package Y0;

import a.AbstractC0212a;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;

/* JADX INFO: loaded from: classes.dex */
public final class a {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final String f3372c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Set f3373d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final a f3374e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final a f3375f;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f3376a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final String f3377b;

    static {
        String strA = AbstractC0212a.A("hts/frbslgiggolai.o/0clgbthfra=snpoo", "tp:/ieaeogn.ogepscmvc/o/ac?omtjo_rt3");
        f3372c = strA;
        String strA2 = AbstractC0212a.A("hts/frbslgigp.ogepscmv/ieo/eaybtho", "tp:/ieaeogn-agolai.o/1frlglgc/aclg");
        String strA3 = AbstractC0212a.A("AzSCki82AwsLzKd5O8zo", "IayckHiZRO1EFl1aGoK");
        f3373d = Collections.unmodifiableSet(new HashSet(Arrays.asList(new X0.c("proto"), new X0.c("json"))));
        f3374e = new a(strA, null);
        f3375f = new a(strA2, strA3);
    }

    public a(String str, String str2) {
        this.f3376a = str;
        this.f3377b = str2;
    }

    public static a a(byte[] bArr) {
        String str = new String(bArr, Charset.forName("UTF-8"));
        if (!str.startsWith("1$")) {
            throw new IllegalArgumentException("Version marker missing from extras");
        }
        String[] strArrSplit = str.substring(2).split(Pattern.quote("\\"), 2);
        if (strArrSplit.length != 2) {
            throw new IllegalArgumentException("Extra is not a valid encoded LegacyFlgDestination");
        }
        String str2 = strArrSplit[0];
        if (str2.isEmpty()) {
            throw new IllegalArgumentException("Missing endpoint in CCTDestination extras");
        }
        String str3 = strArrSplit[1];
        if (str3.isEmpty()) {
            str3 = null;
        }
        return new a(str2, str3);
    }
}
