/*
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-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core";
import { IFastItemColumn$1_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./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";
import { List$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-react-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { dateToStringFormat } from "igniteui-react-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let FinancialEventArgs = /*@__PURE__*/ (() => {
    class FinancialEventArgs extends EventArgs {
        constructor(a, b, c, d, e) {
            super();
            this._position = 0;
            this._count = 0;
            this._dataSource = null;
            this._supportingCalculations = null;
            this._basedOn = null;
            this.position = a;
            this.count = b;
            this.dataSource = c;
            this.supportingCalculations = d;
            if (c != null) {
                c.series = e;
            }
        }
        get position() {
            return this._position;
        }
        set position(a) {
            this._position = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get dataSource() {
            return this._dataSource;
        }
        set dataSource(a) {
            this._dataSource = a;
        }
        get supportingCalculations() {
            return this._supportingCalculations;
        }
        set supportingCalculations(a) {
            this._supportingCalculations = a;
        }
        get basedOn() {
            return this._basedOn;
        }
        set basedOn(a) {
            this._basedOn = a;
        }
    }
    FinancialEventArgs.$t = /*@__PURE__*/ markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
})();
/**
 * @hidden
 */
export let FinancialBucketCalculator = /*@__PURE__*/ (() => {
    class FinancialBucketCalculator extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.c = 0;
            this.d = 0;
            this.b = 0;
            if (a == null) {
                throw new ArgumentNullException(0, "view");
            }
            this.a = a;
            this.c = -1;
            this.d = this.d;
            this.b = 0;
        }
        getBucket(a) {
            return null;
        }
        getBucketWithoutUnknowns(a) {
            return this.getBucket(a);
        }
        getErrorBucket(a, b) {
            return NaN;
        }
        getBucketInfo(a, b, c, d) {
            a = this.c;
            b = this.d;
            c = this.b;
            d = this.a.bz.fq;
            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.oh == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.bz.oh != null) ? this.a.bz.oh.ca : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.bz.ny(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.bz.oh);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.bz.oh.d2(g.left, f));
                let j = Math.ceil(this.a.bz.oh.d2(g.right, f));
                if (this.a.bz.oh.ca) {
                    j = Math.ceil(this.a.bz.oh.d2(g.left, f));
                    i = Math.floor(this.a.bz.oh.d2(g.right, f));
                }
                let k = Math.floor((j - i + 1) * a / g.width);
                this.b = truncate(Math.max(1, k));
                this.c = truncate(Math.floor(i / this.b));
                this.d = truncate(Math.ceil(j / this.b));
            }
            else {
                this.c = h.i$e(b, c, d, g);
                this.d = h.i$g(b, c, d, g);
                this.b = 1;
            }
        }
        cacheValues() {
        }
        unCacheValues() {
        }
    }
    FinancialBucketCalculator.$t = /*@__PURE__*/ markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
})();
/**
 * @hidden
 */
