导航菜单

页面标题

页面副标题

Zepto v25.1.4 - AbstractC0496w0.java 源代码

正在查看: Zepto v25.1.4 应用的 AbstractC0496w0.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.inmobi.media;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Log;
import android.util.SparseArray;
import android.widget.TextView;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;
import androidx.annotation.WorkerThread;
import androidx.browser.customtabs.CustomTabsClient;
import androidx.recyclerview.widget.RecyclerView;
import com.iab.omid.library.inmobi.Omid;
import com.iab.omid.library.inmobi.adsession.AdSessionContext;
import com.iab.omid.library.inmobi.adsession.ImpressionType;
import com.iab.omid.library.inmobi.adsession.VerificationScriptResource;
import com.inmobi.adquality.models.AdQualityControl;
import com.inmobi.ads.AdMetaInfo;
import com.inmobi.ads.InMobiAdRequestStatus;
import com.inmobi.ads.WatermarkData;
import com.inmobi.commons.core.configs.AdConfig;
import com.inmobi.commons.core.configs.Config;
import com.inmobi.commons.core.configs.TelemetryConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$ABConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$AdABConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$AdNonABConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$AdPreloadConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$MediationConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$NonABConfig;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations$PreloadConfig;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Timer;
import java.util.TreeSet;
import java.util.UUID;
import java.util.concurrent.ScheduledExecutorService;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.EmptyList;
import kotlin.collections.MapsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.ranges.IntRange;
import kotlin.text.StringsKt;
import org.apache.commons.lang3.CharEncoding;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.npci.upi.security.pinactivitycomponent.CLConstants;

public abstract class AbstractC0496w0 extends U9 implements InterfaceC0241d0, F1, InterfaceC0494vb, InterfaceC0295gc, InterfaceC0417pb, K {
    public static final int L = 0;
    public boolean A;
    public String B;
    public final C0469u C;
    public C0534z D;
    public C0246d5 E;
    public C0412p6 F;
    public final Handler G;
    public final LinkedHashMap H;
    public final C0522y0 I;
    public WatermarkData J;
    public final C0406p0 K;

    public byte f53097a;

    public AdConfig f53098b;

    public WeakReference f53099c;

    public Cb f53100d;

    public C0283g0 f53101e;

    public WeakReference f53102f;

    public ArrayList f53103g;

    public M6 f53104h;

    public HashMap f53105i;

    public A4 f53106j;

    public byte f53107k;

    public Handler f53108l;

    public boolean f53109m;

    public S9 f53110n;
    public boolean o;
    public boolean p;
    public boolean q;
    public boolean r;
    public R8 s;
    public J t;
    public C0227c0 u;
    public C0520xb v;
    public int w;
    public int x;
    public long y;
    public TreeSet z;

    public AbstractC0496w0(@NotNull Context context, @NotNull J adPlacement, @Nullable AbstractC0339k0 abstractC0339k0) {
        Boolean o;
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(adPlacement, "adPlacement");
        this.f53103g = new ArrayList();
        this.y = -1L;
        this.z = new TreeSet();
        this.C = C0469u.f53054a;
        this.G = new Handler(Looper.getMainLooper());
        this.H = new LinkedHashMap();
        this.I = new C0522y0(this);
        this.K = new C0406p0(this);
        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
        toString();
        this.f53099c = new WeakReference(context);
        this.t = adPlacement;
        WeakReference weakReference = new WeakReference(abstractC0339k0);
        this.f53102f = weakReference;
        String q = q();
        C0227c0 c0227c0 = this.u;
        this.D = new C0534z(weakReference, q, (c0227c0 == null || (o = c0227c0.o()) == null) ? false : o.booleanValue());
        n0();
    }

    public static void R() {
    }

    public static void U() {
    }

    public static final String e() {
        return "w0";
    }

    public final int A() {
        return this.x;
    }

