package r8;

import androidx.lifecycle.f0;
import ca.canadapost.core.data.model.CoreConstants;
import h7.l;
import kotlin.jvm.internal.t;
import qa.d;

/* loaded from: classes.dex */
public abstract class c {
    public static final boolean a(String str, t7.c contextService, String emptyErrorStr, f0 errorLiveData) {
        t.g(str, "<this>");
        t.g(contextService, "contextService");
        t.g(emptyErrorStr, "emptyErrorStr");
        t.g(errorLiveData, "errorLiveData");
        if (str.length() == 0) {
            errorLiveData.q(emptyErrorStr);
        } else if (str.length() > 40) {
            errorLiveData.q(contextService.getString(l.f21169l0));
        } else {
            if (d.r(str, CoreConstants.REGEX_FOR_NO_SPECIAL_CHAR)) {
                return true;
            }
            errorLiveData.q(contextService.getString(l.f21174m0));
        }
        return false;
    }
}
