.class public final synthetic Le5/j;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Le5/n$b;


# instance fields
.field public final synthetic r:Le5/n;

.field public final synthetic s:Lz4/i;


# direct methods
.method public synthetic constructor <init>(Le5/n;Lz4/i;)V
    .registers 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Le5/j;->r:Le5/n;

    iput-object p2, p0, Le5/j;->s:Lz4/i;

    return-void
.end method


# virtual methods
.method public final apply(Ljava/lang/Object;)Ljava/lang/Object;
    .registers 15

    iget-object v0, p0, Le5/j;->r:Le5/n;

    iget-object v1, p0, Le5/j;->s:Lz4/i;

    check-cast p1, Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 1
    new-instance v11, Ljava/util/ArrayList;

    invoke-direct {v11}, Ljava/util/ArrayList;-><init>()V

    invoke-virtual {v0, p1, v1}, Le5/n;->g(Landroid/database/sqlite/SQLiteDatabase;Lz4/i;)Ljava/lang/Long;

    move-result-object v2

    const/4 v12, 0x0

    if-nez v2, :cond_16

    goto :goto_51

    :cond_16
    const-string v3, "_id"

    const-string v4, "transport_name"

    const-string v5, "timestamp_ms"

    const-string v6, "uptime_ms"

    const-string v7, "payload_encoding"

    const-string v8, "payload"

    const-string v9, "code"

    const-string v10, "inline"

    filled-new-array/range {v3 .. v10}, [Ljava/lang/String;

    move-result-object v4

    const/4 v3, 0x1

    new-array v6, v3, [Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/Long;->toString()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v6, v12

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    iget-object v2, v0, Le5/n;->u:Le5/d;

    invoke-virtual {v2}, Le5/d;->c()I

    move-result v2

    invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v10

    const-string v3, "events"

    const-string v5, "context_id = ?"

    move-object v2, p1

    invoke-virtual/range {v2 .. v10}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v2

    new-instance v3, Lc5/a;

    invoke-direct {v3, v0, v11, v1}, Lc5/a;-><init>(Le5/n;Ljava/util/List;Lz4/i;)V

    invoke-static {v2, v3}, Le5/n;->p(Landroid/database/Cursor;Le5/n$b;)Ljava/lang/Object;

    .line 2
    :goto_51
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "event_id IN ("

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    :goto_5d
    invoke-virtual {v11}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-ge v12, v2, :cond_80

    invoke-virtual {v11, v12}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Le5/h;

    invoke-virtual {v2}, Le5/h;->b()J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v11}, Ljava/util/ArrayList;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-ge v12, v2, :cond_7d

    const/16 v2, 0x2c

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    :cond_7d
    add-int/lit8 v12, v12, 0x1

    goto :goto_5d

    :cond_80
    const/16 v2, 0x29

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    const-string v2, "event_id"

    const-string v3, "name"

    const-string v4, "value"

    filled-new-array {v2, v3, v4}, [Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    const-string v3, "event_metadata"

    move-object v2, p1

    invoke-virtual/range {v2 .. v9}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object p1

    new-instance v1, Li4/d;

    invoke-direct {v1, v0}, Li4/d;-><init>(Ljava/util/Map;)V

    invoke-static {p1, v1}, Le5/n;->p(Landroid/database/Cursor;Le5/n$b;)Ljava/lang/Object;

    .line 3
    invoke-virtual {v11}, Ljava/util/ArrayList;->listIterator()Ljava/util/ListIterator;

    move-result-object p1

    :goto_aa
    invoke-interface {p1}, Ljava/util/ListIterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_108

    invoke-interface {p1}, Ljava/util/ListIterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Le5/h;

    invoke-virtual {v1}, Le5/h;->b()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_c5

    goto :goto_aa

    :cond_c5
    invoke-virtual {v1}, Le5/h;->a()Lz4/f;

    move-result-object v2

    invoke-virtual {v2}, Lz4/f;->i()Lz4/f$a;

    move-result-object v2

    invoke-virtual {v1}, Le5/h;->b()J

    move-result-wide v3

    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v0, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/Set;

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_df
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_f3

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Le5/n$c;

    iget-object v5, v4, Le5/n$c;->a:Ljava/lang/String;

    iget-object v4, v4, Le5/n$c;->b:Ljava/lang/String;

    invoke-virtual {v2, v5, v4}, Lz4/f$a;->a(Ljava/lang/String;Ljava/lang/String;)Lz4/f$a;

    goto :goto_df

    :cond_f3
    invoke-virtual {v1}, Le5/h;->b()J

    move-result-wide v3

    invoke-virtual {v1}, Le5/h;->c()Lz4/i;

    move-result-object v1

    invoke-virtual {v2}, Lz4/f$a;->b()Lz4/f;

    move-result-object v2

    .line 4
    new-instance v5, Le5/b;

    invoke-direct {v5, v3, v4, v1, v2}, Le5/b;-><init>(JLz4/i;Lz4/f;)V

    .line 5
    invoke-interface {p1, v5}, Ljava/util/ListIterator;->set(Ljava/lang/Object;)V

    goto :goto_aa

    :cond_108
    return-object v11
.end method
