/*
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-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "igniteui-angular-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-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { Dictionary$2 } from "igniteui-angular-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-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-angular-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { dateToStringFormat } from "igniteui-angular-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core";
import { Color } from "igniteui-angular-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 = 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.cf.ie;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.ca;
            let c = this.a.b9;
            let d = this.a.b9;
            if (this.a.cf != null) {
                d = this.a.cf.getEffectiveViewport1(this.a);
            }
            if (b.isEmpty || c.isEmpty || this.a.cf.xg == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.cf.xg != null) ? this.a.cf.xg.df : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.cf.wt(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.cf.xg);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.cf.xg.fw(g.left, f));
                let j = Math.ceil(this.a.cf.xg.fw(g.right, f));
                if (this.a.cf.xg.df) {
                    j = Math.ceil(this.a.cf.xg.fw(g.left, f));
                    i = Math.floor(this.a.cf.xg.fw(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 = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
})();
/**
 * @hidden
 */
export let FinancialSeries = /*@__PURE__*/ (() => {
    class FinancialSeries extends Series {
        constructor() {
            super();
            this.x7 = null;
            this.x5 = null;
            this.x6 = null;
            this.x4 = null;
            this.x8 = null;
            this.yh = false;
            this.assigningCategoryStyle = null;
            this.xp = null;
            this.yr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.ys = new Dictionary$2(String_$type, String_$type, 0);
            this.yg = false;
            this.x3 = null;
            this.xk = null;
            this.xm = null;
            this.xi = null;
            this.xs = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.yf = false;
            this.y4 = null;
            this.y2 = null;
            this.y3 = null;
            this.y1 = null;
            this.y5 = null;
            this.xl = null;
            this.xh = null;
            this.xn = 0;
            this.xy = null;
            this.x0 = null;
            this.xp = new CategorySeriesRenderManager();
            this.yh = false;
            this.xs = new CategoryTransitionSourceFramePreparer();
            this.xl = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.xo = 0;
        }
        hu() {
            let a = super.hu();
            {
                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.aaj));
                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.aah));
                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.aai));
                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.aag));
                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.aak));
                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.r8));
                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.r8));
                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.r8));
                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.r8));
                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;
        }
        aaj(a, b) {
            if (this.zt != null) {
                b.value = this.zt;
                return;
            }
            b.value = this.z6;
        }
        aah(a, b) {
            if (this.zp != null) {
                b.value = this.zp;
                return;
            }
            b.value = this.zx;
        }
        aai(a, b) {
            if (this.zr != null) {
                b.value = this.zr;
                return;
            }
            b.value = this.z2;
        }
        aag(a, b) {
            if (this.zn != null) {
                b.value = this.zn;
                return;
            }
            b.value = this.zk;
        }
        aak(a, b) {
            if (this.zv != null) {
                b.value = this.zv;
                return;
            }
            b.value = this.aaa;
        }
        kz() {
            if (this.d4()) {
                return this.bo.xm;
            }
            else {
                return this.bo.xi;
            }
        }
        q7(a) {
            super.q7(a);
            this.xx = a;
        }
        get_e8() {
            return true;
        }
        ai() {
            return [this.xg, this.xz];
        }
        ku(a, b) {
            let c = this.ni(b);
            if (c == FinancialSeries.$$p[11]) {
                return this.kv(a, b, this.z6);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.kv(a, b, this.zx);
            }
            if (c == FinancialSeries.$$p[9]) {
                return this.kv(a, b, this.z2);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.kv(a, b, this.zk);
            }
            if (c == FinancialSeries.$$p[13]) {
                return this.kv(a, b, this.aaa);
            }
            if (c == FinancialSeries.$$p[5]) {
                return this.kv(a, b, this.zt);
            }
            if (c == FinancialSeries.$$p[3]) {
                return this.kv(a, b, this.zp);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.kv(a, b, this.zr);
            }
            if (c == FinancialSeries.$$p[2]) {
                return this.kv(a, b, this.zn);
            }
            if (c == FinancialSeries.$$p[6]) {
                return this.kv(a, b, this.zv);
            }
            return super.ku(a, b);
        }
        mi(a) {
            let b = this.ni(a);
            if (b == FinancialSeries.$$p[11]) {
                return this.z6;
            }
            if (b == FinancialSeries.$$p[1]) {
                return this.zx;
            }
            if (b == FinancialSeries.$$p[9]) {
                return this.z2;
            }
            if (b == FinancialSeries.$$p[0]) {
                return this.zk;
            }
            if (b == FinancialSeries.$$p[13]) {
                return this.aaa;
            }
            if (b == FinancialSeries.$$p[5]) {
                return this.zt;
            }
            if (b == FinancialSeries.$$p[3]) {
                return this.zp;
            }
            if (b == FinancialSeries.$$p[4]) {
                return this.zr;
            }
            if (b == FinancialSeries.$$p[2]) {
                return this.zn;
            }
            if (b == FinancialSeries.$$p[6]) {
                return this.zv;
            }
            return super.mi(a);
        }
        zg() {
            return 2;
        }
        ze() {
            return 4;
        }
        aj(a) {
            let b = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), this.wr(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.zg();
            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;
        }
        al(a) {
            let b = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), this.wr(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;
        }
        v6() {
            return this.aa6;
        }
        v7() {
            return this.aa6;
        }
        o8() {
            super.o8();
            this.xg = null;
            this.xz = null;
        }
        get_em() {
            return true;
        }
        get_f6() {
            return this.xz != null && this.xz.df;
        }
        get yc() {
            return this.x7;
        }
        set yc(a) {
            if (this.x7 != a) {
                let b = this.x7;
                this.x7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.x7);
            }
        }
        get ya() {
            return this.x5;
        }
        set ya(a) {
            if (this.x5 != a) {
                let b = this.x5;
                this.x5 = a;
                this.raisePropertyChanged("HighColumn", b, this.x5);
            }
        }
        get yb() {
            return this.x6;
        }
        set yb(a) {
            if (this.x6 != a) {
                let b = this.x6;
                this.x6 = a;
                this.raisePropertyChanged("LowColumn", b, this.x6);
            }
        }
        get x9() {
            return this.x4;
        }
        set x9(a) {
            if (this.x4 != a) {
                let b = this.x4;
                this.x4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.x4);
            }
        }
        get ye() {
            return this.x8;
        }
        set ye(a) {
            if (this.x8 != a) {
                let b = this.x8;
                this.x8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.x8);
            }
        }
        gc() {
            return this.highlightedItemsSource != null || (this.zt != null && this.zp != null && this.zr != null && this.zn != null);
        }
        yo() {
            return (this.assigningCategoryStyle != null && this.yh) || this.by != 1 || this.cq != 1 || this.cp != 1;
        }
        aan(a) {
            if (this.assigningCategoryStyle != null && this.yh) {
                this.assigningCategoryStyle(this, a);
            }
        }
        aal(a, b, c, d, e, f, g) {
            let h = this.by != 1;
            let i = this.cq != 1;
            let j = this.cp != 1;
            this.xp.a3(this.xp.b, d.dm, a, b, c, d, e, f, false, g);
            this.xp.ab(this.ic);
            let k = this.xp.ay;
            let l = null;
            let m = null;
            let n = null;
            let o = this.dp;
            if (h && this.dc != null) {
                l = this.dc.d0.getHighlightingInfo(this, o, k.z, k.y, false);
                k.c = l;
            }
            if (i && this.dc != null) {
                m = this.dc.d1.getHighlightingInfo(this, o, k.z, k.y, false);
                if (m == null && this.bo != null) {
                    m = this.dc.d1.getHighlightingInfo(this.bo, this.bo.dp, k.z, k.y, false);
                }
                k.d = m;
            }
            if (j && this.dc != null) {
                n = this.dc.dz.getHighlightingInfo(this, o, k.z, k.y, false);
                k.b = n;
            }
            k.h = f;
            this.aan(k);
            this.xp.z(this, l, m, n, f, h, i, j, b < 0);
        }
        y6(a) {
            return this.iv(a, this.xg);
        }
        ke(a, b) {
            return this.kf(a, b, this.xg, runOn(this, this.y6), new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye));
        }
        kc(a, b) {
            return this.kd(a, b, this.xg, runOn(this, this.y6), new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye));
        }
        ir(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.xg.o5;
            return this.is(a, b, this.xg, d, e, f, runOn(this, this.y6));
        }
        getOffsetValue() {
            return this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
        }
        getCategoryWidth() {
            return this.xg.getCategorySize(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
        }
        wm(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, null, null, null);
        }
        i8(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye), a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        i4(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(this.ya, a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        i6(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(this.yb, a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        y8(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(this.x9, a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        y9(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(this.yc, a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        za(a, b, c) {
            let d = this.getEffectiveViewport1(this.cw);
            let e = this.y7(this.cw.ca, this.cw.b9, d);
            let f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
            return this.ja(this.ye, a, this.xg, f, e, runOn(this, this.y6), b, c);
        }
        wi(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.i4), (d, e) => this.kf(d, e, this.xg, runOn(this, this.y6), this.ya), (d, e) => this.kd(d, e, this.xg, runOn(this, this.y6), this.ya));
        }
        wk(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.i6), (d, e) => this.kf(d, e, this.xg, runOn(this, this.y6), this.yb), (d, e) => this.kd(d, e, this.xg, runOn(this, this.y6), this.yb));
        }
        aa8(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.y9), (d, e) => this.kf(d, e, this.xg, runOn(this, this.y6), this.yc), (d, e) => this.kd(d, e, this.xg, runOn(this, this.y6), this.yc));
        }
        aa7(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.y8), (d, e) => this.kf(d, e, this.xg, runOn(this, this.y6), this.x9), (d, e) => this.kd(d, e, this.xg, runOn(this, this.y6), this.x9));
        }
        aa9(a, b, c) {
            return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.za), (d, e) => this.kf(d, e, this.xg, runOn(this, this.y6), this.ye), (d, e) => this.kd(d, e, this.xg, runOn(this, this.y6), this.ye));
        }
        qh() {
            super.qh();
            if (this.xg != null) {
                this.xg.k3(false);
            }
            if (this.xz != null) {
                this.xz.k3(false);
            }
        }
        sz(a, b) {
            this.xx.cd.e(this.ie);
            this.ry(false);
        }
        sy(a, b) {
            if (this.g2 && this.ju < 0.05) {
                this.g3 = true;
                this.g6 = false;
                this.gl = false;
            }
            this.xx.cd.e(this.ie);
            this.ry(false);
        }
        yd(a, b, c) {
            let d = this.dl(b);
            this.yr.addItem(d, b);
            this.ys.addItem(b, c);
            return d;
        }
        aaf(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.yr.item(b);
            this.ys.removeItem(c);
            this.yr.removeItem(b);
        }
        rg(a, b, c, d) {
            super.rg(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.c4 != null && this.dc != null) {
                        this.xx.cd.e(this.ie);
                        this.ry(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.xg != null) {
                            this.xg.cq(this);
                        }
                        if (this.xz != null) {
                            this.xz.cq(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.xg != null) {
                            this.xg.du(this);
                        }
                        if (this.xz != null) {
                            this.xz.du(this);
                        }
                    }
                    this.xx.cd.e(this.ie);
                    this.ry(false);
                    break;
                case "FastItemsSource":
                    this.yg = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.aaf(typeCast(IFastItemsSource_$type, c), this.yc);
                        this.aaf(typeCast(IFastItemsSource_$type, c), this.ya);
                        this.aaf(typeCast(IFastItemsSource_$type, c), this.yb);
                        this.aaf(typeCast(IFastItemsSource_$type, c), this.x9);
                        this.aaf(typeCast(IFastItemsSource_$type, c), this.ye);
                        this.yc = null;
                        this.ya = null;
                        this.yb = null;
                        this.x9 = null;
                        this.ye = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.z6) == false) {
                            this.yc = this.yd(typeCast(IFastItemsSource_$type, d), this.z6, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.zx) == false) {
                            this.ya = this.yd(typeCast(IFastItemsSource_$type, d), this.zx, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.z2) == false) {
                            this.yb = this.yd(typeCast(IFastItemsSource_$type, d), this.z2, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.zk) == false) {
                            this.x9 = this.yd(typeCast(IFastItemsSource_$type, d), this.zk, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.aaa) == false) {
                            this.ye = this.yd(typeCast(IFastItemsSource_$type, d), this.aaa, "VolumeColumn");
                        }
                    }
                    this.yg = false;
                    if (this.xz != null && !this.xz.d2()) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && c != null);
                    }
                    break;
                case FinancialSeries.$$p[11]:
                    if (this.dp != null) {
                        this.aaf(this.dp, this.yc);
                        this.yc = this.yd(this.dp, this.z6, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.xz != null && !this.xz.d2() && !this.yg) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && this.d9);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.dp != null) {
                        this.aaf(this.dp, this.ya);
                        this.ya = this.yd(this.dp, this.zx, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.xz != null && !this.xz.d2() && !this.yg) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && this.d9);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (this.dp != null) {
                        this.aaf(this.dp, this.yb);
                        this.yb = this.yd(this.dp, this.z2, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.xz != null && !this.xz.d2() && !this.yg) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && this.d9);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.dp != null) {
                        this.aaf(this.dp, this.x9);
                        this.x9 = this.yd(this.dp, this.zk, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.xz != null && !this.xz.d2() && !this.yg) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && this.d9);
                    }
                    this.aap();
                    break;
                case FinancialSeries.$$p[13]:
                    if (this.dp != null) {
                        this.aaf(this.dp, this.ye);
                        this.ye = this.yd(this.dp, this.aaa, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.xz != null && !this.xz.d2() && !this.yg) {
                        this.xx.cd.e(this.ie);
                        this.ry(this.gh && this.d9);
                    }
                    break;
                case FinancialSeries.$$p[14]:
                    if (c != null) {
                        c.cq(this);
                    }
                    if (d != null) {
                        d.du(this);
                    }
                    this.xx.cd.e(this.ie);
                    this.ry(false);
                    this.qr();
                    this.xy = typeCast(ITimeRangeSelectorAxis_$type, this.xg);
                    break;
                case FinancialSeries.$$p[15]:
                    if (c != null) {
                        c.cq(this);
                    }
                    if (d != null) {
                        d.du(this);
                    }
                    this.xx.cd.e(this.ie);
                    if (this.xz != null) {
                        this.xz.d2();
                    }
                    {
                        this.ry(false);
                    }
                    this.qr();
                    break;
                case "TransitionProgress":
                    this.xm.c(this.ju, this.xk, this.xi);
                    if (this.d7(this.cw)) {
                        return;
                    }
                    if (this.ju == 1) {
                        this.xi.y();
                        this.aao(this.xi, this.xx);
                        if (this.g2) {
                            this.g2 = false;
                            this.pc();
                            this.dd.r = truncate(this.jc());
                            this.dd.b = this.de;
                        }
                        if (this.g5) {
                            this.g5 = false;
                            this.pc();
                            this.dd.r = truncate(this.jc());
                            this.dd.b = this.de;
                            this.q6();
                        }
                        this.qu();
                    }
                    else {
                        this.aao(this.xm, this.xx);
                    }
                    if (this.dc != null) {
                        this.dc.rz(this);
                    }
                    break;
                case FinancialSeries.$$p[10]:
                    this.ry(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.yh = this.yk();
                    this.ry(false);
                    break;
                case "CategoryMode":
                    if (this.xg != null) {
                        this.xg.pw(true);
                    }
                    break;
            }
        }
        yj(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        yi(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.dc) {
                return true;
            }
            return false;
        }
        w9(a, b, c) {
            if (b < a || a < 0 || a > this.dp.count || b < 0 || b > this.dp.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.dm;
            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.dp.item(g);
            }
            return d;
        }
        zd(a) {
            return a.cd.b;
        }
        zf(a) {
            return a.cd.c;
        }
        w8(a, b) {
            return this.w9(a, b, this.xz);
        }
        get_ff() {
            return true;
        }
        o9() {
            super.o9();
            this.x3 = null;
        }
        dh(a, b, c) {
            if (this.ef && this.f0(this.by) && !c) {
                let d = this.x2(a, b, this.x3);
                this.x3 = d;
                return d;
            }
            else {
                let e = this.x1(a, b, this.x3);
                this.x3 = e;
                return e;
            }
        }
        zh(a) {
            let b = this.xj();
            let c = this.cw.b9;
            let d = this.cw.ca;
            let e = this.xg;
            let f = 0;
            if (e.dq) {
                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.h.count;
            let j = 0;
            for (j = 0; j < i; j++) {
                let k = b.h._inner[j];
                let l = null;
                if (j < i - 1) {
                    l = b.h._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;
        }
        x2(a, b, c) {
            if (this.dp == null) {
                return null;
            }
            let d = this.dp.count;
            let e = this.xx.cd.c;
            let f = this.xx.cd.d;
            let g = this.xx.cd.b;
            let h = this.xg;
            let i = -1;
            let j = -1;
            if (h.dm) {
                let k = this.xj();
                let l = this.zh(b);
                if (k.o != null && l >= 0 && l < k.o.count) {
                    l = truncate(Math.round(k.o._inner[l]));
                }
                i = l;
                j = l;
            }
            else {
                let m = this.j7(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;
        }
        x1(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dp.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        yk() {
            return this.ym;
        }
        it(a) {
            let b = this.cw.ca;
            let c = this.cw.b9;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.xg != null) {
                let e = this.getEffectiveViewport1(this.cw);
                let f = new ScalerParams(0, b, c, this.xg.df, e);
                let g = this.wt(this.cw);
                let h = this.xg.fw(g.left, f);
                let i = this.xg.fw(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.xg.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        j7(a) {
            return truncate(Math.round(this.it(a)));
        }
        get_ft() {
            return typeCast(ISortingAxis_$type, this.xg) !== null;
        }
        a0() {
            return this.xg;
        }
        j9(a) {
            let b = this.cw.ca;
            let c = this.cw.b9;
            let d = this.getEffectiveViewport1(this.cw);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.xg.df, d);
            let g = typeCast(ISortingAxis_$type, this.xg);
            let h = this.wt(this.cw);
            let i = h.left;
            let j = h.right;
            let k = this.wh(a).x;
            let l = this.xg.fw(k, f);
            let m = this.xg.fw(i, f);
            let n = this.xg.fw(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        kr(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.xg) !== null) {
                b = this.j9(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.j7(a);
            }
            return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
        }
        xj() {
            let a = this.xi;
            if (this.d4()) {
                if (this.dd.g) {
                    this.dd.t();
                }
                a = this.xm;
            }
            return a;
        }
        y7(a, b, c) {
            if (this.xg == null) {
                return 0;
            }
            return this.xg.ov(a, b, c, this.index);
        }
        go() {
            return this.yn;
        }
        xq() {
            return 11;
        }
        c5() {
            return 3;
        }
        c8() {
            return 3;
        }
        aao(a, b) {
            this.q3();
            this.ws = a.ad;
            b.a6();
        }
        aam(a, b) {
            a.x();
        }
        hf(a, b, c) {
            let d = super.hf(a, b, c);
            let e = c;
            if (this.dp == null || this.dp.count == 0 || !c.r() || b.isEmpty || a.isEmpty || this.xg == null || this.xz == null || e.cd.b < 1 || this.xg.b0 == null || this.xz.b0 == null || this.xz.pr == this.xz.pq || this.xg.itemsSource == null || this.xg.o5 < 1) {
                e.cd.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.cw.ca;
            a = this.cw.b9;
            return {
                p0: a,
                p1: b
            };
        }
        zb(a) {
            let b = 0;
            let c = a.ca;
            let d = a.b9;
            let e = this.getEffectiveViewport1(this.cw);
            if (!c.isEmpty && !d.isEmpty && this.xz != null) {
                let f = new ScalerParams(0, c, d, this.xz.df, e);
                f.b = this.i0();
                b = this.xz.ft(this.xz.p5, f);
            }
            return b;
        }
        pc() {
            super.pc();
            this.xk.y();
            this.xi.y();
            this.xm.y();
        }
        rz(a) {
            super.rz(a);
            this.xx.cd.e(this.ie);
            if (this.d7(this.cw)) {
                return;
            }
            if (this.gs) {
                if (this.d4()) {
                    this.aao(this.xm, this.xx);
                }
                else {
                    this.aao(this.xi, this.xx);
                }
                return;
            }
            if (this.gg(a)) {
                let b = this.xk;
                if (this.d4()) {
                    if (this.dd.g) {
                        this.dd.t();
                    }
                    this.xk = this.xm;
                    this.xm = b;
                }
                else {
                    this.xk = this.xi;
                    this.xi = b;
                }
                this.aam(this.xi, this.xx);
                let c = false;
                if (this.g4) {
                    this.dd.w();
                    this.dd.r = truncate(this.jd());
                    this.dd.b = this.df != null ? this.df : this.de;
                    if (this.g5) {
                        let d = this.xm;
                        this.xm = this.xk;
                        this.xk = d;
                        c = true;
                    }
                    this.xs.x(this, this.xk, this.xi, this.isVertical, this.xg, this.xz, this.xr, this.xq(), this.c6, this.c5(), () => this.zb(this.xx), this.xx.b9);
                    if (this.g5) {
                        let e = this.xm;
                        this.xm = this.xk;
                        this.xk = e;
                    }
                    this.g5 = false;
                }
                if (this.g7) {
                    this.dd.w();
                    this.dd.r = truncate(this.je());
                    this.dd.b = this.dg != null ? this.dg : this.de;
                    if (this.g2) {
                        let f = this.xm;
                        this.xm = this.xk;
                        this.xk = f;
                        c = true;
                    }
                    this.xs.x(this, this.xk, this.xi, this.isVertical, this.xg, this.xz, this.xr, this.xq(), this.c6, this.c5(), () => this.zb(this.xx), this.xx.b9);
                    let g = this.xi;
                    this.xi = this.xk;
                    this.xk = g;
                    if (this.g2) {
                        let h = this.xm;
                        this.xm = this.xk;
                        this.xk = h;
                    }
                    this.g2 = false;
                }
                this.eb = false;
                if (!c) {
                    this.o7();
                }
                this.sf();
                if (this.g4) {
                    this.g3 = false;
                    this.g6 = false;
                    this.gl = false;
                    this.g2 = true;
                }
                if (this.g7) {
                    this.g6 = false;
                    this.g5 = true;
                }
            }
            else {
                this.aam(this.xi, this.xx);
                this.aao(this.xi, this.xx);
            }
        }
        gp() {
            return true;
        }
        yp(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.ya == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.yb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.yc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.x9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.ye == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get yq() {
            return this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null;
        }
        yl() {
            return this.typical != null;
        }
        aae(a) {
            this.typical(this, a);
        }
        get yy() {
            return this.yv();
        }
        *_yv() {
            let a = false;
            if (this.yl()) {
                let b = this.xt(0, this.dp.count);
                this.aae(new FinancialEventArgs(0, this.dp.count, b, this.xu(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.yq && this.xg.i$b != null) {
                    let d = this.dp.count;
                    let e = this.xg.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.ya.item(e.item(f)) + this.yb.item(e.item(f)) + this.x9.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.dp.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.ya.item(h) + this.yb.item(h) + this.x9.item(h)) / 3;
                    }
                }
            }
        }
        yv() {
            return toEnum(() => this._yv());
        }
        get yx() {
            return this.yu();
        }
        *_yu() {
            if (this.yq && this.xg.i$b != null) {
                let a = this.ya.count;
                let b = this.xg.i$b;
                if (a > 0) {
                    yield this.zc(this.ya.item(b.item(0)) - this.yb.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.zc(this.ya.item(b.item(c)) - this.yb.item(b.item(c))), Math.max(this.zc(Math.abs(this.ya.item(b.item(c)) - this.x9.item(b.item(c - 1)))), this.zc(Math.abs(this.yb.item(b.item(c)) - this.x9.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.ya.count;
                if (d > 0) {
                    yield this.zc(this.ya.item(0) - this.yb.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.zc(this.ya.item(e) - this.yb.item(e)), Math.max(this.zc(Math.abs(this.ya.item(e) - this.x9.item(e - 1))), this.zc(Math.abs(this.yb.item(e) - this.x9.item(e - 1)))));
                }
            }
        }
        yu() {
            return toEnum(() => this._yu());
        }
        get yw() {
            return this.yt();
        }
        *_yt() {
            if (this.yq && this.xg.i$b != null) {
                let a = this.yb.count;
                let b = this.xg.i$b;
                if (a > 0) {
                    yield this.zc(this.yb.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.zc(this.yb.item(b.item(c))), this.zc(this.x9.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.yb.count;
                if (d > 0) {
                    yield this.zc(this.yb.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.zc(this.yb.item(e)), this.zc(this.x9.item(e - 1)));
                }
            }
        }
        yt() {
            return toEnum(() => this._yt());
        }
        y0(a) {
            if (a == null) {
                return null;
            }
            if (this.yq && this.xg.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.xg.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        yz() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.dp != null && !this.yf) {
                this.yf = true;
                let b = this.xt(0, this.dp.count);
                this.yf = false;
                let c = new FinancialEventArgs(0, this.dp.count, b, this.xu(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.yc == null) {
                return null;
            }
            if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
                if (this.y4 != null) {
                    return this.y4.asArray();
                }
                let a = new List$1(Number_$type, 2, this.yc.count);
                let b = this.xg.i$b;
                let c = this.yc.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.y4 = a;
                return this.y4.asArray();
            }
            else {
                return this.yc.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.ya == null) {
                return null;
            }
            if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
                if (this.y2 != null) {
                    return this.y2.asArray();
                }
                let a = new List$1(Number_$type, 2, this.ya.count);
                let b = this.xg.i$b;
                let c = this.ya.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.y2 = a;
                return this.y2.asArray();
            }
            else {
                return this.ya.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.yb == null) {
                return null;
            }
            if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
                if (this.y3 != null) {
                    return this.y3.asArray();
                }
                let a = new List$1(Number_$type, 2, this.yb.count);
                let b = this.xg.i$b;
                let c = this.yb.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.y3 = a;
                return this.y3.asArray();
            }
            else {
                return this.yb.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.x9 == null) {
                return null;
            }
            if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
                if (this.y1 != null) {
                    return this.y1.asArray();
                }
                let a = new List$1(Number_$type, 2, this.x9.count);
                let b = this.xg.i$b;
                let c = this.x9.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.y1 = a;
                return this.y1.asArray();
            }
            else {
                return this.x9.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.ye == null) {
                return null;
            }
            if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
                if (this.y5 != null) {
                    return this.y5.asArray();
                }
                let a = new List$1(Number_$type, 2, this.ye.count);
                let b = this.xg.i$b;
                let c = this.ye.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.y5 = a;
                return this.y5.asArray();
            }
            else {
                return this.ye.asArray();
            }
        }
        ph(a, b, c, d) {
            super.ph(a, b, c, d);
            if (this.xg == null || !(typeCast(ISortingAxis_$type, this.xg) !== null)) {
                return;
            }
            let e = this.xg.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.y4 != null) {
                            this.y4.insert(f, this.yc.item(g));
                        }
                        if (this.y2 != null) {
                            this.y2.insert(f, this.ya.item(g));
                        }
                        if (this.y3 != null) {
                            this.y3.insert(f, this.yb.item(g));
                        }
                        if (this.y1 != null) {
                            this.y1.insert(f, this.x9.item(g));
                        }
                        if (this.y5 != null) {
                            this.y5.insert(f, this.ye.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.y4 != null) {
                        this.y4.v(b, c);
                    }
                    if (this.y2 != null) {
                        this.y2.v(b, c);
                    }
                    if (this.y3 != null) {
                        this.y3.v(b, c);
                    }
                    if (this.y1 != null) {
                        this.y1.v(b, c);
                    }
                    if (this.y5 != null) {
                        this.y5.v(b, c);
                    }
                    break;
                case 4:
                    if (this.y4 != null) {
                        this.y4 = new List$1(Number_$type, 0);
                    }
                    if (this.y2 != null) {
                        this.y2 = new List$1(Number_$type, 0);
                    }
                    if (this.y3 != null) {
                        this.y3 = new List$1(Number_$type, 0);
                    }
                    if (this.y1 != null) {
                        this.y1 = new List$1(Number_$type, 0);
                    }
                    if (this.y5 != null) {
                        this.y5 = 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.y4 != null) {
                            this.y4._inner[h] = this.yc.item(i);
                        }
                        if (this.y2 != null) {
                            this.y2._inner[h] = this.ya.item(i);
                        }
                        if (this.y3 != null) {
                            this.y3._inner[h] = this.yb.item(i);
                        }
                        if (this.y1 != null) {
                            this.y1._inner[h] = this.x9.item(i);
                        }
                        if (this.y5 != null) {
                            this.y5._inner[h] = this.ye.item(i);
                        }
                    }
                    break;
            }
            this.aap();
            this.sv();
        }
        xt(a, b) {
            let c = this.y0(this.yc);
            let d = this.y0(this.x9);
            let e = this.y0(this.ya);
            let f = this.y0(this.yb);
            let g = this.y0(this.ye);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.yy), this.yz());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.yx), ((() => {
                    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.yw), ((() => {
                    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.dp != null ? this.dp.count : 0;
                return $ret;
            })());
            return h;
        }
        zc(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        xu(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.hr;
                $ret.j = Series.hq;
                $ret.i = runOn(this, this.zc);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.xg;
        }
        r0(a, b) {
            super.r0(a, b);
            if (!this.g1) {
                this.cw.be(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.cv);
            this.cw.be(b);
            c.cd.e(this.ie);
            if (this.d7(this.cv)) {
                return;
            }
            this.r1();
            this.g1 = false;
        }
        r1() {
            super.r1();
            let a = typeCast(FinancialSeriesView.$, this.cv);
            if (!this.gt) {
                this.aam(this.xl, a);
            }
            this.gt = false;
            this.aao(this.xl, a);
        }
        rx(a, b, c, d, e) {
            super.rx(a, b, c, d, e);
            let f = this.ba.a$j.item(d);
            let g = f;
            g.cd.e(this.ie);
            f.bd(c);
            if (this.d7(g)) {
                return;
            }
            if (this.xh == null) {
                this.xh = new CategoryFrame(3);
            }
            this.xh.x();
            this.aam(this.xh, g);
            this.aao(this.xh, g);
        }
        aw(a) {
            if (this.xg == a) {
                return this.xz;
            }
            if (this.xz == a) {
                return this.xg;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.xg);
            return b != null ? b.preferredCategoryMode(this) : this.xo;
        }
        get xo() {
            return this.xn;
        }
        set xo(a) {
            let b = this.xo;
            if (a != b) {
                this.xn = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.xo));
            }
        }
        get_fn() {
            return true;
        }
        sb(a, b) {
            super.sb(a, b);
            this.aa6 = a;
        }
        aap() {
            this.io = this.x9 == null || this.x9.count == 0 ? NaN : this.x9.item(this.x9.count - 1);
        }
        kt(a) {
            if (this.xy != null && a != null) {
                if (this.x0 == null || this.x0.propertyName != this.xy.dateTimeMemberPath) {
                    this.x0 = new FastReflectionHelper(false, this.xy.dateTimeMemberPath);
                }
                let b = this.x0.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.xy.itemLabelFormat());
                }
            }
            return super.kt(a);
        }
    }
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:zk:aaq', [2, null], 'HighMemberPath:zx:aaw', [2, null], 'HighlightedCloseMemberPath:zn:aar', [2, null], 'HighlightedHighMemberPath:zp:aas', [2, null], 'HighlightedLowMemberPath:zr:aat', [2, null], 'HighlightedOpenMemberPath:zt:aau', [2, null], 'HighlightedVolumeMemberPath:zv:aav', [2, null], 'IsCustomCategoryStyleAllowed:ym:aax', [0, false], 'IsTransitionInEnabled:yn:aay', [0, false], 'LowMemberPath:z2:aaz', [2, null], 'NegativeBrush:aa6:aa0', [Brush.$, null], 'OpenMemberPath:z6:aa1', [2, null], 'TransitionInMode:xr:aa2', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:aaa:aa3', [2, null], 'XAxis:xg:aa4', [CategoryAxisBase.$, null], 'YAxis:xz:aa5', [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 = 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 = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', 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 = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
})();
/**
 * @hidden
 */
export let FinancialSeriesView = /*@__PURE__*/ (() => {
    class FinancialSeriesView extends SeriesView {
        constructor(a) {
            super(a);
            this.cf = null;
            this.cd = null;
            this.ch = 0;
            this.ch = -1;
            this.cf = a;
            this.cd = this.ce();
        }
        cg(a) {
            if (this.ch != a.w) {
                return true;
            }
            return false;
        }
        ci(a) {
            this.ch = a.w;
        }
        a4() {
            super.a4();
            if (!this.t) {
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.cf.xg.dc) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.cf.xg.hg != null) {
                a += "<span>${item." + this.cf.xg.hg + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.f.ba.a$u(this.f);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            let c = new SRProvider(this.ae);
            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.cf.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.cf.z6 + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.cf.zx + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.cf.z2 + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.cf.zk + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.cf.aaa)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.cf.aaa + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        an() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.f.wb = a;
            this.f.jq = 5;
            this.f.jr = 2;
            this.f.js = 2;
        }
    }
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
