/*
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-angular-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { ISupportsFillScale_$type } from "./ISupportsFillScale";
import { List$1 } from "igniteui-angular-core";
import { UIElement } from "igniteui-angular-core";
import { Base, typeCast, Point_$type, fromEnum, markType, markDep, enumGetBox, runOn } from "igniteui-angular-core";
import { ActualRange } from "./ActualRange";
import { DependencyProperty } from "igniteui-angular-core";
import { SizeScale } from "./SizeScale";
import { BrushScale } from "./BrushScale";
import { ScatterFrame } from "./ScatterFrame";
import { IChartLegend_$type } from "igniteui-angular-core";
import { ValueBrushScale } from "./ValueBrushScale";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { ScatterBaseView } from "./ScatterBaseView";
import { ScalerParams } from "./ScalerParams";
import { OwnedPoint } from "./OwnedPoint";
import { Dictionary$2 } from "igniteui-angular-core";
import { BubbleMarkerManager } from "./BubbleMarkerManager";
import { IChartItemLegend_$type } from "igniteui-angular-core";
import { IChartScaleLegend_$type } from "igniteui-angular-core";
import { ContentControl } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_, isInfinity, logBase } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { BrushSelectionMode_$type } from "./BrushSelectionMode";
import { ScatterTrendLineManager } from "./ScatterTrendLineManager";
import { Defaults } from "./Defaults";
/**
 * @hidden
 */
