/*
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 { ValueType, toNullable, typeCast, Number_$type, markStruct } from "igniteui-angular-core";
import { DocCoreUtils } from "./DocCoreUtils";
import { CultureInfo } from "igniteui-angular-core";
import { tryParseInt64_2 } from "igniteui-angular-core";
/**
 * @hidden
 */
export let ST_PositiveCoordinate = /*@__PURE__*/ (() => {
    class ST_PositiveCoordinate extends ValueType {
        constructor(a, ..._rest) {
            super();
            this.m = 0;
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0: break;
                case 1:
                    {
                        let c = _rest[0];
                        DocCoreUtils.aw(ST_PositiveCoordinate.$, c, "emus", 0, 27273042316900);
                        this.m = c;
                    }
                    break;
            }
        }
        equals(a) {
            let b = toNullable(ST_PositiveCoordinate.$, typeCast(ST_PositiveCoordinate.$, a));
            if (ST_PositiveCoordinate.g(b, toNullable(ST_PositiveCoordinate.$, null))) {
                return false;
            }
            return ST_PositiveCoordinate.d(this, b.getValueOrDefault());
        }
        getHashCode() {
            return (this.m);
        }
        toString() {
            return this.m.toString();
        }
        n() {
            return this.m;
        }
        j() {
            return DocCoreUtils.i(this.m);
        }
        static c(a) {
            let b = ST_PositiveCoordinate.s(a);
            if (ST_PositiveCoordinate.g(b, toNullable(ST_PositiveCoordinate.$, null))) {
                return b.getValueOrDefault();
            }
            throw DocCoreUtils.n(ST_PositiveCoordinate.$, a);
        }
        static s(a) {
            let b;
            if (((() => { let c = tryParseInt64_2(a, 7, CultureInfo.invariantCulture, b); b = c.p3; return c.ret; })()) == false) {
                return toNullable(ST_PositiveCoordinate.$, null);
            }
            return toNullable(ST_PositiveCoordinate.$, ST_PositiveCoordinate.a(b));
        }
        static d(a, b) {
            return a.m == b.m;
        }
        static e(a, b) {
            if (!a.hasValue) {
                return !b.hasValue;
            }
            else if (!b.hasValue) {
                return false;
            }
            return ST_PositiveCoordinate.d(a.value, b.value);
        }
        static f(a, b) {
            return !(ST_PositiveCoordinate.d(a, b));
        }
        static g(a, b) {
            if (!a.hasValue) {
                return b.hasValue;
            }
            else if (!b.hasValue) {
                return true;
            }
            return ST_PositiveCoordinate.f(a.value, b.value);
        }
        static a(a) {
            return new ST_PositiveCoordinate(1, a);
        }
        static r(a) {
            if (!a.hasValue) {
                return toNullable(ST_PositiveCoordinate.$, null);
            }
            return toNullable(ST_PositiveCoordinate.$, ST_PositiveCoordinate.a(a.value));
        }
        static o(a) {
            return a.m;
        }
        static q(a) {
            if (!a.hasValue) {
                return toNullable(Number_$type, null);
            }
            return toNullable(Number_$type, ST_PositiveCoordinate.o(a.value));
        }
    }
    ST_PositiveCoordinate.$t = markStruct(ST_PositiveCoordinate, 'ST_PositiveCoordinate');
    return ST_PositiveCoordinate;
})();
