/*
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 { 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 "./HighlightingInfo";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { 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
 */
export let FinancialEventArgs = /*@__PURE__*/ (() => {
    class FinancialEventArgs extends EventArgs {
        constructor(a, b, c, d, e) {
            super();
            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;
            }
        }
        get position() {
            return this._position;
        }
        set position(a) {
            this._position = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get dataSource() {
            return this._dataSource;
        }
        set dataSource(a) {
            this._dataSource = a;
        }
        get supportingCalculations() {
            return this._supportingCalculations;
        }
        set supportingCalculations(a) {
            this._supportingCalculations = a;
        }
        get basedOn() {
            return this._basedOn;
        }
        set basedOn(a) {
            this._basedOn = a;
        }
    }
    FinancialEventArgs.$t = /*@__PURE__*/ markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
})();
/**
 * @hidden
 */
export let FinancialBucketCalculator = /*@__PURE__*/ (() => {
    class FinancialBucketCalculator extends Base {
        constructor(a) {
            super();
            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;
        }
        getBucket(a) {
            return null;
        }
        getBucketWithoutUnknowns(a) {
            return this.getBucket(a);
        }
        getErrorBucket(a, b) {
            return NaN;
        }
        getBucketInfo(a, b, c, d) {
            a = this.c;
            b = this.d;
            c = this.b;
            d = this.a.b2.hj;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.by;
            let c = this.a.bx;
            let d = this.a.bx;
            if (this.a.b2 != null) {
                d = this.a.b2.getEffectiveViewport1(this.a);
            }
            if (b.isEmpty || c.isEmpty || this.a.b2.t9 == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.b2.t9 != null) ? this.a.b2.t9.ch : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.b2.to(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.b2.t9);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.b2.t9.em(g.left, f));
                let j = Math.ceil(this.a.b2.t9.em(g.right, f));
                if (this.a.b2.t9.ch) {
                    j = Math.ceil(this.a.b2.t9.em(g.left, f));
                    i = Math.floor(this.a.b2.t9.em(g.right, f));
                }
                let 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;
            }
        }
        cacheValues() {
        }
        unCacheValues() {
        }
    }
    FinancialBucketCalculator.$t = /*@__PURE__*/ markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
})();
/**
 * @hidden
 */
