@sddsjs/design-system-builder-cli 0.0.0-stage → 0.2.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 (63) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +969 -2
  3. package/bin/dsbuilder.js +2 -0
  4. package/dist/kotlin/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +3170 -0
  5. package/dist/kotlin/Stately-stately-concurrency.js +32 -0
  6. package/dist/kotlin/Stately-stately-concurrent-collections.js +302 -0
  7. package/dist/kotlin/Stately-stately-strict.js +12 -0
  8. package/dist/kotlin/clikt-clikt-mordant.js +304 -0
  9. package/dist/kotlin/clikt-clikt.js +6960 -0
  10. package/dist/kotlin/colormath-root-colormath.js +1653 -0
  11. package/dist/kotlin/design-system-builder-frontend-analytics-metrica.js +1026 -0
  12. package/dist/kotlin/design-system-builder-frontend-cli.js +10690 -0
  13. package/dist/kotlin/design-system-builder-frontend-core-analytics.js +128 -0
  14. package/dist/kotlin/design-system-builder-frontend-core-application.js +3634 -0
  15. package/dist/kotlin/design-system-builder-frontend-core-auth.js +1772 -0
  16. package/dist/kotlin/design-system-builder-frontend-core-domain.js +501 -0
  17. package/dist/kotlin/design-system-builder-frontend-core-network.js +3318 -0
  18. package/dist/kotlin/design-system-builder-frontend-core-platform.js +972 -0
  19. package/dist/kotlin/design-system-builder-frontend-core-process.js +236 -0
  20. package/dist/kotlin/design-system-builder-frontend-core-workspace.js +1058 -0
  21. package/dist/kotlin/design-system-builder-frontend-feature-auth.js +1664 -0
  22. package/dist/kotlin/design-system-builder-frontend-feature-components.js +24819 -0
  23. package/dist/kotlin/design-system-builder-frontend-feature-docs.js +7625 -0
  24. package/dist/kotlin/design-system-builder-frontend-feature-ds.js +2219 -0
  25. package/dist/kotlin/design-system-builder-frontend-feature-init.js +318 -0
  26. package/dist/kotlin/design-system-builder-frontend-feature-projects.js +624 -0
  27. package/dist/kotlin/design-system-builder-frontend-feature-status.js +984 -0
  28. package/dist/kotlin/design-system-builder-frontend-feature-theme.js +10456 -0
  29. package/dist/kotlin/design-system-builder-frontend-feature-toolchain.js +586 -0
  30. package/dist/kotlin/design-system-builder-frontend-mcp-server-core.js +6878 -0
  31. package/dist/kotlin/design-system-builder-frontend-platform-android.js +451 -0
  32. package/dist/kotlin/design-system-builder-frontend-platform-ios.js +1858 -0
  33. package/dist/kotlin/design-system-builder-frontend-platform-web.js +1555 -0
  34. package/dist/kotlin/design-system-builder-frontend-runtime-node.js +1763 -0
  35. package/dist/kotlin/kotlin-kotlin-stdlib.js +17881 -0
  36. package/dist/kotlin/kotlin-logging.js +440 -0
  37. package/dist/kotlin/kotlin-sdk-kotlin-sdk-core.js +20228 -0
  38. package/dist/kotlin/kotlin-sdk-kotlin-sdk-server.js +2771 -0
  39. package/dist/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  40. package/dist/kotlin/kotlinx-atomicfu.js +252 -0
  41. package/dist/kotlin/kotlinx-coroutines-core.js +10822 -0
  42. package/dist/kotlin/kotlinx-io-kotlinx-io-bytestring.js +203 -0
  43. package/dist/kotlin/kotlinx-io-kotlinx-io-core.js +2032 -0
  44. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +6171 -0
  45. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +5690 -0
  46. package/dist/kotlin/ktor-ktor-client-core.js +8382 -0
  47. package/dist/kotlin/ktor-ktor-events.js +80 -0
  48. package/dist/kotlin/ktor-ktor-http-cio.js +2252 -0
  49. package/dist/kotlin/ktor-ktor-http.js +3320 -0
  50. package/dist/kotlin/ktor-ktor-io.js +3328 -0
  51. package/dist/kotlin/ktor-ktor-serialization.js +8 -0
  52. package/dist/kotlin/ktor-ktor-server-core.js +12 -0
  53. package/dist/kotlin/ktor-ktor-server-sse.js +8 -0
  54. package/dist/kotlin/ktor-ktor-server-websockets.js +8 -0
  55. package/dist/kotlin/ktor-ktor-sse.js +8 -0
  56. package/dist/kotlin/ktor-ktor-utils.js +2524 -0
  57. package/dist/kotlin/ktor-ktor-websocket-serialization.js +8 -0
  58. package/dist/kotlin/ktor-ktor-websockets.js +433 -0
  59. package/dist/kotlin/mordant-mordant-omnibus.js +8 -0
  60. package/dist/kotlin/mordant-mordant.js +12111 -0
  61. package/dist/kotlin/okio-parent-okio.js +2335 -0
  62. package/dist/kotlin/projects-core-koin-core.js +1285 -0
  63. package/package.json +26 -5
