/*
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 { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { DependencyProperty } from "igniteui-angular-core";
import { BrushScale } from "./BrushScale";
import { HighlightingInfo } from "igniteui-angular-core";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IEnumerable$1_$type, String_$type, enumGetBox, Number_$type, Point_$type, typeCast, runOn, delegateCombine, fromEnum, Array_$type, markType, markDep } from "igniteui-angular-core";
import { NumericXAxis } from "./NumericXAxis";
import { NumericYAxis } from "./NumericYAxis";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { StyleShapeEventArgs } from "./StyleShapeEventArgs";
import { FrameworkElement } from "igniteui-angular-core";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { ShapeHitRegion } from "./ShapeHitRegion";
import { RectUtil } from "igniteui-angular-core";
import { Tuple$3 } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { AssigningShapeStyleEventArgs } from "./AssigningShapeStyleEventArgs";
import { AssigningShapeMarkerStyleEventArgs } from "./AssigningShapeMarkerStyleEventArgs";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { CustomPaletteBrushScale } from "./CustomPaletteBrushScale";
import { ValueBrushScale } from "./ValueBrushScale";
import { PointCollectionUtil } from "igniteui-angular-core";
import { FlattenedShape } from "./FlattenedShape";
import { SeriesView } from "./SeriesView";
import { Clipper } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-angular-core";
import { ActualRange } from "./ActualRange";
import { SeriesRenderManager } from "./SeriesRenderManager";
import { PolySimplification } from "igniteui-angular-core";
import { DefaultFlattener } from "./DefaultFlattener";
import { ChartSelection } from "./ChartSelection";
import { AxisRange } from "./AxisRange";
import { Style } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { boxArray$1 } from "igniteui-angular-core";
import { InvalidOperationException } from "igniteui-angular-core";
import { isNaN_, truncate } from "igniteui-angular-core";
import { FastItemObjectColumn } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { PointCollection } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { PolyLineSegment } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { PolygonUtil } from "igniteui-angular-core";
/**
 * @hidden
 */
