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