/*
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, toNullable, typeCast, markType } from "igniteui-angular-core";
import { ColorInfo } from "./ColorInfo";
import { FillPatternStyle_$type } from "./FillPatternStyle";
import { CellFillPattern } from "./CellFillPattern";
import { WorkbookColorInfo } from "./WorkbookColorInfo";
import { SystemColorsInternal } from "./SystemColorsInternal";
import { nullableEquals } from "igniteui-angular-core";
/**
 * @hidden
 */
var PatternFillInfo = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PatternFillInfo, _super);
    function PatternFillInfo() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.c = null;
        _this.d = null;
        _this.i = toNullable(FillPatternStyle_$type, null);
        return _this;
    }
    PatternFillInfo.prototype.equals = function (a) {
        if (Base.referenceEquals(this, a)) {
            return true;
        }
        var b = typeCast(PatternFillInfo.$, a);
        if (b == null) {
            return false;
        }
        return nullableEquals(this.i, b.i) && Base.equalsStatic(this.c, b.c) && Base.equalsStatic(this.d, b.d);
    };
    PatternFillInfo.prototype.getHashCode = function () {
        var a = Base.getHashCodeStatic(this.i);
        if (this.c != null) {
            a ^= this.c.getHashCode();
        }
        if (this.d != null) {
            a ^= this.d.getHashCode();
        }
        return a;
    };
    Object.defineProperty(PatternFillInfo.prototype, "b", {
        get: function () {
            return this.c;
        },
        set: function (a) {
            this.c = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PatternFillInfo.prototype, "e", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            this.d = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PatternFillInfo.prototype, "j", {
        get: function () {
            return this.i;
        },
        set: function (a) {
            this.i = a;
        },
        enumerable: false,
        configurable: true
    });
    PatternFillInfo.f = function (a, b, c) {
        var d = new PatternFillInfo();
        d.j = toNullable(FillPatternStyle_$type, c.patternStyle);
        if (c.patternStyle == 0) {
            return d;
        }
        var e = c._aa(b);
        if (WorkbookColorInfo.l_op_Inequality(e, WorkbookColorInfo.automatic)) {
            d.e = ColorInfo.a(a, e, 1);
        }
        var f = c._y(b);
        if (WorkbookColorInfo.l_op_Inequality(f, new WorkbookColorInfo(SystemColorsInternal.bb))) {
            d.b = ColorInfo.a(a, f, 1);
        }
        return d;
    };
    PatternFillInfo.prototype.a = function (a, b) {
        var c = 0;
        var d = new WorkbookColorInfo(SystemColorsInternal.bb);
        if (this.b != null) {
            c = 1;
            d = this.b.c(a);
        }
        var e = WorkbookColorInfo.automatic;
        if (this.e != null) {
            c = 1;
            e = this.e.c(a);
        }
        if (this.j.hasValue) {
            c = this.j.value;
        }
        return new CellFillPattern(d, e, c, b, true);
    };
    PatternFillInfo.$t = markType(PatternFillInfo, 'PatternFillInfo');
    return PatternFillInfo;
}(Base));
export { PatternFillInfo };
