package com.vinfast.companion.map.dao;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
@kotlin.Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u0000 \u00172\u00020\u0001:\u0001\u0018B\u000f\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\u0017\u0010\t\u001a\u00020\b2\u0006\u0010\u0007\u001a\u00020\u0006H\u0016¢\u0006\u0004\b\t\u0010\nJ+\u0010\u0011\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00060\u00100\u000f2\u0006\u0010\f\u001a\u00020\u000b2\u0006\u0010\u000e\u001a\u00020\rH\u0016¢\u0006\u0004\b\u0011\u0010\u0012R\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\t\u0010\u0013R\u001a\u0010\u0016\u001a\b\u0012\u0004\u0012\u00020\u00060\u00148\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0011\u0010\u0015¨\u0006\u0019"}, d2 = {"Lcom/vinfast/companion/map/dao/RecentSearchDao_Impl;", "Lcom/vinfast/companion/map/dao/RecentSearchDao;", "Landroidx/room/RoomDatabase;", "__db", "<init>", "(Landroidx/room/RoomDatabase;)V", "Lcom/vinfast/companion/map/dao/entity/RecentSearchEntity;", "obj", "", "a", "(Lcom/vinfast/companion/map/dao/entity/RecentSearchEntity;)J", "", "count", "", "userId", "Lio/reactivex/rxjava3/core/Observable;", "", "b", "(ILjava/lang/String;)Lio/reactivex/rxjava3/core/Observable;", "Landroidx/room/RoomDatabase;", "Landroidx/room/EntityInsertAdapter;", "Landroidx/room/EntityInsertAdapter;", "__insertAdapterOfRecentSearchEntity", "c", "Companion", "app_vinFastVNProductionRelease"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class RecentSearchDao_Impl extends com.vinfast.companion.map.dao.RecentSearchDao {

    /* JADX INFO: renamed from: c, reason: from kotlin metadata */
    public static final com.vinfast.companion.map.dao.RecentSearchDao_Impl.Companion INSTANCE = new com.vinfast.companion.map.dao.RecentSearchDao_Impl.Companion(null);

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private final androidx.room.RoomDatabase __db;

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private final androidx.room.EntityInsertAdapter __insertAdapterOfRecentSearchEntity;

    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u0017\u0010\u0006\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00050\u0004¢\u0006\u0004\b\u0006\u0010\u0007¨\u0006\b"}, d2 = {"Lcom/vinfast/companion/map/dao/RecentSearchDao_Impl$Companion;", "", "<init>", "()V", "", "Lkotlin/reflect/KClass;", "a", "()Ljava/util/List;", "app_vinFastVNProductionRelease"}, k = 1, mv = {2, 2, 0}, xi = 48)
    public static final class Companion {
        public /* synthetic */ Companion(kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public final java.util.List a() {
            return kotlin.collections.CollectionsKt.o();
        }

        private Companion() {
        }
    }

    public RecentSearchDao_Impl(androidx.room.RoomDatabase roomDatabase) {
        kotlin.jvm.internal.Intrinsics.l(roomDatabase, "__db");
        this.__db = roomDatabase;
        this.__insertAdapterOfRecentSearchEntity = new androidx.room.EntityInsertAdapter<com.vinfast.companion.map.dao.entity.RecentSearchEntity>() { // from class: com.vinfast.companion.map.dao.RecentSearchDao_Impl.1
            protected java.lang.String b() {
                return "INSERT OR REPLACE INTO `recent_search` (`id`,`title`,`here_id`,`address`,`user_id`,`vinfast_id`,`place_category`,`latitude`,`longitude`,`create_at`) VALUES (?,?,?,?,?,?,?,?,?,?)";
            }

            /* JADX INFO: Access modifiers changed from: protected */
            /* JADX INFO: renamed from: g, reason: merged with bridge method [inline-methods] */
            public void a(androidx.sqlite.SQLiteStatement statement, com.vinfast.companion.map.dao.entity.RecentSearchEntity entity) {
                kotlin.jvm.internal.Intrinsics.l(statement, "statement");
                kotlin.jvm.internal.Intrinsics.l(entity, "entity");
                java.lang.Integer id = entity.getId();
                if (id == null) {
                    statement.m(1);
                } else {
                    statement.l(1, id.intValue());
                }
                java.lang.String title = entity.getTitle();
                if (title == null) {
                    statement.m(2);
                } else {
                    statement.u1(2, title);
                }
                java.lang.String hereId = entity.getHereId();
                if (hereId == null) {
                    statement.m(3);
                } else {
                    statement.u1(3, hereId);
                }
                java.lang.String address = entity.getAddress();
                if (address == null) {
                    statement.m(4);
                } else {
                    statement.u1(4, address);
                }
                java.lang.String userId = entity.getUserId();
                if (userId == null) {
                    statement.m(5);
                } else {
                    statement.u1(5, userId);
                }
                java.lang.String vinFastId = entity.getVinFastId();
                if (vinFastId == null) {
                    statement.m(6);
                } else {
                    statement.u1(6, vinFastId);
                }
                java.lang.String placeCategory = entity.getPlaceCategory();
                if (placeCategory == null) {
                    statement.m(7);
                } else {
                    statement.u1(7, placeCategory);
                }
                java.lang.Double latitude = entity.getLatitude();
                if (latitude == null) {
                    statement.m(8);
                } else {
                    statement.q(8, latitude.doubleValue());
                }
                java.lang.Double longitude = entity.getLongitude();
                if (longitude == null) {
                    statement.m(9);
                } else {
                    statement.q(9, longitude.doubleValue());
                }
                statement.l(10, entity.getCreateAt());
            }
        };
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final long e(com.vinfast.companion.map.dao.RecentSearchDao_Impl recentSearchDao_Impl, com.vinfast.companion.map.dao.entity.RecentSearchEntity recentSearchEntity, androidx.sqlite.SQLiteConnection sQLiteConnection) {
        kotlin.jvm.internal.Intrinsics.l(sQLiteConnection, "_connection");
        return recentSearchDao_Impl.__insertAdapterOfRecentSearchEntity.e(sQLiteConnection, recentSearchEntity);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final java.util.List f(java.lang.String str, java.lang.String str2, int i, androidx.sqlite.SQLiteConnection sQLiteConnection) {
        kotlin.jvm.internal.Intrinsics.l(sQLiteConnection, "_connection");
        androidx.sqlite.SQLiteStatement sQLiteStatementF1 = sQLiteConnection.f1(str);
        try {
            sQLiteStatementF1.u1(1, str2);
            sQLiteStatementF1.l(2, i);
            int iC = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "id");
            int iC2 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "title");
            int iC3 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "here_id");
            int iC4 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "address");
            int iC5 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "user_id");
            int iC6 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "vinfast_id");
            int iC7 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "place_category");
            int iC8 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "latitude");
            int iC9 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "longitude");
            int iC10 = androidx.room.util.SQLiteStatementUtil.c(sQLiteStatementF1, "create_at");
            java.util.ArrayList arrayList = new java.util.ArrayList();
            while (sQLiteStatementF1.a1()) {
                arrayList.add(new com.vinfast.companion.map.dao.entity.RecentSearchEntity(sQLiteStatementF1.isNull(iC) ? null : java.lang.Integer.valueOf((int) sQLiteStatementF1.getLong(iC)), sQLiteStatementF1.isNull(iC2) ? null : sQLiteStatementF1.x2(iC2), sQLiteStatementF1.isNull(iC3) ? null : sQLiteStatementF1.x2(iC3), sQLiteStatementF1.isNull(iC4) ? null : sQLiteStatementF1.x2(iC4), sQLiteStatementF1.isNull(iC5) ? null : sQLiteStatementF1.x2(iC5), sQLiteStatementF1.isNull(iC6) ? null : sQLiteStatementF1.x2(iC6), sQLiteStatementF1.isNull(iC7) ? null : sQLiteStatementF1.x2(iC7), sQLiteStatementF1.isNull(iC8) ? null : java.lang.Double.valueOf(sQLiteStatementF1.getDouble(iC8)), sQLiteStatementF1.isNull(iC9) ? null : java.lang.Double.valueOf(sQLiteStatementF1.getDouble(iC9)), sQLiteStatementF1.getLong(iC10)));
            }
            return arrayList;
        } finally {
            sQLiteStatementF1.close();
        }
    }

    @Override // com.vinfast.companion.map.dao.RecentSearchDao
    public long a(final com.vinfast.companion.map.dao.entity.RecentSearchEntity obj) {
        kotlin.jvm.internal.Intrinsics.l(obj, "obj");
        return ((java.lang.Number) androidx.room.util.DBUtil.d(this.__db, false, true, new kotlin.jvm.functions.Function1() { // from class: m4.a
            public final java.lang.Object invoke(java.lang.Object obj2) {
                return java.lang.Long.valueOf(com.vinfast.companion.map.dao.RecentSearchDao_Impl.e(this.a, obj, (androidx.sqlite.SQLiteConnection) obj2));
            }
        })).longValue();
    }

    @Override // com.vinfast.companion.map.dao.RecentSearchDao
    public io.reactivex.rxjava3.core.Observable b(final int count, final java.lang.String userId) {
        kotlin.jvm.internal.Intrinsics.l(userId, "userId");
        final java.lang.String str = "SELECT * FROM recent_search WHERE id IN (SELECT MAX(id) FROM recent_search GROUP BY title, here_id, address) AND user_id = ? ORDER BY create_at DESC LIMIT ?";
        return androidx.room.rxjava3.RxRoom.a(this.__db, false, new java.lang.String[]{"recent_search"}, new kotlin.jvm.functions.Function1() { // from class: m4.b
            public final java.lang.Object invoke(java.lang.Object obj) {
                return com.vinfast.companion.map.dao.RecentSearchDao_Impl.f(str, userId, count, (androidx.sqlite.SQLiteConnection) obj);
            }
        });
    }
}
