/*
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 { Rect } from "igniteui-react-core/ES2015/Rect";
import { Base, Point_$type, typeCast, fromEnum, markType } from "igniteui-react-core/ES2015/type";
import { RotateTransform } from "igniteui-react-core/ES2015/RotateTransform";
import { TransformGroup } from "igniteui-react-core/ES2015/TransformGroup";
import { TranslateTransform } from "igniteui-react-core/ES2015/TranslateTransform";
import { RectUtil } from "igniteui-react-core/ES2015/RectUtil";
export class VisualExportHelper extends Base {
    static a(a) {
        let b = { $type: Point_$type, x: a.n, y: a.o };
        let c = new Rect(0, b.x, b.y, a.m, a.l);
        let d = a.j;
        if (d == null) {
            return c;
        }
        let e = 0;
        let f = 0;
        let g = 0;
        let h = null;
        if (typeCast(RotateTransform.$, d) !== null) {
            h = typeCast(RotateTransform.$, d);
            e = h.j;
        }
        else if (typeCast(TransformGroup.$, d) !== null) {
            let i = typeCast(TransformGroup.$, d);
            for (let j of fromEnum(i.j)) {
                if (typeCast(RotateTransform.$, j) !== null) {
                    h = typeCast(RotateTransform.$, j);
                    e = h.j;
                }
                if (typeCast(TranslateTransform.$, j) !== null) {
                    let k = typeCast(TranslateTransform.$, j);
                    f = k.j;
                    g = k.k;
                }
            }
        }
        if (h != null) {
            c = RectUtil.x(c, h.k, h.l, e);
        }
        c.x = c.x + f;
        c.y = c.y + g;
        return c;
    }
}
VisualExportHelper.$t = markType(VisualExportHelper, 'VisualExportHelper');
