UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

2,169 lines 75.3 kB
/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { Axis } from "./Axis";
import { DependencyProperty } from "igniteui-angular-core";
import { DataToolTipLayerGroupingMode_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { Base, enumGetBox, EnumUtil, fromEnum, typeCast, String_$type, typeGetValue, Point_$type, Array_$type, markType, markDep, runOn, TypeRegistrar } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { RectUtil } from "igniteui-angular-core";
import { DataTooltipGroupedPositionX_$type } from "igniteui-angular-core";
import { DataTooltipGroupedPositionY_$type } from "igniteui-angular-core";
import { DataAbbreviationMode_$type } from "igniteui-angular-core";
import { DataLegendValueMode_$type } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { DataLegendHeaderDateMode_$type } from "igniteui-angular-core";
import { DataLegendHeaderTimeMode_$type } from "igniteui-angular-core";
import { DataLegendSummaryType_$type } from "igniteui-angular-core";
import { LegendItemBadgeShape_$type } from "igniteui-angular-core";
import { DataLegendLayoutMode_$type } from "igniteui-angular-core";
import { DataLegendUnitsMode_$type } from "igniteui-angular-core";
import { DataLegendLabelMode_$type } from "igniteui-angular-core";
import { DataToolTipLayerFrame } from "./DataToolTipLayerFrame";
import { Dictionary$2 } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Pool$1 } from "igniteui-angular-core";
import { DataToolTipSeriesInfo } from "./DataToolTipSeriesInfo";
import { DataContext } from "igniteui-angular-core";
import { DataTooltipCollisionInfo } from "./DataTooltipCollisionInfo";
import { CanvasScalingHelpers } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { HashSet$1 } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { stringEmpty } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { PointerTooltip } from "./PointerTooltip";
import { XamDataLegend } from "./XamDataLegend";
import { IOnDemandRender_$type } from "igniteui-angular-core";
import { PointerTooltipStyle } from "./PointerTooltipStyle";
import { PointerTooltipUtils } from "./PointerTooltipUtils";
/**
 * @hidden
 */
var DataToolTipLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataToolTipLayer, _super);
    function DataToolTipLayer() {
        var _this = _super.call(this) || this;
        _this.abi = 1;
        _this.acn = new Dictionary$2(String_$type, Base.$, 0);
        _this.aco = new List$1(String_$type, 0);
        _this.aba = 8;
        _this.abe = 11;
        _this.aby = null;
        _this.abq = null;
        _this.abp = null;
        _this.abt = null;
        _this.abv = null;
        _this.abs = null;
        _this.abu = null;
        _this.abx = null;
        _this.abw = null;
        _this.abr = null;
        var a = new DataToolTipLayerFrame();
        var b = new DataToolTipLayerFrame();
        var c = new DataToolTipLayerFrame();
        _this.xx = a;
        _this.xw = b;
        _this.xy = c;
        _this.ab = DataToolTipLayer.$;
        return _this;
    }
    DataToolTipLayer.prototype.get_f7 = function () {
        return true;
    };
    DataToolTipLayer.prototype.bk = function () {
        return new DataToolTipLayer();
    };
    DataToolTipLayer.prototype.get_eu = function () {
        return true;
    };
    DataToolTipLayer.prototype.ct = function () {
        return new DataToolTipLayerView(this);
    };
    DataToolTipLayer.prototype.rh = function (a) {
        _super.prototype.rh.call(this, a);
        this.abm = a;
    };
    DataToolTipLayer.prototype.q7 = function () {
        _super.prototype.q7.call(this);
        this.abm.c1();
    };
    DataToolTipLayer.prototype.get_e5 = function () {
        return true;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "abj", {
        get: function () {
            return this.abi;
        },
        set: function (a) {
            var b = this.abi;
            this.abi = a;
            if (b != this.abi) {
                this.raisePropertyChanged("ActualGroupingMode", enumGetBox(DataToolTipLayerGroupingMode_$type, b), enumGetBox(DataToolTipLayerGroupingMode_$type, this.abi));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.abl = function () {
        var e_1, _a;
        var a = true;
        var b = true;
        var c = true;
        var d = true;
        if (this.abk != 0) {
            return this.abk;
        }
        var e = this.aa0();
        if (e != null) {
            try {
                for (var _b = __values(fromEnum(e.eo())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var f = _c.value;
                    if (!f.ev && !f.fz) {
                        a = false;
                    }
                    if (!f.ev && !f.fs) {
                        b = false;
                    }
                    if (!f.ev && !f.f0) {
                        c = false;
                    }
                    if (!f.ev && !f.fw) {
                        d = false;
                    }
                }
            }
            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;
                }
            }
        }
        if (a || b || c || d) {
            return 2;
        }
        return 1;
    };
    DataToolTipLayer.prototype.rq = function (a, b, c, d) {
        _super.prototype.rq.call(this, a, b, c, d);
        switch (b) {
            case DataToolTipLayer.$$p[42]:
                this.r8(true);
                break;
            case DataToolTipLayer.$$p[52]:
                this.r8(true);
                break;
            case DataToolTipLayer.$$p[12]:
                this.abj = this.abl();
                break;
            case "ActualGroupingMode":
                this.r8(true);
                break;
            case DataToolTipLayer.$$p[10]:
                this.abb = this.abd();
                break;
            case DataToolTipLayer.$$p[11]:
                this.abf = this.abh();
                break;
            case "SeriesViewer":
                this.abm.c2();
                break;
            case DataToolTipLayer.$$p[31]:
            case DataToolTipLayer.$$p[24]:
            case DataToolTipLayer.$$p[5]:
            case DataToolTipLayer.$$p[23]:
            case DataToolTipLayer.$$p[4]:
            case DataToolTipLayer.$$p[28]:
            case DataToolTipLayer.$$p[53]:
            case DataToolTipLayer.$$p[55]:
            case DataToolTipLayer.$$p[56]:
            case DataToolTipLayer.$$p[57]:
            case DataToolTipLayer.$$p[54]:
            case DataToolTipLayer.$$p[60]:
            case DataToolTipLayer.$$p[59]:
            case DataToolTipLayer.$$p[58]:
            case DataToolTipLayer.$$p[61]:
            case DataToolTipLayer.$$p[62]:
            case DataToolTipLayer.$$p[66]:
            case DataToolTipLayer.$$p[65]:
            case DataToolTipLayer.$$p[64]:
            case DataToolTipLayer.$$p[63]:
            case "ValueTextStyle":
            case DataToolTipLayer.$$p[16]:
            case DataToolTipLayer.$$p[15]:
            case DataToolTipLayer.$$p[13]:
            case DataToolTipLayer.$$p[14]:
            case DataToolTipLayer.$$p[17]:
            case DataToolTipLayer.$$p[22]:
            case DataToolTipLayer.$$p[20]:
            case DataToolTipLayer.$$p[21]:
            case DataToolTipLayer.$$p[18]:
            case DataToolTipLayer.$$p[19]:
            case "HeaderTextStyle":
            case DataToolTipLayer.$$p[8]:
            case DataToolTipLayer.$$p[9]:
            case DataToolTipLayer.$$p[6]:
            case DataToolTipLayer.$$p[7]:
            case "GroupTextStyle":
            case DataToolTipLayer.$$p[35]:
            case "SummaryTitleTextStyle":
            case DataToolTipLayer.$$p[38]:
            case DataToolTipLayer.$$p[37]:
            case DataToolTipLayer.$$p[36]:
            case DataToolTipLayer.$$p[34]:
            case DataToolTipLayer.$$p[41]:
            case "SummaryValueTextStyle":
            case DataToolTipLayer.$$p[33]:
            case DataToolTipLayer.$$p[32]:
            case "SummaryLabelTextStyle":
            case DataToolTipLayer.$$p[40]:
            case DataToolTipLayer.$$p[39]:
            case "SummaryUnitsTextStyle":
            case DataToolTipLayer.$$p[0]:
            case DataToolTipLayer.$$p[1]:
            case DataToolTipLayer.$$p[48]:
            case DataToolTipLayer.$$p[51]:
            case DataToolTipLayer.$$p[49]:
            case DataToolTipLayer.$$p[50]:
            case "UnitsTextStyle":
            case DataToolTipLayer.$$p[44]:
            case DataToolTipLayer.$$p[43]:
            case "TitleTextStyle":
            case DataToolTipLayer.$$p[25]:
            case DataToolTipLayer.$$p[26]:
            case DataToolTipLayer.$$p[27]:
            case "LabelTextStyle":
                this.agf(b, c, d);
                break;
            case DataToolTipLayer.$$p[45]:
            case DataToolTipLayer.$$p[46]:
            case DataToolTipLayer.$$p[47]:
                this.r8(true);
                break;
        }
    };
    DataToolTipLayer.prototype.agf = function (a, b, c) {
        if (!this.acn.containsKey(a)) {
            this.aco.add(a);
            this.acn.addItem(a, c);
        }
        else {
            this.acn.item(a, c);
        }
        this.r8(true);
    };
    DataToolTipLayer.prototype.agj = function (a, b) {
        switch (a) {
            case DataToolTipLayer.$$p[12]:
                this.abk = EnumUtil.getEnumValue(DataToolTipLayerGroupingMode_$type, b);
                break;
            case DataToolTipLayer.$$p[29]:
                this.acs = b;
                break;
            case DataToolTipLayer.$$p[30]:
                this.act = b;
                break;
            case DataToolTipLayer.$$p[2]:
                this.acq = b;
                break;
            case DataToolTipLayer.$$p[3]:
                this.acr = b;
                break;
            case DataToolTipLayer.$$p[10]:
                this.abc = EnumUtil.getEnumValue(DataTooltipGroupedPositionX_$type, b);
                break;
            case DataToolTipLayer.$$p[11]:
                this.abg = EnumUtil.getEnumValue(DataTooltipGroupedPositionY_$type, b);
                break;
            case DataToolTipLayer.$$p[31]:
                this.aci = b;
                break;
            case DataToolTipLayer.$$p[24]:
                this.aay = b;
                break;
            case DataToolTipLayer.$$p[5]:
                this.aat = b;
                break;
            case DataToolTipLayer.$$p[23]:
                this.aax = b;
                break;
            case DataToolTipLayer.$$p[4]:
                this.aas = b;
                break;
            case DataToolTipLayer.$$p[53]:
                this.aa2 = EnumUtil.getEnumValue(DataAbbreviationMode_$type, b);
                break;
            case DataToolTipLayer.$$p[55]:
                this.adt = typeGetValue(b);
                break;
            case DataToolTipLayer.$$p[56]:
                this.adu = typeGetValue(b);
                break;
            case DataToolTipLayer.$$p[57]:
                this.aa9 = EnumUtil.getEnumValue(DataLegendValueMode_$type, b);
                break;
            case DataToolTipLayer.$$p[54]:
                this.afx = b;
                break;
            case DataToolTipLayer.$$p[60]:
                this.ack = b;
                break;
            case DataToolTipLayer.$$p[59]:
                this.af3 = b;
                break;
            case DataToolTipLayer.$$p[58]:
                this.aaz = b;
                break;
            case DataToolTipLayer.$$p[61]:
                this.ai7 = b;
                break;
            case DataToolTipLayer.$$p[62]:
                this.acl = b;
                break;
            case DataToolTipLayer.$$p[66]:
                this.agc = b;
                break;
            case DataToolTipLayer.$$p[65]:
                this.acm = b;
                break;
            case DataToolTipLayer.$$p[64]:
                this.ai8 = b;
                break;
            case DataToolTipLayer.$$p[63]:
                this.aiq = b;
                break;
            case "ValueTextStyle":
                this.ab8 = b;
                break;
            case DataToolTipLayer.$$p[16]:
                this.aeh = b;
                break;
            case DataToolTipLayer.$$p[15]:
                this.aaw = b;
                break;
            case DataToolTipLayer.$$p[13]:
                this.aed = b;
                break;
            case DataToolTipLayer.$$p[14]:
                this.aa3 = EnumUtil.getEnumValue(DataLegendHeaderDateMode_$type, b);
                break;
            case DataToolTipLayer.$$p[17]:
                this.aa4 = EnumUtil.getEnumValue(DataLegendHeaderTimeMode_$type, b);
                break;
            case DataToolTipLayer.$$p[22]:
                this.aem = b;
                break;
            case DataToolTipLayer.$$p[20]:
                this.aig = b;
                break;
            case DataToolTipLayer.$$p[21]:
                this.ai1 = b;
                break;
            case DataToolTipLayer.$$p[18]:
                this.ai0 = b;
                break;
            case DataToolTipLayer.$$p[19]:
                this.acb = b;
                break;
            case "HeaderTextStyle":
                this.ab0 = b;
                break;
            case DataToolTipLayer.$$p[28]:
                this.aa6 = EnumUtil.getEnumValue(DataLegendLayoutMode_$type, b);
                break;
            case DataToolTipLayer.$$p[8]:
                this.aif = b;
                break;
            case DataToolTipLayer.$$p[9]:
                this.aiz = b;
                break;
            case DataToolTipLayer.$$p[6]:
                this.aiy = b;
                break;
            case DataToolTipLayer.$$p[7]:
                this.aca = b;
                break;
            case "GroupTextStyle":
                this.abz = b;
                break;
            case DataToolTipLayer.$$p[35]:
                this.aij = b;
                break;
            case "SummaryTitleTextStyle":
                this.ab3 = b;
                break;
            case DataToolTipLayer.$$p[38]:
                this.aa7 = EnumUtil.getEnumValue(DataLegendSummaryType_$type, b);
                break;
            case DataToolTipLayer.$$p[37]:
                this.ae6 = b;
                break;
            case DataToolTipLayer.$$p[36]:
                this.ai4 = b;
                break;
            case DataToolTipLayer.$$p[34]:
                this.ai3 = b;
                break;
            case DataToolTipLayer.$$p[41]:
                this.ail = b;
                break;
            case "SummaryValueTextStyle":
                this.ab5 = b;
                break;
            case DataToolTipLayer.$$p[33]:
                this.ae1 = b;
                break;
            case DataToolTipLayer.$$p[32]:
                this.aii = b;
                break;
            case "SummaryLabelTextStyle":
                this.ab2 = b;
                break;
            case DataToolTipLayer.$$p[40]:
                this.afc = b;
                break;
            case DataToolTipLayer.$$p[39]:
                this.aik = b;
                break;
            case "SummaryUnitsTextStyle":
                this.ab4 = b;
                break;
            case DataToolTipLayer.$$p[0]:
                this.aix = b;
                break;
            case DataToolTipLayer.$$p[1]:
                this.abo = EnumUtil.getEnumValue(LegendItemBadgeShape_$type, b);
                break;
            case DataToolTipLayer.$$p[48]:
                this.aa8 = EnumUtil.getEnumValue(DataLegendUnitsMode_$type, b);
                break;
            case DataToolTipLayer.$$p[51]:
                this.afq = b;
                break;
            case DataToolTipLayer.$$p[49]:
                this.aip = b;
                break;
            case DataToolTipLayer.$$p[50]:
                this.ai6 = b;
                break;
            case "UnitsTextStyle":
                this.ab7 = b;
                break;
            case DataToolTipLayer.$$p[44]:
                this.ai5 = b;
                break;
            case DataToolTipLayer.$$p[43]:
                this.aim = b;
                break;
            case "TitleTextStyle":
                this.ab6 = b;
                break;
            case DataToolTipLayer.$$p[25]:
                this.aa5 = EnumUtil.getEnumValue(DataLegendLabelMode_$type, b);
                break;
            case DataToolTipLayer.$$p[26]:
                this.aih = b;
                break;
            case DataToolTipLayer.$$p[27]:
                this.ai2 = b;
                break;
            case "LabelTextStyle":
                this.ab1 = b;
                break;
            case DataToolTipLayer.$$p[47]:
                this.acy = b;
                break;
            case DataToolTipLayer.$$p[46]:
                this.aio = b;
                break;
            case DataToolTipLayer.$$p[45]:
                this.ain = b;
                break;
        }
    };
    DataToolTipLayer.prototype.agg = function (a) {
        for (var b = 0; b < this.aco.count; b++) {
            var c = this.aco._inner[b];
            a.updatePropertyByName(c, this.acn.item(c));
        }
    };
    DataToolTipLayer.prototype.zc = function (a, b) {
        {
            if (!this.a1.c) {
                this.r8(b);
            }
        }
    };
    DataToolTipLayer.prototype.zd = function (a, b) {
        if (!this.a1.c) {
            this.r8(b);
        }
    };
    DataToolTipLayer.prototype.zf = function (a, b) {
        var e_2, _a;
        var _this = this;
        _super.prototype.zf.call(this, a, b);
        this.abi = this.abl();
        var c = a;
        var d = this.abm.cp;
        var e = this.acj;
        var f = false;
        c.p.clear();
        c.l.clear();
        c.o.clear();
        c.j.clear();
        c.i.clear();
        c.n.clear();
        c.m.clear();
        c.k.clear();
        if (isNaN_(this.aap.x) && isNaN_(this.aap.y)) {
            d.count = 0;
            return;
        }
        {
            if (this.abj == 2) {
                var g_1 = 0;
                {
                    try {
                        for (var _b = __values(fromEnum(this.dc.b9)), _c = _b.next(); !_c.done; _c = _b.next()) {
                            var h = _c.value;
                            if (this.x4(h)) {
                                this.agi(h, c, e, f, g_1);
                                g_1++;
                            }
                            if (h.isStacked) {
                                h.qh(function (i) {
                                    if (_this.x4(i)) {
                                        _this.agi(i, c, e, f, g_1);
                                        g_1++;
                                    }
                                    if (i.ei) {
                                        i.qf(function (j) {
                                            if (_this.x4(j)) {
                                                _this.agi(j, c, e, f, g_1);
                                                g_1++;
                                            }
                                            return true;
                                        });
                                    }
                                    return true;
                                });
                            }
                            if (h.ei) {
                                h.qf(function (i) {
                                    if (_this.x4(i)) {
                                        _this.agi(i, c, e, f, g_1);
                                        g_1++;
                                    }
                                    return true;
                                });
                            }
                        }
                    }
                    catch (e_2_1) {
                        e_2 = { error: e_2_1 };
                    }
                    finally {
                        try {
                            if (_c && !_c.done && (_a = _b.return))
                                _a.call(_b);
                        }
                        finally {
                            if (e_2)
                                throw e_2.error;
                        }
                    }
                    this.age(c);
                }
                d.count = g_1;
            }
            else {
                var i = this.aa0();
                var j = this.acp(i);
                var k = this.abn(i, j, e);
                this.agh(k, c, e);
            }
        }
    };
    DataToolTipLayer.prototype.acp = function (a) {
        var e_3, _a;
        var b = new List$1(Series.$, 0);
        if (a == null) {
            return b;
        }
        try {
            for (var _b = __values(fromEnum(a.es)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                b.add(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;
    };
    DataToolTipLayer.prototype.aa0 = function () {
        var e_4, _a, e_5, _b;
        if (this.aa1 != null) {
            return this.aa1;
        }
        if (this.dc == null) {
            return null;
        }
        try {
            for (var _c = __values(fromEnum(this.dc.b9)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var a = _d.value;
                if (a.e1) {
                    var b = a.a0();
                    if (b != null && b.dx()) {
                        return b;
                    }
                }
            }
        }
        catch (e_4_1) {
            e_4 = { error: e_4_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_4)
                    throw e_4.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.dc.b9)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var c = _f.value;
                if (!c.e1) {
                    var d = c.ai();
                    var e = d != null && d.length > 0 ? d[0] : null;
                    if (e != null && e.dx()) {
                        return e;
                    }
                }
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
        return null;
    };
    DataToolTipLayer.prototype.abn = function (a, b, c) {
        var d = 1.7976931348623157E+308;
        var e = -1.7976931348623157E+308;
        var f = new List$1(DataContext.$, 0);
        var g = new List$1(Base.$, 0);
        var h = false;
        var i = true;
        var j = { $type: Point_$type, x: NaN, y: NaN };
        var k = 0;
        var l = 0;
        var _loop_1 = function (m) {
            var n = b.item(m);
            k = n.dc.l;
            l = n.dc.m;
            if (n.e1) {
                var o = n;
                var p_1 = new List$1(Series.$, 0);
                if (o.isStacked) {
                    o.qh(function (q) {
                        p_1.add(q);
                        if (q.ei) {
                            q.qf(function (r) {
                                p_1.add(r);
                                return true;
                            });
                        }
                        return true;
                    });
                }
                else if (o.ei) {
                    p_1.add(o);
                    o.qf(function (q) {
                        p_1.add(q);
                        return true;
                    });
                }
                else {
                    p_1.add(o);
                }
                for (var q = 0; q < p_1.count; q++) {
                    var r = p_1._inner[q];
                    var s = p_1._inner[q];
                    if (s.dc == null) {
                        continue;
                    }
                    if (!r.categoryAxis.dx()) {
                        continue;
                    }
                    if (i) {
                        h = s.isVertical;
                    }
                    else {
                        if (h != s.isVertical) {
                            continue;
                        }
                    }
                    var t = this_1.oz(s, this_1.aap);
                    if (!t.c) {
                        continue;
                    }
                    j = s.wr(t.d);
                    var u = s.ww(t.d, c, false);
                    if (h) {
                        if (!isNaN_(u.y)) {
                            d = Math.min(d, u.y);
                            e = Math.max(e, u.y);
                        }
                    }
                    else {
                        if (!isNaN_(u.x)) {
                            d = Math.min(d, u.x);
                            e = Math.max(e, u.x);
                        }
                    }
                }
            }
            else {
                var v = n.ai();
                for (var w = 0; w < v.length; w++) {
                    if (!v[w].dx()) {
                        continue;
                    }
                }
                var x = n.ww(this_1.aap, c, false);
                j = n.wr(this_1.aap);
                if (h) {
                    if (!isNaN_(x.y)) {
                        d = Math.min(d, x.y);
                        e = Math.max(e, x.y);
                    }
                }
                else {
                    if (!isNaN_(x.x)) {
                        d = Math.min(d, x.x);
                        e = Math.max(e, x.x);
                    }
                }
            }
            var y = null;
            var z = n.kw(this_1.aap);
            if (n.e7 && z != null) {
                y = n.a3(z);
            }
            else {
                y = new DataContext();
                y.item = z;
                y.series = n;
            }
            f.add(y);
        };
        var this_1 = this;
        for (var m = 0; m < b.count; m++) {
            _loop_1(m);
        }
        var aa = 0;
        var ab = 0;
        if (h) {
            ab = (d + e) / 2;
            aa = this.xd.right;
            if (!isNaN_(j.x)) {
                aa = j.x;
            }
            if (ab < 0 || ab > this.xd.bottom) {
                ab = NaN;
            }
        }
        else {
            aa = (d + e) / 2;
            if (!isNaN_(j.y)) {
                ab = j.y;
            }
            if (aa < 0 || aa > this.xd.right) {
                aa = NaN;
            }
        }
        var ac = new DataToolTipSeriesInfo();
        ac.f = { $type: Point_$type, x: aa, y: ab };
        ac.e = { $type: Point_$type, x: j.x, y: j.y };
        ac.b = f;
        ac.a = h;
        return ac;
    };
    DataToolTipLayer.prototype.ql = function () {
        this.aap = { $type: Point_$type, x: NaN, y: NaN };
        this.r8(false);
        this.abm.cz(false);
    };
    DataToolTipLayer.prototype.qm = function () {
        this.aap = { $type: Point_$type, x: NaN, y: NaN };
        this.r8(false);
        this.abm.cz(true);
    };
    Object.defineProperty(DataToolTipLayer.prototype, "aiu", {
        get: function () {
            var a = RectUtil.n(this.cw.b9);
            var b = new Size(1, this.cw.b9.width, this.cw.b9.height);
            return new Rect(3, a, b);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ait", {
        get: function () {
            var a = RectUtil.n(this.cw.b9);
            var b = new Size(1, this.cw.b9.width, this.cw.b9.height);
            return new Rect(3, this.abm.c3(a), b);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ais", {
        get: function () {
            var a = new Rect(0, 0, 0, this.dc.m, this.dc.l);
            var b = RectUtil.n(a);
            var c = new Size(1, a.width, a.height);
            return new Rect(3, this.abm.c3(b), c);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "aiw", {
        get: function () {
            var a = { $type: Point_$type, x: 0, y: 0 };
            return new Rect(3, a, this.abm.c8());
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.aiv = function () {
        return this.aiu;
    };
    DataToolTipLayer.prototype.acf = function (a, b, c) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var d = a.top;
        return c < d;
    };
    DataToolTipLayer.prototype.acc = function (a, b, c, d) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var e = a.bottom;
        return c + d.height >= e;
    };
    DataToolTipLayer.prototype.acd = function (a, b, c) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var d = a.left;
        return c < d;
    };
    DataToolTipLayer.prototype.ace = function (a, b, c, d) {
        if (Rect.l_op_Equality(a, Rect.empty)) {
            return false;
        }
        var e = a.right;
        return c + d.width > e;
    };
    DataToolTipLayer.prototype.adj = function (a, b) {
        return a.top + b;
    };
    DataToolTipLayer.prototype.adh = function (a, b, c) {
        return a.bottom - c.height - b;
    };
    DataToolTipLayer.prototype.adi = function (a, b) {
        return ((a.bottom + a.top) / 2) - (b.height / 2);
    };
    DataToolTipLayer.prototype.ads = function (a, b, c, d, e) {
        var f = c.y - d.height - b;
        return f;
    };
    DataToolTipLayer.prototype.adq = function (a, b, c, d, e) {
        var f = c.y + b;
        return f;
    };
    DataToolTipLayer.prototype.adr = function (a, b, c, d, e) {
        var f = c.y - (d.height / 2);
        return f;
    };
    DataToolTipLayer.prototype.adm = function (a, b, c, d, e) {
        var f = c.y - d.height;
        f = f - b;
        return f;
    };
    DataToolTipLayer.prototype.adk = function (a, b, c, d, e) {
        var f = c.y;
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.adl = function (a, b, c, d, e) {
        var f = c.y - (d.height / 2);
        return f;
    };
    DataToolTipLayer.prototype.ac2 = function (a, b) {
        return a.left + b;
    };
    DataToolTipLayer.prototype.ac4 = function (a, b, c) {
        return (a.right - (c.width)) - b;
    };
    DataToolTipLayer.prototype.ac3 = function (a, b, c) {
        return ((a.right + a.left) / 2) - (c.width / 2) + b;
    };
    DataToolTipLayer.prototype.adb = function (a, b, c, d, e) {
        var f = (c.x - d.width) - b;
        return f;
    };
    DataToolTipLayer.prototype.add = function (a, b, c, d, e) {
        var f = c.x + b;
        return f;
    };
    DataToolTipLayer.prototype.adc = function (a, b, c, d, e) {
        var f = (c.x - (d.width / 2));
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.ac8 = function (a, b, c, d, e) {
        var f = c.x - d.width;
        f = f - b;
        return f;
    };
    DataToolTipLayer.prototype.ada = function (a, b, c, d, e) {
        var f = c.x;
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.ac9 = function (a, b, c, d, e) {
        var f = c.x - (d.width / 2);
        f = f + b;
        return f;
    };
    DataToolTipLayer.prototype.acx = function (a, b, c, d, e, f, g, h) {
        switch (a) {
            case 1:
                {
                    return this.adm(e, b, h, f, true);
                }
            case 2:
                {
                    return this.adk(e, b, h, f, true);
                }
            case 3:
                {
                    return this.adl(e, b, h, f, true);
                }
            case 5: return this.adn(e, c, b, h, f);
            case 6: return this.ado(e, c, b, h, f);
            case 4: return this.adp(e, c, b, h, f);
            case 8: return this.ade(e, c, b, h, f);
            case 9: return this.adf(e, c, b, h, f);
            case 7: return this.adg(e, c, b, h, f);
            case 13: return this.adj(d, b);
            case 14: return this.adh(d, b, f);
            case 15: return this.adi(d, f);
            case 10: return this.ads(e, b, g, f, true);
            case 12: return this.adr(e, b, g, f, true);
            case 11:
            default: return this.adq(e, b, g, f, true);
        }
    };
    DataToolTipLayer.prototype.ac5 = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f - e.width;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.ac6 = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f - e.width / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ac7 = function (a, b, c, d, e) {
        var f = d.x;
        f = f + b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.acz = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f - e.width;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.ac0 = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f - e.width / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ac1 = function (a, b, c, d, e) {
        var f = d.x;
        f = f - b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.adg = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f - e.height;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.adf = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f - e.height / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.ade = function (a, b, c, d, e) {
        var f = d.y;
        f = f + b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.adp = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f - e.height;
        f = f - c;
        return f;
    };
    DataToolTipLayer.prototype.ado = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f - e.height / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.adn = function (a, b, c, d, e) {
        var f = d.y;
        f = f - b / 2;
        f = f + c;
        return f;
    };
    DataToolTipLayer.prototype.acw = function (a, b, c, d, e, f, g, h) {
        switch (a) {
            case 10: return this.adb(e, b, g, f, true);
            case 11: return this.add(e, b, g, f, true);
            case 12: return this.adc(e, b, g, f, true);
            case 13: return this.ac2(d, b);
            case 14: return this.ac4(e, b, f);
            case 15: return this.ac3(e, b, f);
            case 5: return this.ac1(e, c, b, h, f);
            case 6: return this.ac0(e, c, b, h, f);
            case 4: return this.acz(e, c, b, h, f);
            case 8: return this.ac7(e, c, b, h, f);
            case 9: return this.ac6(e, c, b, h, f);
            case 7: return this.ac5(e, c, b, h, f);
            case 1:
                {
                    return this.ac8(e, b, h, f, true);
                }
            case 3:
                {
                    return this.ac9(e, b, h, f, true);
                }
            case 2:
            default:
                {
                    return this.ada(e, b, h, f, true);
                }
        }
    };
    DataToolTipLayer.prototype.air = function (a, b, c, d) {
        var e = this.abb;
        var f = this.abf;
        var g = this.aa0();
        var h = 0;
        if (g != null && g.df && this.dc != null) {
            h = g.getCategorySize(this.dc.yr, this.xd, this.getEffectiveViewport());
            if (g.categoryMode == 0) {
                h = 0;
            }
        }
        var i = this.acu(e);
        var j = this.acv(f);
        var k = this.acw(e, i, h, this.aiu, a, b, c, d);
        var l = this.acx(f, j, h, this.aiu, a, b, c, d);
        var m = this.acg(a, i, k, b);
        var n = this.ach(a, j, l, b);
        if (!m) {
            var o = this.aau(e);
            var p = 0;
            while (!m && p < o.length) {
                e = o[p];
                i = this.acu(e);
                k = this.acw(e, i, h, this.aiu, a, b, c, d);
                m = this.acg(a, i, k, b);
                p++;
            }
        }
        if (!n) {
            var q = this.aav(f);
            var r = 0;
            while (!n && r < q.length) {
                f = q[r];
                j = this.acv(f);
                l = this.acx(f, j, h, this.aiu, a, b, c, d);
                n = this.ach(a, j, l, b);
                r++;
            }
        }
        return { $type: Point_$type, x: k, y: l };
    };
    DataToolTipLayer.prototype.acv = function (a) {
        if (!isNaN_(this.act)) {
            return this.act;
        }
        switch (a) {
            case 1: return this.acr;
            case 2: return this.acr;
            case 3: return 0;
            case 4: return this.acr;
            case 5: return this.acr;
            case 6: return this.acr;
            case 7: return this.acr;
            case 8: return this.acr;
            case 9: return 0;
            case 10: return this.acr;
            case 11: return this.acr;
            case 12: return 0;
            case 13: return this.acr;
            case 14: return this.acr;
            case 15: return 0;
        }
        return this.acr;
    };
    DataToolTipLayer.prototype.acu = function (a) {
        if (!isNaN_(this.acs)) {
            return this.acs;
        }
        switch (a) {
            case 4: return this.acq;
            case 6: return 0;
            case 5: return this.acq;
            case 13: return this.acq;
            case 15: return 0;
            case 14: return this.acq;
            case 7: return this.acq;
            case 9: return 0;
            case 8: return this.acq;
            case 1: return this.acq;
            case 3: return 0;
            case 2: return this.acq;
            case 10: return this.acq;
            case 12: return 0;
            case 11: return this.acq;
        }
        return this.acq;
    };
    DataToolTipLayer.prototype.aav = function (a) {
        var b = [a];
        switch (a) {
            case 1:
                b = [2, 3, 13, 14];
                break;
            case 2:
                b = [1, 3, 14, 13];
                break;
            case 3:
                b = [1, 2];
                break;
            case 4:
                b = [8, 7, 3, 13, 14];
                break;
            case 5:
                b = [7, 8, 3, 13, 14];
                break;
            case 6:
                b = [9, 8, 4, 3];
                break;
            case 7:
                b = [5, 4, 2, 14, 13];
                break;
            case 8:
                b = [4, 5, 3, 14, 13];
                break;
            case 9:
                b = [6, 4, 8, 3];
                break;
            case 10:
                b = [11, 12, 2, 1, 3, 13, 14];
                break;
            case 11:
                b = [10, 12, 1, 2, 3, 14, 13];
                break;
            case 12:
                b = [10, 11];
                break;
            case 13: break;
            case 14: break;
            case 15: break;
        }
        return b;
    };
    DataToolTipLayer.prototype.aau = function (a) {
        var b = [a];
        switch (a) {
            case 1:
                b = [2, 3, 13, 14];
                break;
            case 2:
                b = [1, 3, 14, 13];
                break;
            case 3:
                b = [1, 2];
                break;
            case 4:
                b = [8, 7, 3, 13, 14];
                break;
            case 5:
                b = [7, 8, 1, 14, 13];
                break;
            case 6:
                b = [9, 8, 4, 3];
                break;
            case 7:
                b = [5, 4, 2, 14, 13];
                break;
            case 8:
                b = [4, 5, 3, 13, 14];
                break;
            case 9:
                b = [6, 4, 8, 3];
                break;
            case 10:
                b = [11, 12, 2, 1, 3, 13, 14];
                break;
            case 11:
                b = [10, 12, 1, 2, 3, 14, 13];
                break;
            case 12:
                b = [10, 11];
                break;
            case 13: break;
            case 14: break;
            case 15: break;
        }
        return b;
    };
    DataToolTipLayer.prototype.acg = function (a, b, c, d) {
        return !(this.acd(a, b, c) || this.ace(a, b, c, d));
    };
    DataToolTipLayer.prototype.ach = function (a, b, c, d) {
        return !(this.acf(a, b, c) || this.acc(a, b, c, d));
    };
    DataToolTipLayer.prototype.age = function (a) {
        var b = new List$1(DataTooltipCollisionInfo.$, 0);
        for (var c = 0; c < a.i.count; c++) {
            var d = new DataTooltipCollisionInfo();
            d.d = c;
            d.e = { $type: Point_$type, x: a.i._inner[c], y: a.j._inner[c] };
            d.c = a.n._inner[c];
            d.a = a.m._inner[c];
            d.b = a.p._inner[c];
            if (isNaN_(d.e.x) || isNaN_(d.e.y)) {
                continue;
            }
            b.add(d);
        }
        b.aa(function (e, f) {
            if (e.e.y < f.e.y) {
                return -1;
            }
            if (e.e.y > f.e.y) {
                return 1;
            }
            if (e.b < f.b) {
                return -1;
            }
            if (e.b > f.b) {
                return 1;
            }
            return 0;
        });
        var e = this.ab9(b);
        if (!e) {
            return;
        }
        for (var f = 0; f < b.count - 1; f++) {
            var g = b._inner[f];
            var h = b._inner[f + 1];
            var i = new Rect(0, g.e.x, g.e.y, g.c, g.a);
            var j = new Rect(0, h.e.x, h.e.y, h.c, h.a);
            if (i.intersectsWith(j) || i.top > j.bottom) {
                h.e = { $type: Point_$type, x: h.e.x, y: i.bottom + 1 };
            }
        }
        if (b._inner[b.count - 1].e.y + b._inner[b.count - 1].a > this.cw.b9.height) {
            b._inner[b.count - 1].e = { $type: Point_$type, x: b._inner[b.count - 1].e.x, y: b._inner[b.count - 1].e.y - ((b._inner[b.count - 1].e.y + b._inner[b.count - 1].a) - this.cw.b9.height) };
        }
        for (var k = b.count - 1; k >= 1; k--) {
            var l = b._inner[k];
            var m = b._inner[k - 1];
            var n = new Rect(0, l.e.x, l.e.y, l.c, l.a);
            var o = new Rect(0, m.e.x, m.e.y, m.c, m.a);
            if (n.intersectsWith(o) || n.top < o.bottom) {
                m.e = { $type: Point_$type, x: m.e.x, y: n.top - (o.height + 1) };
            }
        }
        for (var p = 0; p < b.count; p++) {
            var q = b._inner[p].d;
            var r = b._inner[p];
            a.i._inner[q] = r.e.x;
            a.j._inner[q] = r.e.y;
        }
    };
    DataToolTipLayer.prototype.ab9 = function (a) {
        if (a.count <= 1) {
            return false;
        }
        var b = this.cw.b9;
        for (var c = 0; c < a.count - 1; c++) {
            var d = a._inner[c];
            var e = a._inner[c + 1];
            var f = new Rect(0, d.e.x, d.e.y, d.c, d.a);
            var g = new Rect(0, e.e.x, e.e.y, e.c, e.a);
            if (f.intersectsWith(g)) {
                return true;
            }
        }
        return false;
    };
    DataToolTipLayer.prototype.agi = function (a, b, c, d, e) {
        var _this = this;
        var f = this.oz(a, this.aap);
        if (!f.c) {
            return;
        }
        var g = a.ww(f.d, c, d);
        var h = this.abm.cp;
        var i = this.aap;
        if (!c) {
            i = this.w2(g);
        }
        var j = a.kw(i);
        var k = h.item(e);
        var l = this.cw.b9;
        var m = this.abm.co(k);
        if (!Base.equalsStatic(m.target, this.dc)) {
            m.target = this.dc;
        }
        var n = new List$1(String_$type, 0);
        if (a.ei && this.abj == 2) {
            a.qf(function (o) {
                if (_this.x4(o)) {
                    n.add(o.dataLegendKey);
                }
                return true;
            });
        }
        m.includedSeries = [a.dataLegendKey];
        m.excludedSeries = n.toArray();
        this.agg(m);
        m.targetCursorPositionX = this.aap.x;
        m.targetCursorPositionY = this.aap.y;
        if (!this.abm.cr(k, a)) {
            return;
        }
        var o = this.abm.c7(k);
        b.l.add1(k);
        var p = CanvasScalingHelpers.c(this.dc.dw.j.ae.rootWrapper);
        var q = g.x;
        var r = g.x * p;
        r = Math.max(r, l.left);
        r = Math.min(r, l.right);
        b.o.add(r);
        var s = g.y * p;
        s = Math.max(s, l.top);
        s = Math.min(s, l.bottom);
        b.p.add(s);
        var t = DeviceUtils.g(10);
        var u = (g.x * p) + t;
        if (u + o.width > l.right) {
            u = (l.right - o.width) - t;
        }
        if (u < l.left) {
            u = l.left;
        }
        b.i.add(u);
        var v = (g.y * p - o.height) - t;
        if (v + o.height > l.bottom) {
            v = (l.bottom - o.height) - t;
        }
        if (v < l.top) {
            v = l.top;
        }
        b.j.add(v);
        b.n.add(o.width);
        b.m.add(o.height);
        var w = this.vt;
        if (w == null) {
            w = this.vz;
        }
        if (w == null) {
            w = a.vt;
        }
        b.k.add(w);
    };
    DataToolTipLayer.prototype.agh = function (a, b, c) {
        var e_6, _a;
        this.aba = this.abd();
        this.abe = this.abh();
        var d = a.f;
        var e = a.e;
        var f = 0;
        var g = this.abm.cp.item(0);
        this.abm.cr(g, null);
        var h = this.abm.co(g);
        if (!Base.equalsStatic(h.target, this.dc)) {
            h.target = this.dc;
        }
        var i = new List$1(String_$type, 0);
        var j = this.aa0();
        if (j != null) {
            try {
                for (var _b = __values(fromEnum(j.eo())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var k = _c.value;
                    if (k.isStacked) {
                        k.qh(function (l) {
                            i.add(l.dataLegendKey);
                            if (l.ei) {
                                l.qf(function (m) {
                                    i.add(m.dataLegendKey);
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    else if (k.ei) {
                        i.add(k.dataLegendKey);
                        k.qf(function (l) {
                            i.add(l.dataLegendKey);
                            return true;
                        });
                    }
                    else {
                        i.add(k.dataLegendKey);
                    }
                }
            }
            catch (e_6_1) {
                e_6 = { error: e_6_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_6)
                        throw e_6.error;
                }
            }
            h.includedSeries = i.toArray();
            h.excludedSeries = null;
        }
        else {
            h.includedSeries = null;
            h.excludedSeries = null;
        }
        this.agg(h);
        h.targetCursorPositionX = this.aap.x;
        h.targetCursorPositionY = this.aap.y;
        var l = this.abm.c7(g);
        var m = 0;
        var n = 0;
        var o = 0;
        var p = 0;
        var q = false;
        var r = false;
        o = d.x;
        p = d.y;
        var s = this.cw.b9;
        var t = this.abm.c8();
        var u = this.aiv();
        var v = CanvasScalingHelpers.c(this.dc.dw.j.ae.rootWrapper);
        d.x *= v;
        d.y *= v;
        u.x *= v;
        u.y *= v;
        u.width *= v;
        u.height *= v;
        e.x *= v;
        e.y *= v;
        var w = this.air(u, l, e, d);
        var x = w.x;
        var y = w.y;
        {
        }
        b.o.add(x);
        b.p.add(y);
        b.i.add(x);
        b.j.add(y);
        b.n.add(l.width);
        b.m.add(l.height);
        b.l.add1(g);
        var z = null;
        b.k.add(z);
        this.abm.cp.count = 1;
    };
    DataToolTipLayer.prototype.adv = function (a) {
        return a.toolTip;
    };
    DataToolTipLayer.prototype.zi = function (a, b) {
        _super.prototype.zi.call(this, a, b);
        var c = a;
        var d = c.p.count;
        var e = b.b9.left;
        var f = b.b9.right;
        var g = b.b9.top;
        var h = b.b9.bottom;
        for (var i = 0; i < d; i++) {
            if (isNaN_(c.o._inner[i]) || isNaN_(c.p._inner[i]) || isNaN_(c.i._inner[i]) || isNaN_(c.j._inner[i])) {
                this.abm.cy(c.l._inner[i]);
                continue;
            }
            var j = c.i._inner[i];
            var k = c.j._inner[i];
            var l = c.n._inner[i];
            var m = c.m._inner[i];
            var n = false;
            if (n) {
                this.abm.cy(c.l._inner[i]);
                continue;
            }
            var o = c.l._inner[i];
            var p = Math.min(c.i._inner[i], c.o._inner[i]);
            var q = Math.min(c.j._inner[i], c.p._inner[i]);
            var r = c.o._inner[i] - c.i._inner[i];
            var s = c.p._inner[i] - c.j._inner[i];
            if (o != null) {
                this.abm.c0(o, p, q, r, s);
            }
        }
    };
    DataToolTipLayer.prototype.gg = function () {
        return true;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "abb", {
        get: function () {
            return this.aba;
        },
        set: function (a) {
            var b = this.aba;
            this.aba = a;
            if (b != this.aba) {
                this.raisePropertyChanged("ActualGroupedPositionModeX", enumGetBox(DataTooltipGroupedPositionX_$type, b), enumGetBox(DataTooltipGroupedPositionX_$type, this.aba));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.abd = function () {
        var e_7, _a;
        if (this.dc == null) {
            return 2;
        }
        var a = false;
        var b = false;
        var c = false;
        var d = false;
        var e = this.aa0();
        if (e == null) {
            if (this.abc != 0) {
                return this.abc;
            }
            else {
                return 2;
            }
        }
        try {
            for (var _b = __values(fromEnum(e.es)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                if (f.e2) {
                    a = true;
                }
                if (f.isVertical) {
                    b = true;
                }
                if (f.fs) {
                    c = true;
                }
                if (f.fz) {
                    d = true;
                }
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
        var g = ((function () {
            var $ret = new HashSet$1(DataTooltipGroupedPositionX_$type, 0);
            $ret.add_1(1);
            $ret.add_1(2);
            $ret.add_1(3);
            $ret.add_1(4);
            $ret.add_1(5);
            $ret.add_1(6);
            $ret.add_1(7);
            $ret.add_1(8);
            $ret.add_1(9);
            return $ret;
        })());
        var h = g.contains(this.abc);
        if (this.abc != 0) {
            return this.abc;
        }
        if (h && b) {
            return 11;
        }
        if (c || d) {
            return 11;
        }
        if (b) {
            return 11;
        }
        if (a) {
            return 8;
        }
        return 8;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "abf", {
        get: function () {
            return this.abe;
        },
        set: function (a) {
            var b = this.abe;
            this.abe = a;
            if (b != this.abe) {
                this.raisePropertyChanged("ActualPositionModeY", enumGetBox(DataTooltipGroupedPositionY_$type, b), enumGetBox(DataTooltipGroupedPositionY_$type, this.abe));
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.prototype.abh = function () {
        var e_8, _a;
        if (this.dc == null) {
            return 11;
        }
        var a = false;
        var b = false;
        var c = false;
        var d = this.aa0();
        if (d == null) {
            if (this.abg != 0) {
                return this.abg;
            }
            else {
                return 11;
            }
        }
        try {
            for (var _b = __values(fromEnum(d.eo())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                if (e.isVertical) {
                    a = true;
                }
                if (e.fs) {
                    b = true;
                }
                if (e.fz) {
                    c = true;
                }
            }
        }
        catch (e_8_1) {
            e_8 = { error: e_8_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_8)
                    throw e_8.error;
            }
        }
        var f = ((function () {
            var $ret = new HashSet$1(DataTooltipGroupedPositionY_$type, 0);
            $ret.add_1(1);
            $ret.add_1(2);
            $ret.add_1(3);
            $ret.add_1(4);
            $ret.add_1(5);
            $ret.add_1(6);
            $ret.add_1(7);
            $ret.add_1(8);
            $ret.add_1(9);
            return $ret;
        })());
        var g = f.contains(this.abg);
        if (this.abg != 0) {
            return this.abg;
        }
        if (g && !a) {
            return 11;
        }
        if (b || c) {
            return 11;
        }
        if (a) {
            return 8;
        }
        if (!a) {
            return 11;
        }
        return 11;
    };
    Object.defineProperty(DataToolTipLayer.prototype, "ab8", {
        get: function () {
            return this.aby;
        },
        set: function (a) {
            var b = this.aby;
            this.aby = a;
            if (b != this.aby) {
                this.raisePropertyChanged("ValueTextStyle", b, this.aby);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab0", {
        get: function () {
            return this.abq;
        },
        set: function (a) {
            var b = this.abq;
            this.abq = a;
            if (b != this.abq) {
                this.raisePropertyChanged("HeaderTextStyle", b, this.abq);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "abz", {
        get: function () {
            return this.abp;
        },
        set: function (a) {
            var b = this.abp;
            this.abp = a;
            if (b != this.abp) {
                this.raisePropertyChanged("GroupTextStyle", b, this.abp);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab3", {
        get: function () {
            return this.abt;
        },
        set: function (a) {
            var b = this.abt;
            this.abt = a;
            if (b != this.abt) {
                this.raisePropertyChanged("SummaryTitleTextStyle", b, this.abt);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab5", {
        get: function () {
            return this.abv;
        },
        set: function (a) {
            var b = this.abv;
            this.abv = a;
            if (b != this.abv) {
                this.raisePropertyChanged("SummaryValueTextStyle", b, this.abv);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab2", {
        get: function () {
            return this.abs;
        },
        set: function (a) {
            var b = this.abs;
            this.abs = a;
            if (b != this.abs) {
                this.raisePropertyChanged("SummaryLabelTextStyle", b, this.abs);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab4", {
        get: function () {
            return this.abu;
        },
        set: function (a) {
            var b = this.abu;
            this.abu = a;
            if (b != this.abu) {
                this.raisePropertyChanged("SummaryUnitsTextStyle", b, this.abu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab7", {
        get: function () {
            return this.abx;
        },
        set: function (a) {
            var b = this.abx;
            this.abx = a;
            if (b != this.abx) {
                this.raisePropertyChanged("UnitsTextStyle", b, this.abx);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab6", {
        get: function () {
            return this.abw;
        },
        set: function (a) {
            var b = this.abw;
            this.abw = a;
            if (b != this.abw) {
                this.raisePropertyChanged("TitleTextStyle", b, this.abw);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataToolTipLayer.prototype, "ab1", {
        get: function () {
            return this.abr;
        },
        set: function (a) {
            var b = this.abr;
            this.abr = a;
            if (b != this.abr) {
                this.raisePropertyChanged("LabelTextStyle", b, this.abr);
            }
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayer.$t = markType(DataToolTipLayer, 'DataToolTipLayer', AnnotationLayer.$);
    DataToolTipLayer.$$p = markDep(DependencyProperty, PropertyMetadata, DataToolTipLayer, 'raisePropertyChanged', ['BadgeMargin:aix:agk', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'BadgeShape:abo:agl', [LegendItemBadgeShape_$type, enumGetBox(LegendItemBadgeShape_$type, 0)], 'DefaultPositionOffsetX:acq:agm', [1, DeviceUtils.g(10)], 'DefaultPositionOffsetY:acr:agn', [1, DeviceUtils.g(10)], 'ExcludedColumns:aas:ago', [Array_$type, null], 'ExcludedSeries:aat:agp', [Array_$type, null], 'GroupRowMargin:aiy:agt', [Thickness.$, new Thickness(0, 5)], 'GroupRowVisible:aca:agu', [0, false], 'GroupTextColor:aif:agv', [Brush.$, null], 'GroupTextMargin:aiz:agw', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'GroupedPositionModeX:abc:agq', [DataTooltipGroupedPositionX_$type, enumGetBox(DataTooltipGroupedPositionX_$type, 0)], 'GroupedPositionModeY:abg:agr', [DataTooltipGroupedPositionY_$type, enumGetBox(DataTooltipGroupedPositionY_$type, 0)], 'GroupingMode:abk:ags', [DataToolTipLayerGroupingMode_$type, enumGetBox(DataToolTipLayerGroupingMode_$type, 0)], 'HeaderFormatCulture:aed:agx', [2, stringEmpty()], 'HeaderFormatDate:aa3:agy', [DataLegendHeaderDateMode_$type, enumGetBox(DataLegendHeaderDateMode_$type, 0)], 'HeaderFormatSpecifiers:aaw:agz', [Array_$type, null], 'HeaderFormatString:aeh:ag0', [2, null], 'HeaderFormatTime:aa4:ag1', [DataLegendHeaderTimeMode_$type, enumGetBox(DataLegendHeaderTimeMode_$type, 0)], 'HeaderRowMargin:ai0:ag2', [Thickness.$, new Thickness(0, 5)], 'HeaderRowVisible:acb:ag3', [0, true], 'HeaderTextColor:aig:ag4', [Brush.$, null], 'HeaderTextMargin:ai1:ag5', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'HeaderText:aem:ag6', [2, null], 'IncludedColumns:aax:ag7', [Array_$type, null], 'IncludedSeries:aay:ag8', [Array_$type, null], 'LabelDisplayMode:aa5:ag9', [DataLegendLabelMode_$type, enumGetBox(DataLegendLabelMode_$type, 0)], 'LabelTextColor:aih:aha', [Brush.$, null], 'LabelTextMargin:ai2:ahb', [Thickness.$, new Thickness(1, 8, 0, 0, 0)], 'LayoutMode:aa6:ahc', [DataLegendLayoutMode_$type, enumGetBox(DataLegendLayoutMode_$type, 0)], 'PositionOffsetX:acs:ahd', [1, NaN], 'PositionOffsetY:act:ahe', [1, NaN], 'ShouldUpdateWhenSeriesDataChanges:aci:ahf', [0, true], 'SummaryLabelTextColor:aii:ahg', [Brush.$, null], 'SummaryLabelText:ae1:ahh', [2, null], 'SummaryRowMargin:ai3:ahi', [Thickness.$, new Thickness(0, 5)], 'SummaryTitleTextColor:aij:ahj', [Brush.$, null], 'SummaryTitleTextMargin:ai4:ahk', [Thickness.$, new Thickness(1, 2, 0, 0, 0)], 'SummaryTitleText:ae6:ahl', [2, null], 'SummaryType:aa7:ahm', [DataLegendSummaryType_$type, enumGetBox(DataLegendSummaryType_$type, 0)], 'SummaryUnitsTextColor:aik:ahn', [Brush.$, null], 'SummaryUnitsText:afc:aho', [2, null], 'SummaryValueTextColor:ail:ahp', [Brush.$, null], 'TargetAxis:aa1:ahq', [Axis.$, null], 'TitleTextColor:aim:ahr', [Brush.$, null], 'TitleTextMargin:ai5:ahs', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'ToolTipBackground:ain:aht', [Brush.$, null], 'ToolTipBorderBrush:aio:ahu', [Brush.$, null], 'ToolTipBorderThickness:acy:ahv', [1, NaN], 'UnitsDisplayMode:aa8:ahw', [DataLegendUnitsMode_$type, enumGetBox(DataLegendUnitsMode_$type, 0)], 'UnitsTextColor:aip:ahx', [Brush.$, null], 'UnitsTextMargin:ai6:ahy', [Thickness.$, new Thickness(1, 0, 0, 0, 0)], 'UnitsText:afq:ahz', [2, null], 'UseInterpolation:acj:ah0', [0, false], 'ValueFormatAbbreviation:aa2:ah1', [DataAbbreviationMode_$type, enumGetBox(DataAbbreviationMode_$type, 0)], 'ValueFormatCulture:afx:ah2', [2, stringEmpty()], 'ValueFormatMaxFractions:adt:ah3', [1, -1], 'ValueFormatMinFractions:adu:ah4', [1, -1], 'ValueFormatMode:aa9:ah5', [DataLegendValueMode_$type, enumGetBox(DataLegendValueMode_$type, 0)], 'ValueFormatSpecifiers:aaz:ah6', [Array_$type, null], 'ValueFormatString:af3:ah7', [2, null], 'ValueFormatUseGrouping:ack:ah8', [0, true], 'ValueRowMargin:ai7:ah9', [Thickness.$, new Thickness(0, 5)], 'ValueRowVisible:acl:aia', [0, true], 'ValueTextColor:aiq:aib', [Brush.$, null], 'ValueTextMargin:ai8:aic', [Thickness.$, new Thickness(1, 2, 0, 2, 0)], 'ValueTextUseSeriesColors:acm:aid', [0, false], 'ValueTextWhenMissingData:agc:aie', [2, "N/A"]]);
    return DataToolTipLayer;
}(AnnotationLayer));
export { DataToolTipLayer };
/**
 * @hidden
 */
var DataToolTipLayerView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataToolTipLayerView, _super);
    function DataToolTipLayerView(a) {
        var _this = _super.call(this, a) || this;
        _this.cp = null;
        _this.cs = null;
        _this.cn = null;
        _this.cq = false;
        _this._htmlTest = null;
        _this.cn = a;
        _this.htmlTest = /^[^<]*(<[\w\W]+>)[^>]*$/;
        _this.cs = new List$1(PointerTooltip.$, 0);
        return _this;
    }
    DataToolTipLayerView.prototype.c1 = function () {
        for (var a = 0; a < this.cs.count; a++) {
            var b = this.cs._inner[a];
            if (b.ai != null) {
                if (typeCast(XamDataLegend.$, b.ai) !== null) {
                    var c = b.ai;
                    c.flush();
                }
            }
        }
    };
    DataToolTipLayerView.prototype.as = function () {
        _super.prototype.as.call(this);
        for (var a = 0; a < this.cp.a.count; a++) {
            this.cp.a._inner[a].bv();
        }
        for (var b = 0; b < this.cp.b.count; b++) {
            this.cp.b._inner[b].bv();
        }
        this.cp.clear();
    };
    DataToolTipLayerView.prototype.ct = function () {
        var a = new PointerTooltip();
        a.b0(this.f.j8);
        a._visibility = 1;
        a.ap = this.f.dc.dw.k;
        var b = null;
        if (TypeRegistrar.isRegistered("XamDataLegend")) {
            b = TypeRegistrar.create("XamDataLegend");
        }
        b.pixelScalingRatio = 1;
        b.isEmbeddedInDataTooltip = true;
        if (this.f.dc != null) {
            var c = this.f.dc.dw.j.ae.createElement("div");
            var ren_ = this.f.dc.dw.j.ae.getSubRenderer(c);
            var len_ = b;
            len_.provideContainer(ren_);
        }
        a.ai = typeCast(IOnDemandRender_$type, b);
        a.ai.shouldOnDemandRender = true;
        this.cs.add(a);
        return a;
    };
    DataToolTipLayerView.prototype.cv = function (a) {
        var b = a;
    };
    DataToolTipLayerView.prototype.cx = function (a) {
        var b = a;
        b._visibility = 1;
    };
    DataToolTipLayerView.prototype.cw = function (a) {
        var b = a;
        b.b3();
        b.content = null;
        this.cs.remove1(a);
    };
    DataToolTipLayerView.prototype.a4 = function () {
        var _this = this;
        _super.prototype.a4.call(this);
        this.cp = ((function () {
            var $ret = new Pool$1(Base.$);
            $ret.create = runOn(_this, _this.ct);
            $ret.activate = runOn(_this, _this.cv);
            $ret.disactivate = runOn(_this, _this.cx);
            $ret.destroy = runOn(_this, _this.cw);
            return $ret;
        })());
    };
    Object.defineProperty(DataToolTipLayerView.prototype, "htmlTest", {
        get: function () {
            return this._htmlTest;
        },
        set: function (a) {
            this._htmlTest = a;
        },
        enumerable: false,
        configurable: true
    });
    DataToolTipLayerView.prototype.cr = function (a, b) {
        var c = a;
        var d = c.ai;
        return true;
    };
    DataToolTipLayerView.prototype.c7 = function (a) {
        var b = a;
        var c = new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY);
        b.c2 = 1;
        var d = b.c1(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
        b.c2 = 0;
        return d;
    };
    DataToolTipLayerView.prototype.c6 = function () {
        if (this.f.dc != null) {
            var a = this.f.dc.yk();
            var b = this.f.dc.dw.bb;
            var c = this.f.dc.dw.ba;
            return new Rect(0, 0, 0, b, c);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c5 = function () {
        if (this.f.dc != null) {
            var a = this.f.dc.yk();
            var b = this.f.dc.dw.bb;
            var c = this.f.dc.dw.ba;
            return new Rect(0, 0, 0, b, c);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c4 = function () {
        var a = 0;
        var b = 0;
        if (this.f.dc != null) {
            var c = this.f.dc.yk();
            a += c.x;
            b += c.y;
            var d = this.f.dc.dw.bb;
            var e = this.f.dc.dw.ba;
            return new Rect(0, a, b, d, e);
        }
        return Rect.empty;
    };
    DataToolTipLayerView.prototype.c3 = function (a) {
        var b = 0;
        var c = 0;
        if (this.f.dc != null) {
            var d = this.f.dc.yk();
            b += d.x;
            c += d.y;
        }
        return { $type: Point_$type, x: b + a.x, y: c + a.y };
    };
    DataToolTipLayerView.prototype.c0 = function (a, b, c, d, e) {
        var f = new PointerTooltipStyle();
        if (this.f.dc != null) {
            var g = this.f.dc.dw.j.i();
            PointerTooltipUtils.a(g, f, this.cn.ain, this.cn.aio, this.cn.acy, 0);
        }
        var h = a;
        if (h == null) {
            return;
        }
        if (d == 0 && e == 0) {
            h.c2 = 1;
        }
        else {
            h.c2 = 0;
        }
        h.aq = f;
        var i = h.an.n();
        h.cw = { $type: Point_$type, x: d * i, y: e * i };
        h._visibility = 0;
        h.n = b;
        h.o = c;
    };
    DataToolTipLayerView.prototype.c8 = function () {
        var a = (window.innerWidth);
        var b = (window.innerHeight);
        return new Size(1, a, b);
    };
    DataToolTipLayerView.prototype.cy = function (a) {
        if (a != null) {
            var b = a;
            b._visibility = 1;
        }
    };
    DataToolTipLayerView.prototype.c2 = function () {
        if (this.f.dc == null) {
            this.cz(true);
        }
    };
    DataToolTipLayerView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (b) {
            return;
        }
        var c = 0;
        var d = 0;
        var e = this.f.dc;
        if (e != null) {
            var f = e.dw.j.b8();
            c += f.x;
            d += f.y;
        }
        for (var g = 0; g < this.cs.count; g++) {
            this.cs._inner[g].b2(this.cs._inner[g].n + c, this.cs._inner[g].o + d);
        }
    };
    DataToolTipLayerView.prototype.ax = function (a) {
        _super.prototype.ax.call(this, a);
        for (var b = 0; b < this.cs.count; b++) {
            var c = this.cs._inner[b];
            var d = 0;
            var e = 0;
            if (this.f.dc != null) {
                var f = this.f.dc.yk();
                d += f.x;
                e += f.y;
            }
            var g = c.a9();
            var h = c.n - d;
            var i = c.o - e;
            var j = c.ai;
            var k = null;
            if (j != null) {
                k = j.exportVisualData();
            }
            this.f.bc.addPointerTooltipWithDataLegend(a, g, h, i, k);
        }
    };
    DataToolTipLayerView.prototype.co = function (a) {
        var b = a;
        var c = b.ai;
        return c;
    };
    DataToolTipLayerView.prototype.cz = function (a) {
        this.a2();
        for (var b = 0; b < this.cs.count; b++) {
            this.cy(this.cs._inner[b]);
            if (a) {
                this.cs._inner[b].bw();
            }
        }
    };
    DataToolTipLayerView.$t = markType(DataToolTipLayerView, 'DataToolTipLayerView', AnnotationLayerView.$);
    return DataToolTipLayerView;
}(AnnotationLayerView));
export { DataToolTipLayerView };