// SPDX-License-Identifier: Apache-2.0
export var RegulationType;
(function (RegulationType) {
    RegulationType["NONE"] = "NONE";
    RegulationType["REG_S"] = "REG_S";
    RegulationType["REG_D"] = "REG_D";
})(RegulationType || (RegulationType = {}));
export var RegulationSubType;
(function (RegulationSubType) {
    RegulationSubType["NONE"] = "NONE";
    RegulationSubType["B_506"] = "506_B";
    RegulationSubType["C_506"] = "506_C";
})(RegulationSubType || (RegulationSubType = {}));
export var AccreditedInvestors;
(function (AccreditedInvestors) {
    AccreditedInvestors["NONE"] = "NONE";
    AccreditedInvestors["ACCREDITATION_REQUIRED"] = "ACCREDITATION REQUIRED";
})(AccreditedInvestors || (AccreditedInvestors = {}));
export var ManualInvestorVerification;
(function (ManualInvestorVerification) {
    ManualInvestorVerification["NOTHING_TO_VERIFY"] = "NOTHING TO VERIFY";
    ManualInvestorVerification["VERIFICATION_INVESTORS_FINANCIAL_DOCUMENTS_REQUIRED"] = "VERIFICATION INVESTORS FINANCIAL DOCUMENTS REQUIRED";
})(ManualInvestorVerification || (ManualInvestorVerification = {}));
export var InternationalInvestors;
(function (InternationalInvestors) {
    InternationalInvestors["NOT_ALLOWED"] = "NOT ALLOWED";
    InternationalInvestors["ALLOWED"] = "ALLOWED";
})(InternationalInvestors || (InternationalInvestors = {}));
export var ResaleHoldPeriod;
(function (ResaleHoldPeriod) {
    ResaleHoldPeriod["NOT_APPLICABLE"] = "NOT APPLICABLE";
    ResaleHoldPeriod["APPLICABLE_FROM_6_MOTHS_TO_1_YEAR"] = "APPLICABLE FROM 6 MOTHS TO 1 YEAR";
})(ResaleHoldPeriod || (ResaleHoldPeriod = {}));
export class CastRegulationType {
    static fromNumber(id) {
        if (id == 0)
            return RegulationType.NONE;
        if (id == 1)
            return RegulationType.REG_S;
        return RegulationType.REG_D;
    }
    static fromBigint(id) {
        return this.fromNumber(Number(id));
    }
    static toNumber(value) {
        if (value == RegulationType.NONE)
            return 0;
        if (value == RegulationType.REG_S)
            return 1;
        return 2;
    }
}
export class CastRegulationSubType {
    static fromNumber(id) {
        if (id === 0)
            return RegulationSubType.NONE;
        if (id === 1)
            return RegulationSubType.B_506;
        return RegulationSubType.C_506;
    }
    static fromBigint(id) {
        return this.fromNumber(Number(id));
    }
    static toNumber(value) {
        if (value == RegulationSubType.NONE)
            return 0;
        if (value == RegulationSubType.B_506)
            return 1;
        return 2;
    }
}
export class CheckRegulations {
    static typeAndSubtype(type, subtype) {
        if (type == CastRegulationType.toNumber(RegulationType.REG_S)) {
            return subtype == CastRegulationSubType.toNumber(RegulationSubType.NONE);
        }
        else if (type == CastRegulationType.toNumber(RegulationType.REG_D)) {
            return (subtype == CastRegulationSubType.toNumber(RegulationSubType.B_506) ||
                subtype == CastRegulationSubType.toNumber(RegulationSubType.C_506));
        }
        return false;
    }
}
export class CastAccreditedInvestors {
    static fromBigint(id) {
        if (id === 0n)
            return AccreditedInvestors.NONE;
        return AccreditedInvestors.ACCREDITATION_REQUIRED;
    }
    static toNumber(value) {
        if (value == AccreditedInvestors.NONE)
            return 0;
        return 1;
    }
}
export class CastManualInvestorVerification {
    static fromBigint(id) {
        if (id === 0n)
            return ManualInvestorVerification.NOTHING_TO_VERIFY;
        return ManualInvestorVerification.VERIFICATION_INVESTORS_FINANCIAL_DOCUMENTS_REQUIRED;
    }
    static toNumber(value) {
        if (value == ManualInvestorVerification.NOTHING_TO_VERIFY)
            return 0;
        return 1;
    }
}
export class CastInternationalInvestorscation {
    static fromBigint(id) {
        if (id === 0n)
            return InternationalInvestors.NOT_ALLOWED;
        return InternationalInvestors.ALLOWED;
    }
    static toNumber(value) {
        if (value == InternationalInvestors.NOT_ALLOWED)
            return 0;
        return 1;
    }
}
export class CastResaleHoldPeriodorscation {
    static fromBigint(id) {
        if (id === 0n)
            return ResaleHoldPeriod.NOT_APPLICABLE;
        return ResaleHoldPeriod.APPLICABLE_FROM_6_MOTHS_TO_1_YEAR;
    }
    static toNumber(value) {
        if (value == ResaleHoldPeriod.NOT_APPLICABLE)
            return 0;
        return 1;
    }
}