export let FinancialSeries = /*@__PURE__*/ (() => {
    class FinancialSeries extends Series {
        g0() {
            let a = super.g0();
            {
                let b = ((() => {
                    let $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.xc));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $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.xa));
                a.add(c);
            }
            {
                let d = ((() => {
                    let $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.xb));
                a.add(d);
            }
            {
                let e = ((() => {
                    let $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.w9));
                a.add(e);
            }
            {
                let f = ((() => {
                    let $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.xd));
                a.add(f);
            }
            {
                let g = ((() => {
                    let $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.px));
                a.add(g);
            }
            {
                let h = ((() => {
                    let $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.px));
                a.add(h);
            }
            {
                let i = ((() => {
                    let $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.px));
                a.add(i);
            }
            {
                let j = ((() => {
                    let $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.px));
                a.add(j);
            }
            let k = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "IsTransitionInEnabled";
                $ret.x = true;
                $ret.q = true;
                return $ret;
            })());
            a.add(k);
            let l = ((() => {
                let $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;
        }
        xc(a, b) {
            if (this.wm != null) {
                b.value = this.wm;
                return;
            }
            b.value = this.wz;
        }
        xa(a, b) {
            if (this.wi != null) {
                b.value = this.wi;
                return;
            }
            b.value = this.wq;
        }
        xb(a, b) {
            if (this.wk != null) {
                b.value = this.wk;
                return;
            }
            b.value = this.wv;
        }
        w9(a, b) {
            if (this.wg != null) {
                b.value = this.wg;
                return;
            }
            b.value = this.wd;
        }
        xd(a, b) {
            if (this.wo != null) {
                b.value = this.wo;
                return;
            }
            b.value = this.w3;
        }
        jw() {
            if (this.dj()) {
                return this.bi.uf;
            }
            else {
                return this.bi.ub;
            }
        }
        o0(a) {
            super.o0(a);
            this.uq = a;
        }
        get_ek() {
            return true;
        }
        ag() {
            return [this.t9, this.uv];
        }
        ju(a, b) {
            let c = this.lv(b);
            if (c == FinancialSeries.$$p[11]) {
                return this.jv(a, b, this.wz);
            }
            if (c == FinancialSeries.$$p[6]) {
                return this.jv(a, b, this.wq);
            }
            if (c == FinancialSeries.$$p[9]) {
                return this.jv(a, b, this.wv);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.jv(a, b, this.wd);
            }
            if (c == FinancialSeries.$$p[13]) {
                return this.jv(a, b, this.w3);
            }
            return super.ju(a, b);
        }
        v9() {
            return 2;
        }
        v7() {
            return 4;
        }
        ah(a) {
            let b = this.aj(this.t9, this.ub.f, this.v6(this.cj), this.v8(this.cj), this.tm(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let f = new Array(2);
            let g = this.v9();
            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;
        }
        ai(a) {
            let b = this.aj(this.t9, this.ub.f, this.v6(this.cj), this.v8(this.cj), this.tm(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let 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;
        }
        constructor() {
            super();
            this.u0 = null;
            this.uy = null;
            this.uz = null;
            this.ux = null;
            this.u1 = null;
            this.va = false;
            this.assigningCategoryStyle = null;
            this.ui = null;
            this.vk = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.vl = new Dictionary$2(String_$type, String_$type, 0);
            this.u9 = false;
            this.ut = null;
            this.ud = null;
            this.uf = null;
            this.ub = null;
            this.ul = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.u8 = false;
            this.vx = null;
            this.vv = null;
            this.vw = null;
            this.vu = null;
            this.vy = null;
            this.ue = null;
            this.ua = null;
            this.ug = 0;
            this.uu = null;
            this.uw = null;
            this.ui = new CategorySeriesRenderManager();
            this.va = false;
            this.ul = new CategoryTransitionSourceFramePreparer();
            this.ue = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.uh = 0;
        }
        s3() {
            return this.xz;
        }
        s4() {
            return this.xz;
        }
        ng() {
            super.ng();
            this.t9 = null;
            this.uv = null;
        }
        get_dz() {
            return true;
        }
        get_fi() {
            return this.uv != null && this.uv.ch;
        }
        get u5() {
            return this.u0;
        }
        set u5(a) {
            if (this.u0 != a) {
                let b = this.u0;
                this.u0 = a;
                this.raisePropertyChanged("OpenColumn", b, this.u0);
            }
        }
        get u3() {
            return this.uy;
        }
        set u3(a) {
            if (this.uy != a) {
                let b = this.uy;
                this.uy = a;
                this.raisePropertyChanged("HighColumn", b, this.uy);
            }
        }
        get u4() {
            return this.uz;
        }
        set u4(a) {
            if (this.uz != a) {
                let b = this.uz;
                this.uz = a;
                this.raisePropertyChanged("LowColumn", b, this.uz);
            }
        }
        get u2() {
            return this.ux;
        }
        set u2(a) {
            if (this.ux != a) {
                let b = this.ux;
                this.ux = a;
                this.raisePropertyChanged("CloseColumn", b, this.ux);
            }
        }
        get u7() {
            return this.u1;
        }
        set u7(a) {
            if (this.u1 != a) {
                let b = this.u1;
                this.u1 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.u1);
            }
        }
        fn() {
            return this.highlightedItemsSource != null || (this.wm != null && this.wi != null && this.wk != null && this.wg != null);
        }
        vh() {
            return (this.assigningCategoryStyle != null && this.va) || this.bs != 1;
        }
        xg(a) {
            if (this.assigningCategoryStyle != null && this.va) {
                this.assigningCategoryStyle(this, a);
            }
        }
        xe(a, b, c, d, e, f) {
            let g = this.bs != 1;
            this.ui.a3(this.ui.b, d.cn, a, b, c, d, e, f, false);
            this.ui.ab(this.hh);
            let h = this.ui.ay;
            let i = null;
            let j = this.c6;
            if (g && this.cy != null) {
                i = this.cy.a7.getHighlightingInfo(this, j, h.o, h.n, false);
                h.b = i;
            }
            h.f = f;
            this.xg(h);
            this.ui.z(this, i, f, g, b < 0);
        }
        vz(a) {
            return this.hx(a, this.t9);
        }
        jf(a, b) {
            return this.jg(a, b, this.t9, runOn(this, this.vz), new FinancialValueList(this.u5, this.u3, this.u4, this.u2, this.u7));
        }
        jd(a, b) {
            return this.je(a, b, this.t9, runOn(this, this.vz), new FinancialValueList(this.u5, this.u3, this.u4, this.u2, this.u7));
        }
        ht(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.t9.lf;
            return this.hu(a, b, this.t9, d, e, f, runOn(this, this.vz));
        }
        getOffsetValue() {
            return this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj));
        }
        getCategoryWidth() {
            return this.t9.getCategorySize(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj));
        }
        th(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, null, null, null);
        }
        h9(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(new FinancialValueList(this.u5, this.u3, this.u4, this.u2, this.u7), a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        h5(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(this.u3, a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        h7(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(this.u4, a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        v1(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(this.u2, a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        v2(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(this.u5, a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        v3(a, b, c) {
            let d = this.getEffectiveViewport1(this.cj);
            let e = this.v0(this.cj.by, this.cj.bx, d);
            let f = new ScalerParams(0, this.cj.by, this.cj.bx, this.t9.ch, d);
            return this.ib(this.u7, a, this.t9, f, e, runOn(this, this.vz), b, c);
        }
        td(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, runOn(this, this.h5), (d, e) => this.jg(d, e, this.t9, runOn(this, this.vz), this.u3), (d, e) => this.je(d, e, this.t9, runOn(this, this.vz), this.u3));
        }
        tf(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, runOn(this, this.h7), (d, e) => this.jg(d, e, this.t9, runOn(this, this.vz), this.u4), (d, e) => this.je(d, e, this.t9, runOn(this, this.vz), this.u4));
        }
        x1(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, runOn(this, this.v2), (d, e) => this.jg(d, e, this.t9, runOn(this, this.vz), this.u5), (d, e) => this.je(d, e, this.t9, runOn(this, this.vz), this.u5));
        }
        x0(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, runOn(this, this.v1), (d, e) => this.jg(d, e, this.t9, runOn(this, this.vz), this.u2), (d, e) => this.je(d, e, this.t9, runOn(this, this.vz), this.u2));
        }
        x2(a, b, c) {
            return this.tj(a, b, c, this.v0(this.cj.by, this.cj.bx, this.getEffectiveViewport1(this.cj)), this.uv, this.t9, runOn(this, this.v3), (d, e) => this.jg(d, e, this.t9, runOn(this, this.vz), this.u7), (d, e) => this.je(d, e, this.t9, runOn(this, this.vz), this.u7));
        }
        ob() {
            super.ob();
            if (this.t9 != null) {
                this.t9.h8(false);
            }
            if (this.uv != null) {
                this.uv.h8(false);
            }
        }
        qn(a, b) {
            this.uq.b0.e(this.hj);
            this.pp(false);
        }
        qm(a, b) {
            if (this.f9 && this.iv < 0.05) {
                this.ga = true;
                this.gd = false;
                this.ft = false;
            }
            this.uq.b0.e(this.hj);
            this.pp(false);
        }
        u6(a, b, c) {
            let d = this.c3(b);
            this.vk.addItem(d, b);
            this.vl.addItem(b, c);
            return d;
        }
        w8(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.vk.item(b);
            this.vl.removeItem(c);
            this.vk.removeItem(b);
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.cr != null && this.cy != null) {
                        this.uq.b0.e(this.hj);
                        this.pp(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.t9 != null) {
                            this.t9.b0(this);
                        }
                        if (this.uv != null) {
                            this.uv.b0(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.t9 != null) {
                            this.t9.ct(this);
                        }
                        if (this.uv != null) {
                            this.uv.ct(this);
                        }
                    }
                    this.uq.b0.e(this.hj);
                    this.pp(false);
                    break;
                case "FastItemsSource":
                    this.u9 = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.w8(typeCast(IFastItemsSource_$type, c), this.u5);
                        this.w8(typeCast(IFastItemsSource_$type, c), this.u3);
                        this.w8(typeCast(IFastItemsSource_$type, c), this.u4);
                        this.w8(typeCast(IFastItemsSource_$type, c), this.u2);
                        this.w8(typeCast(IFastItemsSource_$type, c), this.u7);
                        this.u5 = null;
                        this.u3 = null;
                        this.u4 = null;
                        this.u2 = null;
                        this.u7 = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.wz) == false) {
                            this.u5 = this.u6(typeCast(IFastItemsSource_$type, d), this.wz, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.wq) == false) {
                            this.u3 = this.u6(typeCast(IFastItemsSource_$type, d), this.wq, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.wv) == false) {
                            this.u4 = this.u6(typeCast(IFastItemsSource_$type, d), this.wv, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.wd) == false) {
                            this.u2 = this.u6(typeCast(IFastItemsSource_$type, d), this.wd, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.w3) == false) {
                            this.u7 = this.u6(typeCast(IFastItemsSource_$type, d), this.w3, "VolumeColumn");
                        }
                    }
                    this.u9 = false;
                    if (this.uv != null && !this.uv.c1()) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && c != null);
                    }
                    break;
                case FinancialSeries.$$p[11]:
                    if (this.c6 != null) {
                        this.w8(this.c6, this.u5);
                        this.u5 = this.u6(this.c6, this.wz, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.uv != null && !this.uv.c1() && !this.u9) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case FinancialSeries.$$p[6]:
                    if (this.c6 != null) {
                        this.w8(this.c6, this.u3);
                        this.u3 = this.u6(this.c6, this.wq, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.uv != null && !this.uv.c1() && !this.u9) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (this.c6 != null) {
                        this.w8(this.c6, this.u4);
                        this.u4 = this.u6(this.c6, this.wv, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.uv != null && !this.uv.c1() && !this.u9) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.c6 != null) {
                        this.w8(this.c6, this.u2);
                        this.u2 = this.u6(this.c6, this.wd, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.uv != null && !this.uv.c1() && !this.u9) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && this.dn);
                    }
                    this.xi();
                    break;
                case FinancialSeries.$$p[13]:
                    if (this.c6 != null) {
                        this.w8(this.c6, this.u7);
                        this.u7 = this.u6(this.c6, this.w3, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.uv != null && !this.uv.c1() && !this.u9) {
                        this.uq.b0.e(this.hj);
                        this.pp(this.fq && this.dn);
                    }
                    break;
                case FinancialSeries.$$p[14]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.uq.b0.e(this.hj);
                    this.pp(false);
                    this.ol();
                    this.uu = typeCast(ITimeRangeSelectorAxis_$type, this.t9);
                    break;
                case FinancialSeries.$$p[15]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.uq.b0.e(this.hj);
                    if (this.uv != null) {
                        this.uv.c1();
                    }
                    {
                        this.pp(false);
                    }
                    this.ol();
                    break;
                case "TransitionProgress":
                    this.uf.c(this.iv, this.ud, this.ub);
                    if (this.dl(this.cj)) {
                        return;
                    }
                    if (this.iv == 1) {
                        this.ub.v();
                        this.xh(this.ub, this.uq);
                        if (this.f9) {
                            this.f9 = false;
                            this.nk();
                            this.cz.r = truncate(this.id());
                            this.cz.b = this.c0;
                        }
                    }
                    else {
                        this.xh(this.uf, this.uq);
                    }
                    if (this.cy != null) {
                        this.cy.on(this);
                    }
                    break;
                case FinancialSeries.$$p[10]:
                    this.pp(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.va = this.vd();
                    this.pp(false);
                    break;
                case "CategoryMode":
                    if (this.t9 != null) {
                        this.t9.l5(true);
                    }
                    break;
            }
        }
        vc(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        vb(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        t2(a, b, c) {
            if (b < a || a < 0 || a > this.c6.count || b < 0 || b > this.c6.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cn;
            let f = null;
            if (e) {
                f = c.i$b;
            }
            for (let g = a; g <= b; g++) {
                let h = g;
                if (e) {
                    h = f._inner[h];
                }
                d[g - a] = this.c6.item(g);
            }
            return d;
        }
        v6(a) {
            return a.b0.b;
        }
        v8(a) {
            return a.b0.c;
        }
        t1(a, b) {
            return this.t2(a, b, this.uv);
        }
        get_es() {
            return true;
        }
        nh() {
            super.nh();
            this.ut = null;
        }
        ax(a, b, c) {
            if (this.du && this.fc(this.bs) && !c) {
                let d = this.us(a, b, this.ut);
                this.ut = d;
                return d;
            }
            else {
                let e = this.ur(a, b, this.ut);
                this.ut = e;
                return e;
            }
        }
        wa(a) {
            let b = this.uc();
            let c = this.cj.bx;
            let d = this.cj.by;
            let e = this.t9;
            let f = 0;
            if (e.cp) {
                let g = (a.y - d.top) / d.height;
                f = g * c.height + c.top;
            }
            else {
                let h = (a.x - d.left) / d.width;
                f = h * c.width + c.left;
            }
            let i = b.f.count;
            let j = 0;
            for (j = 0; j < i; j++) {
                let k = b.f._inner[j];
                let 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;
        }
        us(a, b, c) {
            let d = this.c6.count;
            let e = this.uq.b0.c;
            let f = this.uq.b0.d;
            let g = this.uq.b0.b;
            let h = this.t9;
            let i = -1;
            let j = -1;
            if (h.cn) {
                let k = this.uc();
                let l = this.wa(b);
                i = l;
                j = l;
            }
            else {
                let m = this.i8(b);
                i = truncate(Math.floor((intDivide(m, g)))) * g;
                j = i + (g - 1);
            }
            if (c != null && c.h == i && c.g == j) {
                return c;
            }
            let n = new HighlightingInfo();
            n.b = this;
            n.h = i;
            n.g = j;
            return n;
        }
        ur(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.c6.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        vd() {
            return this.vf;
        }
        hv(a) {
            let b = this.cj.by;
            let c = this.cj.bx;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.t9 != null) {
                let e = this.getEffectiveViewport1(this.cj);
                let f = new ScalerParams(0, b, c, this.t9.ch, e);
                let g = this.to(this.cj);
                let h = this.t9.em(g.left, f);
                let i = this.t9.em(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.t9.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        i8(a) {
            return truncate(Math.round(this.hv(a)));
        }
        get_e5() {
            return typeCast(ISortingAxis_$type, this.t9) !== null;
        }
        as() {
            return this.t9;
        }
        ja(a) {
            let b = this.cj.by;
            let c = this.cj.bx;
            let d = this.getEffectiveViewport1(this.cj);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.t9.ch, d);
            let g = typeCast(ISortingAxis_$type, this.t9);
            let h = this.to(this.cj);
            let i = h.left;
            let j = h.right;
            let k = this.tc(a).x;
            let l = this.t9.em(k, f);
            let m = this.t9.em(i, f);
            let n = this.t9.em(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        jr(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.t9) !== null) {
                b = this.ja(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.i8(a);
            }
            return b >= 0 && this.c6 != null && b < this.c6.count ? this.c6.item(b) : null;
        }
        uc() {
            let a = this.ub;
            if (this.dj()) {
                if (this.cz.g) {
                    this.cz.t();
                }
                a = this.uf;
            }
            return a;
        }
        v0(a, b, c) {
            if (this.t9 == null) {
                return 0;
            }
            return this.t9.k5(a, b, c, this.index);
        }
        fw() {
            return this.vg;
        }
        uj() {
            return 11;
        }
        cs() {
            return 3;
        }
        cu() {
            return 3;
        }
        xh(a, b) {
            this.ow();
            this.tn = a.aa;
            b.aw();
        }
        xf(a, b) {
            a.u();
        }
        gl(a, b, c) {
            let d = super.gl(a, b, c);
            let e = c;
            if (this.c6 == null || this.c6.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.t9 == null || this.uv == null || e.b0.b < 1 || this.t9.bi == null || this.uv.bi == null || this.uv.lx == this.uv.lw || this.t9.itemsSource == null || this.t9.lf < 1) {
                e.b0.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.cj.by;
            a = this.cj.bx;
            return {
                p0: a,
                p1: b
            };
        }
        v4(a) {
            let b = 0;
            let c = a.by;
            let d = a.bx;
            let e = this.getEffectiveViewport1(this.cj);
            if (!c.isEmpty && !d.isEmpty && this.uv != null) {
                let f = new ScalerParams(0, c, d, this.uv.ch, e);
                f.b = this.h2();
                b = this.uv.ej(this.uv.l7, f);
            }
            return b;
        }
        nk() {
            super.nk();
            this.ud.v();
            this.ub.v();
            this.uf.v();
        }
        pq(a) {
            super.pq(a);
            this.uq.b0.e(this.hj);
            if (this.dl(this.cj)) {
                return;
            }
            if (this.f0) {
                if (this.dj()) {
                    this.xh(this.uf, this.uq);
                }
                else {
                    this.xh(this.ub, this.uq);
                }
                return;
            }
            if (this.fp(a)) {
                let b = this.ud;
                if (this.dj()) {
                    if (this.cz.g) {
                        this.cz.t();
                    }
                    this.ud = this.uf;
                    this.uf = b;
                }
                else {
                    this.ud = this.ub;
                    this.ub = b;
                }
                this.xf(this.ub, this.uq);
                let c = false;
                if (this.gb) {
                    this.cz.w();
                    this.cz.r = truncate(this.ie());
                    this.cz.b = this.c1 != null ? this.c1 : this.c0;
                    if (this.gc) {
                        let d = this.uf;
                        this.uf = this.ud;
                        this.ud = d;
                        c = true;
                    }
                    this.ul.s(this, this.ud, this.ub, this.isVertical, this.t9, this.uv, this.uk, this.uj(), this.ct, this.cs(), () => this.v4(this.uq), this.uq.bx);
                    if (this.gc) {
                        let e = this.uf;
                        this.uf = this.ud;
                        this.ud = e;
                    }
                    this.gc = false;
                }
                if (this.ge) {
                    this.cz.w();
                    this.cz.r = truncate(this.ig());
                    this.cz.b = this.c2 != null ? this.c2 : this.c0;
                    if (this.f9) {
                        let f = this.uf;
                        this.uf = this.ud;
                        this.ud = f;
                        c = true;
                    }
                    this.ul.s(this, this.ud, this.ub, this.isVertical, this.t9, this.uv, this.uk, this.uj(), this.ct, this.cs(), () => this.v4(this.uq), this.uq.bx);
                    let g = this.ub;
                    this.ub = this.ud;
                    this.ud = g;
                    if (this.f9) {
                        let h = this.uf;
                        this.uf = this.ud;
                        this.ud = h;
                    }
                    this.f9 = false;
                }
                this.dq = false;
                if (!c) {
                    this.nf();
                }
                this.p3();
                if (this.gb) {
                    this.ga = false;
                    this.gd = false;
                    this.ft = false;
                    this.f9 = true;
                }
                if (this.ge) {
                    this.gd = false;
                    this.gc = true;
                }
            }
            else {
                this.xf(this.ub, this.uq);
                this.xh(this.ub, this.uq);
            }
        }
        fx() {
            return true;
        }
        vi(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.u3 == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.u4 == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.u5 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.u2 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.u7 == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get vj() {
            return this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null;
        }
        ve() {
            return this.typical != null;
        }
        w7(a) {
            this.typical(this, a);
        }
        get vr() {
            return this.vo();
        }
        *_vo() {
            let a = false;
            if (this.ve()) {
                let b = this.um(0, this.c6.count);
                this.w7(new FinancialEventArgs(0, this.c6.count, b, this.un(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.vj && this.t9.i$b != null) {
                    let d = this.c6.count;
                    let e = this.t9.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.u3.item(e.item(f)) + this.u4.item(e.item(f)) + this.u2.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.c6.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.u3.item(h) + this.u4.item(h) + this.u2.item(h)) / 3;
                    }
                }
            }
        }
        vo() {
            return toEnum(() => this._vo());
        }
        get vq() {
            return this.vn();
        }
        *_vn() {
            if (this.vj && this.t9.i$b != null) {
                let a = this.u3.count;
                let b = this.t9.i$b;
                if (a > 0) {
                    yield this.v5(this.u3.item(b.item(0)) - this.u4.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.v5(this.u3.item(b.item(c)) - this.u4.item(b.item(c))), Math.max(this.v5(Math.abs(this.u3.item(b.item(c)) - this.u2.item(b.item(c - 1)))), this.v5(Math.abs(this.u4.item(b.item(c)) - this.u2.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.u3.count;
                if (d > 0) {
                    yield this.v5(this.u3.item(0) - this.u4.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.v5(this.u3.item(e) - this.u4.item(e)), Math.max(this.v5(Math.abs(this.u3.item(e) - this.u2.item(e - 1))), this.v5(Math.abs(this.u4.item(e) - this.u2.item(e - 1)))));
                }
            }
        }
        vn() {
            return toEnum(() => this._vn());
        }
        get vp() {
            return this.vm();
        }
        *_vm() {
            if (this.vj && this.t9.i$b != null) {
                let a = this.u4.count;
                let b = this.t9.i$b;
                if (a > 0) {
                    yield this.v5(this.u4.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.v5(this.u4.item(b.item(c))), this.v5(this.u2.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.u4.count;
                if (d > 0) {
                    yield this.v5(this.u4.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.v5(this.u4.item(e)), this.v5(this.u2.item(e - 1)));
                }
            }
        }
        vm() {
            return toEnum(() => this._vm());
        }
        vt(a) {
            if (a == null) {
                return null;
            }
            if (this.vj && this.t9.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.t9.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        vs() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.c6 != null && !this.u8) {
                this.u8 = true;
                let b = this.um(0, this.c6.count);
                this.u8 = false;
                let c = new FinancialEventArgs(0, this.c6.count, b, this.un(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.u5 == null) {
                return null;
            }
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                if (this.vx != null) {
                    return this.vx.asArray();
                }
                let a = new List$1(Number_$type, 2, this.u5.count);
                let b = this.t9.i$b;
                let c = this.u5.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.vx = a;
                return this.vx.asArray();
            }
            else {
                return this.u5.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.u3 == null) {
                return null;
            }
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                if (this.vv != null) {
                    return this.vv.asArray();
                }
                let a = new List$1(Number_$type, 2, this.u3.count);
                let b = this.t9.i$b;
                let c = this.u3.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.vv = a;
                return this.vv.asArray();
            }
            else {
                return this.u3.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.u4 == null) {
                return null;
            }
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                if (this.vw != null) {
                    return this.vw.asArray();
                }
                let a = new List$1(Number_$type, 2, this.u4.count);
                let b = this.t9.i$b;
                let c = this.u4.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.vw = a;
                return this.vw.asArray();
            }
            else {
                return this.u4.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.u2 == null) {
                return null;
            }
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                if (this.vu != null) {
                    return this.vu.asArray();
                }
                let a = new List$1(Number_$type, 2, this.u2.count);
                let b = this.t9.i$b;
                let c = this.u2.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.vu = a;
                return this.vu.asArray();
            }
            else {
                return this.u2.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.u7 == null) {
                return null;
            }
            if (this.t9 != null && typeCast(ISortingAxis_$type, this.t9) !== null) {
                if (this.vy != null) {
                    return this.vy.asArray();
                }
                let a = new List$1(Number_$type, 2, this.u7.count);
                let b = this.t9.i$b;
                let c = this.u7.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.vy = a;
                return this.vy.asArray();
            }
            else {
                return this.u7.asArray();
            }
        }
        no(a, b, c, d) {
            super.no(a, b, c, d);
            if (this.t9 == null || !(typeCast(ISortingAxis_$type, this.t9) !== null)) {
                return;
            }
            let e = this.t9.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.vx != null) {
                            this.vx.insert(f, this.u5.item(g));
                        }
                        if (this.vv != null) {
                            this.vv.insert(f, this.u3.item(g));
                        }
                        if (this.vw != null) {
                            this.vw.insert(f, this.u4.item(g));
                        }
                        if (this.vu != null) {
                            this.vu.insert(f, this.u2.item(g));
                        }
                        if (this.vy != null) {
                            this.vy.insert(f, this.u7.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.vx != null) {
                        this.vx.v(b, c);
                    }
                    if (this.vv != null) {
                        this.vv.v(b, c);
                    }
                    if (this.vw != null) {
                        this.vw.v(b, c);
                    }
                    if (this.vu != null) {
                        this.vu.v(b, c);
                    }
                    if (this.vy != null) {
                        this.vy.v(b, c);
                    }
                    break;
                case 4:
                    if (this.vx != null) {
                        this.vx = new List$1(Number_$type, 0);
                    }
                    if (this.vv != null) {
                        this.vv = new List$1(Number_$type, 0);
                    }
                    if (this.vw != null) {
                        this.vw = new List$1(Number_$type, 0);
                    }
                    if (this.vu != null) {
                        this.vu = new List$1(Number_$type, 0);
                    }
                    if (this.vy != null) {
                        this.vy = new List$1(Number_$type, 0);
                    }
                    break;
                case 3:
                case 2:
                    for (let h = b; h < c; h++) {
                        let i = e._inner[h];
                        if (this.vx != null) {
                            this.vx._inner[h] = this.u5.item(i);
                        }
                        if (this.vv != null) {
                            this.vv._inner[h] = this.u3.item(i);
                        }
                        if (this.vw != null) {
                            this.vw._inner[h] = this.u4.item(i);
                        }
                        if (this.vu != null) {
                            this.vu._inner[h] = this.u2.item(i);
                        }
                        if (this.vy != null) {
                            this.vy._inner[h] = this.u7.item(i);
                        }
                    }
                    break;
            }
            this.xi();
            this.qj();
        }
        um(a, b) {
            let c = this.vt(this.u5);
            let d = this.vt(this.u2);
            let e = this.vt(this.u3);
            let f = this.vt(this.u4);
            let g = this.vt(this.u7);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.vr), this.vs());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.vq), ((() => {
                    let $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.vp), ((() => {
                    let $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.c6 != null ? this.c6.count : 0;
                return $ret;
            })());
            return h;
        }
        v5(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        un(a) {
            return ((() => {
                let $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, (b) => TrendCalculators.b(b.volumeColumn, b.shortPeriod), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("VolumeColumn");
                    return $ret;
                })()));
                $ret.f = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.longPeriod), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("VolumeColumn");
                    return $ret;
                })()));
                $ret.g = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.shortPeriod), a.typicalColumn.basedOn);
                $ret.e = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.longPeriod), a.typicalColumn.basedOn);
                $ret.k = Series.gx;
                $ret.j = Series.gw;
                $ret.i = runOn(this, this.v5);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.t9;
        }
        pr(a, b) {
            super.pr(a, b);
            if (!this.f8) {
                this.cj.a4(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.ci);
            this.cj.a4(b);
            c.b0.e(this.hj);
            if (this.dl(this.ci)) {
                return;
            }
            if (!this.f1) {
                this.xf(this.ue, c);
            }
            this.f1 = false;
            this.xh(this.ue, c);
            this.f8 = false;
        }
        po(a, b, c, d, e) {
            super.po(a, b, c, d, e);
            let f = this.a7.a$h.item(d);
            let g = f;
            g.b0.e(this.hj);
            f.a3(c);
            if (this.dl(g)) {
                return;
            }
            if (this.ua == null) {
                this.ua = new CategoryFrame(3);
            }
            this.ua.u();
            this.xf(this.ua, g);
            this.xh(this.ua, g);
        }
        ao(a) {
            if (this.t9 == a) {
                return this.uv;
            }
            if (this.uv == a) {
                return this.t9;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.t9);
            return b != null ? b.preferredCategoryMode(this) : this.uh;
        }
        get uh() {
            return this.ug;
        }
        set uh(a) {
            let b = this.uh;
            if (a != b) {
                this.ug = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.uh));
            }
        }
        get_ez() {
            return true;
        }
        pz(a, b) {
            super.pz(a, b);
            this.xz = a;
        }
        xi() {
            this.hr = this.u2 == null || this.u2.count == 0 ? NaN : this.u2.item(this.u2.count - 1);
        }
        jt(a) {
            if (this.uu != null && a != null) {
                if (this.uw == null || this.uw.propertyName != this.uu.dateTimeMemberPath) {
                    this.uw = new FastReflectionHelper(false, this.uu.dateTimeMemberPath);
                }
                let b = this.uw.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.uu.itemLabelFormat());
                }
            }
            return super.jt(a);
        }
    }
    FinancialSeries.$t = /*@__PURE__*/ markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:wd:xj', [2, null], 'HighlightedCloseMemberPath:wg:xk', [2, null], 'HighlightedHighMemberPath:wi:xl', [2, null], 'HighlightedLowMemberPath:wk:xm', [2, null], 'HighlightedOpenMemberPath:wm:xn', [2, null], 'HighlightedVolumeMemberPath:wo:xo', [2, null], 'HighMemberPath:wq:xp', [2, null], 'IsCustomCategoryStyleAllowed:vf:xq', [0, false], 'IsTransitionInEnabled:vg:xr', [0, false], 'LowMemberPath:wv:xs', [2, null], 'NegativeBrush:xz:xt', [Brush.$, null], 'OpenMemberPath:wz:xu', [2, null], 'TransitionInMode:uk:xv', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:w3:xw', [2, null], 'XAxis:t9:xx', [CategoryAxisBase.$, null], 'YAxis:uv:xy', [NumericYAxis.$, null]]);
    return FinancialSeries;
})();
/**
 * @hidden
 */
export let FinancialCalculationSupportingCalculations = /*@__PURE__*/ (() => {
    class FinancialCalculationSupportingCalculations extends Base {
        constructor() {
            super(...arguments);
            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;
        }
    }
    FinancialCalculationSupportingCalculations.$t = /*@__PURE__*/ markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
})();
/**
 * @hidden
 */
export let DataSourceSupportingCalculation = /*@__PURE__*/ (() => {
    class DataSourceSupportingCalculation extends SupportingCalculation$1 {
        constructor(a, ..._rest) {
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0:
                    {
                        let c = _rest[0];
                        super(Delegate_$type, 0, c);
                    }
                    break;
                case 1:
                    {
                        let c = _rest[0];
                        let d = _rest[1];
                        super(Delegate_$type, 1, c, d);
                    }
                    break;
            }
        }
    }
    DataSourceSupportingCalculation.$t = /*@__PURE__*/ markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', /*@__PURE__*/ SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
})();
/**
 * @hidden
 */
export let FinancialCalculationDataSource = /*@__PURE__*/ (() => {
    class FinancialCalculationDataSource extends Base {
        constructor() {
            super(...arguments);
            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;
        }
        get openColumn() {
            return this._openColumn;
        }
        set openColumn(a) {
            this._openColumn = a;
        }
        get closeColumn() {
            return this._closeColumn;
        }
        set closeColumn(a) {
            this._closeColumn = a;
        }
        get highColumn() {
            return this._highColumn;
        }
        set highColumn(a) {
            this._highColumn = a;
        }
        get lowColumn() {
            return this._lowColumn;
        }
        set lowColumn(a) {
            this._lowColumn = a;
        }
        get volumeColumn() {
            return this._volumeColumn;
        }
        set volumeColumn(a) {
            this._volumeColumn = a;
        }
        get indicatorColumn() {
            return this._indicatorColumn;
        }
        set indicatorColumn(a) {
            this._indicatorColumn = a;
        }
        get typicalColumn() {
            return this._typicalColumn;
        }
        set typicalColumn(a) {
            this._typicalColumn = a;
        }
        get trueRange() {
            return this._trueRange;
        }
        set trueRange(a) {
            this._trueRange = a;
        }
        get trueLow() {
            return this._trueLow;
        }
        set trueLow(a) {
            this._trueLow = a;
        }
        get period() {
            return this._period;
        }
        set period(a) {
            this._period = a;
        }
        get shortPeriod() {
            return this._shortPeriod;
        }
        set shortPeriod(a) {
            this._shortPeriod = a;
        }
        get longPeriod() {
            return this._longPeriod;
        }
        set longPeriod(a) {
            this._longPeriod = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get calculateFrom() {
            return this._calculateFrom;
        }
        set calculateFrom(a) {
            this._calculateFrom = a;
        }
        get calculateCount() {
            return this._calculateCount;
        }
        set calculateCount(a) {
            this._calculateCount = a;
        }
        get multiplier() {
            return this._multiplier;
        }
        set multiplier(a) {
            this._multiplier = a;
        }
        get minimumValue() {
            return this._minimumValue;
        }
        set minimumValue(a) {
            this._minimumValue = a;
        }
        get maximumValue() {
            return this._maximumValue;
        }
        set maximumValue(a) {
            this._maximumValue = a;
        }
        get specifiesRange() {
            return this._specifiesRange;
        }
        set specifiesRange(a) {
            this._specifiesRange = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
    }
    FinancialCalculationDataSource.$t = /*@__PURE__*/ markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
})();
/**
 * @hidden
 */
export let FinancialSeriesView = /*@__PURE__*/ (() => {
    class FinancialSeriesView extends SeriesView {
        b3(a) {
            if (this.b4 != a.t) {
                return true;
            }
            return false;
        }
        b5(a) {
            this.b4 = a.t;
        }
        constructor(a) {
            super(a);
            this.b2 = null;
            this.b0 = null;
            this.b4 = 0;
            this.b4 = -1;
            this.b2 = a;
            this.b0 = this.b1();
        }
        au() {
            super.au();
            if (!this.q) {
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.b2.t9.ce) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.b2.t9.f0 != null) {
                a += "<span>${item." + this.b2.t9.f0 + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a7.a$r(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            let c = new SRProvider(this.w);
            let d = c.b1("financialSeries_Open");
            let e = c.b1("financialSeries_High");
            let f = c.b1("financialSeries_Low");
            let 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.wz + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.wq + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.wv + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.wd + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.b2.w3)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.w3 + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.s6 = a;
            this.e.ir = 5;
            this.e.is = 2;
            this.e.it = 2;
        }
    }
    FinancialSeriesView.$t = /*@__PURE__*/ markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
