/*
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 * as tslib_1 from "tslib";
import { Base, Point_$type, EnumUtil, markType } from "igniteui-angular-core/ES5/type";
import { IDataChartVisualDataManager_$type } from "./IDataChartVisualDataManager";
import { ChartVisualData } from "./ChartVisualData";
import { RectData } from "igniteui-angular-core/ES5/RectData";
import { VisualExportHelper } from "./VisualExportHelper";
import { ChartTitleVisualData } from "./ChartTitleVisualData";
import { HorizontalAlignment_$type } from "igniteui-angular-core/ES5/HorizontalAlignment";
import { AppearanceHelper } from "igniteui-angular-core/ES5/AppearanceHelper";
import { FontUtil } from "igniteui-angular-core/ES5/FontUtil";
/**
 * @hidden
 */
var DataChartVisualDataManager = /** @class */ (function (_super) {
    tslib_1.__extends(DataChartVisualDataManager, _super);
    function DataChartVisualDataManager() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    DataChartVisualDataManager.prototype.exportVisualData = function (a) {
        var b = new ChartVisualData();
        for (var c = 0; c < a.axes.count; c++) {
            var d = a.axes._inner[c].e2();
            b.axes.add1(d);
        }
        for (var e = 0; e < a.series.count; e++) {
            var f = a.series._inner[e].fo();
            b.series.add1(f);
        }
        b.name = a.name;
        this.b(a, b);
        this.c(a, b);
        return b;
    };
    DataChartVisualDataManager.prototype.c = function (a, b) {
        var c = a.bn;
        b.width = c.a6;
        b.height = c.a5;
        b.contentArea = RectData.b(c.e1());
        b.centralArea = new RectData(c.a2, 0, c.a6 - (c.a2 + c.a3), c.a5 - (c.a4 + c.a1));
        b.plotArea = RectData.b(a.m3);
    };
    DataChartVisualDataManager.prototype.d = function (a, b) {
        var c = VisualExportHelper.a(a);
        return c;
    };
    DataChartVisualDataManager.prototype.b = function (a, b) {
        var c = a.bn;
        var d = null;
        b.title = null;
        b.subtitle = null;
        var e = c.e9();
        var f = 0;
        var g = 0;
        if (c.el != null) {
            d = c.t();
            var h = this.a(c, c.el, d);
            var i = { $type: Point_$type, x: 0, y: 0 };
            g = c.el.l + e.b + e.e;
            var j = new ChartTitleVisualData();
            var k = c.e1();
            j.viewport = new RectData(k.left, k.top, k.width, g);
            j.textPlotArea = RectData.b(this.d(c.el, a));
            j.textPlotArea = new RectData(c.el.n, c.el.o, c.el.m, c.el.l);
            f = j.height;
            j.appearance = AppearanceHelper.c(c.el, h);
            var l = c.e9();
            j.appearance.marginTop = l.e;
            j.appearance.marginLeft = l.c;
            j.appearance.marginRight = l.d;
            j.appearance.marginBottom = l.b;
            var m = c.en();
            j.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, m);
            b.title = j;
        }
        if (c.ek != null) {
            d = c.s();
            var n = this.a(c, c.ek, d);
            var o = { $type: Point_$type, x: 0, y: f };
            var p = c.e8();
            var q = c.ek.l + p.b + p.e;
            var r = new ChartTitleVisualData();
            var s = c.e1();
            r.viewport = new RectData(s.left, s.top + g, s.width, q);
            r.textPlotArea = RectData.b(this.d(c.ek, a));
            r.appearance = AppearanceHelper.c(c.ek, n);
            var t = c.e8();
            r.appearance.marginTop = t.e;
            r.appearance.marginLeft = t.c;
            r.appearance.marginRight = t.d;
            r.appearance.marginBottom = t.b;
            var u = c.em();
            r.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, u);
            b.subtitle = r;
        }
    };
    DataChartVisualDataManager.prototype.a = function (a, b, c) {
        return FontUtil.getFontInfo(a.i.af, b, c);
    };
    DataChartVisualDataManager.$t = markType(DataChartVisualDataManager, 'DataChartVisualDataManager', Base.$, [IDataChartVisualDataManager_$type]);
    return DataChartVisualDataManager;
}(Base));
export { DataChartVisualDataManager };
//# sourceMappingURL=DataChartVisualDataManager.js.map