package com.sistemasolton.itranvias.data.local;

import android.content.Context;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.util.KClassUtil;
import com.sistemasolton.itranvias.home.data.local.BusDatabase;
import java.io.File;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt;

/* JADX INFO: compiled from: DatabaseBuilder.android.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0014\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u00012\u0006\u0010\u0003\u001a\u00020\u0004¨\u0006\u0005"}, d2 = {"getDatabaseBuilder", "Landroidx/room/RoomDatabase$Builder;", "Lcom/sistemasolton/itranvias/home/data/local/BusDatabase;", "context", "Landroid/content/Context;", "composeApp_release"}, k = 2, mv = {2, 1, 0}, xi = 48)
public final class DatabaseBuilder_androidKt {
    public static final RoomDatabase.Builder<BusDatabase> getDatabaseBuilder(Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        File databasePath = context.getDatabasePath("bus.db");
        Room room = Room.INSTANCE;
        String absolutePath = databasePath.getAbsolutePath();
        Intrinsics.checkNotNullExpressionValue(absolutePath, "getAbsolutePath(...)");
        DatabaseBuilder_androidKt$getDatabaseBuilder$$inlined$databaseBuilder$default$1 databaseBuilder_androidKt$getDatabaseBuilder$$inlined$databaseBuilder$default$1 = new Function0<BusDatabase>() { // from class: com.sistemasolton.itranvias.data.local.DatabaseBuilder_androidKt$getDatabaseBuilder$$inlined$databaseBuilder$default$1
            /* JADX WARN: Can't rename method to resolve collision */
            /* JADX WARN: Type inference failed for: r0v2, types: [androidx.room.RoomDatabase, com.sistemasolton.itranvias.home.data.local.BusDatabase] */
            @Override // kotlin.jvm.functions.Function0
            public final BusDatabase invoke() {
                return (RoomDatabase) KClassUtil.findAndInstantiateDatabaseImpl$default(BusDatabase.class, null, 2, null);
            }
        };
        if (StringsKt.isBlank(absolutePath)) {
            throw new IllegalArgumentException("Cannot build a database with empty name. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder().".toString());
        }
        if (Intrinsics.areEqual(absolutePath, ":memory:")) {
            throw new IllegalArgumentException("Cannot build a database with the special name ':memory:'. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder().".toString());
        }
        return new RoomDatabase.Builder<>(Reflection.getOrCreateKotlinClass(BusDatabase.class), absolutePath, databaseBuilder_androidKt$getDatabaseBuilder$$inlined$databaseBuilder$default$1, context);
    }
}