package com.google.android.material.shape;

import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.RectF;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import kotlin.collections.builders.ListBuilder;

/* JADX INFO: loaded from: classes2.dex */
public abstract class m {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final k1.m f23114a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final k1.m f23115b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final k1.m f23116c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final k1.m f23117d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final k1.m f23118e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final k1.m f23119f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final k1.m f23120g;

    static {
        k1.b bVar = new k1.b(0.15f, 0.0f);
        k1.b bVar2 = new k1.b(0.2f, 0.0f);
        k1.b bVar3 = new k1.b(0.3f, 0.0f);
        k1.b bVar4 = new k1.b(0.5f, 0.0f);
        k1.b bVar5 = new k1.b(1.0f, 0.0f);
        c(o6.b.g(10, 14));
        c(o6.b.z(1.0f, bVar3, null));
        ArrayList arrayList = new ArrayList();
        arrayList.add(new l(new PointF(0.926f, 0.97f), new k1.b(0.189f, 0.811f)));
        arrayList.add(new l(new PointF(-0.021f, 0.967f), new k1.b(0.187f, 0.057f)));
        c(b(arrayList, 2, false));
        k1.b bVar6 = k1.b.f28974c;
        c(o6.b.E(o6.b.b(4, 1.0f, 0.0f, 0.0f, bVar6, Arrays.asList(bVar5, bVar5, bVar2, bVar2)), a(-135.0f)));
        ArrayList arrayList2 = new ArrayList();
        arrayList2.add(new l(new PointF(1.0f, 1.0f), new k1.b(0.148f, 0.417f)));
        arrayList2.add(new l(new PointF(0.0f, 1.0f), new k1.b(0.151f, 0.0f)));
        arrayList2.add(new l(new PointF(0.0f, 0.0f), new k1.b(0.148f, 0.0f)));
        arrayList2.add(new l(new PointF(0.978f, 0.02f), new k1.b(0.803f, 0.0f)));
        c(b(arrayList2, 1, false));
        ArrayList arrayList3 = new ArrayList();
        arrayList3.add(new l(new PointF(0.5f, 0.892f), new k1.b(0.313f, 0.0f)));
        arrayList3.add(new l(new PointF(-0.216f, 1.05f), new k1.b(0.207f, 0.0f)));
        arrayList3.add(new l(new PointF(0.499f, -0.16f), new k1.b(0.215f, 1.0f)));
        arrayList3.add(new l(new PointF(1.225f, 1.06f), new k1.b(0.211f, 0.0f)));
        c(b(arrayList3, 1, false));
        c(o6.b.z(1.6f, bVar6, Arrays.asList(bVar2, bVar2, bVar5, bVar5)));
        k1.m mVarG = o6.b.g(0, 15);
        Matrix matrix = new Matrix();
        matrix.setScale(1.0f, 0.64f);
        f23114a = c(o6.b.E(o6.b.E(mVarG, matrix), a(-45.0f)));
        ArrayList arrayList4 = new ArrayList();
        arrayList4.add(new l(new PointF(0.961f, 0.039f), new k1.b(0.426f, 0.0f)));
        arrayList4.add(new l(new PointF(1.001f, 0.428f)));
        arrayList4.add(new l(new PointF(1.0f, 0.609f), bVar5));
        f23115b = c(b(arrayList4, 2, true));
        c(o6.b.E(o6.b.b(3, 1.0f, 0.0f, 0.0f, bVar2, null), a(-90.0f)));
        ArrayList arrayList5 = new ArrayList();
        arrayList5.add(new l(new PointF(0.5f, 1.096f), new k1.b(0.151f, 0.524f)));
        arrayList5.add(new l(new PointF(0.04f, 0.5f), new k1.b(0.159f, 0.0f)));
        c(b(arrayList5, 2, false));
        ArrayList arrayList6 = new ArrayList();
        arrayList6.add(new l(new PointF(0.171f, 0.841f), new k1.b(0.159f, 0.0f)));
        arrayList6.add(new l(new PointF(-0.02f, 0.5f), new k1.b(0.14f, 0.0f)));
        arrayList6.add(new l(new PointF(0.17f, 0.159f), new k1.b(0.159f, 0.0f)));
        c(b(arrayList6, 2, false));
        ArrayList arrayList7 = new ArrayList();
        arrayList7.add(new l(new PointF(0.5f, -0.009f), new k1.b(0.172f, 0.0f)));
        f23116c = c(b(arrayList7, 5, false));
        ArrayList arrayList8 = new ArrayList();
        arrayList8.add(new l(new PointF(0.499f, 1.023f), new k1.b(0.241f, 0.778f)));
        arrayList8.add(new l(new PointF(-0.005f, 0.792f), new k1.b(0.208f, 0.0f)));
        arrayList8.add(new l(new PointF(0.073f, 0.258f), new k1.b(0.228f, 0.0f)));
        arrayList8.add(new l(new PointF(0.433f, -0.0f), new k1.b(0.491f, 0.0f)));
        c(o6.b.E(b(arrayList8, 1, true), a(-90.0f)));
        f23117d = c(o6.b.C(8, 0.8f, bVar));
        ArrayList arrayList9 = new ArrayList();
        arrayList9.add(new l(new PointF(0.5f, 1.08f), new k1.b(0.085f, 0.0f)));
        arrayList9.add(new l(new PointF(0.358f, 0.843f), new k1.b(0.085f, 0.0f)));
        c(b(arrayList9, 8, false));
        ArrayList arrayList10 = new ArrayList();
        arrayList10.add(new l(new PointF(1.237f, 1.236f), new k1.b(0.258f, 0.0f)));
        arrayList10.add(new l(new PointF(0.5f, 0.918f), new k1.b(0.233f, 0.0f)));
        f23118e = c(b(arrayList10, 4, false));
        ArrayList arrayList11 = new ArrayList();
        arrayList11.add(new l(new PointF(0.723f, 0.884f), new k1.b(0.394f, 0.0f)));
        arrayList11.add(new l(new PointF(0.5f, 1.099f), new k1.b(0.398f, 0.0f)));
        c(b(arrayList11, 6, false));
        c(o6.b.E(o6.b.C(7, 0.75f, bVar4), a(-90.0f)));
        f23119f = c(o6.b.E(o6.b.C(9, 0.8f, bVar4), a(-90.0f)));
        c(o6.b.E(o6.b.C(12, 0.8f, bVar4), a(-90.0f)));
        ArrayList arrayList12 = new ArrayList();
        arrayList12.add(new l(new PointF(0.5f, 0.0f), bVar5));
        arrayList12.add(new l(new PointF(1.0f, 0.0f), bVar5));
        arrayList12.add(new l(new PointF(1.0f, 1.14f), new k1.b(0.254f, 0.106f)));
        arrayList12.add(new l(new PointF(0.575f, 0.906f), new k1.b(0.253f, 0.0f)));
        c(b(arrayList12, 1, true));
        ArrayList arrayList13 = new ArrayList();
        arrayList13.add(new l(new PointF(0.5f, 0.074f)));
        arrayList13.add(new l(new PointF(0.725f, -0.099f), new k1.b(0.476f, 0.0f)));
        c(b(arrayList13, 4, true));
        ArrayList arrayList14 = new ArrayList();
        arrayList14.add(new l(new PointF(0.5f, 0.036f)));
        arrayList14.add(new l(new PointF(0.758f, -0.101f), new k1.b(0.209f, 0.0f)));
        c(b(arrayList14, 8, false));
        ArrayList arrayList15 = new ArrayList();
        arrayList15.add(new l(new PointF(0.5f, -0.006f), new k1.b(0.006f, 0.0f)));
        arrayList15.add(new l(new PointF(0.592f, 0.158f), new k1.b(0.006f, 0.0f)));
        c(b(arrayList15, 12, false));
        ArrayList arrayList16 = new ArrayList();
        arrayList16.add(new l(new PointF(0.193f, 0.277f), new k1.b(0.053f, 0.0f)));
        arrayList16.add(new l(new PointF(0.176f, 0.055f), new k1.b(0.053f, 0.0f)));
        f23120g = c(b(arrayList16, 10, false));
        ArrayList arrayList17 = new ArrayList();
        arrayList17.add(new l(new PointF(0.457f, 0.296f), new k1.b(0.007f, 0.0f)));
        arrayList17.add(new l(new PointF(0.5f, -0.051f), new k1.b(0.007f, 0.0f)));
        c(b(arrayList17, 15, false));
        ArrayList arrayList18 = new ArrayList();
        arrayList18.add(new l(new PointF(0.733f, 0.454f)));
        arrayList18.add(new l(new PointF(0.839f, 0.437f), new k1.b(0.532f, 0.0f)));
        arrayList18.add(new l(new PointF(0.949f, 0.449f), new k1.b(0.439f, 1.0f)));
        arrayList18.add(new l(new PointF(0.998f, 0.478f), new k1.b(0.174f, 0.0f)));
        c(b(arrayList18, 16, true));
        ArrayList arrayList19 = new ArrayList();
        arrayList19.add(new l(new PointF(0.37f, 0.187f)));
        arrayList19.add(new l(new PointF(0.416f, 0.049f), new k1.b(0.381f, 0.0f)));
        arrayList19.add(new l(new PointF(0.479f, 0.0f), new k1.b(0.095f, 0.0f)));
        c(b(arrayList19, 8, true));
        ArrayList arrayList20 = new ArrayList();
        arrayList20.add(new l(new PointF(0.5f, 0.053f)));
        arrayList20.add(new l(new PointF(0.545f, -0.04f), new k1.b(0.405f, 0.0f)));
        arrayList20.add(new l(new PointF(0.67f, -0.035f), new k1.b(0.426f, 0.0f)));
        arrayList20.add(new l(new PointF(0.717f, 0.066f), new k1.b(0.574f, 0.0f)));
        arrayList20.add(new l(new PointF(0.722f, 0.128f)));
        arrayList20.add(new l(new PointF(0.777f, 0.002f), new k1.b(0.36f, 0.0f)));
        arrayList20.add(new l(new PointF(0.914f, 0.149f), new k1.b(0.66f, 0.0f)));
        arrayList20.add(new l(new PointF(0.926f, 0.289f), new k1.b(0.66f, 0.0f)));
        arrayList20.add(new l(new PointF(0.881f, 0.346f)));
        arrayList20.add(new l(new PointF(0.94f, 0.344f), new k1.b(0.126f, 0.0f)));
        arrayList20.add(new l(new PointF(1.003f, 0.437f), new k1.b(0.255f, 0.0f)));
        k1.m mVarB = b(arrayList20, 2, true);
        Matrix matrix2 = new Matrix();
        matrix2.setScale(1.0f, 0.742f);
        c(o6.b.E(mVarB, matrix2));
        ArrayList arrayList21 = new ArrayList();
        arrayList21.add(new l(new PointF(0.87f, 0.13f), new k1.b(0.146f, 0.0f)));
        arrayList21.add(new l(new PointF(0.818f, 0.357f)));
        arrayList21.add(new l(new PointF(1.0f, 0.332f), new k1.b(0.853f, 0.0f)));
        c(b(arrayList21, 4, true));
        ArrayList arrayList22 = new ArrayList();
        arrayList22.add(new l(new PointF(0.5f, 0.0f)));
        arrayList22.add(new l(new PointF(0.704f, 0.0f)));
        arrayList22.add(new l(new PointF(0.704f, 0.065f)));
        arrayList22.add(new l(new PointF(0.843f, 0.065f)));
        arrayList22.add(new l(new PointF(0.843f, 0.148f)));
        arrayList22.add(new l(new PointF(0.926f, 0.148f)));
        arrayList22.add(new l(new PointF(0.926f, 0.296f)));
        arrayList22.add(new l(new PointF(1.0f, 0.296f)));
        c(b(arrayList22, 2, true));
        ArrayList arrayList23 = new ArrayList();
        arrayList23.add(new l(new PointF(0.11f, 0.5f)));
        arrayList23.add(new l(new PointF(0.113f, 0.0f)));
        arrayList23.add(new l(new PointF(0.287f, 0.0f)));
        arrayList23.add(new l(new PointF(0.287f, 0.087f)));
        arrayList23.add(new l(new PointF(0.421f, 0.087f)));
        arrayList23.add(new l(new PointF(0.421f, 0.17f)));
        arrayList23.add(new l(new PointF(0.56f, 0.17f)));
        arrayList23.add(new l(new PointF(0.56f, 0.265f)));
        arrayList23.add(new l(new PointF(0.674f, 0.265f)));
        arrayList23.add(new l(new PointF(0.675f, 0.344f)));
        arrayList23.add(new l(new PointF(0.789f, 0.344f)));
        arrayList23.add(new l(new PointF(0.789f, 0.439f)));
        arrayList23.add(new l(new PointF(0.888f, 0.439f)));
        c(b(arrayList23, 1, true));
        ArrayList arrayList24 = new ArrayList();
        arrayList24.add(new l(new PointF(0.796f, 0.5f)));
        arrayList24.add(new l(new PointF(0.853f, 0.518f), bVar5));
        arrayList24.add(new l(new PointF(0.992f, 0.631f), bVar5));
        arrayList24.add(new l(new PointF(0.968f, 1.0f), bVar5));
        c(b(arrayList24, 2, true));
        ArrayList arrayList25 = new ArrayList();
        arrayList25.add(new l(new PointF(0.5f, 0.268f), new k1.b(0.016f, 0.0f)));
        arrayList25.add(new l(new PointF(0.792f, -0.066f), new k1.b(0.958f, 0.0f)));
        arrayList25.add(new l(new PointF(1.064f, 0.276f), bVar5));
        arrayList25.add(new l(new PointF(0.501f, 0.946f), new k1.b(0.129f, 0.0f)));
        c(b(arrayList25, 1, true));
    }