export let ShapeSeriesBase = /*@__PURE__*/ (() => {
    class ShapeSeriesBase extends Series {
        constructor() {
            super();
            this.xt = null;
            this.xy = false;
            this.xx = false;
            this.xr = null;
            this.xs = null;
            this.xh = 1;
            this.w2 = null;
            this.w3 = null;
            this.assigningShapeStyle = null;
            this.assigningShapeMarkerStyle = null;
            this.xl = null;
            this.xu = null;
            this.xd = null;
            this.xf = null;
            this.yk = 0;
            this.yg = null;
            this.wz = null;
            this.w1 = null;
            this.w0 = null;
            this.wy = null;
            this.z4 = null;
            this.xb = null;
            this.xn = null;
            this.w6 = null;
            this.yn = 0;
            this.styleShape = null;
            this.xl = new ShapeSeriesRenderManager();
            FastItemObjectColumn.m();
            this.yn = this.ym;
            this.z4 = Rect.empty;
        }
        o2() {
            super.o2();
            this.xe = null;
            this.xg = null;
        }
        ai() {
            return [this.xe, this.xg];
        }
        kq(a, b) {
            let c = this.nd(b);
            if (c == ShapeSeriesBase.$$p[9]) {
                return this.kr(a, b, this.y7);
            }
            return null;
        }
        md(a) {
            let b = this.nd(a);
            if (b == ShapeSeriesBase.$$p[9]) {
                return this.y7;
            }
            return super.md(a);
        }
        get xv() {
            return this.xt;
        }
        set xv(a) {
            if (this.xt != a) {
                let b = this.xv;
                this.xt = a;
                this.raisePropertyChanged("FillColumn", b, this.xv);
            }
        }
        get_fe() {
            return true;
        }
        get_ed() {
            return true;
        }
        xp(a, b, c) {
            if (this.dn == null) {
                return null;
            }
            let d = this.v7(b);
            let e = this.xm.c2(d, false);
            let f = -1;
            if (e == null) {
                if (a != null) {
                    f = this.dn.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else if (e.dataContext != null) {
                f = e.dataContext.c;
            }
            if (f == -1) {
                return null;
            }
            let g = new HighlightingInfo();
            g.i = this;
            g.g = f;
            g.f = f;
            g.c = false;
            if (c != null && c.g == g.g && c.f == g.f) {
                return c;
            }
            return g;
        }
        xq(a, b, c) {
            if (this.dn == null) {
                return null;
            }
            let d = this.xm.b4(this.v7(b));
            let e = -1;
            if (d == null) {
                if (a != null) {
                    e = this.dn.indexOf(a);
                }
                else {
                    return null;
                }
            }
            else {
                e = d.ak;
            }
            if (e == -1) {
                return null;
            }
            let f = new HighlightingInfo();
            f.i = this;
            f.g = e;
            f.f = e;
            f.c = false;
            f.d = true;
            if (c != null && c.g == f.g && c.f == f.f) {
                return c;
            }
            return f;
        }
        get xi() {
            return this.xh;
        }
        set xi(a) {
            let b = this.xh;
            this.xh = a;
            if (b != this.xh) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ShapeItemSearchMode_$type, b), enumGetBox(ShapeItemSearchMode_$type, this.xh));
            }
        }
        xj() {
            if (this.xk != 0) {
                return this.xk;
            }
            return 1;
        }
        ir(a) {
            switch (this.xi) {
                case 1: return this.zd(a).c;
                case 2: return this.yl(a);
                case 3: return this.yl(a);
            }
            return -1;
        }
        zd(a) {
            let b = this.v7(a);
            let c = { $type: Point_$type, x: NaN, y: NaN };
            let d = this.xm.ce;
            if (d == null) {
                return new Tuple$2(Number_$type, Point_$type, -1, c);
            }
            let e = this.xm.b5(b, false, !this.x0);
            if (e != null) {
                c = RectUtil.l(e.d);
                return new Tuple$2(Number_$type, Point_$type, e.b, c);
            }
            let f = b.x;
            let g = b.y;
            if (this.dn == null || this.xe == null || this.xg == null || this.yg == null) {
                return new Tuple$2(Number_$type, Point_$type, -1, c);
            }
            if (this.dn.count > this.yq) {
                return new Tuple$2(Number_$type, Point_$type, -1, c);
            }
            let h = 1.7976931348623157E+308;
            let i = -1;
            for (let j = 0; j < d.count; j++) {
                let k = d._inner[j].d;
                let l = RectUtil.g(k, b);
                if (l < h) {
                    h = l;
                    i = d._inner[j].b;
                    c = RectUtil.l(d._inner[j].d);
                }
            }
            return new Tuple$2(Number_$type, Point_$type, i, c);
        }
        zc(a) {
            let b = this.v7(a);
            let c = b.x;
            let d = b.y;
            let e = { $type: Point_$type, x: NaN, y: NaN };
            if (this.dn == null || this.xe == null || this.xg == null || this.yg == null) {
                return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
            }
            if (this.dn.count > this.yq) {
                return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
            }
            let f = 1.7976931348623157E+308;
            let g = this.xm.ce;
            if (g == null) {
                return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
            }
            let h = this.xm.b5(b, false, !this.x0);
            if (h != null) {
                let i = RectUtil.l(h.d);
                let j = this.zb(b, h.a, this.x0);
                return new Tuple$3(Number_$type, Point_$type, Point_$type, h.b, j.d, i);
            }
            for (let k = 0; k < g.count; k++) {
                let l = g._inner[k].d;
                let m = RectUtil.g(l, b);
                let n = (l.width * l.width) + (l.height * l.height) + m;
                if (n <= f) {
                    f = n;
                }
            }
            let o = 1.7976931348623157E+308;
            let p = -1;
            for (let q = 0; q < g.count; q++) {
                let r = g._inner[q].d;
                let s = RectUtil.g(r, b);
                if (s < f) {
                    let t = this.zb(b, g._inner[q].a, this.x0);
                    if (t.c < o) {
                        o = t.c;
                        e = t.d;
                        p = q;
                    }
                }
            }
            if (p >= 0) {
                return new Tuple$3(Number_$type, Point_$type, Point_$type, g._inner[p].b, e, RectUtil.l(g._inner[p].d));
            }
            return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
        }
        get_x0() {
            return true;
        }
        get x0() {
            return this.get_x0();
        }
        zb(a, b, c) {
            let d = { $type: Point_$type, x: NaN, y: NaN };
            let e = 1.7976931348623157E+308;
            let f = { $type: Point_$type, x: NaN, y: NaN };
            let g = false;
            let h = -1;
            for (let i = 0; i < b.count; i++) {
                let j = b._inner[i];
                if (i >= 1) {
                    let k = GeometryUtil.h(a, d, j);
                    if (k < e) {
                        e = k;
                        g = true;
                        h = i;
                    }
                }
                d = j;
            }
            if (c) {
                let l = b._inner[0];
                let m = GeometryUtil.h(a, d, l);
                if (m < e) {
                    e = m;
                    let n = GeometryUtil.m(a, d, l);
                    f = { $type: Point_$type, x: d.x + (l.x - d.x) * n, y: d.y + (l.y - d.y) * n };
                    return new Tuple$2(Number_$type, Point_$type, e, f);
                }
            }
            if (g) {
                let o = b._inner[h - 1];
                let p = b._inner[h];
                let q = GeometryUtil.m(a, o, p);
                f = { $type: Point_$type, x: o.x + (p.x - o.x) * q, y: o.y + (p.y - o.y) * q };
            }
            return new Tuple$2(Number_$type, Point_$type, e, f);
        }
        yl(a) {
            return this.zc(a).c;
        }
        wc(a, b, c) {
            if (this.xe == null || this.xg == null || this.yg == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            switch (this.xi) {
                case 1:
                    let d = this.zd(a);
                    return d.d;
                case 2:
                    let e = this.zc(a);
                    return e.e;
                case 3:
                    let f = this.zc(a);
                    return f.d;
            }
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        kn(a) {
            let b = this.j3(a);
            if (this.dn != null && b >= 0 && b < this.dn.count) {
                return this.dn.item(b);
            }
            return null;
        }
        xo(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dn.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        dg(a, b, c) {
            if (this.ed && this.fz(this.bx) && !c) {
                let d = this.xp(a, b, this.xr);
                this.xr = d;
                return d;
            }
            else {
                let e = this.xo(a, b, this.xr);
                this.xr = e;
                return e;
            }
        }
        dh(a, b, c) {
            if (this.fz(this.bx) && !c) {
                let d = this.xq(a, b, this.xs);
                this.xs = d;
                return d;
            }
            else {
                let e = this.xo(a, b, this.xs);
                e.d = true;
                this.xs = e;
                return e;
            }
        }
        ye() {
            return (this.assigningShapeStyle != null && this.xy) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1) || (this.xv != null && this.xa != null);
        }
        yd() {
            return (this.assigningShapeMarkerStyle != null && this.xx) || this.d2 || (this.bx != 1) || (this.cp != 1) || (this.co != 1);
        }
        get yy() {
            return this.c(ShapeSeriesBase.zu);
        }
        set yy(a) {
            this.h(ShapeSeriesBase.zu, a);
        }
        gb() {
            return this.highlightedItemsSource != null || this.yy != null;
        }
        ht() {
            let a = super.ht();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "ShapeMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedShapeMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.zg));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.r0));
                a.add(c);
            }
            {
                let d = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.r0));
                a.add(d);
            }
            return a;
        }
        zg(a, b) {
            if (this.yy != null) {
                b.value = this.yy;
                return;
            }
            b.value = this.y7;
        }
        get xw() {
            return this.xu;
        }
        set xw(a) {
            let b = this.xw != a;
            if (b) {
                let c = this.xw;
                this.xu = a;
                this.raisePropertyChanged("ShapeColumn", c, this.xw);
            }
        }
        x5(array_) {
            let a = (Array.isArray(array_));
            return a;
        }
        static x9(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.x9(d)) && (isNaN_(e) || ShapeSeriesBase.x9(e))) {
                            d = (curr_.X);
                            e = (curr_.Y);
                            if (!isNaN_(d) && !ShapeSeriesBase.x9(d) && !isNaN_(e) && !ShapeSeriesBase.x9(e)) {
                                g = true;
                                f = true;
                            }
                        }
                        else {
                            g = true;
                        }
                    }
                    i.add({ $type: Point_$type, x: d, y: e });
                }
                b.add(i);
            }
            return b;
        }
        dm(a) {
            if (this.dn != null && this.x5(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.dm(a);
        }
        q9(a, b, c, d) {
            super.q9(a, b, c, d);
            let e = false;
            let f = false;
            switch (b) {
                case ShapeSeriesBase.$$p[5]:
                    this.xi = this.xj();
                    break;
                case "FastItemsSource":
                    let g = typeCast(IFastItemsSource_$type, c);
                    if (g != null) {
                        if (this.xv != null) {
                            g.deregisterColumn(this.xv);
                        }
                        if (this.xw != null) {
                            g.deregisterColumn(this.xw);
                        }
                        this.xw = null;
                    }
                    let h = typeCast(IFastItemsSource_$type, d);
                    if (h != null) {
                        if (this.y7 != null) {
                            this.xw = this.dm(this.y7);
                        }
                        if (this.yu != null) {
                            this.xv = this.dk(this.yu);
                        }
                    }
                    e = this.xe != null && !this.xe.c1();
                    f = this.xg != null && !this.xg.c1();
                    if (e || f) {
                        this.rr(this.gg && c != null);
                    }
                    break;
                case ShapeSeriesBase.$$p[9]:
                    if (this.dn != null) {
                        this.dn.deregisterColumn(this.xw);
                        this.xw = this.dm(this.y7);
                    }
                    break;
                case "ShapeColumn":
                    this.zo();
                    e = this.xe != null && !this.xe.c1();
                    f = this.xg != null && !this.xg.c1();
                    if (e || f) {
                        this.rr(this.gg && this.d7);
                    }
                    this.ql();
                    break;
                case ShapeSeriesBase.$$p[10]:
                case ShapeSeriesBase.$$p[11]:
                    this.xd = this.xe;
                    this.xf = this.xg;
                    let i = c;
                    let j = d;
                    this.zp(i);
                    this.zh(j);
                    if ((j != null && !j.c1()) || (j == null && i != null)) {
                        this.rr(false);
                    }
                    this.ql();
                    break;
                case "ActualResolution":
                    this.yk = this.id;
                    this.ql();
                    break;
                case "ActualBrush":
                    this.rr(false);
                    break;
                case ShapeSeriesBase.$$p[8]:
                    this.yn = this.ym;
                    this.rr(false);
                    this.ql();
                    break;
                case ShapeSeriesBase.$$p[2]:
                case "ActualThickness":
                    this.rr(false);
                    this.ql();
                    break;
                case ShapeSeriesBase.$$p[4]:
                    this.xy = this.yc();
                    this.rr(false);
                    break;
                case ShapeSeriesBase.$$p[3]:
                    this.xx = this.yb();
                    this.rr(false);
                    break;
                case ShapeSeriesBase.$$p[1]:
                    if (c != null) {
                        c.o.remove(this);
                        c.x();
                        this.xb = null;
                        this.xn = null;
                    }
                    if (d != null) {
                        d.o.add(this);
                        d.x();
                        this.xb = typeCast(CustomPaletteBrushScale.$, d);
                        this.xn = typeCast(ValueBrushScale.$, d);
                    }
                    this.rr(false);
                    this.ql();
                    break;
                case "FillColumn":
                    this.rr(this.gg && this.d7);
                    this.ql();
                    break;
                case ShapeSeriesBase.$$p[0]:
                    if (this.xa != null) {
                        this.xa.x();
                    }
                    if (this.dn != null) {
                        this.dn.deregisterColumn(this.xv);
                        this.xv = this.dk(this.yu);
                    }
                    break;
            }
        }
        yc() {
            return this.x8;
        }
        yb() {
            return this.x7;
        }
        x2(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        x1(a) {
            if (typeCast(NumericXAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        zo() {
            this.yg = null;
            if (this.xw == null) {
                return;
            }
            this.yg = new List$1(Rect.$, 2, this.xw.count);
            for (let a = 0; a < this.xw.count; a++) {
                this.yg.add(PointCollectionUtil.j(this.xw.item(a)));
            }
        }
        z5(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;
        }
        yi(a, b, c, d, e, f, g) {
            return this.yj(a, b, c, d, e, f, g);
            if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
                return this.yj(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.xc(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.xc(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_x6() {
            return true;
        }
        get x6() {
            return this.get_x6();
        }
        yf() {
            return false;
        }
        rs(a) {
            this.zn(this.cv);
        }
        rq(a, b, c, d, e) {
            super.rq(a, b, c, d, e);
            let f = this.ba.a$j.item(d);
            let g = f;
            f.a3(c);
            if (this.d5(f)) {
                return;
            }
            this.zn(f);
        }
        updateFillScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.xv != null) {
                a.b = this.xv.minimum;
                a.a = this.xv.maximum;
            }
            if (this.xa != null) {
                this.xa.z(a.b, a.a);
            }
        }
        zn(a) {
            if (this.d5(a)) {
                return;
            }
            if (this.xa != null) {
                this.w6 = this.w7();
            }
            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.xw == null) {
                return;
            }
            let f = this.xe;
            let g = this.xg;
            let h = this.getEffectiveViewport1(a);
            let i = new ScalerParams(1, b, c, f.ch);
            i.c = h;
            let j = new ScalerParams(1, b, c, g.ch);
            j.c = h;
            if (!this.gr) {
                d.cu();
                let k = new Rect(0, 0, 0, 0, 0);
                let l;
                let m;
                let n;
                let o;
                let p = this.xw.count;
                if (this.w1 == null || this.w1.length != p) {
                    this.w1 = new Array(p);
                    this.wz = new Array(p);
                    this.w0 = new Array(p);
                    this.wy = new Array(p);
                }
                let q = this.w1;
                let r = this.wz;
                let s = this.w0;
                let t = this.wy;
                let u;
                for (let v = 0; v < p; v++) {
                    u = this.yg._inner[v];
                    q[v] = u.top;
                    r[v] = u.left;
                    s[v] = u.right;
                    t[v] = u.bottom;
                }
                this.xd.hq(boxArray$1(r), 0, r.length, i);
                this.xd.hq(boxArray$1(s), 0, s.length, i);
                this.xf.hq(boxArray$1(q), 0, q.length, j);
                this.xf.hq(boxArray$1(t), 0, t.length, j);
                d.cv(r, q, s, t);
                let w = this.xw;
                let x = this.dn;
                this.zq(d);
                let y = c.left;
                let z = c.right;
                let aa = c.top;
                let ab = c.bottom;
                let ac = null;
                if (this.z4.isEmpty) {
                    ac = null;
                }
                else {
                    ac = new Clipper(1, this.z4.left, this.z4.bottom, this.z4.right, this.z4.top, this.x6);
                }
                let ad = this.yf();
                if (ad) {
                    d.cc.clear();
                }
                let ae = false;
                let af = true;
                let ag = 0;
                if (this.db != null) {
                    if (this.db.f4()) {
                        let ah = this.db.m4(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.yi(a, ai, w.item(aj), i, j, 0, ag);
                        if (ad) {
                            ShapeSeriesBase.zm(d, aj, ak);
                        }
                        d.ci(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.yi(a, ai, w.item(aj), i, j, ag, ag);
                            if (ad) {
                                ShapeSeriesBase.zm(d, aj, al);
                            }
                            d.ci(aj, x.item(aj), k, al);
                        }
                    }
                }
                d.ct();
            }
            let am = this.ye();
            this.xl.az(this, this.ye(), runOn(this, this.w4));
            let an = false;
            let ao = this.xl.b;
            if (ao != null) {
                an = true;
            }
            let ap = a.q;
            let aq = this.fy;
            let ar = d.ca;
            d.cp((as) => {
                let at = as.dataContext != null ? as.dataContext.item : null;
                let au = as.dataContext != null ? as.dataContext.c : -1;
                d.cm(as, at, am);
                if (an) {
                    this.zj(as, aq, au, this.xw.count, ap, ar);
                }
                else {
                    if (ar) {
                        {
                            this.xl.a1(as, this.ib, ar);
                        }
                    }
                }
                {
                    this.xl.ad(as, false, false, false, false);
                }
            });
        }
        w7() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.xv != null) {
                a.b = this.xv.minimum;
                a.a = this.xv.maximum;
            }
            let b = typeCast(ValueBrushScale.$, this.xa);
            if (b != null) {
                b.s();
                if (this.x3 && this.xa.o.count > 1) {
                    a.b = b.q;
                    a.a = b.p;
                }
            }
            return a;
        }
        zj(a, b, c, d, e, f) {
            let g = this.bx != 1;
            let h = this.cp != 1;
            let i = this.co != 1;
            this.xl.a0(this.xl.b, c, d, false);
            {
                this.xl.a1(a, this.ib, f);
            }
            let j = this.xl.ax;
            let k = null;
            let l = null;
            let m = null;
            let n = this.dn;
            if (this.xv != null && this.xa != null) {
                if (j.z >= 0 && j.z < this.xv.count) {
                    let o = this.xv.item(j.z);
                    let p = this.w6;
                    let q = p.b;
                    let r = p.a;
                    let s = j.aa;
                    if (this.xb != null) {
                        s = this.xb.getBrush1(j.z, this.xv.count);
                    }
                    else if (this.xn != null && this.xv != null) {
                        let t = this.xv.item(j.z);
                        s = this.xn.getBrushByRange(t, q, r);
                    }
                    else if (this.xa != null) {
                        s = this.xa.getBrush(j.z);
                    }
                    j.aa = s;
                }
            }
            if (g && this.db != null) {
                k = this.db.dl.getHighlightingInfo(this, n, j.z, j.y, false);
                j.c = k;
            }
            if (h && this.db != null) {
                l = this.db.dm.getHighlightingInfo(this, n, j.z, j.y, false);
                if (l == null && this.bn != null) {
                    l = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, j.z, j.y, false);
                }
                if (l == null && this.bk != null) {
                    l = this.db.dm.getHighlightingInfo(this.bk, this.bk.dn, j.z, j.y, true);
                }
                j.d = l;
            }
            if (i && this.db != null) {
                m = this.db.dk.getHighlightingInfo(this, n, j.z, j.y, false);
                j.b = m;
            }
            j.h = e;
            this.zl(j);
            this.xl.z(this, k, l, m, e, g, h, i, false);
        }
        zi(a, b, c) {
            let d = this.bx != 1;
            let e = this.cp != 1;
            let f = this.co != 1;
            this.xl.a0(this.xl.d, a, b, true);
            this.xl.aa(this.ib);
            let g = this.xl.aw;
            let h = null;
            let i = null;
            let j = null;
            let k = this.dn;
            let l = null;
            let m = null;
            let n = null;
            if (d && this.db != null) {
                h = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.db.dl.isCrossContextHighlight(this)) {
                    l = this.db.dl.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.c = h;
            }
            if (e && this.db != null) {
                i = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
                if (i == null && this.bn != null) {
                    i = this.db.dm.getHighlightingInfo(this.bn, this.bn.dn, g.z, g.y, true);
                }
                if (this.db.dm.isCrossContextHighlight(this)) {
                    m = this.db.dm.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.d = i;
            }
            if (f && this.db != null) {
                j = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                if (this.db.dk.isCrossContextHighlight(this)) {
                    n = this.db.dk.getHighlightingInfo(this, k, g.z, g.y, true);
                }
                g.b = i;
            }
            g.h = c;
            this.zk(g);
            this.xl.y(this, h, i, j, c, d, e, f, g.v, this.db.dl.totalHighWaterMark, g.x, this.db.dm.totalHighWaterMark, g.t, this.db.dk.totalHighWaterMark);
        }
        zl(a) {
            if (this.assigningShapeStyle != null && this.xy) {
                this.assigningShapeStyle(this, a);
            }
        }
        zk(a) {
            if (this.assigningShapeMarkerStyle != null && this.xx) {
                this.assigningShapeMarkerStyle(this, a);
            }
        }
        w4(a, b) {
            return this.w5(a, b);
        }
        w5(a, b) {
            if (b < a || a < 0 || a > this.xw.count || b < 0 || b > this.xw.count) {
                return null;
            }
            let c = new Array((b - a) + 1);
            for (let d = a; d <= b; d++) {
                let e = d;
                c[d - a] = this.dn.item(d);
            }
            return c;
        }
        static zm(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.cc.addItem(b, e);
        }
        qb() {
            super.qb();
            if (this.xe != null) {
                this.xe.ia();
            }
            if (this.xg != null) {
                this.xg.ia();
            }
        }
        sr(a, b) {
            this.rr(false);
        }
        sq(a, b) {
            this.rr(false);
        }
        pb(a, b, c, d) {
            super.pb(a, b, c, d);
            switch (a) {
                case 3:
                    if (d == this.y7) {
                        this.yg._inner[b] = this.z5(this.xw.item(b));
                    }
                    break;
                case 1:
                    for (let e = b; e < b + c; e++) {
                        this.yg.insert(e, this.z5(this.xw.item(e)));
                    }
                    break;
                case 0:
                    this.yg.v(b, c);
                    break;
                case 2:
                    for (let f = b; f < b + c; f++) {
                        this.yg._inner[f] = this.z5(this.xw.item(f));
                    }
                    break;
                case 4:
                    this.zo();
                    break;
            }
            this.rr(false);
        }
        he(a, b, c) {
            let d = true;
            if (!super.he(a, b, c) || (this.ya && this.xw == null) || b.isEmpty || a.isEmpty || this.xe == null || this.xg == null || this.xe.bi == null || this.xg.bi == null || this.xe.l4 == this.xe.l3 || this.xg.l4 == this.xg.l3 || this.xw == null || this.xw.count == 0 || this.yg == null || this.yg.count == 0 || this.yg.count != this.xw.count) {
                d = false;
            }
            return d;
        }
        get_ya() {
            return true;
        }
        get ya() {
            return this.get_ya();
        }
        q1(a) {
            super.q1(a);
            this.xm = typeCast(ShapeSeriesViewBase.$, a);
        }
        yj(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.xc(a, b, i, d, e, f, g);
                if (l == null) {
                    continue;
                }
                h.add(l);
            }
            return h;
        }
        xc(a, b, c, d, e, f, g) {
            let h = this.ze(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.z4.right || n < this.z4.left || m > this.z4.bottom || o < this.z4.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.z4.right || n < this.z4.left || m > this.z4.bottom || o < this.z4.top);
            }
            if (!t) {
                return null;
            }
            let w = b != null && (l < this.z4.left || m < this.z4.top || n > this.z4.right || o > this.z4.bottom);
            let x = new Rect(0, l, m, n - l, o - m);
            if (!a.cb(x)) {
                return null;
            }
            l = l < this.z4.left ? this.z4.left : l;
            n = n > this.z4.right ? this.z4.right : n;
            m = m < this.z4.top ? this.z4.top : m;
            o = o > this.z4.bottom ? this.z4.bottom : o;
            let y = PolySimplification.b(h, this.id);
            let z = new DefaultFlattener().c(h.c, h.d, y, this.yk);
            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;
        }
        ze(a, b, c) {
            let d = this.xd;
            let e = this.xf;
            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.hq(boxArray$1(g), 0, g.length, b);
            e.hq(boxArray$1(h), 0, h.length, c);
            return new Tuple$2(Array_$type, Array_$type, g, h);
        }
        zq(a) {
            a.c0();
        }
        o5(a, b) {
            super.o5(a, b);
            let c = b;
            c.cn();
        }
        zh(a) {
            if (a != null) {
                a.ct(this);
            }
        }
        zp(a) {
            if (a != null) {
                a.b0(this);
            }
        }
        zf(a, b, c) {
            let d = this.cv;
            let e = d.bx;
            let f = this.wr(a);
            if (e.width < 1 || e.height < 1 || this.xw == null) {
                return;
            }
            let g = this.getEffectiveViewport1(d);
            let h = new ScalerParams(0, f, e, this.xe.ch, g);
            let i = new ScalerParams(0, f, e, this.xg.ch, g);
            d.cu();
            let j = this.xw.count;
            let k = new Array(j);
            let l = new Array(j);
            let m = new Array(j);
            let n = new Array(j);
            let o;
            for (let p = 0; p < j; p++) {
                o = this.yg._inner[p];
                k[p] = o.top;
                l[p] = o.left;
                m[p] = o.right;
                n[p] = o.bottom;
            }
            this.xe.hq(boxArray$1(l), 0, l.length, h);
            this.xe.hq(boxArray$1(m), 0, m.length, h);
            this.xg.hq(boxArray$1(k), 0, k.length, i);
            this.xg.hq(boxArray$1(n), 0, n.length, i);
            d.cv(l, k, m, n);
            d.c0();
            let q = null;
            if (!this.z4.isEmpty) {
                q = new Clipper(1, this.z4.left, this.z4.bottom, this.z4.right, this.z4.top, this.x6);
            }
            let r = false;
            let s = 0;
            if (this.db != null) {
                if (this.db.f4()) {
                    let t = this.db.m4(f, h);
                    r = t.c;
                    s = t.d;
                }
            }
            let u, v, w, x;
            let y = new Rect(0, 0, 0, 0, 0);
            for (let z = 0; z < j; z++) {
                w = l[z];
                u = k[z];
                v = n[z];
                x = m[z];
                y.x = Math.min(w, x);
                y.y = Math.min(u, v);
                y.width = Math.max(w, x) - y.x;
                y.height = Math.max(u, v) - y.y;
                if (r) {
                    y.x = y.x + s;
                }
                if (!y.intersectsWith(e)) {
                    continue;
                }
                let aa = this.yi(d, q, this.xw.item(z), h, i, s, s);
                if (aa.count <= 0) {
                    continue;
                }
                this.xz(b, c, z);
            }
        }
        xz(a, b, c) {
            if (b == 7 || b == 6) {
                a.add(((() => {
                    let $ret = new ChartSelection();
                    $ret.series = this;
                    return $ret;
                })()));
                return false;
            }
            else if (b == 1 || b == 2) {
                a.add(((() => {
                    let $ret = new ChartSelection();
                    $ret.item = this.dn.item(c);
                    return $ret;
                })()));
                return true;
            }
            else {
                a.add(((() => {
                    let $ret = new ChartSelection();
                    $ret.item = this.dn.item(c);
                    $ret.series = this;
                    return $ret;
                })()));
                return true;
            }
        }
        a2(a, b) {
            let c = this.xm.c2(a, b);
            let d = null;
            if (c != null) {
                d = c.dataContext;
            }
            if (d != null) {
                return d;
            }
            return super.a2(a, b);
        }
        yr(a) {
            return this.dn.item(a);
        }
        get_g7() {
            return true;
        }
        set_g7(a) {
            super.set_g7(a);
        }
        ay(a) {
            if (typeCast(NumericXAxis.$, a) !== null && this.yg != null) {
                let b = 1.7976931348623157E+308;
                let c = -1.7976931348623157E+308;
                for (let d of fromEnum(this.yg)) {
                    b = Math.min(b, d.left);
                    c = Math.max(c, d.right);
                }
                return new AxisRange(b, c);
            }
            if (typeCast(NumericYAxis.$, a) !== null && this.yg != null) {
                let e = 1.7976931348623157E+308;
                let f = -1.7976931348623157E+308;
                for (let g of fromEnum(this.yg)) {
                    e = Math.min(e, g.top);
                    f = Math.max(f, g.bottom);
                }
                return new AxisRange(e, f);
            }
            return null;
        }
        get_fx() {
            return true;
        }
        get_fl() {
            return true;
        }
        get x4() {
            return this.styleShape != null;
        }
        z6(a, b, c) {
            if (this.styleShape != null) {
                if (this.xm.c9 != null && c == this.xm.c9) {
                    c = new Style();
                    let d = this.xm.c9;
                    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 c;
        }
    }
    ShapeSeriesBase.$t = markType(ShapeSeriesBase, 'ShapeSeriesBase', Series.$, [ISupportsFillScale_$type]);
    ShapeSeriesBase.zu = DependencyProperty.i("HighlightedValueMemberPath", String_$type, ShapeSeriesBase.$, new PropertyMetadata(2, null, (a, b) => a.raisePropertyChanged("HighlightedValueMemberPath", b.oldValue, b.newValue)));
    ShapeSeriesBase.$$p = markDep(DependencyProperty, PropertyMetadata, ShapeSeriesBase, 'raisePropertyChanged', ['FillMemberPath:yu:zr', [2], 'FillScale:xa:zs', [BrushScale.$], 'FillScaleUseGlobalValues:x3:zt', [0, false], 'IsCustomShapeMarkerStyleAllowed:x7:zv', [0, false], 'IsCustomShapeStyleAllowed:x8:zw', [0, false], 'ItemSearchMode:xk:zx', [ShapeItemSearchMode_$type, enumGetBox(ShapeItemSearchMode_$type, 0)], 'ItemSearchPointsThreshold:yp:zy', [1, 10000], 'ItemSearchThreshold:yq:zz', [1, 10000], 'ShapeFilterResolution:ym:z0', [1, 2], 'ShapeMemberPath:y7:z1', [2, null], 'XAxis:xe:z2', [NumericXAxis.$, null], 'YAxis:xg:z3', [NumericYAxis.$, null]]);
    return ShapeSeriesBase;
})();
/**
 * @hidden
 */
export let ShapeSeriesRenderManager = /*@__PURE__*/ (() => {
    class ShapeSeriesRenderManager extends SeriesRenderManager {
        constructor() {
            super(...arguments);
            this.aw = null;
            this.ax = null;
        }
        c() {
            this.aw = new AssigningShapeMarkerStyleEventArgs();
            return this.aw;
        }
        a() {
            this.ax = new AssigningShapeStyleEventArgs();
            return this.ax;
        }
        a1(a, b, c) {
            this.ag = this.ak;
            this.ah = this.al;
            this.m = this.t;
            this.am = this.an;
            this.ao = this.ar;
            this.k = this.r;
            this.l = this.s;
            this.j = this.q;
            if (c) {
                if (a._fill != null) {
                    this.ag = a._fill;
                }
                if (a._stroke != null) {
                    this.ah = a._stroke;
                }
                if (!isNaN_(a.ad) && (a.y == null || !isNaN_(a.y.strokeThickness))) {
                    this.m = a.ad;
                }
            }
            let d = this.b;
            if (d != null) {
                d.aa = this.ag;
                d.ab = this.ah;
                d.ae = this.m;
                d.af = this.am;
                d.ag = this.ao;
                d.ac = this.k;
                d.ad = this.l;
                d.o = this.j;
                d.g = this.f;
                d.k = b;
                d.f = false;
            }
        }
        ay(a, b, c) {
            this.w(a, b, c);
        }
        az(a, b, c) {
            this.x(a, b, c);
        }
        a0(a, b, c, d) {
            if (b == -1) {
                a.e = false;
                a.z = 0;
                a.y = c - 1;
            }
            else {
                if (d) {
                    a.z = b;
                    a.y = b;
                }
                else {
                    a.e = false;
                    a.z = b;
                    a.y = b;
                }
            }
        }
    }
    ShapeSeriesRenderManager.$t = markType(ShapeSeriesRenderManager, 'ShapeSeriesRenderManager', SeriesRenderManager.$);
    return ShapeSeriesRenderManager;
})();
/**
 * @hidden
 */
export let ShapeSeriesViewBase = /*@__PURE__*/ (() => {
    class ShapeSeriesViewBase extends SeriesView {
        constructor(a) {
            super(a);
            this.cc = null;
            this.b6 = null;
            this.cd = new List$1(ShapeHitRegion.$, 0);
            this.ch = 0;
            this.cg = null;
            this.b9 = null;
            this.c7 = new Path();
            this.b7 = null;
            this.c8 = null;
            this.b1 = null;
            this.b3 = null;
            this.b2 = null;
            this.b0 = null;
            this.b6 = a;
            this.b9 = this.b8();
            this.cg = new List$1(Path.$, 0);
            this.cc = new Dictionary$2(Number_$type, FlattenedShape.$, 0);
        }
        b4(a) {
            return null;
        }
        get ce() {
            return this.cd;
        }
        b8() {
            return ((() => {
                let $ret = new Pool$1(FrameworkElement.$);
                $ret.create = runOn(this, this.c1);
                $ret.activate = runOn(this, this.cq);
                $ret.disactivate = runOn(this, this.cr);
                $ret.destroy = runOn(this, this.cs);
                return $ret;
            })());
        }
        cb(a) {
            return a.width >= this.b6.yn && a.height >= this.b6.yn;
        }
        static cf(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;
        }
        get ca() {
            return this.c8 != null || this.b7 != null || this.b6.x4;
        }
        ci(a, b, c, d) {
            if (d != null && d.count > 0) {
                let e = ShapeSeriesViewBase.cf(d);
                c.intersect(this.bx);
                if (!this.cb(c)) {
                }
                else {
                    let f = this.c5(a, e);
                    if (f != null) {
                        let g = this.c4(this.ch, 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.cd.add(i);
                        }
                        this.ck(g, f);
                        this.ch = this.ch + 1;
                    }
                }
            }
        }
        c4(a, b) {
            let c = this.b9.item(this.ch);
            if (c.dataContext != null) {
                c.dataContext.item = b;
                c.dataContext.c = a;
            }
            return c;
        }
        static cl(a, b, c) {
            if (b._fill == null) {
                b._fill = a.e.u9;
            }
            if (b._stroke == null) {
                b._stroke = a.e.vd;
            }
            if (b.y == null) {
                b.ad = a.e.ie;
            }
        }
        cp(a) {
            for (let b = 0; b < this.b9.a.count; b++) {
                let c = this.b9.a._inner[b];
                a(c);
            }
        }
        cm(a, b, c) {
            if (a == null) {
                return;
            }
            this.co(a, c);
            let d = false;
            if (this.b7 != null) {
                let e = this.b7.selectStyle(b, a);
                if (e != null) {
                    d = true;
                }
                if (a.y != e) {
                    a.y = e;
                    this.k.j(a, a.y);
                }
            }
            if (!d) {
                if (a.y != this.c8) {
                    a.y = this.c8;
                    this.k.j(a, a.y);
                }
            }
            let f = this.b6.z6(b, a, a.y);
            if (a.y != f) {
                a.y = f;
                this.k.j(a, a.y);
            }
        }
        co(a, b) {
        }
        cj(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.cx(g, h, b);
                }
            }
        }
        cx(a, b, c) {
        }
        cu() {
            this.ch = 0;
        }
        ct() {
            this.b9.count = this.ch;
            this.as();
        }
        cw(a, b) {
        }
        cn() {
            this.b9.count = 0;
            this.as();
        }
        c1() {
            let a = this.b6;
            let b = ((() => {
                let $ret = new Path();
                $ret.dataContext = ((() => {
                    let $ret = new DataContext();
                    $ret.series = a;
                    return $ret;
                })());
                return $ret;
            })());
            this.cg.add(b);
            return b;
        }
        cq(a) {
            a._visibility = 0;
        }
        cr(a) {
            a.dataContext.item = null;
            a._visibility = 1;
        }
        cs(a) {
            this.cg.remove(a);
        }
        c6(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;
        }
        ac(a) {
            return this.cg._inner[a];
        }
        ab(a) {
            let b = this.cg._inner[a];
            this.c7._visibility = b._visibility;
            this.c7.an = b.an;
            let c = this.bs(a);
            this.c7._fill = c;
            this.c7._stroke = c;
            this.c7.ad = this.e.ie + 3;
            return this.c7;
        }
        a8(a, b) {
            super.a8(a, b);
            for (let c = 0; c < this.cg.count; c++) {
                let d = this.aa(c, b);
                if (d._visibility != 1) {
                    a.t(d);
                }
            }
        }
        get c9() {
            return this.c8;
        }
        cz(a) {
            this.b7 = a;
        }
        cy(a) {
            this.c8 = a;
        }
        c2(a, b) {
            return this.c3(a, b, false);
        }
        c3(a, b, c) {
            let d = this.b5(a, b, c);
            if (d == null) {
                return null;
            }
            return d.c;
        }
        b5(a, b, c) {
            if (this.cd.count == 0) {
                return null;
            }
            let d = a.x;
            let e = a.y;
            let f = this.cd.count;
            let g = this.cd;
            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.b6.ie / 2 + this.b6.iu(b);
                        if (GeometryUtil.e(a, h.a._inner[0], h.a, j)) {
                            return h;
                        }
                    }
                    else {
                        if (PolygonUtil.b(h.a, a)) {
                            return h;
                        }
                    }
                }
            }
            return null;
        }
        cv(a, b, c, d) {
            this.b1 = a;
            this.b3 = b;
            this.b2 = c;
            this.b0 = d;
            this.cd.clear();
        }
        c0() {
            let a = this.bx;
            let b = ((() => {
                let $ret = new Path();
                $ret.y = this.c8;
                return $ret;
            })());
            b.ad = 1;
            if (this.k != null) {
                this.k.j(b, b.y);
            }
            this.b6.z4 = RectUtil.r(a, b.ad);
        }
        an(a) {
            super.an(a);
            if (this.b9.a == null) {
                return;
            }
            for (let b = 0; b < this.b9.a.count; b++) {
                let c = typeCast(Path.$, this.b9.a._inner[b]);
                if (c._visibility != 1) {
                    this.e.bc.exportPathData(a, c, "shape" + b, ["Main "]);
                }
            }
        }
    }
    ShapeSeriesViewBase.$t = markType(ShapeSeriesViewBase, 'ShapeSeriesViewBase', SeriesView.$);
    return ShapeSeriesViewBase;
})();
