/*
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 { AnnotationLayer } from "./AnnotationLayer";
import { DependencyProperty } from "igniteui-react-core";
import { Base, runOn, delegateCombine, String_$type, enumGetBox, EnumUtil, typeCast, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-react-core";
import { Series } from "./Series";
import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection";
import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode";
import { Brush } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { FontUtil } from "igniteui-react-core";
import { Rect } from "igniteui-react-core";
import { CalloutLayerFrame } from "./CalloutLayerFrame";
import { HashSet$1 } from "igniteui-react-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { List$1 } from "igniteui-react-core";
import { LinkedList$1 } from "igniteui-react-core";
import { Dictionary$2 } from "igniteui-react-core";
import { LinkedListNode$1 } from "igniteui-react-core";
import { LabelCollisionManager } from "igniteui-react-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs";
import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs";
import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs";
import { DeviceUtils } from "igniteui-react-core";
import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs";
import { LabelCollisionInfo } from "igniteui-react-core";
import { QuadTreeBoundingBox } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { Size } from "igniteui-react-core";
import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs";
import { CalloutKey } from "./CalloutKey";
import { DataContext } from "igniteui-react-core";
import { HashPool$2 } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_ } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { FastItemObjectColumn } from "igniteui-react-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-react-core";
import { TextBlock } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
import { Line } from "igniteui-react-core";
import { CalloutViewHelper } from "./CalloutViewHelper";
import { Rectangle } from "igniteui-react-core";
import { TranslateTransform } from "igniteui-react-core";
/**
 * @hidden
 */
