@doordeck/doordeck-headless-sdk 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +2 -0
  2. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js +5545 -0
  3. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  4. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js +255 -0
  5. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js.map +1 -0
  6. package/kotlin/MultiplatformSettings-multiplatform-settings.js +41 -0
  7. package/kotlin/MultiplatformSettings-multiplatform-settings.js.map +1 -0
  8. package/kotlin/Stately-stately-concurrency.js +32 -0
  9. package/kotlin/Stately-stately-concurrency.js.map +1 -0
  10. package/kotlin/Stately-stately-concurrent-collections.js +304 -0
  11. package/kotlin/Stately-stately-concurrent-collections.js.map +1 -0
  12. package/kotlin/Stately-stately-strict.js +12 -0
  13. package/kotlin/Stately-stately-strict.js.map +1 -0
  14. package/kotlin/doordeck-sdk.d.ts +1325 -0
  15. package/kotlin/doordeck-sdk.js +33503 -0
  16. package/kotlin/doordeck-sdk.js.map +1 -0
  17. package/kotlin/kotlin-kotlin-stdlib.js +14474 -0
  18. package/kotlin/kotlin-kotlin-stdlib.js.map +1 -0
  19. package/kotlin/kotlin-kotlinx-atomicfu-runtime.js +8 -0
  20. package/kotlin/kotlin-kotlinx-atomicfu-runtime.js.map +1 -0
  21. package/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  22. package/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
  23. package/kotlin/kotlinx-atomicfu.js +249 -0
  24. package/kotlin/kotlinx-atomicfu.js.map +1 -0
  25. package/kotlin/kotlinx-coroutines-core.js +8784 -0
  26. package/kotlin/kotlinx-coroutines-core.js.map +1 -0
  27. package/kotlin/kotlinx-io-kotlinx-io-bytestring.js +8 -0
  28. package/kotlin/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  29. package/kotlin/kotlinx-io-kotlinx-io-core.js +1333 -0
  30. package/kotlin/kotlinx-io-kotlinx-io-core.js.map +1 -0
  31. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +5908 -0
  32. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  33. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +4740 -0
  34. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  35. package/kotlin/ktor-ktor-client-ktor-client-core.js +8407 -0
  36. package/kotlin/ktor-ktor-client-ktor-client-core.js.map +1 -0
  37. package/kotlin/ktor-ktor-client-ktor-client-js.js +8 -0
  38. package/kotlin/ktor-ktor-client-ktor-client-js.js.map +1 -0
  39. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js +1146 -0
  40. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js.map +1 -0
  41. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js +647 -0
  42. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js.map +1 -0
  43. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-encoding.js +8 -0
  44. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-encoding.js.map +1 -0
  45. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-logging.js +8 -0
  46. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-logging.js.map +1 -0
  47. package/kotlin/ktor-ktor-http.js +3638 -0
  48. package/kotlin/ktor-ktor-http.js.map +1 -0
  49. package/kotlin/ktor-ktor-io.js +2249 -0
  50. package/kotlin/ktor-ktor-io.js.map +1 -0
  51. package/kotlin/ktor-ktor-shared-ktor-events.js +84 -0
  52. package/kotlin/ktor-ktor-shared-ktor-events.js.map +1 -0
  53. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js +47 -0
  54. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js.map +1 -0
  55. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js +857 -0
  56. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js.map +1 -0
  57. package/kotlin/ktor-ktor-shared-ktor-serialization.js +365 -0
  58. package/kotlin/ktor-ktor-shared-ktor-serialization.js.map +1 -0
  59. package/kotlin/ktor-ktor-shared-ktor-sse.js +8 -0
  60. package/kotlin/ktor-ktor-shared-ktor-sse.js.map +1 -0
  61. package/kotlin/ktor-ktor-shared-ktor-websocket-serialization.js +8 -0
  62. package/kotlin/ktor-ktor-shared-ktor-websocket-serialization.js.map +1 -0
  63. package/kotlin/ktor-ktor-shared-ktor-websockets.js +424 -0
  64. package/kotlin/ktor-ktor-shared-ktor-websockets.js.map +1 -0
  65. package/kotlin/ktor-ktor-utils.js +2393 -0
  66. package/kotlin/ktor-ktor-utils.js.map +1 -0
  67. package/kotlin/projects-core-koin-core.js +1134 -0
  68. package/kotlin/projects-core-koin-core.js.map +1 -0
  69. package/kotlin/uuid.js +152 -0
  70. package/kotlin/uuid.js.map +1 -0
  71. package/package.json +42 -0
