/*
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-angular-core";
import { Base, runOn, delegateCombine, String_$type, enumGetBox, EnumUtil, typeCast, fromEnum, delegateRemove, Point_$type, Date_$type, markType, markDep } from "igniteui-angular-core";
import { Series } from "./Series";
import { CalloutPlacementPositionsCollection } from "./CalloutPlacementPositionsCollection";
import { AutoCalloutVisibilityMode_$type } from "./AutoCalloutVisibilityMode";
import { Brush } from "igniteui-angular-core";
import { Thickness } from "igniteui-angular-core";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { FontUtil } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { CalloutLayerFrame } from "./CalloutLayerFrame";
import { HashSet$1 } from "igniteui-angular-core";
import { CalloutAnnotationWrapper } from "./CalloutAnnotationWrapper";
import { List$1 } from "igniteui-angular-core";
import { LinkedList$1 } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { LinkedListNode$1 } from "igniteui-angular-core";
import { LabelCollisionManager } from "igniteui-angular-core";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { CalloutLabelUpdatingEventArgs } from "./CalloutLabelUpdatingEventArgs";
import { CalloutSeriesSelectingEventArgs } from "./CalloutSeriesSelectingEventArgs";
import { CalloutStyleUpdatingEventArgs } from "./CalloutStyleUpdatingEventArgs";
import { DeviceUtils } from "igniteui-angular-core";
import { CalloutRenderStyleUpdatingEventArgs } from "./CalloutRenderStyleUpdatingEventArgs";
import { LabelCollisionInfo } from "igniteui-angular-core";
import { QuadTreeBoundingBox } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ViewportUtils } from "./ViewportUtils";
import { Size } from "igniteui-angular-core";
import { CalloutContentUpdatingEventArgs } from "./CalloutContentUpdatingEventArgs";
import { CalloutKey } from "./CalloutKey";
import { DataContext } from "igniteui-angular-core";
import { HashPool$2 } from "igniteui-angular-core";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { FastItemObjectColumn } from "igniteui-angular-core";
import { AnnotationLayerView } from "./AnnotationLayerView";
import { BrushUtil } from "igniteui-angular-core";
import { TextBlock } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
import { Line } from "igniteui-angular-core";
import { CalloutViewHelper } from "./CalloutViewHelper";
import { Rectangle } from "igniteui-angular-core";
import { TranslateTransform } from "igniteui-angular-core";
/**
 * @hidden
 */
