package com.google.android.material.shape;

import android.util.StateSet;
import androidx.annotation.Nullable;

/* JADX INFO: loaded from: classes2.dex */
public final class m0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f23121a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public s f23122b;

    @Nullable
    private l0 bottomLeftCornerSizeOverride;

    @Nullable
    private l0 bottomRightCornerSizeOverride;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int[][] f23123c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public s[] f23124d;

    @Nullable
    private l0 topLeftCornerSizeOverride;

    @Nullable
    private l0 topRightCornerSizeOverride;

    public m0(n0 n0Var) {
        int i10 = n0Var.f23127a;
        this.f23121a = i10;
        this.f23122b = n0Var.f23128b;
        int[][] iArr = n0Var.f23129c;
        int[][] iArr2 = new int[iArr.length][];
        this.f23123c = iArr2;
        s[] sVarArr = n0Var.f23130d;
        this.f23124d = new s[sVarArr.length];
        System.arraycopy(iArr, 0, iArr2, 0, i10);
        System.arraycopy(sVarArr, 0, this.f23124d, 0, this.f23121a);
        this.topLeftCornerSizeOverride = n0Var.topLeftCornerSizeOverride;
        this.topRightCornerSizeOverride = n0Var.topRightCornerSizeOverride;
        this.bottomLeftCornerSizeOverride = n0Var.bottomLeftCornerSizeOverride;
        this.bottomRightCornerSizeOverride = n0Var.bottomRightCornerSizeOverride;
    }

    @Nullable
    public n0 build() {
        if (this.f23121a == 0) {
            return null;
        }
        return new n0(this);
    }

    public final void e(int[] iArr, s sVar) {
        int i10 = this.f23121a;
        if (i10 == 0 || iArr.length == 0) {
            this.f23122b = sVar;
        }
        int[][] iArr2 = this.f23123c;
        if (i10 >= iArr2.length) {
            int i11 = i10 + 10;
            int[][] iArr3 = new int[i11][];
            System.arraycopy(iArr2, 0, iArr3, 0, i10);
            this.f23123c = iArr3;
            s[] sVarArr = new s[i11];
            System.arraycopy(this.f23124d, 0, sVarArr, 0, i10);
            this.f23124d = sVarArr;
        }
        int[][] iArr4 = this.f23123c;
        int i12 = this.f23121a;
        iArr4[i12] = iArr;
        this.f23124d[i12] = sVar;
        this.f23121a = i12 + 1;
    }

    public final void f() {
        this.f23122b = new s();
        this.f23123c = new int[10][];
        this.f23124d = new s[10];
    }

    public final void g(l0 l0Var, int i10) {
        if ((i10 | 1) == i10) {
            this.topLeftCornerSizeOverride = l0Var;
        }
        if ((i10 | 2) == i10) {
            this.topRightCornerSizeOverride = l0Var;
        }
        if ((i10 | 4) == i10) {
            this.bottomLeftCornerSizeOverride = l0Var;
        }
        if ((i10 | 8) == i10) {
            this.bottomRightCornerSizeOverride = l0Var;
        }
    }

    public m0(s sVar) {
        f();
        e(StateSet.WILD_CARD, sVar);
    }
}
