package P;

import B.AbstractC0084s;
import G0.B;
import G0.InterfaceC0245a0;
import I0.C0291f;
import I0.C0293g;
import I0.InterfaceC0295h;
import K.C0473q;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.util.AttributeSet;
import androidx.compose.runtime.ComposablesKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.CompositionLocalMap;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.Updater;
import androidx.compose.runtime.internal.ComposableLambda;
import i0.AbstractC2237a;
import i0.C2239c;
import i0.InterfaceC2255s;
import java.io.IOException;
import java.util.List;
import org.xmlpull.v1.XmlPullParserException;
import q.InterfaceC2807y;
import t.C2925h;
import u.AbstractC2955a;
import u.AbstractC2957c;
import u.EnumC2956b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class p implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f5584a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f5585b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ Object f5586c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f5587d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ Object f5588e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ Object f5589f;

    public /* synthetic */ p(Object obj, Object obj2, Object obj3, Object obj4, Object obj5, int i6) {
        this.f5584a = i6;
        this.f5585b = obj;
        this.f5586c = obj2;
        this.f5587d = obj3;
        this.f5588e = obj4;
        this.f5589f = obj5;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) throws XmlPullParserException, IOException {
        EnumC2956b enumC2956b;
        TypedArray typedArrayObtainAttributes;
        switch (this.f5584a) {
            case 0:
                Composer composer = (Composer) obj;
                int iIntValue = ((Integer) obj2).intValue();
                if (composer.shouldExecute((iIntValue & 3) != 2, iIntValue & 1)) {
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventStart(1070596993, iIntValue, -1, "androidx.compose.foundation.text.contextmenu.internal.ProvideBothDefaultProviders.<anonymous> (PlatformDefaultTextContextMenuProviders.android.kt:76)");
                    }
                    Object objRememberedValue = composer.rememberedValue();
                    if (objRememberedValue == Composer.Companion.getEmpty()) {
                        objRememberedValue = new C0473q((MutableState) this.f5586c, 11);
                        composer.updateRememberedValue(objRememberedValue);
                    }
                    InterfaceC2255s interfaceC2255sN = B.n((InterfaceC2255s) this.f5585b, (J4.c) objRememberedValue);
                    InterfaceC0245a0 interfaceC0245a0D = AbstractC0084s.d(C2239c.f18794a, true);
                    int iHashCode = Long.hashCode(ComposablesKt.getCurrentCompositeKeyHashCode(composer, 0));
                    CompositionLocalMap currentCompositionLocalMap = composer.getCurrentCompositionLocalMap();
                    InterfaceC2255s interfaceC2255sC = AbstractC2237a.c(composer, interfaceC2255sN);
                    InterfaceC0295h.f2384g.getClass();
                    C0291f c0291f = C0293g.f2375b;
                    if (composer.getApplier() == null) {
                        ComposablesKt.invalidApplier();
                    }
                    composer.startReusableNode();
                    if (composer.getInserting()) {
                        composer.createNode(c0291f);
                    } else {
                        composer.useNode();
                    }
                    Composer composerM81constructorimpl = Updater.m81constructorimpl(composer);
                    Updater.m89setimpl(composerM81constructorimpl, interfaceC0245a0D, C0293g.f2379f);
                    Updater.m89setimpl(composerM81constructorimpl, currentCompositionLocalMap, C0293g.f2378e);
                    Updater.m86initimpl(composerM81constructorimpl, Integer.valueOf(iHashCode), C0293g.f2380g);
                    Updater.m87reconcileimpl(composerM81constructorimpl, C0293g.f2381h);
                    Updater.m89setimpl(composerM81constructorimpl, interfaceC2255sC, C0293g.f2377d);
                    ((ComposableLambda) this.f5587d).invoke(composer, 0);
                    ((R.d) this.f5588e).b((J4.a) this.f5589f, composer, 6);
                    composer.endNode();
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventEnd();
                    }
                } else {
                    composer.skipToGroupEnd();
                }
                return C3137A.f25453a;
            default:
                InterfaceC2807y interfaceC2807y = (InterfaceC2807y) this.f5589f;
                EnumC2956b enumC2956b2 = (EnumC2956b) obj;
                List list = (List) obj2;
                XmlResourceParser xmlResourceParser = (XmlResourceParser) this.f5585b;
                xmlResourceParser.next();
                EnumC2956b enumC2956b3 = null;
                while (true) {
                    boolean zA = AbstractC2955a.a(xmlResourceParser);
                    enumC2956b = AbstractC2957c.f24396a;
                    if (!zA && (xmlResourceParser.getEventType() != 3 || !kotlin.jvm.internal.o.c(xmlResourceParser.getName(), "propertyValuesHolder"))) {
                        if (xmlResourceParser.getEventType() == 2 && kotlin.jvm.internal.o.c(xmlResourceParser.getName(), "keyframe")) {
                            int[] iArr = AbstractC2955a.f24384f;
                            Resources resources = (Resources) this.f5586c;
                            Resources.Theme theme = (Resources.Theme) this.f5587d;
                            AttributeSet attributeSet = (AttributeSet) this.f5588e;
                            if (theme == null || (typedArrayObtainAttributes = theme.obtainStyledAttributes(attributeSet, iArr, 0, 0)) == null) {
                                typedArrayObtainAttributes = resources.obtainAttributes(attributeSet, iArr);
                            }
                            if (enumC2956b2 == null) {
                                try {
                                    EnumC2956b enumC2956bD = AbstractC2957c.d(typedArrayObtainAttributes.getInt(2, 4), typedArrayObtainAttributes.peekValue(0).type);
                                    if (enumC2956bD != null) {
                                        enumC2956b = enumC2956bD;
                                    }
                                } catch (Throwable th) {
                                    typedArrayObtainAttributes.recycle();
                                    throw th;
                                }
                            } else {
                                enumC2956b = enumC2956b2;
                            }
                            C2925h c2925hB = AbstractC2957c.b(typedArrayObtainAttributes, typedArrayObtainAttributes.getFloat(3, 0.0f), AbstractC2957c.a(typedArrayObtainAttributes, resources, theme, 1, interfaceC2807y), enumC2956b, 0);
                            typedArrayObtainAttributes.recycle();
                            if (enumC2956b3 == null) {
                                enumC2956b3 = enumC2956b;
                            }
                            list.add(c2925hB);
                        }
                        xmlResourceParser.next();
                    }
                }
                return enumC2956b3 == null ? enumC2956b2 == null ? enumC2956b : enumC2956b2 : enumC2956b3;
        }
    }
}