export let CalloutLayer = /*@__PURE__*/ (() => {
    class CalloutLayer extends AnnotationLayer {
        constructor() {
            super();
            this.calloutStyleUpdating = null;
            this.calloutRenderStyleUpdating = null;
            this.rw = null;
            this.rx = null;
            this.ry = null;
            this.rv = null;
            this.ru = null;
            this.so = new HashSet$1(CalloutAnnotationWrapper.$, 0);
            this.sr = new List$1(CalloutAnnotationWrapper.$, 0);
            this.ss = new List$1(CalloutAnnotationWrapper.$, 0);
            this.rm = null;
            this.rc = null;
            this.rs = null;
            this.sp = new LinkedList$1(CalloutAnnotationWrapper.$);
            this.sm = new Dictionary$2(CalloutAnnotationWrapper.$, LinkedListNode$1.$.specialize(CalloutAnnotationWrapper.$), 0);
            this.r4 = null;
            this.vy = new Rect(0, 0, 0, 1, 1);
            this.sb = false;
            this.s3 = 0;
            this.vx = Rect.empty;
            this.r9 = false;
            this.sa = false;
            this.calloutContentUpdating = null;
            this.calloutLabelUpdating = null;
            this.calloutSeriesSelecting = null;
            this.sq = new List$1(SeriesPointOfInterest.$, 0);
            this.sd = false;
            this.se = false;
            this.su = 0;
            this.sc = false;
            this.r8 = true;
            this.re = 1;
            FastItemObjectColumn.m();
            this.rc = null;
            this.rm = new CalloutPlacementPositionsCollection();
            let a = this.rm;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.ui));
            this.qi = true;
            let b = new CalloutLayerFrame();
            let c = new CalloutLayerFrame();
            let d = new CalloutLayerFrame();
            let e = this.ho / 1000;
            this.qa = b;
            this.p9 = c;
            this.qb = d;
            this.ab = CalloutLayer.$;
        }
        get_c8() {
            return true;
        }
        ui(a, b) {
            this.ur();
        }
        ur() {
            this.rc = this.rd(this.rn);
            this.uo();
        }
        uj(a, b) {
            this.ss.clear();
            this.ml(false);
        }
        k3(a, b, c, d) {
            super.k3(a, b, c, d);
            let e = this.sn();
            switch (a) {
                case 3:
                    this.uw(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.rr;
                        this.ss.insert(f, h);
                        this.uw(f, e);
                    }
                    break;
                case 0:
                    this.ss.v(b, c);
                    break;
                case 2:
                    for (let i = b; i < b + c; i++) {
                        this.uw(i, e);
                    }
                    break;
                case 4:
                    this.ss.clear();
                    for (let j = 0; j < this.ck.count; j++) {
                        let k = new CalloutAnnotation();
                        let l = new CalloutAnnotationWrapper();
                        l.b = k;
                        l.b.series = this.rr;
                        this.ss.add(l);
                        this.uw(j, e);
                    }
                    break;
            }
            this.ml(true);
        }
        ep(a) {
            return false;
        }
        sn() {
            let a = new Dictionary$2(String_$type, Series.$, 0);
            if (this.cd != null) {
                for (let b = 0; b < this.cd.series.count; b++) {
                    let c = this.cd.series._inner[b];
                    if (c.name != null && !a.containsKey(c.name)) {
                        a.addItem(c.name, c);
                    }
                }
            }
            return a;
        }
        uw(a, b) {
            if (this.r3 == null || this.r1 == null) {
                return;
            }
            let c = a;
            if (this.r2 != null) {
                c = this.r2.item(a);
            }
            let d = this.r3.item(a);
            let e = this.r1.item(a);
            let f = this.ss._inner[a];
            if (this.r0 != null) {
                if (f.b.ab != this.r0.item(a)) {
                    f.b.key = this.r0.item(a);
                }
            }
            if (this.sm.containsKey(f)) {
                f.b = this.sm.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.ck.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.rz != null) {
                f.b.content = this.rz.item(a);
            }
            else {
                f.b.content = this.ck.item(a);
            }
            if (this.calloutSeriesSelecting != null) {
                let i = ((() => {
                    let $ret = new CalloutSeriesSelectingEventArgs();
                    $ret.c = c;
                    $ret.d = d;
                    $ret.item = this.ck.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.ux(f);
        }
        ux(a) {
            let b = new Thickness(0, DeviceUtils.g(3));
            if (isNaN_(this.v0.left) || isNaN_(this.v0.top) || isNaN_(this.v0.right) || isNaN_(this.v0.bottom)) {
                b = new Thickness(0, DeviceUtils.g(3));
            }
            else {
                b = this.v0;
            }
            let c = DeviceUtils.g(3);
            if (isNaN_(this.sv)) {
                c = DeviceUtils.g(3);
            }
            else {
                c = this.sv;
            }
            let d = this.vt != null ? this.vt : this.rl.ci(a.b.l);
            let e = this.vw != null ? this.vw : this.rl.cl();
            let f = this.vv != null ? this.vv : this.rl.ck(a.b.l);
            let g = this.vu != null ? this.vu : this.rl.cj(a.b.l);
            let h = isNaN_(this.s1) ? 0 : this.s1;
            if (this.si && 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;
        }
        hy(a, b) {
            let c = this.js(b);
            if (c == CalloutLayer.$$p[21]) {
                return this.hz(a, b, this.t2);
            }
            if (c == CalloutLayer.$$p[28]) {
                return this.hz(a, b, this.ud);
            }
            if (c == CalloutLayer.$$p[29]) {
                return this.hz(a, b, this.ug);
            }
            if (c == CalloutLayer.$$p[20]) {
                return this.hz(a, b, this.tz);
            }
            if (c == CalloutLayer.$$p[15]) {
                return this.hz(a, b, this.ts);
            }
            return super.hy(a, b);
        }
        get r1() {
            return this.rw;
        }
        set r1(a) {
            if (this.rw != a) {
                let b = this.rw;
                this.rw = a;
                this.raisePropertyChanged("LabelColumn", b, this.rw);
            }
        }
        get r2() {
            return this.rx;
        }
        set r2(a) {
            if (this.rx != a) {
                let b = this.rx;
                this.rx = a;
                this.raisePropertyChanged("XColumn", b, this.rx);
            }
        }
        get r3() {
            return this.ry;
        }
        set r3(a) {
            if (this.ry != a) {
                let b = this.ry;
                this.ry = a;
                this.raisePropertyChanged("YColumn", b, this.ry);
            }
        }
        get r0() {
            return this.rv;
        }
        set r0(a) {
            if (this.rv != a) {
                let b = this.rv;
                this.rv = a;
                this.raisePropertyChanged("KeyColumn", b, this.rv);
            }
        }
        get rz() {
            return this.ru;
        }
        set rz(a) {
            if (this.ru != a) {
                let b = this.ru;
                this.ru = a;
                this.raisePropertyChanged("ContentColumn", b, this.ru);
            }
        }
        ul(a, b) {
            if (b.propertyName == CalloutAnnotation.$$p[14] || b.propertyName == CalloutAnnotation.$$p[15]) {
                let c = a.k;
                if (!this.so.contains(c)) {
                    this.so.add_1(c);
                    this.sr.add(c);
                    this.ml(false);
                }
            }
        }
        bx() {
            return new CalloutLayerView(this);
        }
        l2(a) {
            super.l2(a);
            this.rl = a;
        }
        get rn() {
            return this.rm;
        }
        set rn(a) {
            let b = this.rn;
            if (a != b) {
                this.rm = a;
                this.raisePropertyChanged("AllowedPositions", b, this.rn);
            }
        }
        get rg() {
            return EnumUtil.getEnumValue(AutoCalloutVisibilityMode_$type, this.c(CalloutLayer.vc));
        }
        set rg(a) {
            this.h(CalloutLayer.vc, enumGetBox(AutoCalloutVisibilityMode_$type, a));
        }
        get rf() {
            return this.re;
        }
        set rf(a) {
            this.re = a;
        }
        get v0() {
            return new Thickness(1, this.sx, this.sz, this.sy, this.sw);
        }
        get rt() {
            if (this.rs == null) {
                this.rs = FontUtil.toFontInfo(this.hb, this.t7);
            }
            return this.rs;
        }
        qt(a, b) {
            if (this.rr == null || this.rr == a) {
                if (!this.as.c) {
                    this.ml(b);
                }
            }
        }
        qv(a, b) {
            super.qv(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.st();
            let e = new List$1(CalloutAnnotationWrapper.$, 0);
            let f = true;
            if (this.sf) {
                if (this.qg(this.rr)) {
                    this.ut(this.rr, c, e);
                }
                else {
                    for (let g of fromEnum(this.cd.series)) {
                        if (this.qg(g)) {
                            if (!g.dc) {
                                if (!g.isVertical) {
                                    f = false;
                                }
                            }
                            this.ut(g, c, e);
                        }
                    }
                }
            }
            if (this.sf && this.rf == 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.us(c, d, e);
        }
        m9(a, b) {
            super.m9(a, b);
            let c = b.width - this.vy.width;
            let d = b.height - this.vy.height;
            let e = 0;
            if (Math.abs(c) > Math.abs(d)) {
                e = c;
                this.su = c * this.p3.width;
            }
            else {
                e = d;
                this.su = d * this.p3.height;
            }
            if (e > 0 && this.su > 5) {
                this.se = true;
            }
            if (e < 0 && this.su > 5) {
                this.sd = true;
            }
        }
        m8(a, b) {
            super.m8(a, b);
            if (!a.equals1(b)) {
                this.sc = true;
            }
        }
        get vz() {
            return this.vx;
        }
        set vz(a) {
            this.vx = a;
        }
        us(a, b, c) {
            if (this.cd != null) {
                this.vy = this.cd.s9;
            }
            if (this.p3.isEmpty) {
                return;
            }
            this.vz = new Rect(0, this.p3.left, this.p3.top, this.p3.width, this.p3.height);
            if (this.r4 != null && this.tp != null && this.tp != this.r4.ap) {
                this.un();
            }
            if (this.r4 == null) {
                let d = this.r5();
                if (d != null) {
                    this.r4 = d;
                    let e = this.r4;
                    e.labelsMoved = delegateCombine(e.labelsMoved, runOn(this, this.uk));
                }
                else {
                    let f = this.pv(this.b0);
                    let g = new Array(2);
                    g[0] = 0;
                    g[1] = 3;
                    if (this.rr != null) {
                        if (this.rr.isVertical) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    else {
                        let h = false;
                        if (this.cd != null && this.cd.series.count > 0) {
                            h = true;
                            for (let i of fromEnum(this.cd.series)) {
                                if (!i.dc) {
                                    if (!i.isVertical) {
                                        h = false;
                                    }
                                }
                            }
                        }
                        if (h) {
                            g = new Array(2);
                            g[0] = 2;
                            g[1] = 1;
                        }
                    }
                    this.r4 = new LabelCollisionManager(this.p3.right, this.p3.bottom, this.p3, this.rl.j(), this.s0, this.r6(), g, this.s7(), this.s6(), this.sg, this.rc);
                    if (this.tp != null) {
                        this.r4.ap = this.tp;
                        this.r4.an = this;
                    }
                    let j = this.r4;
                    j.labelsMoved = delegateCombine(j.labelsMoved, runOn(this, this.uk));
                }
            }
            if (this.sd) {
                this.sd = false;
                if (this.r4.al > 2) {
                    this.sb = true;
                }
            }
            if (this.se) {
                this.se = false;
                if (this.su > 5) {
                    this.sb = true;
                }
            }
            if (this.sc) {
                this.sc = false;
                this.r4.a3(this.p3.right, this.p3.bottom, this.p3);
                this.sb = 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.sp.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.ul));
                    this.sp.h(r);
                    this.sm.removeItem(r.c);
                    this.r4.a2(r.c.c);
                }
                r = s;
            }
            for (let u = 0; u < b.count; u++) {
                if (!this.sm.containsKey(b._inner[u])) {
                    this.sp.f(b._inner[u]);
                    let v = b._inner[u].b;
                    v.propertyChanged = delegateCombine(v.propertyChanged, runOn(this, this.ul));
                    this.sm.addItem(b._inner[u], this.sp.d);
                    m.add(b._inner[u]);
                    k.add_1(b._inner[u]);
                    this.sb = true;
                }
            }
            for (let w = 0; w < c.count; w++) {
                if (!this.sm.containsKey(c._inner[w])) {
                    this.sp.f(c._inner[w]);
                    this.sm.addItem(c._inner[w], this.sp.d);
                    let x = c._inner[w].b;
                    x.propertyChanged = delegateCombine(x.propertyChanged, runOn(this, this.ul));
                    m.add(c._inner[w]);
                    k.add_1(c._inner[w]);
                    this.sb = true;
                }
            }
            if (this.r9 == true) {
                this.r9 = false;
                this.sb = true;
            }
            if (this.sr.count > 0) {
                this.sb = true;
                this.sr.clear();
                this.so.clear();
            }
            r = this.sp.c;
            while (r != null) {
                let y = this.r7(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.r4.t(aa, false);
                        }
                        if (z) {
                            this.r4.aq(aa);
                        }
                        else {
                            this.r4.az(aa);
                        }
                    }
                }
                r = r.a;
            }
            let ab = this.r4.am();
            let ac = this.r4.u();
            if (ac) {
                if (this.r4.q()) {
                    this.sb = true;
                }
            }
            if (this.sb && (ab != 0 || ac)) {
                this.sb = false;
                this.s3 = 0x7FFFFFFF;
                if (this.tp != null) {
                    let ad = true;
                    for (let ae = 0; ae < this.cd.series.count; ae++) {
                        let af = this.cd.series._inner[ae];
                        if (af.dc && typeCast(CalloutLayer.$, af) !== null) {
                            let ag = af;
                            if (ag.tp == this.tp) {
                                if (!ag.vz.equals1(this.r4.a5)) {
                                    ad = false;
                                    break;
                                }
                            }
                        }
                    }
                    if (ad) {
                        this.r4.a4();
                    }
                    else {
                        this.r4.ar();
                        this.r4.as();
                    }
                }
                else {
                    this.r4.a4();
                }
            }
            else {
                this.r4.as();
            }
            let ah = this.sp.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.sh;
            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;
            }
        }
        un() {
            if (this.r4 != null) {
                let a = this.sp.c;
                while (a != null) {
                    let b = a.c.c;
                    if (b != null) {
                        this.r4.a2(b);
                    }
                    a = a.a;
                }
                let c = this.r4;
                c.labelsMoved = delegateRemove(c.labelsMoved, runOn(this, this.uk));
                this.r4 = null;
            }
            this.um();
        }
        r5() {
            if (this.cd == null) {
                return null;
            }
            for (let a = 0; a < this.cd.series.count; a++) {
                let b = this.cd.series._inner[a];
                if (b.dc && typeCast(CalloutLayer.$, b) !== null) {
                    let c = b;
                    if (c != this) {
                        if (c.tp != null && c.tp == this.tp) {
                            if (c.r4 != null) {
                                return c.r4;
                            }
                        }
                    }
                }
            }
            return null;
        }
        s6() {
            return 20000;
        }
        s7() {
            return 300;
        }
        r6() {
            switch (this.ri) {
                case 0: return 2;
                case 2: return 1;
                case 3: return 2;
                case 1: return 0;
            }
            return 2;
        }
        uk(a) {
            let b = this.r4.am();
            if (b < this.s3) {
                this.s3 = b;
                this.ml(false);
            }
        }
        r7(a) {
            let b = this.rr;
            if (a.b.l != null) {
                b = a.b.l;
            }
            if (b == null) {
                for (let c = 0; c < this.cd.series.count; c++) {
                    let d = this.cd.series._inner[c];
                    if (!d.dc) {
                        b = d;
                        break;
                    }
                }
            }
            if (b == null) {
                return null;
            }
            let e = b.ag();
            let f = b.ge();
            let g = null;
            let h = null;
            let i = false;
            for (let j = 0; j < e.length; j++) {
                if (e[j].b8) {
                    i = true;
                    g = e[j];
                }
                else if (e[j].cl) {
                    i = true;
                    h = e[j];
                }
                else if (e[j].co) {
                    h = e[j];
                }
                else {
                    g = e[j];
                }
            }
            if (g == null || h == null) {
                return null;
            }
            if (!g.cn() || !h.cn()) {
                return null;
            }
            let k = 0;
            let l = 0;
            if (g.ca && g.categoryMode != 0) {
                if (b.dq) {
                    k = b.getOffsetValue();
                }
                else if (b.dh) {
                    k = b.getOffsetValue();
                }
            }
            if (h.ca && h.categoryMode != 0) {
                if (b.dh) {
                    l = b.getOffsetValue();
                }
            }
            let m = new ScalerParams(0, this.cd.s9, g.kc, g.cg, g.j7());
            m.b = f;
            let n = new ScalerParams(0, this.cd.s9, h.kc, h.cg, h.j7());
            n.b = f;
            let o = 0;
            let p = 0;
            if (i) {
                o = g.ei(this.s2(a.b.ac), m) + k;
                p = h.ei(this.s2(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.ei(this.s2(a.b.ac), m) + k;
                p = h.ei(this.s2(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;
        }
        s2(a) {
            if (typeCast(Date_$type, a) !== null) {
                return a.getTime();
            }
            if (a == null) {
                return 0;
            }
            return a;
        }
        st() {
            let a = new List$1(CalloutAnnotationWrapper.$, 0);
            for (let b = 0; b < this.ss.count; b++) {
                if (stringIsNullOrEmpty(this.ss._inner[b].b.ao)) {
                    continue;
                }
                if (this.ss._inner[b].c == null) {
                    let c = new LabelCollisionInfo();
                    this.ss._inner[b].c = c;
                    let d = this.rl.cn(this.s8(this.ss._inner[b]), this.ss._inner[b].b.backgroundPadding);
                    c.k = d.height / 2;
                    c.l = d.width / 2;
                }
                let e = this.r7(this.ss._inner[b]);
                if (e == null || e.b < this.p3.left || e.b > this.p3.right || e.c < this.p3.top || e.c > this.p3.bottom) {
                    continue;
                }
                a.add(this.ss._inner[b]);
            }
            return a;
        }
        s8(a) {
            return a.b.ao;
        }
        qg(a) {
            if (!super.qg(a)) {
                return false;
            }
            if (this.t4 != null) {
                if (a.dv) {
                    let b = a.jr();
                    if (!Base.equalsStatic(this.t4, b)) {
                        return false;
                    }
                }
                else {
                    if (!Base.equalsStatic(this.t4, a.name)) {
                        return false;
                    }
                }
            }
            return true;
        }
        lv() {
            super.lv();
            if (!this.as.c && !this.cv()) {
                return;
            }
            if (this.r8) {
                this.r8 = false;
                this.up();
            }
            if (this.cv()) {
                this.uv(this.qb, false);
            }
            else {
                this.uv(this.p9, false);
            }
        }
        uq() {
            if (!this.sa) {
                this.sa = true;
                this.ml(true);
            }
        }
        ut(a, b, c) {
            let d = false;
            if (this.sa) {
                this.sa = false;
                d = true;
            }
            if (!a.er && a.c1(this.sq, this.sl, this.sj, this.s4)) {
                let e = this.sq;
                for (let f = 0; f < this.sq.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.sm.containsKey(l)) {
                        l = this.sm.item(l).c;
                        m = l.b;
                        n = d;
                    }
                    else {
                        n = true;
                    }
                    let o = m.ac;
                    let p = m.ad;
                    if (this.s2(o) != this.s2(g.b)) {
                        m.xValue = g.b;
                    }
                    if (this.s2(p) != this.s2(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.ux(l);
                    }
                    if (l.c == null) {
                        let u = new LabelCollisionInfo();
                        l.c = u;
                        let v = this.rl.cn(this.s8(l), l.b.backgroundPadding);
                        u.k = v.height / 2;
                        u.l = v.width / 2;
                    }
                    let w = this.r7(l);
                    if (w == null || w.b < this.p3.left || w.b > this.p3.right || w.c < this.p3.top || w.c > this.p3.bottom) {
                        continue;
                    }
                    l.e = w.b;
                    l.f = w.c;
                    c.add(l);
                }
            }
        }
        bp() {
            return 1;
        }
        at(a, b) {
            let c = this.r4.f(a, b);
            if (c == null) {
                return null;
            }
            return c.u;
        }
        ex(a, b) {
            if (this.r4 == null) {
                return false;
            }
            return this.r4.f(a, b) != null;
        }
        uv(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.rl.b8.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.b0.bq();
                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.rl.cg(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.rl.ch(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.rl.b8.c)) {
                if (!d.contains(i)) {
                    h.add(i);
                }
            }
            for (let j = 0; j < h.count; j++) {
                this.rl.b8.h(h._inner[j]);
            }
        }
        qy(a, b) {
            super.qy(a, b);
            if (this.cv()) {
                this.uv(this.qb, true);
            }
            else {
                this.uv(this.p9, false);
            }
        }
        en() {
            return true;
        }
        l7(a, b, c, d) {
            super.l7(a, b, c, d);
            switch (b) {
                case CalloutLayer.$$p[24]:
                    this.rs = null;
                    this.rl.cf();
                    this.ml(true);
                    break;
                case CalloutLayer.$$p[22]:
                case CalloutLayer.$$p[23]:
                    this.ml(true);
                    break;
                case CalloutLayer.$$p[14]:
                    this.ml(true);
                    break;
                case "SeriesViewer":
                    if (c != null) {
                        let e = c;
                        e.seriesAnimating = delegateRemove(e.seriesAnimating, runOn(this, this.uu));
                    }
                    if (d != null) {
                        let f = d;
                        f.seriesAnimating = delegateCombine(f.seriesAnimating, runOn(this, this.uu));
                    }
                    if (d == null) {
                        this.un();
                    }
                    break;
                case "AutoCalloutVisibilityMode":
                    this.rf = this.rh();
                    this.uo();
                    break;
                case "AllowedPositions":
                    if (c != null) {
                        let g = c;
                        g.collectionChanged = delegateRemove(g.collectionChanged, runOn(this, this.ui));
                    }
                    if (d != null) {
                        let h = d;
                        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.ui));
                    }
                    this.rc = this.rd(this.rn);
                    this.uo();
                    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.uo();
                    break;
                case CalloutLayer.$$p[21]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.r1);
                        this.r1 = this.cj(this.t2);
                    }
                    break;
                case "LabelColumn":
                    this.uo();
                    break;
                case CalloutLayer.$$p[15]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.rz);
                        this.rz = this.cj(this.ts);
                    }
                    break;
                case "ContentColumn":
                    this.uo();
                    break;
                case CalloutLayer.$$p[28]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.r2);
                        this.r2 = stringIsNullOrEmpty(this.ud) == false ? this.cj(this.ud) : null;
                    }
                    break;
                case "XColumn":
                    this.uo();
                    break;
                case CalloutLayer.$$p[29]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.r3);
                        this.r3 = this.cj(this.ug);
                    }
                    break;
                case "YColumn":
                    this.uo();
                    break;
                case CalloutLayer.$$p[20]:
                    if (this.ck != null) {
                        this.ck.deregisterColumn(this.r0);
                        this.r0 = this.cj(this.tz);
                    }
                    break;
                case "KeyColumn":
                    this.uo();
                    break;
                case "FastItemsSource":
                    this.r9 = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        c.deregisterColumn(this.r1);
                        c.deregisterColumn(this.rz);
                        c.deregisterColumn(this.r2);
                        c.deregisterColumn(this.r3);
                        c.deregisterColumn(this.r0);
                        this.r1 = null;
                        this.rz = null;
                        this.r2 = null;
                        this.r3 = null;
                        this.r0 = null;
                        this.ss.clear();
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        this.r1 = this.cj(this.t2);
                        this.rz = this.cj(this.ts);
                        if (stringIsNullOrEmpty(this.ud) == false) {
                            this.r2 = this.cj(this.ud);
                        }
                        this.r3 = this.cj(this.ug);
                        this.r0 = this.cj(this.tz);
                    }
                    this.uo();
                    break;
            }
        }
        rh() {
            if (this.rg == 0) {
                return 1;
            }
            return this.rg;
        }
        rd(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;
        }
        uu(a) {
            if (a.dc) {
                return;
            }
            if ((a == this.rr || this.rr == null) && this.sf) {
                this.ml(false);
            }
        }
        uo() {
            if (this.r8 == false) {
                this.r8 = true;
                this.ml(false);
            }
        }
        um() {
            this.rl.b8.clear();
            this.sp.g();
            this.sm.clear();
        }
        up() {
            if (this.r3 == null || this.r1 == null) {
                let a = this.sp.c;
                while (a != null) {
                    this.ux(a.c);
                    a = a.a;
                }
                return;
            }
            let b = this.sn();
            for (let c = 0; c < this.r3.count; c++) {
                let d;
                if (this.ss.count <= c) {
                    let e = new CalloutAnnotation();
                    d = new CalloutAnnotationWrapper();
                    d.b = e;
                    d.b.series = this.rr;
                    this.ss.add(d);
                }
                else {
                    d = this.ss._inner[c];
                }
                this.uw(c, b);
            }
        }
    }
    CalloutLayer.$t = markType(CalloutLayer, 'CalloutLayer', AnnotationLayer.$);
    CalloutLayer.vc = DependencyProperty.i("AutoCalloutVisibilityMode", AutoCalloutVisibilityMode_$type, CalloutLayer.$, new PropertyMetadata(2, enumGetBox(AutoCalloutVisibilityMode_$type, 0), (a, b) => a.raisePropertyChanged("AutoCalloutVisibilityMode", b.oldValue, b.newValue)));
    CalloutLayer.$$p = markDep(DependencyProperty, PropertyMetadata, CalloutLayer, 'raisePropertyChanged', ['AutoCalloutLabelPrecision:s4:uy', [1, 5], 'CalloutBackground:vt:uz', [Brush.$, null], 'CalloutCollisionMode:ri:u0', [CalloutCollisionMode_$type, enumGetBox(CalloutCollisionMode_$type, 3)], 'CalloutCornerRadius:sv:u1', [1, NaN], 'CalloutInterpolatedValuePrecision:s5:u2', [1, -1], 'CalloutLeaderBrush:vu:u3', [Brush.$, null], 'CalloutOutline:vv:u4', [Brush.$, null], 'CalloutPaddingBottom:sw:u5', [1, NaN], 'CalloutPaddingLeft:sx:u6', [1, NaN], 'CalloutPaddingRight:sy:u7', [1, NaN], 'CalloutPaddingTop:sz:u8', [1, NaN], 'CalloutPositionPadding:s0:u9', [1, 10], 'CalloutStrokeThickness:s1:va', [1, NaN], 'CalloutTextColor:vw:vb', [Brush.$, null], 'CollisionChannel:tp:vd', [2, null], 'ContentMemberPath:ts:ve', [2, null], 'IsAutoCalloutBehaviorEnabled:sf:vf', [0, false], 'IsCalloutOffsettingEnabled:sg:vg', [0, true], 'IsCustomCalloutRenderStyleEnabled:sh:vh', [0, false], 'IsCustomCalloutStyleEnabled:si:vi', [0, false], 'KeyMemberPath:tz:vj', [2, null], 'LabelMemberPath:t2:vk', [2, null], 'TargetSeriesName:t4:vl', [2, null], 'TargetSeries:rr:vm', [Series.$, null], 'TextStyle:t7:vn', [2, null], 'UseInterpolatedValueForAutoCalloutLabels:sj:vo', [0, false], 'UseSeriesColorForOutline:sk:vp', [0, false], 'UseValueForAutoCalloutLabels:sl:vq', [0, true], 'XMemberPath:ud:vr', [2, null], 'YMemberPath:ug:vs', [2, null]]);
    return CalloutLayer;
})();
/**
 * @hidden
 */