    public static Matrix a(float f10) {
        Matrix matrix = new Matrix();
        matrix.setRotate(f10);
        return matrix;
    }

    public static k1.m b(ArrayList arrayList, int i10, boolean z10) {
        ArrayList arrayList2 = new ArrayList();
        arrayList2.clear();
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            PointF pointF = ((l) it.next()).f23108a;
            pointF.offset(-0.5f, -0.5f);
            float fAtan2 = (float) Math.atan2(pointF.y, pointF.x);
            float fHypot = (float) Math.hypot(pointF.x, pointF.y);
            pointF.x = fAtan2;
            pointF.y = fHypot;
        }
        float f10 = (float) (6.283185307179586d / ((double) i10));
        if (z10) {
            int i11 = i10 * 2;
            float f11 = f10 / 2.0f;
            for (int i12 = 0; i12 < i11; i12++) {
                for (int i13 = 0; i13 < arrayList.size(); i13++) {
                    boolean z11 = i12 % 2 != 0;
                    int size = z11 ? (arrayList.size() - 1) - i13 : i13;
                    l lVar = (l) arrayList.get(size);
                    if (size > 0 || !z11) {
                        arrayList2.add(new l(new PointF((i12 * f11) + (z11 ? (((l) arrayList.get(0)).f23108a.x * 2.0f) + (f11 - lVar.f23108a.x) : lVar.f23108a.x), lVar.f23108a.y), lVar.f23109b));
                    }
                }
            }
        } else {
            for (int i14 = 0; i14 < i10; i14++) {
                Iterator it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    l lVar2 = (l) it2.next();
                    arrayList2.add(new l(new PointF((i14 * f10) + lVar2.f23108a.x, lVar2.f23108a.y), lVar2.f23109b));
                }
            }
        }
        Iterator it3 = arrayList2.iterator();
        while (it3.hasNext()) {
            PointF pointF2 = ((l) it3.next()).f23108a;
            double d10 = 0.5f;
            float fCos = (float) ((Math.cos(pointF2.x) * ((double) pointF2.y)) + d10);
            float fSin = (float) ((Math.sin(pointF2.x) * ((double) pointF2.y)) + d10);
            pointF2.x = fCos;
            pointF2.y = fSin;
        }
        float[] fArr = new float[arrayList2.size() * 2];
        for (int i15 = 0; i15 < arrayList2.size(); i15++) {
            int i16 = i15 * 2;
            fArr[i16] = ((l) arrayList2.get(i15)).f23108a.x;
            fArr[i16 + 1] = ((l) arrayList2.get(i15)).f23108a.y;
        }
        ArrayList arrayList3 = new ArrayList();
        for (int i17 = 0; i17 < arrayList2.size(); i17++) {
            arrayList3.add(((l) arrayList2.get(i17)).f23109b);
        }
        return o6.b.c(fArr, k1.b.f28974c, arrayList3, 0.5f, 0.5f);
    }

    public static k1.m c(k1.m mVar) {
        return d(mVar, new RectF(0.0f, 0.0f, 1.0f, 1.0f));
    }

    public static k1.m d(k1.m mVar, RectF rectF) {
        float[] fArr = new float[4];
        mVar.getClass();
        ListBuilder listBuilder = mVar.f29006d;
        int length = listBuilder.getLength();
        float fMax = 0.0f;
        int i10 = 0;
        while (true) {
            float f10 = mVar.f29005c;
            float f11 = mVar.f29004b;
            if (i10 >= length) {
                float fSqrt = (float) Math.sqrt(fMax);
                fArr[0] = f11 - fSqrt;
                fArr[1] = f10 - fSqrt;
                fArr[2] = f11 + fSqrt;
                fArr[3] = f10 + fSqrt;
                RectF rectF2 = new RectF(fArr[0], fArr[1], fArr[2], fArr[3]);
                float fMin = Math.min(rectF.width() / rectF2.width(), rectF.height() / rectF2.height());
                Matrix matrix = new Matrix();
                matrix.setScale(fMin, fMin);
                matrix.preTranslate(-rectF2.centerX(), -rectF2.centerY());
                matrix.postTranslate(rectF.centerX(), rectF.centerY());
                return o6.b.E(mVar, matrix);
            }
            k1.c cVar = (k1.c) listBuilder.get(i10);
            float[] fArr2 = cVar.f28977a;
            float f12 = fArr2[0] - f11;
            float f13 = fArr2[1] - f10;
            float f14 = k1.o.f29010b;
            float f15 = (f13 * f13) + (f12 * f12);
            long jC = cVar.c(0.5f);
            float fT = o6.b.t(jC) - f11;
            float fU = o6.b.u(jC) - f10;
            fMax = Math.max(fMax, Math.max(f15, (fU * fU) + (fT * fT)));
            i10++;
        }
    }
}
