/*
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, fromEnum, markType } from "igniteui-react-core/ES5/type";
import { PrimitiveVisualDataList } from "igniteui-react-core/ES5/PrimitiveVisualDataList";
import { PointerTooltipVisualDataList } from "./PointerTooltipVisualDataList";
import { MarkerVisualDataList } from "./MarkerVisualDataList";
import { CalloutVisualDataList } from "./CalloutVisualDataList";
import { StringBuilder } from "igniteui-react-core/ES5/StringBuilder";
/**
 * @hidden
 */
var SeriesVisualData = /** @class */ (function (_super) {
    tslib_1.__extends(SeriesVisualData, _super);
    function SeriesVisualData() {
        var _this = _super.call(this) || this;
        _this._name = null;
        _this._type = null;
        _this._viewport = null;
        _this._opacity = 0;
        _this._shapes = null;
        _this._pointerTooltips = null;
        _this._markerShapes = null;
        _this._calloutShapes = null;
        _this._pixels = null;
        _this._pixelWidth = 0;
        _this._pixelHeight = 0;
        _this.shapes = new PrimitiveVisualDataList();
        _this.markerShapes = new MarkerVisualDataList();
        _this.pointerTooltips = new PointerTooltipVisualDataList();
        _this.calloutShapes = new CalloutVisualDataList();
        return _this;
    }
    Object.defineProperty(SeriesVisualData.prototype, "name", {
        get: function () {
            return this._name;
        },
        set: function (a) {
            this._name = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "type", {
        get: function () {
            return this._type;
        },
        set: function (a) {
            this._type = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "viewport", {
        get: function () {
            return this._viewport;
        },
        set: function (a) {
            this._viewport = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "opacity", {
        get: function () {
            return this._opacity;
        },
        set: function (a) {
            this._opacity = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "shapes", {
        get: function () {
            return this._shapes;
        },
        set: function (a) {
            this._shapes = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "pointerTooltips", {
        get: function () {
            return this._pointerTooltips;
        },
        set: function (a) {
            this._pointerTooltips = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "markerShapes", {
        get: function () {
            return this._markerShapes;
        },
        set: function (a) {
            this._markerShapes = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "calloutShapes", {
        get: function () {
            return this._calloutShapes;
        },
        set: function (a) {
            this._calloutShapes = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "pixels", {
        get: function () {
            return this._pixels;
        },
        set: function (a) {
            this._pixels = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "pixelWidth", {
        get: function () {
            return this._pixelWidth;
        },
        set: function (a) {
            this._pixelWidth = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SeriesVisualData.prototype, "pixelHeight", {
        get: function () {
            return this._pixelHeight;
        },
        set: function (a) {
            this._pixelHeight = a;
        },
        enumerable: true,
        configurable: true
    });
    SeriesVisualData.prototype.m = function () {
        var e_1, _a, e_2, _b, e_3, _c;
        try {
            for (var _d = tslib_1.__values(fromEnum(this.shapes)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var a = _e.value;
                a.scaleByViewport(this.viewport);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
            }
            finally { if (e_1) throw e_1.error; }
        }
        try {
            for (var _f = tslib_1.__values(fromEnum(this.markerShapes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var b = _g.value;
                b.i(this.viewport);
            }
        }
        catch (e_2_1) { e_2 = { error: e_2_1 }; }
        finally {
            try {
                if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
            }
            finally { if (e_2) throw e_2.error; }
        }
        try {
            for (var _h = tslib_1.__values(fromEnum(this.pointerTooltips)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var c = _j.value;
                c.scaleByViewport(this.viewport);
            }
        }
        catch (e_3_1) { e_3 = { error: e_3_1 }; }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
            }
            finally { if (e_3) throw e_3.error; }
        }
    };
    SeriesVisualData.prototype.serialize = function () {
        var a = new StringBuilder(0);
        a.u("{");
        a.u("name: \"" + this.name + "\",");
        a.u("type: \"" + this.type + "\", ");
        a.u("opacity: " + this.opacity + ", ");
        a.u("viewport: { left: " + this.viewport.left + ", top: " + this.viewport.top + ", width: " + this.viewport.width + ", height: " + this.viewport.height + "}, ");
        a.u("shapes: [");
        for (var b = 0; b < this.shapes.count; b++) {
            if (b != 0) {
                a.l(", ");
            }
            a.l(this.shapes._inner[b].serialize());
        }
        a.u("],");
        a.u("pointerTooltips: [");
        for (var c = 0; c < this.pointerTooltips.count; c++) {
            if (c != 0) {
                a.l(", ");
            }
            a.l(this.pointerTooltips._inner[c].serialize());
        }
        a.u("],");
        if (this.calloutShapes != null && this.calloutShapes.count > 0) {
            a.u("calloutshapes: [");
            for (var d = 0; d < this.calloutShapes.count; d++) {
                if (d != 0) {
                    a.l(", ");
                }
                a.l(this.calloutShapes._inner[d].serialize());
            }
            a.u("],");
        }
        a.u("markerShapes: [");
        for (var e = 0; e < this.markerShapes.count; e++) {
            if (e != 0) {
                a.l(", ");
            }
            a.l(this.markerShapes._inner[e].serialize());
        }
        a.u("]");
        if (this.pixels != null) {
            a.u(", pixels: [");
            for (var f = 0; f < this.pixels.length; f++) {
                if (f != 0) {
                    a.l(", ");
                }
                a.l(this.pixels[f].toString());
            }
            a.u("], ");
            a.u("pixelWidth: " + this.pixelWidth + ", ");
        }
        a.u("}");
        return a.toString();
    };
    SeriesVisualData.$t = markType(SeriesVisualData, 'SeriesVisualData');
    return SeriesVisualData;
}(Base));
export { SeriesVisualData };
