/*
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 { Base, Point_$type, runOn, fromEnum, markType, PointUtil } from "igniteui-react-core";
import { ISeriesViewerInteractionManager_$type } from "./ISeriesViewerInteractionManager";
import { HighlightingManager } from "./HighlightingManager";
import { Rect } from "igniteui-react-core";
import { TileZoomManager } from "./TileZoomManager";
import { Size } from "igniteui-react-core";
import { MathUtil } from "igniteui-react-core";
import { MouseEventArgs } from "igniteui-react-core";
import { MouseButtonEventArgs } from "igniteui-react-core";
import { truncate, intDivide, isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
export let SeriesViewerInteractionManager = /*@__PURE__*/ (() => {
    class SeriesViewerInteractionManager extends Base {
        constructor() {
            super();
            this.r = 0;
            this.s = 0;
            this.af = null;
            this.o = 0;
            this.p = 0;
            this.n = 0;
            this.q = 0;
            this.h = false;
            this.ag = null;
            this.ai = null;
            this.j = false;
            this.e = null;
            this.b = null;
            this.ah = null;
            this.aj = null;
            this.d = null;
            this.a = null;
            this.g = false;
            this.ah = Rect.empty;
            this.ag = Rect.empty;
        }
        get f$b() {
            if (this.b == null) {
                this.b = new HighlightingManager();
            }
            return this.b;
        }
        f$am(a, b) {
            let c = null;
            let d = null;
            let e = null;
            e = a.b8.e();
            let f;
            let g = ((() => { let h = a.b8.f(b, false, f, false); f = h.p2; return h.ret; })());
            if (g != e) {
                if (e.a3.a$c) {
                    e.a3.a$z(e, b, null, null, false);
                }
            }
            c = f;
            if (a != null) {
                a.lw(b);
            }
            if (g != null && !g.a3.a$c) {
                g.a3.a$y(g, b, c, d, false);
            }
        }
        f$a(a) {
            if (a.ap != 0) {
                return a.ap;
            }
            let b = 1;
            let c = false;
            let d = false;
            for (let e = 0; e < a.series.count; e++) {
                let f = a.series._inner[e];
                if (f.isStacked) {
                    f.jy((g) => {
                        if (g.bi == 2) {
                            c = true;
                        }
                        if (g.bi == 1) {
                            d = true;
                        }
                        return true;
                    });
                }
                else {
                    if (f.bi == 2) {
                        c = true;
                    }
                    if (f.bi == 1) {
                        d = true;
                    }
                }
            }
            if (d) {
                b = 1;
            }
            if (c) {
                b = 2;
            }
            if (c && d) {
                b = 3;
            }
            return b;
        }
        f$al(a) {
            let b = a.ok;
            let c = b;
            let d = a.b8;
            let e = a.c2();
            let f = a.c4;
            let g = a.d6;
            let h = a.ee;
            if (!e) {
                c = { $type: Point_$type, x: NaN, y: NaN };
            }
            if (c.x < 0 || c.x > 1 || c.y < 0 || c.y > 1) {
                c = { $type: Point_$type, x: NaN, y: NaN };
            }
            for (let i = 0; i < a.series.count; i++) {
                let j = a.series._inner[i];
                j.j3(c);
            }
            let k = a.bz == 0 && !a.dh && (a.c7 || f) && !g && !h;
            let l = a.o7;
            if (k && !isNaN_(b.x) && !l.isEmpty) {
                let m = l.width * (b.x - a.os.left) / a.os.width;
                d.el(l.left + m, l.top, l.left + m, l.bottom);
                d.ea();
                d.ef(m);
            }
            else {
                d.ci();
            }
            if (k && !isNaN_(b.y) && !l.isEmpty) {
                let n = l.height * (b.y - a.os.top) / a.os.height;
                d.ee(l.left, l.top + n, l.right, l.top + n);
                d.d6();
            }
            else {
                d.cd();
            }
        }
        f$ae(a) {
            switch (a.bz) {
                case 0:
                    a.b8.d2();
                    this.f$al(a);
                    a.b8.ca();
                    break;
                case 1:
                    a.b8.d4();
                    a.b8.ch();
                    this.f$al(a);
                    a.b8.b9();
                    break;
                case 2:
                    a.b8.d4();
                    a.b8.ch();
                    this.f$al(a);
                    a.b8.cb();
                    break;
            }
        }
        f$p(a, b) {
            if (b.x >= 0 && b.y >= 0 && b.x <= a.o7.width && b.y <= a.o7.height) {
                this.ab(a, b);
            }
            else {
                a.i3();
            }
        }
        ab(a, b) {
            let c = a.b8;
            let d = a.o7;
            if (a.di || a.dh) {
                return;
            }
            if (a.c4 && a.c7) {
                let e = d.height > d.width;
                c.bv(e);
                for (let f of fromEnum(a.series)) {
                    if (f.isStacked) {
                        f.jy((g) => {
                            if (g._visibility == 0) {
                                g.k9(b, runOn(c, c.bm));
                            }
                            return true;
                        });
                    }
                    else {
                        if (f._visibility == 0) {
                            f.k9(b, runOn(c, c.bm));
                        }
                    }
                }
                c.d7();
            }
        }
        aa(a, b) {
            if (a.c7 || a.df) {
                a.c4 = true;
                a.kt();
                this.ag = new Rect(0, b.x, b.y, 0, 0);
                this.ai = new Rect(0, b.x, b.y, 0, 0);
                a.bz = 0;
                a.iu(a.om(b));
            }
        }
        f$ac(a, b) {
            this.aa(a, b);
            this.ab(a, b);
            this.f$al(a);
        }
        f$q(a, b, c) {
            if (!a.c4) {
                this.ad(a, b, c);
            }
        }
        f$o(a, b) {
            this.ah = Rect.empty;
            a.i3();
        }
        f$aj(a) {
            let b = a.b8;
            this.q = 1;
            a.c4 = false;
            b.cg();
            b.cc();
            b.ce();
            a.iu({ $type: Point_$type, x: NaN, y: NaN });
            b.cd();
            b.ci();
            b.ch();
            a.bz = 0;
            this.h = true;
            a.d6 = true;
            a.ku();
        }
        f$ab(a, b) {
            this.f$aj(a);
        }
        f$ak(a, b, c, d, e) {
            this.r = b.x;
            this.s = b.y;
            this.o = c;
            this.p = d;
            this.n = e;
            this.af = a.os;
            this.f$aj(a);
        }
        f$aa(a, b) {
            let c = a.b8;
            c.cd();
            c.ci();
            if (c.av) {
                this.w(a, b);
            }
            else {
                this.y(a, b);
                this.q = b;
            }
        }
        f$ag(a, b, c, d, e) {
            let f = a.b8;
            f.cd();
            f.ci();
            this.o = this.o * c;
            this.p = this.p * d;
            this.n = this.n * e;
            if (a.dp) {
                this.o = this.n;
                this.p = this.n;
            }
            let g = a.os;
            let h = a.o7;
            let i = b.x - this.r;
            let j = b.y - this.s;
            this.r = b.x;
            this.s = b.y;
            let k = g.width;
            let l = g.height;
            let m = this.af.width / this.o;
            let n = this.af.height / this.p;
            if (m > 1) {
                m = 1;
            }
            if (n > 1) {
                n = 1;
            }
            let o = { $type: Point_$type, x: b.x, y: b.y };
            let p = { $type: Point_$type, x: (o.x - h.left) / h.width * g.width + g.left, y: (o.y - h.top) / h.height * g.height + g.top };
            let q = new Rect(0, g.left, g.top, m, n);
            let r = { $type: Point_$type, x: (p.x - q.left) / q.width * h.width + h.left, y: (p.y - q.top) / q.height * h.height + h.top };
            let s = (r.x - o.x) - i;
            let t = (r.y - o.y) - j;
            let u = s / h.width * q.width;
            let v = t / h.height * q.height;
            q = new Rect(0, q.left + u, q.top + v, q.width, q.height);
            g = q;
            a.mc(g, true);
        }
        f$x(a, b) {
            this.ag = new Rect(0, b.x, b.y, 0, 0);
            this.ai = new Rect(0, b.x, b.y, 0, 0);
        }
        x(a, b, c) {
            let d = a.os.width;
            let e = a.os.height;
            let f = a.os.left + d / 2;
            let g = a.os.top + e / 2;
            d = d / b;
            e = e / b;
            let h = f - d / 2;
            let i = g - e / 2;
            a.mc(new Rect(0, h, i, d, e), true);
        }
        f$z(a, b) {
            let c = a.b8;
            if (c.av) {
                this.w(a, b);
            }
            else {
                this.y(a, b);
            }
            this.ag = Rect.empty;
            a.d6 = false;
        }
        f$r(a, b) {
            a.d6 = false;
            this.ag = Rect.empty;
            a.i3();
        }
        f$af(a, b, c, d, e) {
            a.d6 = false;
            this.ag = Rect.empty;
            a.i3();
        }
        w(a, b) {
            let c = a.o8;
            let d = 1 / b;
            let e = { $type: Point_$type, x: c.x + c.width / 2, y: c.y + c.height / 2 };
            let f = { $type: Point_$type, x: c.x - e.x, y: c.y - e.y };
            let g = new Rect(0, f.x * d + e.x, f.y * d + e.y, c.width * d, c.height * d);
            a.mc(g, true);
        }
        y(a, b) {
            let c = a.o7;
            let d = a.o8;
            let e = b - this.q;
            if (e != 0) {
                let f = 0.03;
                let g = e < 0 ? 1 + f : 1 - f;
                let h = { $type: Point_$type, x: d.x + d.width / 2, y: d.y + d.height / 2 };
                let i = { $type: Point_$type, x: d.x - h.x, y: d.y - h.y };
                let j = new Rect(0, i.x * g + h.x, i.y * g + h.y, d.width * g, d.height * g);
                a.mc(j, true);
            }
        }
        f$m(a, b, c) {
            if (!a.d6) {
                this.h = false;
            }
            this.ad(a, b, c);
            a.ke(b, c);
        }
        ad(a, b, c) {
            let d;
            let e = a.b8;
            let f = a.bx(c);
            if (e.ew == 0) {
                switch (f) {
                    case 1:
                        d = a.dw() ? f : 0;
                        break;
                    default:
                        d = f;
                        break;
                }
            }
            else {
                if (e.ew == a.n0) {
                    d = 1;
                }
                else if (e.ew == a.n1) {
                    d = 2;
                }
                else {
                    d = 0;
                }
            }
            switch (d) {
                case 1:
                case 2:
                    a.b8.b7();
                    a.b8.dn();
                    break;
            }
            a.bz = d;
            switch (a.bz) {
                case 1:
                    a.iu({ $type: Point_$type, x: NaN, y: NaN });
                    this.ag = new Rect(0, b.x, b.y, 0, 0);
                    this.ai = new Rect(0, b.x, b.y, 0, 0);
                    this.ah = new Rect(0, b.x, b.y, 0, 0);
                    e.d5();
                    e.ed(this.ag);
                    a.kz(Rect.empty, true);
                    break;
                case 2:
                    this.ag = new Rect(0, b.x, b.y, 0, 0);
                    this.ah = new Rect(0, b.x, b.y, 0, 0);
                    break;
            }
            this.aj = a.os;
            a.o9 = a.os;
        }
        f$ai(a) {
            a.lx();
            a.b8.di();
        }
        f$ah(a) {
            a.iy();
            a.b8.dh();
        }
        f$an(a) {
            if (a.c1 && !this.j) {
                this.j = true;
                this.ac(a);
            }
        }
        f$j(a) {
            if (this.j) {
                this.z(a);
                this.j = false;
            }
        }
        f$g(a) {
            if (this.e == null) {
                return;
            }
            this.f.ab();
        }
        get f() {
            return this.e;
        }
        ac(a) {
            if (this.e == null) {
                this.e = new TileZoomManager(a, true, a.f1);
                this.e.h = !a.d7;
            }
            a.de = true;
            a.ky();
            this.e.al();
            a.b8.br();
            a.b8.bs();
        }
        z(a) {
            if (this.e == null) {
                return;
            }
            a.de = false;
            a.b8.dd();
            this.e.ah();
            a.lh();
            a.b8.by();
        }
        f$i(a) {
            a.is();
            a.lj();
        }
        l(a) {
            return a.bz == 2;
        }
        m(a, b) {
            return a.bp == 1 || b || a.c1;
        }
        k(a) {
            return a.bz == 1;
        }
        f$l(a, b, c) {
            let d = a.b8;
            if (this.ag.isEmpty && c) {
                this.ad(a, b, c);
            }
            let e = 2;
            if (c) {
                e = 10;
            }
            let f = false;
            let g = new Rect(2, { $type: Point_$type, x: this.ag.x, y: this.ag.y }, b);
            let h = new Rect(0, 0, 0, 0, 0);
            if (!this.ah.isEmpty) {
                h = new Rect(2, { $type: Point_$type, x: this.ah.x, y: this.ah.y }, b);
            }
            if (h.width > e && h.height > e) {
                f = true;
            }
            if (!a.d6) {
                if (f) {
                    this.h = false;
                }
            }
            if (!a.d6 && (a.c4 || !c)) {
                a.iu(a.om(b));
            }
            if (this.k(a)) {
                if (f) {
                    let i = a.o6(g);
                    a.kz(i, true);
                }
                else {
                    a.kz(Rect.empty, true);
                }
                a.jo();
                d.ed(g);
            }
            let j = a.o7;
            let k = a.os;
            if (this.l(a)) {
                let l = j;
                let m = k.left + k.width * (this.ag.x - b.x) / l.width;
                let n = k.top + k.height * (this.ag.y - b.y) / l.height;
                let o = new Rect(0, m, n, k.width, k.height);
                if (this.m(a, c)) {
                    if (h.width != 0 || h.height != 0) {
                        a.ku();
                    }
                    a.kz(Rect.empty, true);
                    a.mc(o, true);
                    this.ag = new Rect(3, b, new Size(1, 0, 0));
                    this.ai = new Rect(3, b, new Size(1, 0, 0));
                }
                else {
                    a.kz(o, true);
                }
            }
            this.ai = new Rect(3, b, new Size(1, 0, 0));
            d.bu(b);
        }
        f$k(a, b, c, d) {
            let e = a.b8;
            let f = 2;
            if (c) {
                f = 10;
            }
            let g = a.o7;
            let h = a.os;
            if (!this.h) {
                let i = false;
                let j = new Rect(2, { $type: Point_$type, x: this.ag.x, y: this.ag.y }, b);
                if (j.width > f && j.height > f) {
                    i = true;
                }
                if (a.bz == 1) {
                    a.jn();
                    e.cc();
                    if (i) {
                        a.mc(a.o6(j), true);
                    }
                }
                if (a.bz == 2) {
                    let k = g;
                    let l = h.left + h.width * (this.ag.x - b.x) / k.width;
                    let m = h.top + h.height * (this.ag.y - b.y) / k.height;
                    a.mc(new Rect(0, l, m, h.width, h.height), true);
                }
            }
            let n = false;
            let o = new Rect(2, { $type: Point_$type, x: this.ah.x, y: this.ah.y }, b);
            if (o.width > f || o.height > f) {
                n = true;
            }
            if (n) {
                a.ee = true;
            }
            a.bz = 0;
            a.kz(Rect.empty, true);
            e.bw();
            a.ee = false;
            e.cd();
            e.ci();
            if (c) {
                e.ch();
                e.cd();
                e.ci();
                e.ce();
            }
            a.i3();
            a.kt();
            a.kf(b, c, d);
        }
        f$ad(a) {
            if (this.f != null) {
                this.f.h = !a.d7;
            }
        }
        f$d(a, b) {
            let c = a.b8;
            let d = a.os;
            if (a.bz == 2 && b == 8) {
                c.bt();
                a.bz = 0;
                a.kt();
                a.kz(Rect.empty, true);
                if (a.bp == 1) {
                    a.mc(this.aj, true);
                }
                return true;
            }
            if (a.bz == 1 && b == 8) {
                c.bt();
                a.bz = 0;
                a.kt();
                c.cc();
                a.kz(Rect.empty, true);
                return true;
            }
            let e = Rect.empty;
            let f = false;
            switch (b) {
                case 13:
                    f = true;
                    e = new Rect(0, 0, 0, 1, 1);
                    break;
                case 11:
                    f = true;
                    e = new Rect(0, d.left - 0.1 * d.width, d.top - 0.1 * d.height, 1.2 * d.width, 1.2 * d.height);
                    break;
                case 10:
                    f = true;
                    e = new Rect(0, d.left + 0.1 * d.width, d.top + 0.1 * d.height, 0.8 * d.width, 0.8 * d.height);
                    break;
                case 14:
                    f = true;
                    e = new Rect(0, d.left - 0.1 * d.width, d.top, d.width, d.height);
                    e.x = e.x - Math.min(e.left, 0);
                    break;
                case 16:
                    f = true;
                    e = new Rect(0, d.left + 0.1 * d.width, d.top, d.width, d.height);
                    e.x = e.x - Math.max(e.right - 1, 0);
                    break;
                case 15:
                    f = true;
                    e = new Rect(0, d.left, d.top - 0.1 * d.height, d.width, d.height);
                    e.y = e.y - Math.min(e.top, 0);
                    break;
                case 17:
                    f = true;
                    e = new Rect(0, d.left, d.top + 0.1 * d.height, d.width, d.height);
                    e.y = e.y - Math.max(e.bottom - 1, 0);
                    break;
            }
            if (!e.isEmpty && Rect.l_op_Inequality(e, d)) {
                a.mc(e, true);
            }
            return f;
        }
        f$e(a, b, c) {
            let d = a.b8;
            let e = a.os;
            let f = e.left + e.width * b.x / a.o7.width;
            let g = e.top + e.height * b.y / a.o7.height;
            let h = 1 - MathUtil.b(c, -0.5, 0.5);
            let i = Math.max(0, f - h * (f - e.left));
            let j = Math.min(1, g + h * (e.bottom - g));
            let k = Math.min(1, f + h * (e.right - f));
            let l = Math.max(0, g - h * (g - e.top));
            a.ku();
            this.v(a, 1000);
            a.mc(new Rect(0, i, l, k - i, j - l), true);
            return a.dw();
        }
        v(a, b) {
            a.b8.bz(b);
        }
        f$n(a, b) {
            let c = a.os;
            let d = c.left + c.width * b.x / a.o7.width;
            let e = c.top + c.height * b.y / a.o7.height;
            let f = 0.7;
            let g = Math.max(0, d - f * (d - c.left));
            let h = Math.min(1, e + f * (c.bottom - e));
            let i = Math.min(1, d + f * (c.right - d));
            let j = Math.max(0, e - f * (e - c.top));
            a.mc(new Rect(0, g, j, i - g, h - j), true);
        }
        f$h(a) {
            this.f.ac();
        }
        f$c(a, b, c, d, e, f, g) {
            let h = true;
            let i = false;
            let j = false;
            let k = a;
            if (k.ao == 1) {
                h = false;
                i = true;
            }
            if (k.ao == 3 || k.ao == 4) {
                i = true;
            }
            if (k.ao == 4) {
                j = true;
            }
            let l = truncate(Math.round(d.x));
            let m = truncate(Math.round(d.y));
            f = null;
            let n = -1;
            if (h && c != null) {
                let o = l;
                let p = m;
                if (a.e8 != 1) {
                    o = truncate(Math.round(d.x * a.e8));
                    p = truncate(Math.round(d.y * a.e8));
                }
                let q = c.a(o, p);
                if (q == null || q.length == 0) {
                    f = null;
                    return {
                        ret: null,
                        p5: f
                    };
                }
                if ((q[0] > 0 || q[1] > 0 || q[2] > 0) && q[3] == 255) {
                    let num2_ = q[2];
                    if (num2_ % 4 != 0) {
                        num2_ = num2_ + (4 - (num2_ % 4));
                    }
                    let num1_ = q[1];
                    if (num1_ % 4 != 0) {
                        num1_ = num1_ + (4 - (num1_ % 4));
                    }
                    let num0_ = q[0];
                    if (num0_ % 4 != 0) {
                        num0_ = num0_ + (4 - (num0_ % 4));
                    }
                    let num_ = 0;
                    num_ = (num2_ >> 2);
                    num_ = (num_ << 6);
                    num_ = (num_ | (num1_ >> 2));
                    num_ = (num_ << 6);
                    num_ = (num_ | (num0_ >> 2));
                    n = truncate(Math.floor((intDivide(num_, 1000))));
                    n--;
                }
            }
            let r = null;
            let s = -1;
            if (n >= 0) {
                let t = false;
                let u = 0;
                for (let v of fromEnum(b)) {
                    if (!v.dn) {
                        continue;
                    }
                    if (t) {
                        break;
                    }
                    if (v.isStacked) {
                        v.jy((w) => {
                            if (w.gl == n) {
                                r = w;
                                s = u;
                                t = true;
                                return false;
                            }
                            return true;
                        });
                    }
                    else if (v.gl == n) {
                        r = v;
                        s = u;
                        break;
                    }
                    u++;
                }
            }
            let w = null;
            if (i) {
                let x = false;
                for (let y = b.count - 1; y >= 0; y--) {
                    let z = b._inner[y];
                    if (!z.dn) {
                        continue;
                    }
                    let aa = z.bs;
                    if (!z.ec(aa.bu, aa.bv, aa)) {
                        continue;
                    }
                    if (!x && y < s && h && !j) {
                        if (r != null) {
                            w = r;
                            x = true;
                            break;
                        }
                    }
                    if (z != null && z.bi == 1) {
                        if (z.dy(d, g)) {
                            w = z;
                            break;
                        }
                    }
                }
                if (h && !x) {
                    if (r != null) {
                        w = r;
                        x = true;
                    }
                }
            }
            else {
                w = r;
            }
            if (w != null) {
                let ab = w.as({ $type: Point_$type, x: l, y: m }, g);
                if (ab != null) {
                    f = ab;
                }
                return {
                    ret: w,
                    p5: f
                };
            }
            return {
                ret: null,
                p5: f
            };
        }
        f$f(a, b) {
            if (PointUtil.equals(b, null)) {
                return false;
            }
            let c = b.x;
            let d = b.y;
            if (c >= a.o7.left && d >= a.o7.top && c <= a.o7.left + a.o7.width && d <= a.o7.top + a.o7.height) {
                let e = a.b1;
                if (e != null && e.viewShouldInteract(b)) {
                    return false;
                }
                return true;
            }
            return false;
        }
        c(a) {
            if (a != null) {
                return a.a9();
            }
            else {
                return null;
            }
        }
        f$v(a, b, c, d, e, f) {
            if (!f && a.c0) {
                this.ae(a, false);
            }
            let g = new MouseEventArgs();
            g.position = d;
            if (a.bz == 2 || a.bz == 1 || a.d6 || (a.b1 != null && a.b1.isPinching)) {
                if (this.d != null) {
                    this.d.a3.a$z(this.d, g.position, this.a, g, f);
                    this.d = null;
                }
                return;
            }
            let h = null;
            let i = ((() => { let j = this.f$c(a, b, c, d, !e, h, f); h = j.p5; return j.ret; })());
            this.a = h;
            let j = this.c(i);
            if (i != null) {
                let k = false;
                let l = false;
                if (this.d != i) {
                    l = true;
                }
                if (this.d == null || l) {
                    k = true;
                }
                if (k) {
                    if (l) {
                        if (this.d != null) {
                            j = this.c(this.d);
                            this.d.a3.a$z(this.d, g.position, h, g, f);
                            if (j != null) {
                                j.a3.a$z(j, g.position, h, g, f);
                            }
                        }
                    }
                    this.d = i;
                    i.kh(g.position, h, g, f);
                    if (j != null) {
                        j.kh(g.position, h, g, f);
                    }
                }
                else {
                    this.d = i;
                    i.a3.a$ab(i, g.position, h, g, f);
                    if (j != null) {
                        j.a3.a$ab(j, g.position, h, g, f);
                    }
                }
            }
            else {
                if (this.d != null) {
                    j = this.c(this.d);
                    this.d.a3.a$z(this.d, g.position, h, g, f);
                    if (j != null) {
                        j.a3.a$z(j, g.position, h, g, f);
                    }
                    this.d = null;
                }
                for (let m = 0; m < a.series.count; m++) {
                    let n = a.series._inner[m];
                    if (n.a3.a$b) {
                        j = this.c(n);
                        n.a3.a$z(n, g.position, n.a3.a$p, g, f);
                        if (j != null) {
                            j.a3.a$z(j, g.position, n.a3.a$p, g, f);
                        }
                    }
                }
            }
        }
        f$u(a, b) {
            if (this.d != null) {
                let c = this.c(this.d);
                let d = new MouseEventArgs();
                d.position = b;
                this.d.a3.a$z(this.d, d.position, null, d, false);
                if (c != null) {
                    c.a3.a$z(c, d.position, null, d, false);
                }
                this.d = null;
            }
            a.j9(b, a.bz != 0 || a.d1);
        }
        f$t(a, b, c) {
            if (this.d != null) {
                let d = new MouseButtonEventArgs();
                d.position = c;
                if (b.ai) {
                    this.d.a3.a$ac(this.d, d.position, this.a, d);
                }
                else {
                    this.d.a3.a$w(this.d, d.position, this.a, d);
                }
            }
        }
        f$w(a, b, c) {
            let d;
            let e = (this.d != null) ? this.d : ((() => { let f = a.b8.f(c, false, d, false); d = f.p2; return f.ret; })());
            if (e != null) {
                let f = new MouseButtonEventArgs();
                f.position = c;
                if (b.ai) {
                    e.a3.a$ad(e, f.position, this.a, f);
                }
                else {
                    e.a3.a$aa(e, f.position, this.a, f);
                }
            }
        }
        f$s(a, b, c) {
            if (!c && a.d2) {
                this.ae(a, false);
            }
            if (c && !a.d2) {
                this.ae(a, true);
            }
            a.js(b, c);
        }
        ae(a, b) {
            if (a != null) {
                if (!this.i) {
                    a.c0 = b;
                }
            }
        }
        f$y(a, b) {
            this.g = true;
        }
        get i() {
            return this.g;
        }
    }
    SeriesViewerInteractionManager.$t = /*@__PURE__*/ markType(SeriesViewerInteractionManager, 'SeriesViewerInteractionManager', Base.$, [ISeriesViewerInteractionManager_$type]);
    return SeriesViewerInteractionManager;
})();
//# sourceMappingURL=SeriesViewerInteractionManager.js.map
