Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9

以下内容为反编译后的 BERepo.java 源代码,内容仅作参考


package com.picsart.video.blooper;

import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import com.google.gson.Gson;
import com.picsart.koin.PAKoinHolder;
import com.picsart.logger.PALog;
import com.picsart.studio.apiv3.model.onboarding.OnBoardingComponentDataKt;
import com.picsart.video.blooper.services.BlooperService;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.net.SocketTimeoutException;
import java.util.Map;
import java.util.regex.Pattern;
import kotlin.Pair;
import kotlin.Triple;
import kotlin.collections.d;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.jvm.internal.Intrinsics;
import myobfuscated.ik2.i;
import myobfuscated.jk2.e0;
import myobfuscated.pd2.e;
import myobfuscated.pd2.j;
import myobfuscated.pn2.g;
import myobfuscated.qd0.c;
import okhttp3.i;
import okhttp3.j;
import okhttp3.n;
import okhttp3.o;
import okhttp3.q;
import org.jetbrains.annotations.NotNull;
import retrofit2.HttpException;
import retrofit2.Response;
public final class BERepo implements c {
    @NotNull
    public final BlooperService a;
    @NotNull
    public final myobfuscated.jg1.a b;
    public String c;

    public static final class a {
        public final boolean a;
        @NotNull
        public final String b;
        @NotNull
        public final String c;
        @NotNull
        public final String d;

        public a(@NotNull String url, @NotNull String message, @NotNull String status, boolean z) {
            Intrinsics.checkNotNullParameter(url, "url");
            Intrinsics.checkNotNullParameter(message, "message");
            Intrinsics.checkNotNullParameter(status, "status");
            this.a = z;
            this.b = url;
            this.c = message;
            this.d = status;
        }

