package com.revenuecat.purchases.ui.revenuecatui.components.text;

import J4.a;
import X0.I;
import com.revenuecat.purchases.paywalls.components.PartialTextComponent;
import com.revenuecat.purchases.paywalls.components.properties.FontWeight;
import com.revenuecat.purchases.ui.revenuecatui.components.LocalizedTextPartial;
import com.revenuecat.purchases.ui.revenuecatui.components.ktx.FontKt;
import kotlin.jvm.internal.p;

/* JADX INFO: loaded from: classes3.dex */
public final class TextComponentState$fontWeight$2 extends p implements a {
    final /* synthetic */ TextComponentState this$0;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public TextComponentState$fontWeight$2(TextComponentState textComponentState) {
        super(0);
        this.this$0 = textComponentState;
    }

    @Override // J4.a
    public final I invoke() {
        PartialTextComponent partial;
        I fontWeight;
        LocalizedTextPartial presentedPartial = this.this$0.getPresentedPartial();
        if (presentedPartial != null && (partial = presentedPartial.getPartial()) != null) {
            Integer fontWeightInt = partial.getFontWeightInt();
            if (fontWeightInt != null) {
                fontWeight = new I(fontWeightInt.intValue());
            } else {
                FontWeight fontWeight2 = partial.getFontWeight();
                fontWeight = fontWeight2 != null ? FontKt.toFontWeight(fontWeight2) : null;
            }
            if (fontWeight != null) {
                return fontWeight;
            }
        }
        return this.this$0.style.getFontWeight();
    }
}
