/*
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 { __extends, __values } from "tslib";
import { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { HighlightingInfo } from "./HighlightingInfo";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IEnumerable$1_$type, enumGetBox, Number_$type, Point_$type, String_$type, typeCast, runOn, delegateCombine, fromEnum, Array_$type, markType, markDep } 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 { StyleShapeEventArgs } from "./StyleShapeEventArgs";
import { FrameworkElement } from "igniteui-react-core";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { Tuple$2 } from "igniteui-react-core";
import { ShapeHitRegion } from "./ShapeHitRegion";
import { RectUtil } from "igniteui-react-core";
import { Tuple$3 } from "igniteui-react-core";
import { GeometryUtil } from "igniteui-react-core";
import { AssigningShapeStyleEventArgs } from "./AssigningShapeStyleEventArgs";
import { AssigningShapeMarkerStyleEventArgs } from "./AssigningShapeMarkerStyleEventArgs";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
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 { SeriesRenderManager } from "./SeriesRenderManager";
import { PolySimplification } from "igniteui-react-core";
import { DefaultFlattener } from "./DefaultFlattener";
import { AxisRange } from "./AxisRange";
import { Style } from "igniteui-react-core";
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 { PointCollection } from "igniteui-react-core";
import { PathGeometry } from "igniteui-react-core";
import { PolyLineSegment } from "igniteui-react-core";
import { PathFigure } from "igniteui-react-core";
import { PolygonUtil } from "igniteui-react-core";
/**
 * @hidden
 */
var ShapeSeriesBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ShapeSeriesBase, _super);
    function ShapeSeriesBase() {
        var _this = _super.call(this) || this;
        _this.uu = false;
        _this.ut = false;
        _this.uf = null;
        _this.ug = null;
        _this.ul = 1;
        _this.t5 = null;
        _this.t6 = null;
        _this.assigningShapeStyle = null;
        _this.assigningShapeMarkerStyle = null;
        _this.up = null;
        _this.ur = null;
        _this.uh = null;
        _this.uj = null;
        _this.ve = 0;
        _this.va = null;
        _this.t2 = null;
        _this.t4 = null;
        _this.t3 = null;
        _this.t1 = null;
        _this.wp = null;
        _this.vh = 0;
        _this.styleShape = null;
        _this.up = new ShapeSeriesRenderManager();
        FastItemObjectColumn.m();
        _this.vh = _this.vg;
        _this.wp = Rect.empty;
        return _this;
    }
    ShapeSeriesBase.prototype.ng = function () {
        _super.prototype.ng.call(this);
        this.ui = null;
        this.uk = null;
    };
    ShapeSeriesBase.prototype.ag = function () {
        return [this.ui, this.uk];
    };
    ShapeSeriesBase.prototype.ju = function (a, b) {
        var c = this.lv(b);
        if (c == ShapeSeriesBase.$$p[6]) {
            return this.jv(a, b, this.vw);
        }
        return null;
    };
    ShapeSeriesBase.prototype.get_es = function () {
        return true;
    };
    ShapeSeriesBase.prototype.get_du = function () {
        return true;
    };
    ShapeSeriesBase.prototype.ud = function (a, b, c) {
        var d = this.tc(b);
        var e = this.uq.c2(d, false);
        var f = -1;
        if (e == null) {
            if (a != null) {
                f = this.c6.indexOf(a);
            }
            else {
                return null;
            }
        }
        else if (e.dataContext != null) {
            f = e.dataContext.c;
        }
        if (f == -1) {
            return null;
        }
        var g = new HighlightingInfo();
        g.b = this;
        g.h = f;
        g.g = f;
        g.d = false;
        if (c != null && c.h == g.h && c.g == g.g) {
            return c;
        }
        return g;
    };
    ShapeSeriesBase.prototype.ue = function (a, b, c) {
        var d = this.uq.b4(this.tc(b));
        var e = -1;
        if (d == null) {
            if (a != null) {
                e = this.c6.indexOf(a);
            }
            else {
                return null;
            }
        }
        else {
            e = d.ak;
        }
        if (e == -1) {
            return null;
        }
        var f = new HighlightingInfo();
        f.b = this;
        f.h = e;
        f.g = e;
        f.d = false;
        f.e = true;
        if (c != null && c.h == f.h && c.g == f.g) {
            return c;
        }
        return f;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "um", {
        get: function () {
            return this.ul;
        },
        set: function (a) {
            var b = this.ul;
            this.ul = a;
            if (b != this.ul) {
                this.raisePropertyChanged("ActualItemSearchMode", enumGetBox(ShapeItemSearchMode_$type, b), enumGetBox(ShapeItemSearchMode_$type, this.ul));
            }
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.un = function () {
        if (this.uo != 0) {
            return this.uo;
        }
        return 1;
    };
    ShapeSeriesBase.prototype.hv = function (a) {
        switch (this.um) {
            case 1: return this.v2(a).c;
            case 2: return this.vf(a);
            case 3: return this.vf(a);
        }
        return -1;
    };
    ShapeSeriesBase.prototype.v2 = function (a) {
        var b = this.tc(a);
        var c = { $type: Point_$type, x: NaN, y: NaN };
        var d = this.uq.ce;
        if (d == null) {
            return new Tuple$2(Number_$type, Point_$type, -1, c);
        }
        var e = this.uq.b5(b, false, !this.uv);
        if (e != null) {
            c = RectUtil.l(e.d);
            return new Tuple$2(Number_$type, Point_$type, e.b, c);
        }
        var f = b.x;
        var g = b.y;
        if (this.c6 == null || this.ui == null || this.uk == null || this.va == null) {
            return new Tuple$2(Number_$type, Point_$type, -1, c);
        }
        if (this.c6.count > this.vk) {
            return new Tuple$2(Number_$type, Point_$type, -1, c);
        }
        var h = 1.7976931348623157E+308;
        var i = -1;
        for (var j = 0; j < d.count; j++) {
            var k = d._inner[j].d;
            var 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);
    };
    ShapeSeriesBase.prototype.v1 = function (a) {
        var b = this.tc(a);
        var c = b.x;
        var d = b.y;
        var e = { $type: Point_$type, x: NaN, y: NaN };
        if (this.c6 == null || this.ui == null || this.uk == null || this.va == null) {
            return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
        }
        if (this.c6.count > this.vk) {
            return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
        }
        var f = 1.7976931348623157E+308;
        var g = this.uq.ce;
        if (g == null) {
            return new Tuple$3(Number_$type, Point_$type, Point_$type, -1, e, e);
        }
        var h = this.uq.b5(b, false, !this.uv);
        if (h != null) {
            var i = RectUtil.l(h.d);
            var j = this.v0(b, h.a, this.uv);
            return new Tuple$3(Number_$type, Point_$type, Point_$type, h.b, j.d, i);
        }
        for (var k = 0; k < g.count; k++) {
            var l = g._inner[k].d;
            var m = RectUtil.g(l, b);
            var n = (l.width * l.width) + (l.height * l.height) + m;
            if (n <= f) {
                f = n;
            }
        }
        var o = 1.7976931348623157E+308;
        var p = -1;
        for (var q = 0; q < g.count; q++) {
            var r = g._inner[q].d;
            var s = RectUtil.g(r, b);
            if (s < f) {
                var t = this.v0(b, g._inner[q].a, this.uv);
                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);
    };
    ShapeSeriesBase.prototype.get_uv = function () {
        return true;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "uv", {
        get: function () {
            return this.get_uv();
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.v0 = function (a, b, c) {
        var d = { $type: Point_$type, x: NaN, y: NaN };
        var e = 1.7976931348623157E+308;
        var f = { $type: Point_$type, x: NaN, y: NaN };
        var g = false;
        var h = -1;
        for (var i = 0; i < b.count; i++) {
            var j = b._inner[i];
            if (i >= 1) {
                var k = GeometryUtil.d(a, d, j);
                if (k < e) {
                    e = k;
                    g = true;
                    h = i;
                }
            }
            d = j;
        }
        if (c) {
            var l = b._inner[0];
            var m = GeometryUtil.d(a, d, l);
            if (m < e) {
                e = m;
                var n = GeometryUtil.h(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) {
            var o = b._inner[h - 1];
            var p = b._inner[h];
            var q = GeometryUtil.h(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);
    };
    ShapeSeriesBase.prototype.vf = function (a) {
        return this.v1(a).c;
    };
    ShapeSeriesBase.prototype.th = function (a, b, c) {
        if (this.ui == null || this.uk == null || this.va == null) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        switch (this.um) {
            case 1:
                var d = this.v2(a);
                return d.d;
            case 2:
                var e = this.v1(a);
                return e.e;
            case 3:
                var f = this.v1(a);
                return f.d;
        }
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    ShapeSeriesBase.prototype.jr = function (a) {
        var b = this.i8(a);
        if (this.c6 != null && b >= 0 && b < this.c6.count) {
            return this.c6.item(b);
        }
        return null;
    };
    ShapeSeriesBase.prototype.uc = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.h = 0;
        d.g = this.c6.count - 1;
        d.d = true;
        if (c != null && c.h == d.h && c.g == d.g) {
            return c;
        }
        return d;
    };
    ShapeSeriesBase.prototype.ax = function (a, b, c) {
        if (this.du && this.fc(this.bs) && !c) {
            var d = this.ud(a, b, this.uf);
            this.uf = d;
            return d;
        }
        else {
            var e = this.uc(a, b, this.uf);
            this.uf = e;
            return e;
        }
    };
    ShapeSeriesBase.prototype.ay = function (a, b, c) {
        if (this.fc(this.bs) && !c) {
            var d = this.ue(a, b, this.ug);
            this.ug = d;
            return d;
        }
        else {
            var e = this.uc(a, b, this.ug);
            e.e = true;
            this.ug = e;
            return e;
        }
    };
    ShapeSeriesBase.prototype.u8 = function () {
        return (this.assigningShapeStyle != null && this.uu) || (this.bs != 1);
    };
    ShapeSeriesBase.prototype.u7 = function () {
        return (this.assigningShapeMarkerStyle != null && this.ut) || (this.bs != 1);
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "vn", {
        get: function () {
            return this.c(ShapeSeriesBase.wf);
        },
        set: function (a) {
            this.h(ShapeSeriesBase.wf, a);
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.fn = function () {
        return this.highlightedItemsSource != null || this.vn != null;
    };
    ShapeSeriesBase.prototype.g0 = function () {
        var a = _super.prototype.g0.call(this);
        {
            var b = ((function () {
                var $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.v4));
            a.add(b);
        }
        {
            var c = ((function () {
                var $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.px));
            a.add(c);
        }
        {
            var d = ((function () {
                var $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.px));
            a.add(d);
        }
        return a;
    };
    ShapeSeriesBase.prototype.v4 = function (a, b) {
        if (this.vn != null) {
            b.value = this.vn;
            return;
        }
        b.value = this.vw;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "us", {
        get: function () {
            return this.ur;
        },
        set: function (a) {
            var b = this.us != a;
            if (b) {
                var c = this.us;
                this.ur = a;
                this.raisePropertyChanged("ShapeColumn", c, this.us);
            }
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.uz = function (array_) {
        var a = (Array.isArray(array_));
        return a;
    };
    ShapeSeriesBase.u3 = function (a) {
        if (a == null) {
            return true;
        }
        var val_ = a;
        return (val_ == undefined);
    };
    ShapeSeriesBase.prototype.convertToListList = function (a) {
        if (a == null) {
            return null;
        }
        var b = new List$1(List$1.$.specialize(Point_$type), 0);
        var c;
        var curr_;
        var d;
        var e;
        var f = false;
        var g = false;
        for (var h = 0; h < a.length; h++) {
            c = a[h];
            if (c == null) {
                continue;
            }
            var i = new List$1(Point_$type, 0);
            for (var 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.u3(d)) && (isNaN_(e) || ShapeSeriesBase.u3(e))) {
                        d = (curr_.X);
                        e = (curr_.Y);
                        if (!isNaN_(d) && !ShapeSeriesBase.u3(d) && !isNaN_(e) && !ShapeSeriesBase.u3(e)) {
                            g = true;
                            f = true;
                        }
                    }
                    else {
                        g = true;
                    }
                }
                i.add({ $type: Point_$type, x: d, y: e });
            }
            b.add(i);
        }
        return b;
    };
    ShapeSeriesBase.prototype.c5 = function (a) {
        if (this.c6 != null && this.uz(this.itemsSource) && a != null && a.split('!').length != 2) {
            if (this.coercionMethods == null) {
                this.coercionMethods = {};
            }
            var methods_ = this.coercionMethods;
            methods_.convertToListList = this.convertToListList;
            a += "!convertToListList";
        }
        return _super.prototype.c5.call(this, a);
    };
    ShapeSeriesBase.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        var e = false;
        var f = false;
        switch (b) {
            case ShapeSeriesBase.$$p[2]:
                this.um = this.un();
                break;
            case "FastItemsSource":
                var g = typeCast(IFastItemsSource_$type, c);
                if (g != null) {
                    g.deregisterColumn(this.us);
                    this.us = null;
                }
                var h = typeCast(IFastItemsSource_$type, d);
                if (h != null) {
                    this.us = this.c5(this.vw);
                }
                e = this.ui != null && !this.ui.c1();
                f = this.uk != null && !this.uk.c1();
                if (e || f) {
                    this.pp(this.fq && c != null);
                }
                break;
            case ShapeSeriesBase.$$p[6]:
                if (this.c6 != null) {
                    this.c6.deregisterColumn(this.us);
                    this.us = this.c5(this.vw);
                }
                break;
            case "ShapeColumn":
                this.wc();
                e = this.ui != null && !this.ui.c1();
                f = this.uk != null && !this.uk.c1();
                if (e || f) {
                    this.pp(this.fq && this.dn);
                }
                this.ol();
                break;
            case ShapeSeriesBase.$$p[7]:
            case ShapeSeriesBase.$$p[8]:
                this.uh = this.ui;
                this.uj = this.uk;
                var i = c;
                var j = d;
                this.wd(i);
                this.v5(j);
                if ((j != null && !j.c1()) || (j == null && i != null)) {
                    this.pp(false);
                }
                this.ol();
                break;
            case "ActualResolution":
                this.ve = this.hj;
                this.ol();
                break;
            case "ActualBrush":
                this.pp(false);
                break;
            case ShapeSeriesBase.$$p[5]:
                this.vh = this.vg;
                this.pp(false);
                this.ol();
                break;
            case "ActualThickness":
                this.pp(false);
                this.ol();
                break;
            case ShapeSeriesBase.$$p[1]:
                this.uu = this.u6();
                this.pp(false);
                break;
            case ShapeSeriesBase.$$p[0]:
                this.ut = this.u5();
                this.pp(false);
                break;
        }
    };
    ShapeSeriesBase.prototype.u6 = function () {
        return this.u2;
    };
    ShapeSeriesBase.prototype.u5 = function () {
        return this.u1;
    };
    ShapeSeriesBase.prototype.ux = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    ShapeSeriesBase.prototype.uw = function (a) {
        if (typeCast(NumericXAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    ShapeSeriesBase.prototype.wc = function () {
        this.va = null;
        if (this.us == null) {
            return;
        }
        this.va = new List$1(Rect.$, 2, this.us.count);
        for (var a = 0; a < this.us.count; a++) {
            this.va.add(PointCollectionUtil.j(this.us.item(a)));
        }
    };
    ShapeSeriesBase.prototype.wq = function (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;
    };
    ShapeSeriesBase.prototype.vc = function (a, b, c, d, e, f, g) {
        var e_1, _a;
        return this.vd(a, b, c, d, e, f, g);
        if (typeCast(List$1.$.specialize(List$1.$.specialize(Point_$type)), c) !== null) {
            return this.vd(a, b, c, d, e, f, g);
        }
        else if (typeCast(IEnumerable$1_$type.specialize(IEnumerable$1_$type.specialize(Point_$type)), c) !== null) {
            var h = c;
            var i = new List$1(FlattenedShape.$, 0);
            var j = null;
            try {
                for (var _b = __values(fromEnum(h)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var k = _c.value;
                    j = this.ub(a, b, PointCollectionUtil.b(k), d, e, f, g);
                    if (j == null) {
                        continue;
                    }
                    i.add(j);
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
            return i;
        }
        else if (typeCast(IEnumerable$1_$type.specialize(Point_$type), c) !== null) {
            var l = c;
            var m = this.ub(a, b, PointCollectionUtil.b(l), d, e, f, g);
            var n = new List$1(FlattenedShape.$, 0);
            if (m != null) {
                n.add(m);
            }
            return n;
        }
        else {
            throw new InvalidOperationException(1, "Unrecognized data in ShapeColumn");
        }
    };
    ShapeSeriesBase.prototype.get_u0 = function () {
        return true;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "u0", {
        get: function () {
            return this.get_u0();
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.u9 = function () {
        return false;
    };
    ShapeSeriesBase.prototype.pq = function (a) {
        this.wb(this.cj);
    };
    ShapeSeriesBase.prototype.po = function (a, b, c, d, e) {
        _super.prototype.po.call(this, a, b, c, d, e);
        var f = this.a7.a$h.item(d);
        var g = f;
        f.a3(c);
        if (this.dl(f)) {
            return;
        }
        this.wb(f);
    };
    ShapeSeriesBase.prototype.wb = function (a) {
        var _this = this;
        if (this.dl(a)) {
            return;
        }
        var b;
        var c;
        var d = a;
        var e = a.getViewInfo(c, b);
        c = e.p0;
        b = e.p1;
        if (c.width < 1 || c.height < 1 || this.us == null) {
            return;
        }
        var f = this.ui;
        var g = this.uk;
        var h = this.getEffectiveViewport1(a);
        var i = new ScalerParams(1, b, c, f.ch);
        i.c = h;
        var j = new ScalerParams(1, b, c, g.ch);
        j.c = h;
        if (!this.f0) {
            d.cu();
            var k = new Rect(0, 0, 0, 0, 0);
            var l = void 0;
            var m = void 0;
            var n = void 0;
            var o = void 0;
            var p = this.us.count;
            if (this.t4 == null || this.t4.length != p) {
                this.t4 = new Array(p);
                this.t2 = new Array(p);
                this.t3 = new Array(p);
                this.t1 = new Array(p);
            }
            var q = this.t4;
            var r = this.t2;
            var s = this.t3;
            var t = this.t1;
            var u = void 0;
            for (var v = 0; v < p; v++) {
                u = this.va._inner[v];
                q[v] = u.top;
                r[v] = u.left;
                s[v] = u.right;
                t[v] = u.bottom;
            }
            this.uh.hn(boxArray$1(r), 0, r.length, i);
            this.uh.hn(boxArray$1(s), 0, s.length, i);
            this.uj.hn(boxArray$1(q), 0, q.length, j);
            this.uj.hn(boxArray$1(t), 0, t.length, j);
            d.cv(r, q, s, t);
            var w = this.us;
            var x = this.c6;
            this.we(d);
            var y = c.left;
            var z = c.right;
            var aa = c.top;
            var ab = c.bottom;
            var ac = null;
            if (this.wp.isEmpty) {
                ac = null;
            }
            else {
                ac = new Clipper(1, this.wp.left, this.wp.bottom, this.wp.right, this.wp.top, this.u0);
            }
            var ad = this.u9();
            if (ad) {
                d.cc.clear();
            }
            var ae = false;
            var af = true;
            var ag = 0;
            if (this.cy != null) {
                if (this.cy.fb()) {
                    var ah = this.cy.lo(b, i);
                    ae = ah.c;
                    ag = ah.d;
                }
            }
            var ai = void 0;
            for (var 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;
                    }
                    var ak = this.vc(a, ai, w.item(aj), i, j, 0, ag);
                    if (ad) {
                        ShapeSeriesBase.wa(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;
                        }
                        var al = this.vc(a, ai, w.item(aj), i, j, ag, ag);
                        if (ad) {
                            ShapeSeriesBase.wa(d, aj, al);
                        }
                        d.ci(aj, x.item(aj), k, al);
                    }
                }
            }
            d.ct();
        }
        var am = this.u8();
        this.up.az(this, this.u8(), runOn(this, this.t7));
        var an = false;
        var ao = this.up.b;
        if (ao != null) {
            an = true;
        }
        var ap = a.q;
        var aq = this.fb;
        var ar = d.ca;
        d.cp(function (as) {
            var at = as.dataContext != null ? as.dataContext.item : null;
            var au = as.dataContext != null ? as.dataContext.c : -1;
            d.cm(as, at, am);
            if (an) {
                _this.v7(as, aq, au, _this.us.count, ap, ar);
            }
            else {
                if (ar) {
                    {
                        _this.up.a1(as, _this.hh, ar);
                    }
                }
            }
            {
                _this.up.ad(as, false, false, false, false);
            }
        });
    };
    ShapeSeriesBase.prototype.v7 = function (a, b, c, d, e, f) {
        var g = this.bs != 1;
        this.up.a0(this.up.b, c, d, false);
        {
            this.up.a1(a, this.hh, f);
        }
        var h = this.up.ax;
        var i = null;
        var j = this.c6;
        if (g && this.cy != null) {
            i = this.cy.a7.getHighlightingInfo(this, j, h.o, h.n, false);
            h.b = i;
        }
        h.f = e;
        this.v9(h);
        this.up.z(this, i, e, g, false);
    };
    ShapeSeriesBase.prototype.v6 = function (a, b, c) {
        var d = this.bs != 1;
        this.up.a0(this.up.d, a, b, true);
        this.up.aa(this.hh);
        var e = this.up.aw;
        var f = null;
        var g = this.c6;
        var h = null;
        if (d && this.cy != null) {
            f = this.cy.a7.getHighlightingInfo(this, g, e.o, e.n, true);
            if (this.cy.a7.isCrossSeriesHighlight(this)) {
                h = this.cy.a7.getHighlightingInfo(this, g, e.o, e.n, true);
            }
            e.b = f;
        }
        e.f = c;
        this.v8(e);
        this.up.y(this, f, c, d, e.l, this.cy.a7.sumHighlightingProgress);
    };
    ShapeSeriesBase.prototype.v9 = function (a) {
        if (this.assigningShapeStyle != null && this.uu) {
            this.assigningShapeStyle(this, a);
        }
    };
    ShapeSeriesBase.prototype.v8 = function (a) {
        if (this.assigningShapeMarkerStyle != null && this.ut) {
            this.assigningShapeMarkerStyle(this, a);
        }
    };
    ShapeSeriesBase.prototype.t7 = function (a, b) {
        return this.t8(a, b);
    };
    ShapeSeriesBase.prototype.t8 = function (a, b) {
        if (b < a || a < 0 || a > this.us.count || b < 0 || b > this.us.count) {
            return null;
        }
        var c = new Array((b - a) + 1);
        for (var d = a; d <= b; d++) {
            var e = d;
            c[d - a] = this.c6.item(d);
        }
        return c;
    };
    ShapeSeriesBase.wa = function (a, b, c) {
        var d = 0;
        var e = null;
        for (var f = 0; f < c.count; f++) {
            var g = c._inner[f];
            var h = g.b.width * g.b.height;
            if (h > d) {
                d = h;
                e = g;
            }
        }
        a.cc.addItem(b, e);
    };
    ShapeSeriesBase.prototype.ob = function () {
        _super.prototype.ob.call(this);
        if (this.ui != null) {
            this.ui.h7();
        }
        if (this.uk != null) {
            this.uk.h7();
        }
    };
    ShapeSeriesBase.prototype.qn = function (a, b) {
        this.pp(false);
    };
    ShapeSeriesBase.prototype.qm = function (a, b) {
        this.pp(false);
    };
    ShapeSeriesBase.prototype.no = function (a, b, c, d) {
        _super.prototype.no.call(this, a, b, c, d);
        switch (a) {
            case 3:
                if (d == this.vw) {
                    this.va._inner[b] = this.wq(this.us.item(b));
                }
                break;
            case 1:
                for (var e = b; e < b + c; e++) {
                    this.va.insert(e, this.wq(this.us.item(e)));
                }
                break;
            case 0:
                this.va.v(b, c);
                break;
            case 2:
                for (var f = b; f < b + c; f++) {
                    this.va._inner[f] = this.wq(this.us.item(f));
                }
                break;
            case 4:
                this.wc();
                break;
        }
        this.pp(false);
    };
    ShapeSeriesBase.prototype.gl = function (a, b, c) {
        var d = true;
        if (!_super.prototype.gl.call(this, a, b, c) || (this.u4 && this.us == null) || b.isEmpty || a.isEmpty || this.ui == null || this.uk == null || this.ui.bi == null || this.uk.bi == null || this.ui.lx == this.ui.lw || this.uk.lx == this.uk.lw || this.us == null || this.us.count == 0 || this.va == null || this.va.count == 0 || this.va.count != this.us.count) {
            d = false;
        }
        return d;
    };
    ShapeSeriesBase.prototype.get_u4 = function () {
        return true;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "u4", {
        get: function () {
            return this.get_u4();
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.o0 = function (a) {
        _super.prototype.o0.call(this, a);
        this.uq = typeCast(ShapeSeriesViewBase.$, a);
    };
    ShapeSeriesBase.prototype.vd = function (a, b, c, d, e, f, g) {
        var h = new List$1(FlattenedShape.$, 0);
        var i;
        var j = c.count;
        for (var k = 0; k < j; k++) {
            i = c._inner[k];
            var l = this.ub(a, b, i, d, e, f, g);
            if (l == null) {
                continue;
            }
            h.add(l);
        }
        return h;
    };
    ShapeSeriesBase.prototype.ub = function (a, b, c, d, e, f, g) {
        var h = this.v3(c, d, e);
        var i = h.c;
        var j = h.d;
        var k = i.length;
        var l = 1.7976931348623157E+308;
        var m = 1.7976931348623157E+308;
        var n = -1.7976931348623157E+308;
        var o = -1.7976931348623157E+308;
        var p;
        var q;
        if (f != 0) {
            for (var r = 0; r < k; r++) {
                i[r] = i[r] + f;
            }
        }
        for (var 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;
        }
        var t = !(l > this.wp.right || n < this.wp.left || m > this.wp.bottom || o < this.wp.top);
        if (!t && f == 0 && g != 0) {
            if (g != 0) {
                for (var u = 0; u < k; u++) {
                    i[u] = i[u] + g;
                }
            }
            for (var 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.wp.right || n < this.wp.left || m > this.wp.bottom || o < this.wp.top);
        }
        if (!t) {
            return null;
        }
        var w = b != null && (l < this.wp.left || m < this.wp.top || n > this.wp.right || o > this.wp.bottom);
        var x = new Rect(0, l, m, n - l, o - m);
        if (!a.cb(x)) {
            return null;
        }
        l = l < this.wp.left ? this.wp.left : l;
        n = n > this.wp.right ? this.wp.right : n;
        m = m < this.wp.top ? this.wp.top : m;
        o = o > this.wp.bottom ? this.wp.bottom : o;
        var y = PolySimplification.b(h, this.hj);
        var z = new DefaultFlattener().c(h.c, h.d, y, this.ve);
        var aa = z.count;
        if (w) {
            var ab = new List$1(Point_$type, 0);
            b.i = ab;
            for (var ac = 0; ac < aa; ac++) {
                b.j(z._inner[ac]);
            }
            b.i = null;
            z = ab;
        }
        if (z == null || z.count == 0) {
            return null;
        }
        var ad = new FlattenedShape();
        ad.a = z;
        ad.b = new Rect(0, l, m, n - l, o - m);
        ad.c = x;
        return ad;
    };
    ShapeSeriesBase.prototype.v3 = function (a, b, c) {
        var d = this.uh;
        var e = this.uj;
        var f = a.count;
        var g = new Array(f);
        var h = new Array(f);
        for (var i = 0; i < f; i++) {
            g[i] = a._inner[i].x;
            h[i] = a._inner[i].y;
        }
        d.hn(boxArray$1(g), 0, g.length, b);
        e.hn(boxArray$1(h), 0, h.length, c);
        return new Tuple$2(Array_$type, Array_$type, g, h);
    };
    ShapeSeriesBase.prototype.we = function (a) {
        a.c0();
    };
    ShapeSeriesBase.prototype.nj = function (a, b) {
        _super.prototype.nj.call(this, a, b);
        var c = b;
        c.cn();
    };
    ShapeSeriesBase.prototype.v5 = function (a) {
        if (a != null) {
            a.ct(this);
        }
    };
    ShapeSeriesBase.prototype.wd = function (a) {
        if (a != null) {
            a.b0(this);
        }
    };
    ShapeSeriesBase.prototype.au = function (a, b) {
        var c = this.uq.c2(a, b);
        var d = null;
        if (c != null) {
            d = c.dataContext;
        }
        if (d != null) {
            return d;
        }
        return _super.prototype.au.call(this, a, b);
    };
    ShapeSeriesBase.prototype.vl = function (a) {
        return this.c6.item(a);
    };
    ShapeSeriesBase.prototype.get_gf = function () {
        return true;
    };
    ShapeSeriesBase.prototype.set_gf = function (a) {
        _super.prototype.set_gf.call(this, a);
    };
    ShapeSeriesBase.prototype.aq = function (a) {
        var e_2, _a, e_3, _b;
        if (typeCast(NumericXAxis.$, a) !== null && this.va != null) {
            var b = 1.7976931348623157E+308;
            var c = -1.7976931348623157E+308;
            try {
                for (var _c = __values(fromEnum(this.va)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var d = _d.value;
                    b = Math.min(b, d.left);
                    c = Math.max(c, d.right);
                }
            }
            catch (e_2_1) {
                e_2 = { error: e_2_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_2)
                        throw e_2.error;
                }
            }
            return new AxisRange(b, c);
        }
        if (typeCast(NumericYAxis.$, a) !== null && this.va != null) {
            var e = 1.7976931348623157E+308;
            var f = -1.7976931348623157E+308;
            try {
                for (var _e = __values(fromEnum(this.va)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var g = _f.value;
                    e = Math.min(e, g.top);
                    f = Math.max(f, g.bottom);
                }
            }
            catch (e_3_1) {
                e_3 = { error: e_3_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_3)
                        throw e_3.error;
                }
            }
            return new AxisRange(e, f);
        }
        return null;
    };
    ShapeSeriesBase.prototype.get_fa = function () {
        return true;
    };
    ShapeSeriesBase.prototype.get_ey = function () {
        return true;
    };
    Object.defineProperty(ShapeSeriesBase.prototype, "uy", {
        get: function () {
            return this.styleShape != null;
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesBase.prototype.wr = function (a, b, c) {
        if (this.styleShape != null) {
            if (this.uq.c9 != null && c == this.uq.c9) {
                c = new Style();
                var d = this.uq.c9;
                c.fill = d.fill;
                c.opacity = d.opacity;
                c.stroke = d.stroke;
                c.strokeThickness = d.strokeThickness;
            }
            else {
                if (c != null) {
                    var 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();
                }
            }
            var f = new StyleShapeEventArgs(a, b, c);
            this.styleShape(this, f);
            return f.d();
        }
        return c;
    };
    ShapeSeriesBase.$t = markType(ShapeSeriesBase, 'ShapeSeriesBase', Series.$);
    ShapeSeriesBase.wf = DependencyProperty.i("HighlightedValueMemberPath", String_$type, ShapeSeriesBase.$, new PropertyMetadata(2, null, function (a, b) { return a.raisePropertyChanged("HighlightedValueMemberPath", b.oldValue, b.newValue); }));
    ShapeSeriesBase.$$p = markDep(DependencyProperty, PropertyMetadata, ShapeSeriesBase, 'raisePropertyChanged', ['IsCustomShapeMarkerStyleAllowed:u1:wg', [0, false], 'IsCustomShapeStyleAllowed:u2:wh', [0, false], 'ItemSearchMode:uo:wi', [ShapeItemSearchMode_$type, enumGetBox(ShapeItemSearchMode_$type, 0)], 'ItemSearchPointsThreshold:vj:wj', [1, 10000], 'ItemSearchThreshold:vk:wk', [1, 10000], 'ShapeFilterResolution:vg:wl', [1, 2], 'ShapeMemberPath:vw:wm', [2, null], 'XAxis:ui:wn', [NumericXAxis.$, null], 'YAxis:uk:wo', [NumericYAxis.$, null]]);
    return ShapeSeriesBase;
}(Series));
export { ShapeSeriesBase };
/**
 * @hidden
 */
var ShapeSeriesRenderManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ShapeSeriesRenderManager, _super);
    function ShapeSeriesRenderManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.aw = null;
        _this.ax = null;
        return _this;
    }
    ShapeSeriesRenderManager.prototype.c = function () {
        this.aw = new AssigningShapeMarkerStyleEventArgs();
        return this.aw;
    };
    ShapeSeriesRenderManager.prototype.a = function () {
        this.ax = new AssigningShapeStyleEventArgs();
        return this.ax;
    };
    ShapeSeriesRenderManager.prototype.a1 = function (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;
            }
        }
        var d = this.b;
        if (d != null) {
            d.p = this.ag;
            d.q = this.ah;
            d.t = this.m;
            d.u = this.am;
            d.v = this.ao;
            d.r = this.k;
            d.s = this.l;
            d.k = this.j;
            d.e = this.f;
            d.i = b;
            d.d = false;
        }
    };
    ShapeSeriesRenderManager.prototype.ay = function (a, b, c) {
        this.w(a, b, c);
    };
    ShapeSeriesRenderManager.prototype.az = function (a, b, c) {
        this.x(a, b, c);
    };
    ShapeSeriesRenderManager.prototype.a0 = function (a, b, c, d) {
        if (b == -1) {
            a.c = false;
            a.o = 0;
            a.n = c - 1;
        }
        else {
            if (d) {
                a.o = b;
                a.n = b;
            }
            else {
                a.c = false;
                a.o = b;
                a.n = b;
            }
        }
    };
    ShapeSeriesRenderManager.$t = markType(ShapeSeriesRenderManager, 'ShapeSeriesRenderManager', SeriesRenderManager.$);
    return ShapeSeriesRenderManager;
}(SeriesRenderManager));
export { ShapeSeriesRenderManager };
/**
 * @hidden
 */
var ShapeSeriesViewBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ShapeSeriesViewBase, _super);
    function ShapeSeriesViewBase(a) {
        var _this = _super.call(this, a) || this;
        _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);
        return _this;
    }
    ShapeSeriesViewBase.prototype.b4 = function (a) {
        return null;
    };
    Object.defineProperty(ShapeSeriesViewBase.prototype, "ce", {
        get: function () {
            return this.cd;
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesViewBase.prototype.b8 = function () {
        var _this = this;
        return ((function () {
            var $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;
        })());
    };
    ShapeSeriesViewBase.prototype.cb = function (a) {
        return a.width >= this.b6.vh && a.height >= this.b6.vh;
    };
    ShapeSeriesViewBase.cf = function (a) {
        var b = new List$1(PointCollection.$, 0);
        var c;
        var d = a.count;
        for (var e = 0; e < d; e++) {
            c = a._inner[e];
            var f = new PointCollection(1, c.a);
            b.add(f);
        }
        return b;
    };
    Object.defineProperty(ShapeSeriesViewBase.prototype, "ca", {
        get: function () {
            return this.c8 != null || this.b7 != null || this.b6.uy;
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesViewBase.prototype.ci = function (a, b, c, d) {
        if (d != null && d.count > 0) {
            var e = ShapeSeriesViewBase.cf(d);
            c.intersect(this.bx);
            if (!this.cb(c)) {
            }
            else {
                var f = this.c5(a, e);
                if (f != null) {
                    var g = this.c4(this.ch, b);
                    for (var h = 0; h < d.count; h++) {
                        var 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;
                }
            }
        }
    };
    ShapeSeriesViewBase.prototype.c4 = function (a, b) {
        var c = this.b9.item(this.ch);
        if (c.dataContext != null) {
            c.dataContext.item = b;
            c.dataContext.c = a;
        }
        return c;
    };
    ShapeSeriesViewBase.cl = function (a, b, c) {
        if (b._fill == null) {
            b._fill = a.e.ss;
        }
        if (b._stroke == null) {
            b._stroke = a.e.sv;
        }
        if (b.y == null) {
            b.ad = a.e.hk;
        }
    };
    ShapeSeriesViewBase.prototype.cp = function (a) {
        for (var b = 0; b < this.b9.a.count; b++) {
            var c = this.b9.a._inner[b];
            a(c);
        }
    };
    ShapeSeriesViewBase.prototype.cm = function (a, b, c) {
        if (a == null) {
            return;
        }
        this.co(a, c);
        var d = false;
        if (this.b7 != null) {
            var 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);
            }
        }
        var f = this.b6.wr(b, a, a.y);
        if (a.y != f) {
            a.y = f;
            this.k.j(a, a.y);
        }
    };
    ShapeSeriesViewBase.prototype.co = function (a, b) {
    };
    ShapeSeriesViewBase.prototype.cj = function (a, b) {
        var c = truncate(Math.floor(a.left));
        var d = truncate(Math.ceil(a.right));
        var e = truncate(Math.floor(a.top));
        var f = truncate(Math.ceil(a.bottom));
        for (var g = c; g < d; g++) {
            for (var h = e; h < f; h++) {
                this.cx(g, h, b);
            }
        }
    };
    ShapeSeriesViewBase.prototype.cx = function (a, b, c) {
    };
    ShapeSeriesViewBase.prototype.cu = function () {
        this.ch = 0;
    };
    ShapeSeriesViewBase.prototype.ct = function () {
        this.b9.count = this.ch;
        this.as();
    };
    ShapeSeriesViewBase.prototype.cw = function (a, b) {
    };
    ShapeSeriesViewBase.prototype.cn = function () {
        this.b9.count = 0;
        this.as();
    };
    ShapeSeriesViewBase.prototype.c1 = function () {
        var a = this.b6;
        var b = ((function () {
            var $ret = new Path();
            $ret.dataContext = ((function () {
                var $ret = new DataContext();
                $ret.series = a;
                return $ret;
            })());
            return $ret;
        })());
        this.cg.add(b);
        return b;
    };
    ShapeSeriesViewBase.prototype.cq = function (a) {
        a._visibility = 0;
    };
    ShapeSeriesViewBase.prototype.cr = function (a) {
        a.dataContext.item = null;
        a._visibility = 1;
    };
    ShapeSeriesViewBase.prototype.cs = function (a) {
        this.cg.remove(a);
    };
    ShapeSeriesViewBase.prototype.c6 = function (a, b, c) {
        if (b == null) {
            return null;
        }
        var d = new PathGeometry();
        var e;
        var f = b.count;
        for (var g = 0; g < f; g++) {
            e = b._inner[g];
            if (e.count < 1) {
                continue;
            }
            var h = new PolyLineSegment();
            h._points = e;
            var i = new PathFigure();
            i._isFilled = c;
            i._isClosed = c;
            i._startPoint = e._inner[0];
            i._segments.add(h);
            d.c.add(i);
        }
        return d;
    };
    ShapeSeriesViewBase.prototype.ac = function (a) {
        return this.cg._inner[a];
    };
    ShapeSeriesViewBase.prototype.ab = function (a) {
        var b = this.cg._inner[a];
        this.c7._visibility = b._visibility;
        this.c7.an = b.an;
        var c = this.bs(a);
        this.c7._fill = c;
        this.c7._stroke = c;
        this.c7.ad = this.e.hk + 3;
        return this.c7;
    };
    ShapeSeriesViewBase.prototype.a8 = function (a, b) {
        _super.prototype.a8.call(this, a, b);
        for (var c = 0; c < this.cg.count; c++) {
            var d = this.aa(c, b);
            if (d._visibility != 1) {
                a.t(d);
            }
        }
    };
    Object.defineProperty(ShapeSeriesViewBase.prototype, "c9", {
        get: function () {
            return this.c8;
        },
        enumerable: false,
        configurable: true
    });
    ShapeSeriesViewBase.prototype.cz = function (a) {
        this.b7 = a;
    };
    ShapeSeriesViewBase.prototype.cy = function (a) {
        this.c8 = a;
    };
    ShapeSeriesViewBase.prototype.c2 = function (a, b) {
        return this.c3(a, b, false);
    };
    ShapeSeriesViewBase.prototype.c3 = function (a, b, c) {
        var d = this.b5(a, b, c);
        if (d == null) {
            return null;
        }
        return d.c;
    };
    ShapeSeriesViewBase.prototype.b5 = function (a, b, c) {
        if (this.cd.count == 0) {
            return null;
        }
        var d = a.x;
        var e = a.y;
        var f = this.cd.count;
        var g = this.cd;
        var h = null;
        for (var 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) {
                    var j = this.b6.hk / 2 + this.b6.hy(b);
                    if (GeometryUtil.b(a, h.a._inner[0], h.a, j)) {
                        return h;
                    }
                }
                else {
                    if (PolygonUtil.b(h.a, a)) {
                        return h;
                    }
                }
            }
        }
        return null;
    };
    ShapeSeriesViewBase.prototype.cv = function (a, b, c, d) {
        this.b1 = a;
        this.b3 = b;
        this.b2 = c;
        this.b0 = d;
        this.cd.clear();
    };
    ShapeSeriesViewBase.prototype.c0 = function () {
        var _this = this;
        var a = this.bx;
        var b = ((function () {
            var $ret = new Path();
            $ret.y = _this.c8;
            return $ret;
        })());
        b.ad = 1;
        if (this.k != null) {
            this.k.j(b, b.y);
        }
        this.b6.wp = RectUtil.r(a, b.ad);
    };
    ShapeSeriesViewBase.prototype.an = function (a) {
        _super.prototype.an.call(this, a);
        if (this.b9.a == null) {
            return;
        }
        for (var b = 0; b < this.b9.a.count; b++) {
            var c = typeCast(Path.$, this.b9.a._inner[b]);
            if (c._visibility != 1) {
                this.e.a9.exportPathData(a, c, "shape" + b, ["Main "]);
            }
        }
    };
    ShapeSeriesViewBase.$t = markType(ShapeSeriesViewBase, 'ShapeSeriesViewBase', SeriesView.$);
    return ShapeSeriesViewBase;
}(SeriesView));
export { ShapeSeriesViewBase };
