/*
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 { ScatterBase } from "./ScatterBase";
import { IScaleLegendSeries_$type } from "igniteui-react-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { Base, typeCast, Point_$type, fromEnum, markType, markDep, enumGetBox, runOn } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { UIElement } from "igniteui-react-core";
import { ActualRange } from "./ActualRange";
import { DependencyProperty } from "igniteui-react-core";
import { SizeScale } from "./SizeScale";
import { BrushScale } from "./BrushScale";
import { ScatterFrame } from "./ScatterFrame";
import { IChartLegend_$type } from "igniteui-react-core";
import { ValueBrushScale } from "./ValueBrushScale";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { ScatterBaseView } from "./ScatterBaseView";
import { ScalerParams } from "./ScalerParams";
import { Dictionary$2 } from "igniteui-react-core";
import { OwnedPoint } from "./OwnedPoint";
import { BubbleMarkerManager } from "./BubbleMarkerManager";
import { IChartItemLegend_$type } from "igniteui-react-core";
import { IChartScaleLegend_$type } from "igniteui-react-core";
import { ContentControl } from "igniteui-react-core";
import { DataContext } from "igniteui-react-core";
import { DeviceUtils } from "igniteui-react-core";
import { BrushUtil } from "igniteui-react-core";
import { DataLegendSeriesValueInfo } from "igniteui-react-core";
import { DataLegendSeriesContext } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity, logBase } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { BrushSelectionMode_$type } from "./BrushSelectionMode";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let BubbleSeries = /*@__PURE__*/ (() => {
    class BubbleSeries extends ScatterBase {
        bi() {
            return new BubbleSeries();
        }
        get_eg() {
            return true;
        }
        cq() {
            return new BubbleSeriesView(this);
        }
        qx(a) {
            super.qx(a);
            this.ach = a;
        }
        jj() {
            return 0.7;
        }
        wt() {
            if (this.ws == 0) {
                return 2;
            }
            return super.wt();
        }
        constructor() {
            super();
            this.ad7 = null;
            this.ad6 = null;
            this.acu = null;
            this.acm = null;
            this.acl = null;
            this.ack = null;
            this.aci = null;
            this.ab = BubbleSeries.$;
            this.yu = new ScatterFrame();
            this.yw = new ScatterFrame();
            this.ys = new ScatterFrame();
        }
        isAttachedTo(a) {
            return this.a4 == a;
        }
        ef() {
            return true;
        }
        py(a) {
            super.py(a);
            if (this.acp != null && this.acu != null && this.acu.count > 0) {
                for (let b = 0; b < this.acu.count; b++) {
                    a(this.acu._inner[b]);
                }
            }
        }
        get aco() {
            return this.acq;
        }
        get_isColoredItemwise() {
            return this.acn != null && this.acn.count > 0;
        }
        ad5(a) {
            let b = typeCast(CustomPaletteBrushScale.$, this.acg);
            let c = typeCast(ValueBrushScale.$, this.acg);
            let d = this.acg;
            if (b != null && this.dl != null) {
                return b.getBrush1(a, this.dl.count);
            }
            else if (c != null) {
                return c.getBrushByIndex(a, this.acn);
            }
            else if (d != null) {
                return d.getBrush(a);
            }
            return null;
        }
        get legendReady() {
            return this.acq != null && this.acq.count != 0;
        }
        get minScaleText() {
            let a = this.acf(this.acj).b;
            return (Math.round(a * 1000) / 1000).toString();
        }
        get maxScaleText() {
            let a = this.acf(this.acj).a;
            return (Math.round(a * 1000) / 1000).toString();
        }
        forScaleColors(a) {
            for (let b = 0; b < this.acq.count; b++) {
                if (this.acg == null || !this.acg.isReady) {
                    return false;
                }
                let c = NaN;
                if (this.acn != null) {
                    c = (this.acn.item(b) - this.acn.minimum) / (this.acn.maximum - this.acn.minimum);
                }
                let d = (this.acq.item(b) - this.acq.minimum) / (this.acq.maximum - this.acq.minimum);
                if (isNaN_(c)) {
                    c = 0;
                }
                if (isNaN_(d)) {
                    d = c;
                }
                let e = this.x9;
                let f = this.ad5(b);
                let g = f != null ? f : e;
                a(g, d);
            }
            return true;
        }
        ko(a, b) {
            let c = this.nb(b);
            if (c == BubbleSeries.$$p[5]) {
                return this.kp(a, b, this.ac9);
            }
            if (c == BubbleSeries.$$p[11]) {
                return this.kp(a, b, this.adj);
            }
            if (c == ScatterBase.$$p[12]) {
                return this.kp(a, b, this.aal);
            }
            if (c == ScatterBase.$$p[16]) {
                return this.kp(a, b, this.aat);
            }
            if (c == BubbleSeries.$$p[2]) {
                return this.kp(a, b, this.ac4);
            }
            return super.ko(a, b);
        }
        mb(a) {
            let b = this.nb(a);
            if (b == BubbleSeries.$$p[5]) {
                return this.ac9;
            }
            if (b == BubbleSeries.$$p[11]) {
                return this.adj;
            }
            if (b == ScatterBase.$$p[12]) {
                return this.aal;
            }
            if (b == ScatterBase.$$p[16]) {
                return this.aat;
            }
            if (b == BubbleSeries.$$p[2]) {
                return this.ac4;
            }
            return super.mb(a);
        }
        get acq() {
            return this.acm;
        }
        set acq(a) {
            if (this.acm != a) {
                let b = this.acq;
                this.acm = a;
                this.raisePropertyChanged("RadiusColumn", b, this.acq);
            }
        }
        get acp() {
            return this.acl;
        }
        set acp(a) {
            if (this.acl != a) {
                let b = this.acp;
                this.acl = a;
                this.raisePropertyChanged("LabelColumn", b, this.acp);
            }
        }
        get acn() {
            return this.ack;
        }
        set acn(a) {
            if (this.ack != a) {
                let b = this.acn;
                this.ack = a;
                this.raisePropertyChanged("FillColumn", b, this.acn);
            }
        }
        aaw(a, b, c, d, e) {
            if (c <= this.z1) {
                b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
            }
            let f = this.z1;
            let g = this.dl;
            let h;
            let i;
            let j = this.getEffectiveViewport1(a);
            let k = new ScalerParams(0, d, e, this.yo.d, j);
            let l = new ScalerParams(0, d, e, this.yo.e, j);
            let m = false;
            let n = 0;
            if (this.c9 != null) {
                if (this.c9.fz()) {
                    let o = this.c9.mt(d, k);
                    m = o.c;
                    n = o.d;
                }
            }
            for (let p = 0; p < c; p++) {
                h = this.y9.item(p);
                i = this.za.item(p);
                let q = { $type: Point_$type, x: this.yo.a.ek(h, k), y: this.yo.b.ek(i, l) };
                if (m) {
                    if (q.x < e.left || q.x > e.right) {
                        if (q.x + n >= e.left && q.x + n <= e.right) {
                            q = { $type: Point_$type, x: q.x + n, y: i };
                        }
                    }
                }
                if (!isInfinity(q.x) && !isInfinity(q.y)) {
                    let r = g.item(p);
                    if (c <= f) {
                        if (!b.g.containsKey(r)) {
                            let s = { $type: Point_$type, x: h, y: i };
                            b.g.addItem(r, ((() => {
                                let $ret = new OwnedPoint();
                                $ret.a = r;
                                $ret.b = s;
                                $ret.c = q;
                                return $ret;
                            })()));
                        }
                    }
                }
            }
        }
        aa6(a, b) {
            let c = typeCast(BubbleSeriesView.$, b);
            let d = c.c0;
            d.m = this.acq;
            super.aa6(a, b);
            let e = Math.min(this.y9 != null ? this.y9.count : 0, this.za != null ? this.za.count : 0);
            if (e < 1) {
                return;
            }
            c.dm();
            c.dn();
        }
        ado() {
            if (this.c9 == null) {
                return;
            }
            if (this.a4 == null) {
                return;
            }
            if (this.a4.isItemwise) {
                let a = this.a4;
                this.a4.clearLegendItemsForSeries(this);
                this.adn();
                a.renderItemwiseContent(this);
            }
            if (this.a4.isScale) {
                let b = this.a4;
                b.restoreOriginalState();
                b.initializeLegend(this);
            }
        }
        static acv(a, b, c, d, e) {
            if (e <= a || isNaN_(e) || isInfinity(e)) {
                return c;
            }
            if (e >= b) {
                return d;
            }
            let f = c + ((d - c) / (b - a)) * (e - a);
            return f;
        }
        static acw(a, b, c, d, logBase_, e) {
            let f = logBase(e, logBase_);
            let g = logBase(a, logBase_);
            let h = logBase(b, logBase_);
            return BubbleSeries.acv(g, h, c, d, f);
        }
        hc(a, b, c) {
            let d = super.hc(a, b, c);
            if (this.acq == null || this.dl == null || this.acq.count == 0 || this.dl.count != this.acq.count) {
                d = false;
            }
            return d;
        }
        zj(a, b) {
            if (b != 3) {
                return true;
            }
            if (a == null) {
                return true;
            }
            if (this.aal == a || this.aat == a || this.adj == a) {
                return true;
            }
            return false;
        }
        adn() {
            let a = typeCast(IChartLegend_$type, this.a4);
            if (a == null || this.dl == null) {
                return;
            }
            this.acu = new List$1(UIElement.$, 0);
            let b = typeCast(CustomPaletteBrushScale.$, this.acg);
            let c = typeCast(ValueBrushScale.$, this.acg);
            let d = this.acg;
            let e = this.ace();
            let f = e.b;
            let g = e.a;
            let h = this.dl;
            for (let i = 0; i < h.count; i++) {
                let j = null;
                if (c != null && this.acn != null) {
                    let k = this.acn.item(i);
                    j = c.getBrushByRange(k, f, g);
                }
                else if (b != null) {
                    j = b.getBrush1(i, h.count);
                }
                else if (d != null) {
                    j = d.getBrush(i);
                }
                let l = new ContentControl();
                let m = this.acp != null && this.acp.item(i) != null ? this.acp.item(i).toString() : "";
                l.content = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this;
                    $ret.item = h.item(i);
                    $ret.itemBrush = j;
                    $ret.itemLabel = m;
                    return $ret;
                })());
                let n = this.sr;
                if (n == null) {
                    n = this.ct.bn(this.cy);
                }
                l.ah = n;
                this.acu.add(l);
            }
        }
        o9(a, b, c, d) {
            super.o9(a, b, c, d);
            if (this.acj != null) {
                this.acj.aa();
            }
            if (this.acg != null) {
                this.acg.x();
            }
            this.ado();
        }
        p9() {
            super.p9();
            this.ado();
        }
        qg() {
            super.qg();
            this.ado();
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            switch (b) {
                case ScatterBase.$$p[10]:
                case ScatterBase.$$p[14]:
                case ScatterBase.$$p[11]:
                case ScatterBase.$$p[15]:
                case BubbleSeries.$$p[9]:
                case BubbleSeries.$$p[10]:
                    this.qb();
                    break;
                case "FastItemsSource":
                    if (this.acj != null) {
                        this.acj.aa();
                    }
                    if (this.acg != null) {
                        this.acg.x();
                    }
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.acq);
                        c.deregisterColumn(this.acn);
                        c.deregisterColumn(this.acp);
                        this.acq = null;
                        this.acn = null;
                        this.acp = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.acq = this.di(this.adj);
                        if (!stringIsNullOrEmpty(this.ac4)) {
                            this.acn = this.di(this.ac4);
                        }
                        this.acp = this.dk(this.ac9);
                    }
                    this.rn(false);
                    this.ado();
                    break;
                case BubbleSeries.$$p[11]:
                    if (this.acj != null) {
                        this.acj.aa();
                    }
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.acq);
                        this.acq = this.di(this.adj);
                        this.ado();
                    }
                    break;
                case "RadiusColumn":
                    if (this.acj != null) {
                        this.acj.aa();
                    }
                    this.yp.c2.g$i();
                    this.rn(this.ge && this.d5);
                    this.qi();
                    break;
                case BubbleSeries.$$p[12]:
                    if (c != null) {
                        c.l.remove(this);
                        c.aa();
                    }
                    if (d != null) {
                        d.l.add(this);
                        d.aa();
                    }
                    this.rn(false);
                    this.qh();
                    break;
                case BubbleSeries.$$p[13]:
                    this.rn(false);
                    this.qh();
                    break;
                case "DiscreteLegendItemTemplate":
                    this.ado();
                    break;
                case BubbleSeries.$$p[3]:
                    if (c != null) {
                        c.o.remove(this);
                        c.x();
                    }
                    if (d != null) {
                        d.o.add(this);
                        d.x();
                    }
                    this.rn(false);
                    this.ado();
                    this.qh();
                    break;
                case BubbleSeries.$$p[4]:
                case BubbleSeries.$$p[8]:
                case BubbleSeries.$$p[7]:
                case BubbleSeries.$$p[6]:
                    this.rn(false);
                    this.ado();
                    this.qh();
                    break;
                case "FillColumn":
                    this.rn(this.ge && this.d5);
                    this.qh();
                    break;
                case BubbleSeries.$$p[2]:
                    if (this.acg != null) {
                        this.acg.x();
                    }
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.acn);
                        this.acn = this.di(this.ac4);
                        this.ado();
                    }
                    break;
                case BubbleSeries.$$p[5]:
                    if (this.dl != null) {
                        this.dl.deregisterColumn(this.acp);
                        this.acp = this.dk(this.ac9);
                        this.ado();
                    }
                    break;
                case "ActualLegend":
                    let e = typeCast(IChartLegend_$type, c);
                    if (e != null && e.isItemwise) {
                        let f = typeCast(IChartItemLegend_$type, e);
                        f.clearLegendItemsForSeries(this);
                    }
                    if (e != null && e.isScale) {
                        let g = typeCast(IChartScaleLegend_$type, e);
                        let h = true;
                        let i = null;
                        if (this.c9 != null) {
                            for (let j of fromEnum(this.c9.series)) {
                                if (j.legend == g) {
                                    i = j;
                                    h = false;
                                }
                            }
                        }
                        if (h) {
                            g.restoreOriginalState();
                        }
                        else {
                            g.initializeLegend(typeCast(IScaleLegendSeries_$type, i));
                        }
                    }
                    this.ado();
                    break;
                case "SeriesViewer":
                    this.ado();
                    break;
            }
        }
        updateSizeScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acq != null) {
                a.b = this.acq.minimum;
                a.a = this.acq.maximum;
            }
            if (this.acj != null) {
                this.acj.ab(a.b, a.a);
            }
        }
        updateFillScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acn != null) {
                a.b = this.acn.minimum;
                a.a = this.acn.maximum;
            }
            if (this.acg != null) {
                this.acg.z(a.b, a.a);
            }
        }
        acf(a) {
            let b = new ActualRange();
            b.b = NaN;
            b.a = NaN;
            if (this.acq != null) {
                b.b = this.acq.minimum;
                b.a = this.acq.maximum;
            }
            if (a != null) {
                a.x();
                if (this.act) {
                    b.b = a.globalMinimum;
                    b.a = a.globalMaximum;
                }
            }
            return b;
        }
        ace() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.acn != null) {
                a.b = this.acn.minimum;
                a.a = this.acn.maximum;
            }
            let b = typeCast(ValueBrushScale.$, this.acg);
            if (b != null) {
                b.s();
                if (this.acr && this.acg.o.count > 1) {
                    a.b = b.q;
                    a.a = b.p;
                }
            }
            return a;
        }
        adq(a, b, c, d) {
            let e = c.width;
            if (!this.ct.bx.isEmpty) {
                e = this.ct.bx.width;
            }
            else if (this.c9 != null && !this.c9.v0.isEmpty) {
                e = this.c9.v0.width;
            }
            let f = DeviceUtils.c(e);
            this.aci = this.acj || ((() => {
                let $ret = new SizeScale();
                $ret.minimumValue = f / 10;
                $ret.maximumValue = f / 5;
                return $ret;
            })());
            if (this.aci != null) {
                let g = this.aci.minimumValue;
                let h = this.aci.maximumValue;
                let i = this.aci.logarithmBase;
                let j = this.acf(this.aci);
                let k = j.b;
                let l = j.a;
                if (this.aci.isLogarithmic) {
                    for (let m = 0; m < b.count; m++) {
                        b._inner[m] = BubbleSeries.acw(k, l, g, h, i, b._inner[m]);
                    }
                }
                else {
                    for (let n = 0; n < b.count; n++) {
                        b._inner[n] = BubbleSeries.acv(k, l, g, h, b._inner[n]);
                    }
                }
            }
            let o = 1;
            o = DeviceUtils.d();
            let p = this.acj == null;
            if (d) {
                let q = c.width / e;
                for (let r = 0; r < b.count; r++) {
                    if (p) {
                        b._inner[r] = b._inner[r] / o;
                    }
                    b._inner[r] = b._inner[r] * q;
                }
            }
            for (let s = 0; s < a.count; s++) {
                let t = a._inner[s];
                if (p && !d) {
                    t.width = Math.max(0, b._inner[s] / o);
                    t.height = Math.max(0, b._inner[s] / o);
                }
                else {
                    t.width = Math.max(0, b._inner[s]);
                    t.height = Math.max(0, b._inner[s]);
                }
            }
        }
        adp(a) {
            let b = typeCast(BubbleSeriesView.$, this.cs);
            this.ach.b7 = false;
            if (b != null) {
                b.b7 = false;
            }
            let c = typeCast(CustomPaletteBrushScale.$, this.acg);
            let d = typeCast(ValueBrushScale.$, this.acg);
            let e = this.acg;
            let f = this.ace();
            let g = f.b;
            let h = f.a;
            let i = this.acg == null || !this.acg.isReady || (d != null && this.ac4 == null);
            if (i) {
                this.ach.dl();
                if (b != null) {
                    b.dl();
                }
                return;
            }
            this.ach.b7 = true;
            if (b != null) {
                b.b7 = true;
            }
            let j = a.count;
            let k = this.dl;
            for (let l = 0; l < j; l++) {
                let m = a._inner[l];
                let n = typeCast(DataContext.$, m.content);
                if (n != null) {
                    let o = null;
                    let p = k.indexOf(n.item);
                    if (c != null) {
                        o = c.getBrush1(p, k.count);
                    }
                    else if (d != null && this.acn != null) {
                        let q = this.acn.item(p);
                        o = d.getBrushByRange(q, g, h);
                    }
                    else if (e != null) {
                        o = e.getBrush(p);
                    }
                    else {
                        if (this.yb == null) {
                            o = this.x9;
                        }
                        else {
                            o = this.yb;
                        }
                    }
                    let r = null;
                    if (this.yc == null) {
                        r = this.ya;
                    }
                    else {
                        r = this.yc;
                    }
                    if (this.acs && o != null) {
                        r = o;
                    }
                    if (r != null && !isNaN_(this.acy)) {
                        r = BrushUtil.m(r, this.acy);
                    }
                    if (o != null && !isNaN_(this.acx)) {
                        o = BrushUtil.m(o, this.acx);
                    }
                    n.itemBrush = o;
                    n.actualItemBrush = o;
                    n.outline = r;
                }
            }
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.kl(c);
            let e = d == null ? NaN : this.iv(d, "XMemberPath");
            let f = d == null ? NaN : this.iv(d, "YMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.a = 13;
            g.l = e;
            g.q = "X";
            g.r = this.aal != null ? this.aal : "X";
            g.s = this.aah != null ? this.aah : "X:";
            g.t = this.aaj != null ? this.aaj : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 14;
            h.q = "Y";
            h.r = this.aat != null ? this.aat : "Y";
            h.s = this.aap != null ? this.aap : "Y:";
            h.t = this.aar != null ? this.aar : "";
            let i = new DataLegendSeriesContext();
            i.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.h = this.ma();
            if (!stringIsNullOrEmpty(this.adj)) {
                let j = d == null ? NaN : this.iv(d, "RadiusMemberPath");
                let k = new DataLegendSeriesValueInfo();
                k.l = j;
                k.a = 11;
                k.q = "Radius";
                k.r = this.adj != null ? this.adj : "Radius";
                k.s = this.adf != null ? this.adf : "R:";
                k.t = this.adh != null ? this.adh : "";
                i.e.add(k);
            }
            else if (this.aci != null) {
                let l = new DataLegendSeriesValueInfo();
                l.l = this.aci.maximumValue;
                l.a = 11;
                l.q = "Radius";
                l.r = this.adj != null ? this.adj : "Radius";
                l.s = this.adf != null ? this.adf : "R:";
                l.t = this.adh != null ? this.adh : "";
                i.e.add(l);
            }
            if (!stringIsNullOrEmpty(this.ac4)) {
                let m = d == null ? NaN : this.iv(d, "FillMemberPath");
                let n = new DataLegendSeriesValueInfo();
                n.l = m;
                n.a = 12;
                n.q = "Fill";
                n.r = this.ac4 != null ? this.ac4 : "Fill";
                n.s = this.ac0 != null ? this.ac0 : "F:";
                n.t = this.ac2 != null ? this.ac2 : "";
                i.e.add(n);
            }
            return i;
        }
        get actualMarkerBrush() {
            return this.x9;
        }
    }
    BubbleSeries.$t = /*@__PURE__*/ markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberAsLegendLabel:ac0:adr', [2, null], 'FillMemberAsLegendUnit:ac2:ads', [2, null], 'FillMemberPath:ac4:adt', [2], 'FillScale:acg:adu', [BrushScale.$], 'FillScaleUseGlobalValues:acr:adv', [0, false], 'LabelMemberPath:ac9:adw', [2], 'MarkerBrushBrightness:acx:adx', [1, NaN], 'MarkerOutlineBrightness:acy:ady', [1, NaN], 'MarkerOutlineUsesFillScale:acs:adz', [0, false], 'RadiusMemberAsLegendLabel:adf:ad0', [2, null], 'RadiusMemberAsLegendUnit:adh:ad1', [2, null], 'RadiusMemberPath:adj:ad2', [2, null], 'RadiusScale:acj:ad3', [SizeScale.$], 'RadiusScaleUseGlobalValues:act:ad4', [0, false]]);
    return BubbleSeries;
})();
/**
 * @hidden
 */
