/*
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 { FinancialSeries } from "./FinancialSeries";
import { ITrendLineSeries_$type } from "./ITrendLineSeries";
import { TrendLineType_$type } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { PenLineCap_$type } from "igniteui-react-core";
import { DoubleCollection } from "igniteui-react-core";
import { PriceDisplayType_$type } from "./PriceDisplayType";
import { enumGetBox, EnumUtil, typeCast, fromEnum, runOn, Point_$type, markType, markDep } from "igniteui-react-core";
import { CategoryFrame } from "./CategoryFrame";
import { ISortingAxis_$type } from "./ISortingAxis";
import { FinancialSeriesView } from "./FinancialSeriesView";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { RectUtil } from "igniteui-react-core";
import { CategoryTrendLineManagerFactory } from "./CategoryTrendLineManagerFactory";
import { AxisRange } from "./AxisRange";
import { ScalerParams } from "./ScalerParams";
import { TrendResolutionParams } from "./TrendResolutionParams";
import { Pool$1 } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { LineSegment } from "igniteui-react-core";
import { GeometryGroup } from "igniteui-react-core";
import { LineGeometry } from "igniteui-react-core";
import { RectangleGeometry } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { truncate, isNaN_, isInfinity } from "igniteui-react-core";
import { boxArray$1 } from "igniteui-react-core";
import { FinancialPriceBucketCalculator } from "./FinancialPriceBucketCalculator";
import { Extensions } from "igniteui-react-core";
/**
 * @hidden
 */
