package com.google.maps.android.compose;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: MapApplier.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0007\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016¨\u0006\b"}, d2 = {"com/google/maps/android/compose/MapApplier$attachClickListeners$9", "Lcom/google/android/gms/maps/GoogleMap$OnMarkerDragListener;", "onMarkerDragStart", "", "marker", "Lcom/google/android/gms/maps/model/Marker;", "onMarkerDrag", "onMarkerDragEnd", "maps-compose_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
public final class MapApplier$attachClickListeners$9 implements GoogleMap.OnMarkerDragListener {
    final /* synthetic */ MapApplier this$0;

    MapApplier$attachClickListeners$9(MapApplier mapApplier) {
        this.this$0 = mapApplier;
    }

    @Override // com.google.android.gms.maps.GoogleMap.OnMarkerDragListener
    public void onMarkerDragStart(Marker marker) {
        Intrinsics.checkNotNullParameter(marker, "marker");
        for (MapNode mapNode : this.this$0.decorations) {
            if (mapNode instanceof MarkerNode) {
                final MarkerNode markerNode = (MarkerNode) mapNode;
                if (Intrinsics.areEqual(markerNode.getMarker(), marker)) {
                    if (Intrinsics.areEqual(new Function1() { // from class: com.google.maps.android.compose.MapApplier$attachClickListeners$9$$ExternalSyntheticLambda2
                        @Override // kotlin.jvm.functions.Function1
                        public final Object invoke(Object obj) {
                            return MapApplier$attachClickListeners$9.onMarkerDragStart$lambda$2$lambda$1(markerNode, (Marker) obj);
                        }
                    }.invoke(marker), (Object) true)) {
                        return;
                    }
                }
            }
            if (mapNode instanceof InputHandlerNode) {
                Function1<Marker, Unit> onMarkerDragStart = ((InputHandlerNode) mapNode).getOnMarkerDragStart();
                if (onMarkerDragStart != null ? Intrinsics.areEqual((Object) onMarkerDragStart.invoke(marker), (Object) true) : false) {
                    return;
                }
            } else {
                continue;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit onMarkerDragStart$lambda$2$lambda$1(MarkerNode this_findInputCallback, Marker it) {
        Intrinsics.checkNotNullParameter(this_findInputCallback, "$this_findInputCallback");
        Intrinsics.checkNotNullParameter(it, "it");
        LatLng position = it.getPosition();
        Intrinsics.checkNotNullExpressionValue(position, "getPosition(...)");
        this_findInputCallback.getMarkerState().setDragging$maps_compose_release(true);
        this_findInputCallback.getMarkerState().setPosition(position);
        this_findInputCallback.getMarkerState().setDragState$maps_compose_release(DragState.START);
        return Unit.INSTANCE;
    }

    @Override // com.google.android.gms.maps.GoogleMap.OnMarkerDragListener
    public void onMarkerDrag(Marker marker) {
        Intrinsics.checkNotNullParameter(marker, "marker");
        for (MapNode mapNode : this.this$0.decorations) {
            if (mapNode instanceof MarkerNode) {
                final MarkerNode markerNode = (MarkerNode) mapNode;
                if (Intrinsics.areEqual(markerNode.getMarker(), marker)) {
                    if (Intrinsics.areEqual(new Function1() { // from class: com.google.maps.android.compose.MapApplier$attachClickListeners$9$$ExternalSyntheticLambda0
                        @Override // kotlin.jvm.functions.Function1
                        public final Object invoke(Object obj) {
                            return MapApplier$attachClickListeners$9.onMarkerDrag$lambda$6$lambda$5(markerNode, (Marker) obj);
                        }
                    }.invoke(marker), (Object) true)) {
                        return;
                    }
                }
            }
            if (mapNode instanceof InputHandlerNode) {
                Function1<Marker, Unit> onMarkerDrag = ((InputHandlerNode) mapNode).getOnMarkerDrag();
                if (onMarkerDrag != null ? Intrinsics.areEqual((Object) onMarkerDrag.invoke(marker), (Object) true) : false) {
                    return;
                }
            } else {
                continue;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit onMarkerDrag$lambda$6$lambda$5(MarkerNode this_findInputCallback, Marker it) {
        Intrinsics.checkNotNullParameter(this_findInputCallback, "$this_findInputCallback");
        Intrinsics.checkNotNullParameter(it, "it");
        LatLng position = it.getPosition();
        Intrinsics.checkNotNullExpressionValue(position, "getPosition(...)");
        this_findInputCallback.getMarkerState().setDragging$maps_compose_release(true);
        this_findInputCallback.getMarkerState().setPosition(position);
        this_findInputCallback.getMarkerState().setDragState$maps_compose_release(DragState.DRAG);
        return Unit.INSTANCE;
    }

    @Override // com.google.android.gms.maps.GoogleMap.OnMarkerDragListener
    public void onMarkerDragEnd(Marker marker) {
        Intrinsics.checkNotNullParameter(marker, "marker");
        for (MapNode mapNode : this.this$0.decorations) {
            if (mapNode instanceof MarkerNode) {
                final MarkerNode markerNode = (MarkerNode) mapNode;
                if (Intrinsics.areEqual(markerNode.getMarker(), marker)) {
                    if (Intrinsics.areEqual(new Function1() { // from class: com.google.maps.android.compose.MapApplier$attachClickListeners$9$$ExternalSyntheticLambda1
                        @Override // kotlin.jvm.functions.Function1
                        public final Object invoke(Object obj) {
                            return MapApplier$attachClickListeners$9.onMarkerDragEnd$lambda$10$lambda$9(markerNode, (Marker) obj);
                        }
                    }.invoke(marker), (Object) true)) {
                        return;
                    }
                }
            }
            if (mapNode instanceof InputHandlerNode) {
                Function1<Marker, Unit> onMarkerDragEnd = ((InputHandlerNode) mapNode).getOnMarkerDragEnd();
                if (onMarkerDragEnd != null ? Intrinsics.areEqual((Object) onMarkerDragEnd.invoke(marker), (Object) true) : false) {
                    return;
                }
            } else {
                continue;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit onMarkerDragEnd$lambda$10$lambda$9(MarkerNode this_findInputCallback, Marker it) {
        Intrinsics.checkNotNullParameter(this_findInputCallback, "$this_findInputCallback");
        Intrinsics.checkNotNullParameter(it, "it");
        LatLng position = it.getPosition();
        Intrinsics.checkNotNullExpressionValue(position, "getPosition(...)");
        this_findInputCallback.getMarkerState().setDragging$maps_compose_release(true);
        this_findInputCallback.getMarkerState().setPosition(position);
        this_findInputCallback.getMarkerState().setDragging$maps_compose_release(false);
        this_findInputCallback.getMarkerState().setDragState$maps_compose_release(DragState.END);
        return Unit.INSTANCE;
    }
}