package com.airbnb.deeplinkdispatch; import android.os.Bundle; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import o.C14881gav; import o.C14957gcv; import o.InterfaceC14937gcb; /* loaded from: classes.dex */ public final class UtilsKt { public static final void validateConfigurablePathSegmentReplacements(List list, Map map) { C14957gcv.e(list, ""); C14957gcv.e(map, ""); DeepLinkDispatch.getValidationExecutor(); ArrayList arrayList = new ArrayList(); Iterator it = list.iterator(); while (it.hasNext()) { C14881gav.d(arrayList, ((BaseRegistry) it.next()).getPathSegmentReplacementKeysInRegistry()); } Set h = C14881gav.h(arrayList); ArrayList arrayList2 = new ArrayList(); for (Object obj : h) { byte[] bArr = (byte[]) obj; Set keySet = map.keySet(); boolean z = false; if (!(keySet instanceof Collection) || !keySet.isEmpty()) { Iterator it2 = keySet.iterator(); while (true) { if (it2.hasNext()) { if (Arrays.equals((byte[]) it2.next(), bArr)) { z = true; break; } } else { break; } } } if (!z) { arrayList2.add(obj); } } String b = C14881gav.b(arrayList2, ",\n", null, null, 0, null, UtilsKt$validateConfigurablePathSegmentReplacements$1$missingKeys$2.INSTANCE, 30); if (b.length() == 0) { return; } StringBuilder sb = new StringBuilder("Keys not found in BaseDeepLinkDelegate's mapping of PathVariableReplacementValues. Missing keys are:\n"); sb.append(b); sb.append(".\nKeys in mapping are:\n"); sb.append(C14881gav.b(map.keySet(), ",\n", null, null, 0, null, UtilsKt$validateConfigurablePathSegmentReplacements$1$1$1.INSTANCE, 30)); sb.append('.'); throw new IllegalArgumentException(sb.toString().toString()); } public static final Bundle filter(Bundle bundle, InterfaceC14937gcb interfaceC14937gcb) { C14957gcv.e(bundle, ""); C14957gcv.e(interfaceC14937gcb, ""); Bundle bundle2 = new Bundle(bundle); Set keySet = bundle.keySet(); if (keySet != null) { for (String str : keySet) { C14957gcv.c((Object) str, ""); if (!interfaceC14937gcb.invoke(str, bundle.get(str)).booleanValue()) { bundle2.remove(str); } } } return bundle2; } }