        public final boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj instanceof a) {
                a aVar = (a) obj;
                return this.a == aVar.a && Intrinsics.c(this.b, aVar.b) && Intrinsics.c(this.c, aVar.c) && Intrinsics.c(this.d, aVar.d);
            }
            return false;
        }

        public final int hashCode() {
            boolean z = this.a;
            ?? r0 = z;
            if (z) {
                r0 = 1;
            }
            return this.d.hashCode() + d.e(this.c, d.e(this.b, r0 * 31, 31), 31);
        }

        @NotNull
        public final String toString() {
            StringBuilder sb = new StringBuilder("SentenceJsonResponse(success=");
            sb.append(this.a);
            sb.append(", url=");
            sb.append(this.b);
            sb.append(", message=");
            sb.append(this.c);
            sb.append(", status=");
            return e.m(sb, this.d, ")");
        }
    }

    public BERepo(@NotNull BlooperService blooperService, @NotNull myobfuscated.jg1.a remoteSettings) {
        Intrinsics.checkNotNullParameter(blooperService, "blooperService");
        Intrinsics.checkNotNullParameter(remoteSettings, "remoteSettings");
        this.a = blooperService;
        this.b = remoteSettings;
    }

    public final Object a(myobfuscated.mk2.c<? super String> cVar) {
        BERepo$getJsonUploadBaseUrl$1 bERepo$getJsonUploadBaseUrl$1;
        int i;
        BERepo bERepo;
        if (cVar instanceof BERepo$getJsonUploadBaseUrl$1) {
            bERepo$getJsonUploadBaseUrl$1 = (BERepo$getJsonUploadBaseUrl$1) cVar;
            int i2 = bERepo$getJsonUploadBaseUrl$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$getJsonUploadBaseUrl$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                Object obj = bERepo$getJsonUploadBaseUrl$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$getJsonUploadBaseUrl$1.label;
                if (i != 0) {
                    i.b(obj);
                    String str = this.c;
                    if (str != null) {
                        return str;
                    }
                    bERepo$getJsonUploadBaseUrl$1.L$0 = this;
                    bERepo$getJsonUploadBaseUrl$1.label = 1;
                    obj = this.b.i("blooper_json_upload_url", String.class, "https://find-bloopers.picsart.com/", bERepo$getJsonUploadBaseUrl$1);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    bERepo = this;
                } else if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    bERepo = (BERepo) bERepo$getJsonUploadBaseUrl$1.L$0;
                    i.b(obj);
                }
                String str2 = (String) obj;
                bERepo.c = str2;
                return str2;
            }
        }
        bERepo$getJsonUploadBaseUrl$1 = new BERepo$getJsonUploadBaseUrl$1(this, cVar);
        Object obj2 = bERepo$getJsonUploadBaseUrl$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$getJsonUploadBaseUrl$1.label;
        if (i != 0) {
        }
        String str22 = (String) obj2;
        bERepo.c = str22;
        return str22;
    }

    public final Serializable b(@NotNull String str, @NotNull myobfuscated.mk2.c cVar) {
        BERepo$getSentenceJsonUrl$1 bERepo$getSentenceJsonUrl$1;
        BERepo bERepo;
        ?? r4;
        String str2;
        String str3;
        BERepo bERepo2;
        String str4;
        String str5;
        String str6;
        int i;
        if (cVar instanceof BERepo$getSentenceJsonUrl$1) {
            bERepo$getSentenceJsonUrl$1 = (BERepo$getSentenceJsonUrl$1) cVar;
            int i2 = bERepo$getSentenceJsonUrl$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$getSentenceJsonUrl$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                bERepo = this;
                Object obj = bERepo$getSentenceJsonUrl$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                r4 = bERepo$getSentenceJsonUrl$1.label;
                String str7 = "";
                if (r4 != 0) {
                    i.b(obj);
                    str3 = str;
                    bERepo2 = bERepo;
                    str4 = "IN_PROGRESS";
                    r4 = 0;
                    str5 = "";
                    str2 = str5;
                    if (!Intrinsics.c(str4, "IN_PROGRESS")) {
                    }
                } else if (r4 == 1) {
                    int i3 = bERepo$getSentenceJsonUrl$1.I$0;
                    str5 = (String) bERepo$getSentenceJsonUrl$1.L$2;
                    str6 = (String) bERepo$getSentenceJsonUrl$1.L$1;
                    bERepo2 = (BERepo) bERepo$getSentenceJsonUrl$1.L$0;
                    i.b(obj);
                    i = i3;
                    bERepo$getSentenceJsonUrl$1.L$0 = bERepo2;
                    bERepo$getSentenceJsonUrl$1.L$1 = str6;
                    bERepo$getSentenceJsonUrl$1.L$2 = str5;
                    bERepo$getSentenceJsonUrl$1.I$0 = i;
                    bERepo$getSentenceJsonUrl$1.label = 2;
                    obj = bERepo2.e((Response) obj, bERepo$getSentenceJsonUrl$1);
                    if (obj == coroutineSingletons) {
                    }
                    a aVar = (a) obj;
                    boolean z = aVar.a;
                    str5 = aVar.b;
                    str2 = aVar.c;
                    String str8 = str6;
                    str4 = aVar.d;
                    str3 = str8;
                    r4 = z;
                    if (!Intrinsics.c(str4, "IN_PROGRESS")) {
                    }
                } else if (r4 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    int i4 = bERepo$getSentenceJsonUrl$1.I$0;
                    String str9 = (String) bERepo$getSentenceJsonUrl$1.L$2;
                    str6 = (String) bERepo$getSentenceJsonUrl$1.L$1;
                    bERepo2 = (BERepo) bERepo$getSentenceJsonUrl$1.L$0;
                    i.b(obj);
                    a aVar2 = (a) obj;
                    boolean z2 = aVar2.a;
                    str5 = aVar2.b;
                    str2 = aVar2.c;
                    String str82 = str6;
                    str4 = aVar2.d;
                    str3 = str82;
                    r4 = z2;
                    if (!Intrinsics.c(str4, "IN_PROGRESS")) {
                        BlooperService blooperService = bERepo2.a;
                        bERepo$getSentenceJsonUrl$1.L$0 = bERepo2;
                        bERepo$getSentenceJsonUrl$1.L$1 = str3;
                        bERepo$getSentenceJsonUrl$1.L$2 = str5;
                        bERepo$getSentenceJsonUrl$1.I$0 = r4;
                        bERepo$getSentenceJsonUrl$1.label = 1;
                        Object sentenceJsonUrl = blooperService.getSentenceJsonUrl(str3, bERepo$getSentenceJsonUrl$1);
                        if (sentenceJsonUrl == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        str6 = str3;
                        obj = sentenceJsonUrl;
                        i = r4;
                        bERepo$getSentenceJsonUrl$1.L$0 = bERepo2;
                        bERepo$getSentenceJsonUrl$1.L$1 = str6;
                        bERepo$getSentenceJsonUrl$1.L$2 = str5;
                        bERepo$getSentenceJsonUrl$1.I$0 = i;
                        bERepo$getSentenceJsonUrl$1.label = 2;
                        obj = bERepo2.e((Response) obj, bERepo$getSentenceJsonUrl$1);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        a aVar22 = (a) obj;
                        boolean z22 = aVar22.a;
                        str5 = aVar22.b;
                        str2 = aVar22.c;
                        String str822 = str6;
                        str4 = aVar22.d;
                        str3 = str822;
                        r4 = z22;
                        if (!Intrinsics.c(str4, "IN_PROGRESS")) {
                            PALog.a("Blooper_Repo", "getSentenceJsonUrl 1 response success = " + ((boolean) r4) + "; url = " + str5 + "; message = " + str2 + "; status = " + str4);
                            boolean z3 = r4;
                            return new Triple(Boolean.valueOf(z3), str5, str2);
                        }
                    }
                }
            }
        }
        bERepo = this;
        bERepo$getSentenceJsonUrl$1 = new BERepo$getSentenceJsonUrl$1(bERepo, cVar);
        Object obj2 = bERepo$getSentenceJsonUrl$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        r4 = bERepo$getSentenceJsonUrl$1.label;
        String str72 = "";
        if (r4 != 0) {
        }
    }

    public final Serializable c(@NotNull String str, @NotNull myobfuscated.mk2.c cVar) {
        BERepo$getTransactionId$1 bERepo$getTransactionId$1;
        Object obj;
        CoroutineSingletons coroutineSingletons;
        int i;
        String str2;
        BERepo bERepo;
        int i2;
        String str3;
        String str4;
        int i3;
        String str5;
        String str6;
        String message;
        String message2;
        String message3;
        Response response;
        q errorBody;
        String string;
        if (cVar instanceof BERepo$getTransactionId$1) {
            bERepo$getTransactionId$1 = (BERepo$getTransactionId$1) cVar;
            int i4 = bERepo$getTransactionId$1.label;
            if ((i4 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$getTransactionId$1.label = i4 - RecyclerView.UNDEFINED_DURATION;
                obj = bERepo$getTransactionId$1.result;
                coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$getTransactionId$1.label;
                String str7 = "";
                if (i != 0) {
                    i.b(obj);
                    bERepo$getTransactionId$1.L$0 = this;
                    bERepo$getTransactionId$1.L$1 = str;
                    bERepo$getTransactionId$1.L$2 = "";
                    bERepo$getTransactionId$1.L$3 = "";
                    bERepo$getTransactionId$1.I$0 = 0;
                    bERepo$getTransactionId$1.label = 1;
                    Object i5 = this.b.i("blooper_whisper_model", String.class, OnBoardingComponentDataKt.SMALL, bERepo$getTransactionId$1);
                    if (i5 == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    str2 = str;
                    bERepo = this;
                    obj = i5;
                    i2 = 0;
                    str3 = "";
                    str4 = str3;
                } else if (i != 1) {
                    if (i == 2) {
                        i3 = bERepo$getTransactionId$1.I$0;
                        str6 = (String) bERepo$getTransactionId$1.L$1;
                        str5 = (String) bERepo$getTransactionId$1.L$0;
                        try {
                            i.b(obj);
                            response = (Response) obj;
                            if (response == null && response.isSuccessful() && response.body() != null) {
                                try {
                                    myobfuscated.pd2.b bVar = (myobfuscated.pd2.b) response.body();
                                    if (bVar != null) {
                                        String a2 = bVar.a();
                                        if (a2 != null) {
                                            str7 = a2;
                                        }
                                    }
                                    i3 = 1;
                                    str5 = str7;
                                } catch (SocketTimeoutException e) {
                                    e = e;
                                    i3 = 1;
                                    message3 = e.getMessage();
                                    if (message3 != null) {
                                    }
                                    PALog.a("Blooper_Repo", "getTransactionId response error message = ".concat(str7));
                                    str6 = str7;
                                    return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                                } catch (IOException e2) {
                                    e = e2;
                                    i3 = 1;
                                    message2 = e.getMessage();
                                    if (message2 != null) {
                                    }
                                    PALog.a("Blooper_Repo", "getTransactionId response error message = ".concat(str7));
                                    str6 = str7;
                                    return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                                } catch (HttpException e3) {
                                    e = e3;
                                    i3 = 1;
                                    message = e.getMessage();
                                    if (message != null) {
                                    }
                                    PALog.a("Blooper_Repo", "getTransactionId response error code = " + e.code() + ", message = " + e.getMessage());
                                    str6 = str7;
                                    return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                                }
                            } else {
                                if (response != null && (errorBody = response.errorBody()) != null && (string = errorBody.string()) != null) {
                                    str6 = string;
                                    PALog.a("Blooper_Repo", "getTransactionId response error body = ".concat(str6));
                                }
                                str6 = "";
                                PALog.a("Blooper_Repo", "getTransactionId response error body = ".concat(str6));
                            }
                        } catch (SocketTimeoutException e4) {
                            e = e4;
                            message3 = e.getMessage();
                            if (message3 != null) {
                            }
                            PALog.a("Blooper_Repo", "getTransactionId response error message = ".concat(str7));
                            str6 = str7;
                            return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                        } catch (IOException e5) {
                            e = e5;
                            message2 = e.getMessage();
                            if (message2 != null) {
                            }
                            PALog.a("Blooper_Repo", "getTransactionId response error message = ".concat(str7));
                            str6 = str7;
                            return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                        } catch (HttpException e6) {
                            e = e6;
                            message = e.getMessage();
                            if (message != null) {
                            }
                            PALog.a("Blooper_Repo", "getTransactionId response error code = " + e.code() + ", message = " + e.getMessage());
                            str6 = str7;
                            return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                        }
                        return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                    }
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    i2 = bERepo$getTransactionId$1.I$0;
                    str3 = (String) bERepo$getTransactionId$1.L$3;
                    str4 = (String) bERepo$getTransactionId$1.L$2;
                    str2 = (String) bERepo$getTransactionId$1.L$1;
                    bERepo = (BERepo) bERepo$getTransactionId$1.L$0;
                    i.b(obj);
                }
                String str8 = (String) obj;
                BlooperService blooperService = bERepo.a;
                myobfuscated.pd2.c cVar2 = new myobfuscated.pd2.c(str8, str2);
                bERepo$getTransactionId$1.L$0 = str4;
                bERepo$getTransactionId$1.L$1 = str3;
                bERepo$getTransactionId$1.L$2 = null;
                bERepo$getTransactionId$1.L$3 = null;
                bERepo$getTransactionId$1.I$0 = i2;
                bERepo$getTransactionId$1.label = 2;
                obj = blooperService.uploadAudioUrl(cVar2, bERepo$getTransactionId$1);
                if (obj != coroutineSingletons) {
                    return coroutineSingletons;
                }
                i3 = i2;
                str6 = str3;
                str5 = str4;
                response = (Response) obj;
                if (response == null) {
                }
                if (response != null) {
                    str6 = string;
                    PALog.a("Blooper_Repo", "getTransactionId response error body = ".concat(str6));
                    return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
                }
                str6 = "";
                PALog.a("Blooper_Repo", "getTransactionId response error body = ".concat(str6));
                return new Triple(Boolean.valueOf(i3 == 0), str5, str6);
            }
        }
        bERepo$getTransactionId$1 = new BERepo$getTransactionId$1(this, cVar);
        obj = bERepo$getTransactionId$1.result;
        coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$getTransactionId$1.label;
        String str72 = "";
        if (i != 0) {
        }
        String str82 = (String) obj;
        BlooperService blooperService2 = bERepo.a;
        myobfuscated.pd2.c cVar22 = new myobfuscated.pd2.c(str82, str2);
        bERepo$getTransactionId$1.L$0 = str4;
        bERepo$getTransactionId$1.L$1 = str3;
        bERepo$getTransactionId$1.L$2 = null;
        bERepo$getTransactionId$1.L$3 = null;
        bERepo$getTransactionId$1.I$0 = i2;
        bERepo$getTransactionId$1.label = 2;
        obj = blooperService2.uploadAudioUrl(cVar22, bERepo$getTransactionId$1);
        if (obj != coroutineSingletons) {
        }
    }

    public final Serializable d(myobfuscated.mk2.c cVar) {
        BERepo$getUploadSentenceRequestQuery$1 bERepo$getUploadSentenceRequestQuery$1;
        CoroutineSingletons coroutineSingletons;
        int i;
        BERepo bERepo;
        Object i2;
        BERepo bERepo2;
        String str;
        Object i3;
        String str2;
        Object i4;
        String str3;
        String str4;
        String str5;
        if (cVar instanceof BERepo$getUploadSentenceRequestQuery$1) {
            bERepo$getUploadSentenceRequestQuery$1 = (BERepo$getUploadSentenceRequestQuery$1) cVar;
            int i5 = bERepo$getUploadSentenceRequestQuery$1.label;
            if ((i5 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$getUploadSentenceRequestQuery$1.label = i5 - RecyclerView.UNDEFINED_DURATION;
                Object obj = bERepo$getUploadSentenceRequestQuery$1.result;
                coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$getUploadSentenceRequestQuery$1.label;
                if (i != 0) {
                    i.b(obj);
                    bERepo$getUploadSentenceRequestQuery$1.L$0 = this;
                    bERepo$getUploadSentenceRequestQuery$1.label = 1;
                    obj = this.b.i("blooper_space_time", String.class, "1.0", bERepo$getUploadSentenceRequestQuery$1);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    bERepo = this;
                } else if (i == 1) {
                    bERepo = (BERepo) bERepo$getUploadSentenceRequestQuery$1.L$0;
                    i.b(obj);
                } else if (i != 2) {
                    if (i != 3) {
                        if (i == 4) {
                            str3 = (String) bERepo$getUploadSentenceRequestQuery$1.L$2;
                            str5 = (String) bERepo$getUploadSentenceRequestQuery$1.L$1;
                            str4 = (String) bERepo$getUploadSentenceRequestQuery$1.L$0;
                            i.b(obj);
                            return (Serializable) d.i(new Pair("space_time", str4), new Pair("time_to_ignore_duplication", str5), new Pair("space_text", str3), new Pair("word_count_to_match", (String) obj));
                        }
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    String str6 = (String) bERepo$getUploadSentenceRequestQuery$1.L$1;
                    bERepo2 = (BERepo) bERepo$getUploadSentenceRequestQuery$1.L$0;
                    i.b(obj);
                    str2 = (String) bERepo$getUploadSentenceRequestQuery$1.L$2;
                    str = str6;
                    String str7 = (String) obj;
                    myobfuscated.jg1.a aVar = bERepo2.b;
                    bERepo$getUploadSentenceRequestQuery$1.L$0 = str;
                    bERepo$getUploadSentenceRequestQuery$1.L$1 = str2;
                    bERepo$getUploadSentenceRequestQuery$1.L$2 = str7;
                    bERepo$getUploadSentenceRequestQuery$1.label = 4;
                    i4 = aVar.i("blooper_word_count_to_match", String.class, "2", bERepo$getUploadSentenceRequestQuery$1);
                    if (i4 != coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    str3 = str7;
                    obj = i4;
                    str4 = str;
                    str5 = str2;
                    return (Serializable) d.i(new Pair("space_time", str4), new Pair("time_to_ignore_duplication", str5), new Pair("space_text", str3), new Pair("word_count_to_match", (String) obj));
                } else {
                    str = (String) bERepo$getUploadSentenceRequestQuery$1.L$1;
                    i.b(obj);
                    bERepo2 = (BERepo) bERepo$getUploadSentenceRequestQuery$1.L$0;
                    String str8 = (String) obj;
                    myobfuscated.jg1.a aVar2 = bERepo2.b;
                    bERepo$getUploadSentenceRequestQuery$1.L$0 = bERepo2;
                    bERepo$getUploadSentenceRequestQuery$1.L$1 = str;
                    bERepo$getUploadSentenceRequestQuery$1.L$2 = str8;
                    bERepo$getUploadSentenceRequestQuery$1.label = 3;
                    i3 = aVar2.i("blooper_space_text", String.class, "...............", bERepo$getUploadSentenceRequestQuery$1);
                    if (i3 != coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    str2 = str8;
                    obj = i3;
                    String str72 = (String) obj;
                    myobfuscated.jg1.a aVar3 = bERepo2.b;
                    bERepo$getUploadSentenceRequestQuery$1.L$0 = str;
                    bERepo$getUploadSentenceRequestQuery$1.L$1 = str2;
                    bERepo$getUploadSentenceRequestQuery$1.L$2 = str72;
                    bERepo$getUploadSentenceRequestQuery$1.label = 4;
                    i4 = aVar3.i("blooper_word_count_to_match", String.class, "2", bERepo$getUploadSentenceRequestQuery$1);
                    if (i4 != coroutineSingletons) {
                    }
                }
                String str9 = (String) obj;
                myobfuscated.jg1.a aVar4 = bERepo.b;
                bERepo$getUploadSentenceRequestQuery$1.L$0 = bERepo;
                bERepo$getUploadSentenceRequestQuery$1.L$1 = str9;
                bERepo$getUploadSentenceRequestQuery$1.label = 2;
                i2 = aVar4.i("blooper_time_to_ignore_duplication", String.class, "5.0", bERepo$getUploadSentenceRequestQuery$1);
                if (i2 != coroutineSingletons) {
                    return coroutineSingletons;
                }
                bERepo2 = bERepo;
                str = str9;
                obj = i2;
                String str82 = (String) obj;
                myobfuscated.jg1.a aVar22 = bERepo2.b;
                bERepo$getUploadSentenceRequestQuery$1.L$0 = bERepo2;
                bERepo$getUploadSentenceRequestQuery$1.L$1 = str;
                bERepo$getUploadSentenceRequestQuery$1.L$2 = str82;
                bERepo$getUploadSentenceRequestQuery$1.label = 3;
                i3 = aVar22.i("blooper_space_text", String.class, "...............", bERepo$getUploadSentenceRequestQuery$1);
                if (i3 != coroutineSingletons) {
                }
            }
        }
        bERepo$getUploadSentenceRequestQuery$1 = new BERepo$getUploadSentenceRequestQuery$1(this, cVar);
        Object obj2 = bERepo$getUploadSentenceRequestQuery$1.result;
        coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$getUploadSentenceRequestQuery$1.label;
        if (i != 0) {
        }
        String str92 = (String) obj2;
        myobfuscated.jg1.a aVar42 = bERepo.b;
        bERepo$getUploadSentenceRequestQuery$1.L$0 = bERepo;
        bERepo$getUploadSentenceRequestQuery$1.L$1 = str92;
        bERepo$getUploadSentenceRequestQuery$1.label = 2;
        i2 = aVar42.i("blooper_time_to_ignore_duplication", String.class, "5.0", bERepo$getUploadSentenceRequestQuery$1);
        if (i2 != coroutineSingletons) {
        }
    }

    public final Object e(Response<j> response, myobfuscated.mk2.c<? super a> cVar) {
        BERepo$handleResponse$1 bERepo$handleResponse$1;
        int i;
        String str;
        String str2;
        String message;
        String str3;
        int i2;
        String str4;
        String str5;
        String a2;
        if (cVar instanceof BERepo$handleResponse$1) {
            bERepo$handleResponse$1 = (BERepo$handleResponse$1) cVar;
            int i3 = bERepo$handleResponse$1.label;
            if ((i3 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$handleResponse$1.label = i3 - RecyclerView.UNDEFINED_DURATION;
                Object obj = bERepo$handleResponse$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$handleResponse$1.label;
                if (i != 0) {
                    i.b(obj);
                    j body = response.body();
                    myobfuscated.a0.a.v("handleResponse status = ", body != null ? body.b() : null, "Blooper_Repo");
                    String b = body != null ? body.b() : null;
                    str = "FAILED";
                    str2 = "";
                    if (b != null) {
                        switch (b.hashCode()) {
                            case -1363898457:
                                break;
                            case -604548089:
                                break;
                            case 2104194:
                                if (b.equals("DONE")) {
                                    str = "DONE";
                                    str3 = "";
                                    str2 = body.a().a();
                                    i2 = 1;
                                    return new a(str2, str3, str, i2 != 0);
                                }
                                break;
                            case 2066319421:
                                if (b.equals("FAILED")) {
                                    q errorBody = response.errorBody();
                                    message = (errorBody == null || (message = errorBody.string()) == null) ? "" : "";
                                    myobfuscated.pd2.i iVar = (myobfuscated.pd2.i) new Gson().fromJson(message, (Class<Object>) myobfuscated.pd2.i.class);
                                    if (!Intrinsics.c(iVar != null ? iVar.b() : null, "too_many_requests")) {
                                        if (iVar != null && (a2 = iVar.a()) != null) {
                                            message = a2;
                                        }
                                        str3 = message;
                                        i2 = 0;
                                        return new a(str2, str3, str, i2 != 0);
                                    }
                                    bERepo$handleResponse$1.L$0 = "";
                                    bERepo$handleResponse$1.L$1 = "IN_PROGRESS";
                                    bERepo$handleResponse$1.L$2 = "";
                                    bERepo$handleResponse$1.I$0 = 0;
                                    bERepo$handleResponse$1.label = 2;
                                    if (g.a(1000L, bERepo$handleResponse$1) == coroutineSingletons) {
                                        return coroutineSingletons;
                                    }
                                    i2 = 0;
                                    str4 = "";
                                    str3 = str4;
                                    str5 = "IN_PROGRESS";
                                    break;
                                }
                                break;
                        }
                    }
                    message = response.message();
                    Intrinsics.checkNotNullExpressionValue(message, "message(...)");
                    str3 = message;
                    i2 = 0;
                    return new a(str2, str3, str, i2 != 0);
                } else if (i != 1 && i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    i2 = bERepo$handleResponse$1.I$0;
                    str3 = (String) bERepo$handleResponse$1.L$2;
                    str5 = (String) bERepo$handleResponse$1.L$1;
                    str4 = (String) bERepo$handleResponse$1.L$0;
                    i.b(obj);
                }
                str2 = str4;
                str = str5;
                return new a(str2, str3, str, i2 != 0);
            }
        }
        bERepo$handleResponse$1 = new BERepo$handleResponse$1(this, cVar);
        Object obj2 = bERepo$handleResponse$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$handleResponse$1.label;
        if (i != 0) {
        }
        str2 = str4;
        str = str5;
        return new a(str2, str3, str, i2 != 0);
    }

    public final Serializable f(@NotNull String str, @NotNull myobfuscated.mk2.c cVar) {
        BERepo$uploadAudioFiles$1 bERepo$uploadAudioFiles$1;
        int i;
        String str2;
        int i2;
        String str3;
        String str4;
        Response response;
        q errorBody;
        String string;
        myobfuscated.pd2.d a2;
        if (cVar instanceof BERepo$uploadAudioFiles$1) {
            bERepo$uploadAudioFiles$1 = (BERepo$uploadAudioFiles$1) cVar;
            int i3 = bERepo$uploadAudioFiles$1.label;
            if ((i3 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$uploadAudioFiles$1.label = i3 - RecyclerView.UNDEFINED_DURATION;
                Object obj = bERepo$uploadAudioFiles$1.result;
                CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$uploadAudioFiles$1.label;
                str2 = "";
                if (i != 0) {
                    i.b(obj);
                    File file = new File(str);
                    String name = file.getName();
                    o.a aVar = o.Companion;
                    Pattern pattern = okhttp3.i.d;
                    okhttp3.i b = i.a.b("application/octet-stream");
                    aVar.getClass();
                    j.c b2 = j.c.a.b("file", name, o.a.a(file, b));
                    n b3 = o.a.b("blooper-transcribe", i.a.b("text/plain"));
                    try {
                        BlooperService blooperService = this.a;
                        bERepo$uploadAudioFiles$1.L$0 = "";
                        bERepo$uploadAudioFiles$1.L$1 = "";
                        bERepo$uploadAudioFiles$1.I$0 = 0;
                        bERepo$uploadAudioFiles$1.label = 1;
                        try {
                            obj = blooperService.uploadAudioFile(b2, b3, "https://upload.picsart.com/v2/files", bERepo$uploadAudioFiles$1);
                            if (obj == coroutineSingletons) {
                                return coroutineSingletons;
                            }
                            i2 = 0;
                            str3 = "";
                            str4 = str3;
                        } catch (SocketTimeoutException e) {
                            e = e;
                            i2 = 0;
                            str3 = "";
                            String message = e.getMessage();
                            if (message != null) {
                            }
                            PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                            str4 = str2;
                            return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                        } catch (IOException e2) {
                            e = e2;
                            i2 = 0;
                            str3 = "";
                            String message2 = e.getMessage();
                            if (message2 != null) {
                            }
                            PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                            str4 = str2;
                            return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                        } catch (HttpException e3) {
                            e = e3;
                            i2 = 0;
                            str3 = "";
                            String message3 = e.getMessage();
                            if (message3 != null) {
                            }
                            PALog.a("Blooper_Repo", "uploadAudioFiles response error code = " + e.code() + ", message = " + str2);
                            str4 = str2;
                            return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                        }
                    } catch (SocketTimeoutException e4) {
                        e = e4;
                    } catch (IOException e5) {
                        e = e5;
                    } catch (HttpException e6) {
                        e = e6;
                    }
                } else if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                } else {
                    i2 = bERepo$uploadAudioFiles$1.I$0;
                    str4 = (String) bERepo$uploadAudioFiles$1.L$1;
                    str3 = (String) bERepo$uploadAudioFiles$1.L$0;
                    try {
                        myobfuscated.ik2.i.b(obj);
                    } catch (SocketTimeoutException e7) {
                        e = e7;
                        String message4 = e.getMessage();
                        str2 = message4 != null ? message4 : "";
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    } catch (IOException e8) {
                        e = e8;
                        String message22 = e.getMessage();
                        str2 = message22 != null ? message22 : "";
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    } catch (HttpException e9) {
                        e = e9;
                        String message32 = e.getMessage();
                        str2 = message32 != null ? message32 : "";
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error code = " + e.code() + ", message = " + str2);
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    }
                }
                response = (Response) obj;
                if (response == null && response.isSuccessful() && response.body() != null) {
                    try {
                        myobfuscated.pd2.a aVar2 = (myobfuscated.pd2.a) response.body();
                        if (aVar2 != null && (a2 = aVar2.a()) != null) {
                            String a3 = a2.a();
                            if (a3 != null) {
                                str2 = a3;
                            }
                        }
                        i2 = 1;
                        str3 = str2;
                    } catch (SocketTimeoutException e10) {
                        e = e10;
                        i2 = 1;
                        String message42 = e.getMessage();
                        if (message42 != null) {
                        }
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    } catch (IOException e11) {
                        e = e11;
                        i2 = 1;
                        String message222 = e.getMessage();
                        if (message222 != null) {
                        }
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error message = ".concat(str2));
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    } catch (HttpException e12) {
                        e = e12;
                        i2 = 1;
                        String message322 = e.getMessage();
                        if (message322 != null) {
                        }
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error code = " + e.code() + ", message = " + str2);
                        str4 = str2;
                        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
                    }
                } else {
                    if (response != null && (errorBody = response.errorBody()) != null && (string = errorBody.string()) != null) {
                        str4 = string;
                        PALog.a("Blooper_Repo", "uploadAudioFiles response error body = ".concat(str4));
                    }
                    str4 = "";
                    PALog.a("Blooper_Repo", "uploadAudioFiles response error body = ".concat(str4));
                }
                return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
            }
        }
        bERepo$uploadAudioFiles$1 = new BERepo$uploadAudioFiles$1(this, cVar);
        Object obj2 = bERepo$uploadAudioFiles$1.result;
        CoroutineSingletons coroutineSingletons2 = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$uploadAudioFiles$1.label;
        str2 = "";
        if (i != 0) {
        }
        response = (Response) obj2;
        if (response == null) {
        }
        if (response != null) {
            str4 = string;
            PALog.a("Blooper_Repo", "uploadAudioFiles response error body = ".concat(str4));
            return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
        }
        str4 = "";
        PALog.a("Blooper_Repo", "uploadAudioFiles response error body = ".concat(str4));
        return new Triple(Boolean.valueOf(i2 != 0), str3, str4);
    }

    public final Serializable g(@NotNull String str, @NotNull myobfuscated.mk2.c cVar) {
        BERepo$uploadSentenceJson$1 bERepo$uploadSentenceJson$1;
        CoroutineSingletons coroutineSingletons;
        int i;
        String str2;
        String str3;
        q qVar;
        BERepo bERepo;
        Serializable d;
        String str4;
        String str5;
        BERepo bERepo2;
        Response response;
        boolean z;
        if (cVar instanceof BERepo$uploadSentenceJson$1) {
            bERepo$uploadSentenceJson$1 = (BERepo$uploadSentenceJson$1) cVar;
            int i2 = bERepo$uploadSentenceJson$1.label;
            if ((i2 & RecyclerView.UNDEFINED_DURATION) != 0) {
                bERepo$uploadSentenceJson$1.label = i2 - RecyclerView.UNDEFINED_DURATION;
                Object obj = bERepo$uploadSentenceJson$1.result;
                coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                i = bERepo$uploadSentenceJson$1.label;
                if (i != 0) {
                    myobfuscated.ik2.i.b(obj);
                    bERepo$uploadSentenceJson$1.L$0 = this;
                    bERepo$uploadSentenceJson$1.L$1 = str;
                    bERepo$uploadSentenceJson$1.label = 1;
                    obj = a(bERepo$uploadSentenceJson$1);
                    if (obj == coroutineSingletons) {
                        return coroutineSingletons;
                    }
                    bERepo = this;
                } else if (i != 1) {
                    if (i == 2) {
                        str5 = (String) bERepo$uploadSentenceJson$1.L$2;
                        str4 = (String) bERepo$uploadSentenceJson$1.L$1;
                        bERepo2 = (BERepo) bERepo$uploadSentenceJson$1.L$0;
                        myobfuscated.ik2.i.b(obj);
                        Map<String, String> d2 = e0.d(new Pair("url", str4));
                        BlooperService blooperService = bERepo2.a;
                        bERepo$uploadSentenceJson$1.L$0 = null;
                        bERepo$uploadSentenceJson$1.L$1 = null;
                        bERepo$uploadSentenceJson$1.L$2 = null;
                        bERepo$uploadSentenceJson$1.label = 3;
                        obj = blooperService.uploadSentenceJson(str5, (Map) obj, d2, bERepo$uploadSentenceJson$1);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        response = (Response) obj;
                        if (response == null) {
                        }
                        if (r14 != null) {
                        }
                        z = false;
                        if (response != null) {
                        }
                        if (!(!z)) {
                        }
                        if (response != null) {
                        }
                        if (r9 != null) {
                        }
                        PALog.a("Blooper_Repo", "uploadSentenceJson 1 response error message = ".concat(str3));
                        qVar = r14;
                        return new Pair(qVar, str3);
                    } else if (i == 3) {
                        myobfuscated.ik2.i.b(obj);
                        response = (Response) obj;
                        Response response2 = (response == null && response.isSuccessful()) ? response : null;
                        q qVar2 = response2 != null ? (e) response2.body() : null;
                        z = false;
                        if (response != null) {
                            try {
                                if (response.isSuccessful()) {
                                    z = true;
                                }
                            } catch (SocketTimeoutException e) {
                                r9 = qVar2;
                                e = e;
                                String message = e.getMessage();
                                str2 = message != null ? message : "";
                                PALog.a("Blooper_Repo", "uploadSentenceJson 3 response error message = ".concat(str2));
                                str3 = str2;
                                qVar = r9;
                                return new Pair(qVar, str3);
                            } catch (IOException e2) {
                                r9 = qVar2;
                                e = e2;
                                String message2 = e.getMessage();
                                str2 = message2 != null ? message2 : "";
                                PALog.a("Blooper_Repo", "uploadSentenceJson 4 response error message = ".concat(str2));
                                str3 = str2;
                                qVar = r9;
                                return new Pair(qVar, str3);
                            } catch (HttpException e3) {
                                r9 = qVar2;
                                e = e3;
                                String message3 = e.getMessage();
                                str2 = message3 != null ? message3 : "";
                                PALog.a("Blooper_Repo", "uploadSentenceJson 2 response error message = " + str2 + ", code = " + e.code());
                                str3 = str2;
                                qVar = r9;
                                return new Pair(qVar, str3);
                            }
                        }
                        if (!(!z)) {
                            response = null;
                        }
                        r9 = response != null ? response.errorBody() : null;
                        str3 = (r9 != null || (str3 = r9.string()) == null) ? "" : "";
                        PALog.a("Blooper_Repo", "uploadSentenceJson 1 response error message = ".concat(str3));
                        qVar = qVar2;
                        return new Pair(qVar, str3);
                    } else {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                } else {
                    str = (String) bERepo$uploadSentenceJson$1.L$1;
                    bERepo = (BERepo) bERepo$uploadSentenceJson$1.L$0;
                    myobfuscated.ik2.i.b(obj);
                }
                String str6 = obj + "find_bloopers";
                bERepo$uploadSentenceJson$1.L$0 = bERepo;
                bERepo$uploadSentenceJson$1.L$1 = str;
                bERepo$uploadSentenceJson$1.L$2 = str6;
                bERepo$uploadSentenceJson$1.label = 2;
                d = bERepo.d(bERepo$uploadSentenceJson$1);
                if (d != coroutineSingletons) {
                    return coroutineSingletons;
                }
                BERepo bERepo3 = bERepo;
                str4 = str;
                str5 = str6;
                obj = d;
                bERepo2 = bERepo3;
                Map<String, String> d22 = e0.d(new Pair("url", str4));
                BlooperService blooperService2 = bERepo2.a;
                bERepo$uploadSentenceJson$1.L$0 = null;
                bERepo$uploadSentenceJson$1.L$1 = null;
                bERepo$uploadSentenceJson$1.L$2 = null;
                bERepo$uploadSentenceJson$1.label = 3;
                obj = blooperService2.uploadSentenceJson(str5, (Map) obj, d22, bERepo$uploadSentenceJson$1);
                if (obj == coroutineSingletons) {
                }
                response = (Response) obj;
                if (response == null) {
                }
                if (response2 != null) {
                }
                z = false;
                if (response != null) {
                }
                if (!(!z)) {
                }
                if (response != null) {
                }
                if (r9 != null) {
                }
                PALog.a("Blooper_Repo", "uploadSentenceJson 1 response error message = ".concat(str3));
                qVar = qVar2;
                return new Pair(qVar, str3);
            }
        }
        bERepo$uploadSentenceJson$1 = new BERepo$uploadSentenceJson$1(this, cVar);
        Object obj2 = bERepo$uploadSentenceJson$1.result;
        coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
        i = bERepo$uploadSentenceJson$1.label;
        if (i != 0) {
        }
        String str62 = obj2 + "find_bloopers";
        bERepo$uploadSentenceJson$1.L$0 = bERepo;
        bERepo$uploadSentenceJson$1.L$1 = str;
        bERepo$uploadSentenceJson$1.L$2 = str62;
        bERepo$uploadSentenceJson$1.label = 2;
        d = bERepo.d(bERepo$uploadSentenceJson$1);
        if (d != coroutineSingletons) {
        }
    }

    @Override
    public final myobfuscated.qp2.a getKoin() {
        return PAKoinHolder.e(provideContext());
    }

    @Override
    public final Context provideContext() {
        return myobfuscated.qd0.a.a();
    }
}