/*
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 "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
 */
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.ib;
            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.wy == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.b2.wy != null) ? this.a.b2.wy.ch : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.b2.wd(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.b2.wy);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.b2.wy.en(g.left, f));
                let j = Math.ceil(this.a.b2.wy.en(g.right, f));
                if (this.a.b2.wy.ch) {
                    j = Math.ceil(this.a.b2.wy.en(g.left, f));
                    i = Math.floor(this.a.b2.wy.en(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 {
        hr() {
            let a = super.hr();
            {
                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.z1));
                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.zz));
                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.z0));
                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.zy));
                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.z2));
                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.rv));
                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.rv));
                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.rv));
                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.rv));
                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;
        }
        z1(a, b) {
            if (this.zb != null) {
                b.value = this.zb;
                return;
            }
            b.value = this.zo;
        }
        zz(a, b) {
            if (this.y7 != null) {
                b.value = this.y7;
                return;
            }
            b.value = this.zf;
        }
        z0(a, b) {
            if (this.y9 != null) {
                b.value = this.y9;
                return;
            }
            b.value = this.zk;
        }
        zy(a, b) {
            if (this.y5 != null) {
                b.value = this.y5;
                return;
            }
            b.value = this.y2;
        }
        z2(a, b) {
            if (this.zd != null) {
                b.value = this.zd;
                return;
            }
            b.value = this.zs;
        }
        kt() {
            if (this.d1()) {
                return this.bl.w4;
            }
            else {
                return this.bl.w0;
            }
        }
        qx(a) {
            super.qx(a);
            this.xf = a;
        }
        get_e4() {
            return true;
        }
        ai() {
            return [this.wy, this.xh];
        }
        ko(a, b) {
            let c = this.nb(b);
            if (c == FinancialSeries.$$p[11]) {
                return this.kp(a, b, this.zo);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.kp(a, b, this.zf);
            }
            if (c == FinancialSeries.$$p[9]) {
                return this.kp(a, b, this.zk);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.kp(a, b, this.y2);
            }
            if (c == FinancialSeries.$$p[13]) {
                return this.kp(a, b, this.zs);
            }
            if (c == FinancialSeries.$$p[5]) {
                return this.kp(a, b, this.zb);
            }
            if (c == FinancialSeries.$$p[3]) {
                return this.kp(a, b, this.y7);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.kp(a, b, this.y9);
            }
            if (c == FinancialSeries.$$p[2]) {
                return this.kp(a, b, this.y5);
            }
            if (c == FinancialSeries.$$p[6]) {
                return this.kp(a, b, this.zd);
            }
            return super.ko(a, b);
        }
        mb(a) {
            let b = this.nb(a);
            if (b == FinancialSeries.$$p[11]) {
                return this.zo;
            }
            if (b == FinancialSeries.$$p[1]) {
                return this.zf;
            }
            if (b == FinancialSeries.$$p[9]) {
                return this.zk;
            }
            if (b == FinancialSeries.$$p[0]) {
                return this.y2;
            }
            if (b == FinancialSeries.$$p[13]) {
                return this.zs;
            }
            if (b == FinancialSeries.$$p[5]) {
                return this.zb;
            }
            if (b == FinancialSeries.$$p[3]) {
                return this.y7;
            }
            if (b == FinancialSeries.$$p[4]) {
                return this.y9;
            }
            if (b == FinancialSeries.$$p[2]) {
                return this.y5;
            }
            if (b == FinancialSeries.$$p[6]) {
                return this.zd;
            }
            return super.mb(a);
        }
        yy() {
            return 2;
        }
        yw() {
            return 4;
        }
        aj(a) {
            let b = this.am(this.wy, this.w0.f, this.yv(this.ct), this.yx(this.ct), this.wb(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.yy();
            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;
        }
        ak(a) {
            let b = this.am(this.wy, this.w0.f, this.yv(this.ct), this.yx(this.ct), this.wb(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.xp = null;
            this.xn = null;
            this.xo = null;
            this.xm = null;
            this.xq = null;
            this.xz = false;
            this.assigningCategoryStyle = null;
            this.w7 = null;
            this.x9 = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.ya = new Dictionary$2(String_$type, String_$type, 0);
            this.xy = false;
            this.xl = null;
            this.w2 = null;
            this.w4 = null;
            this.w0 = null;
            this.xa = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.xx = false;
            this.ym = null;
            this.yk = null;
            this.yl = null;
            this.yj = null;
            this.yn = null;
            this.w3 = null;
            this.wz = null;
            this.w5 = 0;
            this.xg = null;
            this.xi = null;
            this.w7 = new CategorySeriesRenderManager();
            this.xz = false;
            this.xa = new CategoryTransitionSourceFramePreparer();
            this.w3 = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.w6 = 0;
        }
        vq() {
            return this.aao;
        }
        vr() {
            return this.aao;
        }
        o0() {
            super.o0();
            this.wy = null;
            this.xh = null;
        }
        get_ei() {
            return true;
        }
        get_f3() {
            return this.xh != null && this.xh.ch;
        }
        get xu() {
            return this.xp;
        }
        set xu(a) {
            if (this.xp != a) {
                let b = this.xp;
                this.xp = a;
                this.raisePropertyChanged("OpenColumn", b, this.xp);
            }
        }
        get xs() {
            return this.xn;
        }
        set xs(a) {
            if (this.xn != a) {
                let b = this.xn;
                this.xn = a;
                this.raisePropertyChanged("HighColumn", b, this.xn);
            }
        }
        get xt() {
            return this.xo;
        }
        set xt(a) {
            if (this.xo != a) {
                let b = this.xo;
                this.xo = a;
                this.raisePropertyChanged("LowColumn", b, this.xo);
            }
        }
        get xr() {
            return this.xm;
        }
        set xr(a) {
            if (this.xm != a) {
                let b = this.xm;
                this.xm = a;
                this.raisePropertyChanged("CloseColumn", b, this.xm);
            }
        }
        get xw() {
            return this.xq;
        }
        set xw(a) {
            if (this.xq != a) {
                let b = this.xq;
                this.xq = a;
                this.raisePropertyChanged("VolumeColumn", b, this.xq);
            }
        }
        f9() {
            return this.highlightedItemsSource != null || (this.zb != null && this.y7 != null && this.y9 != null && this.y5 != null);
        }
        x6() {
            return (this.assigningCategoryStyle != null && this.xz) || this.bv != 1 || this.cn != 1 || this.cm != 1;
        }
        z5(a) {
            if (this.assigningCategoryStyle != null && this.xz) {
                this.assigningCategoryStyle(this, a);
            }
        }
        z3(a, b, c, d, e, f, g) {
            let h = this.bv != 1;
            let i = this.cn != 1;
            let j = this.cm != 1;
            this.w7.a3(this.w7.b, d.cn, a, b, c, d, e, f, false, g);
            this.w7.ab(this.h9);
            let k = this.w7.ay;
            let l = null;
            let m = null;
            let n = null;
            let o = this.dl;
            if (h && this.c9 != null) {
                l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, false);
                k.c = l;
            }
            if (i && this.c9 != null) {
                m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, false);
                if (m == null && this.bl != null) {
                    m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, false);
                }
                k.d = m;
            }
            if (j && this.c9 != null) {
                n = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, false);
                k.b = n;
            }
            k.h = f;
            this.z5(k);
            this.w7.z(this, l, m, n, f, h, i, j, b < 0);
        }
        yo(a) {
            return this.ir(a, this.wy);
        }
        j8(a, b) {
            return this.j9(a, b, this.wy, runOn(this, this.yo), new FinancialValueList(this.xu, this.xs, this.xt, this.xr, this.xw));
        }
        j6(a, b) {
            return this.j7(a, b, this.wy, runOn(this, this.yo), new FinancialValueList(this.xu, this.xs, this.xt, this.xr, this.xw));
        }
        im(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.wy.lg;
            return this.io(a, b, this.wy, d, e, f, runOn(this, this.yo));
        }
        getOffsetValue() {
            return this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        getCategoryWidth() {
            return this.wy.getCategorySize(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        v6(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, null, null, null);
        }
        i3(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(new FinancialValueList(this.xu, this.xs, this.xt, this.xr, this.xw), a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        iz(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(this.xs, a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        i1(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(this.xt, a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        yq(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(this.xr, a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        yr(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(this.xu, a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        ys(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yp(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wy.ch, d);
            return this.i5(this.xw, a, this.wy, f, e, runOn(this, this.yo), b, c);
        }
        v2(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, runOn(this, this.iz), (d, e) => this.j9(d, e, this.wy, runOn(this, this.yo), this.xs), (d, e) => this.j7(d, e, this.wy, runOn(this, this.yo), this.xs));
        }
        v4(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, runOn(this, this.i1), (d, e) => this.j9(d, e, this.wy, runOn(this, this.yo), this.xt), (d, e) => this.j7(d, e, this.wy, runOn(this, this.yo), this.xt));
        }
        aaq(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, runOn(this, this.yr), (d, e) => this.j9(d, e, this.wy, runOn(this, this.yo), this.xu), (d, e) => this.j7(d, e, this.wy, runOn(this, this.yo), this.xu));
        }
        aap(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, runOn(this, this.yq), (d, e) => this.j9(d, e, this.wy, runOn(this, this.yo), this.xr), (d, e) => this.j7(d, e, this.wy, runOn(this, this.yo), this.xr));
        }
        aar(a, b, c) {
            return this.v8(a, b, c, this.yp(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xh, this.wy, runOn(this, this.ys), (d, e) => this.j9(d, e, this.wy, runOn(this, this.yo), this.xw), (d, e) => this.j7(d, e, this.wy, runOn(this, this.yo), this.xw));
        }
        p6() {
            super.p6();
            if (this.wy != null) {
                this.wy.h9(false);
            }
            if (this.xh != null) {
                this.xh.h9(false);
            }
        }
        sl(a, b) {
            this.xf.b0.e(this.ib);
            this.rn(false);
        }
        sk(a, b) {
            if (this.gz && this.jo < 0.05) {
                this.g0 = true;
                this.g3 = false;
                this.gi = false;
            }
            this.xf.b0.e(this.ib);
            this.rn(false);
        }
        xv(a, b, c) {
            let d = this.di(b);
            this.x9.addItem(d, b);
            this.ya.addItem(b, c);
            return d;
        }
        zx(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.x9.item(b);
            this.ya.removeItem(c);
            this.x9.removeItem(b);
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.c1 != null && this.c9 != null) {
                        this.xf.b0.e(this.ib);
                        this.rn(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.wy != null) {
                            this.wy.b0(this);
                        }
                        if (this.xh != null) {
                            this.xh.b0(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.wy != null) {
                            this.wy.ct(this);
                        }
                        if (this.xh != null) {
                            this.xh.ct(this);
                        }
                    }
                    this.xf.b0.e(this.ib);
                    this.rn(false);
                    break;
                case "FastItemsSource":
                    this.xy = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.zx(typeCast(IFastItemsSource_$type, c), this.xu);
                        this.zx(typeCast(IFastItemsSource_$type, c), this.xs);
                        this.zx(typeCast(IFastItemsSource_$type, c), this.xt);
                        this.zx(typeCast(IFastItemsSource_$type, c), this.xr);
                        this.zx(typeCast(IFastItemsSource_$type, c), this.xw);
                        this.xu = null;
                        this.xs = null;
                        this.xt = null;
                        this.xr = null;
                        this.xw = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.zo) == false) {
                            this.xu = this.xv(typeCast(IFastItemsSource_$type, d), this.zo, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.zf) == false) {
                            this.xs = this.xv(typeCast(IFastItemsSource_$type, d), this.zf, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.zk) == false) {
                            this.xt = this.xv(typeCast(IFastItemsSource_$type, d), this.zk, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.y2) == false) {
                            this.xr = this.xv(typeCast(IFastItemsSource_$type, d), this.y2, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.zs) == false) {
                            this.xw = this.xv(typeCast(IFastItemsSource_$type, d), this.zs, "VolumeColumn");
                        }
                    }
                    this.xy = false;
                    if (this.xh != null && !this.xh.c1()) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && c != null);
                    }
                    break;
                case FinancialSeries.$$p[11]:
                    if (this.dl != null) {
                        this.zx(this.dl, this.xu);
                        this.xu = this.xv(this.dl, this.zo, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.xh != null && !this.xh.c1() && !this.xy) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.dl != null) {
                        this.zx(this.dl, this.xs);
                        this.xs = this.xv(this.dl, this.zf, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.xh != null && !this.xh.c1() && !this.xy) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (this.dl != null) {
                        this.zx(this.dl, this.xt);
                        this.xt = this.xv(this.dl, this.zk, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.xh != null && !this.xh.c1() && !this.xy) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.dl != null) {
                        this.zx(this.dl, this.xr);
                        this.xr = this.xv(this.dl, this.y2, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.xh != null && !this.xh.c1() && !this.xy) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    this.z7();
                    break;
                case FinancialSeries.$$p[13]:
                    if (this.dl != null) {
                        this.zx(this.dl, this.xw);
                        this.xw = this.xv(this.dl, this.zs, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.xh != null && !this.xh.c1() && !this.xy) {
                        this.xf.b0.e(this.ib);
                        this.rn(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[14]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.xf.b0.e(this.ib);
                    this.rn(false);
                    this.qh();
                    this.xg = typeCast(ITimeRangeSelectorAxis_$type, this.wy);
                    break;
                case FinancialSeries.$$p[15]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.xf.b0.e(this.ib);
                    if (this.xh != null) {
                        this.xh.c1();
                    }
                    {
                        this.rn(false);
                    }
                    this.qh();
                    break;
                case "TransitionProgress":
                    this.w4.c(this.jo, this.w2, this.w0);
                    if (this.d3(this.ct)) {
                        return;
                    }
                    if (this.jo == 1) {
                        this.w0.w();
                        this.z6(this.w0, this.xf);
                        if (this.gz) {
                            this.gz = false;
                            this.o4();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                        }
                        if (this.g2) {
                            this.g2 = false;
                            this.o4();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                            this.qw();
                        }
                        this.qk();
                    }
                    else {
                        this.z6(this.w4, this.xf);
                    }
                    if (this.c9 != null) {
                        this.c9.qa(this);
                    }
                    break;
                case FinancialSeries.$$p[10]:
                    this.rn(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.xz = this.x2();
                    this.rn(false);
                    break;
                case "CategoryMode":
                    if (this.wy != null) {
                        this.wy.l7(true);
                    }
                    break;
            }
        }
        x1(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        x0(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        wr(a, b, c) {
            if (b < a || a < 0 || a > this.dl.count || b < 0 || b > this.dl.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.dl.item(g);
            }
            return d;
        }
        yv(a) {
            return a.b0.b;
        }
        yx(a) {
            return a.b0.c;
        }
        wq(a, b) {
            return this.wr(a, b, this.xh);
        }
        get_fc() {
            return true;
        }
        o1() {
            super.o1();
            this.xl = null;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.xk(a, b, this.xl);
                this.xl = d;
                return d;
            }
            else {
                let e = this.xj(a, b, this.xl);
                this.xl = e;
                return e;
            }
        }
        yz(a) {
            let b = this.w1();
            let c = this.ct.bx;
            let d = this.ct.by;
            let e = this.wy;
            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;
        }
        xk(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.dl.count;
            let e = this.xf.b0.c;
            let f = this.xf.b0.d;
            let g = this.xf.b0.b;
            let h = this.wy;
            let i = -1;
            let j = -1;
            if (h.cn) {
                let k = this.w1();
                let l = this.yz(b);
                if (k.m != null && l >= 0 && l < k.m.count) {
                    l = truncate(Math.round(k.m._inner[l]));
                }
                i = l;
                j = l;
            }
            else {
                let m = this.j1(b);
                i = truncate(Math.floor((intDivide(m, g)))) * g;
                j = i + (g - 1);
            }
            if (c != null && c.g == i && c.f == j) {
                return c;
            }
            let n = new HighlightingInfo();
            n.i = this;
            n.g = i;
            n.f = j;
            return n;
        }
        xj(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dl.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        x2() {
            return this.x4;
        }
        ip(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.wy != null) {
                let e = this.getEffectiveViewport1(this.ct);
                let f = new ScalerParams(0, b, c, this.wy.ch, e);
                let g = this.wd(this.ct);
                let h = this.wy.en(g.left, f);
                let i = this.wy.en(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.wy.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        j1(a) {
            return truncate(Math.round(this.ip(a)));
        }
        get_fq() {
            return typeCast(ISortingAxis_$type, this.wy) !== null;
        }
        az() {
            return this.wy;
        }
        j3(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.getEffectiveViewport1(this.ct);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.wy.ch, d);
            let g = typeCast(ISortingAxis_$type, this.wy);
            let h = this.wd(this.ct);
            let i = h.left;
            let j = h.right;
            let k = this.v1(a).x;
            let l = this.wy.en(k, f);
            let m = this.wy.en(i, f);
            let n = this.wy.en(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        kl(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.wy) !== null) {
                b = this.j3(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.j1(a);
            }
            return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
        }
        w1() {
            let a = this.w0;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.w4;
            }
            return a;
        }
        yp(a, b, c) {
            if (this.wy == null) {
                return 0;
            }
            return this.wy.k6(a, b, c, this.index);
        }
        gl() {
            return this.x5;
        }
        w8() {
            return 11;
        }
        c2() {
            return 3;
        }
        c5() {
            return 3;
        }
        z6(a, b) {
            this.qt();
            this.wc = a.ab;
            b.aw();
        }
        z4(a, b) {
            a.v();
        }
        hc(a, b, c) {
            let d = super.hc(a, b, c);
            let e = c;
            if (this.dl == null || this.dl.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.wy == null || this.xh == null || e.b0.b < 1 || this.wy.bi == null || this.xh.bi == null || this.xh.ly == this.xh.lx || this.wy.itemsSource == null || this.wy.lg < 1) {
                e.b0.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.ct.by;
            a = this.ct.bx;
            return {
                p0: a,
                p1: b
            };
        }
        yt(a) {
            let b = 0;
            let c = a.by;
            let d = a.bx;
            let e = this.getEffectiveViewport1(this.ct);
            if (!c.isEmpty && !d.isEmpty && this.xh != null) {
                let f = new ScalerParams(0, c, d, this.xh.ch, e);
                f.b = this.iw();
                b = this.xh.ek(this.xh.l8, f);
            }
            return b;
        }
        o4() {
            super.o4();
            this.w2.w();
            this.w0.w();
            this.w4.w();
        }
        ro(a) {
            super.ro(a);
            this.xf.b0.e(this.ib);
            if (this.d3(this.ct)) {
                return;
            }
            if (this.gp) {
                if (this.d1()) {
                    this.z6(this.w4, this.xf);
                }
                else {
                    this.z6(this.w0, this.xf);
                }
                return;
            }
            if (this.gd(a)) {
                let b = this.w2;
                if (this.d1()) {
                    if (this.da.g) {
                        this.da.t();
                    }
                    this.w2 = this.w4;
                    this.w4 = b;
                }
                else {
                    this.w2 = this.w0;
                    this.w0 = b;
                }
                this.z4(this.w0, this.xf);
                let c = false;
                if (this.g1) {
                    this.da.w();
                    this.da.r = truncate(this.i8());
                    this.da.b = this.dc != null ? this.dc : this.db;
                    if (this.g2) {
                        let d = this.w4;
                        this.w4 = this.w2;
                        this.w2 = d;
                        c = true;
                    }
                    this.xa.s(this, this.w2, this.w0, this.isVertical, this.wy, this.xh, this.w9, this.w8(), this.c3, this.c2(), () => this.yt(this.xf), this.xf.bx);
                    if (this.g2) {
                        let e = this.w4;
                        this.w4 = this.w2;
                        this.w2 = e;
                    }
                    this.g2 = false;
                }
                if (this.g4) {
                    this.da.w();
                    this.da.r = truncate(this.i9());
                    this.da.b = this.dd != null ? this.dd : this.db;
                    if (this.gz) {
                        let f = this.w4;
                        this.w4 = this.w2;
                        this.w2 = f;
                        c = true;
                    }
                    this.xa.s(this, this.w2, this.w0, this.isVertical, this.wy, this.xh, this.w9, this.w8(), this.c3, this.c2(), () => this.yt(this.xf), this.xf.bx);
                    let g = this.w0;
                    this.w0 = this.w2;
                    this.w2 = g;
                    if (this.gz) {
                        let h = this.w4;
                        this.w4 = this.w2;
                        this.w2 = h;
                    }
                    this.gz = false;
                }
                this.d7 = false;
                if (!c) {
                    this.oz();
                }
                this.r1();
                if (this.g1) {
                    this.g0 = false;
                    this.g3 = false;
                    this.gi = false;
                    this.gz = true;
                }
                if (this.g4) {
                    this.g3 = false;
                    this.g2 = true;
                }
            }
            else {
                this.z4(this.w0, this.xf);
                this.z6(this.w0, this.xf);
            }
        }
        gm() {
            return true;
        }
        x7(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.xs == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.xt == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.xu == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.xr == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.xw == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get x8() {
            return this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null;
        }
        x3() {
            return this.typical != null;
        }
        zw(a) {
            this.typical(this, a);
        }
        get yg() {
            return this.yd();
        }
        *_yd() {
            let a = false;
            if (this.x3()) {
                let b = this.xb(0, this.dl.count);
                this.zw(new FinancialEventArgs(0, this.dl.count, b, this.xc(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.x8 && this.wy.i$b != null) {
                    let d = this.dl.count;
                    let e = this.wy.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.xs.item(e.item(f)) + this.xt.item(e.item(f)) + this.xr.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.dl.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.xs.item(h) + this.xt.item(h) + this.xr.item(h)) / 3;
                    }
                }
            }
        }
        yd() {
            return toEnum(() => this._yd());
        }
        get yf() {
            return this.yc();
        }
        *_yc() {
            if (this.x8 && this.wy.i$b != null) {
                let a = this.xs.count;
                let b = this.wy.i$b;
                if (a > 0) {
                    yield this.yu(this.xs.item(b.item(0)) - this.xt.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.yu(this.xs.item(b.item(c)) - this.xt.item(b.item(c))), Math.max(this.yu(Math.abs(this.xs.item(b.item(c)) - this.xr.item(b.item(c - 1)))), this.yu(Math.abs(this.xt.item(b.item(c)) - this.xr.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.xs.count;
                if (d > 0) {
                    yield this.yu(this.xs.item(0) - this.xt.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.yu(this.xs.item(e) - this.xt.item(e)), Math.max(this.yu(Math.abs(this.xs.item(e) - this.xr.item(e - 1))), this.yu(Math.abs(this.xt.item(e) - this.xr.item(e - 1)))));
                }
            }
        }
        yc() {
            return toEnum(() => this._yc());
        }
        get ye() {
            return this.yb();
        }
        *_yb() {
            if (this.x8 && this.wy.i$b != null) {
                let a = this.xt.count;
                let b = this.wy.i$b;
                if (a > 0) {
                    yield this.yu(this.xt.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.yu(this.xt.item(b.item(c))), this.yu(this.xr.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.xt.count;
                if (d > 0) {
                    yield this.yu(this.xt.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.yu(this.xt.item(e)), this.yu(this.xr.item(e - 1)));
                }
            }
        }
        yb() {
            return toEnum(() => this._yb());
        }
        yi(a) {
            if (a == null) {
                return null;
            }
            if (this.x8 && this.wy.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.wy.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        yh() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.dl != null && !this.xx) {
                this.xx = true;
                let b = this.xb(0, this.dl.count);
                this.xx = false;
                let c = new FinancialEventArgs(0, this.dl.count, b, this.xc(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.xu == null) {
                return null;
            }
            if (this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null) {
                if (this.ym != null) {
                    return this.ym.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xu.count);
                let b = this.wy.i$b;
                let c = this.xu.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.ym = a;
                return this.ym.asArray();
            }
            else {
                return this.xu.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.xs == null) {
                return null;
            }
            if (this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null) {
                if (this.yk != null) {
                    return this.yk.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xs.count);
                let b = this.wy.i$b;
                let c = this.xs.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yk = a;
                return this.yk.asArray();
            }
            else {
                return this.xs.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.xt == null) {
                return null;
            }
            if (this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null) {
                if (this.yl != null) {
                    return this.yl.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xt.count);
                let b = this.wy.i$b;
                let c = this.xt.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yl = a;
                return this.yl.asArray();
            }
            else {
                return this.xt.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.xr == null) {
                return null;
            }
            if (this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null) {
                if (this.yj != null) {
                    return this.yj.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xr.count);
                let b = this.wy.i$b;
                let c = this.xr.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yj = a;
                return this.yj.asArray();
            }
            else {
                return this.xr.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.xw == null) {
                return null;
            }
            if (this.wy != null && typeCast(ISortingAxis_$type, this.wy) !== null) {
                if (this.yn != null) {
                    return this.yn.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xw.count);
                let b = this.wy.i$b;
                let c = this.xw.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yn = a;
                return this.yn.asArray();
            }
            else {
                return this.xw.asArray();
            }
        }
        o9(a, b, c, d) {
            super.o9(a, b, c, d);
            if (this.wy == null || !(typeCast(ISortingAxis_$type, this.wy) !== null)) {
                return;
            }
            let e = this.wy.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.ym != null) {
                            this.ym.insert(f, this.xu.item(g));
                        }
                        if (this.yk != null) {
                            this.yk.insert(f, this.xs.item(g));
                        }
                        if (this.yl != null) {
                            this.yl.insert(f, this.xt.item(g));
                        }
                        if (this.yj != null) {
                            this.yj.insert(f, this.xr.item(g));
                        }
                        if (this.yn != null) {
                            this.yn.insert(f, this.xw.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.ym != null) {
                        this.ym.v(b, c);
                    }
                    if (this.yk != null) {
                        this.yk.v(b, c);
                    }
                    if (this.yl != null) {
                        this.yl.v(b, c);
                    }
                    if (this.yj != null) {
                        this.yj.v(b, c);
                    }
                    if (this.yn != null) {
                        this.yn.v(b, c);
                    }
                    break;
                case 4:
                    if (this.ym != null) {
                        this.ym = new List$1(Number_$type, 0);
                    }
                    if (this.yk != null) {
                        this.yk = new List$1(Number_$type, 0);
                    }
                    if (this.yl != null) {
                        this.yl = new List$1(Number_$type, 0);
                    }
                    if (this.yj != null) {
                        this.yj = new List$1(Number_$type, 0);
                    }
                    if (this.yn != null) {
                        this.yn = 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.ym != null) {
                            this.ym._inner[h] = this.xu.item(i);
                        }
                        if (this.yk != null) {
                            this.yk._inner[h] = this.xs.item(i);
                        }
                        if (this.yl != null) {
                            this.yl._inner[h] = this.xt.item(i);
                        }
                        if (this.yj != null) {
                            this.yj._inner[h] = this.xr.item(i);
                        }
                        if (this.yn != null) {
                            this.yn._inner[h] = this.xw.item(i);
                        }
                    }
                    break;
            }
            this.z7();
            this.sh();
        }
        xb(a, b) {
            let c = this.yi(this.xu);
            let d = this.yi(this.xr);
            let e = this.yi(this.xs);
            let f = this.yi(this.xt);
            let g = this.yi(this.xw);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.yg), this.yh());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.yf), ((() => {
                    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.ye), ((() => {
                    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.dl != null ? this.dl.count : 0;
                return $ret;
            })());
            return h;
        }
        yu(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        xc(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.ho;
                $ret.j = Series.hn;
                $ret.i = runOn(this, this.yu);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.wy;
        }
        rp(a, b) {
            super.rp(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.cs);
            this.ct.a4(b);
            c.b0.e(this.ib);
            if (this.d3(this.cs)) {
                return;
            }
            if (!this.gq) {
                this.z4(this.w3, c);
            }
            this.gq = false;
            this.z6(this.w3, c);
            this.gy = false;
        }
        rm(a, b, c, d, e) {
            super.rm(a, b, c, d, e);
            let f = this.a9.a$j.item(d);
            let g = f;
            g.b0.e(this.ib);
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.wz == null) {
                this.wz = new CategoryFrame(3);
            }
            this.wz.v();
            this.z4(this.wz, g);
            this.z6(this.wz, g);
        }
        av(a) {
            if (this.wy == a) {
                return this.xh;
            }
            if (this.xh == a) {
                return this.wy;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.wy);
            return b != null ? b.preferredCategoryMode(this) : this.w6;
        }
        get w6() {
            return this.w5;
        }
        set w6(a) {
            let b = this.w6;
            if (a != b) {
                this.w5 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.w6));
            }
        }
        get_fk() {
            return true;
        }
        rx(a, b) {
            super.rx(a, b);
            this.aao = a;
        }
        z7() {
            this.ik = this.xr == null || this.xr.count == 0 ? NaN : this.xr.item(this.xr.count - 1);
        }
        kn(a) {
            if (this.xg != null && a != null) {
                if (this.xi == null || this.xi.propertyName != this.xg.dateTimeMemberPath) {
                    this.xi = new FastReflectionHelper(false, this.xg.dateTimeMemberPath);
                }
                let b = this.xi.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.xg.itemLabelFormat());
                }
            }
            return super.kn(a);
        }
    }
    FinancialSeries.$t = /*@__PURE__*/ markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:y2:z8', [2, null], 'HighMemberPath:zf:aae', [2, null], 'HighlightedCloseMemberPath:y5:z9', [2, null], 'HighlightedHighMemberPath:y7:aaa', [2, null], 'HighlightedLowMemberPath:y9:aab', [2, null], 'HighlightedOpenMemberPath:zb:aac', [2, null], 'HighlightedVolumeMemberPath:zd:aad', [2, null], 'IsCustomCategoryStyleAllowed:x4:aaf', [0, false], 'IsTransitionInEnabled:x5:aag', [0, false], 'LowMemberPath:zk:aah', [2, null], 'NegativeBrush:aao:aai', [Brush.$, null], 'OpenMemberPath:zo:aaj', [2, null], 'TransitionInMode:w9:aak', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:zs:aal', [2, null], 'XAxis:wy:aam', [CategoryAxisBase.$, null], 'YAxis:xh:aan', [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.u) {
                return true;
            }
            return false;
        }
        b5(a) {
            this.b4 = a.u;
        }
        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.wy.ce) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.b2.wy.f1 != null) {
                a += "<span>${item." + this.b2.wy.f1 + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a9.a$u(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.zo + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.zf + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.zk + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.y2 + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.b2.zs)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.zs + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.vv = a;
            this.e.jk = 5;
            this.e.jl = 2;
            this.e.jm = 2;
        }
    }
    FinancialSeriesView.$t = /*@__PURE__*/ markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
