/*
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 { 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
 */
export let PatternFillInfo = /*@__PURE__*/ (() => {
    class PatternFillInfo extends Base {
        constructor() {
            super(...arguments);
            this.c = null;
            this.d = null;
            this.i = toNullable(FillPatternStyle_$type, null);
        }
        equals(a) {
            if (Base.referenceEquals(this, a)) {
                return true;
            }
            let 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);
        }
        getHashCode() {
            let a = Base.getHashCodeStatic(this.i);
            if (this.c != null) {
                a ^= this.c.getHashCode();
            }
            if (this.d != null) {
                a ^= this.d.getHashCode();
            }
            return a;
        }
        get b() {
            return this.c;
        }
        set b(a) {
            this.c = a;
        }
        get e() {
            return this.d;
        }
        set e(a) {
            this.d = a;
        }
        get j() {
            return this.i;
        }
        set j(a) {
            this.i = a;
        }
        static f(a, b, c) {
            let d = new PatternFillInfo();
            d.j = toNullable(FillPatternStyle_$type, c.patternStyle);
            if (c.patternStyle == 0) {
                return d;
            }
            let e = c._aa(b);
            if (WorkbookColorInfo.l_op_Inequality(e, WorkbookColorInfo.automatic)) {
                d.e = ColorInfo.a(a, e, 1);
            }
            let f = c._y(b);
            if (WorkbookColorInfo.l_op_Inequality(f, new WorkbookColorInfo(SystemColorsInternal.bb))) {
                d.b = ColorInfo.a(a, f, 1);
            }
            return d;
        }
        a(a, b) {
            let c = 0;
            let d = new WorkbookColorInfo(SystemColorsInternal.bb);
            if (this.b != null) {
                c = 1;
                d = this.b.c(a);
            }
            let 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;
})();
