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

import E3.v;
import J4.c;
import com.revenuecat.purchases.paywalls.components.properties.Badge;
import com.revenuecat.purchases.ui.revenuecatui.helpers.Result;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes3.dex */
public final class BadgeStyleKt {
    public static final Result toBadgeStyle(Badge badge, c createStackComponentStyle) {
        o.h(badge, "<this>");
        o.h(createStackComponentStyle, "createStackComponentStyle");
        Result result = (Result) createStackComponentStyle.invoke(badge.getStack());
        if (result instanceof Result.Success) {
            return new Result.Success(new BadgeStyle((StackComponentStyle) ((Result.Success) result).getValue(), badge.getStyle(), badge.getAlignment()));
        }
        if (result instanceof Result.Error) {
            return result;
        }
        throw new v();
    }
}
