package g.h.a;

import android.graphics.Rect;
import android.os.Build;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/* JADX INFO: compiled from: FragmentTransition.java */
/* JADX INFO: loaded from: classes.dex */
class n {
    private static final int[] a = {0, 3, 0, 1, 5, 4, 7, 6, 9, 8};
    private static final p b;
    private static final p c;

    /* JADX INFO: compiled from: FragmentTransition.java */
    static class a implements Runnable {
        final /* synthetic */ ArrayList b;

        a(ArrayList arrayList) {
            this.b = arrayList;
        }

        @Override // java.lang.Runnable
        public void run() {
            n.B(this.b, 4);
        }
    }

    /* JADX INFO: compiled from: FragmentTransition.java */
    static class b implements Runnable {
        final /* synthetic */ Object b;
        final /* synthetic */ p d;
        final /* synthetic */ View e;
        final /* synthetic */ g.h.a.c f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        final /* synthetic */ ArrayList f564g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        final /* synthetic */ ArrayList f565h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        final /* synthetic */ ArrayList f566i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        final /* synthetic */ Object f567j;

        b(Object obj, p pVar, View view, g.h.a.c cVar, ArrayList arrayList, ArrayList arrayList2, ArrayList arrayList3, Object obj2) {
            this.b = obj;
            this.d = pVar;
            this.e = view;
            this.f = cVar;
            this.f564g = arrayList;
            this.f565h = arrayList2;
            this.f566i = arrayList3;
            this.f567j = obj2;
        }

        @Override // java.lang.Runnable
        public void run() {
            Object obj = this.b;
            if (obj != null) {
                this.d.p(obj, this.e);
                this.f565h.addAll(n.k(this.d, this.b, this.f, this.f564g, this.e));
            }
            if (this.f566i != null) {
                if (this.f567j != null) {
                    ArrayList<View> arrayList = new ArrayList<>();
                    arrayList.add(this.e);
                    this.d.q(this.f567j, this.f566i, arrayList);
                }
                this.f566i.clear();
                this.f566i.add(this.e);
            }
        }
    }

    /* JADX INFO: compiled from: FragmentTransition.java */
    static class c implements Runnable {
        final /* synthetic */ g.h.a.c b;
        final /* synthetic */ g.h.a.c d;
        final /* synthetic */ boolean e;
        final /* synthetic */ g.c.a f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        final /* synthetic */ View f568g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        final /* synthetic */ p f569h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        final /* synthetic */ Rect f570i;

        c(g.h.a.c cVar, g.h.a.c cVar2, boolean z, g.c.a aVar, View view, p pVar, Rect rect) {
            this.b = cVar;
            this.d = cVar2;
            this.e = z;
            this.f = aVar;
            this.f568g = view;
            this.f569h = pVar;
            this.f570i = rect;
        }

        @Override // java.lang.Runnable
        public void run() {
            n.f(this.b, this.d, this.e, this.f, false);
            View view = this.f568g;
            if (view != null) {
                this.f569h.k(view, this.f570i);
            }
        }
    }

    /* JADX INFO: compiled from: FragmentTransition.java */
    static class d implements Runnable {
        final /* synthetic */ p b;
        final /* synthetic */ g.c.a d;
        final /* synthetic */ Object e;
        final /* synthetic */ e f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        final /* synthetic */ ArrayList f571g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        final /* synthetic */ View f572h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        final /* synthetic */ g.h.a.c f573i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        final /* synthetic */ g.h.a.c f574j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        final /* synthetic */ boolean f575k;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        final /* synthetic */ ArrayList f576l;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        final /* synthetic */ Object f577m;
        final /* synthetic */ Rect n;

        d(p pVar, g.c.a aVar, Object obj, e eVar, ArrayList arrayList, View view, g.h.a.c cVar, g.h.a.c cVar2, boolean z, ArrayList arrayList2, Object obj2, Rect rect) {
            this.b = pVar;
            this.d = aVar;
            this.e = obj;
            this.f = eVar;
            this.f571g = arrayList;
            this.f572h = view;
            this.f573i = cVar;
            this.f574j = cVar2;
            this.f575k = z;
            this.f576l = arrayList2;
            this.f577m = obj2;
            this.n = rect;
        }

