@cpaassdk/cpaas-sdk
Version:
1,289 lines (1,265 loc) • 322 kB
JavaScript
(function (root, factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js', './88b0986a7186d029-atomicfu-js-ir.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js'), require('./88b0986a7186d029-atomicfu-js-ir.js'));
else {
if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-io-js-ir'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'ktor-ktor-io-js-ir'.");
}
if (typeof this['kotlinx.coroutines-kotlinx-coroutines-core-js-ir'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-io-js-ir'. Its dependency 'kotlinx.coroutines-kotlinx-coroutines-core-js-ir' was not found. Please, check whether 'kotlinx.coroutines-kotlinx-coroutines-core-js-ir' is loaded prior to 'ktor-ktor-io-js-ir'.");
}
if (typeof this['88b0986a7186d029-atomicfu-js-ir'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-io-js-ir'. Its dependency '88b0986a7186d029-atomicfu-js-ir' was not found. Please, check whether '88b0986a7186d029-atomicfu-js-ir' is loaded prior to 'ktor-ktor-io-js-ir'.");
}
root['ktor-ktor-io-js-ir'] = factory(typeof this['ktor-ktor-io-js-ir'] === 'undefined' ? {} : this['ktor-ktor-io-js-ir'], this['kotlin-kotlin-stdlib-js-ir'], this['kotlinx.coroutines-kotlinx-coroutines-core-js-ir'], this['88b0986a7186d029-atomicfu-js-ir']);
}
}(this, function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_org_jetbrains_kotlinx_atomicfu) {
'use strict';
//region block: imports
var imul = Math.imul;
var interfaceMeta = kotlin_kotlin.$_$.g9;
var ensureNotNull = kotlin_kotlin.$_$.dd;
var Unit_getInstance = kotlin_kotlin.$_$.h4;
var CoroutineImpl = kotlin_kotlin.$_$.h8;
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.s7;
var classMeta = kotlin_kotlin.$_$.x8;
var toLong = kotlin_kotlin.$_$.fa;
var Long = kotlin_kotlin.$_$.lc;
var toString = kotlin_kotlin.$_$.ha;
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.a2;
var CancellationException_init_$Create$ = kotlin_kotlin.$_$.o1;
var Companion_getInstance = kotlin_kotlin.$_$.b4;
var CancellationException = kotlin_kotlin.$_$.r7;
var CancellationException_init_$Init$ = kotlin_kotlin.$_$.n1;
var captureStack = kotlin_kotlin.$_$.s8;
var Job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h1;
var EmptyCoroutineContext_getInstance = kotlin_kotlin.$_$.q3;
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e1;
var cancel$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
var invokeOnCompletion$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
var Key_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.o;
var launch$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m;
var THROW_CCE = kotlin_kotlin.$_$.qc;
var isInterface = kotlin_kotlin.$_$.p9;
var Key_getInstance_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.s;
var Dispatchers_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.q;
var equals = kotlin_kotlin.$_$.z8;
var SuspendFunction1 = kotlin_kotlin.$_$.j8;
var toByte = kotlin_kotlin.$_$.ea;
var toShort = kotlin_kotlin.$_$.ga;
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.e2;
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.r1;
var IntCompanionObject_getInstance = kotlin_kotlin.$_$.v3;
var charSequenceLength = kotlin_kotlin.$_$.v8;
var numberToLong = kotlin_kotlin.$_$.ca;
var numberToChar = kotlin_kotlin.$_$.z9;
var objectMeta = kotlin_kotlin.$_$.da;
var coerceAtLeast = kotlin_kotlin.$_$.la;
var coerceAtMost = kotlin_kotlin.$_$.na;
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.x2;
var Appendable = kotlin_kotlin.$_$.wa;
var Exception = kotlin_kotlin.$_$.ic;
var Exception_init_$Init$ = kotlin_kotlin.$_$.w1;
var _UShort___init__impl__jigrne = kotlin_kotlin.$_$.m3;
var _UShort___get_data__impl__g0245 = kotlin_kotlin.$_$.n3;
var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.p2;
var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.c;
var atomic$int$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d;
var KMutableProperty1 = kotlin_kotlin.$_$.ua;
var getPropertyCallableRef = kotlin_kotlin.$_$.d9;
var Companion_getInstance_0 = kotlin_kotlin.$_$.g4;
var charSequenceGet = kotlin_kotlin.$_$.u8;
var isLowSurrogate = kotlin_kotlin.$_$.db;
var isHighSurrogate = kotlin_kotlin.$_$.cb;
var Char = kotlin_kotlin.$_$.bc;
var Job$default = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i;
var coerceAtMost_0 = kotlin_kotlin.$_$.ma;
var hashCode = kotlin_kotlin.$_$.f9;
var lazy = kotlin_kotlin.$_$.jd;
var KProperty1 = kotlin_kotlin.$_$.va;
var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.i2;
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.q2;
var replace$default = kotlin_kotlin.$_$.u;
var getStringHashCode = kotlin_kotlin.$_$.e9;
var charSequenceSubSequence = kotlin_kotlin.$_$.w8;
var extendThrowable = kotlin_kotlin.$_$.a9;
var isObject = kotlin_kotlin.$_$.s9;
var ReadWriteProperty = kotlin_kotlin.$_$.ka;
var ReadOnlyProperty = kotlin_kotlin.$_$.ja;
var Enum = kotlin_kotlin.$_$.gc;
var IndexOutOfBoundsException_init_$Create$_0 = kotlin_kotlin.$_$.h2;
var Exception_init_$Init$_0 = kotlin_kotlin.$_$.x1;
var isCharSequence = kotlin_kotlin.$_$.l9;
var trim = kotlin_kotlin.$_$.zb;
var decodeToString = kotlin_kotlin.$_$.ya;
var setOf = kotlin_kotlin.$_$.b7;
var fillArrayVal = kotlin_kotlin.$_$.b9;
//endregion
//region block: pre-declaration
$awaitAtLeastNBytesAvailableForWriteCOROUTINE$0.prototype = Object.create(CoroutineImpl.prototype);
$awaitAtLeastNBytesAvailableForWriteCOROUTINE$0.prototype.constructor = $awaitAtLeastNBytesAvailableForWriteCOROUTINE$0;
$awaitAtLeastNBytesAvailableForReadCOROUTINE$1.prototype = Object.create(CoroutineImpl.prototype);
$awaitAtLeastNBytesAvailableForReadCOROUTINE$1.prototype.constructor = $awaitAtLeastNBytesAvailableForReadCOROUTINE$1;
$writeFullyCOROUTINE$9.prototype = Object.create(CoroutineImpl.prototype);
$writeFullyCOROUTINE$9.prototype.constructor = $writeFullyCOROUTINE$9;
$writeFullyCOROUTINE$10.prototype = Object.create(CoroutineImpl.prototype);
$writeFullyCOROUTINE$10.prototype.constructor = $writeFullyCOROUTINE$10;
$readRemainingCOROUTINE$26.prototype = Object.create(CoroutineImpl.prototype);
$readRemainingCOROUTINE$26.prototype.constructor = $readRemainingCOROUTINE$26;
$readRemainingSuspendCOROUTINE$27.prototype = Object.create(CoroutineImpl.prototype);
$readRemainingSuspendCOROUTINE$27.prototype.constructor = $readRemainingSuspendCOROUTINE$27;
$readAvailableCOROUTINE$30.prototype = Object.create(CoroutineImpl.prototype);
$readAvailableCOROUTINE$30.prototype.constructor = $readAvailableCOROUTINE$30;
$readAvailableCOROUTINE$33.prototype = Object.create(CoroutineImpl.prototype);
$readAvailableCOROUTINE$33.prototype.constructor = $readAvailableCOROUTINE$33;
$awaitInternalAtLeast1COROUTINE$38.prototype = Object.create(CoroutineImpl.prototype);
$awaitInternalAtLeast1COROUTINE$38.prototype.constructor = $awaitInternalAtLeast1COROUTINE$38;
$awaitSuspendCOROUTINE$39.prototype = Object.create(CoroutineImpl.prototype);
$awaitSuspendCOROUTINE$39.prototype.constructor = $awaitSuspendCOROUTINE$39;
ClosedWriteChannelException.prototype = Object.create(CancellationException.prototype);
ClosedWriteChannelException.prototype.constructor = ClosedWriteChannelException;
launchChannel$slambda.prototype = Object.create(CoroutineImpl.prototype);
launchChannel$slambda.prototype.constructor = launchChannel$slambda;
_no_name_provided__qut3iv.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv.prototype.constructor = _no_name_provided__qut3iv;
_no_name_provided__qut3iv_0.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_0.prototype.constructor = _no_name_provided__qut3iv_0;
_no_name_provided__qut3iv_1.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_1.prototype.constructor = _no_name_provided__qut3iv_1;
_no_name_provided__qut3iv_2.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_2.prototype.constructor = _no_name_provided__qut3iv_2;
_no_name_provided__qut3iv_3.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_3.prototype.constructor = _no_name_provided__qut3iv_3;
_no_name_provided__qut3iv_4.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_4.prototype.constructor = _no_name_provided__qut3iv_4;
_no_name_provided__qut3iv_5.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_5.prototype.constructor = _no_name_provided__qut3iv_5;
InsufficientSpaceException.prototype = Object.create(Exception.prototype);
InsufficientSpaceException.prototype.constructor = InsufficientSpaceException;
function close() {
this.ho();
}
DefaultBufferPool.prototype = Object.create(DefaultPool.prototype);
DefaultBufferPool.prototype.constructor = DefaultBufferPool;
_no_name_provided__qut3iv_6.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_6.prototype.constructor = _no_name_provided__qut3iv_6;
_no_name_provided__qut3iv_7.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_7.prototype.constructor = _no_name_provided__qut3iv_7;
_no_name_provided__qut3iv_8.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_8.prototype.constructor = _no_name_provided__qut3iv_8;
_no_name_provided__qut3iv_9.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_9.prototype.constructor = _no_name_provided__qut3iv_9;
_no_name_provided__qut3iv_10.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_10.prototype.constructor = _no_name_provided__qut3iv_10;
_no_name_provided__qut3iv_11.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_11.prototype.constructor = _no_name_provided__qut3iv_11;
_no_name_provided__qut3iv_12.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_12.prototype.constructor = _no_name_provided__qut3iv_12;
EmptyBufferPoolImpl.prototype = Object.create(NoPoolImpl.prototype);
EmptyBufferPoolImpl.prototype.constructor = EmptyBufferPoolImpl;
BufferLimitExceededException.prototype = Object.create(Exception.prototype);
BufferLimitExceededException.prototype.constructor = BufferLimitExceededException;
BytePacketBuilderBase.prototype = Object.create(AbstractOutput.prototype);
BytePacketBuilderBase.prototype.constructor = BytePacketBuilderBase;
BytePacketBuilderPlatformBase.prototype = Object.create(BytePacketBuilderBase.prototype);
BytePacketBuilderPlatformBase.prototype.constructor = BytePacketBuilderPlatformBase;
_no_name_provided__qut3iv_13.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_13.prototype.constructor = _no_name_provided__qut3iv_13;
BytePacketBuilder.prototype = Object.create(BytePacketBuilderPlatformBase.prototype);
BytePacketBuilder.prototype.constructor = BytePacketBuilder;
ByteReadPacketBase.prototype = Object.create(AbstractInput.prototype);
ByteReadPacketBase.prototype.constructor = ByteReadPacketBase;
ByteReadPacketPlatformBase.prototype = Object.create(ByteReadPacketBase.prototype);
ByteReadPacketPlatformBase.prototype.constructor = ByteReadPacketPlatformBase;
ByteReadPacket.prototype = Object.create(ByteReadPacketPlatformBase.prototype);
ByteReadPacket.prototype.constructor = ByteReadPacket;
_no_name_provided__qut3iv_14.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_14.prototype.constructor = _no_name_provided__qut3iv_14;
ChunkBuffer$Companion$NoPool$1.prototype = Object.create(NoPoolImpl.prototype);
ChunkBuffer$Companion$NoPool$1.prototype.constructor = ChunkBuffer$Companion$NoPool$1;
ChunkBuffer$Companion$NoPoolManuallyManaged$1.prototype = Object.create(NoPoolImpl.prototype);
ChunkBuffer$Companion$NoPoolManuallyManaged$1.prototype.constructor = ChunkBuffer$Companion$NoPoolManuallyManaged$1;
_no_name_provided__qut3iv_15.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_15.prototype.constructor = _no_name_provided__qut3iv_15;
_no_name_provided__qut3iv_16.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_16.prototype.constructor = _no_name_provided__qut3iv_16;
ChunkBuffer.prototype = Object.create(Buffer.prototype);
ChunkBuffer.prototype.constructor = ChunkBuffer;
_no_name_provided__qut3iv_17.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_17.prototype.constructor = _no_name_provided__qut3iv_17;
MalformedUTF8InputException.prototype = Object.create(Exception.prototype);
MalformedUTF8InputException.prototype.constructor = MalformedUTF8InputException;
$sleepCOROUTINE$52.prototype = Object.create(CoroutineImpl.prototype);
$sleepCOROUTINE$52.prototype.constructor = $sleepCOROUTINE$52;
$trySuspendCOROUTINE$53.prototype = Object.create(CoroutineImpl.prototype);
$trySuspendCOROUTINE$53.prototype.constructor = $trySuspendCOROUTINE$53;
$copyToSequentialImplCOROUTINE$54.prototype = Object.create(CoroutineImpl.prototype);
$copyToSequentialImplCOROUTINE$54.prototype.constructor = $copyToSequentialImplCOROUTINE$54;
$copyToTailCOROUTINE$55.prototype = Object.create(CoroutineImpl.prototype);
$copyToTailCOROUTINE$55.prototype.constructor = $copyToTailCOROUTINE$55;
ByteArrayPool$1.prototype = Object.create(DefaultPool.prototype);
ByteArrayPool$1.prototype.constructor = ByteArrayPool$1;
ByteChannelJS.prototype = Object.create(ByteChannelSequentialBase.prototype);
ByteChannelJS.prototype.constructor = ByteChannelJS;
CharsetImpl.prototype = Object.create(Charset.prototype);
CharsetImpl.prototype.constructor = CharsetImpl;
CharsetEncoderImpl.prototype = Object.create(CharsetEncoder.prototype);
CharsetEncoderImpl.prototype.constructor = CharsetEncoderImpl;
CharsetDecoderImpl.prototype = Object.create(CharsetDecoder.prototype);
CharsetDecoderImpl.prototype.constructor = CharsetDecoderImpl;
MalformedInputException.prototype = Object.create(Error.prototype);
MalformedInputException.prototype.constructor = MalformedInputException;
ByteOrder.prototype = Object.create(Enum.prototype);
ByteOrder.prototype.constructor = ByteOrder;
_no_name_provided__qut3iv_18.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_18.prototype.constructor = _no_name_provided__qut3iv_18;
_no_name_provided__qut3iv_19.prototype = Object.create(RequireFailureCapture.prototype);
_no_name_provided__qut3iv_19.prototype.constructor = _no_name_provided__qut3iv_19;
IoBuffer$Companion$Pool$1.prototype = Object.create(DefaultPool.prototype);
IoBuffer$Companion$Pool$1.prototype.constructor = IoBuffer$Companion$Pool$1;
IoBuffer$Companion$NoPool$1.prototype = Object.create(NoPoolImpl.prototype);
IoBuffer$Companion$NoPool$1.prototype.constructor = IoBuffer$Companion$NoPool$1;
IoBuffer.prototype = Object.create(ChunkBuffer.prototype);
IoBuffer.prototype.constructor = IoBuffer;
IOException.prototype = Object.create(Exception.prototype);
IOException.prototype.constructor = IOException;
EOFException.prototype = Object.create(IOException.prototype);
EOFException.prototype.constructor = EOFException;
//endregion
function ByteReadChannel(content) {
return ByteReadChannel_0(content, 0, content.length);
}
function ByteChannel() {
}
ByteChannel.$metadata$ = interfaceMeta('ByteChannel', [ByteReadChannel_1, ByteWriteChannel]);
function ByteChannelSequentialBase_init_$Init$(initial, autoFlush, pool, $mask0, $marker, $this) {
if (!(($mask0 & 4) === 0))
pool = Companion_getInstance_5().b1c_1;
ByteChannelSequentialBase.call($this, initial, autoFlush, pool);
return $this;
}
function _get_flushSize__xd4y0k($this) {
return $this.l1c_1.j();
}
function _set__totalBytesRead__om08bt($this, value) {
$this.g1c_1.u1c_1 = value;
}
function _get__totalBytesRead__ypqfud($this) {
return $this.g1c_1.u1c_1;
}
function _set__totalBytesWritten__29anve($this, value) {
$this.g1c_1.v1c_1 = value;
}
function _get__totalBytesWritten__yty2ze($this) {
return $this.g1c_1.v1c_1;
}
function _set_closedCause__rpgi88($this, value) {
$this.g1c_1.w1c_1 = value;
}
function flushImpl($this) {
if ($this.h1c_1.ds()) {
return false;
}
flushWrittenBytes($this);
$this.j1c_1.a1d();
return true;
}
function flushWrittenBytes($this) {
var tmp$ret$0;
{
var tmp0_synchronized = $this.k1c_1;
var buffer = ensureNotNull($this.h1c_1.f1d());
tmp$ret$0 = $this.l1c_1.g1d(buffer);
}
}
function ensureNotClosed($this) {
if ($this.i1d()) {
var tmp0_elvis_lhs = $this.h1d();
throw tmp0_elvis_lhs == null ? new ClosedWriteChannelException('Channel is already closed') : tmp0_elvis_lhs;
}
}
function ensureNotFailed($this) {
var tmp0_safe_receiver = $this.h1d();
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$0;
{
{
}
throw tmp0_safe_receiver;
}
}
}
function ensureNotFailed_0($this, closeable) {
var tmp0_safe_receiver = $this.h1d();
if (tmp0_safe_receiver == null)
null;
else {
var tmp$ret$0;
{
{
}
closeable.jr();
throw tmp0_safe_receiver;
}
}
}
function readRemainingSuspend($this, builder, limit, $cont) {
var tmp = new $readRemainingSuspendCOROUTINE$27($this, builder, limit, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
}
function $awaitAtLeastNBytesAvailableForWriteCOROUTINE$0(_this__u8e3s4, count, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.f1e_1 = _this__u8e3s4;
this.g1e_1 = count;
}
$awaitAtLeastNBytesAvailableForWriteCOROUTINE$0.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 4;
this.ii_1 = 1;
continue $sm;
case 1:
if (!(this.f1e_1.h1e() < this.g1e_1 ? !this.f1e_1.i1d() : false)) {
this.ii_1 = 5;
continue $sm;
}
if (!flushImpl(this.f1e_1)) {
this.ii_1 = 2;
suspendResult = this.f1e_1.j1c_1.i1e(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
} else {
this.ii_1 = 3;
continue $sm;
}
break;
case 2:
this.ii_1 = 3;
continue $sm;
case 3:
this.ii_1 = 1;
continue $sm;
case 4:
throw this.li_1;
case 5:
return Unit_getInstance();
}
} catch ($p) {
if (this.ji_1 === 4) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$awaitAtLeastNBytesAvailableForWriteCOROUTINE$0.$metadata$ = classMeta('$awaitAtLeastNBytesAvailableForWriteCOROUTINE$0', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $awaitAtLeastNBytesAvailableForReadCOROUTINE$1(_this__u8e3s4, count, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.r1e_1 = _this__u8e3s4;
this.s1e_1 = count;
}
$awaitAtLeastNBytesAvailableForReadCOROUTINE$1.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 3;
this.ii_1 = 1;
continue $sm;
case 1:
if (!(this.r1e_1.t1e() < this.s1e_1 ? !this.r1e_1.i1d() : false)) {
this.ii_1 = 4;
continue $sm;
}
this.ii_1 = 2;
suspendResult = this.r1e_1.j1c_1.i1e(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 2:
this.ii_1 = 1;
continue $sm;
case 3:
throw this.li_1;
case 4:
return Unit_getInstance();
}
} catch ($p) {
if (this.ji_1 === 3) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$awaitAtLeastNBytesAvailableForReadCOROUTINE$1.$metadata$ = classMeta('$awaitAtLeastNBytesAvailableForReadCOROUTINE$1', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $writeFullyCOROUTINE$9(_this__u8e3s4, src, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.c1f_1 = _this__u8e3s4;
this.d1f_1 = src;
}
$writeFullyCOROUTINE$9.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 2;
this.ii_1 = 1;
suspendResult = this.c1f_1.e1f(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
var count = this.d1f_1.i1f() - this.d1f_1.j1f() | 0;
writeFully$default_0(this.c1f_1.h1c_1, this.d1f_1, 0, 2, null);
this.c1f_1.k1f(count);
return Unit_getInstance();
case 2:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 2) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$writeFullyCOROUTINE$9.$metadata$ = classMeta('$writeFullyCOROUTINE$9', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $writeFullyCOROUTINE$10(_this__u8e3s4, src, offset, length, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.t1f_1 = _this__u8e3s4;
this.u1f_1 = src;
this.v1f_1 = offset;
this.w1f_1 = length;
}
$writeFullyCOROUTINE$10.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 4;
this.x1f_1 = this.v1f_1;
this.y1f_1 = this.v1f_1 + this.w1f_1 | 0;
this.ii_1 = 1;
continue $sm;
case 1:
if (!(this.x1f_1 < this.y1f_1)) {
this.ii_1 = 3;
continue $sm;
}
this.ii_1 = 2;
suspendResult = this.t1f_1.e1f(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 2:
var tmp0_min = this.t1f_1.h1e();
var tmp1_min = this.y1f_1 - this.x1f_1 | 0;
var bytesCount = Math.min(tmp0_min, tmp1_min);
writeFully_2(this.t1f_1.h1c_1, this.u1f_1, this.x1f_1, bytesCount);
this.x1f_1 = this.x1f_1 + bytesCount | 0;
this.t1f_1.k1f(bytesCount);
this.ii_1 = 1;
continue $sm;
case 3:
return Unit_getInstance();
case 4:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 4) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$writeFullyCOROUTINE$10.$metadata$ = classMeta('$writeFullyCOROUTINE$10', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $readRemainingCOROUTINE$26(_this__u8e3s4, limit, headerSizeHint, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.h1g_1 = _this__u8e3s4;
this.i1g_1 = limit;
this.j1g_1 = headerSizeHint;
}
$readRemainingCOROUTINE$26.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 3;
ensureNotFailed(this.h1g_1);
this.k1g_1 = BytePacketBuilder_0(this.j1g_1);
var tmp_0 = this;
var tmp_1 = this;
tmp_1.l1g_1 = this.h1g_1.i1c_1.t1g();
tmp_0.m1g_1 = this.i1g_1.g1(this.l1g_1) <= 0 ? this.i1g_1 : this.l1g_1;
this.k1g_1.u1g(this.h1g_1.i1c_1, this.m1g_1);
var tmp_2 = this;
var tmp_3 = this;
tmp_3.n1g_1 = this.k1g_1.j();
tmp_2.o1g_1 = this.i1g_1.s6(toLong(this.n1g_1));
if (this.o1g_1.equals(new Long(0, 0)) ? true : this.h1g_1.x1g()) {
var tmp_4 = this;
this.h1g_1.v1g(this.o1g_1.m8());
ensureNotFailed_0(this.h1g_1, this.k1g_1);
tmp_4.p1g_1 = this.k1g_1.w1g();
this.ii_1 = 2;
continue $sm;
} else {
this.ii_1 = 1;
suspendResult = readRemainingSuspend(this.h1g_1, this.k1g_1, this.i1g_1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
}
break;
case 1:
this.p1g_1 = suspendResult;
this.ii_1 = 2;
continue $sm;
case 2:
return this.p1g_1;
case 3:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 3) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$readRemainingCOROUTINE$26.$metadata$ = classMeta('$readRemainingCOROUTINE$26', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $readRemainingSuspendCOROUTINE$27(_this__u8e3s4, builder, limit, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.r1d_1 = _this__u8e3s4;
this.s1d_1 = builder;
this.t1d_1 = limit;
}
$readRemainingSuspendCOROUTINE$27.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 5;
this.ii_1 = 1;
continue $sm;
case 1:
if (!(toLong(this.s1d_1.j()).g1(this.t1d_1) < 0)) {
this.ii_1 = 4;
continue $sm;
}
var tmp_0 = this;
var tmp_1 = this;
var tmp0_minus = this.s1d_1.j();
tmp_1.u1d_1 = this.t1d_1.s6(toLong(tmp0_minus));
var tmp_2 = this;
tmp_2.v1d_1 = this.r1d_1.i1c_1.t1g();
tmp_0.w1d_1 = this.u1d_1.g1(this.v1d_1) <= 0 ? this.u1d_1 : this.v1d_1;
this.s1d_1.u1g(this.r1d_1.i1c_1, this.w1d_1);
this.r1d_1.v1g(this.w1d_1.m8());
ensureNotFailed_0(this.r1d_1, this.s1d_1);
if (this.r1d_1.x1g() ? true : this.s1d_1.j() === this.t1d_1.m8()) {
this.ii_1 = 4;
continue $sm;
} else {
this.ii_1 = 2;
continue $sm;
}
break;
case 2:
this.ii_1 = 3;
suspendResult = this.r1d_1.y1g(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 3:
;
this.ii_1 = 1;
continue $sm;
case 4:
ensureNotFailed_0(this.r1d_1, this.s1d_1);
return this.s1d_1.w1g();
case 5:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 5) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$readRemainingSuspendCOROUTINE$27.$metadata$ = classMeta('$readRemainingSuspendCOROUTINE$27', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $readAvailableCOROUTINE$30(_this__u8e3s4, dst, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.h1h_1 = _this__u8e3s4;
this.i1h_1 = dst;
}
$readAvailableCOROUTINE$30.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 3;
var tmp0_safe_receiver = this.h1h_1.h1d();
if (tmp0_safe_receiver == null)
null;
else {
throw tmp0_safe_receiver;
}
;
if (this.h1h_1.i1d() ? this.h1h_1.t1e() === 0 : false)
return -1;
if ((this.i1h_1.j1h() - this.i1h_1.i1f() | 0) === 0)
return 0;
if (this.h1h_1.t1e() === 0) {
this.ii_1 = 1;
suspendResult = this.h1h_1.y1g(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
} else {
this.ii_1 = 2;
continue $sm;
}
break;
case 1:
;
this.ii_1 = 2;
continue $sm;
case 2:
if (!this.h1h_1.i1c_1.l1h()) {
this.h1h_1.k1h();
}
var tmp0_minOf = toLong(this.i1h_1.j1h() - this.i1h_1.i1f() | 0);
var tmp1_minOf = this.h1h_1.i1c_1.t1g();
var size = (tmp0_minOf.g1(tmp1_minOf) <= 0 ? tmp0_minOf : tmp1_minOf).m8();
readFully_2(this.h1h_1.i1c_1, this.i1h_1, size);
this.h1h_1.v1g(size);
return size;
case 3:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 3) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$readAvailableCOROUTINE$30.$metadata$ = classMeta('$readAvailableCOROUTINE$30', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $readAvailableCOROUTINE$33(_this__u8e3s4, dst, offset, length, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.u1h_1 = _this__u8e3s4;
this.v1h_1 = dst;
this.w1h_1 = offset;
this.x1h_1 = length;
}
$readAvailableCOROUTINE$33.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 3;
var tmp0_safe_receiver = this.u1h_1.h1d();
if (tmp0_safe_receiver == null)
null;
else {
throw tmp0_safe_receiver;
}
;
if (this.u1h_1.i1d() ? this.u1h_1.t1e() === 0 : false)
return -1;
if (this.x1h_1 === 0)
return 0;
if (this.u1h_1.t1e() === 0) {
this.ii_1 = 1;
suspendResult = this.u1h_1.y1g(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
} else {
this.ii_1 = 2;
continue $sm;
}
break;
case 1:
;
this.ii_1 = 2;
continue $sm;
case 2:
if (!this.u1h_1.i1c_1.l1h()) {
this.u1h_1.k1h();
}
var tmp0_minOf = toLong(this.x1h_1);
var tmp1_minOf = this.u1h_1.i1c_1.t1g();
var size = (tmp0_minOf.g1(tmp1_minOf) <= 0 ? tmp0_minOf : tmp1_minOf).m8();
readFully_1(this.u1h_1.i1c_1, this.v1h_1, this.w1h_1, size);
this.u1h_1.v1g(size);
return size;
case 3:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 3) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$readAvailableCOROUTINE$33.$metadata$ = classMeta('$readAvailableCOROUTINE$33', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $awaitInternalAtLeast1COROUTINE$38(_this__u8e3s4, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.g1i_1 = _this__u8e3s4;
}
$awaitInternalAtLeast1COROUTINE$38.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 2;
var tmp_0 = this;
tmp_0.i1i_1 = this.g1i_1.i1c_1;
if (!this.i1i_1.j1i()) {
var tmp_1 = this;
tmp_1.h1i_1 = true;
this.ii_1 = 3;
continue $sm;
} else {
this.ii_1 = 1;
suspendResult = this.g1i_1.y1g(1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
}
break;
case 1:
this.h1i_1 = suspendResult;
this.ii_1 = 3;
continue $sm;
case 2:
throw this.li_1;
case 3:
return this.h1i_1;
}
} catch ($p) {
if (this.ji_1 === 2) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$awaitInternalAtLeast1COROUTINE$38.$metadata$ = classMeta('$awaitInternalAtLeast1COROUTINE$38', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function $awaitSuspendCOROUTINE$39(_this__u8e3s4, atLeast, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.s1i_1 = _this__u8e3s4;
this.t1i_1 = atLeast;
}
$awaitSuspendCOROUTINE$39.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 2;
var tmp_0 = this;
tmp_0.u1i_1 = this.t1i_1 >= 0;
if (!this.u1i_1) {
var message = 'Failed requirement.';
throw IllegalArgumentException_init_$Create$(toString(message));
}
this.ii_1 = 1;
suspendResult = this.s1i_1.v1i(this.t1i_1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
this.s1i_1.k1h();
var tmp0_safe_receiver = this.s1i_1.h1d();
if (tmp0_safe_receiver == null)
null;
else {
throw tmp0_safe_receiver;
}
;
return !this.s1i_1.x1g() ? this.s1i_1.t1e() >= this.t1i_1 : false;
case 2:
throw this.li_1;
}
} catch ($p) {
if (this.ji_1 === 2) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
$awaitSuspendCOROUTINE$39.$metadata$ = classMeta('$awaitSuspendCOROUTINE$39', undefined, undefined, undefined, undefined, CoroutineImpl.prototype);
function ByteChannelSequentialBase(initial, autoFlush, pool) {
this.f1c_1 = autoFlush;
this.g1c_1 = new ByteChannelSequentialBaseSharedState();
this.h1c_1 = new BytePacketBuilder(0, pool);
this.i1c_1 = ByteReadPacket_init_$Create$(initial, pool);
this.j1c_1 = new AwaitingSlot();
this.k1c_1 = new Object();
var tmp = this;
tmp.l1c_1 = BytePacketBuilder$default(0, 1, null);
}
ByteChannelSequentialBase.prototype.w1i = function () {
return this.f1c_1;
};
ByteChannelSequentialBase.prototype.x1i = function (value) {
this.g1c_1.r1c_1 = value;
};
ByteChannelSequentialBase.prototype.i1d = function () {
return this.g1c_1.r1c_1;
};
ByteChannelSequentialBase.prototype.y1i = function () {
return this.i1c_1;
};
ByteChannelSequentialBase.prototype.t1e = function () {
return _get_flushSize__xd4y0k(this) + this.i1c_1.t1g().m8() | 0;
};
ByteChannelSequentialBase.prototype.h1e = function () {
var tmp$ret$1;
{
var tmp$ret$0;
{
tmp$ret$0 = this.t1e() + this.h1c_1.j() | 0;
}
var tmp0_maxOf = 4088 - tmp$ret$0 | 0;
tmp$ret$1 = Math.max(0, tmp0_maxOf);
}
return tmp$ret$1;
};
ByteChannelSequentialBase.prototype.x1g = function () {
var tmp;
var tmp_0;
var tmp_1;
if (this.i1d()) {
var tmp$ret$0;
{
var tmp0__get_isEmpty__8d2q20 = this.i1c_1;
tmp$ret$0 = tmp0__get_isEmpty__8d2q20.j1i();
}
tmp_1 = tmp$ret$0;
} else {
tmp_1 = false;
}
if (tmp_1) {
tmp_0 = _get_flushSize__xd4y0k(this) === 0;
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = this.h1c_1.ds();
} else {
tmp = false;
}
return tmp;
};
ByteChannelSequentialBase.prototype.h1d = function () {
return this.g1c_1.w1c_1;
};
ByteChannelSequentialBase.prototype.e1f = function (count, $cont) {
var tmp = new $awaitAtLeastNBytesAvailableForWriteCOROUTINE$0(this, count, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.v1i = function (count, $cont) {
var tmp = new $awaitAtLeastNBytesAvailableForReadCOROUTINE$1(this, count, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.je = function () {
flushImpl(this);
};
ByteChannelSequentialBase.prototype.k1h = function () {
var tmp$ret$1;
{
var tmp0_synchronized = this.k1c_1;
var tmp$ret$0;
{
tmp$ret$0 = unsafeAppend(this.i1c_1, this.l1c_1);
}
tmp$ret$1 = tmp$ret$0;
}
};
ByteChannelSequentialBase.prototype.z1i = function (src, $cont) {
var tmp = new $writeFullyCOROUTINE$9(this, src, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.a1j = function (src, offset, length, $cont) {
var tmp = new $writeFullyCOROUTINE$10(this, src, offset, length, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.v1g = function (count) {
var tmp0_this = this;
var tmp$ret$0;
{
var tmp0_plus = _get__totalBytesRead__ypqfud(tmp0_this);
tmp$ret$0 = tmp0_plus.r6(toLong(count));
}
_set__totalBytesRead__om08bt(tmp0_this, tmp$ret$0);
this.j1c_1.a1d();
};
ByteChannelSequentialBase.prototype.b1j = function (limit, headerSizeHint, $cont) {
var tmp = new $readRemainingCOROUTINE$26(this, limit, headerSizeHint, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.c1j = function (dst, $cont) {
var tmp = new $readAvailableCOROUTINE$30(this, dst, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.d1j = function (dst, offset, length, $cont) {
var tmp = new $readAvailableCOROUTINE$33(this, dst, offset, length, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.e1j = function ($cont) {
var tmp = new $awaitInternalAtLeast1COROUTINE$38(this, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.y1g = function (atLeast, $cont) {
var tmp = new $awaitSuspendCOROUTINE$39(this, atLeast, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
ByteChannelSequentialBase.prototype.ip = function (cause) {
if (!(this.h1d() == null) ? true : this.i1d()) {
return false;
}
var tmp0_elvis_lhs = cause;
return this.iz(tmp0_elvis_lhs == null ? CancellationException_init_$Create$('Channel cancelled') : tmp0_elvis_lhs);
};
ByteChannelSequentialBase.prototype.iz = function (cause) {
if (this.i1d() ? true : !(this.h1d() == null))
return false;
_set_closedCause__rpgi88(this, cause);
this.x1i(true);
if (!(cause == null)) {
this.i1c_1.jr();
this.h1c_1.jr();
this.l1c_1.jr();
} else {
this.je();
}
this.j1c_1.f1j(cause);
return true;
};
ByteChannelSequentialBase.prototype.g1j = function (dst, limit) {
var size = this.i1c_1.t1g();
var tmp;
if (size.g1(limit) <= 0) {
dst.h1c_1.h1j(this.i1c_1);
dst.k1f(size.m8());
this.v1g(size.m8());
tmp = size;
} else {
tmp = new Long(0, 0);
}
return tmp;
};
ByteChannelSequentialBase.prototype.k1f = function (count) {
var tmp0_this = this;
var tmp$ret$0;
{
var tmp0_plus = _get__totalBytesWritten__yty2ze(tmp0_this);
tmp$ret$0 = tmp0_plus.r6(toLong(count));
}
_set__totalBytesWritten__29anve(tmp0_this, tmp$ret$0);
if (this.i1d()) {
this.h1c_1.jr();
ensureNotClosed(this);
}
if (this.w1i() ? true : this.h1e() === 0) {
this.je();
}
};
ByteChannelSequentialBase.$metadata$ = classMeta('ByteChannelSequentialBase', [ByteChannel, ByteReadChannel_1, ByteWriteChannel, SuspendableReadSession, HasReadSession, HasWriteSession]);
function readRemaining(_this__u8e3s4, $cont) {
Companion_getInstance();
return _this__u8e3s4.b1j(new Long(-1, 2147483647), 0, $cont);
}
function cancel(_this__u8e3s4) {
return _this__u8e3s4.ip(null);
}
function readRemaining_0(_this__u8e3s4, limit, $cont) {
return _this__u8e3s4.b1j(limit, 0, $cont);
}
function readAvailable(_this__u8e3s4, dst, $cont) {
return _this__u8e3s4.d1j(dst, 0, dst.length, $cont);
}
function ClosedWriteChannelException(message) {
CancellationException_init_$Init$(message, this);
captureStack(this, ClosedWriteChannelException);
}
ClosedWriteChannelException.$metadata$ = classMeta('ClosedWriteChannelException', undefined, undefined, undefined, undefined, CancellationException.prototype);
function close_0(_this__u8e3s4) {
return _this__u8e3s4.iz(null);
}
function writeFully(_this__u8e3s4, src, $cont) {
return _this__u8e3s4.a1j(src, 0, src.length, $cont);
}
function WriterJob() {
}
WriterJob.$metadata$ = interfaceMeta('WriterJob', [Job]);
function writer(_this__u8e3s4, coroutineContext, autoFlush, block) {
return launchChannel(_this__u8e3s4, coroutineContext, ByteChannel_0(autoFlush), true, block);
}
function writer$default(_this__u8e3s4, coroutineContext, autoFlush, block, $mask0, $handler) {
if (!(($mask0 & 1) === 0))
coroutineContext = EmptyCoroutineContext_getInstance();
if (!(($mask0 & 2) === 0))
autoFlush = false;
return writer(_this__u8e3s4, coroutineContext, autoFlush, block);
}
function WriterScope() {
}
WriterScope.$metadata$ = interfaceMeta('WriterScope', [CoroutineScope]);
function ChannelJob(delegate, channel) {
this.i1j_1 = delegate;
this.j1j_1 = channel;
}
ChannelJob.prototype.sx = function () {
return this.j1j_1;
};
ChannelJob.prototype.lk = function () {
return this.i1j_1.lk();
};
ChannelJob.prototype.x = function () {
return this.i1j_1.x();
};
ChannelJob.prototype.vl = function (child) {
return this.i1j_1.vl(child);
};
ChannelJob.prototype.nl = function (cause) {
this.i1j_1.nl(cause);
};
ChannelJob.prototype.e5 = function (initial, operation) {
return this.i1j_1.e5(initial, operation);
};
ChannelJob.prototype.y4 = function (key) {
return this.i1j_1.y4(key);
};
ChannelJob.prototype.fl = function () {
return this.i1j_1.fl();
};
ChannelJob.prototype.jl = function (onCancelling, invokeImmediately, handler) {
return this.i1j_1.jl(onCancelling, invokeImmediately, handler);
};
ChannelJob.prototype.il = function (handler) {
return this.i1j_1.il(handler);
};
ChannelJob.prototype.d5 = function (key) {
return this.i1j_1.d5(key);
};
ChannelJob.prototype.f5 = function (context) {
return this.i1j_1.f5(context);
};
ChannelJob.prototype.dl = function () {
return this.i1j_1.dl();
};
ChannelJob.prototype.toString = function () {
return 'ChannelJob[' + this.i1j_1 + ']';
};
ChannelJob.$metadata$ = classMeta('ChannelJob', [ReaderJob, WriterJob, Job]);
function launchChannel(_this__u8e3s4, context, channel, attachJob, block) {
var dispatcher = _this__u8e3s4.kk().y4(Key_getInstance());
var job = launch$default(_this__u8e3s4, context, null, launchChannel$slambda_0(attachJob, channel, block, dispatcher, null), 2, null);
job.il(launchChannel$lambda(channel));
return new ChannelJob(job, channel);
}
function ReaderJob() {
}
ReaderJob.$metadata$ = interfaceMeta('ReaderJob', [Job]);
function ChannelScope(delegate, channel) {
this.k1j_1 = channel;
this.l1j_1 = delegate;
}
ChannelScope.prototype.sx = function () {
return this.k1j_1;
};
ChannelScope.prototype.kk = function () {
return this.l1j_1.kk();
};
ChannelScope.$metadata$ = classMeta('ChannelScope', [ReaderScope, WriterScope, CoroutineScope]);
function ReaderScope() {
}
ReaderScope.$metadata$ = interfaceMeta('ReaderScope', [CoroutineScope]);
function launchChannel$slambda($attachJob, $channel, $block, $dispatcher, resultContinuation) {
this.u1j_1 = $attachJob;
this.v1j_1 = $channel;
this.w1j_1 = $block;
this.x1j_1 = $dispatcher;
CoroutineImpl.call(this, resultContinuation);
}
launchChannel$slambda.prototype.v18 = function ($this$launch, $cont) {
var tmp = this.w18($this$launch, $cont);
tmp.ki_1 = Unit_getInstance();
tmp.li_1 = null;
return tmp.si();
};
launchChannel$slambda.prototype.ui = function (p1, $cont) {
return this.v18((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $cont);
};
launchChannel$slambda.prototype.si = function () {
var suspendResult = this.ki_1;
$sm: do
try {
var tmp = this.ii_1;
switch (tmp) {
case 0:
this.ji_1 = 3;
if (this.u1j_1) {
this.v1j_1.a1c(ensureNotNull(this.y1j_1.kk().y4(Key_getInstance_0())));
}
var tmp_0 = this;
var tmp_1 = new ChannelScope(this.y1j_1, this.v1j_1);
tmp_0.z1j_1 = isInterface(tmp_1, CoroutineScope) ? tmp_1 : THROW_CCE();
this.ji_1 = 2;
this.ii_1 = 1;
suspendResult = this.w1j_1(this.z1j_1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
this.ji_1 = 3;
this.ii_1 = 4;
continue $sm;
case 2:
this.ji_1 = 3;
var tmp_2 = this.li_1;
if (tmp_2 instanceof Error) {
var cause = this.li_1;
if (!equals(this.x1j_1, Dispatchers_getInstance().cw_1) ? !(this.x1j_1 == null) : false) {
throw cause;
}
this.v1j_1.ip(cause);
this.ii_1 = 4;
continue $sm;
} else {
throw this.li_1;
}
break;
case 3:
throw this.li_1;
case 4:
this.ji_1 = 3;
return Unit_getInstance();
}
} catch ($p) {
if (this.ji_1 === 3) {
throw $p;
} else {
this.ii_1 = this.ji_1;
this.li_1 = $p;
}
}
while (true);
};
launchChannel$slambda.prototype.w18 = function ($this$launch, completion) {
var i = new launchChannel$slambda(this.u1j_1, this.v1j_1, this.w1j_1, this.x1j_1, completion);
i.y1j_1 = $this$launch;
return i;
};
launchChannel$slambda.$metadata$ = classMeta('launchChannel$slambda', undefined, undefined, undefined, [1], CoroutineImpl.prototype);
function launchChannel$slambda_0($attachJob, $channel, $block, $dispatcher, resultContinuation) {
var i = new launchChannel$slambda($attachJob, $channel, $block, $dispatcher, resultContinuation);
var l = function ($this$launch, $cont) {
return i.v18($this$launch, $cont);
};
l.$arity = 1;
return l;
}
function launchChannel$lambda($channel) {
return function (cause) {
$channel.iz(cause);
return Unit_getInstance();
};
}
function unwrapCancellationException(_this__u8e3s4) {
var exception = _this__u8e3s4;
$l$loop: while (true) {
if (!(exception instanceof CancellationException)) {
break $l