export let CalloutLayerView = /*@__PURE__*/ (() => {
    class CalloutLayerView extends AnnotationLayerView {
        constructor(a) {
            super(a);
            this.b4 = null;
            this.b9 = null;
            this.b8 = null;
            this.ca = NaN;
            this.b5 = null;
            this.b4 = a;
            this.b9 = new List$1(CalloutView.$, 0);
        }
        as() {
            super.as();
            this.b8 = ((() => {
                let $ret = new HashPool$2(CalloutAnnotationWrapper.$, CalloutView.$);
                $ret.create = runOn(this, this.b6);
                $ret.activate = runOn(this, this.cc);
                $ret.disactivate = runOn(this, this.ce);
                $ret.destroy = runOn(this, this.cd);
                return $ret;
            })());
        }
        b6() {
            let a = new CalloutView(this);
            this.b9.add(a);
            return a;
        }
        cc(a) {
            a.y = 0;
        }
        ce(a) {
            a.y = 1;
        }
        cd(a) {
            this.b9.remove(a);
        }
        cm(a) {
            if (a == null) {
                return a;
            }
            return BrushUtil.l(a, 0.1);
        }
        a6(a, b) {
            super.a6(a, b);
            a.ad(this.b7());
            if (a.d && !b) {
                for (let c = 0; c < this.b9.count; c++) {
                    let d = this.b9._inner[c];
                    if (d.y == 0) {
                        d.j(a);
                    }
                }
            }
        }
        b7() {
            if (this.b4.rt != null) {
                return this.b4.rt;
            }
            return this.e.cd.getFontInfo();
        }
        al(a) {
            super.al(a);
            for (let b = 0; b < this.b9.count; b++) {
                let c = this.b9._inner[b];
                if (c.y != 0) {
                    continue;
                }
                c.i(this.b4, this.b7(), a);
            }
        }
        co(a) {
            this.k.ad(this.b7());
            this.ca = this.cb();
            let b = this.k.ah(a, this.ca, true);
            return new Size(1, b.c, b.b);
        }
        cb() {
            let a = this.b7();
            if (isNaN_(this.ca)) {
                let b = FontUtil.getCurrentFontHeight(this.e.cd.cu.j.ae, a);
                this.ca = b;
            }
            return this.ca;
        }
        cn(a, b) {
            if (this.b5 == null) {
                this.b5 = new CalloutView(this);
            }
            this.b5.h = a;
            this.b5.x = b;
            let c = this.b5.u();
            this.b5.h = null;
            return c;
        }
        cg(a, b, c) {
            a.f = b;
            a.g = c;
        }
        ch(a, b, c) {
            a.k(this.e, b, c);
        }
        ci(a) {
            if (a != null) {
                return this.cm(a.o8);
            }
            return this.e.o8;
        }
        cl() {
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        ck(a) {
            if (this.b4.sk) {
                if (a != null) {
                    return this.cm(a.o8);
                }
            }
            return ((() => {
                let $ret = new Brush();
                $ret.color = Color.u(255, 255, 255, 255);
                return $ret;
            })());
        }
        cj(a) {
            if (a != null) {
                return this.cm(a.o3);
            }
            return this.e.o3;
        }
        cf() {
            this.ca = NaN;
        }
    }
    CalloutLayerView.$t = 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.ac = 2;
            this.l = new TextBlock();
            this.t = new Rectangle();
            this.t.ac = 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.am = this.c;
            this.t.an = 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.ac;
        }
        set e(a) {
            this.t.ac = 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.co(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.a8.exportCalloutData(this.f, this.g, this.v.left, this.v.top, c, this.t, this.l, b, this.s, "callout", ["Main", "Callout"]);
        }
    }
    CalloutView.$t = markType(CalloutView, 'CalloutView');
    return CalloutView;
})();
