/*
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 { HorizontalAxisLabelPanelBase } from "./HorizontalAxisLabelPanelBase";
import { Number_$type, fromEnum, Boolean_$type, markType } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { HorizontalAxisLabelPanelBaseView } from "./HorizontalAxisLabelPanelBaseView";
import { TransformGroup } from "igniteui-angular-core";
import { RotateTransform } from "igniteui-angular-core";
import { TranslateTransform } from "igniteui-angular-core";
import { ViewportUtils } from "./ViewportUtils";
/**
 * @hidden
 */
export let RadialAxisLabelPanel = /*@__PURE__*/ (() => {
    class RadialAxisLabelPanel extends HorizontalAxisLabelPanelBase {
        constructor() {
            super(...arguments);
            this.dh = null;
            this.de = 0;
            this.dd = new List$1(Number_$type, 0);
        }
        ad() {
            return new RadialAxisLabelPanelView(this);
        }
        b9(a) {
            super.b9(a);
            this.db = a;
        }
        get dc() {
            return !this.al;
        }
        cw() {
            return this.an && (!this.aq || this.be() == -180);
        }
        cx() {
            return !this.ar;
        }
        bu(a) {
            super.bu(a);
            if (this.de % 360 == 0 || this.al) {
                this.db.a3();
            }
            else {
                this.db.a2(a);
            }
        }
        be() {
            let a = super.be();
            if (this.dc) {
                a -= (this.de * 180) / Math.PI;
            }
            return a;
        }
        cv() {
            return this.be() % 360 != 0;
        }
        cu() {
            if (this.al) {
                return true;
            }
            let a = this.de * 180 / Math.PI;
            if (a < 30 || a > 330 || (a > 150 && a < 210)) {
                return true;
            }
            return false;
        }
        cc(a, b) {
            let c = b * Math.PI / 180;
            let d = Math.abs(Math.sin(c));
            if (this.ac.ay != null && this.ac.ay.c == 4) {
                d = d * -1;
            }
            this.db.a4(a, b, d);
        }
        dg() {
            let a = 1.7976931348623157E+308;
            for (let b of fromEnum(this.a3)) {
                a = Math.min(b.c, a);
            }
            return a;
        }
        df() {
            let a = -1.7976931348623157E+308;
            for (let b of fromEnum(this.a3)) {
                a = Math.max(b.c, a);
            }
            return a;
        }
        c9(a, b) {
            let c;
            if (this.ac.ca) {
                c = this.dg();
            }
            else {
                c = this.df();
            }
            let d = new List$1(Number_$type, 0);
            let e = new List$1(Boolean_$type, 0);
            for (let f = 0; f < this.a3.count; f++) {
                let g = this.a3._inner[f];
                if (g.c == c && !g.a) {
                    d.add(this.a3.indexOf(g));
                }
            }
            this.dd = d;
            let h = new List$1(Rect.$, 0);
            for (let i = 0; i < a.count; i++) {
                let j = a._inner[i];
                let k = this.a3._inner[i].a;
                if (!this.dd.contains(i)) {
                    h.add(j);
                    e.add(k);
                }
            }
            this.an = this.am(h, e);
        }
        ap(a, b) {
            if (this.dd.contains(a)) {
                return false;
            }
            else {
                return super.ap(a, b);
            }
        }
        da() {
            this.dd = new List$1(Number_$type, 0);
            super.da();
        }
        ah() {
            return 5;
        }
        at(a) {
            return a == 5 || a == 4 || a == 1 || a == 0;
        }
        b1() {
        }
    }
    RadialAxisLabelPanel.$t = markType(RadialAxisLabelPanel, 'RadialAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
    return RadialAxisLabelPanel;
})();
/**
 * @hidden
 */
export let RadialAxisLabelPanelView = /*@__PURE__*/ (() => {
    class RadialAxisLabelPanelView extends HorizontalAxisLabelPanelBaseView {
        constructor(a) {
            super(a);
            this.a1 = null;
            this.a1 = a;
        }
        a4(a, b, c) {
            let d = this.m(a);
            let e = this.l(a);
            let f = new TransformGroup();
            f.j.add(((() => {
                let $ret = new RotateTransform();
                $ret.j = b;
                $ret.k = d / 2;
                $ret.l = e / 2;
                return $ret;
            })()));
            f.j.add(((() => {
                let $ret = new TranslateTransform();
                $ret.j = d / -2;
                $ret.k = d / 2 * c;
                return $ret;
            })()));
            a.j = f;
        }
        a3() {
            this.a.j = null;
        }
        a2(a) {
            let b = ViewportUtils.f(0.5, this.a.cq, this.a.cp);
            this.a.j = ((() => {
                let $ret = new RotateTransform();
                $ret.j = (this.a1.de * 180) / Math.PI;
                $ret.k = this.a1.dh.x;
                $ret.l = (this.a1.dh.y * a.height) + b;
                return $ret;
            })());
        }
        al() {
            super.al();
            this.a.cr(new Size(1, this.a.co.width, this.a.co.height));
        }
    }
    RadialAxisLabelPanelView.$t = markType(RadialAxisLabelPanelView, 'RadialAxisLabelPanelView', HorizontalAxisLabelPanelBaseView.$);
    return RadialAxisLabelPanelView;
})();
//# sourceMappingURL=RadialAxisLabelPanel_combined.js.map