export let FinancialSeries = /*@__PURE__*/ (() => {
    class FinancialSeries extends Series {
        constructor() {
            super();
            this.o7 = null;
            this.o5 = null;
            this.o6 = null;
            this.o4 = null;
            this.o8 = null;
            this.ph = false;
            this.assigningCategoryStyle = null;
            this.op = null;
            this.pr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.ps = new Dictionary$2(String_$type, String_$type, 0);
            this.pg = false;
            this.o0 = null;
            this.ok = null;
            this.om = null;
            this.oj = null;
            this.os = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.pf = false;
            this.p4 = null;
            this.p2 = null;
            this.p3 = null;
            this.p1 = null;
            this.p5 = null;
            this.ol = null;
            this.oi = null;
            this.on = 0;
            this.o1 = null;
            this.o3 = null;
            this.op = new CategorySeriesRenderManager();
            this.ph = false;
            this.os = new CategoryTransitionSourceFramePreparer();
            this.ol = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.oo = 0;
        }
        kk(a) {
            super.kk(a);
            this.ox = a;
        }
        get_c6() {
            return true;
        }
        ag() {
            return [this.oh, this.o2];
        }
        gt(a, b) {
            let c = this.ic(b);
            if (c == FinancialSeries.$$p[6]) {
                return this.gu(a, b, this.qw);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.gu(a, b, this.qn);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.gu(a, b, this.qs);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.gu(a, b, this.qk);
            }
            if (c == FinancialSeries.$$p[8]) {
                return this.gu(a, b, this.q0);
            }
            return super.gt(a, b);
        }
        qg() {
            return 2;
        }
        qe() {
            return 4;
        }
        ah(a) {
            let b = this.aj(this.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), this.nw(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.qg();
            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.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), this.nw(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;
        }
        nh() {
            return this.rm;
        }
        ji() {
            super.ji();
            this.oh = null;
            this.o2 = null;
        }
        get pc() {
            return this.o7;
        }
        set pc(a) {
            if (this.o7 != a) {
                let b = this.o7;
                this.o7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.o7);
            }
        }
        get pa() {
            return this.o5;
        }
        set pa(a) {
            if (this.o5 != a) {
                let b = this.o5;
                this.o5 = a;
                this.raisePropertyChanged("HighColumn", b, this.o5);
            }
        }
        get pb() {
            return this.o6;
        }
        set pb(a) {
            if (this.o6 != a) {
                let b = this.o6;
                this.o6 = a;
                this.raisePropertyChanged("LowColumn", b, this.o6);
            }
        }
        get o9() {
            return this.o4;
        }
        set o9(a) {
            if (this.o4 != a) {
                let b = this.o4;
                this.o4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.o4);
            }
        }
        get pe() {
            return this.o8;
        }
        set pe(a) {
            if (this.o8 != a) {
                let b = this.o8;
                this.o8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.o8);
            }
        }
        po() {
            return (this.assigningCategoryStyle != null && this.ph) || this.be != 1;
        }
        q8(a) {
            if (this.assigningCategoryStyle != null && this.ph) {
                this.assigningCategoryStyle(this, a);
            }
        }
        q6(a, b, c, d, e, f) {
            let g = this.be != 1;
            this.op.a1(this.op.b, d.cf, a, b, c, d, e, f, false);
            this.op.ab(this.es);
            let h = this.op.aw;
            let i = null;
            let j = this.cd;
            if (g && this.b6 != null) {
                i = this.b6.az.getHighlightingInfo(this, j, h.o, h.n, false);
                h.b = i;
            }
            h.f = f;
            this.q8(h);
            this.op.z(this, i, f, g, b < 0);
        }
        p6(a) {
            return this.e6(a, this.oh);
        }
        gf(a, b) {
            return this.gg(a, b, this.oh, runOn(this, this.p6), new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe));
        }
        gd(a, b) {
            return this.ge(a, b, this.oh, runOn(this, this.p6), new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe));
        }
        e2(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.oh.j8;
            return this.e3(a, b, this.oh, d, e, f, runOn(this, this.p6));
        }
        getOffsetValue() {
            return this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
        }
        getCategoryWidth() {
            return this.oh.getCategorySize(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs));
        }
        nt(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, null, null, null);
        }
        fh(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(new FinancialValueList(this.pc, this.pa, this.pb, this.o9, this.pe), a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        fd(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(this.pa, a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        ff(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(this.pb, a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        p8(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(this.o9, a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        p9(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(this.pc, a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        qa(a, b, c) {
            let d = this.getEffectiveViewport1(this.bs);
            let e = this.p7(this.bs.bv, this.bs.bu, d);
            let f = new ScalerParams(0, this.bs.bv, this.bs.bu, this.oh.ca, d);
            return this.fj(this.pe, a, this.oh, f, e, runOn(this, this.p6), b, c);
        }
        np(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.fd), (d, e) => this.gg(d, e, this.oh, runOn(this, this.p6), this.pa), (d, e) => this.ge(d, e, this.oh, runOn(this, this.p6), this.pa));
        }
        nr(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.ff), (d, e) => this.gg(d, e, this.oh, runOn(this, this.p6), this.pb), (d, e) => this.ge(d, e, this.oh, runOn(this, this.p6), this.pb));
        }
        ro(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.p9), (d, e) => this.gg(d, e, this.oh, runOn(this, this.p6), this.pc), (d, e) => this.ge(d, e, this.oh, runOn(this, this.p6), this.pc));
        }
        rn(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.p8), (d, e) => this.gg(d, e, this.oh, runOn(this, this.p6), this.o9), (d, e) => this.ge(d, e, this.oh, runOn(this, this.p6), this.o9));
        }
        rp(a, b, c) {
            return this.nv(a, b, c, this.p7(this.bs.bv, this.bs.bu, this.getEffectiveViewport1(this.bs)), this.o2, this.oh, runOn(this, this.qa), (d, e) => this.gg(d, e, this.oh, runOn(this, this.p6), this.pe), (d, e) => this.ge(d, e, this.oh, runOn(this, this.p6), this.pe));
        }
        j2() {
            super.j2();
            if (this.oh != null) {
                this.oh.hc(false);
            }
            if (this.o2 != null) {
                this.o2.hc(false);
            }
        }
        lo(a, b) {
            this.ox.bx.e(this.fq);
            this.k3(false);
        }
        ln(a, b) {
            if (this.d3 && this.fw < 0.05) {
                this.d4 = true;
            }
            this.ox.bx.e(this.fq);
            this.k3(false);
        }
        pd(a, b, c) {
            let d = this.ca(b);
            this.pr.addItem(d, b);
            this.ps.addItem(b, c);
            return d;
        }
        q5(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.pr.item(b);
            this.ps.removeItem(c);
            this.pr.removeItem(b);
        }
        kp(a, b, c, d) {
            super.kp(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.b1 != null && this.b6 != null) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.oh != null) {
                            this.oh.bx(this);
                        }
                        if (this.o2 != null) {
                            this.o2.bx(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.oh != null) {
                            this.oh.ck(this);
                        }
                        if (this.o2 != null) {
                            this.o2.ck(this);
                        }
                    }
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                    break;
                case "FastItemsSource":
                    this.pg = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.q5(typeCast(IFastItemsSource_$type, c), this.pc);
                        this.q5(typeCast(IFastItemsSource_$type, c), this.pa);
                        this.q5(typeCast(IFastItemsSource_$type, c), this.pb);
                        this.q5(typeCast(IFastItemsSource_$type, c), this.o9);
                        this.q5(typeCast(IFastItemsSource_$type, c), this.pe);
                        this.pc = null;
                        this.pa = null;
                        this.pb = null;
                        this.o9 = null;
                        this.pe = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.qw) == false) {
                            this.pc = this.pd(typeCast(IFastItemsSource_$type, d), this.qw, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.qn) == false) {
                            this.pa = this.pd(typeCast(IFastItemsSource_$type, d), this.qn, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.qs) == false) {
                            this.pb = this.pd(typeCast(IFastItemsSource_$type, d), this.qs, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.qk) == false) {
                            this.o9 = this.pd(typeCast(IFastItemsSource_$type, d), this.qk, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.q0) == false) {
                            this.pe = this.pd(typeCast(IFastItemsSource_$type, d), this.q0, "VolumeColumn");
                        }
                    }
                    this.pg = false;
                    if (this.o2 != null && !this.o2.cn()) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case FinancialSeries.$$p[6]:
                    if (this.cd != null) {
                        this.q5(this.cd, this.pc);
                        this.pc = this.pd(this.cd, this.qw, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.o2 != null && !this.o2.cn() && !this.pg) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.cd != null) {
                        this.q5(this.cd, this.pa);
                        this.pa = this.pd(this.cd, this.qn, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.o2 != null && !this.o2.cn() && !this.pg) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case FinancialSeries.$$p[4]:
                    if (this.cd != null) {
                        this.q5(this.cd, this.pb);
                        this.pb = this.pd(this.cd, this.qs, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.o2 != null && !this.o2.cn() && !this.pg) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.cd != null) {
                        this.q5(this.cd, this.o9);
                        this.o9 = this.pd(this.cd, this.qk, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.o2 != null && !this.o2.cn() && !this.pg) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    this.ra();
                    break;
                case FinancialSeries.$$p[8]:
                    if (this.cd != null) {
                        this.q5(this.cd, this.pe);
                        this.pe = this.pd(this.cd, this.q0, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.o2 != null && !this.o2.cn() && !this.pg) {
                        this.ox.bx.e(this.fq);
                        this.k3(false);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (c != null) {
                        c.bx(this);
                    }
                    if (d != null) {
                        d.ck(this);
                    }
                    this.ox.bx.e(this.fq);
                    this.k3(false);
                    this.ka();
                    this.o1 = typeCast(ITimeRangeSelectorAxis_$type, this.oh);
                    break;
                case FinancialSeries.$$p[10]:
                    if (c != null) {
                        c.bx(this);
                    }
                    if (d != null) {
                        d.ck(this);
                    }
                    this.ox.bx.e(this.fq);
                    if (this.o2 != null) {
                        this.o2.cn();
                    }
                    {
                        this.k3(false);
                    }
                    this.ka();
                    break;
                case "TransitionProgress":
                    this.om.c(this.fw, this.ok, this.oj);
                    if (this.cp(this.bs)) {
                        return;
                    }
                    if (this.fw == 1) {
                        this.oj.v();
                        this.q9(this.oj, this.ox);
                        if (this.d3) {
                            this.d3 = false;
                            this.jm();
                            this.b7.r = truncate(this.fk());
                            this.b7.b = this.b8;
                        }
                    }
                    else {
                        this.q9(this.om, this.ox);
                    }
                    if (this.b6 != null) {
                        this.b6.k7(this);
                    }
                    break;
                case FinancialSeries.$$p[5]:
                    this.k3(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.ph = this.pk();
                    this.k3(false);
                    break;
                case "CategoryMode":
                    if (this.oh != null) {
                        this.oh.kw(true);
                    }
                    break;
            }
        }
        pj(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        pi(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
                return true;
            }
            return false;
        }
        oa(a, b, c) {
            if (b < a || a < 0 || a > this.cd.count || b < 0 || b > this.cd.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cf;
            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.cd.item(g);
            }
            return d;
        }
        qd(a) {
            return a.bx.b;
        }
        qf(a) {
            return a.bx.c;
        }
        n9(a, b) {
            return this.oa(a, b, this.o2);
        }
        get_da() {
            return true;
        }
        jj() {
            super.jj();
            this.o0 = null;
        }
        au(a, b, c) {
            if (this.cu && this.dl(this.be) && !c) {
                let d = this.oz(a, b, this.o0);
                this.o0 = d;
                return d;
            }
            else {
                let e = this.oy(a, b, this.o0);
                this.o0 = e;
                return e;
            }
        }
        qh(a) {
            let b = this.oj;
            if (this.cn()) {
                b = this.om;
            }
            let c = this.bs.bu;
            let d = this.bs.bv;
            let e = this.oh;
            let f = 0;
            if (e.ch) {
                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;
        }
        oz(a, b, c) {
            let d = this.cd.count;
            let e = this.ox.bx.c;
            let f = this.ox.bx.d;
            let g = this.ox.bx.b;
            let h = this.oh;
            let i = -1;
            let j = -1;
            if (h.cf) {
                let k = this.oj;
                if (this.cn()) {
                    k = this.om;
                }
                let l = this.qh(b);
                i = l;
                j = l;
            }
            else {
                let m = this.f9(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;
        }
        oy(a, b, c) {
            let d = new HighlightingInfo();
            d.b = this;
            d.h = 0;
            d.g = this.cd.count - 1;
            d.d = true;
            if (c != null && c.h == d.h && c.g == d.g) {
                return c;
            }
            return d;
        }
        pk() {
            return this.pm;
        }
        e4(a) {
            let b = this.bs.bv;
            let c = this.bs.bu;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.oh != null) {
                let e = this.getEffectiveViewport1(this.bs);
                let f = new ScalerParams(0, b, c, this.oh.ca, e);
                let g = this.ny(this.bs);
                let h = this.oh.d2(g.left, f);
                let i = this.oh.d2(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.oh.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        f9(a) {
            return truncate(Math.round(this.e4(a)));
        }
        get_dg() {
            return typeCast(ISortingAxis_$type, this.oh) !== null;
        }
        aq() {
            return this.oh;
        }
        gb(a) {
            let b = this.bs.bv;
            let c = this.bs.bu;
            let d = this.getEffectiveViewport1(this.bs);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.oh.ca, d);
            let g = typeCast(ISortingAxis_$type, this.oh);
            let h = this.ny(this.bs);
            let i = h.left;
            let j = h.right;
            let k = this.no(a).x;
            let l = this.oh.d2(k, f);
            let m = this.oh.d2(i, f);
            let n = this.oh.d2(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        gq(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.oh) !== null) {
                b = this.gb(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.f9(a);
            }
            return b >= 0 && this.cd != null && b < this.cd.count ? this.cd.item(b) : null;
        }
        p7(a, b, c) {
            if (this.oh == null) {
                return 0;
            }
            return this.oh.j1(a, b, c, this.gi);
        }
        dt() {
            return this.pn;
        }
        oq() {
            return 11;
        }
        b2() {
            return 3;
        }
        q9(a, b) {
            this.nx = a.aa;
            b.au();
        }
        q7(a, b) {
            a.u();
        }
        ec(a, b, c) {
            let d = super.ec(a, b, c);
            let e = c;
            if (this.cd == null || this.cd.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.oh == null || this.o2 == null || e.bx.b < 1 || this.oh.bh == null || this.o2.bh == null || this.o2.kd == this.o2.kc || this.oh.itemsSource == null || this.oh.j8 < 1) {
                e.bx.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.bs.bv;
            a = this.bs.bu;
            return {
                p0: a,
                p1: b
            };
        }
        qb(a) {
            let b = 0;
            let c = a.bv;
            let d = a.bu;
            let e = this.getEffectiveViewport1(this.bs);
            if (!c.isEmpty && !d.isEmpty && this.o2 != null) {
                let f = new ScalerParams(0, c, d, this.o2.ca, e);
                f.b = this.fa();
                b = this.o2.dz(this.o2.kn, f);
            }
            return b;
        }
        jm() {
            super.jm();
            this.ok.v();
            this.oj.v();
            this.om.v();
        }
        k4(a) {
            super.k4(a);
            this.ox.bx.e(this.fq);
            if (this.cp(this.bs)) {
                return;
            }
            if (this.dv) {
                if (this.cn()) {
                    this.q9(this.om, this.ox);
                }
                else {
                    this.q9(this.oj, this.ox);
                }
                return;
            }
            if (this.dr(a)) {
                let b = this.ok;
                if (this.cn()) {
                    if (this.b7.g) {
                        this.b7.t();
                    }
                    this.ok = this.om;
                    this.om = b;
                }
                else {
                    this.ok = this.oj;
                    this.oj = b;
                }
                this.q7(this.oj, this.ox);
                if (this.d5) {
                    this.b7.w();
                    this.b7.r = truncate(this.fl());
                    this.b7.b = this.b9 != null ? this.b9 : this.b8;
                    this.os.p(this.ok, this.oj, this.isVertical, this.oh, this.o2, this.or, this.oq(), this.b3, this.b2(), () => this.qb(this.ox), this.ox.bu);
                }
                this.jh();
                this.lb();
                if (this.d5) {
                    this.d4 = false;
                    this.d3 = true;
                }
            }
            else {
                this.q7(this.oj, this.ox);
                this.q9(this.oj, this.ox);
            }
        }
        pp(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.pa == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.pb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.pc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.o9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.pe == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get pq() {
            return this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null;
        }
        pl() {
            return this.typical != null;
        }
        q4(a) {
            this.typical(this, a);
        }
        get py() {
            return this.pv();
        }
        *_pv() {
            let a = false;
            if (this.pl()) {
                let b = this.ot(0, this.cd.count);
                this.q4(new FinancialEventArgs(0, this.cd.count, b, this.ou(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.pq && this.oh.i$b != null) {
                    let d = this.cd.count;
                    let e = this.oh.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.pa.item(e.item(f)) + this.pb.item(e.item(f)) + this.o9.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.cd.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.pa.item(h) + this.pb.item(h) + this.o9.item(h)) / 3;
                    }
                }
            }
        }
        pv() {
            return toEnum(() => this._pv());
        }
        get px() {
            return this.pu();
        }
        *_pu() {
            if (this.pq && this.oh.i$b != null) {
                let a = this.pa.count;
                let b = this.oh.i$b;
                if (a > 0) {
                    yield this.qc(this.pa.item(b.item(0)) - this.pb.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.qc(this.pa.item(b.item(c)) - this.pb.item(b.item(c))), Math.max(this.qc(Math.abs(this.pa.item(b.item(c)) - this.o9.item(b.item(c - 1)))), this.qc(Math.abs(this.pb.item(b.item(c)) - this.o9.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.pa.count;
                if (d > 0) {
                    yield this.qc(this.pa.item(0) - this.pb.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.qc(this.pa.item(e) - this.pb.item(e)), Math.max(this.qc(Math.abs(this.pa.item(e) - this.o9.item(e - 1))), this.qc(Math.abs(this.pb.item(e) - this.o9.item(e - 1)))));
                }
            }
        }
        pu() {
            return toEnum(() => this._pu());
        }
        get pw() {
            return this.pt();
        }
        *_pt() {
            if (this.pq && this.oh.i$b != null) {
                let a = this.pb.count;
                let b = this.oh.i$b;
                if (a > 0) {
                    yield this.qc(this.pb.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.qc(this.pb.item(b.item(c))), this.qc(this.o9.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.pb.count;
                if (d > 0) {
                    yield this.qc(this.pb.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.qc(this.pb.item(e)), this.qc(this.o9.item(e - 1)));
                }
            }
        }
        pt() {
            return toEnum(() => this._pt());
        }
        p0(a) {
            if (a == null) {
                return null;
            }
            if (this.pq && this.oh.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.oh.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        pz() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.cd != null && !this.pf) {
                this.pf = true;
                let b = this.ot(0, this.cd.count);
                this.pf = false;
                let c = new FinancialEventArgs(0, this.cd.count, b, this.ou(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.pc == null) {
                return null;
            }
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                if (this.p4 != null) {
                    return this.p4.asArray();
                }
                let a = new List$1(Number_$type, 2, this.pc.count);
                let b = this.oh.i$b;
                let c = this.pc.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.p4 = a;
                return this.p4.asArray();
            }
            else {
                return this.pc.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.pa == null) {
                return null;
            }
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                if (this.p2 != null) {
                    return this.p2.asArray();
                }
                let a = new List$1(Number_$type, 2, this.pa.count);
                let b = this.oh.i$b;
                let c = this.pa.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.p2 = a;
                return this.p2.asArray();
            }
            else {
                return this.pa.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.pb == null) {
                return null;
            }
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                if (this.p3 != null) {
                    return this.p3.asArray();
                }
                let a = new List$1(Number_$type, 2, this.pb.count);
                let b = this.oh.i$b;
                let c = this.pb.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.p3 = a;
                return this.p3.asArray();
            }
            else {
                return this.pb.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.o9 == null) {
                return null;
            }
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                if (this.p1 != null) {
                    return this.p1.asArray();
                }
                let a = new List$1(Number_$type, 2, this.o9.count);
                let b = this.oh.i$b;
                let c = this.o9.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.p1 = a;
                return this.p1.asArray();
            }
            else {
                return this.o9.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.pe == null) {
                return null;
            }
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                if (this.p5 != null) {
                    return this.p5.asArray();
                }
                let a = new List$1(Number_$type, 2, this.pe.count);
                let b = this.oh.i$b;
                let c = this.pe.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.p5 = a;
                return this.p5.asArray();
            }
            else {
                return this.pe.asArray();
            }
        }
        jo(a, b, c, d) {
            super.jo(a, b, c, d);
            if (this.oh == null || !(typeCast(ISortingAxis_$type, this.oh) !== null)) {
                return;
            }
            let e = this.oh.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.p4 != null) {
                            this.p4.insert(f, this.pc.item(g));
                        }
                        if (this.p2 != null) {
                            this.p2.insert(f, this.pa.item(g));
                        }
                        if (this.p3 != null) {
                            this.p3.insert(f, this.pb.item(g));
                        }
                        if (this.p1 != null) {
                            this.p1.insert(f, this.o9.item(g));
                        }
                        if (this.p5 != null) {
                            this.p5.insert(f, this.pe.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.p4 != null) {
                        this.p4.v(b, c);
                    }
                    if (this.p2 != null) {
                        this.p2.v(b, c);
                    }
                    if (this.p3 != null) {
                        this.p3.v(b, c);
                    }
                    if (this.p1 != null) {
                        this.p1.v(b, c);
                    }
                    if (this.p5 != null) {
                        this.p5.v(b, c);
                    }
                    break;
                case 4:
                    if (this.p4 != null) {
                        this.p4 = new List$1(Number_$type, 0);
                    }
                    if (this.p2 != null) {
                        this.p2 = new List$1(Number_$type, 0);
                    }
                    if (this.p3 != null) {
                        this.p3 = new List$1(Number_$type, 0);
                    }
                    if (this.p1 != null) {
                        this.p1 = new List$1(Number_$type, 0);
                    }
                    if (this.p5 != null) {
                        this.p5 = 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.p4 != null) {
                            this.p4._inner[h] = this.pc.item(i);
                        }
                        if (this.p2 != null) {
                            this.p2._inner[h] = this.pa.item(i);
                        }
                        if (this.p3 != null) {
                            this.p3._inner[h] = this.pb.item(i);
                        }
                        if (this.p1 != null) {
                            this.p1._inner[h] = this.o9.item(i);
                        }
                        if (this.p5 != null) {
                            this.p5._inner[h] = this.pe.item(i);
                        }
                    }
                    break;
            }
            this.ra();
            this.lk();
        }
        ot(a, b) {
            let c = this.p0(this.pc);
            let d = this.p0(this.o9);
            let e = this.p0(this.pa);
            let f = this.p0(this.pb);
            let g = this.p0(this.pe);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.py), this.pz());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.px), ((() => {
                    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.pw), ((() => {
                    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.cd != null ? this.cd.count : 0;
                return $ret;
            })());
            return h;
        }
        qc(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        ou(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.eh;
                $ret.j = Series.eg;
                $ret.i = runOn(this, this.qc);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.oh;
        }
        k5(a, b) {
            super.k5(a, b);
            if (!this.d2) {
                this.bs.a2(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.br);
            this.bs.a2(b);
            c.bx.e(this.fq);
            if (this.cp(this.br)) {
                return;
            }
            if (!this.dw) {
                this.q7(this.ol, c);
            }
            this.dw = false;
            this.q9(this.ol, c);
            this.d2 = false;
        }
        k2(a, b, c, d, e) {
            super.k2(a, b, c, d, e);
            let f = this.a3.a$h.item(d);
            let g = f;
            g.bx.e(this.fq);
            f.a1(c);
            if (this.cp(g)) {
                return;
            }
            if (this.oi == null) {
                this.oi = new CategoryFrame(3);
            }
            this.oi.u();
            this.q7(this.oi, g);
            this.q9(this.oi, g);
        }
        am(a) {
            if (this.oh == a) {
                return this.o2;
            }
            if (this.o2 == a) {
                return this.oh;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.oh);
            return b != null ? b.preferredCategoryMode(this) : this.oo;
        }
        get oo() {
            return this.on;
        }
        set oo(a) {
            let b = this.oo;
            if (a != b) {
                this.on = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.oo));
            }
        }
        get_de() {
            return true;
        }
        k8(a, b) {
            super.k8(a, b);
            this.rm = a;
        }
        ra() {
            this.e1 = this.o9 == null || this.o9.count == 0 ? NaN : this.o9.item(this.o9.count - 1);
        }
        gs(a) {
            if (this.o1 != null && a != null) {
                if (this.o3 == null || this.o3.propertyName != this.o1.dateTimeMemberPath) {
                    this.o3 = new FastReflectionHelper(false, this.o1.dateTimeMemberPath);
                }
                let b = this.o3.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.o1.itemLabelFormat());
                }
            }
            return super.gs(a);
        }
    }
    FinancialSeries.$t = /*@__PURE__*/ markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:qk:rb', [2, null], 'HighMemberPath:qn:rc', [2, null], 'IsCustomCategoryStyleAllowed:pm:rd', [0, false], 'IsTransitionInEnabled:pn:re', [0, false], 'LowMemberPath:qs:rf', [2, null], 'NegativeBrush:rm:rg', [Brush.$, null], 'OpenMemberPath:qw:rh', [2, null], 'TransitionInMode:or:ri', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:q0:rj', [2, null], 'XAxis:oh:rk', [CategoryAxisBase.$, null], 'YAxis:o2:rl', [NumericYAxis.$, null]]);
    return FinancialSeries;
})();
/**
 * @hidden
 */
export let FinancialCalculationSupportingCalculations = /*@__PURE__*/ (() => {
    class FinancialCalculationSupportingCalculations extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
            this.c = null;
            this.d = null;
            this.b = null;
            this.h = null;
            this.f = null;
            this.g = null;
            this.e = null;
            this.k = null;
            this.j = null;
            this.i = null;
        }
    }
    FinancialCalculationSupportingCalculations.$t = /*@__PURE__*/ markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
})();
/**
 * @hidden
 */
export let DataSourceSupportingCalculation = /*@__PURE__*/ (() => {
    class DataSourceSupportingCalculation extends SupportingCalculation$1 {
        constructor(a, ..._rest) {
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0:
                    {
                        let c = _rest[0];
                        super(Delegate_$type, 0, c);
                    }
                    break;
                case 1:
                    {
                        let c = _rest[0];
                        let d = _rest[1];
                        super(Delegate_$type, 1, c, d);
                    }
                    break;
            }
        }
    }
    DataSourceSupportingCalculation.$t = /*@__PURE__*/ markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', /*@__PURE__*/ SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
})();
/**
 * @hidden
 */
export let FinancialCalculationDataSource = /*@__PURE__*/ (() => {
    class FinancialCalculationDataSource extends Base {
        constructor() {
            super(...arguments);
            this._openColumn = null;
            this._closeColumn = null;
            this._highColumn = null;
            this._lowColumn = null;
            this._volumeColumn = null;
            this._indicatorColumn = null;
            this._typicalColumn = null;
            this._trueRange = null;
            this._trueLow = null;
            this._period = 0;
            this._shortPeriod = 0;
            this._longPeriod = 0;
            this._count = 0;
            this._calculateFrom = 0;
            this._calculateCount = 0;
            this._multiplier = 0;
            this._minimumValue = 0;
            this._maximumValue = 0;
            this._specifiesRange = false;
            this._series = null;
        }
        get openColumn() {
            return this._openColumn;
        }
        set openColumn(a) {
            this._openColumn = a;
        }
        get closeColumn() {
            return this._closeColumn;
        }
        set closeColumn(a) {
            this._closeColumn = a;
        }
        get highColumn() {
            return this._highColumn;
        }
        set highColumn(a) {
            this._highColumn = a;
        }
        get lowColumn() {
            return this._lowColumn;
        }
        set lowColumn(a) {
            this._lowColumn = a;
        }
        get volumeColumn() {
            return this._volumeColumn;
        }
        set volumeColumn(a) {
            this._volumeColumn = a;
        }
        get indicatorColumn() {
            return this._indicatorColumn;
        }
        set indicatorColumn(a) {
            this._indicatorColumn = a;
        }
        get typicalColumn() {
            return this._typicalColumn;
        }
        set typicalColumn(a) {
            this._typicalColumn = a;
        }
        get trueRange() {
            return this._trueRange;
        }
        set trueRange(a) {
            this._trueRange = a;
        }
        get trueLow() {
            return this._trueLow;
        }
        set trueLow(a) {
            this._trueLow = a;
        }
        get period() {
            return this._period;
        }
        set period(a) {
            this._period = a;
        }
        get shortPeriod() {
            return this._shortPeriod;
        }
        set shortPeriod(a) {
            this._shortPeriod = a;
        }
        get longPeriod() {
            return this._longPeriod;
        }
        set longPeriod(a) {
            this._longPeriod = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get calculateFrom() {
            return this._calculateFrom;
        }
        set calculateFrom(a) {
            this._calculateFrom = a;
        }
        get calculateCount() {
            return this._calculateCount;
        }
        set calculateCount(a) {
            this._calculateCount = a;
        }
        get multiplier() {
            return this._multiplier;
        }
        set multiplier(a) {
            this._multiplier = a;
        }
        get minimumValue() {
            return this._minimumValue;
        }
        set minimumValue(a) {
            this._minimumValue = a;
        }
        get maximumValue() {
            return this._maximumValue;
        }
        set maximumValue(a) {
            this._maximumValue = a;
        }
        get specifiesRange() {
            return this._specifiesRange;
        }
        set specifiesRange(a) {
            this._specifiesRange = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
    }
    FinancialCalculationDataSource.$t = /*@__PURE__*/ markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
})();
/**
 * @hidden
 */
export let FinancialSeriesView = /*@__PURE__*/ (() => {
    class FinancialSeriesView extends SeriesView {
        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) {
                this.e.bx = 6;
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.bz.oh.b7) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.bz.oh.fa != null) {
                a += "<span>${item." + this.bz.oh.fa + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a3.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.gy + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bz.qw + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bz.qn + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bz.qs + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bz.qk + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.bz.q0)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bz.q0 + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.ni = a;
            this.e.fs = 5;
            this.e.ft = 2;
            this.e.fu = 2;
        }
    }
    FinancialSeriesView.$t = /*@__PURE__*/ markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
//# sourceMappingURL=FinancialEventArgs_combined.js.map
