/*
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 { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { IEnumerable$1_$type, typeCast, Point_$type, fromEnum, Array_$type, Number_$type, markType, markDep, runOn } from "igniteui-react-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { List$1 } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { PointCollectionUtil } from "igniteui-react-core";
import { FlattenedShape } from "./FlattenedShape";
import { SeriesView } from "./SeriesView";
import { Clipper } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { PolySimplification } from "igniteui-react-core";
import { DefaultFlattener } from "./DefaultFlattener";
import { DataContext } from "igniteui-react-core";
import { FrameworkElement } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { Style } from "igniteui-react-core";
import { StyleShapeEventArgs } from "./StyleShapeEventArgs";
import { PropertyMetadata } from "igniteui-react-core";
import { boxArray$1 } from "igniteui-react-core";
import { InvalidOperationException } from "igniteui-react-core";
import { isNaN_, truncate } from "igniteui-react-core";
import { FastItemObjectColumn } from "igniteui-react-core";
import { Path } from "igniteui-react-core";
import { Pool$1 } from "igniteui-react-core";
import { ShapeHitRegion } from "./ShapeHitRegion";
import { PointCollection } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { PolyLineSegment } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { GeometryUtil } from "igniteui-react-core";
import { PolygonUtil } from "igniteui-react-core";
import { RectUtil } from "igniteui-react-core";
/**
 * @hidden
 */
