package androidx.fragment.app;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.Log;
import androidx.fragment.app.AbstractC0377u;
import androidx.lifecycle.AbstractC0424i;
import java.util.ArrayList;

/* renamed from: androidx.fragment.app.b */
/* loaded from: classes.dex */
public final class C0277b implements Parcelable {
    public static final Parcelable.Creator<C0277b> CREATOR = new C0278a();

    /* renamed from: d */
    public final int[] f1239d;

    /* renamed from: e */
    public final ArrayList<String> f1240e;

    /* renamed from: f */
    public final int[] f1241f;

    /* renamed from: g */
    public final int[] f1242g;

    /* renamed from: h */
    public final int f1243h;

    /* renamed from: i */
    public final String f1244i;

    /* renamed from: j */
    public final int f1245j;

    /* renamed from: k */
    public final int f1246k;

    /* renamed from: l */
    public final CharSequence f1247l;

    /* renamed from: m */
    public final int f1248m;

    /* renamed from: n */
    public final CharSequence f1249n;

    /* renamed from: o */
    public final ArrayList<String> f1250o;

    /* renamed from: p */
    public final ArrayList<String> f1251p;

    /* renamed from: q */
    public final boolean f1252q;

    /* renamed from: androidx.fragment.app.b$a */
    /* loaded from: classes.dex */
    public class C0278a implements Parcelable.Creator<C0277b> {
        @Override // android.os.Parcelable.Creator
        /* renamed from: a */
        public C0277b createFromParcel(Parcel parcel) {
            return new C0277b(parcel);
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: b */
        public C0277b[] newArray(int i) {
            return new C0277b[i];
        }
    }

    public C0277b(Parcel parcel) {
        this.f1239d = parcel.createIntArray();
        this.f1240e = parcel.createStringArrayList();
        this.f1241f = parcel.createIntArray();
        this.f1242g = parcel.createIntArray();
        this.f1243h = parcel.readInt();
        this.f1244i = parcel.readString();
        this.f1245j = parcel.readInt();
        this.f1246k = parcel.readInt();
        this.f1247l = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.f1248m = parcel.readInt();
        this.f1249n = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.f1250o = parcel.createStringArrayList();
        this.f1251p = parcel.createStringArrayList();
        this.f1252q = parcel.readInt() != 0;
    }

    public C0277b(C0275a c0275a) {
        int size = c0275a.f1504c.size();
        this.f1239d = new int[size * 5];
        if (!c0275a.f1510i) {
            throw new IllegalStateException("Not on back stack");
        }
        this.f1240e = new ArrayList<>(size);
        this.f1241f = new int[size];
        this.f1242g = new int[size];
        int i = 0;
        int i2 = 0;
        while (i < size) {
            AbstractC0377u.C0378a c0378a = c0275a.f1504c.get(i);
            int i3 = i2 + 1;
            this.f1239d[i2] = c0378a.f1521a;
            ArrayList<String> arrayList = this.f1240e;
            Fragment fragment = c0378a.f1522b;
            arrayList.add(fragment != null ? fragment.f1186i : null);
            int[] iArr = this.f1239d;
            int i4 = i3 + 1;
            iArr[i3] = c0378a.f1523c;
            int i5 = i4 + 1;
            iArr[i4] = c0378a.f1524d;
            int i6 = i5 + 1;
            iArr[i5] = c0378a.f1525e;
            iArr[i6] = c0378a.f1526f;
            this.f1241f[i] = c0378a.f1527g.ordinal();
            this.f1242g[i] = c0378a.f1528h.ordinal();
            i++;
            i2 = i6 + 1;
        }
        this.f1243h = c0275a.f1509h;
        this.f1244i = c0275a.f1512k;
        this.f1245j = c0275a.f1238v;
        this.f1246k = c0275a.f1513l;
        this.f1247l = c0275a.f1514m;
        this.f1248m = c0275a.f1515n;
        this.f1249n = c0275a.f1516o;
        this.f1250o = c0275a.f1517p;
        this.f1251p = c0275a.f1518q;
        this.f1252q = c0275a.f1519r;
    }

    /* renamed from: a */
    public C0275a m4150a(AbstractC0330m abstractC0330m) {
        C0275a c0275a = new C0275a(abstractC0330m);
        int i = 0;
        int i2 = 0;
        while (i < this.f1239d.length) {
            AbstractC0377u.C0378a c0378a = new AbstractC0377u.C0378a();
            int i3 = i + 1;
            c0378a.f1521a = this.f1239d[i];
            if (AbstractC0330m.m4049B0(2)) {
                Log.v("FragmentManager", "Instantiate " + c0275a + " op #" + i2 + " base fragment #" + this.f1239d[i3]);
            }
            String str = this.f1240e.get(i2);
            c0378a.f1522b = str != null ? abstractC0330m.m3993c0(str) : null;
            c0378a.f1527g = AbstractC0424i.EnumC0427c.values()[this.f1241f[i2]];
            c0378a.f1528h = AbstractC0424i.EnumC0427c.values()[this.f1242g[i2]];
            int[] iArr = this.f1239d;
            int i4 = i3 + 1;
            int i5 = iArr[i3];
            c0378a.f1523c = i5;
            int i6 = i4 + 1;
            int i7 = iArr[i4];
            c0378a.f1524d = i7;
            int i8 = i6 + 1;
            int i9 = iArr[i6];
            c0378a.f1525e = i9;
            int i10 = iArr[i8];
            c0378a.f1526f = i10;
            c0275a.f1505d = i5;
            c0275a.f1506e = i7;
            c0275a.f1507f = i9;
            c0275a.f1508g = i10;
            c0275a.m3791d(c0378a);
            i2++;
            i = i8 + 1;
        }
        c0275a.f1509h = this.f1243h;
        c0275a.f1512k = this.f1244i;
        c0275a.f1238v = this.f1245j;
        c0275a.f1510i = true;
        c0275a.f1513l = this.f1246k;
        c0275a.f1514m = this.f1247l;
        c0275a.f1515n = this.f1248m;
        c0275a.f1516o = this.f1249n;
        c0275a.f1517p = this.f1250o;
        c0275a.f1518q = this.f1251p;
        c0275a.f1519r = this.f1252q;
        c0275a.m4165i(1);
        return c0275a;
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeIntArray(this.f1239d);
        parcel.writeStringList(this.f1240e);
        parcel.writeIntArray(this.f1241f);
        parcel.writeIntArray(this.f1242g);
        parcel.writeInt(this.f1243h);
        parcel.writeString(this.f1244i);
        parcel.writeInt(this.f1245j);
        parcel.writeInt(this.f1246k);
        TextUtils.writeToParcel(this.f1247l, parcel, 0);
        parcel.writeInt(this.f1248m);
        TextUtils.writeToParcel(this.f1249n, parcel, 0);
        parcel.writeStringList(this.f1250o);
        parcel.writeStringList(this.f1251p);
        parcel.writeInt(this.f1252q ? 1 : 0);
    }
}