package androidx.lifecycle;

import android.os.Bundle;
import androidx.lifecycle.g;
import d0.a;

/* JADX INFO: compiled from: SavedStateHandleSupport.kt */
/* JADX INFO: loaded from: classes.dex */
public final class w {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final a.b<g0.e> f2589a = new b();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final a.b<d0> f2590b = new c();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final a.b<Bundle> f2591c = new a();

    /* JADX INFO: compiled from: SavedStateHandleSupport.kt */
    public static final class a implements a.b<Bundle> {
        a() {
        }
    }

    /* JADX INFO: compiled from: SavedStateHandleSupport.kt */
    public static final class b implements a.b<g0.e> {
        b() {
        }
    }

    /* JADX INFO: compiled from: SavedStateHandleSupport.kt */
    public static final class c implements a.b<d0> {
        c() {
        }
    }

    /* JADX INFO: compiled from: SavedStateHandleSupport.kt */
    static final class d extends w1.h implements v1.l<d0.a, y> {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        public static final d f2592e = new d();

        d() {
            super(1);
        }

        @Override // v1.l
        /* JADX INFO: renamed from: d, reason: merged with bridge method [inline-methods] */
        public final y e(d0.a aVar) {
            w1.g.e(aVar, "$this$initializer");
            return new y();
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    public static final <T extends g0.e & d0> void a(T t2) {
        w1.g.e(t2, "<this>");
        g.c cVarB = t2.a().b();
        w1.g.d(cVarB, "lifecycle.currentState");
        if (!(cVarB == g.c.INITIALIZED || cVarB == g.c.CREATED)) {
            throw new IllegalArgumentException("Failed requirement.".toString());
        }
        if (t2.d().c("androidx.lifecycle.internal.SavedStateHandlesProvider") == null) {
            x xVar = new x(t2.d(), t2);
            t2.d().h("androidx.lifecycle.internal.SavedStateHandlesProvider", xVar);
            t2.a().a(new SavedStateHandleAttacher(xVar));
        }
    }

    public static final y b(d0 d0Var) {
        w1.g.e(d0Var, "<this>");
        d0.c cVar = new d0.c();
        cVar.a(w1.m.a(y.class), d.f2592e);
        return (y) new a0(d0Var, cVar.b()).b("androidx.lifecycle.internal.SavedStateHandlesVM", y.class);
    }
}