export let FinancialPriceSeries = /*@__PURE__*/ (() => {
    class FinancialPriceSeries extends FinancialSeries {
        constructor() {
            super();
            this.ab = FinancialPriceSeries.$;
            this.ok = new CategoryFrame(5);
            this.om = new CategoryFrame(5);
            this.oj = new CategoryFrame(5);
        }
        bp() {
            return new FinancialPriceSeriesView(this);
        }
        kk(a) {
            super.kk(a);
            this.rr = a;
        }
        get sb() {
            return this.c(FinancialPriceSeries.r1);
        }
        set sb(a) {
            this.h(FinancialPriceSeries.r1, a);
        }
        jo(a, b, c, d) {
            super.jo(a, b, c, d);
            if (this.oh != null && typeCast(ISortingAxis_$type, this.oh) !== null) {
                this.oh.i$i();
            }
            this.rr.bx.e(this.fq);
            if (this.rr.b7) {
                this.rr.b5.g$e(a, b, c, d);
            }
            if (this.o2 != null) {
                this.o2.cn();
            }
            this.k3(true);
        }
        bj() {
            if (this.bk == 0) {
                return 1;
            }
            else {
                return super.bj();
            }
        }
        n2(a) {
            if (this.oj == null || this.oj.f.count == 0) {
                return Rect.empty;
            }
            let b = this.no(a);
            let c = this.bs.bv;
            let d = this.bs.bu;
            let e = this.getEffectiveViewport1(this.bs);
            let f = this.aj(this.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), a, true);
            let g = f[0];
            let h = f[1];
            let i = Math.abs(b.x - g[0]);
            let j = Math.abs(b.x - h[0]);
            let k = this.rt(this.ox, e);
            k = Math.max(k, 3);
            let l = (k - 1) / 2;
            if (i < j) {
                let m = g[0] - l;
                let n = g[0];
                let o = g[0] + l;
                let p = g[1];
                let q = g[2];
                let r = g[3];
                let s = g[4];
                let t = Math.min(Math.min(Math.min(p, q), r), s);
                let u = Math.max(Math.max(Math.max(p, q), r), s);
                return new Rect(0, m, t, Math.abs(o - m), u - t);
            }
            else {
                let v = h[0] - l;
                let w = h[0];
                let x = h[0] + l;
                let y = h[1];
                let z = h[2];
                let aa = h[3];
                let ab = h[4];
                let ac = Math.min(Math.min(Math.min(y, z), aa), ab);
                let ad = Math.max(Math.max(Math.max(y, z), aa), ab);
                return new Rect(0, v, ac, Math.abs(x - v), ad - ac);
            }
        }
        rq(a, b) {
            let c = a[0] - b;
            let d = a[0];
            let e = a[0] + b;
            let f = a[1];
            let g = a[2];
            let h = a[3];
            let i = a[4];
            let j = Math.min(Math.min(Math.min(f, g), h), i);
            let k = Math.max(Math.max(Math.max(f, g), h), i);
            let l = Math.min(g, h);
            let m = Math.max(g, h);
            let n = Math.min(f, i);
            let o = Math.max(f, i);
            if (this.rs == 1) {
                let p = new Array(3);
                let q = new Rect(0, c, f, b, 0);
                let r = new Rect(0, d, i, b, 0);
                let s = new Rect(0, d, l, 0, m - l);
                p[0] = q;
                p[1] = r;
                p[2] = s;
                return p;
            }
            else {
                let t = new Array(2);
                let u = new Rect(0, d, l, 0, m - l);
                let v = new Rect(0, c, n, b * 2, o - n);
                t[0] = u;
                t[1] = v;
                return t;
            }
        }
        ak(a) {
            let b = new List$1(Rect.$, 0);
            let c = this.no(a);
            let d = this.bs.bv;
            let e = this.bs.bu;
            let f = this.getEffectiveViewport1(this.bs);
            let g = this.aj(this.oh, this.oj.f, this.qd(this.bs), this.qf(this.bs), a, true);
            let h = g[0];
            let i = g[1];
            let j = Math.abs(c.x - h[0]);
            let k = Math.abs(c.x - i[0]);
            let l = this.rt(this.ox, f);
            l = Math.max(l, 3);
            let m = (l - 1) / 2;
            if (j < k) {
                return this.rq(h, m);
            }
            else {
                return this.rq(i, m);
            }
        }
        dy(a, b) {
            if (this.d1(a, b)) {
                return true;
            }
            return false;
        }
        d1(a, b) {
            let c = this.n3(a);
            if (c.isEmpty) {
                return false;
            }
            let d = RectUtil.r(c, (this.eu / 2) + this.e7(b));
            if (d.containsPoint(a)) {
                let e = this.al(a);
                if (e != null) {
                    for (let f = 0; f < e.length; f++) {
                        let g = e[f];
                        let h = RectUtil.r(g, (this.eu / 2) + this.e7(b));
                        if (h.containsPoint(a)) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
        kp(a, b, c, d) {
            switch (b) {
                case FinancialSeries.$$p[9]:
                    this.rr.cd();
                    if (this.b6 != null) {
                        this.b6.i9();
                    }
                    break;
                case "TrendLineType":
                    let e = EnumUtil.getEnumValue(TrendLineType_$type, d);
                    if (e != 0) {
                        this.rr.b5 = CategoryTrendLineManagerFactory.a(this.rr.b5, this.oh, this.ls, this, this.cg);
                    }
                    break;
            }
            super.kp(a, b, c, d);
            if (this.rr.b7 && this.rr.b5 != null && this.rr.b5.g$b(a, b, c, d)) {
                this.k3(false);
                this.ka();
            }
            switch (b) {
                case FinancialPriceSeries.$$p[0]:
                    if (this.ls != null) {
                        this.r0();
                        this.oj.w();
                        this.q9(this.oj, this.rr);
                    }
                    this.ka();
                    break;
                case "ActualHighlightingMode":
                    this.k3(true);
                    break;
                case "TrendLineBrush":
                    this.lg();
                    break;
                case "TrendLineType":
                    this.ka();
                    break;
                case FinancialSeries.$$p[5]:
                case FinancialPriceSeries.$$p[1]:
                    this.km();
                    break;
            }
        }
        r0() {
            this.rr.ch();
            if (this.br != null) {
                this.br.ch();
            }
        }
        ao(a) {
            if (a != null && a == this.o2 && this.pb != null && !isNaN_(this.pb.minimum) && this.pa != null && !isNaN_(this.pa.maximum)) {
                return new AxisRange(this.pb.minimum, this.pa.maximum);
            }
            return null;
        }
        ap(a) {
            if (a.isEmpty && this.b6 != null) {
                a = this.b6.os;
            }
            if (this.pb == null || this.pa == null) {
                return null;
            }
            let b = this.ny(this.bs);
            let c = new ScalerParams(0, a, this.b6.o7, this.oh.ca, this.getEffectiveViewport());
            let d = (this.oh.d2(b.left, c));
            let e = (this.oh.d2(b.right, c));
            if (this.oh.ca) {
                let f = d;
                d = e;
                e = f;
            }
            let g = null;
            if (this.oh.cf) {
                g = this.oh;
                d = g.i$f(d);
                e = g.i$f(e);
            }
            else {
                d = Math.floor(d);
                e = Math.ceil(e);
            }
            d = Math.max(0, Math.min(this.pb.count - 1, d));
            e = Math.max(0, Math.min(this.pb.count - 1, e));
            let h = 1.7976931348623157E+308;
            let i = -1.7976931348623157E+308;
            for (let j = truncate(d); j <= truncate(e); j++) {
                let k = j;
                if (g != null) {
                    k = g.i$b._inner[j];
                }
                let l = this.pb.item(k);
                if (this.pb.mayContainUnknowns) {
                    if (isInfinity(l) || isNaN_(l)) {
                        continue;
                    }
                }
                let m = this.pa.item(k);
                if (this.pa.mayContainUnknowns) {
                    if (isInfinity(m) || isNaN_(m)) {
                        continue;
                    }
                }
                h = Math.min(h, l);
                i = Math.max(i, m);
            }
            let n = new AxisRange(h, i);
            n = this.an(n, this.o2, a);
            return n;
        }
        fa() {
            return Series.fb(this.pc, typeCast(ISortingAxis_$type, this.oh));
        }
        dq(a) {
            let b = this.cd != null ? this.cd.indexOf(a) : -1;
            let c = this.bs.bv;
            c = c.copy();
            let d = this.bs.bu;
            let e = new Rect(0, 0, 0, 1, 1);
            let f = this.n0(this.bs);
            if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
                if (this.oh != null) {
                    let g = new ScalerParams(0, e, e, this.oh.ca, f);
                    let h = this.oh.dz(b, g);
                    if (h < c.left + 0.1 * c.width) {
                        h = h + 0.4 * c.width;
                    }
                    if (h > c.right - 0.1 * c.width) {
                        h = h - 0.4 * c.width;
                    }
                    c.x = h - 0.5 * c.width;
                }
                if (this.o2 != null && this.pb != null && this.pa != null && b < this.pb.count && b < this.pa.count) {
                    let i = new ScalerParams(0, e, e, this.o2.ca, f);
                    i.b = this.fa();
                    let j = this.o2.dz(this.pb.item(b), i);
                    let k = this.o2.dz(this.pa.item(b), i);
                    if (!isNaN_(j) && !isNaN_(k)) {
                        let l = Math.abs(j - k);
                        if (c.height < l) {
                            c.height = l;
                            c.y = Math.min(j, k);
                        }
                        else {
                            if (j < c.top + 0.1 * c.height) {
                                j = j + 0.4 * c.height;
                            }
                            if (j > c.bottom - 0.1 * c.height) {
                                j = j - 0.4 * c.height;
                            }
                            c.y = j - 0.5 * c.height;
                        }
                    }
                }
                this.b1.ap(this.b6, c, true);
            }
            return b >= 0;
        }
        ec(a, b, c) {
            let d = super.ec(a, b, c);
            if (this.pc == null || this.o9 == null || this.pa == null || this.pb == null) {
                d = false;
            }
            return d;
        }
        q7(a, b) {
            super.q7(a, b);
            let c = b.bv;
            let d = b.bu;
            let e = this.getEffectiveViewport1(b);
            let f = this.oh;
            let g = this.o2;
            let h = new ScalerParams(0, c, d, f.ca, e);
            let i = ((() => {
                let $ret = new ScalerParams(0, c, d, g.ca, e);
                $ret.b = this.fa();
                return $ret;
            })());
            a.f.clear();
            a.m.clear();
            a.p.clear();
            let j = 0;
            let k = typeCast(ISortingAxis_$type, this.oh);
            if (k != null && (k.i$b == null || k.i$b.count != this.cd.count)) {
                return;
            }
            j = this.p7(c, d, e);
            let l = typeCast(FinancialPriceSeriesView.$, b);
            let m = this.fq;
            if (this.trendLineType != 0) {
                let n = new Array(this.cd.count);
                let o = 0;
                for (let p of fromEnum(this.py)) {
                    n[o] = p;
                    o++;
                }
                if (this.rr.b7) {
                    this.rr.b5.prepareLineCore(a.p, this.trendLineType, boxArray$1(n), this.trendLinePeriod, (q) => this.oh.dz(q, h), (q) => this.o2.dz(q, i), ((() => {
                        let $ret = new TrendResolutionParams();
                        $ret.c = b.bx.b;
                        $ret.d = b.bx.c;
                        $ret.e = b.bx.d;
                        $ret.a = j;
                        $ret.b = m;
                        $ret.f = d;
                        return $ret;
                    })()));
                }
            }
            let q = this.oh.d2(2, h) - this.oh.d2(1, h);
            for (let r = b.bx.c; r <= b.bx.d; ++r) {
                let s;
                if (k == null) {
                    s = b.bx.getBucket(r);
                }
                else {
                    let t = k.i$b._inner[r];
                    let u = k.i$d(t);
                    let v = this.pc.item(t);
                    let w = this.pa.item(t);
                    let x = this.pb.item(t);
                    let y = this.o9.item(t);
                    let z = v;
                    let aa = w;
                    let ab = x;
                    let ac = y;
                    let ad = u;
                    while (r < b.bx.d) {
                        t = k.i$b._inner[r + 1];
                        ad = k.i$d(t);
                        if (ad - u > q * m) {
                            break;
                        }
                        r++;
                        aa = Math.max(aa, this.pa.item(t));
                        ab = Math.min(ab, this.pb.item(t));
                        ac = this.o9.item(t);
                    }
                    let ae = NaN;
                    if (!isNaN_(u)) {
                        ae = this.oh.dz(u, h);
                    }
                    s = [ae, z, aa, ab, ac];
                }
                if (!isNaN_(s[0])) {
                    if (k != null) {
                        s[0] = s[0] + j;
                    }
                    else {
                        s[0] = f.dz(s[0], h) + j;
                    }
                    s[1] = g.dz(s[1], i);
                    s[2] = g.dz(s[2], i);
                    s[3] = g.dz(s[3], i);
                    s[4] = g.dz(s[4], i);
                    a.f.add(s);
                }
            }
            return;
        }
        jl(a, b) {
            super.jl(a, b);
            let c = typeCast(FinancialPriceSeriesView.$, b);
            c.cb();
            if (a) {
                c.b6.count = 0;
            }
            if (c.b7 && c.b5 != null) {
                c.b5.g$d();
            }
        }
        ln(a, b) {
            super.ln(a, b);
            if (this.b6 != null) {
                this.b6.i9();
            }
        }
        n7() {
            if (this.oh != null && this.oh.categoryMode == 0) {
                let a = this.getEffectiveViewport1(this.bs);
                let b = this.rt(this.ox, a) / 2;
                return new Thickness(1, b, 0, b, 0);
            }
            return super.n7();
        }
        get_cu() {
            return true;
        }
        q9(a, b) {
            super.q9(a, b);
            if (this.oh == null || this.o2 == null) {
                return;
            }
            let c = false;
            if (b.b0(a)) {
                c = true;
                b.b2(a);
            }
            this.op.a0(this, this.po(), runOn(this, this.n9), this.qd(b), this.qf(b));
            let d = false;
            let e = this.op.b;
            if (e != null) {
                d = true;
            }
            let f = typeCast(FinancialPriceSeriesView.$, b);
            f.ca();
            f.b8 = false;
            if (f.b7) {
                f.b5.g$d();
            }
            if (this.trendLineType != 0) {
                f.b5.g$g(a.p);
            }
            if (d) {
                this.rz(a, b, c);
            }
            else {
                f.b6.count = 0;
                this.ry(a, b);
            }
        }
        e9() {
            let a = this.getEffectiveViewport1(this.bs);
            return this.rt(this.ox, a);
        }
        rz(a, b, c) {
            let d = this.rs;
            let e = this.getEffectiveViewport1(b);
            let f = this.rt(b, e);
            let g = (f - 1) / 2;
            let h = typeCast(FinancialPriceSeriesView.$, b);
            h.b8 = true;
            let i = a.f;
            let j = 0;
            let k = this.cd.count;
            let l = this.oh;
            let m = new ScalerParams(0, b.bv, b.bu, l.ca, e);
            let n = this.m9;
            let o = this.rm;
            if (o == null) {
                o = n;
            }
            let p = this.na;
            let q = this.sc;
            if (q == null) {
                q = p;
            }
            for (let r = 0; r < i.count; ++r) {
                let s = i._inner[r][0] - g;
                let t = i._inner[r][0];
                let u = i._inner[r][0] + g;
                let v = i._inner[r][1];
                let w = i._inner[r][2];
                let x = i._inner[r][3];
                let y = i._inner[r][4];
                if (isNaN_(v) || isNaN_(w) || isNaN_(x) || isNaN_(y)) {
                    continue;
                }
                let z = h.b6.item(j);
                j++;
                let aa = v < y;
                let ab = new PathGeometry();
                if (c) {
                    switch (d) {
                        case 0:
                            if (aa) {
                                let ac = v;
                                v = y;
                                y = ac;
                            }
                            let ad = new PathFigure();
                            ad._startPoint = { $type: Point_$type, x: t, y: x };
                            ad._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: t, y: v };
                                return $ret;
                            })()));
                            let ae = new PathFigure();
                            ae._startPoint = { $type: Point_$type, x: s, y: y };
                            ae._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: u, y: y };
                                return $ret;
                            })()));
                            ae._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: u, y: v };
                                return $ret;
                            })()));
                            ae._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: s, y: v };
                                return $ret;
                            })()));
                            ae._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: s, y: y };
                                return $ret;
                            })()));
                            let af = new PathFigure();
                            af._startPoint = { $type: Point_$type, x: t, y: y };
                            af._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: t, y: w };
                                return $ret;
                            })()));
                            ab.c.add(ad);
                            ab.c.add(ae);
                            ab.c.add(af);
                            break;
                        case 1:
                            let ag = new PathFigure();
                            ag._startPoint = { $type: Point_$type, x: s, y: v };
                            ag._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: t, y: v };
                                return $ret;
                            })()));
                            let ah = new PathFigure();
                            ah._startPoint = { $type: Point_$type, x: t, y: x };
                            ah._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: t, y: w };
                                return $ret;
                            })()));
                            let ai = new PathFigure();
                            ai._startPoint = { $type: Point_$type, x: t, y: y };
                            ai._segments.add(((() => {
                                let $ret = new LineSegment(1);
                                $ret.c = { $type: Point_$type, x: u, y: y };
                                return $ret;
                            })()));
                            ab.c.add(ag);
                            ab.c.add(ah);
                            ab.c.add(ai);
                            break;
                    }
                }
                if (aa) {
                    this.op.ak = o;
                    this.op.ag = o;
                    this.op.ah = q;
                    this.op.al = q;
                    this.op.f = true;
                }
                else {
                    this.op.ak = n;
                    this.op.ag = n;
                    this.op.ah = p;
                    this.op.al = p;
                    this.op.f = false;
                }
                this.q6(i, r, k, l, m, b.q);
                if (d == 1) {
                    this.op.ad(z, true, false, false, false);
                }
                else {
                    this.op.ad(z, false, false, false, false);
                }
                if (c) {
                    z.ak = ab;
                }
            }
            h.b6.count = j;
            h.cc();
        }
        rt(a, b) {
            let c = this.oh.j0(a.bv, a.bu, b);
            c = Math.max(c, this.fq * 0.9);
            c = Math.max(c, 3);
            return c;
        }
        ry(a, b) {
            let c = this.rs;
            let d = this.getEffectiveViewport1(b);
            let e = this.rt(b, d);
            let f = (e - 1) / 2;
            let g = typeCast(FinancialPriceSeriesView.$, b);
            let h = g.ck();
            let i = g.cj();
            let j = a.f;
            for (let k = 0; k < j.count; ++k) {
                let l = j._inner[k][0] - f;
                let m = j._inner[k][0];
                let n = j._inner[k][0] + f;
                let o = j._inner[k][1];
                let p = j._inner[k][2];
                let q = j._inner[k][3];
                let r = j._inner[k][4];
                if (isNaN_(o) || isNaN_(p) || isNaN_(q) || isNaN_(r)) {
                    continue;
                }
                let s = o < r;
                let t = s ? i : h;
                switch (c) {
                    case 0:
                        if (s) {
                            let u = o;
                            o = r;
                            r = u;
                        }
                        t.d.add(((() => {
                            let $ret = new LineGeometry();
                            $ret.d = { $type: Point_$type, x: m, y: q };
                            $ret.c = { $type: Point_$type, x: m, y: o };
                            return $ret;
                        })()));
                        t.d.add(((() => {
                            let $ret = new RectangleGeometry();
                            $ret.e = new Rect(0, l, r, n - l, o - r);
                            return $ret;
                        })()));
                        t.d.add(((() => {
                            let $ret = new LineGeometry();
                            $ret.d = { $type: Point_$type, x: m, y: r };
                            $ret.c = { $type: Point_$type, x: m, y: p };
                            return $ret;
                        })()));
                        break;
                    case 1:
                        t.d.add(((() => {
                            let $ret = new LineGeometry();
                            $ret.d = { $type: Point_$type, x: l, y: o };
                            $ret.c = { $type: Point_$type, x: m, y: o };
                            return $ret;
                        })()));
                        t.d.add(((() => {
                            let $ret = new LineGeometry();
                            $ret.d = { $type: Point_$type, x: m, y: q };
                            $ret.c = { $type: Point_$type, x: m, y: p };
                            return $ret;
                        })()));
                        t.d.add(((() => {
                            let $ret = new LineGeometry();
                            $ret.d = { $type: Point_$type, x: m, y: r };
                            $ret.c = { $type: Point_$type, x: n, y: r };
                            return $ret;
                        })()));
                        break;
                }
            }
        }
        gw(a, b) {
            if (this.rr.b7 && a == this.rr.b5.g$j) {
                return null;
            }
            return super.gw(a, b);
        }
        lg() {
            super.lg();
            if (this.gi < 0) {
                return;
            }
            this.rr.ci();
        }
        jv(a) {
            super.jv(a);
            if (this.rr.b7) {
                this.a5.exportTrendlineData(this, a, this.rr.b5.g$j);
            }
        }
        k8(a, b) {
            super.k8(a, b);
            this.sc = b;
        }
    }
    FinancialPriceSeries.$t = /*@__PURE__*/ markType(FinancialPriceSeries, 'FinancialPriceSeries', FinancialSeries.$, [ITrendLineSeries_$type]);
    FinancialPriceSeries.r1 = /*@__PURE__*/ DependencyProperty.i("ActualTrendLineBrush", Brush.$, FinancialPriceSeries.$, /*@__PURE__*/ new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("ActualTrendLineBrush", b.oldValue, b.newValue)));
    FinancialPriceSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialPriceSeries, 'raisePropertyChanged', ['DisplayType:rs:r2', [PriceDisplayType_$type, /*@__PURE__*/ enumGetBox(PriceDisplayType_$type, 0)], 'NegativeOutline:sc:r3', [Brush.$, null], 'TrendLineType::r9', [TrendLineType_$type, /*@__PURE__*/ enumGetBox(TrendLineType_$type, 0)], 'TrendLineThickness::r8', [1, 1.5], 'TrendLinePeriod::r7', [1, 7], 'TrendLineBrush::r4', [Brush.$, null], 'TrendLineZIndex:rv:sa', [1, 1001], 'TrendLineDashArray:sd:r5', [DoubleCollection.$], 'TrendLineDashCap:se:r6', [PenLineCap_$type, /*@__PURE__*/ enumGetBox(PenLineCap_$type, 0)]]);
    return FinancialPriceSeries;
})();
/**
 * @hidden
 */
