/*
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, Type, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, Delegate_$type } from "igniteui-react-core/ES2015/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core/ES2015/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-react-core/ES2015/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core/ES2015/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./HighlightingInfo";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core/ES2015/FastReflectionHelper";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core/ES2015/IFastItemsSource";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-react-core/ES2015/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { dateToStringFormat } from "igniteui-react-core/ES2015/dateExtended";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core/ES2015/SRProvider";
import { Color } from "igniteui-react-core/ES2015/Color";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES2015/string";
export 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.$);
export 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.bw.eq;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    }
    e(a) {
        let b = this.a.bs;
        let c = this.a.br;
        let d = this.a.br;
        if (this.a.bw != null) {
            d = this.a.bw.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bw.lz == null) {
            this.b = 0;
            return;
        }
        let e = (this.a.bw.lz != null) ? this.a.bw.lz.b8 : false;
        let f = new ScalerParams(0, b, c, e, d);
        let g = this.a.bw.lh(this.a);
        let h = typeCast(ISortingAxis_$type, this.a.bw.lz);
        if (h == null || h.i$b == null) {
            let i = Math.floor(this.a.bw.lz.dw(g.left, f));
            let j = Math.ceil(this.a.bw.lz.dw(g.right, f));
            if (this.a.bw.lz.b8) {
                j = Math.ceil(this.a.bw.lz.dw(g.left, f));
                i = Math.floor(this.a.bw.lz.dw(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]);
export class FinancialSeries extends Series {
    constructor() {
        super();
        this.ms = null;
        this.mo = null;
        this.mq = null;
        this.mm = null;
        this.mv = null;
        this.mz = false;
        this.assigningCategoryStyle = null;
        this.l7 = null;
        this.na = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        this.nb = new Dictionary$2(String_$type, String_$type, 0);
        this.my = false;
        this.mi = null;
        this.l2 = null;
        this.l4 = null;
        this.l1 = null;
        this.ma = null;
        this.typical = null;
        this.typicalBasedOn = null;
        this.mx = false;
        this.nn = null;
        this.nl = null;
        this.nm = null;
        this.nk = null;
        this.no = null;
        this.l3 = null;
        this.l0 = null;
        this.l5 = 0;
        this.mj = null;
        this.ml = null;
        this.l7 = new CategorySeriesRenderManager();
        this.mz = false;
        this.ma = new CategoryTransitionSourceFramePreparer();
        this.l3 = new CategoryFrame(3);
        this.ab = FinancialSeries.$;
        this.l6 = 0;
    }
    il(a) {
        super.il(a);
        this.mf = a;
    }
    get_cr() {
        return true;
    }
    ag() {
        return [this.lz, this.mk];
    }
    nz() {
        return 2;
    }
    nx() {
        return 4;
    }
    ah(a) {
        let b = this.aj(this.lz, this.l1.f, this.nw(this.bi), this.ny(this.bi), this.lf(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.nz();
        f[0] = { $type: Point_$type, x: c[0], y: c[g] };
        f[1] = { $type: Point_$type, x: d[0], y: d[g] };
        e[0] = f;
        return e;
    }
    ai(a) {
        let b = this.aj(this.lz, this.l1.f, this.nw(this.bi), this.ny(this.bi), this.lf(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;
    }
    k0() {
        return this.o5;
    }
    hm() {
        super.hm();
        this.lz = null;
        this.mk = null;
    }
    get mt() {
        return this.ms;
    }
    set mt(a) {
        if (this.ms != a) {
            let b = this.ms;
            this.ms = a;
            this.raisePropertyChanged("OpenColumn", b, this.ms);
        }
    }
    get mp() {
        return this.mo;
    }
    set mp(a) {
        if (this.mo != a) {
            let b = this.mo;
            this.mo = a;
            this.raisePropertyChanged("HighColumn", b, this.mo);
        }
    }
    get mr() {
        return this.mq;
    }
    set mr(a) {
        if (this.mq != a) {
            let b = this.mq;
            this.mq = a;
            this.raisePropertyChanged("LowColumn", b, this.mq);
        }
    }
    get mn() {
        return this.mm;
    }
    set mn(a) {
        if (this.mm != a) {
            let b = this.mm;
            this.mm = a;
            this.raisePropertyChanged("CloseColumn", b, this.mm);
        }
    }
    get mw() {
        return this.mv;
    }
    set mw(a) {
        if (this.mv != a) {
            let b = this.mv;
            this.mv = a;
            this.raisePropertyChanged("VolumeColumn", b, this.mv);
        }
    }
    m7() {
        return (this.assigningCategoryStyle != null && this.mz) || this.cu;
    }
    or(a) {
        if (this.assigningCategoryStyle != null && this.mz) {
            this.assigningCategoryStyle(this, a);
        }
    }
    op(a, b, c, d, e, f) {
        let g = this.b9;
        this.l7.ac(a, b, c, d, e, f, g);
        let h = this.l7.c;
        let i = null;
        let j = this.bz;
        if (g && this.bs != null) {
            i = this.bs.az.getHighlightingInfo(this, j, d, h.m, h.l, false);
            h.b = i;
        }
        h.f = f;
        this.or(h);
        this.l7.aa(i, f, g);
    }
    np(a) {
        return this.d9(a, this.lz);
    }
    fa(a, b) {
        return this.fb(a, b, this.lz, runOn(this, this.np), new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw));
    }
    e8(a, b) {
        return this.e9(a, b, this.lz, runOn(this, this.np), new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw));
    }
    d5(a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        let f = this.lz.jr;
        return this.d6(a, b, this.lz, d, e, f, runOn(this, this.np));
    }
    getOffsetValue() {
        return this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.lz.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    lc(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, null, null, null);
    }
    ej(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(new FinancialValueList(this.mt, this.mp, this.mr, this.mn, this.mw), a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    ef(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mp, a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    eh(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mr, a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    nr(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mn, a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    ns(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mt, a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    nt(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.nq(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.lz.b8, d);
        return this.el(this.mw, a, this.lz, f, e, runOn(this, this.np), b, c);
    }
    k8(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.ef), (d, e) => this.fb(d, e, this.lz, runOn(this, this.np), this.mp), (d, e) => this.e9(d, e, this.lz, runOn(this, this.np), this.mp));
    }
    la(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.eh), (d, e) => this.fb(d, e, this.lz, runOn(this, this.np), this.mr), (d, e) => this.e9(d, e, this.lz, runOn(this, this.np), this.mr));
    }
    o7(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.ns), (d, e) => this.fb(d, e, this.lz, runOn(this, this.np), this.mt), (d, e) => this.e9(d, e, this.lz, runOn(this, this.np), this.mt));
    }
    o6(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.nr), (d, e) => this.fb(d, e, this.lz, runOn(this, this.np), this.mn), (d, e) => this.e9(d, e, this.lz, runOn(this, this.np), this.mn));
    }
    o8(a, b, c) {
        return this.le(a, b, c, this.nq(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mk, this.lz, runOn(this, this.nt), (d, e) => this.fb(d, e, this.lz, runOn(this, this.np), this.mw), (d, e) => this.e9(d, e, this.lz, runOn(this, this.np), this.mw));
    }
    h3() {
        super.h3();
        if (this.lz != null) {
            this.lz.g0(false);
        }
        if (this.mk != null) {
            this.mk.g0(false);
        }
    }
    jk(a, b) {
        this.mf.bu.e(this.eq);
        this.i4(false);
    }
    jj(a, b) {
        if (this.dk && this.ev < 0.05) {
            this.dl = true;
        }
        this.mf.bu.e(this.eq);
        this.i4(false);
    }
    mu(a, b, c) {
        let d = this.bw(b);
        this.na.addItem(d, b);
        this.nb.addItem(b, c);
        return d;
    }
    oo(a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        let c = this.na.item(b);
        this.nb.removeItem(c);
        this.na.removeItem(b);
    }
    ir(a, b, c, d) {
        super.ir(a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.lz != null) {
                        this.lz.bv(this);
                    }
                    if (this.mk != null) {
                        this.mk.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.lz != null) {
                        this.lz.ch(this);
                    }
                    if (this.mk != null) {
                        this.mk.ch(this);
                    }
                }
                this.mf.bu.e(this.eq);
                this.i4(false);
                break;
            case "FastItemsSource":
                this.my = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mt);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mp);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mr);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mn);
                    this.oo(typeCast(IFastItemsSource_$type, c), this.mw);
                    this.mt = null;
                    this.mp = null;
                    this.mr = null;
                    this.mn = null;
                    this.mw = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (this.of != null) {
                        this.mt = this.mu(typeCast(IFastItemsSource_$type, d), this.of, "OpenColumn");
                    }
                    if (this.n6 != null) {
                        this.mp = this.mu(typeCast(IFastItemsSource_$type, d), this.n6, "HighColumn");
                    }
                    if (this.ob != null) {
                        this.mr = this.mu(typeCast(IFastItemsSource_$type, d), this.ob, "LowColumn");
                    }
                    if (this.n3 != null) {
                        this.mn = this.mu(typeCast(IFastItemsSource_$type, d), this.n3, "CloseColumn");
                    }
                    if (this.oj != null) {
                        this.mw = this.mu(typeCast(IFastItemsSource_$type, d), this.oj, "VolumeColumn");
                    }
                }
                this.my = false;
                if (this.mk != null && !this.mk.ck()) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mt);
                    this.mt = this.mu(this.bz, this.of, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mp);
                    this.mp = this.mu(this.bz, this.n6, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mr);
                    this.mr = this.mu(this.bz, this.ob, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mn);
                    this.mn = this.mu(this.bz, this.n3, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                this.ot();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.oo(this.bz, this.mw);
                    this.mw = this.mu(this.bz, this.oj, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mk != null && !this.mk.ck() && !this.my) {
                    this.mf.bu.e(this.eq);
                    this.i4(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mf.bu.e(this.eq);
                this.i4(false);
                this.ib();
                this.mj = typeCast(ITimeRangeSelectorAxis_$type, this.lz);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mf.bu.e(this.eq);
                if (this.mk != null) {
                    this.mk.ck();
                }
                {
                    this.i4(false);
                }
                this.ib();
                break;
            case "TransitionProgress":
                this.l4.c(this.ev, this.l2, this.l1);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ev == 1) {
                    this.l1.v();
                    this.os(this.l1, this.mf);
                    if (this.dk) {
                        this.dk = false;
                        this.hp();
                        this.bt.r = truncate(this.em());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.os(this.l4, this.mf);
                }
                if (this.bs != null) {
                    this.bs.jh(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.i4(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.mz = this.m2();
                this.i4(false);
                break;
            case "CategoryMode":
                if (this.lz != null) {
                    this.lz.kg(true);
                }
                break;
        }
    }
    m1(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    m0(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    ls(a, b, c) {
        if (b < a || a < 0 || a > this.bz.count || b < 0 || b > this.bz.count || c == null) {
            return null;
        }
        let d = new Array((b - a) + 1);
        let e = c.cc;
        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.bz.item(g);
        }
        return d;
    }
    nw(a) {
        return a.bu.b;
    }
    ny(a) {
        return a.bu.c;
    }
    lr(a, b) {
        return this.ls(a, b, this.mk);
    }
    get_m3() {
        return false;
    }
    get m3() {
        return this.get_m3();
    }
    get_cv() {
        return true;
    }
    at(a, b) {
        if (this.m3) {
            let c = this.mh(a, b, this.mi);
            this.mi = c;
            return c;
        }
        else {
            let d = this.mg(a, b, this.mi);
            this.mi = d;
            return d;
        }
    }
    n0(a) {
        let b = this.l1;
        if (this.ca()) {
            b = this.l4;
        }
        let c = this.bi.br;
        let d = this.bi.bs;
        let e = this.lz;
        let f = 0;
        if (e.ce) {
            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;
    }
    mh(a, b, c) {
        let d = this.bz.count;
        let e = this.mf.bu.c;
        let f = this.mf.bu.d;
        let g = this.mf.bu.b;
        let h = this.lz;
        let i = -1;
        let j = -1;
        if (h.cc) {
            let k = this.l1;
            if (this.ca()) {
                k = this.l4;
            }
            let l = this.n0(b);
            i = l;
            j = l;
        }
        else {
            let m = this.e4(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.f == i && c.e == j) {
            return c;
        }
        let n = new HighlightingInfo();
        n.b = this;
        n.f = i;
        n.e = j;
        return n;
    }
    mg(a, b, c) {
        let d = new HighlightingInfo();
        d.b = this;
        d.f = 0;
        d.e = this.bz.count - 1;
        if (c != null && c.f == d.f && c.e == d.e) {
            return c;
        }
        return d;
    }
    m2() {
        return this.m5;
    }
    d7(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = -1;
        if (!b.isEmpty && !c.isEmpty && this.lz != null) {
            let e = this.getEffectiveViewport1(this.bi);
            let f = new ScalerParams(0, b, c, this.lz.b8, e);
            let g = this.lh(this.bi);
            let h = this.lz.dw(g.left, f);
            let i = this.lz.dw(g.right, f);
            let j = (a.x - b.left) / b.width;
            let k = h + (j * (i - h));
            if (this.lz.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    }
    e4(a) {
        return truncate(Math.round(this.d7(a)));
    }
    get_c1() {
        return typeCast(ISortingAxis_$type, this.lz) !== null;
    }
    ap() {
        return this.lz;
    }
    e6(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = this.getEffectiveViewport1(this.bi);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        let e = new Rect(0, 0, 0, 1, 1);
        let f = new ScalerParams(0, b, c, this.lz.b8, d);
        let g = typeCast(ISortingAxis_$type, this.lz);
        let h = this.lh(this.bi);
        let i = h.left;
        let j = h.right;
        let k = this.k7(a).x;
        let l = this.lz.dw(k, f);
        let m = this.lz.dw(i, f);
        let n = this.lz.dw(j, f);
        l = Math.max(m, Math.min(n, l));
        let o = g.i$f(l);
        return o;
    }
    fl(a) {
        let b = 0;
        if (typeCast(ISortingAxis_$type, this.lz) !== null) {
            b = this.e6(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e4(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    nq(a, b, c) {
        if (this.lz == null) {
            return 0;
        }
        return this.lz.jl(a, b, c, this.fd);
    }
    da() {
        return this.m6;
    }
    l8() {
        return 11;
    }
    bo() {
        return 3;
    }
    os(a, b) {
        this.lg = a.aa;
        b.ar();
    }
    oq(a, b) {
        a.u();
    }
    du(a, b, c) {
        let d = super.du(a, b, c);
        let e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.lz == null || this.mk == null || e.bu.b < 1 || this.lz.bf == null || this.mk.bf == null || this.mk.jx == this.mk.jw || this.lz.itemsSource == null || this.lz.jr < 1) {
            e.bu.b = 0;
            d = false;
        }
        return d;
    }
    getViewInfo(a, b) {
        b = this.bi.bs;
        a = this.bi.br;
        return {
            p0: a,
            p1: b
        };
    }
    nu(a) {
        let b = 0;
        let c = a.bs;
        let d = a.br;
        let e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.mk != null) {
            let f = new ScalerParams(0, c, d, this.mk.b8, e);
            f.b = this.ed();
            b = this.mk.dt(this.mk.j7, f);
        }
        return b;
    }
    hp() {
        super.hp();
        this.l2.v();
        this.l1.v();
        this.l4.v();
    }
    i5(a) {
        super.i5(a);
        this.mf.bu.e(this.eq);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.dc) {
            if (this.ca()) {
                this.os(this.l4, this.mf);
            }
            else {
                this.os(this.l1, this.mf);
            }
            return;
        }
        if (this.c8(a)) {
            let b = this.l2;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.l2 = this.l4;
                this.l4 = b;
            }
            else {
                this.l2 = this.l1;
                this.l1 = b;
            }
            this.oq(this.l1, this.mf);
            if (this.dm) {
                this.bt.w();
                this.bt.r = truncate(this.en());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.ma.p(this.l2, this.l1, this.isVertical, this.lz, this.mk, this.l9, this.l8(), this.bp, this.bo(), () => this.nu(this.mf), this.mf.br);
            }
            this.hl();
            this.jc();
            if (this.dm) {
                this.dl = false;
                this.dk = true;
            }
        }
        else {
            this.oq(this.l1, this.mf);
            this.os(this.l1, this.mf);
        }
    }
    m8(a) {
        for (let b of fromEnum(a)) {
            switch (b) {
                case "HighColumn":
                    if (this.mp == null) {
                        return false;
                    }
                    break;
                case "LowColumn":
                    if (this.mr == null) {
                        return false;
                    }
                    break;
                case "OpenColumn":
                    if (this.mt == null) {
                        return false;
                    }
                    break;
                case "CloseColumn":
                    if (this.mn == null) {
                        return false;
                    }
                    break;
                case "VolumeColumn":
                    if (this.mw == null) {
                        return false;
                    }
                    break;
            }
        }
        return true;
    }
    get m9() {
        return this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null;
    }
    m4() {
        return this.typical != null;
    }
    on(a) {
        this.typical(this, a);
    }
    get nh() {
        return this.ne();
    }
    *_ne() {
        let a = false;
        if (this.m4()) {
            let b = this.mb(0, this.bz.count);
            this.on(new FinancialEventArgs(0, this.bz.count, b, this.mc(b), this));
            if (b.typicalColumn != null) {
                a = true;
                for (let c of fromEnum(b.typicalColumn)) {
                    yield c;
                }
            }
        }
        if (!a) {
            if (this.m9 && this.lz.i$b != null) {
                let d = this.bz.count;
                let e = this.lz.i$b;
                for (let f = 0; f < d; ++f) {
                    yield (this.mp.item(e.item(f)) + this.mr.item(e.item(f)) + this.mn.item(e.item(f))) / 3;
                }
            }
            else {
                let g = this.bz.count;
                for (let h = 0; h < g; ++h) {
                    yield (this.mp.item(h) + this.mr.item(h) + this.mn.item(h)) / 3;
                }
            }
        }
    }
    ne() {
        return toEnum(() => this._ne());
    }
    get ng() {
        return this.nd();
    }
    *_nd() {
        if (this.m9 && this.lz.i$b != null) {
            let a = this.mp.count;
            let b = this.lz.i$b;
            if (a > 0) {
                yield this.nv(this.mp.item(b.item(0)) - this.mr.item(b.item(0)));
            }
            for (let c = 1; c < a; ++c) {
                yield Math.max(this.nv(this.mp.item(b.item(c)) - this.mr.item(b.item(c))), Math.max(this.nv(Math.abs(this.mp.item(b.item(c)) - this.mn.item(b.item(c - 1)))), this.nv(Math.abs(this.mr.item(b.item(c)) - this.mn.item(b.item(c - 1))))));
            }
        }
        else {
            let d = this.mp.count;
            if (d > 0) {
                yield this.nv(this.mp.item(0) - this.mr.item(0));
            }
            for (let e = 1; e < d; ++e) {
                yield Math.max(this.nv(this.mp.item(e) - this.mr.item(e)), Math.max(this.nv(Math.abs(this.mp.item(e) - this.mn.item(e - 1))), this.nv(Math.abs(this.mr.item(e) - this.mn.item(e - 1)))));
            }
        }
    }
    nd() {
        return toEnum(() => this._nd());
    }
    get nf() {
        return this.nc();
    }
    *_nc() {
        if (this.m9 && this.lz.i$b != null) {
            let a = this.mr.count;
            let b = this.lz.i$b;
            if (a > 0) {
                yield this.nv(this.mr.item(b.item(0)));
            }
            for (let c = 1; c < a; c++) {
                yield Math.min(this.nv(this.mr.item(b.item(c))), this.nv(this.mn.item(b.item(c - 1))));
            }
        }
        else {
            let d = this.mr.count;
            if (d > 0) {
                yield this.nv(this.mr.item(0));
            }
            for (let e = 1; e < d; e++) {
                yield Math.min(this.nv(this.mr.item(e)), this.nv(this.mn.item(e - 1)));
            }
        }
    }
    nc() {
        return toEnum(() => this._nc());
    }
    nj(a) {
        if (a == null) {
            return null;
        }
        if (this.m9 && this.lz.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.lz.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    }
    ni() {
        let a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.bz != null && !this.mx) {
            this.mx = true;
            let b = this.mb(0, this.bz.count);
            this.mx = false;
            let c = new FinancialEventArgs(0, this.bz.count, b, this.mc(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    }
    getOpenColumnAsArray() {
        if (this.mt == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nn != null) {
                return this.nn.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mt.count);
            let b = this.lz.i$b;
            let c = this.mt.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nn = a;
            return this.nn.asArray();
        }
        else {
            return this.mt.asArray();
        }
    }
    getHighColumnAsArray() {
        if (this.mp == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nl != null) {
                return this.nl.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mp.count);
            let b = this.lz.i$b;
            let c = this.mp.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nl = a;
            return this.nl.asArray();
        }
        else {
            return this.mp.asArray();
        }
    }
    getLowColumnAsArray() {
        if (this.mr == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nm != null) {
                return this.nm.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mr.count);
            let b = this.lz.i$b;
            let c = this.mr.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nm = a;
            return this.nm.asArray();
        }
        else {
            return this.mr.asArray();
        }
    }
    getCloseColumnAsArray() {
        if (this.mn == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.nk != null) {
                return this.nk.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mn.count);
            let b = this.lz.i$b;
            let c = this.mn.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nk = a;
            return this.nk.asArray();
        }
        else {
            return this.mn.asArray();
        }
    }
    getVolumeColumnAsArray() {
        if (this.mw == null) {
            return null;
        }
        if (this.lz != null && typeCast(ISortingAxis_$type, this.lz) !== null) {
            if (this.no != null) {
                return this.no.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mw.count);
            let b = this.lz.i$b;
            let c = this.mw.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.no = a;
            return this.no.asArray();
        }
        else {
            return this.mw.asArray();
        }
    }
    hr(a, b, c, d) {
        super.hr(a, b, c, d);
        if (this.lz == null || !(typeCast(ISortingAxis_$type, this.lz) !== null)) {
            return;
        }
        let e = this.lz.i$b;
        switch (a) {
            case 1:
                for (let f = b; f < c; f++) {
                    let g = e._inner[f];
                    if (this.nn != null) {
                        this.nn.insert(f, this.mt.item(g));
                    }
                    if (this.nl != null) {
                        this.nl.insert(f, this.mp.item(g));
                    }
                    if (this.nm != null) {
                        this.nm.insert(f, this.mr.item(g));
                    }
                    if (this.nk != null) {
                        this.nk.insert(f, this.mn.item(g));
                    }
                    if (this.no != null) {
                        this.no.insert(f, this.mw.item(g));
                    }
                }
                break;
            case 0:
                if (this.nn != null) {
                    this.nn.v(b, c);
                }
                if (this.nl != null) {
                    this.nl.v(b, c);
                }
                if (this.nm != null) {
                    this.nm.v(b, c);
                }
                if (this.nk != null) {
                    this.nk.v(b, c);
                }
                if (this.no != null) {
                    this.no.v(b, c);
                }
                break;
            case 4:
                if (this.nn != null) {
                    this.nn = new List$1(Number_$type, 0);
                }
                if (this.nl != null) {
                    this.nl = new List$1(Number_$type, 0);
                }
                if (this.nm != null) {
                    this.nm = new List$1(Number_$type, 0);
                }
                if (this.nk != null) {
                    this.nk = new List$1(Number_$type, 0);
                }
                if (this.no != null) {
                    this.no = 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.nn != null) {
                        this.nn._inner[h] = this.mt.item(i);
                    }
                    if (this.nl != null) {
                        this.nl._inner[h] = this.mp.item(i);
                    }
                    if (this.nm != null) {
                        this.nm._inner[h] = this.mr.item(i);
                    }
                    if (this.nk != null) {
                        this.nk._inner[h] = this.mn.item(i);
                    }
                    if (this.no != null) {
                        this.no._inner[h] = this.mw.item(i);
                    }
                }
                break;
        }
        this.ot();
        this.jh();
    }
    mb(a, b) {
        let c = this.nj(this.mt);
        let d = this.nj(this.mn);
        let e = this.nj(this.mp);
        let f = this.nj(this.mr);
        let g = this.nj(this.mw);
        let h = ((() => {
            let $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.nh), this.ni());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.ng), ((() => {
                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.nf), ((() => {
                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.bz != null ? this.bz.count : 0;
            return $ret;
        })());
        return h;
    }
    nv(a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    }
    mc(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.dx;
            $ret.j = Series.dw;
            $ret.i = runOn(this, this.nv);
            return $ret;
        })());
    }
    get categoryAxis() {
        return this.lz;
    }
    i6(a, b) {
        super.i6(a, b);
        if (!this.dj) {
            this.bi.az(b);
            return;
        }
        let c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.eq);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.dd) {
            this.oq(this.l3, c);
        }
        this.dd = false;
        this.os(this.l3, c);
        this.dj = false;
    }
    i3(a, b, c, d, e) {
        super.i3(a, b, c, d, e);
        let f = this.a0.a$h.item(d);
        let g = f;
        g.bu.e(this.eq);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.l0 == null) {
            this.l0 = new CategoryFrame(3);
        }
        this.l0.u();
        this.oq(this.l0, g);
        this.os(this.l0, g);
    }
    am(a) {
        if (this.lz == a) {
            return this.mk;
        }
        if (this.mk == a) {
            return this.lz;
        }
        return null;
    }
    preferredCategoryMode(a) {
        let b = typeCast(IDateTimeAxis_$type, this.lz);
        return b != null ? b.preferredCategoryMode(this) : this.l6;
    }
    get l6() {
        return this.l5;
    }
    set l6(a) {
        let b = this.l6;
        if (a != b) {
            this.l5 = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.l6));
        }
    }
    get_cz() {
        return true;
    }
    i9(a, b) {
        super.i9(a, b);
        this.o5 = a;
    }
    ot() {
        this.d4 = this.mn == null || this.mn.count == 0 ? NaN : this.mn.item(this.mn.count - 1);
    }
    fn(a) {
        if (this.mj != null && a != null) {
            if (this.ml == null || this.ml.e != this.mj.dateTimeMemberPath) {
                this.ml = new FastReflectionHelper(false, this.mj.dateTimeMemberPath);
            }
            let b = this.ml.c(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.mj.itemLabelFormat());
            }
        }
        return super.fn(a);
    }
}
FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:n3:ou', [2, null], 'HighMemberPath:n6:ov', [2, null], 'IsCustomCategoryStyleAllowed:m5:ow', [0, false], 'IsTransitionInEnabled:m6:ox', [0, false], 'LowMemberPath:ob:oy', [2, null], 'NegativeBrush:o5:oz', [Brush.$, null], 'OpenMemberPath:of:o0', [2, null], 'TransitionInMode:l9:o1', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:oj:o2', [2, null], 'XAxis:lz:o3', [CategoryAxisBase.$, null], 'YAxis:mk:o4', [NumericYAxis.$, null]]);
export 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');
export 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));
export 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');
export class FinancialSeriesView extends SeriesView {
    constructor(a) {
        super(a);
        this.bw = null;
        this.bu = null;
        this.by = 0;
        this.by = -1;
        this.bw = a;
        this.bu = this.bv();
    }
    bx(a) {
        if (this.by != a.t) {
            return true;
        }
        return false;
    }
    bz(a) {
        this.by = a.t;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 6;
        }
    }
    getDefaultTooltipTemplate() {
        let a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bw.lz.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.lz.e2 != null) {
            a += "<span>${item." + this.bw.lz.e2 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        let b = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        let c = new SRProvider(this.t);
        let d = c.al("financialSeries_Open");
        let e = c.al("financialSeries_High");
        let f = c.al("financialSeries_Low");
        let g = c.al("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.bw.fr + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.of + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.n6 + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.ob + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.n3 + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.oj)) {
            let h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.oj + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k1 = a;
        this.e.er = 5;
        this.e.es = 2;
        this.e.et = 2;
    }
}
FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
