@earth-app/shovel
Version:
Kotlin Multiplatform Web Scraping Framework
1,183 lines (1,175 loc) • 293 kB
JavaScript
(function (factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-atomicfu.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-atomicfu.js'));
else {
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
throw new Error("Error loading module 'kotlinx-coroutines-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'kotlinx-coroutines-core'.");
}
if (typeof globalThis['kotlinx-atomicfu'] === 'undefined') {
throw new Error("Error loading module 'kotlinx-coroutines-core'. Its dependency 'kotlinx-atomicfu' was not found. Please, check whether 'kotlinx-atomicfu' is loaded prior to 'kotlinx-coroutines-core'.");
}
globalThis['kotlinx-coroutines-core'] = factory(typeof globalThis['kotlinx-coroutines-core'] === 'undefined' ? {} : globalThis['kotlinx-coroutines-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-atomicfu']);
}
}(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_atomicfu) {
'use strict';
//region block: imports
var imul = Math.imul;
var Unit_instance = kotlin_kotlin.$_$.a3;
var protoOf = kotlin_kotlin.$_$.z7;
var THROW_CCE = kotlin_kotlin.$_$.lb;
var Continuation = kotlin_kotlin.$_$.g6;
var initMetadataForClass = kotlin_kotlin.$_$.i7;
var VOID = kotlin_kotlin.$_$.h;
var EmptyCoroutineContext_getInstance = kotlin_kotlin.$_$.w2;
var createCoroutineUnintercepted = kotlin_kotlin.$_$.y5;
var CoroutineImpl = kotlin_kotlin.$_$.m6;
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.w5;
var initMetadataForCoroutine = kotlin_kotlin.$_$.k7;
var initMetadataForInterface = kotlin_kotlin.$_$.m7;
var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.g2;
var toString = kotlin_kotlin.$_$.d8;
var isInterface = kotlin_kotlin.$_$.s7;
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.r1;
var toString_0 = kotlin_kotlin.$_$.ac;
var atomic$int$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.e;
var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d;
var initMetadataForObject = kotlin_kotlin.$_$.o7;
var hashCode = kotlin_kotlin.$_$.h7;
var equals = kotlin_kotlin.$_$.b7;
var atomic$boolean$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.b;
var CancellationException_init_$Create$ = kotlin_kotlin.$_$.w;
var Result__exceptionOrNull_impl_p6xea9 = kotlin_kotlin.$_$.q2;
var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.s2;
var AbstractCoroutineContextKey = kotlin_kotlin.$_$.c6;
var Key_instance = kotlin_kotlin.$_$.v2;
var AbstractCoroutineContextElement = kotlin_kotlin.$_$.b6;
var get = kotlin_kotlin.$_$.d6;
var minusKey = kotlin_kotlin.$_$.e6;
var ContinuationInterceptor = kotlin_kotlin.$_$.f6;
var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.e2;
var addSuppressed = kotlin_kotlin.$_$.ob;
var getStringHashCode = kotlin_kotlin.$_$.g7;
var Enum = kotlin_kotlin.$_$.ab;
var startCoroutine = kotlin_kotlin.$_$.n6;
var noWhenBranchMatchedException = kotlin_kotlin.$_$.wb;
var Long = kotlin_kotlin.$_$.gb;
var ArrayDeque_init_$Create$ = kotlin_kotlin.$_$.n;
var RuntimeException = kotlin_kotlin.$_$.kb;
var RuntimeException_init_$Init$ = kotlin_kotlin.$_$.d2;
var captureStack = kotlin_kotlin.$_$.s6;
var Error_0 = kotlin_kotlin.$_$.bb;
var Error_init_$Init$ = kotlin_kotlin.$_$.f1;
var Element = kotlin_kotlin.$_$.k6;
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.d1;
var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.zb;
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.o;
var CancellationException = kotlin_kotlin.$_$.v5;
var intercepted = kotlin_kotlin.$_$.z5;
var ArrayList = kotlin_kotlin.$_$.b3;
var IllegalStateException_init_$Create$_0 = kotlin_kotlin.$_$.t1;
var plus = kotlin_kotlin.$_$.l6;
var get_0 = kotlin_kotlin.$_$.i6;
var fold = kotlin_kotlin.$_$.h6;
var minusKey_0 = kotlin_kotlin.$_$.j6;
var anyToString = kotlin_kotlin.$_$.q6;
var Companion_instance = kotlin_kotlin.$_$.z2;
var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.p2;
var createFailure = kotlin_kotlin.$_$.rb;
var UnsupportedOperationException = kotlin_kotlin.$_$.nb;
var atomicfu$AtomicRefArray$ofNulls = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.a;
var ensureNotNull = kotlin_kotlin.$_$.sb;
var toLong = kotlin_kotlin.$_$.b8;
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.o1;
var atomic$long$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.c;
var listOf = kotlin_kotlin.$_$.t4;
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.p;
var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.w1;
var compareTo = kotlin_kotlin.$_$.z6;
var last = kotlin_kotlin.$_$.s9;
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.h2;
var initMetadataForCompanion = kotlin_kotlin.$_$.j7;
var IllegalStateException = kotlin_kotlin.$_$.eb;
var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.q1;
var NoSuchElementException = kotlin_kotlin.$_$.hb;
var NoSuchElementException_init_$Init$ = kotlin_kotlin.$_$.x1;
var getKClass = kotlin_kotlin.$_$.e;
var Unit = kotlin_kotlin.$_$.mb;
var Exception = kotlin_kotlin.$_$.cb;
var Exception_init_$Init$ = kotlin_kotlin.$_$.l1;
var defineProp = kotlin_kotlin.$_$.a7;
var toLongOrNull = kotlin_kotlin.$_$.oa;
var createCoroutineUnintercepted_0 = kotlin_kotlin.$_$.x5;
var startCoroutineUninterceptedOrReturnNonGeneratorVersion = kotlin_kotlin.$_$.a6;
var plus_0 = kotlin_kotlin.$_$.z4;
var KtList = kotlin_kotlin.$_$.e3;
var listOf_0 = kotlin_kotlin.$_$.s4;
var getKClassFromExpression = kotlin_kotlin.$_$.d;
var Exception_init_$Create$ = kotlin_kotlin.$_$.k1;
var removeFirstOrNull = kotlin_kotlin.$_$.a5;
var KtMutableList = kotlin_kotlin.$_$.j3;
var CancellationException_init_$Init$ = kotlin_kotlin.$_$.x;
var CancellationException_init_$Create$_0 = kotlin_kotlin.$_$.y;
var HashSet_init_$Create$ = kotlin_kotlin.$_$.r;
var RuntimeException_init_$Init$_0 = kotlin_kotlin.$_$.c2;
var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.v;
//endregion
//region block: pre-declaration
function cancel$default(cause, $super) {
cause = cause === VOID ? null : cause;
var tmp;
if ($super === VOID) {
this.qn(cause);
tmp = Unit_instance;
} else {
tmp = $super.qn.call(this, cause);
}
return tmp;
}
function invokeOnCompletion$default(onCancelling, invokeImmediately, handler, $super) {
onCancelling = onCancelling === VOID ? false : onCancelling;
invokeImmediately = invokeImmediately === VOID ? true : invokeImmediately;
return $super === VOID ? this.ln(onCancelling, invokeImmediately, handler) : $super.ln.call(this, onCancelling, invokeImmediately, handler);
}
initMetadataForInterface(Job, 'Job', VOID, VOID, [Element], [0]);
initMetadataForInterface(ParentJob, 'ParentJob', VOID, VOID, [Job], [0]);
initMetadataForClass(JobSupport, 'JobSupport', VOID, VOID, [Job, ParentJob], [0]);
initMetadataForInterface(CoroutineScope, 'CoroutineScope');
initMetadataForClass(AbstractCoroutine, 'AbstractCoroutine', VOID, JobSupport, [JobSupport, Job, Continuation, CoroutineScope], [0]);
initMetadataForClass(StandaloneCoroutine, 'StandaloneCoroutine', VOID, AbstractCoroutine, VOID, [0]);
initMetadataForClass(LazyStandaloneCoroutine, 'LazyStandaloneCoroutine', VOID, StandaloneCoroutine, VOID, [0]);
initMetadataForCoroutine($awaitCOROUTINE$, CoroutineImpl);
initMetadataForClass(DeferredCoroutine, 'DeferredCoroutine', VOID, AbstractCoroutine, [AbstractCoroutine, Job], [0]);
initMetadataForClass(LazyDeferredCoroutine, 'LazyDeferredCoroutine', VOID, DeferredCoroutine, VOID, [0]);
initMetadataForInterface(CancellableContinuation, 'CancellableContinuation', VOID, VOID, [Continuation]);
initMetadataForInterface(NotCompleted, 'NotCompleted');
initMetadataForInterface(CancelHandler, 'CancelHandler', VOID, VOID, [NotCompleted]);
initMetadataForClass(DisposeOnCancel, 'DisposeOnCancel', VOID, VOID, [CancelHandler]);
initMetadataForInterface(Runnable, 'Runnable');
initMetadataForClass(SchedulerTask, 'SchedulerTask', VOID, VOID, [Runnable]);
initMetadataForClass(DispatchedTask, 'DispatchedTask', VOID, SchedulerTask);
initMetadataForInterface(Waiter, 'Waiter');
initMetadataForClass(CancellableContinuationImpl, 'CancellableContinuationImpl', VOID, DispatchedTask, [DispatchedTask, CancellableContinuation, Waiter]);
initMetadataForClass(UserSupplied, 'UserSupplied', VOID, VOID, [CancelHandler]);
initMetadataForObject(Active, 'Active', VOID, VOID, [NotCompleted]);
initMetadataForClass(CompletedContinuation, 'CompletedContinuation');
initMetadataForClass(LockFreeLinkedListNode, 'LockFreeLinkedListNode', LockFreeLinkedListNode);
initMetadataForInterface(Incomplete, 'Incomplete');
initMetadataForClass(JobNode, 'JobNode', VOID, LockFreeLinkedListNode, [LockFreeLinkedListNode, Incomplete]);
initMetadataForClass(ChildContinuation, 'ChildContinuation', VOID, JobNode);
initMetadataForCoroutine($awaitCOROUTINE$_0, CoroutineImpl);
initMetadataForClass(CompletableDeferredImpl, 'CompletableDeferredImpl', VOID, JobSupport, [JobSupport, Job], [0]);
initMetadataForInterface(CompletableJob, 'CompletableJob', VOID, VOID, [Job], [0]);
initMetadataForClass(CompletedExceptionally, 'CompletedExceptionally');
initMetadataForClass(CancelledContinuation, 'CancelledContinuation', VOID, CompletedExceptionally);
initMetadataForObject(Key, 'Key', VOID, AbstractCoroutineContextKey);
initMetadataForClass(CoroutineDispatcher, 'CoroutineDispatcher', VOID, AbstractCoroutineContextElement, [AbstractCoroutineContextElement, ContinuationInterceptor]);
initMetadataForObject(Key_0, 'Key');
initMetadataForObject(Key_1, 'Key');
initMetadataForClass(CoroutineName, 'CoroutineName', VOID, AbstractCoroutineContextElement);
initMetadataForObject(GlobalScope, 'GlobalScope', VOID, VOID, [CoroutineScope]);
initMetadataForClass(CoroutineStart, 'CoroutineStart', VOID, Enum);
initMetadataForInterface(CopyableThrowable, 'CopyableThrowable');
initMetadataForClass(EventLoop, 'EventLoop', VOID, CoroutineDispatcher);
initMetadataForObject(ThreadLocalEventLoop, 'ThreadLocalEventLoop');
initMetadataForClass(CompletionHandlerException, 'CompletionHandlerException', VOID, RuntimeException);
initMetadataForClass(CoroutinesInternalError, 'CoroutinesInternalError', VOID, Error_0);
initMetadataForObject(Key_2, 'Key');
initMetadataForObject(NonDisposableHandle, 'NonDisposableHandle');
initMetadataForClass(Empty, 'Empty', VOID, VOID, [Incomplete]);
initMetadataForClass(LockFreeLinkedListHead, 'LockFreeLinkedListHead', LockFreeLinkedListHead, LockFreeLinkedListNode);
initMetadataForClass(NodeList, 'NodeList', NodeList, LockFreeLinkedListHead, [LockFreeLinkedListHead, Incomplete]);
initMetadataForClass(SynchronizedObject, 'SynchronizedObject', SynchronizedObject);
initMetadataForClass(Finishing, 'Finishing', VOID, SynchronizedObject, [SynchronizedObject, Incomplete]);
initMetadataForClass(ChildCompletion, 'ChildCompletion', VOID, JobNode);
initMetadataForClass(AwaitContinuation, 'AwaitContinuation', VOID, CancellableContinuationImpl);
initMetadataForClass(InactiveNodeList, 'InactiveNodeList', VOID, VOID, [Incomplete]);
initMetadataForClass(InvokeOnCompletion, 'InvokeOnCompletion', VOID, JobNode);
initMetadataForClass(InvokeOnCancelling, 'InvokeOnCancelling', VOID, JobNode);
initMetadataForClass(ResumeOnCompletion, 'ResumeOnCompletion', VOID, JobNode);
initMetadataForClass(ChildHandleNode, 'ChildHandleNode', VOID, JobNode);
initMetadataForClass(ResumeAwaitOnCompletion, 'ResumeAwaitOnCompletion', VOID, JobNode);
initMetadataForClass(IncompleteStateBox, 'IncompleteStateBox');
initMetadataForClass(JobImpl, 'JobImpl', VOID, JobSupport, [JobSupport, CompletableJob], [0]);
initMetadataForClass(MainCoroutineDispatcher, 'MainCoroutineDispatcher', VOID, CoroutineDispatcher);
initMetadataForClass(SupervisorJobImpl, 'SupervisorJobImpl', VOID, JobImpl, VOID, [0]);
initMetadataForClass(TimeoutCancellationException, 'TimeoutCancellationException', VOID, CancellationException, [CancellationException, CopyableThrowable]);
initMetadataForObject(Unconfined, 'Unconfined', VOID, CoroutineDispatcher);
initMetadataForObject(Key_3, 'Key');
initMetadataForClass(BufferOverflow, 'BufferOverflow', VOID, Enum);
initMetadataForClass(ConcurrentLinkedListNode, 'ConcurrentLinkedListNode');
initMetadataForClass(Segment, 'Segment', VOID, ConcurrentLinkedListNode, [ConcurrentLinkedListNode, NotCompleted]);
initMetadataForClass(ChannelSegment, 'ChannelSegment', VOID, Segment);
initMetadataForCoroutine($hasNextCOROUTINE$, CoroutineImpl);
initMetadataForClass(SendBroadcast, 'SendBroadcast', VOID, VOID, [Waiter]);
initMetadataForClass(BufferedChannelIterator, 'BufferedChannelIterator', VOID, VOID, [Waiter], [0, 3]);
initMetadataForCoroutine($sendCOROUTINE$, CoroutineImpl);
function close$default(cause, $super) {
cause = cause === VOID ? null : cause;
return $super === VOID ? this.m12(cause) : $super.m12.call(this, cause);
}
initMetadataForInterface(SendChannel, 'SendChannel', VOID, VOID, VOID, [1]);
function cancel$default_0(cause, $super) {
cause = cause === VOID ? null : cause;
var tmp;
if ($super === VOID) {
this.qn(cause);
tmp = Unit_instance;
} else {
tmp = $super.qn.call(this, cause);
}
return tmp;
}
initMetadataForInterface(ReceiveChannel, 'ReceiveChannel', VOID, VOID, VOID, [0]);
initMetadataForClass(BufferedChannel, 'BufferedChannel', VOID, VOID, [SendChannel, ReceiveChannel], [1, 4, 0, 3]);
initMetadataForClass(WaiterEB, 'WaiterEB');
initMetadataForClass(ReceiveCatching, 'ReceiveCatching', VOID, VOID, [Waiter]);
initMetadataForObject(Factory, 'Factory');
initMetadataForClass(Failed, 'Failed', Failed);
initMetadataForClass(Closed, 'Closed', VOID, Failed);
initMetadataForCompanion(Companion);
initMetadataForClass(ChannelResult, 'ChannelResult');
initMetadataForClass(ClosedSendChannelException, 'ClosedSendChannelException', VOID, IllegalStateException);
initMetadataForClass(ClosedReceiveChannelException, 'ClosedReceiveChannelException', VOID, NoSuchElementException);
initMetadataForClass(ChannelCoroutine, 'ChannelCoroutine', VOID, AbstractCoroutine, [AbstractCoroutine, SendChannel, ReceiveChannel], [1, 0]);
initMetadataForClass(ConflatedBufferedChannel, 'ConflatedBufferedChannel', VOID, BufferedChannel, VOID, [1, 0]);
initMetadataForInterface(ProducerScope, 'ProducerScope', VOID, VOID, [CoroutineScope, SendChannel], [1]);
initMetadataForClass(ProducerCoroutine, 'ProducerCoroutine', VOID, ChannelCoroutine, [ChannelCoroutine, ProducerScope], [1, 0]);
initMetadataForClass(SegmentOrClosed, 'SegmentOrClosed');
initMetadataForObject(ExceptionSuccessfullyProcessed, 'ExceptionSuccessfullyProcessed', VOID, Exception);
initMetadataForClass(DispatchedContinuation, 'DispatchedContinuation', VOID, DispatchedTask, [DispatchedTask, Continuation]);
initMetadataForClass(DispatchException, 'DispatchException', VOID, Exception);
initMetadataForClass(UndeliveredElementException, 'UndeliveredElementException', VOID, RuntimeException);
initMetadataForClass(ContextScope, 'ContextScope', VOID, VOID, [CoroutineScope]);
initMetadataForClass(Symbol, 'Symbol');
initMetadataForInterface(SelectInstance, 'SelectInstance');
initMetadataForClass(ClauseData, 'ClauseData', VOID, VOID, VOID, [1]);
initMetadataForClass(SelectImplementation, 'SelectImplementation', VOID, VOID, [CancelHandler, Waiter, SelectInstance], [0, 2]);
initMetadataForClass(TrySelectDetailedResult, 'TrySelectDetailedResult', VOID, Enum);
initMetadataForClass(SetTimeoutBasedDispatcher, 'SetTimeoutBasedDispatcher', VOID, CoroutineDispatcher, VOID, [1]);
initMetadataForObject(NodeDispatcher, 'NodeDispatcher', VOID, SetTimeoutBasedDispatcher, VOID, [1]);
initMetadataForClass(MessageQueue, 'MessageQueue', VOID, VOID, [KtMutableList]);
initMetadataForClass(ScheduledMessageQueue, 'ScheduledMessageQueue', VOID, MessageQueue);
initMetadataForClass(WindowMessageQueue, 'WindowMessageQueue', VOID, MessageQueue);
initMetadataForClass(UnconfinedEventLoop, 'UnconfinedEventLoop', UnconfinedEventLoop, EventLoop);
initMetadataForObject(SetTimeoutDispatcher, 'SetTimeoutDispatcher', VOID, SetTimeoutBasedDispatcher, VOID, [1]);
initMetadataForClass(WindowDispatcher, 'WindowDispatcher', VOID, CoroutineDispatcher, VOID, [1]);
initMetadataForObject(Dispatchers, 'Dispatchers');
initMetadataForClass(JsMainDispatcher, 'JsMainDispatcher', VOID, MainCoroutineDispatcher);
initMetadataForClass(JobCancellationException, 'JobCancellationException', VOID, CancellationException);
initMetadataForClass(DiagnosticCoroutineContextException, 'DiagnosticCoroutineContextException', VOID, RuntimeException);
initMetadataForClass(ListClosed, 'ListClosed', VOID, LockFreeLinkedListNode);
initMetadataForClass(CommonThreadLocal, 'CommonThreadLocal', CommonThreadLocal);
//endregion
function AbstractCoroutine(parentContext, initParentJob, active) {
JobSupport.call(this, active);
if (initParentJob) {
this.em(parentContext.z8(Key_instance_3));
}
this.hm_1 = parentContext.nh(this);
}
protoOf(AbstractCoroutine).s8 = function () {
return this.hm_1;
};
protoOf(AbstractCoroutine).im = function () {
return this.hm_1;
};
protoOf(AbstractCoroutine).jm = function () {
return protoOf(JobSupport).jm.call(this);
};
protoOf(AbstractCoroutine).km = function (value) {
};
protoOf(AbstractCoroutine).lm = function (cause, handled) {
};
protoOf(AbstractCoroutine).mm = function () {
return get_classSimpleName(this) + ' was cancelled';
};
protoOf(AbstractCoroutine).nm = function (state) {
if (state instanceof CompletedExceptionally) {
this.lm(state.om_1, state.qm());
} else {
this.km((state == null ? true : !(state == null)) ? state : THROW_CCE());
}
};
protoOf(AbstractCoroutine).x8 = function (result) {
var state = this.rm(toState_0(result));
if (state === get_COMPLETING_WAITING_CHILDREN())
return Unit_instance;
this.sm(state);
};
protoOf(AbstractCoroutine).sm = function (state) {
return this.tm(state);
};
protoOf(AbstractCoroutine).um = function (exception) {
handleCoroutineException(this.hm_1, exception);
};
protoOf(AbstractCoroutine).vm = function () {
var tmp0_elvis_lhs = get_coroutineName(this.hm_1);
var tmp;
if (tmp0_elvis_lhs == null) {
return protoOf(JobSupport).vm.call(this);
} else {
tmp = tmp0_elvis_lhs;
}
var coroutineName = tmp;
return '"' + coroutineName + '":' + protoOf(JobSupport).vm.call(this);
};
protoOf(AbstractCoroutine).wm = function (start, receiver, block) {
start.zm(block, receiver, this);
};
function launch(_this__u8e3s4, context, start, block) {
context = context === VOID ? EmptyCoroutineContext_getInstance() : context;
start = start === VOID ? CoroutineStart_DEFAULT_getInstance() : start;
var newContext = newCoroutineContext(_this__u8e3s4, context);
var coroutine = start.ho() ? new LazyStandaloneCoroutine(newContext, block) : new StandaloneCoroutine(newContext, true);
coroutine.wm(start, coroutine, block);
return coroutine;
}
function async(_this__u8e3s4, context, start, block) {
context = context === VOID ? EmptyCoroutineContext_getInstance() : context;
start = start === VOID ? CoroutineStart_DEFAULT_getInstance() : start;
var newContext = newCoroutineContext(_this__u8e3s4, context);
var coroutine = start.ho() ? new LazyDeferredCoroutine(newContext, block) : new DeferredCoroutine(newContext, true);
coroutine.wm(start, coroutine, block);
return coroutine;
}
function StandaloneCoroutine(parentContext, active) {
AbstractCoroutine.call(this, parentContext, true, active);
}
protoOf(StandaloneCoroutine).co = function (exception) {
handleCoroutineException(this.hm_1, exception);
return true;
};
function LazyStandaloneCoroutine(parentContext, block) {
StandaloneCoroutine.call(this, parentContext, false);
this.oo_1 = createCoroutineUnintercepted(block, this, this);
}
protoOf(LazyStandaloneCoroutine).gn = function () {
startCoroutineCancellable_0(this.oo_1, this);
};
function $awaitCOROUTINE$(_this__u8e3s4, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.xo_1 = _this__u8e3s4;
}
protoOf($awaitCOROUTINE$).u8 = function () {
var suspendResult = this.o8_1;
$sm: do
try {
var tmp = this.m8_1;
switch (tmp) {
case 0:
this.n8_1 = 2;
this.m8_1 = 1;
suspendResult = this.xo_1.go(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
return (suspendResult == null ? true : !(suspendResult == null)) ? suspendResult : THROW_CCE();
case 2:
throw this.p8_1;
}
} catch ($p) {
var e = $p;
if (this.n8_1 === 2) {
throw e;
} else {
this.m8_1 = this.n8_1;
this.p8_1 = e;
}
}
while (true);
};
function DeferredCoroutine(parentContext, active) {
AbstractCoroutine.call(this, parentContext, true, active);
}
protoOf(DeferredCoroutine).bp = function () {
var tmp = this.fo();
return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
};
protoOf(DeferredCoroutine).cp = function ($completion) {
var tmp = new $awaitCOROUTINE$(this, $completion);
tmp.o8_1 = Unit_instance;
tmp.p8_1 = null;
return tmp.u8();
};
function LazyDeferredCoroutine(parentContext, block) {
DeferredCoroutine.call(this, parentContext, false);
this.gp_1 = createCoroutineUnintercepted(block, this, this);
}
protoOf(LazyDeferredCoroutine).gn = function () {
startCoroutineCancellable_0(this.gp_1, this);
};
function CancellableContinuation() {
}
function disposeOnCancellation(_this__u8e3s4, handle) {
return invokeOnCancellation(_this__u8e3s4, new DisposeOnCancel(handle));
}
function invokeOnCancellation(_this__u8e3s4, handler) {
var tmp;
if (_this__u8e3s4 instanceof CancellableContinuationImpl) {
_this__u8e3s4.qp(handler);
tmp = Unit_instance;
} else {
throw UnsupportedOperationException_init_$Create$('third-party implementation of CancellableContinuation is not supported');
}
return tmp;
}
function DisposeOnCancel(handle) {
this.rp_1 = handle;
}
protoOf(DisposeOnCancel).sp = function (cause) {
return this.rp_1.tp();
};
protoOf(DisposeOnCancel).toString = function () {
return 'DisposeOnCancel[' + toString(this.rp_1) + ']';
};
function getOrCreateCancellableContinuation(delegate) {
if (!(delegate instanceof DispatchedContinuation)) {
return new CancellableContinuationImpl(delegate, 1);
}
var tmp0_safe_receiver = delegate.aq();
var tmp;
if (tmp0_safe_receiver == null) {
tmp = null;
} else {
// Inline function 'kotlin.takeIf' call
var tmp_0;
if (tmp0_safe_receiver.bq()) {
tmp_0 = tmp0_safe_receiver;
} else {
tmp_0 = null;
}
tmp = tmp_0;
}
var tmp1_elvis_lhs = tmp;
var tmp_1;
if (tmp1_elvis_lhs == null) {
return new CancellableContinuationImpl(delegate, 2);
} else {
tmp_1 = tmp1_elvis_lhs;
}
return tmp_1;
}
function get_RESUME_TOKEN() {
_init_properties_CancellableContinuationImpl_kt__6rrtdd();
return RESUME_TOKEN;
}
var RESUME_TOKEN;
function _get_parentHandle__f8dcex($this) {
return $this.pp_1.kotlinx$atomicfu$value;
}
function _get_stateDebugRepresentation__bf18u4($this) {
var tmp0_subject = $this.cn();
var tmp;
if (!(tmp0_subject == null) ? isInterface(tmp0_subject, NotCompleted) : false) {
tmp = 'Active';
} else {
if (tmp0_subject instanceof CancelledContinuation) {
tmp = 'Cancelled';
} else {
tmp = 'Completed';
}
}
return tmp;
}
function isReusable($this) {
var tmp;
if (get_isReusableMode($this.dq_1)) {
var tmp_0 = $this.lp_1;
tmp = (tmp_0 instanceof DispatchedContinuation ? tmp_0 : THROW_CCE()).cq();
} else {
tmp = false;
}
return tmp;
}
function cancelLater($this, cause) {
if (!isReusable($this))
return false;
var tmp = $this.lp_1;
var dispatched = tmp instanceof DispatchedContinuation ? tmp : THROW_CCE();
return dispatched.eq(cause);
}
function callSegmentOnCancellation($this, segment, cause) {
// Inline function 'kotlinx.coroutines.index' call
var index = $this.np_1.kotlinx$atomicfu$value & 536870911;
// Inline function 'kotlin.check' call
if (!!(index === 536870911)) {
var message = 'The index for Segment.onCancellation(..) is broken';
throw IllegalStateException_init_$Create$(toString(message));
}
// Inline function 'kotlinx.coroutines.CancellableContinuationImpl.callCancelHandlerSafely' call
try {
segment.jq(index, cause, $this.s8());
} catch ($p) {
if ($p instanceof Error) {
var ex = $p;
handleCoroutineException($this.s8(), new CompletionHandlerException('Exception in invokeOnCancellation handler for ' + $this.toString(), ex));
} else {
throw $p;
}
}
}
function trySuspend($this) {
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = $this.np_1;
while (true) {
var cur = this_0.kotlinx$atomicfu$value;
// Inline function 'kotlinx.coroutines.decision' call
switch (cur >> 29) {
case 0:
// Inline function 'kotlinx.coroutines.index' call
// Inline function 'kotlinx.coroutines.decisionAndIndex' call
var tmp$ret$2 = (1 << 29) + (cur & 536870911) | 0;
if ($this.np_1.atomicfu$compareAndSet(cur, tmp$ret$2))
return true;
break;
case 2:
return false;
default:
// Inline function 'kotlin.error' call
var message = 'Already suspended';
throw IllegalStateException_init_$Create$(toString(message));
}
}
}
function tryResume($this) {
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = $this.np_1;
while (true) {
var cur = this_0.kotlinx$atomicfu$value;
// Inline function 'kotlinx.coroutines.decision' call
switch (cur >> 29) {
case 0:
// Inline function 'kotlinx.coroutines.index' call
// Inline function 'kotlinx.coroutines.decisionAndIndex' call
var tmp$ret$2 = (2 << 29) + (cur & 536870911) | 0;
if ($this.np_1.atomicfu$compareAndSet(cur, tmp$ret$2))
return true;
break;
case 1:
return false;
default:
// Inline function 'kotlin.error' call
var message = 'Already resumed';
throw IllegalStateException_init_$Create$(toString(message));
}
}
}
function installParentHandle($this) {
var tmp0_elvis_lhs = $this.s8().z8(Key_instance_3);
var tmp;
if (tmp0_elvis_lhs == null) {
return null;
} else {
tmp = tmp0_elvis_lhs;
}
var parent = tmp;
var handle = invokeOnCompletion(parent, VOID, new ChildContinuation($this));
$this.pp_1.atomicfu$compareAndSet(null, handle);
return handle;
}
function invokeOnCancellationImpl($this, handler) {
// Inline function 'kotlinx.coroutines.assert' call
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = $this.op_1;
while (true) {
var state = this_0.kotlinx$atomicfu$value;
if (state instanceof Active) {
if ($this.op_1.atomicfu$compareAndSet(state, handler))
return Unit_instance;
} else {
var tmp;
if (!(state == null) ? isInterface(state, CancelHandler) : false) {
tmp = true;
} else {
tmp = state instanceof Segment;
}
if (tmp) {
multipleHandlersError($this, handler, state);
} else {
if (state instanceof CompletedExceptionally) {
if (!state.sq()) {
multipleHandlersError($this, handler, state);
}
if (state instanceof CancelledContinuation) {
var tmp1_safe_receiver = state instanceof CompletedExceptionally ? state : null;
var cause = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.om_1;
if (isInterface(handler, CancelHandler)) {
$this.pq(handler, cause);
} else {
var segment = handler instanceof Segment ? handler : THROW_CCE();
callSegmentOnCancellation($this, segment, cause);
}
}
return Unit_instance;
} else {
if (state instanceof CompletedContinuation) {
if (!(state.lq_1 == null)) {
multipleHandlersError($this, handler, state);
}
if (handler instanceof Segment)
return Unit_instance;
if (!isInterface(handler, CancelHandler))
THROW_CCE();
if (state.qq()) {
$this.pq(handler, state.oq_1);
return Unit_instance;
}
var update = state.rq(VOID, handler);
if ($this.op_1.atomicfu$compareAndSet(state, update))
return Unit_instance;
} else {
if (handler instanceof Segment)
return Unit_instance;
if (!isInterface(handler, CancelHandler))
THROW_CCE();
var update_0 = new CompletedContinuation(state, handler);
if ($this.op_1.atomicfu$compareAndSet(state, update_0))
return Unit_instance;
}
}
}
}
}
}
function multipleHandlersError($this, handler, state) {
// Inline function 'kotlin.error' call
var message = "It's prohibited to register multiple handlers, tried to register " + toString(handler) + ', already has ' + toString_0(state);
throw IllegalStateException_init_$Create$(toString(message));
}
function dispatchResume($this, mode) {
if (tryResume($this))
return Unit_instance;
dispatch($this, mode);
}
function resumedState($this, state, proposedUpdate, resumeMode, onCancellation, idempotent) {
var tmp;
if (proposedUpdate instanceof CompletedExceptionally) {
// Inline function 'kotlinx.coroutines.assert' call
// Inline function 'kotlinx.coroutines.assert' call
tmp = proposedUpdate;
} else {
if (!get_isCancellableMode(resumeMode) && idempotent == null) {
tmp = proposedUpdate;
} else {
var tmp_0;
var tmp_1;
if (!(onCancellation == null)) {
tmp_1 = true;
} else {
tmp_1 = isInterface(state, CancelHandler);
}
if (tmp_1) {
tmp_0 = true;
} else {
tmp_0 = !(idempotent == null);
}
if (tmp_0) {
tmp = new CompletedContinuation(proposedUpdate, isInterface(state, CancelHandler) ? state : null, onCancellation, idempotent);
} else {
tmp = proposedUpdate;
}
}
}
return tmp;
}
function tryResumeImpl($this, proposedUpdate, idempotent, onCancellation) {
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = $this.op_1;
while (true) {
var tmp0 = this_0.kotlinx$atomicfu$value;
$l$block: {
if (!(tmp0 == null) ? isInterface(tmp0, NotCompleted) : false) {
var update = resumedState($this, tmp0, proposedUpdate, $this.dq_1, onCancellation, idempotent);
if (!$this.op_1.atomicfu$compareAndSet(tmp0, update)) {
break $l$block;
}
detachChildIfNonReusable($this);
return get_RESUME_TOKEN();
} else {
if (tmp0 instanceof CompletedContinuation) {
var tmp;
if (!(idempotent == null) && tmp0.nq_1 === idempotent) {
// Inline function 'kotlinx.coroutines.assert' call
tmp = get_RESUME_TOKEN();
} else {
tmp = null;
}
return tmp;
} else {
return null;
}
}
}
}
}
function alreadyResumedError($this, proposedUpdate) {
// Inline function 'kotlin.error' call
var message = 'Already resumed, but proposed with update ' + toString_0(proposedUpdate);
throw IllegalStateException_init_$Create$(toString(message));
}
function detachChildIfNonReusable($this) {
if (!isReusable($this)) {
$this.tq();
}
}
function CancellableContinuationImpl(delegate, resumeMode) {
DispatchedTask.call(this, resumeMode);
this.lp_1 = delegate;
// Inline function 'kotlinx.coroutines.assert' call
this.mp_1 = this.lp_1.s8();
var tmp = this;
// Inline function 'kotlinx.coroutines.decisionAndIndex' call
var tmp$ret$1 = (0 << 29) + 536870911 | 0;
tmp.np_1 = atomic$int$1(tmp$ret$1);
this.op_1 = atomic$ref$1(Active_instance);
this.pp_1 = atomic$ref$1(null);
}
protoOf(CancellableContinuationImpl).uq = function () {
return this.lp_1;
};
protoOf(CancellableContinuationImpl).s8 = function () {
return this.mp_1;
};
protoOf(CancellableContinuationImpl).cn = function () {
return this.op_1.kotlinx$atomicfu$value;
};
protoOf(CancellableContinuationImpl).dn = function () {
var tmp = this.cn();
return !(!(tmp == null) ? isInterface(tmp, NotCompleted) : false);
};
protoOf(CancellableContinuationImpl).en = function () {
var tmp = this.cn();
return tmp instanceof CancelledContinuation;
};
protoOf(CancellableContinuationImpl).vq = function () {
var tmp0_elvis_lhs = installParentHandle(this);
var tmp;
if (tmp0_elvis_lhs == null) {
return Unit_instance;
} else {
tmp = tmp0_elvis_lhs;
}
var handle = tmp;
if (this.dn()) {
handle.tp();
this.pp_1.kotlinx$atomicfu$value = NonDisposableHandle_instance;
}
};
protoOf(CancellableContinuationImpl).bq = function () {
// Inline function 'kotlinx.coroutines.assert' call
// Inline function 'kotlinx.coroutines.assert' call
var state = this.op_1.kotlinx$atomicfu$value;
// Inline function 'kotlinx.coroutines.assert' call
var tmp;
if (state instanceof CompletedContinuation) {
tmp = !(state.nq_1 == null);
} else {
tmp = false;
}
if (tmp) {
this.tq();
return false;
}
var tmp_0 = this.np_1;
// Inline function 'kotlinx.coroutines.decisionAndIndex' call
tmp_0.kotlinx$atomicfu$value = (0 << 29) + 536870911 | 0;
this.op_1.kotlinx$atomicfu$value = Active_instance;
return true;
};
protoOf(CancellableContinuationImpl).wq = function () {
return this.cn();
};
protoOf(CancellableContinuationImpl).xq = function (takenState, cause) {
var this_0 = this.op_1;
while (true) {
var state = this_0.kotlinx$atomicfu$value;
if (!(state == null) ? isInterface(state, NotCompleted) : false) {
// Inline function 'kotlin.error' call
var message = 'Not completed';
throw IllegalStateException_init_$Create$(toString(message));
} else {
if (state instanceof CompletedExceptionally)
return Unit_instance;
else {
if (state instanceof CompletedContinuation) {
// Inline function 'kotlin.check' call
if (!!state.qq()) {
var message_0 = 'Must be called at most once';
throw IllegalStateException_init_$Create$(toString(message_0));
}
var update = state.rq(VOID, VOID, VOID, VOID, cause);
if (this.op_1.atomicfu$compareAndSet(state, update)) {
state.yq(this, cause);
return Unit_instance;
}
} else {
if (this.op_1.atomicfu$compareAndSet(state, new CompletedContinuation(state, VOID, VOID, VOID, cause))) {
return Unit_instance;
}
}
}
}
}
return Unit_instance;
};
protoOf(CancellableContinuationImpl).zq = function (cause) {
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = this.op_1;
while (true) {
var tmp0 = this_0.kotlinx$atomicfu$value;
$l$block: {
if (!(!(tmp0 == null) ? isInterface(tmp0, NotCompleted) : false))
return false;
var tmp;
if (isInterface(tmp0, CancelHandler)) {
tmp = true;
} else {
tmp = tmp0 instanceof Segment;
}
var update = new CancelledContinuation(this, cause, tmp);
if (!this.op_1.atomicfu$compareAndSet(tmp0, update)) {
break $l$block;
}
if (isInterface(tmp0, CancelHandler)) {
this.pq(tmp0, cause);
} else {
if (tmp0 instanceof Segment) {
callSegmentOnCancellation(this, tmp0, cause);
}
}
detachChildIfNonReusable(this);
dispatchResume(this, this.dq_1);
return true;
}
}
};
protoOf(CancellableContinuationImpl).ar = function (cause) {
if (cancelLater(this, cause))
return Unit_instance;
this.zq(cause);
detachChildIfNonReusable(this);
};
protoOf(CancellableContinuationImpl).pq = function (handler, cause) {
// Inline function 'kotlinx.coroutines.CancellableContinuationImpl.callCancelHandlerSafely' call
try {
handler.sp(cause);
} catch ($p) {
if ($p instanceof Error) {
var ex = $p;
handleCoroutineException(this.s8(), new CompletionHandlerException('Exception in invokeOnCancellation handler for ' + this.toString(), ex));
} else {
throw $p;
}
}
return Unit_instance;
};
protoOf(CancellableContinuationImpl).br = function (onCancellation, cause, value) {
try {
onCancellation(cause, value, this.s8());
} catch ($p) {
if ($p instanceof Error) {
var ex = $p;
handleCoroutineException(this.s8(), new CompletionHandlerException('Exception in resume onCancellation handler for ' + this.toString(), ex));
} else {
throw $p;
}
}
};
protoOf(CancellableContinuationImpl).cr = function (parent) {
return parent.hn();
};
protoOf(CancellableContinuationImpl).dr = function () {
var isReusable_0 = isReusable(this);
if (trySuspend(this)) {
if (_get_parentHandle__f8dcex(this) == null) {
installParentHandle(this);
}
if (isReusable_0) {
this.er();
}
return get_COROUTINE_SUSPENDED();
}
if (isReusable_0) {
this.er();
}
var state = this.cn();
if (state instanceof CompletedExceptionally)
throw recoverStackTrace(state.om_1, this);
if (get_isCancellableMode(this.dq_1)) {
var job = this.s8().z8(Key_instance_3);
if (!(job == null) && !job.jm()) {
var cause = job.hn();
this.xq(state, cause);
throw recoverStackTrace(cause, this);
}
}
return this.fr(state);
};
protoOf(CancellableContinuationImpl).er = function () {
var tmp = this.lp_1;
var tmp0_safe_receiver = tmp instanceof DispatchedContinuation ? tmp : null;
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.gr(this);
var tmp_0;
if (tmp1_elvis_lhs == null) {
return Unit_instance;
} else {
tmp_0 = tmp1_elvis_lhs;
}
var cancellationCause = tmp_0;
this.tq();
this.zq(cancellationCause);
};
protoOf(CancellableContinuationImpl).x8 = function (result) {
return this.hr(toState(result, this), this.dq_1);
};
protoOf(CancellableContinuationImpl).ir = function (value, onCancellation) {
return this.jr(value, this.dq_1, onCancellation);
};
protoOf(CancellableContinuationImpl).kr = function (segment, index) {
var tmp0 = this.np_1;
$l$block: {
// Inline function 'kotlinx.atomicfu.update' call
while (true) {
var cur = tmp0.kotlinx$atomicfu$value;
// Inline function 'kotlinx.coroutines.index' call
// Inline function 'kotlin.check' call
if (!((cur & 536870911) === 536870911)) {
var message = 'invokeOnCancellation should be called at most once';
throw IllegalStateException_init_$Create$(toString(message));
}
// Inline function 'kotlinx.coroutines.decision' call
// Inline function 'kotlinx.coroutines.decisionAndIndex' call
var upd = (cur >> 29 << 29) + index | 0;
if (tmp0.atomicfu$compareAndSet(cur, upd)) {
break $l$block;
}
}
}
invokeOnCancellationImpl(this, segment);
};
protoOf(CancellableContinuationImpl).jp = function (handler) {
return invokeOnCancellation(this, new UserSupplied(handler));
};
protoOf(CancellableContinuationImpl).qp = function (handler) {
return invokeOnCancellationImpl(this, handler);
};
protoOf(CancellableContinuationImpl).jr = function (proposedUpdate, resumeMode, onCancellation) {
// Inline function 'kotlinx.atomicfu.loop' call
var this_0 = this.op_1;
while (true) {
var tmp0 = this_0.kotlinx$atomicfu$value;
$l$block: {
if (!(tmp0 == null) ? isInterface(tmp0, NotCompleted) : false) {
var update = resumedState(this, tmp0, proposedUpdate, resumeMode, onCancellation, null);
if (!this.op_1.atomicfu$compareAndSet(tmp0, update)) {
break $l$block;
}
detachChildIfNonReusable(this);
dispatchResume(this, resumeMode);
return Unit_instance;
} else {
if (tmp0 instanceof CancelledContinuation) {
if (tmp0.or()) {
if (onCancellation == null)
null;
else {
// Inline function 'kotlin.let' call
this.br(onCancellation, tmp0.om_1, proposedUpdate);
}
return Unit_instance;
}
}
}
alreadyResumedError(this, proposedUpdate);
}
}
};
protoOf(CancellableContinuationImpl).hr = function (proposedUpdate, resumeMode, onCancellation, $super) {
onCancellation = onCancellation === VOID ? null : onCancellation;
var tmp;
if ($super === VOID) {
this.jr(proposedUpdate, resumeMode, onCancellation);
tmp = Unit_instance;
} else {
tmp = $super.jr.call(this, proposedUpdate, resumeMode, onCancellation);
}
return tmp;
};
protoOf(CancellableContinuationImpl).tq = function () {
var tmp0_elvis_lhs = _get_parentHandle__f8dcex(this);
var tmp;
if (tmp0_elvis_lhs == null) {
return Unit_instance;
} else {
tmp = tmp0_elvis_lhs;
}
var handle = tmp;
handle.tp();
this.pp_1.kotlinx$atomicfu$value = NonDisposableHandle_instance;
};
protoOf(CancellableContinuationImpl).hp = function (value, idempotent, onCancellation) {
return tryResumeImpl(this, value, idempotent, onCancellation);
};
protoOf(CancellableContinuationImpl).ip = function (token) {
// Inline function 'kotlinx.coroutines.assert' call
dispatchResume(this, this.dq_1);
};
protoOf(CancellableContinuationImpl).fr = function (state) {
var tmp;
if (state instanceof CompletedContinuation) {
var tmp_0 = state.kq_1;
tmp = (tmp_0 == null ? true : !(tmp_0 == null)) ? tmp_0 : THROW_CCE();
} else {
tmp = (state == null ? true : !(state == null)) ? state : THROW_CCE();
}
return tmp;
};
protoOf(CancellableContinuationImpl).pr = function (state) {
var tmp0_safe_receiver = protoOf(DispatchedTask).pr.call(this, state);
var tmp;
if (tmp0_safe_receiver == null) {
tmp = null;
} else {
// Inline function 'kotlin.let' call
tmp = recoverStackTrace(tmp0_safe_receiver, this.lp_1);
}
return tmp;
};
protoOf(CancellableContinuationImpl).toString = function () {
return this.qr() + '(' + toDebugString(this.lp_1) + '){' + _get_stateDebugRepresentation__bf18u4(this) + '}@' + get_hexAddress(this);
};
protoOf(CancellableContinuationImpl).qr = function () {
return 'CancellableContinuation';
};
function NotCompleted() {
}
function UserSupplied(handler) {
this.tr_1 = handler;
}
protoOf(UserSupplied).sp = function (cause) {
this.tr_1(cause);
};
protoOf(UserSupplied).toString = function () {
return 'CancelHandler.UserSupplied[' + get_classSimpleName(this.tr_1) + '@' + get_hexAddress(this) + ']';
};
function CancelHandler() {
}
function Active() {
}
protoOf(Active).toString = function () {
return 'Active';
};
var Active_instance;
function Active_getInstance() {
return Active_instance;
}
function CompletedContinuation(result, cancelHandler, onCancellation, idempotentResume, cancelCause) {
cancelHandler = cancelHandler === VOID ? null : cancelHandler;
onCancellation = onCancellation === VOID ? null : onCancellation;
idempotentResume = idempotentResume === VOID ? null : idempotentResume;
cancelCause = cancelCause === VOID ? null : cancelCause;
this.kq_1 = result;
this.lq_1 = cancelHandler;
this.mq_1 = onCancellation;
this.nq_1 = idempotentResume;
this.oq_1 = cancelCause;
}
protoOf(CompletedContinuation).qq = function () {
return !(this.oq_1 == null);
};
protoOf(CompletedContinuation).yq = function (cont, cause) {
var tmp0_safe_receiver = this.lq_1;
if (tmp0_safe_receiver == null)
null;
else {
// Inline function 'kotlin.let' call
cont.pq(tmp0_safe_receiver, cause);
}
var tmp1_safe_receiver = this.mq_1;
if (tmp1_safe_receiver == null)
null;
else {
// Inline function 'kotlin.let' call
cont.br(tmp1_safe_receiver, cause, this.kq_1);
}
};
protoOf(CompletedContinuation).ur = function (result, cancelHandler, onCancellation, idempotentResume, cancelCause) {
return new CompletedContinuation(result, cancelHandler, onCancellation, idempotentResume, cancelCause);
};
protoOf(CompletedContinuation).rq = function (result, cancelHandler, onCancellation, idempotentResume, cancelCause, $super) {
result = result === VOID ? this.kq_1 : result;
cancelHandler = cancelHandler === VOID ? this.lq_1 : cancelHandler;
onCancellation = onCancellation === VOID ? this.mq_1 : onCancellation;
idempotentResume = idempotentResume === VOID ? this.nq_1 : idempotentResume;
cancelCause = cancelCause === VOID ? this.oq_1 : cancelCause;
return $super === VOID ? this.ur(result, cancelHandler, onCancellation, idempotentResume, cancelCause) : $super.ur.call(this, result, cancelHandler, onCancellation, idempotentResume, cancelCause);
};
protoOf(CompletedContinuation).toString = function () {
return 'CompletedContinuation(result=' + toString_0(this.kq_1) + ', cancelHandler=' + toString_0(this.lq_1) + ', onCancellation=' + toString_0(this.mq_1) + ', idempotentResume=' + toString_0(this.nq_1) + ', cancelCause=' + toString_0(this.oq_1) + ')';
};
protoOf(CompletedContinuation).hashCode = function () {
var result = this.kq_1 == null ? 0 : hashCode(this.kq_1);
result = imul(result, 31) + (this.lq_1 == null ? 0 : hashCode(this.lq_1)) | 0;
result = imul(result, 31) + (this.mq_1 == null ? 0 : hashCode(this.mq_1)) | 0;
result = imul(result, 31) + (this.nq_1 == null ? 0 : hashCode(this.nq_1)) | 0;
result = imul(result, 31) + (this.oq_1 == null ? 0 : hashCode(this.oq_1)) | 0;
return result;
};
protoOf(CompletedContinuation).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof CompletedContinuation))
return false;
var tmp0_other_with_cast = other instanceof CompletedContinuation ? other : THROW_CCE();
if (!equals(this.kq_1, tmp0_other_with_cast.kq_1))
return false;
if (!equals(this.lq_1, tmp0_other_with_cast.lq_1))
return false;
if (!equals(this.mq_1, tmp0_other_with_cast.mq_1))
return false;
if (!equals(this.nq_1, tmp0_other_with_cast.nq_1))
return false;
if (!equals(this.oq_1, tmp0_other_with_cast.oq_1))
return false;
return true;
};
function ChildContinuation(child) {
JobNode.call(this);
this.zr_1 = child;
}
protoOf(ChildContinuation).as = function () {
return true;
};
protoOf(ChildContinuation).sp = function (cause) {
this.zr_1.ar(this.zr_1.cr(this.fs()));
};
var properties_initialized_CancellableContinuationImpl_kt_xtzb03;
function _init_properties_CancellableContinuationImpl_kt__6rrtdd() {
if (!properties_initialized_CancellableContinuationImpl_kt_xtzb03) {
properties_initialized_CancellableContinuationImpl_kt_xtzb03 = true;
RESUME_TOKEN = new Symbol('RESUME_TOKEN');
}
}
function CompletableDeferred(parent) {
parent = parent === VOID ? null : parent;
return new CompletableDeferredImpl(parent);
}
function $awaitCOROUTINE$_0(_this__u8e3s4, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.vs_1 = _this__u8e3s4;
}
protoOf($awaitCOROUTINE$_0).u8 = function () {
var suspendResult = this.o8_1;
$sm: do
try {
var tmp = this.m8_1;
switch (tmp) {
case 0:
this.n8_1 = 2;
this.m8_1 = 1;
suspendResult = this.vs_1.go(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {