/*
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 { Base, typeCast, String_$type, Boolean_$type, markType } from "igniteui-angular-core";
import { ErrorValue } from "./ErrorValue";
import { stringContains } from "igniteui-angular-core";
/**
 * @hidden
 */
var Biff8RecordStream_AFDOper = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(Biff8RecordStream_AFDOper, _super);
    function Biff8RecordStream_AFDOper(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.c = 0;
        _this.a = 2;
        _this.l = null;
        _this.m = null;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    if (c.length > 255) {
                        c = c.substr(0, 255);
                    }
                    _this.m = c;
                    _this.c = 6;
                    _this.l = c.length;
                }
                break;
            case 2:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this.n(c, d);
                }
                break;
            case 3:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    if (d == null) {
                        return _this;
                    }
                    var e = void 0;
                    var f = void 0;
                    var g = d._q(c, e, f);
                    e = g.p1;
                    f = g.p2;
                    _this.n(f, e);
                }
                break;
        }
        return _this;
    }
    Biff8RecordStream_AFDOper.prototype.n = function (a, b) {
        this.a = b;
        var c = typeCast(String_$type, a);
        if (c != null) {
            if (c.length == 0 && this.a == 5) {
                this.c = 14;
            }
            else {
                this.c = 6;
                this.m = c;
                this.l = this.m.length;
            }
        }
        else {
            this.l = a;
            if (typeof a === 'number') {
                this.c = 4;
            }
            else if (typeCast(Boolean_$type, a) !== null || typeCast(ErrorValue.$, a) !== null) {
                this.c = 8;
            }
            else {
            }
        }
    };
    Object.defineProperty(Biff8RecordStream_AFDOper.prototype, "k", {
        get: function () {
            if (this.c == 6) {
                return this.m;
            }
            return this.l;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Biff8RecordStream_AFDOper.prototype, "b", {
        get: function () {
            if (this.c != 6) {
                return false;
            }
            return stringContains(this.m, "*") || stringContains(this.m, "?");
        },
        enumerable: false,
        configurable: true
    });
    Biff8RecordStream_AFDOper.$t = markType(Biff8RecordStream_AFDOper, 'Biff8RecordStream_AFDOper');
    return Biff8RecordStream_AFDOper;
}(Base));
export { Biff8RecordStream_AFDOper };
