@solibo/solibo-sdk 1.57.9 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/FieldSpec.mjs +4 -4
  2. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/FormatStructure.mjs +1 -1
  3. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/Predicate.mjs +2 -2
  4. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/decimal/BigDecimal.mjs +2 -2
  5. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/decimal/BigDecimalExtensions.mjs +2 -2
  6. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/integer/BigInteger.mjs +2 -2
  7. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/integer/BigIntegerExtensions.mjs +2 -2
  8. package/client-core.mjs +71 -7
  9. package/client.d.mts +38 -1
  10. package/core.d.mts +2 -2
  11. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCbc.mjs +1 -1
  12. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCtr.mjs +1 -1
  13. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesGcm.mjs +1 -1
  14. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdh.mjs +3 -3
  15. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdsa.mjs +3 -3
  16. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEdDsa.mjs +2 -2
  17. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoHmac.mjs +1 -1
  18. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaOaep.mjs +3 -3
  19. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPkcs1.mjs +3 -3
  20. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPss.mjs +3 -3
  21. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoXdh.mjs +2 -2
  22. package/kotlin-kotlin-stdlib/kotlin/UInt.mjs +2 -2
  23. package/kotlin-kotlin-stdlib/kotlin/ULong.mjs +2 -2
  24. package/kotlin-kotlin-stdlib/kotlin/UnsignedJs.mjs +2 -2
  25. package/kotlin-kotlin-stdlib/kotlin/time/Duration.mjs +31 -0
  26. package/kotlin-kotlin-stdlib/kotlin/time/DurationUnitJs.mjs +6 -1
  27. package/kotlin-kotlin-stdlib/kotlin/time/MonoTimeSource.mjs +2 -0
  28. package/kotlin-kotlin-stdlib/kotlin/time/TimeSource.mjs +2 -0
  29. package/kotlin-kotlin-stdlib/kotlin/uuid/Uuid.mjs +2 -2
  30. package/kotlin-kotlin-stdlib/kotlin/uuid/UuidJs.mjs +2 -2
  31. package/kotlinx-coroutines-core/kotlinx/coroutines/AbstractCoroutine.mjs +2 -2
  32. package/kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuation.mjs +2 -2
  33. package/kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuationImpl.mjs +2 -2
  34. package/kotlinx-coroutines-core/kotlinx/coroutines/CompletableJob.mjs +2 -2
  35. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineContext.mjs +2 -2
  36. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineDispatcher.mjs +2 -2
  37. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineExceptionHandler.mjs +2 -2
  38. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs +2 -2
  39. package/kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs +2 -2
  40. package/kotlinx-coroutines-core/kotlinx/coroutines/DispatchedTask.mjs +2 -2
  41. package/kotlinx-coroutines-core/kotlinx/coroutines/Dispatchers.mjs +2 -2
  42. package/kotlinx-coroutines-core/kotlinx/coroutines/EventLoop.common.mjs +2 -2
  43. package/kotlinx-coroutines-core/kotlinx/coroutines/EventLoop.mjs +2 -2
  44. package/kotlinx-coroutines-core/kotlinx/coroutines/JSDispatcher.mjs +2 -2
  45. package/kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs +2 -2
  46. package/kotlinx-coroutines-core/kotlinx/coroutines/JobSupport.mjs +2 -2
  47. package/kotlinx-coroutines-core/kotlinx/coroutines/MainCoroutineDispatcher.mjs +2 -2
  48. package/kotlinx-coroutines-core/kotlinx/coroutines/Runnable.mjs +1 -1
  49. package/kotlinx-coroutines-core/kotlinx/coroutines/Timeout.mjs +2 -2
  50. package/kotlinx-coroutines-core/kotlinx/coroutines/Unconfined.mjs +2 -2
  51. package/kotlinx-coroutines-core/kotlinx/coroutines/Window.mjs +2 -2
  52. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferedChannel.mjs +2 -2
  53. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/Channel.mjs +2 -2
  54. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/ChannelCoroutine.mjs +8 -2
  55. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/ConflatedBufferedChannel.mjs +2 -2
  56. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Channels.mjs +128 -2
  57. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Collect.mjs +19 -0
  58. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Context.mjs +50 -0
  59. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Distinct.mjs +215 -0
  60. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Emitters.mjs +4 -4
  61. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Merge.mjs +111 -0
  62. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/SharedFlow.mjs +2 -273
  63. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/StateFlow.mjs +2 -366
  64. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/AbstractSharedFlow.mjs +2 -144
  65. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/ChannelFlow.mjs +648 -2
  66. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/FlowExceptions.mjs +13 -0
  67. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/Merge.mjs +311 -0
  68. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/NopCollector.mjs +39 -0
  69. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/ConcurrentLinkedList.mjs +2 -2
  70. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/CoroutineExceptionHandlerImpl.common.mjs +2 -2
  71. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/DispatchedContinuation.mjs +2 -2
  72. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/Scopes.mjs +2 -2
  73. package/kotlinx-coroutines-core/kotlinx/coroutines/intrinsics/Undispatched.mjs +2 -2
  74. package/kotlinx-coroutines-core/kotlinx/coroutines/selects/Select.mjs +2 -2
  75. package/kotlinx-coroutines-core/kotlinx/coroutines/sync/Semaphore.mjs +1 -1
  76. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Buffer.mjs +2 -2
  77. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Core.mjs +2 -2
  78. package/kotlinx-io-kotlinx-io-core/kotlinx/io/RealSource.mjs +2 -2
  79. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Segment.mjs +2 -2
  80. package/kotlinx-io-kotlinx-io-core/kotlinx/io/SegmentPool.mjs +2 -2
  81. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/PolymorphicSerializer.mjs +2 -2
  82. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/SealedSerializer.mjs +1 -1
  83. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/Serializers.mjs +2 -2
  84. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/SerializersCache.mjs +2 -2
  85. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/builtins/BuiltinSerializers.mjs +2 -2
  86. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/descriptors/SerialDescriptors.mjs +2 -2
  87. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/encoding/AbstractEncoder.mjs +2 -2
  88. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/AbstractPolymorphicSerializer.mjs +2 -2
  89. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/BuiltInSerializers.mjs +2 -2
  90. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/CollectionSerializers.mjs +2 -2
  91. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Enums.mjs +2 -2
  92. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/InlineClassDescriptor.mjs +2 -2
  93. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/NoOpEncoder.mjs +2 -2
  94. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/ObjectSerializer.mjs +2 -2
  95. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Platform.mjs +2 -2
  96. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/PluginGeneratedSerialDescriptor.mjs +2 -2
  97. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/PrimitiveArraysSerializers.mjs +2 -2
  98. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Primitives.mjs +2 -2
  99. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Tuples.mjs +2 -2
  100. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/ValueClasses.mjs +2 -2
  101. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/Json.mjs +2 -2
  102. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElement.mjs +2 -2
  103. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElementSerializers.mjs +2 -2
  104. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonExceptions.mjs +2 -2
  105. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/CommentLexers.mjs +2 -2
  106. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonElementMarker.mjs +1 -1
  107. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonExceptions.mjs +2 -2
  108. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonStreams.mjs +2 -2
  109. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonTreeReader.mjs +2 -2
  110. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StreamingJsonDecoder.mjs +2 -2
  111. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StreamingJsonEncoder.mjs +2 -2
  112. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StringJsonLexer.mjs +2 -2
  113. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/TreeJsonDecoder.mjs +2 -2
  114. package/ktor-ktor-client-auth/io/ktor/client/plugins/auth/Auth.mjs +1 -1
  115. package/ktor-ktor-client-content-negotiation/io/ktor/client/plugins/contentnegotiation/ContentNegotiation.mjs +2 -2
  116. package/ktor-ktor-client-core/io/ktor/client/call/HttpClientCall.mjs +2 -2
  117. package/ktor-ktor-client-core/io/ktor/client/call/SavedCall.mjs +2 -2
  118. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngine.mjs +2 -2
  119. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineBase.mjs +2 -2
  120. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineCapability.mjs +2 -2
  121. package/ktor-ktor-client-core/io/ktor/client/fetch/LibDom.mjs +1 -1
  122. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpCallValidator.mjs +1 -1
  123. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpPlainText.mjs +1 -1
  124. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRedirect.mjs +1 -1
  125. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestLifecycle.mjs +2 -2
  126. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestRetry.mjs +2 -2
  127. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpSend.mjs +2 -2
  128. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpTimeout.mjs +2 -2
  129. package/ktor-ktor-client-core/io/ktor/client/plugins/SaveBody.mjs +2 -2
  130. package/ktor-ktor-client-core/io/ktor/client/plugins/api/CommonHooks.mjs +2 -2
  131. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCache.mjs +2 -2
  132. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheEntry.mjs +2 -2
  133. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheLegacy.mjs +2 -2
  134. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheValidation.mjs +2 -2
  135. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/DisabledCacheStorage.mjs +2 -2
  136. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/HttpCacheStorage.mjs +2 -2
  137. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/UnlimitedCacheStorage.mjs +2 -2
  138. package/ktor-ktor-client-core/io/ktor/client/plugins/cookies/HttpCookies.mjs +1 -1
  139. package/ktor-ktor-client-core/io/ktor/client/plugins/observer/ResponseObserver.mjs +1 -1
  140. package/ktor-ktor-client-core/io/ktor/client/request/DefaultHttpRequest.mjs +2 -2
  141. package/ktor-ktor-client-core/io/ktor/client/request/HttpRequest.mjs +2 -2
  142. package/ktor-ktor-client-encoding/io/ktor/client/plugins/compression/ContentEncoding.mjs +1 -1
  143. package/ktor-ktor-client-logging/io/ktor/client/plugins/logging/Logging.mjs +1 -1
  144. package/ktor-ktor-http/io/ktor/http/URLBuilder.mjs +2 -2
  145. package/ktor-ktor-http/io/ktor/http/URLParser.mjs +2 -2
  146. package/ktor-ktor-http/io/ktor/http/URLUtils.mjs +2 -2
  147. package/ktor-ktor-http/io/ktor/http/Url.mjs +2 -2
  148. package/ktor-ktor-http/io/ktor/http/content/CompressedContent.mjs +2 -2
  149. package/ktor-ktor-io/io/ktor/utils/io/ByteChannel.mjs +2 -2
  150. package/ktor-ktor-io/io/ktor/utils/io/ByteChannelScanner.mjs +2 -2
  151. package/ktor-ktor-io/io/ktor/utils/io/ByteReadChannelOperations.mjs +2 -2
  152. package/ktor-ktor-io/io/ktor/utils/io/ByteWriteChannel.mjs +2 -2
  153. package/ktor-ktor-io/io/ktor/utils/io/ByteWriteChannelOperations.mjs +2 -2
  154. package/ktor-ktor-io/io/ktor/utils/io/charsets/Charset.js.mjs +2 -2
  155. package/ktor-ktor-io/io/ktor/utils/io/charsets/Encoding.mjs +2 -2
  156. package/ktor-ktor-io/io/ktor/utils/io/charsets/ISO88591.mjs +2 -2
  157. package/ktor-ktor-utils/io/ktor/util/PlatformUtils.js.mjs +2 -2
  158. package/ktor-ktor-utils/io/ktor/util/PlatformUtils.mjs +2 -2
  159. package/ktor-ktor-utils/io/ktor/util/date/Date.mjs +2 -2
  160. package/ktor-ktor-utils/io/ktor/util/date/DateJs.mjs +2 -2
  161. package/ktor-ktor-utils/io/ktor/util/pipeline/DebugPipelineContext.mjs +2 -2
  162. package/ktor-ktor-utils/io/ktor/util/pipeline/Pipeline.mjs +2 -2
  163. package/ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs +2 -2
  164. package/ktor-ktor-utils/io/ktor/util/pipeline/SuspendFunctionGun.mjs +2 -2
  165. package/ktor-ktor-websockets/io/ktor/websocket/DefaultWebSocketSession.mjs +2 -2
  166. package/ktor-ktor-websockets/io/ktor/websocket/PingPong.mjs +2 -2
  167. package/ktor-ktor-websockets/io/ktor/websocket/WebSocketChannelsConfig.mjs +11 -2
  168. package/package.json +1 -1
  169. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-4.mjs +5 -5
  170. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-6.mjs +8 -8
  171. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-7.mjs +4 -4
  172. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-8.mjs +21 -21
  173. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-9.mjs +9 -9
  174. package/solibo-cycles/cryptography-kotlin-cryptography-serialization-asn1-modules-3.mjs +3 -3
  175. package/solibo-cycles/kotlin-kotlin-stdlib-10.mjs +11 -11
  176. package/solibo-cycles/kotlin-kotlin-stdlib-13.mjs +297 -245
  177. package/solibo-cycles/kotlin-kotlin-stdlib-14.mjs +250 -428
  178. package/solibo-cycles/kotlin-kotlin-stdlib-15.mjs +482 -0
  179. package/solibo-cycles/kotlinx-coroutines-core-17.mjs +5576 -3023
  180. package/solibo-cycles/kotlinx-coroutines-core-18.mjs +3500 -365
  181. package/solibo-cycles/kotlinx-coroutines-core-19.mjs +1316 -0
  182. package/solibo-cycles/kotlinx-io-kotlinx-io-core-20.mjs +602 -336
  183. package/solibo-cycles/kotlinx-io-kotlinx-io-core-21.mjs +383 -0
  184. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-22.mjs +4075 -145
  185. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-23.mjs +188 -196
  186. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-24.mjs +186 -360
  187. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-25.mjs +392 -0
  188. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-26.mjs +227 -3646
  189. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-27.mjs +3638 -143
  190. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-28.mjs +179 -0
  191. package/solibo-cycles/ktor-ktor-client-core-29.mjs +3004 -427
  192. package/solibo-cycles/ktor-ktor-client-core-30.mjs +455 -3061
  193. package/solibo-cycles/ktor-ktor-client-core-31.mjs +3176 -0
  194. package/solibo-cycles/{ktor-ktor-http-31.mjs → ktor-ktor-http-32.mjs} +5 -5
  195. package/solibo-cycles/ktor-ktor-io-33.mjs +2950 -342
  196. package/solibo-cycles/ktor-ktor-io-34.mjs +412 -0
  197. package/solibo-cycles/ktor-ktor-utils-35.mjs +557 -312
  198. package/solibo-cycles/ktor-ktor-utils-36.mjs +329 -218
  199. package/solibo-cycles/ktor-ktor-utils-37.mjs +245 -0
  200. package/solibo-cycles/{solibo-sdk-sdk-api-document-39.mjs → solibo-sdk-sdk-api-document-40.mjs} +1 -1
  201. package/solibo-cycles/solibo-sdk-sdk-api-resident-43.mjs +819 -332
  202. package/solibo-cycles/solibo-sdk-sdk-api-resident-44.mjs +745 -1431
  203. package/solibo-cycles/solibo-sdk-sdk-api-resident-45.mjs +1597 -0
  204. package/solibo-cycles/solibo-sdk-sdk-core-47.mjs +1020 -3585
  205. package/solibo-cycles/solibo-sdk-sdk-core-48.mjs +3984 -2184
  206. package/solibo-cycles/solibo-sdk-sdk-core-49.mjs +2634 -580
  207. package/solibo-cycles/solibo-sdk-sdk-core-50.mjs +597 -1902
  208. package/solibo-cycles/solibo-sdk-sdk-core-51.mjs +1873 -943
  209. package/solibo-cycles/solibo-sdk-sdk-core-52.mjs +1147 -9240
  210. package/solibo-cycles/solibo-sdk-sdk-core-53.mjs +8074 -3853
  211. package/solibo-cycles/solibo-sdk-sdk-core-54.mjs +5135 -0
  212. package/solibo-sdk-sdk/no/solibo/oss/sdk/SoliboSDK.mjs +1 -1
  213. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/IntegratedDocumentMutation.export.d.mts +18 -0
  214. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/IntegratedDocumentMutation.mjs +3411 -463
  215. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/MockHomeApi.mjs +874 -707
  216. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewCommunicationCommentPushPayload.mjs +2 -2
  217. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewMessageInConversationPushPayload.mjs +2 -2
  218. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewNeighborhoodPostPushPayload.mjs +2 -2
  219. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewOppslagPushPayload.mjs +2 -2
  220. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewPracticalInfoPushPayload.mjs +2 -2
  221. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/PushNotificationPayload.mjs +2 -2
  222. package/solibo-sdk-sdk-api-document/no/solibo/oss/sdk/api/DocumentUploader.mjs +2 -2
  223. package/solibo-sdk-sdk-api-document/no/solibo/oss/sdk/api/DocumentsApi.mjs +2 -2
  224. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/ExpenseFollowUp.mjs +2 -2
  225. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/FollowUp.mjs +2 -2
  226. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/MeetingProtocolFollowUp.mjs +2 -2
  227. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/SupplierInvoiceFollowUp.mjs +2 -2
  228. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalCustomerCommand.mjs +2 -2
  229. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalOrganizationCustomerCommand.mjs +2 -2
  230. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalPersonCustomerCommand.mjs +2 -2
  231. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/ResidentOperations.mjs +2 -2
  232. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/ResidentsApi.mjs +2 -2
  233. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreateOrganizationResidentCommand.mjs +2 -2
  234. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreatePersonResidentCommand.mjs +2 -2
  235. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreateResidentCommand.mjs +2 -2
  236. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdateOrganizationResidentCommand.mjs +2 -2
  237. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdatePersonResidentCommand.mjs +2 -2
  238. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdateResidentCommand.mjs +2 -2
  239. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationAltinnError.mjs +2 -2
  240. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationEmailError.mjs +2 -2
  241. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationError.mjs +2 -2
  242. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationPostenError.mjs +2 -2
  243. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationProcessError.mjs +2 -2
  244. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/Platform.js.mjs +2 -2
  245. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/SoliboSDKBase.mjs +1 -1
  246. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBus.export.d.mts +3 -1
  247. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBus.mjs +743 -69
  248. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBusAccess.mjs +2 -2
  249. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBusSubscriptions.mjs +75 -25
  250. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/HomeApiBase.export.d.mts +1 -0
  251. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/HomeApiBase.mjs +2 -2
  252. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/ApiClient.mjs +1 -1
  253. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/HttpResponse.mjs +2 -2
  254. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Ack.mjs +2 -2
  255. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/AckedPayload.mjs +2 -2
  256. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Attendance.mjs +2 -2
  257. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/AuthUser.mjs +2 -2
  258. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/BoardParticipant.mjs +2 -2
  259. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ClientUser.mjs +2 -2
  260. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ClientUserParticipant.mjs +2 -2
  261. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationEventPayload.mjs +2 -2
  262. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationMessagePayload.mjs +2 -2
  263. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationTypingPayload.mjs +2 -2
  264. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationUpdatedPayload.mjs +2 -2
  265. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Customer.mjs +2 -2
  266. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/DomainEventPayload.mjs +2 -2
  267. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/EmployeeParticipant.mjs +2 -2
  268. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/EventBusErrorPayload.mjs +2 -2
  269. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/GenericPayload.mjs +2 -2
  270. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/HeartbeatPayload.mjs +2 -2
  271. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/IncomingEventBusMessage.mjs +2 -2
  272. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/InquiryParticipant.mjs +2 -2
  273. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationCustomer.mjs +2 -2
  274. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationParticipant.mjs +2 -2
  275. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationResident.mjs +2 -2
  276. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Participant.mjs +2 -2
  277. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonCustomer.mjs +2 -2
  278. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonParticipant.mjs +2 -2
  279. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonResident.mjs +2 -2
  280. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonUser.mjs +2 -2
  281. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Ping.mjs +2 -2
  282. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Pong.mjs +2 -2
  283. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ReplayCompletePayload.mjs +2 -2
  284. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Resident.mjs +2 -2
  285. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ResidentRelationshipAggregate.mjs +2 -2
  286. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ResidentRelationshipPeriod.mjs +2 -2
  287. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextAckedPayload.mjs +2 -2
  288. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextClose.mjs +2 -2
  289. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextErrorPayload.mjs +2 -2
  290. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextOpen.mjs +2 -2
  291. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextOpenedPayload.mjs +2 -2
  292. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextPresence.mjs +2 -2
  293. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextPresencePayload.mjs +2 -2
  294. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextSyncedPayload.mjs +2 -2
  295. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextUpdate.mjs +2 -2
  296. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextUpdatePayload.mjs +2 -2
  297. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Subscribe.mjs +2 -2
  298. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SubscribedPayload.mjs +2 -2
  299. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SubscriptionEndedPayload.mjs +2 -2
  300. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SupplierContactParticipant.mjs +2 -2
  301. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Typing.mjs +2 -2
  302. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Unsubscribe.mjs +2 -2
  303. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/WebSocketPayload.mjs +2 -2
  304. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/auth/Auth.mjs +2 -2
  305. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/auth/SignInResult.mjs +2 -2
  306. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/telemetry/SoliboOpenTelemetry.mjs +1 -1
  307. package/solibo-sdk-sdk.d.mts +22 -1
  308. package/solibo-cycles/kotlinx-coroutines-core-16.mjs +0 -5952
  309. package/solibo-cycles/kotlinx-io-kotlinx-io-core-19.mjs +0 -649
  310. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-21.mjs +0 -4140
  311. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-25.mjs +0 -255
  312. package/solibo-cycles/ktor-ktor-client-core-28.mjs +0 -3147
  313. package/solibo-cycles/ktor-ktor-io-32.mjs +0 -3020
  314. package/solibo-cycles/ktor-ktor-utils-34.mjs +0 -601
  315. package/solibo-cycles/solibo-sdk-sdk-api-resident-42.mjs +0 -1398
  316. package/solibo-cycles/solibo-sdk-sdk-core-46.mjs +0 -2166
  317. /package/solibo-cycles/{KotlinBigInteger-bignum-15.mjs → KotlinBigInteger-bignum-16.mjs} +0 -0
  318. /package/solibo-cycles/{ktor-ktor-websockets-37.mjs → ktor-ktor-websockets-38.mjs} +0 -0
  319. /package/solibo-cycles/{solibo-sdk-sdk-api-communication-38.mjs → solibo-sdk-sdk-api-communication-39.mjs} +0 -0
  320. /package/solibo-cycles/{solibo-sdk-sdk-api-follow-up-40.mjs → solibo-sdk-sdk-api-follow-up-41.mjs} +0 -0
  321. /package/solibo-cycles/{solibo-sdk-sdk-api-invoicing-41.mjs → solibo-sdk-sdk-api-invoicing-42.mjs} +0 -0
  322. /package/solibo-cycles/{solibo-sdk-sdk-api-third-party-information-45.mjs → solibo-sdk-sdk-api-third-party-information-46.mjs} +0 -0
