package com.vinfast.companion.core.managers;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\u0010\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\t\b\u0000¢\u0006\u0004\b\u0002\u0010\u0003J5\u0010\f\u001a\u00020\n2\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0012\u0010\u000b\u001a\u000e\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\n0\b¢\u0006\u0004\b\f\u0010\r¨\u0006\u000e"}, d2 = {"Lcom/vinfast/companion/core/managers/FeatureScope;", "", "<init>", "()V", "Lkotlinx/coroutines/CoroutineScope;", "scope", "Lcom/vinfast/companion/core/managers/SOTAFeature;", "feature", "Lkotlin/Function1;", "", "", "block", "b", "(Lkotlinx/coroutines/CoroutineScope;Lcom/vinfast/companion/core/managers/SOTAFeature;Lkotlin/jvm/functions/Function1;)V", "core_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class FeatureScope {
    public static /* synthetic */ void c(com.vinfast.companion.core.managers.FeatureScope featureScope, kotlinx.coroutines.CoroutineScope coroutineScope, com.vinfast.companion.core.managers.SOTAFeature sOTAFeature, kotlin.jvm.functions.Function1 function1, int i, java.lang.Object obj) {
        if ((i & 1) != 0) {
            coroutineScope = null;
        }
        featureScope.b(coroutineScope, sOTAFeature, function1);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void d(com.vinfast.companion.core.managers.SOTAFeature sOTAFeature, kotlin.jvm.functions.Function1 function1, com.vinfast.companion.core.managers.SOTAPlan sOTAPlan) {
        com.vinfast.companion.core.managers.SOTAPlan sOTAPlan2 = (com.vinfast.companion.core.managers.SOTAPlan) com.vinfast.companion.core.managers.FeatureAccess.INSTANCE.a().f().get(sOTAFeature);
        if (sOTAPlan2 == null) {
            return;
        }
        function1.invoke(java.lang.Boolean.valueOf(sOTAPlan.compareTo(sOTAPlan2) >= 0));
    }

    public final void b(kotlinx.coroutines.CoroutineScope scope, com.vinfast.companion.core.managers.SOTAFeature feature, kotlin.jvm.functions.Function1 block) {
        kotlin.jvm.internal.Intrinsics.l(feature, "feature");
        kotlin.jvm.internal.Intrinsics.l(block, "block");
        if (scope == null || kotlinx.coroutines.BuildersKt.d(scope, (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.core.managers.FeatureScope$canUse$1(feature, block, null), 3, (java.lang.Object) null) == null) {
            d(feature, block, (com.vinfast.companion.core.managers.SOTAPlan) com.vinfast.companion.core.managers.FeatureAccess.INSTANCE.a().getCurrentPlan().getValue());
        }
    }
}