export let BubbleSeries = /*@__PURE__*/ (() => {
    class BubbleSeries extends ScatterBase {
        constructor() {
            super();
            this.wu = null;
            this.wt = null;
            this.vh = null;
            this.u9 = null;
            this.u8 = null;
            this.u7 = null;
            this.u5 = null;
            this.ab = BubbleSeries.$;
            this.r2 = new ScatterFrame();
            this.r4 = new ScatterFrame();
            this.r0 = new ScatterFrame();
        }
        get_c4() {
            return true;
        }
        bx() {
            return new BubbleSeriesView(this);
        }
        ly(a) {
            super.ly(a);
            this.u4 = a;
        }
        gv() {
            return 0.7;
        }
        p6() {
            if (this.p5 == 0) {
                return 2;
            }
            return super.p6();
        }
        isAttachedTo(a) {
            return this.a1 == a;
        }
        c3() {
            return true;
        }
        k9(a) {
            super.k9(a);
            if (this.vc != null && this.vh != null && this.vh.count > 0) {
                for (let b = 0; b < this.vh.count; b++) {
                    a(this.vh._inner[b]);
                }
            }
        }
        get vb() {
            return this.vd;
        }
        ws(a) {
            let b = typeCast(CustomPaletteBrushScale.$, this.u3);
            let c = typeCast(ValueBrushScale.$, this.u3);
            let d = this.u3;
            if (b != null && this.ck != null) {
                return b.getBrush1(a, this.ck.count);
            }
            else if (c != null) {
                return c.getBrushByIndex(a, this.va);
            }
            else if (d != null) {
                return d.getBrush(a);
            }
            return null;
        }
        get legendReady() {
            return this.vd != null && this.vd.count != 0;
        }
        get minScaleText() {
            let a = this.u2(this.u6).b;
            return (Math.round(a * 1000) / 1000).toString();
        }
        get maxScaleText() {
            let a = this.u2(this.u6).a;
            return (Math.round(a * 1000) / 1000).toString();
        }
        forScaleColors(a) {
            for (let b = 0; b < this.vd.count; b++) {
                if (this.u3 == null || !this.u3.isReady) {
                    return false;
                }
                let c = NaN;
                if (this.va != null) {
                    c = (this.va.item(b) - this.va.minimum) / (this.va.maximum - this.va.minimum);
                }
                let d = (this.vd.item(b) - this.vd.minimum) / (this.vd.maximum - this.vd.minimum);
                if (isNaN_(c)) {
                    c = 0;
                }
                if (isNaN_(d)) {
                    d = c;
                }
                let e = this.rc;
                let f = this.ws(b);
                let g = f != null ? f : e;
                a(g, d);
            }
            return true;
        }
        hw(a, b) {
            let c = this.jq(b);
            if (c == BubbleSeries.$$p[5]) {
                return this.hx(a, b, this.vw);
            }
            if (c == BubbleSeries.$$p[11]) {
                return this.hx(a, b, this.v6);
            }
            if (c == ScatterBase.$$p[10]) {
                return this.hx(a, b, this.td);
            }
            if (c == ScatterBase.$$p[14]) {
                return this.hx(a, b, this.tl);
            }
            if (c == BubbleSeries.$$p[2]) {
                return this.hx(a, b, this.vr);
            }
            return super.hw(a, b);
        }
        get vd() {
            return this.u9;
        }
        set vd(a) {
            if (this.u9 != a) {
                let b = this.vd;
                this.u9 = a;
                this.raisePropertyChanged("RadiusColumn", b, this.vd);
            }
        }
        get vc() {
            return this.u8;
        }
        set vc(a) {
            if (this.u8 != a) {
                let b = this.vc;
                this.u8 = a;
                this.raisePropertyChanged("LabelColumn", b, this.vc);
            }
        }
        get va() {
            return this.u7;
        }
        set va(a) {
            if (this.u7 != a) {
                let b = this.va;
                this.u7 = a;
                this.raisePropertyChanged("FillColumn", b, this.va);
            }
        }
        to(a, b, c, d, e) {
            if (c <= this.sx) {
                b.g = new Dictionary$2(Base.$, OwnedPoint.$, 1, c);
            }
            let f = this.sx;
            let g = this.ck;
            let h;
            let i;
            let j = this.getEffectiveViewport1(a);
            let k = new ScalerParams(0, d, e, this.rw.d, j);
            let l = new ScalerParams(0, d, e, this.rw.e, j);
            let m = false;
            let n = 0;
            if (this.cd != null) {
                if (this.cd.e3()) {
                    let o = this.cd.ku(d, k);
                    m = o.c;
                    n = o.d;
                }
            }
            for (let p = 0; p < c; p++) {
                h = this.sc.item(p);
                i = this.sd.item(p);
                let q = { $type: Point_$type, x: this.rw.a.ei(h, k), y: this.rw.b.ei(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;
                            })()));
                        }
                    }
                }
            }
        }
        tw(a, b) {
            let c = typeCast(BubbleSeriesView.$, b);
            let d = c.cv;
            d.m = this.vd;
            super.tw(a, b);
            let e = Math.min(this.sc != null ? this.sc.count : 0, this.sd != null ? this.sd.count : 0);
            if (e < 1) {
                return;
            }
            c.dh();
            c.di();
        }
        wb() {
            if (this.cd == null) {
                return;
            }
            if (this.a1 == null) {
                return;
            }
            if (this.a1.isItemwise) {
                let a = this.a1;
                this.a1.clearLegendItemsForSeries(this);
                this.wa();
                a.renderItemwiseContent(this);
            }
            if (this.a1.isScale) {
                let b = this.a1;
                b.restoreOriginalState();
                b.initializeLegend(this);
            }
        }
        static vi(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 vj(a, b, c, d, logBase_, e) {
            let f = logBase(e, logBase_);
            let g = logBase(a, logBase_);
            let h = logBase(b, logBase_);
            return BubbleSeries.vi(g, h, c, d, f);
        }
        e9(a, b, c) {
            let d = super.e9(a, b, c);
            if (this.vd == null || this.ck == null || this.vd.count == 0 || this.ck.count != this.vd.count) {
                d = false;
            }
            return d;
        }
        sl(a, b) {
            if (b != 3) {
                return true;
            }
            if (a == null) {
                return true;
            }
            if (this.td == a || this.tl == a || this.v6 == a) {
                return true;
            }
            return false;
        }
        wa() {
            let a = typeCast(IChartLegend_$type, this.a1);
            if (a == null || this.ck == null) {
                return;
            }
            this.vh = new List$1(UIElement.$, 0);
            let b = typeCast(CustomPaletteBrushScale.$, this.u3);
            let c = typeCast(ValueBrushScale.$, this.u3);
            let d = this.u3;
            let e = this.u1();
            let f = e.b;
            let g = e.a;
            let h = this.ck;
            for (let i = 0; i < h.count; i++) {
                let j = null;
                if (c != null && this.va != null) {
                    let k = this.va.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.vc != null && this.vc.item(i) != null ? this.vc.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.nb;
                if (n == null) {
                    n = this.b0.bl(this.b5);
                }
                l.ah = n;
                this.vh.add(l);
            }
        }
        k0(a, b, c, d) {
            super.k0(a, b, c, d);
            if (this.u6 != null) {
                this.u6.aa();
            }
            if (this.u3 != null) {
                this.u3.x();
            }
            this.wb();
        }
        lh() {
            super.lh();
            this.wb();
        }
        ln() {
            super.ln();
            this.wb();
        }
        l3(a, b, c, d) {
            super.l3(a, b, c, d);
            switch (b) {
                case "FastItemsSource":
                    if (this.u6 != null) {
                        this.u6.aa();
                    }
                    if (this.u3 != null) {
                        this.u3.x();
                    }
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.vd);
                        c.deregisterColumn(this.va);
                        c.deregisterColumn(this.vc);
                        this.vd = null;
                        this.va = null;
                        this.vc = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.vd = this.ch(this.v6);
                        if (!stringIsNullOrEmpty(this.vr)) {
                            this.va = this.ch(this.vr);
                        }
                        this.vc = this.cj(this.vw);
                    }
                    this.mh(false);
                    this.wb();
                    break;
                case BubbleSeries.$$p[11]:
                    if (this.u6 != null) {
                        this.u6.aa();
                    }
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.vd);
                        this.vd = this.ch(this.v6);
                        this.wb();
                    }
                    break;
                case "RadiusColumn":
                    if (this.u6 != null) {
                        this.u6.aa();
                    }
                    this.rx.cx.g$i();
                    this.mh(false);
                    this.lp();
                    break;
                case BubbleSeries.$$p[12]:
                    if (c != null) {
                        c.l.remove(this);
                        c.aa();
                    }
                    if (d != null) {
                        d.l.add(this);
                        d.aa();
                    }
                    this.mh(false);
                    this.lo();
                    break;
                case BubbleSeries.$$p[13]:
                    this.mh(false);
                    this.lo();
                    break;
                case "DiscreteLegendItemTemplate":
                    this.wb();
                    break;
                case BubbleSeries.$$p[3]:
                    if (c != null) {
                        c.o.remove(this);
                        c.x();
                    }
                    if (d != null) {
                        d.o.add(this);
                        d.x();
                    }
                    this.mh(false);
                    this.wb();
                    this.lo();
                    break;
                case BubbleSeries.$$p[4]:
                case BubbleSeries.$$p[8]:
                case BubbleSeries.$$p[7]:
                case BubbleSeries.$$p[6]:
                    this.mh(false);
                    this.wb();
                    this.lo();
                    break;
                case "FillColumn":
                    this.mh(false);
                    this.lo();
                    break;
                case BubbleSeries.$$p[2]:
                    if (this.u3 != null) {
                        this.u3.x();
                    }
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.va);
                        this.va = this.ch(this.vr);
                        this.wb();
                    }
                    break;
                case BubbleSeries.$$p[5]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.vc);
                        this.vc = this.cj(this.vw);
                        this.wb();
                    }
                    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.cd != null) {
                            for (let j of fromEnum(this.cd.series)) {
                                if (j.legend == g) {
                                    i = j;
                                    h = false;
                                }
                            }
                        }
                        if (h) {
                            g.restoreOriginalState();
                        }
                        else {
                            g.initializeLegend(typeCast(IScaleLegendSeries_$type, i));
                        }
                    }
                    this.wb();
                    break;
                case "SeriesViewer":
                    this.wb();
                    break;
            }
        }
        updateSizeScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.vd != null) {
                a.b = this.vd.minimum;
                a.a = this.vd.maximum;
            }
            if (this.u6 != null) {
                this.u6.ab(a.b, a.a);
            }
        }
        updateFillScaleGlobals() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.va != null) {
                a.b = this.va.minimum;
                a.a = this.va.maximum;
            }
            if (this.u3 != null) {
                this.u3.z(a.b, a.a);
            }
        }
        u2(a) {
            let b = new ActualRange();
            b.b = NaN;
            b.a = NaN;
            if (this.vd != null) {
                b.b = this.vd.minimum;
                b.a = this.vd.maximum;
            }
            if (a != null) {
                a.x();
                if (this.vg) {
                    b.b = a.globalMinimum;
                    b.a = a.globalMaximum;
                }
            }
            return b;
        }
        u1() {
            let a = new ActualRange();
            a.b = NaN;
            a.a = NaN;
            if (this.va != null) {
                a.b = this.va.minimum;
                a.a = this.va.maximum;
            }
            let b = typeCast(ValueBrushScale.$, this.u3);
            if (b != null) {
                b.s();
                if (this.ve && this.u3.o.count > 1) {
                    a.b = b.q;
                    a.a = b.p;
                }
            }
            return a;
        }
        wd(a, b, c, d) {
            let e = c.width;
            if (!this.b0.bu.isEmpty) {
                e = this.b0.bu.width;
            }
            else if (this.cd != null && !this.cd.su.isEmpty) {
                e = this.cd.su.width;
            }
            let f = DeviceUtils.c(e);
            this.u5 = this.u6 || ((() => {
                let $ret = new SizeScale();
                $ret.minimumValue = f / 10;
                $ret.maximumValue = f / 5;
                return $ret;
            })());
            if (this.u5 != null) {
                let g = this.u5.minimumValue;
                let h = this.u5.maximumValue;
                let i = this.u5.logarithmBase;
                let j = this.u2(this.u5);
                let k = j.b;
                let l = j.a;
                if (this.u5.isLogarithmic) {
                    for (let m = 0; m < b.count; m++) {
                        b._inner[m] = BubbleSeries.vj(k, l, g, h, i, b._inner[m]);
                    }
                }
                else {
                    for (let n = 0; n < b.count; n++) {
                        b._inner[n] = BubbleSeries.vi(k, l, g, h, b._inner[n]);
                    }
                }
            }
            let o = 1;
            o = DeviceUtils.d();
            let p = this.u6 == 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]);
                }
            }
        }
        wc(a) {
            let b = typeCast(BubbleSeriesView.$, this.bz);
            this.u4.b3 = false;
            if (b != null) {
                b.b3 = false;
            }
            let c = typeCast(CustomPaletteBrushScale.$, this.u3);
            let d = typeCast(ValueBrushScale.$, this.u3);
            let e = this.u3;
            let f = this.u1();
            let g = f.b;
            let h = f.a;
            let i = this.u3 == null || !this.u3.isReady || (d != null && this.vr == null);
            if (i) {
                this.u4.dg();
                if (b != null) {
                    b.dg();
                }
                return;
            }
            this.u4.b3 = true;
            if (b != null) {
                b.b3 = true;
            }
            let j = a.count;
            let k = this.ck;
            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.va != null) {
                        let q = this.va.item(p);
                        o = d.getBrushByRange(q, g, h);
                    }
                    else if (e != null) {
                        o = e.getBrush(p);
                    }
                    else {
                        if (this.re == null) {
                            o = this.rc;
                        }
                        else {
                            o = this.re;
                        }
                    }
                    let r = null;
                    if (this.rf == null) {
                        r = this.rd;
                    }
                    else {
                        r = this.rf;
                    }
                    if (this.vf && o != null) {
                        r = o;
                    }
                    if (r != null && !isNaN_(this.vl)) {
                        r = BrushUtil.l(r, this.vl);
                    }
                    if (o != null && !isNaN_(this.vk)) {
                        o = BrushUtil.l(o, this.vk);
                    }
                    n.itemBrush = o;
                    n.actualItemBrush = o;
                    n.outline = r;
                }
            }
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = { $type: Point_$type, x: a, y: b };
            let d = this.ht(c);
            let e = d == null ? NaN : this.gb(d, "XMemberPath");
            let f = d == null ? NaN : this.gb(d, "YMemberPath");
            let g = new DataLegendSeriesValueInfo();
            g.a = 13;
            g.l = e;
            g.p = this.td != null ? this.td : "X";
            g.q = this.s9 != null ? this.s9 : "X:";
            g.r = this.tb != null ? this.tb : "";
            let h = new DataLegendSeriesValueInfo();
            h.l = f;
            h.a = 14;
            h.p = this.tl != null ? this.tl : "Y";
            h.q = this.th != null ? this.th : "Y:";
            h.r = this.tj != null ? this.tj : "";
            let i = new DataLegendSeriesContext();
            i.f = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(g);
                $ret.add(h);
                return $ret;
            })());
            i.b = this.av();
            if (!stringIsNullOrEmpty(this.v6)) {
                let j = d == null ? NaN : this.gb(d, "RadiusMemberPath");
                let k = new DataLegendSeriesValueInfo();
                k.l = j;
                k.a = 11;
                k.p = this.v6 != null ? this.v6 : "Radius";
                k.q = this.v2 != null ? this.v2 : "R:";
                k.r = this.v4 != null ? this.v4 : "";
                i.f.add(k);
            }
            else if (this.u5 != null) {
                let l = new DataLegendSeriesValueInfo();
                l.l = this.u5.maximumValue;
                l.a = 11;
                l.p = this.v6 != null ? this.v6 : "Radius";
                l.q = this.v2 != null ? this.v2 : "R:";
                l.r = this.v4 != null ? this.v4 : "";
                i.f.add(l);
            }
            if (!stringIsNullOrEmpty(this.vr)) {
                let m = d == null ? NaN : this.gb(d, "FillMemberPath");
                let n = new DataLegendSeriesValueInfo();
                n.l = m;
                n.a = 12;
                n.p = this.vr != null ? this.vr : "Fill";
                n.q = this.vn != null ? this.vn : "F:";
                n.r = this.vp != null ? this.vp : "";
                i.f.add(n);
            }
            return i;
        }
        get actualMarkerBrush() {
            return this.rc;
        }
    }
    BubbleSeries.$t = markType(BubbleSeries, 'BubbleSeries', ScatterBase.$, [IScaleLegendSeries_$type, ISupportsSizeScale_$type, ISupportsFillScale_$type]);
    BubbleSeries.$$p = markDep(DependencyProperty, PropertyMetadata, BubbleSeries, 'raisePropertyChanged', ['FillMemberAsLegendLabel:vn:we', [2, null], 'FillMemberAsLegendUnit:vp:wf', [2, null], 'FillMemberPath:vr:wg', [2], 'FillScale:u3:wh', [BrushScale.$], 'FillScaleUseGlobalValues:ve:wi', [0, false], 'LabelMemberPath:vw:wj', [2], 'MarkerBrushBrightness:vk:wk', [1, NaN], 'MarkerOutlineBrightness:vl:wl', [1, NaN], 'MarkerOutlineUsesFillScale:vf:wm', [0, false], 'RadiusMemberAsLegendLabel:v2:wn', [2, null], 'RadiusMemberAsLegendUnit:v4:wo', [2, null], 'RadiusMemberPath:v6:wp', [2, null], 'RadiusScale:u6:wq', [SizeScale.$], 'RadiusScaleUseGlobalValues:vg:wr', [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.vi(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 = markType(CustomPaletteBrushScale, 'CustomPaletteBrushScale', BrushScale.$);
    CustomPaletteBrushScale.$$p = markDep(DependencyProperty, PropertyMetadata, CustomPaletteBrushScale, 'v', ['BrushSelectionMode', [BrushSelectionMode_$type, enumGetBox(BrushSelectionMode_$type, 0)]]);
    return CustomPaletteBrushScale;
})();
/**
 * @hidden
 */
export let BubbleSeriesView = /*@__PURE__*/ (() => {
    class BubbleSeriesView extends ScatterBaseView {
        constructor(a) {
            super(a);
            this.df = null;
            this.df = a;
            this.cx = new ScatterTrendLineManager();
        }
        as() {
            super.as();
            if (!this.q) {
                this.b1.qc = Defaults.e;
            }
        }
        cu() {
            return new BubbleMarkerManager((a) => this.cy.item(a), (a) => this.cw.rw.c.item(a), runOn(this, this.c9), runOn(this, this.cr), runOn(this, this.cz));
        }
        dh() {
            let a = this.cv;
            this.df.wd(a.n, a.o, this.bu, this == this.e.bz);
            this.aq();
        }
        di() {
            let a = this.cv;
            this.df.wc(a.n);
        }
        dg() {
            let a = this.cv;
            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.a6.a$r(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            a += ">" + this.df.title + "</span><br/><span>" + "(${item." + this.df.td + "}, ${item." + this.df.tl + "})</span>";
            if (!stringIsNullOrEmpty(this.df.v6)) {
                a += "<span>, Radius: ${item." + this.df.v6 + "}</span>";
            }
            a += "</div>";
            return a;
        }
    }
    BubbleSeriesView.$t = markType(BubbleSeriesView, 'BubbleSeriesView', ScatterBaseView.$);
    return BubbleSeriesView;
})();