@@ -1,150 +1,423 @@
1
- // Generated by sdk/scripts/post-process-per-file.js from an import cycle of 2 files; see collapseCycles.
2
- // build/packages/js/kotlinx-coroutines-core/kotlinx/coroutines/flow/Channels.mjs
1
+ // Generated by sdk/scripts/post-process-per-file.js from an import cycle of 3 files; see collapseCycles.
2
+ // build/packages/js/kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferedChannel.mjs
3
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
4
+ import {
5
+ Segmentqmq1glevgieu as Segment,
6
+ closefimrnzr4lu35 as close,
7
+ findSegmentInternal35lxp6iondi3q as findSegmentInternal,
8
+ _SegmentOrClosed___get_segment__impl__jvcr9l2mjww16efupm8 as _SegmentOrClosed___get_segment__impl__jvcr9l,
9
+ _SegmentOrClosed___get_isClosed__impl__qmxmlo1rgnwiimtgu6z as _SegmentOrClosed___get_isClosed__impl__qmxmlo,
10
+ SegmentOrCloseds3xpxfs4wrg9 as SegmentOrClosed
11
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/ConcurrentLinkedList.mjs";
12
+ import { atomicfu$AtomicRefArray$ofNulls2kz3j9ehigwa3 as atomicfu$AtomicRefArray$ofNulls } from "../kotlinx-atomicfu/kotlinx/atomicfu/AtomicFU.common.mjs";
3
13
  import {
14
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
15
+ THROW_CCE2g6jy02ryeudk as THROW_CCE
16
+ } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
17
+ import {
18
+ protoOf180f3jzyo7rfj as protoOf,
4
19
  toString1pkumu07cwy4m as toString,
5
- protoOf180f3jzyo7rfj as protoOf
20
+ equals2au1ep9vhcato as equals
6
21
  } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
7
- import { IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
8
- import { Unit_instance3kz1zqli6gr1r as Unit_instance } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
9
- import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
10
- import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
22
+ import { Waiter3lxa2a79zyo0g as Waiter } from "../kotlinx-coroutines-core/kotlinx/coroutines/Waiter.mjs";
23
+ import { isInterface3d6p8outrmvmk as isInterface } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
24
+ import { toString30pk9tzaqopn as toString_0 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
25
+ import {
26
+ IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$,
27
+ IllegalArgumentException_init_$Create$1gox8sdqs91jy as IllegalArgumentException_init_$Create$,
28
+ NoSuchElementException_init_$Create$14710snnwdnfb as NoSuchElementException_init_$Create$
29
+ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
11
30
  import {
12
- initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
13
- initMetadataForClassbxx6q50dy2s7 as initMetadataForClass
31
+ callUndeliveredElement5xsmnofvtcme as callUndeliveredElement,
32
+ callUndeliveredElementCatchingException6xwxmojd3rq1 as callUndeliveredElementCatchingException
33
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/OnUndeliveredElement.mjs";
34
+ import {
35
+ fromInt2ii0rejb1w62w as fromInt,
36
+ multiply2k9eolhnz1bjv as multiply,
37
+ add2suhfggl4zvkk as add,
38
+ dividelr0uqtdj497z as divide,
39
+ modulooi4g1kq3dmtt as modulo,
40
+ convertToInty04h231mmjoh as convertToInt,
41
+ shiftRight2gqph14wydb8s as shiftRight,
42
+ subtract2orl8z9upxd9l as subtract,
43
+ shiftLeft3tsh2sstjchzn as shiftLeft
44
+ } from "../kotlin-kotlin-stdlib/kotlin/js/internal/longAsBigInt/longAsBigInt.mjs";
45
+ import {
46
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
47
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine
14
48
  } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
15
49
  import { VOID3gxj6tk5isa35 as VOID } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
16
- import { EmptyCoroutineContext_instance3dshdbvg42f79 as EmptyCoroutineContext_instance } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineContextImpl.mjs";
17
- import { BufferOverflow_SUSPEND_getInstance1ucmryz5dsuc2 as BufferOverflow_SUSPEND_getInstance } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferOverflow.mjs";
18
- import { atomic$boolean$1iggki4z65a2h as atomic$boolean$1 } from "../kotlinx-atomicfu/kotlinx/atomicfu/AtomicFU.mjs";
19
- import { SendingCollector33jb503i6hglm as SendingCollector } from "../kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/SendingCollector.mjs";
20
- import { ensureActive17z6c489wymmv as ensureActive } from "../kotlinx-coroutines-core/kotlinx/coroutines/flow/Emitters.mjs";
21
- import { cancelConsumed2i0oizqhmljf6 as cancelConsumed } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/Channels.common.mjs";
22
- function receiveAsFlow(_this__u8e3s4) {
23
- return new (ChannelAsFlow())(_this__u8e3s4, false);
24
- }
25
- function markConsumed($this) {
26
- if ($this.consume_1) {
27
- if (!!$this.consumed_1.atomicfu$getAndSet(true)) {
28
- var message = "ReceiveChannel.consumeAsFlow can be collected just once";
29
- throw IllegalStateException_init_$Create$(toString(message));
30
- }
31
- }
50
+ import {
51
+ recoverStackTrace3k4hvtb53ci4z as recoverStackTrace,
52
+ recoverStackTrace2i3si2i8nvw1k as recoverStackTrace_0
53
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/StackTraceRecovery.mjs";
54
+ import { intercepted2ogpsikxxj4u0 as intercepted } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/IntrinsicsJs.mjs";
55
+ import {
56
+ getOrCreateCancellableContinuation2t1o0dr9l9i36 as getOrCreateCancellableContinuation,
57
+ CancellableContinuationpb2x00mxmcbt as CancellableContinuation
58
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuation.mjs";
59
+ import {
60
+ Companion_instancejy2056q2ma5w as Companion_instance,
61
+ createFailure8paxfkfa5dc7 as createFailure,
62
+ _Result___init__impl__xyqfz832zdzqrocazzs as _Result___init__impl__xyqfz8
63
+ } from "../kotlin-kotlin-stdlib/kotlin/Result.mjs";
64
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
65
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
66
+ import { CancellableContinuationImpl1cx201opicavg as CancellableContinuationImpl } from "../kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuationImpl.mjs";
67
+ import { addSuppressedu5jwjfvsc039 as addSuppressed } from "../kotlin-kotlin-stdlib/kotlin/throwableExtensions.mjs";
68
+ import {
69
+ SelectInstance2isepgzfsd8ur as SelectInstance,
70
+ SelectImplementation59ci94k9x9wm as SelectImplementation,
71
+ TrySelectDetailedResult_REREGISTER_getInstance22g7lc4gi2j6m as TrySelectDetailedResult_REREGISTER_getInstance,
72
+ TrySelectDetailedResult_SUCCESSFUL_getInstancea5pcdnmhzdxt as TrySelectDetailedResult_SUCCESSFUL_getInstance,
73
+ SelectClause1Impl32e0ot7ko7h09 as SelectClause1Impl
74
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/selects/Select.mjs";
75
+ import {
76
+ _InlineList___init__impl__z8n56m2gffjy7o3ep as _InlineList___init__impl__z8n56,
77
+ InlineList__plus_impl_nuetvo25d08twmx1uk7 as InlineList__plus_impl_nuetvo,
78
+ access$_get_holder__kkflengpb3tkfr49xk as access$_get_holder__kkflen
79
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/InlineList.mjs";
80
+ import {
81
+ ArrayList3it5z8td81qkl as ArrayList,
82
+ ArrayList_init_$Create$2xrifdqz5xirg as ArrayList_init_$Create$
83
+ } from "../kotlin-kotlin-stdlib/kotlin/collections/ArrayListJs.mjs";
84
+ import { constructCallableReference23y65rf941mch as constructCallableReference } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
85
+ import {
86
+ atomic$long$129k9zwo6n9ogd as atomic$long$1,
87
+ atomic$ref$130aurmcwdfdf1 as atomic$ref$1
88
+ } from "../kotlinx-atomicfu/kotlinx/atomicfu/AtomicFU.mjs";
89
+ import { CancellationException_init_$Create$1flhbcsrur0zx as CancellationException_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/coroutines/cancellation/CancellationException.mjs";
90
+ import { StringBuilder_init_$Create$b2348mky3co as StringBuilder_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/text/StringBuilderJs.mjs";
91
+ import { listOf1jh22dvmctj1r as listOf } from "../kotlin-kotlin-stdlib/kotlin/collections/CollectionsKt.mjs";
92
+ import { compareTo3ankvs086tmwq as compareTo } from "../kotlin-kotlin-stdlib/kotlin/js/compareTo.mjs";
93
+ import { last2n4gf5az1lkn4 as last } from "../kotlin-kotlin-stdlib/kotlin/text/_Strings.mjs";
94
+ import { _Char___init__impl__6a9atxrzocepzq3zgi as _Char___init__impl__6a9atx } from "../kotlin-kotlin-stdlib/kotlin/Char.mjs";
95
+ import { systemProp2qpti4y1f5b4b as systemProp } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/SystemProps.common.mjs";
96
+ import { Symbol17xuwzgi5g8ve as Symbol } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/Symbol.mjs";
97
+ var imul = Math.imul;
98
+ function get_NULL_SEGMENT() {
99
+ _init_properties_BufferedChannel_kt__d6uc4y();
100
+ return NULL_SEGMENT;
32
101
  }
33
- var $collectCOROUTINE$Class;
34
- function $collectCOROUTINE$() {
35
- if ($collectCOROUTINE$Class === VOID) {
36
- let $ = function(_this__u8e3s4, collector, resultContinuation) {
37
- CoroutineImpl().call(this, resultContinuation);
38
- this._this__u8e3s4__1 = _this__u8e3s4;
39
- this.collector_1 = collector;
102
+ var NULL_SEGMENT;
103
+ function get_SEGMENT_SIZE() {
104
+ _init_properties_BufferedChannel_kt__d6uc4y();
105
+ return SEGMENT_SIZE;
106
+ }
107
+ var SEGMENT_SIZE;
108
+ function get_EXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS() {
109
+ _init_properties_BufferedChannel_kt__d6uc4y();
110
+ return EXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS;
111
+ }
112
+ var EXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS;
113
+ function get_BUFFERED() {
114
+ _init_properties_BufferedChannel_kt__d6uc4y();
115
+ return BUFFERED;
116
+ }
117
+ var BUFFERED;
118
+ function get_IN_BUFFER() {
119
+ _init_properties_BufferedChannel_kt__d6uc4y();
120
+ return IN_BUFFER;
121
+ }
122
+ var IN_BUFFER;
123
+ function get_RESUMING_BY_RCV() {
124
+ _init_properties_BufferedChannel_kt__d6uc4y();
125
+ return RESUMING_BY_RCV;
126
+ }
127
+ var RESUMING_BY_RCV;
128
+ function get_RESUMING_BY_EB() {
129
+ _init_properties_BufferedChannel_kt__d6uc4y();
130
+ return RESUMING_BY_EB;
131
+ }
132
+ var RESUMING_BY_EB;
133
+ function get_POISONED() {
134
+ _init_properties_BufferedChannel_kt__d6uc4y();
135
+ return POISONED;
136
+ }
137
+ var POISONED;
138
+ function get_DONE_RCV() {
139
+ _init_properties_BufferedChannel_kt__d6uc4y();
140
+ return DONE_RCV;
141
+ }
142
+ var DONE_RCV;
143
+ function get_INTERRUPTED_SEND() {
144
+ _init_properties_BufferedChannel_kt__d6uc4y();
145
+ return INTERRUPTED_SEND;
146
+ }
147
+ var INTERRUPTED_SEND;
148
+ function get_INTERRUPTED_RCV() {
149
+ _init_properties_BufferedChannel_kt__d6uc4y();
150
+ return INTERRUPTED_RCV;
151
+ }
152
+ var INTERRUPTED_RCV;
153
+ function get_CHANNEL_CLOSED() {
154
+ _init_properties_BufferedChannel_kt__d6uc4y();
155
+ return CHANNEL_CLOSED;
156
+ }
157
+ var CHANNEL_CLOSED;
158
+ function get_SUSPEND() {
159
+ _init_properties_BufferedChannel_kt__d6uc4y();
160
+ return SUSPEND;
161
+ }
162
+ var SUSPEND;
163
+ function get_SUSPEND_NO_WAITER() {
164
+ _init_properties_BufferedChannel_kt__d6uc4y();
165
+ return SUSPEND_NO_WAITER;
166
+ }
167
+ var SUSPEND_NO_WAITER;
168
+ function get_FAILED() {
169
+ _init_properties_BufferedChannel_kt__d6uc4y();
170
+ return FAILED;
171
+ }
172
+ var FAILED;
173
+ function get_NO_RECEIVE_RESULT() {
174
+ _init_properties_BufferedChannel_kt__d6uc4y();
175
+ return NO_RECEIVE_RESULT;
176
+ }
177
+ var NO_RECEIVE_RESULT;
178
+ function get_CLOSE_HANDLER_CLOSED() {
179
+ _init_properties_BufferedChannel_kt__d6uc4y();
180
+ return CLOSE_HANDLER_CLOSED;
181
+ }
182
+ var CLOSE_HANDLER_CLOSED;
183
+ function get_CLOSE_HANDLER_INVOKED() {
184
+ _init_properties_BufferedChannel_kt__d6uc4y();
185
+ return CLOSE_HANDLER_INVOKED;
186
+ }
187
+ var CLOSE_HANDLER_INVOKED;
188
+ function get_NO_CLOSE_CAUSE() {
189
+ _init_properties_BufferedChannel_kt__d6uc4y();
190
+ return NO_CLOSE_CAUSE;
191
+ }
192
+ var NO_CLOSE_CAUSE;
193
+ function setElementLazy($this, index, value) {
194
+ $this.data_1.atomicfu$get(imul(index, 2)).kotlinx$atomicfu$value = value;
195
+ }
196
+ var ChannelSegmentClass;
197
+ function ChannelSegment() {
198
+ if (ChannelSegmentClass === VOID) {
199
+ let $ = function(id, prev, channel, pointers) {
200
+ Segment().call(this, id, prev, pointers);
201
+ this._channel_1 = channel;
202
+ this.data_1 = atomicfu$AtomicRefArray$ofNulls(imul(get_SEGMENT_SIZE(), 2));
40
203
  };
41
- initMetadataForCoroutine($, CoroutineImpl());
42
- protoOf($).doResume_5yljmg_k$ = function() {
43
- var suspendResult = this.result_1;
44
- $sm: do
45
- try {
46
- var tmp = this.state_1;
47
- switch (tmp) {
48
- case 0:
49
- this.exceptionState_1 = 4;
50
- if (this._this__u8e3s4__1.capacity_1 === -3) {
51
- markConsumed(this._this__u8e3s4__1);
52
- this.state_1 = 2;
53
- suspendResult = emitAllImpl(this.collector_1, this._this__u8e3s4__1.channel_1, this._this__u8e3s4__1.consume_1, this);
54
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
55
- return suspendResult;
56
- }
57
- continue $sm;
58
- } else {
59
- this.state_1 = 1;
60
- suspendResult = protoOf(ChannelFlow()).collect_aksokr_k$.call(this._this__u8e3s4__1, this.collector_1, this);
61
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
62
- return suspendResult;
63
- }
64
- continue $sm;
204
+ initMetadataForClass($, "ChannelSegment", VOID, Segment());
205
+ protoOf($).get_channel_dhi7tm_k$ = function() {
206
+ return ensureNotNull(this._channel_1);
207
+ };
208
+ protoOf($).get_numberOfSlots_n3mgwk_k$ = function() {
209
+ return get_SEGMENT_SIZE();
210
+ };
211
+ protoOf($).storeElement_gce1i0_k$ = function(index, element) {
212
+ setElementLazy(this, index, element);
213
+ };
214
+ protoOf($).getElement_ye1phr_k$ = function(index) {
215
+ return this.data_1.atomicfu$get(imul(index, 2)).kotlinx$atomicfu$value;
216
+ };
217
+ protoOf($).retrieveElement_j8ywl1_k$ = function(index) {
218
+ var this_0 = this.getElement_ye1phr_k$(index);
219
+ this.cleanElement_ob56q6_k$(index);
220
+ return this_0;
221
+ };
222
+ protoOf($).cleanElement_ob56q6_k$ = function(index) {
223
+ setElementLazy(this, index, null);
224
+ };
225
+ protoOf($).getState_jak5mi_k$ = function(index) {
226
+ return this.data_1.atomicfu$get(imul(index, 2) + 1 | 0).kotlinx$atomicfu$value;
227
+ };
228
+ protoOf($).setState_bwy33f_k$ = function(index, value) {
229
+ this.data_1.atomicfu$get(imul(index, 2) + 1 | 0).kotlinx$atomicfu$value = value;
230
+ };
231
+ protoOf($).casState_u37dcn_k$ = function(index, from, to) {
232
+ return this.data_1.atomicfu$get(imul(index, 2) + 1 | 0).atomicfu$compareAndSet(from, to);
233
+ };
234
+ protoOf($).getAndSetState_5asfss_k$ = function(index, update) {
235
+ return this.data_1.atomicfu$get(imul(index, 2) + 1 | 0).atomicfu$getAndSet(update);
236
+ };
237
+ protoOf($).onCancellation_4jec3b_k$ = function(index, cause, context) {
238
+ var isSender = index >= get_SEGMENT_SIZE();
239
+ var index_0 = isSender ? index - get_SEGMENT_SIZE() | 0 : index;
240
+ var element = this.getElement_ye1phr_k$(index_0);
241
+ $l$loop: while (true) {
242
+ var cur = this.getState_jak5mi_k$(index_0);
243
+ var tmp;
244
+ if (!(cur == null) ? isInterface(cur, Waiter()) : false) {
245
+ tmp = true;
246
+ } else {
247
+ tmp = cur instanceof WaiterEB();
248
+ }
249
+ if (tmp) {
250
+ var update = isSender ? get_INTERRUPTED_SEND() : get_INTERRUPTED_RCV();
251
+ if (this.casState_u37dcn_k$(index_0, cur, update)) {
252
+ this.cleanElement_ob56q6_k$(index_0);
253
+ this.onCancelledRequest_bhmu12_k$(index_0, !isSender);
254
+ if (isSender) {
255
+ var tmp0_safe_receiver = this.get_channel_dhi7tm_k$().onUndeliveredElement_1;
256
+ if (tmp0_safe_receiver == null)
257
+ null;
258
+ else {
259
+ callUndeliveredElement(tmp0_safe_receiver, element, context);
65
260
  }
66
- case 1:
67
- this.state_1 = 3;
68
- continue $sm;
69
- case 2:
70
- this.state_1 = 3;
71
- continue $sm;
72
- case 3:
73
- return Unit_instance;
74
- case 4:
75
- throw this.exception_1;
261
+ }
262
+ return Unit_instance;
76
263
  }
77
- } catch ($p) {
78
- var e = $p;
79
- if (this.exceptionState_1 === 4) {
80
- throw e;
264
+ } else {
265
+ if (cur === get_INTERRUPTED_SEND() || cur === get_INTERRUPTED_RCV()) {
266
+ this.cleanElement_ob56q6_k$(index_0);
267
+ if (isSender) {
268
+ var tmp1_safe_receiver = this.get_channel_dhi7tm_k$().onUndeliveredElement_1;
269
+ if (tmp1_safe_receiver == null)
270
+ null;
271
+ else {
272
+ callUndeliveredElement(tmp1_safe_receiver, element, context);
273
+ }
274
+ }
275
+ return Unit_instance;
81
276
  } else {
82
- this.state_1 = this.exceptionState_1;
83
- this.exception_1 = e;
277
+ if (cur === get_RESUMING_BY_EB() || cur === get_RESUMING_BY_RCV())
278
+ continue $l$loop;
279
+ else {
280
+ if (cur === get_DONE_RCV() || cur === get_BUFFERED())
281
+ return Unit_instance;
282
+ else {
283
+ if (cur === get_CHANNEL_CLOSED())
284
+ return Unit_instance;
285
+ else {
286
+ var message = "unexpected state: " + toString_0(cur);
287
+ throw IllegalStateException_init_$Create$(toString(message));
288
+ }
289
+ }
290
+ }
84
291
  }
85
292
  }
86
- while (true);
87
- };
88
- $collectCOROUTINE$Class = $;
89
- }
90
- return $collectCOROUTINE$Class;
91
- }
92
- var ChannelAsFlowClass;
93
- function ChannelAsFlow() {
94
- if (ChannelAsFlowClass === VOID) {
95
- let $ = function(channel, consume, context, capacity, onBufferOverflow) {
96
- context = context === VOID ? EmptyCoroutineContext_instance : context;
97
- capacity = capacity === VOID ? -3 : capacity;
98
- onBufferOverflow = onBufferOverflow === VOID ? BufferOverflow_SUSPEND_getInstance() : onBufferOverflow;
99
- ChannelFlow().call(this, context, capacity, onBufferOverflow);
100
- this.channel_1 = channel;
101
- this.consume_1 = consume;
102
- this.consumed_1 = atomic$boolean$1(false);
103
- };
104
- initMetadataForClass($, "ChannelAsFlow", VOID, ChannelFlow(), VOID, [1]);
105
- protoOf($).collectTo_qjwlth_k$ = function(scope, $completion) {
106
- return emitAllImpl(new (SendingCollector())(scope), this.channel_1, this.consume_1, $completion);
107
- };
108
- protoOf($).produceImpl_qjsv5i_k$ = function(scope) {
109
- markConsumed(this);
110
- var tmp;
111
- if (this.capacity_1 === -3) {
112
- tmp = this.channel_1;
113
- } else {
114
- tmp = protoOf(ChannelFlow()).produceImpl_qjsv5i_k$.call(this, scope);
115
293
  }
116
- return tmp;
117
- };
118
- protoOf($).collect_aksokr_k$ = function(collector, $completion) {
119
- var tmp = new ($collectCOROUTINE$())(this, collector, $completion);
120
- tmp.result_1 = Unit_instance;
121
- tmp.exception_1 = null;
122
- return tmp.doResume_5yljmg_k$();
123
294
  };
124
- protoOf($).additionalToStringProps_j3cp6l_k$ = function() {
125
- return "channel=" + toString(this.channel_1);
295
+ protoOf($).onCancelledRequest_bhmu12_k$ = function(index, receiver) {
296
+ if (receiver) {
297
+ var tmp = this.get_channel_dhi7tm_k$();
298
+ var tmp0 = this.id_1;
299
+ var other = get_SEGMENT_SIZE();
300
+ var this_0 = multiply(tmp0, fromInt(other));
301
+ var tmp$ret$1 = add(this_0, fromInt(index));
302
+ tmp.waitExpandBufferCompletion_nil576_k$(tmp$ret$1);
303
+ }
304
+ this.onSlotCleaned_do6lqz_k$();
126
305
  };
127
- ChannelAsFlowClass = $;
306
+ ChannelSegmentClass = $;
307
+ }
308
+ return ChannelSegmentClass;
309
+ }
310
+ function onClosedHasNext($this) {
311
+ $this.receiveResult_1 = get_CHANNEL_CLOSED();
312
+ var tmp0_elvis_lhs = $this.$this_1.get_closeCause_gbqkm2_k$();
313
+ var tmp;
314
+ if (tmp0_elvis_lhs == null) {
315
+ return false;
316
+ } else {
317
+ tmp = tmp0_elvis_lhs;
128
318
  }
129
- return ChannelAsFlowClass;
319
+ var cause = tmp;
320
+ throw recoverStackTrace(cause);
130
321
  }
131
- function emitAllImpl(_this__u8e3s4, channel, consume, $completion) {
132
- var tmp = new ($emitAllImplCOROUTINE$())(_this__u8e3s4, channel, consume, $completion);
133
- tmp.result_1 = Unit_instance;
134
- tmp.exception_1 = null;
135
- return tmp.doResume_5yljmg_k$();
322
+ function hasNextOnNoWaiterSuspend($this, segment, index, r, $completion) {
323
+ var cancellable = getOrCreateCancellableContinuation(intercepted($completion));
324
+ try {
325
+ $this.continuation_1 = cancellable;
326
+ var this_0 = $this.$this_1;
327
+ var updCellResult = updateCellReceive(this_0, segment, index, r, $this);
328
+ if (updCellResult === get_SUSPEND()) {
329
+ prepareReceiverForSuspension(this_0, $this, segment, index);
330
+ } else if (updCellResult === get_FAILED()) {
331
+ if (r < this_0.get_sendersCounter_mvbt0m_k$()) {
332
+ segment.cleanPrev_rn0kss_k$();
333
+ }
334
+ $l$block_0: {
335
+ var segment_0 = this_0.receiveSegment_1.kotlinx$atomicfu$value;
336
+ $l$loop_0: while (true) {
337
+ if (this_0.get_isClosedForReceive_v0r77d_k$()) {
338
+ onClosedHasNextNoWaiterSuspend($this);
339
+ break $l$block_0;
340
+ }
341
+ var r_0 = this_0.receivers_1.atomicfu$getAndIncrement$long();
342
+ var other = get_SEGMENT_SIZE();
343
+ var id = divide(r_0, fromInt(other));
344
+ var other_0 = get_SEGMENT_SIZE();
345
+ var tmp$ret$6 = modulo(r_0, fromInt(other_0));
346
+ var i = convertToInt(tmp$ret$6);
347
+ if (!(segment_0.id_1 === id)) {
348
+ var tmp0_elvis_lhs = findSegmentReceive(this_0, id, segment_0);
349
+ var tmp;
350
+ if (tmp0_elvis_lhs == null) {
351
+ continue $l$loop_0;
352
+ } else {
353
+ tmp = tmp0_elvis_lhs;
354
+ }
355
+ segment_0 = tmp;
356
+ }
357
+ var updCellResult_0 = updateCellReceive(this_0, segment_0, i, r_0, $this);
358
+ if (updCellResult_0 === get_SUSPEND()) {
359
+ var tmp1_safe_receiver = (!($this == null) ? isInterface($this, Waiter()) : false) ? $this : null;
360
+ if (tmp1_safe_receiver == null)
361
+ null;
362
+ else {
363
+ prepareReceiverForSuspension(this_0, tmp1_safe_receiver, segment_0, i);
364
+ }
365
+ } else if (updCellResult_0 === get_FAILED()) {
366
+ if (r_0 < this_0.get_sendersCounter_mvbt0m_k$()) {
367
+ segment_0.cleanPrev_rn0kss_k$();
368
+ }
369
+ continue $l$loop_0;
370
+ } else if (updCellResult_0 === get_SUSPEND_NO_WAITER()) {
371
+ var message = "unexpected";
372
+ throw IllegalStateException_init_$Create$(toString(message));
373
+ } else {
374
+ segment_0.cleanPrev_rn0kss_k$();
375
+ $this.receiveResult_1 = updCellResult_0;
376
+ $this.continuation_1 = null;
377
+ var tmp0_safe_receiver = $this.$this_1.onUndeliveredElement_1;
378
+ cancellable.resume_nf5g9e_k$(true, tmp0_safe_receiver == null ? null : bindCancellationFun($this.$this_1, tmp0_safe_receiver, updCellResult_0));
379
+ }
380
+ break $l$block_0;
381
+ }
382
+ }
383
+ } else {
384
+ segment.cleanPrev_rn0kss_k$();
385
+ $this.receiveResult_1 = updCellResult;
386
+ $this.continuation_1 = null;
387
+ var tmp0_safe_receiver_0 = $this.$this_1.onUndeliveredElement_1;
388
+ cancellable.resume_nf5g9e_k$(true, tmp0_safe_receiver_0 == null ? null : bindCancellationFun($this.$this_1, tmp0_safe_receiver_0, updCellResult));
389
+ }
390
+ } catch ($p) {
391
+ if ($p instanceof Error) {
392
+ var e = $p;
393
+ cancellable.releaseClaimedReusableContinuation_mdg0s9_k$();
394
+ throw e;
395
+ } else {
396
+ throw $p;
397
+ }
398
+ }
399
+ return cancellable.getResult_fck196_k$();
136
400
  }
137
- function emitAll(_this__u8e3s4, channel, $completion) {
138
- return emitAllImpl(_this__u8e3s4, channel, true, $completion);
401
+ function onClosedHasNextNoWaiterSuspend($this) {
402
+ var cont = ensureNotNull($this.continuation_1);
403
+ $this.continuation_1 = null;
404
+ $this.receiveResult_1 = get_CHANNEL_CLOSED();
405
+ var cause = $this.$this_1.get_closeCause_gbqkm2_k$();
406
+ if (cause == null) {
407
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(false);
408
+ cont.resumeWith_rk9gbt_k$(tmp$ret$1);
409
+ } else {
410
+ var exception = recoverStackTrace_0(cause, cont);
411
+ var tmp$ret$3 = _Result___init__impl__xyqfz8(createFailure(exception));
412
+ cont.resumeWith_rk9gbt_k$(tmp$ret$3);
413
+ }
139
414
  }
140
- var $emitAllImplCOROUTINE$Class;
141
- function $emitAllImplCOROUTINE$() {
142
- if ($emitAllImplCOROUTINE$Class === VOID) {
143
- let $ = function(_this__u8e3s4, channel, consume, resultContinuation) {
415
+ var $hasNextCOROUTINE$Class;
416
+ function $hasNextCOROUTINE$() {
417
+ if ($hasNextCOROUTINE$Class === VOID) {
418
+ let $ = function(_this__u8e3s4, resultContinuation) {
144
419
  CoroutineImpl().call(this, resultContinuation);
145
420
  this._this__u8e3s4__1 = _this__u8e3s4;
146
- this.channel_1 = channel;
147
- this.consume_1 = consume;
148
421
  };
149
422
  initMetadataForCoroutine($, CoroutineImpl());
150
423
  protoOf($).doResume_5yljmg_k$ = function() {
@@ -154,154 +427,137 @@ function $emitAllImplCOROUTINE$() {
154
427
  var tmp = this.state_1;
155
428
  switch (tmp) {
156
429
  case 0:
157
- this.exceptionState_1 = 9;
158
- ensureActive(this._this__u8e3s4__1);
159
- this.cause0__1 = null;
160
- this.state_1 = 1;
161
- continue $sm;
430
+ this.exceptionState_1 = 8;
431
+ if (!(this._this__u8e3s4__1.receiveResult_1 === get_NO_RECEIVE_RESULT()) && !(this._this__u8e3s4__1.receiveResult_1 === get_CHANNEL_CLOSED())) {
432
+ var tmp_0 = this;
433
+ tmp_0.WHEN_RESULT0__1 = true;
434
+ this.state_1 = 11;
435
+ continue $sm;
436
+ } else {
437
+ this.tmp010__1 = this._this__u8e3s4__1.$this_1;
438
+ this.tmp29__1 = null;
439
+ this.state_1 = 1;
440
+ continue $sm;
441
+ }
162
442
  case 1:
163
- this.exceptionState_1 = 7;
164
- this.exceptionState_1 = 6;
165
- this._iterator_1_yqohr1__1 = this.channel_1.iterator_jk1svi_k$();
443
+ this.this6__1 = this.tmp010__1;
444
+ this.waiter7__1 = this.tmp29__1;
445
+ this.segment3__1 = this.this6__1.receiveSegment_1.kotlinx$atomicfu$value;
166
446
  this.state_1 = 2;
167
447
  continue $sm;
168
448
  case 2:
169
- this.state_1 = 3;
170
- suspendResult = this._iterator_1_yqohr1__1.hasNext_nhy1w3_k$(this);
171
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
172
- return suspendResult;
449
+ if (false) {
450
+ this.state_1 = 9;
451
+ continue $sm;
452
+ }
453
+ if (this.this6__1.get_isClosedForReceive_v0r77d_k$()) {
454
+ var tmp_1 = this;
455
+ tmp_1.tmp$ret$01__1 = onClosedHasNext(this._this__u8e3s4__1);
456
+ this.state_1 = 10;
457
+ continue $sm;
458
+ } else {
459
+ this.state_1 = 3;
460
+ continue $sm;
173
461
  }
174
- continue $sm;
175
462
  case 3:
176
- if (!suspendResult) {
463
+ this.r4__1 = this.this6__1.receivers_1.atomicfu$getAndIncrement$long();
464
+ var tmp0 = this.r4__1;
465
+ var other = get_SEGMENT_SIZE();
466
+ var id = divide(tmp0, fromInt(other));
467
+ var tmp_2 = this;
468
+ var tmp0_0 = this.r4__1;
469
+ var other_0 = get_SEGMENT_SIZE();
470
+ tmp_2.i5__1 = convertToInt(modulo(tmp0_0, fromInt(other_0)));
471
+ if (!(this.segment3__1.id_1 === id)) {
472
+ var tmp0_elvis_lhs = findSegmentReceive(this.this6__1, id, this.segment3__1);
473
+ if (tmp0_elvis_lhs == null) {
474
+ this.state_1 = 2;
475
+ var tmp_3 = this;
476
+ continue $sm;
477
+ } else {
478
+ this.WHEN_RESULT8__1 = tmp0_elvis_lhs;
479
+ this.state_1 = 4;
480
+ continue $sm;
481
+ }
482
+ } else {
177
483
  this.state_1 = 5;
178
484
  continue $sm;
179
485
  }
180
- var element = this._iterator_1_yqohr1__1.next_20eer_k$();
181
- this.state_1 = 4;
182
- suspendResult = this._this__u8e3s4__1.emit_t92u1f_k$(element, this);
183
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
184
- return suspendResult;
185
- }
186
- continue $sm;
187
486
  case 4:
188
- this.state_1 = 2;
487
+ this.segment3__1 = this.WHEN_RESULT8__1;
488
+ this.state_1 = 5;
189
489
  continue $sm;
190
490
  case 5:
191
- this.exceptionState_1 = 9;
192
- this.state_1 = 8;
193
- continue $sm;
194
- case 6:
195
- this.exceptionState_1 = 7;
196
- var tmp_0 = this.exception_1;
197
- if (tmp_0 instanceof Error) {
198
- var e = this.exception_1;
199
- this.cause0__1 = e;
200
- throw e;
491
+ var updCellResult = updateCellReceive(this.this6__1, this.segment3__1, this.i5__1, this.r4__1, this.waiter7__1);
492
+ if (updCellResult === get_SUSPEND()) {
493
+ var tmp_4 = this;
494
+ var tmp_5 = this.waiter7__1;
495
+ var tmp1_safe_receiver = (!(tmp_5 == null) ? isInterface(tmp_5, Waiter()) : false) ? tmp_5 : null;
496
+ if (tmp1_safe_receiver == null)
497
+ null;
498
+ else {
499
+ prepareReceiverForSuspension(this.this6__1, tmp1_safe_receiver, this.segment3__1, this.i5__1);
500
+ }
501
+ this.segment3__1;
502
+ this.i5__1;
503
+ this.r4__1;
504
+ var message = "unreachable";
505
+ throw IllegalStateException_init_$Create$(toString(message));
201
506
  } else {
202
- throw this.exception_1;
507
+ if (updCellResult === get_FAILED()) {
508
+ if (this.r4__1 < this.this6__1.get_sendersCounter_mvbt0m_k$()) {
509
+ this.segment3__1.cleanPrev_rn0kss_k$();
510
+ }
511
+ this.state_1 = 2;
512
+ var tmp_6 = this;
513
+ continue $sm;
514
+ } else {
515
+ if (updCellResult === get_SUSPEND_NO_WAITER()) {
516
+ var tmp0_1 = this.segment3__1;
517
+ var tmp2 = this.i5__1;
518
+ var r = this.r4__1;
519
+ this.state_1 = 6;
520
+ suspendResult = hasNextOnNoWaiterSuspend(this._this__u8e3s4__1, tmp0_1, tmp2, r, this);
521
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
522
+ return suspendResult;
523
+ }
524
+ continue $sm;
525
+ } else {
526
+ var tmp_7 = this;
527
+ this.segment3__1.cleanPrev_rn0kss_k$();
528
+ this._this__u8e3s4__1.receiveResult_1 = updCellResult;
529
+ tmp_7.WHEN_RESULT2__1 = true;
530
+ this.state_1 = 7;
531
+ continue $sm;
532
+ }
533
+ }
203
534
  }
535
+ case 6:
536
+ var tmp_8 = this;
537
+ return suspendResult;
204
538
  case 7:
205
- this.exceptionState_1 = 9;
206
- var t = this.exception_1;
207
- if (this.consume_1) {
208
- cancelConsumed(this.channel_1, this.cause0__1);
209
- }
210
- throw t;
539
+ this.tmp$ret$01__1 = this.WHEN_RESULT2__1;
540
+ this.state_1 = 10;
541
+ continue $sm;
211
542
  case 8:
212
- this.exceptionState_1 = 9;
213
- if (this.consume_1) {
214
- cancelConsumed(this.channel_1, this.cause0__1);
215
- }
216
- return Unit_instance;
217
- case 9:
218
543
  throw this.exception_1;
219
- }
220
- } catch ($p) {
221
- var e_0 = $p;
222
- if (this.exceptionState_1 === 9) {
223
- throw e_0;
224
- } else {
225
- this.state_1 = this.exceptionState_1;
226
- this.exception_1 = e_0;
227
- }
228
- }
229
- while (true);
230
- };
231
- $emitAllImplCOROUTINE$Class = $;
232
- }
233
- return $emitAllImplCOROUTINE$Class;
234
- }
235
-
236
- // build/packages/js/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/ChannelFlow.mjs
237
- import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
238
- import { Unit_instance3kz1zqli6gr1r as Unit_instance2 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
239
- import {
240
- protoOf180f3jzyo7rfj as protoOf2,
241
- toString1pkumu07cwy4m as toString2
242
- } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
243
- import { THROW_CCE2g6jy02ryeudk as THROW_CCE } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
244
- import {
245
- ProducerScopeb3mmhvfa6ll7 as ProducerScope,
246
- produce3s4oh9balbl5b as produce
247
- } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/Produce.mjs";
248
- import { isInterface3d6p8outrmvmk as isInterface } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
249
- import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
250
- import {
251
- initMetadataForLambda3af3he42mmnh as initMetadataForLambda,
252
- initMetadataForClassbxx6q50dy2s7 as initMetadataForClass2
253
- } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
254
- import { VOID3gxj6tk5isa35 as VOID2 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
255
- import { constructCallableReference23y65rf941mch as constructCallableReference } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
256
- import {
257
- CoroutineScopefcb5f5dwqcas as CoroutineScope,
258
- coroutineScope2qhrb6lhutwsn as coroutineScope
259
- } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
260
- import { CoroutineStart_ATOMIC_getInstancehid42awkwncc as CoroutineStart_ATOMIC_getInstance } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineStart.mjs";
261
- import { ArrayList_init_$Create$a978fvbbts3d as ArrayList_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/collections/ArrayListJs.mjs";
262
- import { EmptyCoroutineContext_instance3dshdbvg42f79 as EmptyCoroutineContext_instance2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineContextImpl.mjs";
263
- import { BufferOverflow_SUSPEND_getInstance1ucmryz5dsuc2 as BufferOverflow_SUSPEND_getInstance2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferOverflow.mjs";
264
- import { get_classSimpleName2jgk6lzg9ft1 as get_classSimpleName } from "../kotlinx-coroutines-core/kotlinx/coroutines/Debug.mjs";
265
- import { joinToString1cxrrlmo0chqs as joinToString } from "../kotlin-kotlin-stdlib/kotlin/collections/_Collections.mjs";
266
- var ChannelFlow$_get_collectToFun_$slambda_j53z2eClass;
267
- function ChannelFlow$_get_collectToFun_$slambda_j53z2e() {
268
- if (ChannelFlow$_get_collectToFun_$slambda_j53z2eClass === VOID2) {
269
- let $ = function(this$0, resultContinuation) {
270
- this.this$0__1 = this$0;
271
- CoroutineImpl2().call(this, resultContinuation);
272
- };
273
- initMetadataForLambda($, CoroutineImpl2(), VOID2, [1]);
274
- protoOf2($).invoke_c55cnc_k$ = function(it, $completion) {
275
- var tmp = this.create_8tn3fw_k$(it, $completion);
276
- tmp.result_1 = Unit_instance2;
277
- tmp.exception_1 = null;
278
- return tmp.doResume_5yljmg_k$();
279
- };
280
- protoOf2($).invoke_qns8j1_k$ = function(p1, $completion) {
281
- return this.invoke_c55cnc_k$((!(p1 == null) ? isInterface(p1, ProducerScope()) : false) ? p1 : THROW_CCE(), $completion);
282
- };
283
- protoOf2($).doResume_5yljmg_k$ = function() {
284
- var suspendResult = this.result_1;
285
- $sm: do
286
- try {
287
- var tmp = this.state_1;
288
- switch (tmp) {
289
- case 0:
290
- this.exceptionState_1 = 2;
291
- this.state_1 = 1;
292
- suspendResult = this.this$0__1.collectTo_qjwlth_k$(this.it_1, this);
293
- if (suspendResult === get_COROUTINE_SUSPENDED2()) {
294
- return suspendResult;
544
+ case 9:
545
+ if (false) {
546
+ this.state_1 = 1;
547
+ continue $sm;
295
548
  }
549
+ this.state_1 = 10;
296
550
  continue $sm;
297
- case 1:
298
- return Unit_instance2;
299
- case 2:
300
- throw this.exception_1;
551
+ case 10:
552
+ this.WHEN_RESULT0__1 = this.tmp$ret$01__1;
553
+ this.state_1 = 11;
554
+ continue $sm;
555
+ case 11:
556
+ return this.WHEN_RESULT0__1;
301
557
  }
302
558
  } catch ($p) {
303
559
  var e = $p;
304
- if (this.exceptionState_1 === 2) {
560
+ if (this.exceptionState_1 === 8) {
305
561
  throw e;
306
562
  } else {
307
563
  this.state_1 = this.exceptionState_1;
@@ -310,133 +566,3012 @@ function ChannelFlow$_get_collectToFun_$slambda_j53z2e() {
310
566
  }
311
567
  while (true);
312
568
  };
313
- protoOf2($).create_8tn3fw_k$ = function(it, completion) {
314
- var i = new (ChannelFlow$_get_collectToFun_$slambda_j53z2e())(this.this$0__1, completion);
315
- i.it_1 = it;
316
- return i;
317
- };
318
- ChannelFlow$_get_collectToFun_$slambda_j53z2eClass = $;
319
- }
320
- return ChannelFlow$_get_collectToFun_$slambda_j53z2eClass;
321
- }
322
- function ChannelFlow$_get_collectToFun_$slambda_j53z2e_0(this$0, resultContinuation) {
323
- var i = new (ChannelFlow$_get_collectToFun_$slambda_j53z2e())(this$0, resultContinuation);
324
- return constructCallableReference(function(it, $completion) {
325
- return i.invoke_c55cnc_k$(it, $completion);
326
- }, 1);
327
- }
328
- var ChannelFlow$collect$slambdaClass;
329
- function ChannelFlow$collect$slambda() {
330
- if (ChannelFlow$collect$slambdaClass === VOID2) {
331
- let $ = function($collector, this$0, resultContinuation) {
332
- this.$collector_1 = $collector;
333
- this.this$0__1 = this$0;
334
- CoroutineImpl2().call(this, resultContinuation);
335
- };
336
- initMetadataForLambda($, CoroutineImpl2(), VOID2, [1]);
337
- protoOf2($).invoke_d9fzmj_k$ = function($this$coroutineScope, $completion) {
338
- var tmp = this.create_rcuf4x_k$($this$coroutineScope, $completion);
339
- tmp.result_1 = Unit_instance2;
340
- tmp.exception_1 = null;
341
- return tmp.doResume_5yljmg_k$();
342
- };
343
- protoOf2($).invoke_qns8j1_k$ = function(p1, $completion) {
344
- return this.invoke_d9fzmj_k$((!(p1 == null) ? isInterface(p1, CoroutineScope()) : false) ? p1 : THROW_CCE(), $completion);
345
- };
346
- protoOf2($).doResume_5yljmg_k$ = function() {
347
- var suspendResult = this.result_1;
348
- $sm: do
349
- try {
350
- var tmp = this.state_1;
351
- switch (tmp) {
352
- case 0:
353
- this.exceptionState_1 = 2;
354
- this.state_1 = 1;
355
- suspendResult = emitAll(this.$collector_1, this.this$0__1.produceImpl_qjsv5i_k$(this.$this$coroutineScope_1), this);
356
- if (suspendResult === get_COROUTINE_SUSPENDED2()) {
357
- return suspendResult;
569
+ $hasNextCOROUTINE$Class = $;
570
+ }
571
+ return $hasNextCOROUTINE$Class;
572
+ }
573
+ function _get_bufferEndCounter__2d4hee($this) {
574
+ return $this.bufferEnd_1.kotlinx$atomicfu$value;
575
+ }
576
+ function _get_isRendezvousOrUnlimited__3mdufi($this) {
577
+ var it = _get_bufferEndCounter__2d4hee($this);
578
+ return it === 0n || it === 9223372036854775807n;
579
+ }
580
+ function onClosedSend($this, element, $completion) {
581
+ var cancellable = new (CancellableContinuationImpl())(intercepted($completion), 1);
582
+ cancellable.initCancellability_shqc60_k$();
583
+ $l$block: {
584
+ var tmp0_safe_receiver = $this.onUndeliveredElement_1;
585
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : callUndeliveredElementCatchingException(tmp0_safe_receiver, element);
586
+ if (tmp1_safe_receiver == null)
587
+ null;
588
+ else {
589
+ addSuppressed(tmp1_safe_receiver, $this.get_sendException_qpq1ry_k$());
590
+ var exception = recoverStackTrace_0(tmp1_safe_receiver, cancellable);
591
+ var tmp$ret$5 = _Result___init__impl__xyqfz8(createFailure(exception));
592
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$5);
593
+ break $l$block;
594
+ }
595
+ var exception_0 = $this.get_sendException_qpq1ry_k$();
596
+ var exception_1 = recoverStackTrace_0(exception_0, cancellable);
597
+ var tmp$ret$7 = _Result___init__impl__xyqfz8(createFailure(exception_1));
598
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$7);
599
+ }
600
+ return cancellable.getResult_fck196_k$();
601
+ }
602
+ function sendOnNoWaiterSuspend($this, segment, index, element, s, $completion) {
603
+ var cancellable = getOrCreateCancellableContinuation(intercepted($completion));
604
+ try {
605
+ switch (updateCellSend($this, segment, index, element, s, cancellable, false)) {
606
+ case 0:
607
+ segment.cleanPrev_rn0kss_k$();
608
+ var tmp$ret$5 = _Result___init__impl__xyqfz8(Unit_instance);
609
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$5);
610
+ break;
611
+ case 1:
612
+ var tmp$ret$8 = _Result___init__impl__xyqfz8(Unit_instance);
613
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$8);
614
+ break;
615
+ case 2:
616
+ prepareSenderForSuspension($this, cancellable, segment, index);
617
+ break;
618
+ case 4:
619
+ if (s < $this.get_receiversCounter_ne8ics_k$()) {
620
+ segment.cleanPrev_rn0kss_k$();
621
+ }
622
+ onClosedSendOnNoWaiterSuspend($this, element, cancellable);
623
+ break;
624
+ case 5:
625
+ segment.cleanPrev_rn0kss_k$();
626
+ $l$block_5: {
627
+ var segment_0 = access$_get_sendSegment__111kgq($this).kotlinx$atomicfu$value;
628
+ $l$loop_0: while (true) {
629
+ var sendersAndCloseStatusCur = access$_get_sendersAndCloseStatus__tvw29s($this).atomicfu$getAndIncrement$long();
630
+ var s_0 = sendersAndCloseStatusCur & 1152921504606846975n;
631
+ var closed = access$_get_isClosedForSend0__sm8f7a($this, sendersAndCloseStatusCur);
632
+ var other = get_SEGMENT_SIZE();
633
+ var id = divide(s_0, fromInt(other));
634
+ var other_0 = get_SEGMENT_SIZE();
635
+ var tmp$ret$13 = modulo(s_0, fromInt(other_0));
636
+ var i = convertToInt(tmp$ret$13);
637
+ if (!(segment_0.id_1 === id)) {
638
+ var tmp0_elvis_lhs = access$findSegmentSend($this, id, segment_0);
639
+ var tmp;
640
+ if (tmp0_elvis_lhs == null) {
641
+ var tmp_0;
642
+ if (closed) {
643
+ onClosedSendOnNoWaiterSuspend($this, element, cancellable);
644
+ break $l$block_5;
645
+ } else {
646
+ continue $l$loop_0;
647
+ }
648
+ } else {
649
+ tmp = tmp0_elvis_lhs;
358
650
  }
359
- continue $sm;
360
- case 1:
361
- return Unit_instance2;
362
- case 2:
363
- throw this.exception_1;
364
- }
365
- } catch ($p) {
366
- var e = $p;
367
- if (this.exceptionState_1 === 2) {
368
- throw e;
369
- } else {
370
- this.state_1 = this.exceptionState_1;
371
- this.exception_1 = e;
651
+ segment_0 = tmp;
652
+ }
653
+ switch (access$updateCellSend($this, segment_0, i, element, s_0, cancellable, closed)) {
654
+ case 0:
655
+ segment_0.cleanPrev_rn0kss_k$();
656
+ var tmp$ret$17 = _Result___init__impl__xyqfz8(Unit_instance);
657
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$17);
658
+ break $l$block_5;
659
+ case 1:
660
+ var tmp$ret$20 = _Result___init__impl__xyqfz8(Unit_instance);
661
+ cancellable.resumeWith_rk9gbt_k$(tmp$ret$20);
662
+ break $l$block_5;
663
+ case 2:
664
+ if (closed) {
665
+ segment_0.onSlotCleaned_do6lqz_k$();
666
+ onClosedSendOnNoWaiterSuspend($this, element, cancellable);
667
+ break $l$block_5;
668
+ }
669
+ var tmp2_safe_receiver = (!(cancellable == null) ? isInterface(cancellable, Waiter()) : false) ? cancellable : null;
670
+ if (tmp2_safe_receiver == null)
671
+ null;
672
+ else {
673
+ access$prepareSenderForSuspension($this, tmp2_safe_receiver, segment_0, i);
674
+ }
675
+ break $l$block_5;
676
+ case 4:
677
+ if (s_0 < $this.get_receiversCounter_ne8ics_k$()) {
678
+ segment_0.cleanPrev_rn0kss_k$();
679
+ }
680
+ onClosedSendOnNoWaiterSuspend($this, element, cancellable);
681
+ break $l$block_5;
682
+ case 5:
683
+ segment_0.cleanPrev_rn0kss_k$();
684
+ continue $l$loop_0;
685
+ case 3:
686
+ var message = "unexpected";
687
+ throw IllegalStateException_init_$Create$(toString(message));
688
+ }
372
689
  }
373
690
  }
374
- while (true);
375
- };
376
- protoOf2($).create_rcuf4x_k$ = function($this$coroutineScope, completion) {
377
- var i = new (ChannelFlow$collect$slambda())(this.$collector_1, this.this$0__1, completion);
378
- i.$this$coroutineScope_1 = $this$coroutineScope;
379
- return i;
380
- };
381
- ChannelFlow$collect$slambdaClass = $;
691
+ break;
692
+ default:
693
+ var message_0 = "unexpected";
694
+ throw IllegalStateException_init_$Create$(toString(message_0));
695
+ }
696
+ } catch ($p) {
697
+ if ($p instanceof Error) {
698
+ var e = $p;
699
+ cancellable.releaseClaimedReusableContinuation_mdg0s9_k$();
700
+ throw e;
701
+ } else {
702
+ throw $p;
703
+ }
382
704
  }
383
- return ChannelFlow$collect$slambdaClass;
705
+ return cancellable.getResult_fck196_k$();
384
706
  }
385
- function ChannelFlow$collect$slambda_0($collector, this$0, resultContinuation) {
386
- var i = new (ChannelFlow$collect$slambda())($collector, this$0, resultContinuation);
387
- return constructCallableReference(function($this$coroutineScope, $completion) {
388
- return i.invoke_d9fzmj_k$($this$coroutineScope, $completion);
389
- }, 1);
707
+ function prepareSenderForSuspension($this, $receiver, segment, index) {
708
+ $receiver.invokeOnCancellation_effrxe_k$(segment, index + get_SEGMENT_SIZE() | 0);
390
709
  }
391
- var ChannelFlowClass;
392
- function ChannelFlow() {
393
- if (ChannelFlowClass === VOID2) {
394
- let $ = function(context, capacity, onBufferOverflow) {
395
- this.context_1 = context;
396
- this.capacity_1 = capacity;
397
- this.onBufferOverflow_1 = onBufferOverflow;
398
- };
399
- initMetadataForClass2($, "ChannelFlow", VOID2, VOID2, VOID2, [1]);
400
- protoOf2($).get_collectToFun_6oxkuu_k$ = function() {
401
- return ChannelFlow$_get_collectToFun_$slambda_j53z2e_0(this, null);
402
- };
403
- protoOf2($).get_produceCapacity_futzxg_k$ = function() {
404
- return this.capacity_1 === -3 ? -2 : this.capacity_1;
405
- };
406
- protoOf2($).produceImpl_qjsv5i_k$ = function(scope) {
407
- return produce(scope, this.context_1, this.get_produceCapacity_futzxg_k$(), this.onBufferOverflow_1, CoroutineStart_ATOMIC_getInstance(), VOID2, this.get_collectToFun_6oxkuu_k$());
408
- };
409
- protoOf2($).collect_aksokr_k$ = function(collector, $completion) {
410
- return coroutineScope(ChannelFlow$collect$slambda_0(collector, this, null), $completion);
411
- };
412
- protoOf2($).additionalToStringProps_j3cp6l_k$ = function() {
413
- return null;
710
+ function onClosedSendOnNoWaiterSuspend($this, element, cont) {
711
+ var tmp0_safe_receiver = $this.onUndeliveredElement_1;
712
+ if (tmp0_safe_receiver == null)
713
+ null;
714
+ else {
715
+ callUndeliveredElement(tmp0_safe_receiver, element, cont.get_context_h02k06_k$());
716
+ }
717
+ var exception = recoverStackTrace_0($this.get_sendException_qpq1ry_k$(), cont);
718
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(createFailure(exception));
719
+ cont.resumeWith_rk9gbt_k$(tmp$ret$1);
720
+ }
721
+ var SendBroadcastClass;
722
+ function SendBroadcast() {
723
+ if (SendBroadcastClass === VOID) {
724
+ let $ = function() {
414
725
  };
415
- protoOf2($).toString = function() {
416
- var props = ArrayList_init_$Create$(4);
417
- var tmp0_safe_receiver = this.additionalToStringProps_j3cp6l_k$();
418
- if (tmp0_safe_receiver == null)
419
- null;
420
- else {
421
- props.add_utx5q5_k$(tmp0_safe_receiver);
726
+ initMetadataForClass($, "SendBroadcast", VOID, VOID, [Waiter()]);
727
+ SendBroadcastClass = $;
728
+ }
729
+ return SendBroadcastClass;
730
+ }
731
+ function updateCellSend($this, segment, index, element, s, waiter, closed) {
732
+ segment.storeElement_gce1i0_k$(index, element);
733
+ if (closed)
734
+ return updateCellSendSlow($this, segment, index, element, s, waiter, closed);
735
+ var state = segment.getState_jak5mi_k$(index);
736
+ if (state === null) {
737
+ if (bufferOrRendezvousSend($this, s)) {
738
+ if (segment.casState_u37dcn_k$(index, null, get_BUFFERED())) {
739
+ return 1;
740
+ }
741
+ } else {
742
+ if (waiter == null) {
743
+ return 3;
744
+ } else {
745
+ if (segment.casState_u37dcn_k$(index, null, waiter))
746
+ return 2;
747
+ }
748
+ }
749
+ } else {
750
+ if (isInterface(state, Waiter())) {
751
+ segment.cleanElement_ob56q6_k$(index);
752
+ var tmp;
753
+ if (tryResumeReceiver($this, state, element)) {
754
+ segment.setState_bwy33f_k$(index, get_DONE_RCV());
755
+ $this.onReceiveDequeued_4w5qpk_k$();
756
+ tmp = 0;
757
+ } else {
758
+ if (!(segment.getAndSetState_5asfss_k$(index, get_INTERRUPTED_RCV()) === get_INTERRUPTED_RCV())) {
759
+ segment.onCancelledRequest_bhmu12_k$(index, true);
760
+ }
761
+ tmp = 5;
762
+ }
763
+ return tmp;
764
+ }
765
+ }
766
+ return updateCellSendSlow($this, segment, index, element, s, waiter, closed);
767
+ }
768
+ function updateCellSendSlow($this, segment, index, element, s, waiter, closed) {
769
+ while (true) {
770
+ var state = segment.getState_jak5mi_k$(index);
771
+ if (state === null) {
772
+ if (bufferOrRendezvousSend($this, s) && !closed) {
773
+ if (segment.casState_u37dcn_k$(index, null, get_BUFFERED())) {
774
+ return 1;
775
+ }
776
+ } else {
777
+ if (closed) {
778
+ if (segment.casState_u37dcn_k$(index, null, get_INTERRUPTED_SEND())) {
779
+ segment.onCancelledRequest_bhmu12_k$(index, false);
780
+ return 4;
781
+ }
782
+ } else if (waiter == null)
783
+ return 3;
784
+ else if (segment.casState_u37dcn_k$(index, null, waiter))
785
+ return 2;
422
786
  }
423
- if (!(this.context_1 === EmptyCoroutineContext_instance2)) {
424
- props.add_utx5q5_k$("context=" + toString2(this.context_1));
787
+ } else if (state === get_IN_BUFFER()) {
788
+ if (segment.casState_u37dcn_k$(index, state, get_BUFFERED())) {
789
+ return 1;
425
790
  }
426
- if (!(this.capacity_1 === -3)) {
427
- props.add_utx5q5_k$("capacity=" + this.capacity_1);
791
+ } else if (state === get_INTERRUPTED_RCV()) {
792
+ segment.cleanElement_ob56q6_k$(index);
793
+ return 5;
794
+ } else if (state === get_POISONED()) {
795
+ segment.cleanElement_ob56q6_k$(index);
796
+ return 5;
797
+ } else if (state === get_CHANNEL_CLOSED()) {
798
+ segment.cleanElement_ob56q6_k$(index);
799
+ completeCloseOrCancel($this);
800
+ return 4;
801
+ } else {
802
+ segment.cleanElement_ob56q6_k$(index);
803
+ var tmp;
804
+ if (state instanceof WaiterEB()) {
805
+ tmp = state.waiter_1;
806
+ } else {
807
+ tmp = state;
428
808
  }
429
- if (!this.onBufferOverflow_1.equals(BufferOverflow_SUSPEND_getInstance2())) {
430
- props.add_utx5q5_k$("onBufferOverflow=" + this.onBufferOverflow_1.toString());
809
+ var receiver = tmp;
810
+ var tmp_0;
811
+ if (tryResumeReceiver($this, receiver, element)) {
812
+ segment.setState_bwy33f_k$(index, get_DONE_RCV());
813
+ $this.onReceiveDequeued_4w5qpk_k$();
814
+ tmp_0 = 0;
815
+ } else {
816
+ if (!(segment.getAndSetState_5asfss_k$(index, get_INTERRUPTED_RCV()) === get_INTERRUPTED_RCV())) {
817
+ segment.onCancelledRequest_bhmu12_k$(index, true);
818
+ }
819
+ tmp_0 = 5;
431
820
  }
432
- return get_classSimpleName(this) + "[" + joinToString(props, ", ") + "]";
821
+ return tmp_0;
822
+ }
823
+ }
824
+ }
825
+ function shouldSendSuspend0($this, curSendersAndCloseStatus) {
826
+ if (_get_isClosedForSend0__kxgf9m($this, curSendersAndCloseStatus))
827
+ return false;
828
+ var tmp$ret$0 = curSendersAndCloseStatus & 1152921504606846975n;
829
+ return !bufferOrRendezvousSend($this, tmp$ret$0);
830
+ }
831
+ function bufferOrRendezvousSend($this, curSenders) {
832
+ var tmp;
833
+ if (curSenders < _get_bufferEndCounter__2d4hee($this)) {
834
+ tmp = true;
835
+ } else {
836
+ var tmp0 = $this.get_receiversCounter_ne8ics_k$();
837
+ var other = $this.capacity_1;
838
+ tmp = curSenders < add(tmp0, fromInt(other));
839
+ }
840
+ return tmp;
841
+ }
842
+ function tryResumeReceiver($this, $receiver, element) {
843
+ var tmp;
844
+ if (isInterface($receiver, SelectInstance())) {
845
+ tmp = $receiver.trySelect_fbege0_k$($this, element);
846
+ } else {
847
+ if ($receiver instanceof ReceiveCatching()) {
848
+ if (!($receiver instanceof ReceiveCatching()))
849
+ THROW_CCE();
850
+ var tmp_0 = Companion_getInstance().success_tizbw6_k$(element);
851
+ var tmp1_safe_receiver = $this.onUndeliveredElement_1;
852
+ tmp = tryResume0($receiver.cont_1, new (ChannelResult())(tmp_0), tmp1_safe_receiver == null ? null : bindCancellationFunResult($this, tmp1_safe_receiver));
853
+ } else {
854
+ if ($receiver instanceof BufferedChannelIterator()) {
855
+ if (!($receiver instanceof BufferedChannelIterator()))
856
+ THROW_CCE();
857
+ tmp = $receiver.tryResumeHasNext_yugi5j_k$(element);
858
+ } else {
859
+ if (isInterface($receiver, CancellableContinuation())) {
860
+ if (!isInterface($receiver, CancellableContinuation()))
861
+ THROW_CCE();
862
+ var tmp2_safe_receiver = $this.onUndeliveredElement_1;
863
+ tmp = tryResume0($receiver, element, tmp2_safe_receiver == null ? null : bindCancellationFun_0($this, tmp2_safe_receiver));
864
+ } else {
865
+ var message = "Unexpected receiver type: " + toString($receiver);
866
+ throw IllegalStateException_init_$Create$(toString(message));
867
+ }
868
+ }
869
+ }
870
+ }
871
+ return tmp;
872
+ }
873
+ function receiveOnNoWaiterSuspend($this, segment, index, r, $completion) {
874
+ var cancellable = getOrCreateCancellableContinuation(intercepted($completion));
875
+ try {
876
+ var updCellResult = updateCellReceive($this, segment, index, r, cancellable);
877
+ if (updCellResult === get_SUSPEND()) {
878
+ prepareReceiverForSuspension($this, cancellable, segment, index);
879
+ } else if (updCellResult === get_FAILED()) {
880
+ if (r < $this.get_sendersCounter_mvbt0m_k$()) {
881
+ segment.cleanPrev_rn0kss_k$();
882
+ }
883
+ $l$block_0: {
884
+ var segment_0 = $this.receiveSegment_1.kotlinx$atomicfu$value;
885
+ $l$loop_0: while (true) {
886
+ if ($this.get_isClosedForReceive_v0r77d_k$()) {
887
+ onClosedReceiveOnNoWaiterSuspend($this, cancellable);
888
+ break $l$block_0;
889
+ }
890
+ var r_0 = $this.receivers_1.atomicfu$getAndIncrement$long();
891
+ var other = get_SEGMENT_SIZE();
892
+ var id = divide(r_0, fromInt(other));
893
+ var other_0 = get_SEGMENT_SIZE();
894
+ var tmp$ret$6 = modulo(r_0, fromInt(other_0));
895
+ var i = convertToInt(tmp$ret$6);
896
+ if (!(segment_0.id_1 === id)) {
897
+ var tmp0_elvis_lhs = findSegmentReceive($this, id, segment_0);
898
+ var tmp;
899
+ if (tmp0_elvis_lhs == null) {
900
+ continue $l$loop_0;
901
+ } else {
902
+ tmp = tmp0_elvis_lhs;
903
+ }
904
+ segment_0 = tmp;
905
+ }
906
+ var updCellResult_0 = updateCellReceive($this, segment_0, i, r_0, cancellable);
907
+ if (updCellResult_0 === get_SUSPEND()) {
908
+ var tmp1_safe_receiver = (!(cancellable == null) ? isInterface(cancellable, Waiter()) : false) ? cancellable : null;
909
+ if (tmp1_safe_receiver == null)
910
+ null;
911
+ else {
912
+ prepareReceiverForSuspension($this, tmp1_safe_receiver, segment_0, i);
913
+ }
914
+ } else if (updCellResult_0 === get_FAILED()) {
915
+ if (r_0 < $this.get_sendersCounter_mvbt0m_k$()) {
916
+ segment_0.cleanPrev_rn0kss_k$();
917
+ }
918
+ continue $l$loop_0;
919
+ } else if (updCellResult_0 === get_SUSPEND_NO_WAITER()) {
920
+ var message = "unexpected";
921
+ throw IllegalStateException_init_$Create$(toString(message));
922
+ } else {
923
+ segment_0.cleanPrev_rn0kss_k$();
924
+ var tmp0_safe_receiver = $this.onUndeliveredElement_1;
925
+ var onCancellation = tmp0_safe_receiver == null ? null : bindCancellationFun_0($this, tmp0_safe_receiver);
926
+ cancellable.resume_nf5g9e_k$(updCellResult_0, onCancellation);
927
+ }
928
+ break $l$block_0;
929
+ }
930
+ }
931
+ } else {
932
+ segment.cleanPrev_rn0kss_k$();
933
+ var tmp0_safe_receiver_0 = $this.onUndeliveredElement_1;
934
+ var onCancellation_0 = tmp0_safe_receiver_0 == null ? null : bindCancellationFun_0($this, tmp0_safe_receiver_0);
935
+ cancellable.resume_nf5g9e_k$(updCellResult, onCancellation_0);
936
+ }
937
+ } catch ($p) {
938
+ if ($p instanceof Error) {
939
+ var e = $p;
940
+ cancellable.releaseClaimedReusableContinuation_mdg0s9_k$();
941
+ throw e;
942
+ } else {
943
+ throw $p;
944
+ }
945
+ }
946
+ return cancellable.getResult_fck196_k$();
947
+ }
948
+ function prepareReceiverForSuspension($this, $receiver, segment, index) {
949
+ $this.onReceiveEnqueued_xthhlc_k$();
950
+ $receiver.invokeOnCancellation_effrxe_k$(segment, index);
951
+ }
952
+ function onClosedReceiveOnNoWaiterSuspend($this, cont) {
953
+ var exception = _get_receiveException__foorc1($this);
954
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(createFailure(exception));
955
+ cont.resumeWith_rk9gbt_k$(tmp$ret$1);
956
+ }
957
+ function updateCellReceive($this, segment, index, r, waiter) {
958
+ var state = segment.getState_jak5mi_k$(index);
959
+ if (state === null) {
960
+ var senders = $this.sendersAndCloseStatus_1.kotlinx$atomicfu$value & 1152921504606846975n;
961
+ if (r >= senders) {
962
+ if (waiter === null) {
963
+ return get_SUSPEND_NO_WAITER();
964
+ }
965
+ if (segment.casState_u37dcn_k$(index, state, waiter)) {
966
+ expandBuffer($this);
967
+ return get_SUSPEND();
968
+ }
969
+ }
970
+ } else if (state === get_BUFFERED()) {
971
+ if (segment.casState_u37dcn_k$(index, state, get_DONE_RCV())) {
972
+ expandBuffer($this);
973
+ return segment.retrieveElement_j8ywl1_k$(index);
974
+ }
975
+ }
976
+ return updateCellReceiveSlow($this, segment, index, r, waiter);
977
+ }
978
+ function updateCellReceiveSlow($this, segment, index, r, waiter) {
979
+ $l$loop: while (true) {
980
+ var state = segment.getState_jak5mi_k$(index);
981
+ if (state === null || state === get_IN_BUFFER()) {
982
+ var senders = $this.sendersAndCloseStatus_1.kotlinx$atomicfu$value & 1152921504606846975n;
983
+ if (r < senders) {
984
+ if (segment.casState_u37dcn_k$(index, state, get_POISONED())) {
985
+ expandBuffer($this);
986
+ return get_FAILED();
987
+ }
988
+ } else {
989
+ if (waiter === null) {
990
+ return get_SUSPEND_NO_WAITER();
991
+ }
992
+ if (segment.casState_u37dcn_k$(index, state, waiter)) {
993
+ expandBuffer($this);
994
+ return get_SUSPEND();
995
+ }
996
+ }
997
+ } else if (state === get_BUFFERED()) {
998
+ if (segment.casState_u37dcn_k$(index, state, get_DONE_RCV())) {
999
+ expandBuffer($this);
1000
+ return segment.retrieveElement_j8ywl1_k$(index);
1001
+ }
1002
+ } else if (state === get_INTERRUPTED_SEND())
1003
+ return get_FAILED();
1004
+ else if (state === get_POISONED())
1005
+ return get_FAILED();
1006
+ else if (state === get_CHANNEL_CLOSED()) {
1007
+ expandBuffer($this);
1008
+ return get_FAILED();
1009
+ } else if (state === get_RESUMING_BY_EB())
1010
+ continue $l$loop;
1011
+ else {
1012
+ if (segment.casState_u37dcn_k$(index, state, get_RESUMING_BY_RCV())) {
1013
+ var helpExpandBuffer = state instanceof WaiterEB();
1014
+ var tmp;
1015
+ if (state instanceof WaiterEB()) {
1016
+ tmp = state.waiter_1;
1017
+ } else {
1018
+ tmp = state;
1019
+ }
1020
+ var sender = tmp;
1021
+ var tmp_0;
1022
+ if (tryResumeSender($this, sender, segment, index)) {
1023
+ segment.setState_bwy33f_k$(index, get_DONE_RCV());
1024
+ expandBuffer($this);
1025
+ tmp_0 = segment.retrieveElement_j8ywl1_k$(index);
1026
+ } else {
1027
+ segment.setState_bwy33f_k$(index, get_INTERRUPTED_SEND());
1028
+ segment.onCancelledRequest_bhmu12_k$(index, false);
1029
+ if (helpExpandBuffer) {
1030
+ expandBuffer($this);
1031
+ }
1032
+ tmp_0 = get_FAILED();
1033
+ }
1034
+ return tmp_0;
1035
+ }
1036
+ }
1037
+ }
1038
+ }
1039
+ function tryResumeSender($this, $receiver, segment, index) {
1040
+ var tmp;
1041
+ if (isInterface($receiver, CancellableContinuation())) {
1042
+ if (!isInterface($receiver, CancellableContinuation()))
1043
+ THROW_CCE();
1044
+ tmp = tryResume0($receiver, Unit_instance);
1045
+ } else {
1046
+ if (isInterface($receiver, SelectInstance())) {
1047
+ if (!($receiver instanceof SelectImplementation()))
1048
+ THROW_CCE();
1049
+ var trySelectResult = $receiver.trySelectDetailed_t8yc08_k$($this, Unit_instance);
1050
+ if (trySelectResult === TrySelectDetailedResult_REREGISTER_getInstance()) {
1051
+ segment.cleanElement_ob56q6_k$(index);
1052
+ }
1053
+ tmp = trySelectResult === TrySelectDetailedResult_SUCCESSFUL_getInstance();
1054
+ } else {
1055
+ if ($receiver instanceof SendBroadcast()) {
1056
+ tmp = tryResume0($receiver.cont_1, true);
1057
+ } else {
1058
+ var message = "Unexpected waiter: " + toString($receiver);
1059
+ throw IllegalStateException_init_$Create$(toString(message));
1060
+ }
1061
+ }
1062
+ }
1063
+ return tmp;
1064
+ }
1065
+ function expandBuffer($this) {
1066
+ if (_get_isRendezvousOrUnlimited__3mdufi($this))
1067
+ return Unit_instance;
1068
+ var segment = $this.bufferEndSegment_1.kotlinx$atomicfu$value;
1069
+ try_again: while (true) {
1070
+ var b = $this.bufferEnd_1.atomicfu$getAndIncrement$long();
1071
+ var other = get_SEGMENT_SIZE();
1072
+ var id = divide(b, fromInt(other));
1073
+ var s = $this.get_sendersCounter_mvbt0m_k$();
1074
+ if (s <= b) {
1075
+ if (segment.id_1 < id && !(segment.get_next_wor1vg_k$() == null)) {
1076
+ moveSegmentBufferEndToSpecifiedOrLast($this, id, segment);
1077
+ }
1078
+ incCompletedExpandBufferAttempts($this);
1079
+ return Unit_instance;
1080
+ }
1081
+ if (!(segment.id_1 === id)) {
1082
+ var tmp0_elvis_lhs = findSegmentBufferEnd($this, id, segment, b);
1083
+ var tmp;
1084
+ if (tmp0_elvis_lhs == null) {
1085
+ continue try_again;
1086
+ } else {
1087
+ tmp = tmp0_elvis_lhs;
1088
+ }
1089
+ segment = tmp;
1090
+ }
1091
+ var other_0 = get_SEGMENT_SIZE();
1092
+ var tmp$ret$1 = modulo(b, fromInt(other_0));
1093
+ var i = convertToInt(tmp$ret$1);
1094
+ if (updateCellExpandBuffer($this, segment, i, b)) {
1095
+ incCompletedExpandBufferAttempts($this);
1096
+ return Unit_instance;
1097
+ } else {
1098
+ incCompletedExpandBufferAttempts($this);
1099
+ continue try_again;
1100
+ }
1101
+ }
1102
+ }
1103
+ function updateCellExpandBuffer($this, segment, index, b) {
1104
+ var state = segment.getState_jak5mi_k$(index);
1105
+ if (!(state == null) ? isInterface(state, Waiter()) : false) {
1106
+ if (b >= $this.receivers_1.kotlinx$atomicfu$value) {
1107
+ if (segment.casState_u37dcn_k$(index, state, get_RESUMING_BY_EB())) {
1108
+ var tmp;
1109
+ if (tryResumeSender($this, state, segment, index)) {
1110
+ segment.setState_bwy33f_k$(index, get_BUFFERED());
1111
+ tmp = true;
1112
+ } else {
1113
+ segment.setState_bwy33f_k$(index, get_INTERRUPTED_SEND());
1114
+ segment.onCancelledRequest_bhmu12_k$(index, false);
1115
+ tmp = false;
1116
+ }
1117
+ return tmp;
1118
+ }
1119
+ }
1120
+ }
1121
+ return updateCellExpandBufferSlow($this, segment, index, b);
1122
+ }
1123
+ function updateCellExpandBufferSlow($this, segment, index, b) {
1124
+ $l$loop: while (true) {
1125
+ var state = segment.getState_jak5mi_k$(index);
1126
+ if (!(state == null) ? isInterface(state, Waiter()) : false) {
1127
+ if (b < $this.receivers_1.kotlinx$atomicfu$value) {
1128
+ if (segment.casState_u37dcn_k$(index, state, new (WaiterEB())(state)))
1129
+ return true;
1130
+ } else {
1131
+ if (segment.casState_u37dcn_k$(index, state, get_RESUMING_BY_EB())) {
1132
+ var tmp;
1133
+ if (tryResumeSender($this, state, segment, index)) {
1134
+ segment.setState_bwy33f_k$(index, get_BUFFERED());
1135
+ tmp = true;
1136
+ } else {
1137
+ segment.setState_bwy33f_k$(index, get_INTERRUPTED_SEND());
1138
+ segment.onCancelledRequest_bhmu12_k$(index, false);
1139
+ tmp = false;
1140
+ }
1141
+ return tmp;
1142
+ }
1143
+ }
1144
+ } else {
1145
+ if (state === get_INTERRUPTED_SEND())
1146
+ return false;
1147
+ else {
1148
+ if (state === null) {
1149
+ if (segment.casState_u37dcn_k$(index, state, get_IN_BUFFER()))
1150
+ return true;
1151
+ } else {
1152
+ if (state === get_BUFFERED())
1153
+ return true;
1154
+ else {
1155
+ if (state === get_POISONED() || state === get_DONE_RCV() || state === get_INTERRUPTED_RCV())
1156
+ return true;
1157
+ else {
1158
+ if (state === get_CHANNEL_CLOSED())
1159
+ return true;
1160
+ else {
1161
+ if (state === get_RESUMING_BY_RCV())
1162
+ continue $l$loop;
1163
+ else {
1164
+ var message = "Unexpected cell state: " + toString(state);
1165
+ throw IllegalStateException_init_$Create$(toString(message));
1166
+ }
1167
+ }
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ }
1175
+ function incCompletedExpandBufferAttempts($this, nAttempts) {
1176
+ nAttempts = nAttempts === VOID ? 1n : nAttempts;
1177
+ if (!(($this.completedExpandBuffersAndPauseFlag_1.atomicfu$addAndGet$long(nAttempts) & 4611686018427387904n) === 0n)) {
1178
+ $l$loop: while (true) {
1179
+ if (!!(($this.completedExpandBuffersAndPauseFlag_1.kotlinx$atomicfu$value & 4611686018427387904n) === 0n)) {
1180
+ break $l$loop;
1181
+ }
1182
+ }
1183
+ }
1184
+ }
1185
+ function registerSelectForReceive($this, select, ignoredParam) {
1186
+ var tmp$ret$0;
1187
+ $l$block_0: {
1188
+ var segment = $this.receiveSegment_1.kotlinx$atomicfu$value;
1189
+ $l$loop_0: while (true) {
1190
+ if ($this.get_isClosedForReceive_v0r77d_k$()) {
1191
+ onClosedSelectOnReceive($this, select);
1192
+ tmp$ret$0 = Unit_instance;
1193
+ break $l$block_0;
1194
+ }
1195
+ var r = $this.receivers_1.atomicfu$getAndIncrement$long();
1196
+ var other = get_SEGMENT_SIZE();
1197
+ var id = divide(r, fromInt(other));
1198
+ var other_0 = get_SEGMENT_SIZE();
1199
+ var tmp$ret$3 = modulo(r, fromInt(other_0));
1200
+ var i = convertToInt(tmp$ret$3);
1201
+ if (!(segment.id_1 === id)) {
1202
+ var tmp0_elvis_lhs = findSegmentReceive($this, id, segment);
1203
+ var tmp;
1204
+ if (tmp0_elvis_lhs == null) {
1205
+ continue $l$loop_0;
1206
+ } else {
1207
+ tmp = tmp0_elvis_lhs;
1208
+ }
1209
+ segment = tmp;
1210
+ }
1211
+ var updCellResult = updateCellReceive($this, segment, i, r, select);
1212
+ if (updCellResult === get_SUSPEND()) {
1213
+ var tmp1_safe_receiver = (!(select == null) ? isInterface(select, Waiter()) : false) ? select : null;
1214
+ if (tmp1_safe_receiver == null)
1215
+ null;
1216
+ else {
1217
+ prepareReceiverForSuspension($this, tmp1_safe_receiver, segment, i);
1218
+ }
1219
+ } else if (updCellResult === get_FAILED()) {
1220
+ if (r < $this.get_sendersCounter_mvbt0m_k$()) {
1221
+ segment.cleanPrev_rn0kss_k$();
1222
+ }
1223
+ continue $l$loop_0;
1224
+ } else if (updCellResult === get_SUSPEND_NO_WAITER()) {
1225
+ var message = "unexpected";
1226
+ throw IllegalStateException_init_$Create$(toString(message));
1227
+ } else {
1228
+ segment.cleanPrev_rn0kss_k$();
1229
+ select.selectInRegistrationPhase_ldg7ua_k$(updCellResult);
1230
+ }
1231
+ tmp$ret$0 = Unit_instance;
1232
+ break $l$block_0;
1233
+ }
1234
+ }
1235
+ return tmp$ret$0;
1236
+ }
1237
+ function onClosedSelectOnReceive($this, select) {
1238
+ select.selectInRegistrationPhase_ldg7ua_k$(get_CHANNEL_CLOSED());
1239
+ }
1240
+ function processResultSelectReceive($this, ignoredParam, selectResult) {
1241
+ var tmp;
1242
+ if (selectResult === get_CHANNEL_CLOSED()) {
1243
+ throw _get_receiveException__foorc1($this);
1244
+ } else {
1245
+ tmp = selectResult;
1246
+ }
1247
+ return tmp;
1248
+ }
1249
+ var BufferedChannelIteratorClass;
1250
+ function BufferedChannelIterator() {
1251
+ if (BufferedChannelIteratorClass === VOID) {
1252
+ let $ = function($outer) {
1253
+ this.$this_1 = $outer;
1254
+ this.receiveResult_1 = get_NO_RECEIVE_RESULT();
1255
+ this.continuation_1 = null;
1256
+ };
1257
+ initMetadataForClass($, "BufferedChannelIterator", VOID, VOID, [Waiter()], [0, 3]);
1258
+ protoOf($).hasNext_nhy1w3_k$ = function($completion) {
1259
+ var tmp = new ($hasNextCOROUTINE$())(this, $completion);
1260
+ tmp.result_1 = Unit_instance;
1261
+ tmp.exception_1 = null;
1262
+ return tmp.doResume_5yljmg_k$();
1263
+ };
1264
+ protoOf($).invokeOnCancellation_effrxe_k$ = function(segment, index) {
1265
+ var tmp0_safe_receiver = this.continuation_1;
1266
+ if (tmp0_safe_receiver == null)
1267
+ null;
1268
+ else {
1269
+ tmp0_safe_receiver.invokeOnCancellation_effrxe_k$(segment, index);
1270
+ }
1271
+ };
1272
+ protoOf($).next_20eer_k$ = function() {
1273
+ var result = this.receiveResult_1;
1274
+ if (!!(result === get_NO_RECEIVE_RESULT())) {
1275
+ var message = "`hasNext()` has not been invoked";
1276
+ throw IllegalStateException_init_$Create$(toString(message));
1277
+ }
1278
+ this.receiveResult_1 = get_NO_RECEIVE_RESULT();
1279
+ if (result === get_CHANNEL_CLOSED())
1280
+ throw recoverStackTrace(_get_receiveException__foorc1(this.$this_1));
1281
+ return result;
1282
+ };
1283
+ protoOf($).tryResumeHasNext_yugi5j_k$ = function(element) {
1284
+ var cont = ensureNotNull(this.continuation_1);
1285
+ this.continuation_1 = null;
1286
+ this.receiveResult_1 = element;
1287
+ var tmp0_safe_receiver = this.$this_1.onUndeliveredElement_1;
1288
+ return tryResume0(cont, true, tmp0_safe_receiver == null ? null : bindCancellationFun(this.$this_1, tmp0_safe_receiver, element));
1289
+ };
1290
+ protoOf($).tryResumeHasNextOnClosedChannel_mc581v_k$ = function() {
1291
+ var cont = ensureNotNull(this.continuation_1);
1292
+ this.continuation_1 = null;
1293
+ this.receiveResult_1 = get_CHANNEL_CLOSED();
1294
+ var cause = this.$this_1.get_closeCause_gbqkm2_k$();
1295
+ if (cause == null) {
1296
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(false);
1297
+ cont.resumeWith_rk9gbt_k$(tmp$ret$1);
1298
+ } else {
1299
+ var exception = recoverStackTrace_0(cause, cont);
1300
+ var tmp$ret$3 = _Result___init__impl__xyqfz8(createFailure(exception));
1301
+ cont.resumeWith_rk9gbt_k$(tmp$ret$3);
1302
+ }
1303
+ };
1304
+ BufferedChannelIteratorClass = $;
1305
+ }
1306
+ return BufferedChannelIteratorClass;
1307
+ }
1308
+ function _get_receiveException__foorc1($this) {
1309
+ var tmp0_elvis_lhs = $this.get_closeCause_gbqkm2_k$();
1310
+ return tmp0_elvis_lhs == null ? new (ClosedReceiveChannelException())("Channel was closed") : tmp0_elvis_lhs;
1311
+ }
1312
+ function invokeCloseHandler($this) {
1313
+ var tmp0 = $this.closeHandler_1;
1314
+ var tmp$ret$0;
1315
+ $l$block: {
1316
+ while (true) {
1317
+ var cur = tmp0.kotlinx$atomicfu$value;
1318
+ var tmp;
1319
+ if (cur === null) {
1320
+ tmp = get_CLOSE_HANDLER_CLOSED();
1321
+ } else {
1322
+ tmp = get_CLOSE_HANDLER_INVOKED();
1323
+ }
1324
+ var upd = tmp;
1325
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1326
+ tmp$ret$0 = cur;
1327
+ break $l$block;
1328
+ }
1329
+ }
1330
+ }
1331
+ var tmp0_elvis_lhs = tmp$ret$0;
1332
+ var tmp_0;
1333
+ if (tmp0_elvis_lhs == null) {
1334
+ return Unit_instance;
1335
+ } else {
1336
+ tmp_0 = tmp0_elvis_lhs;
1337
+ }
1338
+ var closeHandler = tmp_0;
1339
+ if (typeof closeHandler !== "function")
1340
+ THROW_CCE();
1341
+ closeHandler($this.get_closeCause_gbqkm2_k$());
1342
+ }
1343
+ function markClosed($this) {
1344
+ var tmp0 = $this.sendersAndCloseStatus_1;
1345
+ var tmp$ret$0;
1346
+ $l$block: {
1347
+ while (true) {
1348
+ var cur = tmp0.kotlinx$atomicfu$value;
1349
+ var tmp;
1350
+ switch (convertToInt(shiftRight(cur, 60))) {
1351
+ case 0:
1352
+ var tmp$ret$3 = cur & 1152921504606846975n;
1353
+ tmp = constructSendersAndCloseStatus(tmp$ret$3, 2);
1354
+ break;
1355
+ case 1:
1356
+ var tmp$ret$4 = cur & 1152921504606846975n;
1357
+ tmp = constructSendersAndCloseStatus(tmp$ret$4, 3);
1358
+ break;
1359
+ default:
1360
+ return Unit_instance;
1361
+ }
1362
+ var upd = tmp;
1363
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1364
+ tmp$ret$0 = Unit_instance;
1365
+ break $l$block;
1366
+ }
1367
+ }
1368
+ tmp$ret$0 = Unit_instance;
1369
+ }
1370
+ return tmp$ret$0;
1371
+ }
1372
+ function markCancelled($this) {
1373
+ var tmp0 = $this.sendersAndCloseStatus_1;
1374
+ var tmp$ret$0;
1375
+ $l$block: {
1376
+ while (true) {
1377
+ var cur = tmp0.kotlinx$atomicfu$value;
1378
+ var tmp$ret$2 = cur & 1152921504606846975n;
1379
+ var upd = constructSendersAndCloseStatus(tmp$ret$2, 3);
1380
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1381
+ tmp$ret$0 = Unit_instance;
1382
+ break $l$block;
1383
+ }
1384
+ }
1385
+ tmp$ret$0 = Unit_instance;
1386
+ }
1387
+ return tmp$ret$0;
1388
+ }
1389
+ function markCancellationStarted($this) {
1390
+ var tmp0 = $this.sendersAndCloseStatus_1;
1391
+ var tmp$ret$0;
1392
+ $l$block: {
1393
+ while (true) {
1394
+ var cur = tmp0.kotlinx$atomicfu$value;
1395
+ var tmp;
1396
+ if (convertToInt(shiftRight(cur, 60)) === 0) {
1397
+ var tmp$ret$3 = cur & 1152921504606846975n;
1398
+ tmp = constructSendersAndCloseStatus(tmp$ret$3, 1);
1399
+ } else {
1400
+ return Unit_instance;
1401
+ }
1402
+ var upd = tmp;
1403
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
1404
+ tmp$ret$0 = Unit_instance;
1405
+ break $l$block;
1406
+ }
1407
+ }
1408
+ tmp$ret$0 = Unit_instance;
1409
+ }
1410
+ return tmp$ret$0;
1411
+ }
1412
+ function completeCloseOrCancel($this) {
1413
+ $this.get_isClosedForSend_ajczci_k$();
1414
+ }
1415
+ function completeClose($this, sendersCur) {
1416
+ var lastSegment = closeLinkedList($this);
1417
+ if ($this.get_isConflatedDropOldest_qp2q39_k$()) {
1418
+ var lastBufferedCellGlobalIndex = markAllEmptyCellsAsClosed($this, lastSegment);
1419
+ if (!(lastBufferedCellGlobalIndex === -1n)) {
1420
+ $this.dropFirstElementUntilTheSpecifiedCellIsInTheBuffer_l7hcju_k$(lastBufferedCellGlobalIndex);
1421
+ }
1422
+ }
1423
+ cancelSuspendedReceiveRequests($this, lastSegment, sendersCur);
1424
+ return lastSegment;
1425
+ }
1426
+ function completeCancel($this, sendersCur) {
1427
+ var lastSegment = completeClose($this, sendersCur);
1428
+ removeUnprocessedElements($this, lastSegment);
1429
+ }
1430
+ function closeLinkedList($this) {
1431
+ var lastSegment = $this.bufferEndSegment_1.kotlinx$atomicfu$value;
1432
+ var it = $this.sendSegment_1.kotlinx$atomicfu$value;
1433
+ if (it.id_1 > lastSegment.id_1)
1434
+ lastSegment = it;
1435
+ var it_0 = $this.receiveSegment_1.kotlinx$atomicfu$value;
1436
+ if (it_0.id_1 > lastSegment.id_1)
1437
+ lastSegment = it_0;
1438
+ return close(lastSegment);
1439
+ }
1440
+ function markAllEmptyCellsAsClosed($this, lastSegment) {
1441
+ var segment = lastSegment;
1442
+ while (true) {
1443
+ var inductionVariable = get_SEGMENT_SIZE() - 1 | 0;
1444
+ if (0 <= inductionVariable)
1445
+ do {
1446
+ var index = inductionVariable;
1447
+ inductionVariable = inductionVariable + -1 | 0;
1448
+ var tmp0 = segment.id_1;
1449
+ var other = get_SEGMENT_SIZE();
1450
+ var this_0 = multiply(tmp0, fromInt(other));
1451
+ var globalIndex = add(this_0, fromInt(index));
1452
+ if (globalIndex < $this.get_receiversCounter_ne8ics_k$())
1453
+ return -1n;
1454
+ cell_update: while (true) {
1455
+ var state = segment.getState_jak5mi_k$(index);
1456
+ if (state === null || state === get_IN_BUFFER()) {
1457
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1458
+ segment.onSlotCleaned_do6lqz_k$();
1459
+ break cell_update;
1460
+ }
1461
+ } else if (state === get_BUFFERED())
1462
+ return globalIndex;
1463
+ else
1464
+ break cell_update;
1465
+ }
1466
+ } while (0 <= inductionVariable);
1467
+ var tmp0_elvis_lhs = segment.get_prev_wosl18_k$();
1468
+ var tmp;
1469
+ if (tmp0_elvis_lhs == null) {
1470
+ return -1n;
1471
+ } else {
1472
+ tmp = tmp0_elvis_lhs;
1473
+ }
1474
+ segment = tmp;
1475
+ }
1476
+ }
1477
+ function removeUnprocessedElements($this, lastSegment) {
1478
+ var onUndeliveredElement = $this.onUndeliveredElement_1;
1479
+ var undeliveredElementException = null;
1480
+ var suspendedSenders = _InlineList___init__impl__z8n56();
1481
+ var segment = lastSegment;
1482
+ process_segments: while (true) {
1483
+ var inductionVariable = get_SEGMENT_SIZE() - 1 | 0;
1484
+ if (0 <= inductionVariable)
1485
+ do {
1486
+ var index = inductionVariable;
1487
+ inductionVariable = inductionVariable + -1 | 0;
1488
+ var tmp0 = segment.id_1;
1489
+ var other = get_SEGMENT_SIZE();
1490
+ var this_0 = multiply(tmp0, fromInt(other));
1491
+ var globalIndex = add(this_0, fromInt(index));
1492
+ update_cell: while (true) {
1493
+ var state = segment.getState_jak5mi_k$(index);
1494
+ if (state === get_DONE_RCV())
1495
+ break process_segments;
1496
+ else {
1497
+ if (state === get_BUFFERED()) {
1498
+ if (globalIndex < $this.get_receiversCounter_ne8ics_k$())
1499
+ break process_segments;
1500
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1501
+ if (!(onUndeliveredElement == null)) {
1502
+ var element = segment.getElement_ye1phr_k$(index);
1503
+ undeliveredElementException = callUndeliveredElementCatchingException(onUndeliveredElement, element, undeliveredElementException);
1504
+ }
1505
+ segment.cleanElement_ob56q6_k$(index);
1506
+ segment.onSlotCleaned_do6lqz_k$();
1507
+ break update_cell;
1508
+ }
1509
+ } else {
1510
+ if (state === get_IN_BUFFER() || state === null) {
1511
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1512
+ segment.onSlotCleaned_do6lqz_k$();
1513
+ break update_cell;
1514
+ }
1515
+ } else {
1516
+ var tmp;
1517
+ if (isInterface(state, Waiter())) {
1518
+ tmp = true;
1519
+ } else {
1520
+ tmp = state instanceof WaiterEB();
1521
+ }
1522
+ if (tmp) {
1523
+ if (globalIndex < $this.get_receiversCounter_ne8ics_k$())
1524
+ break process_segments;
1525
+ var tmp_0;
1526
+ if (state instanceof WaiterEB()) {
1527
+ tmp_0 = state.waiter_1;
1528
+ } else {
1529
+ tmp_0 = isInterface(state, Waiter()) ? state : THROW_CCE();
1530
+ }
1531
+ var sender = tmp_0;
1532
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1533
+ if (!(onUndeliveredElement == null)) {
1534
+ var element_0 = segment.getElement_ye1phr_k$(index);
1535
+ undeliveredElementException = callUndeliveredElementCatchingException(onUndeliveredElement, element_0, undeliveredElementException);
1536
+ }
1537
+ suspendedSenders = InlineList__plus_impl_nuetvo(suspendedSenders, sender);
1538
+ segment.cleanElement_ob56q6_k$(index);
1539
+ segment.onSlotCleaned_do6lqz_k$();
1540
+ break update_cell;
1541
+ }
1542
+ } else {
1543
+ if (state === get_RESUMING_BY_EB() || state === get_RESUMING_BY_RCV())
1544
+ break process_segments;
1545
+ else {
1546
+ if (state === get_RESUMING_BY_EB())
1547
+ continue update_cell;
1548
+ else {
1549
+ break update_cell;
1550
+ }
1551
+ }
1552
+ }
1553
+ }
1554
+ }
1555
+ }
1556
+ }
1557
+ } while (0 <= inductionVariable);
1558
+ var tmp0_elvis_lhs = segment.get_prev_wosl18_k$();
1559
+ var tmp_1;
1560
+ if (tmp0_elvis_lhs == null) {
1561
+ break process_segments;
1562
+ } else {
1563
+ tmp_1 = tmp0_elvis_lhs;
1564
+ }
1565
+ segment = tmp_1;
1566
+ }
1567
+ var tmp0_0 = suspendedSenders;
1568
+ $l$block: {
1569
+ var tmp0_subject = access$_get_holder__kkflen(tmp0_0);
1570
+ if (tmp0_subject == null) {
1571
+ break $l$block;
1572
+ } else {
1573
+ if (!(tmp0_subject instanceof ArrayList())) {
1574
+ var tmp_2 = access$_get_holder__kkflen(tmp0_0);
1575
+ var it = !(tmp_2 == null) ? tmp_2 : THROW_CCE();
1576
+ resumeSenderOnCancelledChannel($this, it);
1577
+ } else {
1578
+ var tmp_3 = access$_get_holder__kkflen(tmp0_0);
1579
+ var list = tmp_3 instanceof ArrayList() ? tmp_3 : THROW_CCE();
1580
+ var inductionVariable_0 = list.get_size_woubt6_k$() - 1 | 0;
1581
+ if (0 <= inductionVariable_0)
1582
+ do {
1583
+ var i = inductionVariable_0;
1584
+ inductionVariable_0 = inductionVariable_0 + -1 | 0;
1585
+ var it_0 = list.get_c1px32_k$(i);
1586
+ resumeSenderOnCancelledChannel($this, it_0);
1587
+ } while (0 <= inductionVariable_0);
1588
+ }
1589
+ }
1590
+ }
1591
+ var tmp1_safe_receiver = undeliveredElementException;
1592
+ if (tmp1_safe_receiver == null)
1593
+ null;
1594
+ else {
1595
+ throw tmp1_safe_receiver;
1596
+ }
1597
+ }
1598
+ function cancelSuspendedReceiveRequests($this, lastSegment, sendersCounter) {
1599
+ var suspendedReceivers = _InlineList___init__impl__z8n56();
1600
+ var segment = lastSegment;
1601
+ process_segments: while (!(segment == null)) {
1602
+ var inductionVariable = get_SEGMENT_SIZE() - 1 | 0;
1603
+ if (0 <= inductionVariable)
1604
+ do {
1605
+ var index = inductionVariable;
1606
+ inductionVariable = inductionVariable + -1 | 0;
1607
+ var tmp0 = segment.id_1;
1608
+ var other = get_SEGMENT_SIZE();
1609
+ var this_0 = multiply(tmp0, fromInt(other));
1610
+ if (add(this_0, fromInt(index)) < sendersCounter)
1611
+ break process_segments;
1612
+ cell_update: while (true) {
1613
+ var state = segment.getState_jak5mi_k$(index);
1614
+ if (state === null || state === get_IN_BUFFER()) {
1615
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1616
+ segment.onSlotCleaned_do6lqz_k$();
1617
+ break cell_update;
1618
+ }
1619
+ } else {
1620
+ if (state instanceof WaiterEB()) {
1621
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1622
+ suspendedReceivers = InlineList__plus_impl_nuetvo(suspendedReceivers, state.waiter_1);
1623
+ segment.onCancelledRequest_bhmu12_k$(index, true);
1624
+ break cell_update;
1625
+ }
1626
+ } else {
1627
+ if (isInterface(state, Waiter())) {
1628
+ if (segment.casState_u37dcn_k$(index, state, get_CHANNEL_CLOSED())) {
1629
+ suspendedReceivers = InlineList__plus_impl_nuetvo(suspendedReceivers, state);
1630
+ segment.onCancelledRequest_bhmu12_k$(index, true);
1631
+ break cell_update;
1632
+ }
1633
+ } else {
1634
+ break cell_update;
1635
+ }
1636
+ }
1637
+ }
1638
+ }
1639
+ } while (0 <= inductionVariable);
1640
+ segment = segment.get_prev_wosl18_k$();
1641
+ }
1642
+ var tmp0_0 = suspendedReceivers;
1643
+ $l$block: {
1644
+ var tmp0_subject = access$_get_holder__kkflen(tmp0_0);
1645
+ if (tmp0_subject == null) {
1646
+ break $l$block;
1647
+ } else {
1648
+ if (!(tmp0_subject instanceof ArrayList())) {
1649
+ var tmp = access$_get_holder__kkflen(tmp0_0);
1650
+ var it = !(tmp == null) ? tmp : THROW_CCE();
1651
+ resumeReceiverOnClosedChannel($this, it);
1652
+ } else {
1653
+ var tmp_0 = access$_get_holder__kkflen(tmp0_0);
1654
+ var list = tmp_0 instanceof ArrayList() ? tmp_0 : THROW_CCE();
1655
+ var inductionVariable_0 = list.get_size_woubt6_k$() - 1 | 0;
1656
+ if (0 <= inductionVariable_0)
1657
+ do {
1658
+ var i = inductionVariable_0;
1659
+ inductionVariable_0 = inductionVariable_0 + -1 | 0;
1660
+ var it_0 = list.get_c1px32_k$(i);
1661
+ resumeReceiverOnClosedChannel($this, it_0);
1662
+ } while (0 <= inductionVariable_0);
1663
+ }
1664
+ }
1665
+ }
1666
+ }
1667
+ function resumeReceiverOnClosedChannel($this, $receiver) {
1668
+ return resumeWaiterOnClosedChannel($this, $receiver, true);
1669
+ }
1670
+ function resumeSenderOnCancelledChannel($this, $receiver) {
1671
+ return resumeWaiterOnClosedChannel($this, $receiver, false);
1672
+ }
1673
+ function resumeWaiterOnClosedChannel($this, $receiver, receiver) {
1674
+ if ($receiver instanceof SendBroadcast()) {
1675
+ var this_0 = $receiver.cont_1;
1676
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(false);
1677
+ this_0.resumeWith_rk9gbt_k$(tmp$ret$1);
1678
+ } else {
1679
+ if (isInterface($receiver, CancellableContinuation())) {
1680
+ var exception = receiver ? _get_receiveException__foorc1($this) : $this.get_sendException_qpq1ry_k$();
1681
+ var tmp$ret$3 = _Result___init__impl__xyqfz8(createFailure(exception));
1682
+ $receiver.resumeWith_rk9gbt_k$(tmp$ret$3);
1683
+ } else {
1684
+ if ($receiver instanceof ReceiveCatching()) {
1685
+ var tmp0 = $receiver.cont_1;
1686
+ var value = new (ChannelResult())(Companion_getInstance().closed_xuwu5z_k$($this.get_closeCause_gbqkm2_k$()));
1687
+ var tmp$ret$5 = _Result___init__impl__xyqfz8(value);
1688
+ tmp0.resumeWith_rk9gbt_k$(tmp$ret$5);
1689
+ } else {
1690
+ if ($receiver instanceof BufferedChannelIterator()) {
1691
+ $receiver.tryResumeHasNextOnClosedChannel_mc581v_k$();
1692
+ } else {
1693
+ if (isInterface($receiver, SelectInstance()))
1694
+ $receiver.trySelect_fbege0_k$($this, get_CHANNEL_CLOSED());
1695
+ else {
1696
+ var message = "Unexpected waiter: " + toString($receiver);
1697
+ throw IllegalStateException_init_$Create$(toString(message));
1698
+ }
1699
+ }
1700
+ }
1701
+ }
1702
+ }
1703
+ }
1704
+ function _get_isClosedForSend0__kxgf9m($this, $receiver) {
1705
+ return isClosed($this, $receiver, false);
1706
+ }
1707
+ function _get_isClosedForReceive0__f7qknl($this, $receiver) {
1708
+ return isClosed($this, $receiver, true);
1709
+ }
1710
+ function isClosed($this, sendersAndCloseStatusCur, isClosedForReceive) {
1711
+ var tmp;
1712
+ switch (convertToInt(shiftRight(sendersAndCloseStatusCur, 60))) {
1713
+ case 0:
1714
+ tmp = false;
1715
+ break;
1716
+ case 1:
1717
+ tmp = false;
1718
+ break;
1719
+ case 2:
1720
+ var tmp$ret$1 = sendersAndCloseStatusCur & 1152921504606846975n;
1721
+ completeClose($this, tmp$ret$1);
1722
+ tmp = isClosedForReceive ? !$this.hasElements_2busqs_k$() : true;
1723
+ break;
1724
+ case 3:
1725
+ var tmp$ret$2 = sendersAndCloseStatusCur & 1152921504606846975n;
1726
+ completeCancel($this, tmp$ret$2);
1727
+ tmp = true;
1728
+ break;
1729
+ default:
1730
+ var message = "unexpected close status: " + convertToInt(shiftRight(sendersAndCloseStatusCur, 60));
1731
+ throw IllegalStateException_init_$Create$(toString(message));
1732
+ }
1733
+ return tmp;
1734
+ }
1735
+ function isCellNonEmpty($this, segment, index, globalIndex) {
1736
+ while (true) {
1737
+ var state = segment.getState_jak5mi_k$(index);
1738
+ if (state === null || state === get_IN_BUFFER()) {
1739
+ if (segment.casState_u37dcn_k$(index, state, get_POISONED())) {
1740
+ expandBuffer($this);
1741
+ return false;
1742
+ }
1743
+ } else if (state === get_BUFFERED())
1744
+ return true;
1745
+ else if (state === get_INTERRUPTED_SEND())
1746
+ return false;
1747
+ else if (state === get_CHANNEL_CLOSED())
1748
+ return false;
1749
+ else if (state === get_DONE_RCV())
1750
+ return false;
1751
+ else if (state === get_POISONED())
1752
+ return false;
1753
+ else if (state === get_RESUMING_BY_EB())
1754
+ return true;
1755
+ else if (state === get_RESUMING_BY_RCV())
1756
+ return false;
1757
+ else
1758
+ return globalIndex === $this.get_receiversCounter_ne8ics_k$();
1759
+ }
1760
+ }
1761
+ function findSegmentSend($this, id, startFrom) {
1762
+ var tmp0 = $this.sendSegment_1;
1763
+ var tmp6 = createSegmentFunction();
1764
+ var tmp$ret$0;
1765
+ $l$block_2: {
1766
+ while (true) {
1767
+ var s = findSegmentInternal(startFrom, id, tmp6);
1768
+ var tmp;
1769
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(s)) {
1770
+ tmp = true;
1771
+ } else {
1772
+ var tmp2 = _SegmentOrClosed___get_segment__impl__jvcr9l(s);
1773
+ var tmp$ret$1;
1774
+ $l$block_1: {
1775
+ var tmp$ret$2;
1776
+ while (true) {
1777
+ var cur = tmp0.kotlinx$atomicfu$value;
1778
+ if (cur.id_1 >= tmp2.id_1) {
1779
+ tmp$ret$1 = true;
1780
+ break $l$block_1;
1781
+ }
1782
+ if (!tmp2.tryIncPointers_6zsfpw_k$()) {
1783
+ tmp$ret$1 = false;
1784
+ break $l$block_1;
1785
+ }
1786
+ if (tmp0.atomicfu$compareAndSet(cur, tmp2)) {
1787
+ if (cur.decPointers_vy306j_k$()) {
1788
+ cur.remove_ldkf9o_k$();
1789
+ }
1790
+ tmp$ret$1 = true;
1791
+ break $l$block_1;
1792
+ }
1793
+ if (tmp2.decPointers_vy306j_k$()) {
1794
+ tmp2.remove_ldkf9o_k$();
1795
+ }
1796
+ }
1797
+ tmp$ret$1 = tmp$ret$2;
1798
+ }
1799
+ tmp = tmp$ret$1;
1800
+ }
1801
+ if (tmp) {
1802
+ tmp$ret$0 = s;
1803
+ break $l$block_2;
1804
+ }
1805
+ }
1806
+ }
1807
+ var it = tmp$ret$0;
1808
+ var tmp_0;
1809
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(it)) {
1810
+ completeCloseOrCancel($this);
1811
+ var tmp0_0 = startFrom.id_1;
1812
+ var other = get_SEGMENT_SIZE();
1813
+ if (multiply(tmp0_0, fromInt(other)) < $this.get_receiversCounter_ne8ics_k$()) {
1814
+ startFrom.cleanPrev_rn0kss_k$();
1815
+ }
1816
+ tmp_0 = null;
1817
+ } else {
1818
+ var segment = _SegmentOrClosed___get_segment__impl__jvcr9l(it);
1819
+ var tmp_1;
1820
+ if (segment.id_1 > id) {
1821
+ var tmp0_1 = segment.id_1;
1822
+ var other_0 = get_SEGMENT_SIZE();
1823
+ var tmp$ret$7 = multiply(tmp0_1, fromInt(other_0));
1824
+ updateSendersCounterIfLower($this, tmp$ret$7);
1825
+ var tmp0_2 = segment.id_1;
1826
+ var other_1 = get_SEGMENT_SIZE();
1827
+ if (multiply(tmp0_2, fromInt(other_1)) < $this.get_receiversCounter_ne8ics_k$()) {
1828
+ segment.cleanPrev_rn0kss_k$();
1829
+ }
1830
+ tmp_1 = null;
1831
+ } else {
1832
+ tmp_1 = segment;
1833
+ }
1834
+ tmp_0 = tmp_1;
1835
+ }
1836
+ return tmp_0;
1837
+ }
1838
+ function findSegmentReceive($this, id, startFrom) {
1839
+ var tmp0 = $this.receiveSegment_1;
1840
+ var tmp6 = createSegmentFunction();
1841
+ var tmp$ret$0;
1842
+ $l$block_2: {
1843
+ while (true) {
1844
+ var s = findSegmentInternal(startFrom, id, tmp6);
1845
+ var tmp;
1846
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(s)) {
1847
+ tmp = true;
1848
+ } else {
1849
+ var tmp2 = _SegmentOrClosed___get_segment__impl__jvcr9l(s);
1850
+ var tmp$ret$1;
1851
+ $l$block_1: {
1852
+ var tmp$ret$2;
1853
+ while (true) {
1854
+ var cur = tmp0.kotlinx$atomicfu$value;
1855
+ if (cur.id_1 >= tmp2.id_1) {
1856
+ tmp$ret$1 = true;
1857
+ break $l$block_1;
1858
+ }
1859
+ if (!tmp2.tryIncPointers_6zsfpw_k$()) {
1860
+ tmp$ret$1 = false;
1861
+ break $l$block_1;
1862
+ }
1863
+ if (tmp0.atomicfu$compareAndSet(cur, tmp2)) {
1864
+ if (cur.decPointers_vy306j_k$()) {
1865
+ cur.remove_ldkf9o_k$();
1866
+ }
1867
+ tmp$ret$1 = true;
1868
+ break $l$block_1;
1869
+ }
1870
+ if (tmp2.decPointers_vy306j_k$()) {
1871
+ tmp2.remove_ldkf9o_k$();
1872
+ }
1873
+ }
1874
+ tmp$ret$1 = tmp$ret$2;
1875
+ }
1876
+ tmp = tmp$ret$1;
1877
+ }
1878
+ if (tmp) {
1879
+ tmp$ret$0 = s;
1880
+ break $l$block_2;
1881
+ }
1882
+ }
1883
+ }
1884
+ var it = tmp$ret$0;
1885
+ var tmp_0;
1886
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(it)) {
1887
+ completeCloseOrCancel($this);
1888
+ var tmp0_0 = startFrom.id_1;
1889
+ var other = get_SEGMENT_SIZE();
1890
+ if (multiply(tmp0_0, fromInt(other)) < $this.get_sendersCounter_mvbt0m_k$()) {
1891
+ startFrom.cleanPrev_rn0kss_k$();
1892
+ }
1893
+ tmp_0 = null;
1894
+ } else {
1895
+ var segment = _SegmentOrClosed___get_segment__impl__jvcr9l(it);
1896
+ var tmp_1;
1897
+ if (!_get_isRendezvousOrUnlimited__3mdufi($this)) {
1898
+ var tmp0_1 = _get_bufferEndCounter__2d4hee($this);
1899
+ var other_0 = get_SEGMENT_SIZE();
1900
+ tmp_1 = id <= divide(tmp0_1, fromInt(other_0));
1901
+ } else {
1902
+ tmp_1 = false;
1903
+ }
1904
+ if (tmp_1) {
1905
+ var tmp0_2 = $this.bufferEndSegment_1;
1906
+ $l$block_5: {
1907
+ while (true) {
1908
+ var cur_0 = tmp0_2.kotlinx$atomicfu$value;
1909
+ if (cur_0.id_1 >= segment.id_1) {
1910
+ break $l$block_5;
1911
+ }
1912
+ if (!segment.tryIncPointers_6zsfpw_k$()) {
1913
+ break $l$block_5;
1914
+ }
1915
+ if (tmp0_2.atomicfu$compareAndSet(cur_0, segment)) {
1916
+ if (cur_0.decPointers_vy306j_k$()) {
1917
+ cur_0.remove_ldkf9o_k$();
1918
+ }
1919
+ break $l$block_5;
1920
+ }
1921
+ if (segment.decPointers_vy306j_k$()) {
1922
+ segment.remove_ldkf9o_k$();
1923
+ }
1924
+ }
1925
+ }
1926
+ }
1927
+ var tmp_2;
1928
+ if (segment.id_1 > id) {
1929
+ var tmp0_3 = segment.id_1;
1930
+ var other_1 = get_SEGMENT_SIZE();
1931
+ var tmp$ret$11 = multiply(tmp0_3, fromInt(other_1));
1932
+ updateReceiversCounterIfLower($this, tmp$ret$11);
1933
+ var tmp0_4 = segment.id_1;
1934
+ var other_2 = get_SEGMENT_SIZE();
1935
+ if (multiply(tmp0_4, fromInt(other_2)) < $this.get_sendersCounter_mvbt0m_k$()) {
1936
+ segment.cleanPrev_rn0kss_k$();
1937
+ }
1938
+ tmp_2 = null;
1939
+ } else {
1940
+ tmp_2 = segment;
1941
+ }
1942
+ tmp_0 = tmp_2;
1943
+ }
1944
+ return tmp_0;
1945
+ }
1946
+ function findSegmentBufferEnd($this, id, startFrom, currentBufferEndCounter) {
1947
+ var tmp0 = $this.bufferEndSegment_1;
1948
+ var tmp6 = createSegmentFunction();
1949
+ var tmp$ret$0;
1950
+ $l$block_2: {
1951
+ while (true) {
1952
+ var s = findSegmentInternal(startFrom, id, tmp6);
1953
+ var tmp;
1954
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(s)) {
1955
+ tmp = true;
1956
+ } else {
1957
+ var tmp2 = _SegmentOrClosed___get_segment__impl__jvcr9l(s);
1958
+ var tmp$ret$1;
1959
+ $l$block_1: {
1960
+ var tmp$ret$2;
1961
+ while (true) {
1962
+ var cur = tmp0.kotlinx$atomicfu$value;
1963
+ if (cur.id_1 >= tmp2.id_1) {
1964
+ tmp$ret$1 = true;
1965
+ break $l$block_1;
1966
+ }
1967
+ if (!tmp2.tryIncPointers_6zsfpw_k$()) {
1968
+ tmp$ret$1 = false;
1969
+ break $l$block_1;
1970
+ }
1971
+ if (tmp0.atomicfu$compareAndSet(cur, tmp2)) {
1972
+ if (cur.decPointers_vy306j_k$()) {
1973
+ cur.remove_ldkf9o_k$();
1974
+ }
1975
+ tmp$ret$1 = true;
1976
+ break $l$block_1;
1977
+ }
1978
+ if (tmp2.decPointers_vy306j_k$()) {
1979
+ tmp2.remove_ldkf9o_k$();
1980
+ }
1981
+ }
1982
+ tmp$ret$1 = tmp$ret$2;
1983
+ }
1984
+ tmp = tmp$ret$1;
1985
+ }
1986
+ if (tmp) {
1987
+ tmp$ret$0 = s;
1988
+ break $l$block_2;
1989
+ }
1990
+ }
1991
+ }
1992
+ var it = tmp$ret$0;
1993
+ var tmp_0;
1994
+ if (_SegmentOrClosed___get_isClosed__impl__qmxmlo(it)) {
1995
+ completeCloseOrCancel($this);
1996
+ moveSegmentBufferEndToSpecifiedOrLast($this, id, startFrom);
1997
+ incCompletedExpandBufferAttempts($this);
1998
+ tmp_0 = null;
1999
+ } else {
2000
+ var segment = _SegmentOrClosed___get_segment__impl__jvcr9l(it);
2001
+ var tmp_1;
2002
+ if (segment.id_1 > id) {
2003
+ var tmp_2 = add(currentBufferEndCounter, fromInt(1));
2004
+ var tmp0_0 = segment.id_1;
2005
+ var other = get_SEGMENT_SIZE();
2006
+ var tmp$ret$7 = multiply(tmp0_0, fromInt(other));
2007
+ if ($this.bufferEnd_1.atomicfu$compareAndSet(tmp_2, tmp$ret$7)) {
2008
+ var tmp0_1 = segment.id_1;
2009
+ var other_0 = get_SEGMENT_SIZE();
2010
+ var tmp$ret$8 = multiply(tmp0_1, fromInt(other_0));
2011
+ incCompletedExpandBufferAttempts($this, subtract(tmp$ret$8, currentBufferEndCounter));
2012
+ } else {
2013
+ incCompletedExpandBufferAttempts($this);
2014
+ }
2015
+ tmp_1 = null;
2016
+ } else {
2017
+ tmp_1 = segment;
2018
+ }
2019
+ tmp_0 = tmp_1;
2020
+ }
2021
+ return tmp_0;
2022
+ }
2023
+ function moveSegmentBufferEndToSpecifiedOrLast($this, id, startFrom) {
2024
+ var segment = startFrom;
2025
+ $l$loop: while (segment.id_1 < id) {
2026
+ var tmp0_elvis_lhs = segment.get_next_wor1vg_k$();
2027
+ var tmp;
2028
+ if (tmp0_elvis_lhs == null) {
2029
+ break $l$loop;
2030
+ } else {
2031
+ tmp = tmp0_elvis_lhs;
2032
+ }
2033
+ segment = tmp;
2034
+ }
2035
+ while (true) {
2036
+ $l$loop_0: while (segment.get_isRemoved_gzdz59_k$()) {
2037
+ var tmp1_elvis_lhs = segment.get_next_wor1vg_k$();
2038
+ var tmp_0;
2039
+ if (tmp1_elvis_lhs == null) {
2040
+ break $l$loop_0;
2041
+ } else {
2042
+ tmp_0 = tmp1_elvis_lhs;
2043
+ }
2044
+ segment = tmp_0;
2045
+ }
2046
+ var tmp0 = $this.bufferEndSegment_1;
2047
+ var tmp2 = segment;
2048
+ var tmp$ret$0;
2049
+ $l$block_1: {
2050
+ var tmp$ret$1;
2051
+ while (true) {
2052
+ var cur = tmp0.kotlinx$atomicfu$value;
2053
+ if (cur.id_1 >= tmp2.id_1) {
2054
+ tmp$ret$0 = true;
2055
+ break $l$block_1;
2056
+ }
2057
+ if (!tmp2.tryIncPointers_6zsfpw_k$()) {
2058
+ tmp$ret$0 = false;
2059
+ break $l$block_1;
2060
+ }
2061
+ if (tmp0.atomicfu$compareAndSet(cur, tmp2)) {
2062
+ if (cur.decPointers_vy306j_k$()) {
2063
+ cur.remove_ldkf9o_k$();
2064
+ }
2065
+ tmp$ret$0 = true;
2066
+ break $l$block_1;
2067
+ }
2068
+ if (tmp2.decPointers_vy306j_k$()) {
2069
+ tmp2.remove_ldkf9o_k$();
2070
+ }
2071
+ }
2072
+ tmp$ret$0 = tmp$ret$1;
2073
+ }
2074
+ if (tmp$ret$0)
2075
+ return Unit_instance;
2076
+ }
2077
+ }
2078
+ function updateSendersCounterIfLower($this, value) {
2079
+ var tmp$ret$0;
2080
+ var this_0 = $this.sendersAndCloseStatus_1;
2081
+ while (true) {
2082
+ var cur = this_0.kotlinx$atomicfu$value;
2083
+ var curCounter = cur & 1152921504606846975n;
2084
+ if (curCounter >= value)
2085
+ return Unit_instance;
2086
+ var tmp$ret$3 = convertToInt(shiftRight(cur, 60));
2087
+ var update = constructSendersAndCloseStatus(curCounter, tmp$ret$3);
2088
+ if ($this.sendersAndCloseStatus_1.atomicfu$compareAndSet(cur, update))
2089
+ return Unit_instance;
2090
+ }
2091
+ return tmp$ret$0;
2092
+ }
2093
+ function updateReceiversCounterIfLower($this, value) {
2094
+ var tmp$ret$0;
2095
+ var this_0 = $this.receivers_1;
2096
+ while (true) {
2097
+ var cur = this_0.kotlinx$atomicfu$value;
2098
+ if (cur >= value)
2099
+ return Unit_instance;
2100
+ if ($this.receivers_1.atomicfu$compareAndSet(cur, value))
2101
+ return Unit_instance;
2102
+ }
2103
+ return tmp$ret$0;
2104
+ }
2105
+ function bindCancellationFunResult($this, $receiver) {
2106
+ return BufferedChannel$onCancellationChannelResultImplDoNotCall$ref($this);
2107
+ }
2108
+ function onCancellationChannelResultImplDoNotCall($this, cause, element, context) {
2109
+ callUndeliveredElement(ensureNotNull($this.onUndeliveredElement_1), ensureNotNull(ChannelResult__getOrNull_impl_f5e07h(element)), context);
2110
+ }
2111
+ function bindCancellationFun($this, $receiver, element) {
2112
+ return BufferedChannel$bindCancellationFun$lambda($receiver, element);
2113
+ }
2114
+ function bindCancellationFun_0($this, $receiver) {
2115
+ return BufferedChannel$onCancellationImplDoNotCall$ref($this);
2116
+ }
2117
+ function onCancellationImplDoNotCall($this, cause, element, context) {
2118
+ callUndeliveredElement(ensureNotNull($this.onUndeliveredElement_1), element, context);
2119
+ }
2120
+ function access$_get_sendersAndCloseStatus__tvw29s($this) {
2121
+ return $this.sendersAndCloseStatus_1;
2122
+ }
2123
+ function access$_get_sendSegment__111kgq($this) {
2124
+ return $this.sendSegment_1;
2125
+ }
2126
+ function access$prepareSenderForSuspension($this, $receiver, segment, index) {
2127
+ return prepareSenderForSuspension($this, $receiver, segment, index);
2128
+ }
2129
+ function access$updateCellSend($this, segment, index, element, s, waiter, closed) {
2130
+ return updateCellSend($this, segment, index, element, s, waiter, closed);
2131
+ }
2132
+ function access$_get_isClosedForSend0__sm8f7a($this, $receiver) {
2133
+ return _get_isClosedForSend0__kxgf9m($this, $receiver);
2134
+ }
2135
+ function access$findSegmentSend($this, id, startFrom) {
2136
+ return findSegmentSend($this, id, startFrom);
2137
+ }
2138
+ function BufferedChannel$registerSelectForReceive$ref() {
2139
+ return constructCallableReference(function(p0, p1, p2) {
2140
+ registerSelectForReceive(p0, p1, p2);
2141
+ return Unit_instance;
2142
+ }, 3, 0, 4, "registerSelectForReceive");
2143
+ }
2144
+ function BufferedChannel$processResultSelectReceive$ref() {
2145
+ return constructCallableReference(function(p0, p1, p2) {
2146
+ return processResultSelectReceive(p0, p1, p2);
2147
+ }, 3, 0, 5, "processResultSelectReceive");
2148
+ }
2149
+ function BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$lambda$lambda($element, this$0, $select) {
2150
+ return function(_unused_var__etf5q3, _unused_var__etf5q3_0, _unused_var__etf5q3_1) {
2151
+ var tmp;
2152
+ if (!($element === get_CHANNEL_CLOSED())) {
2153
+ callUndeliveredElement(this$0.onUndeliveredElement_1, $element, $select.get_context_h02k06_k$());
2154
+ tmp = Unit_instance;
2155
+ }
2156
+ return Unit_instance;
2157
+ };
2158
+ }
2159
+ function BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$lambda(this$0) {
2160
+ return function(select, _unused_var__etf5q3, element) {
2161
+ return BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$lambda$lambda(element, this$0, select);
2162
+ };
2163
+ }
2164
+ function BufferedChannel$onCancellationChannelResultImplDoNotCall$ref(p0) {
2165
+ return constructCallableReference(function(p0_0, p1, p2) {
2166
+ var tmp0 = p0;
2167
+ onCancellationChannelResultImplDoNotCall(tmp0, p0_0, p1.holder_1, p2);
2168
+ return Unit_instance;
2169
+ }, 3, 0, 6, "onCancellationChannelResultImplDoNotCall", [p0]);
2170
+ }
2171
+ function BufferedChannel$bindCancellationFun$lambda($this_bindCancellationFun, $element) {
2172
+ return function(_unused_var__etf5q3, _unused_var__etf5q3_0, context) {
2173
+ callUndeliveredElement($this_bindCancellationFun, $element, context);
2174
+ return Unit_instance;
2175
+ };
2176
+ }
2177
+ function BufferedChannel$onCancellationImplDoNotCall$ref(p0) {
2178
+ return constructCallableReference(function(p0_0, p1, p2) {
2179
+ var tmp0 = p0;
2180
+ onCancellationImplDoNotCall(tmp0, p0_0, p1, p2);
2181
+ return Unit_instance;
2182
+ }, 3, 0, 7, "onCancellationImplDoNotCall", [p0]);
2183
+ }
2184
+ var $sendCOROUTINE$Class;
2185
+ function $sendCOROUTINE$() {
2186
+ if ($sendCOROUTINE$Class === VOID) {
2187
+ let $ = function(_this__u8e3s4, element, resultContinuation) {
2188
+ CoroutineImpl().call(this, resultContinuation);
2189
+ this._this__u8e3s4__1 = _this__u8e3s4;
2190
+ this.element_1 = element;
2191
+ };
2192
+ initMetadataForCoroutine($, CoroutineImpl());
2193
+ protoOf($).doResume_5yljmg_k$ = function() {
2194
+ var suspendResult = this.result_1;
2195
+ $sm: do
2196
+ try {
2197
+ var tmp = this.state_1;
2198
+ switch (tmp) {
2199
+ case 0:
2200
+ this.exceptionState_1 = 11;
2201
+ this.tmp010__1 = this._this__u8e3s4__1;
2202
+ this.tmp29__1 = this.element_1;
2203
+ this.tmp48__1 = null;
2204
+ this.state_1 = 1;
2205
+ continue $sm;
2206
+ case 1:
2207
+ this.this2__1 = this.tmp010__1;
2208
+ this.element5__1 = this.tmp29__1;
2209
+ this.waiter3__1 = this.tmp48__1;
2210
+ this.segment1__1 = access$_get_sendSegment__111kgq(this.this2__1).kotlinx$atomicfu$value;
2211
+ this.state_1 = 2;
2212
+ continue $sm;
2213
+ case 2:
2214
+ if (false) {
2215
+ this.state_1 = 12;
2216
+ continue $sm;
2217
+ }
2218
+ var sendersAndCloseStatusCur = access$_get_sendersAndCloseStatus__tvw29s(this.this2__1).atomicfu$getAndIncrement$long();
2219
+ var tmp_0 = this;
2220
+ tmp_0.s4__1 = sendersAndCloseStatusCur & 1152921504606846975n;
2221
+ this.closed6__1 = access$_get_isClosedForSend0__sm8f7a(this.this2__1, sendersAndCloseStatusCur);
2222
+ var tmp0 = this.s4__1;
2223
+ var other = get_SEGMENT_SIZE();
2224
+ var id = divide(tmp0, fromInt(other));
2225
+ var tmp_1 = this;
2226
+ var tmp0_0 = this.s4__1;
2227
+ var other_0 = get_SEGMENT_SIZE();
2228
+ tmp_1.i0__1 = convertToInt(modulo(tmp0_0, fromInt(other_0)));
2229
+ if (!(this.segment1__1.id_1 === id)) {
2230
+ var tmp0_elvis_lhs = access$findSegmentSend(this.this2__1, id, this.segment1__1);
2231
+ if (tmp0_elvis_lhs == null) {
2232
+ if (this.closed6__1) {
2233
+ this.state_1 = 10;
2234
+ suspendResult = onClosedSend(this._this__u8e3s4__1, this.element_1, this);
2235
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2236
+ return suspendResult;
2237
+ }
2238
+ continue $sm;
2239
+ } else {
2240
+ this.state_1 = 2;
2241
+ var tmp_2 = this;
2242
+ continue $sm;
2243
+ }
2244
+ } else {
2245
+ this.WHEN_RESULT7__1 = tmp0_elvis_lhs;
2246
+ this.state_1 = 3;
2247
+ continue $sm;
2248
+ }
2249
+ } else {
2250
+ this.state_1 = 4;
2251
+ continue $sm;
2252
+ }
2253
+ case 3:
2254
+ this.segment1__1 = this.WHEN_RESULT7__1;
2255
+ this.state_1 = 4;
2256
+ continue $sm;
2257
+ case 4:
2258
+ var tmp1_subject = access$updateCellSend(this.this2__1, this.segment1__1, this.i0__1, this.element5__1, this.s4__1, this.waiter3__1, this.closed6__1);
2259
+ if (tmp1_subject === 0) {
2260
+ this.segment1__1.cleanPrev_rn0kss_k$();
2261
+ this.state_1 = 13;
2262
+ continue $sm;
2263
+ } else {
2264
+ if (tmp1_subject === 1) {
2265
+ this.state_1 = 13;
2266
+ continue $sm;
2267
+ } else {
2268
+ if (tmp1_subject === 2) {
2269
+ if (this.closed6__1) {
2270
+ this.segment1__1.onSlotCleaned_do6lqz_k$();
2271
+ this.state_1 = 9;
2272
+ suspendResult = onClosedSend(this._this__u8e3s4__1, this.element_1, this);
2273
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2274
+ return suspendResult;
2275
+ }
2276
+ continue $sm;
2277
+ } else {
2278
+ this.state_1 = 8;
2279
+ continue $sm;
2280
+ }
2281
+ } else {
2282
+ if (tmp1_subject === 4) {
2283
+ if (this.s4__1 < this.this2__1.get_receiversCounter_ne8ics_k$()) {
2284
+ this.segment1__1.cleanPrev_rn0kss_k$();
2285
+ }
2286
+ this.state_1 = 7;
2287
+ suspendResult = onClosedSend(this._this__u8e3s4__1, this.element_1, this);
2288
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2289
+ return suspendResult;
2290
+ }
2291
+ continue $sm;
2292
+ } else {
2293
+ if (tmp1_subject === 5) {
2294
+ this.segment1__1.cleanPrev_rn0kss_k$();
2295
+ this.state_1 = 2;
2296
+ continue $sm;
2297
+ } else {
2298
+ if (tmp1_subject === 3) {
2299
+ var tmp0_1 = this.segment1__1;
2300
+ var tmp2 = this.i0__1;
2301
+ var tmp4 = this.element5__1;
2302
+ var s = this.s4__1;
2303
+ this.state_1 = 6;
2304
+ suspendResult = sendOnNoWaiterSuspend(this._this__u8e3s4__1, tmp0_1, tmp2, tmp4, s, this);
2305
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2306
+ return suspendResult;
2307
+ }
2308
+ continue $sm;
2309
+ } else {
2310
+ this.state_1 = 5;
2311
+ continue $sm;
2312
+ }
2313
+ }
2314
+ }
2315
+ }
2316
+ }
2317
+ }
2318
+ case 5:
2319
+ this.state_1 = 2;
2320
+ continue $sm;
2321
+ case 6:
2322
+ this.state_1 = 13;
2323
+ continue $sm;
2324
+ case 7:
2325
+ this.state_1 = 13;
2326
+ continue $sm;
2327
+ case 8:
2328
+ var tmp_3 = this.waiter3__1;
2329
+ var tmp2_safe_receiver = (!(tmp_3 == null) ? isInterface(tmp_3, Waiter()) : false) ? tmp_3 : null;
2330
+ if (tmp2_safe_receiver == null)
2331
+ null;
2332
+ else {
2333
+ access$prepareSenderForSuspension(this.this2__1, tmp2_safe_receiver, this.segment1__1, this.i0__1);
2334
+ }
2335
+ this.segment1__1;
2336
+ this.i0__1;
2337
+ this.state_1 = 13;
2338
+ continue $sm;
2339
+ case 9:
2340
+ this.state_1 = 13;
2341
+ continue $sm;
2342
+ case 10:
2343
+ this.state_1 = 13;
2344
+ continue $sm;
2345
+ case 11:
2346
+ throw this.exception_1;
2347
+ case 12:
2348
+ if (false) {
2349
+ this.state_1 = 1;
2350
+ continue $sm;
2351
+ }
2352
+ this.state_1 = 13;
2353
+ continue $sm;
2354
+ case 13:
2355
+ return Unit_instance;
2356
+ }
2357
+ } catch ($p) {
2358
+ var e = $p;
2359
+ if (this.exceptionState_1 === 11) {
2360
+ throw e;
2361
+ } else {
2362
+ this.state_1 = this.exceptionState_1;
2363
+ this.exception_1 = e;
2364
+ }
2365
+ }
2366
+ while (true);
2367
+ };
2368
+ $sendCOROUTINE$Class = $;
2369
+ }
2370
+ return $sendCOROUTINE$Class;
2371
+ }
2372
+ var $receiveCOROUTINE$Class;
2373
+ function $receiveCOROUTINE$() {
2374
+ if ($receiveCOROUTINE$Class === VOID) {
2375
+ let $ = function(_this__u8e3s4, resultContinuation) {
2376
+ CoroutineImpl().call(this, resultContinuation);
2377
+ this._this__u8e3s4__1 = _this__u8e3s4;
2378
+ };
2379
+ initMetadataForCoroutine($, CoroutineImpl());
2380
+ protoOf($).doResume_5yljmg_k$ = function() {
2381
+ var suspendResult = this.result_1;
2382
+ $sm: do
2383
+ try {
2384
+ var tmp = this.state_1;
2385
+ switch (tmp) {
2386
+ case 0:
2387
+ this.exceptionState_1 = 8;
2388
+ this.tmp09__1 = this._this__u8e3s4__1;
2389
+ this.tmp28__1 = null;
2390
+ this.state_1 = 1;
2391
+ continue $sm;
2392
+ case 1:
2393
+ this.this5__1 = this.tmp09__1;
2394
+ this.waiter6__1 = this.tmp28__1;
2395
+ this.segment2__1 = this.this5__1.receiveSegment_1.kotlinx$atomicfu$value;
2396
+ this.state_1 = 2;
2397
+ continue $sm;
2398
+ case 2:
2399
+ if (false) {
2400
+ this.state_1 = 9;
2401
+ continue $sm;
2402
+ }
2403
+ if (this.this5__1.get_isClosedForReceive_v0r77d_k$()) {
2404
+ var tmp_0 = this;
2405
+ throw recoverStackTrace(_get_receiveException__foorc1(this._this__u8e3s4__1));
2406
+ } else {
2407
+ this.state_1 = 3;
2408
+ continue $sm;
2409
+ }
2410
+ case 3:
2411
+ this.r3__1 = this.this5__1.receivers_1.atomicfu$getAndIncrement$long();
2412
+ var tmp0 = this.r3__1;
2413
+ var other = get_SEGMENT_SIZE();
2414
+ var id = divide(tmp0, fromInt(other));
2415
+ var tmp_1 = this;
2416
+ var tmp0_0 = this.r3__1;
2417
+ var other_0 = get_SEGMENT_SIZE();
2418
+ tmp_1.i4__1 = convertToInt(modulo(tmp0_0, fromInt(other_0)));
2419
+ if (!(this.segment2__1.id_1 === id)) {
2420
+ var tmp0_elvis_lhs = findSegmentReceive(this.this5__1, id, this.segment2__1);
2421
+ if (tmp0_elvis_lhs == null) {
2422
+ this.state_1 = 2;
2423
+ var tmp_2 = this;
2424
+ continue $sm;
2425
+ } else {
2426
+ this.WHEN_RESULT7__1 = tmp0_elvis_lhs;
2427
+ this.state_1 = 4;
2428
+ continue $sm;
2429
+ }
2430
+ } else {
2431
+ this.state_1 = 5;
2432
+ continue $sm;
2433
+ }
2434
+ case 4:
2435
+ this.segment2__1 = this.WHEN_RESULT7__1;
2436
+ this.state_1 = 5;
2437
+ continue $sm;
2438
+ case 5:
2439
+ var updCellResult = updateCellReceive(this.this5__1, this.segment2__1, this.i4__1, this.r3__1, this.waiter6__1);
2440
+ if (updCellResult === get_SUSPEND()) {
2441
+ var tmp_3 = this;
2442
+ var tmp_4 = this.waiter6__1;
2443
+ var tmp1_safe_receiver = (!(tmp_4 == null) ? isInterface(tmp_4, Waiter()) : false) ? tmp_4 : null;
2444
+ if (tmp1_safe_receiver == null)
2445
+ null;
2446
+ else {
2447
+ prepareReceiverForSuspension(this.this5__1, tmp1_safe_receiver, this.segment2__1, this.i4__1);
2448
+ }
2449
+ this.segment2__1;
2450
+ this.i4__1;
2451
+ this.r3__1;
2452
+ var message = "unexpected";
2453
+ throw IllegalStateException_init_$Create$(toString(message));
2454
+ } else {
2455
+ if (updCellResult === get_FAILED()) {
2456
+ if (this.r3__1 < this.this5__1.get_sendersCounter_mvbt0m_k$()) {
2457
+ this.segment2__1.cleanPrev_rn0kss_k$();
2458
+ }
2459
+ this.state_1 = 2;
2460
+ var tmp_5 = this;
2461
+ continue $sm;
2462
+ } else {
2463
+ if (updCellResult === get_SUSPEND_NO_WAITER()) {
2464
+ var tmp0_1 = this.segment2__1;
2465
+ var tmp2 = this.i4__1;
2466
+ var r = this.r3__1;
2467
+ this.state_1 = 6;
2468
+ suspendResult = receiveOnNoWaiterSuspend(this._this__u8e3s4__1, tmp0_1, tmp2, r, this);
2469
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2470
+ return suspendResult;
2471
+ }
2472
+ continue $sm;
2473
+ } else {
2474
+ var tmp_6 = this;
2475
+ this.segment2__1.cleanPrev_rn0kss_k$();
2476
+ return updCellResult;
2477
+ }
2478
+ }
2479
+ }
2480
+ case 6:
2481
+ this.WHEN_RESULT1__1 = suspendResult;
2482
+ this.state_1 = 7;
2483
+ continue $sm;
2484
+ case 7:
2485
+ this.tmp$ret$00__1 = this.WHEN_RESULT1__1;
2486
+ this.state_1 = 10;
2487
+ continue $sm;
2488
+ case 8:
2489
+ throw this.exception_1;
2490
+ case 9:
2491
+ if (false) {
2492
+ this.state_1 = 1;
2493
+ continue $sm;
2494
+ }
2495
+ this.state_1 = 10;
2496
+ continue $sm;
2497
+ case 10:
2498
+ return this.tmp$ret$00__1;
2499
+ }
2500
+ } catch ($p) {
2501
+ var e = $p;
2502
+ if (this.exceptionState_1 === 8) {
2503
+ throw e;
2504
+ } else {
2505
+ this.state_1 = this.exceptionState_1;
2506
+ this.exception_1 = e;
2507
+ }
2508
+ }
2509
+ while (true);
2510
+ };
2511
+ $receiveCOROUTINE$Class = $;
2512
+ }
2513
+ return $receiveCOROUTINE$Class;
2514
+ }
2515
+ var BufferedChannelClass;
2516
+ function BufferedChannel() {
2517
+ if (BufferedChannelClass === VOID) {
2518
+ let $ = function(capacity, onUndeliveredElement) {
2519
+ onUndeliveredElement = onUndeliveredElement === VOID ? null : onUndeliveredElement;
2520
+ this.capacity_1 = capacity;
2521
+ this.onUndeliveredElement_1 = onUndeliveredElement;
2522
+ if (!(this.capacity_1 >= 0)) {
2523
+ var message = "Invalid channel capacity: " + this.capacity_1 + ", should be >=0";
2524
+ throw IllegalArgumentException_init_$Create$(toString(message));
2525
+ }
2526
+ this.sendersAndCloseStatus_1 = atomic$long$1(0n);
2527
+ this.receivers_1 = atomic$long$1(0n);
2528
+ this.bufferEnd_1 = atomic$long$1(initialBufferEnd(this.capacity_1));
2529
+ this.completedExpandBuffersAndPauseFlag_1 = atomic$long$1(_get_bufferEndCounter__2d4hee(this));
2530
+ var firstSegment = new (ChannelSegment())(0n, null, this, 3);
2531
+ this.sendSegment_1 = atomic$ref$1(firstSegment);
2532
+ this.receiveSegment_1 = atomic$ref$1(firstSegment);
2533
+ var tmp = this;
2534
+ var tmp_0;
2535
+ if (_get_isRendezvousOrUnlimited__3mdufi(this)) {
2536
+ var tmp_1 = get_NULL_SEGMENT();
2537
+ tmp_0 = tmp_1 instanceof ChannelSegment() ? tmp_1 : THROW_CCE();
2538
+ } else {
2539
+ tmp_0 = firstSegment;
2540
+ }
2541
+ tmp.bufferEndSegment_1 = atomic$ref$1(tmp_0);
2542
+ var tmp_2 = this;
2543
+ var tmp_3;
2544
+ if (this.onUndeliveredElement_1 == null) {
2545
+ tmp_3 = null;
2546
+ } else {
2547
+ tmp_3 = BufferedChannel$onUndeliveredElementReceiveCancellationConstructor$lambda(this);
2548
+ }
2549
+ tmp_2.onUndeliveredElementReceiveCancellationConstructor_1 = tmp_3;
2550
+ this._closeCause_1 = atomic$ref$1(get_NO_CLOSE_CAUSE());
2551
+ this.closeHandler_1 = atomic$ref$1(null);
2552
+ };
2553
+ initMetadataForClass($, "BufferedChannel", VOID, VOID, [SendChannel(), ReceiveChannel()], [1, 4, 0, 3]);
2554
+ protoOf($).get_sendersCounter_mvbt0m_k$ = function() {
2555
+ return this.sendersAndCloseStatus_1.kotlinx$atomicfu$value & 1152921504606846975n;
2556
+ };
2557
+ protoOf($).get_receiversCounter_ne8ics_k$ = function() {
2558
+ return this.receivers_1.kotlinx$atomicfu$value;
2559
+ };
2560
+ protoOf($).send_44jogj_k$ = function(element, $completion) {
2561
+ var tmp = new ($sendCOROUTINE$())(this, element, $completion);
2562
+ tmp.result_1 = Unit_instance;
2563
+ tmp.exception_1 = null;
2564
+ return tmp.doResume_5yljmg_k$();
2565
+ };
2566
+ protoOf($).trySend_62dpg8_k$ = function(element) {
2567
+ if (shouldSendSuspend0(this, this.sendersAndCloseStatus_1.kotlinx$atomicfu$value))
2568
+ return Companion_getInstance().failure_q0nifh_k$();
2569
+ var tmp4 = get_INTERRUPTED_SEND();
2570
+ var tmp$ret$0;
2571
+ $l$block_5: {
2572
+ var segment = access$_get_sendSegment__111kgq(this).kotlinx$atomicfu$value;
2573
+ $l$loop_0: while (true) {
2574
+ var sendersAndCloseStatusCur = access$_get_sendersAndCloseStatus__tvw29s(this).atomicfu$getAndIncrement$long();
2575
+ var s = sendersAndCloseStatusCur & 1152921504606846975n;
2576
+ var closed = access$_get_isClosedForSend0__sm8f7a(this, sendersAndCloseStatusCur);
2577
+ var other = get_SEGMENT_SIZE();
2578
+ var id = divide(s, fromInt(other));
2579
+ var other_0 = get_SEGMENT_SIZE();
2580
+ var tmp$ret$3 = modulo(s, fromInt(other_0));
2581
+ var i = convertToInt(tmp$ret$3);
2582
+ if (!(segment.id_1 === id)) {
2583
+ var tmp0_elvis_lhs = access$findSegmentSend(this, id, segment);
2584
+ var tmp;
2585
+ if (tmp0_elvis_lhs == null) {
2586
+ var tmp_0;
2587
+ if (closed) {
2588
+ tmp$ret$0 = Companion_getInstance().closed_xuwu5z_k$(this.get_sendException_qpq1ry_k$());
2589
+ break $l$block_5;
2590
+ } else {
2591
+ continue $l$loop_0;
2592
+ }
2593
+ } else {
2594
+ tmp = tmp0_elvis_lhs;
2595
+ }
2596
+ segment = tmp;
2597
+ }
2598
+ switch (access$updateCellSend(this, segment, i, element, s, tmp4, closed)) {
2599
+ case 0:
2600
+ segment.cleanPrev_rn0kss_k$();
2601
+ tmp$ret$0 = Companion_getInstance().success_tizbw6_k$(Unit_instance);
2602
+ break $l$block_5;
2603
+ case 1:
2604
+ tmp$ret$0 = Companion_getInstance().success_tizbw6_k$(Unit_instance);
2605
+ break $l$block_5;
2606
+ case 2:
2607
+ if (closed) {
2608
+ segment.onSlotCleaned_do6lqz_k$();
2609
+ tmp$ret$0 = Companion_getInstance().closed_xuwu5z_k$(this.get_sendException_qpq1ry_k$());
2610
+ break $l$block_5;
2611
+ }
2612
+ var tmp2_safe_receiver = (!(tmp4 == null) ? isInterface(tmp4, Waiter()) : false) ? tmp4 : null;
2613
+ if (tmp2_safe_receiver == null)
2614
+ null;
2615
+ else {
2616
+ access$prepareSenderForSuspension(this, tmp2_safe_receiver, segment, i);
2617
+ }
2618
+ segment.onSlotCleaned_do6lqz_k$();
2619
+ tmp$ret$0 = Companion_getInstance().failure_q0nifh_k$();
2620
+ break $l$block_5;
2621
+ case 4:
2622
+ if (s < this.get_receiversCounter_ne8ics_k$()) {
2623
+ segment.cleanPrev_rn0kss_k$();
2624
+ }
2625
+ tmp$ret$0 = Companion_getInstance().closed_xuwu5z_k$(this.get_sendException_qpq1ry_k$());
2626
+ break $l$block_5;
2627
+ case 5:
2628
+ segment.cleanPrev_rn0kss_k$();
2629
+ continue $l$loop_0;
2630
+ case 3:
2631
+ var message = "unexpected";
2632
+ throw IllegalStateException_init_$Create$(toString(message));
2633
+ }
2634
+ }
2635
+ }
2636
+ return tmp$ret$0;
2637
+ };
2638
+ protoOf($).onReceiveEnqueued_xthhlc_k$ = function() {
2639
+ };
2640
+ protoOf($).onReceiveDequeued_4w5qpk_k$ = function() {
2641
+ };
2642
+ protoOf($).receive_awoumx_k$ = function($completion) {
2643
+ var tmp = new ($receiveCOROUTINE$())(this, $completion);
2644
+ tmp.result_1 = Unit_instance;
2645
+ tmp.exception_1 = null;
2646
+ return tmp.doResume_5yljmg_k$();
2647
+ };
2648
+ protoOf($).tryReceive_y3ovg2_k$ = function() {
2649
+ var r = this.receivers_1.kotlinx$atomicfu$value;
2650
+ var sendersAndCloseStatusCur = this.sendersAndCloseStatus_1.kotlinx$atomicfu$value;
2651
+ if (_get_isClosedForReceive0__f7qknl(this, sendersAndCloseStatusCur)) {
2652
+ return Companion_getInstance().closed_xuwu5z_k$(this.get_closeCause_gbqkm2_k$());
2653
+ }
2654
+ var s = sendersAndCloseStatusCur & 1152921504606846975n;
2655
+ if (r >= s)
2656
+ return Companion_getInstance().failure_q0nifh_k$();
2657
+ var tmp2 = get_INTERRUPTED_RCV();
2658
+ var tmp$ret$1;
2659
+ $l$block_0: {
2660
+ var segment = this.receiveSegment_1.kotlinx$atomicfu$value;
2661
+ $l$loop_0: while (true) {
2662
+ if (this.get_isClosedForReceive_v0r77d_k$()) {
2663
+ tmp$ret$1 = Companion_getInstance().closed_xuwu5z_k$(this.get_closeCause_gbqkm2_k$());
2664
+ break $l$block_0;
2665
+ }
2666
+ var r_0 = this.receivers_1.atomicfu$getAndIncrement$long();
2667
+ var other = get_SEGMENT_SIZE();
2668
+ var id = divide(r_0, fromInt(other));
2669
+ var other_0 = get_SEGMENT_SIZE();
2670
+ var tmp$ret$4 = modulo(r_0, fromInt(other_0));
2671
+ var i = convertToInt(tmp$ret$4);
2672
+ if (!(segment.id_1 === id)) {
2673
+ var tmp0_elvis_lhs = findSegmentReceive(this, id, segment);
2674
+ var tmp;
2675
+ if (tmp0_elvis_lhs == null) {
2676
+ continue $l$loop_0;
2677
+ } else {
2678
+ tmp = tmp0_elvis_lhs;
2679
+ }
2680
+ segment = tmp;
2681
+ }
2682
+ var updCellResult = updateCellReceive(this, segment, i, r_0, tmp2);
2683
+ var tmp_0;
2684
+ if (updCellResult === get_SUSPEND()) {
2685
+ var tmp1_safe_receiver = (!(tmp2 == null) ? isInterface(tmp2, Waiter()) : false) ? tmp2 : null;
2686
+ if (tmp1_safe_receiver == null)
2687
+ null;
2688
+ else {
2689
+ prepareReceiverForSuspension(this, tmp1_safe_receiver, segment, i);
2690
+ }
2691
+ var segm = segment;
2692
+ this.waitExpandBufferCompletion_nil576_k$(r_0);
2693
+ segm.onSlotCleaned_do6lqz_k$();
2694
+ tmp_0 = new (ChannelResult())(Companion_getInstance().failure_q0nifh_k$());
2695
+ } else if (updCellResult === get_FAILED()) {
2696
+ if (r_0 < this.get_sendersCounter_mvbt0m_k$()) {
2697
+ segment.cleanPrev_rn0kss_k$();
2698
+ }
2699
+ continue $l$loop_0;
2700
+ } else if (updCellResult === get_SUSPEND_NO_WAITER()) {
2701
+ var message = "unexpected";
2702
+ throw IllegalStateException_init_$Create$(toString(message));
2703
+ } else {
2704
+ segment.cleanPrev_rn0kss_k$();
2705
+ tmp_0 = new (ChannelResult())(Companion_getInstance().success_tizbw6_k$(updCellResult));
2706
+ }
2707
+ tmp$ret$1 = tmp_0.holder_1;
2708
+ break $l$block_0;
2709
+ }
2710
+ }
2711
+ return tmp$ret$1;
2712
+ };
2713
+ protoOf($).dropFirstElementUntilTheSpecifiedCellIsInTheBuffer_l7hcju_k$ = function(globalCellIndex) {
2714
+ var segment = this.receiveSegment_1.kotlinx$atomicfu$value;
2715
+ $l$loop_0: while (true) {
2716
+ var r = this.receivers_1.kotlinx$atomicfu$value;
2717
+ var other = this.capacity_1;
2718
+ var tmp0 = add(r, fromInt(other));
2719
+ var b = _get_bufferEndCounter__2d4hee(this);
2720
+ if (globalCellIndex < (tmp0 >= b ? tmp0 : b))
2721
+ return Unit_instance;
2722
+ var tmp$ret$3 = add(r, fromInt(1));
2723
+ if (!this.receivers_1.atomicfu$compareAndSet(r, tmp$ret$3))
2724
+ continue $l$loop_0;
2725
+ var other_0 = get_SEGMENT_SIZE();
2726
+ var id = divide(r, fromInt(other_0));
2727
+ var other_1 = get_SEGMENT_SIZE();
2728
+ var tmp$ret$5 = modulo(r, fromInt(other_1));
2729
+ var i = convertToInt(tmp$ret$5);
2730
+ if (!(segment.id_1 === id)) {
2731
+ var tmp0_elvis_lhs = findSegmentReceive(this, id, segment);
2732
+ var tmp;
2733
+ if (tmp0_elvis_lhs == null) {
2734
+ continue $l$loop_0;
2735
+ } else {
2736
+ tmp = tmp0_elvis_lhs;
2737
+ }
2738
+ segment = tmp;
2739
+ }
2740
+ var updCellResult = updateCellReceive(this, segment, i, r, null);
2741
+ if (updCellResult === get_FAILED()) {
2742
+ if (r < this.get_sendersCounter_mvbt0m_k$()) {
2743
+ segment.cleanPrev_rn0kss_k$();
2744
+ }
2745
+ } else {
2746
+ segment.cleanPrev_rn0kss_k$();
2747
+ var tmp1_safe_receiver = this.onUndeliveredElement_1;
2748
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : callUndeliveredElementCatchingException(tmp1_safe_receiver, updCellResult);
2749
+ if (tmp2_safe_receiver == null)
2750
+ null;
2751
+ else {
2752
+ throw tmp2_safe_receiver;
2753
+ }
2754
+ }
2755
+ }
2756
+ };
2757
+ protoOf($).waitExpandBufferCompletion_nil576_k$ = function(globalIndex) {
2758
+ if (_get_isRendezvousOrUnlimited__3mdufi(this))
2759
+ return Unit_instance;
2760
+ while (_get_bufferEndCounter__2d4hee(this) <= globalIndex) {
2761
+ }
2762
+ var times = get_EXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS();
2763
+ var inductionVariable = 0;
2764
+ if (inductionVariable < times)
2765
+ do {
2766
+ var index = inductionVariable;
2767
+ inductionVariable = inductionVariable + 1 | 0;
2768
+ var b = _get_bufferEndCounter__2d4hee(this);
2769
+ var ebCompleted = this.completedExpandBuffersAndPauseFlag_1.kotlinx$atomicfu$value & 4611686018427387903n;
2770
+ if (b === ebCompleted && b === _get_bufferEndCounter__2d4hee(this))
2771
+ return Unit_instance;
2772
+ } while (inductionVariable < times);
2773
+ var tmp0 = this.completedExpandBuffersAndPauseFlag_1;
2774
+ $l$block: {
2775
+ while (true) {
2776
+ var cur = tmp0.kotlinx$atomicfu$value;
2777
+ var tmp$ret$5 = cur & 4611686018427387903n;
2778
+ var upd = constructEBCompletedAndPauseFlag(tmp$ret$5, true);
2779
+ if (tmp0.atomicfu$compareAndSet(cur, upd)) {
2780
+ break $l$block;
2781
+ }
2782
+ }
2783
+ }
2784
+ while (true) {
2785
+ var b_0 = _get_bufferEndCounter__2d4hee(this);
2786
+ var ebCompletedAndBit = this.completedExpandBuffersAndPauseFlag_1.kotlinx$atomicfu$value;
2787
+ var ebCompleted_0 = ebCompletedAndBit & 4611686018427387903n;
2788
+ var pauseExpandBuffers = !((ebCompletedAndBit & 4611686018427387904n) === 0n);
2789
+ if (b_0 === ebCompleted_0 && b_0 === _get_bufferEndCounter__2d4hee(this)) {
2790
+ var tmp0_0 = this.completedExpandBuffersAndPauseFlag_1;
2791
+ $l$block_0: {
2792
+ while (true) {
2793
+ var cur_0 = tmp0_0.kotlinx$atomicfu$value;
2794
+ var tmp$ret$10 = cur_0 & 4611686018427387903n;
2795
+ var upd_0 = constructEBCompletedAndPauseFlag(tmp$ret$10, false);
2796
+ if (tmp0_0.atomicfu$compareAndSet(cur_0, upd_0)) {
2797
+ break $l$block_0;
2798
+ }
2799
+ }
2800
+ }
2801
+ return Unit_instance;
2802
+ }
2803
+ if (!pauseExpandBuffers) {
2804
+ this.completedExpandBuffersAndPauseFlag_1.atomicfu$compareAndSet(ebCompletedAndBit, constructEBCompletedAndPauseFlag(ebCompleted_0, true));
2805
+ }
2806
+ }
2807
+ };
2808
+ protoOf($).get_onReceive_mimw11_k$ = function() {
2809
+ var tmp = BufferedChannel$registerSelectForReceive$ref();
2810
+ var tmp_0 = typeof tmp === "function" ? tmp : THROW_CCE();
2811
+ var tmp_1 = BufferedChannel$processResultSelectReceive$ref();
2812
+ return new (SelectClause1Impl())(this, tmp_0, typeof tmp_1 === "function" ? tmp_1 : THROW_CCE(), this.onUndeliveredElementReceiveCancellationConstructor_1);
2813
+ };
2814
+ protoOf($).iterator_jk1svi_k$ = function() {
2815
+ return new (BufferedChannelIterator())(this);
2816
+ };
2817
+ protoOf($).get_closeCause_gbqkm2_k$ = function() {
2818
+ var tmp = this._closeCause_1.kotlinx$atomicfu$value;
2819
+ return (tmp == null ? true : tmp instanceof Error) ? tmp : THROW_CCE();
2820
+ };
2821
+ protoOf($).get_sendException_qpq1ry_k$ = function() {
2822
+ var tmp0_elvis_lhs = this.get_closeCause_gbqkm2_k$();
2823
+ return tmp0_elvis_lhs == null ? new (ClosedSendChannelException())("Channel was closed") : tmp0_elvis_lhs;
2824
+ };
2825
+ protoOf($).onClosedIdempotent_yws25w_k$ = function() {
2826
+ };
2827
+ protoOf($).close_ukldxa_k$ = function(cause) {
2828
+ return this.closeOrCancelImpl_46q3uk_k$(cause, false);
2829
+ };
2830
+ protoOf($).cancel_hkmm2i_k$ = function(cause) {
2831
+ this.cancelImpl_1ciz43_k$(cause);
2832
+ };
2833
+ protoOf($).cancelImpl_1ciz43_k$ = function(cause) {
2834
+ return this.closeOrCancelImpl_46q3uk_k$(cause == null ? CancellationException_init_$Create$("Channel was cancelled") : cause, true);
2835
+ };
2836
+ protoOf($).closeOrCancelImpl_46q3uk_k$ = function(cause, cancel) {
2837
+ if (cancel) {
2838
+ markCancellationStarted(this);
2839
+ }
2840
+ var closedByThisOperation = this._closeCause_1.atomicfu$compareAndSet(get_NO_CLOSE_CAUSE(), cause);
2841
+ if (cancel) {
2842
+ markCancelled(this);
2843
+ } else {
2844
+ markClosed(this);
2845
+ }
2846
+ completeCloseOrCancel(this);
2847
+ this.onClosedIdempotent_yws25w_k$();
2848
+ if (closedByThisOperation) {
2849
+ invokeCloseHandler(this);
2850
+ }
2851
+ return closedByThisOperation;
2852
+ };
2853
+ protoOf($).get_isConflatedDropOldest_qp2q39_k$ = function() {
2854
+ return false;
2855
+ };
2856
+ protoOf($).get_isClosedForSend_ajczci_k$ = function() {
2857
+ return _get_isClosedForSend0__kxgf9m(this, this.sendersAndCloseStatus_1.kotlinx$atomicfu$value);
2858
+ };
2859
+ protoOf($).get_isClosedForReceive_v0r77d_k$ = function() {
2860
+ return _get_isClosedForReceive0__f7qknl(this, this.sendersAndCloseStatus_1.kotlinx$atomicfu$value);
2861
+ };
2862
+ protoOf($).hasElements_2busqs_k$ = function() {
2863
+ $l$loop: while (true) {
2864
+ var segment = this.receiveSegment_1.kotlinx$atomicfu$value;
2865
+ var r = this.get_receiversCounter_ne8ics_k$();
2866
+ var s = this.get_sendersCounter_mvbt0m_k$();
2867
+ if (s <= r)
2868
+ return false;
2869
+ var other = get_SEGMENT_SIZE();
2870
+ var id = divide(r, fromInt(other));
2871
+ if (!(segment.id_1 === id)) {
2872
+ var tmp0_elvis_lhs = findSegmentReceive(this, id, segment);
2873
+ var tmp;
2874
+ if (tmp0_elvis_lhs == null) {
2875
+ var tmp_0;
2876
+ if (this.receiveSegment_1.kotlinx$atomicfu$value.id_1 < id) {
2877
+ return false;
2878
+ } else {
2879
+ continue $l$loop;
2880
+ }
2881
+ } else {
2882
+ tmp = tmp0_elvis_lhs;
2883
+ }
2884
+ segment = tmp;
2885
+ }
2886
+ segment.cleanPrev_rn0kss_k$();
2887
+ var other_0 = get_SEGMENT_SIZE();
2888
+ var tmp$ret$1 = modulo(r, fromInt(other_0));
2889
+ var i = convertToInt(tmp$ret$1);
2890
+ if (isCellNonEmpty(this, segment, i, r))
2891
+ return true;
2892
+ var tmp$ret$2 = add(r, fromInt(1));
2893
+ this.receivers_1.atomicfu$compareAndSet(r, tmp$ret$2);
2894
+ }
2895
+ };
2896
+ protoOf($).toString = function() {
2897
+ var sb = StringBuilder_init_$Create$();
2898
+ var this_0 = this.sendersAndCloseStatus_1.kotlinx$atomicfu$value;
2899
+ var tmp0_subject = convertToInt(shiftRight(this_0, 60));
2900
+ if (tmp0_subject === 2) {
2901
+ sb.append_22ad7x_k$("closed,");
2902
+ } else if (tmp0_subject === 3) {
2903
+ sb.append_22ad7x_k$("cancelled,");
2904
+ }
2905
+ sb.append_22ad7x_k$("capacity=" + this.capacity_1 + ",");
2906
+ sb.append_22ad7x_k$("data=[");
2907
+ var tmp0 = listOf([this.receiveSegment_1.kotlinx$atomicfu$value, this.sendSegment_1.kotlinx$atomicfu$value, this.bufferEndSegment_1.kotlinx$atomicfu$value]);
2908
+ var destination = ArrayList_init_$Create$();
2909
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
2910
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2911
+ var element = _iterator__ex2g4s.next_20eer_k$();
2912
+ if (!(element === get_NULL_SEGMENT())) {
2913
+ destination.add_utx5q5_k$(element);
2914
+ }
2915
+ }
2916
+ var tmp$ret$4;
2917
+ $l$block: {
2918
+ var iterator = destination.iterator_jk1svi_k$();
2919
+ if (!iterator.hasNext_bitz1p_k$())
2920
+ throw NoSuchElementException_init_$Create$();
2921
+ var minElem = iterator.next_20eer_k$();
2922
+ if (!iterator.hasNext_bitz1p_k$()) {
2923
+ tmp$ret$4 = minElem;
2924
+ break $l$block;
2925
+ }
2926
+ var minValue = minElem.id_1;
2927
+ do {
2928
+ var e = iterator.next_20eer_k$();
2929
+ var v = e.id_1;
2930
+ if (compareTo(minValue, v) > 0) {
2931
+ minElem = e;
2932
+ minValue = v;
2933
+ }
2934
+ } while (iterator.hasNext_bitz1p_k$());
2935
+ tmp$ret$4 = minElem;
2936
+ }
2937
+ var firstSegment = tmp$ret$4;
2938
+ var r = this.get_receiversCounter_ne8ics_k$();
2939
+ var s = this.get_sendersCounter_mvbt0m_k$();
2940
+ var segment = firstSegment;
2941
+ append_elements: while (true) {
2942
+ var inductionVariable = 0;
2943
+ var last_0 = get_SEGMENT_SIZE();
2944
+ if (inductionVariable < last_0)
2945
+ process_cell: do {
2946
+ var i = inductionVariable;
2947
+ inductionVariable = inductionVariable + 1 | 0;
2948
+ var tmp0_0 = segment.id_1;
2949
+ var other = get_SEGMENT_SIZE();
2950
+ var this_1 = multiply(tmp0_0, fromInt(other));
2951
+ var globalCellIndex = add(this_1, fromInt(i));
2952
+ if (globalCellIndex >= s && globalCellIndex >= r)
2953
+ break append_elements;
2954
+ var cellState = segment.getState_jak5mi_k$(i);
2955
+ var element_0 = segment.getElement_ye1phr_k$(i);
2956
+ var tmp;
2957
+ if (!(cellState == null) ? isInterface(cellState, CancellableContinuation()) : false) {
2958
+ tmp = (s <= globalCellIndex ? globalCellIndex < r : false) ? "receive" : (r <= globalCellIndex ? globalCellIndex < s : false) ? "send" : "cont";
2959
+ } else {
2960
+ if (!(cellState == null) ? isInterface(cellState, SelectInstance()) : false) {
2961
+ tmp = (s <= globalCellIndex ? globalCellIndex < r : false) ? "onReceive" : (r <= globalCellIndex ? globalCellIndex < s : false) ? "onSend" : "select";
2962
+ } else {
2963
+ if (cellState instanceof ReceiveCatching()) {
2964
+ tmp = "receiveCatching";
2965
+ } else {
2966
+ if (cellState instanceof SendBroadcast()) {
2967
+ tmp = "sendBroadcast";
2968
+ } else {
2969
+ if (cellState instanceof WaiterEB()) {
2970
+ tmp = "EB(" + cellState.toString() + ")";
2971
+ } else {
2972
+ if (equals(cellState, get_RESUMING_BY_RCV()) || equals(cellState, get_RESUMING_BY_EB())) {
2973
+ tmp = "resuming_sender";
2974
+ } else {
2975
+ if (cellState == null || (equals(cellState, get_IN_BUFFER()) || equals(cellState, get_DONE_RCV())) || (equals(cellState, get_POISONED()) || equals(cellState, get_INTERRUPTED_RCV()) || (equals(cellState, get_INTERRUPTED_SEND()) || equals(cellState, get_CHANNEL_CLOSED())))) {
2976
+ continue process_cell;
2977
+ } else {
2978
+ tmp = toString(cellState);
2979
+ }
2980
+ }
2981
+ }
2982
+ }
2983
+ }
2984
+ }
2985
+ }
2986
+ var cellStateString = tmp;
2987
+ if (!(element_0 == null)) {
2988
+ sb.append_22ad7x_k$("(" + cellStateString + "," + toString(element_0) + "),");
2989
+ } else {
2990
+ sb.append_22ad7x_k$(cellStateString + ",");
2991
+ }
2992
+ } while (inductionVariable < last_0);
2993
+ var tmp4_elvis_lhs = segment.get_next_wor1vg_k$();
2994
+ var tmp_0;
2995
+ if (tmp4_elvis_lhs == null) {
2996
+ break append_elements;
2997
+ } else {
2998
+ tmp_0 = tmp4_elvis_lhs;
2999
+ }
3000
+ segment = tmp_0;
3001
+ }
3002
+ if (last(sb) === _Char___init__impl__6a9atx(44)) {
3003
+ sb.deleteAt_mq1vvq_k$(sb.get_length_g42xv3_k$() - 1 | 0);
3004
+ }
3005
+ sb.append_22ad7x_k$("]");
3006
+ return sb.toString();
3007
+ };
3008
+ protoOf($).close$default_kcbl7u_k$ = close$default;
3009
+ protoOf($).cancel$default_880p35_k$ = cancel$default;
3010
+ BufferedChannelClass = $;
3011
+ }
3012
+ return BufferedChannelClass;
3013
+ }
3014
+ var WaiterEBClass;
3015
+ function WaiterEB() {
3016
+ if (WaiterEBClass === VOID) {
3017
+ let $ = function(waiter) {
3018
+ this.waiter_1 = waiter;
3019
+ };
3020
+ initMetadataForClass($, "WaiterEB");
3021
+ protoOf($).toString = function() {
3022
+ return "WaiterEB(" + toString(this.waiter_1) + ")";
3023
+ };
3024
+ WaiterEBClass = $;
3025
+ }
3026
+ return WaiterEBClass;
3027
+ }
3028
+ function initialBufferEnd(capacity) {
3029
+ _init_properties_BufferedChannel_kt__d6uc4y();
3030
+ switch (capacity) {
3031
+ case 0:
3032
+ return 0n;
3033
+ case 2147483647:
3034
+ return 9223372036854775807n;
3035
+ default:
3036
+ return fromInt(capacity);
3037
+ }
3038
+ }
3039
+ var ReceiveCatchingClass;
3040
+ function ReceiveCatching() {
3041
+ if (ReceiveCatchingClass === VOID) {
3042
+ let $ = function() {
3043
+ };
3044
+ initMetadataForClass($, "ReceiveCatching", VOID, VOID, [Waiter()]);
3045
+ ReceiveCatchingClass = $;
3046
+ }
3047
+ return ReceiveCatchingClass;
3048
+ }
3049
+ function tryResume0(_this__u8e3s4, value, onCancellation) {
3050
+ onCancellation = onCancellation === VOID ? null : onCancellation;
3051
+ _init_properties_BufferedChannel_kt__d6uc4y();
3052
+ var token = _this__u8e3s4.tryResume_gmd8sc_k$(value, null, onCancellation);
3053
+ var tmp;
3054
+ if (!(token == null)) {
3055
+ _this__u8e3s4.completeResume_fabtk_k$(token);
3056
+ tmp = true;
3057
+ } else {
3058
+ tmp = false;
3059
+ }
3060
+ return tmp;
3061
+ }
3062
+ function constructEBCompletedAndPauseFlag(counter, pauseEB) {
3063
+ _init_properties_BufferedChannel_kt__d6uc4y();
3064
+ return add(pauseEB ? 4611686018427387904n : 0n, counter);
3065
+ }
3066
+ function constructSendersAndCloseStatus(counter, closeStatus) {
3067
+ _init_properties_BufferedChannel_kt__d6uc4y();
3068
+ return add(shiftLeft(fromInt(closeStatus), 60), counter);
3069
+ }
3070
+ function createSegmentFunction() {
3071
+ _init_properties_BufferedChannel_kt__d6uc4y();
3072
+ return createSegment$ref();
3073
+ }
3074
+ function createSegment(id, prev) {
3075
+ _init_properties_BufferedChannel_kt__d6uc4y();
3076
+ return new (ChannelSegment())(id, prev, prev.get_channel_dhi7tm_k$(), 0);
3077
+ }
3078
+ function createSegment$ref() {
3079
+ return constructCallableReference(function(p0, p1) {
3080
+ return createSegment(p0, p1);
3081
+ }, 2, 0, 8, "createSegment");
3082
+ }
3083
+ var properties_initialized_BufferedChannel_kt_58tjvw;
3084
+ function _init_properties_BufferedChannel_kt__d6uc4y() {
3085
+ if (!properties_initialized_BufferedChannel_kt_58tjvw) {
3086
+ properties_initialized_BufferedChannel_kt_58tjvw = true;
3087
+ NULL_SEGMENT = new (ChannelSegment())(-1n, null, null, 0);
3088
+ SEGMENT_SIZE = systemProp("kotlinx.coroutines.bufferedChannel.segmentSize", 32);
3089
+ EXPAND_BUFFER_COMPLETION_WAIT_ITERATIONS = systemProp("kotlinx.coroutines.bufferedChannel.expandBufferCompletionWaitIterations", 1e4);
3090
+ BUFFERED = new (Symbol())("BUFFERED");
3091
+ IN_BUFFER = new (Symbol())("SHOULD_BUFFER");
3092
+ RESUMING_BY_RCV = new (Symbol())("S_RESUMING_BY_RCV");
3093
+ RESUMING_BY_EB = new (Symbol())("RESUMING_BY_EB");
3094
+ POISONED = new (Symbol())("POISONED");
3095
+ DONE_RCV = new (Symbol())("DONE_RCV");
3096
+ INTERRUPTED_SEND = new (Symbol())("INTERRUPTED_SEND");
3097
+ INTERRUPTED_RCV = new (Symbol())("INTERRUPTED_RCV");
3098
+ CHANNEL_CLOSED = new (Symbol())("CHANNEL_CLOSED");
3099
+ SUSPEND = new (Symbol())("SUSPEND");
3100
+ SUSPEND_NO_WAITER = new (Symbol())("SUSPEND_NO_WAITER");
3101
+ FAILED = new (Symbol())("FAILED");
3102
+ NO_RECEIVE_RESULT = new (Symbol())("NO_RECEIVE_RESULT");
3103
+ CLOSE_HANDLER_CLOSED = new (Symbol())("CLOSE_HANDLER_CLOSED");
3104
+ CLOSE_HANDLER_INVOKED = new (Symbol())("CLOSE_HANDLER_INVOKED");
3105
+ NO_CLOSE_CAUSE = new (Symbol())("NO_CLOSE_CAUSE");
3106
+ }
3107
+ }
3108
+
3109
+ // build/packages/js/kotlinx-coroutines-core/kotlinx/coroutines/channels/ConflatedBufferedChannel.mjs
3110
+ import {
3111
+ BufferOverflow_DROP_LATEST_getInstancemfonw00bpn5q as BufferOverflow_DROP_LATEST_getInstance,
3112
+ BufferOverflow_SUSPEND_getInstance1ucmryz5dsuc2 as BufferOverflow_SUSPEND_getInstance,
3113
+ BufferOverflow_DROP_OLDEST_getInstance2xuwx7fze5aij as BufferOverflow_DROP_OLDEST_getInstance
3114
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferOverflow.mjs";
3115
+ import {
3116
+ protoOf180f3jzyo7rfj as protoOf2,
3117
+ toString1pkumu07cwy4m as toString2
3118
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
3119
+ import { callUndeliveredElementCatchingException6xwxmojd3rq1 as callUndeliveredElementCatchingException2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/OnUndeliveredElement.mjs";
3120
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance2 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
3121
+ import {
3122
+ fromInt2ii0rejb1w62w as fromInt2,
3123
+ dividelr0uqtdj497z as divide2,
3124
+ modulooi4g1kq3dmtt as modulo2,
3125
+ convertToInty04h231mmjoh as convertToInt2,
3126
+ multiply2k9eolhnz1bjv as multiply2,
3127
+ add2suhfggl4zvkk as add2
3128
+ } from "../kotlin-kotlin-stdlib/kotlin/js/internal/longAsBigInt/longAsBigInt.mjs";
3129
+ import { Waiter3lxa2a79zyo0g as Waiter2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/Waiter.mjs";
3130
+ import { isInterface3d6p8outrmvmk as isInterface2 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
3131
+ import {
3132
+ IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$2,
3133
+ IllegalArgumentException_init_$Create$1gox8sdqs91jy as IllegalArgumentException_init_$Create$2
3134
+ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
3135
+ import { VOID3gxj6tk5isa35 as VOID2 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
3136
+ import { getKClass3t8tygqu4lcxf as getKClass } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
3137
+ import { addSuppressedu5jwjfvsc039 as addSuppressed2 } from "../kotlin-kotlin-stdlib/kotlin/throwableExtensions.mjs";
3138
+ import { initMetadataForClassbxx6q50dy2s7 as initMetadataForClass2 } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
3139
+ function trySendImpl($this, element, isSendOp) {
3140
+ return $this.onBufferOverflow_1 === BufferOverflow_DROP_LATEST_getInstance() ? trySendDropLatest($this, element, isSendOp) : trySendDropOldest($this, element);
3141
+ }
3142
+ function trySendDropLatest($this, element, isSendOp) {
3143
+ var result = protoOf2(BufferedChannel()).trySend_62dpg8_k$.call($this, element);
3144
+ if (_ChannelResult___get_isSuccess__impl__odq1z9(result) || _ChannelResult___get_isClosed__impl__mg7kuu(result))
3145
+ return result;
3146
+ if (isSendOp) {
3147
+ var tmp0_safe_receiver = $this.onUndeliveredElement_1;
3148
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : callUndeliveredElementCatchingException2(tmp0_safe_receiver, element);
3149
+ if (tmp1_safe_receiver == null)
3150
+ null;
3151
+ else {
3152
+ throw tmp1_safe_receiver;
3153
+ }
3154
+ }
3155
+ return Companion_getInstance().success_tizbw6_k$(Unit_instance2);
3156
+ }
3157
+ function trySendDropOldest($this, element) {
3158
+ var tmp4 = get_BUFFERED();
3159
+ var tmp$ret$0;
3160
+ $l$block_5: {
3161
+ var segment = access$_get_sendSegment__111kgq($this).kotlinx$atomicfu$value;
3162
+ $l$loop_0: while (true) {
3163
+ var sendersAndCloseStatusCur = access$_get_sendersAndCloseStatus__tvw29s($this).atomicfu$getAndIncrement$long();
3164
+ var s = sendersAndCloseStatusCur & 1152921504606846975n;
3165
+ var closed = access$_get_isClosedForSend0__sm8f7a($this, sendersAndCloseStatusCur);
3166
+ var other = get_SEGMENT_SIZE();
3167
+ var id = divide2(s, fromInt2(other));
3168
+ var other_0 = get_SEGMENT_SIZE();
3169
+ var tmp$ret$3 = modulo2(s, fromInt2(other_0));
3170
+ var i = convertToInt2(tmp$ret$3);
3171
+ if (!(segment.id_1 === id)) {
3172
+ var tmp0_elvis_lhs = access$findSegmentSend($this, id, segment);
3173
+ var tmp;
3174
+ if (tmp0_elvis_lhs == null) {
3175
+ var tmp_0;
3176
+ if (closed) {
3177
+ return Companion_getInstance().closed_xuwu5z_k$($this.get_sendException_qpq1ry_k$());
3178
+ } else {
3179
+ continue $l$loop_0;
3180
+ }
3181
+ } else {
3182
+ tmp = tmp0_elvis_lhs;
3183
+ }
3184
+ segment = tmp;
3185
+ }
3186
+ switch (access$updateCellSend($this, segment, i, element, s, tmp4, closed)) {
3187
+ case 0:
3188
+ segment.cleanPrev_rn0kss_k$();
3189
+ return Companion_getInstance().success_tizbw6_k$(Unit_instance2);
3190
+ case 1:
3191
+ return Companion_getInstance().success_tizbw6_k$(Unit_instance2);
3192
+ case 2:
3193
+ if (closed) {
3194
+ segment.onSlotCleaned_do6lqz_k$();
3195
+ return Companion_getInstance().closed_xuwu5z_k$($this.get_sendException_qpq1ry_k$());
3196
+ }
3197
+ var tmp2_safe_receiver = (!(tmp4 == null) ? isInterface2(tmp4, Waiter2()) : false) ? tmp4 : null;
3198
+ if (tmp2_safe_receiver == null)
3199
+ null;
3200
+ else {
3201
+ access$prepareSenderForSuspension($this, tmp2_safe_receiver, segment, i);
3202
+ }
3203
+ var tmp0 = segment.id_1;
3204
+ var other_1 = get_SEGMENT_SIZE();
3205
+ var this_0 = multiply2(tmp0, fromInt2(other_1));
3206
+ var tmp$ret$10 = add2(this_0, fromInt2(i));
3207
+ $this.dropFirstElementUntilTheSpecifiedCellIsInTheBuffer_l7hcju_k$(tmp$ret$10);
3208
+ return Companion_getInstance().success_tizbw6_k$(Unit_instance2);
3209
+ case 4:
3210
+ if (s < $this.get_receiversCounter_ne8ics_k$()) {
3211
+ segment.cleanPrev_rn0kss_k$();
3212
+ }
3213
+ return Companion_getInstance().closed_xuwu5z_k$($this.get_sendException_qpq1ry_k$());
3214
+ case 5:
3215
+ segment.cleanPrev_rn0kss_k$();
3216
+ continue $l$loop_0;
3217
+ case 3:
3218
+ var message = "unexpected";
3219
+ throw IllegalStateException_init_$Create$2(toString2(message));
3220
+ }
3221
+ }
3222
+ }
3223
+ return tmp$ret$0;
3224
+ }
3225
+ var ConflatedBufferedChannelClass;
3226
+ function ConflatedBufferedChannel() {
3227
+ if (ConflatedBufferedChannelClass === VOID2) {
3228
+ let $ = function(capacity, onBufferOverflow, onUndeliveredElement) {
3229
+ onUndeliveredElement = onUndeliveredElement === VOID2 ? null : onUndeliveredElement;
3230
+ BufferedChannel().call(this, capacity, onUndeliveredElement);
3231
+ this.capacity_2 = capacity;
3232
+ this.onBufferOverflow_1 = onBufferOverflow;
3233
+ if (!!(this.onBufferOverflow_1 === BufferOverflow_SUSPEND_getInstance())) {
3234
+ var message = "This implementation does not support suspension for senders, use " + getKClass(BufferedChannel()).get_simpleName_r6f8py_k$() + " instead";
3235
+ throw IllegalArgumentException_init_$Create$2(toString2(message));
3236
+ }
3237
+ if (!(this.capacity_2 >= 1)) {
3238
+ var message_0 = "Buffered channel capacity must be at least 1, but " + this.capacity_2 + " was specified";
3239
+ throw IllegalArgumentException_init_$Create$2(toString2(message_0));
3240
+ }
3241
+ };
3242
+ initMetadataForClass2($, "ConflatedBufferedChannel", VOID2, BufferedChannel(), VOID2, [1, 0]);
3243
+ protoOf2($).get_isConflatedDropOldest_qp2q39_k$ = function() {
3244
+ return this.onBufferOverflow_1.equals(BufferOverflow_DROP_OLDEST_getInstance());
3245
+ };
3246
+ protoOf2($).send_44jogj_k$ = function(element, $completion) {
3247
+ var this_0 = trySendImpl(this, element, true);
3248
+ var tmp = _ChannelResult___get_holder__impl__pm9gzw(this_0);
3249
+ if (tmp instanceof Closed()) {
3250
+ ChannelResult__exceptionOrNull_impl_16ei30(this_0);
3251
+ var tmp0_safe_receiver = this.onUndeliveredElement_1;
3252
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : callUndeliveredElementCatchingException2(tmp0_safe_receiver, element);
3253
+ if (tmp1_safe_receiver == null)
3254
+ null;
3255
+ else {
3256
+ addSuppressed2(tmp1_safe_receiver, this.get_sendException_qpq1ry_k$());
3257
+ throw tmp1_safe_receiver;
3258
+ }
3259
+ throw this.get_sendException_qpq1ry_k$();
3260
+ }
3261
+ return Unit_instance2;
3262
+ };
3263
+ protoOf2($).trySend_62dpg8_k$ = function(element) {
3264
+ return trySendImpl(this, element, false);
3265
+ };
3266
+ ConflatedBufferedChannelClass = $;
3267
+ }
3268
+ return ConflatedBufferedChannelClass;
3269
+ }
3270
+
3271
+ // build/packages/js/kotlinx-coroutines-core/kotlinx/coroutines/channels/Channel.mjs
3272
+ import { systemProp2qpti4y1f5b4b as systemProp2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/internal/SystemProps.common.mjs";
3273
+ import {
3274
+ protoOf180f3jzyo7rfj as protoOf3,
3275
+ toString1pkumu07cwy4m as toString3,
3276
+ equals2au1ep9vhcato as equals2,
3277
+ hashCodeq5arwsb9dgti as hashCode,
3278
+ captureStack1fzi4aczwc4hg as captureStack
3279
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
3280
+ import {
3281
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
3282
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass3,
3283
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
3284
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface
3285
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
3286
+ import { VOID3gxj6tk5isa35 as VOID3 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
3287
+ import {
3288
+ BufferOverflow_SUSPEND_getInstance1ucmryz5dsuc2 as BufferOverflow_SUSPEND_getInstance2,
3289
+ BufferOverflow_DROP_OLDEST_getInstance2xuwx7fze5aij as BufferOverflow_DROP_OLDEST_getInstance2
3290
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferOverflow.mjs";
3291
+ import {
3292
+ IllegalArgumentException_init_$Create$1gox8sdqs91jy as IllegalArgumentException_init_$Create$3,
3293
+ NoSuchElementException679xzhnp5bpj as NoSuchElementException,
3294
+ NoSuchElementException_init_$Init$19qwecry5mobn as NoSuchElementException_init_$Init$,
3295
+ IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
3296
+ IllegalStateException_init_$Init$2lydy6bjiiso9 as IllegalStateException_init_$Init$
3297
+ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
3298
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance3 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
3299
+ import { toString30pk9tzaqopn as toString_02 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
3300
+ var FactoryClass;
3301
+ function Factory() {
3302
+ if (FactoryClass === VOID3) {
3303
+ let $ = function() {
3304
+ Factory_instance = this;
3305
+ this.UNLIMITED_1 = 2147483647;
3306
+ this.RENDEZVOUS_1 = 0;
3307
+ this.CONFLATED_1 = -1;
3308
+ this.BUFFERED_1 = -2;
3309
+ this.OPTIONAL_CHANNEL_1 = -3;
3310
+ this.DEFAULT_BUFFER_PROPERTY_NAME_1 = "kotlinx.coroutines.channels.defaultBuffer";
3311
+ this.CHANNEL_DEFAULT_CAPACITY_1 = systemProp2("kotlinx.coroutines.channels.defaultBuffer", 64, 1, 2147483646);
3312
+ };
3313
+ initMetadataForObject($, "Factory");
3314
+ FactoryClass = $;
3315
+ }
3316
+ return FactoryClass;
3317
+ }
3318
+ var Factory_instance;
3319
+ function Factory_getInstance() {
3320
+ if (Factory_instance == null)
3321
+ new (Factory())();
3322
+ return Factory_instance;
3323
+ }
3324
+ function Channel(capacity, onBufferOverflow, onUndeliveredElement) {
3325
+ capacity = capacity === VOID3 ? 0 : capacity;
3326
+ onBufferOverflow = onBufferOverflow === VOID3 ? BufferOverflow_SUSPEND_getInstance2() : onBufferOverflow;
3327
+ onUndeliveredElement = onUndeliveredElement === VOID3 ? null : onUndeliveredElement;
3328
+ var tmp;
3329
+ switch (capacity) {
3330
+ case 0:
3331
+ tmp = onBufferOverflow.equals(BufferOverflow_SUSPEND_getInstance2()) ? new (BufferedChannel())(0, onUndeliveredElement) : new (ConflatedBufferedChannel())(1, onBufferOverflow, onUndeliveredElement);
3332
+ break;
3333
+ case -1:
3334
+ if (!onBufferOverflow.equals(BufferOverflow_SUSPEND_getInstance2())) {
3335
+ var message = "CONFLATED capacity cannot be used with non-default onBufferOverflow";
3336
+ throw IllegalArgumentException_init_$Create$3(toString3(message));
3337
+ }
3338
+ tmp = new (ConflatedBufferedChannel())(1, BufferOverflow_DROP_OLDEST_getInstance2(), onUndeliveredElement);
3339
+ break;
3340
+ case 2147483647:
3341
+ tmp = new (BufferedChannel())(2147483647, onUndeliveredElement);
3342
+ break;
3343
+ case -2:
3344
+ tmp = onBufferOverflow.equals(BufferOverflow_SUSPEND_getInstance2()) ? new (BufferedChannel())(Factory_getInstance().CHANNEL_DEFAULT_CAPACITY_1, onUndeliveredElement) : new (ConflatedBufferedChannel())(1, onBufferOverflow, onUndeliveredElement);
3345
+ break;
3346
+ default:
3347
+ tmp = onBufferOverflow === BufferOverflow_SUSPEND_getInstance2() ? new (BufferedChannel())(capacity, onUndeliveredElement) : new (ConflatedBufferedChannel())(capacity, onBufferOverflow, onUndeliveredElement);
3348
+ break;
3349
+ }
3350
+ return tmp;
3351
+ }
3352
+ function _ChannelResult___init__impl__siwsuf(holder) {
3353
+ return holder;
3354
+ }
3355
+ function _ChannelResult___get_holder__impl__pm9gzw($this) {
3356
+ return $this;
3357
+ }
3358
+ function _ChannelResult___get_isSuccess__impl__odq1z9($this) {
3359
+ var tmp = _ChannelResult___get_holder__impl__pm9gzw($this);
3360
+ return !(tmp instanceof Failed());
3361
+ }
3362
+ function _ChannelResult___get_isClosed__impl__mg7kuu($this) {
3363
+ var tmp = _ChannelResult___get_holder__impl__pm9gzw($this);
3364
+ return tmp instanceof Closed();
3365
+ }
3366
+ function ChannelResult__getOrNull_impl_f5e07h($this) {
3367
+ var tmp;
3368
+ var tmp_0 = _ChannelResult___get_holder__impl__pm9gzw($this);
3369
+ if (!(tmp_0 instanceof Failed())) {
3370
+ tmp = _ChannelResult___get_holder__impl__pm9gzw($this);
3371
+ } else {
3372
+ tmp = null;
3373
+ }
3374
+ return tmp;
3375
+ }
3376
+ function ChannelResult__exceptionOrNull_impl_16ei30($this) {
3377
+ var tmp = _ChannelResult___get_holder__impl__pm9gzw($this);
3378
+ var tmp0_safe_receiver = tmp instanceof Closed() ? tmp : null;
3379
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.cause_1;
3380
+ }
3381
+ var FailedClass;
3382
+ function Failed() {
3383
+ if (FailedClass === VOID3) {
3384
+ let $ = function() {
3385
+ };
3386
+ initMetadataForClass3($, "Failed", Failed);
3387
+ protoOf3($).toString = function() {
3388
+ return "Failed";
3389
+ };
3390
+ FailedClass = $;
3391
+ }
3392
+ return FailedClass;
3393
+ }
3394
+ var ClosedClass;
3395
+ function Closed() {
3396
+ if (ClosedClass === VOID3) {
3397
+ let $ = function(cause) {
3398
+ Failed().call(this);
3399
+ this.cause_1 = cause;
3400
+ };
3401
+ initMetadataForClass3($, "Closed", VOID3, Failed());
3402
+ protoOf3($).equals = function(other) {
3403
+ var tmp;
3404
+ if (other instanceof Closed()) {
3405
+ tmp = equals2(this.cause_1, other.cause_1);
3406
+ } else {
3407
+ tmp = false;
3408
+ }
3409
+ return tmp;
3410
+ };
3411
+ protoOf3($).hashCode = function() {
3412
+ var tmp0_safe_receiver = this.cause_1;
3413
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
3414
+ return tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
3415
+ };
3416
+ protoOf3($).toString = function() {
3417
+ return "Closed(" + toString_02(this.cause_1) + ")";
3418
+ };
3419
+ ClosedClass = $;
3420
+ }
3421
+ return ClosedClass;
3422
+ }
3423
+ var CompanionClass;
3424
+ function Companion() {
3425
+ if (CompanionClass === VOID3) {
3426
+ let $ = function() {
3427
+ Companion_instance2 = this;
3428
+ this.failed_1 = new (Failed())();
3429
+ };
3430
+ initMetadataForCompanion($);
3431
+ protoOf3($).success_tizbw6_k$ = function(value) {
3432
+ return _ChannelResult___init__impl__siwsuf(value);
3433
+ };
3434
+ protoOf3($).failure_q0nifh_k$ = function() {
3435
+ return _ChannelResult___init__impl__siwsuf(this.failed_1);
3436
+ };
3437
+ protoOf3($).closed_xuwu5z_k$ = function(cause) {
3438
+ return _ChannelResult___init__impl__siwsuf(new (Closed())(cause));
3439
+ };
3440
+ CompanionClass = $;
3441
+ }
3442
+ return CompanionClass;
3443
+ }
3444
+ var Companion_instance2;
3445
+ function Companion_getInstance() {
3446
+ if (Companion_instance2 == null)
3447
+ new (Companion())();
3448
+ return Companion_instance2;
3449
+ }
3450
+ function ChannelResult__toString_impl_rrcqu7($this) {
3451
+ var tmp;
3452
+ if (_ChannelResult___get_holder__impl__pm9gzw($this) instanceof Closed()) {
3453
+ tmp = _ChannelResult___get_holder__impl__pm9gzw($this).toString();
3454
+ } else {
3455
+ tmp = "Value(" + toString_02(_ChannelResult___get_holder__impl__pm9gzw($this)) + ")";
3456
+ }
3457
+ return tmp;
3458
+ }
3459
+ function ChannelResult__hashCode_impl_lilec2($this) {
3460
+ return $this == null ? 0 : hashCode($this);
3461
+ }
3462
+ function ChannelResult__equals_impl_f471ri($this, other) {
3463
+ if (!(other instanceof ChannelResult()))
3464
+ return false;
3465
+ var tmp0_other_with_cast = other.holder_1;
3466
+ if (!equals2($this, tmp0_other_with_cast))
3467
+ return false;
3468
+ return true;
3469
+ }
3470
+ var ChannelResultClass;
3471
+ function ChannelResult() {
3472
+ if (ChannelResultClass === VOID3) {
3473
+ let $ = function(holder) {
3474
+ Companion_getInstance();
3475
+ this.holder_1 = holder;
3476
+ };
3477
+ initMetadataForClass3($, "ChannelResult");
3478
+ protoOf3($).toString = function() {
3479
+ return ChannelResult__toString_impl_rrcqu7(this.holder_1);
3480
+ };
3481
+ protoOf3($).hashCode = function() {
3482
+ return ChannelResult__hashCode_impl_lilec2(this.holder_1);
3483
+ };
3484
+ protoOf3($).equals = function(other) {
3485
+ return ChannelResult__equals_impl_f471ri(this.holder_1, other);
3486
+ };
3487
+ ChannelResultClass = $;
3488
+ }
3489
+ return ChannelResultClass;
3490
+ }
3491
+ function cancel$default(cause, $super) {
3492
+ cause = cause === VOID3 ? null : cause;
3493
+ var tmp;
3494
+ if ($super === VOID3) {
3495
+ this.cancel_hkmm2i_k$(cause);
3496
+ tmp = Unit_instance3;
3497
+ } else {
3498
+ tmp = $super.cancel_hkmm2i_k$.call(this, cause);
3499
+ }
3500
+ return tmp;
3501
+ }
3502
+ var ReceiveChannelClass;
3503
+ function ReceiveChannel() {
3504
+ if (ReceiveChannelClass === VOID3) {
3505
+ let $ = function() {
3506
+ };
3507
+ initMetadataForInterface($, "ReceiveChannel", VOID3, VOID3, VOID3, [0]);
3508
+ ReceiveChannelClass = $;
3509
+ }
3510
+ return ReceiveChannelClass;
3511
+ }
3512
+ function close$default(cause, $super) {
3513
+ cause = cause === VOID3 ? null : cause;
3514
+ return $super === VOID3 ? this.close_ukldxa_k$(cause) : $super.close_ukldxa_k$.call(this, cause);
3515
+ }
3516
+ var SendChannelClass;
3517
+ function SendChannel() {
3518
+ if (SendChannelClass === VOID3) {
3519
+ let $ = function() {
3520
+ };
3521
+ initMetadataForInterface($, "SendChannel", VOID3, VOID3, VOID3, [1]);
3522
+ SendChannelClass = $;
3523
+ }
3524
+ return SendChannelClass;
3525
+ }
3526
+ var ClosedReceiveChannelExceptionClass;
3527
+ function ClosedReceiveChannelException() {
3528
+ if (ClosedReceiveChannelExceptionClass === VOID3) {
3529
+ let $ = function(message) {
3530
+ NoSuchElementException_init_$Init$(message, this);
3531
+ captureStack(this, ClosedReceiveChannelException());
3532
+ };
3533
+ initMetadataForClass3($, "ClosedReceiveChannelException", VOID3, NoSuchElementException());
3534
+ ClosedReceiveChannelExceptionClass = $;
3535
+ }
3536
+ return ClosedReceiveChannelExceptionClass;
3537
+ }
3538
+ var ClosedSendChannelExceptionClass;
3539
+ function ClosedSendChannelException() {
3540
+ if (ClosedSendChannelExceptionClass === VOID3) {
3541
+ let $ = function(message) {
3542
+ IllegalStateException_init_$Init$(message, this);
3543
+ captureStack(this, ClosedSendChannelException());
433
3544
  };
434
- ChannelFlowClass = $;
3545
+ initMetadataForClass3($, "ClosedSendChannelException", VOID3, IllegalStateException());
3546
+ ClosedSendChannelExceptionClass = $;
435
3547
  }
436
- return ChannelFlowClass;
3548
+ return ClosedSendChannelExceptionClass;
437
3549
  }
438
3550
  export {
439
- ChannelFlow as ChannelFlowvdfy82kdxy2m,
440
- emitAll as emitAllrvkmpyrgtm20,
441
- receiveAsFlow as receiveAsFlow2v7nzqlsp0hx7
3551
+ BufferedChannel as BufferedChannel3lgkhzot5gmk6,
3552
+ Channel as Channel3r72atmcithql,
3553
+ ChannelResult as ChannelResult2y4k69ac6y3du,
3554
+ ChannelResult__exceptionOrNull_impl_16ei30 as ChannelResult__exceptionOrNull_impl_16ei30skcgwlkg1n39,
3555
+ ChannelResult__getOrNull_impl_f5e07h as ChannelResult__getOrNull_impl_f5e07h3a081spbk3eji,
3556
+ Closed as Closed8t4xgopf7j5r,
3557
+ ClosedReceiveChannelException as ClosedReceiveChannelException3ofg6gf5f5b38,
3558
+ ClosedSendChannelException as ClosedSendChannelException29m33prpq9jaw,
3559
+ Companion_getInstance as Companion_getInstance2vekrswsg6p6,
3560
+ ConflatedBufferedChannel as ConflatedBufferedChannel16nes42ao4b78,
3561
+ Factory_getInstance as Factory_getInstance14vrned6uf29d,
3562
+ ReceiveChannel as ReceiveChannel24wu5e2tj9lbp,
3563
+ SendChannel as SendChannel38sllbxw662ws,
3564
+ _ChannelResult___get_holder__impl__pm9gzw as _ChannelResult___get_holder__impl__pm9gzw2lcu3ixrszjgj,
3565
+ _ChannelResult___get_isClosed__impl__mg7kuu as _ChannelResult___get_isClosed__impl__mg7kuul2jcxqhngcqm,
3566
+ _ChannelResult___get_isSuccess__impl__odq1z9 as _ChannelResult___get_isSuccess__impl__odq1z923tdiqn4dmkwh,
3567
+ access$_get_isClosedForSend0__sm8f7a as access$_get_isClosedForSend0__sm8f7ad6w3wkg5hm6q,
3568
+ access$_get_sendSegment__111kgq as access$_get_sendSegment__111kgq3e41ruajnjr0f,
3569
+ access$_get_sendersAndCloseStatus__tvw29s as access$_get_sendersAndCloseStatus__tvw29s1hsu1qz6ckz7z,
3570
+ access$findSegmentSend as access$findSegmentSend1rq2hoj4hiojx,
3571
+ access$prepareSenderForSuspension as access$prepareSenderForSuspensionhe35w06znfdm,
3572
+ access$updateCellSend as access$updateCellSend1n524tbdorfh1,
3573
+ cancel$default as cancel$default3v09jht7i082i,
3574
+ close$default as close$default2suggcywjwe8g,
3575
+ get_BUFFERED as get_BUFFERED29hqqqmuwfwgo,
3576
+ get_SEGMENT_SIZE as get_SEGMENT_SIZE3avqnmtdqy204
442
3577
  };