/*
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 { __extends } from "tslib";
import { ValueType, toNullable, markStruct } from "igniteui-angular-core";
import { DocCoreUtils } from "./DocCoreUtils";
import { ST_UnsignedDecimalNumber } from "./ST_UnsignedDecimalNumber";
import { ST_PositiveUniversalMeasure } from "./ST_PositiveUniversalMeasure";
import { truncate } from "igniteui-angular-core";
import { nullableNotEquals } from "igniteui-angular-core";
import { stringEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var ST_TwipsMeasure = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ST_TwipsMeasure, _super);
    function ST_TwipsMeasure(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.c = toNullable(ST_UnsignedDecimalNumber.$, null);
        _this.d = toNullable(ST_PositiveUniversalMeasure.$, null);
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    var d = [ST_UnsignedDecimalNumber.b(truncate(DocCoreUtils.j(c)))];
                    {
                        var f = d[0];
                        _this.c = toNullable(ST_UnsignedDecimalNumber.$, f);
                        _this.d = toNullable(ST_PositiveUniversalMeasure.$, null);
                    }
                }
                break;
            case 2:
                {
                    var c = _rest[0];
                    _this.c = toNullable(ST_UnsignedDecimalNumber.$, c);
                    _this.d = toNullable(ST_PositiveUniversalMeasure.$, null);
                }
                break;
            case 3:
                {
                    var c = _rest[0];
                    _this.c = toNullable(ST_UnsignedDecimalNumber.$, null);
                    _this.d = toNullable(ST_PositiveUniversalMeasure.$, c);
                }
                break;
        }
        return _this;
    }
    ST_TwipsMeasure.prototype.toString = function () {
        if (nullableNotEquals(this.c, null)) {
            return this.c.value.toString();
        }
        if (nullableNotEquals(this.d, null)) {
            return this.d.value.toString();
        }
        return stringEmpty();
    };
    ST_TwipsMeasure.prototype.b = function () {
        if (nullableNotEquals(this.c, null)) {
            return ST_UnsignedDecimalNumber.h(this.c.value);
        }
        if (nullableNotEquals(this.d, null)) {
            return this.d.value.d();
        }
        return 0;
    };
    ST_TwipsMeasure.a = function (a) {
        var b = ST_UnsignedDecimalNumber.f(a);
        if (nullableNotEquals(b, null)) {
            return new ST_TwipsMeasure(2, b.value);
        }
        var c = ST_PositiveUniversalMeasure.e(a);
        if (nullableNotEquals(c, null)) {
            return new ST_TwipsMeasure(3, c.value);
        }
        throw DocCoreUtils.n(ST_TwipsMeasure.$, a);
    };
    ST_TwipsMeasure.$t = markStruct(ST_TwipsMeasure, 'ST_TwipsMeasure');
    return ST_TwipsMeasure;
}(ValueType));
export { ST_TwipsMeasure };
