client_plugin_logic_deb 1.6.20 → 1.8.208

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 (84) hide show
  1. package/{KosiTypeSystem-kaverit.js → Kosi-Kaverit-kaverit.js} +143 -144
  2. package/Kosi-Kaverit-kaverit.js.map +1 -0
  3. package/{Kodein-kodein-di.js → Kosi-Kodein-kodein-di.js} +974 -943
  4. package/Kosi-Kodein-kodein-di.js.map +1 -0
  5. package/Kotlin-DateTime-library-kotlinx-datetime.js +6124 -0
  6. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  7. package/Logic_Debertz-client_plugin.d.ts +1392 -475
  8. package/Logic_Debertz-client_plugin.js +7065 -6714
  9. package/Logic_Debertz-client_plugin.js.map +1 -1
  10. package/Logic_Debertz-core.js +5947 -5111
  11. package/Logic_Debertz-core.js.map +1 -1
  12. package/Logic_Debertz-engine.js +45940 -29363
  13. package/Logic_Debertz-engine.js.map +1 -1
  14. package/Logic_Debertz-game_client.js +18434 -17373
  15. package/Logic_Debertz-game_client.js.map +1 -1
  16. package/Logic_Debertz-game_server.js +3066 -2683
  17. package/Logic_Debertz-game_server.js.map +1 -1
  18. package/{kotlin-kotlin-stdlib-js-ir.js → kotlin-kotlin-stdlib.js} +12935 -10723
  19. package/kotlin-kotlin-stdlib.js.map +1 -0
  20. package/kotlin-kotlinx-atomicfu-runtime.js +1 -1
  21. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +1 -1
  22. package/{88b0986a7186d029-atomicfu-js-ir.js → kotlinx-atomicfu.js} +71 -56
  23. package/kotlinx-atomicfu.js.map +1 -0
  24. package/{kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js → kotlinx-coroutines-core.js} +5223 -5784
  25. package/kotlinx-coroutines-core.js.map +1 -0
  26. package/kotlinx-io-kotlinx-io-bytestring.js +15 -0
  27. package/kotlinx-io-kotlinx-io-core.js +1156 -0
  28. package/kotlinx-io-kotlinx-io-core.js.map +1 -0
  29. package/kotlinx-serialization-kotlinx-serialization-core.js +6250 -0
  30. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  31. package/kotlinx-serialization-kotlinx-serialization-json.js +4748 -0
  32. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  33. package/{kotlinx-serialization-kotlinx-serialization-protobuf-js-ir.js → kotlinx-serialization-kotlinx-serialization-protobuf.js} +3 -3
  34. package/kotlinx-serialization-kotlinx-serialization-protobuf.js.map +1 -0
  35. package/ktor-ktor-client-content-negotiation.js +713 -0
  36. package/ktor-ktor-client-content-negotiation.js.map +1 -0
  37. package/ktor-ktor-client-core.js +7207 -0
  38. package/ktor-ktor-client-core.js.map +1 -0
  39. package/ktor-ktor-client-js.js +15 -0
  40. package/ktor-ktor-client-js.js.map +1 -0
  41. package/ktor-ktor-client-logging.js +1506 -0
  42. package/ktor-ktor-client-logging.js.map +1 -0
  43. package/ktor-ktor-events.js +97 -0
  44. package/ktor-ktor-events.js.map +1 -0
  45. package/ktor-ktor-http.js +3263 -0
  46. package/ktor-ktor-http.js.map +1 -0
  47. package/ktor-ktor-io.js +6472 -0
  48. package/ktor-ktor-io.js.map +1 -0
  49. package/ktor-ktor-serialization-kotlinx-json.js +67 -0
  50. package/ktor-ktor-serialization-kotlinx-json.js.map +1 -0
  51. package/ktor-ktor-serialization-kotlinx.js +848 -0
  52. package/ktor-ktor-serialization-kotlinx.js.map +1 -0
  53. package/ktor-ktor-serialization.js +370 -0
  54. package/ktor-ktor-serialization.js.map +1 -0
  55. package/ktor-ktor-utils.js +2659 -0
  56. package/ktor-ktor-utils.js.map +1 -0
  57. package/ktor-ktor-websocket-serialization.js +15 -0
  58. package/ktor-ktor-websocket-serialization.js.map +1 -0
  59. package/ktor-ktor-websockets.js +466 -0
  60. package/ktor-ktor-websockets.js.map +1 -0
  61. package/package.json +5 -2
  62. package/raspberry-cardgame-lib-core.js +1421 -0
  63. package/raspberry-cardgame-lib-core.js.map +1 -0
  64. package/raspberry-cardgame-lib-logger.js +423 -0
  65. package/raspberry-cardgame-lib-logger.js.map +1 -0
  66. package/raspberry-cardgame-lib-random.js +3066 -0
  67. package/raspberry-cardgame-lib-random.js.map +1 -0
  68. package/secure-random-secure-random.js +173 -0
  69. package/secure-random-secure-random.js.map +1 -0
  70. package/{uuid-js-ir.js → uuid.js} +57 -71
  71. package/uuid.js.map +1 -0
  72. package/88b0986a7186d029-atomicfu-js-ir.js.map +0 -1
  73. package/Kodein-kodein-di.js.map +0 -1
  74. package/KosiTypeSystem-kaverit.js.map +0 -1
  75. package/Kotlin-DateTime-library-kotlinx-datetime-js-ir.js +0 -380
  76. package/Kotlin-DateTime-library-kotlinx-datetime-js-ir.js.map +0 -1
  77. package/kotlin-kotlin-stdlib-js-ir.js.map +0 -1
  78. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +0 -6184
  79. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +0 -1
  80. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +0 -4741
  81. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +0 -1
  82. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +0 -1
  83. package/uuid-js-ir.js.map +0 -1
  84. /package/{kotlinx-serialization-kotlinx-serialization-protobuf-js-ir.js.map → kotlinx-io-kotlinx-io-bytestring.js.map} +0 -0
