content: package kotlinx.coroutines.flow.internal;
  
  import java.util.ArrayList;
  import kotlin.Metadata;
  import kotlin.Unit;
  import kotlin.collections.CollectionsKt;
  import kotlin.coroutines.Continuation;
  import kotlin.coroutines.CoroutineContext;
  import kotlin.coroutines.EmptyCoroutineContext;
  import kotlin.coroutines.intrinsics.IntrinsicsKt;
  import kotlin.jvm.functions.Function1;
  import kotlin.jvm.functions.Function2;
  import kotlin.jvm.internal.Intrinsics;
  import kotlinx.coroutines.CoroutineScope;
  import kotlinx.coroutines.CoroutineScopeKt;
  import kotlinx.coroutines.CoroutineStart;
  import kotlinx.coroutines.DebugKt;
  import kotlinx.coroutines.DebugStringsKt;
  import kotlinx.coroutines.channels.BufferOverflow;
  import kotlinx.coroutines.channels.ProduceKt;
  import kotlinx.coroutines.channels.ProducerScope;
  import kotlinx.coroutines.channels.ReceiveChannel;
  import kotlinx.coroutines.flow.Flow;
  import kotlinx.coroutines.flow.FlowCollector;
  import mt.Log1F380D;
  
  @Metadata(d1 = {"\u0000\\\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b'\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u001d\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tJ\n\u0010\u0015\u001a\u0004\u0018\u00010\u0016H\u0014J\u001f\u0010\u0017\u001a\u00020\u000e2\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u00028\u00000\u0019H@ø\u0001\u0000¢\u0006\u0002\u0010\u001aJ\u001f\u0010\u001b\u001a\u00020\u000e2\f\u0010\u001c\u001a\b\u0012\u0004\u0012\u00028\u00000\fH¤@ø\u0001\u0000¢\u0006\u0002\u0010\u001dJ&\u0010\u001e\u001a\b\u0012\u0004\u0012\u00028\u00000\u00002\u0006\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH$J\u0010\u0010\u001f\u001a\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010 H\u0016J&\u0010!\u001a\b\u0012\u0004\u0012\u00028\u00000 2\u0006\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0016J\u0016\u0010\"\u001a\b\u0012\u0004\u0012\u00028\u00000#2\u0006\u0010\u001c\u001a\u00020$H\u0016J\b\u0010%\u001a\u00020\u0016H\u0016R\u0010\u0010\u0005\u001a\u00020\u00068\u0006X\u0004¢\u0006\u0002\n\u0000R9\u0010\n\u001a$\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\f\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000e0\r\u0012\u0006\u0012\u0004\u0018\u00010\u000f0\u000b8@X\u0004ø\u0001\u0000¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u0011R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u00020\b8\u0006X\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0012\u001a\u00020\u00068@X\u0004¢\u0006\u0006\u001a\u0004\b\u0013\u0010\u0014\u0002\u0004\n\u0002\b\u0019¨\u0006&"}, d2 = {"Lkotlinx/coroutines/flow/internal/ChannelFlow;", "T", "Lkotlinx/coroutines/flow/internal/FusibleFlow;", "context", "Lkotlin/coroutines/CoroutineContext;", "capacity", "", "onBufferOverflow", "Lkotlinx/coroutines/channels/BufferOverflow;", "(Lkotlin/coroutines/CoroutineContext;ILkotlinx/coroutines/channels/BufferOverflow;)V", "collectToFun", "Lkotlin/Function2;", "Lkotlinx/coroutines/channels/ProducerScope;", "Lkotlin/coroutines/Continuation;", "", "", "getCollectToFun$kotlinx_coroutines_core", "()Lkotlin/jvm/functions/Function2;", "produceCapacity", "getProduceCapacity$kotlinx_coroutines_core", "()I", "additionalToStringProps", "", "collect", "collector", "Lkotlinx/coroutines/flow/FlowCollector;", "(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "collectTo", "scope", "(Lkotlinx/coroutines/channels/ProducerScope;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "create", "dropChannelOperators", "Lkotlinx/coroutines/flow/Flow;", "fuse", "produceImpl", "Lkotlinx/coroutines/channels/ReceiveChannel;", "Lkotlinx/coroutines/CoroutineScope;", "toString", "kotlinx-coroutines-core"}, k = 1, mv = {1, 6, 0}, xi = 48)
  /* compiled from: 0191 */
  public abstract class ChannelFlow<T> implements FusibleFlow<T> {
      public final int capacity;
      public final CoroutineContext context;
      public final BufferOverflow onBufferOverflow;
  
      public ChannelFlow(CoroutineContext context2, int capacity2, BufferOverflow onBufferOverflow2) {
          this.context = context2;
          this.capacity = capacity2;
          this.onBufferOverflow = onBufferOverflow2;
          if (DebugKt.getASSERTIONS_ENABLED()) {
              if (!(capacity2 != -1)) {
                  throw new AssertionError();
              }
          }
      }
  
      static /* synthetic */ Object collect$suspendImpl(ChannelFlow channelFlow, FlowCollector collector, Continuation $completion) {
          Object coroutineScope = CoroutineScopeKt.coroutineScope(new ChannelFlow$collect$2(collector, channelFlow, (Continuation<? super ChannelFlow$collect$2>) null), $completion);
          return coroutineScope == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? coroutineScope : Unit.INSTANCE;
      }
  
      /* access modifiers changed from: protected */
      public String additionalToStringProps() {
          return null;
      }
  
      public Object collect(FlowCollector<? super T> flowCollector, Continuation<? super Unit> continuation) {
          return collect$suspendImpl(this, flowCollector, continuation);
      }
  
      /* access modifiers changed from: protected */
      public abstract Object collectTo(ProducerScope<? super T> producerScope, Continuation<? super Unit> continuation);
  
      /* access modifiers changed from: protected */
      public abstract ChannelFlow<T> create(CoroutineContext coroutineContext, int i, BufferOverflow bufferOverflow);
  
      public Flow<T> dropChannelOperators() {
          return null;
      }
  
      public Flow<T> fuse(CoroutineContext context2, int capacity2, BufferOverflow onBufferOverflow2) {
          BufferOverflow bufferOverflow;
          int i;
          boolean z = true;
          if (DebugKt.getASSERTIONS_ENABLED()) {
              if (!(capacity2 != -1)) {
                  throw new AssertionError();
              }
          }
          CoroutineContext plus = context2.plus(this.context);
          if (onBufferOverflow2 != BufferOverflow.SUSPEND) {
              i = capacity2;
              bufferOverflow = onBufferOverflow2;
          } else {
              int i2 = this.capacity;
              if (i2 != -3) {
                  if (capacity2 != -3) {
                      if (i2 != -2) {
                          if (capacity2 != -2) {
                              if (DebugKt.getASSERTIONS_ENABLED()) {
                                  if (!(this.capacity >= 0)) {
                                      throw new AssertionError();
                                  }
                              }
                              if (DebugKt.getASSERTIONS_ENABLED()) {
                                  if (capacity2 < 0) {
                                      z = false;
                                  }
                                  if (!z) {
                                      throw new AssertionError();
                                  }
                              }
                              i2 = this.capacity + capacity2;
                              if (i2 < 0) {
                                  i2 = Integer.MAX_VALUE;
                              }
                          }
                      }
                  }
                  i = i2;
                  bufferOverflow = this.onBufferOverflow;
              }
              i2 = capacity2;
              i = i2;
              bufferOverflow = this.onBufferOverflow;
          }
          return (Intrinsics.areEqual((Object) plus, (Object) this.context) && i == this.capacity && bufferOverflow == this.onBufferOverflow) ? this : create(plus, i, bufferOverflow);
      }
  
      public final Function2<ProducerScope<? super T>, Continuation<? super Unit>, Object> getCollectToFun$kotlinx_coroutines_core() {
          return new ChannelFlow$collectToFun$1(this, (Continuation<? super ChannelFlow$collectToFun$1>) null);
      }
  
      public final int getProduceCapacity$kotlinx_coroutines_core() {
          int i = this.capacity;
          if (i == -3) {
              return -2;
          }
          return i;
      }
  
      public ReceiveChannel<T> produceImpl(CoroutineScope scope) {
          return ProduceKt.produce$default(scope, this.context, getProduceCapacity$kotlinx_coroutines_core(), this.onBufferOverflow, CoroutineStart.ATOMIC, (Function1) null, getCollectToFun$kotlinx_coroutines_core(), 16, (Object) null);
      }
  
      public String toString() {
          ArrayList arrayList = new ArrayList(4);
          String additionalToStringProps = additionalToStringProps();
          if (additionalToStringProps != null) {
              arrayList.add(additionalToStringProps);
          }
          if (this.context != EmptyCoroutineContext.INSTANCE) {
              String stringPlus = Intrinsics.stringPlus("context=", this.context);
              Log1F380D.a((Object) stringPlus);
              arrayList.add(stringPlus);
          }
          int i = this.capacity;
          if (i != -3) {
              String stringPlus2 = Intrinsics.stringPlus("capacity=", Integer.valueOf(i));
              Log1F380D.a((Object) stringPlus2);
              arrayList.add(stringPlus2);
          }
          if (this.onBufferOverflow != BufferOverflow.SUSPEND) {
              String stringPlus3 = Intrinsics.stringPlus("onBufferOverflow=", this.onBufferOverflow);
              Log1F380D.a((Object) stringPlus3);
              arrayList.add(stringPlus3);
          }
          StringBuilder sb = new StringBuilder();
          String classSimpleName = DebugStringsKt.getClassSimpleName(this);
          Log1F380D.a((Object) classSimpleName);
          StringBuilder append = sb.append(classSimpleName).append('[');
          String joinToString$default = CollectionsKt.joinToString$default(arrayList, ", ", (CharSequence) null, (CharSequence) null, 0, (CharSequence) null, (Function1) null, 62, (Object) null);
          Log1F380D.a((Object) joinToString$default);
          return append.append(joinToString$default).append(']').toString();
      }
  }
  