export let CalloutLayer = /*@__PURE__*/ (() => {
    class CalloutLayer extends AnnotationLayer {
        get_d2() {
            return true;
        }
        constructor() {
            super();
            this.calloutStyleUpdating = null;
            this.calloutRenderStyleUpdating = null;
            this.xk = null;
            this.xl = null;
            this.xm = null;
            this.xj = null;
            this.xi = null;
            this.yc = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            this.yf = new List$1(CalloutAnnotationWrapper.$, 0);
            this.yg = new List$1(CalloutAnnotationWrapper.$, 0);
            this.xa = null;
            this.w0 = null;
            this.xg = null;
            this.yd = new LinkedList$1(CalloutAnnotationWrapper.$);
            this.ya = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0);
            this.xs = null;
            this.abm = new Rect(0, 0, 0, 1, 1);
            this.xz = false;
            this.yr = 0;
            this.abl = Rect.empty;
            this.xx = false;
            this.xy = false;
            this.calloutContentUpdating = null;
            this.calloutLabelUpdating = null;
            this.calloutSeriesSelecting = null;
            this.ye = new List$1(SeriesPointOfInterest.$, 0);
            this.x1 = false;
            this.x2 = false;
            this.yi = 0;
            this.x0 = false;
            this.xw = true;
            this.w2 = 1;
            FastItemObjectColumn.m();
            this.w0 = null;
            this.xa = new CalloutPlacementPositionsCollection();
            let a = this.xa;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.z6));
            this.un = true;
            let b = new CalloutLayerFrame();
            let c = new CalloutLayerFrame();
            let d = new CalloutLayerFrame();
            let e = this.ji / 1000;
            this.uf = b;
            this.ue = c;
            this.ug = d;
            this.ab = CalloutLayer.$;
        }
        z6(a, b) {
            this.aaf();
        }
        aaf() {
            this.w0 = this.w1(this.xb);
            this.aac();
        }
        z7(a, b) {
            this.yg.clear();
            this.pp(false);
        }
        no(a, b, c, d) {
            super.no(a, b, c, d);
            let e = this.yb();
            switch (a) {
                case 3:
                    this.aak(b, e);
                    break;
                case 1:
                    for (let f = b; f < b + c; f++) {
                        let g = new CalloutAnnotation();
                        let h = new CalloutAnnotationWrapper();
                        h.b = g;
                        h.b.series = this.xf;
                        this.yg.insert(f, h);
                        this.aak(f, e);
                    }
                    break;
                case 0:
                    this.yg.v(b, c);
                    break;
                case 2:
                    for (let i = b; i < b + c; i++) {
                        this.aak(i, e);
                    }
                    break;
                case 4:
                    this.yg.clear();
                    for (let j = 0; j < this.c6.count; j++) {
                        let k = new CalloutAnnotation();
                        let l = new CalloutAnnotationWrapper();
                        l.b = k;
                        l.b.series = this.xf;
                        this.yg.add(l);
                        this.aak(j, e);
                    }
                    break;
            }
            this.pp(true);
        }
        fp(a) {
            return false;
        }
        yb() {
            let a = new Dictionary$2(String_$type, Series.$, 0);
            if (this.cy != null) {
                for (let b = 0; b < this.cy.series.count; b++) {
                    let c = this.cy.series._inner[b];
                    if (c.name != null && !a.containsKey(c.name)) {
                        a.addItem(c.name, c);
                    }
                }
            }
            return a;
        }
        aak(a, b) {
            if (this.xr == null || this.xp == null) {
                return;
            }
            let c = a;
            if (this.xq != null) {
                c = this.xq.item(a);
            }
            let d = this.xr.item(a);
            let e = this.xp.item(a);
            let f = this.yg._inner[a];
            if (this.xo != null) {
                if (f.b.ab != this.xo.item(a)) {
                    f.b.key = this.xo.item(a);
                }
            }
            if (this.ya.containsKey(f)) {
                f.b = this.ya.item(f).c.b;
            }
            f.b.xValue = c;
            f.b.yValue = d;
            if (this.calloutLabelUpdating != null) {
                let g = ((() => {
                    let $ret = new CalloutLabelUpdatingEventArgs();
                    $ret.d = c;
                    $ret.e = d;
                    $ret.item = this.c6.item(a);
                    return $ret;
                })());
                this.calloutLabelUpdating(this, g);
                if (g.c != null && !Base.equalsStatic(g.c, f.b.ao)) {
                    let h = g.c;
                    f.b.text = h != null ? h.toString() : "";
                }
            }
            else {
                f.b.text = e != null ? e.toString() : "";
            }
            if (this.xn != null) {
                f.b.content = this.xn.item(a);
            }
            else {
                f.b.content = this.c6.item(a);
            }
            if (this.calloutSeriesSelecting != null) {
                let i = ((() => {
                    let $ret = new CalloutSeriesSelectingEventArgs();
                    $ret.c = c;
                    $ret.d = d;
                    $ret.item = this.c6.item(a);
                    return $ret;
                })());
                this.calloutSeriesSelecting(this, i);
                if (i.a != null) {
                    f.b.series = i.a;
                }
                else if (i.e != null) {
                    if (b.containsKey(i.e)) {
                        f.b.series = b.item(i.e);
                    }
                }
            }
            this.aal(f);
        }
        aal(a) {
            let b = new Thickness(0, DeviceUtils.g(3));
            if (isNaN_(this.abo.left) || isNaN_(this.abo.top) || isNaN_(this.abo.right) || isNaN_(this.abo.bottom)) {
                b = new Thickness(0, DeviceUtils.g(3));
            }
            else {
                b = this.abo;
            }
            let c = DeviceUtils.g(3);
            if (isNaN_(this.yj)) {
                c = DeviceUtils.g(3);
            }
            else {
                c = this.yj;
            }
            let d = this.abh != null ? this.abh : this.w9.cl(a.b.l);
            let e = this.abk != null ? this.abk : this.w9.co();
            let f = this.abj != null ? this.abj : this.w9.cn(a.b.l);
            let g = this.abi != null ? this.abi : this.w9.cm(a.b.l);
            let h = isNaN_(this.yp) ? 0 : this.yp;
            if (this.x6 && this.calloutStyleUpdating != null) {
                let i = new CalloutStyleUpdatingEventArgs();
                i.item = a.b.aa;
                i.xValue = a.b.ac;
                i.yValue = a.b.ad;
                i.series = a.b.l;
                i.background = d;
                i.textColor = e;
                i.outline = f;
                i.leaderBrush = g;
                i.strokeThickness = h;
                this.calloutStyleUpdating(this, i);
                d = i.background;
                e = i.textColor;
                f = i.outline;
                g = i.leaderBrush;
                h = i.strokeThickness;
            }
            a.b.backgroundPadding = b;
            a.b.backgroundCornerRadius = c;
            a.b.background = d;
            a.b.textColor = e;
            a.b.outline = f;
            a.b.leaderBrush = g;
            a.b.strokeThickness = h;
        }
        ju(a, b) {
            let c = this.lv(b);
            if (c == CalloutLayer.$$p[21]) {
                return this.jv(a, b, this.zq);
            }
            if (c == CalloutLayer.$$p[28]) {
                return this.jv(a, b, this.z1);
            }
            if (c == CalloutLayer.$$p[29]) {
                return this.jv(a, b, this.z4);
            }
            if (c == CalloutLayer.$$p[20]) {
                return this.jv(a, b, this.zn);
            }
            if (c == CalloutLayer.$$p[15]) {
                return this.jv(a, b, this.zg);
            }
            return super.ju(a, b);
        }
        get xp() {
            return this.xk;
        }
        set xp(a) {
            if (this.xk != a) {
                let b = this.xk;
                this.xk = a;
                this.raisePropertyChanged("LabelColumn", b, this.xk);
            }
        }
        get xq() {
            return this.xl;
        }
        set xq(a) {
            if (this.xl != a) {
                let b = this.xl;
                this.xl = a;
                this.raisePropertyChanged("XColumn", b, this.xl);
            }
        }
        get xr() {
            return this.xm;
        }
        set xr(a) {
            if (this.xm != a) {
                let b = this.xm;
                this.xm = a;
                this.raisePropertyChanged("YColumn", b, this.xm);
            }
        }
        get xo() {
            return this.xj;
        }
        set xo(a) {
            if (this.xj != a) {
                let b = this.xj;
                this.xj = a;
                this.raisePropertyChanged("KeyColumn", b, this.xj);
            }
        }
        get xn() {
            return this.xi;
        }
        set xn(a) {
            if (this.xi != a) {
                let b = this.xi;
                this.xi = a;
                this.raisePropertyChanged("ContentColumn", b, this.xi);
            }
        }
        z9(a, b) {
            if (b.propertyName == CalloutAnnotation.$$p[14] || b.propertyName == CalloutAnnotation.$$p[15]) {
                let c = a.k;
                if (!this.yc.contains(c)) {
                    this.yc.add_1(c);
                    this.yf.add(c);
                    this.pp(false);
                }
            }
        }
        cg() {
            return new CalloutLayerView(this);
        }
        o0(a) {
            super.o0(a);
            this.w9 = a;
        }
        get xb() {
            return this.xa;
        }
        set xb(a) {
            let b = this.xb;
            if (a != b) {
                this.xa = a;
                this.raisePropertyChanged("AllowedPositions", b, this.xb);
            }
        }
        get w4() {
            return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.aa0));
        }
        set w4(a) {
            this.h(CalloutLayer.aa0, enumGetBox(AutoCalloutVisibilityMode_$type, a));
        }
        get w3() {
            return this.w2;
        }
        set w3(a) {
            this.w2 = a;
        }
        get abo() {
            return new Thickness(1, this.yl, this.yn, this.ym, this.yk);
        }
        get xh() {
            if (this.xg == null) {
                this.xg = FontUtil.toFontInfo(this.i4, this.zv);
            }
            return this.xg;
        }
        vs(a, b) {
            if (this.xf == null || this.xf == a) {
                if (!this.at.c) {
                    this.pp(b);
                }
            }
        }
        vu(a, b) {
            super.vu(a, b);
            let c = a;
            c.q.clear();
            c.r.clear();
            c.n.clear();
            c.f.clear();
            c.i.clear();
            c.h.clear();
            c.k.clear();
            c.m.clear();
            c.l.clear();
            c.j.clear();
            c.g.clear();
            c.o.clear();
            c.p.clear();
            c.u.clear();
            c.v.clear();
            c.s.clear();
            c.t.clear();
            let d = this.yh();
            let e = new List$1(CalloutAnnotationWrapper.$, 0);
            let f = true;
            if (this.x3) {
                if (this.ul(this.xf)) {
                    this.aah(this.xf, c, e);
                }
                else {
                    for (let g of fromEnum(this.cy.series)) {
                        if (this.ul(g)) {
                            if (!g.d6) {
                                if (!g.isVertical) {
                                    f = false;
                                }
                            }
                            this.aah(g, c, e);
                        }
                    }
                }
            }
            if (this.x3 && this.w3 == 2) {
                let h = 0;
                let i = 0;
                let j = 1.7976931348623157E+308;
                let k = 1.7976931348623157E+308;
                let l = -1.7976931348623157E+308;
                let m = -1.7976931348623157E+308;
                if (e.count > 0) {
                    if (e._inner[0].c != null) {
                        h = e._inner[0].e;
                        i = e._inner[0].f;
                    }
                    for (let n = 0; n < e.count; n++) {
                        let o = e._inner[n];
                        if (o.c != null) {
                            let p = o.e;
                            let q = o.f;
                            if (p != h) {
                                j = Math.min(j, Math.abs(p - h));
                            }
                            if (q != i) {
                                k = Math.min(k, Math.abs(q - i));
                            }
                            l = Math.max(o.c.l + o.c.l, l);
                            m = Math.max(o.c.k + o.c.k, m);
                        }
                    }
                    if (f) {
                        if (m > k) {
                            e.clear();
                        }
                    }
                    else {
                        if (l > j) {
                            e.clear();
                        }
                    }
                }
            }
            this.aag(c, d, e);
        }
        qn(a, b) {
            super.qn(a, b);
            let c = b.width - this.abm.width;
            let d = b.height - this.abm.height;
            let e = 0;
            if (Math.abs(c) > Math.abs(d)) {
                e = c;
                this.yi = c * this.tw.width;
            }
            else {
                e = d;
                this.yi = d * this.tw.height;
            }
            if (e > 0 && this.yi > 5) {
                this.x2 = true;
            }
            if (e < 0 && this.yi > 5) {
                this.x1 = true;
            }
        }
        qm(a, b) {
            super.qm(a, b);
            if (!a.equals1(b)) {
                this.x0 = true;
            }
        }
        get abn() {
            return this.abl;
        }
        set abn(a) {
            this.abl = a;
        }
        aag(a, b, c) {
            if (this.cy != null) {
                this.abm = this.cy.tn;
            }
            if (this.tw.isEmpty) {
                return;
            }
            this.abn = new Rect(0, this.tw.left, this.tw.top, this.tw.width, this.tw.height);
            if (this.xs != null && this.zd != null && this.zd != this.xs.ap) {
                this.aab();
            }
            if (this.xs == null) {
                let d = this.xt();
                if (d != null) {
                    this.xs = d;
                    let e = this.xs;
                    e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.z8));
                }
                else {
                    let f = this.to(this.cj);
                    let g = new Array(2);
                    g[0] = 0;
                    g[1] = 3;
                    if (this.xf != null) {
                        if (this.xf.isVertical) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    else {
                        let h = false;
                        if (this.cy != null && this.cy.series.count > 0) {
                            h = true;
                            for (let i of fromEnum(this.cy.series)) {
                                if (!i.d6) {
                                    if (!i.isVertical) {
                                        h = false;
                                    }
                                }
                            }
                        }
                        if (h) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    this.xs = new LabelCollisionManager(this.tw.right, this.tw.bottom, this.tw, this.w9.j(), this.yo, this.xu(), g, this.yv(), this.yu(), this.x4, this.w0);
                    if (this.zd != null) {
                        this.xs.ap = this.zd;
                        this.xs.an = this;
                    }
                    let j = this.xs;
                    j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.z8));
                }
            }
            if (this.x1) {
                this.x1 = false;
                if (this.xs.al > 2) {
                    this.xz = true;
                }
            }
            if (this.x2) {
                this.x2 = false;
                if (this.yi > 5) {
                    this.xz = true;
                }
            }
            if (this.x0) {
                this.x0 = false;
                this.xs.a3(this.tw.right, this.tw.bottom, this.tw);
                this.xz = true;
            }
            let k = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let l = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            let m = new List$1(CalloutAnnotationWrapper.$, 0);
            let n = new List$1(CalloutAnnotationWrapper.$, 0);
            let o = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (let p = 0; p < b.count; p++) {
                o.add_1(b._inner[p]);
            }
            for (let q = 0; q < c.count; q++) {
                o.add_1(c._inner[q]);
            }
            let r = this.yd.c;
            while (r != null) {
                let s = r.a;
                if (!o.contains(r.c)) {
                    n.add(r.c);
                    l.add_1(r.c);
                    let t = r.c.b;
                    t.propertyChanged = delegateRemove(t.propertyChanged, runOn(this, this.z9));
                    this.yd.h(r);
                    this.ya.removeItem(r.c);
                    this.xs.a2(r.c.c);
                }
                r = s;
            }
            for (let u = 0; u < b.count; u++) {
                if (!this.ya.containsKey(b._inner[u])) {
                    this.yd.f(b._inner[u]);
                    let v = b._inner[u].b;
                    v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.z9));
                    this.ya.addItem(b._inner[u], this.yd.d);
                    m.add(b._inner[u]);
                    k.add_1(b._inner[u]);
                    this.xz = true;
                }
            }
            for (let w = 0; w < c.count; w++) {
                if (!this.ya.containsKey(c._inner[w])) {
                    this.yd.f(c._inner[w]);
                    this.ya.addItem(c._inner[w], this.yd.d);
                    let x = c._inner[w].b;
                    x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.z9));
                    m.add(c._inner[w]);
                    k.add_1(c._inner[w]);
                    this.xz = true;
                }
            }
            if (this.xx == true) {
                this.xx = false;
                this.xz = true;
            }
            if (this.yf.count > 0) {
                this.xz = true;
                this.yf.clear();
                this.yc.clear();
            }
            r = this.yd.c;
            while (r != null) {
                let y = this.xv(r.c);
                if (y == null) {
                    return;
                }
                if (!Base.equalsStatic(y, r.c.c.c)) {
                    let z = false;
                    if (r.c.c.c == null) {
                        z = true;
                    }
                    let aa = r.c.c;
                    aa.o = y.b;
                    aa.p = y.c;
                    if (!isNaN_(aa.o) && !isNaN_(aa.p)) {
                        aa.n = y.e;
                        aa.m = y.d;
                        if (aa.b == null) {
                            this.xs.t(aa, false);
                        }
                        if (z) {
                            this.xs.aq(aa);
                        }
                        else {
                            this.xs.az(aa);
                        }
                    }
                }
                r = r.a;
            }
            let ab = this.xs.am();
            let ac = this.xs.u();
            if (ac) {
                if (this.xs.q()) {
                    this.xz = true;
                }
            }
            if (this.xz && (ab != 0 || ac)) {
                this.xz = false;
                this.yr = 0x7FFFFFFF;
                if (this.zd != null) {
                    let ad = true;
                    for (let ae = 0; ae < this.cy.series.count; ae++) {
                        let af = this.cy.series._inner[ae];
                        if (af.d6 && typeCast(CalloutLayer.$, af) !== null) {
                            let ag = af;
                            if (ag.zd == this.zd) {
                                if (!ag.abn.equals1(this.xs.a5)) {
                                    ad = false;
                                    break;
                                }
                            }
                        }
                    }
                    if (ad) {
                        this.xs.a4();
                    }
                    else {
                        this.xs.ar();
                        this.xs.as();
                    }
                }
                else {
                    this.xs.a4();
                }
            }
            else {
                this.xs.as();
            }
            let ah = this.yd.c;
            let ai;
            let aj;
            let ak;
            let al;
            let am;
            let an;
            let ao;
            let ap;
            let aq;
            let ar;
            let as;
            let at;
            let au;
            let av;
            let aw;
            let ax;
            let ay = this.x5;
            while (ah != null) {
                let az = ah.c;
                let a0 = az.b;
                ai = a0.bk;
                aj = a0.bm;
                ak = a0.bl;
                al = a0.backgroundPadding.left;
                am = a0.backgroundPadding.top;
                an = a0.backgroundPadding.right;
                ao = a0.backgroundPadding.bottom;
                aq = a0.backgroundCornerRadius;
                ap = a0.y;
                ar = a0.bn;
                as = a0.ao;
                at = a0.aa;
                let a1 = az.c;
                au = a1.o - (a1.g - a1.l);
                av = a1.p - (a1.h - a1.k);
                aw = a1.g - a1.l;
                ax = a1.h - a1.k;
                if (ay) {
                    let a2 = new CalloutRenderStyleUpdatingEventArgs();
                    a2.background = ai;
                    a2.outline = aj;
                    a2.leaderBrush = ak;
                    a2.strokeThickness = ap;
                    a2.textColor = ar;
                    a2.item = at;
                    a2.series = a0.l;
                    a2.actualPosition = a1.a;
                    a2.xValue = a0.ac;
                    a2.yValue = a0.ad;
                    if (this.calloutRenderStyleUpdating != null) {
                        this.calloutRenderStyleUpdating(this, a2);
                        ai = a2.background;
                        aj = a2.outline;
                        ak = a2.leaderBrush;
                        ap = a2.strokeThickness;
                        ar = a2.textColor;
                    }
                }
                a.n.add1(az);
                a.f.add(ai);
                a.i.add(aj);
                a.h.add(ak);
                a.k.add(al);
                a.m.add(am);
                a.l.add(an);
                a.j.add(ao);
                a.g.add(aq);
                a.o.add(ap);
                a.p.add(ar);
                a.q.add1(as);
                a.r.add1(at);
                a.u.add(au);
                a.v.add(av);
                a.s.add(aw);
                a.t.add(ax);
                ah = ah.a;
            }
        }
        aab() {
            if (this.xs != null) {
                let a = this.yd.c;
                while (a != null) {
                    let b = a.c.c;
                    if (b != null) {
                        this.xs.a2(b);
                    }
                    a = a.a;
                }
                let c = this.xs;
                c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.z8));
                this.xs = null;
            }
            this.aaa();
        }
        xt() {
            if (this.cy == null) {
                return null;
            }
            for (let a = 0; a < this.cy.series.count; a++) {
                let b = this.cy.series._inner[a];
                if (b.d6 && typeCast(CalloutLayer.$, b) !== null) {
                    let c = b;
                    if (c != this) {
                        if (c.zd != null && c.zd == this.zd) {
                            if (c.xs != null) {
                                return c.xs;
                            }
                        }
                    }
                }
            }
            return null;
        }
        yu() {
            return 20000;
        }
        yv() {
            return 300;
        }
        xu() {
            switch (this.w6) {
                case 0: return 2;
                case 2: return 1;
                case 3: return 2;
                case 1: return 0;
            }
            return 2;
        }
        z8(a) {
            let b = this.xs.am();
            if (b < this.yr) {
                this.yr = b;
                this.pp(false);
            }
        }
        xv(a) {
            let b = this.xf;
            if (a.b.l != null) {
                b = a.b.l;
            }
            if (b == null) {
                for (let c = 0; c < this.cy.series.count; c++) {
                    let d = this.cy.series._inner[c];
                    if (!d.d6) {
                        b = d;
                        break;
                    }
                }
            }
            if (b == null) {
                return null;
            }
            let e = b.ag();
            let f = b.h2();
            let g = null;
            let h = null;
            let i = false;
            for (let j = 0; j < e.length; j++) {
                if (e[j].b9) {
                    i = true;
                    g = e[j];
                }
                else if (e[j].cm) {
                    i = true;
                    h = e[j];
                }
                else if (e[j].cp) {
                    h = e[j];
                }
                else {
                    g = e[j];
                }
            }
            if (g == null || h == null) {
                return null;
            }
            if (!g.co() || !h.co()) {
                return null;
            }
            let k = 0;
            let l = 0;
            if (g.cb && g.categoryMode != 0) {
                if (b.ek) {
                    k = b.getOffsetValue();
                }
                else if (b.ec) {
                    k = b.getOffsetValue();
                }
            }
            if (h.cb && h.categoryMode != 0) {
                if (b.ec) {
                    l = b.getOffsetValue();
                }
            }
            let m = new ScalerParams(0, this.cy.tn, g.kd, g.ch, g.j8());
            m.b = f;
            let n = new ScalerParams(0, this.cy.tn, h.kd, h.ch, h.j8());
            n.b = f;
            let o = 0;
            let p = 0;
            if (i) {
                o = g.ej(this.yq(a.b.ac), m) + k;
                p = h.ej(this.yq(a.b.ad), n) + l;
                let q = o;
                let r = p;
                let s = { $type: Point_$type, x: 0.5, y: 0.5 };
                let t = s.x + (r * Math.cos(q));
                o = ViewportUtils.c(t, m.e, m.d);
                let u = s.y + (r * Math.sin(q));
                p = ViewportUtils.f(u, n.e, n.d);
            }
            else {
                o = g.ej(this.yq(a.b.ac), m) + k;
                p = h.ej(this.yq(a.b.ad), n) + l;
            }
            let v = new QuadTreeBoundingBox();
            v.b = o;
            v.c = p;
            v.e = 3;
            v.d = 3;
            v.g = a.b;
            return v;
        }
        yq(a) {
            if (typeCast(Date_$type, a) !== null) {
                return a.getTime();
            }
            if (a == null) {
                return 0;
            }
            return a;
        }
        yh() {
            let a = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let b = 0; b < this.yg.count; b++) {
                if (stringIsNullOrEmpty(this.yg._inner[b].b.ao)) {
                    continue;
                }
                if (this.yg._inner[b].c == null) {
                    let c = new LabelCollisionInfo();
                    this.yg._inner[b].c = c;
                    let d = this.w9.cq(this.yw(this.yg._inner[b]), this.yg._inner[b].b.backgroundPadding);
                    c.k = d.height / 2;
                    c.l = d.width / 2;
                }
                let e = this.xv(this.yg._inner[b]);
                if (e == null || e.b < this.tw.left || e.b > this.tw.right || e.c < this.tw.top || e.c > this.tw.bottom) {
                    continue;
                }
                a.add(this.yg._inner[b]);
            }
            return a;
        }
        yw(a) {
            return a.b.ao;
        }
        ul(a) {
            if (!super.ul(a)) {
                return false;
            }
            if (this.zs != null) {
                if (a.ep) {
                    let b = a.lu();
                    if (!Base.equalsStatic(this.zs, b)) {
                        return false;
                    }
                }
                else {
                    if (!Base.equalsStatic(this.zs, a.name)) {
                        return false;
                    }
                }
            }
            return true;
        }
        oo() {
            super.oo();
            if (!this.at.c && !this.dj()) {
                return;
            }
            if (this.xw) {
                this.xw = false;
                this.aad();
            }
            if (this.dj()) {
                this.aaj(this.ug, false);
            }
            else {
                this.aaj(this.ue, false);
            }
        }
        aae() {
            if (!this.xy) {
                this.xy = true;
                this.pp(true);
            }
        }
        aah(a, b, c) {
            let d = false;
            if (this.xy) {
                this.xy = false;
                d = true;
            }
            if (!a.fs && a.ds(this.ye, this.x9, this.x7, this.ys)) {
                let e = this.ye;
                for (let f = 0; f < this.ye.count; f++) {
                    let g = e._inner[f];
                    let h = g.a != null ? g.a.item : null;
                    let i = g.a.item != null ? g.a.item : g.a;
                    let j = a;
                    let k = new CalloutKey(i, j);
                    let l = new CalloutAnnotationWrapper();
                    let m = new CalloutAnnotation();
                    l.b = m;
                    m.key = k;
                    let n = false;
                    if (this.ya.containsKey(l)) {
                        l = this.ya.item(l).c;
                        m = l.b;
                        n = d;
                    }
                    else {
                        n = true;
                    }
                    let o = m.ac;
                    let p = m.ad;
                    if (this.yq(o) != this.yq(g.b)) {
                        m.xValue = g.b;
                    }
                    if (this.yq(p) != this.yq(g.c)) {
                        m.yValue = g.c;
                    }
                    m.series = a;
                    let q = false;
                    if (g.d != m.ay) {
                        m.ay = g.d;
                        q = true;
                    }
                    if (n || q) {
                        if (this.calloutLabelUpdating != null) {
                            let r = ((() => {
                                let $ret = new CalloutLabelUpdatingEventArgs();
                                $ret.d = m.ac;
                                $ret.e = m.ad;
                                $ret.item = h;
                                $ret.a = a;
                                $ret.f = a.name;
                                return $ret;
                            })());
                            this.calloutLabelUpdating(this, r);
                            if (r.c != null && !Base.equalsStatic(r.c, l.b.ao)) {
                                let s = r.c;
                                l.b.text = s != null ? s.toString() : "";
                            }
                        }
                        else {
                            if (g.d != null) {
                                m.text = g.d;
                            }
                        }
                    }
                    if (m.ao == null) {
                        continue;
                    }
                    if (n || q) {
                        if (this.calloutContentUpdating != null) {
                            let t = ((() => {
                                let $ret = new CalloutContentUpdatingEventArgs();
                                $ret.c = m.ac;
                                $ret.d = m.ad;
                                $ret.item = h;
                                $ret.a = i;
                                return $ret;
                            })());
                            this.calloutContentUpdating(this, t);
                            if (t.a != null && t.a != l.b.aa) {
                                l.b.content = t.a;
                            }
                        }
                        else {
                            if (i != null && i != l.b.aa) {
                                l.b.content = i;
                            }
                        }
                    }
                    if (n) {
                        this.aal(l);
                    }
                    if (l.c == null) {
                        let u = new LabelCollisionInfo();
                        l.c = u;
                        let v = this.w9.cq(this.yw(l), l.b.backgroundPadding);
                        u.k = v.height / 2;
                        u.l = v.width / 2;
                    }
                    let w = this.xv(l);
                    if (w == null || w.b < this.tw.left || w.b > this.tw.right || w.c < this.tw.top || w.c > this.tw.bottom) {
                        continue;
                    }
                    l.e = w.b;
                    l.f = w.c;
                    c.add(l);
                }
            }
        }
        bx() {
            return 1;
        }
        au(a, b) {
            let c = this.xs.f(a, b);
            if (c == null) {
                return null;
            }
            return c.u;
        }
        f4(a, b) {
            if (this.xs == null) {
                return false;
            }
            return this.xs.f(a, b) != null;
        }
        aaj(a, b) {
            let c = 0;
            let d = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            for (c = 0; c < a.q.count; c++) {
                let e = a.n._inner[c];
                if (isNaN_(a.u._inner[c]) || isNaN_(a.v._inner[c])) {
                    continue;
                }
                let f = this.w9.cb.item(e);
                d.add_1(e);
                if (f.h != a.q._inner[c]) {
                    f.h = a.q._inner[c];
                    let g = f.u();
                }
                f.e = a.o._inner[c];
                f.m = a.f._inner[c];
                f.p = a.p._inner[c];
                f.o = f.e > 0 ? a.i._inner[c] : this.cj.bt();
                f.n = a.h._inner[c];
                f.x = new Thickness(1, a.k._inner[c], a.m._inner[c], a.l._inner[c], a.j._inner[c]);
                f.d = a.g._inner[c];
                this.w9.cj(f, Math.min(a.s._inner[c], a.s._inner[c] + a.u._inner[c]), Math.min(a.t._inner[c], a.t._inner[c] + a.v._inner[c]));
                this.w9.ck(f, e, a.r._inner[c]);
                f.r = { $type: Point_$type, x: a.u._inner[c], y: a.v._inner[c] };
            }
            let h = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let i of fromEnum(this.w9.cb.c)) {
                if (!d.contains(i)) {
                    h.add(i);
                }
            }
            for (let j = 0; j < h.count; j++) {
                this.w9.cb.h(h._inner[j]);
            }
        }
        vx(a, b) {
            super.vx(a, b);
            if (this.dj()) {
                this.aaj(this.ug, true);
            }
            else {
                this.aaj(this.ue, false);
            }
        }
        fm() {
            return true;
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            switch (b) {
                case CalloutLayer.$$p[24]:
                    this.xg = null;
                    this.w9.ci();
                    this.pp(true);
                    break;
                case CalloutLayer.$$p[22]:
                case CalloutLayer.$$p[23]:
                    this.pp(true);
                    break;
                case CalloutLayer.$$p[14]:
                    this.pp(true);
                    break;
                case "SeriesViewer":
                    if (c != null) {
                        let e = c;
                        e.seriesAnimating = delegateRemove(e.seriesAnimating, runOn(this, this.aai));
                    }
                    if (d != null) {
                        let f = d;
                        f.seriesAnimating = delegateCombine(f.seriesAnimating, runOn(this, this.aai));
                    }
                    if (d == null) {
                        this.aab();
                    }
                    break;
                case "AutoCalloutVisibilityMode":
                    this.w3 = this.w5();
                    this.aac();
                    break;
                case "AllowedPositions":
                    if (c != null) {
                        let g = c;
                        g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.z6));
                    }
                    if (d != null) {
                        let h = d;
                        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.z6));
                    }
                    this.w0 = this.w1(this.xb);
                    this.aac();
                    break;
                case CalloutLayer.$$p[16]:
                case CalloutLayer.$$p[17]:
                case CalloutLayer.$$p[1]:
                case CalloutLayer.$$p[6]:
                case CalloutLayer.$$p[5]:
                case CalloutLayer.$$p[25]:
                case CalloutLayer.$$p[26]:
                case CalloutLayer.$$p[19]:
                case CalloutLayer.$$p[18]:
                case CalloutLayer.$$p[8]:
                case CalloutLayer.$$p[10]:
                case CalloutLayer.$$p[9]:
                case CalloutLayer.$$p[7]:
                case CalloutLayer.$$p[12]:
                case CalloutLayer.$$p[13]:
                    this.aac();
                    break;
                case CalloutLayer.$$p[21]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.xp);
                        this.xp = this.c5(this.zq);
                    }
                    break;
                case "LabelColumn":
                    this.aac();
                    break;
                case CalloutLayer.$$p[15]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.xn);
                        this.xn = this.c5(this.zg);
                    }
                    break;
                case "ContentColumn":
                    this.aac();
                    break;
                case CalloutLayer.$$p[28]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.xq);
                        this.xq = stringIsNullOrEmpty(this.z1) == false ? this.c5(this.z1) : null;
                    }
                    break;
                case "XColumn":
                    this.aac();
                    break;
                case CalloutLayer.$$p[29]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.xr);
                        this.xr = this.c5(this.z4);
                    }
                    break;
                case "YColumn":
                    this.aac();
                    break;
                case CalloutLayer.$$p[20]:
                    if (this.c6 != null) {
                        this.c6.deregisterColumn(this.xo);
                        this.xo = this.c5(this.zn);
                    }
                    break;
                case "KeyColumn":
                    this.aac();
                    break;
                case "FastItemsSource":
                    this.xx = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.xp);
                        c.deregisterColumn(this.xn);
                        c.deregisterColumn(this.xq);
                        c.deregisterColumn(this.xr);
                        c.deregisterColumn(this.xo);
                        this.xp = null;
                        this.xn = null;
                        this.xq = null;
                        this.xr = null;
                        this.xo = null;
                        this.yg.clear();
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.xp = this.c5(this.zq);
                        this.xn = this.c5(this.zg);
                        if (stringIsNullOrEmpty(this.z1) == false) {
                            this.xq = this.c5(this.z1);
                        }
                        this.xr = this.c5(this.z4);
                        this.xo = this.c5(this.zn);
                    }
                    this.aac();
                    break;
            }
        }
        w5() {
            if (this.w4 == 0) {
                return 1;
            }
            return this.w4;
        }
        w1(a) {
            if (a == null || a.count == 0) {
                return null;
            }
            let b = new Array(a.count);
            for (let c = 0; c < a.count; c++) {
                b[c] = a._inner[c];
            }
            return b;
        }
        aai(a) {
            if (a.d6) {
                return;
            }
            if ((a == this.xf || this.xf == null) && this.x3) {
                this.pp(false);
            }
        }
        aac() {
            if (this.xw == false) {
                this.xw = true;
                this.pp(false);
            }
        }
        aaa() {
            this.w9.cb.clear();
            this.yd.g();
            this.ya.clear();
        }
        aad() {
            if (this.xr == null || this.xp == null) {
                let a = this.yd.c;
                while (a != null) {
                    this.aal(a.c);
                    a = a.a;
                }
                return;
            }
            let b = this.yb();
            for (let c = 0; c < this.xr.count; c++) {
                let d;
                if (this.yg.count <= c) {
                    let e = new CalloutAnnotation();
                    d = new CalloutAnnotationWrapper();
                    d.b = e;
                    d.b.series = this.xf;
                    this.yg.add(d);
                }
                else {
                    d = this.yg._inner[c];
                }
                this.aak(c, b);
            }
        }
    }
    CalloutLayer.$t = /*@__PURE__*/ markType(CalloutLayer, 'CalloutLayer', AnnotationLayer.$);
    CalloutLayer.aa0 = /*@__PURE__*/ DependencyProperty.i("AutoCalloutVisibilityMode", AutoCalloutVisibilityMode_$type, CalloutLayer.$, /*@__PURE__*/ new PropertyMetadata(2, /*@__PURE__*/ enumGetBox(AutoCalloutVisibilityMode_$type, 0), (a, b) => a.raisePropertyChanged("AutoCalloutVisibilityMode", b.oldValue, b.newValue)));
    CalloutLayer.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, CalloutLayer, 'raisePropertyChanged', ['AutoCalloutLabelPrecision:ys:aam', [1, 5], 'CalloutBackground:abh:aan', [Brush.$, null], 'CalloutCollisionMode:w6:aao', [CalloutCollisionMode_$type, /*@__PURE__*/ enumGetBox(CalloutCollisionMode_$type, 3)], 'CalloutCornerRadius:yj:aap', [1, NaN], 'CalloutInterpolatedValuePrecision:yt:aaq', [1, -1], 'CalloutLeaderBrush:abi:aar', [Brush.$, null], 'CalloutOutline:abj:aas', [Brush.$, null], 'CalloutPaddingBottom:yk:aat', [1, NaN], 'CalloutPaddingLeft:yl:aau', [1, NaN], 'CalloutPaddingRight:ym:aav', [1, NaN], 'CalloutPaddingTop:yn:aaw', [1, NaN], 'CalloutPositionPadding:yo:aax', [1, 10], 'CalloutStrokeThickness:yp:aay', [1, NaN], 'CalloutTextColor:abk:aaz', [Brush.$, null], 'CollisionChannel:zd:aa1', [2, null], 'ContentMemberPath:zg:aa2', [2, null], 'IsAutoCalloutBehaviorEnabled:x3:aa3', [0, false], 'IsCalloutOffsettingEnabled:x4:aa4', [0, true], 'IsCustomCalloutRenderStyleEnabled:x5:aa5', [0, false], 'IsCustomCalloutStyleEnabled:x6:aa6', [0, false], 'KeyMemberPath:zn:aa7', [2, null], 'LabelMemberPath:zq:aa8', [2, null], 'TargetSeriesName:zs:aa9', [2, null], 'TargetSeries:xf:aba', [Series.$, null], 'TextStyle:zv:abb', [2, null], 'UseInterpolatedValueForAutoCalloutLabels:x7:abc', [0, false], 'UseSeriesColorForOutline:x8:abd', [0, false], 'UseValueForAutoCalloutLabels:x9:abe', [0, true], 'XMemberPath:z1:abf', [2, null], 'YMemberPath:z4:abg', [2, null]]);
    return CalloutLayer;
})();
/**
 * @hidden
 */
export let CalloutLayerView = /*@__PURE__*/ (() => {
    class CalloutLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b7 = null;
            this.cc = null;
            this.cb = null;
            this.cd = NaN;
            this.b8 = null;
            this.b7 = a;
            this.cc = new List$1(CalloutView.$, 0);
        }
        au() {
            super.au();
            this.cb = ((() => {
                let $ret = new HashPool$2(CalloutAnnotationWrapper.$, CalloutView.$);
                $ret.create = runOn(this, this.b9);
                $ret.activate = runOn(this, this.cf);
                $ret.disactivate = runOn(this, this.ch);
                $ret.destroy = runOn(this, this.cg);
                return $ret;
            })());
        }
        b9() {
            let a = new CalloutView(this);
            this.cc.add(a);
            return a;
        }
        cf(a) {
            a.y = 0;
        }
        ch(a) {
            a.y = 1;
        }
        cg(a) {
            this.cc.remove(a);
        }
        cp(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.m(a, 0.1);
        }
        a8(a, b) {
            super.a8(a, b);
            a.ad(this.ca());
            if (a.d && !b) {
                for (let c = 0; c < this.cc.count; c++) {
                    let d = this.cc._inner[c];
                    if (d.y == 0) {
                        d.j(a);
                    }
                }
            }
        }
        ca() {
            if (this.b7.xh != null) {
                return this.b7.xh;
            }
            return this.e.cy.getFontInfo();
        }
        an(a) {
            super.an(a);
            for (let b = 0; b < this.cc.count; b++) {
                let c = this.cc._inner[b];
                if (c.y != 0) {
                    continue;
                }
                c.i(this.b7, this.ca(), a);
            }
        }
        cr(a) {
            this.k.ad(this.ca());
            this.cd = this.ce();
            let b = this.k.ah(a, this.cd, true);
            return new Size(1, b.c, b.b);
        }
        ce() {
            let a = this.ca();
            if (isNaN_(this.cd)) {
                let b = FontUtil.getCurrentFontHeight(this.e.cy.cv.j.ae, a);
                this.cd = b;
            }
            return this.cd;
        }
        cq(a, b) {
            if (this.b8 == null) {
                this.b8 = new CalloutView(this);
            }
            this.b8.h = a;
            this.b8.x = b;
            let c = this.b8.u();
            this.b8.h = null;
            return c;
        }
        cj(a, b, c) {
            a.f = b;
            a.g = c;
        }
        ck(a, b, c) {
            a.k(this.e, b, c);
        }
        cl(a) {
            if (a != null) {
                return this.cp(a.sx);
            }
            return this.e.sx;
        }
        co() {
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        cn(a) {
            if (this.b7.x8) {
                if (a != null) {
                    return this.cp(a.sx);
                }
            }
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        cm(a) {
            if (a != null) {
                return this.cp(a.ss);
            }
            return this.e.ss;
        }
        ci() {
            this.cd = NaN;
        }
    }
    CalloutLayerView.$t = /*@__PURE__*/ markType(CalloutLayerView, 'CalloutLayerView', AnnotationLayerView.$);
    return CalloutLayerView;
})();
/**
 * @hidden
 */
