package com.iab.omid.library.vungle.internal; import android.view.View; import androidx.annotation.Nullable; import com.iab.omid.library.vungle.adsession.FriendlyObstructionPurpose; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; /* loaded from: classes2.dex */ public class f { private static final Pattern b = Pattern.compile("^[a-zA-Z0-9 ]+$"); private final List a = new ArrayList(); private void a(View view) { if (view == null) { throw new IllegalArgumentException("FriendlyObstruction is null"); } } private void a(String str) { if (str != null) { if (str.length() > 50) { throw new IllegalArgumentException("FriendlyObstruction has detailed reason over 50 characters in length"); } if (!b.matcher(str).matches()) { throw new IllegalArgumentException("FriendlyObstruction has detailed reason that contains characters not in [a-z][A-Z][0-9] or space"); } } } private e b(View view) { for (e eVar : this.a) { if (eVar.c().get() == view) { return eVar; } } return null; } public List a() { return this.a; } public void a(View view, FriendlyObstructionPurpose friendlyObstructionPurpose, @Nullable String str) { a(view); a(str); if (b(view) == null) { this.a.add(new e(view, friendlyObstructionPurpose, str)); } } public void b() { this.a.clear(); } public void c(View view) { a(view); e b2 = b(view); if (b2 != null) { this.a.remove(b2); } } }