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

import E3.v;
import J4.a;
import com.revenuecat.purchases.paywalls.components.properties.Size;
import com.revenuecat.purchases.paywalls.components.properties.SizeConstraint;
import com.revenuecat.purchases.ui.revenuecatui.components.modifier.AspectRatio;
import kotlin.jvm.internal.p;
import n2.AbstractC2612c;

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

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

    @Override // J4.a
    public final AspectRatio invoke() {
        Size sizePlusMargin = this.this$0.getSizePlusMargin();
        SizeConstraint height = sizePlusMargin.getHeight();
        if (!(height instanceof SizeConstraint.Fixed)) {
            if (height instanceof SizeConstraint.Fit ? true : height instanceof SizeConstraint.Fill) {
                return null;
            }
            throw new v();
        }
        SizeConstraint width = sizePlusMargin.getWidth();
        if (width instanceof SizeConstraint.Fit ? true : width instanceof SizeConstraint.Fill) {
            return null;
        }
        if (width instanceof SizeConstraint.Fixed) {
            return new AspectRatio(((float) AbstractC2612c.u(((SizeConstraint.Fixed) width).m621getValuepVg5ArA())) / ((float) AbstractC2612c.u(((SizeConstraint.Fixed) height).m621getValuepVg5ArA())), true);
        }
        throw new v();
    }
}
