package androidx.compose.ui.platform;

import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.res.Configuration;
import android.view.View;
import androidx.compose.ui.platform.r;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.google.firebase.analytics.FirebaseAnalytics;
import kotlin.Metadata;
import y0.m;
import y0.s3;

@Metadata(d1 = {"\u0000Z\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0001\n\u0000\n\u0002\u0018\u0002\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a%\u0010\u0005\u001a\u00020\u00032\u0006\u0010\u0001\u001a\u00020\u00002\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0002H\u0001¢\u0006\u0004\b\u0005\u0010\u0006\u001a\u0017\u0010\n\u001a\u00020\t2\u0006\u0010\b\u001a\u00020\u0007H\u0003¢\u0006\u0004\b\n\u0010\u000b\u001a!\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\b\u001a\u00020\u00072\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0003¢\u0006\u0004\b\u000f\u0010\u0010\u001a\u0010\u0010\u0014\u001a\u00020\u00132\u0006\u0010\u0012\u001a\u00020\u0011H\u0002\"\u001d\u0010\u0019\u001a\b\u0012\u0004\u0012\u00020\f0\u00158\u0006¢\u0006\f\n\u0004\b\u0005\u0010\u0016\u001a\u0004\b\u0017\u0010\u0018\"\u001d\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00070\u00158\u0006¢\u0006\f\n\u0004\b\u001a\u0010\u0016\u001a\u0004\b\u001b\u0010\u0018\" \u0010\u001f\u001a\b\u0012\u0004\u0012\u00020\u000e0\u00158\u0000X\u0080\u0004¢\u0006\f\n\u0004\b\u001d\u0010\u0016\u001a\u0004\b\u001e\u0010\u0018\" \u0010\"\u001a\b\u0012\u0004\u0012\u00020\t0\u00158\u0000X\u0080\u0004¢\u0006\f\n\u0004\b \u0010\u0016\u001a\u0004\b!\u0010\u0018\"\u001d\u0010&\u001a\b\u0012\u0004\u0012\u00020#0\u00158\u0006¢\u0006\f\n\u0004\b$\u0010\u0016\u001a\u0004\b%\u0010\u0018\"\u001d\u0010)\u001a\b\u0012\u0004\u0012\u00020'0\u00158\u0006¢\u0006\f\n\u0004\b\u0017\u0010\u0016\u001a\u0004\b(\u0010\u0018\" \u0010.\u001a\b\u0012\u0004\u0012\u00020*0\u00158FX\u0087\u0004¢\u0006\f\u0012\u0004\b,\u0010-\u001a\u0004\b+\u0010\u0018¨\u0006/²\u0006\u000e\u0010\r\u001a\u00020\f8\n@\nX\u008a\u008e\u0002"}, d2 = {"Landroidx/compose/ui/platform/r;", "owner", "Lkotlin/Function0;", "Lrm/n0;", FirebaseAnalytics.Param.CONTENT, "a", "(Landroidx/compose/ui/platform/r;Ldn/p;Ly0/m;I)V", "Landroid/content/Context;", "context", "Lm2/g;", "n", "(Landroid/content/Context;Ly0/m;I)Lm2/g;", "Landroid/content/res/Configuration;", "configuration", "Lm2/d;", "m", "(Landroid/content/Context;Landroid/content/res/Configuration;Ly0/m;I)Lm2/d;", "", AppMeasurementSdk.ConditionalUserProperty.NAME, "", "l", "Ly0/h2;", "Ly0/h2;", "f", "()Ly0/h2;", "LocalConfiguration", "b", "g", "LocalContext", "c", "h", "LocalImageVectorCache", "d", "i", "LocalResourceIdCache", "Li5/f;", "e", "j", "LocalSavedStateRegistryOwner", "Landroid/view/View;", "k", "LocalView", "Landroidx/lifecycle/u;", "getLocalLifecycleOwner", "getLocalLifecycleOwner$annotations", "()V", "LocalLifecycleOwner", "ui_release"}, k = 2, mv = {1, 8, 0})
/* loaded from: classes.dex */
public final class AndroidCompositionLocals_androidKt {

    /* renamed from: a, reason: collision with root package name */
    private static final y0.h2 f2268a = y0.x.d(null, a.f2274p, 1, null);

    /* renamed from: b, reason: collision with root package name */
    private static final y0.h2 f2269b = y0.x.f(b.f2275p);

    /* renamed from: c, reason: collision with root package name */
    private static final y0.h2 f2270c = y0.x.f(c.f2276p);