@@ -0,0 +1,2032 @@
1
+ (function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.f2;
6
+ var Long = kotlin_kotlin.$_$.qk;
7
+ var compare = kotlin_kotlin.$_$.fc;
8
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.v1;
9
+ var subtract = kotlin_kotlin.$_$.uc;
10
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.w2;
11
+ var charArrayOf = kotlin_kotlin.$_$.bd;
12
+ var protoOf = kotlin_kotlin.$_$.te;
13
+ var equalsLong = kotlin_kotlin.$_$.kc;
14
+ var toString = kotlin_kotlin.$_$.we;
15
+ var Unit_instance = kotlin_kotlin.$_$.r5;
16
+ var toShort = kotlin_kotlin.$_$.ve;
17
+ var add = kotlin_kotlin.$_$.bc;
18
+ var ensureNotNull = kotlin_kotlin.$_$.ol;
19
+ var fromInt = kotlin_kotlin.$_$.lc;
20
+ var convertToInt = kotlin_kotlin.$_$.hc;
21
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f1;
22
+ var initMetadataForClass = kotlin_kotlin.$_$.qd;
23
+ var VOID = kotlin_kotlin.$_$.c;
24
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.b2;
25
+ var UnsafeByteStringOperations_instance = kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring.$_$.b;
26
+ var AutoCloseable = kotlin_kotlin.$_$.ck;
27
+ var objectCreate = kotlin_kotlin.$_$.se;
28
+ var initMetadataForCompanion = kotlin_kotlin.$_$.rd;
29
+ var arrayCopy = kotlin_kotlin.$_$.p6;
30
+ var toByte = kotlin_kotlin.$_$.ue;
31
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.t1;
32
+ var initMetadataForObject = kotlin_kotlin.$_$.wd;
33
+ var initMetadataForInterface = kotlin_kotlin.$_$.ud;
34
+ var multiply = kotlin_kotlin.$_$.oc;
35
+ var charCodeAt = kotlin_kotlin.$_$.dd;
36
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.c3;
37
+ var charArray = kotlin_kotlin.$_$.cd;
38
+ var numberToChar = kotlin_kotlin.$_$.pe;
39
+ var concatToString = kotlin_kotlin.$_$.qg;
40
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.n1;
41
+ var captureStack = kotlin_kotlin.$_$.ad;
42
+ var Exception_init_$Init$_0 = kotlin_kotlin.$_$.p1;
43
+ var Exception_init_$Init$_1 = kotlin_kotlin.$_$.r1;
44
+ var Exception = kotlin_kotlin.$_$.mk;
45
+ //endregion
46
+ //region block: pre-declaration
47
+ initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
48
+ function write$default(source, startIndex, endIndex, $super) {
49
+ startIndex = startIndex === VOID ? 0 : startIndex;
50
+ endIndex = endIndex === VOID ? source.length : endIndex;
51
+ var tmp;
52
+ if ($super === VOID) {
53
+ this.tt(source, startIndex, endIndex);
54
+ tmp = Unit_instance;
55
+ } else {
56
+ tmp = $super.tt.call(this, source, startIndex, endIndex);
57
+ }
58
+ return tmp;
59
+ }
60
+ initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
61
+ initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
62
+ initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
63
+ initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
64
+ initMetadataForCompanion(Companion);
65
+ initMetadataForClass(Segment, 'Segment');
66
+ initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
67
+ initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
68
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
69
+ initMetadataForClass(SegmentReadContextImpl$1);
70
+ initMetadataForClass(SegmentWriteContextImpl$1);
71
+ initMetadataForClass(BufferIterationContextImpl$1);
72
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
73
+ initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
74
+ initMetadataForObject(SegmentPool, 'SegmentPool');
75
+ //endregion
76
+ function get_HEX_DIGIT_CHARS() {
77
+ _init_properties__Util_kt__g8tcl9();
78
+ return HEX_DIGIT_CHARS;
79
+ }
80
+ var HEX_DIGIT_CHARS;
81
+ function checkBounds(size, startIndex, endIndex) {
82
+ _init_properties__Util_kt__g8tcl9();
83
+ if (compare(startIndex, new Long(0, 0)) < 0 || compare(endIndex, size) > 0) {
84
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
85
+ }
86
+ if (compare(startIndex, endIndex) > 0) {
87
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
88
+ }
89
+ }
90
+ function checkOffsetAndCount(size, offset, byteCount) {
91
+ _init_properties__Util_kt__g8tcl9();
92
+ if (compare(offset, new Long(0, 0)) < 0 || compare(offset, size) > 0 || compare(subtract(size, offset), byteCount) < 0 || compare(byteCount, new Long(0, 0)) < 0) {
93
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
94
+ }
95
+ }
96
+ var properties_initialized__Util_kt_67kc5b;
97
+ function _init_properties__Util_kt__g8tcl9() {
98
+ if (!properties_initialized__Util_kt_67kc5b) {
99
+ properties_initialized__Util_kt_67kc5b = true;
100
+ // Inline function 'kotlin.charArrayOf' call
101
+ HEX_DIGIT_CHARS = charArrayOf([_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(49), _Char___init__impl__6a9atx(50), _Char___init__impl__6a9atx(51), _Char___init__impl__6a9atx(52), _Char___init__impl__6a9atx(53), _Char___init__impl__6a9atx(54), _Char___init__impl__6a9atx(55), _Char___init__impl__6a9atx(56), _Char___init__impl__6a9atx(57), _Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(98), _Char___init__impl__6a9atx(99), _Char___init__impl__6a9atx(100), _Char___init__impl__6a9atx(101), _Char___init__impl__6a9atx(102)]);
102
+ }
103
+ }
104
+ function throwEof($this, byteCount) {
105
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.o().toString() + ', required: ' + byteCount.toString() + ')');
106
+ }
107
+ function Buffer() {
108
+ this.gs_1 = null;
109
+ this.hs_1 = null;
110
+ this.is_1 = new Long(0, 0);
111
+ }
112
+ protoOf(Buffer).o = function () {
113
+ return this.is_1;
114
+ };
115
+ protoOf(Buffer).js = function () {
116
+ return this;
117
+ };
118
+ protoOf(Buffer).ks = function () {
119
+ return equalsLong(this.o(), new Long(0, 0));
120
+ };
121
+ protoOf(Buffer).ls = function (byteCount) {
122
+ // Inline function 'kotlin.require' call
123
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
124
+ var message = 'byteCount: ' + byteCount.toString();
125
+ throw IllegalArgumentException_init_$Create$(toString(message));
126
+ }
127
+ if (compare(this.o(), byteCount) < 0) {
128
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.o().toString() + ', required: ' + byteCount.toString() + ')');
129
+ }
130
+ };
131
+ protoOf(Buffer).ms = function (byteCount) {
132
+ // Inline function 'kotlin.require' call
133
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
134
+ var message = 'byteCount: ' + byteCount.toString() + ' < 0';
135
+ throw IllegalArgumentException_init_$Create$(toString(message));
136
+ }
137
+ return compare(this.o(), byteCount) >= 0;
138
+ };
139
+ protoOf(Buffer).ns = function () {
140
+ var tmp0_elvis_lhs = this.gs_1;
141
+ var tmp;
142
+ if (tmp0_elvis_lhs == null) {
143
+ throwEof(this, new Long(1, 0));
144
+ } else {
145
+ tmp = tmp0_elvis_lhs;
146
+ }
147
+ var segment = tmp;
148
+ var segmentSize = segment.o();
149
+ if (segmentSize === 0) {
150
+ this.vs();
151
+ return this.ns();
152
+ }
153
+ var v = segment.ws();
154
+ this.is_1 = subtract(this.is_1, new Long(1, 0));
155
+ if (segmentSize === 1) {
156
+ this.vs();
157
+ }
158
+ return v;
159
+ };
160
+ protoOf(Buffer).xs = function () {
161
+ var tmp0_elvis_lhs = this.gs_1;
162
+ var tmp;
163
+ if (tmp0_elvis_lhs == null) {
164
+ throwEof(this, new Long(2, 0));
165
+ } else {
166
+ tmp = tmp0_elvis_lhs;
167
+ }
168
+ var segment = tmp;
169
+ var segmentSize = segment.o();
170
+ if (segmentSize < 2) {
171
+ this.ls(new Long(2, 0));
172
+ if (segmentSize === 0) {
173
+ this.vs();
174
+ return this.xs();
175
+ }
176
+ // Inline function 'kotlinx.io.and' call
177
+ var tmp_0 = (this.ns() & 255) << 8;
178
+ // Inline function 'kotlinx.io.and' call
179
+ var tmp$ret$1 = this.ns() & 255;
180
+ return toShort(tmp_0 | tmp$ret$1);
181
+ }
182
+ var v = segment.ys();
183
+ this.is_1 = subtract(this.is_1, new Long(2, 0));
184
+ if (segmentSize === 2) {
185
+ this.vs();
186
+ }
187
+ return v;
188
+ };
189
+ protoOf(Buffer).zs = function () {
190
+ return Unit_instance;
191
+ };
192
+ protoOf(Buffer).at = function (out, startIndex, endIndex) {
193
+ checkBounds(this.o(), startIndex, endIndex);
194
+ if (equalsLong(startIndex, endIndex))
195
+ return Unit_instance;
196
+ var currentOffset = startIndex;
197
+ var remainingByteCount = subtract(endIndex, startIndex);
198
+ out.is_1 = add(out.is_1, remainingByteCount);
199
+ var s = this.gs_1;
200
+ while (compare(currentOffset, fromInt(ensureNotNull(s).qs_1 - s.ps_1 | 0)) >= 0) {
201
+ currentOffset = subtract(currentOffset, fromInt(s.qs_1 - s.ps_1 | 0));
202
+ s = s.ts_1;
203
+ }
204
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
205
+ var copy = ensureNotNull(s).bt();
206
+ copy.ps_1 = copy.ps_1 + convertToInt(currentOffset) | 0;
207
+ var tmp = copy;
208
+ var tmp0 = copy.ps_1 + convertToInt(remainingByteCount) | 0;
209
+ // Inline function 'kotlin.comparisons.minOf' call
210
+ var b = copy.qs_1;
211
+ tmp.qs_1 = Math.min(tmp0, b);
212
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
213
+ if (out.gs_1 == null) {
214
+ out.gs_1 = copy;
215
+ out.hs_1 = copy;
216
+ } else if (false) {
217
+ out.hs_1 = ensureNotNull(out.hs_1).ct(copy).dt();
218
+ if (ensureNotNull(out.hs_1).us_1 == null) {
219
+ out.gs_1 = out.hs_1;
220
+ }
221
+ } else {
222
+ out.hs_1 = ensureNotNull(out.hs_1).ct(copy);
223
+ }
224
+ remainingByteCount = subtract(remainingByteCount, fromInt(copy.qs_1 - copy.ps_1 | 0));
225
+ currentOffset = new Long(0, 0);
226
+ s = s.ts_1;
227
+ }
228
+ };
229
+ protoOf(Buffer).et = function () {
230
+ var result = this.o();
231
+ if (equalsLong(result, new Long(0, 0)))
232
+ return new Long(0, 0);
233
+ var tail = ensureNotNull(this.hs_1);
234
+ if (tail.qs_1 < 8192 && tail.ss_1) {
235
+ result = subtract(result, fromInt(tail.qs_1 - tail.ps_1 | 0));
236
+ }
237
+ return result;
238
+ };
239
+ protoOf(Buffer).ft = function (position) {
240
+ if (compare(position, new Long(0, 0)) < 0 || compare(position, this.o()) >= 0) {
241
+ throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.o().toString() + '))');
242
+ }
243
+ if (equalsLong(position, new Long(0, 0))) {
244
+ return ensureNotNull(this.gs_1).gt(0);
245
+ }
246
+ // Inline function 'kotlinx.io.seek' call
247
+ if (this.gs_1 == null) {
248
+ var offset = new Long(-1, -1);
249
+ return ensureNotNull(null).gt(convertToInt(subtract(position, offset)));
250
+ }
251
+ if (compare(subtract(this.o(), position), position) < 0) {
252
+ var s = this.hs_1;
253
+ var offset_0 = this.o();
254
+ $l$loop: while (!(s == null) && compare(offset_0, position) > 0) {
255
+ offset_0 = subtract(offset_0, fromInt(s.qs_1 - s.ps_1 | 0));
256
+ if (compare(offset_0, position) <= 0)
257
+ break $l$loop;
258
+ s = s.us_1;
259
+ }
260
+ var tmp0 = s;
261
+ var offset_1 = offset_0;
262
+ return ensureNotNull(tmp0).gt(convertToInt(subtract(position, offset_1)));
263
+ } else {
264
+ var s_0 = this.gs_1;
265
+ var offset_2 = new Long(0, 0);
266
+ $l$loop_0: while (!(s_0 == null)) {
267
+ var tmp0_0 = offset_2;
268
+ // Inline function 'kotlin.Long.plus' call
269
+ var other = s_0.qs_1 - s_0.ps_1 | 0;
270
+ var nextOffset = add(tmp0_0, fromInt(other));
271
+ if (compare(nextOffset, position) > 0)
272
+ break $l$loop_0;
273
+ s_0 = s_0.ts_1;
274
+ offset_2 = nextOffset;
275
+ }
276
+ var tmp0_1 = s_0;
277
+ var offset_3 = offset_2;
278
+ return ensureNotNull(tmp0_1).gt(convertToInt(subtract(position, offset_3)));
279
+ }
280
+ };
281
+ protoOf(Buffer).i2 = function () {
282
+ return this.ht(this.o());
283
+ };
284
+ protoOf(Buffer).ht = function (byteCount) {
285
+ // Inline function 'kotlinx.io.checkByteCount' call
286
+ // Inline function 'kotlin.require' call
287
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
288
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
289
+ throw IllegalArgumentException_init_$Create$(toString(message));
290
+ }
291
+ var remainingByteCount = byteCount;
292
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
293
+ var tmp0_elvis_lhs = this.gs_1;
294
+ var tmp;
295
+ if (tmp0_elvis_lhs == null) {
296
+ throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
297
+ } else {
298
+ tmp = tmp0_elvis_lhs;
299
+ }
300
+ var head = tmp;
301
+ var tmp0 = remainingByteCount;
302
+ // Inline function 'kotlinx.io.minOf' call
303
+ var b = head.qs_1 - head.ps_1 | 0;
304
+ // Inline function 'kotlin.comparisons.minOf' call
305
+ var b_0 = fromInt(b);
306
+ var tmp$ret$4 = compare(tmp0, b_0) <= 0 ? tmp0 : b_0;
307
+ var toSkip = convertToInt(tmp$ret$4);
308
+ this.is_1 = subtract(this.is_1, fromInt(toSkip));
309
+ remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
310
+ head.ps_1 = head.ps_1 + toSkip | 0;
311
+ if (head.ps_1 === head.qs_1) {
312
+ this.vs();
313
+ }
314
+ }
315
+ };
316
+ protoOf(Buffer).it = function (sink, startIndex, endIndex) {
317
+ // Inline function 'kotlinx.io.checkBounds' call
318
+ var size = sink.length;
319
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
320
+ var tmp0_elvis_lhs = this.gs_1;
321
+ var tmp;
322
+ if (tmp0_elvis_lhs == null) {
323
+ return -1;
324
+ } else {
325
+ tmp = tmp0_elvis_lhs;
326
+ }
327
+ var s = tmp;
328
+ var tmp0 = endIndex - startIndex | 0;
329
+ // Inline function 'kotlin.comparisons.minOf' call
330
+ var b = s.o();
331
+ var toCopy = Math.min(tmp0, b);
332
+ s.jt(sink, startIndex, startIndex + toCopy | 0);
333
+ this.is_1 = subtract(this.is_1, fromInt(toCopy));
334
+ if (isEmpty(s)) {
335
+ this.vs();
336
+ }
337
+ return toCopy;
338
+ };
339
+ protoOf(Buffer).kt = function (sink, byteCount) {
340
+ // Inline function 'kotlinx.io.checkByteCount' call
341
+ // Inline function 'kotlin.require' call
342
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
343
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
344
+ throw IllegalArgumentException_init_$Create$(toString(message));
345
+ }
346
+ if (equalsLong(this.o(), new Long(0, 0)))
347
+ return new Long(-1, -1);
348
+ var bytesWritten = compare(byteCount, this.o()) > 0 ? this.o() : byteCount;
349
+ sink.lt(this, bytesWritten);
350
+ return bytesWritten;
351
+ };
352
+ protoOf(Buffer).mt = function (sink, byteCount) {
353
+ // Inline function 'kotlinx.io.checkByteCount' call
354
+ // Inline function 'kotlin.require' call
355
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
356
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
357
+ throw IllegalArgumentException_init_$Create$(toString(message));
358
+ }
359
+ if (compare(this.o(), byteCount) < 0) {
360
+ sink.lt(this, this.o());
361
+ throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.o().toString() + ' bytes were written.');
362
+ }
363
+ sink.lt(this, byteCount);
364
+ };
365
+ protoOf(Buffer).nt = function (sink) {
366
+ var byteCount = this.o();
367
+ if (compare(byteCount, new Long(0, 0)) > 0) {
368
+ sink.lt(this, byteCount);
369
+ }
370
+ return byteCount;
371
+ };
372
+ protoOf(Buffer).ot = function () {
373
+ return buffered(new PeekSource(this));
374
+ };
375
+ protoOf(Buffer).pt = function (minimumCapacity) {
376
+ // Inline function 'kotlin.require' call
377
+ if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
378
+ var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
379
+ throw IllegalArgumentException_init_$Create$(toString(message));
380
+ }
381
+ if (this.hs_1 == null) {
382
+ var result = SegmentPool_instance.st();
383
+ this.gs_1 = result;
384
+ this.hs_1 = result;
385
+ return result;
386
+ }
387
+ var t = ensureNotNull(this.hs_1);
388
+ if ((t.qs_1 + minimumCapacity | 0) > 8192 || !t.ss_1) {
389
+ var newTail = t.ct(SegmentPool_instance.st());
390
+ this.hs_1 = newTail;
391
+ return newTail;
392
+ }
393
+ return t;
394
+ };
395
+ protoOf(Buffer).tt = function (source, startIndex, endIndex) {
396
+ // Inline function 'kotlinx.io.checkBounds' call
397
+ var size = source.length;
398
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
399
+ var currentOffset = startIndex;
400
+ while (currentOffset < endIndex) {
401
+ var tail = this.pt(1);
402
+ var tmp0 = endIndex - currentOffset | 0;
403
+ // Inline function 'kotlin.comparisons.minOf' call
404
+ var b = tail.ut();
405
+ var toCopy = Math.min(tmp0, b);
406
+ tail.vt(source, currentOffset, currentOffset + toCopy | 0);
407
+ currentOffset = currentOffset + toCopy | 0;
408
+ }
409
+ var tmp = this;
410
+ var tmp0_0 = this.is_1;
411
+ // Inline function 'kotlin.Long.plus' call
412
+ var other = endIndex - startIndex | 0;
413
+ tmp.is_1 = add(tmp0_0, fromInt(other));
414
+ };
415
+ protoOf(Buffer).xt = function (source, byteCount) {
416
+ // Inline function 'kotlinx.io.checkByteCount' call
417
+ // Inline function 'kotlin.require' call
418
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
419
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
420
+ throw IllegalArgumentException_init_$Create$(toString(message));
421
+ }
422
+ var remainingByteCount = byteCount;
423
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
424
+ var read = source.kt(this, remainingByteCount);
425
+ if (equalsLong(read, new Long(-1, -1))) {
426
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + subtract(byteCount, remainingByteCount).toString() + ' were read.'));
427
+ }
428
+ remainingByteCount = subtract(remainingByteCount, read);
429
+ }
430
+ };
431
+ protoOf(Buffer).lt = function (source, byteCount) {
432
+ // Inline function 'kotlin.require' call
433
+ if (!!(source === this)) {
434
+ var message = 'source == this';
435
+ throw IllegalArgumentException_init_$Create$(toString(message));
436
+ }
437
+ checkOffsetAndCount(source.is_1, new Long(0, 0), byteCount);
438
+ var remainingByteCount = byteCount;
439
+ while (compare(remainingByteCount, new Long(0, 0)) > 0) {
440
+ if (compare(remainingByteCount, fromInt(ensureNotNull(source.gs_1).o())) < 0) {
441
+ var tail = this.hs_1;
442
+ var tmp;
443
+ if (!(tail == null) && tail.ss_1) {
444
+ var tmp0 = remainingByteCount;
445
+ // Inline function 'kotlin.Long.plus' call
446
+ var other = tail.qs_1;
447
+ var tmp0_0 = add(tmp0, fromInt(other));
448
+ // Inline function 'kotlin.Long.minus' call
449
+ var other_0 = tail.yt() ? 0 : tail.ps_1;
450
+ var tmp$ret$3 = subtract(tmp0_0, fromInt(other_0));
451
+ tmp = compare(tmp$ret$3, new Long(8192, 0)) <= 0;
452
+ } else {
453
+ tmp = false;
454
+ }
455
+ if (tmp) {
456
+ ensureNotNull(source.gs_1).au(tail, convertToInt(remainingByteCount));
457
+ source.is_1 = subtract(source.is_1, remainingByteCount);
458
+ this.is_1 = add(this.is_1, remainingByteCount);
459
+ return Unit_instance;
460
+ } else {
461
+ source.gs_1 = ensureNotNull(source.gs_1).zt(convertToInt(remainingByteCount));
462
+ }
463
+ }
464
+ var segmentToMove = ensureNotNull(source.gs_1);
465
+ var movedByteCount = fromInt(segmentToMove.o());
466
+ source.gs_1 = segmentToMove.bu();
467
+ if (source.gs_1 == null) {
468
+ source.hs_1 = null;
469
+ }
470
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
471
+ if (this.gs_1 == null) {
472
+ this.gs_1 = segmentToMove;
473
+ this.hs_1 = segmentToMove;
474
+ } else if (true) {
475
+ this.hs_1 = ensureNotNull(this.hs_1).ct(segmentToMove).dt();
476
+ if (ensureNotNull(this.hs_1).us_1 == null) {
477
+ this.gs_1 = this.hs_1;
478
+ }
479
+ } else {
480
+ this.hs_1 = ensureNotNull(this.hs_1).ct(segmentToMove);
481
+ }
482
+ source.is_1 = subtract(source.is_1, movedByteCount);
483
+ this.is_1 = add(this.is_1, movedByteCount);
484
+ remainingByteCount = subtract(remainingByteCount, movedByteCount);
485
+ }
486
+ };
487
+ protoOf(Buffer).cu = function (source) {
488
+ var totalBytesRead = new Long(0, 0);
489
+ $l$loop: while (true) {
490
+ var readCount = source.kt(this, new Long(8192, 0));
491
+ if (equalsLong(readCount, new Long(-1, -1)))
492
+ break $l$loop;
493
+ totalBytesRead = add(totalBytesRead, readCount);
494
+ }
495
+ return totalBytesRead;
496
+ };
497
+ protoOf(Buffer).du = function (byte) {
498
+ this.pt(1).eu(byte);
499
+ this.is_1 = add(this.is_1, new Long(1, 0));
500
+ };
501
+ protoOf(Buffer).fu = function (short) {
502
+ this.pt(2).gu(short);
503
+ this.is_1 = add(this.is_1, new Long(2, 0));
504
+ };
505
+ protoOf(Buffer).p3 = function () {
506
+ return Unit_instance;
507
+ };
508
+ protoOf(Buffer).toString = function () {
509
+ if (equalsLong(this.o(), new Long(0, 0)))
510
+ return 'Buffer(size=0)';
511
+ var maxPrintableBytes = 64;
512
+ // Inline function 'kotlinx.io.minOf' call
513
+ var b = this.o();
514
+ // Inline function 'kotlin.comparisons.minOf' call
515
+ var a = fromInt(maxPrintableBytes);
516
+ var tmp$ret$1 = compare(a, b) <= 0 ? a : b;
517
+ var len = convertToInt(tmp$ret$1);
518
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (compare(this.o(), fromInt(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
519
+ var bytesWritten = 0;
520
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
521
+ var curr = this.gs_1;
522
+ while (!(curr == null)) {
523
+ var tmp0 = get_SegmentReadContextImpl();
524
+ var segment = curr;
525
+ var idx = 0;
526
+ while (bytesWritten < len && idx < segment.o()) {
527
+ var _unary__edvuaz = idx;
528
+ idx = _unary__edvuaz + 1 | 0;
529
+ var b_0 = tmp0.hu(segment, _unary__edvuaz);
530
+ bytesWritten = bytesWritten + 1 | 0;
531
+ var tmp = get_HEX_DIGIT_CHARS();
532
+ // Inline function 'kotlinx.io.shr' call
533
+ var tmp$ret$2 = b_0 >> 4;
534
+ var tmp_0 = builder.a8(tmp[tmp$ret$2 & 15]);
535
+ var tmp_1 = get_HEX_DIGIT_CHARS();
536
+ // Inline function 'kotlinx.io.and' call
537
+ var tmp$ret$3 = b_0 & 15;
538
+ tmp_0.a8(tmp_1[tmp$ret$3]);
539
+ }
540
+ curr = curr.ts_1;
541
+ }
542
+ if (compare(this.o(), fromInt(maxPrintableBytes)) > 0) {
543
+ builder.a8(_Char___init__impl__6a9atx(8230));
544
+ }
545
+ return 'Buffer(size=' + this.o().toString() + ' hex=' + builder.toString() + ')';
546
+ };
547
+ protoOf(Buffer).vs = function () {
548
+ var oldHead = ensureNotNull(this.gs_1);
549
+ var nextHead = oldHead.ts_1;
550
+ this.gs_1 = nextHead;
551
+ if (nextHead == null) {
552
+ this.hs_1 = null;
553
+ } else {
554
+ nextHead.us_1 = null;
555
+ }
556
+ oldHead.ts_1 = null;
557
+ SegmentPool_instance.iu(oldHead);
558
+ };
559
+ protoOf(Buffer).ju = function () {
560
+ var oldTail = ensureNotNull(this.hs_1);
561
+ var newTail = oldTail.us_1;
562
+ this.hs_1 = newTail;
563
+ if (newTail == null) {
564
+ this.gs_1 = null;
565
+ } else {
566
+ newTail.ts_1 = null;
567
+ }
568
+ oldTail.us_1 = null;
569
+ SegmentPool_instance.iu(oldTail);
570
+ };
571
+ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
572
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
573
+ endIndex = endIndex === VOID ? _this__u8e3s4.o() : endIndex;
574
+ // Inline function 'kotlin.comparisons.minOf' call
575
+ var b = _this__u8e3s4.o();
576
+ var endOffset = compare(endIndex, b) <= 0 ? endIndex : b;
577
+ checkBounds(_this__u8e3s4.o(), startIndex, endOffset);
578
+ if (equalsLong(startIndex, endOffset))
579
+ return new Long(-1, -1);
580
+ // Inline function 'kotlinx.io.seek' call
581
+ if (_this__u8e3s4.gs_1 == null) {
582
+ var o = new Long(-1, -1);
583
+ if (equalsLong(o, new Long(-1, -1))) {
584
+ return new Long(-1, -1);
585
+ }
586
+ var segment = null;
587
+ var offset = o;
588
+ do {
589
+ // Inline function 'kotlin.check' call
590
+ if (!(compare(endOffset, offset) > 0)) {
591
+ throw IllegalStateException_init_$Create$('Check failed.');
592
+ }
593
+ ensureNotNull(segment);
594
+ var tmp = segment;
595
+ // Inline function 'kotlin.comparisons.maxOf' call
596
+ var a = convertToInt(subtract(startIndex, offset));
597
+ var tmp_0 = Math.max(a, 0);
598
+ var tmp0 = segment.o();
599
+ // Inline function 'kotlin.comparisons.minOf' call
600
+ var b_0 = convertToInt(subtract(endOffset, offset));
601
+ var tmp$ret$3 = Math.min(tmp0, b_0);
602
+ var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$3);
603
+ if (!(idx === -1)) {
604
+ return add(offset, fromInt(idx));
605
+ }
606
+ var tmp0_0 = offset;
607
+ // Inline function 'kotlin.Long.plus' call
608
+ var other = segment.o();
609
+ offset = add(tmp0_0, fromInt(other));
610
+ segment = segment.ts_1;
611
+ }
612
+ while (!(segment == null) && compare(offset, endOffset) < 0);
613
+ return new Long(-1, -1);
614
+ }
615
+ if (compare(subtract(_this__u8e3s4.o(), startIndex), startIndex) < 0) {
616
+ var s = _this__u8e3s4.hs_1;
617
+ var offset_0 = _this__u8e3s4.o();
618
+ $l$loop: while (!(s == null) && compare(offset_0, startIndex) > 0) {
619
+ offset_0 = subtract(offset_0, fromInt(s.qs_1 - s.ps_1 | 0));
620
+ if (compare(offset_0, startIndex) <= 0)
621
+ break $l$loop;
622
+ s = s.us_1;
623
+ }
624
+ var tmp0_1 = s;
625
+ var o_0 = offset_0;
626
+ if (equalsLong(o_0, new Long(-1, -1))) {
627
+ return new Long(-1, -1);
628
+ }
629
+ var segment_0 = tmp0_1;
630
+ var offset_1 = o_0;
631
+ do {
632
+ // Inline function 'kotlin.check' call
633
+ if (!(compare(endOffset, offset_1) > 0)) {
634
+ throw IllegalStateException_init_$Create$('Check failed.');
635
+ }
636
+ ensureNotNull(segment_0);
637
+ var tmp_1 = segment_0;
638
+ // Inline function 'kotlin.comparisons.maxOf' call
639
+ var a_0 = convertToInt(subtract(startIndex, offset_1));
640
+ var tmp_2 = Math.max(a_0, 0);
641
+ var tmp0_2 = segment_0.o();
642
+ // Inline function 'kotlin.comparisons.minOf' call
643
+ var b_1 = convertToInt(subtract(endOffset, offset_1));
644
+ var tmp$ret$8 = Math.min(tmp0_2, b_1);
645
+ var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$8);
646
+ if (!(idx_0 === -1)) {
647
+ return add(offset_1, fromInt(idx_0));
648
+ }
649
+ var tmp0_3 = offset_1;
650
+ // Inline function 'kotlin.Long.plus' call
651
+ var other_0 = segment_0.o();
652
+ offset_1 = add(tmp0_3, fromInt(other_0));
653
+ segment_0 = segment_0.ts_1;
654
+ }
655
+ while (!(segment_0 == null) && compare(offset_1, endOffset) < 0);
656
+ return new Long(-1, -1);
657
+ } else {
658
+ var s_0 = _this__u8e3s4.gs_1;
659
+ var offset_2 = new Long(0, 0);
660
+ $l$loop_0: while (!(s_0 == null)) {
661
+ var tmp0_4 = offset_2;
662
+ // Inline function 'kotlin.Long.plus' call
663
+ var other_1 = s_0.qs_1 - s_0.ps_1 | 0;
664
+ var nextOffset = add(tmp0_4, fromInt(other_1));
665
+ if (compare(nextOffset, startIndex) > 0)
666
+ break $l$loop_0;
667
+ s_0 = s_0.ts_1;
668
+ offset_2 = nextOffset;
669
+ }
670
+ var tmp0_5 = s_0;
671
+ var o_1 = offset_2;
672
+ if (equalsLong(o_1, new Long(-1, -1))) {
673
+ return new Long(-1, -1);
674
+ }
675
+ var segment_1 = tmp0_5;
676
+ var offset_3 = o_1;
677
+ do {
678
+ // Inline function 'kotlin.check' call
679
+ if (!(compare(endOffset, offset_3) > 0)) {
680
+ throw IllegalStateException_init_$Create$('Check failed.');
681
+ }
682
+ ensureNotNull(segment_1);
683
+ var tmp_3 = segment_1;
684
+ // Inline function 'kotlin.comparisons.maxOf' call
685
+ var a_1 = convertToInt(subtract(startIndex, offset_3));
686
+ var tmp_4 = Math.max(a_1, 0);
687
+ var tmp0_6 = segment_1.o();
688
+ // Inline function 'kotlin.comparisons.minOf' call
689
+ var b_2 = convertToInt(subtract(endOffset, offset_3));
690
+ var tmp$ret$13 = Math.min(tmp0_6, b_2);
691
+ var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$13);
692
+ if (!(idx_1 === -1)) {
693
+ return add(offset_3, fromInt(idx_1));
694
+ }
695
+ var tmp0_7 = offset_3;
696
+ // Inline function 'kotlin.Long.plus' call
697
+ var other_2 = segment_1.o();
698
+ offset_3 = add(tmp0_7, fromInt(other_2));
699
+ segment_1 = segment_1.ts_1;
700
+ }
701
+ while (!(segment_1 == null) && compare(offset_3, endOffset) < 0);
702
+ return new Long(-1, -1);
703
+ }
704
+ }
705
+ function readByteString(_this__u8e3s4, byteCount) {
706
+ return UnsafeByteStringOperations_instance.fs(readByteArray_0(_this__u8e3s4, byteCount));
707
+ }
708
+ function buffered(_this__u8e3s4) {
709
+ return new RealSource(_this__u8e3s4);
710
+ }
711
+ function PeekSource(upstream) {
712
+ this.ku_1 = upstream;
713
+ this.lu_1 = this.ku_1.js();
714
+ this.mu_1 = this.lu_1.gs_1;
715
+ var tmp = this;
716
+ var tmp0_safe_receiver = this.lu_1.gs_1;
717
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.ps_1;
718
+ tmp.nu_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
719
+ this.ou_1 = false;
720
+ this.pu_1 = new Long(0, 0);
721
+ }
722
+ protoOf(PeekSource).kt = function (sink, byteCount) {
723
+ // Inline function 'kotlin.check' call
724
+ if (!!this.ou_1) {
725
+ var message = 'Source is closed.';
726
+ throw IllegalStateException_init_$Create$(toString(message));
727
+ }
728
+ // Inline function 'kotlinx.io.checkByteCount' call
729
+ // Inline function 'kotlin.require' call
730
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
731
+ var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
732
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
733
+ }
734
+ // Inline function 'kotlin.check' call
735
+ if (!(this.mu_1 == null || (this.mu_1 === this.lu_1.gs_1 && this.nu_1 === ensureNotNull(this.lu_1.gs_1).ps_1))) {
736
+ var message_1 = 'Peek source is invalid because upstream source was used';
737
+ throw IllegalStateException_init_$Create$(toString(message_1));
738
+ }
739
+ if (equalsLong(byteCount, new Long(0, 0)))
740
+ return new Long(0, 0);
741
+ // Inline function 'kotlin.Long.plus' call
742
+ var this_0 = this.pu_1;
743
+ var tmp$ret$7 = add(this_0, fromInt(1));
744
+ if (!this.ku_1.ms(tmp$ret$7))
745
+ return new Long(-1, -1);
746
+ if (this.mu_1 == null && !(this.lu_1.gs_1 == null)) {
747
+ this.mu_1 = this.lu_1.gs_1;
748
+ this.nu_1 = ensureNotNull(this.lu_1.gs_1).ps_1;
749
+ }
750
+ // Inline function 'kotlin.comparisons.minOf' call
751
+ var b = subtract(this.lu_1.o(), this.pu_1);
752
+ var toCopy = compare(byteCount, b) <= 0 ? byteCount : b;
753
+ this.lu_1.at(sink, this.pu_1, add(this.pu_1, toCopy));
754
+ this.pu_1 = add(this.pu_1, toCopy);
755
+ return toCopy;
756
+ };
757
+ protoOf(PeekSource).p3 = function () {
758
+ this.ou_1 = true;
759
+ };
760
+ function RealSource(source) {
761
+ this.qu_1 = source;
762
+ this.ru_1 = false;
763
+ this.su_1 = new Buffer();
764
+ }
765
+ protoOf(RealSource).js = function () {
766
+ return this.su_1;
767
+ };
768
+ protoOf(RealSource).kt = function (sink, byteCount) {
769
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
770
+ // Inline function 'kotlin.check' call
771
+ if (!!this.ru_1) {
772
+ var message = 'Source is closed.';
773
+ throw IllegalStateException_init_$Create$(toString(message));
774
+ }
775
+ // Inline function 'kotlin.require' call
776
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
777
+ var message_0 = 'byteCount: ' + byteCount.toString();
778
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
779
+ }
780
+ if (equalsLong(this.su_1.o(), new Long(0, 0))) {
781
+ var read = this.qu_1.kt(this.su_1, new Long(8192, 0));
782
+ if (equalsLong(read, new Long(-1, -1)))
783
+ return new Long(-1, -1);
784
+ }
785
+ // Inline function 'kotlin.comparisons.minOf' call
786
+ var b = this.su_1.o();
787
+ var toRead = compare(byteCount, b) <= 0 ? byteCount : b;
788
+ return this.su_1.kt(sink, toRead);
789
+ };
790
+ protoOf(RealSource).ks = function () {
791
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
792
+ // Inline function 'kotlin.check' call
793
+ if (!!this.ru_1) {
794
+ var message = 'Source is closed.';
795
+ throw IllegalStateException_init_$Create$(toString(message));
796
+ }
797
+ return this.su_1.ks() && equalsLong(this.qu_1.kt(this.su_1, new Long(8192, 0)), new Long(-1, -1));
798
+ };
799
+ protoOf(RealSource).ls = function (byteCount) {
800
+ if (!this.ms(byteCount))
801
+ throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
802
+ };
803
+ protoOf(RealSource).ms = function (byteCount) {
804
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
805
+ // Inline function 'kotlin.check' call
806
+ if (!!this.ru_1) {
807
+ var message = 'Source is closed.';
808
+ throw IllegalStateException_init_$Create$(toString(message));
809
+ }
810
+ // Inline function 'kotlin.require' call
811
+ if (!(compare(byteCount, new Long(0, 0)) >= 0)) {
812
+ var message_0 = 'byteCount: ' + byteCount.toString();
813
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
814
+ }
815
+ while (compare(this.su_1.o(), byteCount) < 0) {
816
+ if (equalsLong(this.qu_1.kt(this.su_1, new Long(8192, 0)), new Long(-1, -1)))
817
+ return false;
818
+ }
819
+ return true;
820
+ };
821
+ protoOf(RealSource).ns = function () {
822
+ this.ls(new Long(1, 0));
823
+ return this.su_1.ns();
824
+ };
825
+ protoOf(RealSource).it = function (sink, startIndex, endIndex) {
826
+ // Inline function 'kotlinx.io.checkBounds' call
827
+ var size = sink.length;
828
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
829
+ if (equalsLong(this.su_1.o(), new Long(0, 0))) {
830
+ var read = this.qu_1.kt(this.su_1, new Long(8192, 0));
831
+ if (equalsLong(read, new Long(-1, -1)))
832
+ return -1;
833
+ }
834
+ var tmp0 = endIndex - startIndex | 0;
835
+ // Inline function 'kotlinx.io.minOf' call
836
+ var b = this.su_1.o();
837
+ // Inline function 'kotlin.comparisons.minOf' call
838
+ var a = fromInt(tmp0);
839
+ var tmp$ret$2 = compare(a, b) <= 0 ? a : b;
840
+ var toRead = convertToInt(tmp$ret$2);
841
+ return this.su_1.it(sink, startIndex, startIndex + toRead | 0);
842
+ };
843
+ protoOf(RealSource).mt = function (sink, byteCount) {
844
+ try {
845
+ this.ls(byteCount);
846
+ } catch ($p) {
847
+ if ($p instanceof EOFException) {
848
+ var e = $p;
849
+ sink.lt(this.su_1, this.su_1.o());
850
+ throw e;
851
+ } else {
852
+ throw $p;
853
+ }
854
+ }
855
+ this.su_1.mt(sink, byteCount);
856
+ };
857
+ protoOf(RealSource).nt = function (sink) {
858
+ var totalBytesWritten = new Long(0, 0);
859
+ while (!equalsLong(this.qu_1.kt(this.su_1, new Long(8192, 0)), new Long(-1, -1))) {
860
+ var emitByteCount = this.su_1.et();
861
+ if (compare(emitByteCount, new Long(0, 0)) > 0) {
862
+ totalBytesWritten = add(totalBytesWritten, emitByteCount);
863
+ sink.lt(this.su_1, emitByteCount);
864
+ }
865
+ }
866
+ if (compare(this.su_1.o(), new Long(0, 0)) > 0) {
867
+ totalBytesWritten = add(totalBytesWritten, this.su_1.o());
868
+ sink.lt(this.su_1, this.su_1.o());
869
+ }
870
+ return totalBytesWritten;
871
+ };
872
+ protoOf(RealSource).xs = function () {
873
+ this.ls(new Long(2, 0));
874
+ return this.su_1.xs();
875
+ };
876
+ protoOf(RealSource).ot = function () {
877
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
878
+ // Inline function 'kotlin.check' call
879
+ if (!!this.ru_1) {
880
+ var message = 'Source is closed.';
881
+ throw IllegalStateException_init_$Create$(toString(message));
882
+ }
883
+ return buffered(new PeekSource(this));
884
+ };
885
+ protoOf(RealSource).p3 = function () {
886
+ if (this.ru_1)
887
+ return Unit_instance;
888
+ this.ru_1 = true;
889
+ this.qu_1.p3();
890
+ this.su_1.i2();
891
+ };
892
+ protoOf(RealSource).toString = function () {
893
+ return 'buffered(' + toString(this.qu_1) + ')';
894
+ };
895
+ function Segment_init_$Init$($this) {
896
+ Segment.call($this);
897
+ $this.os_1 = new Int8Array(8192);
898
+ $this.ss_1 = true;
899
+ $this.rs_1 = null;
900
+ return $this;
901
+ }
902
+ function Segment_init_$Create$() {
903
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
904
+ }
905
+ function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
906
+ Segment.call($this);
907
+ $this.os_1 = data;
908
+ $this.ps_1 = pos;
909
+ $this.qs_1 = limit;
910
+ $this.rs_1 = shareToken;
911
+ $this.ss_1 = owner;
912
+ return $this;
913
+ }
914
+ function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
915
+ return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
916
+ }
917
+ function Companion() {
918
+ this.tu_1 = 8192;
919
+ this.uu_1 = 1024;
920
+ }
921
+ protoOf(Companion).vu = function () {
922
+ return Segment_init_$Create$();
923
+ };
924
+ var Companion_instance;
925
+ function Companion_getInstance() {
926
+ return Companion_instance;
927
+ }
928
+ protoOf(Segment).yt = function () {
929
+ var tmp0_safe_receiver = this.rs_1;
930
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wu();
931
+ return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
932
+ };
933
+ protoOf(Segment).bt = function () {
934
+ var tmp0_elvis_lhs = this.rs_1;
935
+ var tmp;
936
+ if (tmp0_elvis_lhs == null) {
937
+ // Inline function 'kotlin.also' call
938
+ var this_0 = SegmentPool_instance.xu();
939
+ this.rs_1 = this_0;
940
+ tmp = this_0;
941
+ } else {
942
+ tmp = tmp0_elvis_lhs;
943
+ }
944
+ var t = tmp;
945
+ var tmp_0 = this.ps_1;
946
+ var tmp_1 = this.qs_1;
947
+ // Inline function 'kotlin.also' call
948
+ t.yu();
949
+ return Segment_init_$Create$_0(this.os_1, tmp_0, tmp_1, t, false);
950
+ };
951
+ protoOf(Segment).bu = function () {
952
+ var result = this.ts_1;
953
+ if (!(this.us_1 == null)) {
954
+ ensureNotNull(this.us_1).ts_1 = this.ts_1;
955
+ }
956
+ if (!(this.ts_1 == null)) {
957
+ ensureNotNull(this.ts_1).us_1 = this.us_1;
958
+ }
959
+ this.ts_1 = null;
960
+ this.us_1 = null;
961
+ return result;
962
+ };
963
+ protoOf(Segment).ct = function (segment) {
964
+ segment.us_1 = this;
965
+ segment.ts_1 = this.ts_1;
966
+ if (!(this.ts_1 == null)) {
967
+ ensureNotNull(this.ts_1).us_1 = segment;
968
+ }
969
+ this.ts_1 = segment;
970
+ return segment;
971
+ };
972
+ protoOf(Segment).zt = function (byteCount) {
973
+ // Inline function 'kotlin.require' call
974
+ if (!(byteCount > 0 && byteCount <= (this.qs_1 - this.ps_1 | 0))) {
975
+ var message = 'byteCount out of range';
976
+ throw IllegalArgumentException_init_$Create$(toString(message));
977
+ }
978
+ var prefix;
979
+ if (byteCount >= 1024) {
980
+ prefix = this.bt();
981
+ } else {
982
+ prefix = SegmentPool_instance.st();
983
+ var tmp0 = this.os_1;
984
+ var tmp2 = prefix.os_1;
985
+ var tmp4 = this.ps_1;
986
+ // Inline function 'kotlin.collections.copyInto' call
987
+ var endIndex = this.ps_1 + byteCount | 0;
988
+ // Inline function 'kotlin.js.unsafeCast' call
989
+ // Inline function 'kotlin.js.asDynamic' call
990
+ var tmp = tmp0;
991
+ // Inline function 'kotlin.js.unsafeCast' call
992
+ // Inline function 'kotlin.js.asDynamic' call
993
+ arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
994
+ }
995
+ prefix.qs_1 = prefix.ps_1 + byteCount | 0;
996
+ this.ps_1 = this.ps_1 + byteCount | 0;
997
+ if (!(this.us_1 == null)) {
998
+ ensureNotNull(this.us_1).ct(prefix);
999
+ } else {
1000
+ prefix.ts_1 = this;
1001
+ this.us_1 = prefix;
1002
+ }
1003
+ return prefix;
1004
+ };
1005
+ protoOf(Segment).dt = function () {
1006
+ // Inline function 'kotlin.check' call
1007
+ if (!!(this.us_1 == null)) {
1008
+ var message = 'cannot compact';
1009
+ throw IllegalStateException_init_$Create$(toString(message));
1010
+ }
1011
+ if (!ensureNotNull(this.us_1).ss_1)
1012
+ return this;
1013
+ var byteCount = this.qs_1 - this.ps_1 | 0;
1014
+ var availableByteCount = (8192 - ensureNotNull(this.us_1).qs_1 | 0) + (ensureNotNull(this.us_1).yt() ? 0 : ensureNotNull(this.us_1).ps_1) | 0;
1015
+ if (byteCount > availableByteCount)
1016
+ return this;
1017
+ var predecessor = this.us_1;
1018
+ this.au(ensureNotNull(predecessor), byteCount);
1019
+ var successor = this.bu();
1020
+ // Inline function 'kotlin.check' call
1021
+ if (!(successor == null)) {
1022
+ throw IllegalStateException_init_$Create$('Check failed.');
1023
+ }
1024
+ SegmentPool_instance.iu(this);
1025
+ return predecessor;
1026
+ };
1027
+ protoOf(Segment).eu = function (byte) {
1028
+ var _unary__edvuaz = this.qs_1;
1029
+ this.qs_1 = _unary__edvuaz + 1 | 0;
1030
+ this.os_1[_unary__edvuaz] = byte;
1031
+ };
1032
+ protoOf(Segment).gu = function (short) {
1033
+ var data = this.os_1;
1034
+ var limit = this.qs_1;
1035
+ var _unary__edvuaz = limit;
1036
+ limit = _unary__edvuaz + 1 | 0;
1037
+ data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
1038
+ var _unary__edvuaz_0 = limit;
1039
+ limit = _unary__edvuaz_0 + 1 | 0;
1040
+ data[_unary__edvuaz_0] = toByte(short & 255);
1041
+ this.qs_1 = limit;
1042
+ };
1043
+ protoOf(Segment).ws = function () {
1044
+ var _unary__edvuaz = this.ps_1;
1045
+ this.ps_1 = _unary__edvuaz + 1 | 0;
1046
+ return this.os_1[_unary__edvuaz];
1047
+ };
1048
+ protoOf(Segment).ys = function () {
1049
+ var data = this.os_1;
1050
+ var pos = this.ps_1;
1051
+ var _unary__edvuaz = pos;
1052
+ pos = _unary__edvuaz + 1 | 0;
1053
+ // Inline function 'kotlinx.io.and' call
1054
+ var tmp = (data[_unary__edvuaz] & 255) << 8;
1055
+ var _unary__edvuaz_0 = pos;
1056
+ pos = _unary__edvuaz_0 + 1 | 0;
1057
+ // Inline function 'kotlinx.io.and' call
1058
+ var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
1059
+ var s = toShort(tmp | tmp$ret$1);
1060
+ this.ps_1 = pos;
1061
+ return s;
1062
+ };
1063
+ protoOf(Segment).au = function (sink, byteCount) {
1064
+ // Inline function 'kotlin.check' call
1065
+ if (!sink.ss_1) {
1066
+ var message = 'only owner can write';
1067
+ throw IllegalStateException_init_$Create$(toString(message));
1068
+ }
1069
+ if ((sink.qs_1 + byteCount | 0) > 8192) {
1070
+ if (sink.yt())
1071
+ throw IllegalArgumentException_init_$Create$_0();
1072
+ if (((sink.qs_1 + byteCount | 0) - sink.ps_1 | 0) > 8192)
1073
+ throw IllegalArgumentException_init_$Create$_0();
1074
+ var tmp0 = sink.os_1;
1075
+ var tmp2 = sink.os_1;
1076
+ var tmp4 = sink.ps_1;
1077
+ // Inline function 'kotlin.collections.copyInto' call
1078
+ var endIndex = sink.qs_1;
1079
+ // Inline function 'kotlin.js.unsafeCast' call
1080
+ // Inline function 'kotlin.js.asDynamic' call
1081
+ var tmp = tmp0;
1082
+ // Inline function 'kotlin.js.unsafeCast' call
1083
+ // Inline function 'kotlin.js.asDynamic' call
1084
+ arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
1085
+ sink.qs_1 = sink.qs_1 - sink.ps_1 | 0;
1086
+ sink.ps_1 = 0;
1087
+ }
1088
+ var tmp0_0 = this.os_1;
1089
+ var tmp2_0 = sink.os_1;
1090
+ var tmp4_0 = sink.qs_1;
1091
+ var tmp6 = this.ps_1;
1092
+ // Inline function 'kotlin.collections.copyInto' call
1093
+ var endIndex_0 = this.ps_1 + byteCount | 0;
1094
+ // Inline function 'kotlin.js.unsafeCast' call
1095
+ // Inline function 'kotlin.js.asDynamic' call
1096
+ var tmp_0 = tmp0_0;
1097
+ // Inline function 'kotlin.js.unsafeCast' call
1098
+ // Inline function 'kotlin.js.asDynamic' call
1099
+ arrayCopy(tmp_0, tmp2_0, tmp4_0, tmp6, endIndex_0);
1100
+ sink.qs_1 = sink.qs_1 + byteCount | 0;
1101
+ this.ps_1 = this.ps_1 + byteCount | 0;
1102
+ };
1103
+ protoOf(Segment).jt = function (dst, dstStartOffset, dstEndOffset) {
1104
+ var len = dstEndOffset - dstStartOffset | 0;
1105
+ var tmp0 = this.os_1;
1106
+ var tmp6 = this.ps_1;
1107
+ // Inline function 'kotlin.collections.copyInto' call
1108
+ var endIndex = this.ps_1 + len | 0;
1109
+ // Inline function 'kotlin.js.unsafeCast' call
1110
+ // Inline function 'kotlin.js.asDynamic' call
1111
+ var tmp = tmp0;
1112
+ // Inline function 'kotlin.js.unsafeCast' call
1113
+ // Inline function 'kotlin.js.asDynamic' call
1114
+ arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
1115
+ this.ps_1 = this.ps_1 + len | 0;
1116
+ };
1117
+ protoOf(Segment).vt = function (src, srcStartOffset, srcEndOffset) {
1118
+ var tmp2 = this.os_1;
1119
+ // Inline function 'kotlin.collections.copyInto' call
1120
+ var destinationOffset = this.qs_1;
1121
+ // Inline function 'kotlin.js.unsafeCast' call
1122
+ // Inline function 'kotlin.js.asDynamic' call
1123
+ var tmp = src;
1124
+ // Inline function 'kotlin.js.unsafeCast' call
1125
+ // Inline function 'kotlin.js.asDynamic' call
1126
+ arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
1127
+ this.qs_1 = this.qs_1 + (srcEndOffset - srcStartOffset | 0) | 0;
1128
+ };
1129
+ protoOf(Segment).o = function () {
1130
+ return this.qs_1 - this.ps_1 | 0;
1131
+ };
1132
+ protoOf(Segment).ut = function () {
1133
+ return this.os_1.length - this.qs_1 | 0;
1134
+ };
1135
+ protoOf(Segment).zu = function (readOnly) {
1136
+ return this.os_1;
1137
+ };
1138
+ protoOf(Segment).gt = function (index) {
1139
+ return this.os_1[this.ps_1 + index | 0];
1140
+ };
1141
+ protoOf(Segment).av = function (index, value) {
1142
+ this.os_1[this.qs_1 + index | 0] = value;
1143
+ };
1144
+ protoOf(Segment).bv = function (index, b0, b1) {
1145
+ var d = this.os_1;
1146
+ var l = this.qs_1;
1147
+ d[l + index | 0] = b0;
1148
+ d[(l + index | 0) + 1 | 0] = b1;
1149
+ };
1150
+ protoOf(Segment).cv = function (index, b0, b1, b2) {
1151
+ var d = this.os_1;
1152
+ var l = this.qs_1;
1153
+ d[l + index | 0] = b0;
1154
+ d[(l + index | 0) + 1 | 0] = b1;
1155
+ d[(l + index | 0) + 2 | 0] = b2;
1156
+ };
1157
+ protoOf(Segment).dv = function (index, b0, b1, b2, b3) {
1158
+ var d = this.os_1;
1159
+ var l = this.qs_1;
1160
+ d[l + index | 0] = b0;
1161
+ d[(l + index | 0) + 1 | 0] = b1;
1162
+ d[(l + index | 0) + 2 | 0] = b2;
1163
+ d[(l + index | 0) + 3 | 0] = b3;
1164
+ };
1165
+ function Segment() {
1166
+ this.ps_1 = 0;
1167
+ this.qs_1 = 0;
1168
+ this.rs_1 = null;
1169
+ this.ss_1 = false;
1170
+ this.ts_1 = null;
1171
+ this.us_1 = null;
1172
+ }
1173
+ function isEmpty(_this__u8e3s4) {
1174
+ return _this__u8e3s4.o() === 0;
1175
+ }
1176
+ function SegmentCopyTracker() {
1177
+ }
1178
+ function AlwaysSharedCopyTracker() {
1179
+ AlwaysSharedCopyTracker_instance = this;
1180
+ SegmentCopyTracker.call(this);
1181
+ }
1182
+ protoOf(AlwaysSharedCopyTracker).wu = function () {
1183
+ return true;
1184
+ };
1185
+ protoOf(AlwaysSharedCopyTracker).yu = function () {
1186
+ return Unit_instance;
1187
+ };
1188
+ var AlwaysSharedCopyTracker_instance;
1189
+ function AlwaysSharedCopyTracker_getInstance() {
1190
+ if (AlwaysSharedCopyTracker_instance == null)
1191
+ new AlwaysSharedCopyTracker();
1192
+ return AlwaysSharedCopyTracker_instance;
1193
+ }
1194
+ function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
1195
+ // Inline function 'kotlin.require' call
1196
+ if (!(0 <= startOffset ? startOffset < _this__u8e3s4.o() : false)) {
1197
+ var message = '' + startOffset;
1198
+ throw IllegalArgumentException_init_$Create$(toString(message));
1199
+ }
1200
+ // Inline function 'kotlin.require' call
1201
+ if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.o() : false)) {
1202
+ var message_0 = '' + endOffset;
1203
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1204
+ }
1205
+ var p = _this__u8e3s4.ps_1;
1206
+ var data = _this__u8e3s4.zu(true);
1207
+ var inductionVariable = startOffset;
1208
+ if (inductionVariable < endOffset)
1209
+ do {
1210
+ var idx = inductionVariable;
1211
+ inductionVariable = inductionVariable + 1 | 0;
1212
+ if (data[p + idx | 0] === byte) {
1213
+ return idx;
1214
+ }
1215
+ }
1216
+ while (inductionVariable < endOffset);
1217
+ return -1;
1218
+ }
1219
+ function Sink() {
1220
+ }
1221
+ function Source() {
1222
+ }
1223
+ function readByteArray(_this__u8e3s4) {
1224
+ return readByteArrayImpl(_this__u8e3s4, -1);
1225
+ }
1226
+ function readByteArray_0(_this__u8e3s4, byteCount) {
1227
+ // Inline function 'kotlinx.io.checkByteCount' call
1228
+ var byteCount_0 = fromInt(byteCount);
1229
+ // Inline function 'kotlin.require' call
1230
+ if (!(compare(byteCount_0, new Long(0, 0)) >= 0)) {
1231
+ var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1232
+ throw IllegalArgumentException_init_$Create$(toString(message));
1233
+ }
1234
+ return readByteArrayImpl(_this__u8e3s4, byteCount);
1235
+ }
1236
+ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
1237
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
1238
+ endIndex = endIndex === VOID ? new Long(-1, 2147483647) : endIndex;
1239
+ // Inline function 'kotlin.require' call
1240
+ if (!(compare(new Long(0, 0), startIndex) <= 0 ? compare(startIndex, endIndex) <= 0 : false)) {
1241
+ var tmp;
1242
+ if (compare(endIndex, new Long(0, 0)) < 0) {
1243
+ tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
1244
+ } else {
1245
+ tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
1246
+ }
1247
+ var message = tmp;
1248
+ throw IllegalArgumentException_init_$Create$(toString(message));
1249
+ }
1250
+ if (equalsLong(startIndex, endIndex))
1251
+ return new Long(-1, -1);
1252
+ var offset = startIndex;
1253
+ $l$loop: while (true) {
1254
+ var tmp_0;
1255
+ if (compare(offset, endIndex) < 0) {
1256
+ // Inline function 'kotlin.Long.plus' call
1257
+ var this_0 = offset;
1258
+ var tmp$ret$2 = add(this_0, fromInt(1));
1259
+ tmp_0 = _this__u8e3s4.ms(tmp$ret$2);
1260
+ } else {
1261
+ tmp_0 = false;
1262
+ }
1263
+ if (!tmp_0) {
1264
+ break $l$loop;
1265
+ }
1266
+ var tmp_1 = _this__u8e3s4.js();
1267
+ var tmp_2 = offset;
1268
+ // Inline function 'kotlin.comparisons.minOf' call
1269
+ var b = _this__u8e3s4.js().o();
1270
+ var tmp$ret$3 = compare(endIndex, b) <= 0 ? endIndex : b;
1271
+ var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
1272
+ if (!equalsLong(idx, new Long(-1, -1))) {
1273
+ return idx;
1274
+ }
1275
+ offset = _this__u8e3s4.js().o();
1276
+ }
1277
+ return new Long(-1, -1);
1278
+ }
1279
+ function readByteArrayImpl(_this__u8e3s4, size) {
1280
+ var arraySize = size;
1281
+ if (size === -1) {
1282
+ var fetchSize = new Long(2147483647, 0);
1283
+ while (compare(_this__u8e3s4.js().o(), new Long(2147483647, 0)) < 0 && _this__u8e3s4.ms(fetchSize)) {
1284
+ // Inline function 'kotlin.Long.times' call
1285
+ var this_0 = fetchSize;
1286
+ fetchSize = multiply(this_0, fromInt(2));
1287
+ }
1288
+ // Inline function 'kotlin.check' call
1289
+ if (!(compare(_this__u8e3s4.js().o(), new Long(2147483647, 0)) < 0)) {
1290
+ var message = "Can't create an array of size " + _this__u8e3s4.js().o().toString();
1291
+ throw IllegalStateException_init_$Create$(toString(message));
1292
+ }
1293
+ arraySize = convertToInt(_this__u8e3s4.js().o());
1294
+ } else {
1295
+ _this__u8e3s4.ls(fromInt(size));
1296
+ }
1297
+ var array = new Int8Array(arraySize);
1298
+ readTo(_this__u8e3s4.js(), array);
1299
+ return array;
1300
+ }
1301
+ function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
1302
+ startIndex = startIndex === VOID ? 0 : startIndex;
1303
+ endIndex = endIndex === VOID ? sink.length : endIndex;
1304
+ // Inline function 'kotlinx.io.checkBounds' call
1305
+ var size = sink.length;
1306
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1307
+ var offset = startIndex;
1308
+ while (offset < endIndex) {
1309
+ var bytesRead = _this__u8e3s4.it(sink, offset, endIndex);
1310
+ if (bytesRead === -1) {
1311
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
1312
+ }
1313
+ offset = offset + bytesRead | 0;
1314
+ }
1315
+ }
1316
+ function readString(_this__u8e3s4) {
1317
+ return commonReadUtf8(_this__u8e3s4, _this__u8e3s4.o());
1318
+ }
1319
+ function readString_0(_this__u8e3s4) {
1320
+ _this__u8e3s4.ms(new Long(-1, 2147483647));
1321
+ return commonReadUtf8(_this__u8e3s4.js(), _this__u8e3s4.js().o());
1322
+ }
1323
+ function readString_1(_this__u8e3s4, byteCount) {
1324
+ _this__u8e3s4.ls(byteCount);
1325
+ return commonReadUtf8(_this__u8e3s4.js(), byteCount);
1326
+ }
1327
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
1328
+ startIndex = startIndex === VOID ? 0 : startIndex;
1329
+ endIndex = endIndex === VOID ? string.length : endIndex;
1330
+ // Inline function 'kotlinx.io.checkBounds' call
1331
+ var size = string.length;
1332
+ checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1333
+ // Inline function 'kotlinx.io.writeToInternalBuffer' call
1334
+ // Inline function 'kotlinx.io.commonWriteUtf8' call
1335
+ var this_0 = _this__u8e3s4.js();
1336
+ var i = startIndex;
1337
+ while (i < endIndex) {
1338
+ var p0 = i;
1339
+ // Inline function 'kotlin.code' call
1340
+ var this_1 = charCodeAt(string, p0);
1341
+ var c = Char__toInt_impl_vasixd(this_1);
1342
+ if (c < 128) {
1343
+ $l$block_0: {
1344
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1345
+ var tail = this_0.pt(1);
1346
+ var ctx = get_SegmentWriteContextImpl();
1347
+ var segmentOffset = -i | 0;
1348
+ // Inline function 'kotlin.comparisons.minOf' call
1349
+ var b = i + tail.ut() | 0;
1350
+ var runLimit = Math.min(endIndex, b);
1351
+ var _unary__edvuaz = i;
1352
+ i = _unary__edvuaz + 1 | 0;
1353
+ ctx.hv(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1354
+ $l$loop: while (i < runLimit) {
1355
+ var p0_0 = i;
1356
+ // Inline function 'kotlin.code' call
1357
+ var this_2 = charCodeAt(string, p0_0);
1358
+ c = Char__toInt_impl_vasixd(this_2);
1359
+ if (c >= 128)
1360
+ break $l$loop;
1361
+ var _unary__edvuaz_0 = i;
1362
+ i = _unary__edvuaz_0 + 1 | 0;
1363
+ ctx.hv(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1364
+ }
1365
+ var bytesWritten = i + segmentOffset | 0;
1366
+ if (bytesWritten === 1) {
1367
+ tail.qs_1 = tail.qs_1 + bytesWritten | 0;
1368
+ var tmp = this_0;
1369
+ // Inline function 'kotlin.Long.plus' call
1370
+ var this_3 = this_0.is_1;
1371
+ tmp.is_1 = add(this_3, fromInt(bytesWritten));
1372
+ break $l$block_0;
1373
+ }
1374
+ // Inline function 'kotlin.check' call
1375
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.ut() : false)) {
1376
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.ut();
1377
+ throw IllegalStateException_init_$Create$(toString(message));
1378
+ }
1379
+ if (!(bytesWritten === 0)) {
1380
+ tail.qs_1 = tail.qs_1 + bytesWritten | 0;
1381
+ var tmp_0 = this_0;
1382
+ // Inline function 'kotlin.Long.plus' call
1383
+ var this_4 = this_0.is_1;
1384
+ tmp_0.is_1 = add(this_4, fromInt(bytesWritten));
1385
+ break $l$block_0;
1386
+ }
1387
+ if (isEmpty(tail)) {
1388
+ this_0.ju();
1389
+ }
1390
+ }
1391
+ } else if (c < 2048) {
1392
+ $l$block_2: {
1393
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1394
+ var tail_0 = this_0.pt(2);
1395
+ get_SegmentWriteContextImpl().gv(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1396
+ var bytesWritten_0 = 2;
1397
+ if (bytesWritten_0 === 2) {
1398
+ tail_0.qs_1 = tail_0.qs_1 + bytesWritten_0 | 0;
1399
+ var tmp_1 = this_0;
1400
+ // Inline function 'kotlin.Long.plus' call
1401
+ var this_5 = this_0.is_1;
1402
+ tmp_1.is_1 = add(this_5, fromInt(bytesWritten_0));
1403
+ break $l$block_2;
1404
+ }
1405
+ // Inline function 'kotlin.check' call
1406
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.ut() : false)) {
1407
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.ut();
1408
+ throw IllegalStateException_init_$Create$(toString(message_0));
1409
+ }
1410
+ if (!(bytesWritten_0 === 0)) {
1411
+ tail_0.qs_1 = tail_0.qs_1 + bytesWritten_0 | 0;
1412
+ var tmp_2 = this_0;
1413
+ // Inline function 'kotlin.Long.plus' call
1414
+ var this_6 = this_0.is_1;
1415
+ tmp_2.is_1 = add(this_6, fromInt(bytesWritten_0));
1416
+ break $l$block_2;
1417
+ }
1418
+ if (isEmpty(tail_0)) {
1419
+ this_0.ju();
1420
+ }
1421
+ }
1422
+ i = i + 1 | 0;
1423
+ } else if (c < 55296 || c > 57343) {
1424
+ $l$block_4: {
1425
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1426
+ var tail_1 = this_0.pt(3);
1427
+ get_SegmentWriteContextImpl().fv(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1428
+ var bytesWritten_1 = 3;
1429
+ if (bytesWritten_1 === 3) {
1430
+ tail_1.qs_1 = tail_1.qs_1 + bytesWritten_1 | 0;
1431
+ var tmp_3 = this_0;
1432
+ // Inline function 'kotlin.Long.plus' call
1433
+ var this_7 = this_0.is_1;
1434
+ tmp_3.is_1 = add(this_7, fromInt(bytesWritten_1));
1435
+ break $l$block_4;
1436
+ }
1437
+ // Inline function 'kotlin.check' call
1438
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.ut() : false)) {
1439
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.ut();
1440
+ throw IllegalStateException_init_$Create$(toString(message_1));
1441
+ }
1442
+ if (!(bytesWritten_1 === 0)) {
1443
+ tail_1.qs_1 = tail_1.qs_1 + bytesWritten_1 | 0;
1444
+ var tmp_4 = this_0;
1445
+ // Inline function 'kotlin.Long.plus' call
1446
+ var this_8 = this_0.is_1;
1447
+ tmp_4.is_1 = add(this_8, fromInt(bytesWritten_1));
1448
+ break $l$block_4;
1449
+ }
1450
+ if (isEmpty(tail_1)) {
1451
+ this_0.ju();
1452
+ }
1453
+ }
1454
+ i = i + 1 | 0;
1455
+ } else {
1456
+ var tmp_5;
1457
+ if ((i + 1 | 0) < endIndex) {
1458
+ var p0_1 = i + 1 | 0;
1459
+ // Inline function 'kotlin.code' call
1460
+ var this_9 = charCodeAt(string, p0_1);
1461
+ tmp_5 = Char__toInt_impl_vasixd(this_9);
1462
+ } else {
1463
+ tmp_5 = 0;
1464
+ }
1465
+ var low = tmp_5;
1466
+ if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
1467
+ // Inline function 'kotlin.code' call
1468
+ var this_10 = _Char___init__impl__6a9atx(63);
1469
+ var tmp$ret$26 = Char__toInt_impl_vasixd(this_10);
1470
+ this_0.du(toByte(tmp$ret$26));
1471
+ i = i + 1 | 0;
1472
+ } else {
1473
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
1474
+ $l$block_6: {
1475
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1476
+ var tail_2 = this_0.pt(4);
1477
+ get_SegmentWriteContextImpl().ev(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1478
+ var bytesWritten_2 = 4;
1479
+ if (bytesWritten_2 === 4) {
1480
+ tail_2.qs_1 = tail_2.qs_1 + bytesWritten_2 | 0;
1481
+ var tmp_6 = this_0;
1482
+ // Inline function 'kotlin.Long.plus' call
1483
+ var this_11 = this_0.is_1;
1484
+ tmp_6.is_1 = add(this_11, fromInt(bytesWritten_2));
1485
+ break $l$block_6;
1486
+ }
1487
+ // Inline function 'kotlin.check' call
1488
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.ut() : false)) {
1489
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.ut();
1490
+ throw IllegalStateException_init_$Create$(toString(message_2));
1491
+ }
1492
+ if (!(bytesWritten_2 === 0)) {
1493
+ tail_2.qs_1 = tail_2.qs_1 + bytesWritten_2 | 0;
1494
+ var tmp_7 = this_0;
1495
+ // Inline function 'kotlin.Long.plus' call
1496
+ var this_12 = this_0.is_1;
1497
+ tmp_7.is_1 = add(this_12, fromInt(bytesWritten_2));
1498
+ break $l$block_6;
1499
+ }
1500
+ if (isEmpty(tail_2)) {
1501
+ this_0.ju();
1502
+ }
1503
+ }
1504
+ i = i + 2 | 0;
1505
+ }
1506
+ }
1507
+ }
1508
+ _this__u8e3s4.zs();
1509
+ }
1510
+ function commonReadUtf8(_this__u8e3s4, byteCount) {
1511
+ if (equalsLong(byteCount, new Long(0, 0)))
1512
+ return '';
1513
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1514
+ var curr = _this__u8e3s4.gs_1;
1515
+ while (!(curr == null)) {
1516
+ get_SegmentReadContextImpl();
1517
+ if (compare(fromInt(curr.o()), byteCount) >= 0) {
1518
+ var result = '';
1519
+ // Inline function 'kotlinx.io.unsafe.withData' call
1520
+ var tmp0 = curr.zu(true);
1521
+ var tmp2 = curr.ps_1;
1522
+ var tmp0_0 = curr.qs_1;
1523
+ // Inline function 'kotlin.math.min' call
1524
+ var b = tmp2 + convertToInt(byteCount) | 0;
1525
+ var tmp$ret$0 = Math.min(tmp0_0, b);
1526
+ result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
1527
+ _this__u8e3s4.ht(byteCount);
1528
+ return result;
1529
+ }
1530
+ return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
1531
+ }
1532
+ // Inline function 'kotlin.error' call
1533
+ var message = 'Unreacheable';
1534
+ throw IllegalStateException_init_$Create$(toString(message));
1535
+ }
1536
+ function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
1537
+ beginIndex = beginIndex === VOID ? 0 : beginIndex;
1538
+ endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
1539
+ if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
1540
+ throw IndexOutOfBoundsException_init_$Create$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
1541
+ }
1542
+ var chars = charArray(endIndex - beginIndex | 0);
1543
+ var length = 0;
1544
+ // Inline function 'kotlinx.io.internal.processUtf16Chars' call
1545
+ var index = beginIndex;
1546
+ while (index < endIndex) {
1547
+ var b0 = _this__u8e3s4[index];
1548
+ if (b0 >= 0) {
1549
+ var c = numberToChar(b0);
1550
+ var _unary__edvuaz = length;
1551
+ length = _unary__edvuaz + 1 | 0;
1552
+ chars[_unary__edvuaz] = c;
1553
+ index = index + 1 | 0;
1554
+ while (index < endIndex && _this__u8e3s4[index] >= 0) {
1555
+ var _unary__edvuaz_0 = index;
1556
+ index = _unary__edvuaz_0 + 1 | 0;
1557
+ var c_0 = numberToChar(_this__u8e3s4[_unary__edvuaz_0]);
1558
+ var _unary__edvuaz_1 = length;
1559
+ length = _unary__edvuaz_1 + 1 | 0;
1560
+ chars[_unary__edvuaz_1] = c_0;
1561
+ }
1562
+ } else {
1563
+ // Inline function 'kotlinx.io.shr' call
1564
+ if (b0 >> 5 === -2) {
1565
+ var tmp = index;
1566
+ var tmp2 = index;
1567
+ var tmp$ret$5;
1568
+ $l$block_0: {
1569
+ // Inline function 'kotlinx.io.internal.process2Utf8Bytes' call
1570
+ if (endIndex <= (tmp2 + 1 | 0)) {
1571
+ var c_1 = numberToChar(65533);
1572
+ var _unary__edvuaz_2 = length;
1573
+ length = _unary__edvuaz_2 + 1 | 0;
1574
+ chars[_unary__edvuaz_2] = c_1;
1575
+ tmp$ret$5 = 1;
1576
+ break $l$block_0;
1577
+ }
1578
+ var b0_0 = _this__u8e3s4[tmp2];
1579
+ var b1 = _this__u8e3s4[tmp2 + 1 | 0];
1580
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1581
+ // Inline function 'kotlinx.io.and' call
1582
+ if (!((b1 & 192) === 128)) {
1583
+ var c_2 = numberToChar(65533);
1584
+ var _unary__edvuaz_3 = length;
1585
+ length = _unary__edvuaz_3 + 1 | 0;
1586
+ chars[_unary__edvuaz_3] = c_2;
1587
+ tmp$ret$5 = 1;
1588
+ break $l$block_0;
1589
+ }
1590
+ var codePoint = 3968 ^ b1 ^ b0_0 << 6;
1591
+ if (codePoint < 128) {
1592
+ var c_3 = numberToChar(65533);
1593
+ var _unary__edvuaz_4 = length;
1594
+ length = _unary__edvuaz_4 + 1 | 0;
1595
+ chars[_unary__edvuaz_4] = c_3;
1596
+ } else {
1597
+ var c_4 = numberToChar(codePoint);
1598
+ var _unary__edvuaz_5 = length;
1599
+ length = _unary__edvuaz_5 + 1 | 0;
1600
+ chars[_unary__edvuaz_5] = c_4;
1601
+ }
1602
+ tmp$ret$5 = 2;
1603
+ }
1604
+ index = tmp + tmp$ret$5 | 0;
1605
+ } else {
1606
+ // Inline function 'kotlinx.io.shr' call
1607
+ if (b0 >> 4 === -2) {
1608
+ var tmp_0 = index;
1609
+ var tmp2_0 = index;
1610
+ var tmp$ret$19;
1611
+ $l$block_4: {
1612
+ // Inline function 'kotlinx.io.internal.process3Utf8Bytes' call
1613
+ if (endIndex <= (tmp2_0 + 2 | 0)) {
1614
+ var c_5 = numberToChar(65533);
1615
+ var _unary__edvuaz_6 = length;
1616
+ length = _unary__edvuaz_6 + 1 | 0;
1617
+ chars[_unary__edvuaz_6] = c_5;
1618
+ var tmp_1;
1619
+ if (endIndex <= (tmp2_0 + 1 | 0)) {
1620
+ tmp_1 = true;
1621
+ } else {
1622
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1623
+ // Inline function 'kotlinx.io.and' call
1624
+ tmp_1 = !((_this__u8e3s4[tmp2_0 + 1 | 0] & 192) === 128);
1625
+ }
1626
+ if (tmp_1) {
1627
+ tmp$ret$19 = 1;
1628
+ break $l$block_4;
1629
+ } else {
1630
+ tmp$ret$19 = 2;
1631
+ break $l$block_4;
1632
+ }
1633
+ }
1634
+ var b0_1 = _this__u8e3s4[tmp2_0];
1635
+ var b1_0 = _this__u8e3s4[tmp2_0 + 1 | 0];
1636
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1637
+ // Inline function 'kotlinx.io.and' call
1638
+ if (!((b1_0 & 192) === 128)) {
1639
+ var c_6 = numberToChar(65533);
1640
+ var _unary__edvuaz_7 = length;
1641
+ length = _unary__edvuaz_7 + 1 | 0;
1642
+ chars[_unary__edvuaz_7] = c_6;
1643
+ tmp$ret$19 = 1;
1644
+ break $l$block_4;
1645
+ }
1646
+ var b2 = _this__u8e3s4[tmp2_0 + 2 | 0];
1647
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1648
+ // Inline function 'kotlinx.io.and' call
1649
+ if (!((b2 & 192) === 128)) {
1650
+ var c_7 = numberToChar(65533);
1651
+ var _unary__edvuaz_8 = length;
1652
+ length = _unary__edvuaz_8 + 1 | 0;
1653
+ chars[_unary__edvuaz_8] = c_7;
1654
+ tmp$ret$19 = 2;
1655
+ break $l$block_4;
1656
+ }
1657
+ var codePoint_0 = -123008 ^ b2 ^ b1_0 << 6 ^ b0_1 << 12;
1658
+ if (codePoint_0 < 2048) {
1659
+ var c_8 = numberToChar(65533);
1660
+ var _unary__edvuaz_9 = length;
1661
+ length = _unary__edvuaz_9 + 1 | 0;
1662
+ chars[_unary__edvuaz_9] = c_8;
1663
+ } else if (55296 <= codePoint_0 ? codePoint_0 <= 57343 : false) {
1664
+ var c_9 = numberToChar(65533);
1665
+ var _unary__edvuaz_10 = length;
1666
+ length = _unary__edvuaz_10 + 1 | 0;
1667
+ chars[_unary__edvuaz_10] = c_9;
1668
+ } else {
1669
+ var c_10 = numberToChar(codePoint_0);
1670
+ var _unary__edvuaz_11 = length;
1671
+ length = _unary__edvuaz_11 + 1 | 0;
1672
+ chars[_unary__edvuaz_11] = c_10;
1673
+ }
1674
+ tmp$ret$19 = 3;
1675
+ }
1676
+ index = tmp_0 + tmp$ret$19 | 0;
1677
+ } else {
1678
+ // Inline function 'kotlinx.io.shr' call
1679
+ if (b0 >> 3 === -2) {
1680
+ var tmp_2 = index;
1681
+ var tmp2_1 = index;
1682
+ var tmp$ret$41;
1683
+ $l$block_10: {
1684
+ // Inline function 'kotlinx.io.internal.process4Utf8Bytes' call
1685
+ if (endIndex <= (tmp2_1 + 3 | 0)) {
1686
+ if (!(65533 === 65533)) {
1687
+ var c_11 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1688
+ var _unary__edvuaz_12 = length;
1689
+ length = _unary__edvuaz_12 + 1 | 0;
1690
+ chars[_unary__edvuaz_12] = c_11;
1691
+ var c_12 = numberToChar((65533 & 1023) + 56320 | 0);
1692
+ var _unary__edvuaz_13 = length;
1693
+ length = _unary__edvuaz_13 + 1 | 0;
1694
+ chars[_unary__edvuaz_13] = c_12;
1695
+ } else {
1696
+ var c_13 = _Char___init__impl__6a9atx(65533);
1697
+ var _unary__edvuaz_14 = length;
1698
+ length = _unary__edvuaz_14 + 1 | 0;
1699
+ chars[_unary__edvuaz_14] = c_13;
1700
+ }
1701
+ var tmp_3;
1702
+ if (endIndex <= (tmp2_1 + 1 | 0)) {
1703
+ tmp_3 = true;
1704
+ } else {
1705
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1706
+ // Inline function 'kotlinx.io.and' call
1707
+ tmp_3 = !((_this__u8e3s4[tmp2_1 + 1 | 0] & 192) === 128);
1708
+ }
1709
+ if (tmp_3) {
1710
+ tmp$ret$41 = 1;
1711
+ break $l$block_10;
1712
+ } else {
1713
+ var tmp_4;
1714
+ if (endIndex <= (tmp2_1 + 2 | 0)) {
1715
+ tmp_4 = true;
1716
+ } else {
1717
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1718
+ // Inline function 'kotlinx.io.and' call
1719
+ tmp_4 = !((_this__u8e3s4[tmp2_1 + 2 | 0] & 192) === 128);
1720
+ }
1721
+ if (tmp_4) {
1722
+ tmp$ret$41 = 2;
1723
+ break $l$block_10;
1724
+ } else {
1725
+ tmp$ret$41 = 3;
1726
+ break $l$block_10;
1727
+ }
1728
+ }
1729
+ }
1730
+ var b0_2 = _this__u8e3s4[tmp2_1];
1731
+ var b1_1 = _this__u8e3s4[tmp2_1 + 1 | 0];
1732
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1733
+ // Inline function 'kotlinx.io.and' call
1734
+ if (!((b1_1 & 192) === 128)) {
1735
+ if (!(65533 === 65533)) {
1736
+ var c_14 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1737
+ var _unary__edvuaz_15 = length;
1738
+ length = _unary__edvuaz_15 + 1 | 0;
1739
+ chars[_unary__edvuaz_15] = c_14;
1740
+ var c_15 = numberToChar((65533 & 1023) + 56320 | 0);
1741
+ var _unary__edvuaz_16 = length;
1742
+ length = _unary__edvuaz_16 + 1 | 0;
1743
+ chars[_unary__edvuaz_16] = c_15;
1744
+ } else {
1745
+ var c_16 = _Char___init__impl__6a9atx(65533);
1746
+ var _unary__edvuaz_17 = length;
1747
+ length = _unary__edvuaz_17 + 1 | 0;
1748
+ chars[_unary__edvuaz_17] = c_16;
1749
+ }
1750
+ tmp$ret$41 = 1;
1751
+ break $l$block_10;
1752
+ }
1753
+ var b2_0 = _this__u8e3s4[tmp2_1 + 2 | 0];
1754
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1755
+ // Inline function 'kotlinx.io.and' call
1756
+ if (!((b2_0 & 192) === 128)) {
1757
+ if (!(65533 === 65533)) {
1758
+ var c_17 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1759
+ var _unary__edvuaz_18 = length;
1760
+ length = _unary__edvuaz_18 + 1 | 0;
1761
+ chars[_unary__edvuaz_18] = c_17;
1762
+ var c_18 = numberToChar((65533 & 1023) + 56320 | 0);
1763
+ var _unary__edvuaz_19 = length;
1764
+ length = _unary__edvuaz_19 + 1 | 0;
1765
+ chars[_unary__edvuaz_19] = c_18;
1766
+ } else {
1767
+ var c_19 = _Char___init__impl__6a9atx(65533);
1768
+ var _unary__edvuaz_20 = length;
1769
+ length = _unary__edvuaz_20 + 1 | 0;
1770
+ chars[_unary__edvuaz_20] = c_19;
1771
+ }
1772
+ tmp$ret$41 = 2;
1773
+ break $l$block_10;
1774
+ }
1775
+ var b3 = _this__u8e3s4[tmp2_1 + 3 | 0];
1776
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1777
+ // Inline function 'kotlinx.io.and' call
1778
+ if (!((b3 & 192) === 128)) {
1779
+ if (!(65533 === 65533)) {
1780
+ var c_20 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1781
+ var _unary__edvuaz_21 = length;
1782
+ length = _unary__edvuaz_21 + 1 | 0;
1783
+ chars[_unary__edvuaz_21] = c_20;
1784
+ var c_21 = numberToChar((65533 & 1023) + 56320 | 0);
1785
+ var _unary__edvuaz_22 = length;
1786
+ length = _unary__edvuaz_22 + 1 | 0;
1787
+ chars[_unary__edvuaz_22] = c_21;
1788
+ } else {
1789
+ var c_22 = _Char___init__impl__6a9atx(65533);
1790
+ var _unary__edvuaz_23 = length;
1791
+ length = _unary__edvuaz_23 + 1 | 0;
1792
+ chars[_unary__edvuaz_23] = c_22;
1793
+ }
1794
+ tmp$ret$41 = 3;
1795
+ break $l$block_10;
1796
+ }
1797
+ var codePoint_1 = 3678080 ^ b3 ^ b2_0 << 6 ^ b1_1 << 12 ^ b0_2 << 18;
1798
+ if (codePoint_1 > 1114111) {
1799
+ if (!(65533 === 65533)) {
1800
+ var c_23 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1801
+ var _unary__edvuaz_24 = length;
1802
+ length = _unary__edvuaz_24 + 1 | 0;
1803
+ chars[_unary__edvuaz_24] = c_23;
1804
+ var c_24 = numberToChar((65533 & 1023) + 56320 | 0);
1805
+ var _unary__edvuaz_25 = length;
1806
+ length = _unary__edvuaz_25 + 1 | 0;
1807
+ chars[_unary__edvuaz_25] = c_24;
1808
+ } else {
1809
+ var c_25 = _Char___init__impl__6a9atx(65533);
1810
+ var _unary__edvuaz_26 = length;
1811
+ length = _unary__edvuaz_26 + 1 | 0;
1812
+ chars[_unary__edvuaz_26] = c_25;
1813
+ }
1814
+ } else if (55296 <= codePoint_1 ? codePoint_1 <= 57343 : false) {
1815
+ if (!(65533 === 65533)) {
1816
+ var c_26 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1817
+ var _unary__edvuaz_27 = length;
1818
+ length = _unary__edvuaz_27 + 1 | 0;
1819
+ chars[_unary__edvuaz_27] = c_26;
1820
+ var c_27 = numberToChar((65533 & 1023) + 56320 | 0);
1821
+ var _unary__edvuaz_28 = length;
1822
+ length = _unary__edvuaz_28 + 1 | 0;
1823
+ chars[_unary__edvuaz_28] = c_27;
1824
+ } else {
1825
+ var c_28 = _Char___init__impl__6a9atx(65533);
1826
+ var _unary__edvuaz_29 = length;
1827
+ length = _unary__edvuaz_29 + 1 | 0;
1828
+ chars[_unary__edvuaz_29] = c_28;
1829
+ }
1830
+ } else if (codePoint_1 < 65536) {
1831
+ if (!(65533 === 65533)) {
1832
+ var c_29 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1833
+ var _unary__edvuaz_30 = length;
1834
+ length = _unary__edvuaz_30 + 1 | 0;
1835
+ chars[_unary__edvuaz_30] = c_29;
1836
+ var c_30 = numberToChar((65533 & 1023) + 56320 | 0);
1837
+ var _unary__edvuaz_31 = length;
1838
+ length = _unary__edvuaz_31 + 1 | 0;
1839
+ chars[_unary__edvuaz_31] = c_30;
1840
+ } else {
1841
+ var c_31 = _Char___init__impl__6a9atx(65533);
1842
+ var _unary__edvuaz_32 = length;
1843
+ length = _unary__edvuaz_32 + 1 | 0;
1844
+ chars[_unary__edvuaz_32] = c_31;
1845
+ }
1846
+ } else {
1847
+ if (!(codePoint_1 === 65533)) {
1848
+ var c_32 = numberToChar((codePoint_1 >>> 10 | 0) + 55232 | 0);
1849
+ var _unary__edvuaz_33 = length;
1850
+ length = _unary__edvuaz_33 + 1 | 0;
1851
+ chars[_unary__edvuaz_33] = c_32;
1852
+ var c_33 = numberToChar((codePoint_1 & 1023) + 56320 | 0);
1853
+ var _unary__edvuaz_34 = length;
1854
+ length = _unary__edvuaz_34 + 1 | 0;
1855
+ chars[_unary__edvuaz_34] = c_33;
1856
+ } else {
1857
+ var c_34 = _Char___init__impl__6a9atx(65533);
1858
+ var _unary__edvuaz_35 = length;
1859
+ length = _unary__edvuaz_35 + 1 | 0;
1860
+ chars[_unary__edvuaz_35] = c_34;
1861
+ }
1862
+ }
1863
+ tmp$ret$41 = 4;
1864
+ }
1865
+ index = tmp_2 + tmp$ret$41 | 0;
1866
+ } else {
1867
+ var c_35 = _Char___init__impl__6a9atx(65533);
1868
+ var _unary__edvuaz_36 = length;
1869
+ length = _unary__edvuaz_36 + 1 | 0;
1870
+ chars[_unary__edvuaz_36] = c_35;
1871
+ index = index + 1 | 0;
1872
+ }
1873
+ }
1874
+ }
1875
+ }
1876
+ }
1877
+ return concatToString(chars, 0, length);
1878
+ }
1879
+ function get_SegmentReadContextImpl() {
1880
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1881
+ return SegmentReadContextImpl;
1882
+ }
1883
+ var SegmentReadContextImpl;
1884
+ function get_SegmentWriteContextImpl() {
1885
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
1886
+ return SegmentWriteContextImpl;
1887
+ }
1888
+ var SegmentWriteContextImpl;
1889
+ var BufferIterationContextImpl;
1890
+ function UnsafeBufferOperations() {
1891
+ }
1892
+ var UnsafeBufferOperations_instance;
1893
+ function UnsafeBufferOperations_getInstance() {
1894
+ return UnsafeBufferOperations_instance;
1895
+ }
1896
+ function SegmentReadContextImpl$1() {
1897
+ }
1898
+ protoOf(SegmentReadContextImpl$1).hu = function (segment, offset) {
1899
+ return segment.gt(offset);
1900
+ };
1901
+ function SegmentWriteContextImpl$1() {
1902
+ }
1903
+ protoOf(SegmentWriteContextImpl$1).hv = function (segment, offset, value) {
1904
+ segment.av(offset, value);
1905
+ };
1906
+ protoOf(SegmentWriteContextImpl$1).gv = function (segment, offset, b0, b1) {
1907
+ segment.bv(offset, b0, b1);
1908
+ };
1909
+ protoOf(SegmentWriteContextImpl$1).fv = function (segment, offset, b0, b1, b2) {
1910
+ segment.cv(offset, b0, b1, b2);
1911
+ };
1912
+ protoOf(SegmentWriteContextImpl$1).ev = function (segment, offset, b0, b1, b2, b3) {
1913
+ segment.dv(offset, b0, b1, b2, b3);
1914
+ };
1915
+ function BufferIterationContextImpl$1() {
1916
+ }
1917
+ protoOf(BufferIterationContextImpl$1).hu = function (segment, offset) {
1918
+ return get_SegmentReadContextImpl().hu(segment, offset);
1919
+ };
1920
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1921
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1922
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1923
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1924
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
1925
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1926
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
1927
+ }
1928
+ }
1929
+ function IOException_init_$Init$($this) {
1930
+ Exception_init_$Init$($this);
1931
+ IOException.call($this);
1932
+ return $this;
1933
+ }
1934
+ function IOException_init_$Create$() {
1935
+ var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
1936
+ captureStack(tmp, IOException_init_$Create$);
1937
+ return tmp;
1938
+ }
1939
+ function IOException_init_$Init$_0(message, $this) {
1940
+ Exception_init_$Init$_0(message, $this);
1941
+ IOException.call($this);
1942
+ return $this;
1943
+ }
1944
+ function IOException_init_$Create$_0(message) {
1945
+ var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
1946
+ captureStack(tmp, IOException_init_$Create$_0);
1947
+ return tmp;
1948
+ }
1949
+ function IOException_init_$Init$_1(message, cause, $this) {
1950
+ Exception_init_$Init$_1(message, cause, $this);
1951
+ IOException.call($this);
1952
+ return $this;
1953
+ }
1954
+ function IOException_init_$Create$_1(message, cause) {
1955
+ var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
1956
+ captureStack(tmp, IOException_init_$Create$_1);
1957
+ return tmp;
1958
+ }
1959
+ function IOException() {
1960
+ captureStack(this, IOException);
1961
+ }
1962
+ function EOFException_init_$Init$($this) {
1963
+ IOException_init_$Init$($this);
1964
+ EOFException.call($this);
1965
+ return $this;
1966
+ }
1967
+ function EOFException_init_$Create$() {
1968
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
1969
+ captureStack(tmp, EOFException_init_$Create$);
1970
+ return tmp;
1971
+ }
1972
+ function EOFException_init_$Init$_0(message, $this) {
1973
+ IOException_init_$Init$_0(message, $this);
1974
+ EOFException.call($this);
1975
+ return $this;
1976
+ }
1977
+ function EOFException_init_$Create$_0(message) {
1978
+ var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
1979
+ captureStack(tmp, EOFException_init_$Create$_0);
1980
+ return tmp;
1981
+ }
1982
+ function EOFException() {
1983
+ captureStack(this, EOFException);
1984
+ }
1985
+ function SegmentPool() {
1986
+ this.qt_1 = 0;
1987
+ this.rt_1 = 0;
1988
+ }
1989
+ protoOf(SegmentPool).st = function () {
1990
+ return Companion_instance.vu();
1991
+ };
1992
+ protoOf(SegmentPool).iu = function (segment) {
1993
+ };
1994
+ protoOf(SegmentPool).xu = function () {
1995
+ return AlwaysSharedCopyTracker_getInstance();
1996
+ };
1997
+ var SegmentPool_instance;
1998
+ function SegmentPool_getInstance() {
1999
+ return SegmentPool_instance;
2000
+ }
2001
+ //region block: post-declaration
2002
+ protoOf(Buffer).wt = write$default;
2003
+ //endregion
2004
+ //region block: init
2005
+ Companion_instance = new Companion();
2006
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
2007
+ SegmentPool_instance = new SegmentPool();
2008
+ //endregion
2009
+ //region block: exports
2010
+ _.$_$ = _.$_$ || {};
2011
+ _.$_$.a = EOFException_init_$Create$_0;
2012
+ _.$_$.b = IOException_init_$Init$_0;
2013
+ _.$_$.c = IOException_init_$Create$_0;
2014
+ _.$_$.d = IOException_init_$Init$_1;
2015
+ _.$_$.e = IOException_init_$Create$_1;
2016
+ _.$_$.f = Buffer;
2017
+ _.$_$.g = IOException;
2018
+ _.$_$.h = Source;
2019
+ _.$_$.i = indexOf;
2020
+ _.$_$.j = indexOf_1;
2021
+ _.$_$.k = readByteArray_0;
2022
+ _.$_$.l = readByteArray;
2023
+ _.$_$.m = readByteString;
2024
+ _.$_$.n = readString_0;
2025
+ _.$_$.o = readString_1;
2026
+ _.$_$.p = readString;
2027
+ _.$_$.q = writeString;
2028
+ //endregion
2029
+ return _;
2030
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-io-kotlinx-io-bytestring.js')));
2031
+
2032
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.js.map