game_client_logic_deb 1.8.232 → 1.8.243

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 (44) hide show
  1. package/Kosi-Kaverit-kaverit.js +82 -82
  2. package/Kosi-Kaverit-kaverit.js.map +1 -1
  3. package/Kosi-Kodein-kodein-di.js +735 -730
  4. package/Kosi-Kodein-kodein-di.js.map +1 -1
  5. package/Kotlin-DateTime-library-kotlinx-datetime.js +1556 -1521
  6. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -1
  7. package/Logic_Debertz-core.js +1496 -1496
  8. package/Logic_Debertz-core.js.map +1 -1
  9. package/Logic_Debertz-engine.js +12667 -12525
  10. package/Logic_Debertz-engine.js.map +1 -1
  11. package/Logic_Debertz-game_client.d.ts +11 -6
  12. package/Logic_Debertz-game_client.js +4470 -4455
  13. package/Logic_Debertz-game_client.js.map +1 -1
  14. package/kotlin-kotlin-stdlib.js +2312 -2575
  15. package/kotlin-kotlin-stdlib.js.map +1 -1
  16. package/kotlinx-atomicfu.js +25 -25
  17. package/kotlinx-atomicfu.js.map +1 -1
  18. package/kotlinx-coroutines-core.js +2869 -2875
  19. package/kotlinx-coroutines-core.js.map +1 -1
  20. package/kotlinx-io-kotlinx-io-core.js +978 -577
  21. package/kotlinx-io-kotlinx-io-core.js.map +1 -1
  22. package/kotlinx-serialization-kotlinx-serialization-core.js +2026 -2047
  23. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
  24. package/kotlinx-serialization-kotlinx-serialization-json.js +1556 -1556
  25. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
  26. package/ktor-ktor-client-content-negotiation.js +219 -219
  27. package/ktor-ktor-client-core.js +2533 -2533
  28. package/ktor-ktor-client-logging.js +553 -553
  29. package/ktor-ktor-events.js +12 -12
  30. package/ktor-ktor-http.js +747 -747
  31. package/ktor-ktor-io.js +1648 -1648
  32. package/ktor-ktor-io.js.map +1 -1
  33. package/ktor-ktor-serialization-kotlinx-json.js +8 -8
  34. package/ktor-ktor-serialization-kotlinx.js +273 -273
  35. package/ktor-ktor-serialization.js +131 -131
  36. package/ktor-ktor-utils.js +727 -727
  37. package/ktor-ktor-utils.js.map +1 -1
  38. package/ktor-ktor-websockets.js +60 -60
  39. package/package.json +1 -1
  40. package/raspberry-cardgame-lib-core.js +263 -263
  41. package/raspberry-cardgame-lib-logger.js +102 -102
  42. package/raspberry-cardgame-lib-random.js +984 -984
  43. package/secure-random-secure-random.js +20 -20
  44. package/uuid.js +32 -32
@@ -13,60 +13,63 @@
13
13
  'use strict';
14
14
  //region block: imports
15
15
  var imul = Math.imul;
16
- var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.z1;
17
- var Long = kotlin_kotlin.$_$.ng;
18
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.r1;
19
- var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.v2;
20
- var charArrayOf = kotlin_kotlin.$_$.cb;
21
- var protoOf = kotlin_kotlin.$_$.sc;
22
- var Unit_instance = kotlin_kotlin.$_$.n5;
23
- var ensureNotNull = kotlin_kotlin.$_$.kh;
24
- var toLong = kotlin_kotlin.$_$.uc;
25
- var toString = kotlin_kotlin.$_$.wc;
16
+ var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.a2;
17
+ var Long = kotlin_kotlin.$_$.mg;
18
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s1;
19
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.x2;
20
+ var charArrayOf = kotlin_kotlin.$_$.eb;
21
+ var protoOf = kotlin_kotlin.$_$.uc;
22
+ var Unit_instance = kotlin_kotlin.$_$.p5;
23
+ var ensureNotNull = kotlin_kotlin.$_$.jh;
24
+ var toLong = kotlin_kotlin.$_$.wc;
25
+ var toString = kotlin_kotlin.$_$.yc;
26
26
  var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.e1;
27
- var initMetadataForClass = kotlin_kotlin.$_$.rb;
28
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v1;
29
- var objectCreate = kotlin_kotlin.$_$.rc;
30
- var initMetadataForCompanion = kotlin_kotlin.$_$.sb;
31
- var arrayCopy = kotlin_kotlin.$_$.f6;
32
- var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.p1;
27
+ var initMetadataForClass = kotlin_kotlin.$_$.tb;
28
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.w1;
29
+ var objectCreate = kotlin_kotlin.$_$.tc;
30
+ var initMetadataForCompanion = kotlin_kotlin.$_$.ub;
31
+ var arrayCopy = kotlin_kotlin.$_$.h6;
32
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.q1;
33
+ var initMetadataForObject = kotlin_kotlin.$_$.yb;
33
34
  var VOID = kotlin_kotlin.$_$.f;
34
- var charSequenceGet = kotlin_kotlin.$_$.eb;
35
- var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.b3;
36
- var toByte = kotlin_kotlin.$_$.tc;
37
- var initMetadataForInterface = kotlin_kotlin.$_$.ub;
38
- var startsWith = kotlin_kotlin.$_$.af;
35
+ var charSequenceGet = kotlin_kotlin.$_$.gb;
36
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.d3;
37
+ var toByte = kotlin_kotlin.$_$.vc;
38
+ var initMetadataForInterface = kotlin_kotlin.$_$.wb;
39
39
  var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.f1;
40
- var charSequenceLength = kotlin_kotlin.$_$.fb;
41
- var endsWith = kotlin_kotlin.$_$.ae;
42
- var captureStack = kotlin_kotlin.$_$.bb;
43
- var Exception = kotlin_kotlin.$_$.kg;
44
- var Exception_init_$Init$ = kotlin_kotlin.$_$.l1;
45
- var initMetadataForObject = kotlin_kotlin.$_$.wb;
46
- var THROW_CCE = kotlin_kotlin.$_$.tg;
40
+ var charSequenceLength = kotlin_kotlin.$_$.hb;
41
+ var endsWith = kotlin_kotlin.$_$.ce;
42
+ var startsWith = kotlin_kotlin.$_$.af;
43
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.k1;
44
+ var captureStack = kotlin_kotlin.$_$.db;
45
+ var Exception_init_$Init$_0 = kotlin_kotlin.$_$.l1;
46
+ var Exception_init_$Init$_1 = kotlin_kotlin.$_$.m1;
47
+ var Exception = kotlin_kotlin.$_$.jg;
48
+ var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.m2;
49
+ var KProperty0 = kotlin_kotlin.$_$.od;
50
+ var getPropertyCallableRef = kotlin_kotlin.$_$.qb;
51
+ var lazy = kotlin_kotlin.$_$.ph;
47
52
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.n;
48
- var asReversed = kotlin_kotlin.$_$.h6;
49
- var equals = kotlin_kotlin.$_$.jb;
50
- var contains = kotlin_kotlin.$_$.xd;
51
- var getStringHashCode = kotlin_kotlin.$_$.pb;
52
- var Char = kotlin_kotlin.$_$.dg;
53
- var KProperty0 = kotlin_kotlin.$_$.md;
54
- var getPropertyCallableRef = kotlin_kotlin.$_$.ob;
55
- var lazy = kotlin_kotlin.$_$.qh;
53
+ var asReversed = kotlin_kotlin.$_$.j6;
54
+ var contains = kotlin_kotlin.$_$.zd;
55
+ var getStringHashCode = kotlin_kotlin.$_$.rb;
56
+ var Char = kotlin_kotlin.$_$.cg;
56
57
  //endregion
57
58
  //region block: pre-declaration
58
59
  initMetadataForClass(Buffer, 'Buffer', Buffer);
59
60
  initMetadataForClass(RealSink, 'RealSink');
60
61
  initMetadataForCompanion(Companion);
61
- initMetadataForClass(Segment, 'Segment', Segment_init_$Create$);
62
+ initMetadataForClass(Segment, 'Segment');
63
+ initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
64
+ initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
62
65
  function delete$default(path, mustExist, $super) {
63
66
  mustExist = mustExist === VOID ? true : mustExist;
64
67
  var tmp;
65
68
  if ($super === VOID) {
66
- this.a64(path, mustExist);
69
+ this.s64(path, mustExist);
67
70
  tmp = Unit_instance;
68
71
  } else {
69
- tmp = $super.a64.call(this, path, mustExist);
72
+ tmp = $super.s64.call(this, path, mustExist);
70
73
  }
71
74
  return tmp;
72
75
  }
@@ -74,17 +77,21 @@
74
77
  mustCreate = mustCreate === VOID ? false : mustCreate;
75
78
  var tmp;
76
79
  if ($super === VOID) {
77
- this.c64(path, mustCreate);
80
+ this.u64(path, mustCreate);
78
81
  tmp = Unit_instance;
79
82
  } else {
80
- tmp = $super.c64.call(this, path, mustCreate);
83
+ tmp = $super.u64.call(this, path, mustCreate);
81
84
  }
82
85
  return tmp;
83
86
  }
84
87
  initMetadataForInterface(FileSystem, 'FileSystem');
85
88
  initMetadataForClass(SystemFileSystemImpl, 'SystemFileSystemImpl', VOID, VOID, [FileSystem]);
86
89
  initMetadataForClass(FileMetadata, 'FileMetadata', FileMetadata);
87
- initMetadataForClass(IOException, 'IOException', IOException_init_$Create$_0, Exception);
90
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
91
+ initMetadataForClass(SegmentReadContextImpl$1);
92
+ initMetadataForClass(SegmentWriteContextImpl$1);
93
+ initMetadataForClass(BufferIterationContextImpl$1);
94
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
88
95
  initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
89
96
  initMetadataForObject(SegmentPool, 'SegmentPool');
90
97
  initMetadataForClass(FileNotFoundException, 'FileNotFoundException', VOID, IOException);
@@ -108,7 +115,7 @@
108
115
  }
109
116
  function checkOffsetAndCount(size, offset, byteCount) {
110
117
  _init_properties__Util_kt__g8tcl9();
111
- if (offset.z(new Long(0, 0)) < 0 || offset.z(size) > 0 || size.x2(offset).z(byteCount) < 0 || byteCount.z(new Long(0, 0)) < 0) {
118
+ if (offset.z(new Long(0, 0)) < 0 || offset.z(size) > 0 || size.w2(offset).z(byteCount) < 0 || byteCount.z(new Long(0, 0)) < 0) {
112
119
  throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
113
120
  }
114
121
  }
@@ -121,27 +128,33 @@
121
128
  }
122
129
  }
123
130
  function Buffer() {
124
- this.u62_1 = null;
125
- this.v62_1 = new Long(0, 0);
126
- this.w62_1 = this;
131
+ this.q62_1 = null;
132
+ this.r62_1 = null;
133
+ this.s62_1 = new Long(0, 0);
127
134
  }