export let ShapeSeriesBase = /*@__PURE__*/ (() => {
    class ShapeSeriesBase extends Series {
        constructor() {
            super();
            this.mk = null;
            this.mf = null;
            this.mh = null;
            this.mx = 0;
            this.mt = null;
            this.mb = null;
            this.md = null;
            this.mc = null;
            this.ma = null;
            this.nj = null;
            this.mz = 0;
            this.styleShape = null;
            FastItemObjectColumn.m();
            this.mz = this.my;
            this.nj = Rect.empty;
        }
        h1() {
            super.h1();
            this.mg = null;
            this.mi = null;
        }
        ag() {
            return [this.mg, this.mi];
        }
        fs(a, b) {
            let c = this.g2(b);
            if (c == ShapeSeriesBase.$$p[1]) {
                return this.ft(a, b, this.m4);
            }
            return null;
        }
        get ml() {
            return this.mk;
        }
        set ml(a) {
            let b = this.ml != a;
            if (b) {
                let c = this.ml;
                this.mk = a;
                this.raisePropertyChanged("ShapeColumn", c, this.ml);
            }
        }
        mo(array_) {
            let a = (Array.isArray(array_));
            return a;
        }
        static mq(a) {
            if (a == null) {
                return true;
            }
            let val_ = a;
            return (val_ == undefined);
        }
        convertToListList(a) {
            if (a == null) {
                return null;
            }
            let b = new List$1(List$1.$.specialize(Point_$type), 0);
            let c;
            let curr_;
            let d;
            let e;
            let f = false;
            let g = false;
            for (let h = 0; h < a.length; h++) {
                c = a[h];
                if (c == null) {
                    continue;
                }
                let i = new List$1(Point_$type, 0);
                for (let j = 0; j < c.length; j++) {
                    curr_ = c[j];
                    if (f) {
                        d = (curr_.X);
                        e = (curr_.Y);
                    }
                    else {
                        d = (curr_.x);
                        e = (curr_.y);
                    }
                    if (!g) {
                        if ((isNaN_(d) || ShapeSeriesBase.mq(d)) && (isNaN_(e) || ShapeSeriesBase.mq(e))) {
                            d = (curr_.X);
                            e = (curr_.Y);
                            if (!isNaN_(d) && !ShapeSeriesBase.mq(d) && !isNaN_(e) && !ShapeSeriesBase.mq(e)) {
                                g = true;
                                f = true;
                            }
                        }
                        else {
                            g = true;
                        }
                    }
                    i.add({ $type: Point_$type, x: d, y: e });
                }
                b.add(i);
            }
            return b;
        }
        by(a) {
            if (this.bz != null && this.mo(this.itemsSource) && a != null && a.split('!').length != 2) {
                if (this.coercionMethods == null) {
                    this.coercionMethods = {};
                }
                let methods_ = this.coercionMethods;
                methods_.convertToListList = this.convertToListList;
                a += "!convertToListList";
            }
            return super.by(a);
        }
        i7(a, b, c, d) {
            super.i7(a, b, c, d);
            let e = false;
            let f = false;
            switch (b) {
                case "FastItemsSource":
                    let g = typeCast(IFastItemsSource_$type, c);
                    if (g != null) {
                        g.deregisterColumn(this.ml);
                        this.ml = null;
                    }
                    let h = typeCast(IFastItemsSource_$type, d);
                    if (h != null) {
                        this.ml = this.by(this.m4);
                    }
                    e = this.mg != null && !this.mg.cn();
                    f = this.mi != null && !this.mi.cn();
                    if (e || f) {
                        this.jl(false);
                    }
                    break;
                case ShapeSeriesBase.$$p[1]:
                    if (this.bz != null) {
                        this.bz.deregisterColumn(this.ml);
                        this.ml = this.by(this.m4);
                    }
                    break;
                case "ShapeColumn":
                    this.nc();
                    e = this.mg != null && !this.mg.cn();
                    f = this.mi != null && !this.mi.cn();
                    if (e || f) {
                        this.jl(false);
                    }
                    this.it();
                    break;
                case ShapeSeriesBase.$$p[2]:
                case ShapeSeriesBase.$$p[3]:
                    this.mf = this.mg;
                    this.mh = this.mi;
                    let i = c;
                    let j = d;
                    this.nd(i);
                    this.m9(j);
                    if ((j != null && !j.cn()) || (j == null && i != null)) {
                        this.jl(false);
                    }
                    this.it();
                    break;
                case "Resolution":
                    this.mx = this.eu;
                    this.it();
                    break;
                case "ActualBrush":
                    this.jl(false);
                    break;
                case ShapeSeriesBase.$$p[0]:
                    this.mz = this.my;
                    this.jl(false);
                    this.it();
                    break;
                case "Thickness":
                    this.jl(false);
                    this.it();
                    break;
            }
        }
        mn(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        mm(a) {
            if (typeCast(NumericXAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        nc() {
            this.mt = null;
            if (this.ml == null) {
                return;
            }
            this.mt = new List$1(Rect.$, 2, this.ml.count);
            for (let a = 0; a < this.ml.count; a++) {
                this.mt.add(PointCollectionUtil.j(this.ml.item(a)));
            }
        }
        nk(a) {
            if (typeCast(IEnumerable$1_$type.specialize(IEnumerable$1_$type.specialize(Point_$type)), a) !== null) {
                return PointCollectionUtil.h(a);
            }
            else if (typeCast(IEnumerable$1_$type.specialize(Point_$type), a) !== null) {
                return PointCollectionUtil.g(a);
            }
            return Rect.empty;
        }
        mv(a, b, c, d, e, f, g) {
            return this.mw(a, b, c, d, e, f, g);
            if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
                return this.mw(a, b, c, d, e, f, g);
            }
            else if (typeCast(IEnumerable$1_$type.specialize(IEnumerable$1_$type.specialize(Point_$type)), c) !== null) {
                let h = c;
                let i = new List$1(FlattenedShape.$, 0);
                let j = null;
                for (let k of fromEnum(h)) {
                    j = this.me(a, b, PointCollectionUtil.b(k), d, e, f, g);
                    if (j == null) {
                        continue;
                    }
                    i.add(j);
                }
                return i;
            }
            else if (typeCast(IEnumerable$1_$type.specialize(Point_$type), c) !== null) {
                let l = c;
                let m = this.me(a, b, PointCollectionUtil.b(l), d, e, f, g);
                let n = new List$1(FlattenedShape.$, 0);
                if (m != null) {
                    n.add(m);
                }
                return n;
            }
            else {
                throw new InvalidOperationException(1, "Unrecognized data in ShapeColumn");
            }
        }
        get_mp() {
            return true;
        }
        get mp() {
            return this.get_mp();
        }
        ms() {
            return false;
        }
        jm(a) {
            this.nb(this.bi);
        }
        jk(a, b, c, d, e) {
            super.jk(a, b, c, d, e);
            let f = this.a0.a$h.item(d);
            let g = f;
            f.ay(c);
            if (this.cc(f)) {
                return;
            }
            this.nb(f);
        }
        nb(a) {
            if (this.cc(a)) {
                return;
            }
            let b;
            let c;
            let d = a;
            let e = a.getViewInfo(c, b);
            c = e.p0;
            b = e.p1;
            if (c.width < 1 || c.height < 1 || this.ml == null) {
                return;
            }
            let f = this.mg;
            let g = this.mi;
            let h = this.getEffectiveViewport1(a);
            let i = new ScalerParams(1, b, c, f.ca);
            i.c = h;
            let j = new ScalerParams(1, b, c, g.ca);
            j.c = h;
            d.cj();
            let k = new Rect(0, 0, 0, 0, 0);
            let l;
            let m;
            let n;
            let o;
            let p = this.ml.count;
            if (this.md == null || this.md.length != p) {
                this.md = new Array(p);
                this.mb = new Array(p);
                this.mc = new Array(p);
                this.ma = new Array(p);
            }
            let q = this.md;
            let r = this.mb;
            let s = this.mc;
            let t = this.ma;
            let u;
            for (let v = 0; v < p; v++) {
                u = this.mt._inner[v];
                q[v] = u.top;
                r[v] = u.left;
                s[v] = u.right;
                t[v] = u.bottom;
            }
            this.mf.gs(boxArray$1(r), 0, r.length, i);
            this.mf.gs(boxArray$1(s), 0, s.length, i);
            this.mh.gs(boxArray$1(q), 0, q.length, j);
            this.mh.gs(boxArray$1(t), 0, t.length, j);
            d.ck(r, q, s, t);
            let w = this.ml;
            let x = this.bz;
            this.ne(d);
            let y = c.left;
            let z = c.right;
            let aa = c.top;
            let ab = c.bottom;
            let ac = null;
            if (this.nj.isEmpty) {
                ac = null;
            }
            else {
                ac = new Clipper(1, this.nj.left, this.nj.bottom, this.nj.right, this.nj.top, this.mp);
            }
            let ad = this.ms();
            if (ad) {
                d.b3.clear();
            }
            let ae = false;
            let af = true;
            let ag = 0;
            if (this.bs != null) {
                if (this.bs.d1()) {
                    let ah = this.bs.h4(b, i);
                    ae = ah.c;
                    ag = ah.d;
                }
            }
            let ai;
            for (let aj = 0; aj < p; aj++) {
                n = r[aj];
                l = q[aj];
                m = t[aj];
                o = s[aj];
                k.x = Math.min(n, o);
                k.y = Math.min(l, m);
                k.width = Math.max(n, o) - k.x;
                k.height = Math.max(l, m) - k.y;
                if (k.intersectsWith(c)) {
                    if (k.x < y || k.y < aa || k.x > z || k.y > ab) {
                        ai = ac;
                    }
                    else {
                        ai = null;
                    }
                    let ak = this.mv(a, ai, w.item(aj), i, j, 0, ag);
                    if (ad) {
                        ShapeSeriesBase.na(d, aj, ak);
                    }
                    d.b8(aj, x.item(aj), k, ak);
                }
                else if (ae) {
                    k.x = k.x + ag;
                    if (k.intersectsWith(c)) {
                        if (k.x < y || k.y < aa || k.x > z || k.y > ab) {
                            ai = ac;
                        }
                        else {
                            ai = null;
                        }
                        let al = this.mv(a, ai, w.item(aj), i, j, ag, ag);
                        if (ad) {
                            ShapeSeriesBase.na(d, aj, al);
                        }
                        d.b8(aj, x.item(aj), k, al);
                    }
                }
            }
            d.ci();
        }
        static na(a, b, c) {
            let d = 0;
            let e = null;
            for (let f = 0; f < c.count; f++) {
                let g = c._inner[f];
                let h = g.b.width * g.b.height;
                if (h > d) {
                    d = h;
                    e = g;
                }
            }
            a.b3.addItem(b, e);
        }
        ik() {
            super.ik();
            if (this.mg != null) {
                this.mg.ha();
            }
            if (this.mi != null) {
                this.mi.ha();
            }
        }
        j1(a, b) {
            this.jl(false);
        }
        j0(a, b) {
            this.jl(false);
        }
        h6(a, b, c, d) {
            super.h6(a, b, c, d);
            switch (a) {
                case 3:
                    if (d == this.m4) {
                        this.mt._inner[b] = this.nk(this.ml.item(b));
                    }
                    break;
                case 1:
                    for (let e = b; e < b + c; e++) {
                        this.mt.insert(e, this.nk(this.ml.item(e)));
                    }
                    break;
                case 0:
                    this.mt.v(b, c);
                    break;
                case 2:
                    for (let f = b; f < b + c; f++) {
                        this.mt._inner[f] = this.nk(this.ml.item(f));
                    }
                    break;
                case 4:
                    this.nc();
                    break;
            }
            this.jl(false);
        }
        dw(a, b, c) {
            let d = true;
            if (!super.dw(a, b, c) || (this.mr && this.ml == null) || b.isEmpty || a.isEmpty || this.mg == null || this.mi == null || this.mg.bh == null || this.mi.bh == null || this.mg.kc == this.mg.kb || this.mi.kc == this.mi.kb || this.ml == null || this.ml.count == 0 || this.mt == null || this.mt.count == 0 || this.mt.count != this.ml.count) {
                d = false;
            }
            return d;
        }
        get_mr() {
            return true;
        }
        get mr() {
            return this.get_mr();
        }
        i2(a) {
            super.i2(a);
            this.mj = typeCast(ShapeSeriesViewBase.$, a);
        }
        mw(a, b, c, d, e, f, g) {
            let h = new List$1(FlattenedShape.$, 0);
            let i;
            let j = c.count;
            for (let k = 0; k < j; k++) {
                i = c._inner[k];
                let l = this.me(a, b, i, d, e, f, g);
                if (l == null) {
                    continue;
                }
                h.add(l);
            }
            return h;
        }
        me(a, b, c, d, e, f, g) {
            let h = this.m8(c, d, e);
            let i = h.c;
            let j = h.d;
            let k = i.length;
            let l = 1.7976931348623157E+308;
            let m = 1.7976931348623157E+308;
            let n = -1.7976931348623157E+308;
            let o = -1.7976931348623157E+308;
            let p;
            let q;
            if (f != 0) {
                for (let r = 0; r < k; r++) {
                    i[r] = i[r] + f;
                }
            }
            for (let s = 0; s < k; s++) {
                p = i[s];
                q = j[s];
                l = p < l ? p : l;
                m = q < m ? q : m;
                n = p > n ? p : n;
                o = q > o ? q : o;
            }
            let t = !(l > this.nj.right || n < this.nj.left || m > this.nj.bottom || o < this.nj.top);
            if (!t && f == 0 && g != 0) {
                if (g != 0) {
                    for (let u = 0; u < k; u++) {
                        i[u] = i[u] + g;
                    }
                }
                for (let v = 0; v < k; v++) {
                    p = i[v];
                    q = j[v];
                    l = p < l ? p : l;
                    m = q < m ? q : m;
                    n = p > n ? p : n;
                    o = q > o ? q : o;
                }
                t = !(l > this.nj.right || n < this.nj.left || m > this.nj.bottom || o < this.nj.top);
            }
            if (!t) {
                return null;
            }
            let w = b != null && (l < this.nj.left || m < this.nj.top || n > this.nj.right || o > this.nj.bottom);
            let x = new Rect(0, l, m, n - l, o - m);
            if (!a.b2(x)) {
                return null;
            }
            l = l < this.nj.left ? this.nj.left : l;
            n = n > this.nj.right ? this.nj.right : n;
            m = m < this.nj.top ? this.nj.top : m;
            o = o > this.nj.bottom ? this.nj.bottom : o;
            let y = PolySimplification.b(h, this.eu);
            let z = new DefaultFlattener().c(h.c, h.d, y, this.mx);
            let aa = z.count;
            if (w) {
                let ab = new List$1(Point_$type, 0);
                b.i = ab;
                for (let ac = 0; ac < aa; ac++) {
                    b.j(z._inner[ac]);
                }
                b.i = null;
                z = ab;
            }
            if (z == null || z.count == 0) {
                return null;
            }
            let ad = new FlattenedShape();
            ad.a = z;
            ad.b = new Rect(0, l, m, n - l, o - m);
            ad.c = x;
            return ad;
        }
        m8(a, b, c) {
            let d = this.mf;
            let e = this.mh;
            let f = a.count;
            let g = new Array(f);
            let h = new Array(f);
            for (let i = 0; i < f; i++) {
                g[i] = a._inner[i].x;
                h[i] = a._inner[i].y;
            }
            d.gs(boxArray$1(g), 0, g.length, b);
            e.gs(boxArray$1(h), 0, h.length, c);
            return new Tuple$2(Array_$type, Array_$type, g, h);
        }
        ne(a) {
            a.cp();
        }
        h3(a, b) {
            super.h3(a, b);
            let c = b;
            c.cd();
        }
        m9(a) {
            if (a != null) {
                a.ck(this);
            }
        }
        nd(a) {
            if (a != null) {
                a.bx(this);
            }
        }
        ar(a, b) {
            let c = this.mj.cr(a, b);
            let d = null;
            if (c != null) {
                d = c.dataContext;
            }
            if (d != null) {
                return d;
            }
            return super.ar(a, b);
        }
        m1(a) {
            return this.bz.item(a);
        }
        get_dq() {
            return true;
        }
        set_dq(a) {
            super.set_dq(a);
        }
        an(a) {
            if (typeCast(NumericXAxis.$, a) !== null && this.mt != null) {
                let b = 1.7976931348623157E+308;
                let c = -1.7976931348623157E+308;
                for (let d of fromEnum(this.mt)) {
                    b = Math.min(b, d.left);
                    c = Math.max(c, d.right);
                }
                return new AxisRange(b, c);
            }
            if (typeCast(NumericYAxis.$, a) !== null && this.mt != null) {
                let e = 1.7976931348623157E+308;
                let f = -1.7976931348623157E+308;
                for (let g of fromEnum(this.mt)) {
                    e = Math.min(e, g.top);
                    f = Math.max(f, g.bottom);
                }
                return new AxisRange(e, f);
            }
            return null;
        }
        get_c5() {
            return true;
        }
        nl(a, b, c) {
            if (this.styleShape != null) {
                if (this.mj.cx != null && c == this.mj.cx) {
                    c = new Style();
                    let d = this.mj.cx;
                    c.fill = d.fill;
                    c.opacity = d.opacity;
                    c.stroke = d.stroke;
                    c.strokeThickness = d.strokeThickness;
                }
                else {
                    if (c != null) {
                        let e = new Style();
                        e.fill = c.fill;
                        e.opacity = c.opacity;
                        e.stroke = c.stroke;
                        e.strokeThickness = c.strokeThickness;
                        c = e;
                    }
                    else {
                        c = new Style();
                    }
                }
                let f = new StyleShapeEventArgs(a, b, c);
                this.styleShape(this, f);
                return f.d();
            }
            return null;
        }
    }
    ShapeSeriesBase.$t = /*@__PURE__*/ markType(ShapeSeriesBase, 'ShapeSeriesBase', Series.$);
    ShapeSeriesBase.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, ShapeSeriesBase, 'raisePropertyChanged', ['ShapeFilterResolution:my:nf', [1, 2], 'ShapeMemberPath:m4:ng', [2, null], 'XAxis:mg:nh', [NumericXAxis.$, null], 'YAxis:mi:ni', [NumericYAxis.$, null]]);
    return ShapeSeriesBase;
})();
/**
 * @hidden
 */
export let ShapeSeriesViewBase = /*@__PURE__*/ (() => {
    class ShapeSeriesViewBase extends SeriesView {
        constructor(a) {
            super(a);
            this.b3 = null;
            this.by = null;
            this.b4 = new List$1(ShapeHitRegion.$, 0);
            this.b7 = 0;
            this.b6 = null;
            this.b1 = null;
            this.bz = null;
            this.cw = null;
            this.bv = null;
            this.bx = null;
            this.bw = null;
            this.bu = null;
            this.by = a;
            this.b1 = this.b0();
            this.b6 = new List$1(Path.$, 0);
            this.b3 = new Dictionary$2(Number_$type, FlattenedShape.$, 0);
        }
        b0() {
            return ((() => {
                let $ret = new Pool$1(FrameworkElement.$);
                $ret.create = runOn(this, this.cq);
                $ret.activate = runOn(this, this.cf);
                $ret.disactivate = runOn(this, this.cg);
                $ret.destroy = runOn(this, this.ch);
                return $ret;
            })());
        }
        b2(a) {
            return a.width >= this.by.mz && a.height >= this.by.mz;
        }
        static b5(a) {
            let b = new List$1(PointCollection.$, 0);
            let c;
            let d = a.count;
            for (let e = 0; e < d; e++) {
                c = a._inner[e];
                let f = new PointCollection(1, c.a);
                b.add(f);
            }
            return b;
        }
        b8(a, b, c, d) {
            if (d != null && d.count > 0) {
                let e = ShapeSeriesViewBase.b5(d);
                c.intersect(this.br);
                if (!this.b2(c)) {
                }
                else {
                    let f = this.cu(a, e);
                    if (f != null) {
                        let g = this.ct(this.b7, b);
                        for (let h = 0; h < d.count; h++) {
                            let i = new ShapeHitRegion();
                            i.d = d._inner[h].b;
                            i.a = d._inner[h].a;
                            i.b = a;
                            i.c = g;
                            this.b4.add(i);
                        }
                        this.ce(g);
                        this.ca(g, f);
                        this.cc(g, b);
                        this.b7 = this.b7 + 1;
                    }
                }
            }
        }
        ct(a, b) {
            let c = this.b1.item(this.b7);
            if (c.dataContext != null) {
                c.dataContext.item = b;
            }
            return c;
        }
        static cb(a, b, c) {
            if (b._fill == null) {
                b._fill = a.e.lb;
            }
            if (b._stroke == null) {
                b._stroke = a.e.lc;
            }
            if (b.y == null) {
                b.ac = a.e.ey;
            }
        }
        cc(a, b) {
            if (a == null) {
                return;
            }
            let c = false;
            if (this.bz != null) {
                let d = this.bz.selectStyle(b, a);
                if (d != null) {
                    c = true;
                }
                a.y = d;
            }
            if (!c) {
                a.y = this.cw;
            }
            a.y = this.by.nl(b, a, a.y);
        }
        ce(a) {
        }
        b9(a, b) {
            let c = truncate(Math.floor(a.left));
            let d = truncate(Math.ceil(a.right));
            let e = truncate(Math.floor(a.top));
            let f = truncate(Math.ceil(a.bottom));
            for (let g = c; g < d; g++) {
                for (let h = e; h < f; h++) {
                    this.cm(g, h, b);
                }
            }
        }
        cm(a, b, c) {
        }
        cj() {
            this.b7 = 0;
        }
        ci() {
            this.b1.count = this.b7;
            this.an();
        }
        cl(a, b) {
        }
        cd() {
            this.b1.count = 0;
            this.an();
        }
        cq() {
            let a = this.by;
            let b = ((() => {
                let $ret = new Path();
                $ret.dataContext = ((() => {
                    let $ret = new DataContext();
                    $ret.series = a;
                    return $ret;
                })());
                return $ret;
            })());
            this.b6.add(b);
            return b;
        }
        cf(a) {
            a._visibility = 0;
        }
        cg(a) {
            a.dataContext.item = null;
            a._visibility = 1;
        }
        ch(a) {
            this.b6.remove(a);
        }
        cv(a, b, c) {
            if (b == null) {
                return null;
            }
            let d = new PathGeometry();
            let e;
            let f = b.count;
            for (let g = 0; g < f; g++) {
                e = b._inner[g];
                if (e.count < 1) {
                    continue;
                }
                let h = new PolyLineSegment();
                h._points = e;
                let i = new PathFigure();
                i._isFilled = c;
                i._isClosed = c;
                i._startPoint = e._inner[0];
                i._segments.add(h);
                d.c.add(i);
            }
            return d;
        }
        bb(a, b) {
            super.bb(a, b);
            let c = a;
            c._fill = this.e.lb;
            c._stroke = this.e.lc;
            c.ac = this.e.ey;
            if (c.y != null) {
                this.h.i(c, c.y);
            }
        }
        bc(a, b) {
            super.bc(a, b);
            let c = a;
            let d = this.bm(b);
            c._fill = d;
            c._stroke = d;
            c.ac = this.e.ey + 3;
        }
        a3(a, b) {
            super.a3(a, b);
            for (let c = 0; c < this.b6.count; c++) {
                let d = this.b6._inner[c];
                if (d._visibility != 1) {
                    this.ba(d, c, b);
                    a.s(d);
                }
            }
        }
        get cx() {
            return this.cw;
        }
        co(a) {
            this.bz = a;
        }
        cn(a) {
            this.cw = a;
        }
        cr(a, b) {
            return this.cs(a, b, false);
        }
        cs(a, b, c) {
            if (this.b4.count == 0) {
                return null;
            }
            let d = a.x;
            let e = a.y;
            let f = this.b4.count;
            let g = this.b4;
            let h = null;
            for (let i = 0; i < f; i++) {
                h = g._inner[i];
                if (h.a == null || h.a.count == 0) {
                    continue;
                }
                if (d >= h.d.left && d <= h.d.right && e >= h.d.top && e <= h.d.bottom) {
                    if (c) {
                        let j = this.by.ey / 2 + this.by.ee(b);
                        if (GeometryUtil.b(a, h.a._inner[0], h.a, j)) {
                            return h.c;
                        }
                    }
                    else {
                        if (PolygonUtil.a(h.a, a)) {
                            return h.c;
                        }
                    }
                }
            }
            return null;
        }
        ck(a, b, c, d) {
            this.bv = a;
            this.bx = b;
            this.bw = c;
            this.bu = d;
            this.b4.clear();
        }
        cp() {
            let a = this.br;
            let b = ((() => {
                let $ret = new Path();
                $ret.y = this.cw;
                return $ret;
            })());
            b.ac = 1;
            if (this.h != null) {
                this.h.i(b, b.y);
            }
            this.by.nj = RectUtil.r(a, b.ac);
        }
        ai(a) {
            super.ai(a);
            if (this.b1.a == null) {
                return;
            }
            for (let b = 0; b < this.b1.a.count; b++) {
                let c = typeCast(Path.$, this.b1.a._inner[b]);
                if (c._visibility != 1) {
                    this.e.a2.exportPathData(a, c, "shape" + b, ["Main "]);
                }
            }
        }
    }
    ShapeSeriesViewBase.$t = /*@__PURE__*/ markType(ShapeSeriesViewBase, 'ShapeSeriesViewBase', SeriesView.$);
    return ShapeSeriesViewBase;
})();
//# sourceMappingURL=ShapeSeriesBase_combined.js.map