        @Override // java.lang.Runnable
        public void run() {
            g.c.a<String, View> aVarH = n.h(this.b, this.d, this.e, this.f);
            if (aVarH != null) {
                this.f571g.addAll(aVarH.values());
                this.f571g.add(this.f572h);
            }
            n.f(this.f573i, this.f574j, this.f575k, aVarH, false);
            Object obj = this.e;
            if (obj != null) {
                this.b.z(obj, this.f576l, this.f571g);
                View viewT = n.t(aVarH, this.f, this.f577m, this.f575k);
                if (viewT != null) {
                    this.b.k(viewT, this.n);
                }
            }
        }
    }

    /* JADX INFO: compiled from: FragmentTransition.java */
    static class e {
        public g.h.a.c a;
        public boolean b;
        public g.h.a.a c;
        public g.h.a.c d;
        public boolean e;
        public g.h.a.a f;

        e() {
        }
    }

    static {
        b = Build.VERSION.SDK_INT >= 21 ? new o() : null;
        c = x();
    }

    private static void A(p pVar, Object obj, Object obj2, g.c.a<String, View> aVar, boolean z, g.h.a.a aVar2) {
        ArrayList<String> arrayList = aVar2.q;
        if (arrayList == null || arrayList.isEmpty()) {
            return;
        }
        View view = aVar.get(z ? aVar2.r.get(0) : aVar2.q.get(0));
        pVar.v(obj, view);
        if (obj2 != null) {
            pVar.v(obj2, view);
        }
    }