export let CalloutView = /*@__PURE__*/ (() => {
    class CalloutView extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.y = 0;
            this.l = null;
            this.t = null;
            this.q = { $type: Point_$type, x: 0, y: 0 };
            this.s = null;
            this.w = new Thickness(0, 0);
            this.v = null;
            this.c = 0;
            this.f = 0;
            this.g = 0;
            this.b = null;
            this.s = new Line();
            this.s.ab = false;
            this.s._stroke = ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 0, 0, 0);
                return $ret;
            })());
            this.s.ad = 2;
            this.l = new TextBlock();
            this.t = new Rectangle();
            this.t.ad = 0;
            this.a = a;
            this.y = 0;
        }
        j(a) {
            a.aa();
            a.ag(this.f, this.g);
            let b = new TranslateTransform();
            b.j = this.v.left;
            b.k = this.v.top;
            this.t.j = b;
            a.s(this.s);
            a.aa();
            this.t.width = this.l.m + this.w.left + this.w.right;
            this.t.height = this.l.l + this.w.top + this.w.bottom;
            this.t.ap = this.c;
            this.t.aq = this.c;
            a.k(this.t.j);
            a.w(this.t);
            this.l.ag = true;
            this.l.o = this.w.top;
            this.l.n = this.w.left;
            a.x(this.l);
            a.z();
            a.z();
        }
        get r() {
            return this.q;
        }
        set r(a) {
            if (this.q.x != a.x || this.q.y != a.y) {
                let b = this.u();
                let c = b.height;
                let d = b.width;
                this.q = a;
                let e = CalloutViewHelper.b(this.r, d, c, this.s);
                this.v = e;
            }
        }
        get p() {
            return this.l.ao;
        }
        set p(a) {
            this.l.ao = a;
        }
        get o() {
            return this.t._stroke;
        }
        set o(a) {
            this.t._stroke = a;
        }
        get n() {
            return this.s._stroke;
        }
        set n(a) {
            this.s._stroke = a;
        }
        get m() {
            return this.t._fill;
        }
        set m(a) {
            this.t._fill = a;
        }
        get e() {
            return this.t.ad;
        }
        set e(a) {
            this.t.ad = a;
        }
        get x() {
            return this.w;
        }
        set x(a) {
            this.w = a;
        }
        get d() {
            return this.c;
        }
        set d(a) {
            this.c = a;
        }
        get h() {
            return this.l.al;
        }
        set h(a) {
            if (a == null) {
                this.l.al = "";
            }
            else {
                this.l.al = a.toString();
            }
            let b = this.u();
            let c = b.height;
            let d = b.width;
            let e = CalloutViewHelper.b(this.r, d, c, this.s);
            this.v = e;
        }
        u() {
            let a = this.a.cr(this.l);
            this.l.m = a.width;
            this.l.l = a.height;
            return new Size(1, a.width + this.w.left + this.w.right, a.height + this.w.top + this.w.bottom);
        }
        k(a, b, c) {
            if (this.b == null) {
                this.b = new DataContext();
            }
            this.b.series = a;
            this.b.item = c;
            if (b.c != null) {
                b.c.u = this.b;
            }
        }
        i(a, b, c) {
            a.a9.exportCalloutData(this.f, this.g, this.v.left, this.v.top, c, this.t, this.l, b, this.s, "callout", ["Main", "Callout"]);
        }
    }
    CalloutView.$t = /*@__PURE__*/ markType(CalloutView, 'CalloutView');
    return CalloutView;
})();
