Chomp v9.11版本的 MD5 值为:8dd6a6008d51ff2822fc9bfb17203c9f

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


package com.inmobi.media;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.util.Base64;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.URLUtil;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.AbsoluteLayout;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import androidx.appcompat.widget.RtlSpacingHelper;
import com.amazon.device.ads.DtbDeviceData;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import com.iab.omid.library.inmobi.Omid;
import com.iab.omid.library.inmobi.adsession.FriendlyObstructionPurpose;
import com.inmobi.adquality.models.AdQualityControl;
import com.inmobi.ads.WatermarkData;
import com.inmobi.ads.rendering.InMobiAdActivity;
import com.inmobi.commons.core.configs.AdConfig;
import com.inmobi.commons.core.configs.TelemetryConfig;
import com.inmobi.media.h;
import com.inmobi.media.la;
import com.inmobi.media.n4;
import com.inmobi.media.y6;
import com.inmobi.unification.sdk.model.Initialization.TimeoutConfigurations;
import com.smaato.sdk.richmedia.mraid.bridge.MraidJsMethods;
import com.smaato.sdk.video.vast.model.Ad;
import com.smaato.sdk.video.vast.model.Tracking;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@SuppressLint({"SetJavaScriptEnabled", "ViewConstructor", "ClickableViewAccessibility"})
public final class la extends WebView implements com.inmobi.media.h, x1, u1, y6.a, GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener, r9, ia {
    public static final na H0 = new a();
    public static final String I0 = "la";
    public cd A;
    public final e A0;
    public boolean B;
    public final d B0;
    public boolean C;
    public final dd C0;
    public String D;
    public v2 D0;
    public final AtomicBoolean E;
    public final h.a E0;
    public final Object F;
    public final WebChromeClient F0;
    public final Object G;
    public final y0 G0;
    public boolean H;
    public boolean I;
    public View J;
    public WebChromeClient.CustomViewCallback K;
    public int L;
    public long M;
    public String N;
    public FrameLayout O;
    public final AtomicBoolean P;
    public c5 Q;
    public String R;
    public Map<View, ? extends FriendlyObstructionPurpose> S;
    public w1 T;
    public com.inmobi.media.h U;
    public boolean V;
    public boolean W;
    public final byte f8524a;
    public x f8525a0;
    public final Set<ac> f8526b;
    public yc f8527b0;
    public String f8528c;
    public boolean f8529c0;
    public final boolean f8530d;
    public boolean f8531d0;
    public String f8532e;
    public boolean f8533e0;
    public long f8534f;
    public int f8535f0;
    public byte f8536g;
    public String f8537g0;
    public la f8538h;
    public int[] f8539h0;
    public WeakReference<Activity> f8540i;
    public long f8541i0;
    public WeakReference<ViewGroup> f8542j;
    public int f8543j0;
    public na f8544k;
    public int f8545k0;
    public String f8546l;
    public int f8547l0;
    public z6 f8548m;
    public final y6 f8549m0;
    public c7 f8550n;
    public final GestureDetector f8551n0;
    public b7 f8552o;
    public boolean f8553o0;
    public AdConfig f8554p;
    public final ma f8555p0;
    public boolean f8556q;
    public q3 f8557q0;
    public boolean f8558r;
    public String f8559r0;
    public e4 f8560s;
    public q9 f8561s0;
    public sa f8562t;
    public e0 f8563t0;
    public JSONObject f8564u;
    public final AtomicBoolean f8565u0;
    public JSONObject f8566v;
    public final boolean f8567v0;
    public boolean f8568w;
    public Map<String, m0> f8569w0;
    public boolean f8570x;
    public final c f8571x0;
    public boolean f8572y;
    public String f8573y0;
    public boolean f8574z;
    public z5 f8575z0;

    public static final class a extends na {
        @Override
        public void a(sb sbVar) {
            x5.j.i(sbVar, "telemetryOnAdImpression");
        }

        @Override
        public TimeoutConfigurations k() {
            return TimeoutConfigurations.Companion.a();
        }
    }

    public static final class b implements dd {
        public b() {
            la.this = r1;
        }

        @Override
        public void a(View view, boolean z10) {
            x5.j.i(view, "view");
            if (view instanceof la) {
                if (la.this.hasWindowFocus()) {
                    la.this.c(z10);
                } else {
                    la.this.c(false);
                }
            }
        }
    }

    public static final class c implements d0 {
        public c() {
            la.this = r1;
        }

        @Override
        public void a() {
            la.this.b("window.mraidview.broadcastEvent('AdReportFailed')");
        }

        @Override
        public void b() {
            la.this.b("window.mraidview.broadcastEvent('AdReportSuccess')");
        }

        @Override
        public void c() {
            la.this.b("window.mraidview.broadcastEvent('ScreenshotSuccess')");
        }
    }

    public static final class d implements y1 {
        public d() {
            la.this = r1;
        }

