/*
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-angular-core";
import { Style } from "igniteui-angular-core";
import { MarkerType_$type } from "./MarkerType";
import { DataTemplate } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { Base, runOn, enumGetBox, Number_$type, typeCast, fromEnum, markType, markDep, PointUtil } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { OwnedPoint } from "./OwnedPoint";
import { ShapeSeriesViewBase } from "./ShapeSeriesViewBase";
import { Marker } from "./Marker";
import { MarkerSeries } from "./MarkerSeries";
import { BrushUtil } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { RectUtil } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { isNaN_, isInfinity } from "igniteui-angular-core";
import { NumericMarkerManager } from "./NumericMarkerManager";
import { DataTemplateMeasureInfo } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { DataTemplatePassInfo } from "igniteui-angular-core";
import { DataTemplateRenderInfo } from "igniteui-angular-core";
import { MarkerVisualData } from "./MarkerVisualData";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var ScatterPolygonSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ScatterPolygonSeries, _super);
    function ScatterPolygonSeries() {
        var _this = _super.call(this) || this;
        _this.s4 = null;
        _this.s1 = new ScalerParams(1, ScatterPolygonSeries.ua, ScatterPolygonSeries.ua, false);
        _this.s2 = new ScalerParams(1, ScatterPolygonSeries.ua, ScatterPolygonSeries.ua, false);
        _this.tq = null;
        _this.sw = 1;
        _this.ss = 1;
        _this.ab = ScatterPolygonSeries.$;
        return _this;
    }
    ScatterPolygonSeries.prototype.get_d7 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.get_d2 = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.rb = function () {
        return this.s6();
    };
    ScatterPolygonSeries.prototype.sa = function (a) {
        var _this = this;
        var b = a;
        b.cv(this.uc);
        b.cw(this.s5);
        _super.prototype.sa.call(this, a);
        if (this.cx(a)) {
            return;
        }
        var c, d;
        var e = a.getViewInfo(c, d);
        c = e.p0;
        d = e.p1;
        var f = this.getEffectiveViewport1(a);
        this.s1 = new ScalerParams(1, d, c, this.qk.cg);
        this.s1.c = f;
        this.s2 = new ScalerParams(1, d, c, this.qm.cg);
        this.s2.c = f;
        if (c.width < 1 || c.height < 1) {
            return;
        }
        this.s4 = ((function () {
            var $ret = new ShapeAxisInfoCache();
            $ret.a = _this.qk;
            $ret.b = _this.qm;
            $ret.e = _this.qk.cg;
            $ret.f = _this.qm.cg;
            $ret.d = _this.ck;
            $ret.c = _this.qu;
            return $ret;
        })());
        if (this.s6()) {
            var g = new Dictionary$2(Base.$, OwnedPoint.$, 0);
            b.dd.l(g, 400, d, c, this.ft);
            b.dd.j(g, false);
            if (this.q9()) {
                this.tn(a);
            }
        }
    };
    ScatterPolygonSeries.prototype.tn = function (a) {
        var _this = this;
        a.dh = true;
        this.qr.aw(this, this.q9(), runOn(this, this.p9));
        var b = this.qr.d;
        var c = b != null;
        var d = this.getEffectiveViewport1(a);
        var e = this.ck == null ? 0 : this.ck.count;
        a.dt(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.r5(g, e, a.q);
                }
                _this.qr.ac(f, h);
            }
        });
    };
    ScatterPolygonSeries.prototype.s6 = function () {
        return this.tq != null && ((this.s0 != 1 && this.s0 != 0) || this.tr != null);
    };
    ScatterPolygonSeries.prototype.bx = function () {
        return new ScatterPolygonSeriesView(this);
    };
    ScatterPolygonSeries.prototype.ly = function (a) {
        _super.prototype.ly.call(this, a);
        this.s3 = a;
    };
    ScatterPolygonSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    ScatterPolygonSeries.prototype.o5 = function () {
        return this.t6;
    };
    ScatterPolygonSeries.prototype.o6 = function () {
        return this.t7;
    };
    ScatterPolygonSeries.prototype.nd = function () {
        return this.tp;
    };
    ScatterPolygonSeries.prototype.iy = function () {
        return this.iz(this, this.tq);
    };
    ScatterPolygonSeries.prototype.f2 = function () {
        return this.s8;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "sx", {
        get: function () {
            return this.sw;
        },
        set: function (a) {
            this.sw = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.sz = function () {
        if (this.sy == 0) {
            return 1;
        }
        return this.sy;
    };
    ScatterPolygonSeries.prototype.mz = function (a) {
        _super.prototype.mz.call(this, a);
        this.sy = a;
    };
    Object.defineProperty(ScatterPolygonSeries.prototype, "st", {
        get: function () {
            return this.ss;
        },
        set: function (a) {
            this.ss = a;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeries.prototype.sv = function () {
        if (this.su == 0) {
            return 2;
        }
        return this.su;
    };
    ScatterPolygonSeries.prototype.my = function (a) {
        _super.prototype.my.call(this, a);
        this.su = a;
    };
    ScatterPolygonSeries.prototype.m0 = function (a) {
        _super.prototype.m0.call(this, a);
        this.s8 = a;
    };
    ScatterPolygonSeries.prototype.mv = function () {
        _super.prototype.mv.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.tr != null) {
            this.s3.ds();
            this.s3.dp();
        }
        else {
            var a = MarkerSeries.qd(this, this.s0);
            var b = MarkerSeries.ql(a);
            if (b == null) {
                this.tp = MarkerSeries.qz;
            }
            else {
                this.s3.dl(b);
            }
        }
        if (this.t8 != null && this.s0 != 13) {
            this.s3.dq();
            this.s3.dm();
        }
        else {
            if (this.s0 == 13) {
                this.t6 = this.b0.bq();
            }
            else {
                if (this.st != 2) {
                    if (this.cd != null) {
                        var c = this.cd.rq(this.index);
                        if (!isNaN_(this.fs) && this.fs != 1) {
                            c = BrushUtil.o(c, this.fs);
                        }
                        this.t6 = c;
                    }
                    else {
                        this.t6 = null;
                    }
                }
            }
        }
        if (this.t9 != null) {
            this.s3.dr();
            this.s3.dn();
        }
        else {
            if (this.s0 == 13) {
                this.t7 = this.b0.bq();
            }
            else {
                if (this.sy == 2) {
                    this.t7 = this.t6;
                }
                else {
                    this.t7 = this.cd == null ? null : this.cd.rr(this.index);
                }
            }
        }
        if (this.st == 2 && this.t8 == null && this.s0 != 13) {
            if (this.t7 != null) {
                var d = this.t7;
                if (!isNaN_(this.fs) && this.fs != 1) {
                    d = BrushUtil.o(d, this.fs);
                }
                this.t6 = d;
            }
            else {
                this.t6 = null;
            }
        }
    };
    ScatterPolygonSeries.prototype.lt = function () {
        _super.prototype.lt.call(this);
        this.sx = this.sz();
        this.st = this.sv();
    };
    ScatterPolygonSeries.prototype.l3 = function (a, b, c, d) {
        _super.prototype.l3.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.mv();
                this.l0();
                break;
            case ScatterPolygonSeries.$$p[6]:
                this.sx = this.sz();
                this.mv();
                this.l0();
                break;
            case ScatterPolygonSeries.$$p[5]:
                this.st = this.sv();
                this.mv();
                this.l0();
                break;
            case ScatterPolygonSeries.$$p[2]:
                this.tq = d;
                if (c == MarkerSeries.qz || d == MarkerSeries.qz || (c == null || d != null)) {
                    this.s3.du();
                    this.mh(false);
                }
                this.b0.bj();
                if (this.toolTip != null && this.dz) {
                    this.a6.a$aj(this, this.toolTip);
                }
                this.mh(false);
                this.lo();
                break;
            case ScatterPolygonSeries.$$p[12]:
                this.s3.cv(this.uc);
                this.mh(false);
                this.lo();
                break;
            case ScatterPolygonSeries.$$p[13]:
                this.s3.cw(this.s5);
                this.mh(false);
                this.lo();
                break;
            case ScatterPolygonSeries.$$p[4]:
                this.mh(false);
                this.lo();
                break;
            case ScatterPolygonSeries.$$p[0]:
            case ScatterPolygonSeries.$$p[1]:
                if (this.s6()) {
                    this.mh(false);
                }
                break;
        }
    };
    ScatterPolygonSeries.prototype.at = function (a, b) {
        var c = this.s3.b1(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        if (d != null) {
            return d;
        }
        return _super.prototype.at.call(this, a, b);
    };
    ScatterPolygonSeries.prototype.to = 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.c1 = function (a, b, c, d) {
        var _this = this;
        if (!this.hasMarkers) {
            return false;
        }
        var e = this.qk;
        var f = new ScalerParams(1, this.cd.sf, this.py, e.cg);
        f.c = this.getEffectiveViewport1(this.b0);
        var g = this.qm;
        var h = new ScalerParams(1, this.cd.sf, this.py, g.cg);
        h.c = this.getEffectiveViewport1(this.b0);
        a.clear();
        this.s3.dt(function (i) {
            if (i._visibility == 0) {
                var j = new SeriesPointOfInterest();
                var k = i.n;
                var l = i.o;
                if (k < _this.py.left || k > _this.py.right || l < _this.py.top || l > _this.py.bottom) {
                    return;
                }
                j.b = e.el(k, f);
                j.c = g.el(l, h);
                j.a = i.content;
                a.add(j);
            }
        });
        return true;
    };
    ScatterPolygonSeries.prototype.sq = function (a, b, c, d, e) {
        var _this = this;
        if (c == null || c.length != this.s4.d.count) {
            c = new Array(this.s4.d.count);
            for (var f = 0; f < this.s4.d.count; f++) {
                c[f] = PointUtil.create();
            }
        }
        var g = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qk.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var h = ((function () {
            var $ret = new ScalerParams(1, d, e, _this.qm.cg);
            $ret.c = _this.getEffectiveViewport1(a);
            return $ret;
        })());
        var i = this.pq(a);
        var j = this.s4.a.el(i.left, g);
        var k = this.s4.a.el(i.right, g);
        var l = this.s4.b.el(i.bottom, h);
        var m = this.s4.b.el(i.top, h);
        if (this.s4.e) {
            var n = j;
            j = k;
            k = n;
        }
        if (this.s4.f) {
            var o = l;
            l = m;
            m = o;
        }
        var p = this.s4;
        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.s4.d.count; y++) {
            s = 0;
            t = 0;
            var z = null;
            var aa = a.b9.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.s7 = 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.ck;
        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.ua = new Rect(0, 0, 0, 1, 1);
    ScatterPolygonSeries.$$p = markDep(DependencyProperty, PropertyMetadata, ScatterPolygonSeries, 'raisePropertyChanged', ['ActualMarkerBrush:t6:ts', [Brush.$], 'ActualMarkerOutline:t7:tt', [Brush.$], 'ActualMarkerTemplate:tp:tu', [DataTemplate.$, null], 'MarkerBrush:t8:tv', [Brush.$], 'MarkerCollisionAvoidance:sr:tw', [CollisionAvoidanceType_$type, enumGetBox(CollisionAvoidanceType_$type, 0)], 'MarkerFillMode:su:tx', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:sy:ty', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:t9:tz', [Brush.$], 'MarkerStyle:ub:t0', [Style.$], 'MarkerTemplate:tr:t1', [DataTemplate.$, null], 'MarkerThickness:s8:t2', [1, DeviceUtils.g(2)], 'MarkerType:s0:t3', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'ShapeStyle:uc:t4', [Style.$, null], 'ShapeStyleSelector:s5:t5', [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.dh = false;
        _this.c8 = null;
        _this.dj = null;
        _this.de = null;
        _this.dc = null;
        _this.dg = false;
        _this.df = null;
        _this.dk = null;
        _this.c9 = new Marker();
        _this.d1 = null;
        _this.c9 = new Marker();
        _this.c9.content = new DataContext();
        _this.de = a;
        _this.df = new HashPool$2(Base.$, Marker.$);
        _this.dk = new List$1(Marker.$, 0);
        _this.dv(_this.df);
        _this.dc = new NumericMarkerManager(1, function (b) { return _this.df.item(b); }, function (b) { return _this.de.s4.d.item(b); }, runOn(_this, _this.dz), runOn(_this, _this.c7), runOn(_this, _this.di), function () { return _this.de.sr; });
        _this.dc.q = runOn(_this, _this.d2);
        return _this;
    }
    ScatterPolygonSeriesView.prototype.as = function () {
        _super.prototype.as.call(this);
        if (!this.q) {
            this.de.t9 = Defaults.am;
            this.de.gz = Defaults.z;
            this.de.s8 = Defaults.y;
            this.de.s0 = Defaults.f;
            this.de.su = Defaults.b;
        }
    };
    Object.defineProperty(ScatterPolygonSeriesView.prototype, "dd", {
        get: function () {
            return this.dc;
        },
        enumerable: false,
        configurable: true
    });
    ScatterPolygonSeriesView.prototype.dz = function (a) {
        this.de.to(a, this.df);
    };
    ScatterPolygonSeriesView.prototype.c7 = function () {
        this.c8 = this.de.sq(this, this.df, this.c8, this.bv, this.bu);
        return this.c8;
    };
    ScatterPolygonSeriesView.prototype.di = function () {
        this.dj = this.de.s7(this.df, this.dj);
        return this.dj;
    };
    ScatterPolygonSeriesView.prototype.c2 = function (a, b) {
        return this.c3(a, b, true);
    };
    ScatterPolygonSeriesView.prototype.cj = function (a, b, c) {
        _super.prototype.cj.call(this, a, b, c);
        ShapeSeriesViewBase.ci(this, a, b);
    };
    ScatterPolygonSeriesView.prototype.ch = function (a, b) {
        var c = a;
        if (c == null) {
            return;
        }
        c.ak = b;
    };
    ScatterPolygonSeriesView.prototype.dt = function (a) {
        this.df.f(a);
    };
    ScatterPolygonSeriesView.prototype.dv = function (a) {
        a.create = runOn(this, this.db);
        a.destroy = runOn(this, this.dx);
        a.activate = runOn(this, this.dw);
        a.disactivate = runOn(this, this.dy);
    };
    ScatterPolygonSeriesView.prototype.db = function () {
        var _this = this;
        var a = new Marker();
        if (!this.dg) {
            a.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this.e;
                return $ret;
            })());
        }
        a.ah = this.e.tp;
        this.dk.add(a);
        return a;
    };
    ScatterPolygonSeriesView.prototype.b1 = function (a) {
        var b = this.da(a, 0);
        if (b == null) {
            b = this.da(a, 3);
        }
        return b;
    };
    ScatterPolygonSeriesView.prototype.da = function (a, b) {
        var c;
        var d;
        var e;
        var f;
        for (var g = this.dk.count - 1; g >= 0; g--) {
            var h = this.dk._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.dx = function (a) {
        a.content = null;
        this.dk.remove(a);
    };
    ScatterPolygonSeriesView.prototype.dw = function (a) {
        a._visibility = 0;
    };
    ScatterPolygonSeriesView.prototype.dy = function (a) {
        if (a.content != null) {
            (typeCast(DataContext.$, a.content)).item = null;
        }
        a._visibility = 1;
    };
    ScatterPolygonSeriesView.prototype.d0 = function (a) {
        this.dg = a;
    };
    ScatterPolygonSeriesView.prototype.bh = function (a, b) {
        _super.prototype.bh.call(this, a, b);
        if (!this.dh) {
            var c = a;
            var d = c.content;
            if (d != null) {
                if (this.de.t6 != null) {
                    d.actualItemBrush = this.de.t6;
                }
                else {
                    d.actualItemBrush = this.b3.oy;
                }
                if (this.de.t6 != null) {
                    d.outline = this.de.t7;
                }
                else {
                    d.outline = this.b3.o1;
                }
                d.thickness = this.de.s8;
            }
        }
    };
    ScatterPolygonSeriesView.prototype.bi = function (a, b) {
        _super.prototype.bi.call(this, a, b);
        var c = a;
        this.c9._visibility = c._visibility;
        this.c9.ah = c.ah;
        this.c9.width = c.width;
        this.c9.height = c.height;
        this.c9.m = c.m;
        this.c9.l = c.l;
        this.c9.n = c.n;
        this.c9.o = c.o;
        var d = this.bp(b);
        var e = this.c9.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.de.s8 + 3;
        }
    };
    ScatterPolygonSeriesView.prototype.a5 = function (a, b) {
        _super.prototype.a5.call(this, a, b);
        var c = new DataTemplatePassInfo();
        c.isHitTestRender = b;
        c.context = a.g();
        c.viewportTop = this.bu.top;
        c.viewportLeft = this.bu.left;
        c.viewportWidth = this.bu.width;
        c.viewportHeight = this.bu.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.g();
        e.context = g;
        d.context = g;
        var h = 0;
        var i = 0;
        if (this.de.tp != null && this.de.tp.passStarting != null) {
            this.de.tp.passStarting(c);
        }
        for (var j = 0; j < this.dk.count; j++) {
            var k = this.dk._inner[j];
            if (k._visibility == 1) {
                continue;
            }
            this.bg(k, j, b);
            if (b) {
                k = this.c9;
            }
            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.p(d, k);
            k.m = d.availableWidth;
            k.l = d.availableHeight;
            k.ai = d.renderOffsetX;
            k.aj = d.renderOffsetY;
        }
        if (this.de.tp != null && this.de.tp.passCompleted != null) {
            this.de.tp.passCompleted(c);
        }
    };
    ScatterPolygonSeriesView.prototype.ds = function () {
        this.de.tp = null;
    };
    ScatterPolygonSeriesView.prototype.dp = function () {
        this.de.tp = null;
        this.de.tp = this.de.tr;
    };
    ScatterPolygonSeriesView.prototype.dq = function () {
        this.de.t6 = null;
    };
    ScatterPolygonSeriesView.prototype.dm = function () {
        this.de.t6 = null;
        if (!isNaN_(this.e.fs) && this.e.fs != 1) {
            var a = BrushUtil.o(this.de.t8, this.e.fs);
            this.de.t6 = a;
        }
        else {
            this.de.t6 = this.de.t8;
        }
    };
    ScatterPolygonSeriesView.prototype.dr = function () {
        this.de.t7 = null;
    };
    ScatterPolygonSeriesView.prototype.dn = function () {
        this.de.t7 = null;
        this.de.t7 = this.de.t9;
    };
    ScatterPolygonSeriesView.prototype.dl = function (a) {
        switch (a) {
            case "CircleMarkerTemplate":
                this.de.tp = this.de.cd.ov;
                break;
            case "TriangleMarkerTemplate":
                this.de.tp = this.de.cd.o4;
                break;
            case "PyramidMarkerTemplate":
                this.de.tp = this.de.cd.o1;
                break;
            case "SquareMarkerTemplate":
                this.de.tp = this.de.cd.o2;
                break;
            case "DiamondMarkerTemplate":
                this.de.tp = this.de.cd.ow;
                break;
            case "PentagonMarkerTemplate":
                this.de.tp = this.de.cd.oz;
                break;
            case "HexagonMarkerTemplate":
                this.de.tp = this.de.cd.ox;
                break;
            case "TetragramMarkerTemplate":
                this.de.tp = this.de.cd.oz;
                break;
            case "PentagramMarkerTemplate":
                this.de.tp = this.de.cd.o0;
                break;
            case "HexagramMarkerTemplate":
                this.de.tp = this.de.cd.oy;
                break;
        }
    };
    ScatterPolygonSeriesView.prototype.du = function () {
        var e_4, _a;
        try {
            for (var _b = __values(fromEnum(this.dk)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ah = this.de.tp;
            }
        }
        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.aq();
    };
    ScatterPolygonSeriesView.prototype.d2 = function (a) {
        if (this.d1 == null) {
            this.d1 = new DataTemplateMeasureInfo();
            this.d1.context = this.k.g();
        }
        this.d1.width = a.width;
        this.d1.height = a.height;
        this.d1.data = a.content;
        var b = a.ah;
        if (b.measure != null) {
            b.measure(this.d1);
        }
        return new Size(1, this.d1.width, this.d1.height);
    };
    ScatterPolygonSeriesView.prototype.al = function (a) {
        var e_5, _a;
        var b = a;
        _super.prototype.al.call(this, b);
        try {
            for (var _b = __values(fromEnum(this.df.c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = this.df.item(c);
                if (d._visibility != 1) {
                    var e = typeCast(ScatterPolygonSeries.$, this.e);
                    var f = this.e.a8.getMarkerVisualData(e, d, e.tp);
                    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.a6.a$r(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        a += ">" + this.de.title + "</span><br/>";
        a += "</div>";
        return a;
    };
    ScatterPolygonSeriesView.$t = markType(ScatterPolygonSeriesView, 'ScatterPolygonSeriesView', ShapeSeriesViewBase.$);
    return ScatterPolygonSeriesView;
}(ShapeSeriesViewBase));
export { ScatterPolygonSeriesView };
