package p037.p089.p090;

import android.content.Context;
import android.graphics.Rect;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import p037.p057.AbstractC1723;
import p037.p057.C1714;
import p037.p057.C1729;
import p037.p065.p074.C1880;
import p037.p065.p078.C1920;
import p037.p065.p078.ViewTreeObserverOnPreDrawListenerC1919;
import p037.p089.p090.AbstractC2014;
import p037.p089.p090.AbstractC2041;

/* JADX INFO: renamed from: މ.ވ.ށ.ޞ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C2049 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static final int[] f6758 = {0, 3, 0, 1, 5, 4, 7, 6, 9, 8, 10};

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final AbstractC2061 f6759 = new C2052();

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public static final AbstractC2061 f6760;

    /* JADX INFO: renamed from: މ.ވ.ށ.ޞ$֏, reason: contains not printable characters */
    public interface InterfaceC2050 {
    }

    /* JADX INFO: renamed from: މ.ވ.ށ.ޞ$ؠ, reason: contains not printable characters */
    public static class C2051 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public Fragment f6761;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public boolean f6762;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public C1988 f6763;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public Fragment f6764;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public boolean f6765;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public C1988 f6766;
    }

    static {
        AbstractC2061 abstractC2061;
        try {
            abstractC2061 = (AbstractC2061) Class.forName("މ.ޔ.ށ").getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
        } catch (Exception unused) {
            abstractC2061 = null;
        }
        f6760 = abstractC2061;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static View m4008(C1714<String, View> c1714, C2051 c2051, Object obj, boolean z) {
        ArrayList<String> arrayList;
        C1988 c1988 = c2051.f6763;
        if (obj == null || c1714 == null || (arrayList = c1988.f6712) == null || arrayList.isEmpty()) {
            return null;
        }
        return c1714.get(z ? c1988.f6712.get(0) : c1988.f6713.get(0));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Object m4009(AbstractC2061 abstractC2061, Fragment fragment, Fragment fragment2, boolean z) {
        Object sharedElementEnterTransition = null;
        if (fragment == null || fragment2 == null) {
            return null;
        }
        if (z) {
            Fragment.C0088 c0088 = fragment2.mAnimationInfo;
            if (c0088 != null) {
                Object sharedElementEnterTransition2 = c0088.f649;
                if (sharedElementEnterTransition2 == Fragment.USE_DEFAULT_TRANSITION) {
                    sharedElementEnterTransition2 = fragment2.getSharedElementEnterTransition();
                }
                sharedElementEnterTransition = sharedElementEnterTransition2;
            }
        } else {
            sharedElementEnterTransition = fragment.getSharedElementEnterTransition();
        }
        return abstractC2061.mo4040(abstractC2061.mo4035(sharedElementEnterTransition));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static Object m4010(AbstractC2061 abstractC2061, Fragment fragment, boolean z) {
        if (fragment == null) {
            return null;
        }
        return abstractC2061.mo4035(z ? fragment.getReenterTransition() : fragment.getEnterTransition());
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0024  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static Object m4011(AbstractC2061 abstractC2061, Object obj, Object obj2, Object obj3, Fragment fragment, boolean z) {
        boolean zBooleanValue;
        Boolean bool;
        Boolean bool2;
        if (obj == null || obj2 == null || fragment == null) {
            zBooleanValue = true;
        } else if (z) {
            Fragment.C0088 c0088 = fragment.mAnimationInfo;
            if (c0088 != null && (bool2 = c0088.f650) != null) {
                zBooleanValue = bool2.booleanValue();
            }
        } else {
            Fragment.C0088 c00882 = fragment.mAnimationInfo;
            if (c00882 != null && (bool = c00882.f651) != null) {
                zBooleanValue = bool.booleanValue();
            }
        }
        return zBooleanValue ? abstractC2061.mo4036(obj2, obj, obj3) : abstractC2061.mo4025(obj2, obj, obj3);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static ArrayList<View> m4012(AbstractC2061 abstractC2061, Object obj, Fragment fragment, ArrayList<View> arrayList, View view) {
        if (obj == null) {
            return null;
        }
        ArrayList<View> arrayList2 = new ArrayList<>();
        View view2 = fragment.mView;
        if (view2 != null) {
            abstractC2061.m4046(arrayList2, view2);
        }
        if (arrayList != null) {
            arrayList2.removeAll(arrayList);
        }
        if (arrayList2.isEmpty()) {
            return arrayList2;
        }
        arrayList2.add(view);
        abstractC2061.mo4032(obj, arrayList2);
        return arrayList2;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C1714<String, View> m4013(AbstractC2061 abstractC2061, C1714<String, String> c1714, Object obj, C2051 c2051) {
        View view = c2051.f6761.mView;
        if (c1714.isEmpty() || obj == null || view == null) {
            c1714.clear();
            return null;
        }
        C1714<String, View> c17142 = new C1714<>();
        abstractC2061.m4047((Map<String, View>) c17142, view);
        C1988 c1988 = c2051.f6763;
        ArrayList<String> arrayList = c2051.f6762 ? c1988.f6712 : c1988.f6713;
        if (arrayList != null) {
            AbstractC1723.m3377((Map) c17142, (Collection<?>) arrayList);
            AbstractC1723.m3377((Map) c17142, (Collection<?>) c1714.values());
        }
        int i = c1714.f5620;
        while (true) {
            i--;
            if (i < 0) {
                return c17142;
            }
            if (!c17142.containsKey(c1714.m3392(i))) {
                c1714.mo3391(i);
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static AbstractC2061 m4014(Fragment fragment, Fragment fragment2) {
        Object sharedElementEnterTransition;
        ArrayList arrayList = new ArrayList();
        if (fragment != null) {
            Object exitTransition = fragment.getExitTransition();
            if (exitTransition != null) {
                arrayList.add(exitTransition);
            }
            Object returnTransition = fragment.getReturnTransition();
            if (returnTransition != null) {
                arrayList.add(returnTransition);
            }
            Fragment.C0088 c0088 = fragment.mAnimationInfo;
            if (c0088 == null) {
                sharedElementEnterTransition = null;
            } else {
                sharedElementEnterTransition = c0088.f649;
                if (sharedElementEnterTransition == Fragment.USE_DEFAULT_TRANSITION) {
                    sharedElementEnterTransition = fragment.getSharedElementEnterTransition();
                }
            }
            if (sharedElementEnterTransition != null) {
                arrayList.add(sharedElementEnterTransition);
            }
        }
        if (fragment2 != null) {
            Object enterTransition = fragment2.getEnterTransition();
            if (enterTransition != null) {
                arrayList.add(enterTransition);
            }
            Object reenterTransition = fragment2.getReenterTransition();
            if (reenterTransition != null) {
                arrayList.add(reenterTransition);
            }
            Object sharedElementEnterTransition2 = fragment2.getSharedElementEnterTransition();
            if (sharedElementEnterTransition2 != null) {
                arrayList.add(sharedElementEnterTransition2);
            }
        }
        if (arrayList.isEmpty()) {
            return null;
        }
        AbstractC2061 abstractC2061 = f6759;
        if (abstractC2061 != null && m4021(abstractC2061, arrayList)) {
            return f6759;
        }
        AbstractC2061 abstractC20612 = f6760;
        if (abstractC20612 != null && m4021(abstractC20612, arrayList)) {
            return f6760;
        }
        if (f6759 == null && f6760 == null) {
            return null;
        }
        throw new IllegalArgumentException("Invalid Transition types");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:148:0x03cf  */
    /* JADX WARN: Removed duplicated region for block: B:153:0x03ed  */
    /* JADX WARN: Removed duplicated region for block: B:159:0x03ff  */
    /* JADX WARN: Removed duplicated region for block: B:169:0x043c  */
    /* JADX WARN: Removed duplicated region for block: B:180:0x0482 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:86:0x01f5  */
    /* JADX WARN: Removed duplicated region for block: B:95:0x023b  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static void m4015(Context context, AbstractC2007 abstractC2007, ArrayList<C1988> arrayList, ArrayList<Boolean> arrayList2, int i, int i2, boolean z, InterfaceC2050 interfaceC2050) {
        int i3;
        SparseArray sparseArray;
        int i4;
        int i5;
        ViewGroup viewGroup;
        int i6;
        int i7;
        Fragment fragment;
        ArrayList<View> arrayList3;
        ArrayList<View> arrayList4;
        Object obj;
        C1714 c1714;
        AbstractC2061 abstractC2061;
        Object obj2;
        Object obj3;
        Object obj4;
        Object objM4011;
        Object obj5;
        Object obj6;
        boolean z2;
        Fragment fragment2;
        Fragment fragment3;
        ArrayList<View> arrayList5;
        Rect rect;
        ArrayList<View> arrayList6;
        Fragment fragment4;
        boolean z3;
        C1729 c1729;
        Object obj7;
        Object objM40112;
        C1729 c17292;
        Object objM4009;
        View view;
        Rect rect2;
        ArrayList<String> arrayList7;
        ArrayList<String> arrayList8;
        ArrayList<C1988> arrayList9 = arrayList;
        ArrayList<Boolean> arrayList10 = arrayList2;
        int i8 = i2;
        boolean z4 = z;
        SparseArray sparseArray2 = new SparseArray();
        int i9 = i;
        while (true) {
            i3 = 0;
            if (i9 >= i8) {
                break;
            }
            C1988 c1988 = arrayList9.get(i9);
            if (!arrayList10.get(i9).booleanValue()) {
                int size = c1988.f6699.size();
                for (int i10 = 0; i10 < size; i10++) {
                    m4019(c1988, c1988.f6699.get(i10), (SparseArray<C2051>) sparseArray2, false, z4);
                }
            } else if (c1988.f6532.f6619.mo259()) {
                for (int size2 = c1988.f6699.size() - 1; size2 >= 0; size2--) {
                    m4019(c1988, c1988.f6699.get(size2), (SparseArray<C2051>) sparseArray2, true, z4);
                }
            }
            i9++;
        }
        if (sparseArray2.size() != 0) {
            View view2 = new View(context);
            int size3 = sparseArray2.size();
            int i11 = 0;
            while (i11 < size3) {
                int iKeyAt = sparseArray2.keyAt(i11);
                C1714 c17142 = new C1714();
                int i12 = i8 - 1;
                while (i12 >= i) {
                    C1988 c19882 = arrayList9.get(i12);
                    if (c19882.m3871(iKeyAt)) {
                        boolean zBooleanValue = arrayList10.get(i12).booleanValue();
                        ArrayList<String> arrayList11 = c19882.f6712;
                        if (arrayList11 != null) {
                            int size4 = arrayList11.size();
                            if (zBooleanValue) {
                                arrayList7 = c19882.f6712;
                                arrayList8 = c19882.f6713;
                            } else {
                                ArrayList<String> arrayList12 = c19882.f6712;
                                arrayList7 = c19882.f6713;
                                arrayList8 = arrayList12;
                            }
                            while (i3 < size4) {
                                String str = arrayList8.get(i3);
                                String str2 = arrayList7.get(i3);
                                String str3 = (String) c17142.remove(str2);
                                if (str3 != null) {
                                    c17142.put(str, str3);
                                } else {
                                    c17142.put(str, str2);
                                }
                                i3++;
                            }
                        }
                    }
                    i12--;
                    arrayList9 = arrayList;
                    arrayList10 = arrayList2;
                    i3 = 0;
                }
                C2051 c2051 = (C2051) sparseArray2.valueAt(i11);
                if (!abstractC2007.mo259() || (viewGroup = (ViewGroup) abstractC2007.mo258(iKeyAt)) == null) {
                    sparseArray = sparseArray2;
                    i4 = i11;
                    i5 = size3;
                } else {
                    if (z4) {
                        Fragment fragment5 = c2051.f6761;
                        Fragment fragment6 = c2051.f6764;
                        AbstractC2061 abstractC2061M4014 = m4014(fragment6, fragment5);
                        if (abstractC2061M4014 == null) {
                            sparseArray = sparseArray2;
                            i6 = i11;
                            i7 = size3;
                        } else {
                            boolean z5 = c2051.f6762;
                            boolean z6 = c2051.f6765;
                            ArrayList<View> arrayList13 = new ArrayList<>();
                            ArrayList<View> arrayList14 = new ArrayList<>();
                            Object objM4010 = m4010(abstractC2061M4014, fragment5, z5);
                            Object objM4022 = m4022(abstractC2061M4014, fragment6, z6);
                            sparseArray = sparseArray2;
                            Fragment fragment7 = c2051.f6761;
                            Fragment fragment8 = c2051.f6764;
                            i6 = i11;
                            if (fragment7 != null) {
                                i7 = size3;
                                fragment7.requireView().setVisibility(0);
                            } else {
                                i7 = size3;
                            }
                            if (fragment7 == null || fragment8 == null) {
                                arrayList6 = arrayList13;
                                fragment4 = fragment5;
                                z3 = z5;
                            } else {
                                boolean z7 = c2051.f6762;
                                if (c17142.isEmpty()) {
                                    z3 = z5;
                                    objM4009 = null;
                                } else {
                                    objM4009 = m4009(abstractC2061M4014, fragment7, fragment8, z7);
                                    z3 = z5;
                                }
                                C1714<String, View> c1714M4023 = m4023(abstractC2061M4014, c17142, objM4009, c2051);
                                fragment4 = fragment5;
                                C1714<String, View> c1714M4013 = m4013(abstractC2061M4014, (C1714<String, String>) c17142, objM4009, c2051);
                                if (c17142.isEmpty()) {
                                    if (c1714M4023 != null) {
                                        c1714M4023.clear();
                                    }
                                    if (c1714M4013 != null) {
                                        c1714M4013.clear();
                                    }
                                    obj7 = null;
                                } else {
                                    m4018(arrayList14, c1714M4023, c17142.keySet());
                                    m4018(arrayList13, c1714M4013, (Collection<String>) c17142.values());
                                    obj7 = objM4009;
                                }
                                if (objM4010 == null && objM4022 == null && obj7 == null) {
                                    arrayList6 = arrayList13;
                                } else {
                                    c1729 = c17142;
                                    m4016(fragment7, fragment8, z7, c1714M4023, true);
                                    if (obj7 != null) {
                                        arrayList13.add(view2);
                                        abstractC2061M4014.mo4038(obj7, view2, arrayList14);
                                        arrayList6 = arrayList13;
                                        m4020(abstractC2061M4014, obj7, objM4022, c1714M4023, c2051.f6765, c2051.f6766);
                                        Rect rect3 = new Rect();
                                        View viewM4008 = m4008(c1714M4013, c2051, objM4010, z7);
                                        if (viewM4008 != null) {
                                            abstractC2061M4014.mo4028(objM4010, rect3);
                                        }
                                        view = viewM4008;
                                        rect2 = rect3;
                                    } else {
                                        arrayList6 = arrayList13;
                                        view = null;
                                        rect2 = null;
                                    }
                                    ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2047(fragment7, fragment8, z7, c1714M4013, view, abstractC2061M4014, rect2));
                                    if (objM4010 == null || obj7 != null || objM4022 != null) {
                                        ArrayList<View> arrayListM4012 = m4012(abstractC2061M4014, objM4022, fragment6, arrayList14, view2);
                                        Fragment fragment9 = fragment4;
                                        ArrayList<View> arrayList15 = arrayList6;
                                        ArrayList<View> arrayListM40122 = m4012(abstractC2061M4014, objM4010, fragment9, arrayList15, view2);
                                        m4017(arrayListM40122, 4);
                                        objM40112 = m4011(abstractC2061M4014, objM4010, objM4022, obj7, fragment9, z3);
                                        if (fragment6 != null && arrayListM4012 != null && (arrayListM4012.size() > 0 || arrayList14.size() > 0)) {
                                            C1880 c1880 = new C1880();
                                            AbstractC2014.C2017 c2017 = (AbstractC2014.C2017) interfaceC2050;
                                            c2017.m3969(fragment6, c1880);
                                            abstractC2061M4014.mo4027(fragment6, objM40112, c1880, new RunnableC2043(c2017, fragment6, c1880));
                                        }
                                        if (objM40112 == null) {
                                            if (fragment6 != null && objM4022 != null && fragment6.mAdded && fragment6.mHidden && fragment6.mHiddenChanged) {
                                                fragment6.setHideReplaced(true);
                                                abstractC2061M4014.mo4030(objM4022, fragment6.mView, arrayListM4012);
                                                ViewTreeObserverOnPreDrawListenerC1919.m3734(fragment6.mContainer, new RunnableC2044(arrayListM4012));
                                            }
                                            ArrayList arrayList16 = new ArrayList();
                                            int size5 = arrayList15.size();
                                            for (int i13 = 0; i13 < size5; i13++) {
                                                View view3 = arrayList15.get(i13);
                                                arrayList16.add(C1920.m3764(view3));
                                                view3.setTransitionName(null);
                                            }
                                            abstractC2061M4014.mo4031(objM40112, objM4010, arrayListM40122, objM4022, arrayListM4012, obj7, arrayList15);
                                            abstractC2061M4014.mo4026(viewGroup, objM40112);
                                            int size6 = arrayList15.size();
                                            ArrayList arrayList17 = new ArrayList();
                                            int i14 = 0;
                                            while (i14 < size6) {
                                                View view4 = arrayList14.get(i14);
                                                String strM3764 = C1920.m3764(view4);
                                                arrayList17.add(strM3764);
                                                if (strM3764 == null) {
                                                    c17292 = c1729;
                                                } else {
                                                    view4.setTransitionName(null);
                                                    c17292 = c1729;
                                                    String str4 = (String) c17292.get(strM3764);
                                                    int i15 = 0;
                                                    while (true) {
                                                        if (i15 >= size6) {
                                                            break;
                                                        }
                                                        if (str4.equals(arrayList16.get(i15))) {
                                                            arrayList15.get(i15).setTransitionName(strM3764);
                                                            break;
                                                        }
                                                        i15++;
                                                    }
                                                }
                                                i14++;
                                                c1729 = c17292;
                                            }
                                            ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2058(abstractC2061M4014, size6, arrayList15, arrayList16, arrayList14, arrayList17));
                                            m4017(arrayListM40122, 0);
                                            abstractC2061M4014.mo4039(obj7, arrayList14, arrayList15);
                                        }
                                    }
                                }
                            }
                            c1729 = c17142;
                            obj7 = null;
                            if (objM4010 == null) {
                                ArrayList<View> arrayListM40123 = m4012(abstractC2061M4014, objM4022, fragment6, arrayList14, view2);
                                Fragment fragment92 = fragment4;
                                ArrayList<View> arrayList152 = arrayList6;
                                ArrayList<View> arrayListM401222 = m4012(abstractC2061M4014, objM4010, fragment92, arrayList152, view2);
                                m4017(arrayListM401222, 4);
                                objM40112 = m4011(abstractC2061M4014, objM4010, objM4022, obj7, fragment92, z3);
                                if (fragment6 != null) {
                                    C1880 c18802 = new C1880();
                                    AbstractC2014.C2017 c20172 = (AbstractC2014.C2017) interfaceC2050;
                                    c20172.m3969(fragment6, c18802);
                                    abstractC2061M4014.mo4027(fragment6, objM40112, c18802, new RunnableC2043(c20172, fragment6, c18802));
                                }
                                if (objM40112 == null) {
                                }
                            }
                        }
                    } else {
                        sparseArray = sparseArray2;
                        i6 = i11;
                        i7 = size3;
                        Fragment fragment10 = c2051.f6761;
                        Fragment fragment11 = c2051.f6764;
                        AbstractC2061 abstractC2061M40142 = m4014(fragment11, fragment10);
                        if (abstractC2061M40142 != null) {
                            boolean z8 = c2051.f6762;
                            boolean z9 = c2051.f6765;
                            Object objM40102 = m4010(abstractC2061M40142, fragment10, z8);
                            Object objM40222 = m4022(abstractC2061M40142, fragment11, z9);
                            ArrayList<View> arrayList18 = new ArrayList<>();
                            ArrayList<View> arrayList19 = new ArrayList<>();
                            Fragment fragment12 = c2051.f6761;
                            Fragment fragment13 = c2051.f6764;
                            if (fragment12 == null || fragment13 == null) {
                                fragment = fragment10;
                                arrayList3 = arrayList19;
                                arrayList4 = arrayList18;
                                obj = objM40222;
                                c1714 = c17142;
                                abstractC2061 = abstractC2061M40142;
                                i4 = i6;
                                i5 = i7;
                                obj2 = null;
                                obj3 = objM40102;
                                obj4 = null;
                                if (obj3 == null || obj4 != null || obj != null) {
                                    ArrayList<View> arrayList20 = arrayList4;
                                    ArrayList<View> arrayListM40124 = m4012(abstractC2061, obj, fragment11, arrayList20, view2);
                                    Object obj8 = (arrayListM40124 != null || arrayListM40124.isEmpty()) ? obj2 : obj;
                                    abstractC2061.mo4029(obj3, view2);
                                    objM4011 = m4011(abstractC2061, obj3, obj8, obj4, fragment, c2051.f6762);
                                    if (fragment11 != null && arrayListM40124 != null && (arrayListM40124.size() > 0 || arrayList20.size() > 0)) {
                                        C1880 c18803 = new C1880();
                                        AbstractC2014.C2017 c20173 = (AbstractC2014.C2017) interfaceC2050;
                                        c20173.m3969(fragment11, c18803);
                                        abstractC2061.mo4027(fragment11, objM4011, c18803, new RunnableC2045(c20173, fragment11, c18803));
                                    }
                                    if (objM4011 == null) {
                                        ArrayList<View> arrayList21 = new ArrayList<>();
                                        abstractC2061.mo4031(objM4011, obj3, arrayList21, obj8, arrayListM40124, obj4, arrayList3);
                                        ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2046(obj3, abstractC2061, view2, fragment, arrayList3, arrayList21, arrayListM40124, obj8));
                                        C1714 c17143 = c1714;
                                        ArrayList<View> arrayList22 = arrayList3;
                                        ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2059(abstractC2061, arrayList22, c17143));
                                        abstractC2061.mo4026(viewGroup, objM4011);
                                        ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2060(abstractC2061, arrayList22, c17143));
                                    }
                                }
                            } else {
                                boolean z10 = c2051.f6762;
                                Object objM40092 = c17142.isEmpty() ? null : m4009(abstractC2061M40142, fragment12, fragment13, z10);
                                C1714<String, View> c1714M40232 = m4023(abstractC2061M40142, c17142, objM40092, c2051);
                                if (c17142.isEmpty()) {
                                    obj5 = null;
                                } else {
                                    arrayList18.addAll(c1714M40232.values());
                                    obj5 = objM40092;
                                }
                                if (objM40102 != null || objM40222 != null || obj5 != null) {
                                    fragment = fragment10;
                                    m4016(fragment12, fragment13, z10, c1714M40232, true);
                                    if (obj5 != null) {
                                        rect = new Rect();
                                        abstractC2061M40142.mo4038(obj5, view2, arrayList18);
                                        obj6 = obj5;
                                        z2 = z10;
                                        fragment2 = fragment13;
                                        fragment3 = fragment12;
                                        arrayList5 = arrayList19;
                                        arrayList4 = arrayList18;
                                        m4020(abstractC2061M40142, obj6, objM40222, c1714M40232, c2051.f6765, c2051.f6766);
                                        if (objM40102 != null) {
                                            abstractC2061M40142.mo4028(objM40102, rect);
                                        }
                                    } else {
                                        obj6 = obj5;
                                        z2 = z10;
                                        fragment2 = fragment13;
                                        fragment3 = fragment12;
                                        arrayList5 = arrayList19;
                                        arrayList4 = arrayList18;
                                        rect = null;
                                    }
                                    obj = objM40222;
                                    c1714 = c17142;
                                    ArrayList<View> arrayList23 = arrayList5;
                                    i4 = i6;
                                    obj2 = null;
                                    arrayList3 = arrayList5;
                                    abstractC2061 = abstractC2061M40142;
                                    i5 = i7;
                                    ViewTreeObserverOnPreDrawListenerC1919.m3734(viewGroup, new RunnableC2048(abstractC2061M40142, c17142, obj6, c2051, arrayList23, view2, fragment3, fragment2, z2, arrayList4, objM40102, rect));
                                    obj3 = objM40102;
                                    obj4 = obj6;
                                }
                                if (obj3 == null) {
                                    ArrayList<View> arrayList202 = arrayList4;
                                    ArrayList<View> arrayListM401242 = m4012(abstractC2061, obj, fragment11, arrayList202, view2);
                                    if (arrayListM401242 != null) {
                                        abstractC2061.mo4029(obj3, view2);
                                        objM4011 = m4011(abstractC2061, obj3, obj8, obj4, fragment, c2051.f6762);
                                        if (fragment11 != null) {
                                            C1880 c188032 = new C1880();
                                            AbstractC2014.C2017 c201732 = (AbstractC2014.C2017) interfaceC2050;
                                            c201732.m3969(fragment11, c188032);
                                            abstractC2061.mo4027(fragment11, objM4011, c188032, new RunnableC2045(c201732, fragment11, c188032));
                                        }
                                        if (objM4011 == null) {
                                        }
                                    }
                                }
                            }
                        }
                    }
                    i4 = i6;
                    i5 = i7;
                }
                i11 = i4 + 1;
                arrayList9 = arrayList;
                arrayList10 = arrayList2;
                i8 = i2;
                z4 = z;
                sparseArray2 = sparseArray;
                size3 = i5;
                i3 = 0;
            }
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m4016(Fragment fragment, Fragment fragment2, boolean z, C1714<String, View> c1714, boolean z2) {
        if (z) {
            Fragment.C0088 c0088 = fragment2.mAnimationInfo;
        } else {
            Fragment.C0088 c00882 = fragment.mAnimationInfo;
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m4017(ArrayList<View> arrayList, int i) {
        if (arrayList == null) {
            return;
        }
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            arrayList.get(size).setVisibility(i);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m4018(ArrayList<View> arrayList, C1714<String, View> c1714, Collection<String> collection) {
        for (int i = c1714.f5620 - 1; i >= 0; i--) {
            View viewM3392 = c1714.m3392(i);
            if (collection.contains(C1920.m3764(viewM3392))) {
                arrayList.add(viewM3392);
            }
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:60:0x0076  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0078  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x007c  */
    /* JADX WARN: Removed duplicated region for block: B:69:0x0089  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x008b  */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static void m4019(C1988 c1988, AbstractC2041.C2042 c2042, SparseArray<C2051> sparseArray, boolean z, boolean z2) {
        int i;
        boolean z3;
        boolean z4;
        boolean z5;
        View view;
        Fragment fragment = c2042.f6717;
        if (fragment == null || (i = fragment.mContainerId) == 0) {
            return;
        }
        int i2 = z ? f6758[c2042.f6716] : c2042.f6716;
        boolean z6 = true;
        boolean z7 = false;
        if (i2 == 1) {
            if (z2) {
                z3 = fragment.mIsNewlyAdded;
                z7 = z3;
                z4 = z6;
                z6 = false;
                z5 = false;
            } else {
                z3 = (fragment.mAdded || fragment.mHidden) ? false : true;
                z7 = z3;
                z4 = z6;
                z6 = false;
                z5 = false;
            }
        } else if (i2 == 3) {
            boolean z8 = z2 ? !(!fragment.mAdded || fragment.mHidden) : !(fragment.mAdded || (view = fragment.mView) == null || view.getVisibility() != 0 || fragment.mPostponedAlpha < 0.0f);
            z5 = z8;
            z4 = false;
        } else if (i2 != 4) {
            if (i2 != 5) {
                if (i2 != 6) {
                    if (i2 != 7) {
                        z3 = false;
                        z6 = false;
                    }
                }
                if (z2) {
                }
                z5 = z8;
                z4 = false;
            } else if (!z2) {
                z3 = fragment.mHidden;
            } else if (!fragment.mHiddenChanged || fragment.mHidden || !fragment.mAdded) {
            }
            z7 = z3;
            z4 = z6;
            z6 = false;
            z5 = false;
        } else {
            if (!z2 ? !fragment.mAdded || fragment.mHidden : !fragment.mHiddenChanged || !fragment.mAdded || !fragment.mHidden) {
            }
            z5 = z8;
            z4 = false;
        }
        C2051 c2051 = sparseArray.get(i);
        if (z7) {
            if (c2051 == null) {
                C2051 c20512 = new C2051();
                sparseArray.put(i, c20512);
                c2051 = c20512;
            }
            c2051.f6761 = fragment;
            c2051.f6762 = z;
            c2051.f6763 = c1988;
        }
        if (!z2 && z4) {
            if (c2051 != null && c2051.f6764 == fragment) {
                c2051.f6764 = null;
            }
            if (!c1988.f6714) {
                AbstractC2014 abstractC2014 = c1988.f6532;
                abstractC2014.f6604.m3993(abstractC2014.m3938(fragment));
                abstractC2014.m3909(fragment, abstractC2014.f6617);
            }
        }
        if (z5 && (c2051 == null || c2051.f6764 == null)) {
            if (c2051 == null) {
                C2051 c20513 = new C2051();
                sparseArray.put(i, c20513);
                c2051 = c20513;
            }
            c2051.f6764 = fragment;
            c2051.f6765 = z;
            c2051.f6766 = c1988;
        }
        if (z2 || !z6 || c2051 == null || c2051.f6761 != fragment) {
            return;
        }
        c2051.f6761 = null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static void m4020(AbstractC2061 abstractC2061, Object obj, Object obj2, C1714<String, View> c1714, boolean z, C1988 c1988) {
        ArrayList<String> arrayList = c1988.f6712;
        if (arrayList == null || arrayList.isEmpty()) {
            return;
        }
        View view = c1714.get(z ? c1988.f6713.get(0) : c1988.f6712.get(0));
        abstractC2061.mo4041(obj, view);
        if (obj2 != null) {
            abstractC2061.mo4041(obj2, view);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static boolean m4021(AbstractC2061 abstractC2061, List<Object> list) {
        int size = list.size();
        for (int i = 0; i < size; i++) {
            if (!abstractC2061.mo4034(list.get(i))) {
                return false;
            }
        }
        return true;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static Object m4022(AbstractC2061 abstractC2061, Fragment fragment, boolean z) {
        if (fragment == null) {
            return null;
        }
        return abstractC2061.mo4035(z ? fragment.getReturnTransition() : fragment.getExitTransition());
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static C1714<String, View> m4023(AbstractC2061 abstractC2061, C1714<String, String> c1714, Object obj, C2051 c2051) {
        if (c1714.isEmpty() || obj == null) {
            c1714.clear();
            return null;
        }
        Fragment fragment = c2051.f6764;
        C1714<String, View> c17142 = new C1714<>();
        abstractC2061.m4047((Map<String, View>) c17142, fragment.requireView());
        C1988 c1988 = c2051.f6766;
        ArrayList<String> arrayList = c2051.f6765 ? c1988.f6713 : c1988.f6712;
        if (arrayList != null) {
            AbstractC1723.m3377((Map) c17142, (Collection<?>) arrayList);
        }
        AbstractC1723.m3377((Map) c1714, (Collection<?>) c17142.keySet());
        return c17142;
    }
}
