/*
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 { ISeriesInteractionManager_$type } from "./ISeriesInteractionManager";
import { Base, Point_$type, Nullable$1, String_$type, fromEnum, markType } from "igniteui-react-core/ES2015/type";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { SeriesView } from "./SeriesView";
import { ScalerParams } from "./ScalerParams";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { GeometryUtil } from "igniteui-react-core/ES2015/GeometryUtil";
import { PolygonUtil } from "igniteui-react-core/ES2015/PolygonUtil";
import { RectUtil } from "igniteui-react-core/ES2015/RectUtil";
import { BrushUtil } from "igniteui-react-core/ES2015/BrushUtil";
import { Color } from "igniteui-react-core/ES2015/Color";
import { truncate, isNaN_ } from "igniteui-react-core/ES2015/number";
import { boxArray$1 } from "igniteui-react-core/ES2015/array";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES2015/string";
export class SeriesInteractionManager extends Base {
    constructor() {
        super(...arguments);
        this.a = null;
        this.b = null;
        this.a$o = null;
        this.a$c = false;
        this.i = false;
        this.c = false;
        this.d = false;
        this.e = true;
        this.f = false;
        this._toolTipObject = null;
        this.p = null;
        this.s = null;
        this.o = null;
        this.j = false;
        this.k = new Dictionary$2(String_$type, SeriesView.$, 0);
    }
    a$i(a, b, c, d, e, f, g, h) {
        if (d == null) {
            return Number.POSITIVE_INFINITY;
        }
        if (c < 0 || c > g - 1) {
            return Number.POSITIVE_INFINITY;
        }
        let i;
        let j = NaN;
        let k = NaN;
        let l = NaN;
        let m = NaN;
        if (d.cc) {
            let n = d;
            i = h(b);
            let o = truncate(Math.floor(i));
            let p = truncate(Math.ceil(i));
            m = i - o;
            if (o >= 0 && o < g) {
                let q = n.i$d(n.i$b._inner[o]);
                j = d.dt(q, e) + f;
            }
            else {
                j = NaN;
            }
            if (p >= 0 && p < g) {
                let r = n.i$d(n.i$b._inner[p]);
                k = d.dt(r, e) + f;
            }
            else {
                k = NaN;
            }
            if (isNaN_(j) && !isNaN_(k)) {
                j = k;
            }
            if (isNaN_(k) && !isNaN_(j)) {
                k = j;
            }
            if (c >= 0 && c < g) {
                let s = n.i$d(n.i$b._inner[c]);
                l = d.dt(s, e) + f;
            }
        }
        else {
            i = a.d6(b);
            let t = truncate(Math.floor(i));
            let u = truncate(Math.ceil(i));
            m = i - t;
            if (t >= 0 && t < g) {
                j = d.dt(t, e) + f;
            }
            else {
                j = NaN;
            }
            if (u >= 0 && u < g) {
                k = d.dt(u, e) + f;
            }
            else {
                k = NaN;
            }
            if (isNaN_(j) && !isNaN_(k)) {
                j = k;
            }
            if (isNaN_(k) && !isNaN_(j)) {
                k = j;
            }
            if (c >= 0 && c < g) {
                l = d.dt(c, e) + f;
            }
        }
        let v = j + m * (k - j);
        return Math.abs(l - v);
    }
    a$k(a, b, c, d, e, f, g, h, i) {
        let j = NaN;
        if (d >= 0 && d < c.count) {
            j = c.item(d);
        }
        let k = NaN;
        if (e >= 0 && e < c.count) {
            k = c.item(e);
        }
        if (g == 0) {
            return k;
        }
        if (f == c.count - 1) {
            return j;
        }
        if (isNaN_(k) && h != 0 && b <= 0.5 && !i) {
            return j;
        }
        if (isNaN_(j) && h != 0 && b >= 0.5 && !i) {
            return k;
        }
        return j * (1 - b) + k * b;
    }
    a$a(a, b, c, d, e, f, g) {
        if (b == null) {
            return null;
        }
        let h = -1;
        let i = -1;
        if (b.cc) {
            let j = a.k4(f);
            let k = -1;
            let l = b.b8;
            let m = a.bi.bp.right * 2;
            k = SeriesInteractionManager.n(c, j, l, m);
            if (k < 0) {
                k = ~k;
                k--;
            }
            if (k < 0) {
                k = 0;
            }
            if (k > c.count - 1) {
                k = c.count - 1;
            }
            let n = k;
            let o = k + 1;
            if (o > c.count - 1) {
                o = c.count - 1;
            }
            h = n;
            i = o;
        }
        else {
            let p = a.e8(f, g);
            let q = a.e6(f, g);
            let r = truncate(Math.floor(p / d));
            let s = truncate(Math.floor(q / d));
            h = r - e;
            i = s - e;
            if (i == h) {
                i++;
            }
        }
        if (h < 0) {
            h = 0;
        }
        if (h > c.count - 1) {
            h = c.count - 1;
        }
        if (i < 0) {
            i = 0;
        }
        if (i > c.count - 1) {
            i = c.count - 1;
        }
        if (h < 0 || i < 0) {
            return null;
        }
        let t = c._inner[h];
        let u = c._inner[i];
        let v = new Array(2);
        v[0] = t;
        v[1] = u;
        return v;
    }
    static n(a, b, c, d) {
        let e = 0;
        let f = a.count - 1;
        while (e <= f) {
            let g = (e + ((f - e) >> 1));
            let h;
            let i = a.item(g);
            if (c) {
                h = (d - b.x) < (d - i[0]) ? -1 : ((d - b.x) > (d - i[0]) ? 1 : 0);
            }
            else {
                h = b.x < i[0] ? -1 : (b.x > i[0] ? 1 : 0);
            }
            if (h < 0) {
                f = g - 1;
            }
            else if (h > 0) {
                e = g + 1;
            }
            else {
                return g;
            }
        }
        return ~e;
    }
    a$n(a, b, c, d, e, f) {
        if (d == null) {
            return -1;
        }
        let g = d.cc;
        let h = a.ds;
        let i = null;
        if (g) {
            i = d;
        }
        let j = -1;
        let k = -1;
        let l = -1;
        if (g) {
            j = e(b);
            if (isNaN_(j)) {
                return -1;
            }
            k = truncate(Math.floor(j));
            l = truncate(Math.ceil(j));
        }
        else {
            j = a.d6(b);
            if (isNaN_(j)) {
                return -1;
            }
            k = truncate(Math.floor(j));
            l = truncate(Math.ceil(j));
        }
        if (f == null) {
            return -1;
        }
        if (k < 0 || k > f.count - 1) {
            return -1;
        }
        if (!c) {
            return k;
        }
        let m = NaN;
        if (g && !h) {
            if (k < i.i$b.count && i.i$b._inner[k] < f.count) {
                m = f.item(i.i$b._inner[k]);
            }
        }
        else {
            m = f.item(k);
        }
        while (isNaN_(m)) {
            k--;
            if (k < 0 || k > f.count - 1) {
                return -1;
            }
            if (g && !h) {
                m = f.item(i.i$b._inner[k]);
            }
            else {
                m = f.item(k);
            }
        }
        return k;
    }
    a$l(a, b, c, d, e, f, g, h, i) {
        if (b == null) {
            return NaN;
        }
        let j = a.ds;
        let k = a.e9(c, i, d, g, b);
        let l = a.e7(c, i, d, g, b);
        let m = a.d4(c, k, d, e, f);
        let n = a.d4(c, l, d, e, f);
        let o = k;
        let p = l;
        let q = d.cc;
        if (q && !j) {
            let r = d;
            if (k >= 0 && k < r.i$b.count) {
                k = r.i$b._inner[k];
            }
            if (l >= 0 && k < r.i$b.count) {
                l = r.i$b._inner[l];
            }
        }
        let s = m / (n + m);
        if (m == 0) {
            s = 0;
        }
        if (n == 0) {
            s = 1;
        }
        if (!h) {
            if (n <= m) {
                if (l >= 0 && l < b.count) {
                    return b.item(l);
                }
            }
            else {
                if (k >= 0 && k < b.count) {
                    return b.item(k);
                }
            }
            return NaN;
        }
        return a.ea(s, b, k, l, o, p, f, q);
    }
    a$d(a, b, c) {
        let d = a.ai(b);
        let e = a.ah(b);
        if (d == null) {
            return false;
        }
        for (let f = 0; f < d.length; f++) {
            let g = d[f];
            if (g == null || g.length != 2) {
                continue;
            }
            if (GeometryUtil.a(b, g[0], g[1], a.es / 2 + a.d9(c))) {
                return true;
            }
            if (e != null && f < e.length) {
                let h = e[f];
                if (h == null || h.length != 2) {
                    continue;
                }
                if (GeometryUtil.a(b, h[0], h[1], a.es / 2 + a.d9(c))) {
                    return true;
                }
                if (GeometryUtil.a(b, g[0], h[0], a.es / 2 + a.d9(c))) {
                    return true;
                }
                if (GeometryUtil.a(b, g[1], h[1], a.es / 2 + a.d9(c))) {
                    return true;
                }
                let i = new Array(5);
                i[0] = h[0];
                i[1] = h[1];
                i[2] = g[1];
                i[3] = g[0];
                i[4] = h[0];
                if (PolygonUtil.a(boxArray$1(i), b)) {
                    return true;
                }
            }
        }
        return false;
    }
    a$e(a, b, c, d) {
        if (d == null) {
            return false;
        }
        for (let e = 0; e < d.b.count; e++) {
            let f = d.b._inner[e];
            for (let g = 0; g < f._segments.count; g++) {
                let h = f._segments._inner[g];
                if (GeometryUtil.b(b, f._startPoint, h._points, a.d9(c))) {
                    return true;
                }
            }
        }
        return false;
    }
    a$f(a, b, c) {
        if (c.b.count > 0) {
            let d = c.b._inner[0];
            if (d._segments.count > 0) {
                let e = d._segments._inner[0];
                if (PolygonUtil.a(e._points, b)) {
                    return true;
                }
            }
        }
        return false;
    }
    a$m(a, b, c, d, e, f) {
        let g = a.ds;
        let h = d.cc;
        let i = null;
        if (h) {
            i = d;
        }
        let j = -1;
        let k = -1;
        let l = -1;
        if (h) {
            j = e(b);
            if (isNaN_(j)) {
                return -1;
            }
            k = truncate(Math.floor(j));
            l = truncate(Math.ceil(j));
        }
        else {
            j = a.d6(b);
            if (isNaN_(j)) {
                return -1;
            }
            k = truncate(Math.floor(j));
            l = truncate(Math.ceil(j));
        }
        if (f == null) {
            return -1;
        }
        if (l < 0 || l > f.count - 1) {
            return -1;
        }
        if (!c) {
            return l;
        }
        let m = NaN;
        if (h && !g) {
            if (l < i.i$b.count && i.i$b._inner[l] < f.count) {
                m = f.item(i.i$b._inner[l]);
            }
        }
        else {
            m = f.item(l);
        }
        while (isNaN_(m)) {
            l++;
            if (l < 0 || l > f.count - 1) {
                return -1;
            }
            if (h && !g) {
                m = f.item(i.i$b._inner[l]);
            }
            else {
                m = f.item(l);
            }
        }
        return l;
    }
    a$j(a, b, c) {
        let d = a.bi.bq;
        let e = a.bi.bp;
        if (d.isEmpty || e.isEmpty || c == null) {
            return -1;
        }
        let f = a.getEffectiveViewport1(a.bi);
        let g = null;
        if (c.cc) {
            g = c;
        }
        let h = new ScalerParams(0, d, e, c.b8, f);
        if (a.bs == null) {
            return -1;
        }
        h.c = a.getEffectiveViewport1(a.bi);
        let i = a.le(a.bi);
        let j = 0;
        if (c.ce) {
            let k = c.dw(i.top, h);
            let l = c.dw(i.bottom, h);
            let m = (b.y - d.top) / d.height;
            j = k + ((l - k) * m);
        }
        else {
            if (c.b3) {
                let n = c.dw(i.left, h);
                let o = c.dw(i.right, h);
                let p = (b.x - d.left) / d.width;
                j = n + ((o - n) * p);
            }
            else {
                let q = new Rect(0, 0, 0, 1, 1);
                j = c.dw(b.x, new ScalerParams(1, q, q, c.b8));
            }
        }
        if (c.b5) {
        }
        let r = g.i$c(j);
        return r;
    }
    a$g(a, b, c) {
        let d = a.lj(b);
        if (d.isEmpty) {
            return false;
        }
        let e = RectUtil.r(d, a.d9(c));
        return e.containsPoint(b);
    }
    a$aj(a, b, c, d, e, f, g, h, i, j) {
        if (f == null || g == null || a.bi == null || a.bi.bq.isEmpty || a.bi.bp.isEmpty) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        let k = a.getEffectiveViewport1(a.bi);
        let l = new ScalerParams(0, a.bi.bq, a.bi.bp, f.b8, k);
        l.c = a.getEffectiveViewport1(a.bi);
        let m = a.bi;
        let n;
        if (g.ce) {
            n = b.y;
            n = m.bp.top + m.bp.height * (n - m.bq.top) / m.bq.height;
        }
        else {
            n = b.x;
            n = m.bp.left + m.bp.width * (n - m.bq.left) / m.bq.width;
        }
        if (!c && g != null) {
            let o;
            let p;
            if (i != null) {
                o = i(b, d);
            }
            else {
                o = a.e8(b, d);
            }
            if (j != null) {
                p = j(b, d);
            }
            else {
                p = a.e6(b, d);
            }
            let q = new ScalerParams(0, m.bq, m.bp, g.b8, k);
            q.c = a.bs.mx;
            let r = a.d4(b, o, g, q, e);
            let s = a.d4(b, p, g, q, e);
            let t = p;
            let u = o;
            if (g.cc) {
                let v = g;
                if (t >= 0 && t < v.i$b.count) {
                    t = v.i$d(v.i$b._inner[truncate(t)]);
                }
                if (u >= 0 && u < v.i$b.count) {
                    u = v.i$d(v.i$b._inner[truncate(u)]);
                }
            }
            if ((s + r) != 0) {
                let w = s / (r + s);
                if (Math.abs(w - 0.5) < 1E-07) {
                    s = r;
                }
            }
            if (s <= r) {
                n = g.dt(t, q) + e;
            }
            else {
                n = g.dt(u, q) + e;
            }
        }
        else {
            if (g.b2 && !g.b5 && g.categoryMode != 0) {
                let x = 0.5 * g.getCategorySize(m.bq, m.bp, a.getEffectiveViewport1(m));
                if (a.isVertical) {
                    x = x * -1;
                }
                if (g.b8) {
                    x = x * -1;
                }
                n -= x;
                n += e;
            }
        }
        let y;
        if (h != null) {
            y = h(b, c, d);
        }
        else {
            y = a.eh(b, c, d);
        }
        let z = f.dt(y, l);
        if (g.ce) {
            return { $type: Point_$type, x: z, y: n };
        }
        else {
            return { $type: Point_$type, x: n, y: z };
        }
    }
    a$t(a, b, c, d, e) {
        if (a.bs.c2() && !e) {
            return;
        }
        if (!a.b9) {
            return;
        }
        if (a.bs == null) {
            return;
        }
        let f = null;
        let g = null;
        let h = a.bs.az;
        let i = a.bs.bl;
        if (e && this.a != null) {
            f = this.a;
        }
        else {
            f = a.at(b, c);
            if (this.a != null && this.a != f) {
                if (a.bs != null) {
                    h.endHighlight(this.a);
                }
            }
            this.a = f;
        }
        if (a.hasMarkers) {
            if (e && this.b != null) {
                g = this.b;
            }
            else {
                g = a.au(b, c);
                if (this.b != null && this.b != g) {
                    h.endHighlight(this.b);
                }
                this.b = g;
            }
        }
        let j = true;
        if (e) {
            h.endHighlight(f);
            if (g != null) {
                h.endHighlight(g);
            }
        }
        else {
            if (d || !j) {
                h.startHighlight(f);
                if (g != null) {
                    h.startHighlight(g);
                }
            }
        }
        if (!i.f() && i.r > 0) {
            i.v();
        }
        if (i.r == 0) {
            a.bs.j9(1);
        }
    }
    a$ai(a, b, c) {
        let d = b.d;
        d = d * 0.5;
        return this.r(c, d);
    }
    r(a, b) {
        if (a == null) {
            return a;
        }
        return BrushUtil.h(a, b);
    }
    a$w(a, b, c, d) {
        let e = a.bi;
        e.aj();
        this.a$c = true;
        let f = a.fm(c, b);
        this.a$o = f;
        if (a.bs != null && !a.aq.c) {
            this.q(a, b, f, d);
        }
        this.c = false;
        if (a.c8 && f == null) {
            this.c = true;
        }
        if (a.bs != null && !this.c) {
            if (a.c8) {
                this.d = true;
            }
            this.a$t(a, f, a.lc(b), true, false);
            a.bs.ip(a, f, d);
        }
    }
    a$ag(a, b) {
        let c = null;
        let d = null;
        let e;
        let f = ((() => { let g = a.bs.bk.e(b, false, e, false); e = g.p2; return g.ret; })());
        if (f != a) {
            if (this.a$c) {
                this.a$x(a, b, null, null);
            }
            return;
        }
        c = e;
        if (!this.a$c) {
            this.a$w(a, b, c, d);
        }
        this.a$z(a, b, c, d);
    }
    a$z(a, b, c, d) {
        this.a$c = true;
        let e = a.fm(c, b);
        this.q(a, b, e, d);
        if (e != null) {
            this.a$o = e;
        }
        if (a.bs != null && e != null && this.c) {
            this.c = false;
            this.d = true;
            this.a$t(a, e, a.lc(b), true, false);
            a.bs.ip(a, e, d);
        }
        if (a.bs != null && (!a.c8 || e != null) && !this.c) {
            this.a$t(a, e, a.lc(b), true, false);
            a.bs.it(a, e, d);
        }
        if (e == null && !this.c && a.c8) {
            this.a$t(a, e, a.lc(b), false, true);
            a.bs.iq(a, this.a$o, d);
            this.d = false;
            this.c = true;
        }
    }
    a$x(a, b, c, d) {
        a.bi.ak();
        this.a$c = false;
        let e = this.a$o;
        a.bi.am();
        if (a.bs != null && (this.d || !a.c8)) {
            this.d = false;
            this.c = false;
            this.a$t(a, e, a.lc(b), false, true);
            a.bs.iq(a, e, d);
        }
    }
    a$u(a, b, c, d) {
        this.i = true;
        if (a.bs != null) {
            a.bs.ir(a, a.fm(c, b), d);
        }
    }
    a$y(a, b, c, d) {
        this.i = false;
        if (a.bs != null && this.a$c) {
            a.bs.is(a, a.fm(c, b), d);
        }
    }
    a$v(a, b, c, d) {
        if (a.bi.p) {
            return;
        }
        if (this.i) {
            this.a$y(a, b, c, d);
        }
        if (this.a$c) {
            this.a$x(a, b, c, d);
        }
    }
    a$aa(a, b, c, d) {
        if (a.bs != null) {
            a.bs.iu(a, a.fm(c, b), d);
        }
    }
    a$ab(a, b, c, d) {
        if (a.bs != null) {
            a.bs.iv(a, a.fm(c, b), d);
        }
    }
    get g() {
        return this.c;
    }
    set g(a) {
        this.c = a;
    }
    get a$b() {
        return this.d;
    }
    set a$b(a) {
        this.d = a;
    }
    q(a, b, c, d) {
        let e = false;
        if (a.bs != null) {
            e = a.bs.co;
        }
        if (e) {
            return;
        }
        if (a.bs == null || a.bs.ch) {
            return;
        }
        this.j = true;
        this.s = b;
        this.o = c;
        a.bi.d.item = c;
        let f = a.bs.md();
        let pos_ = { $type: Point_$type, x: b.x + 15 + f.x, y: b.y + 15 + f.y };
        let context_ = a.bi.d;
        if (this._toolTipObject != null) {
            if (this.f) {
                this.f = false;
                this._toolTipObject.remove();
                this._toolTipObject.setStyleProperty("position", "absolute");
                this._toolTipObject.addClass(a.bs.gw);
                a.bs.g6(this._toolTipObject);
                this._toolTipObject.hide();
            }
            if (this.e) {
                a.bs.g6(this._toolTipObject);
                this.e = false;
            }
            context_.hideOthers = true;
            if ((this._toolTipObject.updateToolTip && !this._toolTipObject.updateToolTip(context_))) {
                this.a$s(a);
            }
            let g = window.pageXOffset;
            let h = window.pageYOffset;
            let i = document.documentElement.clientWidth;
            let j = document.documentElement.clientHeight;
            let k = this._toolTipObject.outerWidthWithMargin();
            let l = this._toolTipObject.outerHeightWithMargin();
            let m = pos_.x;
            let n = pos_.y;
            if (k + m - g > i) {
                let o = i - k + g;
                pos_.x = o;
            }
            if (l + n - h > j) {
                let p = j - l + h;
                pos_.y = p;
            }
            this._toolTipObject.setOffset(pos_.x, pos_.y);
        }
    }
    a$af(a, b, c) {
        this.j = true;
        let d = { $type: Point_$type, x: b.x + a.bi.bp.left, y: b.y + a.bi.bp.top };
        let e = a.fm(null, d);
        if (a.bi.d != null) {
            a.bi.d.series = a;
            a.bi.d.item = e;
        }
        let tooltip_ = this._toolTipObject;
        let context_ = a.bi.d;
        if (context_ != null) {
            context_.hideOthers = false;
        }
        if (!this.f && tooltip_ != null) {
            this.f = true;
            tooltip_.remove();
            tooltip_.setStyleProperty("position", "relative");
            tooltip_.setStyleProperty("top", "");
            tooltip_.setStyleProperty("left", "");
            tooltip_.removeClass(a.bs.gw);
        }
        if (this._toolTipObject != null) {
            if (tooltip_.updateToolTip) {
                tooltip_.updateToolTip(context_);
            }
            ;
        }
        if (tooltip_ != null) {
            c(tooltip_);
        }
    }
    a$p(a) {
        let b = "<div class='ui-chart-default-tooltip-content'><span";
        let c = this.a$q(a);
        if (!stringIsNullOrEmpty(c)) {
            b += " style='color:" + c + "'";
        }
        b += ">" + a.fo + "</span></div>";
        return b;
    }
    h(a, b) {
        let c = a != null && Color.e(Nullable$1.toNullable(Color.$, a.color), Nullable$1.toNullable(Color.$, null));
        c = c && a.color.l > 0;
        c = c && Color.d(a.color, b);
        return !c;
    }
    a$q(a) {
        let b = new Color();
        let c = a != null && a.bs != null && a.bs.bk != null && a.bs.bk.i != null ? a.bs.bk.i.af : null;
        c.startCSSQuery();
        b.colorString = c.getCssDefaultPropertyValue("ui-chart-pointer-tooltip", "background-color");
        c.endCSSQuery();
        if (!this.h(a.ks, b)) {
            return a.ks._fill;
        }
        if (!this.h(a.kr, b)) {
            return a.kr._fill;
        }
        return null;
    }
    a$s(a) {
        if (this._toolTipObject != null && this.j) {
            this.j = false;
            let context_ = a.bi.d;
            if (this._toolTipObject.hideToolTip) {
                this._toolTipObject.hideToolTip(context_);
            }
            ;
        }
    }
    a$ah(a, b) {
        let c = this._toolTipObject;
        this.p = null;
        this._toolTipObject = null;
        if (typeof b === 'string') {
            this.p = b;
        }
        else {
            this._toolTipObject = b;
            if (this._toolTipObject != null) {
                this._toolTipObject.setStyleProperty("position", "absolute");
                this._toolTipObject.setStyleProperty("top", "0px");
                this._toolTipObject.setStyleProperty("left", "0px");
                this._toolTipObject.setStyleProperty("z-index", "10000");
                let d = a.ks != null && Color.e(Nullable$1.toNullable(Color.$, a.ks.color), Nullable$1.toNullable(Color.$, null)) && a.ks.color.l > 0;
                if (d) {
                    this._toolTipObject.setStyleProperty("border-color", a.ks._fill);
                }
            }
            else {
                if (!this.e && c != null) {
                    a.bs.ju(c);
                    this.e = true;
                }
            }
        }
    }
    a$ae(a) {
    }
    get a$h() {
        return this.k;
    }
    a$r(a, b, c, d, e) {
        let f;
        if (!((() => { let g = this.k.tryGetValue(d, f); f = g.p1; return g.ret; })())) {
            f = a.bg();
            f.n = true;
            f.m = true;
            if (a.bs != null) {
                f.a = a.bs.ag;
                a.bs.ag.l(f);
            }
            f.ap();
            f.aa = d;
            this.k.item(d, f);
        }
        f.s = e;
        f.bp = b;
        f.bo = c;
    }
    a$ad(a, b, c) {
        let d;
        let e = c;
        if (e == null) {
            e = a.bs;
        }
        if (((() => { let f = this.k.tryGetValue(b, d); d = f.p1; return f.ret; })())) {
            if (e != null) {
                d.a = null;
                e.ag.r(d);
            }
            this.k.removeItem(b);
        }
    }
    a$ac(a, b) {
        let c = new List$1(String_$type, 0);
        for (let d of fromEnum(this.k.keys)) {
            c.add(d);
        }
        for (let e = 0; e < c.count; e++) {
            this.a$ad(a, c._inner[e], b);
        }
    }
}
SeriesInteractionManager.$t = markType(SeriesInteractionManager, 'SeriesInteractionManager', Base.$, [ISeriesInteractionManager_$type]);