    static void B(ArrayList<View> arrayList, int i2) {
        if (arrayList == null) {
            return;
        }
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            arrayList.get(size).setVisibility(i2);
        }
    }

    static void C(i iVar, ArrayList<g.h.a.a> arrayList, ArrayList<Boolean> arrayList2, int i2, int i3, boolean z) {
        if (iVar.n < 1) {
            return;
        }
        SparseArray sparseArray = new SparseArray();
        for (int i4 = i2; i4 < i3; i4++) {
            g.h.a.a aVar = arrayList.get(i4);
            if (arrayList2.get(i4).booleanValue()) {
                e(aVar, sparseArray, z);
            } else {
                c(aVar, sparseArray, z);
            }
        }
        if (sparseArray.size() != 0) {
            View view = new View(iVar.o.e());
            int size = sparseArray.size();
            for (int i5 = 0; i5 < size; i5++) {
                int iKeyAt = sparseArray.keyAt(i5);
                g.c.a<String, String> aVarD = d(iKeyAt, arrayList, arrayList2, i2, i3);
                e eVar = (e) sparseArray.valueAt(i5);
                if (z) {
                    o(iVar, iKeyAt, eVar, view, aVarD);
                } else {
                    n(iVar, iKeyAt, eVar, view, aVarD);
                }
            }
        }
    }

    private static void a(ArrayList<View> arrayList, g.c.a<String, View> aVar, Collection<String> collection) {
        for (int size = aVar.size() - 1; size >= 0; size--) {
            View viewM = aVar.m(size);
            if (collection.contains(g.e.j.o.h(viewM))) {
                arrayList.add(viewM);
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:55:0x0077  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0079  */
    /* JADX WARN: Removed duplicated region for block: B:64:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x008d  */
    /* JADX WARN: Removed duplicated region for block: B:69:0x0095  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x0097  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    private static void b(g.h.a.a r16, g.h.a.a.C0031a r17, android.util.SparseArray<g.h.a.n.e> r18, boolean r19, boolean r20) {
        /*
            Method dump skipped, instruction units count: 244
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.h.a.n.b(g.h.a.a, g.h.a.a$a, android.util.SparseArray, boolean, boolean):void");
    }

    public static void c(g.h.a.a aVar, SparseArray<e> sparseArray, boolean z) {
        int size = aVar.b.size();
        for (int i2 = 0; i2 < size; i2++) {
            b(aVar, aVar.b.get(i2), sparseArray, false, z);
        }
    }

    private static g.c.a<String, String> d(int i2, ArrayList<g.h.a.a> arrayList, ArrayList<Boolean> arrayList2, int i3, int i4) {
        ArrayList<String> arrayList3;
        ArrayList<String> arrayList4;
        g.c.a<String, String> aVar = new g.c.a<>();
        for (int i5 = i4 - 1; i5 >= i3; i5--) {
            g.h.a.a aVar2 = arrayList.get(i5);
            if (aVar2.j(i2)) {
                boolean zBooleanValue = arrayList2.get(i5).booleanValue();
                ArrayList<String> arrayList5 = aVar2.q;
                if (arrayList5 != null) {
                    int size = arrayList5.size();
                    if (zBooleanValue) {
                        arrayList3 = aVar2.q;
                        arrayList4 = aVar2.r;
                    } else {
                        ArrayList<String> arrayList6 = aVar2.q;
                        arrayList3 = aVar2.r;
                        arrayList4 = arrayList6;
                    }
                    for (int i6 = 0; i6 < size; i6++) {
                        String str = arrayList4.get(i6);
                        String str2 = arrayList3.get(i6);
                        String strRemove = aVar.remove(str2);
                        if (strRemove != null) {
                            aVar.put(str, strRemove);
                        } else {
                            aVar.put(str, str2);
                        }
                    }
                }
            }
        }
        return aVar;
    }

    public static void e(g.h.a.a aVar, SparseArray<e> sparseArray, boolean z) {
        if (aVar.a.p.c()) {
            for (int size = aVar.b.size() - 1; size >= 0; size--) {
                b(aVar, aVar.b.get(size), sparseArray, true, z);
            }
        }
    }

    static void f(g.h.a.c cVar, g.h.a.c cVar2, boolean z, g.c.a<String, View> aVar, boolean z2) {
        androidx.core.app.f fVarR = z ? cVar2.R() : cVar.R();
        if (fVarR != null) {
            ArrayList arrayList = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            int size = aVar == null ? 0 : aVar.size();
            for (int i2 = 0; i2 < size; i2++) {
                arrayList2.add(aVar.j(i2));
                arrayList.add(aVar.m(i2));
            }
            if (z2) {
                fVarR.c(arrayList2, arrayList, null);
            } else {
                fVarR.b(arrayList2, arrayList, null);
            }
        }
    }

    private static boolean g(p pVar, List<Object> list) {
        int size = list.size();
        for (int i2 = 0; i2 < size; i2++) {
            if (!pVar.e(list.get(i2))) {
                return false;
            }
        }
        return true;
    }

    static g.c.a<String, View> h(p pVar, g.c.a<String, String> aVar, Object obj, e eVar) {
        androidx.core.app.f fVarR;
        ArrayList<String> arrayList;
        String strQ;
        g.h.a.c cVar = eVar.a;
        View viewH0 = cVar.h0();
        if (aVar.isEmpty() || obj == null || viewH0 == null) {
            aVar.clear();
            return null;
        }
        g.c.a<String, View> aVar2 = new g.c.a<>();
        pVar.j(aVar2, viewH0);
        g.h.a.a aVar3 = eVar.c;
        if (eVar.b) {
            fVarR = cVar.T();
            arrayList = aVar3.q;
        } else {
            fVarR = cVar.R();
            arrayList = aVar3.r;
        }
        if (arrayList != null) {
            aVar2.o(arrayList);
            aVar2.o(aVar.values());
        }
        if (fVarR != null) {
            fVarR.a(arrayList, aVar2);
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                String str = arrayList.get(size);
                View view = aVar2.get(str);
                if (view == null) {
                    String strQ2 = q(aVar, str);
                    if (strQ2 != null) {
                        aVar.remove(strQ2);
                    }
                } else if (!str.equals(g.e.j.o.h(view)) && (strQ = q(aVar, str)) != null) {
                    aVar.put(strQ, g.e.j.o.h(view));
                }
            }
        } else {
            y(aVar, aVar2);
        }
        return aVar2;
    }

    private static g.c.a<String, View> i(p pVar, g.c.a<String, String> aVar, Object obj, e eVar) {
        androidx.core.app.f fVarT;
        ArrayList<String> arrayList;
        if (aVar.isEmpty() || obj == null) {
            aVar.clear();
            return null;
        }
        g.h.a.c cVar = eVar.d;
        g.c.a<String, View> aVar2 = new g.c.a<>();
        pVar.j(aVar2, cVar.h0());
        g.h.a.a aVar3 = eVar.f;
        if (eVar.e) {
            fVarT = cVar.R();
            arrayList = aVar3.r;
        } else {
            fVarT = cVar.T();
            arrayList = aVar3.q;
        }
        aVar2.o(arrayList);
        if (fVarT != null) {
            fVarT.a(arrayList, aVar2);
            for (int size = arrayList.size() - 1; size >= 0; size--) {
                String str = arrayList.get(size);
                View view = aVar2.get(str);
                if (view == null) {
                    aVar.remove(str);
                } else if (!str.equals(g.e.j.o.h(view))) {
                    aVar.put(g.e.j.o.h(view), aVar.remove(str));
                }
            }
        } else {
            aVar.o(aVar2.keySet());
        }
        return aVar2;
    }

    private static p j(g.h.a.c cVar, g.h.a.c cVar2) {
        ArrayList arrayList = new ArrayList();
        if (cVar != null) {
            Object objS = cVar.S();
            if (objS != null) {
                arrayList.add(objS);
            }
            Object objB0 = cVar.b0();
            if (objB0 != null) {
                arrayList.add(objB0);
            }
            Object objD0 = cVar.d0();
            if (objD0 != null) {
                arrayList.add(objD0);
            }
        }
        if (cVar2 != null) {
            Object objQ = cVar2.Q();
            if (objQ != null) {
                arrayList.add(objQ);
            }
            Object objZ = cVar2.Z();
            if (objZ != null) {
                arrayList.add(objZ);
            }
            Object objC0 = cVar2.c0();
            if (objC0 != null) {
                arrayList.add(objC0);
            }
        }
        if (arrayList.isEmpty()) {
            return null;
        }
        p pVar = b;
        if (pVar != null && g(pVar, arrayList)) {
            return b;
        }
        p pVar2 = c;
        if (pVar2 != null && g(pVar2, arrayList)) {
            return c;
        }
        if (b == null && c == null) {
            return null;
        }
        throw new IllegalArgumentException("Invalid Transition types");
    }

    static ArrayList<View> k(p pVar, Object obj, g.h.a.c cVar, ArrayList<View> arrayList, View view) {
        if (obj == null) {
            return null;
        }
        ArrayList<View> arrayList2 = new ArrayList<>();
        View viewH0 = cVar.h0();
        if (viewH0 != null) {
            pVar.f(arrayList2, viewH0);
        }
        if (arrayList != null) {
            arrayList2.removeAll(arrayList);
        }
        if (arrayList2.isEmpty()) {
            return arrayList2;
        }
        arrayList2.add(view);
        pVar.b(obj, arrayList2);
        return arrayList2;
    }

    private static Object l(p pVar, ViewGroup viewGroup, View view, g.c.a<String, String> aVar, e eVar, ArrayList<View> arrayList, ArrayList<View> arrayList2, Object obj, Object obj2) {
        Object objU;
        g.c.a<String, String> aVar2;
        Object obj3;
        Rect rect;
        g.h.a.c cVar = eVar.a;
        g.h.a.c cVar2 = eVar.d;
        if (cVar == null || cVar2 == null) {
            return null;
        }
        boolean z = eVar.b;
        if (aVar.isEmpty()) {
            aVar2 = aVar;
            objU = null;
        } else {
            objU = u(pVar, cVar, cVar2, z);
            aVar2 = aVar;
        }
        g.c.a<String, View> aVarI = i(pVar, aVar2, objU, eVar);
        if (aVar.isEmpty()) {
            obj3 = null;
        } else {
            arrayList.addAll(aVarI.values());
            obj3 = objU;
        }
        if (obj == null && obj2 == null && obj3 == null) {
            return null;
        }
        f(cVar, cVar2, z, aVarI, true);
        if (obj3 != null) {
            rect = new Rect();
            pVar.y(obj3, view, arrayList);
            A(pVar, obj3, obj2, aVarI, eVar.e, eVar.f);
            if (obj != null) {
                pVar.u(obj, rect);
            }
        } else {
            rect = null;
        }
        q.a(viewGroup, new d(pVar, aVar, obj3, eVar, arrayList2, view, cVar, cVar2, z, arrayList, obj, rect));
        return obj3;
    }

    private static Object m(p pVar, ViewGroup viewGroup, View view, g.c.a<String, String> aVar, e eVar, ArrayList<View> arrayList, ArrayList<View> arrayList2, Object obj, Object obj2) {
        Object obj3;
        View view2;
        Rect rect;
        g.h.a.c cVar = eVar.a;
        g.h.a.c cVar2 = eVar.d;
        if (cVar != null) {
            cVar.h0().setVisibility(0);
        }
        if (cVar == null || cVar2 == null) {
            return null;
        }
        boolean z = eVar.b;
        Object objU = aVar.isEmpty() ? null : u(pVar, cVar, cVar2, z);
        g.c.a<String, View> aVarI = i(pVar, aVar, objU, eVar);
        g.c.a<String, View> aVarH = h(pVar, aVar, objU, eVar);
        if (aVar.isEmpty()) {
            if (aVarI != null) {
                aVarI.clear();
            }
            if (aVarH != null) {
                aVarH.clear();
            }
            obj3 = null;
        } else {
            a(arrayList, aVarI, aVar.keySet());
            a(arrayList2, aVarH, aVar.values());
            obj3 = objU;
        }
        if (obj == null && obj2 == null && obj3 == null) {
            return null;
        }
        f(cVar, cVar2, z, aVarI, true);
        if (obj3 != null) {
            arrayList2.add(view);
            pVar.y(obj3, view, arrayList);
            A(pVar, obj3, obj2, aVarI, eVar.e, eVar.f);
            Rect rect2 = new Rect();
            View viewT = t(aVarH, eVar, obj, z);
            if (viewT != null) {
                pVar.u(obj, rect2);
            }
            rect = rect2;
            view2 = viewT;
        } else {
            view2 = null;
            rect = null;
        }
        q.a(viewGroup, new c(cVar, cVar2, z, aVarH, view2, pVar, rect));
        return obj3;
    }

    private static void n(i iVar, int i2, e eVar, View view, g.c.a<String, String> aVar) {
        g.h.a.c cVar;
        g.h.a.c cVar2;
        p pVarJ;
        Object obj;
        ViewGroup viewGroup = iVar.p.c() ? (ViewGroup) iVar.p.b(i2) : null;
        if (viewGroup == null || (pVarJ = j((cVar2 = eVar.d), (cVar = eVar.a))) == null) {
            return;
        }
        boolean z = eVar.b;
        boolean z2 = eVar.e;
        Object objR = r(pVarJ, cVar, z);
        Object objS = s(pVarJ, cVar2, z2);
        ArrayList arrayList = new ArrayList();
        ArrayList<View> arrayList2 = new ArrayList<>();
        Object objL = l(pVarJ, viewGroup, view, aVar, eVar, arrayList, arrayList2, objR, objS);
        if (objR == null && objL == null) {
            obj = objS;
            if (obj == null) {
                return;
            }
        } else {
            obj = objS;
        }
        ArrayList<View> arrayListK = k(pVarJ, obj, cVar2, arrayList, view);
        Object obj2 = (arrayListK == null || arrayListK.isEmpty()) ? null : obj;
        pVarJ.a(objR, view);
        Object objV = v(pVarJ, objR, obj2, objL, cVar, eVar.b);
        if (objV != null) {
            ArrayList<View> arrayList3 = new ArrayList<>();
            pVarJ.t(objV, objR, arrayList3, obj2, arrayListK, objL, arrayList2);
            z(pVarJ, viewGroup, cVar, view, arrayList2, objR, arrayList3, obj2, arrayListK);
            pVarJ.w(viewGroup, arrayList2, aVar);
            pVarJ.c(viewGroup, objV);
            pVarJ.s(viewGroup, arrayList2, aVar);
        }
    }

    private static void o(i iVar, int i2, e eVar, View view, g.c.a<String, String> aVar) {
        g.h.a.c cVar;
        g.h.a.c cVar2;
        p pVarJ;
        Object obj;
        ViewGroup viewGroup = iVar.p.c() ? (ViewGroup) iVar.p.b(i2) : null;
        if (viewGroup == null || (pVarJ = j((cVar2 = eVar.d), (cVar = eVar.a))) == null) {
            return;
        }
        boolean z = eVar.b;
        boolean z2 = eVar.e;
        ArrayList<View> arrayList = new ArrayList<>();
        ArrayList<View> arrayList2 = new ArrayList<>();
        Object objR = r(pVarJ, cVar, z);
        Object objS = s(pVarJ, cVar2, z2);
        Object objM = m(pVarJ, viewGroup, view, aVar, eVar, arrayList2, arrayList, objR, objS);
        if (objR == null && objM == null) {
            obj = objS;
            if (obj == null) {
                return;
            }
        } else {
            obj = objS;
        }
        ArrayList<View> arrayListK = k(pVarJ, obj, cVar2, arrayList2, view);
        ArrayList<View> arrayListK2 = k(pVarJ, objR, cVar, arrayList, view);
        B(arrayListK2, 4);
        Object objV = v(pVarJ, objR, obj, objM, cVar, z);
        if (objV != null) {
            w(pVarJ, obj, cVar2, arrayListK);
            ArrayList<String> arrayListO = pVarJ.o(arrayList);
            pVarJ.t(objV, objR, arrayListK2, obj, arrayListK, objM, arrayList);
            pVarJ.c(viewGroup, objV);
            pVarJ.x(viewGroup, arrayList2, arrayList, arrayListO, aVar);
            B(arrayListK2, 0);
            pVarJ.z(objM, arrayList2, arrayList);
        }
    }

    private static e p(e eVar, SparseArray<e> sparseArray, int i2) {
        if (eVar != null) {
            return eVar;
        }
        e eVar2 = new e();
        sparseArray.put(i2, eVar2);
        return eVar2;
    }

    private static String q(g.c.a<String, String> aVar, String str) {
        int size = aVar.size();
        for (int i2 = 0; i2 < size; i2++) {
            if (str.equals(aVar.m(i2))) {
                return aVar.j(i2);
            }
        }
        return null;
    }

    private static Object r(p pVar, g.h.a.c cVar, boolean z) {
        if (cVar == null) {
            return null;
        }
        return pVar.g(z ? cVar.Z() : cVar.Q());
    }

    private static Object s(p pVar, g.h.a.c cVar, boolean z) {
        if (cVar == null) {
            return null;
        }
        return pVar.g(z ? cVar.b0() : cVar.S());
    }

    static View t(g.c.a<String, View> aVar, e eVar, Object obj, boolean z) {
        ArrayList<String> arrayList;
        g.h.a.a aVar2 = eVar.c;
        if (obj == null || aVar == null || (arrayList = aVar2.q) == null || arrayList.isEmpty()) {
            return null;
        }
        return aVar.get(z ? aVar2.q.get(0) : aVar2.r.get(0));
    }

    private static Object u(p pVar, g.h.a.c cVar, g.h.a.c cVar2, boolean z) {
        if (cVar == null || cVar2 == null) {
            return null;
        }
        return pVar.A(pVar.g(z ? cVar2.d0() : cVar.c0()));
    }

    private static Object v(p pVar, Object obj, Object obj2, Object obj3, g.h.a.c cVar, boolean z) {
        return (obj == null || obj2 == null || cVar == null) ? true : z ? cVar.K() : cVar.J() ? pVar.n(obj2, obj, obj3) : pVar.m(obj2, obj, obj3);
    }

    private static void w(p pVar, Object obj, g.h.a.c cVar, ArrayList<View> arrayList) {
        if (cVar != null && obj != null && cVar.f533m && cVar.C && cVar.Q) {
            cVar.z1(true);
            pVar.r(obj, cVar.h0(), arrayList);
            q.a(cVar.J, new a(arrayList));
        }
    }

    private static p x() {
        try {
            return (p) Class.forName("androidx.transition.FragmentTransitionSupport").getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
        } catch (Exception unused) {
            return null;
        }
    }

    private static void y(g.c.a<String, String> aVar, g.c.a<String, View> aVar2) {
        for (int size = aVar.size() - 1; size >= 0; size--) {
            if (!aVar2.containsKey(aVar.m(size))) {
                aVar.k(size);
            }
        }
    }

    private static void z(p pVar, ViewGroup viewGroup, g.h.a.c cVar, View view, ArrayList<View> arrayList, Object obj, ArrayList<View> arrayList2, Object obj2, ArrayList<View> arrayList3) {
        q.a(viewGroup, new b(obj, pVar, view, cVar, arrayList, arrayList2, arrayList3, obj2));
    }
}
