package com.bytedance.sdk.component.adexpress.dynamic.yz;

import android.graphics.Color;
import android.text.TextUtils;
import com.bytedance.sdk.component.adexpress.dynamic.jnr.ku;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
public class wsy {
    private String ajl;
    public int fm;
    private jnr jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public JSONObject f6523lb;
    public String ro;
    private ajl yz;

    public wsy(jnr jnrVar) {
        this.jnr = jnrVar;
        this.fm = jnrVar.fm();
        this.ro = jnrVar.lb();
        this.f6523lb = jnrVar.jnr().pbk();
        this.ajl = jnrVar.yz();
        if (com.bytedance.sdk.component.adexpress.yz.lb() == 1) {
            this.yz = jnrVar.wsy();
        } else {
            this.yz = jnrVar.jnr();
        }
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            this.yz = jnrVar.jnr();
        }
    }

    private boolean ttj() {
        if (com.bytedance.sdk.component.adexpress.yz.ro()) {
            return false;
        }
        return (!TextUtils.isEmpty(this.ro) && this.ro.contains("adx:")) || ku.ro();
    }

    private boolean xca() {
        return (com.bytedance.sdk.component.adexpress.yz.ro() && (this.jnr.ro().contains("logo-union") || this.jnr.ro().contains("logounion") || this.jnr.ro().contains("logoad"))) || "logo-union".equals(this.jnr.ro()) || "logounion".equals(this.jnr.ro()) || "logoad".equals(this.jnr.ro());
    }

    public boolean ado() {
        return this.yz.wbw();
    }

    public double ai() {
        return this.yz.wu();
    }

    public String ajl() {
        return this.fm == 0 ? !TextUtils.isEmpty(this.ro) ? this.ro : this.f6523lb.optString(com.bytedance.sdk.component.adexpress.yz.wsy.lb(com.bytedance.sdk.component.adexpress.yz.fm())) : "";
    }

    public double aws() {
        return this.yz.gc();
    }

    public boolean bkb() {
        return this.yz.cyr();
    }

    public String bwv() {
        return this.yz.ol();
    }

    public int bx() {
        return this.yz.zow();
    }

    public String cg() {
        return this.yz.hi();
    }

    public double dsz() {
        if (this.fm == 11) {
            try {
                return !com.bytedance.sdk.component.adexpress.yz.ro() ? (int) r0 : Double.parseDouble(this.ro);
            } catch (NumberFormatException unused) {
            }
        }
        return -1.0d;
    }

    public String duv() {
        return this.ajl;
    }

    public int ef() {
        int iWu = wu();
        if (iWu == 4) {
            return 17;
        }
        return iWu == 3 ? 8388613 : 8388611;
    }

    public float fhx() {
        return this.yz.ku();
    }

    public int fm() {
        return (int) this.yz.onz();
    }

    public String gc() {
        return this.yz.vt();
    }

    public int gof() {
        return this.yz.ky();
    }

    public int gqi() {
        return this.yz.kc();
    }

    public int gzf() {
        return fm(this.yz.lse());
    }

    public int ha() {
        return this.yz.jnr();
    }

    public String hi() {
        return this.yz.zzm();
    }

    public String hlt() {
        return this.yz.mon();
    }

    public int hxv() {
        return this.yz.ef();
    }

    public int ib() {
        return this.yz.ff();
    }

    public int irt() {
        return fm(this.yz.nt());
    }

    public String jm() {
        return this.yz.jn();
    }

    public float jnr() {
        return this.yz.gof();
    }

    public String ku() {
        return this.fm == 1 ? this.ro : "";
    }

    public int kwx() {
        return this.yz.cpu();
    }

    public int lb() {
        return (int) this.yz.fhx();
    }

    public int lcp() {
        return this.yz.zh();
    }

    public String lmk() {
        return this.yz.ai();
    }

    public int lse() {
        return this.yz.qf();
    }

    public boolean lz() {
        return this.yz.zzn();
    }

    public boolean maa() {
        return this.yz.lz();
    }

    public boolean mj() {
        return this.yz.dsz();
    }

    public boolean mon() {
        return this.yz.no();
    }

    public String mpp() {
        return this.yz.ucr();
    }

    public int mq() {
        String strMon = this.yz.mon();
        if ("skip-with-time-skip-btn".equals(this.jnr.ro()) || "skip".equals(this.jnr.ro()) || TextUtils.equals("skip-with-countdowns-skip-btn", this.jnr.ro())) {
            return 6;
        }
        if (!"skip-with-time-countdown".equals(this.jnr.ro()) && !"skip-with-time".equals(this.jnr.ro())) {
            if (this.fm == 10 && TextUtils.equals(this.yz.bx(), "click")) {
                return 5;
            }
            if (xca() && ttj()) {
                return 0;
            }
            if (xca()) {
                return 7;
            }
            if ("feedback-dislike".equals(this.jnr.ro())) {
                return 3;
            }
            if (!TextUtils.isEmpty(strMon) && !strMon.equals("none")) {
                if (strMon.equals("video") || (this.jnr.fm() == 7 && TextUtils.equals(strMon, "normal"))) {
                    return (com.bytedance.sdk.component.adexpress.yz.ro() && this.jnr.jnr() != null && this.jnr.jnr().bp()) ? 11 : 4;
                }
                if (strMon.equals("normal")) {
                    return 1;
                }
                return (strMon.equals("creative") || "slide".equals(this.yz.bx())) ? 2 : 0;
            }
        }
        return 0;
    }

    public int ne() {
        return this.yz.hm();
    }

    public boolean no() {
        return this.yz.zjk();
    }

    public long nt() {
        return this.yz.qlg();
    }

    public int ol() {
        return this.yz.lb();
    }

    public double onz() {
        return this.yz.gqi();
    }

    public String pbk() {
        return this.yz.xp();
    }

    public int pcm() {
        return this.yz.pkk();
    }

    public int pkk() {
        return this.yz.yz();
    }

    public int qb() {
        return this.yz.grs();
    }

    public int qf() {
        return this.yz.wsy();
    }

    public float qhl() {
        return this.yz.duv();
    }

    public int rka() {
        return this.yz.po();
    }

    public int ro() {
        return (int) this.yz.qhl();
    }

    public String sds() {
        return this.yz.hlt();
    }

    public int si() {
        return this.yz.wjb();
    }

    public double so() {
        return this.yz.hxv();
    }

    public boolean te() {
        return this.yz.cyr();
    }

    public String tzk() {
        return this.yz.xgn();
    }

    public String vt() {
        int i10 = this.fm;
        return (i10 == 2 || i10 == 13) ? this.ro : "";
    }

    public String vvj() {
        return this.yz.le();
    }

    public int wbw() {
        return this.yz.ro();
    }

    public boolean wey() {
        return this.yz.oy();
    }

    public int wsy() {
        return fm(this.yz.maa());
    }

    public int wu() {
        String strSds = this.yz.sds();
        if ("left".equals(strSds)) {
            return 17;
        }
        if ("center".equals(strSds)) {
            return 4;
        }
        return "right".equals(strSds) ? 3 : 2;
    }

    public String xgn() {
        return this.yz.bx();
    }

    public int ywr() {
        return this.yz.ha();
    }

    public int yz() {
        return (int) this.yz.irt();
    }

    public int zan() {
        return this.yz.lcp();
    }

    public int zow() {
        return this.yz.pf();
    }

    public static float[] ro(String str) {
        String[] strArrSplit = str.substring(str.indexOf("(") + 1, str.indexOf(")")).split(",");
        return (strArrSplit == null || strArrSplit.length != 4) ? new float[]{0.0f, 0.0f, 0.0f, 0.0f} : new float[]{Float.parseFloat(strArrSplit[0]), Float.parseFloat(strArrSplit[1]), Float.parseFloat(strArrSplit[2]), Float.parseFloat(strArrSplit[3])};
    }

    public void fm(float f10) {
        this.yz.fm(f10);
    }

    public static int fm(String str) {
        String[] strArrSplit;
        if (TextUtils.isEmpty(str)) {
            return -16777216;
        }
        if (str.equals("transparent")) {
            return 0;
        }
        if (str.charAt(0) == '#' && str.length() == 7) {
            return Color.parseColor(str);
        }
        if (str.charAt(0) == '#' && str.length() == 9) {
            return Color.parseColor(str);
        }
        if (str.startsWith("rgba") && (strArrSplit = str.substring(str.indexOf("(") + 1, str.indexOf(")")).split(",")) != null) {
            try {
                if (strArrSplit.length == 4) {
                    return (((int) ((Float.parseFloat(strArrSplit[3]) * 255.0f) + 0.5f)) << 24) | (((int) Float.parseFloat(strArrSplit[0])) << 16) | (((int) Float.parseFloat(strArrSplit[1])) << 8) | ((int) Float.parseFloat(strArrSplit[2]));
                }
            } catch (NumberFormatException unused) {
                return 0;
            }
        }
        return -16777216;
    }
}