@@ -0,0 +1,1156 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'kotlinx-io-kotlinx-io-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'kotlinx-io-kotlinx-io-core'.");
9
+ }
10
+ root['kotlinx-io-kotlinx-io-core'] = factory(typeof this['kotlinx-io-kotlinx-io-core'] === 'undefined' ? {} : this['kotlinx-io-kotlinx-io-core'], this['kotlin-kotlin-stdlib']);
11
+ }
12
+ }(globalThis, function (_, kotlin_kotlin) {
13
+ 'use strict';
14
+ //region block: imports
15
+ var imul = Math.imul;
16
+ var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.z1;
17
+ var Long = kotlin_kotlin.$_$.kg;
18
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.r1;
19
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.w2;
20
+ var charArrayOf = kotlin_kotlin.$_$.ab;
21
+ var protoOf = kotlin_kotlin.$_$.qc;
22
+ var Unit_instance = kotlin_kotlin.$_$.n5;
23
+ var ensureNotNull = kotlin_kotlin.$_$.hh;
24
+ var toLong = kotlin_kotlin.$_$.sc;
25
+ var toString = kotlin_kotlin.$_$.uc;
26
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.e1;
27
+ var initMetadataForClass = kotlin_kotlin.$_$.pb;
28
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v1;
29
+ var objectCreate = kotlin_kotlin.$_$.pc;
30
+ var initMetadataForCompanion = kotlin_kotlin.$_$.qb;
31
+ var arrayCopy = kotlin_kotlin.$_$.f6;
32
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.p1;
33
+ var VOID = kotlin_kotlin.$_$.f;
34
+ var charSequenceGet = kotlin_kotlin.$_$.cb;
35
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.c3;
36
+ var toByte = kotlin_kotlin.$_$.rc;
37
+ var initMetadataForInterface = kotlin_kotlin.$_$.sb;
38
+ var startsWith = kotlin_kotlin.$_$.ye;
39
+ var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.f1;
40
+ var charSequenceLength = kotlin_kotlin.$_$.db;
41
+ var endsWith = kotlin_kotlin.$_$.yd;
42
+ var captureStack = kotlin_kotlin.$_$.za;
43
+ var Exception = kotlin_kotlin.$_$.hg;
44
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.l1;
45
+ var initMetadataForObject = kotlin_kotlin.$_$.ub;
46
+ var THROW_CCE = kotlin_kotlin.$_$.qg;
47
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.n;
48
+ var asReversed = kotlin_kotlin.$_$.h6;
49
+ var equals = kotlin_kotlin.$_$.hb;
50
+ var contains = kotlin_kotlin.$_$.vd;
51
+ var getStringHashCode = kotlin_kotlin.$_$.nb;
52
+ var Char = kotlin_kotlin.$_$.ag;
53
+ var KProperty0 = kotlin_kotlin.$_$.kd;
54
+ var getPropertyCallableRef = kotlin_kotlin.$_$.mb;
55
+ var lazy = kotlin_kotlin.$_$.nh;
56
+ //endregion
57
+ //region block: pre-declaration
58
+ initMetadataForClass(Buffer, 'Buffer', Buffer);
59
+ initMetadataForClass(RealSink, 'RealSink');
60
+ initMetadataForCompanion(Companion);
61
+ initMetadataForClass(Segment, 'Segment', Segment_init_$Create$);
62
+ function delete$default(path, mustExist, $super) {
63
+ mustExist = mustExist === VOID ? true : mustExist;
64
+ var tmp;
65
+ if ($super === VOID) {
66
+ this.m66(path, mustExist);
67
+ tmp = Unit_instance;
68
+ } else {
69
+ tmp = $super.m66.call(this, path, mustExist);
70
+ }
71
+ return tmp;
72
+ }
73
+ function createDirectories$default(path, mustCreate, $super) {
74
+ mustCreate = mustCreate === VOID ? false : mustCreate;
75
+ var tmp;
76
+ if ($super === VOID) {
77
+ this.o66(path, mustCreate);
78
+ tmp = Unit_instance;
79
+ } else {
80
+ tmp = $super.o66.call(this, path, mustCreate);
81
+ }
82
+ return tmp;
83
+ }
84
+ initMetadataForInterface(FileSystem, 'FileSystem');
85
+ initMetadataForClass(SystemFileSystemImpl, 'SystemFileSystemImpl', VOID, VOID, [FileSystem]);
86
+ initMetadataForClass(FileMetadata, 'FileMetadata', FileMetadata);
87
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$_0, Exception);
88
+ initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
89
+ initMetadataForObject(SegmentPool, 'SegmentPool');
90
+ initMetadataForClass(FileNotFoundException, 'FileNotFoundException', VOID, IOException);
91
+ initMetadataForClass(SystemFileSystem$1, VOID, VOID, SystemFileSystemImpl);
92
+ initMetadataForClass(Path_0, 'Path');
93
+ initMetadataForClass(FileSink, 'FileSink');
94
+ //endregion
95
+ function get_HEX_DIGIT_CHARS() {
96
+ _init_properties__Util_kt__g8tcl9();
97
+ return HEX_DIGIT_CHARS;
98
+ }
99
+ var HEX_DIGIT_CHARS;
100
+ function checkBounds(size, startIndex, endIndex) {
101
+ _init_properties__Util_kt__g8tcl9();
102
+ if (startIndex.z(new Long(0, 0)) < 0 || endIndex.z(size) > 0) {
103
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
104
+ }
105
+ if (startIndex.z(endIndex) > 0) {
106
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
107
+ }
108
+ }
109
+ function checkOffsetAndCount(size, offset, byteCount) {
110
+ _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) {
112
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
113
+ }
114
+ }
115
+ var properties_initialized__Util_kt_67kc5b;
116
+ function _init_properties__Util_kt__g8tcl9() {
117
+ if (!properties_initialized__Util_kt_67kc5b) {
118
+ properties_initialized__Util_kt_67kc5b = true;
119
+ // Inline function 'kotlin.charArrayOf' call
120
+ 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)]);
121
+ }
122
+ }
123
+ function Buffer() {
124
+ this.g65_1 = null;
125
+ this.h65_1 = new Long(0, 0);
126
+ this.i65_1 = this;
127
+ }
128
+ protoOf(Buffer).j65 = function () {
129
+ return this.i65_1;
130
+ };
131
+ protoOf(Buffer).k65 = function () {
132
+ return Unit_instance;
133
+ };
134
+ protoOf(Buffer).l65 = function () {
135
+ var result = this.h65_1;
136
+ if (result.equals(new Long(0, 0)))
137
+ return new Long(0, 0);
138
+ var tail = ensureNotNull(ensureNotNull(this.g65_1).s65_1);
139
+ if (tail.o65_1 < 8192 && tail.q65_1) {
140
+ result = result.x2(toLong(tail.o65_1 - tail.n65_1 | 0));
141
+ }
142
+ return result;
143
+ };
144
+ protoOf(Buffer).t65 = function (byteCount) {
145
+ // Inline function 'kotlinx.io.checkByteCount' call
146
+ // Inline function 'kotlin.require' call
147
+ // Inline function 'kotlin.contracts.contract' call
148
+ if (!(byteCount.z(new Long(0, 0)) >= 0)) {
149
+ // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
150
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
151
+ throw IllegalArgumentException_init_$Create$(toString(message));
152
+ }
153
+ var remainingByteCount = byteCount;
154
+ while (remainingByteCount.z(new Long(0, 0)) > 0) {
155
+ var tmp0_elvis_lhs = this.g65_1;
156
+ var tmp;
157
+ if (tmp0_elvis_lhs == null) {
158
+ throw new EOFException('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
159
+ } else {
160
+ tmp = tmp0_elvis_lhs;
161
+ }
162
+ var head = tmp;
163
+ // Inline function 'kotlinx.io.minOf' call
164
+ var a = remainingByteCount;
165
+ var b = head.o65_1 - head.n65_1 | 0;
166
+ // Inline function 'kotlin.comparisons.minOf' call
167
+ var b_0 = toLong(b);
168
+ var toSkip = (a.z(b_0) <= 0 ? a : b_0).e1();
169
+ this.h65_1 = this.h65_1.x2(toLong(toSkip));
170
+ remainingByteCount = remainingByteCount.x2(toLong(toSkip));
171
+ head.n65_1 = head.n65_1 + toSkip | 0;
172
+ if (head.n65_1 === head.o65_1) {
173
+ this.g65_1 = head.u65();
174
+ SegmentPool_instance.x65(head);
175
+ }
176
+ }
177
+ };
178
+ protoOf(Buffer).y65 = function (minimumCapacity) {
179
+ // Inline function 'kotlin.require' call
180
+ // Inline function 'kotlin.contracts.contract' call
181
+ if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
182
+ // Inline function 'kotlinx.io.Buffer.writableSegment.<anonymous>' call
183
+ var message = 'unexpected capacity';
184
+ throw IllegalArgumentException_init_$Create$(toString(message));
185
+ }
186
+ if (this.g65_1 == null) {
187
+ var result = SegmentPool_instance.z65();
188
+ this.g65_1 = result;
189
+ result.s65_1 = result;
190
+ result.r65_1 = result;
191
+ return result;
192
+ }
193
+ var tail = ensureNotNull(this.g65_1).s65_1;
194
+ if ((ensureNotNull(tail).o65_1 + minimumCapacity | 0) > 8192 || !tail.q65_1) {
195
+ tail = tail.a66(SegmentPool_instance.z65());
196
+ }
197
+ return tail;
198
+ };
199
+ protoOf(Buffer).b66 = function (source, byteCount) {
200
+ // Inline function 'kotlin.require' call
201
+ // Inline function 'kotlin.contracts.contract' call
202
+ if (!!(source === this)) {
203
+ // Inline function 'kotlinx.io.Buffer.write.<anonymous>' call
204
+ var message = 'source == this';
205
+ throw IllegalArgumentException_init_$Create$(toString(message));
206
+ }
207
+ checkOffsetAndCount(source.h65_1, new Long(0, 0), byteCount);
208
+ var remainingByteCount = byteCount;
209
+ while (remainingByteCount.z(new Long(0, 0)) > 0) {
210
+ if (remainingByteCount.z(toLong(ensureNotNull(source.g65_1).o65_1 - ensureNotNull(source.g65_1).n65_1 | 0)) < 0) {
211
+ var tail = !(this.g65_1 == null) ? ensureNotNull(this.g65_1).s65_1 : null;
212
+ var tmp;
213
+ if (!(tail == null) && tail.q65_1) {
214
+ // Inline function 'kotlin.Long.minus' call
215
+ // Inline function 'kotlin.Long.plus' call
216
+ var this_0 = remainingByteCount;
217
+ var other = tail.o65_1;
218
+ var this_1 = this_0.w2(toLong(other));
219
+ var other_0 = tail.p65_1 ? 0 : tail.n65_1;
220
+ tmp = this_1.x2(toLong(other_0)).z(new Long(8192, 0)) <= 0;
221
+ } else {
222
+ tmp = false;
223
+ }
224
+ if (tmp) {
225
+ ensureNotNull(source.g65_1).d66(tail, remainingByteCount.e1());
226
+ source.h65_1 = source.h65_1.x2(remainingByteCount);
227
+ this.h65_1 = this.h65_1.w2(remainingByteCount);
228
+ return Unit_instance;
229
+ } else {
230
+ source.g65_1 = ensureNotNull(source.g65_1).c66(remainingByteCount.e1());
231
+ }
232
+ }
233
+ var segmentToMove = source.g65_1;
234
+ var movedByteCount = toLong(ensureNotNull(segmentToMove).o65_1 - segmentToMove.n65_1 | 0);
235
+ source.g65_1 = segmentToMove.u65();
236
+ if (this.g65_1 == null) {
237
+ this.g65_1 = segmentToMove;
238
+ segmentToMove.s65_1 = segmentToMove;
239
+ segmentToMove.r65_1 = segmentToMove.s65_1;
240
+ } else {
241
+ var tail_0 = ensureNotNull(this.g65_1).s65_1;
242
+ tail_0 = ensureNotNull(tail_0).a66(segmentToMove);
243
+ tail_0.e66();
244
+ }
245
+ source.h65_1 = source.h65_1.x2(movedByteCount);
246
+ this.h65_1 = this.h65_1.w2(movedByteCount);
247
+ remainingByteCount = remainingByteCount.x2(movedByteCount);
248
+ }
249
+ };
250
+ protoOf(Buffer).x21 = function (byte) {
251
+ var tail = this.y65(1);
252
+ var tmp1 = tail.o65_1;
253
+ tail.o65_1 = tmp1 + 1 | 0;
254
+ tail.m65_1[tmp1] = byte;
255
+ this.h65_1 = this.h65_1.w2(new Long(1, 0));
256
+ };
257
+ protoOf(Buffer).g23 = function () {
258
+ return Unit_instance;
259
+ };
260
+ protoOf(Buffer).toString = function () {
261
+ if (this.h65_1.equals(new Long(0, 0)))
262
+ return 'Buffer(size=0)';
263
+ var maxPrintableBytes = 64;
264
+ // Inline function 'kotlinx.io.minOf' call
265
+ var b = this.h65_1;
266
+ // Inline function 'kotlin.comparisons.minOf' call
267
+ var a = toLong(maxPrintableBytes);
268
+ var len = (a.z(b) <= 0 ? a : b).e1();
269
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.h65_1.z(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
270
+ var curr = ensureNotNull(this.g65_1);
271
+ var bytesWritten = 0;
272
+ var pos = curr.n65_1;
273
+ while (bytesWritten < len) {
274
+ if (pos === curr.o65_1) {
275
+ curr = ensureNotNull(curr.r65_1);
276
+ pos = curr.n65_1;
277
+ }
278
+ var tmp = curr.m65_1;
279
+ var tmp0 = pos;
280
+ pos = tmp0 + 1 | 0;
281
+ var b_0 = tmp[tmp0];
282
+ bytesWritten = bytesWritten + 1 | 0;
283
+ builder.j8(get_HEX_DIGIT_CHARS()[b_0 >> 4 & 15]).j8(get_HEX_DIGIT_CHARS()[b_0 & 15]);
284
+ }
285
+ if (this.h65_1.z(toLong(maxPrintableBytes)) > 0) {
286
+ builder.j8(_Char___init__impl__6a9atx(8230));
287
+ }
288
+ return 'Buffer(size=' + this.h65_1.toString() + ' hex=' + builder.toString() + ')';
289
+ };
290
+ function buffered(_this__u8e3s4) {
291
+ return new RealSink(_this__u8e3s4);
292
+ }
293
+ function RealSink(sink) {
294
+ this.f66_1 = sink;
295
+ this.g66_1 = false;
296
+ this.h66_1 = new Buffer();
297
+ }
298
+ protoOf(RealSink).j65 = function () {
299
+ return this.h66_1;
300
+ };
301
+ protoOf(RealSink).b66 = function (source, byteCount) {
302
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
303
+ // Inline function 'kotlin.check' call
304
+ // Inline function 'kotlin.contracts.contract' call
305
+ if (!!this.g66_1) {
306
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
307
+ var message = 'Sink is closed.';
308
+ throw IllegalStateException_init_$Create$(toString(message));
309
+ }
310
+ // Inline function 'kotlin.require' call
311
+ // Inline function 'kotlin.contracts.contract' call
312
+ if (!(byteCount.z(new Long(0, 0)) >= 0)) {
313
+ // Inline function 'kotlinx.io.RealSink.write.<anonymous>' call
314
+ var message_0 = 'byteCount: ' + byteCount.toString();
315
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
316
+ }
317
+ this.h66_1.b66(source, byteCount);
318
+ this.k65();
319
+ };
320
+ protoOf(RealSink).k65 = function () {
321
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
322
+ // Inline function 'kotlin.check' call
323
+ // Inline function 'kotlin.contracts.contract' call
324
+ if (!!this.g66_1) {
325
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
326
+ var message = 'Sink is closed.';
327
+ throw IllegalStateException_init_$Create$(toString(message));
328
+ }
329
+ var byteCount = this.h66_1.l65();
330
+ if (byteCount.z(new Long(0, 0)) > 0) {
331
+ this.f66_1.b66(this.h66_1, byteCount);
332
+ }
333
+ };
334
+ protoOf(RealSink).g23 = function () {
335
+ if (this.g66_1)
336
+ return Unit_instance;
337
+ var thrown = null;
338
+ try {
339
+ if (this.h66_1.h65_1.z(new Long(0, 0)) > 0) {
340
+ this.f66_1.b66(this.h66_1, this.h66_1.h65_1);
341
+ }
342
+ } catch ($p) {
343
+ if ($p instanceof Error) {
344
+ var e = $p;
345
+ thrown = e;
346
+ } else {
347
+ throw $p;
348
+ }
349
+ }
350
+ try {
351
+ this.f66_1.g23();
352
+ } catch ($p) {
353
+ if ($p instanceof Error) {
354
+ var e_0 = $p;
355
+ if (thrown == null)
356
+ thrown = e_0;
357
+ } else {
358
+ throw $p;
359
+ }
360
+ }
361
+ this.g66_1 = true;
362
+ if (!(thrown == null))
363
+ throw thrown;
364
+ };
365
+ protoOf(RealSink).toString = function () {
366
+ return 'buffered(' + toString(this.f66_1) + ')';
367
+ };
368
+ function Segment_init_$Init$($this) {
369
+ Segment.call($this);
370
+ $this.m65_1 = new Int8Array(8192);
371
+ $this.q65_1 = true;
372
+ $this.p65_1 = false;
373
+ return $this;
374
+ }
375
+ function Segment_init_$Create$() {
376
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
377
+ }
378
+ function Segment_init_$Init$_0(data, pos, limit, shared, owner, $this) {
379
+ Segment.call($this);
380
+ $this.m65_1 = data;
381
+ $this.n65_1 = pos;
382
+ $this.o65_1 = limit;
383
+ $this.p65_1 = shared;
384
+ $this.q65_1 = owner;
385
+ return $this;
386
+ }
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)));
389
+ }
390
+ function Companion() {
391
+ this.i66_1 = 8192;
392
+ this.j66_1 = 1024;
393
+ }
394
+ var Companion_instance;
395
+ function Companion_getInstance() {
396
+ return Companion_instance;
397
+ }
398
+ protoOf(Segment).k66 = function () {
399
+ this.p65_1 = true;
400
+ return Segment_init_$Create$_0(this.m65_1, this.n65_1, this.o65_1, true, false);
401
+ };
402
+ protoOf(Segment).u65 = function () {
403
+ var result = !(this.r65_1 === this) ? this.r65_1 : null;
404
+ ensureNotNull(this.s65_1).r65_1 = this.r65_1;
405
+ ensureNotNull(this.r65_1).s65_1 = this.s65_1;
406
+ this.r65_1 = null;
407
+ this.s65_1 = null;
408
+ return result;
409
+ };
410
+ protoOf(Segment).a66 = function (segment) {
411
+ segment.s65_1 = this;
412
+ segment.r65_1 = this.r65_1;
413
+ ensureNotNull(this.r65_1).s65_1 = segment;
414
+ this.r65_1 = segment;
415
+ return segment;
416
+ };
417
+ protoOf(Segment).c66 = function (byteCount) {
418
+ // Inline function 'kotlin.require' call
419
+ // Inline function 'kotlin.contracts.contract' call
420
+ if (!(byteCount > 0 && byteCount <= (this.o65_1 - this.n65_1 | 0))) {
421
+ // Inline function 'kotlinx.io.Segment.split.<anonymous>' call
422
+ var message = 'byteCount out of range';
423
+ throw IllegalArgumentException_init_$Create$(toString(message));
424
+ }
425
+ var prefix;
426
+ if (byteCount >= 1024) {
427
+ prefix = this.k66();
428
+ } else {
429
+ prefix = SegmentPool_instance.z65();
430
+ // Inline function 'kotlin.collections.copyInto' call
431
+ var this_0 = this.m65_1;
432
+ var destination = prefix.m65_1;
433
+ var startIndex = this.n65_1;
434
+ var endIndex = this.n65_1 + byteCount | 0;
435
+ // Inline function 'kotlin.js.unsafeCast' call
436
+ // Inline function 'kotlin.js.asDynamic' call
437
+ var tmp = this_0;
438
+ // Inline function 'kotlin.js.unsafeCast' call
439
+ // Inline function 'kotlin.js.asDynamic' call
440
+ arrayCopy(tmp, destination, 0, startIndex, endIndex);
441
+ }
442
+ prefix.o65_1 = prefix.n65_1 + byteCount | 0;
443
+ this.n65_1 = this.n65_1 + byteCount | 0;
444
+ ensureNotNull(this.s65_1).a66(prefix);
445
+ return prefix;
446
+ };
447
+ protoOf(Segment).e66 = function () {
448
+ // Inline function 'kotlin.check' call
449
+ // Inline function 'kotlin.contracts.contract' call
450
+ if (!!(this.s65_1 === this)) {
451
+ // Inline function 'kotlinx.io.Segment.compact.<anonymous>' call
452
+ var message = 'cannot compact';
453
+ throw IllegalStateException_init_$Create$(toString(message));
454
+ }
455
+ if (!ensureNotNull(this.s65_1).q65_1)
456
+ return Unit_instance;
457
+ var byteCount = this.o65_1 - this.n65_1 | 0;
458
+ var availableByteCount = (8192 - ensureNotNull(this.s65_1).o65_1 | 0) + (ensureNotNull(this.s65_1).p65_1 ? 0 : ensureNotNull(this.s65_1).n65_1) | 0;
459
+ if (byteCount > availableByteCount)
460
+ return Unit_instance;
461
+ this.d66(ensureNotNull(this.s65_1), byteCount);
462
+ this.u65();
463
+ SegmentPool_instance.x65(this);
464
+ };
465
+ protoOf(Segment).d66 = function (sink, byteCount) {
466
+ // Inline function 'kotlin.check' call
467
+ // Inline function 'kotlin.contracts.contract' call
468
+ if (!sink.q65_1) {
469
+ // Inline function 'kotlinx.io.Segment.writeTo.<anonymous>' call
470
+ var message = 'only owner can write';
471
+ throw IllegalStateException_init_$Create$(toString(message));
472
+ }
473
+ if ((sink.o65_1 + byteCount | 0) > 8192) {
474
+ if (sink.p65_1)
475
+ throw IllegalArgumentException_init_$Create$_0();
476
+ if (((sink.o65_1 + byteCount | 0) - sink.n65_1 | 0) > 8192)
477
+ throw IllegalArgumentException_init_$Create$_0();
478
+ // Inline function 'kotlin.collections.copyInto' call
479
+ var this_0 = sink.m65_1;
480
+ var destination = sink.m65_1;
481
+ var startIndex = sink.n65_1;
482
+ var endIndex = sink.o65_1;
483
+ // Inline function 'kotlin.js.unsafeCast' call
484
+ // Inline function 'kotlin.js.asDynamic' call
485
+ var tmp = this_0;
486
+ // Inline function 'kotlin.js.unsafeCast' call
487
+ // Inline function 'kotlin.js.asDynamic' call
488
+ arrayCopy(tmp, destination, 0, startIndex, endIndex);
489
+ sink.o65_1 = sink.o65_1 - sink.n65_1 | 0;
490
+ sink.n65_1 = 0;
491
+ }
492
+ // Inline function 'kotlin.collections.copyInto' call
493
+ var this_1 = this.m65_1;
494
+ var destination_0 = sink.m65_1;
495
+ var destinationOffset = sink.o65_1;
496
+ var startIndex_0 = this.n65_1;
497
+ var endIndex_0 = this.n65_1 + byteCount | 0;
498
+ // Inline function 'kotlin.js.unsafeCast' call
499
+ // Inline function 'kotlin.js.asDynamic' call
500
+ var tmp_0 = this_1;
501
+ // Inline function 'kotlin.js.unsafeCast' call
502
+ // Inline function 'kotlin.js.asDynamic' call
503
+ arrayCopy(tmp_0, destination_0, destinationOffset, startIndex_0, endIndex_0);
504
+ sink.o65_1 = sink.o65_1 + byteCount | 0;
505
+ this.n65_1 = this.n65_1 + byteCount | 0;
506
+ };
507
+ function Segment() {
508
+ this.n65_1 = 0;
509
+ this.o65_1 = 0;
510
+ this.p65_1 = false;
511
+ this.q65_1 = false;
512
+ this.r65_1 = null;
513
+ this.s65_1 = null;
514
+ }
515
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
516
+ startIndex = startIndex === VOID ? 0 : startIndex;
517
+ endIndex = endIndex === VOID ? string.length : endIndex;
518
+ // Inline function 'kotlinx.io.writeString.<anonymous>' call
519
+ var it = _this__u8e3s4.j65();
520
+ commonWriteUtf8(it, string, startIndex, endIndex);
521
+ _this__u8e3s4.k65();
522
+ return Unit_instance;
523
+ }
524
+ function commonWriteUtf8(_this__u8e3s4, string, beginIndex, endIndex) {
525
+ // Inline function 'kotlinx.io.checkBounds' call
526
+ var size = string.length;
527
+ checkBounds(toLong(size), toLong(beginIndex), toLong(endIndex));
528
+ var i = beginIndex;
529
+ while (i < endIndex) {
530
+ // Inline function 'kotlin.code' call
531
+ var this_0 = charSequenceGet(string, i);
532
+ var c = Char__toInt_impl_vasixd(this_0);
533
+ if (c < 128) {
534
+ var tail = _this__u8e3s4.y65(1);
535
+ var data = tail.m65_1;
536
+ var segmentOffset = tail.o65_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);
552
+ }
553
+ var runSize = (i + segmentOffset | 0) - tail.o65_1 | 0;
554
+ tail.o65_1 = tail.o65_1 + runSize | 0;
555
+ _this__u8e3s4.h65_1 = _this__u8e3s4.h65_1.w2(toLong(runSize));
556
+ } else if (c < 2048) {
557
+ var tail_0 = _this__u8e3s4.y65(2);
558
+ tail_0.m65_1[tail_0.o65_1] = toByte(c >> 6 | 192);
559
+ tail_0.m65_1[tail_0.o65_1 + 1 | 0] = toByte(c & 63 | 128);
560
+ tail_0.o65_1 = tail_0.o65_1 + 2 | 0;
561
+ _this__u8e3s4.h65_1 = _this__u8e3s4.h65_1.w2(new Long(2, 0));
562
+ i = i + 1 | 0;
563
+ } else if (c < 55296 || c > 57343) {
564
+ var tail_1 = _this__u8e3s4.y65(3);
565
+ tail_1.m65_1[tail_1.o65_1] = toByte(c >> 12 | 224);
566
+ tail_1.m65_1[tail_1.o65_1 + 1 | 0] = toByte(c >> 6 & 63 | 128);
567
+ tail_1.m65_1[tail_1.o65_1 + 2 | 0] = toByte(c & 63 | 128);
568
+ tail_1.o65_1 = tail_1.o65_1 + 3 | 0;
569
+ _this__u8e3s4.h65_1 = _this__u8e3s4.h65_1.w2(new Long(3, 0));
570
+ i = i + 1 | 0;
571
+ } else {
572
+ var tmp;
573
+ if ((i + 1 | 0) < endIndex) {
574
+ // Inline function 'kotlin.code' call
575
+ var this_2 = charSequenceGet(string, i + 1 | 0);
576
+ tmp = Char__toInt_impl_vasixd(this_2);
577
+ } else {
578
+ tmp = 0;
579
+ }
580
+ var low = tmp;
581
+ if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
582
+ _this__u8e3s4.x21(63);
583
+ i = i + 1 | 0;
584
+ } else {
585
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
586
+ var tail_2 = _this__u8e3s4.y65(4);
587
+ tail_2.m65_1[tail_2.o65_1] = toByte(codePoint >> 18 | 240);
588
+ tail_2.m65_1[tail_2.o65_1 + 1 | 0] = toByte(codePoint >> 12 & 63 | 128);
589
+ tail_2.m65_1[tail_2.o65_1 + 2 | 0] = toByte(codePoint >> 6 & 63 | 128);
590
+ tail_2.m65_1[tail_2.o65_1 + 3 | 0] = toByte(codePoint & 63 | 128);
591
+ tail_2.o65_1 = tail_2.o65_1 + 4 | 0;
592
+ _this__u8e3s4.h65_1 = _this__u8e3s4.h65_1.w2(new Long(4, 0));
593
+ i = i + 2 | 0;
594
+ }
595
+ }
596
+ }
597
+ }
598
+ function FileSystem() {
599
+ }
600
+ function SystemFileSystemImpl() {
601
+ }
602
+ function FileMetadata(isRegularFile, isDirectory, size) {
603
+ isRegularFile = isRegularFile === VOID ? false : isRegularFile;
604
+ isDirectory = isDirectory === VOID ? false : isDirectory;
605
+ size = size === VOID ? new Long(0, 0) : size;
606
+ this.r66_1 = isRegularFile;
607
+ this.s66_1 = isDirectory;
608
+ this.t66_1 = size;
609
+ }
610
+ function removeTrailingSeparators(path, isWindows_) {
611
+ isWindows_ = isWindows_ === VOID ? get_isWindows() : isWindows_;
612
+ if (isWindows_) {
613
+ var tmp;
614
+ if (path.length > 1) {
615
+ var tmp_0;
616
+ if (charSequenceGet(path, 1) === _Char___init__impl__6a9atx(58)) {
617
+ tmp_0 = 3;
618
+ } else if (isUnc(path)) {
619
+ tmp_0 = 2;
620
+ } else {
621
+ tmp_0 = 1;
622
+ }
623
+ tmp = tmp_0;
624
+ } else {
625
+ tmp = 1;
626
+ }
627
+ var limit = tmp;
628
+ return removeTrailingSeparatorsWindows(limit, path);
629
+ }
630
+ return removeTrailingSeparatorsUnix(path);
631
+ }
632
+ function isUnc(path) {
633
+ if (path.length < 2)
634
+ return false;
635
+ if (startsWith(path, '\\\\'))
636
+ return true;
637
+ if (startsWith(path, '//'))
638
+ return true;
639
+ return false;
640
+ }
641
+ function removeTrailingSeparatorsWindows(suffixLength, path) {
642
+ // Inline function 'kotlin.require' call
643
+ // Inline function 'kotlin.contracts.contract' call
644
+ // Inline function 'kotlin.require' call
645
+ // Inline function 'kotlin.contracts.contract' call
646
+ if (!(suffixLength >= 1)) {
647
+ // Inline function 'kotlin.require.<anonymous>' call
648
+ var message = 'Failed requirement.';
649
+ throw IllegalArgumentException_init_$Create$(toString(message));
650
+ }
651
+ var idx = path.length;
652
+ $l$loop: while (idx > suffixLength) {
653
+ var c = charSequenceGet(path, idx - 1 | 0);
654
+ if (!(c === _Char___init__impl__6a9atx(92)) && !(c === _Char___init__impl__6a9atx(47)))
655
+ break $l$loop;
656
+ idx = idx - 1 | 0;
657
+ }
658
+ // Inline function 'kotlin.text.substring' call
659
+ var endIndex = idx;
660
+ // Inline function 'kotlin.js.asDynamic' call
661
+ return path.substring(0, endIndex);
662
+ }
663
+ function removeTrailingSeparatorsUnix(path) {
664
+ var idx = path.length;
665
+ while (idx > 1 && charSequenceGet(path, idx - 1 | 0) === _Char___init__impl__6a9atx(47)) {
666
+ idx = idx - 1 | 0;
667
+ }
668
+ // Inline function 'kotlin.text.substring' call
669
+ var endIndex = idx;
670
+ // Inline function 'kotlin.js.asDynamic' call
671
+ return path.substring(0, endIndex);
672
+ }
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.i8(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());
692
+ } else {
693
+ tmp = false;
694
+ }
695
+ if (tmp) {
696
+ this_0.j8(get_SystemPathSeparator());
697
+ }
698
+ this_0.i8(element);
699
+ }
700
+ var tmp$ret$2 = this_0.toString();
701
+ return Path_1(tmp$ret$2);
702
+ }
703
+ function IOException_init_$Init$(message, $this) {
704
+ IOException.call($this, message, null);
705
+ return $this;
706
+ }
707
+ function IOException_init_$Create$(message) {
708
+ var tmp = IOException_init_$Init$(message, objectCreate(protoOf(IOException)));
709
+ captureStack(tmp, IOException_init_$Create$);
710
+ return tmp;
711
+ }
712
+ function IOException_init_$Init$_0($this) {
713
+ IOException_init_$Init$(null, $this);
714
+ return $this;
715
+ }
716
+ function IOException_init_$Create$_0() {
717
+ var tmp = IOException_init_$Init$_0(objectCreate(protoOf(IOException)));
718
+ captureStack(tmp, IOException_init_$Create$_0);
719
+ return tmp;
720
+ }
721
+ function IOException(message, cause) {
722
+ Exception_init_$Init$(message, cause, this);
723
+ captureStack(this, IOException);
724
+ }
725
+ function EOFException_init_$Init$($this) {
726
+ EOFException.call($this, null);
727
+ return $this;
728
+ }
729
+ function EOFException_init_$Create$() {
730
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
731
+ captureStack(tmp, EOFException_init_$Create$);
732
+ return tmp;
733
+ }
734
+ function EOFException(message) {
735
+ IOException_init_$Init$(message, this);
736
+ captureStack(this, EOFException);
737
+ }
738
+ function SegmentPool() {
739
+ this.v65_1 = 0;
740
+ this.w65_1 = 0;
741
+ }
742
+ protoOf(SegmentPool).z65 = function () {
743
+ return Segment_init_$Create$();
744
+ };
745
+ protoOf(SegmentPool).x65 = function (segment) {
746
+ };
747
+ var SegmentPool_instance;
748
+ function SegmentPool_getInstance() {
749
+ return SegmentPool_instance;
750
+ }
751
+ function get_SystemFileSystem() {
752
+ _init_properties_FileSystemJs_kt__4boaac();
753
+ return SystemFileSystem;
754
+ }
755
+ var SystemFileSystem;
756
+ function get_isWindows() {
757
+ _init_properties_FileSystemJs_kt__4boaac();
758
+ return isWindows;
759
+ }
760
+ var isWindows;
761
+ function FileNotFoundException(message) {
762
+ IOException_init_$Init$(message, this);
763
+ captureStack(this, FileNotFoundException);
764
+ }
765
+ 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;
776
+ return Path_1(tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
777
+ }
778
+ function SystemFileSystem$1() {
779
+ SystemFileSystemImpl.call(this);
780
+ }
781
+ protoOf(SystemFileSystem$1).l66 = 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.u66_1);
790
+ return (!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE();
791
+ };
792
+ protoOf(SystemFileSystem$1).m66 = 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.l66(path)) {
801
+ if (mustExist) {
802
+ throw new FileNotFoundException('File does not exist: ' + path.u66_1);
803
+ }
804
+ return Unit_instance;
805
+ }
806
+ try {
807
+ var stats = get_fs().statSync(path.u66_1);
808
+ var tmp = stats.isDirectory();
809
+ if ((!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE()) {
810
+ get_fs().rmdirSync(path.u66_1);
811
+ } else {
812
+ get_fs().rmSync(path.u66_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
+ }
821
+ }
822
+ };
823
+ protoOf(SystemFileSystem$1).o66 = function (path, mustCreate) {
824
+ var metadata = this.v66(path);
825
+ if (!(metadata == null)) {
826
+ if (mustCreate) {
827
+ throw IOException_init_$Create$('Path already exists: ' + path.toString());
828
+ }
829
+ if (metadata.r66_1) {
830
+ throw IOException_init_$Create$("Path already exists and it's a file: " + path.toString());
831
+ }
832
+ return Unit_instance;
833
+ }
834
+ // Inline function 'kotlin.collections.arrayListOf' call
835
+ var parts = ArrayList_init_$Create$();
836
+ var p = path;
837
+ while (!(p == null) && !this.l66(p)) {
838
+ parts.e(p.toString());
839
+ p = p.un();
840
+ }
841
+ // Inline function 'kotlin.collections.forEach' call
842
+ var tmp0_iterator = asReversed(parts).j();
843
+ while (tmp0_iterator.k()) {
844
+ var element = tmp0_iterator.l();
845
+ // Inline function 'kotlinx.io.files.<no name provided>.createDirectories.<anonymous>' call
846
+ get_fs().mkdirSync(element);
847
+ }
848
+ };
849
+ protoOf(SystemFileSystem$1).v66 = function (path) {
850
+ // Inline function 'kotlin.check' call
851
+ // Inline function 'kotlin.contracts.contract' call
852
+ if (!(get_fs() !== null)) {
853
+ // 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.u66_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.l66(path))
879
+ throw new IOException('Stat failed for ' + path.toString(), t);
880
+ return null;
881
+ } else {
882
+ throw $p;
883
+ }
884
+ }
885
+ return tmp;
886
+ };
887
+ protoOf(SystemFileSystem$1).q66 = 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
+ }
902
+ return new FileSink(path, append);
903
+ };
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;
908
+ SystemFileSystem = new SystemFileSystem$1();
909
+ isWindows = get_os().platform() == 'win32';
910
+ }
911
+ }
912
+ function get_SystemPathSeparator() {
913
+ _init_properties_PathsJs_kt__cx5uqj();
914
+ // Inline function 'kotlin.getValue' call
915
+ var this_0 = SystemPathSeparator$delegate;
916
+ SystemPathSeparator$factory();
917
+ return this_0.u().g1_1;
918
+ }
919
+ var SystemPathSeparator$delegate;
920
+ function Path_0(rawPath, any) {
921
+ this.u66_1 = removeTrailingSeparators(rawPath);
922
+ }
923
+ protoOf(Path_0).un = 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
+ }
931
+ // Inline function 'kotlin.text.isEmpty' call
932
+ var this_0 = this.u66_1;
933
+ if (charSequenceLength(this_0) === 0)
934
+ return null;
935
+ if (get_isWindows()) {
936
+ if (!contains(this.u66_1, _Char___init__impl__6a9atx(47)) && !contains(this.u66_1, _Char___init__impl__6a9atx(92))) {
937
+ return null;
938
+ }
939
+ } else if (!contains(this.u66_1, get_SystemPathSeparator())) {
940
+ return null;
941
+ }
942
+ var tmp = get_pathLib().dirname(this.u66_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;
949
+ } else {
950
+ if (p === this.u66_1) {
951
+ tmp_0 = null;
952
+ } else {
953
+ tmp_0 = Path_1(p);
954
+ }
955
+ }
956
+ return tmp_0;
957
+ };
958
+ protoOf(Path_0).toString = function () {
959
+ return this.u66_1;
960
+ };
961
+ protoOf(Path_0).equals = function (other) {
962
+ if (this === other)
963
+ return true;
964
+ if (!(other instanceof Path_0))
965
+ return false;
966
+ return this.u66_1 === other.u66_1;
967
+ };
968
+ protoOf(Path_0).hashCode = function () {
969
+ return getStringHashCode(this.u66_1);
970
+ };
971
+ function open($this, path, append) {
972
+ var flags = append ? 'a' : 'w';
973
+ var tmp;
974
+ try {
975
+ tmp = get_fs().openSync(path.u66_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.u66_1 + '.', e);
981
+ } else {
982
+ throw $p;
983
+ }
984
+ }
985
+ var fd = tmp;
986
+ if (fd < 0)
987
+ throw IOException_init_$Create$('Failed to open a file ' + path.u66_1 + '.');
988
+ return fd;
989
+ }
990
+ function FileSink(path, append) {
991
+ this.w66_1 = false;
992
+ this.x66_1 = open(this, path, append);
993
+ }
994
+ protoOf(FileSink).b66 = function (source, byteCount) {
995
+ // Inline function 'kotlin.check' call
996
+ // Inline function 'kotlin.contracts.contract' call
997
+ if (!!this.w66_1) {
998
+ // Inline function 'kotlinx.io.files.FileSink.write.<anonymous>' call
999
+ var message = 'Sink is closed.';
1000
+ throw IllegalStateException_init_$Create$(toString(message));
1001
+ }
1002
+ if (byteCount.equals(new Long(0, 0))) {
1003
+ return Unit_instance;
1004
+ }
1005
+ // Inline function 'kotlin.comparisons.minOf' call
1006
+ var b = source.h65_1;
1007
+ var remainingBytes = byteCount.z(b) <= 0 ? byteCount : b;
1008
+ while (remainingBytes.z(new Long(0, 0)) > 0) {
1009
+ var head = ensureNotNull(source.g65_1);
1010
+ var segmentBytes = head.o65_1 - head.n65_1 | 0;
1011
+ var buf = get_buffer().Buffer.allocUnsafe(segmentBytes);
1012
+ buf.fill(head.m65_1, head.n65_1, segmentBytes);
1013
+ try {
1014
+ get_fs().writeFileSync(this.x66_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;
1021
+ }
1022
+ }
1023
+ source.t65(toLong(segmentBytes));
1024
+ // Inline function 'kotlin.Long.minus' call
1025
+ remainingBytes = remainingBytes.x2(toLong(segmentBytes));
1026
+ }
1027
+ };
1028
+ protoOf(FileSink).g23 = function () {
1029
+ if (!this.w66_1) {
1030
+ this.w66_1 = true;
1031
+ get_fs().closeSync(this.x66_1);
1032
+ }
1033
+ };
1034
+ function Path_1(path) {
1035
+ _init_properties_PathsJs_kt__cx5uqj();
1036
+ return new Path_0(path, null);
1037
+ }
1038
+ 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();
1049
+ // Inline function 'kotlin.check' call
1050
+ // Inline function 'kotlin.contracts.contract' call
1051
+ // Inline function 'kotlin.check' call
1052
+ // Inline function 'kotlin.contracts.contract' call
1053
+ if (!(sep.length === 1)) {
1054
+ // Inline function 'kotlin.check.<anonymous>' call
1055
+ var message_0 = 'Check failed.';
1056
+ throw IllegalStateException_init_$Create$(toString(message_0));
1057
+ }
1058
+ return new Char(charSequenceGet(sep, 0));
1059
+ }
1060
+ function SystemPathSeparator$factory() {
1061
+ return getPropertyCallableRef('SystemPathSeparator', 0, KProperty0, function () {
1062
+ return new Char(get_SystemPathSeparator());
1063
+ }, null);
1064
+ }
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;
1069
+ SystemPathSeparator$delegate = lazy(SystemPathSeparator$delegate$lambda);
1070
+ }
1071
+ }
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
+ //region block: post-declaration
1137
+ protoOf(SystemFileSystemImpl).n66 = delete$default;
1138
+ protoOf(SystemFileSystemImpl).p66 = createDirectories$default;
1139
+ //endregion
1140
+ //region block: init
1141
+ Companion_instance = new Companion();
1142
+ SegmentPool_instance = new SegmentPool();
1143
+ //endregion
1144
+ //region block: exports
1145
+ _.$_$ = _.$_$ || {};
1146
+ _.$_$.a = Path;
1147
+ _.$_$.b = Path_1;
1148
+ _.$_$.c = get_SystemFileSystem;
1149
+ _.$_$.d = get_SystemTemporaryDirectory;
1150
+ _.$_$.e = buffered;
1151
+ _.$_$.f = writeString;
1152
+ //endregion
1153
+ return _;
1154
+ }));
1155
+
1156
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.js.map