/*
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.id;
        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.w4 == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.b2.w4 != null) ? this.a.b2.w4.ch : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.b2.wh(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.b2.w4);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.b2.w4.eo(g.left, f));
            var j = Math.ceil(this.a.b2.w4.eo(g.right, f));
            if (this.a.b2.w4.ch) {
                j = Math.ceil(this.a.b2.w4.eo(g.left, f));
                i = Math.floor(this.a.b2.w4.eo(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.xv = null;
        _this.xt = null;
        _this.xu = null;
        _this.xs = null;
        _this.xw = null;
        _this.x5 = false;
        _this.assigningCategoryStyle = null;
        _this.xd = null;
        _this.yf = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.yg = new Dictionary$2(String_$type, String_$type, 0);
        _this.x4 = false;
        _this.xr = null;
        _this.w8 = null;
        _this.xa = null;
        _this.w6 = null;
        _this.xg = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.x3 = false;
        _this.ys = null;
        _this.yq = null;
        _this.yr = null;
        _this.yp = null;
        _this.yt = null;
        _this.w9 = null;
        _this.w5 = null;
        _this.xb = 0;
        _this.xm = null;
        _this.xo = null;
        _this.xd = new CategorySeriesRenderManager();
        _this.x5 = false;
        _this.xg = new CategoryTransitionSourceFramePreparer();
        _this.w9 = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.xc = 0;
        return _this;
    }
    FinancialSeries.prototype.ht = function () {
        var a = _super.prototype.ht.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.z7));
            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.z5));
            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.z6));
            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.z4));
            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.z8));
            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.ry));
            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.ry));
            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.ry));
            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.ry));
            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.z7 = function (a, b) {
        if (this.zh != null) {
            b.value = this.zh;
            return;
        }
        b.value = this.zu;
    };
    FinancialSeries.prototype.z5 = function (a, b) {
        if (this.zd != null) {
            b.value = this.zd;
            return;
        }
        b.value = this.zl;
    };
    FinancialSeries.prototype.z6 = function (a, b) {
        if (this.zf != null) {
            b.value = this.zf;
            return;
        }
        b.value = this.zq;
    };
    FinancialSeries.prototype.z4 = function (a, b) {
        if (this.zb != null) {
            b.value = this.zb;
            return;
        }
        b.value = this.y8;
    };
    FinancialSeries.prototype.z8 = function (a, b) {
        if (this.zj != null) {
            b.value = this.zj;
            return;
        }
        b.value = this.zy;
    };
    FinancialSeries.prototype.kv = function () {
        if (this.d3()) {
            return this.bn.xa;
        }
        else {
            return this.bn.w6;
        }
    };
    FinancialSeries.prototype.qz = function (a) {
        _super.prototype.qz.call(this, a);
        this.xl = a;
    };
    FinancialSeries.prototype.get_e6 = function () {
        return true;
    };
    FinancialSeries.prototype.ai = function () {
        return [this.w4, this.xn];
    };
    FinancialSeries.prototype.kq = function (a, b) {
        var c = this.nd(b);
        if (c == FinancialSeries.$$p[11]) {
            return this.kr(a, b, this.zu);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.kr(a, b, this.zl);
        }
        if (c == FinancialSeries.$$p[9]) {
            return this.kr(a, b, this.zq);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.kr(a, b, this.y8);
        }
        if (c == FinancialSeries.$$p[13]) {
            return this.kr(a, b, this.zy);
        }
        if (c == FinancialSeries.$$p[5]) {
            return this.kr(a, b, this.zh);
        }
        if (c == FinancialSeries.$$p[3]) {
            return this.kr(a, b, this.zd);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.kr(a, b, this.zf);
        }
        if (c == FinancialSeries.$$p[2]) {
            return this.kr(a, b, this.zb);
        }
        if (c == FinancialSeries.$$p[6]) {
            return this.kr(a, b, this.zj);
        }
        return _super.prototype.kq.call(this, a, b);
    };
    FinancialSeries.prototype.md = function (a) {
        var b = this.nd(a);
        if (b == FinancialSeries.$$p[11]) {
            return this.zu;
        }
        if (b == FinancialSeries.$$p[1]) {
            return this.zl;
        }
        if (b == FinancialSeries.$$p[9]) {
            return this.zq;
        }
        if (b == FinancialSeries.$$p[0]) {
            return this.y8;
        }
        if (b == FinancialSeries.$$p[13]) {
            return this.zy;
        }
        if (b == FinancialSeries.$$p[5]) {
            return this.zh;
        }
        if (b == FinancialSeries.$$p[3]) {
            return this.zd;
        }
        if (b == FinancialSeries.$$p[4]) {
            return this.zf;
        }
        if (b == FinancialSeries.$$p[2]) {
            return this.zb;
        }
        if (b == FinancialSeries.$$p[6]) {
            return this.zj;
        }
        return _super.prototype.md.call(this, a);
    };
    FinancialSeries.prototype.y4 = function () {
        return 2;
    };
    FinancialSeries.prototype.y2 = function () {
        return 4;
    };
    FinancialSeries.prototype.aj = function (a) {
        var b = this.an(this.w4, this.w6.f, this.y1(this.cv), this.y3(this.cv), this.wf(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.y4();
        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.al = function (a) {
        var b = this.an(this.w4, this.w6.f, this.y1(this.cv), this.y3(this.cv), this.wf(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.vu = function () {
        return this.aau;
    };
    FinancialSeries.prototype.vv = function () {
        return this.aau;
    };
    FinancialSeries.prototype.o2 = function () {
        _super.prototype.o2.call(this);
        this.w4 = null;
        this.xn = null;
    };
    FinancialSeries.prototype.get_ek = function () {
        return true;
    };
    FinancialSeries.prototype.get_f5 = function () {
        return this.xn != null && this.xn.ch;
    };
    Object.defineProperty(FinancialSeries.prototype, "x0", {
        get: function () {
            return this.xv;
        },
        set: function (a) {
            if (this.xv != a) {
                var b = this.xv;
                this.xv = a;
                this.raisePropertyChanged("OpenColumn", b, this.xv);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xy", {
        get: function () {
            return this.xt;
        },
        set: function (a) {
            if (this.xt != a) {
                var b = this.xt;
                this.xt = a;
                this.raisePropertyChanged("HighColumn", b, this.xt);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xz", {
        get: function () {
            return this.xu;
        },
        set: function (a) {
            if (this.xu != a) {
                var b = this.xu;
                this.xu = a;
                this.raisePropertyChanged("LowColumn", b, this.xu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "xx", {
        get: function () {
            return this.xs;
        },
        set: function (a) {
            if (this.xs != a) {
                var b = this.xs;
                this.xs = a;
                this.raisePropertyChanged("CloseColumn", b, this.xs);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "x2", {
        get: function () {
            return this.xw;
        },
        set: function (a) {
            if (this.xw != a) {
                var b = this.xw;
                this.xw = a;
                this.raisePropertyChanged("VolumeColumn", b, this.xw);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.gb = function () {
        return this.highlightedItemsSource != null || (this.zh != null && this.zd != null && this.zf != null && this.zb != null);
    };
    FinancialSeries.prototype.yc = function () {
        return (this.assigningCategoryStyle != null && this.x5) || this.bx != 1 || this.cp != 1 || this.co != 1;
    };
    FinancialSeries.prototype.aab = function (a) {
        if (this.assigningCategoryStyle != null && this.x5) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.z9 = function (a, b, c, d, e, f, g) {
        var h = this.bx != 1;
        var i = this.cp != 1;
        var j = this.co != 1;
        this.xd.a3(this.xd.b, d.cn, a, b, c, d, e, f, false, g);
        this.xd.ab(this.ib);
        var k = this.xd.ay;
        var l = null;
        var m = null;
        var n = null;
        var o = this.dn;
        if (h && this.db != null) {
            l = this.db.dl.getHighlightingInfo(this, o, k.z, k.y, false);
            k.c = l;
        }
        if (i && this.db != null) {
            m = this.db.dm.getHighlightingInfo(this, o, k.z, k.y, false);
            if (m == null && this.bn != null) {
                m = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, k.z, k.y, false);
            }
            k.d = m;
        }
        if (j && this.db != null) {
            n = this.db.dk.getHighlightingInfo(this, o, k.z, k.y, false);
            k.b = n;
        }
        k.h = f;
        this.aab(k);
        this.xd.z(this, l, m, n, f, h, i, j, b < 0);
    };
    FinancialSeries.prototype.yu = function (a) {
        return this.it(a, this.w4);
    };
    FinancialSeries.prototype.ka = function (a, b) {
        return this.kb(a, b, this.w4, runOn(this, this.yu), new FinancialValueList(this.x0, this.xy, this.xz, this.xx, this.x2));
    };
    FinancialSeries.prototype.j8 = function (a, b) {
        return this.j9(a, b, this.w4, runOn(this, this.yu), new FinancialValueList(this.x0, this.xy, this.xz, this.xx, this.x2));
    };
    FinancialSeries.prototype.ip = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.w4.lj;
        return this.iq(a, b, this.w4, d, e, f, runOn(this, this.yu));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.w4.getCategorySize(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv));
    };
    FinancialSeries.prototype.wa = function (a, b, c) {
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, null, null, null);
    };
    FinancialSeries.prototype.i5 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(new FinancialValueList(this.x0, this.xy, this.xz, this.xx, this.x2), a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.i1 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(this.xy, a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.i3 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(this.xz, a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.yw = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(this.xx, a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.yx = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(this.x0, a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.yy = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cv);
        var e = this.yv(this.cv.by, this.cv.bx, d);
        var f = new ScalerParams(0, this.cv.by, this.cv.bx, this.w4.ch, d);
        return this.i7(this.x2, a, this.w4, f, e, runOn(this, this.yu), b, c);
    };
    FinancialSeries.prototype.v6 = function (a, b, c) {
        var _this = this;
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, runOn(this, this.i1), function (d, e) { return _this.kb(d, e, _this.w4, runOn(_this, _this.yu), _this.xy); }, function (d, e) { return _this.j9(d, e, _this.w4, runOn(_this, _this.yu), _this.xy); });
    };
    FinancialSeries.prototype.v8 = function (a, b, c) {
        var _this = this;
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, runOn(this, this.i3), function (d, e) { return _this.kb(d, e, _this.w4, runOn(_this, _this.yu), _this.xz); }, function (d, e) { return _this.j9(d, e, _this.w4, runOn(_this, _this.yu), _this.xz); });
    };
    FinancialSeries.prototype.aaw = function (a, b, c) {
        var _this = this;
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, runOn(this, this.yx), function (d, e) { return _this.kb(d, e, _this.w4, runOn(_this, _this.yu), _this.x0); }, function (d, e) { return _this.j9(d, e, _this.w4, runOn(_this, _this.yu), _this.x0); });
    };
    FinancialSeries.prototype.aav = function (a, b, c) {
        var _this = this;
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, runOn(this, this.yw), function (d, e) { return _this.kb(d, e, _this.w4, runOn(_this, _this.yu), _this.xx); }, function (d, e) { return _this.j9(d, e, _this.w4, runOn(_this, _this.yu), _this.xx); });
    };
    FinancialSeries.prototype.aax = function (a, b, c) {
        var _this = this;
        return this.wc(a, b, c, this.yv(this.cv.by, this.cv.bx, this.getEffectiveViewport1(this.cv)), this.xn, this.w4, runOn(this, this.yy), function (d, e) { return _this.kb(d, e, _this.w4, runOn(_this, _this.yu), _this.x2); }, function (d, e) { return _this.j9(d, e, _this.w4, runOn(_this, _this.yu), _this.x2); });
    };
    FinancialSeries.prototype.p9 = function () {
        _super.prototype.p9.call(this);
        if (this.w4 != null) {
            this.w4.ib(false);
        }
        if (this.xn != null) {
            this.xn.ib(false);
        }
    };
    FinancialSeries.prototype.sp = function (a, b) {
        this.xl.b0.e(this.id);
        this.rp(false);
    };
    FinancialSeries.prototype.so = function (a, b) {
        if (this.g1 && this.jq < 0.05) {
            this.g2 = true;
            this.g5 = false;
            this.gk = false;
        }
        this.xl.b0.e(this.id);
        this.rp(false);
    };
    FinancialSeries.prototype.x1 = function (a, b, c) {
        var d = this.dk(b);
        this.yf.addItem(d, b);
        this.yg.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.z3 = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.yf.item(b);
        this.yg.removeItem(c);
        this.yf.removeItem(b);
    };
    FinancialSeries.prototype.q7 = function (a, b, c, d) {
        _super.prototype.q7.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.c3 != null && this.db != null) {
                    this.xl.b0.e(this.id);
                    this.rp(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.w4 != null) {
                        this.w4.b0(this);
                    }
                    if (this.xn != null) {
                        this.xn.b0(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.w4 != null) {
                        this.w4.ct(this);
                    }
                    if (this.xn != null) {
                        this.xn.ct(this);
                    }
                }
                this.xl.b0.e(this.id);
                this.rp(false);
                break;
            case "FastItemsSource":
                this.x4 = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.z3(typeCast(IFastItemsSource_$type, c), this.x0);
                    this.z3(typeCast(IFastItemsSource_$type, c), this.xy);
                    this.z3(typeCast(IFastItemsSource_$type, c), this.xz);
                    this.z3(typeCast(IFastItemsSource_$type, c), this.xx);
                    this.z3(typeCast(IFastItemsSource_$type, c), this.x2);
                    this.x0 = null;
                    this.xy = null;
                    this.xz = null;
                    this.xx = null;
                    this.x2 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.zu) == false) {
                        this.x0 = this.x1(typeCast(IFastItemsSource_$type, d), this.zu, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.zl) == false) {
                        this.xy = this.x1(typeCast(IFastItemsSource_$type, d), this.zl, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.zq) == false) {
                        this.xz = this.x1(typeCast(IFastItemsSource_$type, d), this.zq, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.y8) == false) {
                        this.xx = this.x1(typeCast(IFastItemsSource_$type, d), this.y8, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.zy) == false) {
                        this.x2 = this.x1(typeCast(IFastItemsSource_$type, d), this.zy, "VolumeColumn");
                    }
                }
                this.x4 = false;
                if (this.xn != null && !this.xn.c1()) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && c != null);
                }
                break;
            case FinancialSeries.$$p[11]:
                if (this.dn != null) {
                    this.z3(this.dn, this.x0);
                    this.x0 = this.x1(this.dn, this.zu, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.xn != null && !this.xn.c1() && !this.x4) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && this.d7);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.dn != null) {
                    this.z3(this.dn, this.xy);
                    this.xy = this.x1(this.dn, this.zl, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.xn != null && !this.xn.c1() && !this.x4) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && this.d7);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (this.dn != null) {
                    this.z3(this.dn, this.xz);
                    this.xz = this.x1(this.dn, this.zq, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.xn != null && !this.xn.c1() && !this.x4) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && this.d7);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.dn != null) {
                    this.z3(this.dn, this.xx);
                    this.xx = this.x1(this.dn, this.y8, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.xn != null && !this.xn.c1() && !this.x4) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && this.d7);
                }
                this.aad();
                break;
            case FinancialSeries.$$p[13]:
                if (this.dn != null) {
                    this.z3(this.dn, this.x2);
                    this.x2 = this.x1(this.dn, this.zy, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.xn != null && !this.xn.c1() && !this.x4) {
                    this.xl.b0.e(this.id);
                    this.rp(this.gg && this.d7);
                }
                break;
            case FinancialSeries.$$p[14]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.xl.b0.e(this.id);
                this.rp(false);
                this.qj();
                this.xm = typeCast(ITimeRangeSelectorAxis_$type, this.w4);
                break;
            case FinancialSeries.$$p[15]:
                if (c != null) {
                    c.b0(this);
                }
                if (d != null) {
                    d.ct(this);
                }
                this.xl.b0.e(this.id);
                if (this.xn != null) {
                    this.xn.c1();
                }
                {
                    this.rp(false);
                }
                this.qj();
                break;
            case "TransitionProgress":
                this.xa.c(this.jq, this.w8, this.w6);
                if (this.d5(this.cv)) {
                    return;
                }
                if (this.jq == 1) {
                    this.w6.w();
                    this.aac(this.w6, this.xl);
                    if (this.g1) {
                        this.g1 = false;
                        this.o6();
                        this.dc.r = truncate(this.i9());
                        this.dc.b = this.dd;
                    }
                    if (this.g4) {
                        this.g4 = false;
                        this.o6();
                        this.dc.r = truncate(this.i9());
                        this.dc.b = this.dd;
                        this.qy();
                    }
                    this.qm();
                }
                else {
                    this.aac(this.xa, this.xl);
                }
                if (this.db != null) {
                    this.db.qo(this);
                }
                break;
            case FinancialSeries.$$p[10]:
                this.rp(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.x5 = this.x8();
                this.rp(false);
                break;
            case "CategoryMode":
                if (this.w4 != null) {
                    this.w4.ma(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.x7 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.x6 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.wx = function (a, b, c) {
        if (b < a || a < 0 || a > this.dn.count || b < 0 || b > this.dn.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.dn.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.y1 = function (a) {
        return a.b0.b;
    };
    FinancialSeries.prototype.y3 = function (a) {
        return a.b0.c;
    };
    FinancialSeries.prototype.ww = function (a, b) {
        return this.wx(a, b, this.xn);
    };
    FinancialSeries.prototype.get_fe = function () {
        return true;
    };
    FinancialSeries.prototype.o3 = function () {
        _super.prototype.o3.call(this);
        this.xr = null;
    };
    FinancialSeries.prototype.dg = function (a, b, c) {
        if (this.ed && this.fz(this.bx) && !c) {
            var d = this.xq(a, b, this.xr);
            this.xr = d;
            return d;
        }
        else {
            var e = this.xp(a, b, this.xr);
            this.xr = e;
            return e;
        }
    };
    FinancialSeries.prototype.y5 = function (a) {
        var b = this.w7();
        var c = this.cv.bx;
        var d = this.cv.by;
        var e = this.w4;
        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.xq = function (a, b, c) {
        if (this.dn == null) {
            return null;
        }
        var d = this.dn.count;
        var e = this.xl.b0.c;
        var f = this.xl.b0.d;
        var g = this.xl.b0.b;
        var h = this.w4;
        var i = -1;
        var j = -1;
        if (h.cn) {
            var k = this.w7();
            var l = this.y5(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.j3(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.xp = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dn.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.x8 = function () {
        return this.ya;
    };
    FinancialSeries.prototype.ir = function (a) {
        var b = this.cv.by;
        var c = this.cv.bx;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.w4 != null) {
            var e = this.getEffectiveViewport1(this.cv);
            var f = new ScalerParams(0, b, c, this.w4.ch, e);
            var g = this.wh(this.cv);
            var h = this.w4.eo(g.left, f);
            var i = this.w4.eo(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.w4.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.j3 = function (a) {
        return truncate(Math.round(this.ir(a)));
    };
    FinancialSeries.prototype.get_fs = function () {
        return typeCast(ISortingAxis_$type, this.w4) !== null;
    };
    FinancialSeries.prototype.a0 = function () {
        return this.w4;
    };
    FinancialSeries.prototype.j5 = function (a) {
        var b = this.cv.by;
        var c = this.cv.bx;
        var d = this.getEffectiveViewport1(this.cv);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.w4.ch, d);
        var g = typeCast(ISortingAxis_$type, this.w4);
        var h = this.wh(this.cv);
        var i = h.left;
        var j = h.right;
        var k = this.v5(a).x;
        var l = this.w4.eo(k, f);
        var m = this.w4.eo(i, f);
        var n = this.w4.eo(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.kn = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.w4) !== null) {
            b = this.j5(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.j3(a);
        }
        return b >= 0 && this.dn != null && b < this.dn.count ? this.dn.item(b) : null;
    };
    FinancialSeries.prototype.w7 = function () {
        var a = this.w6;
        if (this.d3()) {
            if (this.dc.g) {
                this.dc.t();
            }
            a = this.xa;
        }
        return a;
    };
    FinancialSeries.prototype.yv = function (a, b, c) {
        if (this.w4 == null) {
            return 0;
        }
        return this.w4.k9(a, b, c, this.index);
    };
    FinancialSeries.prototype.gn = function () {
        return this.yb;
    };
    FinancialSeries.prototype.xe = function () {
        return 11;
    };
    FinancialSeries.prototype.c4 = function () {
        return 3;
    };
    FinancialSeries.prototype.c7 = function () {
        return 3;
    };
    FinancialSeries.prototype.aac = function (a, b) {
        this.qv();
        this.wg = a.ab;
        b.aw();
    };
    FinancialSeries.prototype.aaa = function (a, b) {
        a.v();
    };
    FinancialSeries.prototype.he = function (a, b, c) {
        var d = _super.prototype.he.call(this, a, b, c);
        var e = c;
        if (this.dn == null || this.dn.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.w4 == null || this.xn == null || e.b0.b < 1 || this.w4.bi == null || this.xn.bi == null || this.xn.l4 == this.xn.l3 || this.w4.itemsSource == null || this.w4.lj < 1) {
            e.b0.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.cv.by;
        a = this.cv.bx;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.yz = function (a) {
        var b = 0;
        var c = a.by;
        var d = a.bx;
        var e = this.getEffectiveViewport1(this.cv);
        if (!c.isEmpty && !d.isEmpty && this.xn != null) {
            var f = new ScalerParams(0, c, d, this.xn.ch, e);
            f.b = this.iy();
            b = this.xn.el(this.xn.me, f);
        }
        return b;
    };
    FinancialSeries.prototype.o6 = function () {
        _super.prototype.o6.call(this);
        this.w8.w();
        this.w6.w();
        this.xa.w();
    };
    FinancialSeries.prototype.rq = function (a) {
        var _this = this;
        _super.prototype.rq.call(this, a);
        this.xl.b0.e(this.id);
        if (this.d5(this.cv)) {
            return;
        }
        if (this.gr) {
            if (this.d3()) {
                this.aac(this.xa, this.xl);
            }
            else {
                this.aac(this.w6, this.xl);
            }
            return;
        }
        if (this.gf(a)) {
            var b = this.w8;
            if (this.d3()) {
                if (this.dc.g) {
                    this.dc.t();
                }
                this.w8 = this.xa;
                this.xa = b;
            }
            else {
                this.w8 = this.w6;
                this.w6 = b;
            }
            this.aaa(this.w6, this.xl);
            var c = false;
            if (this.g3) {
                this.dc.w();
                this.dc.r = truncate(this.ja());
                this.dc.b = this.de != null ? this.de : this.dd;
                if (this.g4) {
                    var d = this.xa;
                    this.xa = this.w8;
                    this.w8 = d;
                    c = true;
                }
                this.xg.s(this, this.w8, this.w6, this.isVertical, this.w4, this.xn, this.xf, this.xe(), this.c5, this.c4(), function () { return _this.yz(_this.xl); }, this.xl.bx);
                if (this.g4) {
                    var e = this.xa;
                    this.xa = this.w8;
                    this.w8 = e;
                }
                this.g4 = false;
            }
            if (this.g6) {
                this.dc.w();
                this.dc.r = truncate(this.jb());
                this.dc.b = this.df != null ? this.df : this.dd;
                if (this.g1) {
                    var f = this.xa;
                    this.xa = this.w8;
                    this.w8 = f;
                    c = true;
                }
                this.xg.s(this, this.w8, this.w6, this.isVertical, this.w4, this.xn, this.xf, this.xe(), this.c5, this.c4(), function () { return _this.yz(_this.xl); }, this.xl.bx);
                var g = this.w6;
                this.w6 = this.w8;
                this.w8 = g;
                if (this.g1) {
                    var h = this.xa;
                    this.xa = this.w8;
                    this.w8 = h;
                }
                this.g1 = false;
            }
            this.d9 = false;
            if (!c) {
                this.o1();
            }
            this.r5();
            if (this.g3) {
                this.g2 = false;
                this.g5 = false;
                this.gk = false;
                this.g1 = true;
            }
            if (this.g6) {
                this.g5 = false;
                this.g4 = true;
            }
        }
        else {
            this.aaa(this.w6, this.xl);
            this.aac(this.w6, this.xl);
        }
    };
    FinancialSeries.prototype.go = function () {
        return true;
    };
    FinancialSeries.prototype.yd = 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.xy == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.xz == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.x0 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.xx == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.x2 == 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, "ye", {
        get: function () {
            return this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.x9 = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.z2 = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "ym", {
        get: function () {
            return this.yj();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yj = 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.x9())
                        return [3 /*break*/, 8];
                    b = this.xh(0, this.dn.count);
                    this.z2(new FinancialEventArgs(0, this.dn.count, b, this.xi(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.ye && this.w4.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.dn.count;
                    e = this.w4.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.xy.item(e.item(f)) + this.xz.item(e.item(f)) + this.xx.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.dn.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.xy.item(h) + this.xz.item(h) + this.xx.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yj = function () {
        var _this = this;
        return toEnum(function () { return _this._yj(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "yl", {
        get: function () {
            return this.yi();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yi = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ye && this.w4.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.xy.count;
                    b = this.w4.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.y0(this.xy.item(b.item(0)) - this.xz.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.y0(this.xy.item(b.item(c)) - this.xz.item(b.item(c))), Math.max(this.y0(Math.abs(this.xy.item(b.item(c)) - this.xx.item(b.item(c - 1)))), this.y0(Math.abs(this.xz.item(b.item(c)) - this.xx.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.xy.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.y0(this.xy.item(0) - this.xz.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.y0(this.xy.item(e) - this.xz.item(e)), Math.max(this.y0(Math.abs(this.xy.item(e) - this.xx.item(e - 1))), this.y0(Math.abs(this.xz.item(e) - this.xx.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yi = function () {
        var _this = this;
        return toEnum(function () { return _this._yi(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "yk", {
        get: function () {
            return this.yh();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yh = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ye && this.w4.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.xz.count;
                    b = this.w4.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.y0(this.xz.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.y0(this.xz.item(b.item(c))), this.y0(this.xx.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.xz.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.y0(this.xz.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.y0(this.xz.item(e)), this.y0(this.xx.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yh = function () {
        var _this = this;
        return toEnum(function () { return _this._yh(); });
    };
    FinancialSeries.prototype.yo = function (a) {
        if (a == null) {
            return null;
        }
        if (this.ye && this.w4.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.w4.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.yn = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.dn != null && !this.x3) {
            this.x3 = true;
            var b = this.xh(0, this.dn.count);
            this.x3 = false;
            var c = new FinancialEventArgs(0, this.dn.count, b, this.xi(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.x0 == null) {
            return null;
        }
        if (this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null) {
            if (this.ys != null) {
                return this.ys.asArray();
            }
            var a = new List$1(Number_$type, 2, this.x0.count);
            var b = this.w4.i$b;
            var c = this.x0.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ys = a;
            return this.ys.asArray();
        }
        else {
            return this.x0.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.xy == null) {
            return null;
        }
        if (this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null) {
            if (this.yq != null) {
                return this.yq.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xy.count);
            var b = this.w4.i$b;
            var c = this.xy.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yq = a;
            return this.yq.asArray();
        }
        else {
            return this.xy.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.xz == null) {
            return null;
        }
        if (this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null) {
            if (this.yr != null) {
                return this.yr.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xz.count);
            var b = this.w4.i$b;
            var c = this.xz.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yr = a;
            return this.yr.asArray();
        }
        else {
            return this.xz.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.xx == null) {
            return null;
        }
        if (this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null) {
            if (this.yp != null) {
                return this.yp.asArray();
            }
            var a = new List$1(Number_$type, 2, this.xx.count);
            var b = this.w4.i$b;
            var c = this.xx.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yp = a;
            return this.yp.asArray();
        }
        else {
            return this.xx.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.x2 == null) {
            return null;
        }
        if (this.w4 != null && typeCast(ISortingAxis_$type, this.w4) !== null) {
            if (this.yt != null) {
                return this.yt.asArray();
            }
            var a = new List$1(Number_$type, 2, this.x2.count);
            var b = this.w4.i$b;
            var c = this.x2.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.yt = a;
            return this.yt.asArray();
        }
        else {
            return this.x2.asArray();
        }
    };
    FinancialSeries.prototype.pb = function (a, b, c, d) {
        _super.prototype.pb.call(this, a, b, c, d);
        if (this.w4 == null || !(typeCast(ISortingAxis_$type, this.w4) !== null)) {
            return;
        }
        var e = this.w4.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.ys != null) {
                        this.ys.insert(f, this.x0.item(g));
                    }
                    if (this.yq != null) {
                        this.yq.insert(f, this.xy.item(g));
                    }
                    if (this.yr != null) {
                        this.yr.insert(f, this.xz.item(g));
                    }
                    if (this.yp != null) {
                        this.yp.insert(f, this.xx.item(g));
                    }
                    if (this.yt != null) {
                        this.yt.insert(f, this.x2.item(g));
                    }
                }
                break;
            case 0:
                if (this.ys != null) {
                    this.ys.v(b, c);
                }
                if (this.yq != null) {
                    this.yq.v(b, c);
                }
                if (this.yr != null) {
                    this.yr.v(b, c);
                }
                if (this.yp != null) {
                    this.yp.v(b, c);
                }
                if (this.yt != null) {
                    this.yt.v(b, c);
                }
                break;
            case 4:
                if (this.ys != null) {
                    this.ys = new List$1(Number_$type, 0);
                }
                if (this.yq != null) {
                    this.yq = new List$1(Number_$type, 0);
                }
                if (this.yr != null) {
                    this.yr = new List$1(Number_$type, 0);
                }
                if (this.yp != null) {
                    this.yp = new List$1(Number_$type, 0);
                }
                if (this.yt != null) {
                    this.yt = 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.ys != null) {
                        this.ys._inner[h] = this.x0.item(i);
                    }
                    if (this.yq != null) {
                        this.yq._inner[h] = this.xy.item(i);
                    }
                    if (this.yr != null) {
                        this.yr._inner[h] = this.xz.item(i);
                    }
                    if (this.yp != null) {
                        this.yp._inner[h] = this.xx.item(i);
                    }
                    if (this.yt != null) {
                        this.yt._inner[h] = this.x2.item(i);
                    }
                }
                break;
        }
        this.aad();
        this.sl();
    };
    FinancialSeries.prototype.xh = function (a, b) {
        var _this = this;
        var c = this.yo(this.x0);
        var d = this.yo(this.xx);
        var e = this.yo(this.xy);
        var f = this.yo(this.xz);
        var g = this.yo(this.x2);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.ym), _this.yn());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.yl), ((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.yk), ((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.dn != null ? _this.dn.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.y0 = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.xi = 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.hq;
            $ret.j = Series.hp;
            $ret.i = runOn(_this, _this.y0);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.w4;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.rr = function (a, b) {
        _super.prototype.rr.call(this, a, b);
        if (!this.g0) {
            this.cv.a4(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.cu);
        this.cv.a4(b);
        c.b0.e(this.id);
        if (this.d5(this.cu)) {
            return;
        }
        if (!this.gs) {
            this.aaa(this.w9, c);
        }
        this.gs = false;
        this.aac(this.w9, c);
        this.g0 = false;
    };
    FinancialSeries.prototype.ro = function (a, b, c, d, e) {
        _super.prototype.ro.call(this, a, b, c, d, e);
        var f = this.ba.a$j.item(d);
        var g = f;
        g.b0.e(this.id);
        f.a3(c);
        if (this.d5(g)) {
            return;
        }
        if (this.w5 == null) {
            this.w5 = new CategoryFrame(3);
        }
        this.w5.v();
        this.aaa(this.w5, g);
        this.aac(this.w5, g);
    };
    FinancialSeries.prototype.aw = function (a) {
        if (this.w4 == a) {
            return this.xn;
        }
        if (this.xn == a) {
            return this.w4;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.w4);
        return b != null ? b.preferredCategoryMode(this) : this.xc;
    };
    Object.defineProperty(FinancialSeries.prototype, "xc", {
        get: function () {
            return this.xb;
        },
        set: function (a) {
            var b = this.xc;
            if (a != b) {
                this.xb = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.xc));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_fm = function () {
        return true;
    };
    FinancialSeries.prototype.r1 = function (a, b) {
        _super.prototype.r1.call(this, a, b);
        this.aau = a;
    };
    FinancialSeries.prototype.aad = function () {
        this.im = this.xx == null || this.xx.count == 0 ? NaN : this.xx.item(this.xx.count - 1);
    };
    FinancialSeries.prototype.kp = function (a) {
        if (this.xm != null && a != null) {
            if (this.xo == null || this.xo.propertyName != this.xm.dateTimeMemberPath) {
                this.xo = new FastReflectionHelper(false, this.xm.dateTimeMemberPath);
            }
            var b = this.xo.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.xm.itemLabelFormat());
            }
        }
        return _super.prototype.kp.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:y8:aae', [2, null], 'HighMemberPath:zl:aak', [2, null], 'HighlightedCloseMemberPath:zb:aaf', [2, null], 'HighlightedHighMemberPath:zd:aag', [2, null], 'HighlightedLowMemberPath:zf:aah', [2, null], 'HighlightedOpenMemberPath:zh:aai', [2, null], 'HighlightedVolumeMemberPath:zj:aaj', [2, null], 'IsCustomCategoryStyleAllowed:ya:aal', [0, false], 'IsTransitionInEnabled:yb:aam', [0, false], 'LowMemberPath:zq:aan', [2, null], 'NegativeBrush:aau:aao', [Brush.$, null], 'OpenMemberPath:zu:aap', [2, null], 'TransitionInMode:xf:aaq', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:zy:aar', [2, null], 'XAxis:w4:aas', [CategoryAxisBase.$, null], 'YAxis:xn:aat', [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.w4.ce) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.b2.w4.f2 != null) {
            a += "<span>${item." + this.b2.w4.f2 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.ba.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.zu + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.zl + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.zq + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.y8 + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.b2.zy)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.zy + "}</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.vz = a;
        this.e.jm = 5;
        this.e.jn = 2;
        this.e.jo = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
