package d.c;

import com.cvte.vman.BuildConfig;
import d.e.a.l;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public class a {
    public static String a(Iterable iterable, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, l lVar, int i2) throws IOException {
        if ((i2 & 1) != 0) {
            charSequence = ", ";
        }
        int i3 = i2 & 2;
        String str = BuildConfig.FLAVOR;
        CharSequence charSequence5 = i3 != 0 ? BuildConfig.FLAVOR : null;
        if ((i2 & 4) == 0) {
            str = null;
        }
        if ((i2 & 8) != 0) {
            i = -1;
        }
        String str2 = (i2 & 16) != 0 ? "..." : null;
        if ((i2 & 32) != 0) {
            lVar = null;
        }
        d.e.b.e.d(iterable, "<this>");
        d.e.b.e.d(charSequence, "separator");
        d.e.b.e.d(charSequence5, "prefix");
        d.e.b.e.d(str, "postfix");
        d.e.b.e.d(str2, "truncated");
        StringBuilder sb = new StringBuilder();
        d.e.b.e.d(iterable, "<this>");
        d.e.b.e.d(sb, "buffer");
        d.e.b.e.d(charSequence, "separator");
        d.e.b.e.d(charSequence5, "prefix");
        d.e.b.e.d(str, "postfix");
        d.e.b.e.d(str2, "truncated");
        sb.append(charSequence5);
        int i4 = 0;
        for (Object obj : iterable) {
            i4++;
            if (i4 > 1) {
                sb.append(charSequence);
            }
            if (i >= 0 && i4 > i) {
                break;
            }
            b.f.b.b.a(sb, obj, lVar);
        }
        if (i >= 0 && i4 > i) {
            sb.append((CharSequence) str2);
        }
        sb.append((CharSequence) str);
        String string = sb.toString();
        d.e.b.e.c(string, "joinTo(StringBuilder(), …ed, transform).toString()");
        return string;
    }

    public static final <T> List<T> b(T... tArr) {
        d.e.b.e.d(tArr, "elements");
        if (tArr.length <= 0) {
            return c.f1637a;
        }
        d.e.b.e.d(tArr, "<this>");
        List<T> listAsList = Arrays.asList(tArr);
        d.e.b.e.c(listAsList, "asList(this)");
        return listAsList;
    }

    public static final <K, V, M extends Map<? super K, ? super V>> M c(Iterable<? extends d.a<? extends K, ? extends V>> iterable, M m) {
        d.e.b.e.d(iterable, "<this>");
        d.e.b.e.d(m, "destination");
        d.e.b.e.d(m, "<this>");
        d.e.b.e.d(iterable, "pairs");
        for (d.a<? extends K, ? extends V> aVar : iterable) {
            m.put(aVar.f1634a, aVar.f1635b);
        }
        return m;
    }
}