    /* renamed from: d, reason: collision with root package name */
    private static final y0.h2 f2271d = y0.x.f(d.f2277p);

    /* renamed from: e, reason: collision with root package name */
    private static final y0.h2 f2272e = y0.x.f(e.f2278p);

    /* renamed from: f, reason: collision with root package name */
    private static final y0.h2 f2273f = y0.x.f(f.f2279p);

    /* loaded from: classes.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final a f2274p = new a();

        a() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Configuration invoke() {
            AndroidCompositionLocals_androidKt.l("LocalConfiguration");
            throw new rm.k();
        }
    }

    /* loaded from: classes.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final b f2275p = new b();

        b() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Context invoke() {
            AndroidCompositionLocals_androidKt.l("LocalContext");
            throw new rm.k();
        }
    }

    /* loaded from: classes.dex */
    static final class c extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final c f2276p = new c();

        c() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final m2.d invoke() {
            AndroidCompositionLocals_androidKt.l("LocalImageVectorCache");
            throw new rm.k();
        }
    }

    /* loaded from: classes.dex */
    static final class d extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final d f2277p = new d();

        d() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final m2.g invoke() {
            AndroidCompositionLocals_androidKt.l("LocalResourceIdCache");
            throw new rm.k();
        }
    }

    /* loaded from: classes.dex */
    static final class e extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final e f2278p = new e();

        e() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final i5.f invoke() {
            AndroidCompositionLocals_androidKt.l("LocalSavedStateRegistryOwner");
            throw new rm.k();
        }
    }

    /* loaded from: classes.dex */
    static final class f extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final f f2279p = new f();

        f() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final View invoke() {
            AndroidCompositionLocals_androidKt.l("LocalView");
            throw new rm.k();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class g extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ y0.q1 f2280p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        g(y0.q1 q1Var) {
            super(1);
            this.f2280p = q1Var;
        }

        public final void a(Configuration configuration) {
            AndroidCompositionLocals_androidKt.c(this.f2280p, new Configuration(configuration));
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Configuration) obj);
            return rm.n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class h extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ g1 f2281p;

        /* loaded from: classes.dex */
        public static final class a implements y0.l0 {

            /* renamed from: a, reason: collision with root package name */
            final /* synthetic */ g1 f2282a;

            public a(g1 g1Var) {
                this.f2282a = g1Var;
            }

            @Override // y0.l0
            public void a() {
                this.f2282a.b();
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        h(g1 g1Var) {
            super(1);
            this.f2281p = g1Var;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final y0.l0 invoke(y0.m0 m0Var) {
            return new a(this.f2281p);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class i extends kotlin.jvm.internal.v implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ r f2283p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ r0 f2284q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ dn.p f2285r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        i(r rVar, r0 r0Var, dn.p pVar) {
            super(2);
            this.f2283p = rVar;
            this.f2284q = r0Var;
            this.f2285r = pVar;
        }

        public final void a(y0.m mVar, int i10) {
            if ((i10 & 3) == 2 && mVar.v()) {
                mVar.A();
                return;
            }
            if (y0.p.H()) {
                y0.p.Q(1471621628, i10, -1, "androidx.compose.ui.platform.ProvideAndroidCompositionLocals.<anonymous> (AndroidCompositionLocals.android.kt:131)");
            }
            c1.a(this.f2283p, this.f2284q, this.f2285r, mVar, 0);
            if (y0.p.H()) {
                y0.p.P();
            }
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((y0.m) obj, ((Number) obj2).intValue());
            return rm.n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class j extends kotlin.jvm.internal.v implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ r f2286p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ dn.p f2287q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ int f2288r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        j(r rVar, dn.p pVar, int i10) {
            super(2);
            this.f2286p = rVar;
            this.f2287q = pVar;
            this.f2288r = i10;
        }

        public final void a(y0.m mVar, int i10) {
            AndroidCompositionLocals_androidKt.a(this.f2286p, this.f2287q, mVar, y0.l2.a(this.f2288r | 1));
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((y0.m) obj, ((Number) obj2).intValue());
            return rm.n0.f34904a;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class k extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ Context f2289p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ l f2290q;

        /* loaded from: classes.dex */
        public static final class a implements y0.l0 {

            /* renamed from: a, reason: collision with root package name */
            final /* synthetic */ Context f2291a;

            /* renamed from: b, reason: collision with root package name */
            final /* synthetic */ l f2292b;

            public a(Context context, l lVar) {
                this.f2291a = context;
                this.f2292b = lVar;
            }

            @Override // y0.l0
            public void a() {
                this.f2291a.getApplicationContext().unregisterComponentCallbacks(this.f2292b);
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        k(Context context, l lVar) {
            super(1);
            this.f2289p = context;
            this.f2290q = lVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final y0.l0 invoke(y0.m0 m0Var) {
            this.f2289p.getApplicationContext().registerComponentCallbacks(this.f2290q);
            return new a(this.f2289p, this.f2290q);
        }
    }

    /* loaded from: classes.dex */
    public static final class l implements ComponentCallbacks2 {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ Configuration f2293p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ m2.d f2294q;

        l(Configuration configuration, m2.d dVar) {
            this.f2293p = configuration;
            this.f2294q = dVar;
        }

        @Override // android.content.ComponentCallbacks
        public void onConfigurationChanged(Configuration configuration) {
            this.f2294q.c(this.f2293p.updateFrom(configuration));
            this.f2293p.setTo(configuration);
        }

        @Override // android.content.ComponentCallbacks
        public void onLowMemory() {
            this.f2294q.a();
        }

        @Override // android.content.ComponentCallbacks2
        public void onTrimMemory(int i10) {
            this.f2294q.a();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class m extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ Context f2295p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ n f2296q;

        /* loaded from: classes.dex */
        public static final class a implements y0.l0 {

            /* renamed from: a, reason: collision with root package name */
            final /* synthetic */ Context f2297a;

            /* renamed from: b, reason: collision with root package name */
            final /* synthetic */ n f2298b;

            public a(Context context, n nVar) {
                this.f2297a = context;
                this.f2298b = nVar;
            }

            @Override // y0.l0
            public void a() {
                this.f2297a.getApplicationContext().unregisterComponentCallbacks(this.f2298b);
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        m(Context context, n nVar) {
            super(1);
            this.f2295p = context;
            this.f2296q = nVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final y0.l0 invoke(y0.m0 m0Var) {
            this.f2295p.getApplicationContext().registerComponentCallbacks(this.f2296q);
            return new a(this.f2295p, this.f2296q);
        }
    }

    /* loaded from: classes.dex */
    public static final class n implements ComponentCallbacks2 {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ m2.g f2299p;

        n(m2.g gVar) {
            this.f2299p = gVar;
        }

        @Override // android.content.ComponentCallbacks
        public void onConfigurationChanged(Configuration configuration) {
            this.f2299p.a();
        }

        @Override // android.content.ComponentCallbacks
        public void onLowMemory() {
            this.f2299p.a();
        }

        @Override // android.content.ComponentCallbacks2
        public void onTrimMemory(int i10) {
            this.f2299p.a();
        }
    }

    public static final void a(r rVar, dn.p pVar, y0.m mVar, int i10) {
        int i11;
        y0.m r10 = mVar.r(1396852028);
        if ((i10 & 6) == 0) {
            i11 = (r10.m(rVar) ? 4 : 2) | i10;
        } else {
            i11 = i10;
        }
        if ((i10 & 48) == 0) {
            i11 |= r10.m(pVar) ? 32 : 16;
        }
        if ((i11 & 19) == 18 && r10.v()) {
            r10.A();
        } else {
            if (y0.p.H()) {
                y0.p.Q(1396852028, i11, -1, "androidx.compose.ui.platform.ProvideAndroidCompositionLocals (AndroidCompositionLocals.android.kt:91)");
            }
            Context context = rVar.getContext();
            Object f10 = r10.f();
            m.a aVar = y0.m.f51621a;
            if (f10 == aVar.a()) {
                f10 = s3.d(new Configuration(context.getResources().getConfiguration()), null, 2, null);
                r10.I(f10);
            }
            y0.q1 q1Var = (y0.q1) f10;
            Object f11 = r10.f();
            if (f11 == aVar.a()) {
                f11 = new g(q1Var);
                r10.I(f11);
            }
            rVar.setConfigurationChangeObserver((dn.l) f11);
            Object f12 = r10.f();
            if (f12 == aVar.a()) {
                f12 = new r0(context);
                r10.I(f12);
            }
            r0 r0Var = (r0) f12;
            r.b viewTreeOwners = rVar.getViewTreeOwners();
            if (viewTreeOwners == null) {
                throw new IllegalStateException("Called when the ViewTreeOwnersAvailability is not yet in Available state");
            }
            Object f13 = r10.f();
            if (f13 == aVar.a()) {
                f13 = i1.b(rVar, viewTreeOwners.b());
                r10.I(f13);
            }
            g1 g1Var = (g1) f13;
            rm.n0 n0Var = rm.n0.f34904a;
            boolean m10 = r10.m(g1Var);
            Object f14 = r10.f();
            if (m10 || f14 == aVar.a()) {
                f14 = new h(g1Var);
                r10.I(f14);
            }
            y0.p0.a(n0Var, (dn.l) f14, r10, 6);
            y0.x.b(new y0.i2[]{f2268a.d(b(q1Var)), f2269b.d(context), q4.b.a().d(viewTreeOwners.a()), f2272e.d(viewTreeOwners.b()), i1.i.d().d(g1Var), f2273f.d(rVar.getView()), f2270c.d(m(context, b(q1Var), r10, 0)), f2271d.d(n(context, r10, 0)), c1.l().d(Boolean.valueOf(((Boolean) r10.t(c1.m())).booleanValue() | rVar.getScrollCaptureInProgress$ui_release()))}, g1.c.e(1471621628, true, new i(rVar, r0Var, pVar), r10, 54), r10, y0.i2.f51577i | 48);
            if (y0.p.H()) {
                y0.p.P();
            }
        }
        y0.x2 y10 = r10.y();
        if (y10 != null) {
            y10.a(new j(rVar, pVar, i10));
        }
    }

    private static final Configuration b(y0.q1 q1Var) {
        return (Configuration) q1Var.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void c(y0.q1 q1Var, Configuration configuration) {
        q1Var.setValue(configuration);
    }

    public static final y0.h2 f() {
        return f2268a;
    }

    public static final y0.h2 g() {
        return f2269b;
    }

    public static final y0.h2 getLocalLifecycleOwner() {
        return q4.b.a();
    }

    public static final y0.h2 h() {
        return f2270c;
    }

    public static final y0.h2 i() {
        return f2271d;
    }

    public static final y0.h2 j() {
        return f2272e;
    }

    public static final y0.h2 k() {
        return f2273f;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Void l(String str) {
        throw new IllegalStateException(("CompositionLocal " + str + " not present").toString());
    }

    private static final m2.d m(Context context, Configuration configuration, y0.m mVar, int i10) {
        if (y0.p.H()) {
            y0.p.Q(-485908294, i10, -1, "androidx.compose.ui.platform.obtainImageVectorCache (AndroidCompositionLocals.android.kt:172)");
        }
        Object f10 = mVar.f();
        m.a aVar = y0.m.f51621a;
        if (f10 == aVar.a()) {
            f10 = new m2.d();
            mVar.I(f10);
        }
        m2.d dVar = (m2.d) f10;
        Object f11 = mVar.f();
        Object obj = f11;
        if (f11 == aVar.a()) {
            Configuration configuration2 = new Configuration();
            if (configuration != null) {
                configuration2.setTo(configuration);
            }
            mVar.I(configuration2);
            obj = configuration2;
        }
        Configuration configuration3 = (Configuration) obj;
        Object f12 = mVar.f();
        if (f12 == aVar.a()) {
            f12 = new l(configuration3, dVar);
            mVar.I(f12);
        }
        l lVar = (l) f12;
        boolean m10 = mVar.m(context);
        Object f13 = mVar.f();
        if (m10 || f13 == aVar.a()) {
            f13 = new k(context, lVar);
            mVar.I(f13);
        }
        y0.p0.a(dVar, (dn.l) f13, mVar, 0);
        if (y0.p.H()) {
            y0.p.P();
        }
        return dVar;
    }

    private static final m2.g n(Context context, y0.m mVar, int i10) {
        if (y0.p.H()) {
            y0.p.Q(-1348507246, i10, -1, "androidx.compose.ui.platform.obtainResourceIdCache (AndroidCompositionLocals.android.kt:141)");
        }
        Object f10 = mVar.f();
        m.a aVar = y0.m.f51621a;
        if (f10 == aVar.a()) {
            f10 = new m2.g();
            mVar.I(f10);
        }
        m2.g gVar = (m2.g) f10;
        Object f11 = mVar.f();
        if (f11 == aVar.a()) {
            f11 = new n(gVar);
            mVar.I(f11);
        }
        n nVar = (n) f11;
        boolean m10 = mVar.m(context);
        Object f12 = mVar.f();
        if (m10 || f12 == aVar.a()) {
            f12 = new m(context, nVar);
            mVar.I(f12);
        }
        y0.p0.a(gVar, (dn.l) f12, mVar, 0);
        if (y0.p.H()) {
            y0.p.P();
        }
        return gVar;
    }
}