        @Override
        public void a() {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "onCCTScreenDismissed");
            }
            la.this.x();
        }

        @Override
        public void a(String str, String str2) {
            x5.j.i(str, "url");
            x5.j.i(str2, "api");
            la.this.getLandingPageHandler().a(str, str2);
        }

        @Override
        public void b() {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "onCCTScreenDisplayed");
            }
            la.this.getListener().f(la.this);
            la.a(la.this, (String) null, (String) null, (String) null);
        }
    }

    public static final class e implements y5 {
        public e() {
            la.this = r1;
        }

        @Override
        public void a() {
            la.this.getListener().a();
        }

        @Override
        public void a(Intent intent) {
            x5.j.i(intent, "intent");
            intent.putExtra("creativeId", la.this.getCreativeId());
            intent.putExtra("impressionId", la.this.getImpressionId());
            InMobiAdActivity.a aVar = InMobiAdActivity.f7825h;
            la laVar = la.this;
            InMobiAdActivity.f7827j = laVar;
            cb.f7995a.a(laVar.getContainerContext(), intent);
        }

        @Override
        public void a(String str, String str2, String str3) {
            x5.j.i(str2, "message");
            la.this.b(str, str2, str3);
        }

        @Override
        public void b(String str, String str2, String str3) {
            la.a(la.this, str, str2, str3);
        }
    }

    public static final class f implements h.a {
        public f() {
            la.this = r1;
        }

        @Override
        public void a() {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "onAdScreenDisplayFailed");
            }
            la.this.getListener().g();
        }

        @Override
        public void a(Object obj) {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "onAdScreenDisplayed");
            }
            la laVar = la.this;
            if (laVar.f8524a == 0) {
                if (laVar.getOriginalRenderView() != null) {
                    la originalRenderView = la.this.getOriginalRenderView();
                    if (originalRenderView != null) {
                        originalRenderView.setAndUpdateViewState("Expanded");
                    }
                } else {
                    la.this.setAndUpdateViewState("Expanded");
                }
                la.this.H = false;
            }
            la.this.getListener().f(la.this);
        }

        @Override
        public void b(Object obj) {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "onAdScreenDismissed");
            }
            la laVar = la.this;
            if (laVar.f8524a == 0) {
                laVar.setAndUpdateViewState("Default");
                la originalRenderView = la.this.getOriginalRenderView();
                if (originalRenderView != null) {
                    originalRenderView.setAndUpdateViewState("Default");
                }
            } else if (x5.j.d("Default", laVar.getViewState())) {
                la.this.setAndUpdateViewState("Hidden");
            }
            la.this.x();
        }
    }

    public static final class g implements y0 {
        public g() {
            la.this = r1;
        }

        @Override
        public void a(com.inmobi.media.f fVar) {
            x5.j.i(fVar, "assetBatch");
            if (fVar.f8200c == null || fVar.f8204g.size() <= 0) {
                return;
            }
            String str = "sendSaveContentResult(\"saveContent_" + ((Object) fVar.f8203f) + "\", 'success', \"" + ((Object) fVar.f8204g.get(0).f8099j) + "\");";
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str2 = la.I0;
                x5.j.h(str2, "TAG");
                c5Var.b(str2, x5.j.P(str, "Success injection "));
            }
            la.this.a(fVar.f8200c, str);
        }

        @Override
        public void a(com.inmobi.media.f fVar, byte b10) {
            x5.j.i(fVar, "assetBatch");
            if (fVar.f8200c == null || fVar.f8204g.size() <= 0) {
                return;
            }
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.put("url", fVar.f8204g.get(0).f8091b);
                jSONObject.put("reason", (int) fVar.f8204g.get(0).f8101l);
            } catch (JSONException unused) {
            }
            String jSONObject2 = jSONObject.toString();
            x5.j.h(jSONObject2, "result.toString()");
            String str = "sendSaveContentResult(\"saveContent_" + ((Object) fVar.f8203f) + "\", 'failed', \"" + pb.o.u1(false, jSONObject2, "\"", "\\\"") + "\");";
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str2 = la.I0;
                x5.j.h(str2, "TAG");
                c5Var.a(str2, x5.j.P(str, "Failure injection "));
            }
            la.this.a(fVar.f8200c, str);
        }
    }

    public static final class h extends WebChromeClient {
        public h() {
            la.this = r1;
        }

        public static final void a(GeolocationPermissions.Callback callback, String str, DialogInterface dialogInterface, int i10) {
            x5.j.i(callback, "$callback");
            x5.j.i(str, "$origin");
            callback.invoke(str, true, false);
        }

        public static final void a(JsResult jsResult, DialogInterface dialogInterface, int i10) {
            x5.j.i(jsResult, "$result");
            jsResult.confirm();
        }

        public static final boolean a(View view, MotionEvent motionEvent) {
            return true;
        }

        public static final boolean a(la laVar, h hVar, View view, int i10, KeyEvent keyEvent) {
            x5.j.i(laVar, "this$0");
            x5.j.i(hVar, "this$1");
            if (4 == keyEvent.getKeyCode() && keyEvent.getAction() == 0) {
                c5 c5Var = laVar.Q;
                if (c5Var != null) {
                    String str = la.I0;
                    x5.j.h(str, "TAG");
                    c5Var.b(str, "Back pressed when HTML5 video is playing.");
                }
                hVar.a();
                return true;
            }
            return false;
        }

        public static final void b(GeolocationPermissions.Callback callback, String str, DialogInterface dialogInterface, int i10) {
            x5.j.i(callback, "$callback");
            x5.j.i(str, "$origin");
            callback.invoke(str, false, false);
        }

        public static final void b(JsResult jsResult, DialogInterface dialogInterface, int i10) {
            x5.j.i(jsResult, "$result");
            jsResult.confirm();
        }

        public static final void c(JsResult jsResult, DialogInterface dialogInterface, int i10) {
            x5.j.i(jsResult, "$result");
            jsResult.cancel();
        }

        public final void a() {
            la laVar = la.this;
            if (laVar.J == null) {
                return;
            }
            WebChromeClient.CustomViewCallback customViewCallback = laVar.K;
            if (customViewCallback != null) {
                customViewCallback.onCustomViewHidden();
            }
            la laVar2 = la.this;
            laVar2.K = null;
            View view = laVar2.J;
            if ((view == null ? null : view.getParent()) != null) {
                View view2 = la.this.J;
                ViewParent parent = view2 == null ? null : view2.getParent();
                ViewGroup viewGroup = parent instanceof ViewGroup ? (ViewGroup) parent : null;
                if (viewGroup != null) {
                    viewGroup.removeView(la.this.J);
                }
                la.this.J = null;
            }
        }

        @Override
        public Bitmap getDefaultVideoPoster() {
            Bitmap defaultVideoPoster = super.getDefaultVideoPoster();
            return defaultVideoPoster == null ? Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888) : defaultVideoPoster;
        }

        @Override
        public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
            x5.j.i(consoleMessage, "cm");
            String str = consoleMessage.message() + " -- From line " + consoleMessage.lineNumber() + " of " + ((Object) consoleMessage.sourceId());
            c5 c5Var = la.this.Q;
            if (c5Var == null) {
                return true;
            }
            String str2 = la.I0;
            x5.j.h(str2, "TAG");
            c5Var.e(str2, x5.j.P(str, "Console message:"));
            return true;
        }

        @Override
        public void onGeolocationPermissionsShowPrompt(final String str, final GeolocationPermissions.Callback callback) {
            x5.j.i(str, AppMeasurementSdk.ConditionalUserProperty.ORIGIN);
            x5.j.i(callback, "callback");
            if (la.this.f8540i.get() != null) {
                new AlertDialog.Builder(la.this.f8540i.get()).setTitle("Location Permission").setMessage("Allow location access").setPositiveButton(17039370, new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i10) {
                        int i11 = r3;
                        String str2 = str;
                        GeolocationPermissions.Callback callback2 = callback;
                        switch (i11) {
                            case 0:
                                la.h.a(callback2, str2, dialogInterface, i10);
                                return;
                            default:
                                la.h.b(callback2, str2, dialogInterface, i10);
                                return;
                        }
                    }
                }).setNegativeButton(17039360, new DialogInterface.OnClickListener() {
                    @Override
                    public final void onClick(DialogInterface dialogInterface, int i10) {
                        int i11 = r3;
                        String str2 = str;
                        GeolocationPermissions.Callback callback2 = callback;
                        switch (i11) {
                            case 0:
                                la.h.a(callback2, str2, dialogInterface, i10);
                                return;
                            default:
                                la.h.b(callback2, str2, dialogInterface, i10);
                                return;
                        }
                    }
                }).create().show();
            }
            super.onGeolocationPermissionsShowPrompt(str, callback);
        }

        @Override
        public void onHideCustomView() {
            a();
            super.onHideCustomView();
        }

        @Override
        public boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
            x5.j.i(webView, "view");
            x5.j.i(str, "url");
            x5.j.i(str2, "message");
            x5.j.i(jsResult, "result");
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str3 = la.I0;
                x5.j.h(str3, "TAG");
                c5Var.b(str3, "jsAlert called with: " + str2 + str);
            }
            if (la.a(la.this, jsResult)) {
                Activity fullScreenActivity = la.this.getFullScreenActivity();
                if (fullScreenActivity != null) {
                    new AlertDialog.Builder(fullScreenActivity).setMessage(str2).setTitle(str).setPositiveButton(17039370, new h4.w(jsResult, 0)).setCancelable(false).create().show();
                    return true;
                }
                jsResult.cancel();
                return true;
            }
            return true;
        }

        @Override
        public boolean onJsConfirm(WebView webView, String str, String str2, JsResult jsResult) {
            x5.j.i(webView, "view");
            x5.j.i(str, "url");
            x5.j.i(str2, "message");
            x5.j.i(jsResult, "result");
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str3 = la.I0;
                x5.j.h(str3, "TAG");
                c5Var.b(str3, "jsConfirm called with: " + str2 + str);
            }
            if (la.a(la.this, jsResult)) {
                if (la.this.getFullScreenActivity() != null) {
                    new AlertDialog.Builder(la.this.getFullScreenActivity()).setMessage(str2).setPositiveButton(17039370, new h4.w(jsResult, 1)).setNegativeButton(17039360, new h4.w(jsResult, 2)).create().show();
                } else {
                    jsResult.cancel();
                }
            }
            return true;
        }

        @Override
        public boolean onJsPrompt(WebView webView, String str, String str2, String str3, JsPromptResult jsPromptResult) {
            x5.j.i(webView, "view");
            x5.j.i(str, "url");
            x5.j.i(str2, "message");
            x5.j.i(str3, "defaultValue");
            x5.j.i(jsPromptResult, "result");
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str4 = la.I0;
                x5.j.h(str4, "TAG");
                c5Var.b(str4, "jsPrompt called with: " + str2 + str);
            }
            if (la.a(la.this, jsPromptResult)) {
                if (la.this.getFullScreenActivity() == null) {
                    jsPromptResult.cancel();
                    return true;
                }
                return false;
            }
            return true;
        }

        @Override
        public void onProgressChanged(WebView webView, int i10) {
            c5 c5Var = la.this.Q;
            if (c5Var != null) {
                String str = la.I0;
                x5.j.h(str, "TAG");
                c5Var.e(str, x5.j.P(Integer.valueOf(i10), "webview progress changed - "));
            }
            super.onProgressChanged(webView, i10);
        }

        @Override
        public void onShowCustomView(View view, WebChromeClient.CustomViewCallback customViewCallback) {
            x5.j.i(view, "view");
            x5.j.i(customViewCallback, "callback");
            if (la.this.f8540i.get() != null) {
                la laVar = la.this;
                laVar.J = view;
                laVar.K = customViewCallback;
                view.setOnTouchListener(new h4.c(1));
                Activity activity = la.this.f8540i.get();
                FrameLayout frameLayout = activity == null ? null : (FrameLayout) activity.findViewById(16908290);
                View view2 = la.this.J;
                if (view2 != null) {
                    view2.setBackgroundColor(-16777216);
                }
                if (frameLayout != null) {
                    frameLayout.addView(la.this.J, new AbsoluteLayout.LayoutParams(-1, -1, 0, 0));
                }
                View view3 = la.this.J;
                if (view3 != null) {
                    view3.requestFocus();
                }
                final la laVar2 = la.this;
                View view4 = laVar2.J;
                View.OnKeyListener onKeyListener = new View.OnKeyListener() {
                    @Override
                    public final boolean onKey(View view5, int i10, KeyEvent keyEvent) {
                        return la.h.a(la.this, this, view5, i10, keyEvent);
                    }
                };
                if (view4 != null) {
                    view4.setOnKeyListener(onKeyListener);
                }
                if (view4 != null) {
                    view4.setFocusable(true);
                }
                if (view4 != null) {
                    view4.setFocusableInTouchMode(true);
                }
                if (view4 == null) {
                    return;
                }
                view4.requestFocus();
            }
        }
    }

    public la(Context context, byte b10, Set<ac> set, String str, boolean z10, String str2, long j4) {
        super(context.getApplicationContext());
        x5.j.i(context, "context");
        x5.j.i(str2, "landingScheme");
        this.f8524a = b10;
        this.f8526b = set;
        this.f8528c = str;
        this.f8530d = z10;
        this.f8532e = str2;
        this.f8534f = j4;
        this.f8540i = new WeakReference<>(null);
        this.f8546l = "Default";
        this.f8568w = true;
        this.f8570x = true;
        this.f8574z = true;
        this.A = cd.UNKNOWN;
        this.E = new AtomicBoolean(false);
        this.F = new Object();
        this.G = new Object();
        this.I = true;
        this.L = -1;
        this.M = Long.MIN_VALUE;
        this.P = new AtomicBoolean(false);
        this.f8533e0 = true;
        this.f8545k0 = RtlSpacingHelper.UNDEFINED;
        this.f8547l0 = RtlSpacingHelper.UNDEFINED;
        this.f8555p0 = new ma();
        this.f8565u0 = new AtomicBoolean(true);
        this.f8567v0 = x5.f9258b.a(context, "default").a("enableImraidLogs", false);
        this.f8571x0 = new c();
        this.f8573y0 = "html";
        this.A0 = new e();
        this.B0 = new d();
        this.C0 = new b();
        x5.j.h(I0, "TAG");
        x5.j.P(this, "init constructor ");
        this.U = this;
        this.f8531d0 = true;
        this.f8561s0 = new q9();
        this.f8549m0 = new y6(this);
        GestureDetector gestureDetector = new GestureDetector(context, this);
        this.f8551n0 = gestureDetector;
        gestureDetector.setOnDoubleTapListener(this);
        gestureDetector.setIsLongpressEnabled(b10 == 1);
        this.E0 = new f();
        this.F0 = new h();
        this.G0 = new g();
    }

    public la(Context context, byte b10, Set set, String str, boolean z10, String str2, long j4, int i10) {
        this(context, b10, (i10 & 4) != 0 ? null : set, (i10 & 8) != 0 ? null : str, (i10 & 16) != 0 ? false : z10, (i10 & 32) != 0 ? "DEFAULT" : str2, (i10 & 64) != 0 ? -1L : j4);
    }

    public static final void a(la laVar) {
        c5 c5Var;
        x5.j.i(laVar, "this$0");
        if (laVar.isAttachedToWindow() || (c5Var = laVar.Q) == null) {
            return;
        }
        c5Var.a();
    }

    public static final void a(la laVar, String str) {
        x5.j.i(laVar, "this$0");
        x5.j.i(str, "$js");
        try {
            if (laVar.E.get()) {
                return;
            }
            String str2 = "javascript:try{" + str + "}catch(e){}";
            c5 c5Var = laVar.Q;
            if (c5Var != null) {
                String str3 = I0;
                x5.j.h(str3, "TAG");
                c5Var.b(str3, x5.j.P(str2, "Injecting javascript:"));
            }
            c5 c5Var2 = laVar.Q;
            if (c5Var2 != null) {
                String str4 = I0;
                x5.j.h(str4, "TAG");
                c5Var2.e(str4, "evaluateScript " + laVar + ' ' + str2);
            }
            laVar.evaluateJavascript(str2, null);
        } catch (Exception e10) {
            c5 c5Var3 = laVar.Q;
            if (c5Var3 == null) {
                return;
            }
            String str5 = I0;
            c0.m0.v(str5, "TAG", e10, "SDK encountered an unexpected error injecting JavaScript in the Ad container; ", c5Var3, str5);
        }
    }

    public static final void a(la laVar, String str, String str2, String str3) {
        c5 c5Var = laVar.Q;
        if (c5Var != null) {
            String str4 = I0;
            c0.m0.u(str4, "TAG", laVar, "onUserLandingCompleted ", c5Var, str4);
        }
        laVar.b("window.imraid.broadcastEvent('onUserLandingCompleted');");
        if (str2 == null) {
            return;
        }
        laVar.a(str2, "broadcastEvent('" + ((Object) str) + "Successful','" + ((Object) str3) + "');");
    }

    public static final boolean a(la laVar, JsResult jsResult) {
        c5 c5Var = laVar.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", laVar, "shouldRenderPopup ", c5Var, str);
        }
        if (laVar.getRenderingConfig().shouldRenderPopup()) {
            return true;
        }
        jsResult.cancel();
        c5 c5Var2 = laVar.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", laVar, "firePopupBlockedEvent ", c5Var2, str2);
        }
        laVar.b("window.mraidview.popupBlocked('popupBlocked')");
        return false;
    }

    public static final void b(la laVar) {
        x5.j.i(laVar, "this$0");
        laVar.getListener().h();
    }

    public static final void c(la laVar) {
        x5.j.i(laVar, "this$0");
        laVar.getListener().i();
    }

    public static void getAdType$annotations() {
    }

    public static void getImpressionType$annotations() {
    }

    public static void getMarkupType$annotations() {
    }

    public static void getMarkupTypeAdUnit$annotations() {
    }

    private final AdConfig.MraidConfig getMraidConfig() {
        AdConfig adConfig = this.f8554p;
        if (adConfig != null) {
            return adConfig.getMraidConfig();
        }
        x5.j.Q("mAdConfig");
        throw null;
    }

    public static void getPlacementType$annotations() {
    }

    public static void getViewState$annotations() {
    }

    private final int getVisibilityTrackingMinPercentage() {
        if (x5.j.d("audio", getAdType())) {
            AdConfig adConfig = this.f8554p;
            if (adConfig != null) {
                return adConfig.getViewability().getAudioImpressionMinPercentageViewed();
            }
            x5.j.Q("mAdConfig");
            throw null;
        }
        AdConfig adConfig2 = this.f8554p;
        if (adConfig2 != null) {
            return adConfig2.getViewability().getWebImpressionMinPercentageViewed();
        }
        x5.j.Q("mAdConfig");
        throw null;
    }

    public static final void m66setWatermark$lambda2(la laVar) {
        x5.j.i(laVar, "this$0");
        if (laVar.P.get()) {
            return;
        }
        c5 c5Var = laVar.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "adding overlay to renderview");
        }
        FrameLayout overlayLayout = laVar.getOverlayLayout();
        if (overlayLayout != null && laVar.getParent() != null) {
            ViewParent parent = laVar.getParent();
            if (parent == null) {
                throw new NullPointerException("null cannot be cast to non-null type android.view.ViewGroup");
            }
            ((ViewGroup) parent).addView(overlayLayout, 0);
        }
        laVar.P.set(true);
    }

    @Override
    public void a() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "onFailure ", c5Var, str);
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, "Bitmap check failed, signalling failure.");
        }
        if (this.E.get()) {
            return;
        }
        new Handler(Looper.getMainLooper()).post(new h4.u(this, 2));
    }

    @Override
    public void a(byte b10, Map<String, String> map) {
        c5 c5Var = this.Q;
        if (c5Var == null) {
            return;
        }
        String str = I0;
        x5.j.h(str, "TAG");
        c5Var.b(str, "fireEvent " + this + ' ' + ((int) b10));
    }

    @SuppressLint({"AddJavascriptInterface"})
    @TargetApi(19)
    public final void a(na naVar, AdConfig adConfig, boolean z10, boolean z11) {
        int otherNetworkLoadsLimit;
        x5.j.i(adConfig, "adConfig");
        String str = I0;
        x5.j.h(str, "TAG");
        x5.j.P(this, "initialize ");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            c5Var.e(str, x5.j.P(this, "initialize "));
        }
        if (x5.j.d(this.f8573y0, "htmlUrl")) {
            getSettings().setMixedContentMode(2);
        }
        this.f8554p = adConfig;
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            c5Var2.b(str, x5.j.P(this, "setImpressionParams "));
        }
        if (this.f8526b == null) {
            v();
        } else {
            try {
                v();
                for (ac acVar : this.f8526b) {
                    if (acVar.f7908a == 2) {
                        if (acVar.f7909b.containsKey("type")) {
                            Object obj = acVar.f7909b.get("type");
                            if (obj == null) {
                                throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
                            }
                            this.f8536g = (byte) ((Integer) obj).intValue();
                        } else {
                            w();
                        }
                        if (acVar.f7909b.containsKey("time")) {
                            Object obj2 = acVar.f7909b.get("time");
                            if (obj2 == null) {
                                throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
                            }
                            this.f8545k0 = ((Integer) obj2).intValue();
                        } else {
                            u();
                        }
                        if (acVar.f7909b.containsKey("view")) {
                            Object obj3 = acVar.f7909b.get("view");
                            if (obj3 == null) {
                                throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
                            }
                            this.f8547l0 = ((Integer) obj3).intValue();
                        } else {
                            t();
                        }
                        if (this.f8536g != 2) {
                            continue;
                        } else {
                            if (acVar.f7909b.containsKey("pixel")) {
                                Object obj4 = acVar.f7909b.get("pixel");
                                if (obj4 == null) {
                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
                                }
                                this.f8543j0 = ((Integer) obj4).intValue();
                            } else {
                                w();
                            }
                            if (acVar.f7909b.containsKey("frame")) {
                                Object obj5 = acVar.f7909b.get("frame");
                                JSONArray jSONArray = obj5 instanceof JSONArray ? (JSONArray) obj5 : null;
                                if (jSONArray != null) {
                                    this.f8539h0 = new int[jSONArray.length()];
                                    int length = jSONArray.length();
                                    if (length > 0) {
                                        int i10 = 0;
                                        while (true) {
                                            int i11 = i10 + 1;
                                            int[] iArr = this.f8539h0;
                                            if (iArr != null) {
                                                Object obj6 = jSONArray.get(i10);
                                                if (obj6 == null) {
                                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.Int");
                                                }
                                                iArr[i10] = ((Integer) obj6).intValue();
                                            }
                                            if (i11 >= length) {
                                                break;
                                            }
                                            i10 = i11;
                                        }
                                    } else {
                                        continue;
                                    }
                                }
                            } else {
                                w();
                            }
                        }
                    }
                }
            } catch (JSONException unused) {
                c5 c5Var3 = this.Q;
                if (c5Var3 != null) {
                    String str2 = I0;
                    x5.j.h(str2, "TAG");
                    c5Var3.a(str2, "Exception in parsing the impressionType and pixel frame");
                }
                v();
            } catch (Exception unused2) {
                c5 c5Var4 = this.Q;
                if (c5Var4 != null) {
                    String str3 = I0;
                    x5.j.h(str3, "TAG");
                    c5Var4.a(str3, "SDK encountered an unexpected error in parsing impression parameters");
                }
                v();
            }
        }
        c5 c5Var5 = this.Q;
        if (c5Var5 != null) {
            String str4 = I0;
            c0.m0.u(str4, "TAG", this, "initLandingPageHandler ", c5Var5, str4);
        }
        a6 a6Var = new a6(this.f8530d, this.f8532e, getAdConfig().isCCTEnabled());
        Context context = getContext();
        x5.j.h(context, "context");
        setLandingPageHandler(new z5(context, a6Var, this.B0, this.A0, this, this.Q));
        this.f8544k = naVar;
        this.f8529c0 = z10;
        ViewParent parent = getParent();
        this.f8542j = new WeakReference<>(parent instanceof ViewGroup ? (ViewGroup) parent : null);
        this.f8533e0 = z11;
        setBackgroundColor(getRenderingConfig().getWebviewBackgroundColor());
        new a7(getMraidConfig().getUrl(), getMraidConfig().getMaxRetries(), getMraidConfig().getRetryInterval(), getMraidConfig().getExpiry(), this.Q).a();
        setImportantForAccessibility(2);
        setScrollable(false);
        getSettings().setMediaPlaybackRequiresUserGesture(false);
        getSettings().setJavaScriptEnabled(true);
        getSettings().setGeolocationEnabled(true);
        ma maVar = this.f8555p0;
        String adType = getAdType();
        if (x5.j.d(adType, "banner")) {
            AdConfig adConfig2 = this.f8554p;
            if (adConfig2 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            otherNetworkLoadsLimit = adConfig2.getRendering().getBannerNetworkLoadsLimit();
        } else if (x5.j.d(adType, "audio")) {
            AdConfig adConfig3 = this.f8554p;
            if (adConfig3 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            otherNetworkLoadsLimit = adConfig3.getRendering().getAudioNetworkLoadsLimit();
        } else {
            AdConfig adConfig4 = this.f8554p;
            if (adConfig4 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            otherNetworkLoadsLimit = adConfig4.getRendering().getOtherNetworkLoadsLimit();
        }
        maVar.f8903a = otherNetworkLoadsLimit;
        setWebViewClient(this.f8555p0);
        setWebChromeClient(this.F0);
        r5 r5Var = new r5(this, this.f8524a);
        c5 c5Var6 = this.Q;
        if (c5Var6 != null) {
            r5Var.f8914d = c5Var6;
        }
        addJavascriptInterface(r5Var, "sdkController");
        this.f8548m = new z6(this, getMarkupType());
        this.f8550n = new c7(this);
        this.f8552o = new b7(this);
        this.f8560s = new e4();
        this.f8562t = new sa(sa.DEFAULT_POSITION, true);
        this.f8563t0 = new e0(adConfig.getAdQuality(), this.Q);
    }

    @Override
    public void a(o9 o9Var) {
        c7 c7Var;
        x5.j.i(o9Var, DtbDeviceData.DEVICE_DATA_ORIENTATION_KEY);
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "onOrientationUpdate ", c5Var, str);
        }
        if (!x5.j.d("Resized", this.f8546l) || this.f8562t == null || (c7Var = this.f8550n) == null) {
            return;
        }
        c7Var.a();
    }

    @Override
    public void a(y6 y6Var) {
        x5.j.i(y6Var, "movementGestureDetector");
        if (!getRenderingConfig().getSupportedGestures().contains(2)) {
            c5 c5Var = this.Q;
            if (c5Var == null) {
                return;
            }
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "Pan gesture is disabled from config");
            return;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            StringBuilder x10 = a.a.x(str2, "TAG", "onPanDetected\n ");
            JSONArray jSONArray = y6Var.f9291j;
            x10.append(jSONArray == null ? null : Integer.valueOf(jSONArray.length()));
            x10.append(" \n ");
            x10.append(y6Var.f9291j);
            c5Var2.b(str2, qb.v.R0(x10.toString()));
        }
        b("window.imraidview.onGestureDetected('2', '" + y6Var.f9291j + "');");
    }

    @Override
    public void a(y6 y6Var, MotionEvent motionEvent, MotionEvent motionEvent2) {
        x5.j.i(y6Var, "movementGestureDetector");
        x5.j.i(motionEvent, "initialEvent");
        x5.j.i(motionEvent2, "endEvent");
        if (!getRenderingConfig().getSupportedGestures().contains(4)) {
            c5 c5Var = this.Q;
            if (c5Var == null) {
                return;
            }
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "Pinch gesture is disabled from config");
            return;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, qb.v.R0(" onScaleDetected\n " + motionEvent + " \n " + motionEvent2));
        }
        JSONArray jSONArray = new JSONArray();
        float f10 = 2;
        jSONArray.put(new JSONArray((Collection) q5.g.r(Float.valueOf((motionEvent2.getX(1) + motionEvent2.getX()) / f10), Float.valueOf((motionEvent2.getY(1) + motionEvent2.getY()) / f10))));
        b("window.imraidview.onGestureDetected('4', '" + jSONArray + "');");
    }

    @Override
    public void a(String str) {
        x5.j.i(str, "mraidApi");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "sendFraudBeaconAndTelemetryEvent ", c5Var, str2);
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var2.b(str3, "fireDetectAutoRedirectFraud " + this + ' ' + str);
        }
        b("window.mraidview.fireRedirectFraudBeacon('" + str + "')");
        String adType = getAdType();
        if (adType == null) {
            adType = "banner";
        }
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var3.e(str4, "sendTelemetryForAutoRedirectFraud " + this + ' ' + str + ' ' + adType);
        }
        HashMap hashMap = new HashMap();
        String creativeId = getCreativeId();
        if (creativeId != null) {
            hashMap.put("creativeId", creativeId);
        }
        hashMap.put("trigger", str);
        String impressionId = getImpressionId();
        if (impressionId != null) {
            hashMap.put("impressionId", impressionId);
        }
        hashMap.put(Ad.AD_TYPE, adType);
        a("BlockAutoRedirection", hashMap);
    }

    public final void a(String str, String str2) {
        x5.j.i(str2, "callback");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str3 = I0;
            c0.m0.u(str3, "TAG", this, "fireJavaScriptCallback ", c5Var, str3);
        }
        if (str == null) {
            return;
        }
        b(((Object) str) + '.' + str2);
    }

    @Override
    public void a(String str, String str2, String str3) {
        x5.j.i(str, "jsCallbackNamespace");
        x5.j.i(str2, "callback");
        x5.j.i(str3, "blob");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var.b(str4, "retrievedBlob");
        }
        a(str, str2 + '(' + str3 + ");");
    }

    public final void a(String str, Map<String, Object> map) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "processTelemetryEvent ", c5Var, str2);
        }
        getListener().b(str, map);
    }

    public final void a(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "fireNextAdLoadComplete ", c5Var, str);
        }
        String str2 = "window.imraidview.broadcastEvent('adLoadSuccess'," + z10 + ");";
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var2.e(str3, str2 + " Index: " + getCurrentRenderingPodAdIndex());
        }
        b(str2);
    }

    @Override
    public void b() {
        ViewGroup viewGroup;
        x xVar;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "dismissCurrentViewContainer ", c5Var, str);
        }
        b7 b7Var = this.f8552o;
        if (b7Var != null) {
            u6 u6Var = b7Var.f7941c;
            if (u6Var != null) {
                u6Var.a();
            }
            b7Var.f7941c = null;
        }
        if (x5.j.d("Expanded", this.f8546l)) {
            c5 c5Var2 = this.Q;
            if (c5Var2 != null) {
                String str2 = I0;
                c0.m0.u(str2, "TAG", this, "processCloseRequestOnExpandedRenderView ", c5Var2, str2);
            }
            if (!x5.j.d("Default", this.f8546l)) {
                this.H = true;
                z6 z6Var = this.f8548m;
                if (z6Var != null) {
                    c5 c5Var3 = z6Var.f9340f;
                    if (c5Var3 != null) {
                        String str3 = z6Var.f9337c;
                        x5.j.h(str3, "TAG");
                        c5Var3.e(str3, "closeExpandedView");
                    }
                    if (z6Var.f9335a.getOriginalRenderView() == null) {
                        ViewGroup viewGroup2 = z6Var.f9338d;
                        View rootView = viewGroup2 == null ? null : viewGroup2.getRootView();
                        if (rootView != null) {
                            View findViewById = rootView.findViewById(65535);
                            ViewParent parent = z6Var.f9335a.getParent();
                            ViewGroup viewGroup3 = parent instanceof ViewGroup ? (ViewGroup) parent : null;
                            if (viewGroup3 != null) {
                                viewGroup3.removeView(z6Var.f9335a);
                            }
                            ViewParent parent2 = findViewById == null ? null : findViewById.getParent();
                            viewGroup = parent2 instanceof ViewGroup ? parent2 : null;
                            if (viewGroup != null) {
                                viewGroup.removeView(findViewById);
                            }
                            ViewGroup viewGroup4 = z6Var.f9338d;
                            if (viewGroup4 != null) {
                                viewGroup4.addView(z6Var.f9335a, z6Var.f9339e, new RelativeLayout.LayoutParams(viewGroup4.getWidth(), viewGroup4.getHeight()));
                            }
                            z6Var.f9335a.q();
                        }
                    }
                }
                i();
                this.H = false;
            }
            this.f8574z = false;
        } else if (x5.j.d("Resized", this.f8546l)) {
            c5 c5Var4 = this.Q;
            if (c5Var4 != null) {
                String str4 = I0;
                c0.m0.u(str4, "TAG", this, "processCloseRequestOnResizedRenderView ", c5Var4, str4);
            }
            if (!x5.j.d("Default", this.f8546l)) {
                this.H = true;
                c7 c7Var = this.f8550n;
                if (c7Var != null) {
                    ViewParent parent3 = c7Var.f7990a.getParent();
                    ViewGroup viewGroup5 = parent3 instanceof ViewGroup ? (ViewGroup) parent3 : null;
                    View rootView2 = viewGroup5 == null ? null : viewGroup5.getRootView();
                    View findViewById2 = rootView2 == null ? null : rootView2.findViewById(65534);
                    ViewGroup viewGroup6 = c7Var.f7991b;
                    View rootView3 = viewGroup6 == null ? null : viewGroup6.getRootView();
                    View findViewById3 = rootView3 == null ? null : rootView3.findViewById(65535);
                    ViewParent parent4 = findViewById3 == null ? null : findViewById3.getParent();
                    ViewGroup viewGroup7 = parent4 instanceof ViewGroup ? (ViewGroup) parent4 : null;
                    ViewParent parent5 = findViewById2 == null ? null : findViewById2.getParent();
                    viewGroup = parent5 instanceof ViewGroup ? parent5 : null;
                    if (viewGroup != null) {
                        viewGroup.removeView(findViewById2);
                    }
                    if (viewGroup7 != null) {
                        viewGroup7.removeView(findViewById3);
                    }
                    if (viewGroup5 != null) {
                        viewGroup5.removeView(c7Var.f7990a);
                    }
                    ViewGroup viewGroup8 = c7Var.f7991b;
                    if (viewGroup8 != null) {
                        viewGroup8.addView(c7Var.f7990a, c7Var.f7992c, new RelativeLayout.LayoutParams(viewGroup8.getWidth(), viewGroup8.getHeight()));
                    }
                    c7Var.f7990a.q();
                }
                setAndUpdateViewState("Default");
                x();
                this.H = false;
            }
        } else if (x5.j.d("Default", this.f8546l)) {
            setAndUpdateViewState("Hidden");
            ViewParent parent6 = getParent();
            if (1 == this.f8524a) {
                i();
            } else if (parent6 instanceof ViewGroup) {
                ((ViewGroup) parent6).removeAllViews();
            }
        }
        if (m() && (xVar = this.f8525a0) != null) {
            xVar.a(this, getFullScreenActivity());
        }
        this.f8555p0.f8614e.clear();
    }

    @Override
    public void b(y6 y6Var, MotionEvent motionEvent, MotionEvent motionEvent2) {
        x5.j.i(y6Var, "movementGestureDetector");
        x5.j.i(motionEvent, "initialEvent");
        x5.j.i(motionEvent2, "endEvent");
        if (!getRenderingConfig().getSupportedGestures().contains(3)) {
            c5 c5Var = this.Q;
            if (c5Var == null) {
                return;
            }
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "Rotation gesture is disabled from config");
            return;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            StringBuilder x10 = a.a.x(str2, "TAG", " Rotation detected ");
            x10.append(y6Var.f9290i);
            x10.append(" \n ");
            x10.append(motionEvent);
            x10.append(" \n ");
            x10.append(motionEvent2);
            c5Var2.b(str2, qb.v.R0(x10.toString()));
        }
        JSONArray jSONArray = new JSONArray();
        jSONArray.put(new JSONArray((Collection) q5.g.r(Float.valueOf(motionEvent.getX()), Float.valueOf(motionEvent.getY()))));
        jSONArray.put(new JSONArray((Collection) q5.g.r(Float.valueOf(motionEvent.getX(1)), Float.valueOf(motionEvent.getY(1)))));
        jSONArray.put(new JSONArray((Collection) q5.g.r(Float.valueOf(motionEvent2.getX()), Float.valueOf(motionEvent2.getY()))));
        jSONArray.put(new JSONArray((Collection) q5.g.r(Float.valueOf(motionEvent2.getX(1)), Float.valueOf(motionEvent2.getY(1)))));
        b("window.imraidview.onGestureDetected('3', '" + jSONArray + "');");
    }

    public final void b(String str) {
        x5.j.i(str, "js");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var.e(str2, "injectJavaScript " + this + " - " + str);
        }
        new Handler(getContainerContext().getMainLooper()).postAtFrontOfQueue(new h4.v(0, this, str));
    }

    public final void b(String str, String str2) {
        x5.j.i(str2, "url");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str3 = I0;
            c0.m0.u(str3, "TAG", this, "processMediaPlaybackRequest ", c5Var, str3);
        }
        if (1 != this.f8524a && !x5.j.d("Expanded", this.f8546l)) {
            c5 c5Var2 = this.Q;
            if (c5Var2 == null) {
                return;
            }
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var2.a(str4, "Media playback is only supported on full screen ads! Ignoring request ...");
            return;
        }
        Activity activity = this.f8540i.get();
        if (activity != null) {
            b7 b7Var = this.f8552o;
            if (b7Var == null) {
                return;
            }
            b7Var.a(str2, activity);
            return;
        }
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str5 = I0;
            x5.j.h(str5, "TAG");
            c5Var3.a(str5, "Media playback is  not allowed before it is visible! Ignoring request ...");
        }
        b(str, "Media playback is  not allowed before it is visible! Ignoring request ...", MraidJsMethods.PLAY_VIDEO);
    }

    public final void b(String str, String str2, String str3) {
        x5.j.i(str2, "message");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var.b(str4, "fireError " + this + " - " + str2 + " - " + ((Object) str3));
        }
        if (str == null || str3 == null) {
            return;
        }
        a(str, "broadcastEvent('error',\"" + str2 + "\", \"" + ((Object) str3) + "\")");
    }

    public final void b(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "fireNextAdShowComplete ", c5Var, str);
        }
        String str2 = "window.imraidview.broadcastEvent('adShowSuccess'," + z10 + ");";
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var2.b(str3, str2 + " Index: " + getCurrentRenderingPodAdIndex());
        }
        b(str2);
    }

    @Override
    @TargetApi(11)
    public void c() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "destroyContainer ", c5Var, str);
        }
        if (this.E.get()) {
            return;
        }
        if (!this.f8574z) {
            this.f8574z = true;
            return;
        }
        this.E.set(true);
        v2 v2Var = this.D0;
        if (v2Var != null) {
            v2Var.b();
        }
        this.H = true;
        this.L = -1;
        removeJavascriptInterface("sdkController");
        b7 b7Var = this.f8552o;
        if (b7Var != null) {
            s6 s6Var = b7Var.f7942d;
            if (s6Var != null) {
                s6Var.b();
            }
            b7Var.f7942d = null;
            s6 s6Var2 = b7Var.f7943e;
            if (s6Var2 != null) {
                s6Var2.b();
            }
            b7Var.f7943e = null;
            s6 s6Var3 = b7Var.f7944f;
            if (s6Var3 != null) {
                s6Var3.b();
            }
            b7Var.f7944f = null;
        }
        this.f8540i.clear();
        WeakReference<ViewGroup> weakReference = this.f8542j;
        if (weakReference != null) {
            weakReference.clear();
        }
        yc ycVar = this.f8527b0;
        if (ycVar != null) {
            ycVar.e();
        }
        yc ycVar2 = this.f8527b0;
        if (ycVar2 != null) {
            ycVar2.a();
        }
        setFriendlyViews(null);
        this.f8557q0 = null;
        this.f8544k = null;
        this.U = null;
        this.f8525a0 = null;
        ViewParent parent = getParent();
        if (parent != null) {
            ((ViewGroup) parent).removeView(this);
            removeAllViews();
        }
        AdConfig adConfig = this.f8554p;
        if (adConfig == null) {
            x5.j.Q("mAdConfig");
            throw null;
        }
        AdConfig.OmidConfig omidConfig = adConfig.getViewability().getOmidConfig();
        if (this.f8531d0 && omidConfig.isOmidEnabled()) {
            m9.f8612c.getClass();
            if (Omid.isActive()) {
                new oa(this, omidConfig.getWebViewRetainTime()).a();
                return;
            }
        }
        destroy();
    }

    public final void c(String str) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "loadDataInWebView ", c5Var, str2);
        }
        this.H = false;
        if (this.E.get()) {
            return;
        }
        x5.j.f(str);
        loadDataWithBaseURL("", str, "text/html", "UTF-8", null);
    }

    public final void c(String str, String str2, String str3) {
        x5.j.i(str2, "contentId");
        x5.j.i(str3, "url");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str4 = I0;
            c0.m0.y(str4, "TAG", this, "processSaveContentRequest ", c5Var, str4);
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str5 = I0;
            x5.j.h(str5, "TAG");
            c5Var2.b(str5, "saveContent called: content ID: " + str2 + "; URL: " + str3);
        }
        if (g("saveContent")) {
            HashSet hashSet = new HashSet();
            hashSet.add(new ha((byte) -1, str3));
            String uuid = UUID.randomUUID().toString();
            x5.j.h(uuid, "randomUUID().toString()");
            com.inmobi.media.f fVar = new com.inmobi.media.f(uuid, null, hashSet, this.G0, str2);
            fVar.f8200c = str;
            x0.f9208a.a(fVar);
            return;
        }
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str6 = I0;
            x5.j.h(str6, "TAG");
            c5Var3.a(str6, "saveContent called despite the fact that it is not supported");
        }
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("url", str3);
            jSONObject.put("reason", 7);
        } catch (JSONException unused) {
        }
        String jSONObject2 = jSONObject.toString();
        x5.j.h(jSONObject2, "result.toString()");
        a(str, j6.g.j("sendSaveContentResult(\"saveContent_", str2, "\", 'failed', \"", pb.o.u1(false, jSONObject2, "\"", "\\\""), "\");"));
    }

    public final void c(boolean z10) {
        AdQualityControl adQualityControl;
        Activity activity;
        AdQualityControl adQualityControl2;
        cd cdVar = z10 ? cd.VISIBLE : cd.HIDDEN;
        if (this.A != cdVar) {
            c5 c5Var = this.Q;
            if (c5Var != null) {
                String str = I0;
                x5.j.h(str, "TAG");
                c5Var.b(str, "handleVisibilityChange " + cdVar + ' ' + this);
            }
            if (this.H) {
                return;
            }
            this.A = cdVar;
            if (z10) {
                getListener().j(this);
            }
            c5 c5Var2 = this.Q;
            if (c5Var2 != null) {
                String str2 = I0;
                x5.j.h(str2, "TAG");
                c5Var2.b(str2, "fireViewableChange " + this + ' ' + z10);
            }
            b("window.mraidview.broadcastEvent('viewableChange'," + z10 + ");");
            c5 c5Var3 = this.Q;
            if (c5Var3 != null) {
                String str3 = I0;
                x5.j.h(str3, "TAG");
                c5Var3.e(str3, "fireAQSession");
            }
            c5 c5Var4 = this.Q;
            if (c5Var4 != null) {
                String str4 = I0;
                StringBuilder x10 = a.a.x(str4, "TAG", "AQ - ");
                x10.append((Object) getAdType());
                x10.append(" type - sdk - ");
                x10.append(Build.VERSION.SDK_INT);
                c5Var4.b(str4, x10.toString());
            }
            boolean z11 = false;
            if (!x5.j.d(getAdType(), "int") || Build.VERSION.SDK_INT < 29 || (activity = this.f8540i.get()) == null) {
                e0 e0Var = this.f8563t0;
                if (e0Var == null) {
                    x5.j.Q("adQualityManager");
                    throw null;
                } else if (!e0Var.c()) {
                    c5 c5Var5 = e0Var.f8111b;
                    if (c5Var5 == null) {
                        return;
                    }
                    c5Var5.b("AdQualityManager", "session state invalid");
                    return;
                } else {
                    c5 c5Var6 = e0Var.f8111b;
                    if (c5Var6 != null) {
                        c5Var6.b("AdQualityManager", "session start trigger...");
                    }
                    e0Var.f8112c.set(true);
                    AdQualityControl adQualityControl3 = e0Var.f8116g;
                    if (adQualityControl3 != null && adQualityControl3.getTakeScreenshot()) {
                        z11 = true;
                    }
                    if (!z11 || (adQualityControl = e0Var.f8116g) == null) {
                        return;
                    }
                    e0Var.a((View) this, adQualityControl.getScreenshotDelayInSeconds() * ((float) TelemetryConfig.DEFAULT_MAX_EVENTS_TO_PERSIST), false, (d0) null);
                    return;
                }
            }
            e0 e0Var2 = this.f8563t0;
            if (e0Var2 == null) {
                x5.j.Q("adQualityManager");
                throw null;
            } else if (!e0Var2.c()) {
                c5 c5Var7 = e0Var2.f8111b;
                if (c5Var7 == null) {
                    return;
                }
                c5Var7.b("AdQualityManager", "session state invalid");
            } else {
                c5 c5Var8 = e0Var2.f8111b;
                if (c5Var8 != null) {
                    c5Var8.b("AdQualityManager", "session start trigger...");
                }
                e0Var2.f8112c.set(true);
                AdQualityControl adQualityControl4 = e0Var2.f8116g;
                if (adQualityControl4 != null && adQualityControl4.getTakeScreenshot()) {
                    z11 = true;
                }
                if (!z11 || (adQualityControl2 = e0Var2.f8116g) == null) {
                    return;
                }
                e0Var2.a(activity, adQualityControl2.getScreenshotDelayInSeconds() * ((float) TelemetryConfig.DEFAULT_MAX_EVENTS_TO_PERSIST), false, (d0) null);
            }
        }
    }

    public final void d(String str) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var.b(str2, "loadScript " + this + " - " + str);
        }
        loadUrl(str);
    }

    public final void d(boolean z10) {
        g3 g3Var;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "processDisableCloseRegionRequest " + this + ' ' + z10);
        }
        this.B = z10;
        View rootView = getRootView();
        if (rootView == null || (g3Var = (g3) rootView.findViewById(65531)) == null) {
            return;
        }
        g3Var.setVisibility(this.B ? 8 : 0);
    }

    @Override
    public boolean d() {
        return this.E.get();
    }

    public final void e(String str) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "loadUrlInWebView ", c5Var, str2);
        }
        this.H = false;
        if (this.E.get() || str == null) {
            return;
        }
        loadUrl(str);
    }

    public final void e(boolean z10) {
        g3 g3Var;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "processUseCustomCloseRequest " + this + ' ' + z10);
        }
        setUseCustomClose(z10);
        View rootView = getRootView();
        if (rootView == null || (g3Var = (g3) rootView.findViewById(65532)) == null) {
            return;
        }
        g3Var.setVisibility(this.f8572y ? 8 : 0);
    }

    @Override
    public boolean e() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "canRedirectExternally Called");
        }
        if (getRenderingConfig() == null) {
            return false;
        }
        return !getRenderingConfig().getAutoRedirectionEnforcement() || ((getViewTouchTimestamp() > (-1L) ? 1 : (getViewTouchTimestamp() == (-1L) ? 0 : -1)) != 0 && ((SystemClock.elapsedRealtime() - getViewTouchTimestamp()) > getRenderingConfig().getUserTouchResetTime() ? 1 : ((SystemClock.elapsedRealtime() - getViewTouchTimestamp()) == getRenderingConfig().getUserTouchResetTime() ? 0 : -1)) < 0);
    }

    @Override
    public void f() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "disableHardwareAcceleration called. ", c5Var, str);
        }
        this.I = false;
        try {
            la.class.getMethod("setLayerType", Integer.TYPE, Paint.class).invoke(this, 1, null);
        } catch (IllegalAccessException e10) {
            c5 c5Var2 = this.Q;
            if (c5Var2 == null) {
                return;
            }
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.a(str2, "disableHardwareAcceleration failed.", e10);
        } catch (IllegalArgumentException e11) {
            c5 c5Var3 = this.Q;
            if (c5Var3 == null) {
                return;
            }
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var3.a(str3, "disableHardwareAcceleration failed.", e11);
        } catch (NoSuchMethodException e12) {
            c5 c5Var4 = this.Q;
            if (c5Var4 == null) {
                return;
            }
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var4.a(str4, "disableHardwareAcceleration failed.", e12);
        } catch (InvocationTargetException e13) {
            c5 c5Var5 = this.Q;
            if (c5Var5 == null) {
                return;
            }
            String str5 = I0;
            x5.j.h(str5, "TAG");
            c5Var5.a(str5, "disableHardwareAcceleration failed.", e13);
        }
    }

    public final void f(String str) {
        int a4;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.y(str2, "TAG", this, "processExpandRequest ", c5Var, str2);
        }
        if (!x5.j.d("Default", this.f8546l) && !x5.j.d("Resized", this.f8546l)) {
            c5 c5Var2 = this.Q;
            if (c5Var2 == null) {
                return;
            }
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var2.a(str3, x5.j.P(this.f8546l, "Render view state must be either DEFAULT or RESIZED to admit the expand request. Current state:"));
            return;
        }
        this.H = true;
        z6 z6Var = this.f8548m;
        if (z6Var != null) {
            c5 c5Var3 = z6Var.f9340f;
            if (c5Var3 != null) {
                String str4 = z6Var.f9337c;
                x5.j.h(str4, "TAG");
                c5Var3.e(str4, "doExpand");
            }
            if (z6Var.f9338d == null) {
                ViewParent parent = z6Var.f9335a.getParent();
                ViewGroup viewGroup = parent instanceof ViewGroup ? (ViewGroup) parent : null;
                z6Var.f9338d = viewGroup;
                if (viewGroup != null) {
                    z6Var.f9339e = viewGroup.indexOfChild(z6Var.f9335a);
                }
            }
            e4 expandProperties = z6Var.f9335a.getExpandProperties();
            boolean isValidUrl = URLUtil.isValidUrl(str);
            la laVar = z6Var.f9335a;
            if (isValidUrl) {
                try {
                    la laVar2 = new la(laVar.getContainerContext(), (byte) 0, null, z6Var.f9335a.getImpressionId(), false, null, 0L, 116);
                    laVar2.a(z6Var.f9335a.getListener(), z6Var.f9335a.getAdConfig(), false, false);
                    laVar2.setOriginalRenderView(z6Var.f9335a);
                    x5.j.f(str);
                    laVar2.loadUrl(str);
                    laVar2.setPlacementId(z6Var.f9335a.getPlacementId());
                    laVar2.setAllowAutoRedirection(z6Var.f9335a.getAllowAutoRedirection());
                    laVar2.setCreativeId(z6Var.f9335a.getCreativeId());
                    a4 = InMobiAdActivity.f7825h.a((com.inmobi.media.h) laVar2);
                    if (expandProperties != null) {
                        laVar2.setUseCustomClose(z6Var.f9335a.f8572y);
                    }
                } catch (Exception e10) {
                    c5 c5Var4 = z6Var.f9340f;
                    if (c5Var4 != null) {
                        String str5 = z6Var.f9337c;
                        x5.j.h(str5, "TAG");
                        c5Var4.a(str5, "Exception while initializing Expanded browser", e10);
                    }
                    a.a.s(e10, z2.f9312a);
                    z6Var.f9335a.getListener().a(z6Var.f9335a, (short) 2176);
                }
            } else {
                laVar.setShouldFireRenderBeacon(false);
                ViewGroup viewGroup2 = z6Var.f9338d;
                if (viewGroup2 != null) {
                    c5 c5Var5 = z6Var.f9340f;
                    if (c5Var5 != null) {
                        String str6 = z6Var.f9337c;
                        x5.j.h(str6, "TAG");
                        c5Var5.e(str6, "replaceRenderViewWithPlaceholder");
                    }
                    FrameLayout frameLayout = new FrameLayout(z6Var.f9335a.getContainerContext());
                    ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(z6Var.f9335a.getWidth(), z6Var.f9335a.getHeight());
                    frameLayout.setId(65535);
                    viewGroup2.addView(frameLayout, z6Var.f9339e, layoutParams);
                    viewGroup2.removeView(z6Var.f9335a);
                }
                a4 = InMobiAdActivity.f7825h.a((com.inmobi.media.h) z6Var.f9335a);
            }
            z6Var.f9335a.getListener().j();
            Intent intent = new Intent(z6Var.f9335a.getContainerContext(), InMobiAdActivity.class);
            intent.putExtra("com.inmobi.ads.rendering.InMobiAdActivity.EXTRA_AD_ACTIVITY_TYPE", 102);
            intent.putExtra("com.inmobi.ads.rendering.InMobiAdActivity.EXTRA_AD_CONTAINER_INDEX", a4);
            intent.putExtra("com.inmobi.ads.rendering.InMobiAdActivity.EXTRA_AD_CONTAINER_TYPE", x5.j.d(z6Var.f9336b, "htmlUrl") ? 202 : 200);
            cb.f7995a.a(z6Var.f9335a.getContainerContext(), intent);
        }
        requestLayout();
        invalidate();
        setFocusable(true);
        setFocusableInTouchMode(true);
        requestFocus();
    }

    @Override
    public void g() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "onPixelDetected ", c5Var, str);
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, "Bitmap check successful, signalling success.");
        }
        if (this.E.get()) {
            return;
        }
        new Handler(Looper.getMainLooper()).post(new h4.u(this, 1));
    }

    @TargetApi(16)
    public final boolean g(String str) {
        c5 c5Var;
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.e(str2, "supports " + this + ' ' + ((Object) str));
        }
        boolean z10 = false;
        if (str != null) {
            switch (str.hashCode()) {
                case -1886160473:
                    if (!str.equals(MraidJsMethods.PLAY_VIDEO)) {
                        return false;
                    }
                    return true;
                case -1647691422:
                    if (!str.equals("inlineVideo")) {
                        return false;
                    }
                    if (this.f8556q && this.I) {
                        z10 = true;
                    }
                    c5Var = this.Q;
                    if (c5Var != null) {
                        return z10;
                    }
                    String str3 = I0;
                    x5.j.h(str3, "TAG");
                    c5Var.e(str3, x5.j.P(Boolean.valueOf(z10), "HTML5 video supported:"));
                    return z10;
                case 1509574865:
                    if (!str.equals("html5video")) {
                        return false;
                    }
                    if (this.f8556q) {
                        z10 = true;
                        break;
                    }
                    c5Var = this.Q;
                    if (c5Var != null) {
                    }
                    break;
                case 1642189884:
                    if (!str.equals("saveContent")) {
                        return false;
                    }
                    return true;
                case 1772979069:
                    str.equals("redirectFraudDetection");
                    return false;
                default:
                    return false;
            }
        } else {
            return false;
        }
    }

    @Override
    public AdConfig getAdConfig() {
        AdConfig adConfig = this.f8554p;
        if (adConfig != null) {
            return adConfig;
        }
        x5.j.Q("mAdConfig");
        throw null;
    }

    public final x getAdPodHandler() {
        return this.f8525a0;
    }

    public final e0 getAdQualityManager() {
        e0 e0Var = this.f8563t0;
        if (e0Var != null) {
            return e0Var;
        }
        x5.j.Q("adQualityManager");
        throw null;
    }

    @Override
    public String getAdType() {
        return this.R;
    }

    public final boolean getAllowAutoRedirection() {
        return this.W;
    }

    public Context getContainerContext() {
        Activity activity = this.f8540i.get();
        if (activity == null) {
            Context context = getContext();
            x5.j.h(context, "context");
            return context;
        }
        return activity;
    }

    public final String getContentURL() {
        return this.f8537g0;
    }

    public final v2 getContextualDataHandler() {
        return this.D0;
    }

    public final String getCreativeID() {
        String creativeId = getCreativeId();
        return creativeId == null ? "" : creativeId;
    }

    @Override
    public String getCreativeId() {
        return this.N;
    }

    public final String getCurrentPosition() {
        String jSONObject;
        JSONObject jSONObject2 = this.f8566v;
        return (jSONObject2 == null || (jSONObject = jSONObject2.toString()) == null) ? "" : jSONObject;
    }

    public final Object getCurrentPositionMonitor() {
        return this.G;
    }

    public final int getCurrentRenderingPodAdIndex() {
        x xVar = this.f8525a0;
        if (xVar == null) {
            return 0;
        }
        return xVar.a(this);
    }

    @Override
    public Object getDataModel() {
        return null;
    }

    public final String getDefaultPosition() {
        String jSONObject;
        JSONObject jSONObject2 = this.f8564u;
        return (jSONObject2 == null || (jSONObject = jSONObject2.toString()) == null) ? "" : jSONObject;
    }

    public final Object getDefaultPositionMonitor() {
        return this.F;
    }

    public final q3 getEmbeddedBrowserJSCallbacks() {
        return this.f8557q0;
    }

    public final e4 getExpandProperties() {
        return this.f8560s;
    }

    public Map<View, FriendlyObstructionPurpose> getFriendlyViews() {
        return this.S;
    }

    public final Activity getFullScreenActivity() {
        return this.f8540i.get();
    }

    @Override
    public h.a getFullScreenEventsListener() {
        return this.E0;
    }

    @Override
    public String getImpressionId() {
        return this.f8528c;
    }

    public final byte getImpressionType() {
        return this.f8536g;
    }

    public final z5 getLandingPageHandler() {
        z5 z5Var = this.f8575z0;
        if (z5Var != null) {
            return z5Var;
        }
        x5.j.Q("landingPageHandler");
        throw null;
    }

    public final String getLandingScheme() {
        return this.f8532e;
    }

    public final na getListener() {
        na naVar = this.f8544k;
        if (naVar == null) {
            c5 c5Var = this.Q;
            if (c5Var != null) {
                String str = I0;
                c0.m0.y(str, "TAG", this, "listener getter ", c5Var, str);
            }
            na naVar2 = H0;
            this.f8544k = naVar2;
            return naVar2;
        }
        return naVar;
    }

    @Override
    public String getMarkupType() {
        return this.f8573y0;
    }

    public final String getMarkupTypeAdUnit() {
        return this.f8573y0;
    }

    public final b7 getMediaProcessor() {
        return this.f8552o;
    }

    public final int getMinimumPixelsPainted() {
        return this.f8543j0;
    }

    public final String getMraidJsString() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "mraidJsString getter ", c5Var, str);
        }
        Context context = getContext();
        x5.j.h(context, "context");
        String a4 = new z9(context, "mraid_js_store").a("mraid_js_string");
        if (a4 == null) {
            StringBuilder sb2 = new StringBuilder(32013);
            sb2.append("var imIsObjValid=function(a){return\"undefined\"!=typeof a&&null!=a?!0:!1},EventListeners=function(a){this.event=a;this.count=0;var b=[];this.add=function(a){b.push(a);++this.count};this.remove=function(a){var e=!1,d=this;b=b.filter(function(b){if(b=b===a)--d.count,e=!0;return!b});return e};this.removeAll=function(){b=[];this.count=0};this.broadcast=function(a){b.forEach(function(b){try{b.apply({},a)}catch(d){}})};this.toString=function(){var c=[a,\":\"];b.forEach(function(a){c.push(\"|\",String(a),\"|\")});\nreturn c.join(\"\")}},InmobiObj=function(){this.listeners=[];this.addEventListener=function(a,b){try{if(imIsObjValid(b)&&imIsObjValid(a)){var c=this.listeners;c[a]||(c[a]=new EventListeners);c[a].add(b);\"micIntensityChange\"==a&&window.imraidview.startListeningMicIntensity();\"deviceMuted\"==a&&window.imraidview.startListeningDeviceMuteEvents();\"deviceVolumeChange\"==a&&window.imraidview.startListeningDeviceVolumeChange();\"volumeChange\"==a&&window.imraidview.startListeningVolumeChange();\"headphones\"==a&&\nwindow.imraidview.startListeningHeadphonePluggedEvents();\"backButtonPressed\"==a&&window.imraidview.startListeningForBackButtonPressedEvent();\"downloadStatusChanged\"==a&&window.imraidview.registerDownloaderCallbacks()}}catch(e){this.log(e)}};this.removeEventListener=function(a,b){if(imIsObjValid(a)){var c=this.listeners;imIsObjValid(c[a])&&(imIsObjValid(b)?c[a].remove(b):c[a].removeAll());\"micIntensityChange\"==a&&0==c[a].count&&window.imraidview.stopListeningMicIntensity();\"deviceMuted\"==a&&0==c[a].count&&\nwindow.imraidview.stopListeningDeviceMuteEvents();\"deviceVolumeChange\"==a&&0==c[a].count&&window.imraidview.stopListeningDeviceVolumeChange();\"volumeChange\"==a&&0==c[a].count&&window.imraidview.stopListeningVolumeChange();\"headphones\"==a&&0==c[a].count&&window.imraidview.stopListeningHeadphonePluggedEvents();\"backButtonPressed\"==a&&0==c[a].count&&window.imraidview.stopListeningForBackButtonPressedEvent();\"downloadStatusChanged\"==a&&0==c[a].count&&window.imraidview.unregisterDownloaderCallbacks()}};\nthis.broadcastEvent=function(a){if(imIsObjValid(a)){for(var b=Array(arguments.length),c=0;c<arguments.length;c++)b[c]=arguments[c];c=b.shift();try{this.listeners[c]&&this.listeners[c].broadcast(b)}catch(e){}}};this.sendSaveContentResult=function(a){if(imIsObjValid(a)){for(var b=Array(arguments.length),c=0;c<arguments.length;c++)if(2==c){var e=arguments[c],e=JSON.parse(e);b[c]=e}else b[c]=arguments[c];e=b[1];\"success\"!=e&&(c=b[0].substring(b[0].indexOf(\"_\")+1),imraid.saveContentIDMap[c]&&delete imraid.saveContentIDMap[c]);\nwindow.imraid.broadcastEvent(b[0],b[1],b[2])}}},__im__iosNativeMessageHandler=void 0;window.webkit&&(window.webkit.messageHandlers&&window.webkit.messageHandlers.nativeMessageHandler)&&(__im__iosNativeMessageHandler=window.webkit.messageHandlers.nativeMessageHandler);\nvar __im__iosNativeCall={nativeCallInFlight:!1,nativeCallQueue:[],executeNativeCall:function(a){this.nativeCallInFlight?this.nativeCallQueue.push(a):(this.nativeCallInFlight=!0,imIsObjValid(__im__iosNativeMessageHandler)?__im__iosNativeMessageHandler.postMessage(a):window.location=a)},nativeCallComplete:function(a){0==this.nativeCallQueue.length?this.nativeCallInFlight=!1:(a=this.nativeCallQueue.shift(),imIsObjValid(__im__iosNativeMessageHandler)?__im__iosNativeMessageHandler.postMessage(a):window.location=\na)}},IOSNativeCall=function(){this.urlScheme=\"\";this.executeNativeCall=function(a){if(imIsObjValid(__im__iosNativeMessageHandler)){e={};e.command=a;e.scheme=this.urlScheme;for(var b={},c=1;c<arguments.length;c+=2)d=arguments[c+1],null!=d&&(b[arguments[c]]=\"\"+d);e.params=b}else for(var e=this.urlScheme+\"://\"+a,d,b=!0,c=1;c<arguments.length;c+=2)d=arguments[c+1],null!=d&&(b?(e+=\"?\",b=!1):e+=\"&\",e+=arguments[c]+\"=\"+escape(d));__im__iosNativeCall.executeNativeCall(e);return\"OK\"};this.nativeCallComplete=\nfunction(a){__im__iosNativeCall.nativeCallComplete(a);return\"OK\"};this.updateKV=function(a,b){this[a]=b;var c=this.broadcastMap[a];c&&this.broadcastEvent(c,b)}};\n(function(){var a=window.mraidview={};a.orientationProperties={allowOrientationChange:!0,forceOrientation:\"none\",direction:\"right\"};var b=[],c=!1;a.detectAndBlockFraud=function(b){a.isPossibleFraud()&&a.fireRedirectFraudBeacon(b);return!1};a.popupBlocked=function(b){a.firePopupBlockedBeacon(b)};a.zeroPad=function(b){var a=\"\";10>b&&(a+=\"0\");return a+b};a.supports=function(b){console.log(\"bridge: supports (MRAID)\");if(\"string\"!=typeof b)window.mraid.broadcastEvent(\"error\",\"Supports method expects string parameter\",\n\"supports\");else return\"false\"!=sdkController.supports(\"window.mraidview\",b)};a.useCustomClose=function(b){try{sdkController.useCustomClose(\"window.mraidview\",b)}catch(a){imraidview.showAlert(\"use CustomClose: \"+a)}};a.close=function(){try{sdkController.close(\"window.mraidview\")}catch(b){imraidview.showAlert(\"close: \"+b)}};a.stackCommands=function(a,d){c?b.push(a):(eval(a),d&&(c=!0))};a.expand=function(b){try{\"undefined\"==typeof b&&(b=null),sdkController.expand(\"window.mraidview\",b)}catch(a){imraidview.showAlert(\"executeNativeExpand: \"+\na+\", URL = \"+b)}};a.setExpandProperties=function(b){try{b?this.props=b:b=null;if(\"undefined\"!=typeof b.lockOrientation&&null!=b.lockOrientation&&\"undefined\"!=typeof b.orientation&&null!=b.orientation){var c={};c.allowOrientationChange=!b.lockOrientation;c.forceOrientation=b.orientation;a.setOrientationProperties(c)}sdkController.setExpandProperties(\"window.mraidview\",a.stringify(b))}catch(f){imraidview.showAlert(\"executeNativesetExpandProperties: \"+f+\", props = \"+b)}};a.getExpandProperties=function(){try{return eval(\"(\"+\nsdkController.getExpandProperties(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getExpandProperties: \"+b)}};a.setOrientationProperties=function(b){try{b?(\"undefined\"!=typeof b.allowOrientationChange&&(a.orientationProperties.allowOrientationChange=b.allowOrientationChange),\"undefined\"!=typeof b.forceOrientation&&(a.orientationProperties.forceOrientation=b.forceOrientation)):b=null,sdkController.setOrientationProperties(\"window.mraidview\",a.stringify(a.orientationProperties))}catch(c){imraidview.showAlert(\"setOrientationProperties: \"+\nc+\", props = \"+b)}};a.getOrientationProperties=function(){return{forceOrientation:a.orientationProperties.forceOrientation,allowOrientationChange:a.orientationProperties.allowOrientationChange}};a.resizeProps=null;a.setResizeProperties=function(b){var c,f;try{c=parseInt(b.width);f=parseInt(b.height);if(isNaN(c)||isNaN(f)||1>c||1>f)throw\"Invalid\";b.width=c;b.height=f;a.resizeProps=b;sdkController.setResizeProperties(\"window.mraidview\",a.stringify(b))}catch(g){window.mraid.broadcastEvent(\"error\",\"Invalid properties.\",\n\"setResizeProperties\")}};a.getResizeProperties=function(){try{return eval(\"(\"+sdkController.getResizeProperties(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getResizeProperties: \"+b)}};a.open=function(b){\"undefined\"==typeof b&&(b=null);try{sdkController.open(\"window.mraidview\",b)}catch(a){imraidview.showAlert(\"open: \"+a)}};a.getScreenSize=function(){try{return eval(\"(\"+sdkController.getScreenSize(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getScreenSize: \"+b)}};a.getMaxSize=\nfunction(){try{return eval(\"(\"+sdkController.getMaxSize(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getMaxSize: \"+b)}};a.getCurrentPosition=function(){try{return eval(\"(\"+sdkController.getCurrentPosition(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getCurrentPosition: \"+b)}};a.getDefaultPosition=function(){try{return eval(\"(\"+sdkController.getDefaultPosition(\"window.mraidview\")+\")\")}catch(b){imraidview.showAlert(\"getDefaultPosition: \"+b)}};a.getState=function(){try{return String(sdkController.getState(\"window.mraidview\"))}catch(b){imraidview.showAlert(\"getState: \"+\nb)}};a.isViewable=function(){try{return sdkController.isViewable(\"window.mraidview\")}catch(b){imraidview.showAlert(\"isViewable: \"+b)}};a.getPlacementType=function(){return sdkController.getPlacementType(\"window.mraidview\")};a.close=function(){try{sdkController.close(\"window.mraidview\")}catch(b){imraidview.showAlert(\"close: \"+b)}};\"function\"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(b){return 0==this.indexOf(b)});a.playVideo=function(b){var a=\"\";null!=b&&(a=b);try{sdkController.playVideo(\"window.mraidview\",\na)}catch(c){imraidview.showAlert(\"playVideo: \"+c)}};a.stringify=function(b){if(\"undefined\"===typeof JSON){var c=\"\",f;if(\"undefined\"==typeof b.length)return a.stringifyArg(b);for(f=0;f<b.length;f++)0<f&&(c+=\",\"),c+=a.stringifyArg(b[f]);return c+\"]\"}return JSON.stringify(b)};a.stringifyArg=function(b){var a,c,g;c=typeof b;a=\"\";if(\"number\"===c||\"boolean\"===c)a+=args;else if(b instanceof Array)a=a+\"[\"+b+\"]\";else if(b instanceof Object){c=!0;a+=\"{\";for(g in b)null!==b[g]&&(c||(a+=\",\"),a=a+'\"'+g+'\":',c=\ntypeof b[g],a=\"number\"===c||\"boolean\"===c?a+b[g]:\"function\"===typeof b[g]?a+'\"\"':b[g]instanceof Object?a+this.stringify(args[i][g]):a+'\"'+b[g]+'\"',c=!1);a+=\"}\"}else b=b.replace(/\\\\/g,\"\\\\\\\\\"),b=b.replace(/\"/g,'\\\\\"'),a=a+'\"'+b+'\"';imraidview.showAlert(\"json:\"+a);return a};getPID=function(b){var a=\"\";null!=b&&(\"undefined\"!=typeof b.id&&null!=b.id)&&(a=b.id);return a};a.resize=function(){if(null==a.resizeProps)window.mraid.broadcastEvent(\"error\",\"Valid resize dimensions must be provided before calling resize\",\n\"resize\");else try{sdkController.resize(\"window.mraidview\")}catch(b){imraidview.showAlert(\"resize called in bridge\")}};a.storePicture=function(b){console.log(\"bridge: storePicture\");if(\"string\"!=typeof b)window.mraid.broadcastEvent(\"error\",\"storePicture method expects url as string parameter\",\"storePicture\");else{if(a.supports(\"storePicture\"))return!window.confirm(\"Do you want to download the file?\")?(window.mraid.broadcastEvent(\"error\",\"Store picture on \"+b+\" was cancelled by user.\",\"storePicture\"),\n!1):sdkController.storePicture(\"window.mraidview\",b);window.mraid.broadcastEvent(\"error\",\"Store picture on \"+b+\" was cancelled because it is unsupported in this device/app.\",\"storePicture\")}};a.fireMediaTrackingEvent=function(b,a){};a.fireMediaErrorEvent=function(b,a){};a.fireMediaTimeUpdateEvent=function(b,a,c){};a.fireMediaCloseEvent=function(b,a,c){};a.fireMediaVolumeChangeEvent=function(b,a,c){};a.broadcastEvent=function(){window.mraid.broadcastEvent.apply(window.mraid,arguments)}})();\n(function(){var a=window.mraid=new InmobiObj,b=window.mraidview,c=!1;b.isAdShownToUser=!1;b.onUserInteraction=function(){imraidview.onUserInteraction();c=!0};b.isPossibleFraud=function(){return a.supports(\"redirectFraudDetection\")&&(!b.isAdShownToUser||!c)};b.fireRedirectFraudBeacon=function(a){if(\"undefined\"!=typeof inmobi&&inmobi.recordEvent){var c={};c.trigger=a;c.isAdShown=b.isAdShownToUser.toString();inmobi.recordEvent(135,c)}};b.firePopupBlockedBeacon=function(b){if(\"undefined\"!=typeof inmobi&&\ninmobi.recordEvent){var a={};a.trigger=b;inmobi.recordEvent(136,a)}};window.onbeforeunload=function(){b.detectAndBlockFraud(\"redirect\")};a.addEventListener(\"viewableChange\",function(a){a&&!b.isAdShownToUser&&(b.isAdShownToUser=!0)});a.useCustomClose=b.useCustomClose;a.close=b.close;a.getExpandProperties=b.getExpandProperties;a.setExpandProperties=function(c){\"undefined\"!=typeof c&&(\"useCustomClose\"in c&&\"undefined\"!=typeof a.getState()&&\"expanded\"!=a.getState())&&a.useCustomClose(c.useCustomClose);\nb.setExpandProperties(c)};a.getResizeProperties=b.getResizeProperties;a.setResizeProperties=b.setResizeProperties;a.getOrientationProperties=b.getOrientationProperties;a.setOrientationProperties=b.setOrientationProperties;a.expand=b.expand;a.getMaxSize=b.getMaxSize;a.getState=b.getState;a.isViewable=b.isViewable;a.createCalendarEvent=function(b){window.mraid.broadcastEvent(\"error\",\"Method not supported\",\"createCalendarEvent\")};a.open=function(c){b.detectAndBlockFraud(\"mraid.open\")||(\"string\"!=typeof c?\na.broadcastEvent(\"error\",\"URL is required.\",\"open\"):b.open(c))};a.resize=b.resize;a.getVersion=function(){return\"2.0\"};a.getPlacementType=b.getPlacementType;a.playVideo=function(a){b.playVideo(a)};a.getScreenSize=b.getScreenSize;a.getCurrentPosition=b.getCurrentPosition;a.getDefaultPosition=b.getDefaultPosition;a.supports=function(a){return b.supports(a)};a.storePicture=function(c){\"string\"!=typeof c?a.broadcastEvent(\"error\",\"Request must specify a valid URL\",\"storePicture\"):b.storePicture(c)}})();\n(function(){var a=window.imraidview={};a.setOrientationProperties=function(b){try{b?(\"undefined\"!=typeof b.allowOrientationChange&&(mraidview.orientationProperties.allowOrientationChange=b.allowOrientationChange),\"undefined\"!=typeof b.forceOrientation&&(mraidview.orientationProperties.forceOrientation=b.forceOrientation),\"undefined\"!=typeof b.direction&&(mraidview.orientationProperties.direction=b.direction)):b=null,sdkController.setOrientationProperties(\"window.imraidview\",mraidview.stringify(mraidview.orientationProperties))}catch(c){a.showAlert(\"setOrientationProperties: \"+\nc+\", props = \"+b)}};a.getOrientationProperties=function(){return mraidview.orientationProperties};a.firePostStatusEvent=function(b){window.imraid.broadcastEvent(\"postStatus\",b)};a.fireMediaTrackingEvent=function(b,a){var e={};e.name=b;var d=\"inmobi_media_\"+b;\"undefined\"!=typeof a&&(null!=a&&\"\"!=a)&&(d=d+\"_\"+a);window.imraid.broadcastEvent(d,e)};a.fireMediaErrorEvent=function(b,a){var e={name:\"error\"};e.code=a;var d=\"inmobi_media_\"+e.name;\"undefined\"!=typeof b&&(null!=b&&\"\"!=b)&&(d=d+\"_\"+b);window.imraid.broadcastEvent(d,\ne)};a.fireMediaTimeUpdateEvent=function(b,a,e){var d={name:\"timeupdate\",target:{}};d.target.currentTime=a;d.target.duration=e;a=\"inmobi_media_\"+d.name;\"undefined\"!=typeof b&&(null!=b&&\"\"!=b)&&(a=a+\"_\"+b);window.imraid.broadcastEvent(a,d)};a.saveContent=function(b,a,e){window.imraid.addEventListener(\"saveContent_\"+b,e);sdkController.saveContent(\"window.imraidview\",b,a)};a.cancelSaveContent=function(b){sdkController.cancelSaveContent(\"window.imraidview\",b)};a.disableCloseRegion=function(b){sdkController.disableCloseRegion(\"window.imraidview\",\nb)};a.fireGalleryImageSelectedEvent=function(b,a,e){var d=new Image;d.src=\"data:image/jpeg;base64,\"+b;d.width=a;d.height=e;window.imraid.broadcastEvent(\"galleryImageSelected\",d)};a.fireCameraPictureCatpturedEvent=function(b,a,e){var d=new Image;d.src=\"data:image/jpeg;base64,\"+b;d.width=a;d.height=e;window.imraid.broadcastEvent(\"cameraPictureCaptured\",d)};a.fireMediaCloseEvent=function(b,a,e){var d={name:\"close\"};d.viaUserInteraction=a;d.target={};d.target.currentTime=e;a=\"inmobi_media_\"+d.name;\"undefined\"!=\ntypeof b&&(null!=b&&\"\"!=b)&&(a=a+\"_\"+b);window.imraid.broadcastEvent(a,d)};a.fireMediaVolumeChangeEvent=function(b,a,e){var d={name:\"volumechange\",target:{}};d.target.volume=a;d.target.muted=e;a=\"inmobi_media_\"+d.name;\"undefined\"!=typeof b&&(null!=b&&\"\"!=b)&&(a=a+\"_\"+b);window.imraid.broadcastEvent(a,d)};a.fireDeviceMuteChangeEvent=function(b){window.imraid.broadcastEvent(\"deviceMuted\",b)};a.fireDeviceVolumeChangeEvent=function(b){window.imraid.broadcastEvent(\"deviceVolumeChange\",b)};a.fireHeadphonePluggedEvent=\nfunction(b){window.imraid.broadcastEvent(\"headphones\",b)};a.showAlert=function(b){sdkController.showAlert(\"window.imraidview\",b)};a.openExternal=function(b,c){try{600<=getSdkVersionInt()?sdkController.openExternal(\"window.imraidview\",b,c):sdkController.openExternal(\"window.imraidview\",b)}catch(e){a.showAlert(\"openExternal: \"+e)}};a.log=function(b){try{sdkController.log(\"window.imraidview\",b)}catch(c){a.showAlert(\"log: \"+c)}};a.getPlatform=function(){return\"android\"};a.asyncPing=function(b){try{sdkController.asyncPing(\"window.imraidview\",\nb)}catch(c){a.showAlert(\"asyncPing: \"+c)}};a.startListeningDeviceMuteEvents=function(){sdkController.registerDeviceMuteEventListener(\"window.imraidview\")};a.stopListeningDeviceMuteEvents=function(){sdkController.unregisterDeviceMuteEventListener(\"window.imraidview\")};a.startListeningDeviceVolumeChange=function(){sdkController.registerDeviceVolumeChangeEventListener(\"window.imraidview\")};a.stopListeningDeviceVolumeChange=function(){sdkController.unregisterDeviceVolumeChangeEventListener(\"window.imraidview\")};\na.startListeningHeadphonePluggedEvents=function(){sdkController.registerHeadphonePluggedEventListener(\"window.imraidview\")};a.stopListeningHeadphonePluggedEvents=function(){sdkController.unregisterHeadphonePluggedEventListener(\"window.imraidview\")};getSdkVersionInt=function(){for(var b=a.getSdkVersion().split(\".\"),c=b.length,e=\"\",d=0;d<c;d++)e+=b[d];return parseInt(e)};a.getSdkVersion=function(){return window._im_imaiview.getSdkVersion()};a.supports=function(b){console.log(\"bridge: supports (IMRAID)\");\nif(\"string\"!=typeof b)window.imraid.broadcastEvent(\"error\",\"Supports method expects string parameter\",\"supports\");else return\"false\"!=sdkController.supports(\"window.imraidview\",b)};a.postToSocial=function(b,c,e,d){window.imraid.broadcastEvent(\"error\",\"Method not supported\",\"postToSocial\");a.log(\"Method postToSocial not supported\")};a.incentCompleted=function(b){if(\"object\"!=typeof b||null==b)sdkController.incentCompleted(\"window.imraidview\",null);else try{sdkController.incentCompleted(\"window.imraidview\",\nJSON.stringify(b))}catch(a){sdkController.incentCompleted(\"window.imraidview\",null)}};a.getOrientation=function(){try{return String(sdkController.getOrientation(\"window.imraidview\"))}catch(b){a.showAlert(\"getOrientation: \"+b)}};a.acceptAction=function(b){try{sdkController.acceptAction(\"window.imraidview\",mraidview.stringify(b))}catch(c){a.showAlert(\"acceptAction: \"+c+\", params = \"+b)}};a.rejectAction=function(b){try{sdkController.rejectAction(\"window.imraidview\",mraidview.stringify(b))}catch(c){a.showAlert(\"rejectAction: \"+\nc+\", params = \"+b)}};a.updateToPassbook=function(b){window.imraid.broadcastEvent(\"error\",\"Method not supported\",\"updateToPassbook\");a.log(\"Method not supported\")};a.isDeviceMuted=function(){return\"false\"!=sdkController.isDeviceMuted(\"window.imraidview\")};a.getDeviceVolume=function(){return 603>=getSdkVersionInt()?-1:sdkController.getDeviceVolume(\"window.imraidview\")};a.isHeadPhonesPlugged=function(){return\"false\"!=sdkController.isHeadphonePlugged(\"window.imraidview\")};a.sendSaveContentResult=function(){window.imraid.sendSaveContentResult.apply(window.imraid,\narguments)};a.broadcastEvent=function(){window.imraid.broadcastEvent.apply(window.imraid,arguments)};a.disableBackButton=function(b){void 0==b||\"boolean\"!=typeof b?console.log(\"disableBackButton called with invalid params\"):sdkController.disableBackButton(\"window.imraidview\",b)};a.isBackButtonDisabled=function(){return sdkController.isBackButtonDisabled(\"window.imraidview\")};a.startListeningForBackButtonPressedEvent=function(){sdkController.registerBackButtonPressedEventListener(\"window.imraidview\")};\na.stopListeningForBackButtonPressedEvent=function(){sdkController.unregisterBackButtonPressedEventListener(\"window.imraidview\")};a.hideStatusBar=function(){};a.setOpaqueBackground=function(){};a.startDownloader=function(b,a,e){682<=getSdkVersionInt()&&sdkController.startDownloader(\"window.imraidview\",b,a,e)};a.registerDownloaderCallbacks=function(){682<=getSdkVersionInt()&&sdkController.registerDownloaderCallbacks(\"window.imraidview\")};a.unregisterDownloaderCallbacks=function(){682<=getSdkVersionInt()&&\nsdkController.unregisterDownloaderCallbacks(\"window.imraidview\")};a.getDownloadProgress=function(){return 682<=getSdkVersionInt()?sdkController.getDownloadProgress(\"window.imraidview\"):-1};a.getDownloadStatus=function(){return 682<=getSdkVersionInt()?sdkController.getDownloadStatus(\"window.imraidview\"):-1};a.fireEvent=function(b){700<=getSdkVersionInt()&&(\"fireSkip\"===b?sdkController.fireSkip(\"window.imraidview\"):\"fireComplete\"===b?sdkController.fireComplete(\"window.imraidview\"):\"showEndCard\"===b&&\nsdkController.showEndCard(\"window.imraidview\"))};a.saveBlob=function(b){700<=getSdkVersionInt()&&sdkController.saveBlob(\"window.imraidview\",b)};a.getBlob=function(b,a){700<=getSdkVersionInt()&&sdkController.getBlob(b,a)};a.setCloseEndCardTracker=function(b){700<=getSdkVersionInt()&&sdkController.setCloseEndCardTracker(\"window.imraidview\",b)};a.getRenderableAdIndexes=function(){try{if(917<=getSdkVersionInt())return sdkController.getRenderableAdIndexes(\"window.imraidview\")}catch(b){}return\"[]\"};a.getCurrentRenderingIndex=\nfunction(){try{if(917<=getSdkVersionInt())return sdkController.getCurrentRenderingIndex(\"window.imraidview\")}catch(b){}return-1};a.showAd=function(b){try{917<=getSdkVersionInt()&&sdkController.showAd(\"window.imraidview\",b)}catch(a){}};a.timeSinceShow=function(){try{if(917<=getSdkVersionInt())return sdkController.timeSinceShow(\"window.imraidview\")}catch(b){}return-1};a.getShowTimeStamp=function(){try{if(917<=getSdkVersionInt())return sdkController.getShowTimeStamp(\"window.imraidview\")}catch(b){}return-1};\na.closeAll=function(){try{917<=getSdkVersionInt()&&sdkController.closeAll(\"window.imraidview\")}catch(b){}};a.loadAd=function(b){try{917<=getSdkVersionInt()&&sdkController.loadAd(\"window.imraidview\",b)}catch(a){}};a.setAdContext=function(b){try{917<=getSdkVersionInt()&&sdkController.setAdContext(\"window.imraidview\",b)}catch(a){}};a.getAdContext=function(){try{if(917<=getSdkVersionInt())return sdkController.getAdContext(\"window.imraidview\")}catch(b){}return\"\"};a.openWithoutTracker=function(b){try{\"undefined\"==\ntypeof b&&(b=null),sdkController.openWithoutTracker(\"window.imraidview\",b)}catch(a){}};a.impressionRendered=function(){window.imraid.broadcastEvent(\"impressionRendered\")};a.customExpand=function(b,c,e,d,f){try{void 0==e||\"number\"!=typeof e?console.log(\"screenPercentage called with invalid params\"):void 0==c||\"number\"!=typeof c?console.log(\"inputType called with invalid params\"):void 0==d||\"boolean\"!=typeof d?console.log(\"topNavBarVisible called with invalid params\"):void 0==f||\"boolean\"!=typeof f?\nconsole.log(\"bottomNavBarVisible called with invalid params\"):sdkController.customExpand(\"window.imraidview\",b,c,e,d,f)}catch(g){a.showAlert(\"executeNativeCustomExpand: \"+g+\", input = \"+b+\", inputType = \"+c+\", screenPercentage = \"+e+\", bottomNavBarVisible = \"+f+\", topNavBarVisible = \"+d)}};a.closeCustomExpand=function(){try{sdkController.closeCustomExpand(\"window.imraidview\")}catch(b){}};a.onGestureDetected=function(b,a){window.imraid.broadcastEvent(\"onGestureDetected\",b,a)};a.onUserLandingCompleted=\nfunction(){window.imraid.broadcastEvent(\"onUserLandingCompleted\")};a.onUserInteraction=function(){window.imraid.broadcastEvent(\"onUserInteraction\")};a.impressionFired=function(){try{sdkController.impressionFired(\"window.imraidview\")}catch(b){}};a.getMaxDeviceVolume=function(){try{return sdkController.getMaxDeviceVolume(\"window.imraidview\")}catch(b){return 15}};a.zoom=function(b){try{sdkController.zoom(\"window.imraidview\",b)}catch(a){}};a.onAudioStateChanged=function(b){try{sdkController.onAudioStateChanged(\"window.imraidview\",\nb)}catch(a){}};a.submitAdReport=function(b){try{sdkController.submitAdReport(\"window.imraidview\",void 0!=b.adQualityUrl?b.adQualityUrl:null,void 0!=b.enableUserAdReportScreenshot?b.enableUserAdReportScreenshot:null,void 0!=b.templateInfo?b.templateInfo:null)}catch(a){}};a.onUserAudioMuteInteraction=function(b){try{sdkController.onUserAudioMuteInteraction(\"window.imraidview\",b)}catch(a){}}})();\n(function(){var a=window.imraid=new InmobiObj,b=window.imraidview;a.getOrientation=b.getOrientation;a.setOrientationProperties=b.setOrientationProperties;a.getOrientationProperties=b.getOrientationProperties;a.saveContentIDMap={};a.saveContent=function(c,e,d){var f=arguments.length,g,h=null;if(3>f){if(\"function\"===typeof arguments[f-1])g=arguments[f-1];else return;h={reason:1}}else a.saveContentIDMap[c]&&(g=arguments[2],h={reason:11,url:arguments[1]});\"function\"!==!g&&(h?(window.imraid.addEventListener(\"saveContent_failed_\"+\nc,g),window.imraid.sendSaveContentResult(\"saveContent_failed_\"+c,\"failed\",JSON.stringify(h))):(a.removeEventListener(\"saveContent_\"+c),a.saveContentIDMap[c]=!0,b.saveContent(c,e,d)))};a.cancelSaveContent=function(a){b.cancelSaveContent(a)};a.asyncPing=function(c){\"string\"!=typeof c?a.broadcastEvent(\"error\",\"URL is required.\",\"asyncPing\"):b.asyncPing(c)};a.disableCloseRegion=b.disableCloseRegion;a.getSdkVersion=b.getSdkVersion;a.log=function(c){\"undefined\"==typeof c?a.broadcastEvent(\"error\",\"message is required.\",\n\"log\"):\"string\"==typeof c?b.log(c):b.log(JSON.stringify(c))};a.getInMobiAIVersion=function(){return\"2.0\"};a.getVendorName=function(){return\"inmobi\"};a.openExternal=function(a,e){console.log(\"openExternal is deprecated, will be removed in future version\");mraidview.detectAndBlockFraud(\"imraid.openExternal\")||b.openExternal(a,e)};a.updateToPassbook=function(c){mraidview.detectAndBlockFraud(\"imraid.updateToPassbook\")||(\"string\"!=typeof c?a.broadcastEvent(\"error\",\"Request must specify a valid URL\",\"updateToPassbook\"):\nb.updateToPassbook(c))};a.postToSocial=function(a,e,d,f){mraidview.detectAndBlockFraud(\"imraid.postToSocial\")||b.postToSocial(a,e,d,f)};a.getPlatform=b.getPlatform;a.incentCompleted=b.incentCompleted;a.loadSKStore=b.loadSKStore;a.showSKStore=function(a){mraidview.detectAndBlockFraud(\"imraid.showSKStore\")||b.showSKStore(a)};a.skoverlay=b.skoverlay;a.skoverlayWithSkan=b.skoverlayWithSkan;a.zoom=b.zoom;a.dismissSKOverlay=b.dismissSKOverlay;a.supports=function(a){return b.supports(a)};a.isDeviceMuted=\nfunction(){return!imIsObjValid(a.listeners.deviceMuted)?-1:b.isDeviceMuted()};a.isHeadPhonesPlugged=function(){return!imIsObjValid(a.listeners.headphones)?!1:b.isHeadPhonesPlugged()};a.getDeviceVolume=function(){return b.getDeviceVolume()};a.setDeviceVolume=function(a){b.setDeviceVolume(a)};a.hideStatusBar=function(){b.hideStatusBar()};a.setOpaqueBackground=function(){b.setOpaqueBackground()};a.getRenderableAdIndexes=b.getRenderableAdIndexes;a.getCurrentRenderingIndex=b.getCurrentRenderingIndex;a.showAd=\nb.showAd;a.timeSinceShow=b.timeSinceShow;a.closeAll=b.closeAll;a.loadAd=b.loadAd;a.setAdContext=b.setAdContext;a.getAdContext=b.getAdContext;a.getShowTimeStamp=b.getShowTimeStamp;a.disableBackButton=b.disableBackButton;a.isBackButtonDisabled=b.isBackButtonDisabled;a.startDownloader=b.startDownloader;a.getDownloadProgress=b.getDownloadProgress;a.getDownloadStatus=b.getDownloadStatus;a.fireEvent=b.fireEvent;a.saveBlob=b.saveBlob;a.getBlob=b.getBlob;a.setCloseEndCardTracker=b.setCloseEndCardTracker;\na.openWithoutTracker=b.openWithoutTracker;a.impressionRendered=b.impressionRendered;a.onGestureDetected=b.onGestureDetected;a.onUserLandingCompleted=b.onUserLandingCompleted;a.customExpand=b.customExpand;a.closeCustomExpand=b.closeCustomExpand;a.impressionFired=b.impressionFired;a.getImraidVersion=b.getImraidVersion;a.getMaxDeviceVolume=b.getMaxDeviceVolume;a.onAudioStateChanged=b.onAudioStateChanged;a.onUserAudioMuteInteraction=b.onUserAudioMuteInteraction;a.submitAdReport=b.submitAdReport})();\n(function(){var a=window._im_imaiview={ios:{}};window.imaiview=a;a.broadcastEvent=function(){for(var a=Array(arguments.length),c=0;c<arguments.length;c++)a[c]=arguments[c];c=a.shift();try{window.mraid.broadcastEvent(c,a)}catch(e){}};a.getPlatform=function(){return\"android\"};a.getPlatformVersion=function(){return sdkController.getPlatformVersion(\"window.imaiview\")};a.log=function(a){sdkController.log(\"window.imaiview\",a)};a.openEmbedded=function(a){sdkController.openEmbedded(\"window.imaiview\",a)};\na.openExternal=function(a,c){600<=getSdkVersionInt()?sdkController.openExternal(\"window.imaiview\",a,c):sdkController.openExternal(\"window.imaiview\",a)};a.ping=function(a,c){sdkController.ping(\"window.imaiview\",a,c)};a.pingInWebView=function(a,c){sdkController.pingInWebView(\"window.imaiview\",a,c)};a.getSdkVersion=function(){try{var a=sdkController.getSdkVersion(\"window.imaiview\");if(\"string\"==typeof a&&null!=a)return a}catch(c){return\"3.7.0\"}};a.onUserInteraction=function(a){if(\"object\"!=typeof a||\nnull==a)sdkController.onUserInteraction(\"window.imaiview\",null);else try{sdkController.onUserInteraction(\"window.imaiview\",JSON.stringify(a))}catch(c){sdkController.onUserInteraction(\"window.imaiview\",null)}};a.fireAdReady=function(){sdkController.fireAdReady(\"window.imaiview\")};a.fireAdFailed=function(){sdkController.fireAdFailed(\"window.imaiview\")};a.broadcastEvent=function(){window.imai.broadcastEvent.apply(window.imai,arguments)}})();\n(function(){var a=window._im_imaiview;window._im_imai=new InmobiObj;window._im_imai.ios=new InmobiObj;var b=window._im_imai;window.imai=window._im_imai;b.matchString=function(a,b){if(\"string\"!=typeof a||null==a||null==b)return-1;var d=-1;try{d=a.indexOf(b)}catch(f){}return d};b.isHttpUrl=function(a){return\"string\"!=typeof a||null==a?!1:0==b.matchString(a,\"http://\")?!0:0==b.matchString(a,\"https://\")?!0:!1};b.appendTapParams=function(a,e,d){if(!imIsObjValid(e)||!imIsObjValid(d))return a;b.isHttpUrl(a)&&\n(a=-1==b.matchString(a,\"?\")?a+(\"?u-tap-o=\"+e+\",\"+d):a+(\"&u-tap-o=\"+e+\",\"+d));return a};b.performAdClick=function(a,e){e=e||event;if(imIsObjValid(a)){var d=a.clickConfig,f=a.landingConfig;if(!imIsObjValid(d)&&!imIsObjValid(f))b.log(\"click/landing config are invalid, Nothing to process .\"),this.broadcastEvent(\"error\",\"click/landing config are invalid, Nothing to process .\");else{var g=null,h=null,k=null,m=null,n=null,l=null,q=null,p=null;if(imIsObjValid(e))try{m=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY}catch(r){n=\nm=0}imIsObjValid(f)?imIsObjValid(d)?(l=f.url,q=f.fallbackUrl,p=f.urlType,g=d.url,h=d.pingWV,k=d.fr):(l=f.url,p=f.urlType):(l=d.url,p=d.urlType);d=b.getPlatform();try{if(\"boolean\"!=typeof k&&\"number\"!=typeof k||null==k)k=!0;if(0>k||1<k)k=!0;if(\"boolean\"!=typeof h&&\"number\"!=typeof h||null==h)h=!0;if(0>h||1<h)h=!0;if(\"number\"!=typeof p||null==p)p=0;g=b.appendTapParams(g,m,n);imIsObjValid(g)?!0==h?b.pingInWebView(g,k):b.ping(g,k):b.log(\"clickurl provided is null.\");if(imIsObjValid(l))switch(imIsObjValid(g)||\n(l=b.appendTapParams(l,m,n)),p){case 1:b.openEmbedded(l);break;case 2:\"ios\"==d?b.ios.openItunesProductView(l):this.broadcastEvent(\"error\",\"Cannot process openItunesProductView for os\"+d);break;default:b.openExternal(l,q)}else b.log(\"Landing url provided is null.\")}catch(s){}}}else b.log(\" invalid config, nothing to process .\"),this.broadcastEvent(\"error\",\"invalid config, nothing to process .\")};b.performActionClick=function(a,e){e=e||event;if(imIsObjValid(a)){var d=a.clickConfig,f=a.landingConfig;\nif(!imIsObjValid(d)&&!imIsObjValid(f))b.log(\"click/landing config are invalid, Nothing to process .\"),this.broadcastEvent(\"error\",\"click/landing config are invalid, Nothing to process .\");else{var g=null,h=null,k=null,m=null,n=null;if(imIsObjValid(e))try{m=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY}catch(l){n=m=0}imIsObjValid(d)&&(g=d.url,h=d.pingWV,k=d.fr);try{if(\"boolean\"!=typeof k&&\"number\"!=typeof k||null==k)k=!0;if(0>k||1<k)k=!0;if(\"boolean\"!=typeof h&&\"number\"!=typeof h||null==h)h=\n!0;if(0>h||1<h)h=!0;g=b.appendTapParams(g,m,n);imIsObjValid(g)?!0==h?b.pingInWebView(g,k):b.ping(g,k):b.log(\"clickurl provided is null.\");b.onUserInteraction(f)}catch(q){}}}else b.log(\" invalid config, nothing to process .\"),this.broadcastEvent(\"error\",\"invalid config, nothing to process .\")};b.getVersion=function(){return\"1.0\"};b.getPlatform=a.getPlatform;b.getPlatformVersion=a.getPlatformVersion;b.log=a.log;b.openEmbedded=function(b){console.log(\"openEmbedded is deprecated, will be removed in future version\");\nmraidview.detectAndBlockFraud(\"imai.openEmbedded\")||a.openEmbedded(b)};b.openExternal=function(b,e){console.log(\"openExternal is deprecated, will be removed in future version\");mraidview.detectAndBlockFraud(\"imai.openExternal\")||a.openExternal(b,e)};b.ping=a.ping;b.pingInWebView=a.pingInWebView;b.onUserInteraction=a.onUserInteraction;b.getSdkVersion=a.getSdkVersion;b.loadSKStore=a.loadSKStore;b.showSKStore=function(b){mraidview.detectAndBlockFraud(\"imai.showSKStore\")||a.showSKStore(b)};b.ios.openItunesProductView=\nfunction(b){mraidview.detectAndBlockFraud(\"imai.ios.openItunesProductView\")||a.ios.openItunesProductView(b)};b.fireAdReady=a.fireAdReady;b.fireAdFailed=a.fireAdFailed})();");
            a4 = sb2.toString();
            c5 c5Var2 = this.Q;
            if (c5Var2 != null) {
                String str2 = I0;
                x5.j.h(str2, "TAG");
                c5Var2.b(str2, "Returning default Mraid Js string.");
            }
        } else {
            c5 c5Var3 = this.Q;
            if (c5Var3 != null) {
                String str3 = I0;
                x5.j.h(str3, "TAG");
                c5Var3.b(str3, "Returning fetched Mraid Js string.");
            }
        }
        return a4;
    }

    public final q9 getOrientationProperties() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "getOrientationProperties ", c5Var, str);
        }
        return this.f8561s0;
    }

    public final la getOriginalRenderView() {
        return this.f8538h;
    }

    public final FrameLayout getOverlayLayout() {
        return this.O;
    }

    public final long getPlacementId() {
        return this.M;
    }

    @Override
    public byte getPlacementType() {
        return this.f8524a;
    }

    public com.inmobi.media.h getReferenceContainer() {
        return this.U;
    }

    public final JSONArray getRenderableAdIndexes() {
        x xVar = this.f8525a0;
        JSONArray d10 = xVar == null ? null : xVar.d();
        return d10 == null ? new JSONArray() : d10;
    }

    public final AdConfig.RenderingConfig getRenderingConfig() {
        AdConfig adConfig = this.f8554p;
        if (adConfig != null) {
            return adConfig.getRendering();
        }
        x5.j.Q("mAdConfig");
        throw null;
    }

    public final sa getResizeProperties() {
        return this.f8562t;
    }

    public final long getShowTimeStamp() {
        x xVar = this.f8525a0;
        if (xVar == null) {
            return 0L;
        }
        return xVar.c();
    }

    public Map<String, m0> getTelemetryManagerMap() {
        return this.f8569w0;
    }

    public sb getTelemetryOnAdImpression() {
        Map<String, m0> telemetryManagerMap = getTelemetryManagerMap();
        return new sb(telemetryManagerMap == null ? null : telemetryManagerMap.get("AdImpressionSuccessful"), getCreativeId(), getMarkupType());
    }

    public final long getTotalViewArea() {
        return this.f8541i0;
    }

    public final dd getVISIBILITY_CHANGE_LISTENER() {
        return this.C0;
    }

    @Override
    public View getVideoContainerView() {
        return null;
    }

    public final String getViewState() {
        return this.f8546l;
    }

    @Override
    public long getViewTouchTimestamp() {
        return this.f8534f;
    }

    @Override
    public yc getViewableAd() {
        boolean z10;
        String str;
        c5 c5Var;
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "viewableAd getter ", c5Var2, str2);
        }
        if (this.f8527b0 == null) {
            this.f8527b0 = new g5(this, new zc(this), new n4(this.f8536g, this.f8559r0, this.f8545k0, this.f8547l0, getVisibilityTrackingMinPercentage(), this.Q), this.Q);
            Set<ac> set = this.f8526b;
            if (set != null) {
                for (ac acVar : set) {
                    try {
                        if (acVar.f7908a == 3) {
                            Object obj = acVar.f7909b.get("omidAdSession");
                            h0 h0Var = obj instanceof h0 ? (h0) obj : null;
                            if (acVar.f7909b.containsKey("deferred")) {
                                Object obj2 = acVar.f7909b.get("deferred");
                                if (obj2 == null) {
                                    throw new NullPointerException("null cannot be cast to non-null type kotlin.Boolean");
                                    break;
                                } else if (((Boolean) obj2).booleanValue()) {
                                    z10 = true;
                                    Object obj3 = acVar.f7909b.get("customReferenceData");
                                    str = obj3 instanceof String ? (String) obj3 : null;
                                    if (z10 && h0Var != null) {
                                        h0Var.a(j9.f8419h.a(this, this.f8537g0, str));
                                    }
                                    c5Var = this.Q;
                                    if (c5Var == null) {
                                        String str3 = I0;
                                        x5.j.h(str3, "TAG");
                                        c5Var.a(str3, "Did not find a OMID ad session; the IAB decorator will not be applied.");
                                    }
                                }
                            }
                            z10 = false;
                            Object obj32 = acVar.f7909b.get("customReferenceData");
                            if (obj32 instanceof String) {
                            }
                            if (z10) {
                                h0Var.a(j9.f8419h.a(this, this.f8537g0, str));
                            }
                            c5Var = this.Q;
                            if (c5Var == null) {
                            }
                        } else {
                            continue;
                        }
                    } catch (Exception e10) {
                        c5 c5Var3 = this.Q;
                        if (c5Var3 != null) {
                            String str4 = I0;
                            c0.m0.v(str4, "TAG", e10, "Exception occurred while creating the HTML viewable ad : ", c5Var3, str4);
                        }
                    }
                }
            }
        }
        yc ycVar = this.f8527b0;
        x5.j.f(ycVar);
        return ycVar;
    }

    public final int[] getViewableFrameArray() {
        return this.f8539h0;
    }

    public final void h() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "disableUrlsToOpenInExternalApp ", c5Var, str);
        }
        this.f8558r = true;
    }

    public final void i() {
        Activity fullScreenActivity;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "finishFullScreenActivity ", c5Var, str);
        }
        InMobiAdActivity.f7825h.a((Object) this);
        if (getFullScreenActivity() == null) {
            if (this.f8524a == 0) {
                setAndUpdateViewState("Default");
                la laVar = this.f8538h;
                if (laVar != null) {
                    laVar.setAndUpdateViewState("Default");
                }
            } else if (x5.j.d("Default", this.f8546l)) {
                setAndUpdateViewState("Hidden");
            }
            x();
            return;
        }
        x xVar = this.f8525a0;
        if (xVar != null && xVar.b(this)) {
            return;
        }
        Activity fullScreenActivity2 = getFullScreenActivity();
        if (fullScreenActivity2 == null) {
            throw new NullPointerException("null cannot be cast to non-null type com.inmobi.ads.rendering.InMobiAdActivity");
        }
        ((InMobiAdActivity) fullScreenActivity2).f7833e = true;
        Activity fullScreenActivity3 = getFullScreenActivity();
        if (fullScreenActivity3 != null) {
            fullScreenActivity3.finish();
        }
        if (this.L == -1 || (fullScreenActivity = getFullScreenActivity()) == null) {
            return;
        }
        fullScreenActivity.overridePendingTransition(0, this.L);
    }

    public final void j() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "fireClickTrackers ", c5Var, str);
        }
        v2 v2Var = this.D0;
        if (v2Var != null) {
            v2Var.c();
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "fireOnUserInteraction ", c5Var2, str2);
        }
        b("window.imraidview.onUserInteraction();");
        getListener().c(this);
    }

    public final void k() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "fireImpression ", c5Var, str);
        }
        if (x5.j.d("video", this.f8559r0) || x5.j.d("audio", this.f8559r0)) {
            return;
        }
        o();
        b("window.imraidview.impressionRendered();");
        getListener().d(this);
    }

    public boolean l() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "hasUserInteracted Called");
        }
        if (getRenderingConfig() == null) {
            c5 c5Var2 = this.Q;
            if (c5Var2 == null) {
                return false;
            }
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.a(str2, "hasUserInteracted renderingConfig = null");
            return false;
        }
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str3 = I0;
            StringBuilder x10 = a.a.x(str3, "TAG", "hasUserInteracted ");
            x10.append(getViewTouchTimestamp());
            x10.append(' ');
            x10.append(getRenderingConfig().getUserTouchResetTime());
            c5Var3.b(str3, x10.toString());
        }
        return !getRenderingConfig().getAutoRedirectionEnforcement() || this.W || ((getViewTouchTimestamp() > (-1L) ? 1 : (getViewTouchTimestamp() == (-1L) ? 0 : -1)) != 0 && ((SystemClock.elapsedRealtime() - getViewTouchTimestamp()) > getRenderingConfig().getUserTouchResetTime() ? 1 : ((SystemClock.elapsedRealtime() - getViewTouchTimestamp()) == getRenderingConfig().getUserTouchResetTime() ? 0 : -1)) < 0);
    }

    public final boolean m() {
        return this.A == cd.VISIBLE;
    }

    public final void n() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "processResizeRequest ", c5Var, str);
        }
        if (!x5.j.d("Default", this.f8546l) && !x5.j.d("Resized", this.f8546l)) {
            c5 c5Var2 = this.Q;
            if (c5Var2 == null) {
                return;
            }
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.a(str2, "Render view state must be either DEFAULT or RESIZED to admit the resize request");
        } else if (this.f8562t == null) {
            c5 c5Var3 = this.Q;
            if (c5Var3 == null) {
                return;
            }
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var3.a(str3, "Render view state can not resize with invalid resize properties");
        } else {
            this.H = true;
            c7 c7Var = this.f8550n;
            if (c7Var != null) {
                c7Var.a();
            }
            requestLayout();
            invalidate();
            setFocusable(true);
            setFocusableInTouchMode(true);
            requestFocus();
            setAndUpdateViewState("Resized");
            getListener().f(this);
            this.H = false;
        }
    }

    public final void o() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "recordContextualData ", c5Var, str);
        }
        v2 v2Var = this.D0;
        if (v2Var == null) {
            return;
        }
        v2Var.a();
    }

    @Override
    public void onAttachedToWindow() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "onAttachedToWindow ", c5Var, str);
        }
        super.onAttachedToWindow();
        b7 b7Var = this.f8552o;
        if (b7Var != null) {
            s6 s6Var = b7Var.f7942d;
            if (s6Var != null) {
                s6Var.a();
            }
            s6 s6Var2 = b7Var.f7943e;
            if (s6Var2 != null) {
                s6Var2.a();
            }
            s6 s6Var3 = b7Var.f7944f;
            if (s6Var3 != null) {
                s6Var3.a();
            }
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            c0.m0.y(str2, "TAG", this, "setIsViewHardwareAccelerated ", c5Var2, str2);
        }
        this.f8556q = isHardwareAccelerated();
        if (this.f8542j == null) {
            ViewParent parent = getParent();
            this.f8542j = new WeakReference<>(parent instanceof ViewGroup ? (ViewGroup) parent : null);
        }
        if (this.f8533e0) {
            c5 c5Var3 = this.Q;
            if (c5Var3 != null) {
                String str3 = I0;
                c0.m0.y(str3, "TAG", this, "triggerBitmapCheck ", c5Var3, str3);
            }
            if (this.f8529c0) {
                c5 c5Var4 = this.Q;
                if (c5Var4 != null) {
                    String str4 = I0;
                    x5.j.h(str4, "TAG");
                    c5Var4.b(str4, "Starting bitmap check for ad.");
                }
                new t1(this, this).a(getListener().k().X());
            }
        }
    }

    @Override
    public void onDetachedFromWindow() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "onDetachedFromWindow ", c5Var, str);
        }
        this.f8555p0.f8614e.clear();
        b7 b7Var = this.f8552o;
        if (b7Var != null) {
            s6 s6Var = b7Var.f7942d;
            if (s6Var != null) {
                s6Var.b();
            }
            s6 s6Var2 = b7Var.f7943e;
            if (s6Var2 != null) {
                s6Var2.b();
            }
            s6 s6Var3 = b7Var.f7944f;
            if (s6Var3 != null) {
                s6Var3.b();
            }
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, "Detached from window");
        }
        e0 e0Var = this.f8563t0;
        if (e0Var == null) {
            x5.j.Q("adQualityManager");
            throw null;
        }
        e0Var.b();
        if (this.f8565u0.get()) {
            cb.a(1L, TimeUnit.SECONDS, new h4.u(this, 0));
        }
        try {
            super.onDetachedFromWindow();
        } catch (IllegalArgumentException e10) {
            c5 c5Var3 = this.Q;
            if (c5Var3 == null) {
                return;
            }
            String str3 = I0;
            StringBuilder x10 = a.a.x(str3, "TAG", "Detaching WebView from window encountered an error ( ");
            x10.append((Object) e10.getMessage());
            x10.append(" )");
            c5Var3.a(str3, x10.toString());
        }
    }

    @Override
    public boolean onDoubleTap(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        if (!getRenderingConfig().getSupportedGestures().contains(1)) {
            c5 c5Var = this.Q;
            if (c5Var != null) {
                String str = I0;
                x5.j.h(str, "TAG");
                c5Var.e(str, "Double tap gesture is disabled from config");
            }
            return false;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, x5.j.P(motionEvent, "onDoubleTapEvent detected \n "));
        }
        setViewTouchTimestamp(SystemClock.elapsedRealtime());
        if (motionEvent.getAction() == 1) {
            JSONArray jSONArray = new JSONArray();
            try {
                jSONArray.put(motionEvent.getX());
                jSONArray.put(motionEvent.getY());
            } catch (JSONException e10) {
                c5 c5Var3 = this.Q;
                if (c5Var3 != null) {
                    String str3 = I0;
                    x5.j.h(str3, "TAG");
                    c5Var3.a(str3, "Exception in onDoubleTap", e10);
                }
            }
            JSONArray jSONArray2 = new JSONArray();
            jSONArray2.put(jSONArray);
            b("window.imraidview.onGestureDetected('1', '" + jSONArray2 + "');");
        }
        return false;
    }

    @Override
    public boolean onDoubleTapEvent(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        return false;
    }

    @Override
    public boolean onDown(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        return false;
    }

    @Override
    public boolean onFling(MotionEvent motionEvent, MotionEvent motionEvent2, float f10, float f11) {
        x5.j.i(motionEvent, "e1");
        x5.j.i(motionEvent2, "e2");
        return false;
    }

    @Override
    public void onLongPress(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        if (!getRenderingConfig().getSupportedGestures().contains(5)) {
            c5 c5Var = this.Q;
            if (c5Var == null) {
                return;
            }
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "LongPress gesture is disabled from config");
            return;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, x5.j.P(motionEvent, "onLongPress detected \n "));
        }
        JSONArray jSONArray = new JSONArray();
        try {
            jSONArray.put(motionEvent.getX());
            jSONArray.put(motionEvent.getY());
        } catch (JSONException e10) {
            c5 c5Var3 = this.Q;
            if (c5Var3 != null) {
                String str3 = I0;
                x5.j.h(str3, "TAG");
                c5Var3.a(str3, "Exception in onLongPress", e10);
            }
        }
        JSONArray jSONArray2 = new JSONArray();
        jSONArray2.put(jSONArray);
        b("window.imraidview.onGestureDetected('5', '" + jSONArray2 + "');");
    }

    @Override
    public boolean onScroll(MotionEvent motionEvent, MotionEvent motionEvent2, float f10, float f11) {
        x5.j.i(motionEvent, "e1");
        x5.j.i(motionEvent2, "e2");
        return false;
    }

    @Override
    public void onShowPress(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
    }

    @Override
    public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        if (!getRenderingConfig().getSupportedGestures().contains(0)) {
            c5 c5Var = this.Q;
            if (c5Var != null) {
                String str = I0;
                x5.j.h(str, "TAG");
                c5Var.e(str, "Click gesture is disabled from config");
            }
            return false;
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, x5.j.P(motionEvent, "onSingleTapConfirmed detected \n "));
        }
        JSONArray jSONArray = new JSONArray();
        try {
            jSONArray.put(motionEvent.getX());
            jSONArray.put(motionEvent.getY());
        } catch (JSONException e10) {
            c5 c5Var3 = this.Q;
            if (c5Var3 != null) {
                String str3 = I0;
                x5.j.h(str3, "TAG");
                c5Var3.a(str3, "Exception in onSingleTapConfirmed", e10);
            }
        }
        JSONArray jSONArray2 = new JSONArray();
        jSONArray2.put(jSONArray);
        b("window.imraidview.onGestureDetected('0', '" + jSONArray2 + "');");
        return false;
    }

    @Override
    public boolean onSingleTapUp(MotionEvent motionEvent) {
        x5.j.i(motionEvent, "e");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, x5.j.P(motionEvent, "onSingleTapUp detected \n "));
        }
        setViewTouchTimestamp(SystemClock.elapsedRealtime());
        return false;
    }

    @Override
    public void onSizeChanged(int i10, int i11, int i12, int i13) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "onSizeChanged ", c5Var, str);
        }
        super.onSizeChanged(i10, i11, i12, i13);
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str2 = I0;
            x5.j.h(str2, "TAG");
            c5Var2.b(str2, "onSizeChanged (" + i10 + ", " + i11 + ')');
        }
        if (i10 == 0 || i11 == 0) {
            return;
        }
        int b10 = m3.b(i10);
        int b11 = m3.b(i11);
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var3.b(str3, "fireSizeChanged " + this + " w-" + b10 + " h-" + b11);
        }
        b("window.mraidview.broadcastEvent('sizeChange'," + b10 + ',' + b11 + ");");
    }

    @Override
    public boolean onTouchEvent(MotionEvent motionEvent) {
        float f10;
        float f11;
        float f12;
        x5.j.i(motionEvent, Tracking.EVENT);
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "onTouchEvent ", c5Var, str);
        }
        if (this.f8524a == 1) {
            y6 y6Var = this.f8549m0;
            y6Var.getClass();
            int actionMasked = motionEvent.getActionMasked();
            if (actionMasked == 0) {
                x5.j.h(y6Var.f9283b, "TAG");
                x5.j.P(motionEvent, "ACTION_DOWN \n");
                y6Var.f9288g = motionEvent.getPointerId(motionEvent.getActionIndex());
                y6Var.f9291j = new JSONArray();
                JSONArray jSONArray = new JSONArray((Collection) q5.g.r(Float.valueOf(motionEvent.getX()), Float.valueOf(motionEvent.getY())));
                JSONArray jSONArray2 = y6Var.f9291j;
                if (jSONArray2 != null) {
                    jSONArray2.put(jSONArray);
                }
            } else if (actionMasked != 1) {
                float f13 = 0.0f;
                if (actionMasked == 2) {
                    JSONArray jSONArray3 = y6Var.f9291j;
                    int i10 = y6Var.f9288g;
                    if (i10 != -1 && y6Var.f9289h != -1) {
                        int findPointerIndex = motionEvent.findPointerIndex(i10);
                        int findPointerIndex2 = motionEvent.findPointerIndex(y6Var.f9289h);
                        if (findPointerIndex >= 0) {
                            f11 = motionEvent.getX(findPointerIndex);
                            f10 = motionEvent.getY(findPointerIndex);
                        } else {
                            z2 z2Var = z2.f9312a;
                            z2Var.a(new z1(new IllegalArgumentException("Index for mPtrID1=" + y6Var.f9288g + " is " + findPointerIndex + " | Pointer count=" + motionEvent.getPointerCount())));
                            f10 = 0.0f;
                            f11 = 0.0f;
                        }
                        if (findPointerIndex2 >= 0) {
                            float x10 = motionEvent.getX(findPointerIndex2);
                            f13 = motionEvent.getY(findPointerIndex2);
                            f12 = x10;
                        } else {
                            z2 z2Var2 = z2.f9312a;
                            z2Var2.a(new z1(new IllegalArgumentException("Index for mPtrID1=" + y6Var.f9289h + " is " + findPointerIndex2 + " | Pointer count=" + motionEvent.getPointerCount())));
                            f12 = 0.0f;
                        }
                        float degrees = ((float) Math.toDegrees(((float) Math.atan2(y6Var.f9285d - y6Var.f9287f, y6Var.f9284c - y6Var.f9286e)) - ((float) Math.atan2(f13 - f10, f12 - f11)))) % 360;
                        if (degrees < -180.0f) {
                            degrees += 360.0f;
                        }
                        if (degrees > 180.0f) {
                            degrees -= 360.0f;
                        }
                        y6Var.f9290i = Math.abs(degrees);
                    } else if (i10 != -1 && jSONArray3 != null && jSONArray3.length() > 0 && jSONArray3.length() < 50) {
                        try {
                            float x11 = motionEvent.getX();
                            float y10 = motionEvent.getY();
                            JSONArray jSONArray4 = jSONArray3.getJSONArray(jSONArray3.length() - 1);
                            JSONArray jSONArray5 = new JSONArray((Collection) q5.g.r(Float.valueOf(x11), Float.valueOf(y10)));
                            if (y6Var.a(jSONArray4.getInt(0), jSONArray5.getInt(0), jSONArray4.getInt(1), jSONArray5.getInt(1)) > 100) {
                                jSONArray3.put(jSONArray5);
                            }
                        } catch (JSONException unused) {
                        }
                    }
                } else if (actionMasked == 3) {
                    x5.j.h(y6Var.f9283b, "TAG");
                    motionEvent.toString();
                    y6Var.f9288g = -1;
                    y6Var.f9289h = -1;
                } else if (actionMasked == 5) {
                    x5.j.h(y6Var.f9283b, "TAG");
                    x5.j.P(motionEvent, "ACTION_POINTER_DOWN \n");
                    y6Var.f9289h = motionEvent.getPointerId(motionEvent.getActionIndex());
                    y6Var.f9292k = MotionEvent.obtain(motionEvent);
                    int findPointerIndex3 = motionEvent.findPointerIndex(y6Var.f9288g);
                    int findPointerIndex4 = motionEvent.findPointerIndex(y6Var.f9289h);
                    if (findPointerIndex3 >= 0) {
                        y6Var.f9286e = motionEvent.getX(findPointerIndex3);
                        y6Var.f9287f = motionEvent.getY(findPointerIndex3);
                    } else {
                        z2 z2Var3 = z2.f9312a;
                        z2Var3.a(new z1(new IllegalArgumentException("Index for mPtrID1=" + y6Var.f9288g + " is " + findPointerIndex3 + " | Pointer count=" + motionEvent.getPointerCount())));
                    }
                    if (findPointerIndex4 >= 0) {
                        y6Var.f9284c = motionEvent.getX(findPointerIndex4);
                        y6Var.f9285d = motionEvent.getY(findPointerIndex4);
                    } else {
                        z2 z2Var4 = z2.f9312a;
                        z2Var4.a(new z1(new IllegalArgumentException("Index for mPtrID2=" + y6Var.f9289h + " is " + findPointerIndex4 + " | Pointer count=" + motionEvent.getPointerCount())));
                    }
                    y6Var.f9293l = y6Var.a(y6Var.f9286e, y6Var.f9284c, y6Var.f9287f, y6Var.f9285d);
                } else if (actionMasked == 6) {
                    x5.j.h(y6Var.f9283b, "TAG");
                    motionEvent.toString();
                    y6Var.f9289h = -1;
                    if (y6Var.f9290i > 30.0f) {
                        MotionEvent motionEvent2 = y6Var.f9292k;
                        if (motionEvent2 != null) {
                            y6Var.f9282a.b(y6Var, motionEvent2, motionEvent);
                        }
                        y6Var.f9290i = 0.0f;
                    }
                    if (Math.abs(y6Var.a(motionEvent.getX(), motionEvent.getX(1), motionEvent.getY(), motionEvent.getY(1)) - y6Var.f9293l) > 500) {
                        MotionEvent motionEvent3 = y6Var.f9292k;
                        if (motionEvent3 != null) {
                            y6Var.f9282a.a(y6Var, motionEvent3, motionEvent);
                        }
                        y6Var.f9293l = Integer.MAX_VALUE;
                    }
                }
            } else {
                x5.j.h(y6Var.f9283b, "TAG");
                motionEvent.toString();
                y6Var.f9288g = -1;
                JSONArray jSONArray6 = y6Var.f9291j;
                if (jSONArray6 != null && jSONArray6.length() > 5) {
                    y6Var.f9282a.a(y6Var);
                    y6Var.f9291j = new JSONArray();
                }
            }
        }
        this.f8551n0.onTouchEvent(motionEvent);
        if (this.f8530d) {
            setViewTouchTimestamp(SystemClock.elapsedRealtime());
        }
        return super.onTouchEvent(motionEvent);
    }

    @Override
    public void onWindowFocusChanged(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "onWindowFocusChanged " + this + " - " + z10);
        }
        super.onWindowFocusChanged(z10);
        boolean z11 = false;
        if (z10) {
            if (isShown()) {
                n4.a aVar = (n4.a) n4.f8642k;
                if (aVar.a(this, this, this.f8547l0, null) && aVar.a(this, this, this.f8547l0)) {
                    z10 = true;
                }
            }
            z10 = false;
        }
        Activity fullScreenActivity = getFullScreenActivity();
        if (fullScreenActivity != null && fullScreenActivity.isInMultiWindowMode()) {
            z11 = true;
        }
        if (z11) {
            return;
        }
        c(z10);
    }

    @Override
    public void onWindowVisibilityChanged(int i10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "onWindowVisibilityChanged " + this + ' ' + i10);
        }
        super.onWindowVisibilityChanged(i10);
        boolean z10 = true;
        boolean z11 = i10 == 0;
        if (z11) {
            int visibilityTrackingMinPercentage = getVisibilityTrackingMinPercentage();
            if (isShown()) {
                n4.a aVar = (n4.a) n4.f8642k;
                if (aVar.a(this, this, visibilityTrackingMinPercentage, null)) {
                }
            }
            z10 = false;
        } else {
            z10 = z11;
        }
        c(z10);
    }

    public final void p() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "replayToInterActive");
        }
        b("window.imraid.broadcastEvent('replay');");
    }

    public final void q() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "resetLayout ", c5Var, str);
        }
        setVisibility(0);
        requestLayout();
    }

    public final void r() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setCurrentPosition ", c5Var, str);
        }
        this.f8566v = new JSONObject();
        int[] iArr = new int[2];
        getLocationOnScreen(iArr);
        try {
            JSONObject jSONObject = this.f8566v;
            if (jSONObject != null) {
                jSONObject.put("x", m3.b(iArr[0]));
            }
            JSONObject jSONObject2 = this.f8566v;
            if (jSONObject2 != null) {
                jSONObject2.put("y", m3.b(iArr[1]));
            }
            int b10 = m3.b(getWidth());
            int b11 = m3.b(getHeight());
            JSONObject jSONObject3 = this.f8566v;
            if (jSONObject3 != null) {
                jSONObject3.put("width", b10);
            }
            JSONObject jSONObject4 = this.f8566v;
            if (jSONObject4 != null) {
                jSONObject4.put("height", b11);
            }
        } catch (JSONException unused) {
        }
        synchronized (this.G) {
            this.f8570x = false;
            getCurrentPositionMonitor().notifyAll();
        }
    }

    public final void s() {
        ViewGroup viewGroup;
        int width;
        WeakReference<ViewGroup> weakReference;
        ViewGroup viewGroup2;
        int height;
        JSONObject jSONObject;
        JSONObject jSONObject2;
        ViewGroup viewGroup3;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setDefaultPosition ", c5Var, str);
        }
        int[] iArr = new int[2];
        this.f8564u = new JSONObject();
        if (this.f8542j == null) {
            ViewParent parent = getParent();
            this.f8542j = new WeakReference<>(parent instanceof ViewGroup ? (ViewGroup) parent : null);
        }
        WeakReference<ViewGroup> weakReference2 = this.f8542j;
        try {
            if ((weakReference2 != null ? weakReference2.get() : null) != null) {
                WeakReference<ViewGroup> weakReference3 = this.f8542j;
                if (weakReference3 != null && (viewGroup3 = weakReference3.get()) != null) {
                    viewGroup3.getLocationOnScreen(iArr);
                }
                JSONObject jSONObject3 = this.f8564u;
                if (jSONObject3 != null) {
                    jSONObject3.put("x", m3.b(iArr[0]));
                }
                JSONObject jSONObject4 = this.f8564u;
                if (jSONObject4 != null) {
                    jSONObject4.put("y", m3.b(iArr[1]));
                }
                WeakReference<ViewGroup> weakReference4 = this.f8542j;
                if (weakReference4 != null && (viewGroup = weakReference4.get()) != null) {
                    width = viewGroup.getWidth();
                    int b10 = m3.b(width);
                    weakReference = this.f8542j;
                    if (weakReference != null && (viewGroup2 = weakReference.get()) != null) {
                        height = viewGroup2.getHeight();
                        int b11 = m3.b(height);
                        jSONObject = this.f8564u;
                        if (jSONObject == null) {
                            jSONObject.put("width", b10);
                        }
                        jSONObject2 = this.f8564u;
                        if (jSONObject2 == null) {
                            jSONObject2.put("height", b11);
                        }
                    }
                    height = 0;
                    int b112 = m3.b(height);
                    jSONObject = this.f8564u;
                    if (jSONObject == null) {
                    }
                    jSONObject2 = this.f8564u;
                    if (jSONObject2 == null) {
                    }
                }
                width = 0;
                int b102 = m3.b(width);
                weakReference = this.f8542j;
                if (weakReference != null) {
                    height = viewGroup2.getHeight();
                    int b1122 = m3.b(height);
                    jSONObject = this.f8564u;
                    if (jSONObject == null) {
                    }
                    jSONObject2 = this.f8564u;
                    if (jSONObject2 == null) {
                    }
                }
                height = 0;
                int b11222 = m3.b(height);
                jSONObject = this.f8564u;
                if (jSONObject == null) {
                }
                jSONObject2 = this.f8564u;
                if (jSONObject2 == null) {
                }
            } else {
                JSONObject jSONObject5 = this.f8564u;
                if (jSONObject5 != null) {
                    jSONObject5.put("x", 0);
                }
                JSONObject jSONObject6 = this.f8564u;
                if (jSONObject6 != null) {
                    jSONObject6.put("y", 0);
                }
                JSONObject jSONObject7 = this.f8564u;
                if (jSONObject7 != null) {
                    jSONObject7.put("width", 0);
                }
                JSONObject jSONObject8 = this.f8564u;
                if (jSONObject8 != null) {
                    jSONObject8.put("height", 0);
                }
            }
        } catch (JSONException unused) {
        }
        synchronized (this.F) {
            this.f8568w = false;
            getDefaultPositionMonitor().notifyAll();
        }
    }

    public final void setAdPodHandler(x xVar) {
        this.f8525a0 = xVar;
    }

    public final void setAdSize(String str) {
        x5.j.i(str, "adSize");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "setAdSize ", c5Var, str2);
        }
        Object[] array = new pb.i("x").a(str).toArray(new String[0]);
        if (array == null) {
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
        }
        this.f8535f0 = m3.a(Integer.parseInt(((String[]) array)[0]));
        Object[] array2 = new pb.i("x").a(str).toArray(new String[0]);
        if (array2 == null) {
            throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
        }
        this.f8541i0 = m3.a(Integer.parseInt(((String[]) array2)[1])) * this.f8535f0;
    }

    public void setAdType(String str) {
        this.R = str;
    }

    public final void setAllowAutoRedirection(boolean z10) {
        this.W = z10;
    }

    public final void setAndUpdateViewState(String str) {
        x5.j.i(str, "state");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.y(str2, "TAG", this, "setAndUpdateViewState ", c5Var, str2);
        }
        this.f8546l = str;
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            String str3 = I0;
            x5.j.h(str3, "TAG");
            c5Var2.b(str3, x5.j.P(this.f8546l, "set state:"));
        }
        Locale locale = Locale.ENGLISH;
        x5.j.h(locale, "ENGLISH");
        String lowerCase = str.toLowerCase(locale);
        x5.j.h(lowerCase, "(this as java.lang.String).toLowerCase(locale)");
        c5 c5Var3 = this.Q;
        if (c5Var3 != null) {
            String str4 = I0;
            x5.j.h(str4, "TAG");
            c5Var3.b(str4, "fireStateChange " + this + ' ' + lowerCase);
        }
        b("window.mraidview.broadcastEvent('stateChange','" + lowerCase + "');");
    }

    public final void setBlobProvider(w1 w1Var) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setBlobProvider ", c5Var, str);
        }
        this.T = w1Var;
    }

    public final void setCloseEndCardTracker(String str) {
        vc b10;
        oc c10;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str2 = I0;
            c0.m0.u(str2, "TAG", this, "setCloseEndCardTracker ", c5Var, str2);
        }
        com.inmobi.media.h referenceContainer = getReferenceContainer();
        if (!(referenceContainer instanceof n8) || str == null) {
            return;
        }
        n8 n8Var = (n8) referenceContainer;
        n8Var.getClass();
        c5 c5Var2 = n8Var.U;
        if (c5Var2 != null) {
            String str3 = n8Var.V;
            x5.j.h(str3, "TAG");
            c5Var2.e(str3, x5.j.P(str, "Setting close end tracker with URL : "));
        }
        View videoContainerView = n8Var.getVideoContainerView();
        if (videoContainerView instanceof r8) {
            Object tag = ((r8) videoContainerView).getVideoView().getTag();
            o8 o8Var = tag instanceof o8 ? (o8) tag : null;
            if (o8Var == null || (b10 = o8Var.b()) == null || (c10 = b10.c()) == null) {
                return;
            }
            c10.a(new k8(str, 0, "closeEndCard", null));
        }
    }

    public final void setCloseRegionDisabled(boolean z10) {
        this.B = z10;
    }

    public final void setContentURL(String str) {
        this.f8537g0 = str;
    }

    public final void setContextualDataHandler(v2 v2Var) {
        this.D0 = v2Var;
    }

    public void setCreativeId(String str) {
        this.N = str;
    }

    public final void setDisableBackButton(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setDisableBackButton ", c5Var, str);
        }
        this.C = z10;
    }

    public final void setEmbeddedBrowserJSCallbacks(q3 q3Var) {
        this.f8557q0 = q3Var;
    }

    public void setExitAnimation(int i10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setExitAnimation ", c5Var, str);
        }
        this.L = i10;
    }

    public final void setExpandProperties(e4 e4Var) {
        x5.j.i(e4Var, "expandProperties");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setExpandProperties ", c5Var, str);
        }
        if (e4Var.f8137d) {
            setUseCustomClose(e4Var.f8136c);
        }
        this.f8560s = e4Var;
    }

    public void setFriendlyViews(Map<View, ? extends FriendlyObstructionPurpose> map) {
        this.S = map;
    }

    @Override
    public void setFullScreenActivityContext(Activity activity) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setFullScreenActivityContext ", c5Var, str);
        }
        this.f8540i = new WeakReference<>(activity);
        y();
    }

    public void setImpressionId(String str) {
        this.f8528c = str;
    }

    public final void setLandingPageHandler(z5 z5Var) {
        x5.j.i(z5Var, "<set-?>");
        this.f8575z0 = z5Var;
    }

    public final void setLandingScheme(String str) {
        x5.j.i(str, "<set-?>");
        this.f8532e = str;
    }

    public final void setLogger(c5 c5Var) {
        x5.j.i(c5Var, "logger");
        this.Q = c5Var;
        ma maVar = this.f8555p0;
        maVar.getClass();
        maVar.f8617h = c5Var;
        b7 b7Var = this.f8552o;
        if (b7Var != null) {
            b7Var.f7940b = c5Var;
        }
        z6 z6Var = this.f8548m;
        if (z6Var != null) {
            z6Var.f9340f = c5Var;
        }
        String str = I0;
        x5.j.h(str, "TAG");
        c5Var.b(str, "adding renderView to reference tracker");
        ka.f8481a.a(this, c5Var);
    }

    public final void setMarkupTypeAdUnit(String str) {
        x5.j.i(str, "<set-?>");
        this.f8573y0 = str;
    }

    public final void setOrientationProperties(q9 q9Var) {
        x5.j.i(q9Var, "orientationProperties");
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setOrientationProperties ", c5Var, str);
        }
        this.f8561s0 = q9Var;
        y();
    }

    public final void setOriginalRenderView(la laVar) {
        this.f8538h = laVar;
    }

    public final void setOverlayLayout(FrameLayout frameLayout) {
        this.O = frameLayout;
    }

    public final void setPlacementId(long j4) {
        this.M = j4;
    }

    public final void setPreloadView(boolean z10) {
        this.V = z10;
    }

    public void setReferenceContainer(com.inmobi.media.h hVar) {
        this.U = hVar;
    }

    public final void setRenderViewEventListener(na naVar) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setRenderViewEventListener ", c5Var, str);
        }
        this.f8544k = naVar;
    }

    public final void setResizeProperties(sa saVar) {
        this.f8562t = saVar;
    }

    public final void setScrollable(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.y(str, "TAG", this, "setScrollable ", c5Var, str);
        }
        setScrollContainer(z10);
        setVerticalScrollBarEnabled(z10);
        setHorizontalScrollBarEnabled(z10);
    }

    public final void setShouldFireRenderBeacon(boolean z10) {
        this.f8533e0 = z10;
    }

    public void setTelemetryManagerMap(Map<String, m0> map) {
        this.f8569w0 = map;
    }

    public final void setTotalViewArea(long j4) {
        this.f8541i0 = getWidth() * getHeight();
    }

    public final void setUseCustomClose(boolean z10) {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "setUseCustomClose " + this + ' ' + z10);
        }
        this.f8572y = z10;
    }

    public void setViewTouchTimestamp(long j4) {
        this.f8534f = j4;
    }

    public final void setWatermark(WatermarkData watermarkData) {
        x5.j.i(watermarkData, "watermarkData");
        if (!getAdConfig().getWatermarkEnabled()) {
            c5 c5Var = this.Q;
            if (c5Var == null) {
                return;
            }
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.e(str, "Watermark disabled from config. ignoring...");
            return;
        }
        byte[] decode = Base64.decode(watermarkData.getWatermarkBase64EncodedString(), 0);
        x5.j.h(decode, "decode(watermarkData.wat…roid.util.Base64.DEFAULT)");
        Context context = getContext();
        x5.j.h(context, "context");
        float alpha = watermarkData.getAlpha();
        BitmapDrawable bitmapDrawable = new BitmapDrawable(BitmapFactory.decodeByteArray(decode, 0, decode.length));
        Shader.TileMode tileMode = Shader.TileMode.REPEAT;
        bitmapDrawable.setTileModeXY(tileMode, tileMode);
        bitmapDrawable.setTargetDensity(context.getResources().getDisplayMetrics());
        ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-1, -1);
        FrameLayout frameLayout = new FrameLayout(context);
        frameLayout.setLayoutParams(layoutParams);
        frameLayout.setBackground(bitmapDrawable);
        frameLayout.setElevation(Float.MAX_VALUE);
        frameLayout.setAlpha(alpha);
        frameLayout.setClickable(false);
        frameLayout.setFocusable(false);
        this.O = frameLayout;
        getViewTreeObserver().addOnGlobalLayoutListener(new com.amazon.aps.ads.util.adview.a(this, 1));
    }

    @Override
    public void stopLoading() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "stopLoading ", c5Var, str);
        }
        if (this.E.get()) {
            return;
        }
        super.stopLoading();
    }

    public final void t() {
        int webImpressionMinPercentageViewed;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setFallbackImpressionMinPercentageViewed ", c5Var, str);
        }
        if (x5.j.d("video", this.f8559r0)) {
            AdConfig adConfig = this.f8554p;
            if (adConfig == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinPercentageViewed = adConfig.getViewability().getVideoImpressionMinPercentageViewed();
        } else if (!x5.j.d("audio", this.f8559r0)) {
            AdConfig adConfig2 = this.f8554p;
            if (adConfig2 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinPercentageViewed = adConfig2.getViewability().getWebImpressionMinPercentageViewed();
        } else if (x5.j.d("audio", getAdType())) {
            AdConfig adConfig3 = this.f8554p;
            if (adConfig3 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinPercentageViewed = adConfig3.getViewability().getAudioImpressionMinPercentageViewed();
        } else {
            AdConfig adConfig4 = this.f8554p;
            if (adConfig4 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinPercentageViewed = adConfig4.getViewability().getWebImpressionMinPercentageViewed();
        }
        this.f8547l0 = webImpressionMinPercentageViewed;
    }

    public final void u() {
        int webImpressionMinTimeViewed;
        if (x5.j.d("video", this.f8559r0)) {
            AdConfig adConfig = this.f8554p;
            if (adConfig == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinTimeViewed = adConfig.getViewability().getVideoImpressionMinTimeViewed();
        } else if (!x5.j.d("audio", this.f8559r0)) {
            AdConfig adConfig2 = this.f8554p;
            if (adConfig2 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinTimeViewed = adConfig2.getViewability().getWebImpressionMinTimeViewed();
        } else if (x5.j.d("audio", getAdType())) {
            AdConfig adConfig3 = this.f8554p;
            if (adConfig3 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinTimeViewed = adConfig3.getViewability().getAudioImpressionMinTimeViewed();
        } else {
            AdConfig adConfig4 = this.f8554p;
            if (adConfig4 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            webImpressionMinTimeViewed = adConfig4.getViewability().getWebImpressionMinTimeViewed();
        }
        this.f8545k0 = webImpressionMinTimeViewed;
    }

    public final void v() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setFallbackImpressionParams ", c5Var, str);
        }
        u();
        t();
        w();
    }

    public final void w() {
        byte interstitialImpressionType;
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "setFallbackImpressionType ", c5Var, str);
        }
        String adType = getAdType();
        if (x5.j.d(adType, "banner")) {
            AdConfig adConfig = this.f8554p;
            if (adConfig == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            interstitialImpressionType = adConfig.getViewability().getBannerImpressionType();
        } else if (x5.j.d(adType, "audio")) {
            AdConfig adConfig2 = this.f8554p;
            if (adConfig2 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            interstitialImpressionType = adConfig2.getViewability().getAudioImpressionType();
        } else {
            AdConfig adConfig3 = this.f8554p;
            if (adConfig3 == null) {
                x5.j.Q("mAdConfig");
                throw null;
            }
            interstitialImpressionType = adConfig3.getViewability().getInterstitialImpressionType();
        }
        this.f8536g = interstitialImpressionType;
    }

    public final void x() {
        getListener().e(this);
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            x5.j.h(str, "TAG");
            c5Var.b(str, "ad dismissed");
        }
        c5 c5Var2 = this.Q;
        if (c5Var2 != null) {
            c5Var2.a();
        }
        e0 e0Var = this.f8563t0;
        if (e0Var != null) {
            e0Var.b();
        } else {
            x5.j.Q("adQualityManager");
            throw null;
        }
    }

    public final void y() {
        c5 c5Var = this.Q;
        if (c5Var != null) {
            String str = I0;
            c0.m0.u(str, "TAG", this, "updateActivitiesOrientationProperties ", c5Var, str);
        }
        Activity activity = this.f8540i.get();
        if (activity != null && (activity instanceof InMobiAdActivity)) {
            q9 q9Var = this.f8561s0;
            x5.j.i(q9Var, "orientationProperties");
            x4 x4Var = ((InMobiAdActivity) activity).f7829a;
            if (x4Var != null) {
                x4Var.a(q9Var);
            } else {
                x5.j.Q("orientationHandler");
                throw null;
            }
        }
    }
}