package com.revenuecat.purchases.paywalls.components;

import com.revenuecat.purchases.paywalls.components.ButtonComponent;
import com.revenuecat.purchases.paywalls.components.common.LocalizationKey;
import com.revenuecat.purchases.paywalls.components.common.LocalizationKey$$serializer;
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 UrlSurrogate$$serializer implements A {
    public static final UrlSurrogate$$serializer INSTANCE;
    private static final /* synthetic */ S descriptor;

    static {
        UrlSurrogate$$serializer urlSurrogate$$serializer = new UrlSurrogate$$serializer();
        INSTANCE = urlSurrogate$$serializer;
        S s6 = new S("com.revenuecat.purchases.paywalls.components.UrlSurrogate", urlSurrogate$$serializer, 2);
        s6.k("url_lid", false);
        s6.k("method", false);
        descriptor = s6;
    }

    private UrlSurrogate$$serializer() {
    }

    @Override // k5.A
    public a[] childSerializers() {
        return new a[]{LocalizationKey$$serializer.INSTANCE, UrlMethodDeserializer.INSTANCE};
    }

    @Override // g5.a
    public UrlSurrogate deserialize(c decoder) {
        o.h(decoder, "decoder");
        g descriptor2 = getDescriptor();
        j5.a aVarB = decoder.b(descriptor2);
        boolean z6 = true;
        int i6 = 0;
        String strM613unboximpl = null;
        ButtonComponent.UrlMethod urlMethod = null;
        while (z6) {
            int iK = aVarB.k(descriptor2);
            if (iK == -1) {
                z6 = false;
            } else if (iK == 0) {
                LocalizationKey localizationKey = (LocalizationKey) aVarB.p(descriptor2, 0, LocalizationKey$$serializer.INSTANCE, strM613unboximpl != null ? LocalizationKey.m607boximpl(strM613unboximpl) : null);
                strM613unboximpl = localizationKey != null ? localizationKey.m613unboximpl() : null;
                i6 |= 1;
            } else {
                if (iK != 1) {
                    throw new g5.g(iK);
                }
                urlMethod = (ButtonComponent.UrlMethod) aVarB.p(descriptor2, 1, UrlMethodDeserializer.INSTANCE, urlMethod);
                i6 |= 2;
            }
        }
        aVarB.c(descriptor2);
        return new UrlSurrogate(i6, strM613unboximpl, urlMethod, null, null);
    }

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

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

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