package com.google.maps.android.compose;

import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.saveable.Saver;
import androidx.compose.runtime.saveable.SaverKt;
import androidx.compose.runtime.saveable.SaverScope;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: Marker.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0007\u0018\u0000 '2\u00020\u0001:\u0001'B\u0011\u0012\b\b\u0002\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005J\u0006\u0010$\u001a\u00020%J\u0006\u0010&\u001a\u00020%R+\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0006\u001a\u00020\u00038F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b\n\u0010\u000b\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\u0005R+\u0010\r\u001a\u00020\f2\u0006\u0010\u0006\u001a\u00020\f8F@@X\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b\u0011\u0010\u000b\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R1\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0006\u001a\u00020\u00128F@@X\u0087\u008e\u0002¢\u0006\u0018\n\u0004\b\u001a\u0010\u000b\u0012\u0004\b\u0014\u0010\u0015\u001a\u0004\b\u0016\u0010\u0017\"\u0004\b\u0018\u0010\u0019R\u0016\u0010\u001b\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u001d0\u001cX\u0082\u0004¢\u0006\u0002\n\u0000R(\u0010\u001f\u001a\u0004\u0018\u00010\u001d2\b\u0010\u001e\u001a\u0004\u0018\u00010\u001d8@@@X\u0080\u000e¢\u0006\f\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#¨\u0006("}, d2 = {"Lcom/google/maps/android/compose/MarkerState;", "", "position", "Lcom/google/android/gms/maps/model/LatLng;", "<init>", "(Lcom/google/android/gms/maps/model/LatLng;)V", "<set-?>", "getPosition", "()Lcom/google/android/gms/maps/model/LatLng;", "setPosition", "position$delegate", "Landroidx/compose/runtime/MutableState;", "", "isDragging", "()Z", "setDragging$maps_compose_release", "(Z)V", "isDragging$delegate", "Lcom/google/maps/android/compose/DragState;", "dragState", "getDragState$annotations", "()V", "getDragState", "()Lcom/google/maps/android/compose/DragState;", "setDragState$maps_compose_release", "(Lcom/google/maps/android/compose/DragState;)V", "dragState$delegate", "markerState", "Landroidx/compose/runtime/MutableState;", "Lcom/google/android/gms/maps/model/Marker;", "value", "marker", "getMarker$maps_compose_release", "()Lcom/google/android/gms/maps/model/Marker;", "setMarker$maps_compose_release", "(Lcom/google/android/gms/maps/model/Marker;)V", "showInfoWindow", "", "hideInfoWindow", "Companion", "maps-compose_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
public final class MarkerState {
    public static final int $stable = 0;

    /* JADX INFO: renamed from: Companion, reason: from kotlin metadata */
    public static final Companion INSTANCE = new Companion(null);
    private static final Saver<MarkerState, LatLng> Saver = SaverKt.Saver(new Function2() { // from class: com.google.maps.android.compose.MarkerState$$ExternalSyntheticLambda0
        @Override // kotlin.jvm.functions.Function2
        public final Object invoke(Object obj, Object obj2) {
            return MarkerState.Saver$lambda$0((SaverScope) obj, (MarkerState) obj2);
        }
    }, new Function1() { // from class: com.google.maps.android.compose.MarkerState$$ExternalSyntheticLambda1
        @Override // kotlin.jvm.functions.Function1
        public final Object invoke(Object obj) {
            return MarkerState.Saver$lambda$1((LatLng) obj);
        }
    });

    /* JADX INFO: renamed from: dragState$delegate, reason: from kotlin metadata */
    private final MutableState dragState;

    /* JADX INFO: renamed from: isDragging$delegate, reason: from kotlin metadata */
    private final MutableState isDragging;
    private final MutableState<Marker> markerState;

    /* JADX INFO: renamed from: position$delegate, reason: from kotlin metadata */
    private final MutableState position;

    public MarkerState() {
        this(null, 1, 0 == true ? 1 : 0);
    }

    @Deprecated(level = DeprecationLevel.WARNING, message = "Use isDragging instead - dragState is not appropriate for representing \"state\"; it is a lossy representation of drag \"events\", promoting invalid usage.")
    public static /* synthetic */ void getDragState$annotations() {
    }

    public MarkerState(LatLng position) {
        Intrinsics.checkNotNullParameter(position, "position");
        this.position = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(position, null, 2, null);
        this.isDragging = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(false, null, 2, null);
        this.dragState = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(DragState.END, null, 2, null);
        this.markerState = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
    }

    public /* synthetic */ MarkerState(LatLng latLng, int i, DefaultConstructorMarker defaultConstructorMarker) {
        this((i & 1) != 0 ? new LatLng(0.0d, 0.0d) : latLng);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final LatLng getPosition() {
        return (LatLng) this.position.getValue();
    }

    public final void setPosition(LatLng latLng) {
        Intrinsics.checkNotNullParameter(latLng, "<set-?>");
        this.position.setValue(latLng);
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final boolean isDragging() {
        return ((Boolean) this.isDragging.getValue()).booleanValue();
    }

    public final void setDragging$maps_compose_release(boolean z) {
        this.isDragging.setValue(Boolean.valueOf(z));
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final DragState getDragState() {
        return (DragState) this.dragState.getValue();
    }

    public final void setDragState$maps_compose_release(DragState dragState) {
        Intrinsics.checkNotNullParameter(dragState, "<set-?>");
        this.dragState.setValue(dragState);
    }

    public final Marker getMarker$maps_compose_release() {
        return this.markerState.getValue();
    }

    public final void setMarker$maps_compose_release(Marker marker) {
        if (this.markerState.getValue() == null && marker == null) {
            return;
        }
        if (this.markerState.getValue() != null && marker != null) {
            throw new IllegalStateException("MarkerState may only be associated with one Marker at a time.".toString());
        }
        this.markerState.setValue(marker);
    }

    public final void showInfoWindow() {
        Marker marker$maps_compose_release = getMarker$maps_compose_release();
        if (marker$maps_compose_release != null) {
            marker$maps_compose_release.showInfoWindow();
        }
    }

    public final void hideInfoWindow() {
        Marker marker$maps_compose_release = getMarker$maps_compose_release();
        if (marker$maps_compose_release != null) {
            marker$maps_compose_release.hideInfoWindow();
        }
    }

    /* JADX INFO: compiled from: Marker.kt */
    @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003R\u001d\u0010\u0004\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00070\u0005¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\t¨\u0006\n"}, d2 = {"Lcom/google/maps/android/compose/MarkerState$Companion;", "", "<init>", "()V", "Saver", "Landroidx/compose/runtime/saveable/Saver;", "Lcom/google/maps/android/compose/MarkerState;", "Lcom/google/android/gms/maps/model/LatLng;", "getSaver", "()Landroidx/compose/runtime/saveable/Saver;", "maps-compose_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
    public static final class Companion {
        public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final Saver<MarkerState, LatLng> getSaver() {
            return MarkerState.Saver;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final LatLng Saver$lambda$0(SaverScope Saver2, MarkerState it) {
        Intrinsics.checkNotNullParameter(Saver2, "$this$Saver");
        Intrinsics.checkNotNullParameter(it, "it");
        return it.getPosition();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final MarkerState Saver$lambda$1(LatLng it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return new MarkerState(it);
    }
}