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