/*
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, Point_$type, String_$type, runOn, Number_$type, enumGetBox, 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 "./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-angular-core";
import { List$1 } from "igniteui-angular-core";
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.bz.fv;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.bv;
            let c = this.a.bu;
            let d = this.a.bu;
            if (this.a.bz != null) {
                d = this.a.bz.getEffectiveViewport1(this.a);
            }
            if (b.isEmpty || c.isEmpty || this.a.bz.qg == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.bz.qg != null) ? this.a.bz.qg.cg : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.bz.pv(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.bz.qg);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.bz.qg.el(g.left, f));
                let j = Math.ceil(this.a.bz.qg.el(g.right, f));
                if (this.a.bz.qg.cg) {
                    j = Math.ceil(this.a.bz.qg.el(g.left, f));
                    i = Math.floor(this.a.bz.qg.el(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.q7 = null;
            this.q5 = null;
            this.q6 = null;
            this.q4 = null;
            this.q8 = null;
            this.rh = false;
            this.assigningCategoryStyle = null;
            this.qp = null;
            this.rr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.rs = new Dictionary$2(String_$type, String_$type, 0);
            this.rg = false;
            this.q0 = null;
            this.qk = null;
            this.qm = null;
            this.qi = null;
            this.qs = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.rf = false;
            this.r4 = null;
            this.r2 = null;
            this.r3 = null;
            this.r1 = null;
            this.r5 = null;
            this.ql = null;
            this.qh = null;
            this.qn = 0;
            this.q1 = null;
            this.q3 = null;
            this.qp = new CategorySeriesRenderManager();
            this.rh = false;
            this.qs = new CategoryTransitionSourceFramePreparer();
            this.ql = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.qo = 0;
        }
        l2(a) {
            super.l2(a);
            this.qx = a;
        }
        get_dq() {
            return true;
        }
        ag() {
            return [this.qg, this.q2];
        }
        hy(a, b) {
            let c = this.js(b);
            if (c == FinancialSeries.$$p[6]) {
                return this.hz(a, b, this.sw);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.hz(a, b, this.sn);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.hz(a, b, this.ss);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.hz(a, b, this.sk);
            }
            if (c == FinancialSeries.$$p[8]) {
                return this.hz(a, b, this.s0);
            }
            return super.hy(a, b);
        }
        sg() {
            return 2;
        }
        se() {
            return 4;
        }
        ah(a) {
            let b = this.aj(this.qg, this.qi.f, this.sd(this.b0), this.sf(this.b0), this.pt(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.sg();
            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.qg, this.qi.f, this.sd(this.b0), this.sf(this.b0), this.pt(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;
        }
        pd() {
            return this.tm;
        }
        pe() {
            return this.tm;
        }
        kx() {
            super.kx();
            this.qg = null;
            this.q2 = null;
        }
        get_c6() {
            return true;
        }
        get_ek() {
            return this.q2 != null && this.q2.cg;
        }
        get rc() {
            return this.q7;
        }
        set rc(a) {
            if (this.q7 != a) {
                let b = this.q7;
                this.q7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.q7);
            }
        }
        get ra() {
            return this.q5;
        }
        set ra(a) {
            if (this.q5 != a) {
                let b = this.q5;
                this.q5 = a;
                this.raisePropertyChanged("HighColumn", b, this.q5);
            }
        }
        get rb() {
            return this.q6;
        }
        set rb(a) {
            if (this.q6 != a) {
                let b = this.q6;
                this.q6 = a;
                this.raisePropertyChanged("LowColumn", b, this.q6);
            }
        }
        get q9() {
            return this.q4;
        }
        set q9(a) {
            if (this.q4 != a) {
                let b = this.q4;
                this.q4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.q4);
            }
        }
        get re() {
            return this.q8;
        }
        set re(a) {
            if (this.q8 != a) {
                let b = this.q8;
                this.q8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.q8);
            }
        }
        ro() {
            return (this.assigningCategoryStyle != null && this.rh) || this.bk != 1;
        }
        s8(a) {
            if (this.assigningCategoryStyle != null && this.rh) {
                this.assigningCategoryStyle(this, a);
            }
        }
        s6(a, b, c, d, e, f) {
            let g = this.bk != 1;
            this.qp.a1(this.qp.b, d.cm, a, b, c, d, e, f, false);
            this.qp.ab(this.ft);
            let h = this.qp.aw;
            let i = null;
            let j = this.ck;
            if (g && this.cd != null) {
                i = this.cd.a7.getHighlightingInfo(this, j, h.o, h.n, false);
                h.b = i;
            }
            h.f = f;
            this.s8(h);
            this.qp.z(this, i, f, g, b < 0);
        }
        r6(a) {
            return this.f9(a, this.qg);
        }
        hl(a, b) {
            return this.hm(a, b, this.qg, runOn(this, this.r6), new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re));
        }
        hj(a, b) {
            return this.hk(a, b, this.qg, runOn(this, this.r6), new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re));
        }
        f5(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.qg.le;
            return this.f6(a, b, this.qg, d, e, f, runOn(this, this.r6));
        }
        getOffsetValue() {
            return this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        getCategoryWidth() {
            return this.qg.getCategorySize(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0));
        }
        pq(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, null, null, null);
        }
        gl(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(new FinancialValueList(this.rc, this.ra, this.rb, this.q9, this.re), a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        gh(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(this.ra, a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        gj(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(this.rb, a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        r8(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(this.q9, a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        r9(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(this.rc, a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        sa(a, b, c) {
            let d = this.getEffectiveViewport1(this.b0);
            let e = this.r7(this.b0.bv, this.b0.bu, d);
            let f = new ScalerParams(0, this.b0.bv, this.b0.bu, this.qg.cg, d);
            return this.gn(this.re, a, this.qg, f, e, runOn(this, this.r6), b, c);
        }
        pm(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.gh), (d, e) => this.hm(d, e, this.qg, runOn(this, this.r6), this.ra), (d, e) => this.hk(d, e, this.qg, runOn(this, this.r6), this.ra));
        }
        po(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.gj), (d, e) => this.hm(d, e, this.qg, runOn(this, this.r6), this.rb), (d, e) => this.hk(d, e, this.qg, runOn(this, this.r6), this.rb));
        }
        to(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.r9), (d, e) => this.hm(d, e, this.qg, runOn(this, this.r6), this.rc), (d, e) => this.hk(d, e, this.qg, runOn(this, this.r6), this.rc));
        }
        tn(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.r8), (d, e) => this.hm(d, e, this.qg, runOn(this, this.r6), this.q9), (d, e) => this.hk(d, e, this.qg, runOn(this, this.r6), this.q9));
        }
        tp(a, b, c) {
            return this.ps(a, b, c, this.r7(this.b0.bv, this.b0.bu, this.getEffectiveViewport1(this.b0)), this.q2, this.qg, runOn(this, this.sa), (d, e) => this.hm(d, e, this.qg, runOn(this, this.r6), this.re), (d, e) => this.hk(d, e, this.qg, runOn(this, this.r6), this.re));
        }
        li() {
            super.li();
            if (this.qg != null) {
                this.qg.h7(false);
            }
            if (this.q2 != null) {
                this.q2.h7(false);
            }
        }
        m9(a, b) {
            this.qx.bx.e(this.fv);
            this.ml(false);
        }
        m8(a, b) {
            if (this.e2 && this.g2 < 0.05) {
                this.e3 = true;
            }
            this.qx.bx.e(this.fv);
            this.ml(false);
        }
        rd(a, b, c) {
            let d = this.ch(b);
            this.rr.addItem(d, b);
            this.rs.addItem(b, c);
            return d;
        }
        s5(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.rr.item(b);
            this.rs.removeItem(c);
            this.rr.removeItem(b);
        }
        l7(a, b, c, d) {
            super.l7(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.b8 != null && this.cd != null) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.qg != null) {
                            this.qg.bz(this);
                        }
                        if (this.q2 != null) {
                            this.q2.bz(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.qg != null) {
                            this.qg.cs(this);
                        }
                        if (this.q2 != null) {
                            this.q2.cs(this);
                        }
                    }
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                    break;
                case "FastItemsSource":
                    this.rg = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.s5(typeCast(IFastItemsSource_$type, c), this.rc);
                        this.s5(typeCast(IFastItemsSource_$type, c), this.ra);
                        this.s5(typeCast(IFastItemsSource_$type, c), this.rb);
                        this.s5(typeCast(IFastItemsSource_$type, c), this.q9);
                        this.s5(typeCast(IFastItemsSource_$type, c), this.re);
                        this.rc = null;
                        this.ra = null;
                        this.rb = null;
                        this.q9 = null;
                        this.re = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.sw) == false) {
                            this.rc = this.rd(typeCast(IFastItemsSource_$type, d), this.sw, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.sn) == false) {
                            this.ra = this.rd(typeCast(IFastItemsSource_$type, d), this.sn, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.ss) == false) {
                            this.rb = this.rd(typeCast(IFastItemsSource_$type, d), this.ss, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.sk) == false) {
                            this.q9 = this.rd(typeCast(IFastItemsSource_$type, d), this.sk, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.s0) == false) {
                            this.re = this.rd(typeCast(IFastItemsSource_$type, d), this.s0, "VolumeColumn");
                        }
                    }
                    this.rg = false;
                    if (this.q2 != null && !this.q2.c0()) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case FinancialSeries.$$p[6]:
                    if (this.ck != null) {
                        this.s5(this.ck, this.rc);
                        this.rc = this.rd(this.ck, this.sw, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.q2 != null && !this.q2.c0() && !this.rg) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.ck != null) {
                        this.s5(this.ck, this.ra);
                        this.ra = this.rd(this.ck, this.sn, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.q2 != null && !this.q2.c0() && !this.rg) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case FinancialSeries.$$p[4]:
                    if (this.ck != null) {
                        this.s5(this.ck, this.rb);
                        this.rb = this.rd(this.ck, this.ss, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.q2 != null && !this.q2.c0() && !this.rg) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.ck != null) {
                        this.s5(this.ck, this.q9);
                        this.q9 = this.rd(this.ck, this.sk, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.q2 != null && !this.q2.c0() && !this.rg) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    this.ta();
                    break;
                case FinancialSeries.$$p[8]:
                    if (this.ck != null) {
                        this.s5(this.ck, this.re);
                        this.re = this.rd(this.ck, this.s0, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.q2 != null && !this.q2.c0() && !this.rg) {
                        this.qx.bx.e(this.fv);
                        this.ml(false);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.qx.bx.e(this.fv);
                    this.ml(false);
                    this.ls();
                    this.q1 = typeCast(ITimeRangeSelectorAxis_$type, this.qg);
                    break;
                case FinancialSeries.$$p[10]:
                    if (c != null) {
                        c.bz(this);
                    }
                    if (d != null) {
                        d.cs(this);
                    }
                    this.qx.bx.e(this.fv);
                    if (this.q2 != null) {
                        this.q2.c0();
                    }
                    {
                        this.ml(false);
                    }
                    this.ls();
                    break;
                case "TransitionProgress":
                    this.qm.c(this.g2, this.qk, this.qi);
                    if (this.cx(this.b0)) {
                        return;
                    }
                    if (this.g2 == 1) {
                        this.qi.v();
                        this.s9(this.qi, this.qx);
                        if (this.e2) {
                            this.e2 = false;
                            this.k1();
                            this.ce.r = truncate(this.go());
                            this.ce.b = this.cf;
                        }
                    }
                    else {
                        this.s9(this.qm, this.qx);
                    }
                    if (this.cd != null) {
                        this.cd.oa(this);
                    }
                    break;
                case FinancialSeries.$$p[5]:
                    this.ml(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.rh = this.rk();
                    this.ml(false);
                    break;
                case "CategoryMode":
                    if (this.qg != null) {
                        this.qg.l4(true);
                    }
                    break;
            }
        }
        rj(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        ri(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.cd) {
                return true;
            }
            return false;
        }
        p9(a, b, c) {
            if (b < a || a < 0 || a > this.ck.count || b < 0 || b > this.ck.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cm;
            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.ck.item(g);
            }
            return d;
        }
        sd(a) {
            return a.bx.b;
        }
        sf(a) {
            return a.bx.c;
        }
        p8(a, b) {
            return this.p9(a, b, this.q2);
        }
        get_dy() {
            return true;
        }
        ky() {
            super.ky();
            this.q0 = null;
        }
        aw(a, b, c) {
            if (this.c2 && this.eg(this.bk) && !c) {
                let d = this.qz(a, b, this.q0);
                this.q0 = d;
                return d;
            }
            else {
                let e = this.qy(a, b, this.q0);
                this.q0 = e;
                return e;
            }
        }
        sh(a) {
            let b = this.qj();
            let c = this.b0.bu;
            let d = this.b0.bv;
            let e = this.qg;
            let f = 0;
            if (e.co) {
                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;
        }
        qz(a, b, c) {
            let d = this.ck.count;
            let e = this.qx.bx.c;
            let f = this.qx.bx.d;
            let g = this.qx.bx.b;
            let h = this.qg;
            let i = -1;
            let j = -1;
            if (h.cm) {
                let k = this.qj();
                let l = this.sh(b);
                i = l;
                j = l;
            }
            else {
                let m = this.hf(b);
                i = truncate(Math.floor((intDivide(m, g)))) * g;
                j = i + (g - 1);
            }
            if (c != null && c.h == i && c.g == j) {
                return c;
            }
            let n = new HighlightingInfo();
            n.b = this;
            n.h = i;
            n.g = j;
            return n;
        }
        qy(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.ck.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        rk() {
            return this.rm;
        }
        f7(a) {
            let b = this.b0.bv;
            let c = this.b0.bu;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.qg != null) {
                let e = this.getEffectiveViewport1(this.b0);
                let f = new ScalerParams(0, b, c, this.qg.cg, e);
                let g = this.pv(this.b0);
                let h = this.qg.el(g.left, f);
                let i = this.qg.el(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.qg.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        hf(a) {
            return truncate(Math.round(this.f7(a)));
        }
        get_ea() {
            return typeCast(ISortingAxis_$type, this.qg) !== null;
        }
        ar() {
            return this.qg;
        }
        hh(a) {
            let b = this.b0.bv;
            let c = this.b0.bu;
            let d = this.getEffectiveViewport1(this.b0);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.qg.cg, d);
            let g = typeCast(ISortingAxis_$type, this.qg);
            let h = this.pv(this.b0);
            let i = h.left;
            let j = h.right;
            let k = this.pl(a).x;
            let l = this.qg.el(k, f);
            let m = this.qg.el(i, f);
            let n = this.qg.el(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        hv(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.qg) !== null) {
                b = this.hh(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.hf(a);
            }
            return b >= 0 && this.ck != null && b < this.ck.count ? this.ck.item(b) : null;
        }
        qj() {
            let a = this.qi;
            if (this.cv()) {
                if (this.ce.g) {
                    this.ce.t();
                }
                a = this.qm;
            }
            return a;
        }
        r7(a, b, c) {
            if (this.qg == null) {
                return 0;
            }
            return this.qg.k4(a, b, c, this.index);
        }
        es() {
            return this.rn;
        }
        qq() {
            return 11;
        }
        b9() {
            return 3;
        }
        s9(a, b) {
            this.pu = a.aa;
            b.au();
        }
        s7(a, b) {
            a.u();
        }
        fb(a, b, c) {
            let d = super.fb(a, b, c);
            let e = c;
            if (this.ck == null || this.ck.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.qg == null || this.q2 == null || e.bx.b < 1 || this.qg.bh == null || this.q2.bh == null || this.q2.lv == this.q2.lu || this.qg.itemsSource == null || this.qg.le < 1) {
                e.bx.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.b0.bv;
            a = this.b0.bu;
            return {
                p0: a,
                p1: b
            };
        }
        sb(a) {
            let b = 0;
            let c = a.bv;
            let d = a.bu;
            let e = this.getEffectiveViewport1(this.b0);
            if (!c.isEmpty && !d.isEmpty && this.q2 != null) {
                let f = new ScalerParams(0, c, d, this.q2.cg, e);
                f.b = this.ge();
                b = this.q2.ei(this.q2.l5, f);
            }
            return b;
        }
        k1() {
            super.k1();
            this.qk.v();
            this.qi.v();
            this.qm.v();
        }
        mm(a) {
            super.mm(a);
            this.qx.bx.e(this.fv);
            if (this.cx(this.b0)) {
                return;
            }
            if (this.eu) {
                if (this.cv()) {
                    this.s9(this.qm, this.qx);
                }
                else {
                    this.s9(this.qi, this.qx);
                }
                return;
            }
            if (this.ep(a)) {
                let b = this.qk;
                if (this.cv()) {
                    if (this.ce.g) {
                        this.ce.t();
                    }
                    this.qk = this.qm;
                    this.qm = b;
                }
                else {
                    this.qk = this.qi;
                    this.qi = b;
                }
                this.s7(this.qi, this.qx);
                if (this.e4) {
                    this.ce.w();
                    this.ce.r = truncate(this.gp());
                    this.ce.b = this.cg != null ? this.cg : this.cf;
                    this.qs.p(this.qk, this.qi, this.isVertical, this.qg, this.q2, this.qr, this.qq(), this.ca, this.b9(), () => this.sb(this.qx), this.qx.bu);
                }
                this.kw();
                this.mu();
                if (this.e4) {
                    this.e3 = false;
                    this.e2 = true;
                }
            }
            else {
                this.s7(this.qi, this.qx);
                this.s9(this.qi, this.qx);
            }
        }
        rp(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.ra == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.rb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.rc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.q9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.re == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get rq() {
            return this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null;
        }
        rl() {
            return this.typical != null;
        }
        s4(a) {
            this.typical(this, a);
        }
        get ry() {
            return this.rv();
        }
        *_rv() {
            let a = false;
            if (this.rl()) {
                let b = this.qt(0, this.ck.count);
                this.s4(new FinancialEventArgs(0, this.ck.count, b, this.qu(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.rq && this.qg.i$b != null) {
                    let d = this.ck.count;
                    let e = this.qg.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.ra.item(e.item(f)) + this.rb.item(e.item(f)) + this.q9.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.ck.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.ra.item(h) + this.rb.item(h) + this.q9.item(h)) / 3;
                    }
                }
            }
        }
        rv() {
            return toEnum(() => this._rv());
        }
        get rx() {
            return this.ru();
        }
        *_ru() {
            if (this.rq && this.qg.i$b != null) {
                let a = this.ra.count;
                let b = this.qg.i$b;
                if (a > 0) {
                    yield this.sc(this.ra.item(b.item(0)) - this.rb.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.sc(this.ra.item(b.item(c)) - this.rb.item(b.item(c))), Math.max(this.sc(Math.abs(this.ra.item(b.item(c)) - this.q9.item(b.item(c - 1)))), this.sc(Math.abs(this.rb.item(b.item(c)) - this.q9.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.ra.count;
                if (d > 0) {
                    yield this.sc(this.ra.item(0) - this.rb.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.sc(this.ra.item(e) - this.rb.item(e)), Math.max(this.sc(Math.abs(this.ra.item(e) - this.q9.item(e - 1))), this.sc(Math.abs(this.rb.item(e) - this.q9.item(e - 1)))));
                }
            }
        }
        ru() {
            return toEnum(() => this._ru());
        }
        get rw() {
            return this.rt();
        }
        *_rt() {
            if (this.rq && this.qg.i$b != null) {
                let a = this.rb.count;
                let b = this.qg.i$b;
                if (a > 0) {
                    yield this.sc(this.rb.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.sc(this.rb.item(b.item(c))), this.sc(this.q9.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.rb.count;
                if (d > 0) {
                    yield this.sc(this.rb.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.sc(this.rb.item(e)), this.sc(this.q9.item(e - 1)));
                }
            }
        }
        rt() {
            return toEnum(() => this._rt());
        }
        r0(a) {
            if (a == null) {
                return null;
            }
            if (this.rq && this.qg.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.qg.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        rz() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.ck != null && !this.rf) {
                this.rf = true;
                let b = this.qt(0, this.ck.count);
                this.rf = false;
                let c = new FinancialEventArgs(0, this.ck.count, b, this.qu(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.rc == null) {
                return null;
            }
            if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
                if (this.r4 != null) {
                    return this.r4.asArray();
                }
                let a = new List$1(Number_$type, 2, this.rc.count);
                let b = this.qg.i$b;
                let c = this.rc.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r4 = a;
                return this.r4.asArray();
            }
            else {
                return this.rc.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.ra == null) {
                return null;
            }
            if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
                if (this.r2 != null) {
                    return this.r2.asArray();
                }
                let a = new List$1(Number_$type, 2, this.ra.count);
                let b = this.qg.i$b;
                let c = this.ra.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r2 = a;
                return this.r2.asArray();
            }
            else {
                return this.ra.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.rb == null) {
                return null;
            }
            if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
                if (this.r3 != null) {
                    return this.r3.asArray();
                }
                let a = new List$1(Number_$type, 2, this.rb.count);
                let b = this.qg.i$b;
                let c = this.rb.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r3 = a;
                return this.r3.asArray();
            }
            else {
                return this.rb.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.q9 == null) {
                return null;
            }
            if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
                if (this.r1 != null) {
                    return this.r1.asArray();
                }
                let a = new List$1(Number_$type, 2, this.q9.count);
                let b = this.qg.i$b;
                let c = this.q9.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r1 = a;
                return this.r1.asArray();
            }
            else {
                return this.q9.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.re == null) {
                return null;
            }
            if (this.qg != null && typeCast(ISortingAxis_$type, this.qg) !== null) {
                if (this.r5 != null) {
                    return this.r5.asArray();
                }
                let a = new List$1(Number_$type, 2, this.re.count);
                let b = this.qg.i$b;
                let c = this.re.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.r5 = a;
                return this.r5.asArray();
            }
            else {
                return this.re.asArray();
            }
        }
        k3(a, b, c, d) {
            super.k3(a, b, c, d);
            if (this.qg == null || !(typeCast(ISortingAxis_$type, this.qg) !== null)) {
                return;
            }
            let e = this.qg.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.r4 != null) {
                            this.r4.insert(f, this.rc.item(g));
                        }
                        if (this.r2 != null) {
                            this.r2.insert(f, this.ra.item(g));
                        }
                        if (this.r3 != null) {
                            this.r3.insert(f, this.rb.item(g));
                        }
                        if (this.r1 != null) {
                            this.r1.insert(f, this.q9.item(g));
                        }
                        if (this.r5 != null) {
                            this.r5.insert(f, this.re.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.r4 != null) {
                        this.r4.v(b, c);
                    }
                    if (this.r2 != null) {
                        this.r2.v(b, c);
                    }
                    if (this.r3 != null) {
                        this.r3.v(b, c);
                    }
                    if (this.r1 != null) {
                        this.r1.v(b, c);
                    }
                    if (this.r5 != null) {
                        this.r5.v(b, c);
                    }
                    break;
                case 4:
                    if (this.r4 != null) {
                        this.r4 = new List$1(Number_$type, 0);
                    }
                    if (this.r2 != null) {
                        this.r2 = new List$1(Number_$type, 0);
                    }
                    if (this.r3 != null) {
                        this.r3 = new List$1(Number_$type, 0);
                    }
                    if (this.r1 != null) {
                        this.r1 = new List$1(Number_$type, 0);
                    }
                    if (this.r5 != null) {
                        this.r5 = 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.r4 != null) {
                            this.r4._inner[h] = this.rc.item(i);
                        }
                        if (this.r2 != null) {
                            this.r2._inner[h] = this.ra.item(i);
                        }
                        if (this.r3 != null) {
                            this.r3._inner[h] = this.rb.item(i);
                        }
                        if (this.r1 != null) {
                            this.r1._inner[h] = this.q9.item(i);
                        }
                        if (this.r5 != null) {
                            this.r5._inner[h] = this.re.item(i);
                        }
                    }
                    break;
            }
            this.ta();
            this.m5();
        }
        qt(a, b) {
            let c = this.r0(this.rc);
            let d = this.r0(this.q9);
            let e = this.r0(this.ra);
            let f = this.r0(this.rb);
            let g = this.r0(this.re);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.ry), this.rz());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.rx), ((() => {
                    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.rw), ((() => {
                    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.ck != null ? this.ck.count : 0;
                return $ret;
            })());
            return h;
        }
        sc(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        qu(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.fg;
                $ret.j = Series.ff;
                $ret.i = runOn(this, this.sc);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.qg;
        }
        mn(a, b) {
            super.mn(a, b);
            if (!this.e1) {
                this.b0.a2(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.bz);
            this.b0.a2(b);
            c.bx.e(this.fv);
            if (this.cx(this.bz)) {
                return;
            }
            if (!this.ev) {
                this.s7(this.ql, c);
            }
            this.ev = false;
            this.s9(this.ql, c);
            this.e1 = false;
        }
        mk(a, b, c, d, e) {
            super.mk(a, b, c, d, e);
            let f = this.a6.a$h.item(d);
            let g = f;
            g.bx.e(this.fv);
            f.a1(c);
            if (this.cx(g)) {
                return;
            }
            if (this.qh == null) {
                this.qh = new CategoryFrame(3);
            }
            this.qh.u();
            this.s7(this.qh, g);
            this.s9(this.qh, g);
        }
        an(a) {
            if (this.qg == a) {
                return this.q2;
            }
            if (this.q2 == a) {
                return this.qg;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.qg);
            return b != null ? b.preferredCategoryMode(this) : this.qo;
        }
        get qo() {
            return this.qn;
        }
        set qo(a) {
            let b = this.qo;
            if (a != b) {
                this.qn = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.qo));
            }
        }
        get_d4() {
            return true;
        }
        mq(a, b) {
            super.mq(a, b);
            this.tm = a;
        }
        ta() {
            this.f3 = this.q9 == null || this.q9.count == 0 ? NaN : this.q9.item(this.q9.count - 1);
        }
        hx(a) {
            if (this.q1 != null && a != null) {
                if (this.q3 == null || this.q3.propertyName != this.q1.dateTimeMemberPath) {
                    this.q3 = new FastReflectionHelper(false, this.q1.dateTimeMemberPath);
                }
                let b = this.q3.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.q1.itemLabelFormat());
                }
            }
            return super.hx(a);
        }
    }
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:sk:tb', [2, null], 'HighMemberPath:sn:tc', [2, null], 'IsCustomCategoryStyleAllowed:rm:td', [0, false], 'IsTransitionInEnabled:rn:te', [0, false], 'LowMemberPath:ss:tf', [2, null], 'NegativeBrush:tm:tg', [Brush.$, null], 'OpenMemberPath:sw:th', [2, null], 'TransitionInMode:qr:ti', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:s0:tj', [2, null], 'XAxis:qg:tk', [CategoryAxisBase.$, null], 'YAxis:q2:tl', [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.bz = null;
            this.bx = null;
            this.b1 = 0;
            this.b1 = -1;
            this.bz = a;
            this.bx = this.by();
        }
        b0(a) {
            if (this.b1 != a.t) {
                return true;
            }
            return false;
        }
        b2(a) {
            this.b1 = a.t;
        }
        as() {
            super.as();
            if (!this.q) {
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.bz.qg.cd) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.bz.qg.fz != null) {
                a += "<span>${item." + this.bz.qg.fz + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a6.a$r(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            let c = new SRProvider(this.w);
            let d = c.b1("financialSeries_Open");
            let e = c.b1("financialSeries_High");
            let f = c.b1("financialSeries_Low");
            let g = c.b1("financialSeries_Close");
            d = stringIsNullOrEmpty(d) ? "Open" : d;
            e = stringIsNullOrEmpty(e) ? "High" : e;
            f = stringIsNullOrEmpty(f) ? "Low" : f;
            g = stringIsNullOrEmpty(g) ? "Close" : g;
            a += ">" + this.bz.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.sw + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.sn + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.ss + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.sk + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.bz.s0)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.s0 + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.pf = a;
            this.e.gy = 5;
            this.e.gz = 2;
            this.e.g0 = 2;
        }
    }
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