    @WorkerThread
    public long A0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "timeSincePodShow ", this));
        }
        if (this.A) {
            return System.currentTimeMillis() - this.y;
        }
        return -1L;
    }

    @NotNull
    public final TreeSet<Integer> B() {
        return this.z;
    }

    public final C0309hc B0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "trySetTheLocalVideoDescriptor ", this));
        }
        C0296h m2 = m();
        if (m2 == null) {
            throw new IllegalStateException("No ad");
        }
        if (!(m2 instanceof R7)) {
            return null;
        }
        R7 r7 = (R7) m2;
        C0324j b2 = AbstractC0532ya.a().b(r7.f52036a);
        if (b2 == null || !b2.a()) {
            throw new IllegalStateException("Asset not available in cache".toString());
        }
        String str = b2.f52683c;
        String str2 = r7.f52037b;
        String str3 = r7.f52038c;
        List list = r7.f52039d;
        List list2 = r7.f52040e;
        AdConfig adConfig = this.f53098b;
        Intrinsics.e(adConfig);
        return new C0309hc(str, str2, str3, list, list2, adConfig.getVastVideo());
    }

    public final long C() {
        return this.y;
    }

    @Nullable
    public final Handler D() {
        return this.f53108l;
    }

    @NotNull
    public final String E() {
        String u;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "markupType getter ", this));
        }
        C0296h m2 = m();
        return (m2 == null || (u = m2.u()) == null) ? "unknown" : u;
    }

    @Nullable
    public Integer F() {
        return null;
    }

    @Nullable
    public final M6 G() {
        return this.f53104h;
    }

    @Nullable
    public final R8 H() {
        return this.s;
    }

    @NotNull
    public final J I() {
        return this.t;
    }

    public abstract byte J();

    @WorkerThread
    @Nullable
    public String K() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getPodAdContext ", this));
        }
        if (this.A) {
            return this.B;
        }
        return null;
    }

    @Nullable
    public final String L() {
        return c(0);
    }

    @Nullable
    public final Map<String, String> M() {
        return this.t.f();
    }

    @WorkerThread
    @NotNull
    public JSONArray N() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getRenderableAdIndexes ", this));
        }
        JSONArray jSONArray = new JSONArray();
        Iterator it = this.z.iterator();
        while (it.hasNext()) {
            Integer num = (Integer) it.next();
            Intrinsics.e(num);
            jSONArray.put(num.intValue());
        }
        return jSONArray;
    }

    @WorkerThread
    public long O() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getShowTimeStamp ", this));
        }
        if (this.A) {
            return this.y;
        }
        return -1L;
    }

    @NotNull
    public final Unit P() {
        AbstractC0339k0 r = r();
        long currentTimeMillis = System.currentTimeMillis();
        if (a(r, currentTimeMillis)) {
            return Unit.f62275a;
        }
        this.r = true;
        if (this.s == null) {
            this.s = new R8(this);
        }
        C0469u c0469u = this.C;
        int hashCode = hashCode();
        N3 n3 = new N3(this, currentTimeMillis, this.f53106j);
        c0469u.getClass();
        C0469u.a(hashCode, n3);
        return Unit.f62275a;
    }

    @UiThread
    public final byte Q() {
        return this.f53097a;
    }

    public final String S() {
        LinkedList<C0296h> f2;
        C0296h c0296h;
        String w;
        C0227c0 c0227c0 = this.u;
        return (c0227c0 == null || (f2 = c0227c0.f()) == null || (c0296h = (C0296h) CollectionsKt.q(f2)) == null || (w = c0296h.w()) == null) ? "" : w;
    }

    public final byte T() {
        return this.f53107k;
    }

    public final void V() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "handleInterActive ", this));
        }
        C0469u c0469u = this.C;
        int hashCode = hashCode();
        C0393o0 c0393o0 = new C0393o0(this);
        c0469u.getClass();
        C0469u.a(hashCode, c0393o0);
    }

    public final boolean W() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "hasAdExpired ", this));
        }
        C0296h m2 = m();
        if (m2 == null) {
            return false;
        }
        AdConfig adConfig = this.f53098b;
        Intrinsics.e(adConfig);
        return m2.a(adConfig.getCacheConfig(q()).getTimeToLive());
    }

    @VisibleForTesting
    public final boolean X() {
        AdConfig.RenderingConfig rendering;
        AdConfig adConfig = this.f53098b;
        return adConfig != null && (rendering = adConfig.getRendering()) != null && rendering.getEnablePubMuteControl() && Ha.o();
    }

    @SuppressLint({"SwitchIntDef"})
    public final boolean Y() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "isBlockingStateForLoadWithResponse getter " + this + " state=" + ((int) this.f53097a));
        }
        if (!M3.f51873a.a()) {
            g();
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.GDPR_COMPLIANCE_ENFORCED), true, (short) 2141);
            return true;
        }
        if (f0()) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                StringBuilder a2 = A5.a("w0", "TAG", "Some of the dependency libraries for ");
                a2.append(q());
                a2.append(" not found");
                ((B4) a42).b("w0", a2.toString());
            }
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.MISSING_REQUIRED_DEPENDENCIES), true, (short) 2007);
            return true;
        }
        byte b2 = this.f53097a;
        if (b2 == 1) {
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).b("w0", "load with reasponse called while loading");
            }
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.LOAD_WITH_RESPONSE_CALLED_WHILE_LOADING), false, (short) 2001);
            return true;
        }
        if (b2 != 7) {
            return false;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a44).b("w0", "ad active before load");
        }
        b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.AD_ACTIVE), false, (short) 2003);
        return true;
    }

    public final boolean Z() {
        return this.o;
    }

    @WorkerThread
    public abstract void a(int i2, @NotNull S9 s9);

    public final void a(long j2) {
        this.y = j2;
    }

    public final boolean a0() {
        return this.f53109m;
    }

    @WorkerThread
    public abstract void b();

    public final void b(boolean z) {
        this.f53109m = z;
    }

    public final boolean b0() {
        return this.A;
    }

    @Nullable
    public final String c(int i2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getPubContent ", this));
        }
        if (i2 > 0 && !this.A) {
            return "";
        }
        C0296h a2 = a(i2);
        if (a2 != null) {
            return a2.x();
        }
        return null;
    }

    @UiThread
    public void c0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "load  ", this));
        }
        C0522y0 c0522y0 = this.I;
        c0522y0.getClass();
        c0522y0.f53233c = SystemClock.elapsedRealtime();
        a(new C0419q0(this), new C0431r0(this));
    }

    public final void d(byte b2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "from ");
            a2.append((int) this.f53097a);
            a2.append(" to ");
            a2.append((int) b2);
            a2.append(' ');
            a2.append(this);
            ((B4) a4).d("w0", a2.toString());
        }
        this.f53097a = b2;
    }

    public final void d0() throws IllegalStateException {
        List<String> c2;
        LinkedList<C0296h> f2;
        C0296h c0296h;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "loadAd_ ", this));
        }
        C0296h m2 = m();
        if (m2 == null || W()) {
            m2 = null;
        }
        if (m2 == null) {
            throw new IllegalStateException("Unable to get topAd");
        }
        String u = m2.u();
        int hashCode = u.hashCode();
        if (hashCode == -1084172778) {
            if (u.equals("inmobiJson")) {
                A4 a42 = this.f53106j;
                if (a42 != null) {
                    StringBuilder a2 = A5.a("w0", "TAG", "Loading ad with impressionId : ");
                    a2.append(m2.s());
                    ((B4) a42).a("w0", a2.toString());
                }
                C0227c0 c0227c0 = this.u;
                if (c0227c0 != null) {
                    AdConfig adConfig = this.f53098b;
                    Intrinsics.e(adConfig);
                    c0227c0.a(adConfig, this, this.f53106j);
                }
                c2 = m2.c(C0296h.WIN_BEACON);
                if (this.A) {
                }
                if (c2 == null) {
                }
            }
            A4 a43 = this.f53106j;
            if (a43 != null) {
                StringBuilder a3 = A5.a("w0", "TAG", "Can not handle fallback for");
                a3.append(m2.u());
                ((B4) a43).b("w0", a3.toString());
            }
            throw new IllegalStateException("Can not handle fallback for markup type: " + m2.u());
        }
        if (hashCode != 3213227) {
            c2 = m2.c(C0296h.WIN_BEACON);
            if (this.A) {
                C0227c0 c0227c02 = this.u;
                Intrinsics.e(c0227c02);
                int size = c0227c02.f().size();
                for (int i2 = 1; i2 < size; i2++) {
                    C0227c0 c0227c03 = this.u;
                    List<String> c3 = (c0227c03 == null || (f2 = c0227c03.f()) == null || (c0296h = f2.get(i2)) == null) ? null : c0296h.c(C0296h.WIN_BEACON);
                    if (c3 != null && (c2 instanceof LinkedList)) {
                        ((LinkedList) c2).addAll(c3);
                    }
                }
            }
            if (c2 == null) {
                return;
            }
            Iterator<String> it = c2.iterator();
            while (it.hasNext()) {
                Y1.f52249a.a(it.next(), true, this.f53106j);
            }
            return;
        }
        c2 = m2.c(C0296h.WIN_BEACON);
        if (this.A) {
        }
        if (c2 == null) {
        }
    }

    public final void e0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "makeUnitActive ", this));
        }
        this.o = false;
    }

    public final void f(@NotNull AbstractC0339k0 listener) {
        Intrinsics.checkNotNullParameter(listener, "listener");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onLoadSuccess ", this));
        }
        AdMetaInfo l2 = l();
        if (l2 == null) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).b("w0", "load success - ad unit null");
            }
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), true, (short) 2107);
            return;
        }
        b((byte) 1);
        A4 a43 = this.f53106j;
        if (a43 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a43).a("w0", "callback - onAdLoadSucceeded");
        }
        listener.c(l2);
    }

    public boolean f0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "missingPrerequisitesForAd ", this));
        }
        try {
            Reflection.a(RecyclerView.class).e();
            Reflection.a(CustomTabsClient.class).e();
            return false;
        } catch (NoClassDefFoundError unused) {
            return true;
        }
    }

    public final void g(int i2) {
        this.w = i2;
    }

    public void g0() {
        C0522y0 c0522y0 = this.I;
        c0522y0.getClass();
        c0522y0.f53238h = SystemClock.elapsedRealtime();
    }

    public final void h(int i2) {
        this.x = i2;
    }

    @WorkerThread
    @NotNull
    public final D h0() {
        String jSONArray;
        Integer num;
        Integer num2;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "prepareAdRequest ", this));
        }
        Context t = t();
        M8 m8 = null;
        O8 o8 = t != null ? new O8(t, this.f53106j) : null;
        AdConfig adConfig = this.f53098b;
        String url = adConfig != null ? adConfig.getUrl() : null;
        AdConfig adConfig2 = this.f53098b;
        Intrinsics.e(adConfig2);
        Ib ib = new Ib(adConfig2.getIncludeIdParams());
        ArrayList a2 = AbstractC0532ya.a().a();
        if (a2.isEmpty()) {
            jSONArray = null;
        } else {
            JSONArray jSONArray2 = new JSONArray();
            Iterator it = a2.iterator();
            while (it.hasNext()) {
                try {
                    jSONArray2.put(URLEncoder.encode(((C0324j) it.next()).f52682b, CharEncoding.UTF_8));
                } catch (UnsupportedEncodingException unused) {
                }
            }
            jSONArray = jSONArray2.toString();
        }
        J j2 = this.t;
        if (o8 != null) {
            if (o8.f51975d) {
                m8 = new M8(MapsKt.f(new Pair("n-h-id", o8.f51974c)));
            } else {
                A4 a42 = o8.f51973b;
                if (a42 != null) {
                    ((B4) a42).a("NovatiqDataHandler", "Novatiq disabled. skip");
                }
                m8 = new M8(MapsKt.d());
            }
        }
        M8 m82 = m8;
        A4 a43 = this.f53106j;
        AdConfig adConfig3 = this.f53098b;
        D d2 = new D(url, ib, jSONArray, j2, m82, a43, adConfig3 != null ? adConfig3.getApplyGzipReq() : false);
        d2.C = this.t.i();
        d2.B = q();
        Intrinsics.checkNotNullParameter("unifiedSdkJson", "<set-?>");
        d2.A = "unifiedSdkJson";
        d2.D = o();
        C0412p6 c0412p6 = this.F;
        int i2 = Cb.DEFAULT_TIMEOUT;
        d2.p = (c0412p6 == null || (num2 = c0412p6.f52903d) == null) ? Cb.DEFAULT_TIMEOUT : num2.intValue();
        C0412p6 c0412p62 = this.F;
        if (c0412p62 != null && (num = c0412p62.f52903d) != null) {
            i2 = num.intValue();
        }
        d2.q = i2;
        d2.o = X();
        return d2;
    }

    public final void i() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "fireAdServedBeacon ", this));
        }
        r k2 = k();
        if (k2 == null) {
            return;
        }
        k2.a((byte) 2, null);
    }

    @NotNull
    public Cb i0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "provideTimeoutConfigurations ", this));
        }
        Cb cb = this.f53100d;
        Intrinsics.e(cb);
        return cb;
    }

    @Nullable
    public final AdConfig j() {
        return this.f53098b;
    }

    @UiThread
    public abstract void j0();

    @Nullable
    public final r k() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "adMarkupContainer getter ", this));
        }
        byte b2 = this.f53097a;
        String E = E();
        int hashCode = E.hashCode();
        if (hashCode != -1084172778) {
            if (hashCode != 3213227) {
                if (hashCode == 1236050372 && E.equals("htmlUrl") && b2 != 0 && 1 != b2 && 3 != b2) {
                    return w();
                }
            } else if (E.equals("html") && b2 != 0 && 1 != b2 && 3 != b2) {
                return w();
            }
        } else if (E.equals("inmobiJson") && b2 != 0 && 1 != b2 && 3 != b2 && 2 != b2) {
            return this.f53104h;
        }
        return null;
    }

    @CallSuper
    @UiThread
    public void k0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "resetContainersForNextAd ", this));
        }
        M6 m6 = this.f53104h;
        if (m6 != null) {
            m6.b();
        }
        this.f53104h = null;
        int size = this.f53103g.size();
        int i2 = this.x;
        if (size <= i2 || this.f53103g.get(i2) == null) {
            return;
        }
        a(this.x, false);
    }

    @Nullable
    public final AdMetaInfo l() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "adMetaInfo getter ", this));
        }
        C0296h m2 = m();
        if (m2 != null) {
            return m2.d();
        }
        return null;
    }

    public final L5 l0() {
        Boolean o;
        String w;
        String p;
        long l2 = this.t.l();
        String valueOf = String.valueOf(this.t.m());
        String q = q();
        String E = E();
        C0296h u = u();
        String str = (u == null || (p = u.p()) == null) ? "" : p;
        C0296h u2 = u();
        String str2 = (u2 == null || (w = u2.w()) == null) ? "" : w;
        C0227c0 c0227c0 = this.u;
        return new L5(l2, valueOf, q, E, str, str2, (c0227c0 == null || (o = c0227c0.o()) == null) ? false : o.booleanValue(), System.currentTimeMillis());
    }

    @Nullable
    public final C0296h m() {
        return a(0);
    }

    public final void m0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).d("w0", "AdUnit " + this + " state - FAILED");
        }
        d((byte) 3);
        b((byte) 1);
    }

    @Nullable
    public final String n() {
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null) {
            return c0227c0.c();
        }
        return null;
    }

    public final void n0() {
        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
        toString();
        String b2 = Ha.b();
        LinkedHashMap linkedHashMap = C0382n2.f52847a;
        Config a2 = C0355l2.a("ads", b2, null);
        this.f53098b = a2 instanceof AdConfig ? (AdConfig) a2 : null;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "timeOutConfiguration getter ", this));
        }
        AdConfig adConfig = this.f53098b;
        Intrinsics.e(adConfig);
        this.f53100d = adConfig.getTimeouts();
        d((byte) 0);
        this.f53101e = new C0283g0(this, this, this.t);
        this.f53105i = new HashMap();
        this.f53107k = (byte) -1;
        this.f53108l = new Handler(Looper.getMainLooper());
        this.f53109m = false;
        this.v = new C0520xb(this);
    }

    public HashMap o() {
        return new HashMap();
    }

    public final boolean o0() {
        Unit unit;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "shouldBlockLoadAd ", this));
        }
        C0296h m2 = m();
        if (m2 != null && 4 == this.f53097a && !W()) {
            AbstractC0339k0 r = r();
            if (r != null) {
                A4 a42 = this.f53106j;
                if (a42 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a42).a("w0", "ad is ready - load success");
                }
                f(r);
                unit = Unit.f62275a;
            } else {
                unit = null;
            }
            if (unit == null) {
                b((short) 2188);
            }
            return true;
        }
        if (m2 == null) {
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.AD_NO_LONGER_AVAILABLE), true, (short) 2131);
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).b("w0", "ad no longer available");
            }
            return true;
        }
        if (2 != this.f53097a) {
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.AD_NO_LONGER_AVAILABLE), true, (short) 2132);
            A4 a44 = this.f53106j;
            if (a44 != null) {
                StringBuilder a2 = A5.a("w0", "TAG", "ad no longer available. state - ");
                a2.append((int) this.f53097a);
                ((B4) a44).b("w0", a2.toString());
            }
            return true;
        }
        if (!W()) {
            return false;
        }
        b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.AD_NO_LONGER_AVAILABLE), true, (short) 2133);
        A4 a45 = this.f53106j;
        if (a45 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a45).b("w0", "ad is expired");
        }
        return true;
    }

    @NotNull
    public final C0283g0 p() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "adStore getter ", this));
        }
        if (this.f53101e == null) {
            this.f53101e = new C0283g0(this, this, this.t);
        }
        C0283g0 c0283g0 = this.f53101e;
        Intrinsics.e(c0283g0);
        return c0283g0;
    }

    public final boolean p0() {
        AdConfig adConfig;
        return Intrinsics.c(this.t.m(), "AB") && (adConfig = this.f53098b) != null && adConfig.getSkipNetCheckHB();
    }

    @NotNull
    public abstract String q();

    public void q0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "signalAvailabilityChange ", this));
        }
    }

    @Nullable
    public final AbstractC0339k0 r() {
        A4 a4;
        A4 a42 = this.f53106j;
        if (a42 != null) {
            ((B4) a42).c("w0", AbstractC0311i0.a("w0", "TAG", "adUnitEventListener getter ", this));
        }
        AbstractC0339k0 abstractC0339k0 = (AbstractC0339k0) this.f53102f.get();
        if (abstractC0339k0 == null && (a4 = this.f53106j) != null) {
            ((B4) a4).b("InMobi", "Listener was garbage collected. Unable to give callback");
        }
        return abstractC0339k0;
    }

    public void r0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "signalSuccess ", this));
        }
    }

    @NotNull
    public final C0522y0 s() {
        return this.I;
    }

    @UiThread
    public final void s0() {
        LinkedList<C0296h> f2;
        C0296h c0296h;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "startLoadingHTMLAd ", this));
        }
        S9 s9 = null;
        try {
            e(this.w);
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                StringBuilder sb = new StringBuilder("Loading ad with impressionId : ");
                C0227c0 c0227c0 = this.u;
                sb.append((c0227c0 == null || (f2 = c0227c0.f()) == null || (c0296h = f2.get(this.w)) == null) ? null : c0296h.s());
                ((B4) a42).a("w0", sb.toString());
            }
            S9 s92 = (S9) this.f53103g.get(this.w);
            String E = E();
            if (Intrinsics.c(E, "html")) {
                A4 a43 = this.f53106j;
                if (a43 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a43).a("w0", "loading into weview for " + E());
                }
                if (s92 != null) {
                    s92.c(c(this.w));
                }
            } else if (Intrinsics.c(E, "htmlUrl")) {
                A4 a44 = this.f53106j;
                if (a44 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a44).a("w0", "loading into weview for " + E());
                }
                if (s92 != null) {
                    s92.d(c(this.w));
                }
            }
            a(true, s92);
            if (s92 == null || !Intrinsics.c(E(), "htmlUrl")) {
                return;
            }
            j(s92);
        } catch (Exception e2) {
            A4 a45 = this.f53106j;
            if (a45 != null) {
                ((B4) a45).a("w0", Cc.a(e2, A5.a("w0", "TAG", "Loading ad markup into container encountered an unexpected error: ")));
            }
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
            int i2 = this.w;
            if (i2 >= 0 && i2 < this.f53103g.size()) {
                s9 = (S9) this.f53103g.get(this.w);
            }
            b(s9, (short) 2135);
        }
    }

    @Nullable
    public final Context t() {
        WeakReference weakReference = this.f53099c;
        if (weakReference != null) {
            return (Context) weakReference.get();
        }
        return null;
    }

    public final void t0() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdLoadCalled ", this));
        }
        HashMap hashMap = new HashMap();
        c(hashMap);
        c("AdLoadCalled", hashMap);
    }

    public final C0296h u() {
        return this.A ? a(this.w) : m();
    }

    public final void u0() {
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "submitAdLoadSuccessfulEvent ADunit markuptype : ");
            a2.append(E());
            a2.append(' ');
            a2.append(this);
            ((B4) a4).c("w0", a2.toString());
        }
        HashMap hashMap = new HashMap();
        long j2 = this.I.f53233c;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        hashMap.put("markupType", E());
        C0296h u = u();
        if (u != null && (p = u.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            hashMap.put("retryCount", Integer.valueOf(c0246d5.f52444b));
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c("AdLoadSuccessful", hashMap);
    }

    @NotNull
    public final C0469u v() {
        return this.C;
    }

    public final void v0() {
        String p;
        Boolean o;
        HashMap hashMap = new HashMap();
        c(hashMap);
        hashMap.put("markupType", E());
        long j2 = this.I.f53238h;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        hashMap.put("metadataBlob", S());
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            hashMap.put("retryCount", Integer.valueOf(c0246d5.f52444b));
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        C0296h u = u();
        if (u != null && (p = u.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        c("ParseSuccess", hashMap);
    }

    @Nullable
    public S9 w() {
        if (this.f53103g.size() <= 0 || this.x >= this.f53103g.size()) {
            return null;
        }
        return (S9) this.f53103g.get(this.x);
    }

    public final void w0() {
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdShowCalled ", this));
        }
        C0522y0 c0522y0 = this.I;
        c0522y0.getClass();
        c0522y0.f53235e = SystemClock.elapsedRealtime();
        HashMap hashMap = new HashMap();
        hashMap.put("markupType", E());
        long j2 = this.I.f53239i;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        C0296h a2 = this.A ? a(this.x) : m();
        if (a2 != null && (p = a2.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c("AdShowCalled", hashMap);
    }

    @Nullable
    public final S9 x() {
        return this.f53110n;
    }

    public final void x0() {
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdShowSuccess ", this));
        }
        HashMap hashMap = new HashMap();
        long j2 = this.I.f53235e;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        hashMap.put("markupType", E());
        C0296h a2 = this.A ? a(this.x) : m();
        if (a2 != null && (p = a2.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c("AdShowSuccessful", hashMap);
    }

    @Nullable
    public final C0227c0 y() {
        return this.u;
    }

    public final void y0() {
        HashMap hashMap = new HashMap();
        c(hashMap);
        c("AdGetSignalsCalled", hashMap);
    }

    public final int z() {
        return this.w;
    }

    public final void z0() {
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "submitRenderSuccessEvent ADunit markuptype : ");
            a2.append(E());
            a2.append(' ');
            a2.append(this);
            ((B4) a4).c("w0", a2.toString());
        }
        HashMap hashMap = new HashMap();
        long j2 = this.I.f53237g;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        hashMap.put("markupType", E());
        C0296h a3 = this.A ? a(this.x) : m();
        if (a3 != null && (p = a3.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            hashMap.put("retryCount", Integer.valueOf(c0246d5.f52444b));
        }
        hashMap.put("plType", Byte.valueOf(J()));
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c((Map) hashMap);
        c("RenderSuccess", hashMap);
    }

    public final void a(@Nullable Handler handler) {
        this.f53108l = handler;
    }

    public final void e(@Nullable C0227c0 c0227c0) {
        this.u = c0227c0;
    }

    public final void g(@Nullable AbstractC0339k0 abstractC0339k0) {
        Boolean o;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "adUnitEventListener setter ", this));
        }
        WeakReference weakReference = new WeakReference(abstractC0339k0);
        this.f53102f = weakReference;
        String q = q();
        C0227c0 c0227c0 = this.u;
        C0534z c0534z = new C0534z(weakReference, q, (c0227c0 == null || (o = c0227c0.o()) == null) ? false : o.booleanValue());
        this.D = c0534z;
        A4 logger = this.f53106j;
        if (logger != null) {
            Intrinsics.checkNotNullParameter(logger, "logger");
            c0534z.f53275f = logger;
        }
    }

    @Override
    public void h(@NotNull S9 renderView) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onRenderViewSignaledAdReady ", this));
        }
        if (this.o || t() == null) {
            b((short) 2186);
            return;
        }
        Handler handler = this.f53108l;
        if (handler != null) {
            handler.post(new hf(this, renderView, 1));
        } else {
            b((short) 2187);
        }
    }

    public final void j(S9 s9) {
        List<String> c2;
        int indexOf = this.f53103g.indexOf(s9);
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).a("w0", "fireLoadAdTokenUrlSuccessful : " + indexOf + ' ' + this);
        }
        C0296h a2 = a(indexOf);
        if (a2 == null || (c2 = a2.c(C0296h.LOAD_AD_TOKEN_URL)) == null) {
            return;
        }
        Iterator<String> it = c2.iterator();
        while (it.hasNext()) {
            Y1.f52249a.a(it.next(), true, this.f53106j);
        }
    }

    public final void a(@Nullable AdConfig adConfig) {
        this.f53098b = adConfig;
    }

    public final Set d(int i2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getViewabilityTrackers ", this));
        }
        HashMap hashMap = this.f53105i;
        if (hashMap != null) {
            return (Set) hashMap.get(Integer.valueOf(i2));
        }
        return null;
    }

    public final void e(int i2) {
        S9 s9;
        String str;
        A4 a4;
        AdMetaInfo l2;
        WatermarkData watermarkData;
        S9 s92;
        A4 a42 = this.f53106j;
        if (a42 != null) {
            ((B4) a42).a("w0", AbstractC0311i0.a("w0", "TAG", "initializeHtmlAdContainer ", this));
        }
        Context t = t();
        if (t == null) {
            return;
        }
        try {
            if (this.f53103g.get(i2) != null && ((s92 = (S9) this.f53103g.get(i2)) == null || !s92.I.get())) {
                return;
            }
            C0296h a2 = a(i2);
            V9 a3 = a(i2, a2);
            byte J = J();
            HashMap hashMap = this.f53105i;
            Set set = hashMap != null ? (Set) hashMap.get(Integer.valueOf(i2)) : null;
            C0296h a5 = a(i2);
            String s = a5 != null ? a5.s() : null;
            if (a2 != null) {
                str = a2.t();
                if (str == null) {
                }
                s9 = new S9(t, J, set, s, false, str, 0L, a3, null, this.f53106j, 336);
                String p = a2 != null ? a2.p() : null;
                a4 = s9.f52083j;
                if (a4 != null) {
                    String TAG = S9.O0;
                    Intrinsics.checkNotNullExpressionValue(TAG, "TAG");
                    ((B4) a4).c(TAG, "creativeType " + s9 + ' ' + p);
                }
                s9.s0 = p;
                if (a2 != null || (r6 = a2.u()) == null) {
                    String str2 = "html";
                }
                s9.setMarkupTypeAdUnit(str2);
                this.f53103g.set(i2, s9);
                if (!Intrinsics.c(this.t.b(), "banner") || Intrinsics.c(this.t.b(), "audio")) {
                    s9.setAdSize(this.t.a());
                }
                s9.setAdType(this.t.b());
                s9.setImmersiveMode(b(a2));
                AdConfig adConfig = this.f53098b;
                Intrinsics.e(adConfig);
                s9.a(this, adConfig);
                s9.setAdPodHandler(this);
                s9.setPlacementId(this.t.l());
                s9.setAllowAutoRedirection(b(i2));
                s9.setContentURL(this.t.e());
                l2 = l();
                if (l2 != null) {
                    s9.setCreativeId(l2.getCreativeID());
                }
                if (this.t.p()) {
                    s9.e();
                }
                s9.setTelemetryManagerMap(this.H);
                s9.a(a2);
                a(a2, s9);
                watermarkData = this.J;
                if (watermarkData == null) {
                    s9.setWatermark(watermarkData);
                    return;
                }
                return;
            }
            str = "DEFAULT";
            s9 = new S9(t, J, set, s, false, str, 0L, a3, null, this.f53106j, 336);
            String p2 = a2 != null ? a2.p() : null;
            a4 = s9.f52083j;
            if (a4 != null) {
            }
            s9.s0 = p2;
            if (a2 != null) {
            }
            String str22 = "html";
            s9.setMarkupTypeAdUnit(str22);
            this.f53103g.set(i2, s9);
            if (!Intrinsics.c(this.t.b(), "banner")) {
            }
            s9.setAdSize(this.t.a());
            s9.setAdType(this.t.b());
            s9.setImmersiveMode(b(a2));
            AdConfig adConfig2 = this.f53098b;
            Intrinsics.e(adConfig2);
            s9.a(this, adConfig2);
            s9.setAdPodHandler(this);
            s9.setPlacementId(this.t.l());
            s9.setAllowAutoRedirection(b(i2));
            s9.setContentURL(this.t.e());
            l2 = l();
            if (l2 != null) {
            }
            if (this.t.p()) {
            }
            s9.setTelemetryManagerMap(this.H);
            s9.a(a2);
            a(a2, s9);
            watermarkData = this.J;
            if (watermarkData == null) {
            }
        } catch (Exception e2) {
            b((S9) this.f53103g.get(this.w), (short) 2136);
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).a("w0", "Exception while initializing WebView", e2);
            }
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
        }
    }

    public final void a(@Nullable R8 r8) {
        this.s = r8;
    }

    @VisibleForTesting
    public final boolean b(@Nullable C0296h c0296h) {
        Z q;
        AdConfig.RenderingConfig rendering;
        AdConfig adConfig = this.f53098b;
        boolean z = false;
        boolean enableImmersive = (adConfig == null || (rendering = adConfig.getRendering()) == null) ? false : rendering.getEnableImmersive();
        boolean z2 = AbstractC0342k3.f52748i;
        boolean a2 = (c0296h == null || (q = c0296h.q()) == null) ? false : q.a(false);
        if (enableImmersive && z2 && a2) {
            z = true;
        }
        if (!z) {
            b(enableImmersive, z2, a2);
        }
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).a("w0", "Immersive support - config, device, adResponse - (" + enableImmersive + ' ' + z2 + ' ' + a2 + ')');
        }
        return z;
    }

    public final void c(boolean z) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "setIsAssetReady ", this));
        }
        this.p = z;
    }

    public final void a(@NotNull TreeSet<Integer> treeSet) {
        Intrinsics.checkNotNullParameter(treeSet, "<set-?>");
        this.z = treeSet;
    }

    @Override
    public void i(@NotNull S9 renderView) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "RenderView visible, for index ");
            a2.append(this.f53103g.indexOf(renderView));
            a2.append(' ');
            a2.append(this);
            ((B4) a4).a("w0", a2.toString());
        }
    }

    public void l(S9 s9) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "Render view signaled ad ready, for index ");
            a2.append(this.f53103g.indexOf(s9));
            a2.append(' ');
            a2.append(this);
            ((B4) a4).a("w0", a2.toString());
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "==== CHECKPOINT REACHED - LOAD SUCCESS ====");
        }
        A4 a43 = this.f53106j;
        if (a43 != null) {
            ((B4) a43).b();
        }
    }

    @UiThread
    public final void c(@NotNull C0227c0 adSet) {
        Intrinsics.checkNotNullParameter(adSet, "adSet");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAdFetchSuccessful ", this));
        }
        if (this.f53097a == 1) {
            this.u = adSet;
        }
        if (!this.o && t() != null) {
            a(adSet);
            return;
        }
        b((short) 2185);
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).b("w0", "adUnit is destroyed");
        }
    }

    public final void d(@NotNull AbstractC0339k0 listener) {
        Intrinsics.checkNotNullParameter(listener, "listener");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAdDisplayed ", this));
        }
        AdMetaInfo l2 = l();
        if (l2 == null) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).b("w0", "callback onAdDisplayed failed. ad meta info is null");
            }
            a(listener, (short) 85);
            return;
        }
        A4 a43 = this.f53106j;
        if (a43 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a43).a("w0", "callback - onAdDisplayed");
        }
        listener.a(l2);
    }

    @UiThread
    public void g() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "clear ", this));
        }
        if (this.o) {
            return;
        }
        this.o = true;
        Handler handler = this.f53108l;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            ((B4) a42).a("w0", AbstractC0311i0.a("w0", "TAG", "clearAdPods ", this));
        }
        if (this.A) {
            h();
            this.f53103g.clear();
            this.w = 0;
            this.x = 0;
            this.z.clear();
        }
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            c0246d5.f52444b = 0;
        }
        HashMap hashMap = this.f53105i;
        if (hashMap != null) {
            hashMap.clear();
        }
        k0();
        d((byte) 0);
        A4 a43 = this.f53106j;
        if (a43 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a43).d("w0", "AdUnit " + this + " state - CREATED");
        }
        C0469u c0469u = this.C;
        int hashCode = hashCode();
        c0469u.getClass();
        SparseArray sparseArray = C0469u.f53055b;
        sparseArray.remove(hashCode);
        Intrinsics.checkNotNullExpressionValue("u", "TAG");
        sparseArray.size();
        this.q = false;
        this.f53110n = null;
        this.f53109m = false;
        this.p = false;
        this.r = false;
        this.u = null;
        this.A = false;
    }

    @UiThread
    public final void h() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "destroyAllContainer ", this));
        }
        int size = this.f53103g.size();
        for (int i2 = 0; i2 < size; i2++) {
            a(this, i2, false, 2, null);
        }
    }

    @WorkerThread
    public int k(@NotNull S9 renderView) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getCurrentRenderingPodAdIndex ", this));
        }
        if (this.A) {
            return this.f53103g.indexOf(renderView);
        }
        return -1;
    }

    @Override
    public void f(@NotNull S9 renderView) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "RenderView completed loading ad content, for index ");
            a2.append(this.f53103g.indexOf(renderView));
            a2.append(' ');
            a2.append(this);
            ((B4) a4).a("w0", a2.toString());
        }
    }

    public static final void a(AbstractC0496w0 abstractC0496w0, C0296h c0296h, S9 s9) {
        abstractC0496w0.getClass();
        a(c0296h, s9);
    }

    public final void a(@NotNull Context context, @NotNull J adPlacement, @Nullable AbstractC0339k0 abstractC0339k0) {
        String placementType;
        String adTypes;
        TimeoutConfigurations$AdNonABConfig banner;
        C0412p6 c0412p6;
        TimeoutConfigurations$AdPreloadConfig banner2;
        TimeoutConfigurations$AdABConfig banner3;
        A4 a4;
        A4 a42;
        A4 a43;
        Boolean o;
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(adPlacement, "adPlacement");
        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
        toString();
        a(context);
        WeakReference weakReference = new WeakReference(abstractC0339k0);
        this.f53102f = weakReference;
        String q = q();
        C0227c0 c0227c0 = this.u;
        this.D = new C0534z(weakReference, q, (c0227c0 == null || (o = c0227c0.o()) == null) ? false : o.booleanValue());
        this.t = adPlacement;
        A4 a44 = this.f53106j;
        if (a44 != null) {
            ((B4) a44).a("w0", AbstractC0311i0.a("w0", "TAG", "initTelemetry ", this));
        }
        this.H.put("AdImpressionSuccessful", this.I);
        A4 a45 = this.f53106j;
        if (a45 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a45).c("w0", "initInternetAvailabilityAdRetry");
        }
        if (this.f53098b == null && (a43 = this.f53106j) != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a43).c("w0", "adConfig is null");
            Unit unit = Unit.f62275a;
        }
        if (this.t.m() == null && (a42 = this.f53106j) != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).c("w0", "placement.placementType is null");
            Unit unit2 = Unit.f62275a;
        }
        if (this.t.b() == null && (a4 = this.f53106j) != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "placement.adType is null");
            Unit unit3 = Unit.f62275a;
        }
        AdConfig adConfig = this.f53098b;
        if (adConfig != null && (placementType = this.t.m()) != null && (adTypes = this.t.b()) != null) {
            TimeoutConfigurations$MediationConfig mediationConfig = adConfig.getTimeouts().X();
            String d2 = Ia.d();
            Intrinsics.checkNotNullParameter(mediationConfig, "mediationConfig");
            Intrinsics.checkNotNullParameter(placementType, "placementType");
            Intrinsics.checkNotNullParameter(adTypes, "adTypes");
            if (placementType.equals("AB")) {
                TimeoutConfigurations$ABConfig aBConfig = mediationConfig.getABConfig();
                int hashCode = adTypes.hashCode();
                if (hashCode == -1396342996) {
                    if (adTypes.equals("banner")) {
                        banner3 = aBConfig.getBanner();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                    }
                    banner3 = aBConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                } else if (hashCode == -1052618729) {
                    if (adTypes.equals("native")) {
                        banner3 = aBConfig.getNative();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                    }
                    banner3 = aBConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                } else if (hashCode == 104431) {
                    if (adTypes.equals("int")) {
                        banner3 = aBConfig.getInterstitial();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                    }
                    banner3 = aBConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                } else {
                    if (hashCode == 93166550 && adTypes.equals("audio")) {
                        banner3 = aBConfig.getAudio();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                    }
                    banner3 = aBConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner3.getRetryInterval()), AbstractC0399o6.a(d2, banner3.getMaxRetries()), AbstractC0399o6.a(d2, banner3.getLoadTimeout()), (Integer) null, 24);
                }
            } else if (placementType.equals("Preload")) {
                TimeoutConfigurations$PreloadConfig preloadConfig = mediationConfig.getPreloadConfig();
                int hashCode2 = adTypes.hashCode();
                if (hashCode2 == -1396342996) {
                    if (adTypes.equals("banner")) {
                        banner2 = preloadConfig.getBanner();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                    }
                    banner2 = preloadConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                } else if (hashCode2 == -1052618729) {
                    if (adTypes.equals("native")) {
                        banner2 = preloadConfig.getNative();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                    }
                    banner2 = preloadConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                } else if (hashCode2 == 104431) {
                    if (adTypes.equals("int")) {
                        banner2 = preloadConfig.getInterstitial();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                    }
                    banner2 = preloadConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                } else {
                    if (hashCode2 == 93166550 && adTypes.equals("audio")) {
                        banner2 = preloadConfig.getAudio();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                    }
                    banner2 = preloadConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner2.getRetryInterval()), AbstractC0399o6.a(d2, banner2.getMaxRetries()), AbstractC0399o6.a(d2, banner2.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getMuttTimeout())), Integer.valueOf(AbstractC0399o6.a(d2, banner2.getPreloadTimeout())));
                }
            } else {
                TimeoutConfigurations$NonABConfig nonABConfig = mediationConfig.getNonABConfig();
                int hashCode3 = adTypes.hashCode();
                if (hashCode3 == -1396342996) {
                    if (adTypes.equals("banner")) {
                        banner = nonABConfig.getBanner();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                    }
                    banner = nonABConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                } else if (hashCode3 == -1052618729) {
                    if (adTypes.equals("native")) {
                        banner = nonABConfig.getNative();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                    }
                    banner = nonABConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                } else if (hashCode3 == 104431) {
                    if (adTypes.equals("int")) {
                        banner = nonABConfig.getInterstitial();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                    }
                    banner = nonABConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                } else {
                    if (hashCode3 == 93166550 && adTypes.equals("audio")) {
                        banner = nonABConfig.getAudio();
                        c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                    }
                    banner = nonABConfig.getBanner();
                    c0412p6 = new C0412p6(AbstractC0399o6.a(d2, banner.getRetryInterval()), AbstractC0399o6.a(d2, banner.getMaxRetries()), AbstractC0399o6.a(d2, banner.getLoadTimeout()), Integer.valueOf(AbstractC0399o6.a(d2, banner.getMuttTimeout())), 16);
                }
            }
            this.E = new C0246d5(c0412p6);
            this.F = c0412p6;
        }
        C0356l3 c0356l3 = AbstractC0342k3.f52740a;
        if (context != null && AbstractC0342k3.f52747h == null) {
            AbstractC0342k3.f52747h = Float.valueOf(new TextView(context).getTextSize());
            Intrinsics.checkNotNullExpressionValue("k3", "TAG");
        } else {
            Intrinsics.checkNotNullExpressionValue("k3", "TAG");
        }
        n0();
    }

    @VisibleForTesting
    public final void b(boolean z, boolean z2, boolean z3) {
        Pair<String, Short> a2 = a(z, z2, z3);
        String str = (String) a2.f62240a;
        short shortValue = ((Number) a2.f62241b).shortValue();
        HashMap hashMap = new HashMap();
        hashMap.put("reason", str);
        hashMap.put(CLConstants.FIELD_ERROR_CODE, Short.valueOf(shortValue));
        c("ImmersiveNotSupported", hashMap);
    }

    public void c(@NotNull String monetizationContext) {
        Intrinsics.checkNotNullParameter(monetizationContext, "monetizationContext");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "setMonetizationContext ", this));
        }
        this.t.b(monetizationContext);
    }

    public final void f() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "checkInteractiveAndSignal ", this));
        }
        if (this.f53109m && this.p && this.q) {
            r0();
        }
    }

    @UiThread
    public final void d(@NotNull C0227c0 adSet) {
        Intrinsics.checkNotNullParameter(adSet, "adSet");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAuctionNotClosed ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            ((B4) a42).c("w0", AbstractC0311i0.a("w0", "TAG", "handleAuctionNotClosed ", this));
        }
        if (this.f53097a == 1) {
            this.u = adSet;
            this.A = adSet != null ? adSet.n() : false;
            AbstractC0339k0 r = r();
            if (r != null) {
                r.a(this.t, adSet);
            }
        }
    }

    public static final void c(AbstractC0496w0 abstractC0496w0) {
        int i2;
        String str;
        A4 a4;
        A4 a42 = abstractC0496w0.f53106j;
        if (a42 != null) {
            ((B4) a42).a("w0", AbstractC0311i0.a("w0", "TAG", "startAdFetchWorker ", abstractC0496w0));
        }
        C0522y0 c0522y0 = abstractC0496w0.I;
        c0522y0.getClass();
        c0522y0.f53234d = SystemClock.elapsedRealtime();
        A4 a43 = abstractC0496w0.f53106j;
        if (a43 != null) {
            ((B4) a43).a("w0", AbstractC0311i0.a("w0", "TAG", "doAdLoadWork ", abstractC0496w0));
        }
        try {
            abstractC0496w0.d((byte) 1);
            A4 a44 = abstractC0496w0.f53106j;
            if (a44 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a44).d("w0", "AdUnit " + abstractC0496w0 + " state - LOADING");
            }
            A4 a45 = abstractC0496w0.f53106j;
            if (a45 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a45).c("w0", "printPublisherTestId " + abstractC0496w0);
            }
            Hb.f51741a.d();
            i2 = 0;
        } catch (Exception e2) {
            A4 a46 = abstractC0496w0.f53106j;
            if (a46 != null) {
                ((B4) a46).b("w0", Cc.a(e2, A5.a("w0", "TAG", "Load failed with unexpected error: ")));
            }
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
            abstractC0496w0.a(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), true, (short) 2000);
        }
        if (abstractC0496w0.e((byte) 0)) {
            C0469u c0469u = abstractC0496w0.C;
            int hashCode = abstractC0496w0.hashCode();
            C0508x c0508x = new C0508x(abstractC0496w0, abstractC0496w0.f53106j);
            c0469u.getClass();
            C0469u.a(hashCode, c0508x);
            if (i2 != -2) {
                str = "Loading an ad resulted in an unexpected error";
            } else if (i2 == -1) {
                str = "Ad request skipped as monetization is disabled";
            } else if (i2 == 0) {
                str = "Fresh ad requested";
            } else if (i2 != 1) {
                str = i2 != 2 ? android.support.v4.media.a.h("Unknown return value (", i2, ") from #doAdLoadWork()") : "Already Loading";
            } else {
                str = "Returning pre-cached ad";
            }
            a4 = abstractC0496w0.f53106j;
            if (a4 == null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a4).c("w0", str);
                return;
            }
            return;
        }
        i2 = -2;
        if (i2 != -2) {
        }
        a4 = abstractC0496w0.f53106j;
        if (a4 == null) {
        }
    }

    public final void f(int i2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "resetCurrentRenderingIndex ", this));
        }
        this.x = i2;
    }

    public final boolean b(int i2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "getAllowAutoRedirectionForIndex " + this + " index - " + i2);
        }
        C0296h a2 = a(i2);
        return a2 != null && a2.i();
    }

    @WorkerThread
    public void d(@NotNull String podAdContext) {
        Intrinsics.checkNotNullParameter(podAdContext, "podAdContext");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "setPodAdContext ", this));
        }
        if (this.A) {
            this.B = podAdContext;
        }
    }

    public final int b(String str) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "parseViewabilityResponseValue ", this));
        }
        if (StringsKt.L(str, "track_", false)) {
            str = str.substring(6);
            Intrinsics.checkNotNullExpressionValue(str, "this as java.lang.String).substring(startIndex)");
        }
        try {
            return Integer.parseInt(str);
        } catch (NumberFormatException unused) {
            return -1;
        }
    }

    public static final void d(AbstractC0496w0 this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        if (6 == this$0.f53097a) {
            this$0.a(true, (short) 2158);
        }
    }

    @Override
    public void g(@NotNull S9 renderView) {
        Handler handler;
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onRenderViewSignaledAdFailed ", this));
        }
        if (this.o || t() == null || (handler = this.f53108l) == null) {
            return;
        }
        handler.post(new hf(this, renderView, 0));
    }

    @UiThread
    public final void b(@NotNull InMobiAdRequestStatus requestStatus, boolean z, short s) {
        Intrinsics.checkNotNullParameter(requestStatus, "requestStatus");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).b("w0", "handleAdLoadFailure " + this + " errorCode - " + ((int) s));
        }
        if (this.f53097a == 1 && z) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).b("w0", "load failed - " + ((int) s));
            }
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).d("w0", "AdUnit " + this + " state - FAILED");
            }
            d((byte) 3);
            b((byte) 1);
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.a(this, requestStatus);
        } else {
            A4 a44 = this.f53106j;
            if (a44 != null) {
                ((B4) a44).a();
            }
        }
        if (s != 0) {
            b(s);
        }
    }

    @UiThread
    public final void b(@NotNull C0227c0 adSet) {
        Intrinsics.checkNotNullParameter(adSet, "adSet");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "loadResponse ", this));
        }
        c(adSet);
    }

    @UiThread
    public void b(@Nullable AbstractC0339k0 abstractC0339k0) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "handleAdScreenDisplayed ", this));
        }
    }

    public static final void b(AbstractC0496w0 this$0, S9 renderView) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(renderView, "$renderView");
        this$0.b(renderView, (short) 2137);
    }

    public void b(S9 s9, short s) {
        List<String> c2;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "Render view signaled ad failed, for index ");
            a2.append(this.f53103g.indexOf(s9));
            a2.append(' ');
            a2.append(this);
            ((B4) a4).b("w0", a2.toString());
        }
        if (s9 == null || !Intrinsics.c(s9.getMarkupType(), "htmlUrl")) {
            return;
        }
        int indexOf = this.f53103g.indexOf(s9);
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).b("w0", "fireLoadAdTokenUrlFailed : " + indexOf + ' ' + this);
        }
        C0296h a3 = a(indexOf);
        if (a3 == null || (c2 = a3.c(C0296h.LOAD_AD_TOKEN_URL_FAILURE)) == null) {
            return;
        }
        Iterator<String> it = c2.iterator();
        while (it.hasNext()) {
            Y1.f52249a.a(it.next(), true, this.f53106j);
        }
    }

    public final void e(@NotNull AbstractC0339k0 listener) {
        Intrinsics.checkNotNullParameter(listener, "listener");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onFetchSuccess ", this));
        }
        v0();
        AdMetaInfo l2 = l();
        if (l2 == null) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).b("w0", "ad meta info null. fail");
            }
            b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), true, (short) 2106);
            return;
        }
        A4 a43 = this.f53106j;
        if (a43 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a43).a("w0", "callback - onAdFetchSuccess");
        }
        listener.b(l2);
    }

    public final short c(@NotNull AbstractC0339k0 adUnitEventListener) {
        String str;
        String str2;
        String str3;
        A4 a4;
        M6 m6;
        String str4 = "event";
        Intrinsics.checkNotNullParameter(adUnitEventListener, "adUnitEventListener");
        A4 a42 = this.f53106j;
        String str5 = "TAG";
        String str6 = "w0";
        if (a42 != null) {
            ((B4) a42).c("w0", AbstractC0311i0.a("w0", "TAG", "loadMarkupInContainerNative ", this));
        }
        WeakReference weakReference = new WeakReference(adUnitEventListener);
        try {
            try {
                try {
                    try {
                        byte J = J();
                        JSONObject jSONObject = new JSONObject(L());
                        AdConfig adConfig = this.f53098b;
                        Intrinsics.e(adConfig);
                        C0227c0 c0227c0 = this.u;
                        C0332j7 dataModel = new C0332j7(J, jSONObject, adConfig, c0227c0 == null ? null : K8.a(c0227c0.h()), B0(), this.f53106j);
                        C0296h m2 = m();
                        if (!dataModel.f() || t() == null || m2 == null) {
                            return (short) 20;
                        }
                        A4 a43 = this.f53106j;
                        if (a43 != null) {
                            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                            ((B4) a43).a("w0", "creating native ad container");
                        }
                        Context context = t();
                        Intrinsics.e(context);
                        byte J2 = J();
                        String adImpressionId = m2.s();
                        Set d2 = d(0);
                        AdConfig adConfig2 = this.f53098b;
                        Intrinsics.e(adConfig2);
                        long l2 = this.t.l();
                        boolean b2 = b(0);
                        String creativeId = m2.o();
                        str = "event";
                        try {
                            try {
                                str2 = "TAG";
                                str3 = "w0";
                            } catch (Exception e2) {
                                e = e2;
                                str2 = "TAG";
                                str3 = "w0";
                                a4 = this.f53106j;
                                if (a4 != null) {
                                    String str7 = str3;
                                    ((B4) a4).b(str7, Cc.a(e, A5.a(str7, str2, "Encountered unexpected error in loading ad markup into container: ")));
                                }
                                Q4 q4 = Q4.f52013a;
                                Q4.f52015c.a(AbstractC0513x4.a(e, str));
                                return (short) 88;
                            }
                            try {
                                A2 a2 = new A2(m2, this.t.l());
                                L5 l0 = l0();
                                A4 a44 = this.f53106j;
                                Intrinsics.checkNotNullParameter(context, "context");
                                Intrinsics.checkNotNullParameter(dataModel, "dataModel");
                                Intrinsics.checkNotNullParameter(adImpressionId, "adImpressionId");
                                Intrinsics.checkNotNullParameter(adConfig2, "adConfig");
                                Intrinsics.checkNotNullParameter(creativeId, "creativeId");
                                if (dataModel.c().contains("VIDEO")) {
                                    m6 = new U7(context, J2, dataModel, adImpressionId, d2, adConfig2, l2, b2, creativeId, a2, l0, a44);
                                } else {
                                    m6 = new M6(context, J2, dataModel, adImpressionId, d2, adConfig2, l2, b2, creativeId, a2, l0, a44);
                                }
                                m6.v = new C0470u0(this, weakReference);
                                this.f53104h = m6;
                                m6.Q = this.H;
                                return (short) 0;
                            } catch (IllegalStateException e3) {
                                e = e3;
                                str5 = str2;
                                str6 = str3;
                                A4 a45 = this.f53106j;
                                if (a45 != null) {
                                    Intrinsics.checkNotNullExpressionValue(str6, str5);
                                    ((B4) a45).a(str6, "Error while setting video descriptor", e);
                                }
                                return (short) 83;
                            } catch (Exception e4) {
                                e = e4;
                                a4 = this.f53106j;
                                if (a4 != null) {
                                }
                                Q4 q42 = Q4.f52013a;
                                Q4.f52015c.a(AbstractC0513x4.a(e, str));
                                return (short) 88;
                            }
                        } catch (JSONException e5) {
                            e = e5;
                            str4 = str;
                            Q4 q43 = Q4.f52013a;
                            Q4.f52015c.a(AbstractC0325j0.a(e, str4));
                            return (short) 13;
                        }
                    } catch (IllegalStateException e6) {
                        e = e6;
                    }
                } catch (JSONException e7) {
                    e = e7;
                }
            } catch (Exception e8) {
                e = e8;
                str = "event";
            }
        } catch (IllegalStateException e9) {
            e = e9;
        } catch (JSONException e10) {
            e = e10;
        }
    }

    @Override
    public void b(@NotNull HashMap<Object, Object> rewards) {
        Intrinsics.checkNotNullParameter(rewards, "rewards");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAdRewardActionCompleted ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "Ad reward action completed. Params:" + rewards);
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.b(rewards);
        }
    }

    @SuppressLint({"SwitchIntDef"})
    @UiThread
    public final boolean e(byte b2) {
        int Y;
        Integer num;
        long j2;
        Integer num2;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "startTimer ", this));
        }
        if (b2 == 0) {
            C0412p6 c0412p6 = this.F;
            if (c0412p6 != null && (num2 = c0412p6.f52903d) != null) {
                Y = num2.intValue();
                j2 = Y;
            }
            j2 = 15000;
        } else if (b2 == 1) {
            C0412p6 c0412p62 = this.F;
            if (c0412p62 != null) {
                Y = c0412p62.f52902c;
                j2 = Y;
            }
            j2 = 15000;
        } else {
            if (b2 == 2) {
                C0412p6 c0412p63 = this.F;
                if (c0412p63 != null && (num = c0412p63.f52904e) != null) {
                    Y = num.intValue();
                }
                j2 = 15000;
            } else {
                if (b2 != 4) {
                    A4 a42 = this.f53106j;
                    if (a42 != null) {
                        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                        ((B4) a42).b("w0", "Invalid value for timeOutScenario passed!. Please pass a valid value");
                    }
                    return false;
                }
                Cb cb = this.f53100d;
                Intrinsics.e(cb);
                Y = cb.Y();
            }
            j2 = Y;
        }
        C0520xb c0520xb = this.v;
        if (c0520xb == null) {
            return false;
        }
        Intrinsics.checkNotNullExpressionValue("xb", "TAG");
        if (c0520xb.f53221b.containsKey(Byte.valueOf(b2))) {
            Intrinsics.checkNotNullExpressionValue("xb", "TAG");
            Timer timer = (Timer) c0520xb.f53221b.get(Byte.valueOf(b2));
            if (timer != null) {
                timer.cancel();
                c0520xb.f53221b.remove(Byte.valueOf(b2));
            }
        }
        try {
            Timer timer2 = new Timer("xb");
            c0520xb.f53221b.put(Byte.valueOf(b2), timer2);
            timer2.schedule(new C0507wb(c0520xb, b2), j2);
            return true;
        } catch (InternalError e2) {
            Intrinsics.checkNotNullExpressionValue("xb", "TAG");
            e2.toString();
            return false;
        } catch (OutOfMemoryError unused) {
            Intrinsics.checkNotNullExpressionValue("xb", "TAG");
            Z5.a((byte) 1, "xb", "Could not execute timer due to OutOfMemory.");
            ((AbstractC0496w0) c0520xb.f53220a).c(b2);
            return false;
        }
    }

    public final void b(short s) {
        long j2;
        long elapsedRealtime;
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdLoadFailedEvent ", this));
        }
        HashMap hashMap = new HashMap();
        if (s == 2138 || s == 2109) {
            j2 = this.I.f53234d;
            ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
            elapsedRealtime = SystemClock.elapsedRealtime();
        } else if (s == 2139) {
            j2 = this.I.f53237g;
            ScheduledExecutorService scheduledExecutorService2 = Vb.f52153a;
            elapsedRealtime = SystemClock.elapsedRealtime();
        } else {
            j2 = this.I.f53233c;
            ScheduledExecutorService scheduledExecutorService3 = Vb.f52153a;
            elapsedRealtime = SystemClock.elapsedRealtime();
        }
        hashMap.put("latency", Long.valueOf(elapsedRealtime - j2));
        hashMap.put(CLConstants.FIELD_ERROR_CODE, Short.valueOf(s));
        hashMap.put("markupType", E());
        C0296h u = u();
        if (u != null && (p = u.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            hashMap.put("retryCount", Integer.valueOf(c0246d5.f52444b));
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c((Map) hashMap);
        c("AdLoadFailed", hashMap);
    }

    public final void b(@NotNull Map<String, Object> payload) {
        Boolean o;
        String p;
        Intrinsics.checkNotNullParameter(payload, "payload");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitServerError ", this));
        }
        if (this.f53101e == null) {
            return;
        }
        if (payload.get("reason") == null) {
            payload.put("reason", "");
        }
        C0296h u = u();
        if (u != null && (p = u.p()) != null) {
            payload.put("creativeType", "\"" + p + '\"');
        }
        C0246d5 c0246d5 = this.E;
        if (c0246d5 != null) {
            payload.put("retryCount", Integer.valueOf(c0246d5.f52444b));
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            payload.put("isRewarded", o);
        }
        c(payload);
        C0283g0 c0283g0 = this.f53101e;
        Intrinsics.e(c0283g0);
        c0283g0.a(payload);
    }

    public static final void c(AbstractC0496w0 this$0, S9 renderView) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(renderView, "$renderView");
        this$0.l(renderView);
    }

    @Override
    public void c() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAdScreenDisplayFailed ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).b("w0", "Ad failed to display");
        }
        Handler handler = this.f53108l;
        if (handler != null) {
            handler.post(new we(this, 2));
        }
    }

    public void a(@NotNull Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "setContext ", this));
        }
        this.f53099c = new WeakReference(context);
    }

    public final void a(@NotNull A4 logger) {
        Intrinsics.checkNotNullParameter(logger, "logger");
        this.f53106j = logger;
        C0283g0 p = p();
        p.getClass();
        Intrinsics.checkNotNullParameter(logger, "logger");
        p.f52538f = logger;
        C0534z c0534z = this.D;
        c0534z.getClass();
        Intrinsics.checkNotNullParameter(logger, "logger");
        c0534z.f53275f = logger;
    }

    public final void c(HashMap hashMap) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "constructTelemetryPayload ", this));
        }
        hashMap.put("adType", q());
        hashMap.put("networkType", C0216b3.q());
        hashMap.put("plId", Long.valueOf(this.t.l()));
        String m2 = this.t.m();
        if (m2 != null) {
            hashMap.put("plType", m2);
        }
    }

    public final void b(long j2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdGetSignalsSucceeded ", this));
        }
        this.r = false;
        HashMap hashMap = new HashMap();
        hashMap.put("adType", q());
        hashMap.put("latency", Long.valueOf(System.currentTimeMillis() - j2));
        hashMap.put("networkType", C0216b3.q());
        c("AdGetSignalsSucceeded", hashMap);
    }

    public final V9 a(int i2, C0296h c0296h) {
        String str;
        String str2;
        Boolean o;
        String w;
        LinkedHashMap linkedHashMap = C0382n2.f52847a;
        Y9 y9 = new Y9(((TelemetryConfig) AbstractC0423q4.a("telemetry", "null cannot be cast to non-null type com.inmobi.commons.core.configs.TelemetryConfig", null)).getMaxTemplateEvents());
        J j2 = this.t;
        String E = E();
        String str3 = (c0296h == null || (w = c0296h.w()) == null) ? "" : w;
        C0246d5 c0246d5 = this.E;
        int i3 = c0246d5 != null ? c0246d5.f52444b : 0;
        C0296h u = u();
        if (u == null || (str = u.p()) == null) {
            str = "";
        }
        C0296h u2 = u();
        if (u2 == null || (str2 = u2.o()) == null) {
            str2 = "";
        }
        C0227c0 c0227c0 = this.u;
        return new V9(j2, E, str3, i3, str, str2, (c0227c0 == null || (o = c0227c0.o()) == null) ? false : o.booleanValue(), i2, this.I.f53240j, y9);
    }

    public final void c(short s) {
        C0296h m2;
        Boolean o;
        String p;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdShowFailed ", this));
        }
        HashMap hashMap = new HashMap();
        long j2 = this.I.f53235e;
        ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
        hashMap.put("latency", Long.valueOf(SystemClock.elapsedRealtime() - j2));
        hashMap.put(CLConstants.FIELD_ERROR_CODE, Short.valueOf(s));
        hashMap.put("markupType", E());
        if (this.A) {
            m2 = a(this.x);
        } else {
            m2 = m();
        }
        if (m2 != null && (p = m2.p()) != null) {
            hashMap.put("creativeType", "\"" + p + '\"');
        }
        C0227c0 c0227c0 = this.u;
        if (c0227c0 != null && (o = c0227c0.o()) != null) {
            hashMap.put("isRewarded", o);
        }
        if (S().length() > 0) {
            hashMap.put("metadataBlob", S());
        }
        c(hashMap);
        c((Map) hashMap);
        c("AdShowFailed", hashMap);
    }

    public void b(@NotNull String eventType, @NotNull Map<String, Object> kv) {
        C0296h u;
        String p;
        Intrinsics.checkNotNullParameter(eventType, "eventType");
        Intrinsics.checkNotNullParameter(kv, "kv");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "onTelemetryEvent " + this + " adState=" + ((int) this.f53097a));
        }
        if (this.f53097a != 3) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                ((B4) a42).c("w0", AbstractC0540z5.a("w0", "TAG", "addRetryCountToTelemetryEvent event - ", eventType));
            }
            switch (eventType.hashCode()) {
                case -1959333523:
                    break;
                case 167123846:
                    break;
                case 885222501:
                    break;
                case 925075267:
                    break;
                case 1881615718:
                    break;
                case 1925668903:
                    break;
            }
            if ((Intrinsics.c(eventType, "ServerFill") || Intrinsics.c(eventType, "ServerError")) && (u = u()) != null && (p = u.p()) != null) {
                kv.put("creativeType", p);
            }
            c(eventType, kv);
        }
    }

    @VisibleForTesting
    @NotNull
    public final Pair<String, Short> a(boolean z, boolean z2, boolean z3) {
        Short sh;
        StringBuilder sb = new StringBuilder("Immersive not supported on");
        BitSet bitSet = new BitSet(3);
        ArrayList arrayList = new ArrayList();
        if (!z) {
            arrayList.add(" config");
            bitSet.set(0);
        }
        if (!z2) {
            arrayList.add(" device");
            bitSet.set(1);
        }
        if (!z3) {
            arrayList.add(" ad");
            bitSet.set(2);
        }
        sb.append(CollectionsKt.w(arrayList, ",", null, null, null, 62));
        Intrinsics.checkNotNullParameter(bitSet, "bitSet");
        if (bitSet.get(0) && bitSet.get(1) && bitSet.get(2)) {
            sh = (short) 2202;
        } else if (bitSet.get(0) && bitSet.get(1)) {
            sh = (short) 2200;
        } else if (bitSet.get(0) && bitSet.get(2)) {
            sh = (short) 2199;
        } else if (bitSet.get(1) && bitSet.get(2)) {
            sh = (short) 2201;
        } else if (bitSet.get(0)) {
            sh = (short) 2196;
        } else if (bitSet.get(1)) {
            sh = (short) 2197;
        } else {
            sh = bitSet.get(2) ? (short) 2198 : null;
        }
        short shortValue = sh != null ? sh.shortValue() : (short) -1;
        if (shortValue == -1) {
            return new Pair<>("Invalid Reason", (short) -1);
        }
        return new Pair<>(sb.toString(), Short.valueOf(shortValue));
    }

    @UiThread
    public final void b(byte b2) {
        C0520xb c0520xb;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "cancelTimer ", this));
        }
        if (b2 == 1 && (c0520xb = this.v) != null) {
            Intrinsics.checkNotNullExpressionValue("xb", "TAG");
            Timer timer = (Timer) c0520xb.f53221b.get((byte) 2);
            if (timer != null) {
                timer.cancel();
                c0520xb.f53221b.remove((byte) 2);
            }
        }
        C0520xb c0520xb2 = this.v;
        if (c0520xb2 != null) {
            Intrinsics.checkNotNullExpressionValue("xb", "TAG");
            Timer timer2 = (Timer) c0520xb2.f53221b.get(Byte.valueOf(b2));
            if (timer2 != null) {
                timer2.cancel();
                c0520xb2.f53221b.remove(Byte.valueOf(b2));
            }
        }
    }

    public final void c(Map map) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "updateIdsInTelemetryPayload ", this));
        }
        C0296h m2 = m();
        if (m2 != null) {
            map.put("creativeId", "\"" + m2.o() + '\"');
            map.put("impressionId", "\"" + m2.s() + '\"');
        }
    }

    @VisibleForTesting
    public final void c(@NotNull String eventType, @NotNull Map<String, Object> kv) {
        Intrinsics.checkNotNullParameter(eventType, "eventType");
        Intrinsics.checkNotNullParameter(kv, "kv");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitTelemetryEvent ", this));
        }
        C0266eb c0266eb = C0266eb.f52475a;
        C0266eb.b(eventType, kv, EnumC0336jb.f52717a);
    }

    public final void b(int i2, boolean z) {
        S9 s9;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "fireAdPodShowResult ", this));
        }
        ArrayList list = this.f53103g;
        Intrinsics.checkNotNullParameter(list, "list");
        if (i2 < 0 || i2 >= list.size() || (s9 = (S9) this.f53103g.get(i2)) == null) {
            return;
        }
        s9.b(z);
    }

    public void c(byte b2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).b("w0", AbstractC0311i0.a("w0", "TAG", "onOOM ", this));
        }
        if (b2 == 0) {
            a(this.t, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.LOW_MEMORY), (short) 2110);
            return;
        }
        if (b2 == 2 || b2 == 1) {
            byte b3 = this.f53097a;
            if (b3 == 0 || 1 == b3 || 2 == b3) {
                A4 a42 = this.f53106j;
                if (a42 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a42).a("w0", "onOOM INTERNAL_LOAD_TIME_OUT or PRE_LOAD_TIME_OUT");
                }
                this.G.removeCallbacksAndMessages(null);
                m0();
                b((short) 2112);
                AbstractC0339k0 r = r();
                if (r != null) {
                    r.a(this, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.LOW_MEMORY));
                    return;
                }
                return;
            }
            return;
        }
        if (b2 == 4) {
            AbstractC0339k0 r2 = r();
            if (r2 != null) {
                r2.g();
                return;
            }
            return;
        }
        if (b2 == 3) {
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).a("w0", "OOM Timeout scenario ignored for : " + ((int) b2));
                return;
            }
            return;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a44).a("w0", "OOM Timeout scenario ignored for : " + ((int) b2));
        }
    }

    @Override
    public void b(@NotNull S9 renderView) {
        List<String> c2;
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "fireClickTracker ", this));
        }
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        C0296h a2 = a(this.f53103g.indexOf(renderView));
        if (((a2 != null ? a2.p() : null) != null && Intrinsics.c(a2.p(), "video")) || a2 == null || (c2 = a2.c(C0296h.CLICK_BEACON)) == null) {
            return;
        }
        Iterator<String> it = c2.iterator();
        while (it.hasNext()) {
            Y1.f52249a.a(it.next(), true, this.f53106j);
        }
    }

    public static void a(C0296h c0296h, S9 s9) {
        AdQualityControl adQualityControl;
        W adQualityManager;
        if (c0296h == null || (adQualityControl = c0296h.e()) == null || s9 == null || (adQualityManager = s9.getAdQualityManager()) == null) {
            return;
        }
        Intrinsics.checkNotNullParameter(adQualityControl, "adQualityControl");
        adQualityManager.a("adQuality session setup");
        if (!adQualityManager.f52154a.getEnabled()) {
            adQualityManager.a("config kill switch - false. ad quality will skip");
            return;
        }
        if (adQualityManager.f52156c.get()) {
            adQualityManager.a("session already started. skip");
            return;
        }
        adQualityManager.a("verifying control flags");
        String beacon = adQualityControl.getBeacon();
        if (beacon != null && beacon.length() == 0) {
            adQualityManager.a("no beacon received. aborting...");
            ScheduledExecutorService scheduledExecutorService = P.f51980a;
            if (scheduledExecutorService != null) {
                scheduledExecutorService.shutdown();
                try {
                    try {
                        scheduledExecutorService.shutdownNow();
                    } catch (Exception e2) {
                        Intrinsics.checkNotNullParameter("AdQualityComponent", "tag");
                        Intrinsics.checkNotNullParameter("shutdown fail", "message");
                        Log.e("AdQualityComponent", "shutdown fail", e2);
                        Thread.currentThread().interrupt();
                        adQualityManager.a("session end - cleanup");
                        adQualityManager.f52160g = null;
                        adQualityManager.f52159f.clear();
                        adQualityManager.f52156c.set(false);
                        adQualityManager.f52157d.set(false);
                        adQualityManager.a("ad quality session is already in progress. skipping...");
                        return;
                    }
                } catch (InterruptedException unused) {
                    scheduledExecutorService.shutdownNow();
                    Thread.currentThread().interrupt();
                    adQualityManager.a("session end - cleanup");
                    adQualityManager.f52160g = null;
                    adQualityManager.f52159f.clear();
                    adQualityManager.f52156c.set(false);
                    adQualityManager.f52157d.set(false);
                    adQualityManager.a("ad quality session is already in progress. skipping...");
                    return;
                }
            }
            adQualityManager.a("session end - cleanup");
            adQualityManager.f52160g = null;
            adQualityManager.f52159f.clear();
            adQualityManager.f52156c.set(false);
            adQualityManager.f52157d.set(false);
            adQualityManager.a("ad quality session is already in progress. skipping...");
            return;
        }
        adQualityManager.f52160g = adQualityControl;
    }

    @Override
    public void c(@NotNull S9 renderView) {
        List<String> c2;
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "fireImpressionTracker ", this));
        }
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        C0296h a2 = a(this.f53103g.indexOf(renderView));
        if (((a2 != null ? a2.p() : null) != null && Intrinsics.c(a2.p(), "video")) || a2 == null || (c2 = a2.c(C0296h.IMPRESSION_BEACON)) == null) {
            return;
        }
        for (String str : c2) {
            C0430qb telemetryOnAdImpression = renderView.getTelemetryOnAdImpression();
            telemetryOnAdImpression.getClass();
            Intrinsics.checkNotNullParameter("adResponseTracker", "<set-?>");
            telemetryOnAdImpression.f52937e = "adResponseTracker";
            Y1.f52249a.b(str, true, (D1) new C0521y(this.D, telemetryOnAdImpression), this.f53106j);
        }
    }

    @Nullable
    public final C0296h a(int i2) {
        Iterable iterable;
        LinkedList<C0296h> f2;
        LinkedList<C0296h> f3;
        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
        toString();
        C0227c0 c0227c0 = this.u;
        if (c0227c0 == null || (f3 = c0227c0.f()) == null) {
            iterable = EmptyList.f62316a;
        } else {
            Intrinsics.checkNotNullParameter(f3, "<this>");
            iterable = new IntRange(0, f3.size() - 1, 1);
        }
        if (CollectionsKt.m(iterable, Integer.valueOf(i2))) {
            C0227c0 c0227c02 = this.u;
            if (c0227c02 != null && (f2 = c0227c02.f()) != null) {
                return f2.get(i2);
            }
        } else {
            C0227c0 c0227c03 = this.u;
            if (c0227c03 != null) {
                return c0227c03.p();
            }
        }
        return null;
    }

    public final void a(@NotNull AbstractC0339k0 listener, short s) {
        Intrinsics.checkNotNullParameter(listener, "listener");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onAdShowFailed ", this));
        }
        c(s);
        listener.d();
    }

    @WorkerThread
    public void a(int i2, @NotNull S9 renderView, @Nullable Context context) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "Show pod ad with index : " + i2 + " from creative: " + this.f53103g.indexOf(renderView) + ' ' + this);
        }
        if (i2 >= 0) {
            this.x = i2;
        } else {
            this.x++;
        }
    }

    public void a(@NotNull S9 renderView, @Nullable Context context) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "closeCurrentPodAd ", this));
        }
    }

    public boolean a(@NonNull @NotNull C0296h ad, int i2, boolean z) {
        String str;
        String str2;
        Object obj;
        Object obj2;
        String str3;
        A4 a4;
        boolean z2;
        A4 a42;
        JSONObject c2;
        Object obj3;
        Object obj4;
        HashMap hashMap;
        AdConfig.ViewabilityConfig viewability;
        AdConfig.OmidConfig omidConfig;
        Intrinsics.checkNotNullParameter(ad, "ad");
        A4 a43 = this.f53106j;
        if (a43 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            str = "event";
            str2 = "tracking";
            ((B4) a43).c("w0", "didParseAdResponseAndExtractData " + this + " - index - " + i2);
        } else {
            str = "event";
            str2 = "tracking";
        }
        try {
            try {
                c2 = ad.c();
                try {
                } catch (JSONException e2) {
                    e = e2;
                    obj = CLConstants.FIELD_ERROR_CODE;
                }
            } catch (IllegalArgumentException e3) {
                e = e3;
                obj = CLConstants.FIELD_ERROR_CODE;
            }
        } catch (JSONException e4) {
            e = e4;
            obj = CLConstants.FIELD_ERROR_CODE;
        }
        if (Intrinsics.c("unknown", ad.u())) {
            A4 a44 = this.f53106j;
            if (a44 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a44).b("w0", "unknown markup type. fail");
            }
            if (!z) {
                return false;
            }
            HashMap hashMap2 = new HashMap();
            hashMap2.put(CLConstants.FIELD_ERROR_CODE, (short) 2163);
            b((Map<String, Object>) hashMap2);
            return false;
        }
        String x = ad.x();
        try {
            try {
            } catch (JSONException e5) {
                e = e5;
                obj2 = "reason";
                str3 = str;
                obj = obj4;
                a4 = this.f53106j;
                if (a4 != null) {
                }
                Q4 q4 = Q4.f52013a;
                Q4.f52015c.a(AbstractC0325j0.a(e, str3));
                if (z) {
                }
                z2 = false;
                a42 = this.f53106j;
                if (a42 != null) {
                }
                return z2;
            }
        } catch (IllegalArgumentException e6) {
            e = e6;
            obj = obj3;
        }
        if (x.length() > 0) {
            long j2 = this.I.f53236f;
            ScheduledExecutorService scheduledExecutorService = Vb.f52153a;
            ad.f(StringsKt.H(x, "@__imm_aft@", String.valueOf(SystemClock.elapsedRealtime() - j2)));
            A4 a45 = this.f53106j;
            if (a45 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a45).a("w0", "parsing of pub content success");
            }
            Context d2 = Ha.d();
            HashMap hashMap3 = this.f53105i;
            Intrinsics.e(hashMap3);
            if (hashMap3.get(Integer.valueOf(i2)) == null) {
                Integer valueOf = Integer.valueOf(i2);
                HashMap hashMap4 = this.f53105i;
                Intrinsics.e(hashMap4);
                hashMap4.put(valueOf, new HashSet());
            }
            HashMap hashMap5 = this.f53105i;
            Intrinsics.e(hashMap5);
            Set set = (Set) hashMap5.get(Integer.valueOf(i2));
            if (set != null && set.isEmpty()) {
                A4 a46 = this.f53106j;
                if (a46 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a46).c("w0", "empty trackers");
                }
                AdConfig adConfig = this.f53098b;
                Boolean valueOf2 = (adConfig == null || (viewability = adConfig.getViewability()) == null || (omidConfig = viewability.getOmidConfig()) == null) ? null : Boolean.valueOf(omidConfig.isOmidEnabled());
                A4 a47 = this.f53106j;
                if (a47 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a47).c("w0", "OMID enable - " + valueOf2);
                }
                boolean c3 = Intrinsics.c(valueOf2, Boolean.TRUE);
                int i3 = 2;
                if (c3 && c2 != null && c2.has("metaInfo")) {
                    A4 a48 = this.f53106j;
                    if (a48 != null) {
                        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                        ((B4) a48).c("w0", "checking meta info");
                    }
                    JSONObject jSONObject = c2.getJSONObject("metaInfo");
                    if (jSONObject.has("omsdkInfo")) {
                        A4 a49 = this.f53106j;
                        if (a49 != null) {
                            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                            ((B4) a49).c("w0", "checking OMSDK meta info");
                        }
                        JSONObject jSONObject2 = jSONObject.getJSONObject("omsdkInfo");
                        if (jSONObject2.has("omidEnabled") && jSONObject2.getBoolean("omidEnabled")) {
                            String string = jSONObject.has("creativeType") ? jSONObject.getString("creativeType") : "unknown";
                            Handler handler = this.f53108l;
                            if (handler != null) {
                                handler.post(new df(i3, d2, this));
                            }
                            Fb fb = new Fb((byte) 3);
                            boolean optBoolean = jSONObject2.optBoolean("isolateVerificationScripts");
                            String optString = jSONObject2.optString("customReferenceData");
                            JSONObject optJSONObject = jSONObject2.optJSONObject("macros");
                            byte optInt = (byte) jSONObject2.optInt("impressionType");
                            Intrinsics.e(string);
                            Intrinsics.e(optString);
                            fb.f51667b = AbstractC0367m0.a(string, optString, optBoolean, optJSONObject, optInt);
                            A4 a410 = this.f53106j;
                            if (a410 != null) {
                                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                                ((B4) a410).c("w0", "Read out OMID params: " + fb.f51667b);
                            }
                            set.add(fb);
                        }
                    }
                }
                if (c2 != null && c2.has("viewability")) {
                    A4 a411 = this.f53106j;
                    if (a411 != null) {
                        Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                        ((B4) a411).c("w0", "checking viewability info");
                    }
                    JSONArray jSONArray = c2.getJSONArray("viewability");
                    Intrinsics.checkNotNullExpressionValue(jSONArray, "getJSONArray(...)");
                    HashMap a2 = a(jSONArray);
                    if (a2 != null && !a2.isEmpty()) {
                        A4 a412 = this.f53106j;
                        if (a412 != null) {
                            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                            ((B4) a412).c("w0", "checking for inmobi trackers");
                        }
                        Fb fb2 = new Fb((byte) 2);
                        fb2.f51667b = a2;
                        set.add(fb2);
                    }
                }
            }
            z2 = true;
            a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).a("w0", "Parsing result - " + z2);
            }
            return z2;
        }
        try {
            A4 a413 = this.f53106j;
            if (a413 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a413).a("w0", "empty punContent - fail");
            }
            if (!z) {
                return false;
            }
            try {
                hashMap = new HashMap();
                obj = CLConstants.FIELD_ERROR_CODE;
            } catch (JSONException e7) {
                e = e7;
                obj = CLConstants.FIELD_ERROR_CODE;
            }
            try {
                hashMap.put(obj, (short) 2162);
                b((Map<String, Object>) hashMap);
                return false;
            } catch (IllegalArgumentException e8) {
                e = e8;
                A4 a414 = this.f53106j;
                if (a414 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a414).a("w0", "Invalid Base64 encoding in received ad.", e);
                }
                Q4 q42 = Q4.f52013a;
                J1 j1 = new J1(e);
                Intrinsics.checkNotNullParameter(j1, str);
                Q4.f52015c.a(j1);
                if (z) {
                    HashMap hashMap6 = new HashMap();
                    hashMap6.put(obj, (short) 2121);
                    String message = e.getMessage();
                    if (message != null) {
                        hashMap6.put("reason", message);
                    }
                    b((Map<String, Object>) hashMap6);
                }
                z2 = false;
                a42 = this.f53106j;
                if (a42 != null) {
                }
                return z2;
            } catch (JSONException e9) {
                e = e9;
                obj2 = "reason";
                str3 = str;
                a4 = this.f53106j;
                if (a4 != null) {
                }
                Q4 q43 = Q4.f52013a;
                Q4.f52015c.a(AbstractC0325j0.a(e, str3));
                if (z) {
                }
                z2 = false;
                a42 = this.f53106j;
                if (a42 != null) {
                }
                return z2;
            }
        } catch (JSONException e10) {
            e = e10;
            obj = CLConstants.FIELD_ERROR_CODE;
            obj2 = "reason";
            str3 = str;
            a4 = this.f53106j;
            if (a4 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a4).a("w0", "Exception while parsing received ad.", e);
            }
            Q4 q432 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0325j0.a(e, str3));
            if (z) {
                HashMap hashMap7 = new HashMap();
                hashMap7.put(obj, (short) 2120);
                String message2 = e.getMessage();
                if (message2 != null) {
                    hashMap7.put(obj2, message2);
                }
                b((Map<String, Object>) hashMap7);
            }
            z2 = false;
            a42 = this.f53106j;
            if (a42 != null) {
            }
            return z2;
        }
    }

    public static final void a(Context context, AbstractC0496w0 this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        C0222b9 c0222b9 = AbstractC0208a9.f52330a;
        AdConfig adConfig = this$0.f53098b;
        c0222b9.getClass();
        try {
            if (!Omid.isActive()) {
                Omid.activate(context);
            } else {
                c0222b9.a(adConfig);
            }
        } catch (Exception e2) {
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
        }
    }

    public final HashMap a(JSONArray jSONArray) {
        JSONObject jSONObject;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "parseInMobiViewabilityParams ", this));
        }
        try {
            int length = jSONArray.length();
            int i2 = 0;
            while (true) {
                if (i2 >= length) {
                    jSONObject = null;
                    break;
                }
                JSONObject jSONObject2 = jSONArray.getJSONObject(i2);
                if (jSONObject2.has("inmobi")) {
                    jSONObject = jSONObject2.getJSONObject("inmobi");
                    break;
                }
                i2++;
            }
            if (jSONObject == null) {
                return null;
            }
            HashMap hashMap = new HashMap();
            String optString = jSONObject.optString("time");
            Intrinsics.checkNotNullExpressionValue(optString, "optString(...)");
            int b2 = b(optString);
            if (b2 != -1) {
                hashMap.put("time", Integer.valueOf(b2));
            }
            String optString2 = jSONObject.optString("view");
            Intrinsics.checkNotNullExpressionValue(optString2, "optString(...)");
            int b3 = b(optString2);
            if (b3 != -1) {
                hashMap.put("view", Integer.valueOf(b3));
            }
            String optString3 = jSONObject.optString("pixel");
            Intrinsics.checkNotNullExpressionValue(optString3, "optString(...)");
            int b4 = b(optString3);
            if (b4 != -1) {
                hashMap.put("pixel", Integer.valueOf(b4));
            }
            int optInt = jSONObject.optInt("type");
            if (optInt != -1) {
                hashMap.put("type", Integer.valueOf(optInt));
                if (optInt == 2) {
                    JSONArray optJSONArray = jSONObject.optJSONArray("frame");
                    if (optJSONArray != null && optJSONArray.length() == 4) {
                        JSONArray optJSONArray2 = jSONObject.optJSONArray("frame");
                        Intrinsics.checkNotNullExpressionValue(optJSONArray2, "optJSONArray(...)");
                        hashMap.put("frame", optJSONArray2);
                    } else {
                        hashMap.put("frame", new JSONArray("[0,0,0,0]"));
                    }
                }
            }
            return hashMap;
        } catch (JSONException e2) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                StringBuilder a2 = A5.a("w0", "TAG", "Exception while parsing MoatParams from response : ");
                a2.append(e2.getMessage());
                ((B4) a42).b("w0", a2.toString());
            }
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0325j0.a(e2, "event"));
            return null;
        }
    }

    @UiThread
    public void a(@NotNull J placement, boolean z, short s) {
        Intrinsics.checkNotNullParameter(placement, "placement");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onAssetAvailabilityChanged ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        if (s != 0) {
            b(s);
        }
        a(placement, z);
    }

    public void a(J placement, boolean z) {
        Intrinsics.checkNotNullParameter(placement, "placement");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "handleAssetAvailabilityChanged ", this));
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "Asset availability changed (" + z + ") for placement ID (" + placement + ')');
        }
    }

    public void a(C0227c0 adSet) {
        LinkedList<C0296h> f2;
        LinkedList<C0296h> f3;
        Intrinsics.checkNotNullParameter(adSet, "adSet");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "handleAdFetchSuccessful ", this));
        }
        if (this.f53097a == 1) {
            this.u = adSet;
            int i2 = 0;
            this.A = adSet != null ? adSet.n() : false;
            C0227c0 c0227c0 = this.u;
            if (c0227c0 != null && (f3 = c0227c0.f()) != null) {
                i2 = f3.size();
            }
            this.f53103g = new ArrayList(i2);
            C0227c0 c0227c02 = this.u;
            if (c0227c02 != null && (f2 = c0227c02.f()) != null) {
                for (C0296h c0296h : f2) {
                    this.f53103g.add(null);
                }
            }
            C0296h p = adSet.p();
            if (p == null) {
                A4 a42 = this.f53106j;
                if (a42 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a42).b("w0", "top ad is null. failed.");
                }
                b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), true, (short) 2119);
                return;
            }
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).a("w0", "starting executor. parsing ad response");
            }
            C0469u c0469u = this.C;
            int hashCode = hashCode();
            C0306h9 c0306h9 = new C0306h9(this, p, adSet, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), this.f53106j);
            c0469u.getClass();
            C0469u.a(hashCode, c0306h9);
            return;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "incorrect state - ");
            a2.append((int) this.f53097a);
            ((B4) a44).b("w0", a2.toString());
        }
        b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR), true, (short) 2118);
    }

    @WorkerThread
    public boolean a(@NotNull S9 renderView) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 == null) {
            return false;
        }
        ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "hasNextAdInAdPod ", this));
        return false;
    }

    @UiThread
    public void a(byte b2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onTimeOut ", this));
        }
        if (b2 == 0) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                StringBuilder a2 = A5.a("w0", "TAG", "AdRequestTimeOut by timer, Adstate=");
                a2.append((int) this.f53097a);
                ((B4) a42).a("w0", a2.toString());
            }
            if (this.f53097a != 3) {
                a(this.t, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.REQUEST_TIMED_OUT), (short) 2109);
                return;
            }
            return;
        }
        if (b2 != 2 && b2 != 1) {
            if (b2 == 4) {
                A4 a43 = this.f53106j;
                if (a43 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a43).a("w0", "Show RequestTimeOut by show timer");
                }
                AbstractC0339k0 r = r();
                if (r != null) {
                    r.g();
                    return;
                }
                return;
            }
            if (b2 == 3) {
                A4 a44 = this.f53106j;
                if (a44 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a44).a("w0", "Bitmap TimeOut not handled here");
                    return;
                }
                return;
            }
            A4 a45 = this.f53106j;
            if (a45 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a45).a("w0", "Unknown TimeOut ignored");
                return;
            }
            return;
        }
        A4 a46 = this.f53106j;
        if (a46 != null) {
            StringBuilder a3 = A5.a("w0", "TAG", "Internal LoadTimeOut by timer, Adstate=");
            a3.append((int) this.f53097a);
            ((B4) a46).a("w0", a3.toString());
        }
        if (this.f53097a != 3) {
            this.G.removeCallbacksAndMessages(null);
            A4 a47 = this.f53106j;
            if (a47 != null) {
                StringBuilder a5 = A5.a("w0", "TAG", "adUnitEventListener=");
                a5.append(r());
                a5.append(", Adstate=");
                a5.append((int) this.f53097a);
                ((B4) a47).a("w0", a5.toString());
            }
            byte b3 = this.f53097a;
            if (2 == b3) {
                m0();
                b(K8.a() == null ? (short) 2139 : (short) 2203);
                AbstractC0339k0 r2 = r();
                if (r2 != null) {
                    r2.a(this, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INTERNAL_ERROR));
                    return;
                }
                return;
            }
            if (1 == b3) {
                m0();
                b((short) 2138);
                AbstractC0339k0 r3 = r();
                if (r3 != null) {
                    r3.a(this, new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.REQUEST_TIMED_OUT));
                }
            }
        }
    }

    @UiThread
    public void a(boolean z, @NotNull InMobiAdRequestStatus status) {
        Intrinsics.checkNotNullParameter(status, "status");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onDidParseAfterFetch ", this));
        }
        if (z) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).a("w0", "Ad fetch successful");
            }
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).d("w0", "AdUnit " + this + " state - AVAILABLE");
            }
            d((byte) 2);
            return;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a44).b("w0", "onComplete parse success");
        }
        b(status, true, (short) 0);
    }

    @UiThread
    public final void a(@NotNull J placement, @NotNull InMobiAdRequestStatus requestStatus, short s) {
        Intrinsics.checkNotNullParameter(placement, "placement");
        Intrinsics.checkNotNullParameter(requestStatus, "requestStatus");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onAdFetchFailed ", this));
        }
        if (this.o || t() == null || this.f53097a == 3) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                StringBuilder a2 = A5.a("w0", "TAG", "callback ignored - isDestroyed - ");
                a2.append(this.o);
                a2.append(" context - ");
                a2.append(t());
                a2.append(" state- ");
                a2.append((int) this.f53097a);
                ((B4) a42).b("w0", a2.toString());
                return;
            }
            return;
        }
        A4 a43 = this.f53106j;
        if (a43 != null) {
            ((B4) a43).c("w0", AbstractC0311i0.a("w0", "TAG", "handleMarkupFetchFailure ", this));
        }
        try {
            if (Intrinsics.c(this.t, placement) && this.f53097a == 1) {
                A4 a44 = this.f53106j;
                if (a44 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a44).b("w0", "Failed to fetch ad for placement id: " + placement + ", reason - " + requestStatus.getMessage());
                }
                String str = "MarkupFetch failed reason is: " + requestStatus.getMessage();
                A4 a45 = this.f53106j;
                if (a45 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a45).b("w0", str);
                }
                A4 a46 = this.f53106j;
                if (a46 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a46).d("w0", "AdUnit " + this + " state - FAILED");
                }
                d((byte) 3);
                b((byte) 1);
                if (s != 0) {
                    a(s);
                }
                AbstractC0339k0 r = r();
                if (r != null) {
                    r.a(requestStatus);
                    return;
                }
                A4 a47 = this.f53106j;
                if (a47 != null) {
                    ((B4) a47).a();
                }
            }
        } catch (Exception e2) {
            A4 a48 = this.f53106j;
            if (a48 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a48).a("w0", "onAdFetchFailed with error: ", e2);
            }
            Q4 q4 = Q4.f52013a;
            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
        }
    }

    @UiThread
    public final void a(boolean z, short s) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).b("w0", "handleAdShowFailure " + this + " errorCode - " + ((int) s));
        }
        if (z) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).d("w0", "AdUnit " + this + " state - FAILED");
            }
            d((byte) 3);
            b((byte) 4);
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.d();
        }
        if (s != 0) {
            c(s);
        }
    }

    @UiThread
    public final void a(@NotNull InMobiAdRequestStatus requestStatus, boolean z, short s) {
        Intrinsics.checkNotNullParameter(requestStatus, "requestStatus");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).b("w0", "handleAdFetchFailure " + this + " errorCode - " + ((int) s));
        }
        if (this.f53097a == 1 && z) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).d("w0", "AdUnit " + this + " state - FAILED");
            }
            d((byte) 3);
            b((byte) 1);
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.a(this, requestStatus);
        }
        if (s != 0) {
            a(s);
        }
    }

    public final void a(@Nullable Map<String, String> map) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).c("w0", "setPublisherSuppliedExtras " + this + " - " + map);
        }
        this.t.a(map);
    }

    public final void a(@NotNull JSONObject responseJson) {
        Intrinsics.checkNotNullParameter(responseJson, "responseJson");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAuctionClosed ", this));
        }
        new Handler(Looper.getMainLooper()).post(new df(1, this, responseJson));
    }

    public static final void a(AbstractC0496w0 this$0, JSONObject responseJson) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(responseJson, "$responseJson");
        C0469u c0469u = this$0.C;
        int hashCode = this$0.hashCode();
        C0228c1 c0228c1 = new C0228c1(this$0, responseJson, this$0.f53106j);
        c0469u.getClass();
        C0469u.a(hashCode, c0228c1);
    }

    public final void a(Function0 onSuccess, Function1 onMaxRetryReached) {
        Intrinsics.checkNotNullParameter(onSuccess, "onSuccess");
        Intrinsics.checkNotNullParameter(onMaxRetryReached, "onMaxRetryReached");
        A4 a4 = this.f53106j;
        Object obj = null;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "loadWithRetry ");
            C0246d5 c0246d5 = this.E;
            a2.append(c0246d5 != null ? Integer.valueOf(c0246d5.f52444b) : null);
            ((B4) a4).c("w0", a2.toString());
        }
        C0246d5 c0246d52 = this.E;
        if (c0246d52 != null) {
            EnumC0499w3 a3 = K8.a();
            if (a3 == null) {
                obj = C0292g9.f52557a;
            } else {
                int i2 = c0246d52.f52444b + 1;
                c0246d52.f52444b = i2;
                if (i2 >= c0246d52.f52443a.f52901b) {
                    obj = new C0275f6(a3);
                } else {
                    obj = C0531y9.f53256a;
                }
            }
        }
        if (obj instanceof C0275f6) {
            onMaxRetryReached.invoke(((C0275f6) obj).f52503a);
            return;
        }
        if (obj instanceof C0292g9) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).c("w0", "load with retry success");
            }
            onSuccess.invoke();
            return;
        }
        if (!(obj instanceof C0531y9)) {
            if (obj == null) {
                A4 a43 = this.f53106j;
                if (a43 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a43).c("w0", "shouldProceedToLoad result null. starting as if we have internet.");
                }
                onSuccess.invoke();
                return;
            }
            return;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a44).c("w0", "load failed, retrying");
        }
        this.G.postDelayed(new nd(4, this, onSuccess, onMaxRetryReached), this.F != null ? r7.f52900a : 1000L);
    }

    public static final void a(AbstractC0496w0 this$0, Function0 onSuccess, Function1 onMaxRetryReached) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(onSuccess, "$onSuccess");
        Intrinsics.checkNotNullParameter(onMaxRetryReached, "$onMaxRetryReached");
        A4 a4 = this$0.f53106j;
        if (a4 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "Loading from retry Handler ");
            C0246d5 c0246d5 = this$0.E;
            a2.append(c0246d5 != null ? Integer.valueOf(c0246d5.f52444b) : null);
            ((B4) a4).c("w0", a2.toString());
        }
        this$0.a(onSuccess, onMaxRetryReached);
    }

    @UiThread
    public void a(@Nullable byte[] bArr) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "load response ", this));
        }
        C0522y0 c0522y0 = this.I;
        c0522y0.getClass();
        c0522y0.f53233c = SystemClock.elapsedRealtime();
        C0522y0 c0522y02 = this.I;
        c0522y02.getClass();
        c0522y02.f53238h = SystemClock.elapsedRealtime();
        if (Y()) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).a("w0", "isBlockingStateForLoadWithResponse - blocking");
                return;
            }
            return;
        }
        if (bArr != null && bArr.length != 0) {
            if (this.s == null) {
                this.s = new R8(this);
            }
            C0457t0 c0457t0 = new C0457t0(this, bArr);
            if (p0()) {
                A4 a43 = this.f53106j;
                if (a43 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a43).a("w0", "skipping internet check on load(byte[])");
                }
                c0457t0.invoke();
                return;
            }
            A4 a44 = this.f53106j;
            if (a44 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a44).a("w0", "starting load with retry");
            }
            a(c0457t0, new C0444s0(this));
            return;
        }
        b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.INVALID_RESPONSE_IN_LOAD), true, (short) 2143);
        A4 a45 = this.f53106j;
        if (a45 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a45).a("w0", "null response. failing");
        }
    }

    @UiThread
    public final void a(@NotNull InMobiAdRequestStatus requestStatus, short s) {
        Intrinsics.checkNotNullParameter(requestStatus, "requestStatus");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).b("w0", "loadResponseFailed " + this + " errorCode - " + ((int) s));
        }
        b(requestStatus, true, s);
    }

    @SuppressLint({"SwitchIntDef"})
    @VisibleForTesting
    public final boolean a(@Nullable AbstractC0339k0 abstractC0339k0, long j2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "isBlockingStateForGetSignals ", this));
        }
        if (this.r) {
            Z5.a((byte) 2, "InMobi", "getSignals() call is already in progress. Please wait for its execution to get complete");
            A4 a42 = this.f53106j;
            if (a42 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a42).b("w0", "getSignals() call is already in progress. Please wait for its execution to get complete");
            }
            return true;
        }
        if (!f0()) {
            return false;
        }
        if (abstractC0339k0 != null) {
            abstractC0339k0.b(new InMobiAdRequestStatus(InMobiAdRequestStatus.StatusCode.MISSING_REQUIRED_DEPENDENCIES));
        }
        a(2007, j2);
        return true;
    }

    public final void a(@NotNull WeakReference<AbstractC0339k0> listenerWeakReference, short s, @NotNull InMobiAdRequestStatus status) {
        Intrinsics.checkNotNullParameter(listenerWeakReference, "listenerWeakReference");
        Intrinsics.checkNotNullParameter(status, "status");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "onLoadAdMarkupFailed ", this));
        }
        d((byte) 3);
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).d("w0", "AdUnit " + this + " state - FAILED");
        }
        b((byte) 1);
        if (this.o) {
            A4 a43 = this.f53106j;
            if (a43 != null) {
                Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                ((B4) a43).b("w0", "AdUnit destroyed while onLoadAdMarkupFailed");
                return;
            }
            return;
        }
        AbstractC0339k0 abstractC0339k0 = listenerWeakReference.get();
        if (abstractC0339k0 != null) {
            if (Intrinsics.c("int", q())) {
                a(abstractC0339k0, s);
                return;
            } else {
                b(s);
                abstractC0339k0.a(this, status);
                return;
            }
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a44).b("w0", "Listener was garbage collected.Unable to give callback");
        }
    }

    public final void a(@NotNull WatermarkData watermarkData) {
        Intrinsics.checkNotNullParameter(watermarkData, "watermarkData");
        this.J = watermarkData;
        S9 w = w();
        if (w != null) {
            w.setWatermark(watermarkData);
        }
    }

    public static void a(AbstractC0496w0 abstractC0496w0, int i2, boolean z, int i3, Object obj) {
        if (obj != null) {
            throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: destroyContainer");
        }
        if ((i3 & 2) != 0) {
            z = true;
        }
        abstractC0496w0.a(i2, z);
    }

    @UiThread
    public final void a(int i2, boolean z) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a4).a("w0", "Destroying container for index " + i2 + ' ' + this);
        }
        ArrayList list = this.f53103g;
        Intrinsics.checkNotNullParameter(list, "list");
        if (i2 < 0 || i2 >= list.size()) {
            return;
        }
        S9 s9 = (S9) this.f53103g.get(i2);
        if (s9 != null) {
            s9.v0.set(z);
            s9.stopLoading();
            s9.b();
        }
        this.f53103g.set(i2, null);
    }

    @Override
    public void a(@NotNull String log) {
        Intrinsics.checkNotNullParameter(log, "log");
        AbstractC0339k0 r = r();
        if (r != null) {
            r.a(log);
        }
    }

    @UiThread
    public void a(@Nullable AbstractC0339k0 abstractC0339k0) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "handleAdScreenDismissed ", this));
        }
    }

    @Override
    public void a(@NotNull final S9 renderView, final short s) {
        Intrinsics.checkNotNullParameter(renderView, "renderView");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onRenderViewError ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        try {
            Handler handler = this.f53108l;
            if (handler != null) {
                handler.post(new Runnable() {
                    @Override
                    public final void run() {
                        AbstractC0496w0.a(AbstractC0496w0.this, renderView, s);
                    }
                });
            }
        } catch (Exception e2) {
            A4 a42 = this.f53106j;
            if (a42 != null) {
                ((B4) a42).b("w0", Cc.a(e2, A5.a("w0", "TAG", "Loading ad markup into container encountered an unexpected error: ")));
            }
        }
    }

    public static final void a(AbstractC0496w0 this$0, S9 renderView, short s) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(renderView, "$renderView");
        this$0.b(renderView, s);
    }

    @Override
    public void a(@NotNull HashMap<Object, Object> params) {
        Intrinsics.checkNotNullParameter(params, "params");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onAdInteraction ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "Ad interaction. Params: " + params);
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.a(params);
        }
    }

    @Override
    public void a(@NotNull C0430qb telemetryOnAdImpression) {
        Intrinsics.checkNotNullParameter(telemetryOnAdImpression, "telemetryOnAdImpression");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onImpressionFiredFromTemplate ", this));
        }
        telemetryOnAdImpression.getClass();
        Intrinsics.checkNotNullParameter("imraid_impressionFired", "<set-?>");
        telemetryOnAdImpression.f52937e = "imraid_impressionFired";
        if (this.o || t() == null) {
            telemetryOnAdImpression.b();
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "onImpressionFiredFromTemplate");
        }
        Handler handler = this.f53108l;
        if (handler != null) {
            handler.post(new df(3, this, telemetryOnAdImpression));
        }
    }

    public static final void a(AbstractC0496w0 this$0, C0430qb telemetryOnAdImpression) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        Intrinsics.checkNotNullParameter(telemetryOnAdImpression, "$telemetryOnAdImpression");
        this$0.D.a(telemetryOnAdImpression);
    }

    @Override
    public void a() {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onUserLeaveApplication ", this));
        }
        if (this.o || t() == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            Intrinsics.checkNotNullExpressionValue("w0", "TAG");
            ((B4) a42).a("w0", "User left application");
        }
        AbstractC0339k0 r = r();
        if (r != null) {
            r.h();
        }
    }

    public final void a(short s) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdLoadDroppedAtSDK ", this));
        }
        HashMap hashMap = new HashMap();
        hashMap.put(CLConstants.FIELD_ERROR_CODE, Short.valueOf(s));
        c(hashMap);
        c("AdLoadDroppedAtSDK", hashMap);
    }

    public final void a(int i2, long j2) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "submitAdGetSignalsFailed ", this));
        }
        this.r = false;
        HashMap hashMap = new HashMap();
        hashMap.put("adType", q());
        hashMap.put("latency", Long.valueOf(System.currentTimeMillis() - j2));
        hashMap.put("networkType", C0216b3.q());
        hashMap.put(CLConstants.FIELD_ERROR_CODE, Integer.valueOf(i2));
        c("AdGetSignalsFailed", hashMap);
    }

    @Override
    public void a(@NotNull String eventType, @NotNull Map<String, Object> kv) {
        Intrinsics.checkNotNullParameter(eventType, "eventType");
        Intrinsics.checkNotNullParameter(kv, "kv");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onRenderViewRequestedAction ", this));
        }
        c(eventType, kv);
    }

    public final void a(@NotNull C0296h c0296h) {
        String str;
        boolean z;
        String str2;
        A4 a4;
        JSONObject pubContent;
        String str3;
        AdConfig adConfig;
        String str4;
        W6 w6;
        String str5;
        A4 a42;
        VerificationScriptResource createVerificationScriptResourceWithoutParameters;
        String str6;
        C0332j7 c0332j7;
        W7 w7;
        String str7;
        VerificationScriptResource createVerificationScriptResourceWithoutParameters2;
        AdConfig.ViewabilityConfig viewability;
        C0296h ad = c0296h;
        Intrinsics.checkNotNullParameter(ad, "ad");
        A4 a43 = this.f53106j;
        String str8 = "TAG";
        String str9 = "w0";
        if (a43 != null) {
            ((B4) a43).c("w0", AbstractC0311i0.a("w0", "TAG", "initOmidForAd ", this));
        }
        Context t = t();
        AdConfig adConfig2 = this.f53098b;
        AdConfig.OmidConfig omidConfig = (adConfig2 == null || (viewability = adConfig2.getViewability()) == null) ? null : viewability.getOmidConfig();
        if (omidConfig == null || omidConfig.isOmidEnabled()) {
            AbstractC0208a9.f52330a.getClass();
            if (Omid.isActive()) {
                boolean z2 = ad instanceof R7;
                Set d2 = d(0);
                if (d2 != null) {
                    Iterator it = d2.iterator();
                    while (it.hasNext()) {
                        Fb fb = (Fb) it.next();
                        if (3 == fb.f51666a) {
                            Iterator it2 = it;
                            if ("video" == fb.f51667b.get("creativeType") && z2) {
                                R7 r7 = (R7) ad;
                                A4 a44 = this.f53106j;
                                if (a44 != null) {
                                    ((B4) a44).b(str9, AbstractC0311i0.a(str9, str8, "initOmidForNativeVideoAd ", this));
                                }
                                try {
                                    A4 a45 = this.f53106j;
                                    if (a45 != null) {
                                        Intrinsics.checkNotNullExpressionValue(str9, str8);
                                        ((B4) a45).a(str9, "Processing OMID meta data to bootstrap impression tracking for this ad response");
                                    }
                                    String str10 = r7.f52036a;
                                    String str11 = r7.f52037b;
                                    z = z2;
                                    try {
                                        String str12 = r7.f52038c;
                                        str3 = str8;
                                        try {
                                            List list = r7.f52039d;
                                            List list2 = r7.f52040e;
                                            str4 = str9;
                                            try {
                                                AdConfig adConfig3 = this.f53098b;
                                                Intrinsics.e(adConfig3);
                                                C0309hc c0309hc = new C0309hc(str10, str11, str12, list, list2, adConfig3.getVastVideo());
                                                byte J = J();
                                                String L2 = L();
                                                Intrinsics.e(L2);
                                                JSONObject pubContent2 = new JSONObject(L2);
                                                AdConfig adConfig4 = this.f53098b;
                                                Intrinsics.e(adConfig4);
                                                C0227c0 c0227c0 = this.u;
                                                HashMap a2 = c0227c0 == null ? null : K8.a(c0227c0.h());
                                                A4 a46 = this.f53106j;
                                                Intrinsics.checkNotNullParameter(pubContent2, "pubContent");
                                                Intrinsics.checkNotNullParameter(adConfig4, "adConfig");
                                                c0332j7 = new C0332j7(J, pubContent2, null, false, adConfig4, a2, c0309hc, a46);
                                                Object obj = c0332j7.n("VIDEO").get(0);
                                                Intrinsics.f(obj, "null cannot be cast to non-null type com.inmobi.ads.modelsv2.NativeVideoAsset");
                                                w7 = (W7) obj;
                                            } catch (Exception e2) {
                                                e = e2;
                                                str = str3;
                                                str6 = str4;
                                            }
                                        } catch (Exception e3) {
                                            e = e3;
                                            str6 = str9;
                                            str = str3;
                                        }
                                    } catch (Exception e4) {
                                        e = e4;
                                        str = str8;
                                        str6 = str9;
                                    }
                                } catch (Exception e5) {
                                    e = e5;
                                    str = str8;
                                    str6 = str9;
                                    z = z2;
                                }
                                if (t != null) {
                                    ArrayList verificationScriptResources = new ArrayList();
                                    Iterator it3 = w7.s.iterator();
                                    while (it3.hasNext()) {
                                        P7 p7 = (P7) it3.next();
                                        if (Intrinsics.c("OMID_VIEWABILITY", p7.f51998c) && (p7 instanceof U8)) {
                                            Map map = (Map) fb.a("macros", Map.class);
                                            String a3 = C0353l0.a(((U8) p7).f52126h, map);
                                            String str13 = ((U8) p7).f52127i;
                                            String a5 = C0353l0.a(p7.f52000e, map);
                                            if (AbstractC0229c2.a(a3) && AbstractC0229c2.a(str13)) {
                                                createVerificationScriptResourceWithoutParameters2 = VerificationScriptResource.createVerificationScriptResourceWithParameters(str13, new URL(a5), a3);
                                                Intrinsics.e(createVerificationScriptResourceWithoutParameters2);
                                            } else {
                                                createVerificationScriptResourceWithoutParameters2 = VerificationScriptResource.createVerificationScriptResourceWithoutParameters(new URL(a5));
                                                Intrinsics.e(createVerificationScriptResourceWithoutParameters2);
                                            }
                                            verificationScriptResources.add(createVerificationScriptResourceWithoutParameters2);
                                        }
                                    }
                                    if (verificationScriptResources.size() != 0) {
                                        W6 a6 = a(c0332j7);
                                        if (a6 != null) {
                                            fb.f51667b.put("videoSkippable", Boolean.TRUE);
                                            fb.f51667b.put("videoSkipOffset", Integer.valueOf(a6.f52196n));
                                        } else {
                                            fb.f51667b.put("videoSkippable", Boolean.FALSE);
                                            fb.f51667b.put("videoSkipOffset", 0);
                                        }
                                        HashMap hashMap = fb.f51667b;
                                        Object obj2 = w7.t.get("shouldAutoPlay");
                                        Intrinsics.f(obj2, "null cannot be cast to non-null type kotlin.Any");
                                        hashMap.put("videoAutoPlay", obj2);
                                        HashMap hashMap2 = fb.f51667b;
                                        String e6 = this.t.e();
                                        String str14 = (String) fb.f51667b.get("creativeType");
                                        Intrinsics.checkNotNullParameter(verificationScriptResources, "verificationScriptResources");
                                        C0222b9 c0222b9 = AbstractC0208a9.f52330a;
                                        c0222b9.getClass();
                                        Intrinsics.checkNotNullParameter(verificationScriptResources, "verificationScriptResources");
                                        Context d3 = Ha.d();
                                        if (d3 != null) {
                                            str7 = new C0402o9(d3, "omid_js_store").a("omid_js_string");
                                            if (str7 == null) {
                                                str7 = null;
                                            }
                                        }
                                        str7 = ";(function(omidGlobal) {\n  'use strict';var n;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function p(a){var b='undefined'!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function q(a){if(!(a instanceof Array)){a=p(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ba='function'==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ca;\nif('function'==typeof Object.setPrototypeOf)ca=Object.setPrototypeOf;else{var da;a:{var ea={S:!0},fa={};try{fa.__proto__=ea;da=fa.S;break a}catch(a){}da=!1}ca=da?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+' is not extensible');return a}:null}var ha=ca;\nfunction r(a,b){a.prototype=ba(b.prototype);a.prototype.constructor=a;if(ha)ha(a,b);else for(var c in b)if('prototype'!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c]}function ia(a){a=['object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}return globalThis}\nvar t=ia(this),v='function'==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function x(a,b){if(b){var c=t;a=a.split('.');for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&v(c,a,{configurable:!0,writable:!0,value:b})}}x('globalThis',function(a){return a||t});function y(a,b){return Object.prototype.hasOwnProperty.call(a,b)}\nvar ja='function'==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)y(d,e)&&(a[e]=d[e])}return a};x('Object.assign',function(a){return a||ja});function ka(){ka=function(){};t.Symbol||(t.Symbol=la)}function ma(a,b){this.a=a;v(this,'description',{configurable:!0,writable:!0,value:b})}ma.prototype.toString=function(){return this.a};\nvar la=function(){function a(c){if(this instanceof a)throw new TypeError('Symbol is not a constructor');return new ma('jscomp_symbol_'+(c||'')+'_'+b++,c)}var b=0;return a}();function z(){ka();var a=t.Symbol.iterator;a||(a=t.Symbol.iterator=t.Symbol('Symbol.iterator'));'function'!=typeof Array.prototype[a]&&v(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return na(aa(this))}});z=function(){}}function na(a){z();a={next:a};a[t.Symbol.iterator]=function(){return this};return a}\nx('WeakMap',function(a){function b(h){this.a=(g+=Math.random()+1).toString();if(h){h=p(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}function c(){}function d(h){var k=typeof h;return'object'===k&&null!==h||'function'===k}function e(h){if(!y(h,l)){var k=new c;v(h,l,{value:k})}}function f(h){var k=Object[h];k&&(Object[h]=function(m){if(m instanceof c)return m;e(m);return k(m)})}if(function(){if(!a||!Object.seal)return!1;try{var h=Object.seal({}),k=Object.seal({}),m=new a([[h,2],[k,\n3]]);if(2!=m.get(h)||3!=m.get(k))return!1;m.delete(h);m.set(k,4);return!m.has(h)&&4==m.get(k)}catch(u){return!1}}())return a;var l='$jscomp_hidden_'+Math.random();f('freeze');f('preventExtensions');f('seal');var g=0;b.prototype.set=function(h,k){if(!d(h))throw Error('Invalid WeakMap key');e(h);if(!y(h,l))throw Error('WeakMap key fail: '+h);h[l][this.a]=k;return this};b.prototype.get=function(h){return d(h)&&y(h,l)?h[l][this.a]:void 0};b.prototype.has=function(h){return d(h)&&y(h,l)&&y(h[l],this.a)};\nb.prototype.delete=function(h){return d(h)&&y(h,l)&&y(h[l],this.a)?delete h[l][this.a]:!1};return b});\nx('Map',function(a){function b(){var g={};return g.A=g.next=g.head=g}function c(g,h){var k=g.a;return na(function(){if(k){for(;k.head!=g.a;)k=k.A;for(;k.next!=k.head;)return k=k.next,{done:!1,value:h(k)};k=null}return{done:!0,value:void 0}})}function d(g,h){var k=h&&typeof h;'object'==k||'function'==k?f.has(h)?k=f.get(h):(k=''+ ++l,f.set(h,k)):k='p_'+h;var m=g.b[k];if(m&&y(g.b,k))for(g=0;g<m.length;g++){var u=m[g];if(h!==h&&u.key!==u.key||h===u.key)return{id:k,list:m,index:g,s:u}}return{id:k,list:m,\nindex:-1,s:void 0}}function e(g){this.b={};this.a=b();this.size=0;if(g){g=p(g);for(var h;!(h=g.next()).done;)h=h.value,this.set(h[0],h[1])}}if(function(){if(!a||'function'!=typeof a||!a.prototype.entries||'function'!=typeof Object.seal)return!1;try{var g=Object.seal({x:4}),h=new a(p([[g,'s']]));if('s'!=h.get(g)||1!=h.size||h.get({x:4})||h.set({x:4},'t')!=h||2!=h.size)return!1;var k=h.entries(),m=k.next();if(m.done||m.value[0]!=g||'s'!=m.value[1])return!1;m=k.next();return m.done||4!=m.value[0].x||\n't'!=m.value[1]||!k.next().done?!1:!0}catch(u){return!1}}())return a;z();var f=new WeakMap;e.prototype.set=function(g,h){g=0===g?0:g;var k=d(this,g);k.list||(k.list=this.b[k.id]=[]);k.s?k.s.value=h:(k.s={next:this.a,A:this.a.A,head:this.a,key:g,value:h},k.list.push(k.s),this.a.A.next=k.s,this.a.A=k.s,this.size++);return this};e.prototype.delete=function(g){g=d(this,g);return g.s&&g.list?(g.list.splice(g.index,1),g.list.length||delete this.b[g.id],g.s.A.next=g.s.next,g.s.next.A=g.s.A,g.s.head=null,\nthis.size--,!0):!1};e.prototype.clear=function(){this.b={};this.a=this.a.A=b();this.size=0};e.prototype.has=function(g){return!!d(this,g).s};e.prototype.get=function(g){return(g=d(this,g).s)&&g.value};e.prototype.entries=function(){return c(this,function(g){return[g.key,g.value]})};e.prototype.keys=function(){return c(this,function(g){return g.key})};e.prototype.values=function(){return c(this,function(g){return g.value})};e.prototype.forEach=function(g,h){for(var k=this.entries(),m;!(m=k.next()).done;)m=\nm.value,g.call(h,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var l=0;return e});x('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)y(b,d)&&c.push(b[d]);return c}});\nx('Set',function(a){function b(c){this.a=new Map;if(c){c=p(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.a.size}if(function(){if(!a||'function'!=typeof a||!a.prototype.entries||'function'!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(p([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||4!=f.value[0].x||\nf.value[1]!=f.value[0]?!1:e.next().done}catch(l){return!1}}())return a;z();b.prototype.add=function(c){c=0===c?0:c;this.a.set(c,c);this.size=this.a.size;return this};b.prototype.delete=function(c){c=this.a.delete(c);this.size=this.a.size;return c};b.prototype.clear=function(){this.a.clear();this.size=0};b.prototype.has=function(c){return this.a.has(c)};b.prototype.entries=function(){return this.a.entries()};b.prototype.values=function(){return this.a.values()};b.prototype.keys=b.prototype.values;\nb.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.a.forEach(function(f){return c.call(d,f,f,e)})};return b});x('Object.is',function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});x('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});\nx('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)y(b,d)&&c.push([d,b[d]]);return c}});\nvar A={qa:'loaded',xa:'start',ka:'firstQuartile',sa:'midpoint',ya:'thirdQuartile',ia:'complete',ta:'pause',va:'resume',ha:'bufferStart',ga:'bufferFinish',wa:'skipped',Aa:'volumeChange',ua:'playerStateChange',da:'adUserInteraction'},oa={na:'generic',za:'video',ra:'media'},pa={R:'native',oa:'html',P:'javascript'},qa={R:'native',P:'javascript',NONE:'none'},sa={ma:'full',ja:'domain',pa:'limited'},ta={fa:'backgrounded',la:'foregrounded'},ua={ea:'app',Ba:'web'};function B(a,b){this.x=null!=a.x?a.x:a.left;this.y=null!=a.y?a.y:a.top;this.width=a.width;this.height=a.height;this.endX=this.x+this.width;this.endY=this.y+this.height;this.adSessionId=a.adSessionId||void 0;this.isFriendlyObstructionFor=a.isFriendlyObstructionFor||[];this.b=a.friendlyObstructionClass||void 0;this.c=a.friendlyObstructionPurpose||void 0;this.f=a.friendlyObstructionReason||void 0;this.clipsToBounds=void 0!==a.clipsToBounds?!0===a.clipsToBounds:!0;this.g=void 0!==a.hasWindowFocus?!0===\na.hasWindowFocus:!0;this.notVisibleReason=a.notVisibleReason||void 0;this.childViews=a.childViews||[];this.isCreative=a.isCreative||!1;this.a=b}function va(a){var b={};return b.width=a.width,b.height=a.height,b}function C(a){var b={};return Object.assign({},va(a),(b.x=a.x,b.y=a.y,b))}function wa(a){var b=C(a),c={};return Object.assign({},b,(c.endX=a.endX,c.endY=a.endY,c))}function xa(a,b,c){a.x+=b;a.y+=c;a.endX+=b;a.endY+=c}\nB.prototype.J=function(a){if(null==a)return!1;a=C(a);var b=a.y,c=a.width,d=a.height;return this.x===a.x&&this.y===b&&this.width===c&&this.height===d};function ya(a){return a.width*a.height}function za(a){return 0===a.width||0===a.height};function Aa(a,b){var c=0;if(0<b.length){var d=Ba(a,b);a=d.ba;d=d.ca;for(var e=0;e<a.length-1;e++)for(var f=(a[e]+(a[e]+1))/2,l=a[e+1]-a[e],g=0;g<d.length-1;g++){for(var h=(d[g]+(d[g]+1))/2,k=d[g+1]-d[g],m=!1,u=0;u<b.length;u++){var w=C(b[u]);if(w.x<f&&w.x+w.width>f&&w.y<h&&w.y+w.height>h){m=!0;break}}m&&(c+=Math.round(l)*Math.round(k))}}return c}\nfunction Ba(a,b){a=C(a);for(var c=[],d=[],e=0;e<b.length;e++){var f=C(b[e]);f=Ca(a,f);Da(c,f.x);Da(c,f.endX);Da(d,f.y);Da(d,f.endY)}c=c.sort(function(l,g){return l-g});d=d.sort(function(l,g){return l-g});return{ba:c,ca:d}}function Ca(a,b){return{x:Math.max(a.x,b.x),y:Math.max(a.y,b.y),endX:Math.min(a.x+a.width,b.x+b.width),endY:Math.min(a.y+a.height,b.y+b.height)}}function Da(a,b){-1===a.indexOf(b)&&a.push(b)};function Ea(){this.b=this.a=this.v=this.l=this.g=this.j=void 0;this.m=0;this.h=[];this.o=[];this.u=0;this.i=[];this.c=[];this.f=[]}Ea.prototype.J=function(a){return null==a?!1:JSON.stringify(Fa(this))===JSON.stringify(Fa(a))};\nfunction Fa(a){var b=[],c=[],d={viewport:a.j,adView:{percentageInView:a.m,pixelsInView:a.u,reasons:a.f},declaredFriendlyObstructions:a.h.length};if(void 0!==a.a){d.adView.geometry=C(a.a);d.adView.geometry.pixels=ya(a.a);d.adView.onScreenGeometry=C(a.b);d.adView.onScreenGeometry.pixels=Math.max(0,ya(a.b)-Aa(a.b,a.c));for(var e=0;e<a.c.length;e++)b.push(C(a.c[e]));for(e=0;e<a.o.length;e++){var f=a.o[e],l=f,g={};l.b&&(g.obstructionClass=l.b);l.c&&(g.obstructionPurpose=l.c);l.f&&(g.obstructionReason=\nl.f);f=Ca(a.a,f);c.push(Object.assign({},{x:f.x,y:f.y,width:f.endX-f.x,height:f.endY-f.y},g))}d.adView.onScreenGeometry.obstructions=b;d.adView.onScreenGeometry.friendlyObstructions=c;void 0!==a.l&&void 0!==a.v&&(d.adView.containerGeometry=C(a.l),d.adView.onScreenContainerGeometry=C(a.v),d.adView.measuringElement=!0)}return d}function Ga(a,b){b=va(b);a.j={};a.j.width=b.width;a.j.height=b.height;a.g={};a.g.x=0;a.g.y=0;a.g.width=b.width;a.g.height=b.height;a.g.endX=b.width;a.g.endY=b.height}\nfunction Ha(){return{x:0,y:0,endX:0,endY:0,width:0,height:0}}function Ia(a,b){var c={};c.x=Math.max(a.x,b.x);c.y=Math.max(a.y,b.y);c.endX=Math.min(a.endX,b.endX);c.endY=Math.min(a.endY,b.endY);c.width=Math.max(0,c.endX-c.x);c.height=Math.max(0,c.endY-c.y);return c}function Ja(a,b){return.01<b.width-a.width||.01<b.height-a.height}function Ka(a){if(-1!==a.f.indexOf('backgrounded'))a.m=0,a.u=0;else{var b=ya(a.a);if(0!==b){var c=Math.max(0,ya(a.b)-Aa(a.b,a.c));a.m=Math.round(c/b*100);a.u=c}}}\nfunction La(a,b){if(za(b)||!a.b)b=!1;else{var c=wa(a.b),d=c.y,e=c.endX;a=c.endY;var f=b.endX;c=c.x;(f=f<c||.01>Math.abs(f-c))||(f=b.x,f=f>e||.01>Math.abs(f-e));(e=f)||(e=b.endY,e=e<d||.01>Math.abs(e-d));(d=e)||(b=b.y,d=b>a||.01>Math.abs(b-a));b=!d}return b}function D(a,b){for(var c=!1,d=0;d<a.f.length;d++)a.f[d]===b&&(c=!0);c||a.f.push(b)};function Ma(a,b,c,d,e){var f=new Ea;b=new B(b,!1);Ga(f,b);Na(a,b,f,d);if(!e)return f.f=['unmeasurable'],f.j=void 0,f.m=0,f.c=[],f.a&&(a=f.a,c={},a=new B((c.x=0,c.y=0,c.width=a.width,c.height=a.height,c),a.a),f.a=a),f.b=Ha(),f;if('backgrounded'===c)D(f,'backgrounded');else if(void 0!==f.a){for(a=0;a<f.h.length;a++)La(f,f.h[a])&&f.o.push(f.h[a]);for(a=0;a<f.i.length;a++){if(c=La(f,f.i[a])){a:{c=f.i[a];for(d=0;d<f.c.length;d++)if(f.c[d].J(c)){c=!0;break a}c=!1}c=!c}c&&(D(f,'obstructed'),f.c.push(f.i[a]))}Ka(f)}else D(f,\n'notFound');return f}\nfunction Na(a,b,c,d){var e=b.isCreative?!0:b.adSessionId===d;if(e){c.a=b;var f=wa(c.a);a=Ia(c.g,f);var l=c.a;'notAttached'===l.notVisibleReason||'noWindowFocus'===l.notVisibleReason||'noAdView'===l.notVisibleReason?(D(c,'notFound'),c.b=new B(Ha(),!1)):(l=c.a,'viewInvisible'===l.notVisibleReason||'viewGone'===l.notVisibleReason||'viewNotVisible'===l.notVisibleReason||'viewAlphaZero'===l.notVisibleReason||'viewHidden'===l.notVisibleReason||void 0!==c.a.notVisibleReason||za(c.a)?(D(c,'hidden'),c.b=new B(Ha(),\n!1)):(c.a.g||(D(c,'backgrounded'),D(c,'noWindowFocus')),Ja(a,f)&&D(c,'clipped'),c.b=new B(a,!1)))}else if(f=!0,b.a&&(f=-1!==b.isFriendlyObstructionFor.indexOf(d)?!1:!1===b.clipsToBounds),f){l=b.childViews;for(var g=0;g<l.length;g++)f=void 0!==c.a,Na(a,new B(l[g],f),c,d)}e||void 0===c.a||(b.a?-1!==b.isFriendlyObstructionFor.indexOf(d)?c.h.push(b):c.i.push(b):(e=wa(b),d=wa(c.b),C(c.b),!za(c.b)&&b.clipsToBounds&&(b=Ia(d,e),Ja(b,d)&&(D(c,'clipped'),c.b=new B(b,!1)))))};function Oa(a,b){this.y=this.x=0;this.width=a;this.height=b};function Pa(){return{apiVersion:'1.0',accessMode:'limited',environment:'app',omidJsInfo:{omidImplementer:'omsdk',serviceVersion:'1.3.37-iab3566'}}}function Qa(){this.adSessionId=null;this.c=Pa();this.o=null;this.m='foregrounded';this.l=this.i='none';this.j=this.g=this.f=this.h=this.a=this.b=this.B=this.u=null;this.C=!0;this.v=new Map}var G;function H(){G||(G=new Qa);return G};var I=function(){if('undefined'!==typeof omidGlobal&&omidGlobal)return omidGlobal;if('undefined'!==typeof global&&global)return global;if('undefined'!==typeof window&&window)return window;if('undefined'!==typeof globalThis&&globalThis)return globalThis;var a=Function('return this')();if(a)return a;throw Error('Could not determine global object context.');}();function Ra(a,b){this.a=a;this.b=b}t.Object.defineProperties(Ra.prototype,{event:{configurable:!0,enumerable:!0,get:function(){return this.a}},origin:{configurable:!0,enumerable:!0,get:function(){return this.b}}});function J(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];Sa(function(){throw new (Function.prototype.bind.apply(Error,[null,'Could not complete the test successfully - '].concat(q(b))));},function(){return console.error.apply(console,q(b))})}function Ta(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];Sa(function(){},function(){return console.error.apply(console,q(b))})}\nfunction Sa(a,b){'undefined'!==typeof jasmine&&jasmine?a():'undefined'!==typeof console&&console&&console.error&&b()};function Ua(){this.f=[];this.b=[];this.c=[];this.g=[];this.i={};this.a=H()}function Va(a){a.f=[];a.b=[];a.c=[];a.g=[];a.i={};G.adSessionId=null;G.c=Pa();G.o=null;G.G=void 0;G.K=void 0;G.H=null;G.I=null;G.D=null;G.m='foregrounded';G.i='none';G.l='none';G.u=null;G.B=null;G.b=null;G.a=null;G.h=null;G.f=null;G.g=null;G.j=null;G.C=!0;G.v=new Map}\nfunction Wa(a,b){void 0!==a.a&&a.a.adSessionId&&!1!==Xa(a,b)&&a.c.filter(function(c){return c.type===b.event.type}).forEach(function(c){return a.h(c.F,b.event)})}function Ya(a,b){a.f.push(b);Wa(a,b)}function Za(a,b,c){void 0!==a.a&&a.a.adSessionId&&a.f.filter(function(d){return d.event.type===b&&Xa(a,d)}).map(function(d){return d.event}).forEach(c)}\nfunction Xa(a,b){var c=b.event.type,d=-1!==Object.values(A).indexOf(c)&&'volumeChange'!==c;return'impression'===c||'loaded'===c&&a.a.a?b.origin===H().l:d?b.origin===H().i:!0}function $a(a,b,c){'media'===b||'video'===b?ab(a,c):(a.c.push({type:b,F:c}),Za(a,b,c))}function ab(a,b){Object.keys(A).forEach(function(c){c=A[c];a.c.push({type:c,F:b});Za(a,c,b)})}function bb(a,b,c,d){var e={O:c,L:d,F:b};a.g.push(e);a.b.forEach(function(f){var l=cb(f);'sessionStart'===f.event.type&&db(a,l,e);a.h(b,l)})}\nfunction eb(a,b,c){var d=K(a,'sessionError','native',{errorType:b,message:c});a.b.push(d);a.g.forEach(function(e){a.h(e.F,d.event)})}function fb(a,b){a.i=Object.assign(a.i,b);b=a.a.c;if(void 0!==b){b=Object.assign({},gb(a,hb(a,{context:b}),!0),{supportsLoadedEvent:!!a.a.a||'video'==a.a.b});Object.assign(b,{pageUrl:null,contentUrl:a.a.o});var c=K(a,'sessionStart','native',b);a.b.push(c);a.g.forEach(function(d){var e=d.F,f=cb(c);db(a,f,d);a.h(e,f)},a);ib(a)}}\nfunction db(a,b,c){c.O&&(b.data.verificationParameters=a.i[c.O]);c.L&&(c=a.a.v.get(c.L))&&(b.data.verificationParameters=c.verificationParameters,b.data.context.accessMode=c.accessMode,'full'===c.accessMode&&(a.a.g&&(b.data.context.videoElement=a.a.g),a.a.f&&(b.data.context.slotElement=a.a.f)))}function jb(a){var b=a.g,c=K(a,'sessionFinish','native');a.b.push(c);var d=a.a.c;d&&'native'==d.adSessionType||Va(a);b.forEach(function(e){return a.h(e.F,c.event)})}\nUa.prototype.h=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];try{a.apply(null,q(c))}catch(e){Ta(e)}};function kb(a,b){var c=(c=H().D)?Fa(c):void 0;c=gb(a,hb(a,c));Ya(a,K(a,'impression',b,c))}function lb(a,b,c){if(a.a.a||'display'!=a.a.b)b=K(a,'loaded',b,gb(a,hb(a,void 0===c?null:c))),Ya(a,b)}\nfunction mb(a,b,c,d){'start'!==b&&'volumeChange'!==b||null!=(d&&d.deviceVolume)||(d.deviceVolume=a.a.u);if(d&&('start'===b||'volumeChange'===b)){var e=d.videoPlayerVolume,f=d.mediaPlayerVolume;null!=e?(Object.assign(d,{mediaPlayerVolume:e}),a.a.B=e):null!=f&&(Object.assign(d,{videoPlayerVolume:f}),a.a.B=f)}Ya(a,K(a,b,c,d))}\nfunction ib(a){var b=a.f.filter(function(f){return Object.values(A).includes(f.event.type)&&'video'==a.a.b&&f.origin===a.a.i||'loaded'==f.event.type&&'display'==a.a.b&&f.origin===a.a.l?!0:!1}).map(function(f){return f.event}),c=a.a.adSessionId||'',d={};b=p(b);for(var e=b.next();!e.done;d={w:d.w},e=b.next()){d.w=e.value;d.w.adSessionId||(d.w.adSessionId=c);if('loaded'==d.w.type){if(!a.a.a&&'display'==a.a.b)continue;d.w.data=gb(a,hb(a,d.w.data))}a.c.filter(function(f){return function(l){return l.type===\nf.w.type}}(d)).forEach(function(f){return function(l){return l.F(f.w)}}(d))}}function nb(a,b,c){a:{c=new Set(c);a=p(a.f.concat(a.b));for(var d=a.next();!d.done;d=a.next())if(d=d.value,c.has(d.event.type)&&d.origin!=b){b=!0;break a}b=!1}return b?(J('Event owner cannot be registered after its events have already been published.'),!1):!0}function ob(a,b){nb(a,b,Object.values(A))&&L(a,b)&&(a.a.i=b)}function pb(a,b){nb(a,b,['impression'])&&qb(a,b)&&(a.a.l=b)}\nfunction qb(a,b){var c=a.a.l;return'none'!=c&&c!=b?(J('Impression event is owned by '+(a.a.l+', not ')+(b+'.')),!1):!0}function L(a,b){var c=a.a.i;return'none'!=c&&c!=b?(J('Media events are owned by '+(a.a.i+', not '+b+'.')),!1):!0}function gb(a,b,c){c=void 0===c?!1:c;b=Object.assign({},b);a.a.b&&Object.assign(b,{mediaType:a.a.b});a.a.a&&(c||'definedByJavaScript'!==a.a.a)&&Object.assign(b,{creativeType:a.a.a});return b}function hb(a,b){return a.a.h?Object.assign({},b,{impressionType:a.a.h}):b}\nfunction K(a,b,c,d){return new Ra({adSessionId:a.a.adSessionId||'',timestamp:(new Date).getTime(),type:b,data:d},c)}function cb(a){a=a.event;return{adSessionId:a.adSessionId,timestamp:a.timestamp,type:a.type,data:a.data}};function rb(a,b,c){'container'===b&&void 0!==a.a.G&&void 0!==a.a&&null!=a.a.adSessionId&&(a.a.H=Ma(a.c,a.a.G,a.a.m,a.a.adSessionId,!0));b=a.a;var d=b.H,e=b.I;if(d)if(e){b=new Ea;var f=d.j,l=d.a,g=d.b,h=e.a,k=e.b;f&&l&&g&&h&&k&&(Ga(b,f),b.l=new B(l,!1),b.v=new B(g,!1),b.i=Object.assign([],d.i),b.c=Object.assign([],d.c),b.h=Object.assign([],d.h),b.o=Object.assign([],d.o),b.f=Object.assign([],e.f,d.f),d=b.l.x,e=b.l.y,h=new B(h,!1),k=new B(k,!1),xa(h,d,e),xa(k,d,e),b.a=h,b.b=Ia(k,g),Ka(b))}else b=d;else b=\nnull;g=a.a.D;if(b&&!b.J(g)||c)g=Fa(b),c&&(g.adView.reasons=g.adView.reasons||[c]),c=a.b,'audio'!=c.a.a&&Ya(c,K(c,'geometryChange','native',g)),a.a.D=b};function M(a){return'object'===typeof a}function sb(a){return'number'===typeof a&&!isNaN(a)&&0<=a}function N(a){return'string'===typeof a}function O(a,b){return N(a)&&-1!==Object.values(b).indexOf(a)}function tb(a){return!(!a||!a.tagName||'iframe'!==a.tagName.toLowerCase())};function P(a,b,c){this.f=a;this.K=b;this.G=c;this.c=H();this.b=null;this.a=this.g=this.u=void 0;this.I=!0;this.B=void 0;Q(this)}function Q(a){if(!a.b){var b;a:{if((b=a.f.document)&&b.getElementsByClassName&&(b=b.getElementsByClassName('omid-element'))){if(1==b.length){b=b[0];break a}1<b.length&&a.I&&(eb(a.G,'generic',\"More than one element with 'omid-element' class name.\"),a.I=!1)}b=null}if(b&&b.tagName&&'video'===b.tagName.toLowerCase())a.c.g=b;else if(b&&b.tagName)a.c.f=b;else return;ub(a)}}\nfunction ub(a){a.c.g?(a.b=a.c.g,a.i()):a.c.f&&(a.b=a.c.f,tb(a.b)?a.c.j&&a.i():a.i())}function vb(a){a.a&&(tb(a.b)?a.c.j&&(a.D(),wb(a)):(a.D(),wb(a)))}P.prototype.m=function(){this.B&&(this.f.document.removeEventListener('visibilitychange',this.B),this.B=void 0)};P.prototype.i=function(){};function wb(a){a.u&&(a.c.I=a.u,rb(a.K,'creative'))}function xb(a){if(a.a&&a.c.j){var b=new B(a.c.j,!1);xa(b,a.a.x,a.a.y);b.clipsToBounds=!0;return b}};function yb(a,b,c){return zb(a,'setInterval')(b,c)}function Ab(a,b){zb(a,'clearInterval')(b)}function Bb(a,b){zb(a,'clearTimeout')(b)}function zb(a,b){return a.a&&a.a[b]?a.a[b]:Cb(a,b)}\nfunction Db(a,b,c,d){if(a.a.document&&a.a.document.body){var e=a.a.document.createElement('img');e.width=1;e.height=1;e.style.display='none';e.src=b;c&&e.addEventListener('load',function(){return c()});d&&e.addEventListener('error',function(){return d()});a.a.document.body.appendChild(e)}else Cb(a,'sendUrl')(b,c,d)}function Cb(a,b){if(a.a&&a.a.omidNative&&a.a.omidNative[b])return a.a.omidNative[b].bind(a.a.omidNative);throw Error('Native interface method \"'+b+'\" not found.');};function R(a,b,c,d,e){P.call(this,a,c,e);this.l=b;this.h=void 0;this.j=d}r(R,P);R.prototype.m=function(){void 0!==this.h&&(Ab(this.j,this.h),this.h=void 0);P.prototype.m.call(this)};R.prototype.i=function(){var a=this;P.prototype.i.call(this);null==this.b?this.h=void 0:void 0===this.h&&(this.h=yb(this.j,function(){return Eb(a)},200),Eb(this))};\nR.prototype.D=function(){if(this.g){var a=xb(this);if(a){this.a.isCreative=!1;a.isCreative=!0;for(var b=!1,c=0;c<this.a.childViews.length;c++)if(this.a.childViews[c].isCreative){this.a.childViews[c]=a;b=!0;break}b||this.a.childViews.push(a)}else this.a.isCreative=!0;this.u=Ma(this.l,this.g,this.c.m,this.c.adSessionId,this.C())}};R.prototype.C=function(){return!0};\nfunction Eb(a){if(void 0!==a.h){b:{try{var b=a.f.top;var c=0<=b.innerHeight&&0<=b.innerWidth;break b}catch(d){}c=!1}c?(c=a.f.top,c=new B(new Oa(c.innerWidth,c.innerHeight),!1)):c=new B(new Oa(0,0),!1);b=a.b.getBoundingClientRect();if(null==b.x||isNaN(b.x))b.x=b.left;if(null==b.y||isNaN(b.y))b.y=b.top;b=new B(b,!1);c.J(a.g)&&b.J(a.a)||(a.a=b,a.a.clipsToBounds=!0,a.g=c,a.g.childViews.push(a.a),vb(a))}};function S(a,b,c,d){P.call(this,a,c,d);this.o=this.j=this.l=this.h=void 0;this.H=!1;this.v=void 0}r(S,P);S.prototype.m=function(){this.h&&this.h.disconnect();Fb(this);P.prototype.m.call(this)};S.prototype.i=function(){P.prototype.i.call(this);this.b&&(this.h||(this.h=Gb(this)),Hb(this),Ib(this.b)&&Jb(this))};\nS.prototype.D=function(){if(this.a&&this.v){var a=xb(this);if(a){var b=a;var c=this.v;var d=Math.max(a.x,c.x);var e=Math.max(a.y,c.y),f=Math.min(a.endX,c.endX);a=Math.min(a.endY,c.endY);f<=d||a<=e?d=null:(c={},d=new B((c.x=d,c.y=e,c.width=Math.abs(f-d),c.height=Math.abs(a-e),c),!1));d||(d=new B({x:0,y:0,width:0,height:0},!1))}else b=this.a,d=this.v;e=new Ea;this.g&&Ga(e,this.g);e.a=b;e.b=d;Ka(e);this.H?za(e.a)?D(e,'hidden'):100===e.m||D(e,'clipped'):D(e,'viewport');this.u=e}};S.prototype.C=function(){return!0};\nfunction Fb(a){a.l&&(a.l.disconnect(),a.l=void 0);a.j&&(a.j.disconnect(),a.j=void 0);a.o&&((0,a.f.removeEventListener)('resize',a.o),a.o=void 0)}function Hb(a){a.h&&a.b&&(a.h.unobserve(a.b),a.h.observe(a.b))}function Ib(a){a=a.getBoundingClientRect();return 0==a.width||0==a.height}\nfunction Gb(a){return new a.f.IntersectionObserver(function(b){try{if(b.length){for(var c,d=b[0],e=1;e<b.length;e++)b[e].time>d.time&&(d=b[e]);c=d;a.g=Kb(c.rootBounds);a.a=Kb(c.boundingClientRect);a.v=Kb(c.intersectionRect);a.H=!!c.isIntersecting;vb(a)}}catch(f){a.m(),eb(a.G,'generic','Problem handling IntersectionObserver callback: '+f.message)}},{root:null,rootMargin:'0px',threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]})}\nfunction Jb(a){a.f.ResizeObserver?a.l||(a.l=Lb(a,function(){return Mb(a)}),a.l.observe(a.b)):(a.o||(a.o=function(){return Mb(a)},(0,a.f.addEventListener)('resize',a.o)),a.j||(a.j=new MutationObserver(function(){return Mb(a)}),a.j.observe(a.b,{childList:!1,attributes:!0,subtree:!1})))}function Mb(a){a.b&&!Ib(a.b)&&(Hb(a),Fb(a))}function Lb(a,b){return new a.f.ResizeObserver(b)}function Kb(a){if(a&&null!==a.x&&null!==a.y&&null!==a.width&&null!==a.height)return new B(a,!1)};function Nb(a){return a&&M(a)?Object.entries(a).reduce(function(b,c){var d=p(c);c=d.next().value;d=d.next().value;return b&&N(c)&&null!=d&&M(d)&&N(d.resourceUrl)},!0):!1};function T(a,b,c,d){this.b=a;this.method=b;this.version=c;this.a=d}function Pb(a){return!!a&&void 0!==a.omid_message_guid&&void 0!==a.omid_message_method&&void 0!==a.omid_message_version&&'string'===typeof a.omid_message_guid&&'string'===typeof a.omid_message_method&&'string'===typeof a.omid_message_version&&(void 0===a.omid_message_args||void 0!==a.omid_message_args)}function Qb(a){return new T(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_args)}\nfunction Rb(a){var b={};b=(b.omid_message_guid=a.b,b.omid_message_method=a.method,b.omid_message_version=a.version,b);void 0!==a.a&&(b.omid_message_args=a.a);return b};function Sb(a){this.c=a};function U(a){this.c=a;this.handleExportedMessage=U.prototype.f.bind(this)}r(U,Sb);U.prototype.b=function(a,b){b=void 0===b?this.c:b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.handleExportedMessage(Rb(a),this)};U.prototype.f=function(a,b){Pb(a)&&this.a&&this.a(Qb(a),b)};function Tb(a){return Ub(a,'SessionService.')}function Ub(a,b){return(a=a.match(new RegExp('^'+b+'(.*)')))&&a[1]};function Vb(a,b){this.c=b=void 0===b?I:b;var c=this;a.addEventListener('message',function(d){if('object'===typeof d.data){var e=d.data;Pb(e)&&d.source&&c.a&&c.a(Qb(e),d.source)}})}r(Vb,Sb);Vb.prototype.b=function(a,b){b=void 0===b?this.c:b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.postMessage(Rb(a),'*')};function Wb(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(a){var b=16*Math.random()|0;return'y'===a?(b&3|8).toString(16):b.toString(16)})};function Xb(a){if(!a.a||!a.a.document)throw Error('OMID Service Script is not running within a window.');var b=a.b;a.b=[];b.forEach(function(c){try{var d=a.c.C?'limited':'full',e=O(c.accessMode,sa)?c.accessMode:null;var f=e?'full'==e&&'limited'==d?d:'domain'==e?'limited':e:d;c.accessMode=f;a:{var l=c.resourceUrl,g=a.a.location.origin;try{var h=new URL(l,g);break a}catch(V){}try{h=new URL(l);break a}catch(V){}h=null}if(d=h){var k=Wb(),m=a.a.document,u=m.createElement('iframe');u.id='omid-verification-script-frame-'+\nk;u.style.display='none';['full','limited'].includes(f)?u.srcdoc=\"<html><head>\\n<script type=\\\"text/javascript\\\">window['omidVerificationProperties'] = {\\n'serviceWindow': window.parent,\\n'injectionSource': 'app',\\n'injectionId': '\"+(k+'\\',\\n};\\x3c/script>\\n<script type=\"text/javascript\" src=\"')+d.href+'\">\\x3c/script>\\n</head><body></body></html>':'domain'==f&&(u.src=Yb(a,k,d).href);['domain','limited'].includes(f)&&(u.sandbox='allow-scripts');m.body.appendChild(u);var w=c.vendorKey,E=c.verificationParameters;\nw=void 0===w?'':w;E=void 0===E?'':E;w&&'string'===typeof w&&''!==w&&E&&'string'===typeof E&&''!==E&&(a.f.i[w]=E);a.c.v.set(k,c)}}catch(V){Ta('OMID verification script '+c.resourceUrl+' failed to load: '+V)}})}\nfunction Yb(a,b,c){var d='/.well-known/omid/omloader-v1.html#';(new Map([['verificationScriptUrl',c.href],['injectionId',b]])).forEach(function(e,f){d+=encodeURIComponent(f)+'='+encodeURIComponent(e)+'&'});b=null;try{b=new URL(d,a.a.parent.location.origin)}catch(e){throw Error('OMID Service Script cannot access the parent window.');}return b};function Zb(){var a=$b,b=ac,c=this;this.c=X;this.b=a;this.a=H();this.g=b;this.f=!1;this.registerSessionObserver(function(d){return bc(c,d)})}n=Zb.prototype;n.registerSessionObserver=function(a){bb(this.c,a)};n.setSlotElement=function(a){a&&a.tagName?(this.a.f=a,this.b&&ub(this.b)):J('setSlotElement called with a non-HTMLElement.  It will be ignored.')};n.setElementBounds=function(a){this.a.j=a;this.b&&ub(this.b);this.b&&vb(this.b)};n.error=function(a,b){eb(this.c,a,b)};\nn.registerAdEvents=function(){pb(this.c,'javascript')};n.registerMediaEvents=function(){ob(this.c,'javascript')};function Y(a,b,c){'impression'==b?qb(a.c,'javascript')&&(kb(a.c,'javascript'),a.b&&Q(a.b)):('loaded'==b?(c=void 0===c?null:c,L(a.c,'javascript')&&lb(a.c,'javascript',c)):L(a.c,'javascript')&&mb(a.c,b,'javascript',c),['loaded','start'].includes(b)&&a.b&&Q(a.b))}n.injectVerificationScriptResources=function(a){var b=this.g;b.b.push.apply(b.b,q(a));if(this.f)try{Xb(this.g)}catch(c){J(c.message)}};\nn.setCreativeType=function(a,b){b=void 0===b?null:b;if(!this.a.b||this.a.a)this.a.a=a,'video'==a||'audio'==a?this.a.b='video':'htmlDisplay'==a||'nativeDisplay'==a?this.a.b='display':'definedByJavaScript'==a&&b&&(this.a.b='none'==b?'display':'video')};n.setImpressionType=function(a){if(!this.a.b||this.a.a)this.a.h=a};\nfunction bc(a,b){if('sessionStart'===b.type){a.f=!0;try{Xb(a.g)}catch(c){J(c.message)}}'sessionFinish'===b.type&&(a.f=!1,(b=H().c)&&'native'==b.adSessionType||a.registerSessionObserver(function(c){return bc(a,c)}))}n.setClientInfo=function(a,b,c){var d=this.a.c||{};d.omidJsInfo=Object.assign({},d.omidJsInfo,{sessionClientVersion:a,partnerName:b,partnerVersion:c});this.a.c=d;return this.a.c.omidJsInfo.serviceVersion};function cc(a){return/\\d+\\.\\d+\\.\\d+(-.*)?/.test(a)}function dc(a){a=a.split('-')[0].split('.');for(var b=['1','0','3'],c=0;3>c;c++){var d=parseInt(a[c],10),e=parseInt(b[c],10);if(d>e)break;else if(d<e)return!1}return!0};function ec(a,b){return cc(a)&&dc(a)?b?b:[]:b&&'string'===typeof b?JSON.parse(b):[]};var fc=new function(){};function gc(){var a=hc;var b=void 0===b?omidGlobal:b;this.a=a;this.g=b;this.b=new U;this.g.omid=this.g.omid||{};this.g.omid.v1_SessionServiceCommunication=this.b;this.f=b&&b.addEventListener&&b.postMessage?new Vb(b):null;this.c=null;this.b.a=this.h.bind(this);this.f&&(this.f.a=this.i.bind(this))}gc.prototype.h=function(a,b){null!=Tb(a.method)&&ic(this,fc)&&jc(this,a,b,this.b)};gc.prototype.i=function(a,b){null!=Tb(a.method)&&ic(this,b)&&jc(this,a,b,this.f)};\nfunction ic(a,b){a.c||(a.c=b);return a.c!=b?(J('The source of session client messages cannot be changed from the source of the first message.'),!1):!0}\nfunction jc(a,b,c,d){function e(h){for(var k=[],m=0;m<arguments.length;++m)k[m]=arguments[m];k=new T(f,'response',g,cc(g)&&dc(g)?k:JSON.stringify(k));d.b(k,c)}var f=b.b,l=b.method,g=b.version;b=ec(g,b.a);try{kc(a,l,e,b)}catch(h){d.b(new T(f,'error',g,'\\n        name: '+h.name+'\\n        message: '+h.message+'\\n        filename: '+h.filename+'\\n        lineNumber: '+h.lineNumber+'\\n        columnNumber: '+h.columnNumber+'\\n        stack: '+h.stack+'\\n        toString(): '+h.toString()),c)}}\nfunction kc(a,b,c,d){if(null!=Tb(b))switch(Tb(b)){case 'registerAdEvents':a.a.registerAdEvents();break;case 'registerMediaEvents':a.a.registerMediaEvents();break;case 'registerSessionObserver':a.a.registerSessionObserver(c);break;case 'setSlotElement':c=p(d).next().value;a.a.setSlotElement(c);break;case 'setVideoElement':c=p(d).next().value;a=a.a;c&&c.tagName&&'video'===c.tagName.toLowerCase()?(a.a.g=c,a.b&&ub(a.b)):J('setVideoElement called with a non-HTMLVideoElement. It will be ignored.');break;\ncase 'setElementBounds':c=p(d).next().value;a.a.setElementBounds(c);break;case 'startSession':J('Session start from JS is not supported in mobile app.');break;case 'finishSession':J('Session finish from JS is not supported in mobile app.');break;case 'impressionOccurred':Y(a.a,'impression');break;case 'loaded':(c=p(d).next().value)?(b={skippable:c.isSkippable,autoPlay:c.isAutoPlay,position:c.position},c.isSkippable&&(b.skipOffset=c.skipOffset),Y(a.a,'loaded',b)):Y(a.a,'loaded');break;case 'start':b=\np(d);c=b.next().value;b=b.next().value;Y(a.a,'start',{duration:c,mediaPlayerVolume:b});break;case 'firstQuartile':Y(a.a,'firstQuartile');break;case 'midpoint':Y(a.a,'midpoint');break;case 'thirdQuartile':Y(a.a,'thirdQuartile');break;case 'complete':Y(a.a,'complete');break;case 'pause':Y(a.a,'pause');break;case 'resume':Y(a.a,'resume');break;case 'bufferStart':Y(a.a,'bufferStart');break;case 'bufferFinish':Y(a.a,'bufferFinish');break;case 'skipped':Y(a.a,'skipped');break;case 'volumeChange':c={mediaPlayerVolume:p(d).next().value};\nY(a.a,'volumeChange',c);break;case 'playerStateChange':c={state:p(d).next().value};Y(a.a,'playerStateChange',c);break;case 'adUserInteraction':c={interactionType:p(d).next().value};Y(a.a,'adUserInteraction',c);break;case 'setClientInfo':var e=p(d);b=e.next().value;d=e.next().value;e=e.next().value;a=a.a.setClientInfo(b,d,e);c(a);break;case 'injectVerificationScriptResources':c=p(d).next().value;a.a.injectVerificationScriptResources(c);break;case 'setCreativeType':c=p(d).next().value;a.a.setCreativeType(c);\nbreak;case 'setImpressionType':c=p(d).next().value;a.a.setImpressionType(c);break;case 'setContentUrl':c=p(d).next().value;a.a.a.o=c;break;case 'sessionError':b=p(d),c=b.next().value,b=b.next().value,a.a.error(c,b)}};function Z(){var a=X,b=lc,c=mc,d=$b;this.f=hc;this.a=a;this.c=b;this.h=c;this.g=d;this.b=H()}n=Z.prototype;\nn.T=function(a){if(!(!(a&&M(a)&&O(a.impressionOwner,qa))||'videoEventsOwner'in a&&null!=a.videoEventsOwner&&!O(a.videoEventsOwner,qa)||'mediaEventsOwner'in a&&null!=a.mediaEventsOwner&&!O(a.mediaEventsOwner,qa))){if(a.creativeType&&a.impressionType){var b=a.mediaEventsOwner;null==this.b.a&&this.f.setCreativeType(a.creativeType,b);null==this.b.h&&(this.b.h=a.impressionType);ob(this.a,b)}else b=a.videoEventsOwner,this.b.b=null==b||'none'===b?'display':'video',this.b.a=null,this.b.h=null,ob(this.a,b);\npb(this.a,a.impressionOwner);a&&null!=a.isolateVerificationScripts&&'boolean'===typeof a.isolateVerificationScripts&&(this.b.C=a.isolateVerificationScripts)}};\nn.W=function(a,b,c,d){var e;if(M(b)){if(e=O(b.environment,ua)&&O(b.adSessionType,pa))e=b.omidNativeInfo,e=M(e)?N(e.partnerName)&&N(e.partnerVersion):!1;e&&(e=b.app,e=M(e)?N(e.libraryVersion)&&N(e.appId):!1)}else e=!1;e&&(Nb(d)&&(this.b.v=new Map(Object.entries(d))),d=this.f,c=void 0===c?null:c,null==a&&(a=Wb()),b.canMeasureVisibility=d.b.C(),d.a.adSessionId=a,a=d.a,e=b,void 0!==e.contentUrl&&(a.o=e.contentUrl,e.contentUrl=void 0),e=a.c||{},b.omidJsInfo=Object.assign({},e.omidJsInfo||{},b.omidJsInfo||\n{}),e=b=Object.assign({},e,b),a.C||(null!=a.g?(e.videoElement=a.g,e.accessMode='full'):null!=a.f&&(e.slotElement=a.f,e.accessMode='full')),a.c=b,fb(d.c,c),d.b&&Q(d.b))};n.U=function(){var a=this.f;jb(a.c);a.b.m()};n.$=function(a){M(a)&&sb(a.x)&&sb(a.y)&&sb(a.width)&&sb(a.height)&&(this.b.G=a,rb(this.c,'container'))};n.aa=function(a){O(a,ta)&&(this.b.m=a,'backgrounded'===a?rb(this.c,'container','backgrounded'):rb(this.c,'container'))};n.X=function(a){'impression'===a&&(this.M(),this.g&&Q(this.g))};\nn.M=function(){qb(this.a,'native')&&kb(this.a,'native')};n.V=function(a){a=void 0===a?null:a;L(this.a,'native')&&lb(this.a,'native',a)};n.error=function(a,b){O(a,oa)&&eb(this.a,a,b)};n.Y=function(a,b){this.N(a,b)};n.N=function(a,b){L(this.a,'native')&&O(a,A)&&(void 0===b||M(b))&&('loaded'==a?lb(this.a,'native',b):mb(this.a,a,'native',b))};\nn.Z=function(a){if('none'!==this.a.a.i&&'number'===typeof a&&!isNaN(a)){this.b.u=a;a=this.h;var b=a.a.B;null!=b&&mb(a.b,'volumeChange','native',{mediaPlayerVolume:b,deviceVolume:a.a.u})}};Z.prototype.startSession=Z.prototype.W;Z.prototype.error=Z.prototype.error;Z.prototype.finishSession=Z.prototype.U;Z.prototype.publishAdEvent=Z.prototype.X;Z.prototype.publishImpressionEvent=Z.prototype.M;Z.prototype.publishVideoEvent=Z.prototype.Y;Z.prototype.publishMediaEvent=Z.prototype.N;\nZ.prototype.publishLoadedEvent=Z.prototype.V;Z.prototype.setNativeViewHierarchy=Z.prototype.$;Z.prototype.setState=Z.prototype.aa;Z.prototype.setDeviceVolume=Z.prototype.Z;Z.prototype.init=Z.prototype.T;function nc(){var a=X,b=oc;var c=void 0===c?I:c;this.g=a;this.a=b;this.h={};this.f={};this.c=new U;c.omid=c.omid||{};c.omid.v1_VerificationServiceCommunication=this.c;this.b=null;c&&c.addEventListener&&c.postMessage&&(this.b=new Vb(c));this.c.a=this.i.bind(this);this.b&&(this.b.a=this.j.bind(this))}function pc(a,b,c,d){Db(a.a,b,c,d)}function qc(a,b,c,d){Cb(a.a,'downloadJavaScriptResource')(b,c,d)}nc.prototype.j=function(a,b){this.b&&rc(this,a,b,this.b)};nc.prototype.i=function(a,b){rc(this,a,b,this.c)};\nfunction rc(a,b,c,d){function e(F){for(var W=[],ra=0;ra<arguments.length;++ra)W[ra]=arguments[ra];W=new T(f,'response',g,cc(g)&&dc(g)?W:JSON.stringify(W));d.b(W,c)}var f=b.b,l=b.method,g=b.version;b=ec(g,b.a);if(null!=Ub(l,'VerificationService.')){l=Ub(l,'VerificationService.');try{switch(l){case 'addEventListener':var h=p(b).next().value;$a(a.g,h,e);break;case 'addSessionListener':var k=p(b),m=k.next().value,u=k.next().value;bb(a.g,e,m,u);break;case 'sendUrl':var w=p(b).next().value;pc(a,w,function(){return e(!0)},\nfunction(){return e(!1)});break;case 'setTimeout':var E=p(b),V=E.next().value,wc=E.next().value;a.h[V]=zb(a.a,'setTimeout')(e,wc);break;case 'clearTimeout':var xc=p(b).next().value;Bb(a.a,a.h[xc]);break;case 'setInterval':var Ob=p(b),yc=Ob.next().value,zc=Ob.next().value;a.f[yc]=yb(a.a,e,zc);break;case 'clearInterval':var Ac=p(b).next().value;Ab(a.a,a.f[Ac]);break;case 'injectJavaScriptResource':var Bc=p(b).next().value;qc(a,Bc,function(F){return e(!0,F)},function(){return e(!1)});break;case 'getVersion':p(b).next();\nvar Cc=H().c.omidJsInfo;e(Cc.serviceVersion)}}catch(F){d.b(new T(f,'error',g,'\\n              name: '+F.name+'\\n              message: '+F.message+'\\n              filename: '+F.filename+'\\n              lineNumber: '+F.lineNumber+'\\n              columnNumber: '+F.columnNumber+'\\n              stack: '+F.stack+'\\n              toString(): '+F.toString()+'\\n          '),c)}}};function sc(){var a=I.document.createElement('iframe');a.id='omid_v1_present';a.name='omid_v1_present';a.style.display='none';I.document.body.appendChild(a)}function tc(){var a=new MutationObserver(function(b){b.forEach(function(c){'BODY'===c.addedNodes[0].nodeName&&(sc(),a.disconnect())})});a.observe(I.document.documentElement,{childList:!0})};var X=new Ua,oc=new function(){var a;this.a=a=void 0===a?omidGlobal:a};new nc;var uc=new function(){},vc=new function(){},lc=new function(){this.b=X;this.c=vc;this.a=H()},Dc;I?Dc=I.IntersectionObserver&&(I.MutationObserver||I.ResizeObserver)?new S(I,uc,lc,X):new R(I,vc,lc,oc,X):Dc=null;var $b=Dc,ac=new function(){var a=X;var b=void 0===b?I:b;this.f=a;this.a=b;this.c=H();this.b=[]},hc=new Zb,mc=new function(){var a=X,b=H();this.b=a;this.a=b};I.omidBridge=new Z;new gc;\nif(I.frames&&I.document&&!('omid_v1_present'in I.frames)){var Ec;if(Ec=null==I.document.body)Ec='MutationObserver'in I;Ec?tc():I.document.body?sc():I.document.write('<iframe style=\"display:none\" id=\"omid_v1_present\" name=\"omid_v1_present\"></iframe>')};\n}).call(this, this);";
                                        AdSessionContext createNativeAdSessionContext = AdSessionContext.createNativeAdSessionContext(c0222b9.f52370b, str7, verificationScriptResources, e6, str14);
                                        Intrinsics.checkNotNullExpressionValue(createNativeAdSessionContext, "createNativeAdSessionContext(...)");
                                        hashMap2.put("omidAdSession", new T8("native_video_ad", ImpressionType.VIEWABLE, createNativeAdSessionContext, false));
                                        fb.f51667b.put("deferred", Boolean.TRUE);
                                        A4 a47 = this.f53106j;
                                        if (a47 != null) {
                                            str = str3;
                                            str6 = str4;
                                            try {
                                                Intrinsics.checkNotNullExpressionValue(str6, str);
                                                ((B4) a47).a(str6, "OMID video ad session created and JavaScript resources injected");
                                            } catch (Exception e7) {
                                                e = e7;
                                                A4 a48 = this.f53106j;
                                                if (a48 != null) {
                                                    ((B4) a48).b(str6, Cc.a(e, A5.a(str6, str, "Setting up impression tracking for OMID Native Video encountered an unexpected error: ")));
                                                }
                                                Q4 q4 = Q4.f52013a;
                                                Q4.f52015c.a(AbstractC0513x4.a(e, "event"));
                                                str9 = str6;
                                                it = it2;
                                                z2 = z;
                                                str8 = str;
                                                ad = c0296h;
                                            }
                                            str9 = str6;
                                            it = it2;
                                            z2 = z;
                                            str8 = str;
                                        }
                                    }
                                }
                                ad = c0296h;
                                it = it2;
                                z2 = z;
                                str8 = str3;
                                str9 = str4;
                            } else {
                                str = str8;
                                z = z2;
                                String str15 = str9;
                                A4 a49 = this.f53106j;
                                if (a49 != null) {
                                    ((B4) a49).c(str15, AbstractC0311i0.a(str15, str, "initOmidForNativeDisplayAd ", this));
                                }
                                try {
                                    byte J2 = J();
                                    str3 = str;
                                    try {
                                        String L3 = L();
                                        Intrinsics.e(L3);
                                        pubContent = new JSONObject(L3);
                                        adConfig = this.f53098b;
                                        Intrinsics.e(adConfig);
                                        str4 = str15;
                                    } catch (Exception e8) {
                                        e = e8;
                                        str2 = str15;
                                        str = str3;
                                    }
                                    try {
                                        C0227c0 c0227c02 = this.u;
                                        HashMap a7 = c0227c02 == null ? null : K8.a(c0227c02.h());
                                        A4 a410 = this.f53106j;
                                        Intrinsics.checkNotNullParameter(pubContent, "pubContent");
                                        Intrinsics.checkNotNullParameter(adConfig, "adConfig");
                                        w6 = (W6) new C0332j7(J2, pubContent, null, false, adConfig, a7, null, a410).n("CONTAINER").get(0);
                                    } catch (Exception e9) {
                                        e = e9;
                                        str = str3;
                                        str2 = str4;
                                        a4 = this.f53106j;
                                        if (a4 != null) {
                                            ((B4) a4).b(str2, Cc.a(e, A5.a(str2, str, "Setting up impression tracking for OMID Native Display encountered an unexpected error: ")));
                                        }
                                        Q4 q42 = Q4.f52013a;
                                        Q4.f52015c.a(AbstractC0513x4.a(e, "event"));
                                        str9 = str2;
                                        it = it2;
                                        z2 = z;
                                        str8 = str;
                                        ad = c0296h;
                                    }
                                } catch (Exception e10) {
                                    e = e10;
                                    str2 = str15;
                                }
                                if (t != null) {
                                    ArrayList verificationScriptResources2 = new ArrayList();
                                    Iterator it4 = w6.s.iterator();
                                    while (it4.hasNext()) {
                                        P7 p72 = (P7) it4.next();
                                        if (Intrinsics.c("OMID_VIEWABILITY", p72.f51998c) && (p72 instanceof U8)) {
                                            Map map2 = (Map) fb.a("macros", Map.class);
                                            String a8 = C0353l0.a(((U8) p72).f52126h, map2);
                                            String str16 = ((U8) p72).f52127i;
                                            String a9 = C0353l0.a(p72.f52000e, map2);
                                            if (AbstractC0229c2.a(a8) && AbstractC0229c2.a(str16)) {
                                                createVerificationScriptResourceWithoutParameters = VerificationScriptResource.createVerificationScriptResourceWithParameters(str16, new URL(a9), a8);
                                                Intrinsics.e(createVerificationScriptResourceWithoutParameters);
                                            } else {
                                                createVerificationScriptResourceWithoutParameters = VerificationScriptResource.createVerificationScriptResourceWithoutParameters(new URL(a9));
                                                Intrinsics.e(createVerificationScriptResourceWithoutParameters);
                                            }
                                            verificationScriptResources2.add(createVerificationScriptResourceWithoutParameters);
                                        }
                                    }
                                    if (verificationScriptResources2.size() != 0) {
                                        HashMap hashMap3 = fb.f51667b;
                                        String e11 = this.t.e();
                                        String str17 = (String) fb.f51667b.get("creativeType");
                                        Intrinsics.checkNotNullParameter(verificationScriptResources2, "verificationScriptResources");
                                        C0222b9 c0222b92 = AbstractC0208a9.f52330a;
                                        c0222b92.getClass();
                                        Intrinsics.checkNotNullParameter(verificationScriptResources2, "verificationScriptResources");
                                        Context d4 = Ha.d();
                                        if (d4 != null) {
                                            str5 = new C0402o9(d4, "omid_js_store").a("omid_js_string");
                                            if (str5 == null) {
                                                str5 = null;
                                            }
                                        }
                                        str5 = ";(function(omidGlobal) {\n  'use strict';var n;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function p(a){var b='undefined'!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function q(a){if(!(a instanceof Array)){a=p(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var ba='function'==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ca;\nif('function'==typeof Object.setPrototypeOf)ca=Object.setPrototypeOf;else{var da;a:{var ea={S:!0},fa={};try{fa.__proto__=ea;da=fa.S;break a}catch(a){}da=!1}ca=da?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+' is not extensible');return a}:null}var ha=ca;\nfunction r(a,b){a.prototype=ba(b.prototype);a.prototype.constructor=a;if(ha)ha(a,b);else for(var c in b)if('prototype'!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c]}function ia(a){a=['object'==typeof window&&window,'object'==typeof self&&self,'object'==typeof global&&global,a];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}return globalThis}\nvar t=ia(this),v='function'==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function x(a,b){if(b){var c=t;a=a.split('.');for(var d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&v(c,a,{configurable:!0,writable:!0,value:b})}}x('globalThis',function(a){return a||t});function y(a,b){return Object.prototype.hasOwnProperty.call(a,b)}\nvar ja='function'==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)y(d,e)&&(a[e]=d[e])}return a};x('Object.assign',function(a){return a||ja});function ka(){ka=function(){};t.Symbol||(t.Symbol=la)}function ma(a,b){this.a=a;v(this,'description',{configurable:!0,writable:!0,value:b})}ma.prototype.toString=function(){return this.a};\nvar la=function(){function a(c){if(this instanceof a)throw new TypeError('Symbol is not a constructor');return new ma('jscomp_symbol_'+(c||'')+'_'+b++,c)}var b=0;return a}();function z(){ka();var a=t.Symbol.iterator;a||(a=t.Symbol.iterator=t.Symbol('Symbol.iterator'));'function'!=typeof Array.prototype[a]&&v(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return na(aa(this))}});z=function(){}}function na(a){z();a={next:a};a[t.Symbol.iterator]=function(){return this};return a}\nx('WeakMap',function(a){function b(h){this.a=(g+=Math.random()+1).toString();if(h){h=p(h);for(var k;!(k=h.next()).done;)k=k.value,this.set(k[0],k[1])}}function c(){}function d(h){var k=typeof h;return'object'===k&&null!==h||'function'===k}function e(h){if(!y(h,l)){var k=new c;v(h,l,{value:k})}}function f(h){var k=Object[h];k&&(Object[h]=function(m){if(m instanceof c)return m;e(m);return k(m)})}if(function(){if(!a||!Object.seal)return!1;try{var h=Object.seal({}),k=Object.seal({}),m=new a([[h,2],[k,\n3]]);if(2!=m.get(h)||3!=m.get(k))return!1;m.delete(h);m.set(k,4);return!m.has(h)&&4==m.get(k)}catch(u){return!1}}())return a;var l='$jscomp_hidden_'+Math.random();f('freeze');f('preventExtensions');f('seal');var g=0;b.prototype.set=function(h,k){if(!d(h))throw Error('Invalid WeakMap key');e(h);if(!y(h,l))throw Error('WeakMap key fail: '+h);h[l][this.a]=k;return this};b.prototype.get=function(h){return d(h)&&y(h,l)?h[l][this.a]:void 0};b.prototype.has=function(h){return d(h)&&y(h,l)&&y(h[l],this.a)};\nb.prototype.delete=function(h){return d(h)&&y(h,l)&&y(h[l],this.a)?delete h[l][this.a]:!1};return b});\nx('Map',function(a){function b(){var g={};return g.A=g.next=g.head=g}function c(g,h){var k=g.a;return na(function(){if(k){for(;k.head!=g.a;)k=k.A;for(;k.next!=k.head;)return k=k.next,{done:!1,value:h(k)};k=null}return{done:!0,value:void 0}})}function d(g,h){var k=h&&typeof h;'object'==k||'function'==k?f.has(h)?k=f.get(h):(k=''+ ++l,f.set(h,k)):k='p_'+h;var m=g.b[k];if(m&&y(g.b,k))for(g=0;g<m.length;g++){var u=m[g];if(h!==h&&u.key!==u.key||h===u.key)return{id:k,list:m,index:g,s:u}}return{id:k,list:m,\nindex:-1,s:void 0}}function e(g){this.b={};this.a=b();this.size=0;if(g){g=p(g);for(var h;!(h=g.next()).done;)h=h.value,this.set(h[0],h[1])}}if(function(){if(!a||'function'!=typeof a||!a.prototype.entries||'function'!=typeof Object.seal)return!1;try{var g=Object.seal({x:4}),h=new a(p([[g,'s']]));if('s'!=h.get(g)||1!=h.size||h.get({x:4})||h.set({x:4},'t')!=h||2!=h.size)return!1;var k=h.entries(),m=k.next();if(m.done||m.value[0]!=g||'s'!=m.value[1])return!1;m=k.next();return m.done||4!=m.value[0].x||\n't'!=m.value[1]||!k.next().done?!1:!0}catch(u){return!1}}())return a;z();var f=new WeakMap;e.prototype.set=function(g,h){g=0===g?0:g;var k=d(this,g);k.list||(k.list=this.b[k.id]=[]);k.s?k.s.value=h:(k.s={next:this.a,A:this.a.A,head:this.a,key:g,value:h},k.list.push(k.s),this.a.A.next=k.s,this.a.A=k.s,this.size++);return this};e.prototype.delete=function(g){g=d(this,g);return g.s&&g.list?(g.list.splice(g.index,1),g.list.length||delete this.b[g.id],g.s.A.next=g.s.next,g.s.next.A=g.s.A,g.s.head=null,\nthis.size--,!0):!1};e.prototype.clear=function(){this.b={};this.a=this.a.A=b();this.size=0};e.prototype.has=function(g){return!!d(this,g).s};e.prototype.get=function(g){return(g=d(this,g).s)&&g.value};e.prototype.entries=function(){return c(this,function(g){return[g.key,g.value]})};e.prototype.keys=function(){return c(this,function(g){return g.key})};e.prototype.values=function(){return c(this,function(g){return g.value})};e.prototype.forEach=function(g,h){for(var k=this.entries(),m;!(m=k.next()).done;)m=\nm.value,g.call(h,m[1],m[0],this)};e.prototype[Symbol.iterator]=e.prototype.entries;var l=0;return e});x('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)y(b,d)&&c.push(b[d]);return c}});\nx('Set',function(a){function b(c){this.a=new Map;if(c){c=p(c);for(var d;!(d=c.next()).done;)this.add(d.value)}this.size=this.a.size}if(function(){if(!a||'function'!=typeof a||!a.prototype.entries||'function'!=typeof Object.seal)return!1;try{var c=Object.seal({x:4}),d=new a(p([c]));if(!d.has(c)||1!=d.size||d.add(c)!=d||1!=d.size||d.add({x:4})!=d||2!=d.size)return!1;var e=d.entries(),f=e.next();if(f.done||f.value[0]!=c||f.value[1]!=c)return!1;f=e.next();return f.done||f.value[0]==c||4!=f.value[0].x||\nf.value[1]!=f.value[0]?!1:e.next().done}catch(l){return!1}}())return a;z();b.prototype.add=function(c){c=0===c?0:c;this.a.set(c,c);this.size=this.a.size;return this};b.prototype.delete=function(c){c=this.a.delete(c);this.size=this.a.size;return c};b.prototype.clear=function(){this.a.clear();this.size=0};b.prototype.has=function(c){return this.a.has(c)};b.prototype.entries=function(){return this.a.entries()};b.prototype.values=function(){return this.a.values()};b.prototype.keys=b.prototype.values;\nb.prototype[Symbol.iterator]=b.prototype.values;b.prototype.forEach=function(c,d){var e=this;this.a.forEach(function(f){return c.call(d,f,f,e)})};return b});x('Object.is',function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});x('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});\nx('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)y(b,d)&&c.push([d,b[d]]);return c}});\nvar A={qa:'loaded',xa:'start',ka:'firstQuartile',sa:'midpoint',ya:'thirdQuartile',ia:'complete',ta:'pause',va:'resume',ha:'bufferStart',ga:'bufferFinish',wa:'skipped',Aa:'volumeChange',ua:'playerStateChange',da:'adUserInteraction'},oa={na:'generic',za:'video',ra:'media'},pa={R:'native',oa:'html',P:'javascript'},qa={R:'native',P:'javascript',NONE:'none'},sa={ma:'full',ja:'domain',pa:'limited'},ta={fa:'backgrounded',la:'foregrounded'},ua={ea:'app',Ba:'web'};function B(a,b){this.x=null!=a.x?a.x:a.left;this.y=null!=a.y?a.y:a.top;this.width=a.width;this.height=a.height;this.endX=this.x+this.width;this.endY=this.y+this.height;this.adSessionId=a.adSessionId||void 0;this.isFriendlyObstructionFor=a.isFriendlyObstructionFor||[];this.b=a.friendlyObstructionClass||void 0;this.c=a.friendlyObstructionPurpose||void 0;this.f=a.friendlyObstructionReason||void 0;this.clipsToBounds=void 0!==a.clipsToBounds?!0===a.clipsToBounds:!0;this.g=void 0!==a.hasWindowFocus?!0===\na.hasWindowFocus:!0;this.notVisibleReason=a.notVisibleReason||void 0;this.childViews=a.childViews||[];this.isCreative=a.isCreative||!1;this.a=b}function va(a){var b={};return b.width=a.width,b.height=a.height,b}function C(a){var b={};return Object.assign({},va(a),(b.x=a.x,b.y=a.y,b))}function wa(a){var b=C(a),c={};return Object.assign({},b,(c.endX=a.endX,c.endY=a.endY,c))}function xa(a,b,c){a.x+=b;a.y+=c;a.endX+=b;a.endY+=c}\nB.prototype.J=function(a){if(null==a)return!1;a=C(a);var b=a.y,c=a.width,d=a.height;return this.x===a.x&&this.y===b&&this.width===c&&this.height===d};function ya(a){return a.width*a.height}function za(a){return 0===a.width||0===a.height};function Aa(a,b){var c=0;if(0<b.length){var d=Ba(a,b);a=d.ba;d=d.ca;for(var e=0;e<a.length-1;e++)for(var f=(a[e]+(a[e]+1))/2,l=a[e+1]-a[e],g=0;g<d.length-1;g++){for(var h=(d[g]+(d[g]+1))/2,k=d[g+1]-d[g],m=!1,u=0;u<b.length;u++){var w=C(b[u]);if(w.x<f&&w.x+w.width>f&&w.y<h&&w.y+w.height>h){m=!0;break}}m&&(c+=Math.round(l)*Math.round(k))}}return c}\nfunction Ba(a,b){a=C(a);for(var c=[],d=[],e=0;e<b.length;e++){var f=C(b[e]);f=Ca(a,f);Da(c,f.x);Da(c,f.endX);Da(d,f.y);Da(d,f.endY)}c=c.sort(function(l,g){return l-g});d=d.sort(function(l,g){return l-g});return{ba:c,ca:d}}function Ca(a,b){return{x:Math.max(a.x,b.x),y:Math.max(a.y,b.y),endX:Math.min(a.x+a.width,b.x+b.width),endY:Math.min(a.y+a.height,b.y+b.height)}}function Da(a,b){-1===a.indexOf(b)&&a.push(b)};function Ea(){this.b=this.a=this.v=this.l=this.g=this.j=void 0;this.m=0;this.h=[];this.o=[];this.u=0;this.i=[];this.c=[];this.f=[]}Ea.prototype.J=function(a){return null==a?!1:JSON.stringify(Fa(this))===JSON.stringify(Fa(a))};\nfunction Fa(a){var b=[],c=[],d={viewport:a.j,adView:{percentageInView:a.m,pixelsInView:a.u,reasons:a.f},declaredFriendlyObstructions:a.h.length};if(void 0!==a.a){d.adView.geometry=C(a.a);d.adView.geometry.pixels=ya(a.a);d.adView.onScreenGeometry=C(a.b);d.adView.onScreenGeometry.pixels=Math.max(0,ya(a.b)-Aa(a.b,a.c));for(var e=0;e<a.c.length;e++)b.push(C(a.c[e]));for(e=0;e<a.o.length;e++){var f=a.o[e],l=f,g={};l.b&&(g.obstructionClass=l.b);l.c&&(g.obstructionPurpose=l.c);l.f&&(g.obstructionReason=\nl.f);f=Ca(a.a,f);c.push(Object.assign({},{x:f.x,y:f.y,width:f.endX-f.x,height:f.endY-f.y},g))}d.adView.onScreenGeometry.obstructions=b;d.adView.onScreenGeometry.friendlyObstructions=c;void 0!==a.l&&void 0!==a.v&&(d.adView.containerGeometry=C(a.l),d.adView.onScreenContainerGeometry=C(a.v),d.adView.measuringElement=!0)}return d}function Ga(a,b){b=va(b);a.j={};a.j.width=b.width;a.j.height=b.height;a.g={};a.g.x=0;a.g.y=0;a.g.width=b.width;a.g.height=b.height;a.g.endX=b.width;a.g.endY=b.height}\nfunction Ha(){return{x:0,y:0,endX:0,endY:0,width:0,height:0}}function Ia(a,b){var c={};c.x=Math.max(a.x,b.x);c.y=Math.max(a.y,b.y);c.endX=Math.min(a.endX,b.endX);c.endY=Math.min(a.endY,b.endY);c.width=Math.max(0,c.endX-c.x);c.height=Math.max(0,c.endY-c.y);return c}function Ja(a,b){return.01<b.width-a.width||.01<b.height-a.height}function Ka(a){if(-1!==a.f.indexOf('backgrounded'))a.m=0,a.u=0;else{var b=ya(a.a);if(0!==b){var c=Math.max(0,ya(a.b)-Aa(a.b,a.c));a.m=Math.round(c/b*100);a.u=c}}}\nfunction La(a,b){if(za(b)||!a.b)b=!1;else{var c=wa(a.b),d=c.y,e=c.endX;a=c.endY;var f=b.endX;c=c.x;(f=f<c||.01>Math.abs(f-c))||(f=b.x,f=f>e||.01>Math.abs(f-e));(e=f)||(e=b.endY,e=e<d||.01>Math.abs(e-d));(d=e)||(b=b.y,d=b>a||.01>Math.abs(b-a));b=!d}return b}function D(a,b){for(var c=!1,d=0;d<a.f.length;d++)a.f[d]===b&&(c=!0);c||a.f.push(b)};function Ma(a,b,c,d,e){var f=new Ea;b=new B(b,!1);Ga(f,b);Na(a,b,f,d);if(!e)return f.f=['unmeasurable'],f.j=void 0,f.m=0,f.c=[],f.a&&(a=f.a,c={},a=new B((c.x=0,c.y=0,c.width=a.width,c.height=a.height,c),a.a),f.a=a),f.b=Ha(),f;if('backgrounded'===c)D(f,'backgrounded');else if(void 0!==f.a){for(a=0;a<f.h.length;a++)La(f,f.h[a])&&f.o.push(f.h[a]);for(a=0;a<f.i.length;a++){if(c=La(f,f.i[a])){a:{c=f.i[a];for(d=0;d<f.c.length;d++)if(f.c[d].J(c)){c=!0;break a}c=!1}c=!c}c&&(D(f,'obstructed'),f.c.push(f.i[a]))}Ka(f)}else D(f,\n'notFound');return f}\nfunction Na(a,b,c,d){var e=b.isCreative?!0:b.adSessionId===d;if(e){c.a=b;var f=wa(c.a);a=Ia(c.g,f);var l=c.a;'notAttached'===l.notVisibleReason||'noWindowFocus'===l.notVisibleReason||'noAdView'===l.notVisibleReason?(D(c,'notFound'),c.b=new B(Ha(),!1)):(l=c.a,'viewInvisible'===l.notVisibleReason||'viewGone'===l.notVisibleReason||'viewNotVisible'===l.notVisibleReason||'viewAlphaZero'===l.notVisibleReason||'viewHidden'===l.notVisibleReason||void 0!==c.a.notVisibleReason||za(c.a)?(D(c,'hidden'),c.b=new B(Ha(),\n!1)):(c.a.g||(D(c,'backgrounded'),D(c,'noWindowFocus')),Ja(a,f)&&D(c,'clipped'),c.b=new B(a,!1)))}else if(f=!0,b.a&&(f=-1!==b.isFriendlyObstructionFor.indexOf(d)?!1:!1===b.clipsToBounds),f){l=b.childViews;for(var g=0;g<l.length;g++)f=void 0!==c.a,Na(a,new B(l[g],f),c,d)}e||void 0===c.a||(b.a?-1!==b.isFriendlyObstructionFor.indexOf(d)?c.h.push(b):c.i.push(b):(e=wa(b),d=wa(c.b),C(c.b),!za(c.b)&&b.clipsToBounds&&(b=Ia(d,e),Ja(b,d)&&(D(c,'clipped'),c.b=new B(b,!1)))))};function Oa(a,b){this.y=this.x=0;this.width=a;this.height=b};function Pa(){return{apiVersion:'1.0',accessMode:'limited',environment:'app',omidJsInfo:{omidImplementer:'omsdk',serviceVersion:'1.3.37-iab3566'}}}function Qa(){this.adSessionId=null;this.c=Pa();this.o=null;this.m='foregrounded';this.l=this.i='none';this.j=this.g=this.f=this.h=this.a=this.b=this.B=this.u=null;this.C=!0;this.v=new Map}var G;function H(){G||(G=new Qa);return G};var I=function(){if('undefined'!==typeof omidGlobal&&omidGlobal)return omidGlobal;if('undefined'!==typeof global&&global)return global;if('undefined'!==typeof window&&window)return window;if('undefined'!==typeof globalThis&&globalThis)return globalThis;var a=Function('return this')();if(a)return a;throw Error('Could not determine global object context.');}();function Ra(a,b){this.a=a;this.b=b}t.Object.defineProperties(Ra.prototype,{event:{configurable:!0,enumerable:!0,get:function(){return this.a}},origin:{configurable:!0,enumerable:!0,get:function(){return this.b}}});function J(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];Sa(function(){throw new (Function.prototype.bind.apply(Error,[null,'Could not complete the test successfully - '].concat(q(b))));},function(){return console.error.apply(console,q(b))})}function Ta(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];Sa(function(){},function(){return console.error.apply(console,q(b))})}\nfunction Sa(a,b){'undefined'!==typeof jasmine&&jasmine?a():'undefined'!==typeof console&&console&&console.error&&b()};function Ua(){this.f=[];this.b=[];this.c=[];this.g=[];this.i={};this.a=H()}function Va(a){a.f=[];a.b=[];a.c=[];a.g=[];a.i={};G.adSessionId=null;G.c=Pa();G.o=null;G.G=void 0;G.K=void 0;G.H=null;G.I=null;G.D=null;G.m='foregrounded';G.i='none';G.l='none';G.u=null;G.B=null;G.b=null;G.a=null;G.h=null;G.f=null;G.g=null;G.j=null;G.C=!0;G.v=new Map}\nfunction Wa(a,b){void 0!==a.a&&a.a.adSessionId&&!1!==Xa(a,b)&&a.c.filter(function(c){return c.type===b.event.type}).forEach(function(c){return a.h(c.F,b.event)})}function Ya(a,b){a.f.push(b);Wa(a,b)}function Za(a,b,c){void 0!==a.a&&a.a.adSessionId&&a.f.filter(function(d){return d.event.type===b&&Xa(a,d)}).map(function(d){return d.event}).forEach(c)}\nfunction Xa(a,b){var c=b.event.type,d=-1!==Object.values(A).indexOf(c)&&'volumeChange'!==c;return'impression'===c||'loaded'===c&&a.a.a?b.origin===H().l:d?b.origin===H().i:!0}function $a(a,b,c){'media'===b||'video'===b?ab(a,c):(a.c.push({type:b,F:c}),Za(a,b,c))}function ab(a,b){Object.keys(A).forEach(function(c){c=A[c];a.c.push({type:c,F:b});Za(a,c,b)})}function bb(a,b,c,d){var e={O:c,L:d,F:b};a.g.push(e);a.b.forEach(function(f){var l=cb(f);'sessionStart'===f.event.type&&db(a,l,e);a.h(b,l)})}\nfunction eb(a,b,c){var d=K(a,'sessionError','native',{errorType:b,message:c});a.b.push(d);a.g.forEach(function(e){a.h(e.F,d.event)})}function fb(a,b){a.i=Object.assign(a.i,b);b=a.a.c;if(void 0!==b){b=Object.assign({},gb(a,hb(a,{context:b}),!0),{supportsLoadedEvent:!!a.a.a||'video'==a.a.b});Object.assign(b,{pageUrl:null,contentUrl:a.a.o});var c=K(a,'sessionStart','native',b);a.b.push(c);a.g.forEach(function(d){var e=d.F,f=cb(c);db(a,f,d);a.h(e,f)},a);ib(a)}}\nfunction db(a,b,c){c.O&&(b.data.verificationParameters=a.i[c.O]);c.L&&(c=a.a.v.get(c.L))&&(b.data.verificationParameters=c.verificationParameters,b.data.context.accessMode=c.accessMode,'full'===c.accessMode&&(a.a.g&&(b.data.context.videoElement=a.a.g),a.a.f&&(b.data.context.slotElement=a.a.f)))}function jb(a){var b=a.g,c=K(a,'sessionFinish','native');a.b.push(c);var d=a.a.c;d&&'native'==d.adSessionType||Va(a);b.forEach(function(e){return a.h(e.F,c.event)})}\nUa.prototype.h=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];try{a.apply(null,q(c))}catch(e){Ta(e)}};function kb(a,b){var c=(c=H().D)?Fa(c):void 0;c=gb(a,hb(a,c));Ya(a,K(a,'impression',b,c))}function lb(a,b,c){if(a.a.a||'display'!=a.a.b)b=K(a,'loaded',b,gb(a,hb(a,void 0===c?null:c))),Ya(a,b)}\nfunction mb(a,b,c,d){'start'!==b&&'volumeChange'!==b||null!=(d&&d.deviceVolume)||(d.deviceVolume=a.a.u);if(d&&('start'===b||'volumeChange'===b)){var e=d.videoPlayerVolume,f=d.mediaPlayerVolume;null!=e?(Object.assign(d,{mediaPlayerVolume:e}),a.a.B=e):null!=f&&(Object.assign(d,{videoPlayerVolume:f}),a.a.B=f)}Ya(a,K(a,b,c,d))}\nfunction ib(a){var b=a.f.filter(function(f){return Object.values(A).includes(f.event.type)&&'video'==a.a.b&&f.origin===a.a.i||'loaded'==f.event.type&&'display'==a.a.b&&f.origin===a.a.l?!0:!1}).map(function(f){return f.event}),c=a.a.adSessionId||'',d={};b=p(b);for(var e=b.next();!e.done;d={w:d.w},e=b.next()){d.w=e.value;d.w.adSessionId||(d.w.adSessionId=c);if('loaded'==d.w.type){if(!a.a.a&&'display'==a.a.b)continue;d.w.data=gb(a,hb(a,d.w.data))}a.c.filter(function(f){return function(l){return l.type===\nf.w.type}}(d)).forEach(function(f){return function(l){return l.F(f.w)}}(d))}}function nb(a,b,c){a:{c=new Set(c);a=p(a.f.concat(a.b));for(var d=a.next();!d.done;d=a.next())if(d=d.value,c.has(d.event.type)&&d.origin!=b){b=!0;break a}b=!1}return b?(J('Event owner cannot be registered after its events have already been published.'),!1):!0}function ob(a,b){nb(a,b,Object.values(A))&&L(a,b)&&(a.a.i=b)}function pb(a,b){nb(a,b,['impression'])&&qb(a,b)&&(a.a.l=b)}\nfunction qb(a,b){var c=a.a.l;return'none'!=c&&c!=b?(J('Impression event is owned by '+(a.a.l+', not ')+(b+'.')),!1):!0}function L(a,b){var c=a.a.i;return'none'!=c&&c!=b?(J('Media events are owned by '+(a.a.i+', not '+b+'.')),!1):!0}function gb(a,b,c){c=void 0===c?!1:c;b=Object.assign({},b);a.a.b&&Object.assign(b,{mediaType:a.a.b});a.a.a&&(c||'definedByJavaScript'!==a.a.a)&&Object.assign(b,{creativeType:a.a.a});return b}function hb(a,b){return a.a.h?Object.assign({},b,{impressionType:a.a.h}):b}\nfunction K(a,b,c,d){return new Ra({adSessionId:a.a.adSessionId||'',timestamp:(new Date).getTime(),type:b,data:d},c)}function cb(a){a=a.event;return{adSessionId:a.adSessionId,timestamp:a.timestamp,type:a.type,data:a.data}};function rb(a,b,c){'container'===b&&void 0!==a.a.G&&void 0!==a.a&&null!=a.a.adSessionId&&(a.a.H=Ma(a.c,a.a.G,a.a.m,a.a.adSessionId,!0));b=a.a;var d=b.H,e=b.I;if(d)if(e){b=new Ea;var f=d.j,l=d.a,g=d.b,h=e.a,k=e.b;f&&l&&g&&h&&k&&(Ga(b,f),b.l=new B(l,!1),b.v=new B(g,!1),b.i=Object.assign([],d.i),b.c=Object.assign([],d.c),b.h=Object.assign([],d.h),b.o=Object.assign([],d.o),b.f=Object.assign([],e.f,d.f),d=b.l.x,e=b.l.y,h=new B(h,!1),k=new B(k,!1),xa(h,d,e),xa(k,d,e),b.a=h,b.b=Ia(k,g),Ka(b))}else b=d;else b=\nnull;g=a.a.D;if(b&&!b.J(g)||c)g=Fa(b),c&&(g.adView.reasons=g.adView.reasons||[c]),c=a.b,'audio'!=c.a.a&&Ya(c,K(c,'geometryChange','native',g)),a.a.D=b};function M(a){return'object'===typeof a}function sb(a){return'number'===typeof a&&!isNaN(a)&&0<=a}function N(a){return'string'===typeof a}function O(a,b){return N(a)&&-1!==Object.values(b).indexOf(a)}function tb(a){return!(!a||!a.tagName||'iframe'!==a.tagName.toLowerCase())};function P(a,b,c){this.f=a;this.K=b;this.G=c;this.c=H();this.b=null;this.a=this.g=this.u=void 0;this.I=!0;this.B=void 0;Q(this)}function Q(a){if(!a.b){var b;a:{if((b=a.f.document)&&b.getElementsByClassName&&(b=b.getElementsByClassName('omid-element'))){if(1==b.length){b=b[0];break a}1<b.length&&a.I&&(eb(a.G,'generic',\"More than one element with 'omid-element' class name.\"),a.I=!1)}b=null}if(b&&b.tagName&&'video'===b.tagName.toLowerCase())a.c.g=b;else if(b&&b.tagName)a.c.f=b;else return;ub(a)}}\nfunction ub(a){a.c.g?(a.b=a.c.g,a.i()):a.c.f&&(a.b=a.c.f,tb(a.b)?a.c.j&&a.i():a.i())}function vb(a){a.a&&(tb(a.b)?a.c.j&&(a.D(),wb(a)):(a.D(),wb(a)))}P.prototype.m=function(){this.B&&(this.f.document.removeEventListener('visibilitychange',this.B),this.B=void 0)};P.prototype.i=function(){};function wb(a){a.u&&(a.c.I=a.u,rb(a.K,'creative'))}function xb(a){if(a.a&&a.c.j){var b=new B(a.c.j,!1);xa(b,a.a.x,a.a.y);b.clipsToBounds=!0;return b}};function yb(a,b,c){return zb(a,'setInterval')(b,c)}function Ab(a,b){zb(a,'clearInterval')(b)}function Bb(a,b){zb(a,'clearTimeout')(b)}function zb(a,b){return a.a&&a.a[b]?a.a[b]:Cb(a,b)}\nfunction Db(a,b,c,d){if(a.a.document&&a.a.document.body){var e=a.a.document.createElement('img');e.width=1;e.height=1;e.style.display='none';e.src=b;c&&e.addEventListener('load',function(){return c()});d&&e.addEventListener('error',function(){return d()});a.a.document.body.appendChild(e)}else Cb(a,'sendUrl')(b,c,d)}function Cb(a,b){if(a.a&&a.a.omidNative&&a.a.omidNative[b])return a.a.omidNative[b].bind(a.a.omidNative);throw Error('Native interface method \"'+b+'\" not found.');};function R(a,b,c,d,e){P.call(this,a,c,e);this.l=b;this.h=void 0;this.j=d}r(R,P);R.prototype.m=function(){void 0!==this.h&&(Ab(this.j,this.h),this.h=void 0);P.prototype.m.call(this)};R.prototype.i=function(){var a=this;P.prototype.i.call(this);null==this.b?this.h=void 0:void 0===this.h&&(this.h=yb(this.j,function(){return Eb(a)},200),Eb(this))};\nR.prototype.D=function(){if(this.g){var a=xb(this);if(a){this.a.isCreative=!1;a.isCreative=!0;for(var b=!1,c=0;c<this.a.childViews.length;c++)if(this.a.childViews[c].isCreative){this.a.childViews[c]=a;b=!0;break}b||this.a.childViews.push(a)}else this.a.isCreative=!0;this.u=Ma(this.l,this.g,this.c.m,this.c.adSessionId,this.C())}};R.prototype.C=function(){return!0};\nfunction Eb(a){if(void 0!==a.h){b:{try{var b=a.f.top;var c=0<=b.innerHeight&&0<=b.innerWidth;break b}catch(d){}c=!1}c?(c=a.f.top,c=new B(new Oa(c.innerWidth,c.innerHeight),!1)):c=new B(new Oa(0,0),!1);b=a.b.getBoundingClientRect();if(null==b.x||isNaN(b.x))b.x=b.left;if(null==b.y||isNaN(b.y))b.y=b.top;b=new B(b,!1);c.J(a.g)&&b.J(a.a)||(a.a=b,a.a.clipsToBounds=!0,a.g=c,a.g.childViews.push(a.a),vb(a))}};function S(a,b,c,d){P.call(this,a,c,d);this.o=this.j=this.l=this.h=void 0;this.H=!1;this.v=void 0}r(S,P);S.prototype.m=function(){this.h&&this.h.disconnect();Fb(this);P.prototype.m.call(this)};S.prototype.i=function(){P.prototype.i.call(this);this.b&&(this.h||(this.h=Gb(this)),Hb(this),Ib(this.b)&&Jb(this))};\nS.prototype.D=function(){if(this.a&&this.v){var a=xb(this);if(a){var b=a;var c=this.v;var d=Math.max(a.x,c.x);var e=Math.max(a.y,c.y),f=Math.min(a.endX,c.endX);a=Math.min(a.endY,c.endY);f<=d||a<=e?d=null:(c={},d=new B((c.x=d,c.y=e,c.width=Math.abs(f-d),c.height=Math.abs(a-e),c),!1));d||(d=new B({x:0,y:0,width:0,height:0},!1))}else b=this.a,d=this.v;e=new Ea;this.g&&Ga(e,this.g);e.a=b;e.b=d;Ka(e);this.H?za(e.a)?D(e,'hidden'):100===e.m||D(e,'clipped'):D(e,'viewport');this.u=e}};S.prototype.C=function(){return!0};\nfunction Fb(a){a.l&&(a.l.disconnect(),a.l=void 0);a.j&&(a.j.disconnect(),a.j=void 0);a.o&&((0,a.f.removeEventListener)('resize',a.o),a.o=void 0)}function Hb(a){a.h&&a.b&&(a.h.unobserve(a.b),a.h.observe(a.b))}function Ib(a){a=a.getBoundingClientRect();return 0==a.width||0==a.height}\nfunction Gb(a){return new a.f.IntersectionObserver(function(b){try{if(b.length){for(var c,d=b[0],e=1;e<b.length;e++)b[e].time>d.time&&(d=b[e]);c=d;a.g=Kb(c.rootBounds);a.a=Kb(c.boundingClientRect);a.v=Kb(c.intersectionRect);a.H=!!c.isIntersecting;vb(a)}}catch(f){a.m(),eb(a.G,'generic','Problem handling IntersectionObserver callback: '+f.message)}},{root:null,rootMargin:'0px',threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]})}\nfunction Jb(a){a.f.ResizeObserver?a.l||(a.l=Lb(a,function(){return Mb(a)}),a.l.observe(a.b)):(a.o||(a.o=function(){return Mb(a)},(0,a.f.addEventListener)('resize',a.o)),a.j||(a.j=new MutationObserver(function(){return Mb(a)}),a.j.observe(a.b,{childList:!1,attributes:!0,subtree:!1})))}function Mb(a){a.b&&!Ib(a.b)&&(Hb(a),Fb(a))}function Lb(a,b){return new a.f.ResizeObserver(b)}function Kb(a){if(a&&null!==a.x&&null!==a.y&&null!==a.width&&null!==a.height)return new B(a,!1)};function Nb(a){return a&&M(a)?Object.entries(a).reduce(function(b,c){var d=p(c);c=d.next().value;d=d.next().value;return b&&N(c)&&null!=d&&M(d)&&N(d.resourceUrl)},!0):!1};function T(a,b,c,d){this.b=a;this.method=b;this.version=c;this.a=d}function Pb(a){return!!a&&void 0!==a.omid_message_guid&&void 0!==a.omid_message_method&&void 0!==a.omid_message_version&&'string'===typeof a.omid_message_guid&&'string'===typeof a.omid_message_method&&'string'===typeof a.omid_message_version&&(void 0===a.omid_message_args||void 0!==a.omid_message_args)}function Qb(a){return new T(a.omid_message_guid,a.omid_message_method,a.omid_message_version,a.omid_message_args)}\nfunction Rb(a){var b={};b=(b.omid_message_guid=a.b,b.omid_message_method=a.method,b.omid_message_version=a.version,b);void 0!==a.a&&(b.omid_message_args=a.a);return b};function Sb(a){this.c=a};function U(a){this.c=a;this.handleExportedMessage=U.prototype.f.bind(this)}r(U,Sb);U.prototype.b=function(a,b){b=void 0===b?this.c:b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.handleExportedMessage(Rb(a),this)};U.prototype.f=function(a,b){Pb(a)&&this.a&&this.a(Qb(a),b)};function Tb(a){return Ub(a,'SessionService.')}function Ub(a,b){return(a=a.match(new RegExp('^'+b+'(.*)')))&&a[1]};function Vb(a,b){this.c=b=void 0===b?I:b;var c=this;a.addEventListener('message',function(d){if('object'===typeof d.data){var e=d.data;Pb(e)&&d.source&&c.a&&c.a(Qb(e),d.source)}})}r(Vb,Sb);Vb.prototype.b=function(a,b){b=void 0===b?this.c:b;if(!b)throw Error('Message destination must be defined at construction time or when sending the message.');b.postMessage(Rb(a),'*')};function Wb(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(a){var b=16*Math.random()|0;return'y'===a?(b&3|8).toString(16):b.toString(16)})};function Xb(a){if(!a.a||!a.a.document)throw Error('OMID Service Script is not running within a window.');var b=a.b;a.b=[];b.forEach(function(c){try{var d=a.c.C?'limited':'full',e=O(c.accessMode,sa)?c.accessMode:null;var f=e?'full'==e&&'limited'==d?d:'domain'==e?'limited':e:d;c.accessMode=f;a:{var l=c.resourceUrl,g=a.a.location.origin;try{var h=new URL(l,g);break a}catch(V){}try{h=new URL(l);break a}catch(V){}h=null}if(d=h){var k=Wb(),m=a.a.document,u=m.createElement('iframe');u.id='omid-verification-script-frame-'+\nk;u.style.display='none';['full','limited'].includes(f)?u.srcdoc=\"<html><head>\\n<script type=\\\"text/javascript\\\">window['omidVerificationProperties'] = {\\n'serviceWindow': window.parent,\\n'injectionSource': 'app',\\n'injectionId': '\"+(k+'\\',\\n};\\x3c/script>\\n<script type=\"text/javascript\" src=\"')+d.href+'\">\\x3c/script>\\n</head><body></body></html>':'domain'==f&&(u.src=Yb(a,k,d).href);['domain','limited'].includes(f)&&(u.sandbox='allow-scripts');m.body.appendChild(u);var w=c.vendorKey,E=c.verificationParameters;\nw=void 0===w?'':w;E=void 0===E?'':E;w&&'string'===typeof w&&''!==w&&E&&'string'===typeof E&&''!==E&&(a.f.i[w]=E);a.c.v.set(k,c)}}catch(V){Ta('OMID verification script '+c.resourceUrl+' failed to load: '+V)}})}\nfunction Yb(a,b,c){var d='/.well-known/omid/omloader-v1.html#';(new Map([['verificationScriptUrl',c.href],['injectionId',b]])).forEach(function(e,f){d+=encodeURIComponent(f)+'='+encodeURIComponent(e)+'&'});b=null;try{b=new URL(d,a.a.parent.location.origin)}catch(e){throw Error('OMID Service Script cannot access the parent window.');}return b};function Zb(){var a=$b,b=ac,c=this;this.c=X;this.b=a;this.a=H();this.g=b;this.f=!1;this.registerSessionObserver(function(d){return bc(c,d)})}n=Zb.prototype;n.registerSessionObserver=function(a){bb(this.c,a)};n.setSlotElement=function(a){a&&a.tagName?(this.a.f=a,this.b&&ub(this.b)):J('setSlotElement called with a non-HTMLElement.  It will be ignored.')};n.setElementBounds=function(a){this.a.j=a;this.b&&ub(this.b);this.b&&vb(this.b)};n.error=function(a,b){eb(this.c,a,b)};\nn.registerAdEvents=function(){pb(this.c,'javascript')};n.registerMediaEvents=function(){ob(this.c,'javascript')};function Y(a,b,c){'impression'==b?qb(a.c,'javascript')&&(kb(a.c,'javascript'),a.b&&Q(a.b)):('loaded'==b?(c=void 0===c?null:c,L(a.c,'javascript')&&lb(a.c,'javascript',c)):L(a.c,'javascript')&&mb(a.c,b,'javascript',c),['loaded','start'].includes(b)&&a.b&&Q(a.b))}n.injectVerificationScriptResources=function(a){var b=this.g;b.b.push.apply(b.b,q(a));if(this.f)try{Xb(this.g)}catch(c){J(c.message)}};\nn.setCreativeType=function(a,b){b=void 0===b?null:b;if(!this.a.b||this.a.a)this.a.a=a,'video'==a||'audio'==a?this.a.b='video':'htmlDisplay'==a||'nativeDisplay'==a?this.a.b='display':'definedByJavaScript'==a&&b&&(this.a.b='none'==b?'display':'video')};n.setImpressionType=function(a){if(!this.a.b||this.a.a)this.a.h=a};\nfunction bc(a,b){if('sessionStart'===b.type){a.f=!0;try{Xb(a.g)}catch(c){J(c.message)}}'sessionFinish'===b.type&&(a.f=!1,(b=H().c)&&'native'==b.adSessionType||a.registerSessionObserver(function(c){return bc(a,c)}))}n.setClientInfo=function(a,b,c){var d=this.a.c||{};d.omidJsInfo=Object.assign({},d.omidJsInfo,{sessionClientVersion:a,partnerName:b,partnerVersion:c});this.a.c=d;return this.a.c.omidJsInfo.serviceVersion};function cc(a){return/\\d+\\.\\d+\\.\\d+(-.*)?/.test(a)}function dc(a){a=a.split('-')[0].split('.');for(var b=['1','0','3'],c=0;3>c;c++){var d=parseInt(a[c],10),e=parseInt(b[c],10);if(d>e)break;else if(d<e)return!1}return!0};function ec(a,b){return cc(a)&&dc(a)?b?b:[]:b&&'string'===typeof b?JSON.parse(b):[]};var fc=new function(){};function gc(){var a=hc;var b=void 0===b?omidGlobal:b;this.a=a;this.g=b;this.b=new U;this.g.omid=this.g.omid||{};this.g.omid.v1_SessionServiceCommunication=this.b;this.f=b&&b.addEventListener&&b.postMessage?new Vb(b):null;this.c=null;this.b.a=this.h.bind(this);this.f&&(this.f.a=this.i.bind(this))}gc.prototype.h=function(a,b){null!=Tb(a.method)&&ic(this,fc)&&jc(this,a,b,this.b)};gc.prototype.i=function(a,b){null!=Tb(a.method)&&ic(this,b)&&jc(this,a,b,this.f)};\nfunction ic(a,b){a.c||(a.c=b);return a.c!=b?(J('The source of session client messages cannot be changed from the source of the first message.'),!1):!0}\nfunction jc(a,b,c,d){function e(h){for(var k=[],m=0;m<arguments.length;++m)k[m]=arguments[m];k=new T(f,'response',g,cc(g)&&dc(g)?k:JSON.stringify(k));d.b(k,c)}var f=b.b,l=b.method,g=b.version;b=ec(g,b.a);try{kc(a,l,e,b)}catch(h){d.b(new T(f,'error',g,'\\n        name: '+h.name+'\\n        message: '+h.message+'\\n        filename: '+h.filename+'\\n        lineNumber: '+h.lineNumber+'\\n        columnNumber: '+h.columnNumber+'\\n        stack: '+h.stack+'\\n        toString(): '+h.toString()),c)}}\nfunction kc(a,b,c,d){if(null!=Tb(b))switch(Tb(b)){case 'registerAdEvents':a.a.registerAdEvents();break;case 'registerMediaEvents':a.a.registerMediaEvents();break;case 'registerSessionObserver':a.a.registerSessionObserver(c);break;case 'setSlotElement':c=p(d).next().value;a.a.setSlotElement(c);break;case 'setVideoElement':c=p(d).next().value;a=a.a;c&&c.tagName&&'video'===c.tagName.toLowerCase()?(a.a.g=c,a.b&&ub(a.b)):J('setVideoElement called with a non-HTMLVideoElement. It will be ignored.');break;\ncase 'setElementBounds':c=p(d).next().value;a.a.setElementBounds(c);break;case 'startSession':J('Session start from JS is not supported in mobile app.');break;case 'finishSession':J('Session finish from JS is not supported in mobile app.');break;case 'impressionOccurred':Y(a.a,'impression');break;case 'loaded':(c=p(d).next().value)?(b={skippable:c.isSkippable,autoPlay:c.isAutoPlay,position:c.position},c.isSkippable&&(b.skipOffset=c.skipOffset),Y(a.a,'loaded',b)):Y(a.a,'loaded');break;case 'start':b=\np(d);c=b.next().value;b=b.next().value;Y(a.a,'start',{duration:c,mediaPlayerVolume:b});break;case 'firstQuartile':Y(a.a,'firstQuartile');break;case 'midpoint':Y(a.a,'midpoint');break;case 'thirdQuartile':Y(a.a,'thirdQuartile');break;case 'complete':Y(a.a,'complete');break;case 'pause':Y(a.a,'pause');break;case 'resume':Y(a.a,'resume');break;case 'bufferStart':Y(a.a,'bufferStart');break;case 'bufferFinish':Y(a.a,'bufferFinish');break;case 'skipped':Y(a.a,'skipped');break;case 'volumeChange':c={mediaPlayerVolume:p(d).next().value};\nY(a.a,'volumeChange',c);break;case 'playerStateChange':c={state:p(d).next().value};Y(a.a,'playerStateChange',c);break;case 'adUserInteraction':c={interactionType:p(d).next().value};Y(a.a,'adUserInteraction',c);break;case 'setClientInfo':var e=p(d);b=e.next().value;d=e.next().value;e=e.next().value;a=a.a.setClientInfo(b,d,e);c(a);break;case 'injectVerificationScriptResources':c=p(d).next().value;a.a.injectVerificationScriptResources(c);break;case 'setCreativeType':c=p(d).next().value;a.a.setCreativeType(c);\nbreak;case 'setImpressionType':c=p(d).next().value;a.a.setImpressionType(c);break;case 'setContentUrl':c=p(d).next().value;a.a.a.o=c;break;case 'sessionError':b=p(d),c=b.next().value,b=b.next().value,a.a.error(c,b)}};function Z(){var a=X,b=lc,c=mc,d=$b;this.f=hc;this.a=a;this.c=b;this.h=c;this.g=d;this.b=H()}n=Z.prototype;\nn.T=function(a){if(!(!(a&&M(a)&&O(a.impressionOwner,qa))||'videoEventsOwner'in a&&null!=a.videoEventsOwner&&!O(a.videoEventsOwner,qa)||'mediaEventsOwner'in a&&null!=a.mediaEventsOwner&&!O(a.mediaEventsOwner,qa))){if(a.creativeType&&a.impressionType){var b=a.mediaEventsOwner;null==this.b.a&&this.f.setCreativeType(a.creativeType,b);null==this.b.h&&(this.b.h=a.impressionType);ob(this.a,b)}else b=a.videoEventsOwner,this.b.b=null==b||'none'===b?'display':'video',this.b.a=null,this.b.h=null,ob(this.a,b);\npb(this.a,a.impressionOwner);a&&null!=a.isolateVerificationScripts&&'boolean'===typeof a.isolateVerificationScripts&&(this.b.C=a.isolateVerificationScripts)}};\nn.W=function(a,b,c,d){var e;if(M(b)){if(e=O(b.environment,ua)&&O(b.adSessionType,pa))e=b.omidNativeInfo,e=M(e)?N(e.partnerName)&&N(e.partnerVersion):!1;e&&(e=b.app,e=M(e)?N(e.libraryVersion)&&N(e.appId):!1)}else e=!1;e&&(Nb(d)&&(this.b.v=new Map(Object.entries(d))),d=this.f,c=void 0===c?null:c,null==a&&(a=Wb()),b.canMeasureVisibility=d.b.C(),d.a.adSessionId=a,a=d.a,e=b,void 0!==e.contentUrl&&(a.o=e.contentUrl,e.contentUrl=void 0),e=a.c||{},b.omidJsInfo=Object.assign({},e.omidJsInfo||{},b.omidJsInfo||\n{}),e=b=Object.assign({},e,b),a.C||(null!=a.g?(e.videoElement=a.g,e.accessMode='full'):null!=a.f&&(e.slotElement=a.f,e.accessMode='full')),a.c=b,fb(d.c,c),d.b&&Q(d.b))};n.U=function(){var a=this.f;jb(a.c);a.b.m()};n.$=function(a){M(a)&&sb(a.x)&&sb(a.y)&&sb(a.width)&&sb(a.height)&&(this.b.G=a,rb(this.c,'container'))};n.aa=function(a){O(a,ta)&&(this.b.m=a,'backgrounded'===a?rb(this.c,'container','backgrounded'):rb(this.c,'container'))};n.X=function(a){'impression'===a&&(this.M(),this.g&&Q(this.g))};\nn.M=function(){qb(this.a,'native')&&kb(this.a,'native')};n.V=function(a){a=void 0===a?null:a;L(this.a,'native')&&lb(this.a,'native',a)};n.error=function(a,b){O(a,oa)&&eb(this.a,a,b)};n.Y=function(a,b){this.N(a,b)};n.N=function(a,b){L(this.a,'native')&&O(a,A)&&(void 0===b||M(b))&&('loaded'==a?lb(this.a,'native',b):mb(this.a,a,'native',b))};\nn.Z=function(a){if('none'!==this.a.a.i&&'number'===typeof a&&!isNaN(a)){this.b.u=a;a=this.h;var b=a.a.B;null!=b&&mb(a.b,'volumeChange','native',{mediaPlayerVolume:b,deviceVolume:a.a.u})}};Z.prototype.startSession=Z.prototype.W;Z.prototype.error=Z.prototype.error;Z.prototype.finishSession=Z.prototype.U;Z.prototype.publishAdEvent=Z.prototype.X;Z.prototype.publishImpressionEvent=Z.prototype.M;Z.prototype.publishVideoEvent=Z.prototype.Y;Z.prototype.publishMediaEvent=Z.prototype.N;\nZ.prototype.publishLoadedEvent=Z.prototype.V;Z.prototype.setNativeViewHierarchy=Z.prototype.$;Z.prototype.setState=Z.prototype.aa;Z.prototype.setDeviceVolume=Z.prototype.Z;Z.prototype.init=Z.prototype.T;function nc(){var a=X,b=oc;var c=void 0===c?I:c;this.g=a;this.a=b;this.h={};this.f={};this.c=new U;c.omid=c.omid||{};c.omid.v1_VerificationServiceCommunication=this.c;this.b=null;c&&c.addEventListener&&c.postMessage&&(this.b=new Vb(c));this.c.a=this.i.bind(this);this.b&&(this.b.a=this.j.bind(this))}function pc(a,b,c,d){Db(a.a,b,c,d)}function qc(a,b,c,d){Cb(a.a,'downloadJavaScriptResource')(b,c,d)}nc.prototype.j=function(a,b){this.b&&rc(this,a,b,this.b)};nc.prototype.i=function(a,b){rc(this,a,b,this.c)};\nfunction rc(a,b,c,d){function e(F){for(var W=[],ra=0;ra<arguments.length;++ra)W[ra]=arguments[ra];W=new T(f,'response',g,cc(g)&&dc(g)?W:JSON.stringify(W));d.b(W,c)}var f=b.b,l=b.method,g=b.version;b=ec(g,b.a);if(null!=Ub(l,'VerificationService.')){l=Ub(l,'VerificationService.');try{switch(l){case 'addEventListener':var h=p(b).next().value;$a(a.g,h,e);break;case 'addSessionListener':var k=p(b),m=k.next().value,u=k.next().value;bb(a.g,e,m,u);break;case 'sendUrl':var w=p(b).next().value;pc(a,w,function(){return e(!0)},\nfunction(){return e(!1)});break;case 'setTimeout':var E=p(b),V=E.next().value,wc=E.next().value;a.h[V]=zb(a.a,'setTimeout')(e,wc);break;case 'clearTimeout':var xc=p(b).next().value;Bb(a.a,a.h[xc]);break;case 'setInterval':var Ob=p(b),yc=Ob.next().value,zc=Ob.next().value;a.f[yc]=yb(a.a,e,zc);break;case 'clearInterval':var Ac=p(b).next().value;Ab(a.a,a.f[Ac]);break;case 'injectJavaScriptResource':var Bc=p(b).next().value;qc(a,Bc,function(F){return e(!0,F)},function(){return e(!1)});break;case 'getVersion':p(b).next();\nvar Cc=H().c.omidJsInfo;e(Cc.serviceVersion)}}catch(F){d.b(new T(f,'error',g,'\\n              name: '+F.name+'\\n              message: '+F.message+'\\n              filename: '+F.filename+'\\n              lineNumber: '+F.lineNumber+'\\n              columnNumber: '+F.columnNumber+'\\n              stack: '+F.stack+'\\n              toString(): '+F.toString()+'\\n          '),c)}}};function sc(){var a=I.document.createElement('iframe');a.id='omid_v1_present';a.name='omid_v1_present';a.style.display='none';I.document.body.appendChild(a)}function tc(){var a=new MutationObserver(function(b){b.forEach(function(c){'BODY'===c.addedNodes[0].nodeName&&(sc(),a.disconnect())})});a.observe(I.document.documentElement,{childList:!0})};var X=new Ua,oc=new function(){var a;this.a=a=void 0===a?omidGlobal:a};new nc;var uc=new function(){},vc=new function(){},lc=new function(){this.b=X;this.c=vc;this.a=H()},Dc;I?Dc=I.IntersectionObserver&&(I.MutationObserver||I.ResizeObserver)?new S(I,uc,lc,X):new R(I,vc,lc,oc,X):Dc=null;var $b=Dc,ac=new function(){var a=X;var b=void 0===b?I:b;this.f=a;this.a=b;this.c=H();this.b=[]},hc=new Zb,mc=new function(){var a=X,b=H();this.b=a;this.a=b};I.omidBridge=new Z;new gc;\nif(I.frames&&I.document&&!('omid_v1_present'in I.frames)){var Ec;if(Ec=null==I.document.body)Ec='MutationObserver'in I;Ec?tc():I.document.body?sc():I.document.write('<iframe style=\"display:none\" id=\"omid_v1_present\" name=\"omid_v1_present\"></iframe>')};\n}).call(this, this);";
                                        AdSessionContext createNativeAdSessionContext2 = AdSessionContext.createNativeAdSessionContext(c0222b92.f52370b, str5, verificationScriptResources2, e11, str17);
                                        Intrinsics.checkNotNullExpressionValue(createNativeAdSessionContext2, "createNativeAdSessionContext(...)");
                                        try {
                                            hashMap3.put("omidAdSession", new T8("native_display_ad", ImpressionType.VIEWABLE, createNativeAdSessionContext2, false));
                                            fb.f51667b.put("deferred", Boolean.TRUE);
                                            a42 = this.f53106j;
                                        } catch (Exception e12) {
                                            e = e12;
                                            str = str3;
                                            str2 = str4;
                                        }
                                        if (a42 != null) {
                                            str = str3;
                                            str2 = str4;
                                            try {
                                                Intrinsics.checkNotNullExpressionValue(str2, str);
                                                ((B4) a42).a(str2, "OMID video ad session created and JavaScript resources injected");
                                            } catch (Exception e13) {
                                                e = e13;
                                                a4 = this.f53106j;
                                                if (a4 != null) {
                                                }
                                                Q4 q422 = Q4.f52013a;
                                                Q4.f52015c.a(AbstractC0513x4.a(e, "event"));
                                                str9 = str2;
                                                it = it2;
                                                z2 = z;
                                                str8 = str;
                                                ad = c0296h;
                                            }
                                            str9 = str2;
                                            it = it2;
                                            z2 = z;
                                            str8 = str;
                                        } else {
                                            ad = c0296h;
                                            it = it2;
                                            z2 = z;
                                            str8 = str3;
                                            str9 = str4;
                                        }
                                    }
                                }
                                ad = c0296h;
                                it = it2;
                                z2 = z;
                                str8 = str3;
                                str9 = str4;
                            }
                        }
                        ad = c0296h;
                    }
                }
            }
        }
    }

    public final W6 a(C0332j7 c0332j7) {
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "isSkippableVideo ", this));
        }
        Iterator it = c0332j7.c().iterator();
        while (it.hasNext()) {
            W6 w6 = (W6) c0332j7.n((String) it.next()).get(0);
            if (2 == w6.f52193k) {
                return w6;
            }
        }
        return null;
    }

    public final void a(boolean z, @Nullable S9 s9) {
        Set<Fb> d2;
        AdConfig.ViewabilityConfig viewability;
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).a("w0", AbstractC0311i0.a("w0", "TAG", "omidSessionForHtmlMarkup ", this));
        }
        AdConfig adConfig = this.f53098b;
        AdConfig.OmidConfig omidConfig = (adConfig == null || (viewability = adConfig.getViewability()) == null) ? null : viewability.getOmidConfig();
        if (omidConfig == null || omidConfig.isOmidEnabled()) {
            AbstractC0208a9.f52330a.getClass();
            if (Omid.isActive() && (d2 = d(this.f53103g.indexOf(s9))) != null) {
                for (Fb fb : d2) {
                    if (3 == fb.f51666a) {
                        try {
                            String str = (String) fb.a("creativeType", String.class);
                            String str2 = (String) fb.a("customReferenceData", String.class);
                            Boolean bool = (Boolean) fb.a("isolateVerificationScripts", Boolean.class);
                            Byte b2 = (Byte) fb.a("impressionType", Byte.class);
                            T8 a2 = (str == null || bool == null || b2 == null) ? null : W8.a(str, s9, bool.booleanValue(), this.t.e(), b2.byteValue(), str2);
                            if (a2 != null) {
                                fb.f51667b.put("omidAdSession", a2);
                                fb.f51667b.put("deferred", Boolean.valueOf(z));
                                A4 a42 = this.f53106j;
                                if (a42 != null) {
                                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                                    ((B4) a42).a("w0", "OMID ad session created and WebView container registered with OMID");
                                }
                            } else {
                                A4 a43 = this.f53106j;
                                if (a43 != null) {
                                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                                    ((B4) a43).a("w0", "Ignoring IAB meta data for this ad markup");
                                }
                            }
                        } catch (Exception e2) {
                            A4 a44 = this.f53106j;
                            if (a44 != null) {
                                ((B4) a44).b("w0", Cc.a(e2, A5.a("w0", "TAG", "Setting up impression tracking for IAB encountered an unexpected error: ")));
                            }
                            Q4 q4 = Q4.f52013a;
                            Q4.f52015c.a(AbstractC0513x4.a(e2, "event"));
                        }
                    }
                }
            }
        }
    }

    public static final void a(AbstractC0496w0 abstractC0496w0, C0296h c0296h, String str) {
        A4 a4 = abstractC0496w0.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "updateAdForBlob ", abstractC0496w0));
        }
        c0296h.e(str);
        A4 a42 = abstractC0496w0.f53106j;
        if (a42 != null) {
            ((B4) a42).c("w0", AbstractC0311i0.a("w0", "TAG", "updateAd ", abstractC0496w0));
        }
        C0227c0 c0227c0 = abstractC0496w0.u;
        if (c0227c0 != null) {
            c0227c0.a(c0296h);
        }
    }

    public void a(@NotNull String blob, @Nullable String str) {
        Intrinsics.checkNotNullParameter(blob, "blob");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "saveBlob ", this));
        }
        C0469u c0469u = this.C;
        int hashCode = hashCode();
        C0483v0 c0483v0 = new C0483v0(this, str, blob);
        c0469u.getClass();
        C0469u.a(hashCode, c0483v0);
    }

    public void a(@NotNull String jsCallbackNamespace, @NotNull String callback, @NotNull G1 receiver, @Nullable String str) {
        Intrinsics.checkNotNullParameter(jsCallbackNamespace, "jsCallbackNamespace");
        Intrinsics.checkNotNullParameter(callback, "callback");
        Intrinsics.checkNotNullParameter(receiver, "receiver");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "getBlob ", this));
        }
        C0469u c0469u = this.C;
        int hashCode = hashCode();
        C0380n0 c0380n0 = new C0380n0(this, str, receiver, jsCallbackNamespace, callback);
        c0469u.getClass();
        C0469u.a(hashCode, c0380n0);
    }

    @UiThread
    public void a(@NotNull C0296h primaryAd, boolean z, short s) {
        C0227c0 c0227c0;
        Intrinsics.checkNotNullParameter(primaryAd, "ad");
        A4 a4 = this.f53106j;
        if (a4 != null) {
            ((B4) a4).c("w0", AbstractC0311i0.a("w0", "TAG", "onVastProcessCompleted ", this));
        }
        C0296h m2 = m();
        if (m2 == null || W()) {
            m2 = null;
        }
        if (m2 == null) {
            return;
        }
        A4 a42 = this.f53106j;
        if (a42 != null) {
            StringBuilder a2 = A5.a("w0", "TAG", "Vast processing completed for ad with impressionId : ");
            a2.append(m2.s());
            ((B4) a42).c("w0", a2.toString());
        }
        String u = m2.u();
        int hashCode = u.hashCode();
        if (hashCode != -1084172778) {
            if (hashCode != 3213227) {
                if (hashCode == 1236050372 && u.equals("htmlUrl")) {
                    return;
                }
            } else if (u.equals("html")) {
                return;
            }
        } else if (u.equals("inmobiJson")) {
            if (this.f53097a != 2 || (c0227c0 = this.u) == null) {
                A4 a43 = this.f53106j;
                if (a43 != null) {
                    Intrinsics.checkNotNullExpressionValue("w0", "TAG");
                    ((B4) a43).b("w0", "Found inconsistent state after vast processing");
                    return;
                }
                return;
            }
            c0227c0.a(primaryAd);
            C0283g0 p = p();
            String clientReqId = c0227c0.k();
            p.getClass();
            Intrinsics.checkNotNullParameter(primaryAd, "primaryAd");
            Intrinsics.checkNotNullParameter(clientReqId, "clientReqId");
            Set<C0544z9> y = primaryAd.y();
            if (y.isEmpty()) {
                ((AbstractC0496w0) p.f52533a).a(p.f52535c, true, (short) 0);
                return;
            }
            String uuid = UUID.randomUUID().toString();
            Intrinsics.checkNotNullExpressionValue(uuid, "toString(...)");
            C0338k c0338k = new C0338k(uuid, y, p.f52539g, null, 16);
            String f2 = primaryAd.f();
            if (f2 != null) {
                X0.a(c0338k, f2);
                return;
            }
            return;
        }
        A4 a44 = this.f53106j;
        if (a44 != null) {
            StringBuilder a3 = A5.a("w0", "TAG", "Can not handle fallback for");
            a3.append(m2.u());
            ((B4) a44).b("w0", a3.toString());
        }
        throw new IllegalStateException("Can not handle fallback for markup type: " + m2.u());
    }
}