/*
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 { Base, Point_$type, EnumUtil, markType } from "igniteui-react-core";
import { IDataChartVisualDataManager_$type } from "./IDataChartVisualDataManager";
import { ChartVisualData } from "./ChartVisualData";
import { RectData } from "igniteui-react-core";
import { VisualExportHelper } from "./VisualExportHelper";
import { ChartTitleVisualData } from "./ChartTitleVisualData";
import { HorizontalAlignment_$type } from "igniteui-react-core";
import { AppearanceHelper } from "igniteui-react-core";
import { FontUtil } from "igniteui-react-core";
/**
 * @hidden
 */
export let DataChartVisualDataManager = /*@__PURE__*/ (() => {
    class DataChartVisualDataManager extends Base {
        exportVisualData(a) {
            let b = new ChartVisualData();
            for (let c = 0; c < a.axes.count; c++) {
                let d = a.axes._inner[c].e6();
                b.axes.add1(d);
            }
            for (let e = 0; e < a.series.count; e++) {
                let f = a.series._inner[e].gp();
                b.series.add1(f);
            }
            b.name = a.name;
            this.b(a, b);
            this.c(a, b);
            return b;
        }
        c(a, b) {
            let c = a.b8;
            b.width = c.a8;
            b.height = c.a7;
            b.contentArea = RectData.b(c.e9());
            b.centralArea = new RectData(c.a4, 0, c.a8 - (c.a4 + c.a5), c.a7 - (c.a6 + c.a3));
            b.plotArea = RectData.b(a.o7);
        }
        d(a, b) {
            let c = VisualExportHelper.a(a);
            return c;
        }
        b(a, b) {
            let c = a.b8;
            let d = null;
            b.title = null;
            b.subtitle = null;
            let e = c.fh();
            let f = 0;
            let g = 0;
            if (c.et != null) {
                d = c.v();
                let h = this.a(c, c.et, d);
                let i = { $type: Point_$type, x: 0, y: 0 };
                g = c.et.l + e.b + e.e;
                let j = new ChartTitleVisualData();
                let k = c.e9();
                j.viewport = new RectData(k.left, k.top, k.width, g);
                j.textPlotArea = RectData.b(this.d(c.et, a));
                j.textPlotArea = new RectData(c.et.n, c.et.o, c.et.m, c.et.l);
                f = j.height;
                j.appearance = AppearanceHelper.c(c.et, h);
                let l = c.fh();
                j.appearance.marginTop = l.e;
                j.appearance.marginLeft = l.c;
                j.appearance.marginRight = l.d;
                j.appearance.marginBottom = l.b;
                let m = c.ev();
                j.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, m);
                b.title = j;
            }
            if (c.es != null) {
                d = c.u();
                let n = this.a(c, c.es, d);
                let o = { $type: Point_$type, x: 0, y: f };
                let p = c.fg();
                let q = c.es.l + p.b + p.e;
                let r = new ChartTitleVisualData();
                let s = c.e9();
                r.viewport = new RectData(s.left, s.top + g, s.width, q);
                r.textPlotArea = RectData.b(this.d(c.es, a));
                r.appearance = AppearanceHelper.c(c.es, n);
                let t = c.fg();
                r.appearance.marginTop = t.e;
                r.appearance.marginLeft = t.c;
                r.appearance.marginRight = t.d;
                r.appearance.marginBottom = t.b;
                let u = c.eu();
                r.appearance.horizontalAlignment = EnumUtil.getName(HorizontalAlignment_$type, u);
                b.subtitle = r;
            }
        }
        a(a, b, c) {
            return FontUtil.getFontInfo(a.j.ae, b, c);
        }
    }
    DataChartVisualDataManager.$t = /*@__PURE__*/ markType(DataChartVisualDataManager, 'DataChartVisualDataManager', Base.$, [IDataChartVisualDataManager_$type]);
    return DataChartVisualDataManager;
})();
//# sourceMappingURL=DataChartVisualDataManager.js.map
