package o;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.view.View;
import com.google.android.gms.common.R;
import java.util.LinkedHashMap;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public abstract class N3 {
    public static final C0935cl a = new C0935cl(G3.n);
    public static final Ma0 b = new Ma0(G3.f130o);
    public static final C0935cl c = new C0935cl(C1160f3.q);
    public static final Ma0 d = new Ma0(G3.p);
    public static final Ma0 e = new Ma0(G3.q);
    public static final Ma0 f = new Ma0(G3.r);

    public static final void a(C2207q3 c2207q3, SC sc, C0321Mk c0321Mk, int i) {
        LinkedHashMap linkedHashMap;
        boolean z;
        c0321Mk.X(-520299287);
        int i2 = (c0321Mk.h(c2207q3) ? 4 : 2) | i | (c0321Mk.h(sc) ? 32 : 16);
        if (c0321Mk.N(i2 & 1, (i2 & 19) != 18)) {
            Context context = c2207q3.getContext();
            Object objK = c0321Mk.K();
            Object obj = C0140Fk.a;
            if (objK == obj) {
                objK = AbstractC0752ap.X(new Configuration(context.getResources().getConfiguration()));
                c0321Mk.f0(objK);
            }
            InterfaceC1191fR interfaceC1191fR = (InterfaceC1191fR) objK;
            Object objK2 = c0321Mk.K();
            if (objK2 == obj) {
                objK2 = new C2769w(5, interfaceC1191fR);
                c0321Mk.f0(objK2);
            }
            c2207q3.setConfigurationChangeObserver((OC) objK2);
            Object objK3 = c0321Mk.K();
            if (objK3 == obj) {
                objK3 = new O5();
                c0321Mk.f0(objK3);
            }
            O5 o5 = (O5) objK3;
            C0969d3 viewTreeOwners = c2207q3.getViewTreeOwners();
            if (viewTreeOwners == null) {
                throw new IllegalStateException("Called when the ViewTreeOwnersAvailability is not yet in Available state");
            }
            InterfaceC1925n40 interfaceC1925n40 = viewTreeOwners.b;
            Object objK4 = c0321Mk.K();
            if (objK4 == obj) {
                View view = (View) c2207q3.getParent();
                Object tag = view.getTag(R.id.compose_view_saveable_id_tag);
                String strValueOf = tag instanceof String ? (String) tag : null;
                if (strValueOf == null) {
                    strValueOf = String.valueOf(view.getId());
                }
                String str = Z30.class.getSimpleName() + ':' + strValueOf;
                C1640k40 savedStateRegistry = interfaceC1925n40.getSavedStateRegistry();
                Bundle bundleA = savedStateRegistry.a(str);
                if (bundleA != null) {
                    linkedHashMap = new LinkedHashMap();
                    for (String str2 : bundleA.keySet()) {
                        linkedHashMap.put(str2, bundleA.getParcelableArrayList(str2));
                    }
                } else {
                    linkedHashMap = null;
                }
                Ma0 ma0 = AbstractC0876c40.a;
                C0685a40 c0685a40 = new C0685a40(linkedHashMap);
                try {
                    savedStateRegistry.c(str, new C3024yj(1, c0685a40));
                    z = true;
                } catch (IllegalArgumentException unused) {
                    z = false;
                }
                Object c2662us = new C2662us(c0685a40, new C2757vs(z, savedStateRegistry, str));
                c0321Mk.f0(c2662us);
                objK4 = c2662us;
            }
            Object obj2 = (C2662us) objK4;
            boolean zH = c0321Mk.h(obj2);
            Object objK5 = c0321Mk.K();
            if (zH || objK5 == obj) {
                objK5 = new C2769w(6, obj2);
                c0321Mk.f0(objK5);
            }
            AbstractC0249Jp.b(Oh0.a, (OC) objK5, c0321Mk);
            Object objK6 = c0321Mk.K();
            if (objK6 == obj) {
                objK6 = (Build.VERSION.SDK_INT < 31 || !((Vibrator) context.getSystemService(Vibrator.class)).areAllPrimitivesSupported(1, 7, 2)) ? new C1669kS() : new C0664Zp(c2207q3.getView(), 0);
                c0321Mk.f0(objK6);
            }
            GE ge = (GE) objK6;
            Configuration configuration = (Configuration) interfaceC1191fR.getValue();
            Object objK7 = c0321Mk.K();
            if (objK7 == obj) {
                objK7 = new FG();
                c0321Mk.f0(objK7);
            }
            FG fg = (FG) objK7;
            Object objK8 = c0321Mk.K();
            Object obj3 = objK8;
            if (objK8 == obj) {
                Configuration configuration2 = new Configuration();
                if (configuration != null) {
                    configuration2.setTo(configuration);
                }
                c0321Mk.f0(configuration2);
                obj3 = configuration2;
            }
            Configuration configuration3 = (Configuration) obj3;
            Object objK9 = c0321Mk.K();
            if (objK9 == obj) {
                objK9 = new L3(configuration3, fg);
                c0321Mk.f0(objK9);
            }
            L3 l3 = (L3) objK9;
            boolean zH2 = c0321Mk.h(context);
            Object objK10 = c0321Mk.K();
            if (zH2 || objK10 == obj) {
                objK10 = new K3(0, context, l3);
                c0321Mk.f0(objK10);
            }
            AbstractC0249Jp.b(fg, (OC) objK10, c0321Mk);
            Object objK11 = c0321Mk.K();
            if (objK11 == obj) {
                objK11 = new C2490t20();
                c0321Mk.f0(objK11);
            }
            C2490t20 c2490t20 = (C2490t20) objK11;
            Object objK12 = c0321Mk.K();
            if (objK12 == obj) {
                objK12 = new M3(c2490t20);
                c0321Mk.f0(objK12);
            }
            M3 m3 = (M3) objK12;
            boolean zH3 = c0321Mk.h(context);
            Object objK13 = c0321Mk.K();
            if (zH3 || objK13 == obj) {
                objK13 = new K3(1, context, m3);
                c0321Mk.f0(objK13);
            }
            AbstractC0249Jp.b(c2490t20, (OC) objK13, c0321Mk);
            AbstractC3005yZ abstractC3005yZ = AbstractC0840bl.v;
            AbstractC2841wm0.c(new A7[]{a.a((Configuration) interfaceC1191fR.getValue()), b.a(context), AbstractC1758lM.a.a(viewTreeOwners.a), AbstractC1948nM.a.a(interfaceC1925n40), AbstractC0876c40.a.a(obj2), f.a(c2207q3.getView()), d.a(fg), e.a(c2490t20), abstractC3005yZ.a(Boolean.valueOf(((Boolean) c0321Mk.j(abstractC3005yZ)).booleanValue() | c2207q3.getScrollCaptureInProgress$ui_release())), AbstractC0840bl.l.a(ge)}, C2887xC.y(1059770793, new H3(c2207q3, o5, sc), c0321Mk), c0321Mk, 56);
        } else {
            c0321Mk.Q();
        }
        L00 l00S = c0321Mk.s();
        if (l00S != null) {
            l00S.d = new I3(c2207q3, sc, i);
        }
    }

    public static final void b(String str) {
        throw new IllegalStateException(("CompositionLocal " + str + " not present").toString());
    }
}