@@ -0,0 +1,2249 @@
1
+ (function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_org_jetbrains_kotlinx_atomicfu, kotlin_org_jetbrains_kotlinx_kotlinx_io_core) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var Unit_instance = kotlin_kotlin.$_$.k5;
5
+ var Companion_instance = kotlin_kotlin.$_$.f5;
6
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.z2;
7
+ var createFailure = kotlin_kotlin.$_$.uf;
8
+ var CoroutineImpl = kotlin_kotlin.$_$.u9;
9
+ var numberToLong = kotlin_kotlin.$_$.pb;
10
+ var toLong = kotlin_kotlin.$_$.tb;
11
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.e9;
12
+ var protoOf = kotlin_kotlin.$_$.rb;
13
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.ta;
14
+ var intercepted = kotlin_kotlin.$_$.h9;
15
+ var CancellableContinuationImpl = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.o;
16
+ var returnIfSuspended = kotlin_kotlin.$_$.j;
17
+ var VOID = kotlin_kotlin.$_$.f;
18
+ var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d;
19
+ var Buffer = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.f;
20
+ var IOException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.c;
21
+ var hashCode = kotlin_kotlin.$_$.qa;
22
+ var initMetadataForClass = kotlin_kotlin.$_$.ra;
23
+ var initMetadataForCompanion = kotlin_kotlin.$_$.sa;
24
+ var initMetadataForInterface = kotlin_kotlin.$_$.va;
25
+ var EOFException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.a;
26
+ var Long = kotlin_kotlin.$_$.ze;
27
+ var EmptyCoroutineContext_getInstance = kotlin_kotlin.$_$.q4;
28
+ var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.w;
29
+ var launch = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g1;
30
+ var startCoroutineCancellable = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m;
31
+ var Continuation = kotlin_kotlin.$_$.o9;
32
+ var initMetadataForFunctionReference = kotlin_kotlin.$_$.ua;
33
+ var THROW_CCE = kotlin_kotlin.$_$.ef;
34
+ var isInterface = kotlin_kotlin.$_$.gb;
35
+ var get_job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f1;
36
+ var Job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.y;
37
+ var cancel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e1;
38
+ var initMetadataForLambda = kotlin_kotlin.$_$.wa;
39
+ var CopyableThrowable = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.t;
40
+ var IOException = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.g;
41
+ var IOException_init_$Create$_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.e;
42
+ var CancellationException_init_$Create$ = kotlin_kotlin.$_$.d1;
43
+ var CancellationException = kotlin_kotlin.$_$.d9;
44
+ var readString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.k;
45
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f1;
46
+ var toString = kotlin_kotlin.$_$.vb;
47
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.y1;
48
+ var charSequenceLength = kotlin_kotlin.$_$.ga;
49
+ var readByteArray = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.i;
50
+ var readString_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.l;
51
+ var readByteArray_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.j;
52
+ var encodeToByteArray = kotlin_kotlin.$_$.qc;
53
+ var writeString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.m;
54
+ var decodeToString = kotlin_kotlin.$_$.pc;
55
+ var Unit = kotlin_kotlin.$_$.pf;
56
+ var CancellableContinuation = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.p;
57
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r2;
58
+ var replace = kotlin_kotlin.$_$.jd;
59
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1;
60
+ var getStringHashCode = kotlin_kotlin.$_$.pa;
61
+ var initMetadataForObject = kotlin_kotlin.$_$.xa;
62
+ var IOException_init_$Init$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.b;
63
+ var captureStack = kotlin_kotlin.$_$.ca;
64
+ var charSequenceSubSequence = kotlin_kotlin.$_$.ha;
65
+ var isCharSequence = kotlin_kotlin.$_$.cb;
66
+ var trim = kotlin_kotlin.$_$.le;
67
+ var toByte = kotlin_kotlin.$_$.sb;
68
+ var decodeToString_0 = kotlin_kotlin.$_$.oc;
69
+ var setOf = kotlin_kotlin.$_$.l8;
70
+ var charSequenceGet = kotlin_kotlin.$_$.fa;
71
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.x2;
72
+ var fillArrayVal = kotlin_kotlin.$_$.ma;
73
+ //endregion
74
+ //region block: pre-declaration
75
+ initMetadataForCoroutine($awaitContentCOROUTINE$0, CoroutineImpl);
76
+ initMetadataForCoroutine($flushAndCloseCOROUTINE$1, CoroutineImpl);
77
+ initMetadataForCoroutine($sleepForReadCOROUTINE$2, CoroutineImpl);
78
+ initMetadataForCoroutine($sleepForWriteCOROUTINE$3, CoroutineImpl);
79
+ function awaitContent$default(min, $completion, $super) {
80
+ min = min === VOID ? 1 : min;
81
+ return $super === VOID ? this.k1d(min, $completion) : $super.k1d.call(this, min, $completion);
82
+ }
83
+ initMetadataForInterface(ByteReadChannel_1, 'ByteReadChannel', VOID, VOID, VOID, [1]);
84
+ initMetadataForClass(ByteChannel, 'ByteChannel', ByteChannel, VOID, [ByteReadChannel_1], [1, 0]);
85
+ initMetadataForClass(ByteReadChannel$Companion$Empty$1, VOID, VOID, VOID, [ByteReadChannel_1], [1]);
86
+ initMetadataForCompanion(Companion);
87
+ initMetadataForCoroutine($readRemainingCOROUTINE$4, CoroutineImpl);
88
+ initMetadataForCoroutine($readPacketCOROUTINE$5, CoroutineImpl);
89
+ initMetadataForCoroutine($readAvailableCOROUTINE$8, CoroutineImpl);
90
+ initMetadataForCoroutine($toByteArrayCOROUTINE$10, CoroutineImpl);
91
+ initMetadataForCoroutine($copyToCOROUTINE$11, CoroutineImpl);
92
+ initMetadataForCoroutine($readBufferCOROUTINE$13, CoroutineImpl);
93
+ initMetadataForCoroutine($flushIfNeededCOROUTINE$15, CoroutineImpl);
94
+ initMetadataForClass(WriterJob, 'WriterJob');
95
+ initMetadataForClass(WriterScope, 'WriterScope', VOID, VOID, [CoroutineScope]);
96
+ initMetadataForClass(NO_CALLBACK$1, VOID, VOID, VOID, [Continuation]);
97
+ initMetadataForFunctionReference(ByteWriteChannel$flushAndClose$ref, VOID, VOID, [0]);
98
+ initMetadataForLambda(writer$slambda, CoroutineImpl, VOID, [1]);
99
+ initMetadataForClass(CloseToken, 'CloseToken');
100
+ initMetadataForClass(SourceByteReadChannel, 'SourceByteReadChannel', VOID, VOID, [ByteReadChannel_1], [1]);
101
+ initMetadataForClass(ClosedSlot, 'ClosedSlot', VOID, VOID, [CancellableContinuation]);
102
+ initMetadataForClass(DefaultPool, 'DefaultPool');
103
+ initMetadataForClass(ByteArrayPool$1, VOID, VOID, DefaultPool);
104
+ initMetadataForCompanion(Companion_0);
105
+ initMetadataForClass(Charset, 'Charset');
106
+ initMetadataForObject(Charsets, 'Charsets');
107
+ initMetadataForClass(MalformedInputException, 'MalformedInputException', VOID, IOException);
108
+ initMetadataForClass(CharsetDecoder, 'CharsetDecoder');
109
+ initMetadataForClass(CharsetEncoder, 'CharsetEncoder');
110
+ initMetadataForClass(CharsetImpl, 'CharsetImpl', VOID, Charset);
111
+ initMetadataForClass(CharsetEncoderImpl, 'CharsetEncoderImpl', VOID, CharsetEncoder);
112
+ initMetadataForClass(CharsetDecoderImpl, 'CharsetDecoderImpl', VOID, CharsetDecoder);
113
+ initMetadataForClass(toKtor$1);
114
+ initMetadataForClass(TextDecoderFallback, 'TextDecoderFallback');
115
+ //endregion
116
+ function get_CHANNEL_MAX_SIZE() {
117
+ return CHANNEL_MAX_SIZE;
118
+ }
119
+ var CHANNEL_MAX_SIZE;
120
+ function moveFlushToReadBuffer($this) {
121
+ // Inline function 'io.ktor.utils.io.locks.synchronized' call
122
+ $this.n1b_1;
123
+ $this.l1b_1.h1a($this.o1b_1);
124
+ $this.m1b_1 = 0;
125
+ resumeSlot($this);
126
+ }
127
+ function sleepForRead($this, min, $completion) {
128
+ var tmp = new $sleepForReadCOROUTINE$2($this, min, $completion);
129
+ tmp.c9_1 = Unit_instance;
130
+ tmp.d9_1 = null;
131
+ return tmp.i9();
132
+ }
133
+ function sleepForWrite($this, $completion) {
134
+ var tmp = new $sleepForWriteCOROUTINE$3($this, $completion);
135
+ tmp.c9_1 = Unit_instance;
136
+ tmp.d9_1 = null;
137
+ return tmp.i9();
138
+ }
139
+ function resumeSlot($this) {
140
+ var tmp$ret$1;
141
+ $l$block: {
142
+ // Inline function 'kotlinx.atomicfu.getAndUpdate' call
143
+ var this_0 = $this.q1b_1;
144
+ while (true) {
145
+ var cur = this_0.kotlinx$atomicfu$value;
146
+ // Inline function 'io.ktor.utils.io.ByteChannel.resumeSlot.<anonymous>' call
147
+ var upd = cur instanceof ClosedSlot ? cur : null;
148
+ if (this_0.atomicfu$compareAndSet(cur, upd)) {
149
+ tmp$ret$1 = cur;
150
+ break $l$block;
151
+ }
152
+ }
153
+ }
154
+ var continuation = tmp$ret$1;
155
+ if (continuation == null)
156
+ null;
157
+ else {
158
+ // Inline function 'kotlin.coroutines.resume' call
159
+ // Inline function 'kotlin.Companion.success' call
160
+ var tmp$ret$2 = _Result___init__impl__xyqfz8(Unit_instance);
161
+ continuation.l9(tmp$ret$2);
162
+ }
163
+ }
164
+ function closeSlot($this, cause) {
165
+ var closeContinuation = !(cause == null) ? new ClosedSlot(cause) : get_CLOSED_0();
166
+ var tmp0_elvis_lhs = $this.q1b_1.atomicfu$getAndSet(closeContinuation);
167
+ var tmp;
168
+ if (tmp0_elvis_lhs == null) {
169
+ return Unit_instance;
170
+ } else {
171
+ tmp = tmp0_elvis_lhs;
172
+ }
173
+ var continuation = tmp;
174
+ if (continuation instanceof ClosedSlot)
175
+ return Unit_instance;
176
+ if (!(cause == null)) {
177
+ // Inline function 'kotlin.coroutines.resumeWithException' call
178
+ // Inline function 'kotlin.Companion.failure' call
179
+ var tmp$ret$0 = _Result___init__impl__xyqfz8(createFailure(cause));
180
+ continuation.l9(tmp$ret$0);
181
+ } else {
182
+ // Inline function 'kotlin.coroutines.resume' call
183
+ // Inline function 'kotlin.Companion.success' call
184
+ var tmp$ret$2 = _Result___init__impl__xyqfz8(Unit_instance);
185
+ continuation.l9(tmp$ret$2);
186
+ }
187
+ }
188
+ function $awaitContentCOROUTINE$0(_this__u8e3s4, min, resultContinuation) {
189
+ CoroutineImpl.call(this, resultContinuation);
190
+ this.s1c_1 = _this__u8e3s4;
191
+ this.t1c_1 = min;
192
+ }
193
+ protoOf($awaitContentCOROUTINE$0).i9 = function () {
194
+ var suspendResult = this.c9_1;
195
+ $sm: do
196
+ try {
197
+ var tmp = this.a9_1;
198
+ switch (tmp) {
199
+ case 0:
200
+ this.b9_1 = 2;
201
+ rethrowCloseCauseIfNeeded_1(this.s1c_1);
202
+ if (numberToLong(this.s1c_1.m1b_1).u2(this.s1c_1.o1b_1.m()).z(toLong(this.t1c_1)) >= 0)
203
+ return true;
204
+ this.a9_1 = 1;
205
+ suspendResult = sleepForRead(this.s1c_1, this.t1c_1, this);
206
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
207
+ return suspendResult;
208
+ }
209
+
210
+ continue $sm;
211
+ case 1:
212
+ if (this.s1c_1.o1b_1.m().z(toLong(CHANNEL_MAX_SIZE)) < 0) {
213
+ moveFlushToReadBuffer(this.s1c_1);
214
+ }
215
+
216
+ return this.s1c_1.k1b_1.kotlinx$atomicfu$value == null;
217
+ case 2:
218
+ throw this.d9_1;
219
+ }
220
+ } catch ($p) {
221
+ var e = $p;
222
+ if (this.b9_1 === 2) {
223
+ throw e;
224
+ } else {
225
+ this.a9_1 = this.b9_1;
226
+ this.d9_1 = e;
227
+ }
228
+ }
229
+ while (true);
230
+ };
231
+ function $flushAndCloseCOROUTINE$1(_this__u8e3s4, resultContinuation) {
232
+ CoroutineImpl.call(this, resultContinuation);
233
+ this.c1d_1 = _this__u8e3s4;
234
+ }
235
+ protoOf($flushAndCloseCOROUTINE$1).i9 = function () {
236
+ var suspendResult = this.c9_1;
237
+ $sm: do
238
+ try {
239
+ var tmp = this.a9_1;
240
+ switch (tmp) {
241
+ case 0:
242
+ this.b9_1 = 2;
243
+ this.a9_1 = 1;
244
+ suspendResult = this.c1d_1.d1d(this);
245
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
246
+ return suspendResult;
247
+ }
248
+
249
+ continue $sm;
250
+ case 1:
251
+ if (!this.c1d_1.k1b_1.atomicfu$compareAndSet(null, get_CLOSED()))
252
+ return Unit_instance;
253
+ closeSlot(this.c1d_1, null);
254
+ return Unit_instance;
255
+ case 2:
256
+ throw this.d9_1;
257
+ }
258
+ } catch ($p) {
259
+ var e = $p;
260
+ if (this.b9_1 === 2) {
261
+ throw e;
262
+ } else {
263
+ this.a9_1 = this.b9_1;
264
+ this.d9_1 = e;
265
+ }
266
+ }
267
+ while (true);
268
+ };
269
+ function $sleepForReadCOROUTINE$2(_this__u8e3s4, min, resultContinuation) {
270
+ CoroutineImpl.call(this, resultContinuation);
271
+ this.z1b_1 = _this__u8e3s4;
272
+ this.a1c_1 = min;
273
+ }
274
+ protoOf($sleepForReadCOROUTINE$2).i9 = function () {
275
+ var suspendResult = this.c9_1;
276
+ $sm: do
277
+ try {
278
+ var tmp = this.a9_1;
279
+ switch (tmp) {
280
+ case 0:
281
+ this.b9_1 = 3;
282
+ this.a9_1 = 1;
283
+ continue $sm;
284
+ case 1:
285
+ if (!(numberToLong(this.z1b_1.m1b_1).u2(this.z1b_1.o1b_1.m()).z(toLong(this.a1c_1)) < 0 && this.z1b_1.k1b_1.kotlinx$atomicfu$value == null)) {
286
+ this.a9_1 = 4;
287
+ continue $sm;
288
+ }
289
+
290
+ this.a9_1 = 2;
291
+ var cancellable = new CancellableContinuationImpl(intercepted(this), 1);
292
+ cancellable.ar();
293
+ l$ret$1: do {
294
+ var this_0 = this.z1b_1;
295
+ var published = this_0.q1b_1.atomicfu$compareAndSet(null, cancellable);
296
+ if (!published) {
297
+ cancellable.l9(_Result___init__impl__xyqfz8(Unit_instance));
298
+ break l$ret$1;
299
+ }
300
+ if (!(numberToLong(this.z1b_1.m1b_1).u2(this.z1b_1.o1b_1.m()).z(toLong(this.a1c_1)) < 0 && this.z1b_1.k1b_1.kotlinx$atomicfu$value == null)) {
301
+ var tmp4_safe_receiver = this_0.q1b_1.atomicfu$getAndSet(null);
302
+ if (tmp4_safe_receiver == null)
303
+ null;
304
+ else {
305
+ tmp4_safe_receiver.l9(_Result___init__impl__xyqfz8(Unit_instance));
306
+ }
307
+ }
308
+ }
309
+ while (false);
310
+ suspendResult = returnIfSuspended(cancellable.hr(), this);
311
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
312
+ return suspendResult;
313
+ }
314
+
315
+ continue $sm;
316
+ case 2:
317
+ this.a9_1 = 1;
318
+ continue $sm;
319
+ case 3:
320
+ throw this.d9_1;
321
+ case 4:
322
+ return Unit_instance;
323
+ }
324
+ } catch ($p) {
325
+ var e = $p;
326
+ if (this.b9_1 === 3) {
327
+ throw e;
328
+ } else {
329
+ this.a9_1 = this.b9_1;
330
+ this.d9_1 = e;
331
+ }
332
+ }
333
+ while (true);
334
+ };
335
+ function $sleepForWriteCOROUTINE$3(_this__u8e3s4, resultContinuation) {
336
+ CoroutineImpl.call(this, resultContinuation);
337
+ this.j1c_1 = _this__u8e3s4;
338
+ }
339
+ protoOf($sleepForWriteCOROUTINE$3).i9 = function () {
340
+ var suspendResult = this.c9_1;
341
+ $sm: do
342
+ try {
343
+ var tmp = this.a9_1;
344
+ switch (tmp) {
345
+ case 0:
346
+ this.b9_1 = 4;
347
+ this.a9_1 = 1;
348
+ continue $sm;
349
+ case 1:
350
+ if (!(this.j1c_1.m1b_1 >= CHANNEL_MAX_SIZE)) {
351
+ this.a9_1 = 3;
352
+ continue $sm;
353
+ }
354
+
355
+ this.a9_1 = 2;
356
+ var cancellable = new CancellableContinuationImpl(intercepted(this), 1);
357
+ cancellable.ar();
358
+ l$ret$1: do {
359
+ var this_0 = this.j1c_1;
360
+ var published = this_0.q1b_1.atomicfu$compareAndSet(null, cancellable);
361
+ if (!published) {
362
+ cancellable.l9(_Result___init__impl__xyqfz8(Unit_instance));
363
+ break l$ret$1;
364
+ }
365
+ if (!(this.j1c_1.m1b_1 >= CHANNEL_MAX_SIZE)) {
366
+ var tmp4_safe_receiver = this_0.q1b_1.atomicfu$getAndSet(null);
367
+ if (tmp4_safe_receiver == null)
368
+ null;
369
+ else {
370
+ tmp4_safe_receiver.l9(_Result___init__impl__xyqfz8(Unit_instance));
371
+ }
372
+ }
373
+ }
374
+ while (false);
375
+ suspendResult = returnIfSuspended(cancellable.hr(), this);
376
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
377
+ return suspendResult;
378
+ }
379
+
380
+ continue $sm;
381
+ case 2:
382
+ this.a9_1 = 1;
383
+ continue $sm;
384
+ case 3:
385
+ return Unit_instance;
386
+ case 4:
387
+ throw this.d9_1;
388
+ }
389
+ } catch ($p) {
390
+ var e = $p;
391
+ if (this.b9_1 === 4) {
392
+ throw e;
393
+ } else {
394
+ this.a9_1 = this.b9_1;
395
+ this.d9_1 = e;
396
+ }
397
+ }
398
+ while (true);
399
+ };
400
+ function ByteChannel(autoFlush) {
401
+ autoFlush = autoFlush === VOID ? false : autoFlush;
402
+ this.j1b_1 = autoFlush;
403
+ this.k1b_1 = atomic$ref$1(null);
404
+ this.l1b_1 = new Buffer();
405
+ this.m1b_1 = 0;
406
+ this.n1b_1 = new Object();
407
+ this.o1b_1 = new Buffer();
408
+ this.p1b_1 = new Buffer();
409
+ this.q1b_1 = atomic$ref$1(null);
410
+ }
411
+ protoOf(ByteChannel).e1d = function () {
412
+ var tmp0_safe_receiver = this.f1d();
413
+ if (tmp0_safe_receiver == null)
414
+ null;
415
+ else {
416
+ // Inline function 'kotlin.let' call
417
+ // Inline function 'kotlin.contracts.contract' call
418
+ throw tmp0_safe_receiver;
419
+ }
420
+ if (this.o1b_1.o19()) {
421
+ moveFlushToReadBuffer(this);
422
+ }
423
+ return this.o1b_1;
424
+ };
425
+ protoOf(ByteChannel).g1d = function () {
426
+ var tmp1_safe_receiver = this.f1d();
427
+ if (tmp1_safe_receiver == null)
428
+ null;
429
+ else {
430
+ // Inline function 'kotlin.let' call
431
+ // Inline function 'kotlin.contracts.contract' call
432
+ throw tmp1_safe_receiver;
433
+ }
434
+ if (this.h1d()) {
435
+ throw IOException_init_$Create$('Channel is closed for write');
436
+ }
437
+ return this.p1b_1;
438
+ };
439
+ protoOf(ByteChannel).f1d = function () {
440
+ var tmp2_safe_receiver = this.k1b_1.kotlinx$atomicfu$value;
441
+ return tmp2_safe_receiver == null ? null : tmp2_safe_receiver.r9();
442
+ };
443
+ protoOf(ByteChannel).h1d = function () {
444
+ return !(this.k1b_1.kotlinx$atomicfu$value == null);
445
+ };
446
+ protoOf(ByteChannel).j1d = function () {
447
+ return !(this.f1d() == null) || (this.h1d() && this.m1b_1 === 0 && this.o1b_1.o19());
448
+ };
449
+ protoOf(ByteChannel).k1d = function (min, $completion) {
450
+ var tmp = new $awaitContentCOROUTINE$0(this, min, $completion);
451
+ tmp.c9_1 = Unit_instance;
452
+ tmp.d9_1 = null;
453
+ return tmp.i9();
454
+ };
455
+ protoOf(ByteChannel).d1d = function ($completion) {
456
+ rethrowCloseCauseIfNeeded_1(this);
457
+ this.m1d();
458
+ if (this.m1b_1 < CHANNEL_MAX_SIZE)
459
+ return Unit_instance;
460
+ return sleepForWrite(this, $completion);
461
+ };
462
+ protoOf(ByteChannel).m1d = function () {
463
+ if (this.p1b_1.o19())
464
+ return Unit_instance;
465
+ // Inline function 'io.ktor.utils.io.locks.synchronized' call
466
+ this.n1b_1;
467
+ var count = this.p1b_1.m().e1();
468
+ this.l1b_1.v1a(this.p1b_1);
469
+ this.m1b_1 = this.m1b_1 + count | 0;
470
+ resumeSlot(this);
471
+ };
472
+ protoOf(ByteChannel).n1d = function ($completion) {
473
+ var tmp = new $flushAndCloseCOROUTINE$1(this, $completion);
474
+ tmp.c9_1 = Unit_instance;
475
+ tmp.d9_1 = null;
476
+ return tmp.i9();
477
+ };
478
+ protoOf(ByteChannel).o1d = function (cause) {
479
+ if (!(this.k1b_1.kotlinx$atomicfu$value == null))
480
+ return Unit_instance;
481
+ var closedToken = new CloseToken(cause);
482
+ this.k1b_1.atomicfu$compareAndSet(null, closedToken);
483
+ var actualCause = closedToken.r9();
484
+ closeSlot(this, actualCause);
485
+ };
486
+ protoOf(ByteChannel).toString = function () {
487
+ return 'ByteChannel[' + hashCode(this) + ']';
488
+ };
489
+ function ByteReadChannel(content, offset, length) {
490
+ offset = offset === VOID ? 0 : offset;
491
+ length = length === VOID ? content.length : length;
492
+ // Inline function 'kotlin.also' call
493
+ var this_0 = new Buffer();
494
+ // Inline function 'kotlin.contracts.contract' call
495
+ // Inline function 'io.ktor.utils.io.ByteReadChannel.<anonymous>' call
496
+ this_0.n1a(content, offset, offset + length | 0);
497
+ var source = this_0;
498
+ return ByteReadChannel_0(source);
499
+ }
500
+ function ByteReadChannel_0(source) {
501
+ return new SourceByteReadChannel(source);
502
+ }
503
+ function ByteReadChannel$Companion$Empty$1() {
504
+ this.p1d_1 = null;
505
+ this.q1d_1 = new Buffer();
506
+ }
507
+ protoOf(ByteReadChannel$Companion$Empty$1).f1d = function () {
508
+ return this.p1d_1;
509
+ };
510
+ protoOf(ByteReadChannel$Companion$Empty$1).j1d = function () {
511
+ return true;
512
+ };
513
+ protoOf(ByteReadChannel$Companion$Empty$1).e1d = function () {
514
+ return this.q1d_1;
515
+ };
516
+ protoOf(ByteReadChannel$Companion$Empty$1).k1d = function (min, $completion) {
517
+ return false;
518
+ };
519
+ protoOf(ByteReadChannel$Companion$Empty$1).o1d = function (cause) {
520
+ };
521
+ function Companion() {
522
+ Companion_instance_0 = this;
523
+ var tmp = this;
524
+ tmp.r1d_1 = new ByteReadChannel$Companion$Empty$1();
525
+ }
526
+ var Companion_instance_0;
527
+ function Companion_getInstance() {
528
+ if (Companion_instance_0 == null)
529
+ new Companion();
530
+ return Companion_instance_0;
531
+ }
532
+ function ByteReadChannel_1() {
533
+ }
534
+ function cancel_0(_this__u8e3s4) {
535
+ _this__u8e3s4.o1d(IOException_init_$Create$('Channel was cancelled'));
536
+ }
537
+ function readRemaining(_this__u8e3s4, $completion) {
538
+ var tmp = new $readRemainingCOROUTINE$4(_this__u8e3s4, $completion);
539
+ tmp.c9_1 = Unit_instance;
540
+ tmp.d9_1 = null;
541
+ return tmp.i9();
542
+ }
543
+ function get_availableForRead(_this__u8e3s4) {
544
+ return _this__u8e3s4.e1d().n19().m().e1();
545
+ }
546
+ function readPacket(_this__u8e3s4, packet, $completion) {
547
+ var tmp = new $readPacketCOROUTINE$5(_this__u8e3s4, packet, $completion);
548
+ tmp.c9_1 = Unit_instance;
549
+ tmp.d9_1 = null;
550
+ return tmp.i9();
551
+ }
552
+ function readAvailable(_this__u8e3s4, buffer, offset, length, $completion) {
553
+ offset = offset === VOID ? 0 : offset;
554
+ length = length === VOID ? buffer.length - offset | 0 : length;
555
+ var tmp = new $readAvailableCOROUTINE$8(_this__u8e3s4, buffer, offset, length, $completion);
556
+ tmp.c9_1 = Unit_instance;
557
+ tmp.d9_1 = null;
558
+ return tmp.i9();
559
+ }
560
+ function toByteArray(_this__u8e3s4, $completion) {
561
+ var tmp = new $toByteArrayCOROUTINE$10(_this__u8e3s4, $completion);
562
+ tmp.c9_1 = Unit_instance;
563
+ tmp.d9_1 = null;
564
+ return tmp.i9();
565
+ }
566
+ function copyTo(_this__u8e3s4, channel, limit, $completion) {
567
+ var tmp = new $copyToCOROUTINE$11(_this__u8e3s4, channel, limit, $completion);
568
+ tmp.c9_1 = Unit_instance;
569
+ tmp.d9_1 = null;
570
+ return tmp.i9();
571
+ }
572
+ function rethrowCloseCauseIfNeeded(_this__u8e3s4) {
573
+ var tmp7_safe_receiver = _this__u8e3s4.f1d();
574
+ if (tmp7_safe_receiver == null)
575
+ null;
576
+ else {
577
+ // Inline function 'kotlin.let' call
578
+ // Inline function 'kotlin.contracts.contract' call
579
+ throw tmp7_safe_receiver;
580
+ }
581
+ }
582
+ function readBuffer(_this__u8e3s4, $completion) {
583
+ var tmp = new $readBufferCOROUTINE$13(_this__u8e3s4, $completion);
584
+ tmp.c9_1 = Unit_instance;
585
+ tmp.d9_1 = null;
586
+ return tmp.i9();
587
+ }
588
+ function rethrowCloseCauseIfNeeded_0(_this__u8e3s4) {
589
+ var tmp8_safe_receiver = _this__u8e3s4.f1d();
590
+ if (tmp8_safe_receiver == null)
591
+ null;
592
+ else {
593
+ // Inline function 'kotlin.let' call
594
+ // Inline function 'kotlin.contracts.contract' call
595
+ throw tmp8_safe_receiver;
596
+ }
597
+ }
598
+ function rethrowCloseCauseIfNeeded_1(_this__u8e3s4) {
599
+ var tmp9_safe_receiver = _this__u8e3s4.f1d();
600
+ if (tmp9_safe_receiver == null)
601
+ null;
602
+ else {
603
+ // Inline function 'kotlin.let' call
604
+ // Inline function 'kotlin.contracts.contract' call
605
+ throw tmp9_safe_receiver;
606
+ }
607
+ }
608
+ function $readRemainingCOROUTINE$4(_this__u8e3s4, resultContinuation) {
609
+ CoroutineImpl.call(this, resultContinuation);
610
+ this.a1e_1 = _this__u8e3s4;
611
+ }
612
+ protoOf($readRemainingCOROUTINE$4).i9 = function () {
613
+ var suspendResult = this.c9_1;
614
+ $sm: do
615
+ try {
616
+ var tmp = this.a9_1;
617
+ switch (tmp) {
618
+ case 0:
619
+ this.b9_1 = 4;
620
+ this.b1e_1 = BytePacketBuilder();
621
+ this.a9_1 = 1;
622
+ continue $sm;
623
+ case 1:
624
+ if (!!this.a1e_1.j1d()) {
625
+ this.a9_1 = 3;
626
+ continue $sm;
627
+ }
628
+
629
+ this.b1e_1.v1a(this.a1e_1.e1d());
630
+ this.a9_1 = 2;
631
+ suspendResult = this.a1e_1.l1d(VOID, this);
632
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
633
+ return suspendResult;
634
+ }
635
+
636
+ continue $sm;
637
+ case 2:
638
+ this.a9_1 = 1;
639
+ continue $sm;
640
+ case 3:
641
+ rethrowCloseCauseIfNeeded(this.a1e_1);
642
+ return this.b1e_1.n19();
643
+ case 4:
644
+ throw this.d9_1;
645
+ }
646
+ } catch ($p) {
647
+ var e = $p;
648
+ if (this.b9_1 === 4) {
649
+ throw e;
650
+ } else {
651
+ this.a9_1 = this.b9_1;
652
+ this.d9_1 = e;
653
+ }
654
+ }
655
+ while (true);
656
+ };
657
+ function $readPacketCOROUTINE$5(_this__u8e3s4, packet, resultContinuation) {
658
+ CoroutineImpl.call(this, resultContinuation);
659
+ this.k1e_1 = _this__u8e3s4;
660
+ this.l1e_1 = packet;
661
+ }
662
+ protoOf($readPacketCOROUTINE$5).i9 = function () {
663
+ var suspendResult = this.c9_1;
664
+ $sm: do
665
+ try {
666
+ var tmp = this.a9_1;
667
+ switch (tmp) {
668
+ case 0:
669
+ this.b9_1 = 6;
670
+ this.m1e_1 = new Buffer();
671
+ this.a9_1 = 1;
672
+ continue $sm;
673
+ case 1:
674
+ if (!(this.m1e_1.m().z(toLong(this.l1e_1)) < 0)) {
675
+ this.a9_1 = 5;
676
+ continue $sm;
677
+ }
678
+
679
+ if (this.k1e_1.e1d().o19()) {
680
+ this.a9_1 = 2;
681
+ suspendResult = this.k1e_1.l1d(VOID, this);
682
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
683
+ return suspendResult;
684
+ }
685
+ continue $sm;
686
+ } else {
687
+ this.a9_1 = 3;
688
+ continue $sm;
689
+ }
690
+
691
+ case 2:
692
+ this.a9_1 = 3;
693
+ continue $sm;
694
+ case 3:
695
+ if (this.k1e_1.j1d()) {
696
+ this.a9_1 = 5;
697
+ continue $sm;
698
+ } else {
699
+ this.a9_1 = 4;
700
+ continue $sm;
701
+ }
702
+
703
+ case 4:
704
+ if (get_remaining(this.k1e_1.e1d()).z(numberToLong(this.l1e_1).v2(this.m1e_1.m())) > 0) {
705
+ this.k1e_1.e1d().g1a(this.m1e_1, numberToLong(this.l1e_1).v2(this.m1e_1.m()));
706
+ } else {
707
+ this.k1e_1.e1d().h1a(this.m1e_1);
708
+ }
709
+
710
+ this.a9_1 = 1;
711
+ continue $sm;
712
+ case 5:
713
+ if (this.m1e_1.m().z(toLong(this.l1e_1)) < 0) {
714
+ throw EOFException_init_$Create$('Not enough data available, required ' + this.l1e_1 + ' bytes but only ' + this.m1e_1.m().toString() + ' available');
715
+ }
716
+
717
+ return this.m1e_1;
718
+ case 6:
719
+ throw this.d9_1;
720
+ }
721
+ } catch ($p) {
722
+ var e = $p;
723
+ if (this.b9_1 === 6) {
724
+ throw e;
725
+ } else {
726
+ this.a9_1 = this.b9_1;
727
+ this.d9_1 = e;
728
+ }
729
+ }
730
+ while (true);
731
+ };
732
+ function $readAvailableCOROUTINE$8(_this__u8e3s4, buffer, offset, length, resultContinuation) {
733
+ CoroutineImpl.call(this, resultContinuation);
734
+ this.v1e_1 = _this__u8e3s4;
735
+ this.w1e_1 = buffer;
736
+ this.x1e_1 = offset;
737
+ this.y1e_1 = length;
738
+ }
739
+ protoOf($readAvailableCOROUTINE$8).i9 = function () {
740
+ var suspendResult = this.c9_1;
741
+ $sm: do
742
+ try {
743
+ var tmp = this.a9_1;
744
+ switch (tmp) {
745
+ case 0:
746
+ this.b9_1 = 3;
747
+ if (this.v1e_1.j1d())
748
+ return -1;
749
+ if (this.v1e_1.e1d().o19()) {
750
+ this.a9_1 = 1;
751
+ suspendResult = this.v1e_1.l1d(VOID, this);
752
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
753
+ return suspendResult;
754
+ }
755
+ continue $sm;
756
+ } else {
757
+ this.a9_1 = 2;
758
+ continue $sm;
759
+ }
760
+
761
+ case 1:
762
+ this.a9_1 = 2;
763
+ continue $sm;
764
+ case 2:
765
+ if (this.v1e_1.j1d())
766
+ return -1;
767
+ return readAvailable_0(this.v1e_1.e1d(), this.w1e_1, this.x1e_1, this.y1e_1);
768
+ case 3:
769
+ throw this.d9_1;
770
+ }
771
+ } catch ($p) {
772
+ var e = $p;
773
+ if (this.b9_1 === 3) {
774
+ throw e;
775
+ } else {
776
+ this.a9_1 = this.b9_1;
777
+ this.d9_1 = e;
778
+ }
779
+ }
780
+ while (true);
781
+ };
782
+ function $toByteArrayCOROUTINE$10(_this__u8e3s4, resultContinuation) {
783
+ CoroutineImpl.call(this, resultContinuation);
784
+ this.h1f_1 = _this__u8e3s4;
785
+ }
786
+ protoOf($toByteArrayCOROUTINE$10).i9 = function () {
787
+ var suspendResult = this.c9_1;
788
+ $sm: do
789
+ try {
790
+ var tmp = this.a9_1;
791
+ switch (tmp) {
792
+ case 0:
793
+ this.b9_1 = 2;
794
+ this.a9_1 = 1;
795
+ suspendResult = readBuffer(this.h1f_1, this);
796
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
797
+ return suspendResult;
798
+ }
799
+
800
+ continue $sm;
801
+ case 1:
802
+ var ARGUMENT = suspendResult;
803
+ return readBytes(ARGUMENT);
804
+ case 2:
805
+ throw this.d9_1;
806
+ }
807
+ } catch ($p) {
808
+ var e = $p;
809
+ if (this.b9_1 === 2) {
810
+ throw e;
811
+ } else {
812
+ this.a9_1 = this.b9_1;
813
+ this.d9_1 = e;
814
+ }
815
+ }
816
+ while (true);
817
+ };
818
+ function $copyToCOROUTINE$11(_this__u8e3s4, channel, limit, resultContinuation) {
819
+ CoroutineImpl.call(this, resultContinuation);
820
+ this.q1f_1 = _this__u8e3s4;
821
+ this.r1f_1 = channel;
822
+ this.s1f_1 = limit;
823
+ }
824
+ protoOf($copyToCOROUTINE$11).i9 = function () {
825
+ var suspendResult = this.c9_1;
826
+ $sm: do
827
+ try {
828
+ var tmp = this.a9_1;
829
+ switch (tmp) {
830
+ case 0:
831
+ this.b9_1 = 12;
832
+ this.t1f_1 = this.s1f_1;
833
+ this.a9_1 = 1;
834
+ continue $sm;
835
+ case 1:
836
+ this.b9_1 = 8;
837
+ this.b9_1 = 7;
838
+ this.a9_1 = 2;
839
+ continue $sm;
840
+ case 2:
841
+ if (!(!this.q1f_1.j1d() && this.t1f_1.z(new Long(0, 0)) > 0)) {
842
+ this.a9_1 = 6;
843
+ continue $sm;
844
+ }
845
+
846
+ if (this.q1f_1.e1d().o19()) {
847
+ this.a9_1 = 3;
848
+ suspendResult = this.q1f_1.l1d(VOID, this);
849
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
850
+ return suspendResult;
851
+ }
852
+ continue $sm;
853
+ } else {
854
+ this.a9_1 = 4;
855
+ continue $sm;
856
+ }
857
+
858
+ case 3:
859
+ this.a9_1 = 4;
860
+ continue $sm;
861
+ case 4:
862
+ var tmp_0 = this;
863
+ var a = this.t1f_1;
864
+ var b = get_remaining(this.q1f_1.e1d());
865
+ tmp_0.v1f_1 = a.z(b) <= 0 ? a : b;
866
+ this.q1f_1.e1d().g1a(this.r1f_1.g1d(), this.v1f_1);
867
+ this.t1f_1 = this.t1f_1.v2(this.v1f_1);
868
+ this.a9_1 = 5;
869
+ suspendResult = this.r1f_1.d1d(this);
870
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
871
+ return suspendResult;
872
+ }
873
+
874
+ continue $sm;
875
+ case 5:
876
+ this.a9_1 = 2;
877
+ continue $sm;
878
+ case 6:
879
+ this.u1f_1 = Unit_instance;
880
+ this.b9_1 = 12;
881
+ this.a9_1 = 10;
882
+ continue $sm;
883
+ case 7:
884
+ this.b9_1 = 8;
885
+ var tmp_1 = this.d9_1;
886
+ if (tmp_1 instanceof Error) {
887
+ this.w1f_1 = this.d9_1;
888
+ var tmp_2 = this;
889
+ this.q1f_1.o1d(this.w1f_1);
890
+ close(this.r1f_1, this.w1f_1);
891
+ throw this.w1f_1;
892
+ } else {
893
+ throw this.d9_1;
894
+ }
895
+
896
+ case 8:
897
+ this.b9_1 = 12;
898
+ this.x1f_1 = this.d9_1;
899
+ this.a9_1 = 9;
900
+ suspendResult = this.r1f_1.d1d(this);
901
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
902
+ return suspendResult;
903
+ }
904
+
905
+ continue $sm;
906
+ case 9:
907
+ throw this.x1f_1;
908
+ case 10:
909
+ this.b9_1 = 12;
910
+ this.a9_1 = 11;
911
+ suspendResult = this.r1f_1.d1d(this);
912
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
913
+ return suspendResult;
914
+ }
915
+
916
+ continue $sm;
917
+ case 11:
918
+ return this.s1f_1.v2(this.t1f_1);
919
+ case 12:
920
+ throw this.d9_1;
921
+ }
922
+ } catch ($p) {
923
+ var e = $p;
924
+ if (this.b9_1 === 12) {
925
+ throw e;
926
+ } else {
927
+ this.a9_1 = this.b9_1;
928
+ this.d9_1 = e;
929
+ }
930
+ }
931
+ while (true);
932
+ };
933
+ function $readBufferCOROUTINE$13(_this__u8e3s4, resultContinuation) {
934
+ CoroutineImpl.call(this, resultContinuation);
935
+ this.g1g_1 = _this__u8e3s4;
936
+ }
937
+ protoOf($readBufferCOROUTINE$13).i9 = function () {
938
+ var suspendResult = this.c9_1;
939
+ $sm: do
940
+ try {
941
+ var tmp = this.a9_1;
942
+ switch (tmp) {
943
+ case 0:
944
+ this.b9_1 = 4;
945
+ this.h1g_1 = new Buffer();
946
+ this.a9_1 = 1;
947
+ continue $sm;
948
+ case 1:
949
+ if (!!this.g1g_1.j1d()) {
950
+ this.a9_1 = 3;
951
+ continue $sm;
952
+ }
953
+
954
+ this.h1g_1.v1a(this.g1g_1.e1d());
955
+ this.a9_1 = 2;
956
+ suspendResult = this.g1g_1.l1d(VOID, this);
957
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
958
+ return suspendResult;
959
+ }
960
+
961
+ continue $sm;
962
+ case 2:
963
+ this.a9_1 = 1;
964
+ continue $sm;
965
+ case 3:
966
+ var tmp5_safe_receiver = this.g1g_1.f1d();
967
+ if (tmp5_safe_receiver == null)
968
+ null;
969
+ else {
970
+ throw tmp5_safe_receiver;
971
+ }
972
+
973
+ return this.h1g_1;
974
+ case 4:
975
+ throw this.d9_1;
976
+ }
977
+ } catch ($p) {
978
+ var e = $p;
979
+ if (this.b9_1 === 4) {
980
+ throw e;
981
+ } else {
982
+ this.a9_1 = this.b9_1;
983
+ this.d9_1 = e;
984
+ }
985
+ }
986
+ while (true);
987
+ };
988
+ function flushIfNeeded(_this__u8e3s4, $completion) {
989
+ var tmp = new $flushIfNeededCOROUTINE$15(_this__u8e3s4, $completion);
990
+ tmp.c9_1 = Unit_instance;
991
+ tmp.d9_1 = null;
992
+ return tmp.i9();
993
+ }
994
+ function $flushIfNeededCOROUTINE$15(_this__u8e3s4, resultContinuation) {
995
+ CoroutineImpl.call(this, resultContinuation);
996
+ this.q1g_1 = _this__u8e3s4;
997
+ }
998
+ protoOf($flushIfNeededCOROUTINE$15).i9 = function () {
999
+ var suspendResult = this.c9_1;
1000
+ $sm: do
1001
+ try {
1002
+ var tmp = this.a9_1;
1003
+ switch (tmp) {
1004
+ case 0:
1005
+ this.b9_1 = 3;
1006
+ rethrowCloseCauseIfNeeded_0(this.q1g_1);
1007
+ var tmp_0;
1008
+ var tmp_1 = this.q1g_1;
1009
+ var tmp10_safe_receiver = tmp_1 instanceof ByteChannel ? tmp_1 : null;
1010
+ if ((tmp10_safe_receiver == null ? null : tmp10_safe_receiver.j1b_1) === true) {
1011
+ tmp_0 = true;
1012
+ } else {
1013
+ tmp_0 = get_size(this.q1g_1.g1d()) >= get_CHANNEL_MAX_SIZE();
1014
+ }
1015
+
1016
+ if (tmp_0) {
1017
+ this.a9_1 = 1;
1018
+ suspendResult = this.q1g_1.d1d(this);
1019
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1020
+ return suspendResult;
1021
+ }
1022
+ continue $sm;
1023
+ } else {
1024
+ this.a9_1 = 2;
1025
+ continue $sm;
1026
+ }
1027
+
1028
+ case 1:
1029
+ this.a9_1 = 2;
1030
+ continue $sm;
1031
+ case 2:
1032
+ return Unit_instance;
1033
+ case 3:
1034
+ throw this.d9_1;
1035
+ }
1036
+ } catch ($p) {
1037
+ var e = $p;
1038
+ if (this.b9_1 === 3) {
1039
+ throw e;
1040
+ } else {
1041
+ this.a9_1 = this.b9_1;
1042
+ this.d9_1 = e;
1043
+ }
1044
+ }
1045
+ while (true);
1046
+ };
1047
+ function get_NO_CALLBACK() {
1048
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1049
+ return NO_CALLBACK;
1050
+ }
1051
+ var NO_CALLBACK;
1052
+ function WriterJob(channel, job) {
1053
+ this.r1g_1 = channel;
1054
+ this.s1g_1 = job;
1055
+ }
1056
+ protoOf(WriterJob).cu = function () {
1057
+ return this.s1g_1;
1058
+ };
1059
+ function writer(_this__u8e3s4, coroutineContext, autoFlush, block) {
1060
+ coroutineContext = coroutineContext === VOID ? EmptyCoroutineContext_getInstance() : coroutineContext;
1061
+ autoFlush = autoFlush === VOID ? false : autoFlush;
1062
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1063
+ return writer_0(_this__u8e3s4, coroutineContext, new ByteChannel(), block);
1064
+ }
1065
+ function WriterScope(channel, coroutineContext) {
1066
+ this.t1g_1 = channel;
1067
+ this.u1g_1 = coroutineContext;
1068
+ }
1069
+ protoOf(WriterScope).hm = function () {
1070
+ return this.u1g_1;
1071
+ };
1072
+ function writeFully(_this__u8e3s4, value, startIndex, endIndex, $completion) {
1073
+ startIndex = startIndex === VOID ? 0 : startIndex;
1074
+ endIndex = endIndex === VOID ? value.length : endIndex;
1075
+ _this__u8e3s4.g1d().n1a(value, startIndex, endIndex);
1076
+ return flushIfNeeded(_this__u8e3s4, $completion);
1077
+ }
1078
+ function writePacket(_this__u8e3s4, copy, $completion) {
1079
+ _this__u8e3s4.g1d().v1a(copy);
1080
+ return flushIfNeeded(_this__u8e3s4, $completion);
1081
+ }
1082
+ function close(_this__u8e3s4, cause) {
1083
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1084
+ if (cause == null) {
1085
+ fireAndForget(ByteWriteChannel$flushAndClose$ref_0(_this__u8e3s4));
1086
+ } else {
1087
+ _this__u8e3s4.o1d(cause);
1088
+ }
1089
+ }
1090
+ function invokeOnCompletion(_this__u8e3s4, block) {
1091
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1092
+ var tmp = _this__u8e3s4.cu();
1093
+ tmp.jn(invokeOnCompletion$lambda(block));
1094
+ }
1095
+ function writer_0(_this__u8e3s4, coroutineContext, channel, block) {
1096
+ coroutineContext = coroutineContext === VOID ? EmptyCoroutineContext_getInstance() : coroutineContext;
1097
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1098
+ // Inline function 'kotlin.apply' call
1099
+ var this_0 = launch(_this__u8e3s4, coroutineContext, VOID, writer$slambda_0(block, channel, null));
1100
+ // Inline function 'kotlin.contracts.contract' call
1101
+ // Inline function 'io.ktor.utils.io.writer.<anonymous>' call
1102
+ this_0.jn(writer$lambda(channel));
1103
+ var job = this_0;
1104
+ return new WriterJob(channel, job);
1105
+ }
1106
+ function fireAndForget(_this__u8e3s4) {
1107
+ _init_properties_ByteWriteChannelOperations_kt__i7slrs();
1108
+ startCoroutineCancellable(_this__u8e3s4, get_NO_CALLBACK());
1109
+ }
1110
+ function NO_CALLBACK$1() {
1111
+ }
1112
+ protoOf(NO_CALLBACK$1).g9 = function () {
1113
+ return EmptyCoroutineContext_getInstance();
1114
+ };
1115
+ protoOf(NO_CALLBACK$1).h9 = function (result) {
1116
+ };
1117
+ protoOf(NO_CALLBACK$1).l9 = function (result) {
1118
+ return this.h9(result);
1119
+ };
1120
+ function ByteWriteChannel$flushAndClose$ref($boundThis) {
1121
+ this.v1g_1 = $boundThis;
1122
+ }
1123
+ protoOf(ByteWriteChannel$flushAndClose$ref).w1g = function ($completion) {
1124
+ return this.v1g_1.n1d($completion);
1125
+ };
1126
+ protoOf(ByteWriteChannel$flushAndClose$ref).pa = function ($completion) {
1127
+ return this.w1g($completion);
1128
+ };
1129
+ function ByteWriteChannel$flushAndClose$ref_0($boundThis) {
1130
+ var i = new ByteWriteChannel$flushAndClose$ref($boundThis);
1131
+ var l = function ($completion) {
1132
+ return i.w1g($completion);
1133
+ };
1134
+ l.callableName = 'flushAndClose';
1135
+ l.$arity = 0;
1136
+ return l;
1137
+ }
1138
+ function invokeOnCompletion$lambda($block) {
1139
+ return function (it) {
1140
+ $block();
1141
+ return Unit_instance;
1142
+ };
1143
+ }
1144
+ function writer$slambda($block, $channel, resultContinuation) {
1145
+ this.f1h_1 = $block;
1146
+ this.g1h_1 = $channel;
1147
+ CoroutineImpl.call(this, resultContinuation);
1148
+ }
1149
+ protoOf(writer$slambda).w1h = function ($this$launch, $completion) {
1150
+ var tmp = this.x1h($this$launch, $completion);
1151
+ tmp.c9_1 = Unit_instance;
1152
+ tmp.d9_1 = null;
1153
+ return tmp.i9();
1154
+ };
1155
+ protoOf(writer$slambda).s9 = function (p1, $completion) {
1156
+ return this.w1h((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
1157
+ };
1158
+ protoOf(writer$slambda).i9 = function () {
1159
+ var suspendResult = this.c9_1;
1160
+ $sm: do
1161
+ try {
1162
+ var tmp = this.a9_1;
1163
+ switch (tmp) {
1164
+ case 0:
1165
+ this.b9_1 = 14;
1166
+ this.i1h_1 = Job(get_job(this.h1h_1.hm()));
1167
+ this.a9_1 = 1;
1168
+ continue $sm;
1169
+ case 1:
1170
+ this.b9_1 = 4;
1171
+ this.b9_1 = 3;
1172
+ this.a9_1 = 2;
1173
+ suspendResult = this.f1h_1(new WriterScope(this.g1h_1, this.h1h_1.hm().xg(this.i1h_1)), this);
1174
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1175
+ return suspendResult;
1176
+ }
1177
+
1178
+ continue $sm;
1179
+ case 2:
1180
+ this.i1h_1.gs();
1181
+ var tmp_0 = this;
1182
+ var tmp_1;
1183
+ if (get_job(this.h1h_1.hm()).dn()) {
1184
+ this.g1h_1.o1d(get_job(this.h1h_1.hm()).gn());
1185
+ tmp_1 = Unit_instance;
1186
+ }
1187
+
1188
+ tmp_0.j1h_1 = tmp_1;
1189
+ this.b9_1 = 14;
1190
+ this.a9_1 = 9;
1191
+ continue $sm;
1192
+ case 3:
1193
+ this.b9_1 = 4;
1194
+ var tmp_2 = this.d9_1;
1195
+ if (tmp_2 instanceof Error) {
1196
+ this.k1h_1 = this.d9_1;
1197
+ var tmp_3 = this;
1198
+ cancel(this.i1h_1, 'Exception thrown while writing to channel', this.k1h_1);
1199
+ this.g1h_1.o1d(this.k1h_1);
1200
+ tmp_3.j1h_1 = Unit_instance;
1201
+ this.b9_1 = 14;
1202
+ this.a9_1 = 9;
1203
+ continue $sm;
1204
+ } else {
1205
+ throw this.d9_1;
1206
+ }
1207
+
1208
+ case 4:
1209
+ this.b9_1 = 14;
1210
+ this.l1h_1 = this.d9_1;
1211
+ this.a9_1 = 5;
1212
+ suspendResult = this.i1h_1.hs(this);
1213
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1214
+ return suspendResult;
1215
+ }
1216
+
1217
+ continue $sm;
1218
+ case 5:
1219
+ var tmp_4 = this;
1220
+ tmp_4.m1h_1 = this.h1h_1;
1221
+ this.b9_1 = 7;
1222
+ var tmp_5 = this;
1223
+ tmp_5.o1h_1 = Companion_instance;
1224
+ var tmp_6 = this;
1225
+ tmp_6.p1h_1 = this.m1h_1;
1226
+ this.a9_1 = 6;
1227
+ suspendResult = this.g1h_1.n1d(this);
1228
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1229
+ return suspendResult;
1230
+ }
1231
+
1232
+ continue $sm;
1233
+ case 6:
1234
+ var tmp_7 = this;
1235
+ tmp_7.q1h_1 = Unit_instance;
1236
+ this.n1h_1 = _Result___init__impl__xyqfz8(this.q1h_1);
1237
+ this.b9_1 = 14;
1238
+ this.a9_1 = 8;
1239
+ continue $sm;
1240
+ case 7:
1241
+ this.b9_1 = 14;
1242
+ var tmp_8 = this.d9_1;
1243
+ if (tmp_8 instanceof Error) {
1244
+ this.r1h_1 = this.d9_1;
1245
+ var tmp_9 = this;
1246
+ var exception = this.r1h_1;
1247
+ tmp_9.n1h_1 = _Result___init__impl__xyqfz8(createFailure(exception));
1248
+ this.a9_1 = 8;
1249
+ continue $sm;
1250
+ } else {
1251
+ throw this.d9_1;
1252
+ }
1253
+
1254
+ case 8:
1255
+ this.b9_1 = 14;
1256
+ throw this.l1h_1;
1257
+ case 9:
1258
+ this.b9_1 = 14;
1259
+ this.a9_1 = 10;
1260
+ suspendResult = this.i1h_1.hs(this);
1261
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1262
+ return suspendResult;
1263
+ }
1264
+
1265
+ continue $sm;
1266
+ case 10:
1267
+ var tmp_10 = this;
1268
+ tmp_10.s1h_1 = this.h1h_1;
1269
+ this.b9_1 = 12;
1270
+ var tmp_11 = this;
1271
+ tmp_11.u1h_1 = Companion_instance;
1272
+ var tmp_12 = this;
1273
+ tmp_12.v1h_1 = this.s1h_1;
1274
+ this.a9_1 = 11;
1275
+ suspendResult = this.g1h_1.n1d(this);
1276
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1277
+ return suspendResult;
1278
+ }
1279
+
1280
+ continue $sm;
1281
+ case 11:
1282
+ this.t1h_1 = _Result___init__impl__xyqfz8(Unit_instance);
1283
+ this.b9_1 = 14;
1284
+ this.a9_1 = 13;
1285
+ continue $sm;
1286
+ case 12:
1287
+ this.b9_1 = 14;
1288
+ var tmp_13 = this.d9_1;
1289
+ if (tmp_13 instanceof Error) {
1290
+ var e = this.d9_1;
1291
+ var tmp_14 = this;
1292
+ tmp_14.t1h_1 = _Result___init__impl__xyqfz8(createFailure(e));
1293
+ this.a9_1 = 13;
1294
+ continue $sm;
1295
+ } else {
1296
+ throw this.d9_1;
1297
+ }
1298
+
1299
+ case 13:
1300
+ this.b9_1 = 14;
1301
+ return Unit_instance;
1302
+ case 14:
1303
+ throw this.d9_1;
1304
+ }
1305
+ } catch ($p) {
1306
+ var e_0 = $p;
1307
+ if (this.b9_1 === 14) {
1308
+ throw e_0;
1309
+ } else {
1310
+ this.a9_1 = this.b9_1;
1311
+ this.d9_1 = e_0;
1312
+ }
1313
+ }
1314
+ while (true);
1315
+ };
1316
+ protoOf(writer$slambda).x1h = function ($this$launch, completion) {
1317
+ var i = new writer$slambda(this.f1h_1, this.g1h_1, completion);
1318
+ i.h1h_1 = $this$launch;
1319
+ return i;
1320
+ };
1321
+ function writer$slambda_0($block, $channel, resultContinuation) {
1322
+ var i = new writer$slambda($block, $channel, resultContinuation);
1323
+ var l = function ($this$launch, $completion) {
1324
+ return i.w1h($this$launch, $completion);
1325
+ };
1326
+ l.$arity = 1;
1327
+ return l;
1328
+ }
1329
+ function writer$lambda($channel) {
1330
+ return function (it) {
1331
+ var tmp;
1332
+ if (!(it == null) && !$channel.h1d()) {
1333
+ $channel.o1d(it);
1334
+ tmp = Unit_instance;
1335
+ }
1336
+ return Unit_instance;
1337
+ };
1338
+ }
1339
+ var properties_initialized_ByteWriteChannelOperations_kt_acrf6u;
1340
+ function _init_properties_ByteWriteChannelOperations_kt__i7slrs() {
1341
+ if (!properties_initialized_ByteWriteChannelOperations_kt_acrf6u) {
1342
+ properties_initialized_ByteWriteChannelOperations_kt_acrf6u = true;
1343
+ NO_CALLBACK = new NO_CALLBACK$1();
1344
+ }
1345
+ }
1346
+ function get_CLOSED() {
1347
+ _init_properties_CloseToken_kt__9ucr41();
1348
+ return CLOSED;
1349
+ }
1350
+ var CLOSED;
1351
+ function CloseToken(origin) {
1352
+ var tmp = this;
1353
+ var tmp_0;
1354
+ if (origin == null) {
1355
+ tmp_0 = null;
1356
+ } else {
1357
+ if (origin instanceof CancellationException) {
1358
+ var tmp_1;
1359
+ if (isInterface(origin, CopyableThrowable)) {
1360
+ tmp_1 = origin.rs();
1361
+ } else {
1362
+ var tmp0_elvis_lhs = origin.message;
1363
+ tmp_1 = CancellationException_init_$Create$(tmp0_elvis_lhs == null ? 'Channel was cancelled' : tmp0_elvis_lhs, origin);
1364
+ }
1365
+ tmp_0 = tmp_1;
1366
+ } else {
1367
+ var tmp_2;
1368
+ if (origin instanceof IOException) {
1369
+ tmp_2 = isInterface(origin, CopyableThrowable);
1370
+ } else {
1371
+ tmp_2 = false;
1372
+ }
1373
+ if (tmp_2) {
1374
+ tmp_0 = origin.rs();
1375
+ } else {
1376
+ var tmp1_elvis_lhs = origin.message;
1377
+ tmp_0 = IOException_init_$Create$_0(tmp1_elvis_lhs == null ? 'Channel was closed' : tmp1_elvis_lhs, origin);
1378
+ }
1379
+ }
1380
+ }
1381
+ tmp.i1d_1 = tmp_0;
1382
+ }
1383
+ protoOf(CloseToken).r9 = function () {
1384
+ var tmp;
1385
+ if (this.i1d_1 == null) {
1386
+ tmp = null;
1387
+ } else {
1388
+ var tmp_0 = this.i1d_1;
1389
+ if (tmp_0 instanceof IOException) {
1390
+ var tmp_1;
1391
+ var tmp_2 = this.i1d_1;
1392
+ if (isInterface(tmp_2, CopyableThrowable)) {
1393
+ tmp_1 = this.i1d_1.rs();
1394
+ } else {
1395
+ tmp_1 = IOException_init_$Create$_0(this.i1d_1.message, this.i1d_1);
1396
+ }
1397
+ tmp = tmp_1;
1398
+ } else {
1399
+ var tmp_3 = this.i1d_1;
1400
+ if (!(tmp_3 == null) ? isInterface(tmp_3, CopyableThrowable) : false) {
1401
+ var tmp0_elvis_lhs = this.i1d_1.rs();
1402
+ tmp = tmp0_elvis_lhs == null ? CancellationException_init_$Create$(this.i1d_1.message, this.i1d_1) : tmp0_elvis_lhs;
1403
+ } else {
1404
+ tmp = CancellationException_init_$Create$(this.i1d_1.message, this.i1d_1);
1405
+ }
1406
+ }
1407
+ }
1408
+ return tmp;
1409
+ };
1410
+ var properties_initialized_CloseToken_kt_lgg8zn;
1411
+ function _init_properties_CloseToken_kt__9ucr41() {
1412
+ if (!properties_initialized_CloseToken_kt_lgg8zn) {
1413
+ properties_initialized_CloseToken_kt_lgg8zn = true;
1414
+ CLOSED = new CloseToken(null);
1415
+ }
1416
+ }
1417
+ function release(_this__u8e3s4) {
1418
+ _this__u8e3s4.a1b();
1419
+ }
1420
+ function readText(_this__u8e3s4) {
1421
+ return readString(_this__u8e3s4);
1422
+ }
1423
+ function SourceByteReadChannel(source) {
1424
+ this.y1h_1 = source;
1425
+ this.z1h_1 = null;
1426
+ }
1427
+ protoOf(SourceByteReadChannel).f1d = function () {
1428
+ var tmp11_safe_receiver = this.z1h_1;
1429
+ return tmp11_safe_receiver == null ? null : tmp11_safe_receiver.r9();
1430
+ };
1431
+ protoOf(SourceByteReadChannel).j1d = function () {
1432
+ return this.y1h_1.o19();
1433
+ };
1434
+ protoOf(SourceByteReadChannel).e1d = function () {
1435
+ var tmp12_safe_receiver = this.f1d();
1436
+ if (tmp12_safe_receiver == null)
1437
+ null;
1438
+ else {
1439
+ // Inline function 'kotlin.let' call
1440
+ // Inline function 'kotlin.contracts.contract' call
1441
+ throw tmp12_safe_receiver;
1442
+ }
1443
+ return this.y1h_1;
1444
+ };
1445
+ protoOf(SourceByteReadChannel).k1d = function (min, $completion) {
1446
+ var tmp13_safe_receiver = this.f1d();
1447
+ if (tmp13_safe_receiver == null)
1448
+ null;
1449
+ else {
1450
+ // Inline function 'kotlin.let' call
1451
+ // Inline function 'kotlin.contracts.contract' call
1452
+ throw tmp13_safe_receiver;
1453
+ }
1454
+ return false;
1455
+ };
1456
+ protoOf(SourceByteReadChannel).o1d = function (cause) {
1457
+ if (!(this.z1h_1 == null))
1458
+ return Unit_instance;
1459
+ this.y1h_1.a1b();
1460
+ var tmp = this;
1461
+ var tmp0_elvis_lhs = cause == null ? null : cause.message;
1462
+ tmp.z1h_1 = new CloseToken(IOException_init_$Create$_0(tmp0_elvis_lhs == null ? 'Channel was cancelled' : tmp0_elvis_lhs, cause));
1463
+ };
1464
+ function decode(_this__u8e3s4, input, max) {
1465
+ max = max === VOID ? 2147483647 : max;
1466
+ // Inline function 'kotlin.text.buildString' call
1467
+ // Inline function 'kotlin.comparisons.minOf' call
1468
+ var a = toLong(max);
1469
+ var b = input.n19().m();
1470
+ var capacity = (a.z(b) <= 0 ? a : b).e1();
1471
+ // Inline function 'kotlin.contracts.contract' call
1472
+ // Inline function 'kotlin.apply' call
1473
+ var this_0 = StringBuilder_init_$Create$(capacity);
1474
+ // Inline function 'kotlin.contracts.contract' call
1475
+ // Inline function 'io.ktor.utils.io.charsets.decode.<anonymous>' call
1476
+ decode_0(_this__u8e3s4, input, this_0, max);
1477
+ return this_0.toString();
1478
+ }
1479
+ function encodeToImpl(_this__u8e3s4, destination, input, fromIndex, toIndex) {
1480
+ var start = fromIndex;
1481
+ if (start >= toIndex)
1482
+ return Unit_instance;
1483
+ $l$loop: while (true) {
1484
+ var rc = encodeImpl(_this__u8e3s4, input, start, toIndex, destination);
1485
+ // Inline function 'kotlin.check' call
1486
+ // Inline function 'kotlin.contracts.contract' call
1487
+ // Inline function 'kotlin.check' call
1488
+ // Inline function 'kotlin.contracts.contract' call
1489
+ if (!(rc >= 0)) {
1490
+ // Inline function 'kotlin.check.<anonymous>' call
1491
+ var message = 'Check failed.';
1492
+ throw IllegalStateException_init_$Create$(toString(message));
1493
+ }
1494
+ start = start + rc | 0;
1495
+ if (start >= toIndex)
1496
+ break $l$loop;
1497
+ }
1498
+ }
1499
+ function encode(_this__u8e3s4, input, fromIndex, toIndex) {
1500
+ fromIndex = fromIndex === VOID ? 0 : fromIndex;
1501
+ toIndex = toIndex === VOID ? charSequenceLength(input) : toIndex;
1502
+ // Inline function 'io.ktor.utils.io.core.buildPacket' call
1503
+ var builder = new Buffer();
1504
+ // Inline function 'io.ktor.utils.io.charsets.encode.<anonymous>' call
1505
+ encodeToImpl(_this__u8e3s4, builder, input, fromIndex, toIndex);
1506
+ return builder;
1507
+ }
1508
+ function canRead(_this__u8e3s4) {
1509
+ return !_this__u8e3s4.o19();
1510
+ }
1511
+ function readBytes(_this__u8e3s4, count) {
1512
+ count = count === VOID ? _this__u8e3s4.m().e1() : count;
1513
+ return readByteArray(_this__u8e3s4, count);
1514
+ }
1515
+ function BytePacketBuilder() {
1516
+ return new Buffer();
1517
+ }
1518
+ function writePacket_0(_this__u8e3s4, packet) {
1519
+ _this__u8e3s4.v1a(packet);
1520
+ }
1521
+ function build(_this__u8e3s4) {
1522
+ return _this__u8e3s4.n19();
1523
+ }
1524
+ function get_size(_this__u8e3s4) {
1525
+ return _this__u8e3s4.n19().m().e1();
1526
+ }
1527
+ function writeFully_0(_this__u8e3s4, buffer, offset, length) {
1528
+ offset = offset === VOID ? 0 : offset;
1529
+ length = length === VOID ? buffer.length - offset | 0 : length;
1530
+ _this__u8e3s4.n1a(buffer, offset, offset + length | 0);
1531
+ }
1532
+ var ByteReadPacketEmpty;
1533
+ function copy(_this__u8e3s4) {
1534
+ _init_properties_ByteReadPacket_kt__28475y();
1535
+ return _this__u8e3s4.n19().y1a();
1536
+ }
1537
+ function get_remaining(_this__u8e3s4) {
1538
+ _init_properties_ByteReadPacket_kt__28475y();
1539
+ return _this__u8e3s4.n19().m();
1540
+ }
1541
+ function discard(_this__u8e3s4, count) {
1542
+ count = count === VOID ? new Long(-1, 2147483647) : count;
1543
+ _init_properties_ByteReadPacket_kt__28475y();
1544
+ _this__u8e3s4.q19(count);
1545
+ // Inline function 'kotlin.comparisons.minOf' call
1546
+ var b = get_remaining(_this__u8e3s4);
1547
+ var countToDiscard = count.z(b) <= 0 ? count : b;
1548
+ _this__u8e3s4.n19().c1a(countToDiscard);
1549
+ return countToDiscard;
1550
+ }
1551
+ function takeWhile(_this__u8e3s4, block) {
1552
+ _init_properties_ByteReadPacket_kt__28475y();
1553
+ while (!get_isEmpty(_this__u8e3s4) && block(_this__u8e3s4.n19())) {
1554
+ }
1555
+ }
1556
+ var properties_initialized_ByteReadPacket_kt_hw4st4;
1557
+ function _init_properties_ByteReadPacket_kt__28475y() {
1558
+ if (!properties_initialized_ByteReadPacket_kt_hw4st4) {
1559
+ properties_initialized_ByteReadPacket_kt_hw4st4 = true;
1560
+ ByteReadPacketEmpty = new Buffer();
1561
+ }
1562
+ }
1563
+ function readAvailable_0(_this__u8e3s4, buffer, offset, length) {
1564
+ offset = offset === VOID ? 0 : offset;
1565
+ length = length === VOID ? buffer.length - offset | 0 : length;
1566
+ var result = _this__u8e3s4.d1a(buffer, offset, offset + length | 0);
1567
+ return result === -1 ? 0 : result;
1568
+ }
1569
+ function get_isEmpty(_this__u8e3s4) {
1570
+ return _this__u8e3s4.o19();
1571
+ }
1572
+ function readText_0(_this__u8e3s4, charset, max) {
1573
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
1574
+ max = max === VOID ? 2147483647 : max;
1575
+ if (charset.equals(Charsets_getInstance().a1i_1)) {
1576
+ if (max === 2147483647)
1577
+ return readString(_this__u8e3s4);
1578
+ // Inline function 'kotlin.math.min' call
1579
+ var a = _this__u8e3s4.n19().m();
1580
+ var b = toLong(max);
1581
+ var count = a.z(b) <= 0 ? a : b;
1582
+ return readString_0(_this__u8e3s4, count);
1583
+ }
1584
+ return decode(charset.d1i(), _this__u8e3s4, max);
1585
+ }
1586
+ function readBytes_0(_this__u8e3s4) {
1587
+ return readByteArray_0(_this__u8e3s4);
1588
+ }
1589
+ function toByteArray_0(_this__u8e3s4, charset) {
1590
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
1591
+ if (charset.equals(Charsets_getInstance().a1i_1))
1592
+ return encodeToByteArray(_this__u8e3s4, VOID, VOID, true);
1593
+ return encodeToByteArray_0(charset.e1i(), _this__u8e3s4, 0, _this__u8e3s4.length);
1594
+ }
1595
+ function writeText(_this__u8e3s4, text, fromIndex, toIndex, charset) {
1596
+ fromIndex = fromIndex === VOID ? 0 : fromIndex;
1597
+ toIndex = toIndex === VOID ? charSequenceLength(text) : toIndex;
1598
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
1599
+ if (charset === Charsets_getInstance().a1i_1) {
1600
+ return writeString(_this__u8e3s4, toString(text), fromIndex, toIndex);
1601
+ }
1602
+ encodeToImpl(charset.e1i(), _this__u8e3s4, text, fromIndex, toIndex);
1603
+ }
1604
+ function String_0(bytes, offset, length, charset) {
1605
+ offset = offset === VOID ? 0 : offset;
1606
+ length = length === VOID ? bytes.length : length;
1607
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
1608
+ var tmp;
1609
+ if (charset.equals(Charsets_getInstance().a1i_1)) {
1610
+ tmp = decodeToString(bytes, offset, offset + length | 0);
1611
+ } else {
1612
+ // Inline function 'io.ktor.utils.io.core.buildPacket' call
1613
+ var builder = new Buffer();
1614
+ // Inline function 'io.ktor.utils.io.core.String.<anonymous>' call
1615
+ writeFully_0(builder, bytes, offset, length);
1616
+ tmp = readText_0(builder, charset);
1617
+ }
1618
+ return tmp;
1619
+ }
1620
+ function get_CLOSED_0() {
1621
+ _init_properties_AwaitingSlot_kt__kf2gs6();
1622
+ return CLOSED_0;
1623
+ }
1624
+ var CLOSED_0;
1625
+ function ClosedSlot(cause) {
1626
+ this.f1i_1 = cause;
1627
+ this.g1i_1 = EmptyCoroutineContext_getInstance();
1628
+ this.h1i_1 = false;
1629
+ this.i1i_1 = !(this.f1i_1 == null);
1630
+ this.j1i_1 = true;
1631
+ }
1632
+ protoOf(ClosedSlot).g9 = function () {
1633
+ return this.g1i_1;
1634
+ };
1635
+ protoOf(ClosedSlot).dn = function () {
1636
+ return this.i1i_1;
1637
+ };
1638
+ protoOf(ClosedSlot).hp = function (token) {
1639
+ this.k1i();
1640
+ };
1641
+ protoOf(ClosedSlot).ip = function (handler) {
1642
+ return Unit_instance;
1643
+ };
1644
+ protoOf(ClosedSlot).l1i = function (_this__u8e3s4, value) {
1645
+ this.k1i();
1646
+ };
1647
+ protoOf(ClosedSlot).jp = function (_this__u8e3s4, value) {
1648
+ return this.l1i(_this__u8e3s4, value instanceof Unit ? value : THROW_CCE());
1649
+ };
1650
+ protoOf(ClosedSlot).m1i = function (value, idempotent, onCancellation) {
1651
+ this.k1i();
1652
+ return null;
1653
+ };
1654
+ protoOf(ClosedSlot).gp = function (value, idempotent, onCancellation) {
1655
+ return this.m1i(value instanceof Unit ? value : THROW_CCE(), idempotent, onCancellation);
1656
+ };
1657
+ protoOf(ClosedSlot).n1i = function (value, onCancellation) {
1658
+ return this.k1i();
1659
+ };
1660
+ protoOf(ClosedSlot).kp = function (value, onCancellation) {
1661
+ return this.n1i(value instanceof Unit ? value : THROW_CCE(), onCancellation);
1662
+ };
1663
+ protoOf(ClosedSlot).o1i = function (result) {
1664
+ return this.k1i();
1665
+ };
1666
+ protoOf(ClosedSlot).l9 = function (result) {
1667
+ return this.o1i(result);
1668
+ };
1669
+ protoOf(ClosedSlot).hashCode = function () {
1670
+ return 777;
1671
+ };
1672
+ protoOf(ClosedSlot).k1i = function () {
1673
+ if (!(this.f1i_1 == null))
1674
+ throw this.f1i_1;
1675
+ };
1676
+ var properties_initialized_AwaitingSlot_kt_eetyxg;
1677
+ function _init_properties_AwaitingSlot_kt__kf2gs6() {
1678
+ if (!properties_initialized_AwaitingSlot_kt_eetyxg) {
1679
+ properties_initialized_AwaitingSlot_kt_eetyxg = true;
1680
+ CLOSED_0 = new ClosedSlot(null);
1681
+ }
1682
+ }
1683
+ function get_ByteArrayPool() {
1684
+ _init_properties_ByteArrayPool_kt__kfi3uj();
1685
+ return ByteArrayPool;
1686
+ }
1687
+ var ByteArrayPool;
1688
+ function ByteArrayPool$1() {
1689
+ DefaultPool.call(this, 128);
1690
+ }
1691
+ protoOf(ByteArrayPool$1).s1i = function () {
1692
+ return new Int8Array(4096);
1693
+ };
1694
+ var properties_initialized_ByteArrayPool_kt_td6pfh;
1695
+ function _init_properties_ByteArrayPool_kt__kfi3uj() {
1696
+ if (!properties_initialized_ByteArrayPool_kt_td6pfh) {
1697
+ properties_initialized_ByteArrayPool_kt_td6pfh = true;
1698
+ ByteArrayPool = new ByteArrayPool$1();
1699
+ }
1700
+ }
1701
+ function Companion_0() {
1702
+ }
1703
+ protoOf(Companion_0).b1j = function (name) {
1704
+ switch (name) {
1705
+ case 'UTF-8':
1706
+ case 'utf-8':
1707
+ case 'UTF8':
1708
+ case 'utf8':
1709
+ return Charsets_getInstance().a1i_1;
1710
+ }
1711
+ var tmp;
1712
+ var tmp_0;
1713
+ var tmp_1;
1714
+ switch (name) {
1715
+ case 'ISO-8859-1':
1716
+ case 'iso-8859-1':
1717
+ tmp_1 = true;
1718
+ break;
1719
+ default:
1720
+ // Inline function 'kotlin.let' call
1721
+
1722
+ // Inline function 'kotlin.contracts.contract' call
1723
+
1724
+ // Inline function 'io.ktor.utils.io.charsets.Companion.forName.<anonymous>' call
1725
+
1726
+ var it = replace(name, _Char___init__impl__6a9atx(95), _Char___init__impl__6a9atx(45));
1727
+ var tmp_2;
1728
+ if (it === 'iso-8859-1') {
1729
+ tmp_2 = true;
1730
+ } else {
1731
+ // Inline function 'kotlin.text.lowercase' call
1732
+ // Inline function 'kotlin.js.asDynamic' call
1733
+ tmp_2 = it.toLowerCase() === 'iso-8859-1';
1734
+ }
1735
+
1736
+ tmp_1 = tmp_2;
1737
+ break;
1738
+ }
1739
+ if (tmp_1) {
1740
+ tmp_0 = true;
1741
+ } else {
1742
+ tmp_0 = name === 'latin1';
1743
+ }
1744
+ if (tmp_0) {
1745
+ tmp = true;
1746
+ } else {
1747
+ tmp = name === 'Latin1';
1748
+ }
1749
+ if (tmp) {
1750
+ return Charsets_getInstance().b1i_1;
1751
+ }
1752
+ throw IllegalArgumentException_init_$Create$('Charset ' + name + ' is not supported');
1753
+ };
1754
+ protoOf(Companion_0).c1j = function (charset) {
1755
+ var tmp;
1756
+ switch (charset) {
1757
+ case 'UTF-8':
1758
+ case 'utf-8':
1759
+ case 'UTF8':
1760
+ case 'utf8':
1761
+ tmp = true;
1762
+ break;
1763
+ default:
1764
+ var tmp_0;
1765
+ var tmp_1;
1766
+ switch (charset) {
1767
+ case 'ISO-8859-1':
1768
+ case 'iso-8859-1':
1769
+ tmp_1 = true;
1770
+ break;
1771
+ default:
1772
+ // Inline function 'kotlin.let' call
1773
+
1774
+ // Inline function 'kotlin.contracts.contract' call
1775
+
1776
+ // Inline function 'io.ktor.utils.io.charsets.Companion.isSupported.<anonymous>' call
1777
+
1778
+ var it = replace(charset, _Char___init__impl__6a9atx(95), _Char___init__impl__6a9atx(45));
1779
+ var tmp_2;
1780
+ if (it === 'iso-8859-1') {
1781
+ tmp_2 = true;
1782
+ } else {
1783
+ // Inline function 'kotlin.text.lowercase' call
1784
+ // Inline function 'kotlin.js.asDynamic' call
1785
+ tmp_2 = it.toLowerCase() === 'iso-8859-1';
1786
+ }
1787
+
1788
+ tmp_1 = tmp_2;
1789
+ break;
1790
+ }
1791
+
1792
+ if (tmp_1) {
1793
+ tmp_0 = true;
1794
+ } else {
1795
+ tmp_0 = charset === 'latin1';
1796
+ }
1797
+
1798
+ if (tmp_0) {
1799
+ tmp = true;
1800
+ } else {
1801
+ tmp = false;
1802
+ }
1803
+
1804
+ break;
1805
+ }
1806
+ return tmp;
1807
+ };
1808
+ var Companion_instance_1;
1809
+ function Companion_getInstance_0() {
1810
+ return Companion_instance_1;
1811
+ }
1812
+ function Charset(_name) {
1813
+ this.c1i_1 = _name;
1814
+ }
1815
+ protoOf(Charset).equals = function (other) {
1816
+ if (this === other)
1817
+ return true;
1818
+ if (other == null || !(this.constructor == other.constructor))
1819
+ return false;
1820
+ if (!(other instanceof Charset))
1821
+ THROW_CCE();
1822
+ return this.c1i_1 === other.c1i_1;
1823
+ };
1824
+ protoOf(Charset).hashCode = function () {
1825
+ return getStringHashCode(this.c1i_1);
1826
+ };
1827
+ protoOf(Charset).toString = function () {
1828
+ return this.c1i_1;
1829
+ };
1830
+ function get_name(_this__u8e3s4) {
1831
+ return _this__u8e3s4.c1i_1;
1832
+ }
1833
+ function Charsets() {
1834
+ Charsets_instance = this;
1835
+ this.a1i_1 = new CharsetImpl('UTF-8');
1836
+ this.b1i_1 = new CharsetImpl('ISO-8859-1');
1837
+ }
1838
+ var Charsets_instance;
1839
+ function Charsets_getInstance() {
1840
+ if (Charsets_instance == null)
1841
+ new Charsets();
1842
+ return Charsets_instance;
1843
+ }
1844
+ function MalformedInputException(message) {
1845
+ IOException_init_$Init$(message, this);
1846
+ captureStack(this, MalformedInputException);
1847
+ }
1848
+ function CharsetDecoder(_charset) {
1849
+ this.d1j_1 = _charset;
1850
+ }
1851
+ function CharsetEncoder(_charset) {
1852
+ this.e1j_1 = _charset;
1853
+ }
1854
+ function CharsetImpl(name) {
1855
+ Charset.call(this, name);
1856
+ this.g1j_1 = name;
1857
+ }
1858
+ protoOf(CharsetImpl).e1i = function () {
1859
+ return new CharsetEncoderImpl(this);
1860
+ };
1861
+ protoOf(CharsetImpl).d1i = function () {
1862
+ return new CharsetDecoderImpl(this);
1863
+ };
1864
+ protoOf(CharsetImpl).toString = function () {
1865
+ return 'CharsetImpl(name=' + this.g1j_1 + ')';
1866
+ };
1867
+ protoOf(CharsetImpl).hashCode = function () {
1868
+ return getStringHashCode(this.g1j_1);
1869
+ };
1870
+ protoOf(CharsetImpl).equals = function (other) {
1871
+ if (this === other)
1872
+ return true;
1873
+ if (!(other instanceof CharsetImpl))
1874
+ return false;
1875
+ var tmp0_other_with_cast = other instanceof CharsetImpl ? other : THROW_CCE();
1876
+ if (!(this.g1j_1 === tmp0_other_with_cast.g1j_1))
1877
+ return false;
1878
+ return true;
1879
+ };
1880
+ function CharsetEncoderImpl(charset) {
1881
+ CharsetEncoder.call(this, charset);
1882
+ this.i1j_1 = charset;
1883
+ }
1884
+ protoOf(CharsetEncoderImpl).toString = function () {
1885
+ return 'CharsetEncoderImpl(charset=' + this.i1j_1.toString() + ')';
1886
+ };
1887
+ protoOf(CharsetEncoderImpl).hashCode = function () {
1888
+ return this.i1j_1.hashCode();
1889
+ };
1890
+ protoOf(CharsetEncoderImpl).equals = function (other) {
1891
+ if (this === other)
1892
+ return true;
1893
+ if (!(other instanceof CharsetEncoderImpl))
1894
+ return false;
1895
+ var tmp0_other_with_cast = other instanceof CharsetEncoderImpl ? other : THROW_CCE();
1896
+ if (!this.i1j_1.equals(tmp0_other_with_cast.i1j_1))
1897
+ return false;
1898
+ return true;
1899
+ };
1900
+ function CharsetDecoderImpl(charset) {
1901
+ CharsetDecoder.call(this, charset);
1902
+ this.k1j_1 = charset;
1903
+ }
1904
+ protoOf(CharsetDecoderImpl).toString = function () {
1905
+ return 'CharsetDecoderImpl(charset=' + this.k1j_1.toString() + ')';
1906
+ };
1907
+ protoOf(CharsetDecoderImpl).hashCode = function () {
1908
+ return this.k1j_1.hashCode();
1909
+ };
1910
+ protoOf(CharsetDecoderImpl).equals = function (other) {
1911
+ if (this === other)
1912
+ return true;
1913
+ if (!(other instanceof CharsetDecoderImpl))
1914
+ return false;
1915
+ var tmp0_other_with_cast = other instanceof CharsetDecoderImpl ? other : THROW_CCE();
1916
+ if (!this.k1j_1.equals(tmp0_other_with_cast.k1j_1))
1917
+ return false;
1918
+ return true;
1919
+ };
1920
+ function encodeToByteArray_0(_this__u8e3s4, input, fromIndex, toIndex) {
1921
+ fromIndex = fromIndex === VOID ? 0 : fromIndex;
1922
+ toIndex = toIndex === VOID ? charSequenceLength(input) : toIndex;
1923
+ return encodeToByteArrayImpl(_this__u8e3s4, input, fromIndex, toIndex);
1924
+ }
1925
+ function decode_0(_this__u8e3s4, input, dst, max) {
1926
+ var decoder = Decoder(get_name(get_charset(_this__u8e3s4)), true);
1927
+ // Inline function 'kotlin.comparisons.minOf' call
1928
+ var a = input.n19().m();
1929
+ var b = toLong(max);
1930
+ var count = a.z(b) <= 0 ? a : b;
1931
+ var tmp = readByteArray(input, count.e1());
1932
+ var array = tmp instanceof Int8Array ? tmp : THROW_CCE();
1933
+ var tmp_0;
1934
+ try {
1935
+ tmp_0 = decoder.l1j(array);
1936
+ } catch ($p) {
1937
+ var tmp_1;
1938
+ if ($p instanceof Error) {
1939
+ var cause = $p;
1940
+ var tmp0_elvis_lhs = cause.message;
1941
+ throw new MalformedInputException('Failed to decode bytes: ' + (tmp0_elvis_lhs == null ? 'no cause provided' : tmp0_elvis_lhs));
1942
+ } else {
1943
+ throw $p;
1944
+ }
1945
+ }
1946
+ var result = tmp_0;
1947
+ dst.f(result);
1948
+ return result.length;
1949
+ }
1950
+ function encodeToByteArrayImpl(_this__u8e3s4, input, fromIndex, toIndex) {
1951
+ fromIndex = fromIndex === VOID ? 0 : fromIndex;
1952
+ toIndex = toIndex === VOID ? charSequenceLength(input) : toIndex;
1953
+ var start = fromIndex;
1954
+ if (start >= toIndex)
1955
+ return new Int8Array(0);
1956
+ var dst = new Buffer();
1957
+ var rc = encodeImpl(_this__u8e3s4, input, start, toIndex, dst);
1958
+ start = start + rc | 0;
1959
+ if (start === toIndex) {
1960
+ return readByteArray_0(dst);
1961
+ }
1962
+ encodeToImpl(_this__u8e3s4, dst, input, start, toIndex);
1963
+ return readByteArray_0(dst);
1964
+ }
1965
+ function get_charset(_this__u8e3s4) {
1966
+ return _this__u8e3s4.d1j_1;
1967
+ }
1968
+ function encodeImpl(_this__u8e3s4, input, fromIndex, toIndex, dst) {
1969
+ // Inline function 'kotlin.require' call
1970
+ // Inline function 'kotlin.contracts.contract' call
1971
+ // Inline function 'kotlin.require' call
1972
+ // Inline function 'kotlin.contracts.contract' call
1973
+ if (!(fromIndex <= toIndex)) {
1974
+ // Inline function 'kotlin.require.<anonymous>' call
1975
+ var message = 'Failed requirement.';
1976
+ throw IllegalArgumentException_init_$Create$(toString(message));
1977
+ }
1978
+ if (get_charset_0(_this__u8e3s4).equals(Charsets_getInstance().b1i_1)) {
1979
+ return encodeISO88591(input, fromIndex, toIndex, dst);
1980
+ }
1981
+ // Inline function 'kotlin.require' call
1982
+ // Inline function 'kotlin.contracts.contract' call
1983
+ if (!(get_charset_0(_this__u8e3s4) === Charsets_getInstance().a1i_1)) {
1984
+ // Inline function 'io.ktor.utils.io.charsets.encodeImpl.<anonymous>' call
1985
+ var message_0 = 'Only UTF-8 encoding is supported in JS';
1986
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1987
+ }
1988
+ var encoder = new TextEncoder();
1989
+ // Inline function 'kotlin.text.substring' call
1990
+ var tmp$ret$2 = toString(charSequenceSubSequence(input, fromIndex, toIndex));
1991
+ var result = encoder.encode(tmp$ret$2);
1992
+ // Inline function 'kotlin.js.unsafeCast' call
1993
+ // Inline function 'kotlin.js.asDynamic' call
1994
+ dst.o1a(result);
1995
+ return result.length;
1996
+ }
1997
+ function get_charset_0(_this__u8e3s4) {
1998
+ return _this__u8e3s4.e1j_1;
1999
+ }
2000
+ function forName(_this__u8e3s4, name) {
2001
+ return Companion_instance_1.b1j(name);
2002
+ }
2003
+ function isSupported(_this__u8e3s4, name) {
2004
+ return Companion_instance_1.c1j(name);
2005
+ }
2006
+ function Decoder(encoding, fatal) {
2007
+ fatal = fatal === VOID ? true : fatal;
2008
+ var tmp;
2009
+ try {
2010
+ tmp = toKtor(new TextDecoder(encoding, textDecoderOptions(fatal)));
2011
+ } catch ($p) {
2012
+ var tmp_0;
2013
+ if ($p instanceof Error) {
2014
+ var cause = $p;
2015
+ tmp_0 = new TextDecoderFallback(encoding, fatal);
2016
+ } else {
2017
+ throw $p;
2018
+ }
2019
+ tmp = tmp_0;
2020
+ }
2021
+ return tmp;
2022
+ }
2023
+ function toKtor(_this__u8e3s4) {
2024
+ return new toKtor$1(_this__u8e3s4);
2025
+ }
2026
+ function textDecoderOptions(fatal) {
2027
+ fatal = fatal === VOID ? false : fatal;
2028
+ // Inline function 'kotlin.apply' call
2029
+ var this_0 = new Object();
2030
+ // Inline function 'kotlin.contracts.contract' call
2031
+ // Inline function 'io.ktor.utils.io.charsets.textDecoderOptions.<anonymous>' call
2032
+ // Inline function 'kotlin.with' call
2033
+ // Inline function 'kotlin.js.asDynamic' call
2034
+ // Inline function 'kotlin.contracts.contract' call
2035
+ this_0.fatal = fatal;
2036
+ return this_0;
2037
+ }
2038
+ function toKtor$1($this_toKtor) {
2039
+ this.m1j_1 = $this_toKtor;
2040
+ }
2041
+ protoOf(toKtor$1).l1j = function (buffer) {
2042
+ return this.m1j_1.decode(buffer);
2043
+ };
2044
+ function get_ENCODING_ALIASES() {
2045
+ _init_properties_TextDecoderFallback_js_kt__an7r6m();
2046
+ return ENCODING_ALIASES;
2047
+ }
2048
+ var ENCODING_ALIASES;
2049
+ function get_REPLACEMENT() {
2050
+ _init_properties_TextDecoderFallback_js_kt__an7r6m();
2051
+ return REPLACEMENT;
2052
+ }
2053
+ var REPLACEMENT;
2054
+ function TextDecoderFallback(encoding, fatal) {
2055
+ this.n1j_1 = fatal;
2056
+ // Inline function 'kotlin.text.lowercase' call
2057
+ // Inline function 'kotlin.text.trim' call
2058
+ // Inline function 'kotlin.js.asDynamic' call
2059
+ var requestedEncoding = toString(trim(isCharSequence(encoding) ? encoding : THROW_CCE())).toLowerCase();
2060
+ // Inline function 'kotlin.check' call
2061
+ // Inline function 'kotlin.contracts.contract' call
2062
+ if (!get_ENCODING_ALIASES().s1(requestedEncoding)) {
2063
+ // Inline function 'io.ktor.utils.io.charsets.TextDecoderFallback.<anonymous>' call
2064
+ var message = encoding + ' is not supported.';
2065
+ throw IllegalStateException_init_$Create$(toString(message));
2066
+ }
2067
+ }
2068
+ protoOf(TextDecoderFallback).l1j = function (buffer) {
2069
+ // Inline function 'io.ktor.utils.io.core.buildPacket' call
2070
+ var builder = new Buffer();
2071
+ // Inline function 'io.ktor.utils.io.charsets.TextDecoderFallback.decode.<anonymous>' call
2072
+ var bytes = buffer instanceof Int8Array ? buffer : THROW_CCE();
2073
+ var inductionVariable = 0;
2074
+ var last = bytes.length;
2075
+ if (inductionVariable < last)
2076
+ $l$loop: do {
2077
+ var index = inductionVariable;
2078
+ inductionVariable = inductionVariable + 1 | 0;
2079
+ // Inline function 'org.khronos.webgl.get' call
2080
+ // Inline function 'kotlin.js.asDynamic' call
2081
+ var byte = bytes[index];
2082
+ var point = toCodePoint(byte);
2083
+ if (point < 0) {
2084
+ // Inline function 'kotlin.check' call
2085
+ // Inline function 'kotlin.contracts.contract' call
2086
+ if (!!this.n1j_1) {
2087
+ // Inline function 'io.ktor.utils.io.charsets.TextDecoderFallback.decode.<anonymous>.<anonymous>' call
2088
+ var message = 'Invalid character: ' + point;
2089
+ throw IllegalStateException_init_$Create$(toString(message));
2090
+ }
2091
+ writeFully_0(builder, get_REPLACEMENT());
2092
+ continue $l$loop;
2093
+ }
2094
+ if (point > 255) {
2095
+ builder.w1a(toByte(point >> 8));
2096
+ }
2097
+ builder.w1a(toByte(point & 255));
2098
+ }
2099
+ while (inductionVariable < last);
2100
+ return decodeToString_0(readBytes_0(builder));
2101
+ };
2102
+ function toCodePoint(_this__u8e3s4) {
2103
+ _init_properties_TextDecoderFallback_js_kt__an7r6m();
2104
+ var value = _this__u8e3s4 & 255;
2105
+ if (isASCII(value)) {
2106
+ return value;
2107
+ }
2108
+ return get_WIN1252_TABLE()[value - 128 | 0];
2109
+ }
2110
+ function isASCII(_this__u8e3s4) {
2111
+ _init_properties_TextDecoderFallback_js_kt__an7r6m();
2112
+ return 0 <= _this__u8e3s4 ? _this__u8e3s4 <= 127 : false;
2113
+ }
2114
+ var properties_initialized_TextDecoderFallback_js_kt_6rekzk;
2115
+ function _init_properties_TextDecoderFallback_js_kt__an7r6m() {
2116
+ if (!properties_initialized_TextDecoderFallback_js_kt_6rekzk) {
2117
+ properties_initialized_TextDecoderFallback_js_kt_6rekzk = true;
2118
+ ENCODING_ALIASES = setOf(['ansi_x3.4-1968', 'ascii', 'cp1252', 'cp819', 'csisolatin1', 'ibm819', 'iso-8859-1', 'iso-ir-100', 'iso8859-1', 'iso88591', 'iso_8859-1', 'iso_8859-1:1987', 'l1', 'latin1', 'us-ascii', 'windows-1252', 'x-cp1252']);
2119
+ // Inline function 'kotlin.byteArrayOf' call
2120
+ REPLACEMENT = new Int8Array([-17, -65, -67]);
2121
+ }
2122
+ }
2123
+ function encodeISO88591(input, fromIndex, toIndex, dst) {
2124
+ if (fromIndex >= toIndex)
2125
+ return 0;
2126
+ var inductionVariable = fromIndex;
2127
+ if (inductionVariable < toIndex)
2128
+ do {
2129
+ var index = inductionVariable;
2130
+ inductionVariable = inductionVariable + 1 | 0;
2131
+ // Inline function 'kotlin.code' call
2132
+ var this_0 = charSequenceGet(input, index);
2133
+ var character = Char__toInt_impl_vasixd(this_0);
2134
+ if (character > 255) {
2135
+ failedToMapError(character);
2136
+ }
2137
+ dst.w1a(toByte(character));
2138
+ }
2139
+ while (inductionVariable < toIndex);
2140
+ return toIndex - fromIndex | 0;
2141
+ }
2142
+ function failedToMapError(ch) {
2143
+ throw new MalformedInputException('The character with unicode point ' + ch + " couldn't be mapped to ISO-8859-1 character");
2144
+ }
2145
+ function get_WIN1252_TABLE() {
2146
+ _init_properties_Win1252Table_kt__tl0v64();
2147
+ return WIN1252_TABLE;
2148
+ }
2149
+ var WIN1252_TABLE;
2150
+ var properties_initialized_Win1252Table_kt_pkmjoq;
2151
+ function _init_properties_Win1252Table_kt__tl0v64() {
2152
+ if (!properties_initialized_Win1252Table_kt_pkmjoq) {
2153
+ properties_initialized_Win1252Table_kt_pkmjoq = true;
2154
+ // Inline function 'kotlin.intArrayOf' call
2155
+ WIN1252_TABLE = new Int32Array([8364, -1, 8218, 402, 8222, 8230, 8224, 8225, 710, 8240, 352, 8249, 338, -1, 381, -1, -1, 8216, 8217, 8220, 8221, 8226, 8211, 8212, 732, 8482, 353, 8250, 339, -1, 382, 376, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]);
2156
+ }
2157
+ }
2158
+ function DefaultPool(capacity) {
2159
+ this.t1i_1 = capacity;
2160
+ var tmp = this;
2161
+ // Inline function 'kotlin.arrayOfNulls' call
2162
+ var size = this.t1i_1;
2163
+ tmp.u1i_1 = fillArrayVal(Array(size), null);
2164
+ this.v1i_1 = 0;
2165
+ }
2166
+ protoOf(DefaultPool).w1i = function (instance) {
2167
+ };
2168
+ protoOf(DefaultPool).x1i = function (instance) {
2169
+ return instance;
2170
+ };
2171
+ protoOf(DefaultPool).y1i = function (instance) {
2172
+ };
2173
+ protoOf(DefaultPool).z1i = function () {
2174
+ if (this.v1i_1 === 0)
2175
+ return this.s1i();
2176
+ this.v1i_1 = this.v1i_1 - 1 | 0;
2177
+ var idx = this.v1i_1;
2178
+ var tmp = this.u1i_1[idx];
2179
+ var instance = !(tmp == null) ? tmp : THROW_CCE();
2180
+ this.u1i_1[idx] = null;
2181
+ return this.x1i(instance);
2182
+ };
2183
+ protoOf(DefaultPool).a1j = function (instance) {
2184
+ this.y1i(instance);
2185
+ if (this.v1i_1 === this.t1i_1) {
2186
+ this.w1i(instance);
2187
+ } else {
2188
+ var _unary__edvuaz = this.v1i_1;
2189
+ this.v1i_1 = _unary__edvuaz + 1 | 0;
2190
+ this.u1i_1[_unary__edvuaz] = instance;
2191
+ }
2192
+ };
2193
+ //region block: post-declaration
2194
+ protoOf(ByteChannel).l1d = awaitContent$default;
2195
+ protoOf(ByteReadChannel$Companion$Empty$1).l1d = awaitContent$default;
2196
+ protoOf(SourceByteReadChannel).l1d = awaitContent$default;
2197
+ //endregion
2198
+ //region block: init
2199
+ CHANNEL_MAX_SIZE = 4096;
2200
+ Companion_instance_1 = new Companion_0();
2201
+ //endregion
2202
+ //region block: exports
2203
+ _.$_$ = _.$_$ || {};
2204
+ _.$_$.a = copyTo;
2205
+ _.$_$.b = readAvailable;
2206
+ _.$_$.c = readPacket;
2207
+ _.$_$.d = readRemaining;
2208
+ _.$_$.e = toByteArray;
2209
+ _.$_$.f = writeFully;
2210
+ _.$_$.g = writePacket;
2211
+ _.$_$.h = Charsets_getInstance;
2212
+ _.$_$.i = Companion_getInstance;
2213
+ _.$_$.j = MalformedInputException;
2214
+ _.$_$.k = decode;
2215
+ _.$_$.l = encode;
2216
+ _.$_$.m = forName;
2217
+ _.$_$.n = isSupported;
2218
+ _.$_$.o = get_name;
2219
+ _.$_$.p = BytePacketBuilder;
2220
+ _.$_$.q = String_0;
2221
+ _.$_$.r = build;
2222
+ _.$_$.s = canRead;
2223
+ _.$_$.t = copy;
2224
+ _.$_$.u = discard;
2225
+ _.$_$.v = readAvailable_0;
2226
+ _.$_$.w = readBytes_0;
2227
+ _.$_$.x = readText_0;
2228
+ _.$_$.y = get_remaining;
2229
+ _.$_$.z = takeWhile;
2230
+ _.$_$.a1 = toByteArray_0;
2231
+ _.$_$.b1 = writeFully_0;
2232
+ _.$_$.c1 = writePacket_0;
2233
+ _.$_$.d1 = writeText;
2234
+ _.$_$.e1 = get_ByteArrayPool;
2235
+ _.$_$.f1 = ByteReadChannel;
2236
+ _.$_$.g1 = ByteReadChannel_1;
2237
+ _.$_$.h1 = WriterScope;
2238
+ _.$_$.i1 = get_availableForRead;
2239
+ _.$_$.j1 = cancel_0;
2240
+ _.$_$.k1 = close;
2241
+ _.$_$.l1 = invokeOnCompletion;
2242
+ _.$_$.m1 = readText;
2243
+ _.$_$.n1 = release;
2244
+ _.$_$.o1 = writer;
2245
+ //endregion
2246
+ return _;
2247
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'), require('./kotlinx-atomicfu.js'), require('./kotlinx-io-kotlinx-io-core.js')));
2248
+
2249
+ //# sourceMappingURL=ktor-ktor-io.js.map