@zenwave360/json-schema-ref-parser-kmp 1.0.0-next.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.
@@ -0,0 +1,3549 @@
1
+ import {
2
+ Unit_instance1fbcbse1fwigr as Unit_instance,
3
+ protoOf180f3jzyo7rfj as protoOf,
4
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
5
+ Element2gr7ezmxqaln7 as Element,
6
+ Continuation1aa2oekvx7jm7 as Continuation,
7
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
8
+ VOID3gxj6tk5isa35 as VOID,
9
+ EmptyCoroutineContext_getInstance31fow51ayy30t as EmptyCoroutineContext_getInstance,
10
+ createCoroutineUnintercepted3gya308dmbbtg as createCoroutineUnintercepted,
11
+ isInterface3d6p8outrmvmk as isInterface,
12
+ toString1pkumu07cwy4m as toString,
13
+ IllegalStateException_init_$Create$2w9444nebyjns as IllegalStateException_init_$Create$,
14
+ toString30pk9tzaqopn as toString_0,
15
+ get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED,
16
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
17
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
18
+ hashCodeq5arwsb9dgti as hashCode,
19
+ equals2au1ep9vhcato as equals,
20
+ CancellationException_init_$Create$2cv5nayrc39hr as CancellationException_init_$Create$,
21
+ Result__exceptionOrNull_impl_p6xea9ty3elzpd9eo3 as Result__exceptionOrNull_impl_p6xea9,
22
+ _Result___get_value__impl__bjfvqg2ei4op8d4d2m as _Result___get_value__impl__bjfvqg,
23
+ AbstractCoroutineContextKey9xr9r6wlj5bm as AbstractCoroutineContextKey,
24
+ Key_instance17k9ki7fvysxq as Key_instance,
25
+ AbstractCoroutineContextElement2rpehg0hv5szw as AbstractCoroutineContextElement,
26
+ getxe4seun860fg as get,
27
+ minusKey2uxs00uz5ceqp as minusKey,
28
+ ContinuationInterceptor2624y0vaqwxwf as ContinuationInterceptor,
29
+ RuntimeException_init_$Create$518iyh59wo54 as RuntimeException_init_$Create$,
30
+ addSuppressedu5jwjfvsc039 as addSuppressed,
31
+ Enum3alwj03lh1n41 as Enum,
32
+ startCoroutine327fwvtqvedik as startCoroutine,
33
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
34
+ Long2qws0ah9gnpki as Long,
35
+ ArrayDeque_init_$Create$2333dl090ltjt as ArrayDeque_init_$Create$,
36
+ compare2uud5j30pw5xc as compare,
37
+ add85si75olwt6n as add,
38
+ subtract16cg4lfi29fq9 as subtract,
39
+ RuntimeException1r3t0zl97011n as RuntimeException,
40
+ RuntimeException_init_$Init$3m7ccek2krm3f as RuntimeException_init_$Init$,
41
+ captureStack1fzi4aczwc4hg as captureStack,
42
+ Error3ofk6owajcepa as Error_0,
43
+ Error_init_$Init$17pe7jtgoh3ll as Error_init_$Init$,
44
+ StringBuilder_init_$Create$2qsge4ydj6bin as StringBuilder_init_$Create$,
45
+ throwUninitializedPropertyAccessExceptionyynx7gkm73wd as throwUninitializedPropertyAccessException,
46
+ ArrayList_init_$Create$3bxttkj3v1mea as ArrayList_init_$Create$,
47
+ CancellationException3b36o9qz53rgr as CancellationException,
48
+ ArrayList3it5z8td81qkl as ArrayList,
49
+ IllegalStateException_init_$Create$12oloagvd20rx as IllegalStateException_init_$Create$_0,
50
+ plusolev77jfy5r9 as plus,
51
+ get6d5x931vk0s as get_0,
52
+ fold36i9psb7d5v48 as fold,
53
+ minusKeyyqanvso9aovh as minusKey_0,
54
+ anyToString3ho3k49fc56mj as anyToString,
55
+ UnsupportedOperationException2tkumpmhredt3 as UnsupportedOperationException,
56
+ UnsupportedOperationException_init_$Create$1pe732c4s59hc as UnsupportedOperationException_init_$Create$,
57
+ Exceptiondt2hlxn7j7vw as Exception,
58
+ IllegalArgumentException_init_$Create$3ewkh27kzt8z8 as IllegalArgumentException_init_$Create$,
59
+ Companion_instance2oawqq9qiaris as Companion_instance,
60
+ createFailure8paxfkfa5dc7 as createFailure,
61
+ _Result___init__impl__xyqfz83hut4nr3dfvi3 as _Result___init__impl__xyqfz8,
62
+ Exception_init_$Init$393utbttlf2x4 as Exception_init_$Init$,
63
+ defineProp3ur6h3slcvq4x as defineProp,
64
+ intercepted2ogpsikxxj4u0 as intercepted,
65
+ startCoroutineUninterceptedOrReturnNonGeneratorVersionyfrrvzbtl8bf as startCoroutineUninterceptedOrReturnNonGeneratorVersion,
66
+ getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
67
+ Exception_init_$Create$becl18oowirz as Exception_init_$Create$,
68
+ CancellationException_init_$Init$1ieejj57c468h as CancellationException_init_$Init$,
69
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
70
+ getStringHashCode26igk1bx568vk as getStringHashCode,
71
+ HashSet_init_$Create$1almu45bw06ne as HashSet_init_$Create$,
72
+ RuntimeException_init_$Init$1tdhpyy2sm4eb as RuntimeException_init_$Init$_0,
73
+ LinkedHashSet_init_$Create$3o6z3oewjhki9 as LinkedHashSet_init_$Create$,
74
+ stackTraceToString2670q6lbhdojj as stackTraceToString,
75
+ removeFirstOrNull15yg2tczrh8a7 as removeFirstOrNull,
76
+ KtMutableList1beimitadwkna as KtMutableList,
77
+ } from './kotlin-kotlin-stdlib.mjs';
78
+ import {
79
+ atomic$int$11d5swdyn6j0pu as atomic$int$1,
80
+ atomic$ref$130aurmcwdfdf1 as atomic$ref$1,
81
+ atomic$boolean$1iggki4z65a2h as atomic$boolean$1,
82
+ } from './kotlinx-atomicfu.mjs';
83
+ //region block: imports
84
+ var imul = Math.imul;
85
+ //endregion
86
+ //region block: pre-declaration
87
+ initMetadataForInterface(ParentJob, 'ParentJob', VOID, VOID, [Element], [0]);
88
+ initMetadataForClass(JobSupport, 'JobSupport', VOID, VOID, [Element, ParentJob], [0]);
89
+ initMetadataForInterface(CoroutineScope, 'CoroutineScope');
90
+ initMetadataForClass(AbstractCoroutine, 'AbstractCoroutine', VOID, JobSupport, [JobSupport, Element, Continuation, CoroutineScope], [0]);
91
+ initMetadataForClass(DeferredCoroutine, 'DeferredCoroutine', VOID, AbstractCoroutine, [AbstractCoroutine, Element], [0]);
92
+ initMetadataForClass(LazyDeferredCoroutine, 'LazyDeferredCoroutine', VOID, DeferredCoroutine, VOID, [0]);
93
+ initMetadataForInterface(Runnable, 'Runnable');
94
+ initMetadataForClass(SchedulerTask, 'SchedulerTask', VOID, VOID, [Runnable]);
95
+ initMetadataForClass(DispatchedTask, 'DispatchedTask', VOID, SchedulerTask);
96
+ initMetadataForClass(CancellableContinuationImpl, 'CancellableContinuationImpl', VOID, DispatchedTask, [DispatchedTask, Continuation]);
97
+ initMetadataForInterface(NotCompleted, 'NotCompleted');
98
+ initMetadataForInterface(CancelHandler, 'CancelHandler', VOID, VOID, [NotCompleted]);
99
+ initMetadataForObject(Active, 'Active', VOID, VOID, [NotCompleted]);
100
+ initMetadataForClass(CompletedContinuation, 'CompletedContinuation');
101
+ initMetadataForClass(LockFreeLinkedListNode, 'LockFreeLinkedListNode', LockFreeLinkedListNode);
102
+ initMetadataForInterface(Incomplete, 'Incomplete');
103
+ initMetadataForClass(JobNode, 'JobNode', VOID, LockFreeLinkedListNode, [LockFreeLinkedListNode, Incomplete]);
104
+ initMetadataForClass(ChildContinuation, 'ChildContinuation', VOID, JobNode);
105
+ initMetadataForClass(CompletedExceptionally, 'CompletedExceptionally');
106
+ initMetadataForClass(CancelledContinuation, 'CancelledContinuation', VOID, CompletedExceptionally);
107
+ initMetadataForObject(Key, 'Key', VOID, AbstractCoroutineContextKey);
108
+ initMetadataForClass(CoroutineDispatcher, 'CoroutineDispatcher', VOID, AbstractCoroutineContextElement, [AbstractCoroutineContextElement, ContinuationInterceptor]);
109
+ initMetadataForObject(Key_0, 'Key');
110
+ initMetadataForObject(GlobalScope, 'GlobalScope', VOID, VOID, [CoroutineScope]);
111
+ initMetadataForClass(CoroutineStart, 'CoroutineStart', VOID, Enum);
112
+ initMetadataForClass(EventLoop, 'EventLoop', VOID, CoroutineDispatcher);
113
+ initMetadataForObject(ThreadLocalEventLoop, 'ThreadLocalEventLoop');
114
+ initMetadataForClass(CompletionHandlerException, 'CompletionHandlerException', VOID, RuntimeException);
115
+ initMetadataForClass(CoroutinesInternalError, 'CoroutinesInternalError', VOID, Error_0);
116
+ initMetadataForObject(Key_1, 'Key');
117
+ initMetadataForObject(NonDisposableHandle, 'NonDisposableHandle');
118
+ initMetadataForClass(Empty, 'Empty', VOID, VOID, [Incomplete]);
119
+ initMetadataForClass(LockFreeLinkedListHead, 'LockFreeLinkedListHead', LockFreeLinkedListHead, LockFreeLinkedListNode);
120
+ initMetadataForClass(NodeList, 'NodeList', NodeList, LockFreeLinkedListHead, [LockFreeLinkedListHead, Incomplete]);
121
+ initMetadataForClass(SynchronizedObject, 'SynchronizedObject', SynchronizedObject);
122
+ initMetadataForClass(Finishing, 'Finishing', VOID, SynchronizedObject, [SynchronizedObject, Incomplete]);
123
+ initMetadataForClass(ChildCompletion, 'ChildCompletion', VOID, JobNode);
124
+ initMetadataForClass(InactiveNodeList, 'InactiveNodeList', VOID, VOID, [Incomplete]);
125
+ initMetadataForClass(InvokeOnCompletion, 'InvokeOnCompletion', VOID, JobNode);
126
+ initMetadataForClass(InvokeOnCancelling, 'InvokeOnCancelling', VOID, JobNode);
127
+ initMetadataForClass(ChildHandleNode, 'ChildHandleNode', VOID, JobNode);
128
+ initMetadataForClass(IncompleteStateBox, 'IncompleteStateBox');
129
+ initMetadataForClass(MainCoroutineDispatcher, 'MainCoroutineDispatcher', VOID, CoroutineDispatcher);
130
+ initMetadataForClass(TimeoutCancellationException, 'TimeoutCancellationException', VOID, CancellationException);
131
+ initMetadataForObject(Unconfined, 'Unconfined', VOID, CoroutineDispatcher);
132
+ initMetadataForObject(Key_2, 'Key');
133
+ initMetadataForClass(ConcurrentLinkedListNode, 'ConcurrentLinkedListNode');
134
+ initMetadataForClass(Segment, 'Segment', VOID, ConcurrentLinkedListNode, [ConcurrentLinkedListNode, NotCompleted]);
135
+ initMetadataForObject(ExceptionSuccessfullyProcessed, 'ExceptionSuccessfullyProcessed', VOID, Exception);
136
+ initMetadataForClass(DispatchedContinuation, 'DispatchedContinuation', VOID, DispatchedTask, [DispatchedTask, Continuation]);
137
+ initMetadataForClass(DispatchException, 'DispatchException', VOID, Exception);
138
+ initMetadataForClass(Symbol, 'Symbol');
139
+ initMetadataForClass(SetTimeoutBasedDispatcher, 'SetTimeoutBasedDispatcher', VOID, CoroutineDispatcher, VOID, [1]);
140
+ initMetadataForObject(NodeDispatcher, 'NodeDispatcher', VOID, SetTimeoutBasedDispatcher, VOID, [1]);
141
+ initMetadataForClass(MessageQueue, 'MessageQueue', VOID, VOID, [KtMutableList]);
142
+ initMetadataForClass(ScheduledMessageQueue, 'ScheduledMessageQueue', VOID, MessageQueue);
143
+ initMetadataForClass(WindowMessageQueue, 'WindowMessageQueue', VOID, MessageQueue);
144
+ initMetadataForObject(Dispatchers, 'Dispatchers');
145
+ initMetadataForClass(JsMainDispatcher, 'JsMainDispatcher', VOID, MainCoroutineDispatcher);
146
+ initMetadataForClass(JobCancellationException, 'JobCancellationException', VOID, CancellationException);
147
+ initMetadataForClass(DiagnosticCoroutineContextException, 'DiagnosticCoroutineContextException', VOID, RuntimeException);
148
+ initMetadataForClass(ListClosed, 'ListClosed', VOID, LockFreeLinkedListNode);
149
+ initMetadataForClass(CommonThreadLocal, 'CommonThreadLocal', CommonThreadLocal);
150
+ initMetadataForClass(UnconfinedEventLoop, 'UnconfinedEventLoop', UnconfinedEventLoop, EventLoop);
151
+ initMetadataForObject(SetTimeoutDispatcher, 'SetTimeoutDispatcher', VOID, SetTimeoutBasedDispatcher, VOID, [1]);
152
+ initMetadataForClass(WindowDispatcher, 'WindowDispatcher', VOID, CoroutineDispatcher, VOID, [1]);
153
+ //endregion
154
+ function AbstractCoroutine(parentContext, initParentJob, active) {
155
+ JobSupport.call(this, active);
156
+ if (initParentJob) {
157
+ this.px(parentContext.h7(Key_instance_2));
158
+ }
159
+ this.sx_1 = parentContext.ob(this);
160
+ }
161
+ protoOf(AbstractCoroutine).a7 = function () {
162
+ return this.sx_1;
163
+ };
164
+ protoOf(AbstractCoroutine).tx = function () {
165
+ return this.sx_1;
166
+ };
167
+ protoOf(AbstractCoroutine).ux = function () {
168
+ return protoOf(JobSupport).ux.call(this);
169
+ };
170
+ protoOf(AbstractCoroutine).vx = function (value) {
171
+ };
172
+ protoOf(AbstractCoroutine).wx = function (cause, handled) {
173
+ };
174
+ protoOf(AbstractCoroutine).xx = function () {
175
+ return get_classSimpleName(this) + ' was cancelled';
176
+ };
177
+ protoOf(AbstractCoroutine).yx = function (state) {
178
+ if (state instanceof CompletedExceptionally) {
179
+ this.wx(state.zx_1, state.by());
180
+ } else {
181
+ this.vx((state == null ? true : !(state == null)) ? state : THROW_CCE());
182
+ }
183
+ };
184
+ protoOf(AbstractCoroutine).f7 = function (result) {
185
+ var state = this.cy(toState_0(result));
186
+ if (state === get_COMPLETING_WAITING_CHILDREN())
187
+ return Unit_instance;
188
+ this.dy(state);
189
+ };
190
+ protoOf(AbstractCoroutine).dy = function (state) {
191
+ return this.ey(state);
192
+ };
193
+ protoOf(AbstractCoroutine).fy = function (exception) {
194
+ handleCoroutineException(this.sx_1, exception);
195
+ };
196
+ protoOf(AbstractCoroutine).gy = function () {
197
+ var tmp0_elvis_lhs = get_coroutineName(this.sx_1);
198
+ var tmp;
199
+ if (tmp0_elvis_lhs == null) {
200
+ return protoOf(JobSupport).gy.call(this);
201
+ } else {
202
+ tmp = tmp0_elvis_lhs;
203
+ }
204
+ var coroutineName = tmp;
205
+ return '"' + coroutineName + '":' + protoOf(JobSupport).gy.call(this);
206
+ };
207
+ protoOf(AbstractCoroutine).hy = function (start, receiver, block) {
208
+ start.ky(block, receiver, this);
209
+ };
210
+ function async(_this__u8e3s4, context, start, block) {
211
+ context = context === VOID ? EmptyCoroutineContext_getInstance() : context;
212
+ start = start === VOID ? CoroutineStart_DEFAULT_getInstance() : start;
213
+ var newContext = newCoroutineContext(_this__u8e3s4, context);
214
+ var coroutine = start.lz() ? new LazyDeferredCoroutine(newContext, block) : new DeferredCoroutine(newContext, true);
215
+ coroutine.hy(start, coroutine, block);
216
+ return coroutine;
217
+ }
218
+ function DeferredCoroutine(parentContext, active) {
219
+ AbstractCoroutine.call(this, parentContext, true, active);
220
+ }
221
+ protoOf(DeferredCoroutine).pz = function () {
222
+ var tmp = this.kz();
223
+ return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
224
+ };
225
+ function LazyDeferredCoroutine(parentContext, block) {
226
+ DeferredCoroutine.call(this, parentContext, false);
227
+ this.tz_1 = createCoroutineUnintercepted(block, this, this);
228
+ }
229
+ protoOf(LazyDeferredCoroutine).qy = function () {
230
+ startCoroutineCancellable_0(this.tz_1, this);
231
+ };
232
+ function _get_parentHandle__f8dcex($this) {
233
+ return $this.zz_1.kotlinx$atomicfu$value;
234
+ }
235
+ function _get_stateDebugRepresentation__bf18u4($this) {
236
+ var tmp0_subject = $this.ny();
237
+ var tmp;
238
+ if (!(tmp0_subject == null) ? isInterface(tmp0_subject, NotCompleted) : false) {
239
+ tmp = 'Active';
240
+ } else {
241
+ if (tmp0_subject instanceof CancelledContinuation) {
242
+ tmp = 'Cancelled';
243
+ } else {
244
+ tmp = 'Completed';
245
+ }
246
+ }
247
+ return tmp;
248
+ }
249
+ function isReusable($this) {
250
+ var tmp;
251
+ if (get_isReusableMode($this.h10_1)) {
252
+ var tmp_0 = $this.vz_1;
253
+ tmp = (tmp_0 instanceof DispatchedContinuation ? tmp_0 : THROW_CCE()).g10();
254
+ } else {
255
+ tmp = false;
256
+ }
257
+ return tmp;
258
+ }
259
+ function cancelLater($this, cause) {
260
+ if (!isReusable($this))
261
+ return false;
262
+ var tmp = $this.vz_1;
263
+ var dispatched = tmp instanceof DispatchedContinuation ? tmp : THROW_CCE();
264
+ return dispatched.i10(cause);
265
+ }
266
+ function callSegmentOnCancellation($this, segment, cause) {
267
+ // Inline function 'kotlinx.coroutines.index' call
268
+ var index = $this.xz_1.kotlinx$atomicfu$value & 536870911;
269
+ // Inline function 'kotlin.check' call
270
+ if (!!(index === 536870911)) {
271
+ var message = 'The index for Segment.onCancellation(..) is broken';
272
+ throw IllegalStateException_init_$Create$(toString(message));
273
+ }
274
+ // Inline function 'kotlinx.coroutines.CancellableContinuationImpl.callCancelHandlerSafely' call
275
+ try {
276
+ segment.j10(index, cause, $this.a7());
277
+ } catch ($p) {
278
+ if ($p instanceof Error) {
279
+ var ex = $p;
280
+ handleCoroutineException($this.a7(), new CompletionHandlerException('Exception in invokeOnCancellation handler for ' + $this.toString(), ex));
281
+ } else {
282
+ throw $p;
283
+ }
284
+ }
285
+ }
286
+ function trySuspend($this) {
287
+ // Inline function 'kotlinx.atomicfu.loop' call
288
+ var this_0 = $this.xz_1;
289
+ while (true) {
290
+ var cur = this_0.kotlinx$atomicfu$value;
291
+ // Inline function 'kotlinx.coroutines.decision' call
292
+ switch (cur >> 29) {
293
+ case 0:
294
+ // Inline function 'kotlinx.coroutines.index' call
295
+
296
+ // Inline function 'kotlinx.coroutines.decisionAndIndex' call
297
+
298
+ var tmp$ret$2 = (1 << 29) + (cur & 536870911) | 0;
299
+ if ($this.xz_1.atomicfu$compareAndSet(cur, tmp$ret$2))
300
+ return true;
301
+ break;
302
+ case 2:
303
+ return false;
304
+ default:
305
+ // Inline function 'kotlin.error' call
306
+
307
+ var message = 'Already suspended';
308
+ throw IllegalStateException_init_$Create$(toString(message));
309
+ }
310
+ }
311
+ }
312
+ function tryResume($this) {
313
+ // Inline function 'kotlinx.atomicfu.loop' call
314
+ var this_0 = $this.xz_1;
315
+ while (true) {
316
+ var cur = this_0.kotlinx$atomicfu$value;
317
+ // Inline function 'kotlinx.coroutines.decision' call
318
+ switch (cur >> 29) {
319
+ case 0:
320
+ // Inline function 'kotlinx.coroutines.index' call
321
+
322
+ // Inline function 'kotlinx.coroutines.decisionAndIndex' call
323
+
324
+ var tmp$ret$2 = (2 << 29) + (cur & 536870911) | 0;
325
+ if ($this.xz_1.atomicfu$compareAndSet(cur, tmp$ret$2))
326
+ return true;
327
+ break;
328
+ case 1:
329
+ return false;
330
+ default:
331
+ // Inline function 'kotlin.error' call
332
+
333
+ var message = 'Already resumed';
334
+ throw IllegalStateException_init_$Create$(toString(message));
335
+ }
336
+ }
337
+ }
338
+ function installParentHandle($this) {
339
+ var tmp0_elvis_lhs = $this.a7().h7(Key_instance_2);
340
+ var tmp;
341
+ if (tmp0_elvis_lhs == null) {
342
+ return null;
343
+ } else {
344
+ tmp = tmp0_elvis_lhs;
345
+ }
346
+ var parent = tmp;
347
+ var handle = invokeOnCompletion(parent, VOID, new ChildContinuation($this));
348
+ $this.zz_1.atomicfu$compareAndSet(null, handle);
349
+ return handle;
350
+ }
351
+ function dispatchResume($this, mode) {
352
+ if (tryResume($this))
353
+ return Unit_instance;
354
+ dispatch($this, mode);
355
+ }
356
+ function resumedState($this, state, proposedUpdate, resumeMode, onCancellation, idempotent) {
357
+ var tmp;
358
+ if (proposedUpdate instanceof CompletedExceptionally) {
359
+ // Inline function 'kotlinx.coroutines.assert' call
360
+ // Inline function 'kotlinx.coroutines.assert' call
361
+ tmp = proposedUpdate;
362
+ } else {
363
+ if (!get_isCancellableMode(resumeMode) && idempotent == null) {
364
+ tmp = proposedUpdate;
365
+ } else {
366
+ var tmp_0;
367
+ var tmp_1;
368
+ if (!(onCancellation == null)) {
369
+ tmp_1 = true;
370
+ } else {
371
+ tmp_1 = isInterface(state, CancelHandler);
372
+ }
373
+ if (tmp_1) {
374
+ tmp_0 = true;
375
+ } else {
376
+ tmp_0 = !(idempotent == null);
377
+ }
378
+ if (tmp_0) {
379
+ tmp = new CompletedContinuation(proposedUpdate, isInterface(state, CancelHandler) ? state : null, onCancellation, idempotent);
380
+ } else {
381
+ tmp = proposedUpdate;
382
+ }
383
+ }
384
+ }
385
+ return tmp;
386
+ }
387
+ function alreadyResumedError($this, proposedUpdate) {
388
+ // Inline function 'kotlin.error' call
389
+ var message = 'Already resumed, but proposed with update ' + toString_0(proposedUpdate);
390
+ throw IllegalStateException_init_$Create$(toString(message));
391
+ }
392
+ function detachChildIfNonReusable($this) {
393
+ if (!isReusable($this)) {
394
+ $this.k10();
395
+ }
396
+ }
397
+ function CancellableContinuationImpl(delegate, resumeMode) {
398
+ DispatchedTask.call(this, resumeMode);
399
+ this.vz_1 = delegate;
400
+ // Inline function 'kotlinx.coroutines.assert' call
401
+ this.wz_1 = this.vz_1.a7();
402
+ var tmp = this;
403
+ // Inline function 'kotlinx.coroutines.decisionAndIndex' call
404
+ var tmp$ret$1 = (0 << 29) + 536870911 | 0;
405
+ tmp.xz_1 = atomic$int$1(tmp$ret$1);
406
+ this.yz_1 = atomic$ref$1(Active_instance);
407
+ this.zz_1 = atomic$ref$1(null);
408
+ }
409
+ protoOf(CancellableContinuationImpl).l10 = function () {
410
+ return this.vz_1;
411
+ };
412
+ protoOf(CancellableContinuationImpl).a7 = function () {
413
+ return this.wz_1;
414
+ };
415
+ protoOf(CancellableContinuationImpl).ny = function () {
416
+ return this.yz_1.kotlinx$atomicfu$value;
417
+ };
418
+ protoOf(CancellableContinuationImpl).oy = function () {
419
+ var tmp = this.ny();
420
+ return !(!(tmp == null) ? isInterface(tmp, NotCompleted) : false);
421
+ };
422
+ protoOf(CancellableContinuationImpl).m10 = function () {
423
+ var tmp0_elvis_lhs = installParentHandle(this);
424
+ var tmp;
425
+ if (tmp0_elvis_lhs == null) {
426
+ return Unit_instance;
427
+ } else {
428
+ tmp = tmp0_elvis_lhs;
429
+ }
430
+ var handle = tmp;
431
+ if (this.oy()) {
432
+ handle.n10();
433
+ this.zz_1.kotlinx$atomicfu$value = NonDisposableHandle_instance;
434
+ }
435
+ };
436
+ protoOf(CancellableContinuationImpl).o10 = function () {
437
+ return this.ny();
438
+ };
439
+ protoOf(CancellableContinuationImpl).p10 = function (takenState, cause) {
440
+ var this_0 = this.yz_1;
441
+ while (true) {
442
+ var state = this_0.kotlinx$atomicfu$value;
443
+ if (!(state == null) ? isInterface(state, NotCompleted) : false) {
444
+ // Inline function 'kotlin.error' call
445
+ var message = 'Not completed';
446
+ throw IllegalStateException_init_$Create$(toString(message));
447
+ } else {
448
+ if (state instanceof CompletedExceptionally)
449
+ return Unit_instance;
450
+ else {
451
+ if (state instanceof CompletedContinuation) {
452
+ // Inline function 'kotlin.check' call
453
+ if (!!state.v10()) {
454
+ var message_0 = 'Must be called at most once';
455
+ throw IllegalStateException_init_$Create$(toString(message_0));
456
+ }
457
+ var update = state.w10(VOID, VOID, VOID, VOID, cause);
458
+ if (this.yz_1.atomicfu$compareAndSet(state, update)) {
459
+ state.x10(this, cause);
460
+ return Unit_instance;
461
+ }
462
+ } else {
463
+ if (this.yz_1.atomicfu$compareAndSet(state, new CompletedContinuation(state, VOID, VOID, VOID, cause))) {
464
+ return Unit_instance;
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
470
+ return Unit_instance;
471
+ };
472
+ protoOf(CancellableContinuationImpl).y10 = function (cause) {
473
+ // Inline function 'kotlinx.atomicfu.loop' call
474
+ var this_0 = this.yz_1;
475
+ while (true) {
476
+ var tmp0 = this_0.kotlinx$atomicfu$value;
477
+ $l$block: {
478
+ if (!(!(tmp0 == null) ? isInterface(tmp0, NotCompleted) : false))
479
+ return false;
480
+ var tmp;
481
+ if (isInterface(tmp0, CancelHandler)) {
482
+ tmp = true;
483
+ } else {
484
+ tmp = tmp0 instanceof Segment;
485
+ }
486
+ var update = new CancelledContinuation(this, cause, tmp);
487
+ if (!this.yz_1.atomicfu$compareAndSet(tmp0, update)) {
488
+ break $l$block;
489
+ }
490
+ if (isInterface(tmp0, CancelHandler)) {
491
+ this.z10(tmp0, cause);
492
+ } else {
493
+ if (tmp0 instanceof Segment) {
494
+ callSegmentOnCancellation(this, tmp0, cause);
495
+ }
496
+ }
497
+ detachChildIfNonReusable(this);
498
+ dispatchResume(this, this.h10_1);
499
+ return true;
500
+ }
501
+ }
502
+ };
503
+ protoOf(CancellableContinuationImpl).a11 = function (cause) {
504
+ if (cancelLater(this, cause))
505
+ return Unit_instance;
506
+ this.y10(cause);
507
+ detachChildIfNonReusable(this);
508
+ };
509
+ protoOf(CancellableContinuationImpl).z10 = function (handler, cause) {
510
+ // Inline function 'kotlinx.coroutines.CancellableContinuationImpl.callCancelHandlerSafely' call
511
+ try {
512
+ handler.b11(cause);
513
+ } catch ($p) {
514
+ if ($p instanceof Error) {
515
+ var ex = $p;
516
+ handleCoroutineException(this.a7(), new CompletionHandlerException('Exception in invokeOnCancellation handler for ' + this.toString(), ex));
517
+ } else {
518
+ throw $p;
519
+ }
520
+ }
521
+ return Unit_instance;
522
+ };
523
+ protoOf(CancellableContinuationImpl).c11 = function (onCancellation, cause, value) {
524
+ try {
525
+ onCancellation(cause, value, this.a7());
526
+ } catch ($p) {
527
+ if ($p instanceof Error) {
528
+ var ex = $p;
529
+ handleCoroutineException(this.a7(), new CompletionHandlerException('Exception in resume onCancellation handler for ' + this.toString(), ex));
530
+ } else {
531
+ throw $p;
532
+ }
533
+ }
534
+ };
535
+ protoOf(CancellableContinuationImpl).d11 = function (parent) {
536
+ return parent.ry();
537
+ };
538
+ protoOf(CancellableContinuationImpl).e11 = function () {
539
+ var isReusable_0 = isReusable(this);
540
+ if (trySuspend(this)) {
541
+ if (_get_parentHandle__f8dcex(this) == null) {
542
+ installParentHandle(this);
543
+ }
544
+ if (isReusable_0) {
545
+ this.f11();
546
+ }
547
+ return get_COROUTINE_SUSPENDED();
548
+ }
549
+ if (isReusable_0) {
550
+ this.f11();
551
+ }
552
+ var state = this.ny();
553
+ if (state instanceof CompletedExceptionally)
554
+ throw recoverStackTrace(state.zx_1, this);
555
+ if (get_isCancellableMode(this.h10_1)) {
556
+ var job = this.a7().h7(Key_instance_2);
557
+ if (!(job == null) && !job.ux()) {
558
+ var cause = job.ry();
559
+ this.p10(state, cause);
560
+ throw recoverStackTrace(cause, this);
561
+ }
562
+ }
563
+ return this.g11(state);
564
+ };
565
+ protoOf(CancellableContinuationImpl).f11 = function () {
566
+ var tmp = this.vz_1;
567
+ var tmp0_safe_receiver = tmp instanceof DispatchedContinuation ? tmp : null;
568
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.h11(this);
569
+ var tmp_0;
570
+ if (tmp1_elvis_lhs == null) {
571
+ return Unit_instance;
572
+ } else {
573
+ tmp_0 = tmp1_elvis_lhs;
574
+ }
575
+ var cancellationCause = tmp_0;
576
+ this.k10();
577
+ this.y10(cancellationCause);
578
+ };
579
+ protoOf(CancellableContinuationImpl).f7 = function (result) {
580
+ return this.i11(toState(result, this), this.h10_1);
581
+ };
582
+ protoOf(CancellableContinuationImpl).j11 = function (proposedUpdate, resumeMode, onCancellation) {
583
+ // Inline function 'kotlinx.atomicfu.loop' call
584
+ var this_0 = this.yz_1;
585
+ while (true) {
586
+ var tmp0 = this_0.kotlinx$atomicfu$value;
587
+ $l$block: {
588
+ if (!(tmp0 == null) ? isInterface(tmp0, NotCompleted) : false) {
589
+ var update = resumedState(this, tmp0, proposedUpdate, resumeMode, onCancellation, null);
590
+ if (!this.yz_1.atomicfu$compareAndSet(tmp0, update)) {
591
+ break $l$block;
592
+ }
593
+ detachChildIfNonReusable(this);
594
+ dispatchResume(this, resumeMode);
595
+ return Unit_instance;
596
+ } else {
597
+ if (tmp0 instanceof CancelledContinuation) {
598
+ if (tmp0.n11()) {
599
+ if (onCancellation == null)
600
+ null;
601
+ else {
602
+ // Inline function 'kotlin.let' call
603
+ this.c11(onCancellation, tmp0.zx_1, proposedUpdate);
604
+ }
605
+ return Unit_instance;
606
+ }
607
+ }
608
+ }
609
+ alreadyResumedError(this, proposedUpdate);
610
+ }
611
+ }
612
+ };
613
+ protoOf(CancellableContinuationImpl).i11 = function (proposedUpdate, resumeMode, onCancellation, $super) {
614
+ onCancellation = onCancellation === VOID ? null : onCancellation;
615
+ var tmp;
616
+ if ($super === VOID) {
617
+ this.j11(proposedUpdate, resumeMode, onCancellation);
618
+ tmp = Unit_instance;
619
+ } else {
620
+ tmp = $super.j11.call(this, proposedUpdate, resumeMode, onCancellation);
621
+ }
622
+ return tmp;
623
+ };
624
+ protoOf(CancellableContinuationImpl).k10 = function () {
625
+ var tmp0_elvis_lhs = _get_parentHandle__f8dcex(this);
626
+ var tmp;
627
+ if (tmp0_elvis_lhs == null) {
628
+ return Unit_instance;
629
+ } else {
630
+ tmp = tmp0_elvis_lhs;
631
+ }
632
+ var handle = tmp;
633
+ handle.n10();
634
+ this.zz_1.kotlinx$atomicfu$value = NonDisposableHandle_instance;
635
+ };
636
+ protoOf(CancellableContinuationImpl).g11 = function (state) {
637
+ var tmp;
638
+ if (state instanceof CompletedContinuation) {
639
+ var tmp_0 = state.q10_1;
640
+ tmp = (tmp_0 == null ? true : !(tmp_0 == null)) ? tmp_0 : THROW_CCE();
641
+ } else {
642
+ tmp = (state == null ? true : !(state == null)) ? state : THROW_CCE();
643
+ }
644
+ return tmp;
645
+ };
646
+ protoOf(CancellableContinuationImpl).o11 = function (state) {
647
+ var tmp0_safe_receiver = protoOf(DispatchedTask).o11.call(this, state);
648
+ var tmp;
649
+ if (tmp0_safe_receiver == null) {
650
+ tmp = null;
651
+ } else {
652
+ // Inline function 'kotlin.let' call
653
+ tmp = recoverStackTrace(tmp0_safe_receiver, this.vz_1);
654
+ }
655
+ return tmp;
656
+ };
657
+ protoOf(CancellableContinuationImpl).toString = function () {
658
+ return this.p11() + '(' + toDebugString(this.vz_1) + '){' + _get_stateDebugRepresentation__bf18u4(this) + '}@' + get_hexAddress(this);
659
+ };
660
+ protoOf(CancellableContinuationImpl).p11 = function () {
661
+ return 'CancellableContinuation';
662
+ };
663
+ function NotCompleted() {
664
+ }
665
+ function CancelHandler() {
666
+ }
667
+ function Active() {
668
+ }
669
+ protoOf(Active).toString = function () {
670
+ return 'Active';
671
+ };
672
+ var Active_instance;
673
+ function Active_getInstance() {
674
+ return Active_instance;
675
+ }
676
+ function CompletedContinuation(result, cancelHandler, onCancellation, idempotentResume, cancelCause) {
677
+ cancelHandler = cancelHandler === VOID ? null : cancelHandler;
678
+ onCancellation = onCancellation === VOID ? null : onCancellation;
679
+ idempotentResume = idempotentResume === VOID ? null : idempotentResume;
680
+ cancelCause = cancelCause === VOID ? null : cancelCause;
681
+ this.q10_1 = result;
682
+ this.r10_1 = cancelHandler;
683
+ this.s10_1 = onCancellation;
684
+ this.t10_1 = idempotentResume;
685
+ this.u10_1 = cancelCause;
686
+ }
687
+ protoOf(CompletedContinuation).v10 = function () {
688
+ return !(this.u10_1 == null);
689
+ };
690
+ protoOf(CompletedContinuation).x10 = function (cont, cause) {
691
+ var tmp0_safe_receiver = this.r10_1;
692
+ if (tmp0_safe_receiver == null)
693
+ null;
694
+ else {
695
+ // Inline function 'kotlin.let' call
696
+ cont.z10(tmp0_safe_receiver, cause);
697
+ }
698
+ var tmp1_safe_receiver = this.s10_1;
699
+ if (tmp1_safe_receiver == null)
700
+ null;
701
+ else {
702
+ // Inline function 'kotlin.let' call
703
+ cont.c11(tmp1_safe_receiver, cause, this.q10_1);
704
+ }
705
+ };
706
+ protoOf(CompletedContinuation).s11 = function (result, cancelHandler, onCancellation, idempotentResume, cancelCause) {
707
+ return new CompletedContinuation(result, cancelHandler, onCancellation, idempotentResume, cancelCause);
708
+ };
709
+ protoOf(CompletedContinuation).w10 = function (result, cancelHandler, onCancellation, idempotentResume, cancelCause, $super) {
710
+ result = result === VOID ? this.q10_1 : result;
711
+ cancelHandler = cancelHandler === VOID ? this.r10_1 : cancelHandler;
712
+ onCancellation = onCancellation === VOID ? this.s10_1 : onCancellation;
713
+ idempotentResume = idempotentResume === VOID ? this.t10_1 : idempotentResume;
714
+ cancelCause = cancelCause === VOID ? this.u10_1 : cancelCause;
715
+ return $super === VOID ? this.s11(result, cancelHandler, onCancellation, idempotentResume, cancelCause) : $super.s11.call(this, result, cancelHandler, onCancellation, idempotentResume, cancelCause);
716
+ };
717
+ protoOf(CompletedContinuation).toString = function () {
718
+ return 'CompletedContinuation(result=' + toString_0(this.q10_1) + ', cancelHandler=' + toString_0(this.r10_1) + ', onCancellation=' + toString_0(this.s10_1) + ', idempotentResume=' + toString_0(this.t10_1) + ', cancelCause=' + toString_0(this.u10_1) + ')';
719
+ };
720
+ protoOf(CompletedContinuation).hashCode = function () {
721
+ var result = this.q10_1 == null ? 0 : hashCode(this.q10_1);
722
+ result = imul(result, 31) + (this.r10_1 == null ? 0 : hashCode(this.r10_1)) | 0;
723
+ result = imul(result, 31) + (this.s10_1 == null ? 0 : hashCode(this.s10_1)) | 0;
724
+ result = imul(result, 31) + (this.t10_1 == null ? 0 : hashCode(this.t10_1)) | 0;
725
+ result = imul(result, 31) + (this.u10_1 == null ? 0 : hashCode(this.u10_1)) | 0;
726
+ return result;
727
+ };
728
+ protoOf(CompletedContinuation).equals = function (other) {
729
+ if (this === other)
730
+ return true;
731
+ if (!(other instanceof CompletedContinuation))
732
+ return false;
733
+ if (!equals(this.q10_1, other.q10_1))
734
+ return false;
735
+ if (!equals(this.r10_1, other.r10_1))
736
+ return false;
737
+ if (!equals(this.s10_1, other.s10_1))
738
+ return false;
739
+ if (!equals(this.t10_1, other.t10_1))
740
+ return false;
741
+ if (!equals(this.u10_1, other.u10_1))
742
+ return false;
743
+ return true;
744
+ };
745
+ function ChildContinuation(child) {
746
+ JobNode.call(this);
747
+ this.x11_1 = child;
748
+ }
749
+ protoOf(ChildContinuation).y11 = function () {
750
+ return true;
751
+ };
752
+ protoOf(ChildContinuation).b11 = function (cause) {
753
+ this.x11_1.a11(this.x11_1.d11(this.d12()));
754
+ };
755
+ function CompletedExceptionally(cause, handled) {
756
+ handled = handled === VOID ? false : handled;
757
+ this.zx_1 = cause;
758
+ this.ay_1 = atomic$boolean$1(handled);
759
+ }
760
+ protoOf(CompletedExceptionally).by = function () {
761
+ return this.ay_1.kotlinx$atomicfu$value;
762
+ };
763
+ protoOf(CompletedExceptionally).l12 = function () {
764
+ return this.ay_1.atomicfu$compareAndSet(false, true);
765
+ };
766
+ protoOf(CompletedExceptionally).toString = function () {
767
+ return get_classSimpleName(this) + '[' + this.zx_1.toString() + ']';
768
+ };
769
+ function CancelledContinuation(continuation, cause, handled) {
770
+ CompletedExceptionally.call(this, cause == null ? CancellationException_init_$Create$('Continuation ' + toString(continuation) + ' was cancelled normally') : cause, handled);
771
+ this.m11_1 = atomic$boolean$1(false);
772
+ }
773
+ protoOf(CancelledContinuation).n11 = function () {
774
+ return this.m11_1.atomicfu$compareAndSet(false, true);
775
+ };
776
+ function toState(_this__u8e3s4, caller) {
777
+ // Inline function 'kotlin.getOrElse' call
778
+ var exception = Result__exceptionOrNull_impl_p6xea9(_this__u8e3s4);
779
+ var tmp;
780
+ if (exception == null) {
781
+ var tmp_0 = _Result___get_value__impl__bjfvqg(_this__u8e3s4);
782
+ tmp = (tmp_0 == null ? true : !(tmp_0 == null)) ? tmp_0 : THROW_CCE();
783
+ } else {
784
+ tmp = new CompletedExceptionally(recoverStackTrace(exception, caller));
785
+ }
786
+ return tmp;
787
+ }
788
+ function toState_0(_this__u8e3s4) {
789
+ // Inline function 'kotlin.getOrElse' call
790
+ var exception = Result__exceptionOrNull_impl_p6xea9(_this__u8e3s4);
791
+ var tmp;
792
+ if (exception == null) {
793
+ var tmp_0 = _Result___get_value__impl__bjfvqg(_this__u8e3s4);
794
+ tmp = (tmp_0 == null ? true : !(tmp_0 == null)) ? tmp_0 : THROW_CCE();
795
+ } else {
796
+ tmp = new CompletedExceptionally(exception);
797
+ }
798
+ return tmp;
799
+ }
800
+ function CoroutineDispatcher$Key$_init_$lambda_akl8b5(it) {
801
+ return it instanceof CoroutineDispatcher ? it : null;
802
+ }
803
+ function Key() {
804
+ Key_instance_0 = this;
805
+ var tmp = Key_instance;
806
+ AbstractCoroutineContextKey.call(this, tmp, CoroutineDispatcher$Key$_init_$lambda_akl8b5);
807
+ }
808
+ var Key_instance_0;
809
+ function Key_getInstance() {
810
+ if (Key_instance_0 == null)
811
+ new Key();
812
+ return Key_instance_0;
813
+ }
814
+ function CoroutineDispatcher() {
815
+ Key_getInstance();
816
+ AbstractCoroutineContextElement.call(this, Key_instance);
817
+ }
818
+ protoOf(CoroutineDispatcher).n12 = function (context) {
819
+ return true;
820
+ };
821
+ protoOf(CoroutineDispatcher).i7 = function (continuation) {
822
+ return new DispatchedContinuation(this, continuation);
823
+ };
824
+ protoOf(CoroutineDispatcher).j7 = function (continuation) {
825
+ var dispatched = continuation instanceof DispatchedContinuation ? continuation : THROW_CCE();
826
+ dispatched.p12();
827
+ };
828
+ protoOf(CoroutineDispatcher).toString = function () {
829
+ return get_classSimpleName(this) + '@' + get_hexAddress(this);
830
+ };
831
+ function handleCoroutineException(context, exception) {
832
+ var tmp;
833
+ if (exception instanceof DispatchException) {
834
+ tmp = exception.q12_1;
835
+ } else {
836
+ tmp = exception;
837
+ }
838
+ var reportException = tmp;
839
+ try {
840
+ var tmp0_safe_receiver = context.h7(Key_instance_1);
841
+ if (tmp0_safe_receiver == null)
842
+ null;
843
+ else {
844
+ // Inline function 'kotlin.let' call
845
+ tmp0_safe_receiver.r12(context, reportException);
846
+ return Unit_instance;
847
+ }
848
+ } catch ($p) {
849
+ if ($p instanceof Error) {
850
+ var t = $p;
851
+ handleUncaughtCoroutineException(context, handlerException(reportException, t));
852
+ return Unit_instance;
853
+ } else {
854
+ throw $p;
855
+ }
856
+ }
857
+ handleUncaughtCoroutineException(context, reportException);
858
+ }
859
+ function Key_0() {
860
+ }
861
+ var Key_instance_1;
862
+ function Key_getInstance_0() {
863
+ return Key_instance_1;
864
+ }
865
+ function handlerException(originalException, thrownException) {
866
+ if (originalException === thrownException)
867
+ return originalException;
868
+ // Inline function 'kotlin.apply' call
869
+ var this_0 = RuntimeException_init_$Create$('Exception while trying to handle coroutine exception', thrownException);
870
+ addSuppressed(this_0, originalException);
871
+ return this_0;
872
+ }
873
+ function GlobalScope() {
874
+ }
875
+ protoOf(GlobalScope).tx = function () {
876
+ return EmptyCoroutineContext_getInstance();
877
+ };
878
+ var GlobalScope_instance;
879
+ function GlobalScope_getInstance() {
880
+ return GlobalScope_instance;
881
+ }
882
+ function CoroutineScope() {
883
+ }
884
+ var CoroutineStart_DEFAULT_instance;
885
+ var CoroutineStart_LAZY_instance;
886
+ var CoroutineStart_ATOMIC_instance;
887
+ var CoroutineStart_UNDISPATCHED_instance;
888
+ var CoroutineStart_entriesInitialized;
889
+ function CoroutineStart_initEntries() {
890
+ if (CoroutineStart_entriesInitialized)
891
+ return Unit_instance;
892
+ CoroutineStart_entriesInitialized = true;
893
+ CoroutineStart_DEFAULT_instance = new CoroutineStart('DEFAULT', 0);
894
+ CoroutineStart_LAZY_instance = new CoroutineStart('LAZY', 1);
895
+ CoroutineStart_ATOMIC_instance = new CoroutineStart('ATOMIC', 2);
896
+ CoroutineStart_UNDISPATCHED_instance = new CoroutineStart('UNDISPATCHED', 3);
897
+ }
898
+ function CoroutineStart(name, ordinal) {
899
+ Enum.call(this, name, ordinal);
900
+ }
901
+ protoOf(CoroutineStart).ky = function (block, receiver, completion) {
902
+ var tmp;
903
+ switch (this.w1_1) {
904
+ case 0:
905
+ startCoroutineCancellable(block, receiver, completion);
906
+ tmp = Unit_instance;
907
+ break;
908
+ case 2:
909
+ startCoroutine(block, receiver, completion);
910
+ tmp = Unit_instance;
911
+ break;
912
+ case 3:
913
+ startCoroutineUndispatched(block, receiver, completion);
914
+ tmp = Unit_instance;
915
+ break;
916
+ case 1:
917
+ tmp = Unit_instance;
918
+ break;
919
+ default:
920
+ noWhenBranchMatchedException();
921
+ break;
922
+ }
923
+ return tmp;
924
+ };
925
+ protoOf(CoroutineStart).lz = function () {
926
+ return this === CoroutineStart_LAZY_getInstance();
927
+ };
928
+ function CoroutineStart_DEFAULT_getInstance() {
929
+ CoroutineStart_initEntries();
930
+ return CoroutineStart_DEFAULT_instance;
931
+ }
932
+ function CoroutineStart_LAZY_getInstance() {
933
+ CoroutineStart_initEntries();
934
+ return CoroutineStart_LAZY_instance;
935
+ }
936
+ function delta($this, unconfined) {
937
+ return unconfined ? new Long(0, 1) : new Long(1, 0);
938
+ }
939
+ function EventLoop() {
940
+ CoroutineDispatcher.call(this);
941
+ this.t12_1 = new Long(0, 0);
942
+ this.u12_1 = false;
943
+ this.v12_1 = null;
944
+ }
945
+ protoOf(EventLoop).w12 = function () {
946
+ var tmp0_elvis_lhs = this.v12_1;
947
+ var tmp;
948
+ if (tmp0_elvis_lhs == null) {
949
+ return false;
950
+ } else {
951
+ tmp = tmp0_elvis_lhs;
952
+ }
953
+ var queue = tmp;
954
+ var tmp1_elvis_lhs = queue.ta();
955
+ var tmp_0;
956
+ if (tmp1_elvis_lhs == null) {
957
+ return false;
958
+ } else {
959
+ tmp_0 = tmp1_elvis_lhs;
960
+ }
961
+ var task = tmp_0;
962
+ task.q11();
963
+ return true;
964
+ };
965
+ protoOf(EventLoop).x12 = function (task) {
966
+ var tmp0_elvis_lhs = this.v12_1;
967
+ var tmp;
968
+ if (tmp0_elvis_lhs == null) {
969
+ // Inline function 'kotlin.also' call
970
+ var this_0 = ArrayDeque_init_$Create$();
971
+ this.v12_1 = this_0;
972
+ tmp = this_0;
973
+ } else {
974
+ tmp = tmp0_elvis_lhs;
975
+ }
976
+ var queue = tmp;
977
+ queue.ra(task);
978
+ };
979
+ protoOf(EventLoop).y12 = function () {
980
+ return compare(this.t12_1, delta(this, true)) >= 0;
981
+ };
982
+ protoOf(EventLoop).z12 = function () {
983
+ var tmp0_safe_receiver = this.v12_1;
984
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.p();
985
+ return tmp1_elvis_lhs == null ? true : tmp1_elvis_lhs;
986
+ };
987
+ protoOf(EventLoop).a13 = function (unconfined) {
988
+ this.t12_1 = add(this.t12_1, delta(this, unconfined));
989
+ if (!unconfined)
990
+ this.u12_1 = true;
991
+ };
992
+ protoOf(EventLoop).b13 = function (unconfined) {
993
+ this.t12_1 = subtract(this.t12_1, delta(this, unconfined));
994
+ if (compare(this.t12_1, new Long(0, 0)) > 0)
995
+ return Unit_instance;
996
+ // Inline function 'kotlinx.coroutines.assert' call
997
+ if (this.u12_1) {
998
+ this.c13();
999
+ }
1000
+ };
1001
+ protoOf(EventLoop).c13 = function () {
1002
+ };
1003
+ function ThreadLocalEventLoop() {
1004
+ ThreadLocalEventLoop_instance = this;
1005
+ this.d13_1 = commonThreadLocal(new Symbol('ThreadLocalEventLoop'));
1006
+ }
1007
+ protoOf(ThreadLocalEventLoop).e13 = function () {
1008
+ var tmp0_elvis_lhs = this.d13_1.g13();
1009
+ var tmp;
1010
+ if (tmp0_elvis_lhs == null) {
1011
+ // Inline function 'kotlin.also' call
1012
+ var this_0 = createEventLoop();
1013
+ ThreadLocalEventLoop_getInstance().d13_1.h13(this_0);
1014
+ tmp = this_0;
1015
+ } else {
1016
+ tmp = tmp0_elvis_lhs;
1017
+ }
1018
+ return tmp;
1019
+ };
1020
+ var ThreadLocalEventLoop_instance;
1021
+ function ThreadLocalEventLoop_getInstance() {
1022
+ if (ThreadLocalEventLoop_instance == null)
1023
+ new ThreadLocalEventLoop();
1024
+ return ThreadLocalEventLoop_instance;
1025
+ }
1026
+ function CompletionHandlerException(message, cause) {
1027
+ RuntimeException_init_$Init$(message, cause, this);
1028
+ captureStack(this, CompletionHandlerException);
1029
+ }
1030
+ function CoroutinesInternalError(message, cause) {
1031
+ Error_init_$Init$(message, cause, this);
1032
+ captureStack(this, CoroutinesInternalError);
1033
+ }
1034
+ function Key_1() {
1035
+ }
1036
+ var Key_instance_2;
1037
+ function Key_getInstance_1() {
1038
+ return Key_instance_2;
1039
+ }
1040
+ function ParentJob() {
1041
+ }
1042
+ function NonDisposableHandle() {
1043
+ }
1044
+ protoOf(NonDisposableHandle).n10 = function () {
1045
+ };
1046
+ protoOf(NonDisposableHandle).az = function (cause) {
1047
+ return false;
1048
+ };
1049
+ protoOf(NonDisposableHandle).toString = function () {
1050
+ return 'NonDisposableHandle';
1051
+ };
1052
+ var NonDisposableHandle_instance;
1053
+ function NonDisposableHandle_getInstance() {
1054
+ return NonDisposableHandle_instance;
1055
+ }
1056
+ function invokeOnCompletion(_this__u8e3s4, invokeImmediately, handler) {
1057
+ invokeImmediately = invokeImmediately === VOID ? true : invokeImmediately;
1058
+ var tmp;
1059
+ if (_this__u8e3s4 instanceof JobSupport) {
1060
+ tmp = _this__u8e3s4.wy(invokeImmediately, handler);
1061
+ } else {
1062
+ var tmp_0 = handler.y11();
1063
+ tmp = _this__u8e3s4.vy(tmp_0, invokeImmediately, JobNode$invoke$ref(handler));
1064
+ }
1065
+ return tmp;
1066
+ }
1067
+ function JobNode$invoke$ref(p0) {
1068
+ var l = function (_this__u8e3s4) {
1069
+ p0.b11(_this__u8e3s4);
1070
+ return Unit_instance;
1071
+ };
1072
+ l.callableName = 'invoke';
1073
+ return l;
1074
+ }
1075
+ function get_COMPLETING_ALREADY() {
1076
+ _init_properties_JobSupport_kt__68f172();
1077
+ return COMPLETING_ALREADY;
1078
+ }
1079
+ var COMPLETING_ALREADY;
1080
+ function get_COMPLETING_WAITING_CHILDREN() {
1081
+ _init_properties_JobSupport_kt__68f172();
1082
+ return COMPLETING_WAITING_CHILDREN;
1083
+ }
1084
+ var COMPLETING_WAITING_CHILDREN;
1085
+ function get_COMPLETING_RETRY() {
1086
+ _init_properties_JobSupport_kt__68f172();
1087
+ return COMPLETING_RETRY;
1088
+ }
1089
+ var COMPLETING_RETRY;
1090
+ function get_TOO_LATE_TO_CANCEL() {
1091
+ _init_properties_JobSupport_kt__68f172();
1092
+ return TOO_LATE_TO_CANCEL;
1093
+ }
1094
+ var TOO_LATE_TO_CANCEL;
1095
+ function get_SEALED() {
1096
+ _init_properties_JobSupport_kt__68f172();
1097
+ return SEALED;
1098
+ }
1099
+ var SEALED;
1100
+ function get_EMPTY_NEW() {
1101
+ _init_properties_JobSupport_kt__68f172();
1102
+ return EMPTY_NEW;
1103
+ }
1104
+ var EMPTY_NEW;
1105
+ function get_EMPTY_ACTIVE() {
1106
+ _init_properties_JobSupport_kt__68f172();
1107
+ return EMPTY_ACTIVE;
1108
+ }
1109
+ var EMPTY_ACTIVE;
1110
+ function Empty(isActive) {
1111
+ this.i13_1 = isActive;
1112
+ }
1113
+ protoOf(Empty).ux = function () {
1114
+ return this.i13_1;
1115
+ };
1116
+ protoOf(Empty).e12 = function () {
1117
+ return null;
1118
+ };
1119
+ protoOf(Empty).toString = function () {
1120
+ return 'Empty{' + (this.i13_1 ? 'Active' : 'New') + '}';
1121
+ };
1122
+ function Incomplete() {
1123
+ }
1124
+ function NodeList() {
1125
+ LockFreeLinkedListHead.call(this);
1126
+ }
1127
+ protoOf(NodeList).ux = function () {
1128
+ return true;
1129
+ };
1130
+ protoOf(NodeList).e12 = function () {
1131
+ return this;
1132
+ };
1133
+ protoOf(NodeList).m13 = function (state) {
1134
+ // Inline function 'kotlin.text.buildString' call
1135
+ // Inline function 'kotlin.apply' call
1136
+ var this_0 = StringBuilder_init_$Create$();
1137
+ this_0.f6('List{');
1138
+ this_0.f6(state);
1139
+ this_0.f6('}[');
1140
+ var first = true;
1141
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListHead.forEach' call
1142
+ var cur = this.f12_1;
1143
+ while (!equals(cur, this)) {
1144
+ var node = cur;
1145
+ if (node instanceof JobNode) {
1146
+ if (first) {
1147
+ first = false;
1148
+ } else
1149
+ this_0.f6(', ');
1150
+ this_0.e6(node);
1151
+ }
1152
+ cur = cur.f12_1;
1153
+ }
1154
+ this_0.f6(']');
1155
+ return this_0.toString();
1156
+ };
1157
+ protoOf(NodeList).toString = function () {
1158
+ return get_DEBUG() ? this.m13('Active') : protoOf(LockFreeLinkedListHead).toString.call(this);
1159
+ };
1160
+ function JobNode() {
1161
+ LockFreeLinkedListNode.call(this);
1162
+ }
1163
+ protoOf(JobNode).d12 = function () {
1164
+ var tmp = this.c12_1;
1165
+ if (!(tmp == null))
1166
+ return tmp;
1167
+ else {
1168
+ throwUninitializedPropertyAccessException('job');
1169
+ }
1170
+ };
1171
+ protoOf(JobNode).ux = function () {
1172
+ return true;
1173
+ };
1174
+ protoOf(JobNode).e12 = function () {
1175
+ return null;
1176
+ };
1177
+ protoOf(JobNode).n10 = function () {
1178
+ return this.d12().xy(this);
1179
+ };
1180
+ protoOf(JobNode).toString = function () {
1181
+ return get_classSimpleName(this) + '@' + get_hexAddress(this) + '[job@' + get_hexAddress(this.d12()) + ']';
1182
+ };
1183
+ function _set_exceptionsHolder__tqm22h($this, value) {
1184
+ $this.r13_1.kotlinx$atomicfu$value = value;
1185
+ }
1186
+ function _get_exceptionsHolder__nhszp($this) {
1187
+ return $this.r13_1.kotlinx$atomicfu$value;
1188
+ }
1189
+ function allocateList($this) {
1190
+ return ArrayList_init_$Create$(4);
1191
+ }
1192
+ function finalizeFinishingState($this, state, proposedUpdate) {
1193
+ // Inline function 'kotlinx.coroutines.assert' call
1194
+ // Inline function 'kotlinx.coroutines.assert' call
1195
+ // Inline function 'kotlinx.coroutines.assert' call
1196
+ var tmp0_safe_receiver = proposedUpdate instanceof CompletedExceptionally ? proposedUpdate : null;
1197
+ var proposedException = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.zx_1;
1198
+ var wasCancelling;
1199
+ // Inline function 'kotlinx.coroutines.internal.synchronized' call
1200
+ // Inline function 'kotlinx.coroutines.internal.synchronizedImpl' call
1201
+ wasCancelling = state.s13();
1202
+ var exceptions = state.t13(proposedException);
1203
+ var finalCause = getFinalRootCause($this, state, exceptions);
1204
+ if (!(finalCause == null)) {
1205
+ addSuppressedExceptions($this, finalCause, exceptions);
1206
+ }
1207
+ var finalException = finalCause;
1208
+ var finalState = finalException == null ? proposedUpdate : finalException === proposedException ? proposedUpdate : new CompletedExceptionally(finalException);
1209
+ if (!(finalException == null)) {
1210
+ var handled = cancelParent($this, finalException) || $this.hz(finalException);
1211
+ if (handled) {
1212
+ (finalState instanceof CompletedExceptionally ? finalState : THROW_CCE()).l12();
1213
+ }
1214
+ }
1215
+ if (!wasCancelling) {
1216
+ $this.ez(finalException);
1217
+ }
1218
+ $this.yx(finalState);
1219
+ var casSuccess = $this.nx_1.atomicfu$compareAndSet(state, boxIncomplete(finalState));
1220
+ // Inline function 'kotlinx.coroutines.assert' call
1221
+ completeStateFinalization($this, state, finalState);
1222
+ return finalState;
1223
+ }
1224
+ function getFinalRootCause($this, state, exceptions) {
1225
+ if (exceptions.p()) {
1226
+ if (state.s13()) {
1227
+ // Inline function 'kotlinx.coroutines.JobSupport.defaultCancellationException' call
1228
+ return new JobCancellationException(null == null ? $this.xx() : null, null, $this);
1229
+ }
1230
+ return null;
1231
+ }
1232
+ var tmp$ret$2;
1233
+ $l$block: {
1234
+ // Inline function 'kotlin.collections.firstOrNull' call
1235
+ var _iterator__ex2g4s = exceptions.f();
1236
+ while (_iterator__ex2g4s.g()) {
1237
+ var element = _iterator__ex2g4s.h();
1238
+ if (!(element instanceof CancellationException)) {
1239
+ tmp$ret$2 = element;
1240
+ break $l$block;
1241
+ }
1242
+ }
1243
+ tmp$ret$2 = null;
1244
+ }
1245
+ var firstNonCancellation = tmp$ret$2;
1246
+ if (!(firstNonCancellation == null))
1247
+ return firstNonCancellation;
1248
+ var first = exceptions.n(0);
1249
+ if (first instanceof TimeoutCancellationException) {
1250
+ var tmp$ret$4;
1251
+ $l$block_0: {
1252
+ // Inline function 'kotlin.collections.firstOrNull' call
1253
+ var _iterator__ex2g4s_0 = exceptions.f();
1254
+ while (_iterator__ex2g4s_0.g()) {
1255
+ var element_0 = _iterator__ex2g4s_0.h();
1256
+ var tmp;
1257
+ if (!(element_0 === first)) {
1258
+ tmp = element_0 instanceof TimeoutCancellationException;
1259
+ } else {
1260
+ tmp = false;
1261
+ }
1262
+ if (tmp) {
1263
+ tmp$ret$4 = element_0;
1264
+ break $l$block_0;
1265
+ }
1266
+ }
1267
+ tmp$ret$4 = null;
1268
+ }
1269
+ var detailedTimeoutException = tmp$ret$4;
1270
+ if (!(detailedTimeoutException == null))
1271
+ return detailedTimeoutException;
1272
+ }
1273
+ return first;
1274
+ }
1275
+ function addSuppressedExceptions($this, rootCause, exceptions) {
1276
+ if (exceptions.i() <= 1)
1277
+ return Unit_instance;
1278
+ var seenExceptions = identitySet(exceptions.i());
1279
+ var unwrappedCause = unwrap(rootCause);
1280
+ var _iterator__ex2g4s = exceptions.f();
1281
+ while (_iterator__ex2g4s.g()) {
1282
+ var exception = _iterator__ex2g4s.h();
1283
+ var unwrapped = unwrap(exception);
1284
+ var tmp;
1285
+ var tmp_0;
1286
+ if (!(unwrapped === rootCause) && !(unwrapped === unwrappedCause)) {
1287
+ tmp_0 = !(unwrapped instanceof CancellationException);
1288
+ } else {
1289
+ tmp_0 = false;
1290
+ }
1291
+ if (tmp_0) {
1292
+ tmp = seenExceptions.d(unwrapped);
1293
+ } else {
1294
+ tmp = false;
1295
+ }
1296
+ if (tmp) {
1297
+ addSuppressed(rootCause, unwrapped);
1298
+ }
1299
+ }
1300
+ }
1301
+ function tryFinalizeSimpleState($this, state, update) {
1302
+ // Inline function 'kotlinx.coroutines.assert' call
1303
+ // Inline function 'kotlinx.coroutines.assert' call
1304
+ if (!$this.nx_1.atomicfu$compareAndSet(state, boxIncomplete(update)))
1305
+ return false;
1306
+ $this.ez(null);
1307
+ $this.yx(update);
1308
+ completeStateFinalization($this, state, update);
1309
+ return true;
1310
+ }
1311
+ function completeStateFinalization($this, state, update) {
1312
+ var tmp0_safe_receiver = $this.my();
1313
+ if (tmp0_safe_receiver == null)
1314
+ null;
1315
+ else {
1316
+ // Inline function 'kotlin.let' call
1317
+ tmp0_safe_receiver.n10();
1318
+ $this.ly(NonDisposableHandle_instance);
1319
+ }
1320
+ var tmp1_safe_receiver = update instanceof CompletedExceptionally ? update : null;
1321
+ var cause = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.zx_1;
1322
+ if (state instanceof JobNode) {
1323
+ try {
1324
+ state.b11(cause);
1325
+ } catch ($p) {
1326
+ if ($p instanceof Error) {
1327
+ var ex = $p;
1328
+ $this.fy(new CompletionHandlerException('Exception in completion handler ' + state.toString() + ' for ' + $this.toString(), ex));
1329
+ } else {
1330
+ throw $p;
1331
+ }
1332
+ }
1333
+ } else {
1334
+ var tmp2_safe_receiver = state.e12();
1335
+ if (tmp2_safe_receiver == null)
1336
+ null;
1337
+ else {
1338
+ notifyCompletion($this, tmp2_safe_receiver, cause);
1339
+ }
1340
+ }
1341
+ }
1342
+ function notifyCancelling($this, list, cause) {
1343
+ $this.ez(cause);
1344
+ list.n13(4);
1345
+ // Inline function 'kotlinx.coroutines.JobSupport.notifyHandlers' call
1346
+ var exception = null;
1347
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListHead.forEach' call
1348
+ var cur = list.f12_1;
1349
+ while (!equals(cur, list)) {
1350
+ var node = cur;
1351
+ var tmp;
1352
+ if (node instanceof JobNode) {
1353
+ tmp = node.y11();
1354
+ } else {
1355
+ tmp = false;
1356
+ }
1357
+ if (tmp) {
1358
+ try {
1359
+ node.b11(cause);
1360
+ } catch ($p) {
1361
+ if ($p instanceof Error) {
1362
+ var ex = $p;
1363
+ var tmp0_safe_receiver = exception;
1364
+ var tmp_0;
1365
+ if (tmp0_safe_receiver == null) {
1366
+ tmp_0 = null;
1367
+ } else {
1368
+ // Inline function 'kotlin.apply' call
1369
+ addSuppressed(tmp0_safe_receiver, ex);
1370
+ tmp_0 = tmp0_safe_receiver;
1371
+ }
1372
+ if (tmp_0 == null) {
1373
+ // Inline function 'kotlin.run' call
1374
+ exception = new CompletionHandlerException('Exception in completion handler ' + node.toString() + ' for ' + $this.toString(), ex);
1375
+ }
1376
+ } else {
1377
+ throw $p;
1378
+ }
1379
+ }
1380
+ }
1381
+ cur = cur.f12_1;
1382
+ }
1383
+ var tmp0_safe_receiver_0 = exception;
1384
+ if (tmp0_safe_receiver_0 == null)
1385
+ null;
1386
+ else {
1387
+ // Inline function 'kotlin.let' call
1388
+ $this.fy(tmp0_safe_receiver_0);
1389
+ }
1390
+ cancelParent($this, cause);
1391
+ }
1392
+ function cancelParent($this, cause) {
1393
+ if ($this.fz())
1394
+ return true;
1395
+ var isCancellation = cause instanceof CancellationException;
1396
+ var parent = $this.my();
1397
+ if (parent === null || parent === NonDisposableHandle_instance) {
1398
+ return isCancellation;
1399
+ }
1400
+ return parent.az(cause) || isCancellation;
1401
+ }
1402
+ function notifyCompletion($this, _this__u8e3s4, cause) {
1403
+ _this__u8e3s4.n13(1);
1404
+ // Inline function 'kotlinx.coroutines.JobSupport.notifyHandlers' call
1405
+ var exception = null;
1406
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListHead.forEach' call
1407
+ var cur = _this__u8e3s4.f12_1;
1408
+ while (!equals(cur, _this__u8e3s4)) {
1409
+ var node = cur;
1410
+ var tmp;
1411
+ if (node instanceof JobNode) {
1412
+ tmp = true;
1413
+ } else {
1414
+ tmp = false;
1415
+ }
1416
+ if (tmp) {
1417
+ try {
1418
+ node.b11(cause);
1419
+ } catch ($p) {
1420
+ if ($p instanceof Error) {
1421
+ var ex = $p;
1422
+ var tmp0_safe_receiver = exception;
1423
+ var tmp_0;
1424
+ if (tmp0_safe_receiver == null) {
1425
+ tmp_0 = null;
1426
+ } else {
1427
+ // Inline function 'kotlin.apply' call
1428
+ addSuppressed(tmp0_safe_receiver, ex);
1429
+ tmp_0 = tmp0_safe_receiver;
1430
+ }
1431
+ if (tmp_0 == null) {
1432
+ // Inline function 'kotlin.run' call
1433
+ exception = new CompletionHandlerException('Exception in completion handler ' + node.toString() + ' for ' + $this.toString(), ex);
1434
+ }
1435
+ } else {
1436
+ throw $p;
1437
+ }
1438
+ }
1439
+ }
1440
+ cur = cur.f12_1;
1441
+ }
1442
+ var tmp0_safe_receiver_0 = exception;
1443
+ if (tmp0_safe_receiver_0 == null)
1444
+ null;
1445
+ else {
1446
+ // Inline function 'kotlin.let' call
1447
+ $this.fy(tmp0_safe_receiver_0);
1448
+ }
1449
+ }
1450
+ function startInternal($this, state) {
1451
+ if (state instanceof Empty) {
1452
+ if (state.i13_1)
1453
+ return 0;
1454
+ if (!$this.nx_1.atomicfu$compareAndSet(state, get_EMPTY_ACTIVE()))
1455
+ return -1;
1456
+ $this.qy();
1457
+ return 1;
1458
+ } else {
1459
+ if (state instanceof InactiveNodeList) {
1460
+ if (!$this.nx_1.atomicfu$compareAndSet(state, state.u13_1))
1461
+ return -1;
1462
+ $this.qy();
1463
+ return 1;
1464
+ } else {
1465
+ return 0;
1466
+ }
1467
+ }
1468
+ }
1469
+ function promoteEmptyToNodeList($this, state) {
1470
+ var list = new NodeList();
1471
+ var update = state.i13_1 ? list : new InactiveNodeList(list);
1472
+ $this.nx_1.atomicfu$compareAndSet(state, update);
1473
+ }
1474
+ function promoteSingleToNodeList($this, state) {
1475
+ state.k12(new NodeList());
1476
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListNode.nextNode' call
1477
+ var list = state.f12_1;
1478
+ $this.nx_1.atomicfu$compareAndSet(state, list);
1479
+ }
1480
+ function cancelMakeCompleting($this, cause) {
1481
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
1482
+ while (true) {
1483
+ var state = $this.ny();
1484
+ var tmp;
1485
+ if (!(!(state == null) ? isInterface(state, Incomplete) : false)) {
1486
+ tmp = true;
1487
+ } else {
1488
+ var tmp_0;
1489
+ if (state instanceof Finishing) {
1490
+ tmp_0 = state.v13();
1491
+ } else {
1492
+ tmp_0 = false;
1493
+ }
1494
+ tmp = tmp_0;
1495
+ }
1496
+ if (tmp) {
1497
+ return get_COMPLETING_ALREADY();
1498
+ }
1499
+ var proposedUpdate = new CompletedExceptionally(createCauseException($this, cause));
1500
+ var finalState = tryMakeCompleting($this, state, proposedUpdate);
1501
+ if (!(finalState === get_COMPLETING_RETRY()))
1502
+ return finalState;
1503
+ }
1504
+ }
1505
+ function createCauseException($this, cause) {
1506
+ var tmp;
1507
+ if (cause == null ? true : cause instanceof Error) {
1508
+ var tmp_0;
1509
+ if (cause == null) {
1510
+ // Inline function 'kotlinx.coroutines.JobSupport.defaultCancellationException' call
1511
+ tmp_0 = new JobCancellationException(null == null ? $this.xx() : null, null, $this);
1512
+ } else {
1513
+ tmp_0 = cause;
1514
+ }
1515
+ tmp = tmp_0;
1516
+ } else {
1517
+ tmp = (isInterface(cause, ParentJob) ? cause : THROW_CCE()).cz();
1518
+ }
1519
+ return tmp;
1520
+ }
1521
+ function makeCancelling($this, cause) {
1522
+ var causeExceptionCache = null;
1523
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
1524
+ while (true) {
1525
+ var tmp0 = $this.ny();
1526
+ $l$block: {
1527
+ if (tmp0 instanceof Finishing) {
1528
+ // Inline function 'kotlinx.coroutines.internal.synchronized' call
1529
+ // Inline function 'kotlinx.coroutines.internal.synchronizedImpl' call
1530
+ if (tmp0.w13())
1531
+ return get_TOO_LATE_TO_CANCEL();
1532
+ var wasCancelling = tmp0.s13();
1533
+ if (!(cause == null) || !wasCancelling) {
1534
+ var tmp0_elvis_lhs = causeExceptionCache;
1535
+ var tmp;
1536
+ if (tmp0_elvis_lhs == null) {
1537
+ // Inline function 'kotlin.also' call
1538
+ var this_0 = createCauseException($this, cause);
1539
+ causeExceptionCache = this_0;
1540
+ tmp = this_0;
1541
+ } else {
1542
+ tmp = tmp0_elvis_lhs;
1543
+ }
1544
+ var causeException = tmp;
1545
+ tmp0.x13(causeException);
1546
+ }
1547
+ // Inline function 'kotlin.takeIf' call
1548
+ var this_1 = tmp0.y13();
1549
+ var tmp_0;
1550
+ if (!wasCancelling) {
1551
+ tmp_0 = this_1;
1552
+ } else {
1553
+ tmp_0 = null;
1554
+ }
1555
+ var notifyRootCause = tmp_0;
1556
+ if (notifyRootCause == null)
1557
+ null;
1558
+ else {
1559
+ // Inline function 'kotlin.let' call
1560
+ notifyCancelling($this, tmp0.o13_1, notifyRootCause);
1561
+ }
1562
+ return get_COMPLETING_ALREADY();
1563
+ } else {
1564
+ if (!(tmp0 == null) ? isInterface(tmp0, Incomplete) : false) {
1565
+ var tmp2_elvis_lhs = causeExceptionCache;
1566
+ var tmp_1;
1567
+ if (tmp2_elvis_lhs == null) {
1568
+ // Inline function 'kotlin.also' call
1569
+ var this_2 = createCauseException($this, cause);
1570
+ causeExceptionCache = this_2;
1571
+ tmp_1 = this_2;
1572
+ } else {
1573
+ tmp_1 = tmp2_elvis_lhs;
1574
+ }
1575
+ var causeException_0 = tmp_1;
1576
+ if (tmp0.ux()) {
1577
+ if (tryMakeCancelling($this, tmp0, causeException_0))
1578
+ return get_COMPLETING_ALREADY();
1579
+ } else {
1580
+ var finalState = tryMakeCompleting($this, tmp0, new CompletedExceptionally(causeException_0));
1581
+ if (finalState === get_COMPLETING_ALREADY()) {
1582
+ // Inline function 'kotlin.error' call
1583
+ var message = 'Cannot happen in ' + toString(tmp0);
1584
+ throw IllegalStateException_init_$Create$(toString(message));
1585
+ } else if (finalState === get_COMPLETING_RETRY()) {
1586
+ break $l$block;
1587
+ } else
1588
+ return finalState;
1589
+ }
1590
+ } else {
1591
+ return get_TOO_LATE_TO_CANCEL();
1592
+ }
1593
+ }
1594
+ }
1595
+ }
1596
+ }
1597
+ function getOrPromoteCancellingList($this, state) {
1598
+ var tmp0_elvis_lhs = state.e12();
1599
+ var tmp;
1600
+ if (tmp0_elvis_lhs == null) {
1601
+ var tmp_0;
1602
+ if (state instanceof Empty) {
1603
+ tmp_0 = new NodeList();
1604
+ } else {
1605
+ if (state instanceof JobNode) {
1606
+ promoteSingleToNodeList($this, state);
1607
+ tmp_0 = null;
1608
+ } else {
1609
+ var message = 'State should have list: ' + toString(state);
1610
+ throw IllegalStateException_init_$Create$(toString(message));
1611
+ }
1612
+ }
1613
+ tmp = tmp_0;
1614
+ } else {
1615
+ tmp = tmp0_elvis_lhs;
1616
+ }
1617
+ return tmp;
1618
+ }
1619
+ function tryMakeCancelling($this, state, rootCause) {
1620
+ // Inline function 'kotlinx.coroutines.assert' call
1621
+ // Inline function 'kotlinx.coroutines.assert' call
1622
+ var tmp0_elvis_lhs = getOrPromoteCancellingList($this, state);
1623
+ var tmp;
1624
+ if (tmp0_elvis_lhs == null) {
1625
+ return false;
1626
+ } else {
1627
+ tmp = tmp0_elvis_lhs;
1628
+ }
1629
+ var list = tmp;
1630
+ var cancelling = new Finishing(list, false, rootCause);
1631
+ if (!$this.nx_1.atomicfu$compareAndSet(state, cancelling))
1632
+ return false;
1633
+ notifyCancelling($this, list, rootCause);
1634
+ return true;
1635
+ }
1636
+ function tryMakeCompleting($this, state, proposedUpdate) {
1637
+ if (!(!(state == null) ? isInterface(state, Incomplete) : false))
1638
+ return get_COMPLETING_ALREADY();
1639
+ var tmp;
1640
+ var tmp_0;
1641
+ var tmp_1;
1642
+ if (state instanceof Empty) {
1643
+ tmp_1 = true;
1644
+ } else {
1645
+ tmp_1 = state instanceof JobNode;
1646
+ }
1647
+ if (tmp_1) {
1648
+ tmp_0 = !(state instanceof ChildHandleNode);
1649
+ } else {
1650
+ tmp_0 = false;
1651
+ }
1652
+ if (tmp_0) {
1653
+ tmp = !(proposedUpdate instanceof CompletedExceptionally);
1654
+ } else {
1655
+ tmp = false;
1656
+ }
1657
+ if (tmp) {
1658
+ if (tryFinalizeSimpleState($this, state, proposedUpdate)) {
1659
+ return proposedUpdate;
1660
+ }
1661
+ return get_COMPLETING_RETRY();
1662
+ }
1663
+ return tryMakeCompletingSlowPath($this, state, proposedUpdate);
1664
+ }
1665
+ function tryMakeCompletingSlowPath($this, state, proposedUpdate) {
1666
+ var tmp0_elvis_lhs = getOrPromoteCancellingList($this, state);
1667
+ var tmp;
1668
+ if (tmp0_elvis_lhs == null) {
1669
+ return get_COMPLETING_RETRY();
1670
+ } else {
1671
+ tmp = tmp0_elvis_lhs;
1672
+ }
1673
+ var list = tmp;
1674
+ var tmp1_elvis_lhs = state instanceof Finishing ? state : null;
1675
+ var finishing = tmp1_elvis_lhs == null ? new Finishing(list, false, null) : tmp1_elvis_lhs;
1676
+ var notifyRootCause;
1677
+ // Inline function 'kotlinx.coroutines.internal.synchronized' call
1678
+ // Inline function 'kotlinx.coroutines.internal.synchronizedImpl' call
1679
+ if (finishing.v13())
1680
+ return get_COMPLETING_ALREADY();
1681
+ finishing.z13(true);
1682
+ if (!(finishing === state)) {
1683
+ if (!$this.nx_1.atomicfu$compareAndSet(state, finishing))
1684
+ return get_COMPLETING_RETRY();
1685
+ }
1686
+ // Inline function 'kotlinx.coroutines.assert' call
1687
+ var wasCancelling = finishing.s13();
1688
+ var tmp0_safe_receiver = proposedUpdate instanceof CompletedExceptionally ? proposedUpdate : null;
1689
+ if (tmp0_safe_receiver == null)
1690
+ null;
1691
+ else {
1692
+ // Inline function 'kotlin.let' call
1693
+ finishing.x13(tmp0_safe_receiver.zx_1);
1694
+ }
1695
+ // Inline function 'kotlin.takeIf' call
1696
+ var this_0 = finishing.y13();
1697
+ var tmp_0;
1698
+ if (!wasCancelling) {
1699
+ tmp_0 = this_0;
1700
+ } else {
1701
+ tmp_0 = null;
1702
+ }
1703
+ notifyRootCause = tmp_0;
1704
+ if (notifyRootCause == null)
1705
+ null;
1706
+ else {
1707
+ // Inline function 'kotlin.let' call
1708
+ notifyCancelling($this, list, notifyRootCause);
1709
+ }
1710
+ var child = nextChild($this, list);
1711
+ if (!(child == null) && tryWaitForChild($this, finishing, child, proposedUpdate))
1712
+ return get_COMPLETING_WAITING_CHILDREN();
1713
+ list.n13(2);
1714
+ var anotherChild = nextChild($this, list);
1715
+ if (!(anotherChild == null) && tryWaitForChild($this, finishing, anotherChild, proposedUpdate))
1716
+ return get_COMPLETING_WAITING_CHILDREN();
1717
+ return finalizeFinishingState($this, finishing, proposedUpdate);
1718
+ }
1719
+ function _get_exceptionOrNull__b3j7js($this, _this__u8e3s4) {
1720
+ var tmp0_safe_receiver = _this__u8e3s4 instanceof CompletedExceptionally ? _this__u8e3s4 : null;
1721
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.zx_1;
1722
+ }
1723
+ function tryWaitForChild($this, state, child, proposedUpdate) {
1724
+ var $this_0 = $this;
1725
+ var state_0 = state;
1726
+ var child_0 = child;
1727
+ var proposedUpdate_0 = proposedUpdate;
1728
+ $l$1: do {
1729
+ $l$0: do {
1730
+ var handle = invokeOnCompletion(child_0.e14_1, false, new ChildCompletion($this_0, state_0, child_0, proposedUpdate_0));
1731
+ if (!(handle === NonDisposableHandle_instance))
1732
+ return true;
1733
+ var tmp0_elvis_lhs = nextChild($this_0, child_0);
1734
+ var tmp;
1735
+ if (tmp0_elvis_lhs == null) {
1736
+ return false;
1737
+ } else {
1738
+ tmp = tmp0_elvis_lhs;
1739
+ }
1740
+ var nextChild_0 = tmp;
1741
+ var tmp0 = $this_0;
1742
+ var tmp1 = state_0;
1743
+ var tmp3 = proposedUpdate_0;
1744
+ $this_0 = tmp0;
1745
+ state_0 = tmp1;
1746
+ child_0 = nextChild_0;
1747
+ proposedUpdate_0 = tmp3;
1748
+ continue $l$0;
1749
+ }
1750
+ while (false);
1751
+ }
1752
+ while (true);
1753
+ }
1754
+ function continueCompleting($this, state, lastChild, proposedUpdate) {
1755
+ // Inline function 'kotlinx.coroutines.assert' call
1756
+ var waitChild = nextChild($this, lastChild);
1757
+ if (!(waitChild == null) && tryWaitForChild($this, state, waitChild, proposedUpdate))
1758
+ return Unit_instance;
1759
+ state.o13_1.n13(2);
1760
+ var waitChildAgain = nextChild($this, lastChild);
1761
+ if (!(waitChildAgain == null) && tryWaitForChild($this, state, waitChildAgain, proposedUpdate)) {
1762
+ return Unit_instance;
1763
+ }
1764
+ var finalState = finalizeFinishingState($this, state, proposedUpdate);
1765
+ $this.ey(finalState);
1766
+ }
1767
+ function nextChild($this, _this__u8e3s4) {
1768
+ var cur = _this__u8e3s4;
1769
+ $l$loop: while (true) {
1770
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListNode.isRemoved' call
1771
+ if (!cur.h12_1) {
1772
+ break $l$loop;
1773
+ }
1774
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListNode.prevNode' call
1775
+ cur = cur.g12_1;
1776
+ }
1777
+ $l$loop_0: while (true) {
1778
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListNode.nextNode' call
1779
+ cur = cur.f12_1;
1780
+ // Inline function 'kotlinx.coroutines.internal.LockFreeLinkedListNode.isRemoved' call
1781
+ if (cur.h12_1)
1782
+ continue $l$loop_0;
1783
+ if (cur instanceof ChildHandleNode)
1784
+ return cur;
1785
+ if (cur instanceof NodeList)
1786
+ return null;
1787
+ }
1788
+ }
1789
+ function stateString($this, state) {
1790
+ var tmp;
1791
+ if (state instanceof Finishing) {
1792
+ tmp = state.s13() ? 'Cancelling' : state.v13() ? 'Completing' : 'Active';
1793
+ } else {
1794
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
1795
+ tmp = state.ux() ? 'Active' : 'New';
1796
+ } else {
1797
+ if (state instanceof CompletedExceptionally) {
1798
+ tmp = 'Cancelled';
1799
+ } else {
1800
+ tmp = 'Completed';
1801
+ }
1802
+ }
1803
+ }
1804
+ return tmp;
1805
+ }
1806
+ function Finishing(list, isCompleting, rootCause) {
1807
+ SynchronizedObject.call(this);
1808
+ this.o13_1 = list;
1809
+ this.p13_1 = atomic$boolean$1(isCompleting);
1810
+ this.q13_1 = atomic$ref$1(rootCause);
1811
+ this.r13_1 = atomic$ref$1(null);
1812
+ }
1813
+ protoOf(Finishing).e12 = function () {
1814
+ return this.o13_1;
1815
+ };
1816
+ protoOf(Finishing).z13 = function (value) {
1817
+ this.p13_1.kotlinx$atomicfu$value = value;
1818
+ };
1819
+ protoOf(Finishing).v13 = function () {
1820
+ return this.p13_1.kotlinx$atomicfu$value;
1821
+ };
1822
+ protoOf(Finishing).f14 = function (value) {
1823
+ this.q13_1.kotlinx$atomicfu$value = value;
1824
+ };
1825
+ protoOf(Finishing).y13 = function () {
1826
+ return this.q13_1.kotlinx$atomicfu$value;
1827
+ };
1828
+ protoOf(Finishing).w13 = function () {
1829
+ return _get_exceptionsHolder__nhszp(this) === get_SEALED();
1830
+ };
1831
+ protoOf(Finishing).s13 = function () {
1832
+ return !(this.y13() == null);
1833
+ };
1834
+ protoOf(Finishing).ux = function () {
1835
+ return this.y13() == null;
1836
+ };
1837
+ protoOf(Finishing).t13 = function (proposedException) {
1838
+ var eh = _get_exceptionsHolder__nhszp(this);
1839
+ var tmp;
1840
+ if (eh == null) {
1841
+ tmp = allocateList(this);
1842
+ } else {
1843
+ if (eh instanceof Error) {
1844
+ // Inline function 'kotlin.also' call
1845
+ var this_0 = allocateList(this);
1846
+ this_0.d(eh);
1847
+ tmp = this_0;
1848
+ } else {
1849
+ if (eh instanceof ArrayList) {
1850
+ tmp = eh instanceof ArrayList ? eh : THROW_CCE();
1851
+ } else {
1852
+ var message = 'State is ' + toString(eh);
1853
+ throw IllegalStateException_init_$Create$(toString(message));
1854
+ }
1855
+ }
1856
+ }
1857
+ var list = tmp;
1858
+ var rootCause = this.y13();
1859
+ if (rootCause == null)
1860
+ null;
1861
+ else {
1862
+ // Inline function 'kotlin.let' call
1863
+ list.y2(0, rootCause);
1864
+ }
1865
+ if (!(proposedException == null) && !equals(proposedException, rootCause)) {
1866
+ list.d(proposedException);
1867
+ }
1868
+ _set_exceptionsHolder__tqm22h(this, get_SEALED());
1869
+ return list;
1870
+ };
1871
+ protoOf(Finishing).x13 = function (exception) {
1872
+ var rootCause = this.y13();
1873
+ if (rootCause == null) {
1874
+ this.f14(exception);
1875
+ return Unit_instance;
1876
+ }
1877
+ if (exception === rootCause)
1878
+ return Unit_instance;
1879
+ var eh = _get_exceptionsHolder__nhszp(this);
1880
+ if (eh == null) {
1881
+ _set_exceptionsHolder__tqm22h(this, exception);
1882
+ } else {
1883
+ if (eh instanceof Error) {
1884
+ if (exception === eh)
1885
+ return Unit_instance;
1886
+ // Inline function 'kotlin.apply' call
1887
+ var this_0 = allocateList(this);
1888
+ this_0.d(eh);
1889
+ this_0.d(exception);
1890
+ _set_exceptionsHolder__tqm22h(this, this_0);
1891
+ } else {
1892
+ if (eh instanceof ArrayList) {
1893
+ (eh instanceof ArrayList ? eh : THROW_CCE()).d(exception);
1894
+ } else {
1895
+ // Inline function 'kotlin.error' call
1896
+ var message = 'State is ' + toString(eh);
1897
+ throw IllegalStateException_init_$Create$(toString(message));
1898
+ }
1899
+ }
1900
+ }
1901
+ };
1902
+ protoOf(Finishing).toString = function () {
1903
+ return 'Finishing[cancelling=' + this.s13() + ', completing=' + this.v13() + ', rootCause=' + toString_0(this.y13()) + ', exceptions=' + toString_0(_get_exceptionsHolder__nhszp(this)) + ', list=' + this.o13_1.toString() + ']';
1904
+ };
1905
+ function ChildCompletion(parent, state, child, proposedUpdate) {
1906
+ JobNode.call(this);
1907
+ this.k14_1 = parent;
1908
+ this.l14_1 = state;
1909
+ this.m14_1 = child;
1910
+ this.n14_1 = proposedUpdate;
1911
+ }
1912
+ protoOf(ChildCompletion).y11 = function () {
1913
+ return false;
1914
+ };
1915
+ protoOf(ChildCompletion).b11 = function (cause) {
1916
+ continueCompleting(this.k14_1, this.l14_1, this.m14_1, this.n14_1);
1917
+ };
1918
+ function JobSupport(active) {
1919
+ this.nx_1 = atomic$ref$1(active ? get_EMPTY_ACTIVE() : get_EMPTY_NEW());
1920
+ this.ox_1 = atomic$ref$1(null);
1921
+ }
1922
+ protoOf(JobSupport).i1 = function () {
1923
+ return Key_instance_2;
1924
+ };
1925
+ protoOf(JobSupport).ly = function (value) {
1926
+ this.ox_1.kotlinx$atomicfu$value = value;
1927
+ };
1928
+ protoOf(JobSupport).my = function () {
1929
+ return this.ox_1.kotlinx$atomicfu$value;
1930
+ };
1931
+ protoOf(JobSupport).px = function (parent) {
1932
+ // Inline function 'kotlinx.coroutines.assert' call
1933
+ if (parent == null) {
1934
+ this.ly(NonDisposableHandle_instance);
1935
+ return Unit_instance;
1936
+ }
1937
+ parent.py();
1938
+ var handle = parent.dz(this);
1939
+ this.ly(handle);
1940
+ if (this.oy()) {
1941
+ handle.n10();
1942
+ this.ly(NonDisposableHandle_instance);
1943
+ }
1944
+ };
1945
+ protoOf(JobSupport).ny = function () {
1946
+ return this.nx_1.kotlinx$atomicfu$value;
1947
+ };
1948
+ protoOf(JobSupport).ux = function () {
1949
+ var state = this.ny();
1950
+ var tmp;
1951
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
1952
+ tmp = state.ux();
1953
+ } else {
1954
+ tmp = false;
1955
+ }
1956
+ return tmp;
1957
+ };
1958
+ protoOf(JobSupport).oy = function () {
1959
+ var tmp = this.ny();
1960
+ return !(!(tmp == null) ? isInterface(tmp, Incomplete) : false);
1961
+ };
1962
+ protoOf(JobSupport).py = function () {
1963
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
1964
+ while (true) {
1965
+ var state = this.ny();
1966
+ var tmp0_subject = startInternal(this, state);
1967
+ if (tmp0_subject === 0)
1968
+ return false;
1969
+ else if (tmp0_subject === 1)
1970
+ return true;
1971
+ }
1972
+ };
1973
+ protoOf(JobSupport).qy = function () {
1974
+ };
1975
+ protoOf(JobSupport).ry = function () {
1976
+ var state = this.ny();
1977
+ var tmp;
1978
+ if (state instanceof Finishing) {
1979
+ var tmp0_safe_receiver = state.y13();
1980
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.sy(tmp0_safe_receiver, get_classSimpleName(this) + ' is cancelling');
1981
+ var tmp_0;
1982
+ if (tmp1_elvis_lhs == null) {
1983
+ var message = 'Job is still new or active: ' + this.toString();
1984
+ throw IllegalStateException_init_$Create$(toString(message));
1985
+ } else {
1986
+ tmp_0 = tmp1_elvis_lhs;
1987
+ }
1988
+ tmp = tmp_0;
1989
+ } else {
1990
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
1991
+ var message_0 = 'Job is still new or active: ' + this.toString();
1992
+ throw IllegalStateException_init_$Create$(toString(message_0));
1993
+ } else {
1994
+ if (state instanceof CompletedExceptionally) {
1995
+ tmp = this.ty(state.zx_1);
1996
+ } else {
1997
+ tmp = new JobCancellationException(get_classSimpleName(this) + ' has completed normally', null, this);
1998
+ }
1999
+ }
2000
+ }
2001
+ return tmp;
2002
+ };
2003
+ protoOf(JobSupport).sy = function (_this__u8e3s4, message) {
2004
+ var tmp0_elvis_lhs = _this__u8e3s4 instanceof CancellationException ? _this__u8e3s4 : null;
2005
+ var tmp;
2006
+ if (tmp0_elvis_lhs == null) {
2007
+ // Inline function 'kotlinx.coroutines.JobSupport.defaultCancellationException' call
2008
+ tmp = new JobCancellationException(message == null ? this.xx() : message, _this__u8e3s4, this);
2009
+ } else {
2010
+ tmp = tmp0_elvis_lhs;
2011
+ }
2012
+ return tmp;
2013
+ };
2014
+ protoOf(JobSupport).ty = function (_this__u8e3s4, message, $super) {
2015
+ message = message === VOID ? null : message;
2016
+ return $super === VOID ? this.sy(_this__u8e3s4, message) : $super.sy.call(this, _this__u8e3s4, message);
2017
+ };
2018
+ protoOf(JobSupport).uy = function (handler) {
2019
+ return this.wy(true, new InvokeOnCompletion(handler));
2020
+ };
2021
+ protoOf(JobSupport).vy = function (onCancelling, invokeImmediately, handler) {
2022
+ var tmp;
2023
+ if (onCancelling) {
2024
+ tmp = new InvokeOnCancelling(handler);
2025
+ } else {
2026
+ tmp = new InvokeOnCompletion(handler);
2027
+ }
2028
+ return this.wy(invokeImmediately, tmp);
2029
+ };
2030
+ protoOf(JobSupport).wy = function (invokeImmediately, node) {
2031
+ node.c12_1 = this;
2032
+ var tmp$ret$0;
2033
+ $l$block_1: {
2034
+ // Inline function 'kotlinx.coroutines.JobSupport.tryPutNodeIntoList' call
2035
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
2036
+ while (true) {
2037
+ var state = this.ny();
2038
+ if (state instanceof Empty) {
2039
+ if (state.i13_1) {
2040
+ if (this.nx_1.atomicfu$compareAndSet(state, node)) {
2041
+ tmp$ret$0 = true;
2042
+ break $l$block_1;
2043
+ }
2044
+ } else {
2045
+ promoteEmptyToNodeList(this, state);
2046
+ }
2047
+ } else {
2048
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
2049
+ var list = state.e12();
2050
+ if (list == null) {
2051
+ promoteSingleToNodeList(this, state instanceof JobNode ? state : THROW_CCE());
2052
+ } else {
2053
+ var tmp;
2054
+ if (node.y11()) {
2055
+ var tmp0_safe_receiver = state instanceof Finishing ? state : null;
2056
+ var rootCause = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.y13();
2057
+ var tmp_0;
2058
+ if (rootCause == null) {
2059
+ tmp_0 = list.i12(node, 5);
2060
+ } else {
2061
+ if (invokeImmediately) {
2062
+ node.b11(rootCause);
2063
+ }
2064
+ return NonDisposableHandle_instance;
2065
+ }
2066
+ tmp = tmp_0;
2067
+ } else {
2068
+ tmp = list.i12(node, 1);
2069
+ }
2070
+ if (tmp) {
2071
+ tmp$ret$0 = true;
2072
+ break $l$block_1;
2073
+ }
2074
+ }
2075
+ } else {
2076
+ tmp$ret$0 = false;
2077
+ break $l$block_1;
2078
+ }
2079
+ }
2080
+ }
2081
+ }
2082
+ var added = tmp$ret$0;
2083
+ if (added)
2084
+ return node;
2085
+ else if (invokeImmediately) {
2086
+ var tmp_1 = this.ny();
2087
+ var tmp0_safe_receiver_0 = tmp_1 instanceof CompletedExceptionally ? tmp_1 : null;
2088
+ node.b11(tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.zx_1);
2089
+ }
2090
+ return NonDisposableHandle_instance;
2091
+ };
2092
+ protoOf(JobSupport).xy = function (node) {
2093
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
2094
+ while (true) {
2095
+ var state = this.ny();
2096
+ if (state instanceof JobNode) {
2097
+ if (!(state === node))
2098
+ return Unit_instance;
2099
+ if (this.nx_1.atomicfu$compareAndSet(state, get_EMPTY_ACTIVE()))
2100
+ return Unit_instance;
2101
+ } else {
2102
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
2103
+ if (!(state.e12() == null)) {
2104
+ node.j12();
2105
+ }
2106
+ return Unit_instance;
2107
+ } else {
2108
+ return Unit_instance;
2109
+ }
2110
+ }
2111
+ }
2112
+ };
2113
+ protoOf(JobSupport).yy = function () {
2114
+ return false;
2115
+ };
2116
+ protoOf(JobSupport).xx = function () {
2117
+ return 'Job was cancelled';
2118
+ };
2119
+ protoOf(JobSupport).zy = function (parentJob) {
2120
+ this.bz(parentJob);
2121
+ };
2122
+ protoOf(JobSupport).az = function (cause) {
2123
+ if (cause instanceof CancellationException)
2124
+ return true;
2125
+ return this.bz(cause) && this.gz();
2126
+ };
2127
+ protoOf(JobSupport).bz = function (cause) {
2128
+ var finalState = get_COMPLETING_ALREADY();
2129
+ if (this.yy()) {
2130
+ finalState = cancelMakeCompleting(this, cause);
2131
+ if (finalState === get_COMPLETING_WAITING_CHILDREN())
2132
+ return true;
2133
+ }
2134
+ if (finalState === get_COMPLETING_ALREADY()) {
2135
+ finalState = makeCancelling(this, cause);
2136
+ }
2137
+ var tmp;
2138
+ if (finalState === get_COMPLETING_ALREADY()) {
2139
+ tmp = true;
2140
+ } else if (finalState === get_COMPLETING_WAITING_CHILDREN()) {
2141
+ tmp = true;
2142
+ } else if (finalState === get_TOO_LATE_TO_CANCEL()) {
2143
+ tmp = false;
2144
+ } else {
2145
+ this.ey(finalState);
2146
+ tmp = true;
2147
+ }
2148
+ return tmp;
2149
+ };
2150
+ protoOf(JobSupport).cz = function () {
2151
+ var state = this.ny();
2152
+ var tmp;
2153
+ if (state instanceof Finishing) {
2154
+ tmp = state.y13();
2155
+ } else {
2156
+ if (state instanceof CompletedExceptionally) {
2157
+ tmp = state.zx_1;
2158
+ } else {
2159
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
2160
+ var message = 'Cannot be cancelling child in this state: ' + toString(state);
2161
+ throw IllegalStateException_init_$Create$(toString(message));
2162
+ } else {
2163
+ tmp = null;
2164
+ }
2165
+ }
2166
+ }
2167
+ var rootCause = tmp;
2168
+ var tmp1_elvis_lhs = rootCause instanceof CancellationException ? rootCause : null;
2169
+ return tmp1_elvis_lhs == null ? new JobCancellationException('Parent job is ' + stateString(this, state), rootCause, this) : tmp1_elvis_lhs;
2170
+ };
2171
+ protoOf(JobSupport).cy = function (proposedUpdate) {
2172
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
2173
+ while (true) {
2174
+ var tmp0 = this.ny();
2175
+ $l$block: {
2176
+ var finalState = tryMakeCompleting(this, tmp0, proposedUpdate);
2177
+ if (finalState === get_COMPLETING_ALREADY())
2178
+ throw IllegalStateException_init_$Create$_0('Job ' + this.toString() + ' is already complete or completing, ' + ('but is being completed with ' + toString_0(proposedUpdate)), _get_exceptionOrNull__b3j7js(this, proposedUpdate));
2179
+ else if (finalState === get_COMPLETING_RETRY()) {
2180
+ break $l$block;
2181
+ } else
2182
+ return finalState;
2183
+ }
2184
+ }
2185
+ };
2186
+ protoOf(JobSupport).dz = function (child) {
2187
+ // Inline function 'kotlin.also' call
2188
+ var this_0 = new ChildHandleNode(child);
2189
+ this_0.c12_1 = this;
2190
+ var node = this_0;
2191
+ var tmp$ret$2;
2192
+ $l$block_1: {
2193
+ // Inline function 'kotlinx.coroutines.JobSupport.tryPutNodeIntoList' call
2194
+ // Inline function 'kotlinx.coroutines.JobSupport.loopOnState' call
2195
+ while (true) {
2196
+ var state = this.ny();
2197
+ if (state instanceof Empty) {
2198
+ if (state.i13_1) {
2199
+ if (this.nx_1.atomicfu$compareAndSet(state, node)) {
2200
+ tmp$ret$2 = true;
2201
+ break $l$block_1;
2202
+ }
2203
+ } else {
2204
+ promoteEmptyToNodeList(this, state);
2205
+ }
2206
+ } else {
2207
+ if (!(state == null) ? isInterface(state, Incomplete) : false) {
2208
+ var list = state.e12();
2209
+ if (list == null) {
2210
+ promoteSingleToNodeList(this, state instanceof JobNode ? state : THROW_CCE());
2211
+ } else {
2212
+ var addedBeforeCancellation = list.i12(node, 7);
2213
+ var tmp;
2214
+ if (addedBeforeCancellation) {
2215
+ tmp = true;
2216
+ } else {
2217
+ var addedBeforeCompletion = list.i12(node, 3);
2218
+ var latestState = this.ny();
2219
+ var tmp_0;
2220
+ if (latestState instanceof Finishing) {
2221
+ tmp_0 = latestState.y13();
2222
+ } else {
2223
+ // Inline function 'kotlinx.coroutines.assert' call
2224
+ var tmp0_safe_receiver = latestState instanceof CompletedExceptionally ? latestState : null;
2225
+ tmp_0 = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.zx_1;
2226
+ }
2227
+ var rootCause = tmp_0;
2228
+ node.b11(rootCause);
2229
+ var tmp_1;
2230
+ if (addedBeforeCompletion) {
2231
+ // Inline function 'kotlinx.coroutines.assert' call
2232
+ tmp_1 = true;
2233
+ } else {
2234
+ return NonDisposableHandle_instance;
2235
+ }
2236
+ tmp = tmp_1;
2237
+ }
2238
+ if (tmp) {
2239
+ tmp$ret$2 = true;
2240
+ break $l$block_1;
2241
+ }
2242
+ }
2243
+ } else {
2244
+ tmp$ret$2 = false;
2245
+ break $l$block_1;
2246
+ }
2247
+ }
2248
+ }
2249
+ }
2250
+ var added = tmp$ret$2;
2251
+ if (added)
2252
+ return node;
2253
+ var tmp_2 = this.ny();
2254
+ var tmp0_safe_receiver_0 = tmp_2 instanceof CompletedExceptionally ? tmp_2 : null;
2255
+ node.b11(tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.zx_1);
2256
+ return NonDisposableHandle_instance;
2257
+ };
2258
+ protoOf(JobSupport).fy = function (exception) {
2259
+ throw exception;
2260
+ };
2261
+ protoOf(JobSupport).ez = function (cause) {
2262
+ };
2263
+ protoOf(JobSupport).fz = function () {
2264
+ return false;
2265
+ };
2266
+ protoOf(JobSupport).gz = function () {
2267
+ return true;
2268
+ };
2269
+ protoOf(JobSupport).hz = function (exception) {
2270
+ return false;
2271
+ };
2272
+ protoOf(JobSupport).yx = function (state) {
2273
+ };
2274
+ protoOf(JobSupport).ey = function (state) {
2275
+ };
2276
+ protoOf(JobSupport).toString = function () {
2277
+ return this.iz() + '@' + get_hexAddress(this);
2278
+ };
2279
+ protoOf(JobSupport).iz = function () {
2280
+ return this.gy() + '{' + stateString(this, this.ny()) + '}';
2281
+ };
2282
+ protoOf(JobSupport).gy = function () {
2283
+ return get_classSimpleName(this);
2284
+ };
2285
+ protoOf(JobSupport).jz = function () {
2286
+ var state = this.ny();
2287
+ // Inline function 'kotlin.check' call
2288
+ if (!!(!(state == null) ? isInterface(state, Incomplete) : false)) {
2289
+ var message = 'This job has not completed yet';
2290
+ throw IllegalStateException_init_$Create$(toString(message));
2291
+ }
2292
+ return _get_exceptionOrNull__b3j7js(this, state);
2293
+ };
2294
+ protoOf(JobSupport).kz = function () {
2295
+ var state = this.ny();
2296
+ // Inline function 'kotlin.check' call
2297
+ if (!!(!(state == null) ? isInterface(state, Incomplete) : false)) {
2298
+ var message = 'This job has not completed yet';
2299
+ throw IllegalStateException_init_$Create$(toString(message));
2300
+ }
2301
+ if (state instanceof CompletedExceptionally)
2302
+ throw state.zx_1;
2303
+ return unboxState(state);
2304
+ };
2305
+ function boxIncomplete(_this__u8e3s4) {
2306
+ _init_properties_JobSupport_kt__68f172();
2307
+ var tmp;
2308
+ if (!(_this__u8e3s4 == null) ? isInterface(_this__u8e3s4, Incomplete) : false) {
2309
+ tmp = new IncompleteStateBox(_this__u8e3s4);
2310
+ } else {
2311
+ tmp = _this__u8e3s4;
2312
+ }
2313
+ return tmp;
2314
+ }
2315
+ function InactiveNodeList(list) {
2316
+ this.u13_1 = list;
2317
+ }
2318
+ protoOf(InactiveNodeList).e12 = function () {
2319
+ return this.u13_1;
2320
+ };
2321
+ protoOf(InactiveNodeList).ux = function () {
2322
+ return false;
2323
+ };
2324
+ protoOf(InactiveNodeList).toString = function () {
2325
+ return get_DEBUG() ? this.u13_1.m13('New') : anyToString(this);
2326
+ };
2327
+ function InvokeOnCompletion(handler) {
2328
+ JobNode.call(this);
2329
+ this.s14_1 = handler;
2330
+ }
2331
+ protoOf(InvokeOnCompletion).y11 = function () {
2332
+ return false;
2333
+ };
2334
+ protoOf(InvokeOnCompletion).b11 = function (cause) {
2335
+ return this.s14_1(cause);
2336
+ };
2337
+ function InvokeOnCancelling(handler) {
2338
+ JobNode.call(this);
2339
+ this.x14_1 = handler;
2340
+ this.y14_1 = atomic$boolean$1(false);
2341
+ }
2342
+ protoOf(InvokeOnCancelling).y11 = function () {
2343
+ return true;
2344
+ };
2345
+ protoOf(InvokeOnCancelling).b11 = function (cause) {
2346
+ if (this.y14_1.atomicfu$compareAndSet(false, true))
2347
+ this.x14_1(cause);
2348
+ };
2349
+ function ChildHandleNode(childJob) {
2350
+ JobNode.call(this);
2351
+ this.e14_1 = childJob;
2352
+ }
2353
+ protoOf(ChildHandleNode).y11 = function () {
2354
+ return true;
2355
+ };
2356
+ protoOf(ChildHandleNode).b11 = function (cause) {
2357
+ return this.e14_1.zy(this.d12());
2358
+ };
2359
+ protoOf(ChildHandleNode).az = function (cause) {
2360
+ return this.d12().az(cause);
2361
+ };
2362
+ function unboxState(_this__u8e3s4) {
2363
+ _init_properties_JobSupport_kt__68f172();
2364
+ var tmp0_safe_receiver = _this__u8e3s4 instanceof IncompleteStateBox ? _this__u8e3s4 : null;
2365
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.z14_1;
2366
+ return tmp1_elvis_lhs == null ? _this__u8e3s4 : tmp1_elvis_lhs;
2367
+ }
2368
+ function IncompleteStateBox(state) {
2369
+ this.z14_1 = state;
2370
+ }
2371
+ var properties_initialized_JobSupport_kt_5iq8a4;
2372
+ function _init_properties_JobSupport_kt__68f172() {
2373
+ if (!properties_initialized_JobSupport_kt_5iq8a4) {
2374
+ properties_initialized_JobSupport_kt_5iq8a4 = true;
2375
+ COMPLETING_ALREADY = new Symbol('COMPLETING_ALREADY');
2376
+ COMPLETING_WAITING_CHILDREN = new Symbol('COMPLETING_WAITING_CHILDREN');
2377
+ COMPLETING_RETRY = new Symbol('COMPLETING_RETRY');
2378
+ TOO_LATE_TO_CANCEL = new Symbol('TOO_LATE_TO_CANCEL');
2379
+ SEALED = new Symbol('SEALED');
2380
+ EMPTY_NEW = new Empty(false);
2381
+ EMPTY_ACTIVE = new Empty(true);
2382
+ }
2383
+ }
2384
+ function MainCoroutineDispatcher() {
2385
+ CoroutineDispatcher.call(this);
2386
+ }
2387
+ protoOf(MainCoroutineDispatcher).toString = function () {
2388
+ var tmp0_elvis_lhs = this.c15();
2389
+ return tmp0_elvis_lhs == null ? get_classSimpleName(this) + '@' + get_hexAddress(this) : tmp0_elvis_lhs;
2390
+ };
2391
+ protoOf(MainCoroutineDispatcher).c15 = function () {
2392
+ var main = Dispatchers_getInstance().h15();
2393
+ if (this === main)
2394
+ return 'Dispatchers.Main';
2395
+ var tmp;
2396
+ try {
2397
+ tmp = main.b15();
2398
+ } catch ($p) {
2399
+ var tmp_0;
2400
+ if ($p instanceof UnsupportedOperationException) {
2401
+ var e = $p;
2402
+ tmp_0 = null;
2403
+ } else {
2404
+ throw $p;
2405
+ }
2406
+ tmp = tmp_0;
2407
+ }
2408
+ var immediate = tmp;
2409
+ if (this === immediate)
2410
+ return 'Dispatchers.Main.immediate';
2411
+ return null;
2412
+ };
2413
+ function TimeoutCancellationException() {
2414
+ }
2415
+ function Unconfined() {
2416
+ Unconfined_instance = this;
2417
+ CoroutineDispatcher.call(this);
2418
+ }
2419
+ protoOf(Unconfined).n12 = function (context) {
2420
+ return false;
2421
+ };
2422
+ protoOf(Unconfined).o12 = function (context, block) {
2423
+ var yieldContext = context.h7(Key_instance_3);
2424
+ if (!(yieldContext == null)) {
2425
+ yieldContext.k15_1 = true;
2426
+ return Unit_instance;
2427
+ }
2428
+ throw UnsupportedOperationException_init_$Create$('Dispatchers.Unconfined.dispatch function can only be used by the yield function. If you wrap Unconfined dispatcher in your code, make sure you properly delegate isDispatchNeeded and dispatch calls.');
2429
+ };
2430
+ protoOf(Unconfined).toString = function () {
2431
+ return 'Dispatchers.Unconfined';
2432
+ };
2433
+ var Unconfined_instance;
2434
+ function Unconfined_getInstance() {
2435
+ if (Unconfined_instance == null)
2436
+ new Unconfined();
2437
+ return Unconfined_instance;
2438
+ }
2439
+ function Key_2() {
2440
+ }
2441
+ var Key_instance_3;
2442
+ function Key_getInstance_2() {
2443
+ return Key_instance_3;
2444
+ }
2445
+ function Segment() {
2446
+ }
2447
+ function ConcurrentLinkedListNode() {
2448
+ }
2449
+ function handleUncaughtCoroutineException(context, exception) {
2450
+ var _iterator__ex2g4s = get_platformExceptionHandlers().f();
2451
+ while (_iterator__ex2g4s.g()) {
2452
+ var handler = _iterator__ex2g4s.h();
2453
+ try {
2454
+ handler.r12(context, exception);
2455
+ } catch ($p) {
2456
+ if ($p instanceof ExceptionSuccessfullyProcessed) {
2457
+ var _unused_var__etf5q3 = $p;
2458
+ return Unit_instance;
2459
+ } else {
2460
+ if ($p instanceof Error) {
2461
+ var t = $p;
2462
+ propagateExceptionFinalResort(handlerException(exception, t));
2463
+ } else {
2464
+ throw $p;
2465
+ }
2466
+ }
2467
+ }
2468
+ }
2469
+ try {
2470
+ addSuppressed(exception, new DiagnosticCoroutineContextException(context));
2471
+ } catch ($p) {
2472
+ if ($p instanceof Error) {
2473
+ var e = $p;
2474
+ } else {
2475
+ throw $p;
2476
+ }
2477
+ }
2478
+ propagateExceptionFinalResort(exception);
2479
+ }
2480
+ function ExceptionSuccessfullyProcessed() {
2481
+ }
2482
+ function get_UNDEFINED() {
2483
+ _init_properties_DispatchedContinuation_kt__tnmqc0();
2484
+ return UNDEFINED;
2485
+ }
2486
+ var UNDEFINED;
2487
+ function get_REUSABLE_CLAIMED() {
2488
+ _init_properties_DispatchedContinuation_kt__tnmqc0();
2489
+ return REUSABLE_CLAIMED;
2490
+ }
2491
+ var REUSABLE_CLAIMED;
2492
+ function _get_reusableCancellableContinuation__9qex09($this) {
2493
+ var tmp = $this.f10_1.kotlinx$atomicfu$value;
2494
+ return tmp instanceof CancellableContinuationImpl ? tmp : null;
2495
+ }
2496
+ function DispatchedContinuation(dispatcher, continuation) {
2497
+ DispatchedTask.call(this, -1);
2498
+ this.b10_1 = dispatcher;
2499
+ this.c10_1 = continuation;
2500
+ this.d10_1 = get_UNDEFINED();
2501
+ this.e10_1 = threadContextElements(this.a7());
2502
+ this.f10_1 = atomic$ref$1(null);
2503
+ }
2504
+ protoOf(DispatchedContinuation).g10 = function () {
2505
+ return !(this.f10_1.kotlinx$atomicfu$value == null);
2506
+ };
2507
+ protoOf(DispatchedContinuation).l15 = function () {
2508
+ // Inline function 'kotlinx.atomicfu.loop' call
2509
+ var this_0 = this.f10_1;
2510
+ while (true) {
2511
+ if (!(this_0.kotlinx$atomicfu$value === get_REUSABLE_CLAIMED()))
2512
+ return Unit_instance;
2513
+ }
2514
+ };
2515
+ protoOf(DispatchedContinuation).p12 = function () {
2516
+ this.l15();
2517
+ var tmp0_safe_receiver = _get_reusableCancellableContinuation__9qex09(this);
2518
+ if (tmp0_safe_receiver == null)
2519
+ null;
2520
+ else {
2521
+ tmp0_safe_receiver.k10();
2522
+ }
2523
+ };
2524
+ protoOf(DispatchedContinuation).h11 = function (continuation) {
2525
+ // Inline function 'kotlinx.atomicfu.loop' call
2526
+ var this_0 = this.f10_1;
2527
+ while (true) {
2528
+ var state = this_0.kotlinx$atomicfu$value;
2529
+ if (state === get_REUSABLE_CLAIMED()) {
2530
+ if (this.f10_1.atomicfu$compareAndSet(get_REUSABLE_CLAIMED(), continuation))
2531
+ return null;
2532
+ } else {
2533
+ if (state instanceof Error) {
2534
+ // Inline function 'kotlin.require' call
2535
+ // Inline function 'kotlin.require' call
2536
+ if (!this.f10_1.atomicfu$compareAndSet(state, null)) {
2537
+ var message = 'Failed requirement.';
2538
+ throw IllegalArgumentException_init_$Create$(toString(message));
2539
+ }
2540
+ return state;
2541
+ } else {
2542
+ // Inline function 'kotlin.error' call
2543
+ var message_0 = 'Inconsistent state ' + toString_0(state);
2544
+ throw IllegalStateException_init_$Create$(toString(message_0));
2545
+ }
2546
+ }
2547
+ }
2548
+ };
2549
+ protoOf(DispatchedContinuation).i10 = function (cause) {
2550
+ // Inline function 'kotlinx.atomicfu.loop' call
2551
+ var this_0 = this.f10_1;
2552
+ while (true) {
2553
+ var state = this_0.kotlinx$atomicfu$value;
2554
+ if (equals(state, get_REUSABLE_CLAIMED())) {
2555
+ if (this.f10_1.atomicfu$compareAndSet(get_REUSABLE_CLAIMED(), cause))
2556
+ return true;
2557
+ } else {
2558
+ if (state instanceof Error)
2559
+ return true;
2560
+ else {
2561
+ if (this.f10_1.atomicfu$compareAndSet(state, null))
2562
+ return false;
2563
+ }
2564
+ }
2565
+ }
2566
+ };
2567
+ protoOf(DispatchedContinuation).o10 = function () {
2568
+ var state = this.d10_1;
2569
+ // Inline function 'kotlinx.coroutines.assert' call
2570
+ this.d10_1 = get_UNDEFINED();
2571
+ return state;
2572
+ };
2573
+ protoOf(DispatchedContinuation).l10 = function () {
2574
+ return this;
2575
+ };
2576
+ protoOf(DispatchedContinuation).f7 = function (result) {
2577
+ var state = toState_0(result);
2578
+ if (safeIsDispatchNeeded(this.b10_1, this.a7())) {
2579
+ this.d10_1 = state;
2580
+ this.h10_1 = 0;
2581
+ safeDispatch(this.b10_1, this.a7(), this);
2582
+ } else {
2583
+ $l$block: {
2584
+ // Inline function 'kotlinx.coroutines.internal.executeUnconfined' call
2585
+ // Inline function 'kotlinx.coroutines.assert' call
2586
+ var eventLoop = ThreadLocalEventLoop_getInstance().e13();
2587
+ if (false && eventLoop.z12()) {
2588
+ break $l$block;
2589
+ }
2590
+ var tmp;
2591
+ if (eventLoop.y12()) {
2592
+ this.d10_1 = state;
2593
+ this.h10_1 = 0;
2594
+ eventLoop.x12(this);
2595
+ tmp = true;
2596
+ } else {
2597
+ // Inline function 'kotlinx.coroutines.runUnconfinedEventLoop' call
2598
+ eventLoop.a13(true);
2599
+ try {
2600
+ this.a7();
2601
+ // Inline function 'kotlinx.coroutines.withCoroutineContext' call
2602
+ this.e10_1;
2603
+ this.c10_1.f7(result);
2604
+ $l$loop: while (eventLoop.w12()) {
2605
+ }
2606
+ } catch ($p) {
2607
+ if ($p instanceof Error) {
2608
+ var e = $p;
2609
+ this.r11(e);
2610
+ } else {
2611
+ throw $p;
2612
+ }
2613
+ }
2614
+ finally {
2615
+ eventLoop.b13(true);
2616
+ }
2617
+ tmp = false;
2618
+ }
2619
+ }
2620
+ }
2621
+ };
2622
+ protoOf(DispatchedContinuation).toString = function () {
2623
+ return 'DispatchedContinuation[' + this.b10_1.toString() + ', ' + toDebugString(this.c10_1) + ']';
2624
+ };
2625
+ protoOf(DispatchedContinuation).a7 = function () {
2626
+ return this.c10_1.a7();
2627
+ };
2628
+ function safeDispatch(_this__u8e3s4, context, runnable) {
2629
+ _init_properties_DispatchedContinuation_kt__tnmqc0();
2630
+ try {
2631
+ _this__u8e3s4.o12(context, runnable);
2632
+ } catch ($p) {
2633
+ if ($p instanceof Error) {
2634
+ var e = $p;
2635
+ throw new DispatchException(e, _this__u8e3s4, context);
2636
+ } else {
2637
+ throw $p;
2638
+ }
2639
+ }
2640
+ }
2641
+ function safeIsDispatchNeeded(_this__u8e3s4, context) {
2642
+ _init_properties_DispatchedContinuation_kt__tnmqc0();
2643
+ try {
2644
+ return _this__u8e3s4.n12(context);
2645
+ } catch ($p) {
2646
+ if ($p instanceof Error) {
2647
+ var e = $p;
2648
+ throw new DispatchException(e, _this__u8e3s4, context);
2649
+ } else {
2650
+ throw $p;
2651
+ }
2652
+ }
2653
+ }
2654
+ function resumeCancellableWithInternal(_this__u8e3s4, result) {
2655
+ _init_properties_DispatchedContinuation_kt__tnmqc0();
2656
+ var tmp;
2657
+ if (_this__u8e3s4 instanceof DispatchedContinuation) {
2658
+ // Inline function 'kotlinx.coroutines.internal.DispatchedContinuation.resumeCancellableWith' call
2659
+ var state = toState_0(result);
2660
+ if (safeIsDispatchNeeded(_this__u8e3s4.b10_1, _this__u8e3s4.a7())) {
2661
+ _this__u8e3s4.d10_1 = state;
2662
+ _this__u8e3s4.h10_1 = 1;
2663
+ safeDispatch(_this__u8e3s4.b10_1, _this__u8e3s4.a7(), _this__u8e3s4);
2664
+ } else {
2665
+ $l$block: {
2666
+ // Inline function 'kotlinx.coroutines.internal.executeUnconfined' call
2667
+ // Inline function 'kotlinx.coroutines.assert' call
2668
+ var eventLoop = ThreadLocalEventLoop_getInstance().e13();
2669
+ if (false && eventLoop.z12()) {
2670
+ break $l$block;
2671
+ }
2672
+ var tmp_0;
2673
+ if (eventLoop.y12()) {
2674
+ _this__u8e3s4.d10_1 = state;
2675
+ _this__u8e3s4.h10_1 = 1;
2676
+ eventLoop.x12(_this__u8e3s4);
2677
+ tmp_0 = true;
2678
+ } else {
2679
+ // Inline function 'kotlinx.coroutines.runUnconfinedEventLoop' call
2680
+ eventLoop.a13(true);
2681
+ try {
2682
+ var tmp$ret$4;
2683
+ $l$block_0: {
2684
+ // Inline function 'kotlinx.coroutines.internal.DispatchedContinuation.resumeCancelled' call
2685
+ var job = _this__u8e3s4.a7().h7(Key_instance_2);
2686
+ if (!(job == null) && !job.ux()) {
2687
+ var cause = job.ry();
2688
+ _this__u8e3s4.p10(state, cause);
2689
+ // Inline function 'kotlin.coroutines.resumeWithException' call
2690
+ // Inline function 'kotlin.Companion.failure' call
2691
+ var tmp$ret$2 = _Result___init__impl__xyqfz8(createFailure(cause));
2692
+ _this__u8e3s4.f7(tmp$ret$2);
2693
+ tmp$ret$4 = true;
2694
+ break $l$block_0;
2695
+ }
2696
+ tmp$ret$4 = false;
2697
+ }
2698
+ if (!tmp$ret$4) {
2699
+ // Inline function 'kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith' call
2700
+ _this__u8e3s4.c10_1;
2701
+ // Inline function 'kotlinx.coroutines.withContinuationContext' call
2702
+ _this__u8e3s4.e10_1;
2703
+ _this__u8e3s4.c10_1.f7(result);
2704
+ }
2705
+ $l$loop: while (eventLoop.w12()) {
2706
+ }
2707
+ } catch ($p) {
2708
+ if ($p instanceof Error) {
2709
+ var e = $p;
2710
+ _this__u8e3s4.r11(e);
2711
+ } else {
2712
+ throw $p;
2713
+ }
2714
+ }
2715
+ finally {
2716
+ eventLoop.b13(true);
2717
+ }
2718
+ tmp_0 = false;
2719
+ }
2720
+ }
2721
+ }
2722
+ tmp = Unit_instance;
2723
+ } else {
2724
+ _this__u8e3s4.f7(result);
2725
+ tmp = Unit_instance;
2726
+ }
2727
+ return tmp;
2728
+ }
2729
+ var properties_initialized_DispatchedContinuation_kt_2siadq;
2730
+ function _init_properties_DispatchedContinuation_kt__tnmqc0() {
2731
+ if (!properties_initialized_DispatchedContinuation_kt_2siadq) {
2732
+ properties_initialized_DispatchedContinuation_kt_2siadq = true;
2733
+ UNDEFINED = new Symbol('UNDEFINED');
2734
+ REUSABLE_CLAIMED = new Symbol('REUSABLE_CLAIMED');
2735
+ }
2736
+ }
2737
+ function DispatchedTask(resumeMode) {
2738
+ SchedulerTask.call(this);
2739
+ this.h10_1 = resumeMode;
2740
+ }
2741
+ protoOf(DispatchedTask).p10 = function (takenState, cause) {
2742
+ };
2743
+ protoOf(DispatchedTask).g11 = function (state) {
2744
+ return (state == null ? true : !(state == null)) ? state : THROW_CCE();
2745
+ };
2746
+ protoOf(DispatchedTask).o11 = function (state) {
2747
+ var tmp0_safe_receiver = state instanceof CompletedExceptionally ? state : null;
2748
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.zx_1;
2749
+ };
2750
+ protoOf(DispatchedTask).q11 = function () {
2751
+ // Inline function 'kotlinx.coroutines.assert' call
2752
+ try {
2753
+ var tmp = this.l10();
2754
+ var delegate = tmp instanceof DispatchedContinuation ? tmp : THROW_CCE();
2755
+ var continuation = delegate.c10_1;
2756
+ // Inline function 'kotlinx.coroutines.withContinuationContext' call
2757
+ delegate.e10_1;
2758
+ var context = continuation.a7();
2759
+ var state = this.o10();
2760
+ var exception = this.o11(state);
2761
+ var job = exception == null && get_isCancellableMode(this.h10_1) ? context.h7(Key_instance_2) : null;
2762
+ if (!(job == null) && !job.ux()) {
2763
+ var cause = job.ry();
2764
+ this.p10(state, cause);
2765
+ // Inline function 'kotlinx.coroutines.resumeWithStackTrace' call
2766
+ // Inline function 'kotlin.Companion.failure' call
2767
+ var exception_0 = recoverStackTrace(cause, continuation);
2768
+ var tmp$ret$1 = _Result___init__impl__xyqfz8(createFailure(exception_0));
2769
+ continuation.f7(tmp$ret$1);
2770
+ } else {
2771
+ if (!(exception == null)) {
2772
+ // Inline function 'kotlin.coroutines.resumeWithException' call
2773
+ // Inline function 'kotlin.Companion.failure' call
2774
+ var tmp$ret$3 = _Result___init__impl__xyqfz8(createFailure(exception));
2775
+ continuation.f7(tmp$ret$3);
2776
+ } else {
2777
+ // Inline function 'kotlin.coroutines.resume' call
2778
+ // Inline function 'kotlin.Companion.success' call
2779
+ var value = this.g11(state);
2780
+ var tmp$ret$5 = _Result___init__impl__xyqfz8(value);
2781
+ continuation.f7(tmp$ret$5);
2782
+ }
2783
+ }
2784
+ } catch ($p) {
2785
+ if ($p instanceof DispatchException) {
2786
+ var e = $p;
2787
+ handleCoroutineException(this.l10().a7(), e.q12_1);
2788
+ } else {
2789
+ if ($p instanceof Error) {
2790
+ var e_0 = $p;
2791
+ this.r11(e_0);
2792
+ } else {
2793
+ throw $p;
2794
+ }
2795
+ }
2796
+ }
2797
+ };
2798
+ protoOf(DispatchedTask).r11 = function (exception) {
2799
+ var reason = new CoroutinesInternalError('Fatal exception in coroutines machinery for ' + toString(this) + '. ' + "Please read KDoc to 'handleFatalException' method and report this incident to maintainers", exception);
2800
+ handleCoroutineException(this.l10().a7(), reason);
2801
+ };
2802
+ function get_isReusableMode(_this__u8e3s4) {
2803
+ return _this__u8e3s4 === 2;
2804
+ }
2805
+ function get_isCancellableMode(_this__u8e3s4) {
2806
+ return _this__u8e3s4 === 1 || _this__u8e3s4 === 2;
2807
+ }
2808
+ function dispatch(_this__u8e3s4, mode) {
2809
+ // Inline function 'kotlinx.coroutines.assert' call
2810
+ var delegate = _this__u8e3s4.l10();
2811
+ var undispatched = mode === 4;
2812
+ var tmp;
2813
+ var tmp_0;
2814
+ if (!undispatched) {
2815
+ tmp_0 = delegate instanceof DispatchedContinuation;
2816
+ } else {
2817
+ tmp_0 = false;
2818
+ }
2819
+ if (tmp_0) {
2820
+ tmp = get_isCancellableMode(mode) === get_isCancellableMode(_this__u8e3s4.h10_1);
2821
+ } else {
2822
+ tmp = false;
2823
+ }
2824
+ if (tmp) {
2825
+ var dispatcher = delegate.b10_1;
2826
+ var context = delegate.a7();
2827
+ if (safeIsDispatchNeeded(dispatcher, context)) {
2828
+ safeDispatch(dispatcher, context, _this__u8e3s4);
2829
+ } else {
2830
+ resumeUnconfined(_this__u8e3s4);
2831
+ }
2832
+ } else {
2833
+ resume(_this__u8e3s4, delegate, undispatched);
2834
+ }
2835
+ }
2836
+ function DispatchException(cause, dispatcher, context) {
2837
+ Exception_init_$Init$('Coroutine dispatcher ' + dispatcher.toString() + ' threw an exception, context = ' + toString(context), cause, this);
2838
+ captureStack(this, DispatchException);
2839
+ this.q12_1 = cause;
2840
+ delete this.cause;
2841
+ }
2842
+ protoOf(DispatchException).l7 = function () {
2843
+ return this.q12_1;
2844
+ };
2845
+ function resumeUnconfined(_this__u8e3s4) {
2846
+ var eventLoop = ThreadLocalEventLoop_getInstance().e13();
2847
+ if (eventLoop.y12()) {
2848
+ eventLoop.x12(_this__u8e3s4);
2849
+ } else {
2850
+ // Inline function 'kotlinx.coroutines.runUnconfinedEventLoop' call
2851
+ eventLoop.a13(true);
2852
+ try {
2853
+ resume(_this__u8e3s4, _this__u8e3s4.l10(), true);
2854
+ $l$loop: while (eventLoop.w12()) {
2855
+ }
2856
+ } catch ($p) {
2857
+ if ($p instanceof Error) {
2858
+ var e = $p;
2859
+ _this__u8e3s4.r11(e);
2860
+ } else {
2861
+ throw $p;
2862
+ }
2863
+ }
2864
+ finally {
2865
+ eventLoop.b13(true);
2866
+ }
2867
+ }
2868
+ }
2869
+ function resume(_this__u8e3s4, delegate, undispatched) {
2870
+ var state = _this__u8e3s4.o10();
2871
+ var exception = _this__u8e3s4.o11(state);
2872
+ var tmp;
2873
+ if (!(exception == null)) {
2874
+ // Inline function 'kotlin.Companion.failure' call
2875
+ tmp = _Result___init__impl__xyqfz8(createFailure(exception));
2876
+ } else {
2877
+ // Inline function 'kotlin.Companion.success' call
2878
+ var value = _this__u8e3s4.g11(state);
2879
+ tmp = _Result___init__impl__xyqfz8(value);
2880
+ }
2881
+ var result = tmp;
2882
+ if (undispatched) {
2883
+ // Inline function 'kotlinx.coroutines.internal.DispatchedContinuation.resumeUndispatchedWith' call
2884
+ var this_0 = delegate instanceof DispatchedContinuation ? delegate : THROW_CCE();
2885
+ this_0.c10_1;
2886
+ // Inline function 'kotlinx.coroutines.withContinuationContext' call
2887
+ this_0.e10_1;
2888
+ this_0.c10_1.f7(result);
2889
+ } else {
2890
+ delegate.f7(result);
2891
+ }
2892
+ }
2893
+ function Symbol(symbol) {
2894
+ this.m15_1 = symbol;
2895
+ }
2896
+ protoOf(Symbol).toString = function () {
2897
+ return '<' + this.m15_1 + '>';
2898
+ };
2899
+ function startCoroutineCancellable(_this__u8e3s4, receiver, completion) {
2900
+ // Inline function 'kotlinx.coroutines.intrinsics.runSafely' call
2901
+ try {
2902
+ var tmp = intercepted(createCoroutineUnintercepted(_this__u8e3s4, receiver, completion));
2903
+ // Inline function 'kotlin.Companion.success' call
2904
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(Unit_instance);
2905
+ resumeCancellableWithInternal(tmp, tmp$ret$0);
2906
+ } catch ($p) {
2907
+ if ($p instanceof Error) {
2908
+ var e = $p;
2909
+ dispatcherFailure(completion, e);
2910
+ } else {
2911
+ throw $p;
2912
+ }
2913
+ }
2914
+ return Unit_instance;
2915
+ }
2916
+ function startCoroutineCancellable_0(_this__u8e3s4, fatalCompletion) {
2917
+ // Inline function 'kotlinx.coroutines.intrinsics.runSafely' call
2918
+ try {
2919
+ var tmp = intercepted(_this__u8e3s4);
2920
+ // Inline function 'kotlin.Companion.success' call
2921
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(Unit_instance);
2922
+ resumeCancellableWithInternal(tmp, tmp$ret$0);
2923
+ } catch ($p) {
2924
+ if ($p instanceof Error) {
2925
+ var e = $p;
2926
+ dispatcherFailure(fatalCompletion, e);
2927
+ } else {
2928
+ throw $p;
2929
+ }
2930
+ }
2931
+ return Unit_instance;
2932
+ }
2933
+ function dispatcherFailure(completion, e) {
2934
+ var tmp;
2935
+ if (e instanceof DispatchException) {
2936
+ tmp = e.q12_1;
2937
+ } else {
2938
+ tmp = e;
2939
+ }
2940
+ var reportException = tmp;
2941
+ // Inline function 'kotlin.Companion.failure' call
2942
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(createFailure(reportException));
2943
+ completion.f7(tmp$ret$0);
2944
+ throw reportException;
2945
+ }
2946
+ function startCoroutineUndispatched(_this__u8e3s4, receiver, completion) {
2947
+ // Inline function 'kotlinx.coroutines.internal.probeCoroutineCreated' call
2948
+ var actualCompletion = completion;
2949
+ var tmp;
2950
+ try {
2951
+ // Inline function 'kotlinx.coroutines.withCoroutineContext' call
2952
+ actualCompletion.a7();
2953
+ // Inline function 'kotlinx.coroutines.internal.probeCoroutineResumed' call
2954
+ // Inline function 'kotlin.coroutines.intrinsics.startCoroutineUninterceptedOrReturn' call
2955
+ tmp = startCoroutineUninterceptedOrReturnNonGeneratorVersion(_this__u8e3s4, receiver, actualCompletion);
2956
+ } catch ($p) {
2957
+ var tmp_0;
2958
+ if ($p instanceof Error) {
2959
+ var e = $p;
2960
+ var tmp_1;
2961
+ if (e instanceof DispatchException) {
2962
+ tmp_1 = e.q12_1;
2963
+ } else {
2964
+ tmp_1 = e;
2965
+ }
2966
+ var reportException = tmp_1;
2967
+ // Inline function 'kotlin.coroutines.resumeWithException' call
2968
+ // Inline function 'kotlin.Companion.failure' call
2969
+ var tmp$ret$5 = _Result___init__impl__xyqfz8(createFailure(reportException));
2970
+ actualCompletion.f7(tmp$ret$5);
2971
+ return Unit_instance;
2972
+ } else {
2973
+ throw $p;
2974
+ }
2975
+ }
2976
+ var value = tmp;
2977
+ if (!(value === get_COROUTINE_SUSPENDED())) {
2978
+ // Inline function 'kotlin.coroutines.resume' call
2979
+ // Inline function 'kotlin.Companion.success' call
2980
+ var value_0 = (value == null ? true : !(value == null)) ? value : THROW_CCE();
2981
+ var tmp$ret$7 = _Result___init__impl__xyqfz8(value_0);
2982
+ actualCompletion.f7(tmp$ret$7);
2983
+ }
2984
+ }
2985
+ function createDefaultDispatcher() {
2986
+ var tmp;
2987
+ if (isJsdom()) {
2988
+ tmp = NodeDispatcher_getInstance();
2989
+ } else {
2990
+ var tmp_0;
2991
+ var tmp_1;
2992
+ if (!(typeof window === 'undefined')) {
2993
+ // Inline function 'kotlin.js.asDynamic' call
2994
+ tmp_1 = window != null;
2995
+ } else {
2996
+ tmp_1 = false;
2997
+ }
2998
+ if (tmp_1) {
2999
+ // Inline function 'kotlin.js.asDynamic' call
3000
+ tmp_0 = !(typeof window.addEventListener === 'undefined');
3001
+ } else {
3002
+ tmp_0 = false;
3003
+ }
3004
+ if (tmp_0) {
3005
+ tmp = asCoroutineDispatcher(window);
3006
+ } else {
3007
+ if (typeof process === 'undefined' || typeof process.nextTick === 'undefined') {
3008
+ tmp = SetTimeoutDispatcher_getInstance();
3009
+ } else {
3010
+ tmp = NodeDispatcher_getInstance();
3011
+ }
3012
+ }
3013
+ }
3014
+ return tmp;
3015
+ }
3016
+ function isJsdom() {
3017
+ return !(typeof navigator === 'undefined') && navigator != null && navigator.userAgent != null && !(typeof navigator.userAgent === 'undefined') && !(typeof navigator.userAgent.match === 'undefined') && navigator.userAgent.match('\\bjsdom\\b');
3018
+ }
3019
+ var counter;
3020
+ function get_DEBUG() {
3021
+ return DEBUG;
3022
+ }
3023
+ var DEBUG;
3024
+ function get_classSimpleName(_this__u8e3s4) {
3025
+ var tmp0_elvis_lhs = getKClassFromExpression(_this__u8e3s4).g8();
3026
+ return tmp0_elvis_lhs == null ? 'Unknown' : tmp0_elvis_lhs;
3027
+ }
3028
+ function get_hexAddress(_this__u8e3s4) {
3029
+ // Inline function 'kotlin.js.asDynamic' call
3030
+ var result = _this__u8e3s4.__debug_counter;
3031
+ if (!(typeof result === 'number')) {
3032
+ counter = counter + 1 | 0;
3033
+ result = counter;
3034
+ // Inline function 'kotlin.js.asDynamic' call
3035
+ _this__u8e3s4.__debug_counter = result;
3036
+ }
3037
+ return ((!(result == null) ? typeof result === 'number' : false) ? result : THROW_CCE()).toString();
3038
+ }
3039
+ function NodeDispatcher() {
3040
+ NodeDispatcher_instance = this;
3041
+ SetTimeoutBasedDispatcher.call(this);
3042
+ }
3043
+ protoOf(NodeDispatcher).p15 = function () {
3044
+ process.nextTick(this.w15_1.u15_1);
3045
+ };
3046
+ var NodeDispatcher_instance;
3047
+ function NodeDispatcher_getInstance() {
3048
+ if (NodeDispatcher_instance == null)
3049
+ new NodeDispatcher();
3050
+ return NodeDispatcher_instance;
3051
+ }
3052
+ function ScheduledMessageQueue$processQueue$lambda(this$0) {
3053
+ return function () {
3054
+ this$0.a16();
3055
+ return Unit_instance;
3056
+ };
3057
+ }
3058
+ function ScheduledMessageQueue(dispatcher) {
3059
+ MessageQueue.call(this);
3060
+ this.t15_1 = dispatcher;
3061
+ var tmp = this;
3062
+ tmp.u15_1 = ScheduledMessageQueue$processQueue$lambda(this);
3063
+ }
3064
+ protoOf(ScheduledMessageQueue).b16 = function () {
3065
+ this.t15_1.p15();
3066
+ };
3067
+ protoOf(ScheduledMessageQueue).c16 = function () {
3068
+ setTimeout(this.u15_1, 0);
3069
+ };
3070
+ protoOf(ScheduledMessageQueue).d16 = function (timeout) {
3071
+ setTimeout(this.u15_1, timeout);
3072
+ };
3073
+ function WindowMessageQueue$lambda(this$0) {
3074
+ return function (event) {
3075
+ var tmp;
3076
+ if (event.source == this$0.m16_1 && event.data == this$0.n16_1) {
3077
+ event.stopPropagation();
3078
+ this$0.a16();
3079
+ tmp = Unit_instance;
3080
+ }
3081
+ return Unit_instance;
3082
+ };
3083
+ }
3084
+ function WindowMessageQueue$schedule$lambda(this$0) {
3085
+ return function (it) {
3086
+ this$0.a16();
3087
+ return Unit_instance;
3088
+ };
3089
+ }
3090
+ function WindowMessageQueue(window_0) {
3091
+ MessageQueue.call(this);
3092
+ this.m16_1 = window_0;
3093
+ this.n16_1 = 'dispatchCoroutine';
3094
+ this.m16_1.addEventListener('message', WindowMessageQueue$lambda(this), true);
3095
+ }
3096
+ protoOf(WindowMessageQueue).b16 = function () {
3097
+ var tmp = Promise.resolve(Unit_instance);
3098
+ tmp.then(WindowMessageQueue$schedule$lambda(this));
3099
+ };
3100
+ protoOf(WindowMessageQueue).c16 = function () {
3101
+ this.m16_1.postMessage(this.n16_1, '*');
3102
+ };
3103
+ function toThrowable(_this__u8e3s4) {
3104
+ var tmp0_elvis_lhs = _this__u8e3s4 instanceof Error ? _this__u8e3s4 : null;
3105
+ return tmp0_elvis_lhs == null ? Exception_init_$Create$("Promise resolved with a non-Throwable exception '" + _this__u8e3s4.toString() + "' (type " + toString(getKClassFromExpression(_this__u8e3s4)) + ')') : tmp0_elvis_lhs;
3106
+ }
3107
+ function toJsPromiseError(_this__u8e3s4) {
3108
+ return _this__u8e3s4;
3109
+ }
3110
+ function asCoroutineDispatcher(_this__u8e3s4) {
3111
+ // Inline function 'kotlin.js.asDynamic' call
3112
+ var tmp0_elvis_lhs = _this__u8e3s4.coroutineDispatcher;
3113
+ var tmp;
3114
+ if (tmp0_elvis_lhs == null) {
3115
+ // Inline function 'kotlin.also' call
3116
+ var this_0 = new WindowDispatcher(_this__u8e3s4);
3117
+ // Inline function 'kotlin.js.asDynamic' call
3118
+ _this__u8e3s4.coroutineDispatcher = this_0;
3119
+ tmp = this_0;
3120
+ } else {
3121
+ tmp = tmp0_elvis_lhs;
3122
+ }
3123
+ return tmp;
3124
+ }
3125
+ function toDebugString(_this__u8e3s4) {
3126
+ return toString(_this__u8e3s4);
3127
+ }
3128
+ function newCoroutineContext(_this__u8e3s4, context) {
3129
+ var combined = _this__u8e3s4.tx().ob(context);
3130
+ return !(combined === Dispatchers_getInstance().d15_1) && combined.h7(Key_instance) == null ? combined.ob(Dispatchers_getInstance().d15_1) : combined;
3131
+ }
3132
+ function get_coroutineName(_this__u8e3s4) {
3133
+ return null;
3134
+ }
3135
+ function Dispatchers() {
3136
+ Dispatchers_instance = this;
3137
+ this.d15_1 = createDefaultDispatcher();
3138
+ this.e15_1 = Unconfined_getInstance();
3139
+ this.f15_1 = new JsMainDispatcher(this.d15_1, false);
3140
+ this.g15_1 = null;
3141
+ }
3142
+ protoOf(Dispatchers).h15 = function () {
3143
+ var tmp0_elvis_lhs = this.g15_1;
3144
+ return tmp0_elvis_lhs == null ? this.f15_1 : tmp0_elvis_lhs;
3145
+ };
3146
+ var Dispatchers_instance;
3147
+ function Dispatchers_getInstance() {
3148
+ if (Dispatchers_instance == null)
3149
+ new Dispatchers();
3150
+ return Dispatchers_instance;
3151
+ }
3152
+ function JsMainDispatcher(delegate, invokeImmediately) {
3153
+ MainCoroutineDispatcher.call(this);
3154
+ this.p16_1 = delegate;
3155
+ this.q16_1 = invokeImmediately;
3156
+ this.r16_1 = this.q16_1 ? this : new JsMainDispatcher(this.p16_1, true);
3157
+ }
3158
+ protoOf(JsMainDispatcher).b15 = function () {
3159
+ return this.r16_1;
3160
+ };
3161
+ protoOf(JsMainDispatcher).n12 = function (context) {
3162
+ return !this.q16_1;
3163
+ };
3164
+ protoOf(JsMainDispatcher).o12 = function (context, block) {
3165
+ return this.p16_1.o12(context, block);
3166
+ };
3167
+ protoOf(JsMainDispatcher).toString = function () {
3168
+ var tmp0_elvis_lhs = this.c15();
3169
+ return tmp0_elvis_lhs == null ? this.p16_1.toString() : tmp0_elvis_lhs;
3170
+ };
3171
+ function JobCancellationException(message, cause, job) {
3172
+ CancellationException_init_$Init$(message, cause, this);
3173
+ captureStack(this, JobCancellationException);
3174
+ this.s16_1 = job;
3175
+ }
3176
+ protoOf(JobCancellationException).toString = function () {
3177
+ return protoOf(CancellationException).toString.call(this) + '; job=' + toString(this.s16_1);
3178
+ };
3179
+ protoOf(JobCancellationException).equals = function (other) {
3180
+ var tmp;
3181
+ if (other === this) {
3182
+ tmp = true;
3183
+ } else {
3184
+ var tmp_0;
3185
+ var tmp_1;
3186
+ var tmp_2;
3187
+ if (other instanceof JobCancellationException) {
3188
+ tmp_2 = other.message == this.message;
3189
+ } else {
3190
+ tmp_2 = false;
3191
+ }
3192
+ if (tmp_2) {
3193
+ tmp_1 = equals(other.s16_1, this.s16_1);
3194
+ } else {
3195
+ tmp_1 = false;
3196
+ }
3197
+ if (tmp_1) {
3198
+ tmp_0 = equals(other.cause, this.cause);
3199
+ } else {
3200
+ tmp_0 = false;
3201
+ }
3202
+ tmp = tmp_0;
3203
+ }
3204
+ return tmp;
3205
+ };
3206
+ protoOf(JobCancellationException).hashCode = function () {
3207
+ var tmp = imul(imul(getStringHashCode(ensureNotNull(this.message)), 31) + hashCode(this.s16_1) | 0, 31);
3208
+ var tmp0_safe_receiver = this.cause;
3209
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
3210
+ return tmp + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
3211
+ };
3212
+ function Runnable() {
3213
+ }
3214
+ function SchedulerTask() {
3215
+ }
3216
+ function identitySet(expectedSize) {
3217
+ return HashSet_init_$Create$(expectedSize);
3218
+ }
3219
+ function get_platformExceptionHandlers_() {
3220
+ _init_properties_CoroutineExceptionHandlerImpl_kt__37d7wf();
3221
+ return platformExceptionHandlers_;
3222
+ }
3223
+ var platformExceptionHandlers_;
3224
+ function get_platformExceptionHandlers() {
3225
+ _init_properties_CoroutineExceptionHandlerImpl_kt__37d7wf();
3226
+ return get_platformExceptionHandlers_();
3227
+ }
3228
+ function DiagnosticCoroutineContextException(context) {
3229
+ RuntimeException_init_$Init$_0(toString(context), this);
3230
+ captureStack(this, DiagnosticCoroutineContextException);
3231
+ }
3232
+ var properties_initialized_CoroutineExceptionHandlerImpl_kt_qhrgvx;
3233
+ function _init_properties_CoroutineExceptionHandlerImpl_kt__37d7wf() {
3234
+ if (!properties_initialized_CoroutineExceptionHandlerImpl_kt_qhrgvx) {
3235
+ properties_initialized_CoroutineExceptionHandlerImpl_kt_qhrgvx = true;
3236
+ // Inline function 'kotlin.collections.mutableSetOf' call
3237
+ platformExceptionHandlers_ = LinkedHashSet_init_$Create$();
3238
+ }
3239
+ }
3240
+ function LockFreeLinkedListHead() {
3241
+ LockFreeLinkedListNode.call(this);
3242
+ }
3243
+ function LockFreeLinkedListNode() {
3244
+ this.f12_1 = this;
3245
+ this.g12_1 = this;
3246
+ this.h12_1 = false;
3247
+ }
3248
+ protoOf(LockFreeLinkedListNode).i12 = function (node, permissionsBitmask) {
3249
+ var prev = this.g12_1;
3250
+ var tmp;
3251
+ if (prev instanceof ListClosed) {
3252
+ tmp = ((prev.w16_1 & permissionsBitmask) === 0 && prev.i12(node, permissionsBitmask));
3253
+ } else {
3254
+ node.f12_1 = this;
3255
+ node.g12_1 = prev;
3256
+ prev.f12_1 = node;
3257
+ this.g12_1 = node;
3258
+ tmp = true;
3259
+ }
3260
+ return tmp;
3261
+ };
3262
+ protoOf(LockFreeLinkedListNode).n13 = function (forbiddenElementsBit) {
3263
+ this.i12(new ListClosed(forbiddenElementsBit), forbiddenElementsBit);
3264
+ };
3265
+ protoOf(LockFreeLinkedListNode).j12 = function () {
3266
+ if (this.h12_1)
3267
+ return false;
3268
+ var prev = this.g12_1;
3269
+ var next = this.f12_1;
3270
+ prev.f12_1 = next;
3271
+ next.g12_1 = prev;
3272
+ this.h12_1 = true;
3273
+ return true;
3274
+ };
3275
+ protoOf(LockFreeLinkedListNode).k12 = function (node) {
3276
+ if (!(this.f12_1 === this))
3277
+ return false;
3278
+ this.i12(node, -2147483648);
3279
+ return true;
3280
+ };
3281
+ function ListClosed(forbiddenElementsBitmask) {
3282
+ LockFreeLinkedListNode.call(this);
3283
+ this.w16_1 = forbiddenElementsBitmask;
3284
+ }
3285
+ function unwrap(exception) {
3286
+ return exception;
3287
+ }
3288
+ function recoverStackTrace(exception, continuation) {
3289
+ return exception;
3290
+ }
3291
+ function SynchronizedObject() {
3292
+ }
3293
+ function threadContextElements(context) {
3294
+ return 0;
3295
+ }
3296
+ function CommonThreadLocal() {
3297
+ this.f13_1 = null;
3298
+ }
3299
+ protoOf(CommonThreadLocal).g13 = function () {
3300
+ var tmp = this.f13_1;
3301
+ return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
3302
+ };
3303
+ protoOf(CommonThreadLocal).h13 = function (value) {
3304
+ this.f13_1 = value;
3305
+ };
3306
+ function commonThreadLocal(name) {
3307
+ return new CommonThreadLocal();
3308
+ }
3309
+ function createEventLoop() {
3310
+ return new UnconfinedEventLoop();
3311
+ }
3312
+ function UnconfinedEventLoop() {
3313
+ EventLoop.call(this);
3314
+ }
3315
+ protoOf(UnconfinedEventLoop).o12 = function (context, block) {
3316
+ unsupported();
3317
+ };
3318
+ function unsupported() {
3319
+ throw UnsupportedOperationException_init_$Create$('runBlocking event loop is not supported');
3320
+ }
3321
+ function promise(_this__u8e3s4, context, start, block) {
3322
+ context = context === VOID ? EmptyCoroutineContext_getInstance() : context;
3323
+ start = start === VOID ? CoroutineStart_DEFAULT_getInstance() : start;
3324
+ return asPromise(async(_this__u8e3s4, context, start, block));
3325
+ }
3326
+ function await_0(_this__u8e3s4, $completion) {
3327
+ var cancellable = new CancellableContinuationImpl(intercepted($completion), 1);
3328
+ cancellable.m10();
3329
+ var tmp = await$lambda(cancellable);
3330
+ _this__u8e3s4.then(tmp, await$lambda_0(cancellable));
3331
+ return cancellable.e11();
3332
+ }
3333
+ function asPromise(_this__u8e3s4) {
3334
+ var promise = new Promise(asPromise$lambda(_this__u8e3s4));
3335
+ // Inline function 'kotlin.js.toJsReference' call
3336
+ // Inline function 'kotlin.js.unsafeCast' call
3337
+ // Inline function 'kotlin.js.asDynamic' call
3338
+ promiseSetDeferred(promise, _this__u8e3s4);
3339
+ return promise;
3340
+ }
3341
+ function promiseSetDeferred(promise, deferred) {
3342
+ promise.deferred = deferred;
3343
+ return Unit_instance;
3344
+ }
3345
+ function await$lambda($cont) {
3346
+ return function (it) {
3347
+ // Inline function 'kotlin.coroutines.resume' call
3348
+ var this_0 = $cont;
3349
+ // Inline function 'kotlin.Companion.success' call
3350
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(it);
3351
+ this_0.f7(tmp$ret$0);
3352
+ return null;
3353
+ };
3354
+ }
3355
+ function await$lambda_0($cont) {
3356
+ return function (it) {
3357
+ var tmp0 = $cont;
3358
+ // Inline function 'kotlin.coroutines.resumeWithException' call
3359
+ // Inline function 'kotlin.Companion.failure' call
3360
+ var exception = toThrowable(it);
3361
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(createFailure(exception));
3362
+ tmp0.f7(tmp$ret$0);
3363
+ return null;
3364
+ };
3365
+ }
3366
+ function asPromise$lambda$lambda($this_asPromise, $reject, $resolve) {
3367
+ return function (it) {
3368
+ var e = $this_asPromise.jz();
3369
+ var tmp;
3370
+ if (!(e == null)) {
3371
+ tmp = $reject(toJsPromiseError(e));
3372
+ } else {
3373
+ tmp = $resolve($this_asPromise.pz());
3374
+ }
3375
+ return Unit_instance;
3376
+ };
3377
+ }
3378
+ function asPromise$lambda($this_asPromise) {
3379
+ return function (resolve, reject) {
3380
+ $this_asPromise.uy(asPromise$lambda$lambda($this_asPromise, reject, resolve));
3381
+ return Unit_instance;
3382
+ };
3383
+ }
3384
+ function propagateExceptionFinalResort(exception) {
3385
+ // Inline function 'kotlin.with' call
3386
+ throwAsyncJsError(exception.message, getKClassFromExpression(exception).g8(), stackTraceToString(exception));
3387
+ return Unit_instance;
3388
+ }
3389
+ function throwAsyncJsError(message, className, stack) {
3390
+ var error = new Error();
3391
+ error.message = message;
3392
+ error.name = className;
3393
+ error.stack = stack;
3394
+ if (typeof globalThis.reportError === 'function') {
3395
+ // Up-to-date browsers and some non-browser JS runtimes (Deno, Bun)
3396
+ globalThis.reportError(error);
3397
+ } else {
3398
+ // Fallback for old browsers (pre-2022), Node.js
3399
+ setTimeout(function () {
3400
+ throw error;
3401
+ }, 0);
3402
+ }
3403
+ }
3404
+ function SetTimeoutDispatcher() {
3405
+ SetTimeoutDispatcher_instance = this;
3406
+ SetTimeoutBasedDispatcher.call(this);
3407
+ }
3408
+ protoOf(SetTimeoutDispatcher).p15 = function () {
3409
+ this.w15_1.d16(0);
3410
+ };
3411
+ var SetTimeoutDispatcher_instance;
3412
+ function SetTimeoutDispatcher_getInstance() {
3413
+ if (SetTimeoutDispatcher_instance == null)
3414
+ new SetTimeoutDispatcher();
3415
+ return SetTimeoutDispatcher_instance;
3416
+ }
3417
+ function SetTimeoutBasedDispatcher() {
3418
+ CoroutineDispatcher.call(this);
3419
+ this.w15_1 = new ScheduledMessageQueue(this);
3420
+ }
3421
+ protoOf(SetTimeoutBasedDispatcher).o12 = function (context, block) {
3422
+ this.w15_1.e16(block);
3423
+ };
3424
+ function MessageQueue() {
3425
+ this.x15_1 = ArrayDeque_init_$Create$();
3426
+ this.y15_1 = 16;
3427
+ this.z15_1 = false;
3428
+ }
3429
+ protoOf(MessageQueue).e16 = function (element) {
3430
+ this.f16(element);
3431
+ if (!this.z15_1) {
3432
+ this.z15_1 = true;
3433
+ this.b16();
3434
+ }
3435
+ };
3436
+ protoOf(MessageQueue).a16 = function () {
3437
+ try {
3438
+ // Inline function 'kotlin.repeat' call
3439
+ var times = this.y15_1;
3440
+ var inductionVariable = 0;
3441
+ if (inductionVariable < times)
3442
+ do {
3443
+ var index = inductionVariable;
3444
+ inductionVariable = inductionVariable + 1 | 0;
3445
+ var tmp0_elvis_lhs = removeFirstOrNull(this);
3446
+ var tmp;
3447
+ if (tmp0_elvis_lhs == null) {
3448
+ return Unit_instance;
3449
+ } else {
3450
+ tmp = tmp0_elvis_lhs;
3451
+ }
3452
+ var element = tmp;
3453
+ element.q11();
3454
+ }
3455
+ while (inductionVariable < times);
3456
+ }finally {
3457
+ if (this.p()) {
3458
+ this.z15_1 = false;
3459
+ } else {
3460
+ this.c16();
3461
+ }
3462
+ }
3463
+ };
3464
+ protoOf(MessageQueue).f16 = function (element) {
3465
+ return this.x15_1.d(element);
3466
+ };
3467
+ protoOf(MessageQueue).d = function (element) {
3468
+ return this.f16((!(element == null) ? isInterface(element, Runnable) : false) ? element : THROW_CCE());
3469
+ };
3470
+ protoOf(MessageQueue).g16 = function (elements) {
3471
+ return this.x15_1.o(elements);
3472
+ };
3473
+ protoOf(MessageQueue).o = function (elements) {
3474
+ return this.g16(elements);
3475
+ };
3476
+ protoOf(MessageQueue).r1 = function () {
3477
+ this.x15_1.r1();
3478
+ };
3479
+ protoOf(MessageQueue).h16 = function (index, element) {
3480
+ return this.x15_1.t1(index, element);
3481
+ };
3482
+ protoOf(MessageQueue).t1 = function (index, element) {
3483
+ return this.h16(index, (!(element == null) ? isInterface(element, Runnable) : false) ? element : THROW_CCE());
3484
+ };
3485
+ protoOf(MessageQueue).u1 = function (index) {
3486
+ return this.x15_1.u1(index);
3487
+ };
3488
+ protoOf(MessageQueue).m = function (index) {
3489
+ return this.x15_1.m(index);
3490
+ };
3491
+ protoOf(MessageQueue).p = function () {
3492
+ return this.x15_1.p();
3493
+ };
3494
+ protoOf(MessageQueue).i16 = function (element) {
3495
+ return this.x15_1.g1(element);
3496
+ };
3497
+ protoOf(MessageQueue).g1 = function (element) {
3498
+ if (!(!(element == null) ? isInterface(element, Runnable) : false))
3499
+ return false;
3500
+ return this.i16((!(element == null) ? isInterface(element, Runnable) : false) ? element : THROW_CCE());
3501
+ };
3502
+ protoOf(MessageQueue).f = function () {
3503
+ return this.x15_1.f();
3504
+ };
3505
+ protoOf(MessageQueue).n = function (index) {
3506
+ return this.x15_1.n(index);
3507
+ };
3508
+ protoOf(MessageQueue).i = function () {
3509
+ return this.x15_1.na_1;
3510
+ };
3511
+ function WindowDispatcher(window_0) {
3512
+ CoroutineDispatcher.call(this);
3513
+ this.e17_1 = window_0;
3514
+ this.f17_1 = new WindowMessageQueue(this.e17_1);
3515
+ }
3516
+ protoOf(WindowDispatcher).o12 = function (context, block) {
3517
+ return this.f17_1.e16(block);
3518
+ };
3519
+ //region block: post-declaration
3520
+ protoOf(JobSupport).ob = plus;
3521
+ protoOf(JobSupport).h7 = get_0;
3522
+ protoOf(JobSupport).nb = fold;
3523
+ protoOf(JobSupport).mb = minusKey_0;
3524
+ protoOf(CoroutineDispatcher).h7 = get;
3525
+ protoOf(CoroutineDispatcher).mb = minusKey;
3526
+ defineProp(protoOf(DispatchException), 'cause', function () {
3527
+ return this.l7();
3528
+ });
3529
+ //endregion
3530
+ //region block: init
3531
+ Active_instance = new Active();
3532
+ Key_instance_1 = new Key_0();
3533
+ GlobalScope_instance = new GlobalScope();
3534
+ Key_instance_2 = new Key_1();
3535
+ NonDisposableHandle_instance = new NonDisposableHandle();
3536
+ Key_instance_3 = new Key_2();
3537
+ counter = 0;
3538
+ DEBUG = false;
3539
+ //endregion
3540
+ //region block: exports
3541
+ export {
3542
+ await_0 as await20nhgj9iqzkt,
3543
+ GlobalScope_instance as GlobalScope_instance1sfulufhd2ijt,
3544
+ CoroutineScope as CoroutineScopefcb5f5dwqcas,
3545
+ promise as promise1ky6tawqaxbt4,
3546
+ };
3547
+ //endregion
3548
+
3549
+ //# sourceMappingURL=kotlinx-coroutines-core.mjs.map