/*
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 { ShapeSeriesBase } from "./ShapeSeriesBase";
import { ShapeAxisInfoCache } from "./ShapeAxisInfoCache";
import { StyleSelector } from "./StyleSelector";
import { DependencyProperty } from "igniteui-react-core";
import { Style } from "igniteui-react-core";
import { MarkerType_$type } from "./MarkerType";
import { DataTemplate } from "igniteui-react-core";
import { Brush } from "igniteui-react-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { Base, runOn, enumGetBox, Number_$type, typeCast, fromEnum, markType, markDep, PointUtil } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { ShapeSeriesViewBase } from "./ShapeSeriesViewBase";
import { Marker } from "./Marker";
import { MarkerSeries } from "./MarkerSeries";
import { BrushUtil } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { RectUtil } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { isNaN_, isInfinity } from "igniteui-react-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { DataTemplateMeasureInfo } from "igniteui-react-core";
import { Size } from "igniteui-react-core";
import { Defaults } from "./Defaults";
import { DataTemplatePassInfo } from "igniteui-react-core";
import { DataTemplateRenderInfo } from "igniteui-react-core";
import { MarkerVisualData } from "./MarkerVisualData";
import { stringIsNullOrEmpty } from "igniteui-react-core";
/**
 * @hidden
 */
var ScatterPolygonSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ScatterPolygonSeries, _super);
    function ScatterPolygonSeries() {
        var _this = _super.call(this) || this;
        _this.w6 = null;
        _this.w3 = new ScalerParams(1, ScatterPolygonSeries.yc, ScatterPolygonSeries.yc, false);
        _this.w4 = new ScalerParams(1, ScatterPolygonSeries.yc, ScatterPolygonSeries.yc, false);
        _this.xs = null;
        _this.wy = 1;
        _this.wu = 1;
        _this.ab = ScatterPolygonSeries.$;
        return _this;
    }
    ScatterPolygonSeries.prototype.get_e3 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.get_ey = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.u9 = function () {
        return this.w8();
    };
    ScatterPolygonSeries.prototype.wb = function (a) {
        var _this = this;
        var b = a;
        b.cy(this.ye);
        b.cz(this.w7);
        _super.prototype.wb.call(this, a);
        if (this.dl(a)) {
            return;
        }
        var c, d;
        var e = a.getViewInfo(c, d);
        c = e.p0;
        d = e.p1;
        var f = this.getEffectiveViewport1(a);
        this.w3 = new ScalerParams(1, d, c, this.ui.ch);
        this.w3.c = f;
        this.w4 = new ScalerParams(1, d, c, this.uk.ch);
        this.w4.c = f;
        if (c.width < 1 || c.height < 1) {
            return;
        }
        this.w6 = ((function () {
            var $ret = new ShapeAxisInfoCache();
            $ret.a = _this.ui;
            $ret.b = _this.uk;
            $ret.e = _this.ui.ch;
            $ret.f = _this.uk.ch;
            $ret.d = _this.c6;
            $ret.c = _this.us;
            return $ret;
        })());
        if (this.w8()) {
            var g = new Dictionary$2(Base.$, OwnedPoint.$, 0);
            b.dg.l(g, 400, d, c, this.hj);
            b.dg.j(g, false);
            if (this.u7()) {
                this.xp(a);
            }
        }
    };
    ScatterPolygonSeries.prototype.xp = function (a) {
        var _this = this;
        a.dk = true;
        this.up.ay(this, this.u7(), runOn(this, this.t7));
        var b = this.up.d;
        var c = b != null;
        var d = this.getEffectiveViewport1(a);
        var e = this.c6 == null ? 0 : this.c6.count;
        a.dw(function (f) {
            if (f._visibility == 0) {
                var g = f.ak;
                var h = f.content;
                if (h == null) {
                    h = new DataContext();
                    f.content = h;
                }
                if (c) {
                    _this.v6(g, e, a.q);
                }
                _this.up.ac(f, h);
            }
        });
    };
    ScatterPolygonSeries.prototype.w8 = function () {
        return this.xs != null && ((this.w2 != 1 && this.w2 != 0) || this.xt != null);
    };
    ScatterPolygonSeries.prototype.cg = function () {
        return new ScatterPolygonSeriesView(this);
    };
    ScatterPolygonSeries.prototype.o0 = function (a) {
        _super.prototype.o0.call(this, a);
        this.w5 = a;
    };
    ScatterPolygonSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.sz = function () {
        return this.x8;
    };
    ScatterPolygonSeries.prototype.s0 = function () {
        return this.x9;
    };
    ScatterPolygonSeries.prototype.qv = function () {
        return this.xr;
    };
    ScatterPolygonSeries.prototype.kx = function () {
        return this.ky(this, this.xs);
    };
    ScatterPolygonSeries.prototype.hs = function () {
        return this.xa;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "wz", {
        get: function () {
            return this.wy;
        },
        set: function (a) {
            this.wy = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.w1 = function () {
        if (this.w0 == 0) {
            return 1;
        }
        return this.w0;
    };
    ScatterPolygonSeries.prototype.qh = function (a) {
        _super.prototype.qh.call(this, a);
        this.w0 = a;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "wv", {
        get: function () {
            return this.wu;
        },
        set: function (a) {
            this.wu = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.wx = function () {
        if (this.ww == 0) {
            return 2;
        }
        return this.ww;
    };
    ScatterPolygonSeries.prototype.qg = function (a) {
        _super.prototype.qg.call(this, a);
        this.ww = a;
    };
    ScatterPolygonSeries.prototype.qi = function (a) {
        _super.prototype.qi.call(this, a);
        this.xa = a;
    };
    ScatterPolygonSeries.prototype.qd = function () {
        _super.prototype.qd.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.xt != null) {
            this.w5.dv();
            this.w5.ds();
        }
        else {
            var a = MarkerSeries.ub(this, this.w2);
            var b = MarkerSeries.uj(a);
            if (b == null) {
                this.xr = MarkerSeries.ux;
            }
            else {
                this.w5.dp(b);
            }
        }
        if (this.ya != null && this.w2 != 13) {
            this.p4("ActualMarkerBrush");
            var c = this.x8;
            this.w5.dt();
            this.w5.dq();
            var d = this.x8;
            var e = this.eu("ActualMarkerBrush", this.g1.f > 0 ? this.g1.d() : null, c, d);
            this.p6("ActualMarkerBrush", e);
        }
        else {
            if (this.w2 == 13) {
                this.x8 = this.cj.bt();
            }
            else {
                if (this.wv != 2) {
                    if (this.cy != null) {
                        var f = this.cy.sy(this.index);
                        if (!isNaN_(this.hi) && this.hi != 1) {
                            f = BrushUtil.q(f, this.hi);
                        }
                        this.x8 = f;
                    }
                    else {
                        this.x8 = null;
                    }
                }
            }
        }
        if (this.yb != null) {
            this.w5.du();
            this.w5.dr();
        }
        else {
            if (this.w2 == 13) {
                this.x9 = this.cj.bt();
            }
            else {
                if (this.w0 == 2) {
                    this.x9 = this.x8;
                }
                else {
                    this.x9 = this.cy == null ? null : this.cy.sz(this.index);
                }
            }
        }
        if (this.wv == 2 && this.ya == null && this.w2 != 13) {
            if (this.x9 != null) {
                var g = this.x9;
                if (!isNaN_(this.hi) && this.hi != 1) {
                    g = BrushUtil.q(g, this.hi);
                }
                this.x8 = g;
            }
            else {
                this.x8 = null;
            }
        }
    };
    ScatterPolygonSeries.prototype.or = function () {
        _super.prototype.or.call(this);
        this.wz = this.w1();
        this.wv = this.wx();
    };
    ScatterPolygonSeries.prototype.o8 = function (a, b, c, d) {
        _super.prototype.o8.call(this, a, b, c, d);
        switch (b) {
            case ScatterPolygonSeries.$$p[3]:
            case ScatterPolygonSeries.$$p[11]:
            case ScatterPolygonSeries.$$p[7]:
            case ScatterPolygonSeries.$$p[9]:
            case ScatterPolygonSeries.$$p[10]:
                this.pe(b);
                this.o2();
                break;
            case ScatterPolygonSeries.$$p[6]:
                this.wz = this.w1();
                this.pe(null);
                this.o2();
                break;
            case ScatterPolygonSeries.$$p[5]:
                this.wv = this.wx();
                this.pe(null);
                this.o2();
                break;
            case ScatterPolygonSeries.$$p[2]:
                this.xs = d;
                if (c == MarkerSeries.ux || d == MarkerSeries.ux || (c == null || d != null)) {
                    this.w5.dx();
                    this.pp(false);
                }
                this.cj.bl();
                if (this.toolTip != null && this.ev) {
                    this.a7.a$aj(this, this.toolTip);
                }
                this.pp(false);
                this.ol();
                break;
            case ScatterPolygonSeries.$$p[12]:
                this.w5.cy(this.ye);
                this.pp(false);
                this.ol();
                break;
            case ScatterPolygonSeries.$$p[13]:
                this.w5.cz(this.w7);
                this.pp(false);
                this.ol();
                break;
            case ScatterPolygonSeries.$$p[4]:
                this.pp(false);
                this.ol();
                break;
            case ScatterPolygonSeries.$$p[0]:
            case ScatterPolygonSeries.$$p[1]:
                if (this.w8()) {
                    this.pp(false);
                }
                break;
        }
    };
    ScatterPolygonSeries.prototype.au = function (a, b) {
        var c = this.w5.b4(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        if (d != null) {
            return d;
        }
        return _super.prototype.au.call(this, a, b);
    };
    ScatterPolygonSeries.prototype.xq = function (a, b) {
        var e_1, _a, e_2, _b;
        var c = new List$1(Base.$, 0);
        try {
            for (var _c = __values(fromEnum(b.c)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var d = _d.value;
                if (!a.containsKey(d)) {
                    c.add1(d);
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var e = _f.value;
                b.h(e);
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    ScatterPolygonSeries.prototype.ds = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.ui;
        var f = new ScalerParams(1, this.cy.tn, this.tw, e.ch);
        f.c = this.getEffectiveViewport1(this.cj);
        var g = this.uk;
        var h = new ScalerParams(1, this.cy.tn, this.tw, g.ch);
        h.c = this.getEffectiveViewport1(this.cj);
        a.clear();
        this.w5.dw(function (i) {
            if (i._visibility == 0) {
                var j = new SeriesPointOfInterest();
                var k = i.n;
                var l = i.o;
                if (k < _this.tw.left || k > _this.tw.right || l < _this.tw.top || l > _this.tw.bottom) {
                    return;
                }
                j.b = e.em(k, f);
                j.c = g.em(l, h);
                j.a = i.content;
                a.add(j);
            }
        });
        return true;
    };
    ScatterPolygonSeries.prototype.ws = function (a, b, c, d, e) {
        var _this = this;
        if (c == null || c.length != this.w6.d.count) {
            c = new Array(this.w6.d.count);
            for (var f = 0; f < this.w6.d.count; f++) {
                c[f] = PointUtil.create();
            }
        }
        var g = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.ui.ch);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var h = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.uk.ch);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var i = this.to(a);
        var j = this.w6.a.em(i.left, g);
        var k = this.w6.a.em(i.right, g);
        var l = this.w6.b.em(i.bottom, h);
        var m = this.w6.b.em(i.top, h);
        if (this.w6.e) {
            var n = j;
            j = k;
            k = n;
        }
        if (this.w6.f) {
            var o = l;
            l = m;
            m = o;
        }
        var p = this.w6;
        var q = p.a;
        var r = p.b;
        var s;
        var t;
        var u = g.d.left;
        var v = g.d.right;
        var w = h.d.top;
        var x = h.d.bottom;
        for (var y = 0; y < this.w6.d.count; y++) {
            s = 0;
            t = 0;
            var z = null;
            var aa = a.cc.tryGetValue(y, z);
            z = aa.p1;
            if (z == null) {
                c[y].x = NaN;
                c[y].y = NaN;
            }
            else {
                var ab = z.c;
                var ac = RectUtil.l(ab);
                s = ac.x;
                t = ac.y;
                if (s >= u && s <= v && t >= w && t <= x) {
                    c[y].x = s;
                    c[y].y = t;
                }
                else {
                    c[y].x = NaN;
                    c[y].y = NaN;
                }
            }
        }
        return c;
    };
    ScatterPolygonSeries.prototype.w9 = function (a, b) {
        var e_3, _a;
        if (b == null) {
            b = new List$1(Number_$type, 2, a.e);
        }
        else {
            b.clear();
        }
        var c = 0;
        var d = this.c6;
        try {
            for (var _b = __values(fromEnum(a.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                b.add(d.indexOf(e));
                c++;
            }
        }
        catch (e_3_1) {
            e_3 = { error: e_3_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_3)
                    throw e_3.error;
            }
        }
        return b;
    };
    ScatterPolygonSeries.$t = markType(ScatterPolygonSeries, 'ScatterPolygonSeries', ShapeSeriesBase.$);
    ScatterPolygonSeries.yc = new Rect(0, 0, 0, 1, 1);
    ScatterPolygonSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterPolygonSeries, 'raisePropertyChanged', ['ActualMarkerBrush:x8:xu', [Brush.$], 'ActualMarkerOutline:x9:xv', [Brush.$], 'ActualMarkerTemplate:xr:xw', [DataTemplate.$, null], 'MarkerBrush:ya:xx', [Brush.$], 'MarkerCollisionAvoidance:wt:xy', [CollisionAvoidanceType_$type, enumGetBox(CollisionAvoidanceType_$type, 0)], 'MarkerFillMode:ww:xz', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:w0:x0', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:yb:x1', [Brush.$], 'MarkerStyle:yd:x2', [Style.$], 'MarkerTemplate:xt:x3', [DataTemplate.$, null], 'MarkerThickness:xa:x4', [1, DeviceUtils.g(2)], 'MarkerType:w2:x5', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'ShapeStyle:ye:x6', [Style.$, null], 'ShapeStyleSelector:w7:x7', [StyleSelector.$, null]]);
    return ScatterPolygonSeries;
}(ShapeSeriesBase));
export { ScatterPolygonSeries };
/**
 * @hidden
 */
var ScatterPolygonSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ScatterPolygonSeriesView, _super);
    function ScatterPolygonSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.dk = false;
        _this.db = null;
        _this.dm = null;
        _this.dh = null;
        _this.df = null;
        _this.dj = false;
        _this.di = null;
        _this.dn = null;
        _this.dc = new Marker();
        _this.d4 = null;
        _this.dc = new Marker();
        _this.dc.content = new DataContext();
        _this.dh = a;
        _this.di = new HashPool$2(Base.$, Marker.$);
        _this.dn = new List$1(Marker.$, 0);
        _this.dy(_this.di);
        _this.df = new NumericMarkerManager(1, function (b) { return _this.di.item(b); }, function (b) { return _this.dh.w6.d.item(b); }, runOn(_this, _this.d2), runOn(_this, _this.da), runOn(_this, _this.dl), function () { return _this.dh.wt; });
        _this.df.q = runOn(_this, _this.d5);
        return _this;
    }
    ScatterPolygonSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        if (!this.q) {
            this.dh.yb = Defaults.am;
            this.dh.iu = Defaults.z;
            this.dh.xa = Defaults.y;
            this.dh.w2 = Defaults.f;
            this.dh.ww = Defaults.b;
        }
    };
    Object.defineProperty(ScatterPolygonSeriesView.prototype, "dg", {
        get: function () {
            return this.df;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeriesView.prototype.d2 = function (a) {
        this.dh.xq(a, this.di);
    };
    ScatterPolygonSeriesView.prototype.da = function () {
        this.db = this.dh.ws(this, this.di, this.db, this.by, this.bx);
        return this.db;
    };
    ScatterPolygonSeriesView.prototype.dl = function () {
        this.dm = this.dh.w9(this.di, this.dm);
        return this.dm;
    };
    ScatterPolygonSeriesView.prototype.c5 = function (a, b) {
        return this.c6(a, b, true);
    };
    ScatterPolygonSeriesView.prototype.cm = function (a, b, c) {
        _super.prototype.cm.call(this, a, b, c);
        ShapeSeriesViewBase.cl(this, a, b);
    };
    ScatterPolygonSeriesView.prototype.ck = function (a, b) {
        var c = a;
        if (c == null) {
            return;
        }
        c.an = b;
    };
    ScatterPolygonSeriesView.prototype.dw = function (a) {
        this.di.f(a);
    };
    ScatterPolygonSeriesView.prototype.dy = function (a) {
        a.create = runOn(this, this.de);
        a.destroy = runOn(this, this.d0);
        a.activate = runOn(this, this.dz);
        a.disactivate = runOn(this, this.d1);
    };
    ScatterPolygonSeriesView.prototype.de = function () {
        var _this = this;
        var a = new Marker();
        if (!this.dj) {
            a.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this.e;
                return $ret;
            })());
        }
        a.ah = this.e.xr;
        this.dn.add(a);
        return a;
    };
    ScatterPolygonSeriesView.prototype.b4 = function (a) {
        var b = this.dd(a, 0);
        if (b == null) {
            b = this.dd(a, 3);
        }
        return b;
    };
    ScatterPolygonSeriesView.prototype.dd = function (a, b) {
        var c;
        var d;
        var e;
        var f;
        for (var g = this.dn.count - 1; g >= 0; g--) {
            var h = this.dn._inner[g];
            if (h._visibility == 1 || h._opacity == 0) {
                continue;
            }
            c = (h.m / 2) + b;
            d = (h.l / 2) + b;
            e = h.ai;
            f = h.aj;
            if ((h.n + e) - c <= a.x && (h.n + e) + c >= a.x && (h.o + f) - d <= a.y && (h.o + f) + d >= a.y) {
                return h;
            }
        }
        return null;
    };
    ScatterPolygonSeriesView.prototype.d0 = function (a) {
        a.content = null;
        this.dn.remove(a);
    };
    ScatterPolygonSeriesView.prototype.dz = function (a) {
        a._visibility = 0;
    };
    ScatterPolygonSeriesView.prototype.d1 = function (a) {
        if (a.content != null) {
            (typeCast(DataContext.$, a.content)).item = null;
        }
        a._visibility = 1;
    };
    ScatterPolygonSeriesView.prototype.d3 = function (a) {
        this.dj = a;
    };
    ScatterPolygonSeriesView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (!this.dk) {
            var c = a;
            var d = c.content;
            if (d != null) {
                if (this.dh.x8 != null) {
                    d.actualItemBrush = this.dh.x8;
                }
                else {
                    d.actualItemBrush = this.b6.ss;
                }
                if (this.dh.x8 != null) {
                    d.outline = this.dh.x9;
                }
                else {
                    d.outline = this.b6.sv;
                }
                d.thickness = this.dh.xa;
            }
        }
    };
    ScatterPolygonSeriesView.prototype.bk = function (a, b) {
        _super.prototype.bk.call(this, a, b);
        var c = a;
        this.dc._visibility = c._visibility;
        this.dc.ah = c.ah;
        this.dc.width = c.width;
        this.dc.height = c.height;
        this.dc.m = c.m;
        this.dc.l = c.l;
        this.dc.n = c.n;
        this.dc.o = c.o;
        var d = this.bs(b);
        var e = this.dc.content;
        var f = c.content;
        e.item = f.item;
        e.series = f.series;
        e.thickness = f.thickness;
        if (e != null) {
            e.actualItemBrush = d;
            e.outline = d;
            e.thickness = this.dh.xa + 3;
        }
    };
    ScatterPolygonSeriesView.prototype.a7 = function (a, b) {
        _super.prototype.a7.call(this, a, b);
        var c = new DataTemplatePassInfo();
        c.isHitTestRender = b;
        c.context = a.h();
        c.viewportTop = this.bx.top;
        c.viewportLeft = this.bx.left;
        c.viewportWidth = this.bx.width;
        c.viewportHeight = this.bx.height;
        c.passID = "Markers";
        var d = new DataTemplateRenderInfo();
        d.passInfo = c;
        d.isHitTestRender = b;
        var e = new DataTemplateMeasureInfo();
        e.passInfo = c;
        var f = false;
        var g = a.h();
        e.context = g;
        d.context = g;
        var h = 0;
        var i = 0;
        if (this.dh.xr != null && this.dh.xr.passStarting != null) {
            this.dh.xr.passStarting(c);
        }
        for (var j = 0; j < this.dn.count; j++) {
            var k = this.dn._inner[j];
            if (k._visibility == 1) {
                continue;
            }
            this.bi(k, j, b);
            if (b) {
                k = this.dc;
            }
            if (!f) {
                e.width = k.width;
                e.height = k.height;
                e.renderOffsetX = 0;
                e.renderOffsetY = 0;
                e.renderContext = a;
                var l = k.ah;
                if (l.measure != null) {
                    e.data = k.content;
                    l.measure(e);
                    f = e.isConstant;
                    if (f) {
                        h = e.width;
                        i = e.height;
                    }
                }
                d.availableWidth = e.width;
                d.availableHeight = e.height;
                d.renderOffsetX = e.renderOffsetX;
                d.renderOffsetY = e.renderOffsetY;
                d.renderContext = a;
            }
            else {
                d.availableWidth = h;
                d.availableHeight = i;
            }
            if (!isNaN_(k.width) && !isInfinity(k.width)) {
                d.availableWidth = k.width;
            }
            if (!isNaN_(k.height) && !isInfinity(k.height)) {
                d.availableHeight = k.height;
            }
            a.q(d, k);
            k.m = d.availableWidth;
            k.l = d.availableHeight;
            k.ai = d.renderOffsetX;
            k.aj = d.renderOffsetY;
        }
        if (this.dh.xr != null && this.dh.xr.passCompleted != null) {
            this.dh.xr.passCompleted(c);
        }
    };
    ScatterPolygonSeriesView.prototype.dv = function () {
        this.dh.xr = null;
    };
    ScatterPolygonSeriesView.prototype.ds = function () {
        this.dh.xr = null;
        this.dh.xr = this.dh.xt;
    };
    ScatterPolygonSeriesView.prototype.dt = function () {
        this.dh.x8 = null;
    };
    ScatterPolygonSeriesView.prototype.dq = function () {
        this.dh.x8 = null;
        if (!isNaN_(this.e.hi) && this.e.hi != 1) {
            var a = BrushUtil.q(this.dh.ya, this.e.hi);
            this.dh.x8 = a;
        }
        else {
            this.dh.x8 = this.dh.ya;
        }
    };
    ScatterPolygonSeriesView.prototype.du = function () {
        this.dh.x9 = null;
    };
    ScatterPolygonSeriesView.prototype.dr = function () {
        this.dh.x9 = null;
        this.dh.x9 = this.dh.yb;
    };
    ScatterPolygonSeriesView.prototype.dp = function (a) {
        switch (a) {
            case "CircleMarkerTemplate":
                this.dh.xr = this.dh.cy.py;
                break;
            case "TriangleMarkerTemplate":
                this.dh.xr = this.dh.cy.p7;
                break;
            case "PyramidMarkerTemplate":
                this.dh.xr = this.dh.cy.p4;
                break;
            case "SquareMarkerTemplate":
                this.dh.xr = this.dh.cy.p5;
                break;
            case "DiamondMarkerTemplate":
                this.dh.xr = this.dh.cy.pz;
                break;
            case "PentagonMarkerTemplate":
                this.dh.xr = this.dh.cy.p2;
                break;
            case "HexagonMarkerTemplate":
                this.dh.xr = this.dh.cy.p0;
                break;
            case "TetragramMarkerTemplate":
                this.dh.xr = this.dh.cy.p2;
                break;
            case "PentagramMarkerTemplate":
                this.dh.xr = this.dh.cy.p3;
                break;
            case "HexagramMarkerTemplate":
                this.dh.xr = this.dh.cy.p1;
                break;
        }
    };
    ScatterPolygonSeriesView.prototype.dx = function () {
        var e_4, _a;
        try {
            for (var _b = __values(fromEnum(this.dn)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ah = this.dh.xr;
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        this.as();
    };
    ScatterPolygonSeriesView.prototype.d5 = function (a) {
        if (this.d4 == null) {
            this.d4 = new DataTemplateMeasureInfo();
            this.d4.context = this.k.h();
        }
        this.d4.width = a.width;
        this.d4.height = a.height;
        this.d4.data = a.content;
        var b = a.ah;
        if (b.measure != null) {
            b.measure(this.d4);
        }
        return new Size(1, this.d4.width, this.d4.height);
    };
    ScatterPolygonSeriesView.prototype.an = function (a) {
        var e_5, _a;
        var b = a;
        _super.prototype.an.call(this, b);
        try {
            for (var _b = __values(fromEnum(this.di.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = this.di.item(c);
                if (d._visibility != 1) {
                    var e = typeCast(ScatterPolygonSeries.$, this.e);
                    var f = this.e.a9.getMarkerVisualData(e, d, e.xr);
                    b.markerShapes.add(typeCast(MarkerVisualData.$, f));
                }
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
    };
    ScatterPolygonSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'><span";
        var b = this.e.a7.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.dh.title + "</span><br/>";
        a += "</div>";
        return a;
    };
    ScatterPolygonSeriesView.$t = markType(ScatterPolygonSeriesView, 'ScatterPolygonSeriesView', ShapeSeriesViewBase.$);
    return ScatterPolygonSeriesView;
}(ShapeSeriesViewBase));
export { ScatterPolygonSeriesView };