export let FinancialPriceSeriesView = /*@__PURE__*/ (() => {
    class FinancialPriceSeriesView extends FinancialSeriesView {
        constructor(a) {
            super(a);
            this.b3 = null;
            this.b6 = null;
            this.b9 = null;
            this.cn = ((() => {
                let $ret = new Path();
                $ret.ak = new GeometryGroup();
                return $ret;
            })());
            this.cm = ((() => {
                let $ret = new Path();
                $ret.ak = new GeometryGroup();
                return $ret;
            })());
            this.b4 = null;
            this.cl = new Path();
            this.b8 = false;
            this.b3 = a;
            this.b9 = new List$1(Path.$, 0);
            this.b6 = ((() => {
                let $ret = new Pool$1(Path.$);
                $ret.create = runOn(this, this.co);
                $ret.activate = runOn(this, this.ce);
                $ret.disactivate = runOn(this, this.cg);
                $ret.destroy = runOn(this, this.cf);
                return $ret;
            })());
        }
        co() {
            let a = new Path();
            this.b9.add(a);
            a._visibility = 1;
            return a;
        }
        ce(a) {
            a._visibility = 0;
        }
        cg(a) {
            a._visibility = 1;
        }
        cf(a) {
            this.b9.remove(a);
        }
        by() {
            return new FinancialPriceBucketCalculator(this);
        }
        as() {
            super.as();
            if (!this.q) {
                this.bz.rm = ((() => {
                    let $ret = new Brush();
                    $ret.fill = "#ee5879";
                    return $ret;
                })());
                this.b3.sc = this.bz.rm;
                this.bz.fq = 5;
                this.bz.fv = 1;
            }
        }
        get b5() {
            if (this.b4 == null) {
                this.b4 = CategoryTrendLineManagerFactory.a(this.b4, this.e.aq(), this.e.ls, this.e, this.e.cg);
            }
            return this.b4;
        }
        set b5(a) {
            this.b4 = a;
        }
        get b7() {
            return this.b4 != null;
        }
        ch() {
            if (this.b3.rs == 1) {
                this.cn._stroke = this.e.m9;
            }
            else {
                this.cn._stroke = this.e.na;
            }
            if (this.b3.rs == 1) {
                this.cm._stroke = this.bz.rm;
            }
            else {
                this.cm._stroke = this.b3.sc;
            }
        }
        cb() {
            this.aq();
            this.b6.count = 0;
            this.ca();
        }
        ca() {
            let a = typeCast(GeometryGroup.$, this.cn.ak);
            let b = typeCast(GeometryGroup.$, this.cm.ak);
            Extensions.d(a);
            Extensions.d(b);
        }
        ck() {
            this.aq();
            return typeCast(GeometryGroup.$, this.cn.ak);
        }
        cj() {
            this.aq();
            return typeCast(GeometryGroup.$, this.cm.ak);
        }
        ci() {
            this.b3.sb = null;
            if (this.b3.trendLineBrush != null) {
                this.b3.sb = this.b3.trendLineBrush;
            }
            else {
                this.b3.sb = this.b3.m9;
            }
        }
        bb() {
            super.bb();
            this.cn.ac = this.e.eu;
            this.cn.ai = this.e.nj;
            this.cn.ad = this.e.nk;
            if (this.b3.rs == 1) {
                this.cn._stroke = this.e.m9;
            }
            else {
                this.cn._stroke = this.e.na;
                this.cn._fill = this.e.m9;
            }
            this.cm.ac = this.e.eu;
            this.cm.ai = this.e.nj;
            this.cm.ad = this.e.nk;
            if (this.b3.rs == 1) {
                this.cm._stroke = this.bz.rm;
            }
            else {
                this.cm._stroke = this.b3.sc;
                this.cm._fill = this.bz.rm;
            }
        }
        bc() {
            super.bc();
            let a = this.bo();
            this.cn.ac = this.e.eu + 3;
            if (this.b3.rs == 1) {
                this.cn._stroke = a;
            }
            else {
                this.cn._stroke = a;
                this.cn._fill = a;
            }
            this.cm.ac = this.e.eu + 3;
            if (this.b3.rs == 1) {
                this.cm._stroke = a;
            }
            else {
                this.cm._stroke = a;
                this.cm._fill = a;
            }
        }
        ac(a) {
            return this.b9._inner[a];
        }
        ab(a) {
            let b = this.b9._inner[a];
            this.cl._visibility = b._visibility;
            this.cl.ak = b.ak;
            let c = this.bp(a);
            this.cl._fill = c;
            this.cl._stroke = c;
            this.cl.ac = this.e.eu + 3;
            return this.cl;
        }
        a6(a, b) {
            super.a6(a, b);
            if (a.d) {
                if (this.b8) {
                    for (let c = 0; c < this.b9.count; c++) {
                        let d = this.aa(c, b);
                        if (d._visibility == 0) {
                            a.s(d);
                        }
                    }
                }
                else {
                    a.s(this.cn);
                    a.s(this.cm);
                }
            }
        }
        a5(a, b) {
            if (a.d) {
                if (this.b3.trendLineType != 0 && !b) {
                    let c = this.b5.g$j;
                    c.ac = this.b3.trendLineThickness;
                    c._stroke = this.b3.sb;
                    c.ai = this.b3.sd;
                    c.ad = this.b3.se;
                    a.u(c);
                }
            }
            super.a5(a, b);
        }
        al(a) {
            super.al(a);
            if (this.b3.po()) {
                for (let b = 0; b < this.b9.count; b++) {
                    let c = this.b9._inner[b];
                    if (c._fill == this.b3.rm) {
                        this.e.a5.exportPathData(a, c, "negativePathShape" + b, ["Negative"]);
                    }
                    else {
                        this.e.a5.exportPathData(a, c, "positivePathShape" + b, ["Positive", "Main"]);
                    }
                }
            }
            else {
                this.e.a5.exportPathData(a, this.cn, "positivePathShape", ["Positive", "Main"]);
                this.e.a5.exportPathData(a, this.cm, "negativePathShape", ["Negative"]);
            }
        }
        cc() {
            this.aq();
        }
        cd() {
            if (this.b7) {
                this.b4 = CategoryTrendLineManagerFactory.a(this.b4, this.e.aq(), this.e.ls, this.e, this.e.cg);
            }
        }
    }
    FinancialPriceSeriesView.$t = /*@__PURE__*/ markType(FinancialPriceSeriesView, 'FinancialPriceSeriesView', FinancialSeriesView.$);
    return FinancialPriceSeriesView;
})();
//# sourceMappingURL=FinancialPriceSeries_combined.js.map
