/*
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, toNullable, Number_$type, fromEnum, typeCast, markType, getInstanceType } from "igniteui-angular-core";
import { ISupportSetProperty_$type } from "./ISupportSetProperty";
import { CT_Address } from "./CT_Address";
import { ST_EntityType_$type } from "./ST_EntityType";
import { CultureInfo } from "igniteui-angular-core";
import { XmlNamespaceDefinitionBase } from "./XmlNamespaceDefinitionBase";
import { parseNumber } from "igniteui-angular-core";
/**
 * @hidden
 */
var CT_GeoLocation = /** @class */ (function (_super) {
    tslib_1.__extends(CT_GeoLocation, _super);
    function CT_GeoLocation() {
        var _this = _super.call(this) || this;
        _this.b = null;
        _this.f = toNullable(Number_$type, null);
        _this.h = toNullable(Number_$type, null);
        _this.j = null;
        _this.d = 0;
        return _this;
    }
    Object.defineProperty(CT_GeoLocation.prototype, "a", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            this.b = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CT_GeoLocation.prototype, "e", {
        get: function () {
            return this.f;
        },
        set: function (a) {
            this.f = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CT_GeoLocation.prototype, "g", {
        get: function () {
            return this.h;
        },
        set: function (a) {
            this.h = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CT_GeoLocation.prototype, "i", {
        get: function () {
            return this.j;
        },
        set: function (a) {
            this.j = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(CT_GeoLocation.prototype, "c", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            this.d = a;
        },
        enumerable: true,
        configurable: true
    });
    CT_GeoLocation.l = function (a, b, c, d, e) {
        var e_1, _a;
        b = toNullable(Number_$type, null);
        c = toNullable(Number_$type, null);
        d = null;
        e = 0;
        try {
            for (var _b = tslib_1.__values(fromEnum(a.ab.u)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                switch (f.a.e(a.d)) {
                    case "latitude":
                        b = toNullable(Number_$type, parseNumber(f.d, CultureInfo.invariantCulture));
                        break;
                    case "longitude":
                        c = toNullable(Number_$type, parseNumber(f.d, CultureInfo.invariantCulture));
                        break;
                    case "entityName":
                        d = f.d;
                        break;
                    case "entityType":
                        e = XmlNamespaceDefinitionBase.b(ST_EntityType_$type, f.d);
                        break;
                    default: break;
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        ;
        return {
            p1: b,
            p2: c,
            p3: d,
            p4: e
        };
    };
    CT_GeoLocation.m = function (a, b, c, d, e, f) {
        a.ad.p(b, "cx");
        var g = null;
        var h = null;
        if (c.hasValue) {
            h = "latitude";
            g = c.value.toString();
            a.ad.h(h, g);
        }
        if (d.hasValue) {
            h = "longitude";
            g = d.value.toString();
            a.ad.h(h, g);
        }
        if (e != null) {
            h = "entityName";
            g = e;
            a.ad.h(h, g);
        }
        h = "entityType";
        g = XmlNamespaceDefinitionBase.f(ST_EntityType_$type, f);
        a.ad.h(h, g);
        ;
    };
    CT_GeoLocation.prototype.setProperty = function (a, b) {
        switch (a) {
            case 18:
                this.a = typeCast(CT_Address.$, b);
                break;
            default: break;
        }
    };
    CT_GeoLocation.prototype.toString = function () {
        var a = getInstanceType(this);
        return a != null ? a.typeName : _super.prototype.toString.call(this);
    };
    CT_GeoLocation.$t = markType(CT_GeoLocation, 'CT_GeoLocation', Base.$, [ISupportSetProperty_$type]);
    return CT_GeoLocation;
}(Base));
export { CT_GeoLocation };
//# sourceMappingURL=CT_GeoLocation.js.map