package com.revenuecat.purchases.paywalls.events;

import com.revenuecat.purchases.paywalls.events.PaywallEvent;
import g5.a;
import i5.g;
import j5.b;
import j5.c;
import j5.d;
import k5.A;
import k5.P;
import k5.S;
import kotlin.jvm.internal.o;
import w4.InterfaceC3141c;

/* JADX INFO: loaded from: classes3.dex */
@InterfaceC3141c
public final class PaywallEvent$$serializer implements A {
    public static final PaywallEvent$$serializer INSTANCE;
    private static final /* synthetic */ S descriptor;

    static {
        PaywallEvent$$serializer paywallEvent$$serializer = new PaywallEvent$$serializer();
        INSTANCE = paywallEvent$$serializer;
        S s6 = new S("com.revenuecat.purchases.paywalls.events.PaywallEvent", paywallEvent$$serializer, 3);
        s6.k("creationData", false);
        s6.k("data", false);
        s6.k("type", false);
        descriptor = s6;
    }

    private PaywallEvent$$serializer() {
    }

    @Override // k5.A
    public a[] childSerializers() {
        return new a[]{PaywallEvent$CreationData$$serializer.INSTANCE, PaywallEventDataSerializer.INSTANCE, PaywallEvent.$childSerializers[2]};
    }

    @Override // g5.a
    public PaywallEvent deserialize(c decoder) {
        o.h(decoder, "decoder");
        g descriptor2 = getDescriptor();
        j5.a aVarB = decoder.b(descriptor2);
        a[] aVarArr = PaywallEvent.$childSerializers;
        int i6 = 0;
        PaywallEvent.CreationData creationData = null;
        PaywallEvent.Data data = null;
        PaywallEventType paywallEventType = null;
        boolean z6 = true;
        while (z6) {
            int iK = aVarB.k(descriptor2);
            if (iK == -1) {
                z6 = false;
            } else if (iK == 0) {
                creationData = (PaywallEvent.CreationData) aVarB.p(descriptor2, 0, PaywallEvent$CreationData$$serializer.INSTANCE, creationData);
                i6 |= 1;
            } else if (iK == 1) {
                data = (PaywallEvent.Data) aVarB.p(descriptor2, 1, PaywallEventDataSerializer.INSTANCE, data);
                i6 |= 2;
            } else {
                if (iK != 2) {
                    throw new g5.g(iK);
                }
                paywallEventType = (PaywallEventType) aVarB.p(descriptor2, 2, aVarArr[2], paywallEventType);
                i6 |= 4;
            }
        }
        aVarB.c(descriptor2);
        return new PaywallEvent(i6, creationData, data, paywallEventType, null);
    }

    @Override // g5.a
    public g getDescriptor() {
        return descriptor;
    }

    @Override // g5.a
    public void serialize(d encoder, PaywallEvent value) {
        o.h(encoder, "encoder");
        o.h(value, "value");
        g descriptor2 = getDescriptor();
        b bVarB = encoder.b(descriptor2);
        PaywallEvent.write$Self$purchases_defaultsBc8Release(value, bVarB, descriptor2);
        bVarB.c(descriptor2);
    }

    @Override // k5.A
    public a[] typeParametersSerializers() {
        return P.f20015b;
    }
}