128
- protoOf(Buffer).x62 = function () {
129
- return this.w62_1;
135
+ protoOf(Buffer).m = function () {
136
+ return this.s62_1;
137
+ };
138
+ protoOf(Buffer).t62 = function () {
139
+ return this;
130
140
  };
131
- protoOf(Buffer).y62 = function () {
141
+ protoOf(Buffer).u62 = function () {
142
+ return this.m().equals(new Long(0, 0));
143
+ };
144
+ protoOf(Buffer).v62 = function () {
132
145
  return Unit_instance;
133
146
  };
134
- protoOf(Buffer).z62 = function () {
135
- var result = this.v62_1;
147
+ protoOf(Buffer).w62 = function () {
148
+ var result = this.m();
136
149
  if (result.equals(new Long(0, 0)))
137
150
  return new Long(0, 0);
138
- var tail = ensureNotNull(ensureNotNull(this.u62_1).g63_1);
139
- if (tail.c63_1 < 8192 && tail.e63_1) {
140
- result = result.x2(toLong(tail.c63_1 - tail.b63_1 | 0));
151
+ var tail = ensureNotNull(this.r62_1);
152
+ if (tail.z62_1 < 8192 && tail.b63_1) {
153
+ result = result.w2(toLong(tail.z62_1 - tail.y62_1 | 0));
141
154
  }
142
155
  return result;
143
156
  };
144
- protoOf(Buffer).h63 = function (byteCount) {
157
+ protoOf(Buffer).e63 = function (byteCount) {
145
158
  // Inline function 'kotlinx.io.checkByteCount' call
146
159
  // Inline function 'kotlin.require' call
147
160
  // Inline function 'kotlin.contracts.contract' call
@@ -152,30 +165,29 @@
152
165
  }
153
166
  var remainingByteCount = byteCount;
154
167
  while (remainingByteCount.z(new Long(0, 0)) > 0) {
155
- var tmp0_elvis_lhs = this.u62_1;
168
+ var tmp0_elvis_lhs = this.q62_1;
156
169
  var tmp;
157
170
  if (tmp0_elvis_lhs == null) {
158
- throw new EOFException('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
171
+ throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
159
172
  } else {
160
173
  tmp = tmp0_elvis_lhs;
161
174
  }
162
175
  var head = tmp;
163
176
  // Inline function 'kotlinx.io.minOf' call
164
177
  var a = remainingByteCount;
165
- var b = head.c63_1 - head.b63_1 | 0;
178
+ var b = head.z62_1 - head.y62_1 | 0;
166
179
  // Inline function 'kotlin.comparisons.minOf' call
167
180
  var b_0 = toLong(b);
168
181
  var toSkip = (a.z(b_0) <= 0 ? a : b_0).e1();
169
- this.v62_1 = this.v62_1.x2(toLong(toSkip));
170
- remainingByteCount = remainingByteCount.x2(toLong(toSkip));
171
- head.b63_1 = head.b63_1 + toSkip | 0;
172
- if (head.b63_1 === head.c63_1) {
173
- this.u62_1 = head.i63();
174
- SegmentPool_instance.l63(head);
182
+ this.s62_1 = this.s62_1.w2(toLong(toSkip));
183
+ remainingByteCount = remainingByteCount.w2(toLong(toSkip));
184
+ head.y62_1 = head.y62_1 + toSkip | 0;
185
+ if (head.y62_1 === head.z62_1) {
186
+ this.f63();
175
187
  }
176
188
  }
177
189
  };
178
- protoOf(Buffer).m63 = function (minimumCapacity) {
190
+ protoOf(Buffer).g63 = function (minimumCapacity) {
179
191
  // Inline function 'kotlin.require' call
180
192
  // Inline function 'kotlin.contracts.contract' call
181
193
  if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
@@ -183,20 +195,21 @@
183
195
  var message = 'unexpected capacity';
184
196
  throw IllegalArgumentException_init_$Create$(toString(message));
185
197
  }
186
- if (this.u62_1 == null) {
187
- var result = SegmentPool_instance.n63();
188
- this.u62_1 = result;
189
- result.g63_1 = result;
190
- result.f63_1 = result;
198
+ if (this.r62_1 == null) {
199
+ var result = SegmentPool_instance.j63();
200
+ this.q62_1 = result;
201
+ this.r62_1 = result;
191
202
  return result;
192
203
  }
193
- var tail = ensureNotNull(this.u62_1).g63_1;
194
- if ((ensureNotNull(tail).c63_1 + minimumCapacity | 0) > 8192 || !tail.e63_1) {
195
- tail = tail.o63(SegmentPool_instance.n63());
204
+ var t = ensureNotNull(this.r62_1);
205
+ if ((t.z62_1 + minimumCapacity | 0) > 8192 || !t.b63_1) {
206
+ var newTail = t.k63(SegmentPool_instance.j63());
207
+ this.r62_1 = newTail;
208
+ return newTail;
196
209
  }
197
- return tail;
210
+ return t;
198
211
  };
199
- protoOf(Buffer).p63 = function (source, byteCount) {
212
+ protoOf(Buffer).l63 = function (source, byteCount) {
200
213
  // Inline function 'kotlin.require' call
201
214
  // Inline function 'kotlin.contracts.contract' call
202
215
  if (!!(source === this)) {
@@ -204,105 +217,141 @@
204
217
  var message = 'source == this';
205
218
  throw IllegalArgumentException_init_$Create$(toString(message));
206
219
  }
207
- checkOffsetAndCount(source.v62_1, new Long(0, 0), byteCount);
220
+ checkOffsetAndCount(source.s62_1, new Long(0, 0), byteCount);
208
221
  var remainingByteCount = byteCount;
209
222
  while (remainingByteCount.z(new Long(0, 0)) > 0) {
210
- if (remainingByteCount.z(toLong(ensureNotNull(source.u62_1).c63_1 - ensureNotNull(source.u62_1).b63_1 | 0)) < 0) {
211
- var tail = !(this.u62_1 == null) ? ensureNotNull(this.u62_1).g63_1 : null;
223
+ if (remainingByteCount.z(toLong(ensureNotNull(source.q62_1).p63())) < 0) {
224
+ var tail = this.r62_1;
212
225
  var tmp;
213
- if (!(tail == null) && tail.e63_1) {
226
+ if (!(tail == null) && tail.b63_1) {
214
227
  // Inline function 'kotlin.Long.minus' call
215
228
  // Inline function 'kotlin.Long.plus' call
216
229
  var this_0 = remainingByteCount;
217
- var other = tail.c63_1;
218
- var this_1 = this_0.w2(toLong(other));
219
- var other_0 = tail.d63_1 ? 0 : tail.b63_1;
220
- tmp = this_1.x2(toLong(other_0)).z(new Long(8192, 0)) <= 0;
230
+ var other = tail.z62_1;
231
+ var this_1 = this_0.v2(toLong(other));
232
+ var other_0 = tail.m63() ? 0 : tail.y62_1;
233
+ tmp = this_1.w2(toLong(other_0)).z(new Long(8192, 0)) <= 0;
221
234
  } else {
222
235
  tmp = false;
223
236
  }
224
237
  if (tmp) {
225
- ensureNotNull(source.u62_1).r63(tail, remainingByteCount.e1());
226
- source.v62_1 = source.v62_1.x2(remainingByteCount);
227
- this.v62_1 = this.v62_1.w2(remainingByteCount);
238
+ ensureNotNull(source.q62_1).o63(tail, remainingByteCount.e1());
239
+ source.s62_1 = source.s62_1.w2(remainingByteCount);
240
+ this.s62_1 = this.s62_1.v2(remainingByteCount);
228
241
  return Unit_instance;
229
242
  } else {
230
- source.u62_1 = ensureNotNull(source.u62_1).q63(remainingByteCount.e1());
243
+ source.q62_1 = ensureNotNull(source.q62_1).n63(remainingByteCount.e1());
231
244
  }
232
245
  }
233
- var segmentToMove = source.u62_1;
234
- var movedByteCount = toLong(ensureNotNull(segmentToMove).c63_1 - segmentToMove.b63_1 | 0);
235
- source.u62_1 = segmentToMove.i63();
236
- if (this.u62_1 == null) {
237
- this.u62_1 = segmentToMove;
238
- segmentToMove.g63_1 = segmentToMove;
239
- segmentToMove.f63_1 = segmentToMove.g63_1;
246
+ var segmentToMove = ensureNotNull(source.q62_1);
247
+ var movedByteCount = toLong(segmentToMove.p63());
248
+ source.q62_1 = segmentToMove.q63();
249
+ if (source.q62_1 == null) {
250
+ source.r62_1 = null;
251
+ }
252
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
253
+ if (this.q62_1 == null) {
254
+ this.q62_1 = segmentToMove;
255
+ this.r62_1 = segmentToMove;
256
+ } else if (true) {
257
+ this.r62_1 = ensureNotNull(this.r62_1).k63(segmentToMove).r63();
258
+ if (ensureNotNull(this.r62_1).d63_1 == null) {
259
+ this.q62_1 = this.r62_1;
260
+ }
240
261
  } else {
241
- var tail_0 = ensureNotNull(this.u62_1).g63_1;
242
- tail_0 = ensureNotNull(tail_0).o63(segmentToMove);
243
- tail_0.s63();
262
+ this.r62_1 = ensureNotNull(this.r62_1).k63(segmentToMove);
244
263
  }
245
- source.v62_1 = source.v62_1.x2(movedByteCount);
246
- this.v62_1 = this.v62_1.w2(movedByteCount);
247
- remainingByteCount = remainingByteCount.x2(movedByteCount);
264
+ source.s62_1 = source.s62_1.w2(movedByteCount);
265
+ this.s62_1 = this.s62_1.v2(movedByteCount);
266
+ remainingByteCount = remainingByteCount.w2(movedByteCount);
248
267
  }
249
268
  };
250
- protoOf(Buffer).o1y = function (byte) {
251
- var tail = this.m63(1);
252
- var tmp1 = tail.c63_1;
253
- tail.c63_1 = tmp1 + 1 | 0;
254
- tail.a63_1[tmp1] = byte;
255
- this.v62_1 = this.v62_1.w2(new Long(1, 0));
269
+ protoOf(Buffer).k1y = function (byte) {
270
+ this.g63(1).s63(byte);
271
+ this.s62_1 = this.s62_1.v2(new Long(1, 0));
256
272
  };
257
- protoOf(Buffer).x1z = function () {
273
+ protoOf(Buffer).t1z = function () {
258
274
  return Unit_instance;
259
275
  };
260
276
  protoOf(Buffer).toString = function () {
261
- if (this.v62_1.equals(new Long(0, 0)))
277
+ if (this.m().equals(new Long(0, 0)))
262
278
  return 'Buffer(size=0)';
263
279
  var maxPrintableBytes = 64;
264
280
  // Inline function 'kotlinx.io.minOf' call
265
- var b = this.v62_1;
281
+ var b = this.m();
266
282
  // Inline function 'kotlin.comparisons.minOf' call
267
283
  var a = toLong(maxPrintableBytes);
268
284
  var len = (a.z(b) <= 0 ? a : b).e1();
269
- var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.v62_1.z(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
270
- var curr = ensureNotNull(this.u62_1);
285
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.m().z(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
271
286
  var bytesWritten = 0;
272
- var pos = curr.b63_1;
273
- while (bytesWritten < len) {
274
- if (pos === curr.c63_1) {
275
- curr = ensureNotNull(curr.f63_1);
276
- pos = curr.b63_1;
287
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
288
+ var curr = this.q62_1;
289
+ while (!(curr == null)) {
290
+ // Inline function 'kotlinx.io.Buffer.toString.<anonymous>' call
291
+ var ctx = get_SegmentReadContextImpl();
292
+ var segment = curr;
293
+ var idx = 0;
294
+ while (bytesWritten < len && idx < segment.p63()) {
295
+ var _unary__edvuaz = idx;
296
+ idx = _unary__edvuaz + 1 | 0;
297
+ var b_0 = ctx.t63(segment, _unary__edvuaz);
298
+ bytesWritten = bytesWritten + 1 | 0;
299
+ var tmp = get_HEX_DIGIT_CHARS();
300
+ // Inline function 'kotlinx.io.shr' call
301
+ var tmp$ret$2 = b_0 >> 4;
302
+ var tmp_0 = builder.o8(tmp[tmp$ret$2 & 15]);
303
+ var tmp_1 = get_HEX_DIGIT_CHARS();
304
+ // Inline function 'kotlinx.io.and' call
305
+ var tmp$ret$3 = b_0 & 15;
306
+ tmp_0.o8(tmp_1[tmp$ret$3]);
277
307
  }
278
- var tmp = curr.a63_1;
279
- var tmp0 = pos;
280
- pos = tmp0 + 1 | 0;
281
- var b_0 = tmp[tmp0];
282
- bytesWritten = bytesWritten + 1 | 0;
283
- builder.r8(get_HEX_DIGIT_CHARS()[b_0 >> 4 & 15]).r8(get_HEX_DIGIT_CHARS()[b_0 & 15]);
308
+ curr = curr.c63_1;
284
309
  }
285
- if (this.v62_1.z(toLong(maxPrintableBytes)) > 0) {
286
- builder.r8(_Char___init__impl__6a9atx(8230));
310
+ if (this.m().z(toLong(maxPrintableBytes)) > 0) {
311
+ builder.o8(_Char___init__impl__6a9atx(8230));
312
+ }
313
+ return 'Buffer(size=' + this.m().toString() + ' hex=' + builder.toString() + ')';
314
+ };
315
+ protoOf(Buffer).f63 = function () {
316
+ var oldHead = ensureNotNull(this.q62_1);
317
+ var nextHead = oldHead.c63_1;
318
+ this.q62_1 = nextHead;
319
+ if (nextHead == null) {
320
+ this.r62_1 = null;
321
+ } else {
322
+ nextHead.d63_1 = null;
323
+ }
324
+ oldHead.c63_1 = null;
325
+ SegmentPool_instance.u63(oldHead);
326
+ };
327
+ protoOf(Buffer).v63 = function () {
328
+ var oldTail = ensureNotNull(this.r62_1);
329
+ var newTail = oldTail.d63_1;
330
+ this.r62_1 = newTail;
331
+ if (newTail == null) {
332
+ this.q62_1 = null;
333
+ } else {
334
+ newTail.c63_1 = null;
287
335
  }
288
- return 'Buffer(size=' + this.v62_1.toString() + ' hex=' + builder.toString() + ')';
336
+ oldTail.d63_1 = null;
337
+ SegmentPool_instance.u63(oldTail);
289
338
  };
290
339
  function buffered(_this__u8e3s4) {
291
340
  return new RealSink(_this__u8e3s4);
292
341
  }
293
342
  function RealSink(sink) {
294
- this.t63_1 = sink;
295
- this.u63_1 = false;
296
- this.v63_1 = new Buffer();
343
+ this.w63_1 = sink;
344
+ this.x63_1 = false;
345
+ this.y63_1 = new Buffer();
297
346
  }
298
- protoOf(RealSink).x62 = function () {
299
- return this.v63_1;
347
+ protoOf(RealSink).t62 = function () {
348
+ return this.y63_1;
300
349
  };
301
- protoOf(RealSink).p63 = function (source, byteCount) {
350
+ protoOf(RealSink).l63 = function (source, byteCount) {
302
351
  // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
303
352
  // Inline function 'kotlin.check' call
304
353
  // Inline function 'kotlin.contracts.contract' call
305
- if (!!this.u63_1) {
354
+ if (!!this.x63_1) {
306
355
  // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
307
356
  var message = 'Sink is closed.';
308
357
  throw IllegalStateException_init_$Create$(toString(message));
@@ -314,30 +363,30 @@
314
363
  var message_0 = 'byteCount: ' + byteCount.toString();
315
364
  throw IllegalArgumentException_init_$Create$(toString(message_0));
316
365
  }
317
- this.v63_1.p63(source, byteCount);
318
- this.y62();
366
+ this.y63_1.l63(source, byteCount);
367
+ this.v62();
319
368
  };
320
- protoOf(RealSink).y62 = function () {
369
+ protoOf(RealSink).v62 = function () {
321
370
  // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
322
371
  // Inline function 'kotlin.check' call
323
372
  // Inline function 'kotlin.contracts.contract' call
324
- if (!!this.u63_1) {
373
+ if (!!this.x63_1) {
325
374
  // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
326
375
  var message = 'Sink is closed.';
327
376
  throw IllegalStateException_init_$Create$(toString(message));
328
377
  }
329
- var byteCount = this.v63_1.z62();
378
+ var byteCount = this.y63_1.w62();
330
379
  if (byteCount.z(new Long(0, 0)) > 0) {
331
- this.t63_1.p63(this.v63_1, byteCount);
380
+ this.w63_1.l63(this.y63_1, byteCount);
332
381
  }
333
382
  };
334
- protoOf(RealSink).x1z = function () {
335
- if (this.u63_1)
383
+ protoOf(RealSink).t1z = function () {
384
+ if (this.x63_1)
336
385
  return Unit_instance;
337
386
  var thrown = null;
338
387
  try {
339
- if (this.v63_1.v62_1.z(new Long(0, 0)) > 0) {
340
- this.t63_1.p63(this.v63_1, this.v63_1.v62_1);
388
+ if (this.y63_1.m().z(new Long(0, 0)) > 0) {
389
+ this.w63_1.l63(this.y63_1, this.y63_1.m());
341
390
  }
342
391
  } catch ($p) {
343
392
  if ($p instanceof Error) {
@@ -348,7 +397,7 @@
348
397
  }
349
398
  }
350
399
  try {
351
- this.t63_1.x1z();
400
+ this.w63_1.t1z();
352
401
  } catch ($p) {
353
402
  if ($p instanceof Error) {
354
403
  var e_0 = $p;
@@ -358,80 +407,112 @@
358
407
  throw $p;
359
408
  }
360
409
  }
361
- this.u63_1 = true;
410
+ this.x63_1 = true;
362
411
  if (!(thrown == null))
363
412
  throw thrown;
364
413
  };
365
414
  protoOf(RealSink).toString = function () {
366
- return 'buffered(' + toString(this.t63_1) + ')';
415
+ return 'buffered(' + toString(this.w63_1) + ')';
367
416
  };
368
417
  function Segment_init_$Init$($this) {
369
418
  Segment.call($this);
370
- $this.a63_1 = new Int8Array(8192);
371
- $this.e63_1 = true;
372
- $this.d63_1 = false;
419
+ $this.x62_1 = new Int8Array(8192);
420
+ $this.b63_1 = true;
421
+ $this.a63_1 = null;
373
422
  return $this;
374
423
  }
375
424
  function Segment_init_$Create$() {
376
425
  return Segment_init_$Init$(objectCreate(protoOf(Segment)));
377
426
  }
378
- function Segment_init_$Init$_0(data, pos, limit, shared, owner, $this) {
427
+ function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
379
428
  Segment.call($this);
380
- $this.a63_1 = data;
381
- $this.b63_1 = pos;
382
- $this.c63_1 = limit;
383
- $this.d63_1 = shared;
384
- $this.e63_1 = owner;
429
+ $this.x62_1 = data;
430
+ $this.y62_1 = pos;
431
+ $this.z62_1 = limit;
432
+ $this.a63_1 = shareToken;
433
+ $this.b63_1 = owner;
385
434
  return $this;
386
435
  }
387
- function Segment_init_$Create$_0(data, pos, limit, shared, owner) {
388
- return Segment_init_$Init$_0(data, pos, limit, shared, owner, objectCreate(protoOf(Segment)));
436
+ function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
437
+ return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
389
438
  }
390
439
  function Companion() {
391
- this.w63_1 = 8192;
392
- this.x63_1 = 1024;
440
+ this.z63_1 = 8192;
441
+ this.a64_1 = 1024;
393
442
  }
443
+ protoOf(Companion).b64 = function () {
444
+ return Segment_init_$Create$();
445
+ };
394
446
  var Companion_instance;
395
447
  function Companion_getInstance() {
396
448
  return Companion_instance;
397
449
  }
398
- protoOf(Segment).y63 = function () {
399
- this.d63_1 = true;
400
- return Segment_init_$Create$_0(this.a63_1, this.b63_1, this.c63_1, true, false);
450
+ protoOf(Segment).m63 = function () {
451
+ var tmp1_safe_receiver = this.a63_1;
452
+ var tmp0_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.c64();
453
+ return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
401
454
  };
402
- protoOf(Segment).i63 = function () {
403
- var result = !(this.f63_1 === this) ? this.f63_1 : null;
404
- ensureNotNull(this.g63_1).f63_1 = this.f63_1;
405
- ensureNotNull(this.f63_1).g63_1 = this.g63_1;
406
- this.f63_1 = null;
407
- this.g63_1 = null;
455
+ protoOf(Segment).d64 = function () {
456
+ var tmp0_elvis_lhs = this.a63_1;
457
+ var tmp;
458
+ if (tmp0_elvis_lhs == null) {
459
+ // Inline function 'kotlin.also' call
460
+ var this_0 = SegmentPool_instance.e64();
461
+ // Inline function 'kotlin.contracts.contract' call
462
+ // Inline function 'kotlinx.io.Segment.sharedCopy.<anonymous>' call
463
+ this.a63_1 = this_0;
464
+ tmp = this_0;
465
+ } else {
466
+ tmp = tmp0_elvis_lhs;
467
+ }
468
+ var t = tmp;
469
+ var tmp_0 = this.y62_1;
470
+ var tmp_1 = this.z62_1;
471
+ // Inline function 'kotlin.also' call
472
+ // Inline function 'kotlin.contracts.contract' call
473
+ // Inline function 'kotlinx.io.Segment.sharedCopy.<anonymous>' call
474
+ t.f64();
475
+ return Segment_init_$Create$_0(this.x62_1, tmp_0, tmp_1, t, false);
476
+ };
477
+ protoOf(Segment).q63 = function () {
478
+ var result = this.c63_1;
479
+ if (!(this.d63_1 == null)) {
480
+ ensureNotNull(this.d63_1).c63_1 = this.c63_1;
481
+ }
482
+ if (!(this.c63_1 == null)) {
483
+ ensureNotNull(this.c63_1).d63_1 = this.d63_1;
484
+ }
485
+ this.c63_1 = null;
486
+ this.d63_1 = null;
408
487
  return result;
409
488
  };
410
- protoOf(Segment).o63 = function (segment) {
411
- segment.g63_1 = this;
412
- segment.f63_1 = this.f63_1;
413
- ensureNotNull(this.f63_1).g63_1 = segment;
414
- this.f63_1 = segment;
489
+ protoOf(Segment).k63 = function (segment) {
490
+ segment.d63_1 = this;
491
+ segment.c63_1 = this.c63_1;
492
+ if (!(this.c63_1 == null)) {
493
+ ensureNotNull(this.c63_1).d63_1 = segment;
494
+ }
495
+ this.c63_1 = segment;
415
496
  return segment;
416
497
  };
417
- protoOf(Segment).q63 = function (byteCount) {
498
+ protoOf(Segment).n63 = function (byteCount) {
418
499
  // Inline function 'kotlin.require' call
419
500
  // Inline function 'kotlin.contracts.contract' call
420
- if (!(byteCount > 0 && byteCount <= (this.c63_1 - this.b63_1 | 0))) {
501
+ if (!(byteCount > 0 && byteCount <= (this.z62_1 - this.y62_1 | 0))) {
421
502
  // Inline function 'kotlinx.io.Segment.split.<anonymous>' call
422
503
  var message = 'byteCount out of range';
423
504
  throw IllegalArgumentException_init_$Create$(toString(message));
424
505
  }
425
506
  var prefix;
426
507
  if (byteCount >= 1024) {
427
- prefix = this.y63();
508
+ prefix = this.d64();
428
509
  } else {
429
- prefix = SegmentPool_instance.n63();
510
+ prefix = SegmentPool_instance.j63();
430
511
  // Inline function 'kotlin.collections.copyInto' call
431
- var this_0 = this.a63_1;
432
- var destination = prefix.a63_1;
433
- var startIndex = this.b63_1;
434
- var endIndex = this.b63_1 + byteCount | 0;
512
+ var this_0 = this.x62_1;
513
+ var destination = prefix.x62_1;
514
+ var startIndex = this.y62_1;
515
+ var endIndex = this.y62_1 + byteCount | 0;
435
516
  // Inline function 'kotlin.js.unsafeCast' call
436
517
  // Inline function 'kotlin.js.asDynamic' call
437
518
  var tmp = this_0;
@@ -439,161 +520,341 @@
439
520
  // Inline function 'kotlin.js.asDynamic' call
440
521
  arrayCopy(tmp, destination, 0, startIndex, endIndex);
441
522
  }
442
- prefix.c63_1 = prefix.b63_1 + byteCount | 0;
443
- this.b63_1 = this.b63_1 + byteCount | 0;
444
- ensureNotNull(this.g63_1).o63(prefix);
523
+ prefix.z62_1 = prefix.y62_1 + byteCount | 0;
524
+ this.y62_1 = this.y62_1 + byteCount | 0;
525
+ if (!(this.d63_1 == null)) {
526
+ ensureNotNull(this.d63_1).k63(prefix);
527
+ } else {
528
+ prefix.c63_1 = this;
529
+ this.d63_1 = prefix;
530
+ }
445
531
  return prefix;
446
532
  };
447
- protoOf(Segment).s63 = function () {
533
+ protoOf(Segment).r63 = function () {
448
534
  // Inline function 'kotlin.check' call
449
535
  // Inline function 'kotlin.contracts.contract' call
450
- if (!!(this.g63_1 === this)) {
536
+ if (!!(this.d63_1 == null)) {
451
537
  // Inline function 'kotlinx.io.Segment.compact.<anonymous>' call
452
538
  var message = 'cannot compact';
453
539
  throw IllegalStateException_init_$Create$(toString(message));
454
540
  }
455
- if (!ensureNotNull(this.g63_1).e63_1)
456
- return Unit_instance;
457
- var byteCount = this.c63_1 - this.b63_1 | 0;
458
- var availableByteCount = (8192 - ensureNotNull(this.g63_1).c63_1 | 0) + (ensureNotNull(this.g63_1).d63_1 ? 0 : ensureNotNull(this.g63_1).b63_1) | 0;
541
+ if (!ensureNotNull(this.d63_1).b63_1)
542
+ return this;
543
+ var byteCount = this.z62_1 - this.y62_1 | 0;
544
+ var availableByteCount = (8192 - ensureNotNull(this.d63_1).z62_1 | 0) + (ensureNotNull(this.d63_1).m63() ? 0 : ensureNotNull(this.d63_1).y62_1) | 0;
459
545
  if (byteCount > availableByteCount)
460
- return Unit_instance;
461
- this.r63(ensureNotNull(this.g63_1), byteCount);
462
- this.i63();
463
- SegmentPool_instance.l63(this);
546
+ return this;
547
+ var predecessor = this.d63_1;
548
+ this.o63(ensureNotNull(predecessor), byteCount);
549
+ var successor = this.q63();
550
+ // Inline function 'kotlin.check' call
551
+ // Inline function 'kotlin.contracts.contract' call
552
+ // Inline function 'kotlin.check' call
553
+ // Inline function 'kotlin.contracts.contract' call
554
+ if (!(successor == null)) {
555
+ // Inline function 'kotlin.check.<anonymous>' call
556
+ var message_0 = 'Check failed.';
557
+ throw IllegalStateException_init_$Create$(toString(message_0));
558
+ }
559
+ SegmentPool_instance.u63(this);
560
+ return predecessor;
464
561
  };
465
- protoOf(Segment).r63 = function (sink, byteCount) {
562
+ protoOf(Segment).s63 = function (byte) {
563
+ var _unary__edvuaz = this.z62_1;
564
+ this.z62_1 = _unary__edvuaz + 1 | 0;
565
+ this.x62_1[_unary__edvuaz] = byte;
566
+ };
567
+ protoOf(Segment).o63 = function (sink, byteCount) {
466
568
  // Inline function 'kotlin.check' call
467
569
  // Inline function 'kotlin.contracts.contract' call
468
- if (!sink.e63_1) {
570
+ if (!sink.b63_1) {
469
571
  // Inline function 'kotlinx.io.Segment.writeTo.<anonymous>' call
470
572
  var message = 'only owner can write';
471
573
  throw IllegalStateException_init_$Create$(toString(message));
472
574
  }
473
- if ((sink.c63_1 + byteCount | 0) > 8192) {
474
- if (sink.d63_1)
575
+ if ((sink.z62_1 + byteCount | 0) > 8192) {
576
+ if (sink.m63())
475
577
  throw IllegalArgumentException_init_$Create$_0();
476
- if (((sink.c63_1 + byteCount | 0) - sink.b63_1 | 0) > 8192)
578
+ if (((sink.z62_1 + byteCount | 0) - sink.y62_1 | 0) > 8192)
477
579
  throw IllegalArgumentException_init_$Create$_0();
478
580
  // Inline function 'kotlin.collections.copyInto' call
479
- var this_0 = sink.a63_1;
480
- var destination = sink.a63_1;
481
- var startIndex = sink.b63_1;
482
- var endIndex = sink.c63_1;
581
+ var this_0 = sink.x62_1;
582
+ var destination = sink.x62_1;
583
+ var startIndex = sink.y62_1;
584
+ var endIndex = sink.z62_1;
483
585
  // Inline function 'kotlin.js.unsafeCast' call
484
586
  // Inline function 'kotlin.js.asDynamic' call
485
587
  var tmp = this_0;
486
588
  // Inline function 'kotlin.js.unsafeCast' call
487
589
  // Inline function 'kotlin.js.asDynamic' call
488
590
  arrayCopy(tmp, destination, 0, startIndex, endIndex);
489
- sink.c63_1 = sink.c63_1 - sink.b63_1 | 0;
490
- sink.b63_1 = 0;
591
+ sink.z62_1 = sink.z62_1 - sink.y62_1 | 0;
592
+ sink.y62_1 = 0;
491
593
  }
492
594
  // Inline function 'kotlin.collections.copyInto' call
493
- var this_1 = this.a63_1;
494
- var destination_0 = sink.a63_1;
495
- var destinationOffset = sink.c63_1;
496
- var startIndex_0 = this.b63_1;
497
- var endIndex_0 = this.b63_1 + byteCount | 0;
595
+ var this_1 = this.x62_1;
596
+ var destination_0 = sink.x62_1;
597
+ var destinationOffset = sink.z62_1;
598
+ var startIndex_0 = this.y62_1;
599
+ var endIndex_0 = this.y62_1 + byteCount | 0;
498
600
  // Inline function 'kotlin.js.unsafeCast' call
499
601
  // Inline function 'kotlin.js.asDynamic' call
500
602
  var tmp_0 = this_1;
501
603
  // Inline function 'kotlin.js.unsafeCast' call
502
604
  // Inline function 'kotlin.js.asDynamic' call
503
605
  arrayCopy(tmp_0, destination_0, destinationOffset, startIndex_0, endIndex_0);
504
- sink.c63_1 = sink.c63_1 + byteCount | 0;
505
- this.b63_1 = this.b63_1 + byteCount | 0;
606
+ sink.z62_1 = sink.z62_1 + byteCount | 0;
607
+ this.y62_1 = this.y62_1 + byteCount | 0;
608
+ };
609
+ protoOf(Segment).p63 = function () {
610
+ return this.z62_1 - this.y62_1 | 0;
611
+ };
612
+ protoOf(Segment).g64 = function () {
613
+ return this.x62_1.length - this.z62_1 | 0;
614
+ };
615
+ protoOf(Segment).h64 = function (readOnly) {
616
+ return this.x62_1;
617
+ };
618
+ protoOf(Segment).i64 = function (index) {
619
+ return this.x62_1[this.y62_1 + index | 0];
620
+ };
621
+ protoOf(Segment).j64 = function (index, value) {
622
+ this.x62_1[this.z62_1 + index | 0] = value;
623
+ };
624
+ protoOf(Segment).k64 = function (index, b0, b1) {
625
+ var d = this.x62_1;
626
+ var l = this.z62_1;
627
+ d[l + index | 0] = b0;
628
+ d[(l + index | 0) + 1 | 0] = b1;
629
+ };
630
+ protoOf(Segment).l64 = function (index, b0, b1, b2) {
631
+ var d = this.x62_1;
632
+ var l = this.z62_1;
633
+ d[l + index | 0] = b0;
634
+ d[(l + index | 0) + 1 | 0] = b1;
635
+ d[(l + index | 0) + 2 | 0] = b2;
636
+ };
637
+ protoOf(Segment).m64 = function (index, b0, b1, b2, b3) {
638
+ var d = this.x62_1;
639
+ var l = this.z62_1;
640
+ d[l + index | 0] = b0;
641
+ d[(l + index | 0) + 1 | 0] = b1;
642
+ d[(l + index | 0) + 2 | 0] = b2;
643
+ d[(l + index | 0) + 3 | 0] = b3;
506
644
  };
507
645
  function Segment() {
508
- this.b63_1 = 0;
509
- this.c63_1 = 0;
510
- this.d63_1 = false;
511
- this.e63_1 = false;
512
- this.f63_1 = null;
513
- this.g63_1 = null;
646
+ this.y62_1 = 0;
647
+ this.z62_1 = 0;
648
+ this.a63_1 = null;
649
+ this.b63_1 = false;
650
+ this.c63_1 = null;
651
+ this.d63_1 = null;
652
+ }
653
+ function SegmentCopyTracker() {
654
+ }
655
+ function isEmpty(_this__u8e3s4) {
656
+ return _this__u8e3s4.p63() === 0;
657
+ }
658
+ function AlwaysSharedCopyTracker() {
659
+ AlwaysSharedCopyTracker_instance = this;
660
+ SegmentCopyTracker.call(this);
661
+ }
662
+ protoOf(AlwaysSharedCopyTracker).c64 = function () {
663
+ return true;
664
+ };
665
+ protoOf(AlwaysSharedCopyTracker).f64 = function () {
666
+ return Unit_instance;
667
+ };
668
+ var AlwaysSharedCopyTracker_instance;
669
+ function AlwaysSharedCopyTracker_getInstance() {
670
+ if (AlwaysSharedCopyTracker_instance == null)
671
+ new AlwaysSharedCopyTracker();
672
+ return AlwaysSharedCopyTracker_instance;
514
673
  }
515
674
  function writeString(_this__u8e3s4, string, startIndex, endIndex) {
516
675
  startIndex = startIndex === VOID ? 0 : startIndex;
517
676
  endIndex = endIndex === VOID ? string.length : endIndex;
518
- // Inline function 'kotlinx.io.writeString.<anonymous>' call
519
- var it = _this__u8e3s4.x62();
520
- commonWriteUtf8(it, string, startIndex, endIndex);
521
- _this__u8e3s4.y62();
522
- return Unit_instance;
523
- }
524
- function commonWriteUtf8(_this__u8e3s4, string, beginIndex, endIndex) {
525
677
  // Inline function 'kotlinx.io.checkBounds' call
526
678
  var size = string.length;
527
- checkBounds(toLong(size), toLong(beginIndex), toLong(endIndex));
528
- var i = beginIndex;
679
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
680
+ // Inline function 'kotlinx.io.writeToInternalBuffer' call
681
+ // Inline function 'kotlinx.io.writeString.<anonymous>' call
682
+ // Inline function 'kotlinx.io.commonWriteUtf8' call
683
+ var this_0 = _this__u8e3s4.t62();
684
+ var i = startIndex;
529
685
  while (i < endIndex) {
530
686
  // Inline function 'kotlin.code' call
531
- var this_0 = charSequenceGet(string, i);
532
- var c = Char__toInt_impl_vasixd(this_0);
687
+ var p0 = i;
688
+ var this_1 = charSequenceGet(string, p0);
689
+ var c = Char__toInt_impl_vasixd(this_1);
533
690
  if (c < 128) {
534
- var tail = _this__u8e3s4.m63(1);
535
- var data = tail.a63_1;
536
- var segmentOffset = tail.c63_1 - i | 0;
537
- // Inline function 'kotlin.comparisons.minOf' call
538
- var b = 8192 - segmentOffset | 0;
539
- var runLimit = Math.min(endIndex, b);
540
- var tmp0 = i;
541
- i = tmp0 + 1 | 0;
542
- data[segmentOffset + tmp0 | 0] = toByte(c);
543
- $l$loop: while (i < runLimit) {
544
- // Inline function 'kotlin.code' call
545
- var this_1 = charSequenceGet(string, i);
546
- c = Char__toInt_impl_vasixd(this_1);
547
- if (c >= 128)
548
- break $l$loop;
549
- var tmp1 = i;
550
- i = tmp1 + 1 | 0;
551
- data[segmentOffset + tmp1 | 0] = toByte(c);
691
+ $l$block_0: {
692
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
693
+ var tail = this_0.g63(1);
694
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
695
+ var ctx = get_SegmentWriteContextImpl();
696
+ var segmentOffset = -i | 0;
697
+ // Inline function 'kotlin.comparisons.minOf' call
698
+ var b = i + tail.g64() | 0;
699
+ var runLimit = Math.min(endIndex, b);
700
+ var _unary__edvuaz = i;
701
+ i = _unary__edvuaz + 1 | 0;
702
+ ctx.q64(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
703
+ $l$loop: while (i < runLimit) {
704
+ // Inline function 'kotlin.code' call
705
+ var p0_0 = i;
706
+ var this_2 = charSequenceGet(string, p0_0);
707
+ c = Char__toInt_impl_vasixd(this_2);
708
+ if (c >= 128)
709
+ break $l$loop;
710
+ var _unary__edvuaz_0 = i;
711
+ i = _unary__edvuaz_0 + 1 | 0;
712
+ ctx.q64(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
713
+ }
714
+ var bytesWritten = i + segmentOffset | 0;
715
+ if (bytesWritten === 1) {
716
+ tail.z62_1 = tail.z62_1 + bytesWritten | 0;
717
+ var tmp = this_0;
718
+ // Inline function 'kotlin.Long.plus' call
719
+ tmp.s62_1 = this_0.s62_1.v2(toLong(bytesWritten));
720
+ break $l$block_0;
721
+ }
722
+ // Inline function 'kotlin.check' call
723
+ // Inline function 'kotlin.contracts.contract' call
724
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.g64() : false)) {
725
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
726
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.g64();
727
+ throw IllegalStateException_init_$Create$(toString(message));
728
+ }
729
+ if (!(bytesWritten === 0)) {
730
+ tail.z62_1 = tail.z62_1 + bytesWritten | 0;
731
+ var tmp_0 = this_0;
732
+ // Inline function 'kotlin.Long.plus' call
733
+ tmp_0.s62_1 = this_0.s62_1.v2(toLong(bytesWritten));
734
+ break $l$block_0;
735
+ }
736
+ if (isEmpty(tail)) {
737
+ this_0.v63();
738
+ }
552
739
  }
553
- var runSize = (i + segmentOffset | 0) - tail.c63_1 | 0;
554
- tail.c63_1 = tail.c63_1 + runSize | 0;
555
- _this__u8e3s4.v62_1 = _this__u8e3s4.v62_1.w2(toLong(runSize));
556
740
  } else if (c < 2048) {
557
- var tail_0 = _this__u8e3s4.m63(2);
558
- tail_0.a63_1[tail_0.c63_1] = toByte(c >> 6 | 192);
559
- tail_0.a63_1[tail_0.c63_1 + 1 | 0] = toByte(c & 63 | 128);
560
- tail_0.c63_1 = tail_0.c63_1 + 2 | 0;
561
- _this__u8e3s4.v62_1 = _this__u8e3s4.v62_1.w2(new Long(2, 0));
741
+ $l$block_2: {
742
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
743
+ var tail_0 = this_0.g63(2);
744
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
745
+ get_SegmentWriteContextImpl().p64(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
746
+ var bytesWritten_0 = 2;
747
+ if (bytesWritten_0 === 2) {
748
+ tail_0.z62_1 = tail_0.z62_1 + bytesWritten_0 | 0;
749
+ var tmp_1 = this_0;
750
+ // Inline function 'kotlin.Long.plus' call
751
+ tmp_1.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_0));
752
+ break $l$block_2;
753
+ }
754
+ // Inline function 'kotlin.check' call
755
+ // Inline function 'kotlin.contracts.contract' call
756
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.g64() : false)) {
757
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
758
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.g64();
759
+ throw IllegalStateException_init_$Create$(toString(message_0));
760
+ }
761
+ if (!(bytesWritten_0 === 0)) {
762
+ tail_0.z62_1 = tail_0.z62_1 + bytesWritten_0 | 0;
763
+ var tmp_2 = this_0;
764
+ // Inline function 'kotlin.Long.plus' call
765
+ tmp_2.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_0));
766
+ break $l$block_2;
767
+ }
768
+ if (isEmpty(tail_0)) {
769
+ this_0.v63();
770
+ }
771
+ }
562
772
  i = i + 1 | 0;
563
773
  } else if (c < 55296 || c > 57343) {
564
- var tail_1 = _this__u8e3s4.m63(3);
565
- tail_1.a63_1[tail_1.c63_1] = toByte(c >> 12 | 224);
566
- tail_1.a63_1[tail_1.c63_1 + 1 | 0] = toByte(c >> 6 & 63 | 128);
567
- tail_1.a63_1[tail_1.c63_1 + 2 | 0] = toByte(c & 63 | 128);
568
- tail_1.c63_1 = tail_1.c63_1 + 3 | 0;
569
- _this__u8e3s4.v62_1 = _this__u8e3s4.v62_1.w2(new Long(3, 0));
774
+ $l$block_4: {
775
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
776
+ var tail_1 = this_0.g63(3);
777
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
778
+ get_SegmentWriteContextImpl().o64(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
779
+ var bytesWritten_1 = 3;
780
+ if (bytesWritten_1 === 3) {
781
+ tail_1.z62_1 = tail_1.z62_1 + bytesWritten_1 | 0;
782
+ var tmp_3 = this_0;
783
+ // Inline function 'kotlin.Long.plus' call
784
+ tmp_3.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_1));
785
+ break $l$block_4;
786
+ }
787
+ // Inline function 'kotlin.check' call
788
+ // Inline function 'kotlin.contracts.contract' call
789
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.g64() : false)) {
790
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
791
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.g64();
792
+ throw IllegalStateException_init_$Create$(toString(message_1));
793
+ }
794
+ if (!(bytesWritten_1 === 0)) {
795
+ tail_1.z62_1 = tail_1.z62_1 + bytesWritten_1 | 0;
796
+ var tmp_4 = this_0;
797
+ // Inline function 'kotlin.Long.plus' call
798
+ tmp_4.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_1));
799
+ break $l$block_4;
800
+ }
801
+ if (isEmpty(tail_1)) {
802
+ this_0.v63();
803
+ }
804
+ }
570
805
  i = i + 1 | 0;
571
806
  } else {
572
- var tmp;
807
+ var tmp_5;
573
808
  if ((i + 1 | 0) < endIndex) {
574
809
  // Inline function 'kotlin.code' call
575
- var this_2 = charSequenceGet(string, i + 1 | 0);
576
- tmp = Char__toInt_impl_vasixd(this_2);
810
+ var p0_1 = i + 1 | 0;
811
+ var this_3 = charSequenceGet(string, p0_1);
812
+ tmp_5 = Char__toInt_impl_vasixd(this_3);
577
813
  } else {
578
- tmp = 0;
814
+ tmp_5 = 0;
579
815
  }
580
- var low = tmp;
816
+ var low = tmp_5;
581
817
  if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
582
- _this__u8e3s4.o1y(63);
818
+ this_0.k1y(63);
583
819
  i = i + 1 | 0;
584
820
  } else {
585
821
  var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
586
- var tail_2 = _this__u8e3s4.m63(4);
587
- tail_2.a63_1[tail_2.c63_1] = toByte(codePoint >> 18 | 240);
588
- tail_2.a63_1[tail_2.c63_1 + 1 | 0] = toByte(codePoint >> 12 & 63 | 128);
589
- tail_2.a63_1[tail_2.c63_1 + 2 | 0] = toByte(codePoint >> 6 & 63 | 128);
590
- tail_2.a63_1[tail_2.c63_1 + 3 | 0] = toByte(codePoint & 63 | 128);
591
- tail_2.c63_1 = tail_2.c63_1 + 4 | 0;
592
- _this__u8e3s4.v62_1 = _this__u8e3s4.v62_1.w2(new Long(4, 0));
822
+ $l$block_6: {
823
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
824
+ var tail_2 = this_0.g63(4);
825
+ // Inline function 'kotlinx.io.commonWriteUtf8.<anonymous>' call
826
+ get_SegmentWriteContextImpl().n64(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
827
+ var bytesWritten_2 = 4;
828
+ if (bytesWritten_2 === 4) {
829
+ tail_2.z62_1 = tail_2.z62_1 + bytesWritten_2 | 0;
830
+ var tmp_6 = this_0;
831
+ // Inline function 'kotlin.Long.plus' call
832
+ tmp_6.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_2));
833
+ break $l$block_6;
834
+ }
835
+ // Inline function 'kotlin.check' call
836
+ // Inline function 'kotlin.contracts.contract' call
837
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.g64() : false)) {
838
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail.<anonymous>' call
839
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.g64();
840
+ throw IllegalStateException_init_$Create$(toString(message_2));
841
+ }
842
+ if (!(bytesWritten_2 === 0)) {
843
+ tail_2.z62_1 = tail_2.z62_1 + bytesWritten_2 | 0;
844
+ var tmp_7 = this_0;
845
+ // Inline function 'kotlin.Long.plus' call
846
+ tmp_7.s62_1 = this_0.s62_1.v2(toLong(bytesWritten_2));
847
+ break $l$block_6;
848
+ }
849
+ if (isEmpty(tail_2)) {
850
+ this_0.v63();
851
+ }
852
+ }
593
853
  i = i + 2 | 0;
594
854
  }
595
855
  }
596
856
  }
857
+ _this__u8e3s4.v62();
597
858
  }
598
859
  function FileSystem() {
599
860
  }
@@ -603,9 +864,9 @@
603
864
  isRegularFile = isRegularFile === VOID ? false : isRegularFile;
604
865
  isDirectory = isDirectory === VOID ? false : isDirectory;
605
866
  size = size === VOID ? new Long(0, 0) : size;
606
- this.f64_1 = isRegularFile;
607
- this.g64_1 = isDirectory;
608
- this.h64_1 = size;
867
+ this.x64_1 = isRegularFile;
868
+ this.y64_1 = isDirectory;
869
+ this.z64_1 = size;
609
870
  }
610
871
  function removeTrailingSeparators(path, isWindows_) {
611
872
  isWindows_ = isWindows_ === VOID ? get_isWindows() : isWindows_;
@@ -629,6 +890,36 @@
629
890
  }
630
891
  return removeTrailingSeparatorsUnix(path);
631
892
  }
893
+ function Path(base, parts) {
894
+ // Inline function 'kotlin.text.buildString' call
895
+ // Inline function 'kotlin.contracts.contract' call
896
+ // Inline function 'kotlin.apply' call
897
+ var this_0 = StringBuilder_init_$Create$_0();
898
+ // Inline function 'kotlin.contracts.contract' call
899
+ // Inline function 'kotlinx.io.files.Path.<anonymous>' call
900
+ this_0.n8(base);
901
+ // Inline function 'kotlin.collections.forEach' call
902
+ var inductionVariable = 0;
903
+ var last = parts.length;
904
+ while (inductionVariable < last) {
905
+ var element = parts[inductionVariable];
906
+ inductionVariable = inductionVariable + 1 | 0;
907
+ // Inline function 'kotlinx.io.files.Path.<anonymous>.<anonymous>' call
908
+ var tmp;
909
+ // Inline function 'kotlin.text.isNotEmpty' call
910
+ if (charSequenceLength(this_0) > 0) {
911
+ tmp = !endsWith(this_0, get_SystemPathSeparator());
912
+ } else {
913
+ tmp = false;
914
+ }
915
+ if (tmp) {
916
+ this_0.o8(get_SystemPathSeparator());
917
+ }
918
+ this_0.n8(element);
919
+ }
920
+ var tmp$ret$2 = this_0.toString();
921
+ return Path_1(tmp$ret$2);
922
+ }
632
923
  function isUnc(path) {
633
924
  if (path.length < 2)
634
925
  return false;
@@ -670,60 +961,105 @@
670
961
  // Inline function 'kotlin.js.asDynamic' call
671
962
  return path.substring(0, endIndex);
672
963
  }
673
- function Path(base, parts) {
674
- // Inline function 'kotlin.text.buildString' call
675
- // Inline function 'kotlin.contracts.contract' call
676
- // Inline function 'kotlin.apply' call
677
- var this_0 = StringBuilder_init_$Create$_0();
678
- // Inline function 'kotlin.contracts.contract' call
679
- // Inline function 'kotlinx.io.files.Path.<anonymous>' call
680
- this_0.q8(base);
681
- // Inline function 'kotlin.collections.forEach' call
682
- var inductionVariable = 0;
683
- var last = parts.length;
684
- while (inductionVariable < last) {
685
- var element = parts[inductionVariable];
686
- inductionVariable = inductionVariable + 1 | 0;
687
- // Inline function 'kotlinx.io.files.Path.<anonymous>.<anonymous>' call
688
- var tmp;
689
- // Inline function 'kotlin.text.isNotEmpty' call
690
- if (charSequenceLength(this_0) > 0) {
691
- tmp = !endsWith(this_0, get_SystemPathSeparator());
964
+ function get_SegmentReadContextImpl() {
965
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
966
+ return SegmentReadContextImpl;
967
+ }
968
+ var SegmentReadContextImpl;
969
+ function get_SegmentWriteContextImpl() {
970
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
971
+ return SegmentWriteContextImpl;
972
+ }
973
+ var SegmentWriteContextImpl;
974
+ var BufferIterationContextImpl;
975
+ function UnsafeBufferOperations() {
976
+ }
977
+ var UnsafeBufferOperations_instance;
978
+ function UnsafeBufferOperations_getInstance() {
979
+ return UnsafeBufferOperations_instance;
980
+ }
981
+ function SegmentReadContextImpl$1() {
982
+ }
983
+ protoOf(SegmentReadContextImpl$1).t63 = function (segment, offset) {
984
+ return segment.i64(offset);
985
+ };
986
+ function SegmentWriteContextImpl$1() {
987
+ }
988
+ protoOf(SegmentWriteContextImpl$1).q64 = function (segment, offset, value) {
989
+ segment.j64(offset, value);
990
+ };
991
+ protoOf(SegmentWriteContextImpl$1).p64 = function (segment, offset, b0, b1) {
992
+ segment.k64(offset, b0, b1);
993
+ };
994
+ protoOf(SegmentWriteContextImpl$1).o64 = function (segment, offset, b0, b1, b2) {
995
+ segment.l64(offset, b0, b1, b2);
996
+ };
997
+ protoOf(SegmentWriteContextImpl$1).n64 = function (segment, offset, b0, b1, b2, b3) {
998
+ segment.m64(offset, b0, b1, b2, b3);
999
+ };
1000
+ function BufferIterationContextImpl$1() {
1001
+ }
1002
+ protoOf(BufferIterationContextImpl$1).t63 = function (segment, offset) {
1003
+ return get_SegmentReadContextImpl().t63(segment, offset);
1004
+ };
1005
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1006
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1007
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1008
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1009
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
1010
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1011
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
1012
+ }
1013
+ }
1014
+ function withCaughtException(block) {
1015
+ try {
1016
+ block();
1017
+ return null;
1018
+ } catch ($p) {
1019
+ if ($p instanceof Error) {
1020
+ var t = $p;
1021
+ return t;
692
1022
  } else {
693
- tmp = false;
694
- }
695
- if (tmp) {
696
- this_0.r8(get_SystemPathSeparator());
1023
+ throw $p;
697
1024
  }
698
- this_0.q8(element);
699
1025
  }
700
- var tmp$ret$2 = this_0.toString();
701
- return Path_1(tmp$ret$2);
702
1026
  }
703
- function IOException_init_$Init$(message, $this) {
704
- IOException.call($this, message, null);
1027
+ function IOException_init_$Init$($this) {
1028
+ Exception_init_$Init$($this);
1029
+ IOException.call($this);
705
1030
  return $this;
706
1031
  }
707
- function IOException_init_$Create$(message) {
708
- var tmp = IOException_init_$Init$(message, objectCreate(protoOf(IOException)));
1032
+ function IOException_init_$Create$() {
1033
+ var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
709
1034
  captureStack(tmp, IOException_init_$Create$);
710
1035
  return tmp;
711
1036
  }
712
- function IOException_init_$Init$_0($this) {
713
- IOException_init_$Init$(null, $this);
1037
+ function IOException_init_$Init$_0(message, $this) {
1038
+ Exception_init_$Init$_0(message, $this);
1039
+ IOException.call($this);
714
1040
  return $this;
715
1041
  }
716
- function IOException_init_$Create$_0() {
717
- var tmp = IOException_init_$Init$_0(objectCreate(protoOf(IOException)));
1042
+ function IOException_init_$Create$_0(message) {
1043
+ var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
718
1044
  captureStack(tmp, IOException_init_$Create$_0);
719
1045
  return tmp;
720
1046
  }
721
- function IOException(message, cause) {
722
- Exception_init_$Init$(message, cause, this);
1047
+ function IOException_init_$Init$_1(message, cause, $this) {
1048
+ Exception_init_$Init$_1(message, cause, $this);
1049
+ IOException.call($this);
1050
+ return $this;
1051
+ }
1052
+ function IOException_init_$Create$_1(message, cause) {
1053
+ var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
1054
+ captureStack(tmp, IOException_init_$Create$_1);
1055
+ return tmp;
1056
+ }
1057
+ function IOException() {
723
1058
  captureStack(this, IOException);
724
1059
  }
725
1060
  function EOFException_init_$Init$($this) {
726
- EOFException.call($this, null);
1061
+ IOException_init_$Init$($this);
1062
+ EOFException.call($this);
727
1063
  return $this;
728
1064
  }
729
1065
  function EOFException_init_$Create$() {
@@ -731,112 +1067,257 @@
731
1067
  captureStack(tmp, EOFException_init_$Create$);
732
1068
  return tmp;
733
1069
  }
734
- function EOFException(message) {
735
- IOException_init_$Init$(message, this);
1070
+ function EOFException_init_$Init$_0(message, $this) {
1071
+ IOException_init_$Init$_0(message, $this);
1072
+ EOFException.call($this);
1073
+ return $this;
1074
+ }
1075
+ function EOFException_init_$Create$_0(message) {
1076
+ var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
1077
+ captureStack(tmp, EOFException_init_$Create$_0);
1078
+ return tmp;
1079
+ }
1080
+ function EOFException() {
736
1081
  captureStack(this, EOFException);
737
1082
  }
738
1083
  function SegmentPool() {
739
- this.j63_1 = 0;
740
- this.k63_1 = 0;
1084
+ this.h63_1 = 0;
1085
+ this.i63_1 = 0;
741
1086
  }
742
- protoOf(SegmentPool).n63 = function () {
743
- return Segment_init_$Create$();
1087
+ protoOf(SegmentPool).j63 = function () {
1088
+ return Companion_instance.b64();
1089
+ };
1090
+ protoOf(SegmentPool).u63 = function (segment) {
744
1091
  };
745
- protoOf(SegmentPool).l63 = function (segment) {
1092
+ protoOf(SegmentPool).e64 = function () {
1093
+ return AlwaysSharedCopyTracker_getInstance();
746
1094
  };
747
1095
  var SegmentPool_instance;
748
1096
  function SegmentPool_getInstance() {
749
1097
  return SegmentPool_instance;
750
1098
  }
1099
+ function get_path() {
1100
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1101
+ // Inline function 'kotlin.getValue' call
1102
+ var this_0 = path$delegate;
1103
+ path$factory();
1104
+ return this_0.u();
1105
+ }
1106
+ var path$delegate;
1107
+ function get_fs() {
1108
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1109
+ // Inline function 'kotlin.getValue' call
1110
+ var this_0 = fs$delegate;
1111
+ fs$factory();
1112
+ return this_0.u();
1113
+ }
1114
+ var fs$delegate;
1115
+ function get_os() {
1116
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1117
+ // Inline function 'kotlin.getValue' call
1118
+ var this_0 = os$delegate;
1119
+ os$factory();
1120
+ return this_0.u();
1121
+ }
1122
+ var os$delegate;
1123
+ function get_buffer() {
1124
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1125
+ // Inline function 'kotlin.getValue' call
1126
+ var this_0 = buffer$delegate;
1127
+ buffer$factory();
1128
+ return this_0.u();
1129
+ }
1130
+ var buffer$delegate;
1131
+ function path$delegate$lambda() {
1132
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1133
+ var tmp;
1134
+ try {
1135
+ tmp = eval('require')('path');
1136
+ } catch ($p) {
1137
+ var tmp_0;
1138
+ if ($p instanceof Error) {
1139
+ var e = $p;
1140
+ throw UnsupportedOperationException_init_$Create$("Module 'path' could not be imported", e);
1141
+ } else {
1142
+ throw $p;
1143
+ }
1144
+ }
1145
+ return tmp;
1146
+ }
1147
+ function fs$delegate$lambda() {
1148
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1149
+ var tmp;
1150
+ try {
1151
+ tmp = eval('require')('fs');
1152
+ } catch ($p) {
1153
+ var tmp_0;
1154
+ if ($p instanceof Error) {
1155
+ var e = $p;
1156
+ throw UnsupportedOperationException_init_$Create$("Module 'fs' could not be imported", e);
1157
+ } else {
1158
+ throw $p;
1159
+ }
1160
+ }
1161
+ return tmp;
1162
+ }
1163
+ function os$delegate$lambda() {
1164
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1165
+ var tmp;
1166
+ try {
1167
+ tmp = eval('require')('os');
1168
+ } catch ($p) {
1169
+ var tmp_0;
1170
+ if ($p instanceof Error) {
1171
+ var e = $p;
1172
+ throw UnsupportedOperationException_init_$Create$("Module 'os' could not be imported", e);
1173
+ } else {
1174
+ throw $p;
1175
+ }
1176
+ }
1177
+ return tmp;
1178
+ }
1179
+ function buffer$delegate$lambda() {
1180
+ _init_properties_nodeModulesJs_kt__ngjjzw();
1181
+ var tmp;
1182
+ try {
1183
+ tmp = eval('require')('buffer');
1184
+ } catch ($p) {
1185
+ var tmp_0;
1186
+ if ($p instanceof Error) {
1187
+ var e = $p;
1188
+ throw UnsupportedOperationException_init_$Create$("Module 'buffer' could not be imported", e);
1189
+ } else {
1190
+ throw $p;
1191
+ }
1192
+ }
1193
+ return tmp;
1194
+ }
1195
+ function path$factory() {
1196
+ return getPropertyCallableRef('path', 0, KProperty0, function () {
1197
+ return get_path();
1198
+ }, null);
1199
+ }
1200
+ function fs$factory() {
1201
+ return getPropertyCallableRef('fs', 0, KProperty0, function () {
1202
+ return get_fs();
1203
+ }, null);
1204
+ }
1205
+ function os$factory() {
1206
+ return getPropertyCallableRef('os', 0, KProperty0, function () {
1207
+ return get_os();
1208
+ }, null);
1209
+ }
1210
+ function buffer$factory() {
1211
+ return getPropertyCallableRef('buffer', 0, KProperty0, function () {
1212
+ return get_buffer();
1213
+ }, null);
1214
+ }
1215
+ var properties_initialized_nodeModulesJs_kt_oooz8e;
1216
+ function _init_properties_nodeModulesJs_kt__ngjjzw() {
1217
+ if (!properties_initialized_nodeModulesJs_kt_oooz8e) {
1218
+ properties_initialized_nodeModulesJs_kt_oooz8e = true;
1219
+ path$delegate = lazy(path$delegate$lambda);
1220
+ fs$delegate = lazy(fs$delegate$lambda);
1221
+ os$delegate = lazy(os$delegate$lambda);
1222
+ buffer$delegate = lazy(buffer$delegate$lambda);
1223
+ }
1224
+ }
751
1225
  function get_SystemFileSystem() {
752
- _init_properties_FileSystemJs_kt__4boaac();
1226
+ _init_properties_FileSystemNodeJs_kt__m4c3u();
753
1227
  return SystemFileSystem;
754
1228
  }
755
1229
  var SystemFileSystem;
756
1230
  function get_isWindows() {
757
- _init_properties_FileSystemJs_kt__4boaac();
1231
+ _init_properties_FileSystemNodeJs_kt__m4c3u();
758
1232
  return isWindows;
759
1233
  }
760
1234
  var isWindows;
761
1235
  function FileNotFoundException(message) {
762
- IOException_init_$Init$(message, this);
1236
+ IOException_init_$Init$_0(message, this);
763
1237
  captureStack(this, FileNotFoundException);
764
1238
  }
765
1239
  function get_SystemTemporaryDirectory() {
766
- _init_properties_FileSystemJs_kt__4boaac();
767
- // Inline function 'kotlin.check' call
768
- // Inline function 'kotlin.contracts.contract' call
769
- if (!(get_os() !== null)) {
770
- // Inline function 'kotlinx.io.files.<get-SystemTemporaryDirectory>.<anonymous>' call
771
- var message = "Module 'os' was not found";
772
- throw IllegalStateException_init_$Create$(toString(message));
773
- }
774
- var tmp = get_os().tmpdir();
775
- var tmp0_elvis_lhs = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : null;
1240
+ _init_properties_FileSystemNodeJs_kt__m4c3u();
1241
+ var tmp0_elvis_lhs = get_os().tmpdir();
776
1242
  return Path_1(tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
777
1243
  }
1244
+ function SystemFileSystem$o$delete$lambda($path) {
1245
+ return function () {
1246
+ var tmp0_elvis_lhs = get_fs().statSync($path.a65_1);
1247
+ var tmp;
1248
+ if (tmp0_elvis_lhs == null) {
1249
+ throw new FileNotFoundException('File does not exist: ' + $path.toString());
1250
+ } else {
1251
+ tmp = tmp0_elvis_lhs;
1252
+ }
1253
+ var stats = tmp;
1254
+ var tmp_0;
1255
+ if (stats.isDirectory()) {
1256
+ get_fs().rmdirSync($path.a65_1);
1257
+ tmp_0 = Unit_instance;
1258
+ } else {
1259
+ get_fs().rmSync($path.a65_1);
1260
+ tmp_0 = Unit_instance;
1261
+ }
1262
+ return Unit_instance;
1263
+ };
1264
+ }
1265
+ function SystemFileSystem$o$metadataOrNull$lambda($path, $metadata) {
1266
+ return function () {
1267
+ var tmp0_elvis_lhs = get_fs().statSync($path.a65_1);
1268
+ var tmp;
1269
+ if (tmp0_elvis_lhs == null) {
1270
+ return Unit_instance;
1271
+ } else {
1272
+ tmp = tmp0_elvis_lhs;
1273
+ }
1274
+ var stat = tmp;
1275
+ var mode = stat.mode;
1276
+ var isFile = (mode & get_fs().constants.S_IFMT) === get_fs().constants.S_IFREG;
1277
+ $metadata._v = new FileMetadata(isFile, (mode & get_fs().constants.S_IFMT) === get_fs().constants.S_IFDIR, isFile ? toLong(stat.size) : new Long(-1, -1));
1278
+ return Unit_instance;
1279
+ };
1280
+ }
778
1281
  function SystemFileSystem$1() {
779
1282
  SystemFileSystemImpl.call(this);
780
1283
  }
781
- protoOf(SystemFileSystem$1).z63 = function (path) {
782
- // Inline function 'kotlin.check' call
783
- // Inline function 'kotlin.contracts.contract' call
784
- if (!(get_fs() !== null)) {
785
- // Inline function 'kotlinx.io.files.<no name provided>.exists.<anonymous>' call
786
- var message = "Module 'fs' was not found";
787
- throw IllegalStateException_init_$Create$(toString(message));
788
- }
789
- var tmp = get_fs().existsSync(path.i64_1);
790
- return (!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE();
1284
+ protoOf(SystemFileSystem$1).r64 = function (path) {
1285
+ return get_fs().existsSync(path.a65_1);
791
1286
  };
792
- protoOf(SystemFileSystem$1).a64 = function (path, mustExist) {
793
- // Inline function 'kotlin.check' call
794
- // Inline function 'kotlin.contracts.contract' call
795
- if (!(get_fs() !== null)) {
796
- // Inline function 'kotlinx.io.files.<no name provided>.delete.<anonymous>' call
797
- var message = "Module 'fs' was not found";
798
- throw IllegalStateException_init_$Create$(toString(message));
799
- }
800
- if (!this.z63(path)) {
1287
+ protoOf(SystemFileSystem$1).s64 = function (path, mustExist) {
1288
+ if (!this.r64(path)) {
801
1289
  if (mustExist) {
802
- throw new FileNotFoundException('File does not exist: ' + path.i64_1);
1290
+ throw new FileNotFoundException('File does not exist: ' + path.toString());
803
1291
  }
804
1292
  return Unit_instance;
805
1293
  }
806
- try {
807
- var stats = get_fs().statSync(path.i64_1);
808
- var tmp = stats.isDirectory();
809
- if ((!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE()) {
810
- get_fs().rmdirSync(path.i64_1);
811
- } else {
812
- get_fs().rmSync(path.i64_1);
813
- }
814
- } catch ($p) {
815
- if ($p instanceof Error) {
816
- var t = $p;
817
- throw new IOException('Delete failed for ' + path.toString(), t);
818
- } else {
819
- throw $p;
820
- }
1294
+ var tmp0_safe_receiver = withCaughtException(SystemFileSystem$o$delete$lambda(path));
1295
+ if (tmp0_safe_receiver == null)
1296
+ null;
1297
+ else {
1298
+ // Inline function 'kotlin.also' call
1299
+ // Inline function 'kotlin.contracts.contract' call
1300
+ // Inline function 'kotlinx.io.files.<no name provided>.delete.<anonymous>' call
1301
+ throw IOException_init_$Create$_1('Delete failed for ' + path.toString(), tmp0_safe_receiver);
821
1302
  }
822
1303
  };
823
- protoOf(SystemFileSystem$1).c64 = function (path, mustCreate) {
824
- var metadata = this.j64(path);
1304
+ protoOf(SystemFileSystem$1).u64 = function (path, mustCreate) {
1305
+ var metadata = this.b65(path);
825
1306
  if (!(metadata == null)) {
826
1307
  if (mustCreate) {
827
- throw IOException_init_$Create$('Path already exists: ' + path.toString());
1308
+ throw IOException_init_$Create$_0('Path already exists: ' + path.toString());
828
1309
  }
829
- if (metadata.f64_1) {
830
- throw IOException_init_$Create$("Path already exists and it's a file: " + path.toString());
1310
+ if (metadata.x64_1) {
1311
+ throw IOException_init_$Create$_0("Path already exists and it's a file: " + path.toString());
831
1312
  }
832
1313
  return Unit_instance;
833
1314
  }
834
1315
  // Inline function 'kotlin.collections.arrayListOf' call
835
1316
  var parts = ArrayList_init_$Create$();
836
1317
  var p = path;
837
- while (!(p == null) && !this.z63(p)) {
1318
+ while (!(p == null) && !this.r64(p)) {
838
1319
  parts.e(p.toString());
839
- p = p.ep();
1320
+ p = p.bp();
840
1321
  }
841
1322
  // Inline function 'kotlin.collections.forEach' call
842
1323
  var tmp0_iterator = asReversed(parts).j();
@@ -846,71 +1327,34 @@
846
1327
  get_fs().mkdirSync(element);
847
1328
  }
848
1329
  };
849
- protoOf(SystemFileSystem$1).j64 = function (path) {
850
- // Inline function 'kotlin.check' call
851
- // Inline function 'kotlin.contracts.contract' call
852
- if (!(get_fs() !== null)) {
1330
+ protoOf(SystemFileSystem$1).b65 = function (path) {
1331
+ if (!this.r64(path))
1332
+ return null;
1333
+ var metadata = {_v: null};
1334
+ var tmp2_safe_receiver = withCaughtException(SystemFileSystem$o$metadataOrNull$lambda(path, metadata));
1335
+ if (tmp2_safe_receiver == null)
1336
+ null;
1337
+ else {
1338
+ // Inline function 'kotlin.also' call
1339
+ // Inline function 'kotlin.contracts.contract' call
853
1340
  // Inline function 'kotlinx.io.files.<no name provided>.metadataOrNull.<anonymous>' call
854
- var message = "Module 'fs' was not found";
855
- throw IllegalStateException_init_$Create$(toString(message));
856
- }
857
- var tmp;
858
- try {
859
- var stat = get_fs().statSync(path.i64_1);
860
- var tmp_0 = stat.mode;
861
- var mode = (!(tmp_0 == null) ? typeof tmp_0 === 'number' : false) ? tmp_0 : THROW_CCE();
862
- var tmp_1 = get_fs().constants.S_IFMT;
863
- var isFile = equals(mode & ((!(tmp_1 == null) ? typeof tmp_1 === 'number' : false) ? tmp_1 : THROW_CCE()), get_fs().constants.S_IFREG);
864
- var tmp_2 = get_fs().constants.S_IFMT;
865
- var tmp_3 = equals(mode & ((!(tmp_2 == null) ? typeof tmp_2 === 'number' : false) ? tmp_2 : THROW_CCE()), get_fs().constants.S_IFDIR);
866
- var tmp_4;
867
- if (isFile) {
868
- var tmp_5 = stat.size;
869
- tmp_4 = toLong((!(tmp_5 == null) ? typeof tmp_5 === 'number' : false) ? tmp_5 : THROW_CCE());
870
- } else {
871
- tmp_4 = new Long(-1, -1);
872
- }
873
- tmp = new FileMetadata(isFile, tmp_3, tmp_4);
874
- } catch ($p) {
875
- var tmp_6;
876
- if ($p instanceof Error) {
877
- var t = $p;
878
- if (this.z63(path))
879
- throw new IOException('Stat failed for ' + path.toString(), t);
880
- return null;
881
- } else {
882
- throw $p;
883
- }
1341
+ throw IOException_init_$Create$_1('Stat failed for ' + path.toString(), tmp2_safe_receiver);
884
1342
  }
885
- return tmp;
1343
+ return metadata._v;
886
1344
  };
887
- protoOf(SystemFileSystem$1).e64 = function (path, append) {
888
- // Inline function 'kotlin.check' call
889
- // Inline function 'kotlin.contracts.contract' call
890
- if (!(get_fs() !== null)) {
891
- // Inline function 'kotlinx.io.files.<no name provided>.sink.<anonymous>' call
892
- var message = "Module 'fs' was not found";
893
- throw IllegalStateException_init_$Create$(toString(message));
894
- }
895
- // Inline function 'kotlin.check' call
896
- // Inline function 'kotlin.contracts.contract' call
897
- if (!(get_buffer() !== null)) {
898
- // Inline function 'kotlinx.io.files.<no name provided>.sink.<anonymous>' call
899
- var message_0 = "Module 'buffer' was not found";
900
- throw IllegalStateException_init_$Create$(toString(message_0));
901
- }
1345
+ protoOf(SystemFileSystem$1).w64 = function (path, append) {
902
1346
  return new FileSink(path, append);
903
1347
  };
904
- var properties_initialized_FileSystemJs_kt_lg8f5i;
905
- function _init_properties_FileSystemJs_kt__4boaac() {
906
- if (!properties_initialized_FileSystemJs_kt_lg8f5i) {
907
- properties_initialized_FileSystemJs_kt_lg8f5i = true;
1348
+ var properties_initialized_FileSystemNodeJs_kt_vmmd20;
1349
+ function _init_properties_FileSystemNodeJs_kt__m4c3u() {
1350
+ if (!properties_initialized_FileSystemNodeJs_kt_vmmd20) {
1351
+ properties_initialized_FileSystemNodeJs_kt_vmmd20 = true;
908
1352
  SystemFileSystem = new SystemFileSystem$1();
909
- isWindows = get_os().platform() == 'win32';
1353
+ isWindows = get_os().platform() === 'win32';
910
1354
  }
911
1355
  }
912
1356
  function get_SystemPathSeparator() {
913
- _init_properties_PathsJs_kt__cx5uqj();
1357
+ _init_properties_PathsNodeJs_kt__bvvvsp();
914
1358
  // Inline function 'kotlin.getValue' call
915
1359
  var this_0 = SystemPathSeparator$delegate;
916
1360
  SystemPathSeparator$factory();
@@ -918,83 +1362,83 @@
918
1362
  }
919
1363
  var SystemPathSeparator$delegate;
920
1364
  function Path_0(rawPath, any) {
921
- this.i64_1 = removeTrailingSeparators(rawPath);
1365
+ this.a65_1 = removeTrailingSeparators(rawPath);
922
1366
  }
923
- protoOf(Path_0).ep = function () {
924
- // Inline function 'kotlin.check' call
925
- // Inline function 'kotlin.contracts.contract' call
926
- if (!(get_pathLib() !== null)) {
927
- // Inline function 'kotlinx.io.files.Path.<get-parent>.<anonymous>' call
928
- var message = 'Path module not found';
929
- throw IllegalStateException_init_$Create$(toString(message));
930
- }
1367
+ protoOf(Path_0).bp = function () {
931
1368
  // Inline function 'kotlin.text.isEmpty' call
932
- var this_0 = this.i64_1;
1369
+ var this_0 = this.a65_1;
933
1370
  if (charSequenceLength(this_0) === 0)
934
1371
  return null;
935
1372
  if (get_isWindows()) {
936
- if (!contains(this.i64_1, _Char___init__impl__6a9atx(47)) && !contains(this.i64_1, _Char___init__impl__6a9atx(92))) {
1373
+ if (!contains(this.a65_1, _Char___init__impl__6a9atx(47)) && !contains(this.a65_1, _Char___init__impl__6a9atx(92))) {
937
1374
  return null;
938
1375
  }
939
- } else if (!contains(this.i64_1, get_SystemPathSeparator())) {
1376
+ } else if (!contains(this.a65_1, get_SystemPathSeparator())) {
940
1377
  return null;
941
1378
  }
942
- var tmp = get_pathLib().dirname(this.i64_1);
943
- var p = (tmp == null ? true : typeof tmp === 'string') ? tmp : THROW_CCE();
944
- var tmp_0;
945
- // Inline function 'kotlin.text.isNullOrEmpty' call
946
- // Inline function 'kotlin.contracts.contract' call
947
- if (p == null || charSequenceLength(p) === 0) {
948
- tmp_0 = null;
1379
+ var p = get_path().dirname(this.a65_1);
1380
+ var tmp;
1381
+ // Inline function 'kotlin.text.isEmpty' call
1382
+ if (charSequenceLength(p) === 0) {
1383
+ tmp = null;
949
1384
  } else {
950
- if (p === this.i64_1) {
951
- tmp_0 = null;
1385
+ if (p === this.a65_1) {
1386
+ tmp = null;
952
1387
  } else {
953
- tmp_0 = Path_1(p);
1388
+ tmp = Path_1(p);
954
1389
  }
955
1390
  }
956
- return tmp_0;
1391
+ return tmp;
957
1392
  };
958
1393
  protoOf(Path_0).toString = function () {
959
- return this.i64_1;
1394
+ return this.a65_1;
960
1395
  };
961
1396
  protoOf(Path_0).equals = function (other) {
962
1397
  if (this === other)
963
1398
  return true;
964
1399
  if (!(other instanceof Path_0))
965
1400
  return false;
966
- return this.i64_1 === other.i64_1;
1401
+ return this.a65_1 === other.a65_1;
967
1402
  };
968
1403
  protoOf(Path_0).hashCode = function () {
969
- return getStringHashCode(this.i64_1);
1404
+ return getStringHashCode(this.a65_1);
970
1405
  };
971
1406
  function open($this, path, append) {
972
1407
  var flags = append ? 'a' : 'w';
973
- var tmp;
974
- try {
975
- tmp = get_fs().openSync(path.i64_1, flags);
976
- } catch ($p) {
977
- var tmp_0;
978
- if ($p instanceof Error) {
979
- var e = $p;
980
- throw new IOException('Failed to open a file ' + path.i64_1 + '.', e);
981
- } else {
982
- throw $p;
983
- }
1408
+ var fd = {_v: -1};
1409
+ var tmp5_safe_receiver = withCaughtException(FileSink$open$lambda(fd, path, flags));
1410
+ if (tmp5_safe_receiver == null)
1411
+ null;
1412
+ else {
1413
+ // Inline function 'kotlin.also' call
1414
+ // Inline function 'kotlin.contracts.contract' call
1415
+ // Inline function 'kotlinx.io.files.FileSink.open.<anonymous>' call
1416
+ throw IOException_init_$Create$_1('Failed to open a file ' + path.a65_1 + '.', tmp5_safe_receiver);
984
1417
  }
985
- var fd = tmp;
986
- if (fd < 0)
987
- throw IOException_init_$Create$('Failed to open a file ' + path.i64_1 + '.');
988
- return fd;
1418
+ if (fd._v < 0)
1419
+ throw IOException_init_$Create$_0('Failed to open a file ' + path.a65_1 + '.');
1420
+ return fd._v;
1421
+ }
1422
+ function FileSink$open$lambda($fd, $path, $flags) {
1423
+ return function () {
1424
+ $fd._v = get_fs().openSync($path.a65_1, $flags);
1425
+ return Unit_instance;
1426
+ };
1427
+ }
1428
+ function FileSink$write$lambda(this$0, $buf) {
1429
+ return function () {
1430
+ get_fs().writeFileSync(this$0.d65_1, $buf);
1431
+ return Unit_instance;
1432
+ };
989
1433
  }
990
1434
  function FileSink(path, append) {
991
- this.k64_1 = false;
992
- this.l64_1 = open(this, path, append);
1435
+ this.c65_1 = false;
1436
+ this.d65_1 = open(this, path, append);
993
1437
  }
994
- protoOf(FileSink).p63 = function (source, byteCount) {
1438
+ protoOf(FileSink).l63 = function (source, byteCount) {
995
1439
  // Inline function 'kotlin.check' call
996
1440
  // Inline function 'kotlin.contracts.contract' call
997
- if (!!this.k64_1) {
1441
+ if (!!this.c65_1) {
998
1442
  // Inline function 'kotlinx.io.files.FileSink.write.<anonymous>' call
999
1443
  var message = 'Sink is closed.';
1000
1444
  throw IllegalStateException_init_$Create$(toString(message));
@@ -1003,57 +1447,77 @@
1003
1447
  return Unit_instance;
1004
1448
  }
1005
1449
  // Inline function 'kotlin.comparisons.minOf' call
1006
- var b = source.v62_1;
1450
+ var b = source.m();
1007
1451
  var remainingBytes = byteCount.z(b) <= 0 ? byteCount : b;
1008
1452
  while (remainingBytes.z(new Long(0, 0)) > 0) {
1009
- var head = ensureNotNull(source.u62_1);
1010
- var segmentBytes = head.c63_1 - head.b63_1 | 0;
1453
+ var segmentBytes = 0;
1454
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.readFromHead' call
1455
+ // Inline function 'kotlin.require' call
1456
+ // Inline function 'kotlin.contracts.contract' call
1457
+ if (!!source.u62()) {
1458
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.readFromHead.<anonymous>' call
1459
+ var message_0 = 'Buffer is empty';
1460
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1461
+ }
1462
+ var head = ensureNotNull(source.q62_1);
1463
+ // Inline function 'kotlinx.io.files.FileSink.write.<anonymous>' call
1464
+ var headData = head.h64(true);
1465
+ var headPos = head.y62_1;
1466
+ segmentBytes = head.z62_1 - headPos | 0;
1011
1467
  var buf = get_buffer().Buffer.allocUnsafe(segmentBytes);
1012
- buf.fill(head.a63_1, head.b63_1, segmentBytes);
1013
- try {
1014
- get_fs().writeFileSync(this.l64_1, buf);
1015
- } catch ($p) {
1016
- if ($p instanceof Error) {
1017
- var e = $p;
1018
- throw new IOException('Write failed', e);
1019
- } else {
1020
- throw $p;
1468
+ var inductionVariable = 0;
1469
+ var last = segmentBytes;
1470
+ if (inductionVariable < last)
1471
+ do {
1472
+ var offset = inductionVariable;
1473
+ inductionVariable = inductionVariable + 1 | 0;
1474
+ buf.writeInt8(headData[headPos + offset | 0], offset);
1021
1475
  }
1476
+ while (inductionVariable < last);
1477
+ var tmp6_safe_receiver = withCaughtException(FileSink$write$lambda(this, buf));
1478
+ if (tmp6_safe_receiver == null)
1479
+ null;
1480
+ else {
1481
+ // Inline function 'kotlin.also' call
1482
+ // Inline function 'kotlin.contracts.contract' call
1483
+ // Inline function 'kotlinx.io.files.FileSink.write.<anonymous>.<anonymous>' call
1484
+ throw IOException_init_$Create$_1('Write failed', tmp6_safe_receiver);
1485
+ }
1486
+ var bytesRead = segmentBytes;
1487
+ if (!(bytesRead === 0)) {
1488
+ if (bytesRead < 0)
1489
+ throw IllegalStateException_init_$Create$('Returned negative read bytes count');
1490
+ if (bytesRead > head.p63())
1491
+ throw IllegalStateException_init_$Create$('Returned too many bytes');
1492
+ source.e63(toLong(bytesRead));
1022
1493
  }
1023
- source.h63(toLong(segmentBytes));
1024
1494
  // Inline function 'kotlin.Long.minus' call
1025
- remainingBytes = remainingBytes.x2(toLong(segmentBytes));
1495
+ var this_0 = remainingBytes;
1496
+ var other = segmentBytes;
1497
+ remainingBytes = this_0.w2(toLong(other));
1026
1498
  }
1027
1499
  };
1028
- protoOf(FileSink).x1z = function () {
1029
- if (!this.k64_1) {
1030
- this.k64_1 = true;
1031
- get_fs().closeSync(this.l64_1);
1500
+ protoOf(FileSink).t1z = function () {
1501
+ if (!this.c65_1) {
1502
+ this.c65_1 = true;
1503
+ get_fs().closeSync(this.d65_1);
1032
1504
  }
1033
1505
  };
1034
1506
  function Path_1(path) {
1035
- _init_properties_PathsJs_kt__cx5uqj();
1507
+ _init_properties_PathsNodeJs_kt__bvvvsp();
1036
1508
  return new Path_0(path, null);
1037
1509
  }
1038
1510
  function SystemPathSeparator$delegate$lambda() {
1039
- _init_properties_PathsJs_kt__cx5uqj();
1040
- // Inline function 'kotlin.check' call
1041
- // Inline function 'kotlin.contracts.contract' call
1042
- if (!(get_pathLib() != null)) {
1043
- // Inline function 'kotlinx.io.files.SystemPathSeparator$delegate.<anonymous>.<anonymous>' call
1044
- var message = 'Path module not found';
1045
- throw IllegalStateException_init_$Create$(toString(message));
1046
- }
1047
- var tmp = get_pathLib().sep;
1048
- var sep = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : THROW_CCE();
1511
+ _init_properties_PathsNodeJs_kt__bvvvsp();
1512
+ var sep = get_path().sep;
1049
1513
  // Inline function 'kotlin.check' call
1050
1514
  // Inline function 'kotlin.contracts.contract' call
1051
1515
  // Inline function 'kotlin.check' call
1052
1516
  // Inline function 'kotlin.contracts.contract' call
1053
1517
  if (!(sep.length === 1)) {
1054
1518
  // Inline function 'kotlin.check.<anonymous>' call
1055
- var message_0 = 'Check failed.';
1056
- throw IllegalStateException_init_$Create$(toString(message_0));
1519
+ var message = 'Check failed.';
1520
+ throw IllegalStateException_init_$Create$(toString(message));
1057
1521
  }
1058
1522
  return new Char(charSequenceGet(sep, 0));
1059
1523
  }
@@ -1062,83 +1526,20 @@
1062
1526
  return new Char(get_SystemPathSeparator());
1063
1527
  }, null);
1064
1528
  }
1065
- var properties_initialized_PathsJs_kt_chgord;
1066
- function _init_properties_PathsJs_kt__cx5uqj() {
1067
- if (!properties_initialized_PathsJs_kt_chgord) {
1068
- properties_initialized_PathsJs_kt_chgord = true;
1529
+ var properties_initialized_PathsNodeJs_kt_2u5gc7;
1530
+ function _init_properties_PathsNodeJs_kt__bvvvsp() {
1531
+ if (!properties_initialized_PathsNodeJs_kt_2u5gc7) {
1532
+ properties_initialized_PathsNodeJs_kt_2u5gc7 = true;
1069
1533
  SystemPathSeparator$delegate = lazy(SystemPathSeparator$delegate$lambda);
1070
1534
  }
1071
1535
  }
1072
- function get_fs() {
1073
- var tmp;
1074
- try {
1075
- tmp = require('fs');
1076
- } catch ($p) {
1077
- var tmp_0;
1078
- if ($p instanceof Error) {
1079
- var t = $p;
1080
- tmp_0 = null;
1081
- } else {
1082
- throw $p;
1083
- }
1084
- tmp = tmp_0;
1085
- }
1086
- return tmp;
1087
- }
1088
- function get_buffer() {
1089
- var tmp;
1090
- try {
1091
- tmp = require('buffer');
1092
- } catch ($p) {
1093
- var tmp_0;
1094
- if ($p instanceof Error) {
1095
- var t = $p;
1096
- tmp_0 = null;
1097
- } else {
1098
- throw $p;
1099
- }
1100
- tmp = tmp_0;
1101
- }
1102
- return tmp;
1103
- }
1104
- function get_os() {
1105
- var tmp;
1106
- try {
1107
- tmp = require('os');
1108
- } catch ($p) {
1109
- var tmp_0;
1110
- if ($p instanceof Error) {
1111
- var t = $p;
1112
- tmp_0 = null;
1113
- } else {
1114
- throw $p;
1115
- }
1116
- tmp = tmp_0;
1117
- }
1118
- return tmp;
1119
- }
1120
- function get_pathLib() {
1121
- var tmp;
1122
- try {
1123
- tmp = require('path');
1124
- } catch ($p) {
1125
- var tmp_0;
1126
- if ($p instanceof Error) {
1127
- var t = $p;
1128
- tmp_0 = null;
1129
- } else {
1130
- throw $p;
1131
- }
1132
- tmp = tmp_0;
1133
- }
1134
- return tmp;
1135
- }
1136
1536
  //region block: post-declaration
1137
- protoOf(SystemFileSystemImpl).b64 = delete$default;
1138
- protoOf(SystemFileSystemImpl).d64 = createDirectories$default;
1537
+ protoOf(SystemFileSystemImpl).t64 = delete$default;
1538
+ protoOf(SystemFileSystemImpl).v64 = createDirectories$default;
1139
1539
  //endregion
1140
1540
  //region block: init
1141
1541
  Companion_instance = new Companion();
1542
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
1142
1543
  SegmentPool_instance = new SegmentPool();
1143
1544
  //endregion
1144
1545
  //region block: exports