export let CustomPaletteBrushScale = /*@__PURE__*/ (() => {
    class CustomPaletteBrushScale extends BrushScale {
        constructor() {
            super();
        }
        getBrush1(a, b) {
            if (this.brushes == null || this.brushes.count == 0) {
                return null;
            }
            if (this.brushSelectionMode == 0) {
                return super.getBrush(a % this.brushes.count);
            }
            let c = BubbleSeries.acv(0, b - 1, 0, this.brushes.count - 1, a);
            return this.ab(c);
        }
        get_isReady() {
            return this.brushes != null && this.brushes.count > 0;
        }
    }
    CustomPaletteBrushScale.$t = /*@__PURE__*/ markType(CustomPaletteBrushScale, 'CustomPaletteBrushScale', BrushScale.$);
    CustomPaletteBrushScale.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CustomPaletteBrushScale, 'v', ['BrushSelectionMode', [BrushSelectionMode_$type, /*@__PURE__*/ enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
})();
/**
 * @hidden
 */
export let BubbleSeriesView = /*@__PURE__*/ (() => {
    class BubbleSeriesView extends ScatterBaseView {
        constructor(a) {
            super(a);
            this.dk = null;
            this.dk = a;
            this.c2 = new ScatterTrendLineManager();
        }
        au() {
            super.au();
            if (!this.q) {
                this.b4.w2 = Defaults.e;
            }
        }
        cz() {
            return new BubbleMarkerManager((a) => this.c3.item(a), (a) => this.c1.yo.c.item(a), runOn(this, this.de), runOn(this, this.cw), runOn(this, this.c4));
        }
        dm() {
            let a = this.c0;
            this.dk.adq(a.n, a.o, this.bx, this == this.e.cs);
            this.as();
        }
        dn() {
            let a = this.c0;
            this.dk.adp(a.n);
        }
        dl() {
            let a = this.c0;
            for (let b of fromEnum(a.n)) {
                let c = typeCast(DataContext.$, b.content);
                if (c != null) {
                    c.itemBrush = null;
                    c.outline = null;
                }
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'><span";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.dk.title + "</span><br/><span>" + "(${item." + this.dk.aal + "}, ${item." + this.dk.aat + "})</span>";
            if (!stringIsNullOrEmpty(this.dk.adj)) {
                a += "<span>, Radius: ${item." + this.dk.adj + "}</span>";
            }
            a += "</div>";
            return a;
        }
    }
    BubbleSeriesView.$t = /*@__PURE__*/ markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
})();
