/*
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, markType } from "igniteui-angular-core";
import { WorksheetRegionAddress } from "./WorksheetRegionAddress";
import { CellAddress } from "./CellAddress";
import { stringFormat } from "igniteui-angular-core";
/**
 * @hidden
 */
var MutableWorksheetRegionAddress = /** @class */ (function (_super) {
    tslib_1.__extends(MutableWorksheetRegionAddress, _super);
    function MutableWorksheetRegionAddress() {
        var _this = _super.call(this) || this;
        _this.d = 0;
        _this.h = 0;
        _this.e = 0;
        _this.i = 0;
        _this.n();
        return _this;
    }
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "f", {
        get: function () {
            return this.d;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "j", {
        get: function () {
            return this.h;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "b", {
        get: function () {
            return this.d < 0;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "c", {
        get: function () {
            return this.d == this.e && this.h == this.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "g", {
        get: function () {
            return this.e;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(MutableWorksheetRegionAddress.prototype, "k", {
        get: function () {
            return this.i;
        },
        enumerable: true,
        configurable: true
    });
    MutableWorksheetRegionAddress.prototype.n = function () {
        this.d = this.e = -1;
        this.h = this.e = -1;
    };
    MutableWorksheetRegionAddress.prototype.a = function () {
        if (this.b) {
            return WorksheetRegionAddress._b;
        }
        else {
            return new WorksheetRegionAddress(1, this.h, this.i, this.d, this.e);
        }
    };
    MutableWorksheetRegionAddress.prototype.toString = function () {
        return this.m(1, true);
    };
    MutableWorksheetRegionAddress.prototype.m = function (a, b) {
        var c = ((function (d, e, f, g, h) { return CellAddress.u(d, e, void 0, g, h, void 0, void 0, void 0, f); })(this.h, this.d, a, b, b));
        if (this.c) {
            return c;
        }
        return stringFormat("{0}{1}{2}", c, ":", ((function (i, j, k, l, m) { return CellAddress.u(i, j, void 0, l, m, void 0, void 0, void 0, k); })(this.i, this.e, a, b, b)));
    };
    MutableWorksheetRegionAddress.prototype.q = function (n, o) {
        if (this.b) {
            this.h = this.i = n;
            this.d = this.e = o;
        }
        else {
            if (n < this.h) {
                this.h = n;
            }
            else if (n > this.i) {
                this.i = n;
            }
            if (o < this.d) {
                this.d = o;
            }
            else if (o > this.e) {
                this.e = o;
            }
        }
    };
    MutableWorksheetRegionAddress.prototype.o = function (n) {
        this.q(n.o, n.m);
    };
    MutableWorksheetRegionAddress.prototype.p = function (n) {
        if (this.b) {
            this.d = n._w;
            this.h = n._ac;
            this.e = n._x;
            this.i = n._ae;
        }
        else {
            this.d = Math.min(this.d, n._w);
            this.h = Math.min(this.h, n._ac);
            this.e = Math.max(this.e, n._x);
            this.i = Math.max(this.i, n._ae);
        }
    };
    MutableWorksheetRegionAddress.$t = markType(MutableWorksheetRegionAddress, 'MutableWorksheetRegionAddress');
    return MutableWorksheetRegionAddress;
}(Base));
export { MutableWorksheetRegionAddress };
//# sourceMappingURL=MutableWorksheetRegionAddress.js.map