@flock/wirespec 0.0.1

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 (55) hide show
  1. package/kotlin/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js +1601 -0
  2. package/kotlin/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.map +1 -0
  3. package/kotlin/arrow-arrow-annotations.js +15 -0
  4. package/kotlin/arrow-arrow-annotations.js.map +1 -0
  5. package/kotlin/arrow-arrow-atomic.js +57 -0
  6. package/kotlin/arrow-arrow-atomic.js.map +1 -0
  7. package/kotlin/arrow-arrow-continuations.js +31 -0
  8. package/kotlin/arrow-arrow-continuations.js.map +1 -0
  9. package/kotlin/arrow-arrow-core.js +357 -0
  10. package/kotlin/arrow-arrow-core.js.map +1 -0
  11. package/kotlin/kotlin-kotlin-stdlib-js-ir.js +11509 -0
  12. package/kotlin/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
  13. package/kotlin/kotlin-openapi-bindings.js +12060 -0
  14. package/kotlin/kotlin-openapi-bindings.js.map +1 -0
  15. package/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +5362 -0
  16. package/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -0
  17. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +4421 -0
  18. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -0
  19. package/kotlin/wirespec-bin.js +3 -0
  20. package/kotlin/wirespec-cli.js +1069 -0
  21. package/kotlin/wirespec-cli.js.map +1 -0
  22. package/kotlin/wirespec-core.js +4687 -0
  23. package/kotlin/wirespec-core.js.map +1 -0
  24. package/kotlin/wirespec-lib.js +620 -0
  25. package/kotlin/wirespec-lib.js.map +1 -0
  26. package/kotlin/wirespec-openapi.js +2614 -0
  27. package/kotlin/wirespec-openapi.js.map +1 -0
  28. package/package.json +17 -0
  29. package/sync-hashes/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.hash +1 -0
  30. package/sync-hashes/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.map.hash +1 -0
  31. package/sync-hashes/arrow-arrow-annotations.js.hash +1 -0
  32. package/sync-hashes/arrow-arrow-annotations.js.map.hash +1 -0
  33. package/sync-hashes/arrow-arrow-atomic.js.hash +1 -0
  34. package/sync-hashes/arrow-arrow-atomic.js.map.hash +1 -0
  35. package/sync-hashes/arrow-arrow-continuations.js.hash +1 -0
  36. package/sync-hashes/arrow-arrow-continuations.js.map.hash +1 -0
  37. package/sync-hashes/arrow-arrow-core.js.hash +1 -0
  38. package/sync-hashes/arrow-arrow-core.js.map.hash +1 -0
  39. package/sync-hashes/kotlin-kotlin-stdlib-js-ir.js.hash +1 -0
  40. package/sync-hashes/kotlin-kotlin-stdlib-js-ir.js.map.hash +1 -0
  41. package/sync-hashes/kotlin-openapi-bindings.js.hash +1 -0
  42. package/sync-hashes/kotlin-openapi-bindings.js.map.hash +1 -0
  43. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.hash +1 -0
  44. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map.hash +1 -0
  45. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.hash +1 -0
  46. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map.hash +1 -0
  47. package/sync-hashes/wirespec-bin.js.hash +1 -0
  48. package/sync-hashes/wirespec-cli.js.hash +1 -0
  49. package/sync-hashes/wirespec-cli.js.map.hash +1 -0
  50. package/sync-hashes/wirespec-core.js.hash +1 -0
  51. package/sync-hashes/wirespec-core.js.map.hash +1 -0
  52. package/sync-hashes/wirespec-lib.js.hash +1 -0
  53. package/sync-hashes/wirespec-lib.js.map.hash +1 -0
  54. package/sync-hashes/wirespec-openapi.js.hash +1 -0
  55. package/sync-hashes/wirespec-openapi.js.map.hash +1 -0
@@ -0,0 +1,4687 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './arrow-arrow-core.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./arrow-arrow-core.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
8
+ throw new Error("Error loading module 'wirespec-core'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'wirespec-core'.");
9
+ }
10
+ if (typeof this['arrow-arrow-core'] === 'undefined') {
11
+ throw new Error("Error loading module 'wirespec-core'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-core'.");
12
+ }
13
+ root['wirespec-core'] = factory(typeof this['wirespec-core'] === 'undefined' ? {} : this['wirespec-core'], this['kotlin-kotlin-stdlib-js-ir'], this['arrow-arrow-core']);
14
+ }
15
+ }(this, function (_, kotlin_kotlin, kotlin_io_arrow_kt_arrow_core) {
16
+ 'use strict';
17
+ //region block: imports
18
+ var imul = Math.imul;
19
+ var toString = kotlin_kotlin.$_$.y7;
20
+ var Unit_getInstance = kotlin_kotlin.$_$.i3;
21
+ var Enum = kotlin_kotlin.$_$.p9;
22
+ var protoOf = kotlin_kotlin.$_$.t7;
23
+ var classMeta = kotlin_kotlin.$_$.q6;
24
+ var VOID = kotlin_kotlin.$_$.ya;
25
+ var setMetadataFor = kotlin_kotlin.$_$.u7;
26
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.ta;
27
+ var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
28
+ var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
29
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.v;
30
+ var to = kotlin_kotlin.$_$.xa;
31
+ var listOf = kotlin_kotlin.$_$.j5;
32
+ var objectMeta = kotlin_kotlin.$_$.s7;
33
+ var trimMargin = kotlin_kotlin.$_$.j9;
34
+ var joinToString = kotlin_kotlin.$_$.a5;
35
+ var split = kotlin_kotlin.$_$.w8;
36
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.g;
37
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.c4;
38
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
39
+ var plus = kotlin_kotlin.$_$.p5;
40
+ var plus_0 = kotlin_kotlin.$_$.q5;
41
+ var filterNotNull = kotlin_kotlin.$_$.u4;
42
+ var toIntOrNull = kotlin_kotlin.$_$.b9;
43
+ var toSet = kotlin_kotlin.$_$.b6;
44
+ var isBlank = kotlin_kotlin.$_$.q8;
45
+ var Collection = kotlin_kotlin.$_$.m3;
46
+ var isInterface = kotlin_kotlin.$_$.i7;
47
+ var checkIndexOverflow = kotlin_kotlin.$_$.b4;
48
+ var THROW_CCE = kotlin_kotlin.$_$.y9;
49
+ var isCharSequence = kotlin_kotlin.$_$.e7;
50
+ var trimStart = kotlin_kotlin.$_$.k9;
51
+ var dropLast = kotlin_kotlin.$_$.l8;
52
+ var drop = kotlin_kotlin.$_$.m8;
53
+ var charSequenceLength = kotlin_kotlin.$_$.o6;
54
+ var charSequenceGet = kotlin_kotlin.$_$.n6;
55
+ var toString_0 = kotlin_kotlin.$_$.l1;
56
+ var listOf_0 = kotlin_kotlin.$_$.i5;
57
+ var interfaceMeta = kotlin_kotlin.$_$.z6;
58
+ var captureStack = kotlin_kotlin.$_$.k6;
59
+ var getKClassFromExpression = kotlin_kotlin.$_$.c;
60
+ var RuntimeException = kotlin_kotlin.$_$.x9;
61
+ var RuntimeException_init_$Init$ = kotlin_kotlin.$_$.h1;
62
+ var getStringHashCode = kotlin_kotlin.$_$.x6;
63
+ var hashCode = kotlin_kotlin.$_$.y6;
64
+ var equals = kotlin_kotlin.$_$.s6;
65
+ var DefaultRaise = kotlin_io_arrow_kt_arrow_core.$_$.a;
66
+ var nonFatalOrThrow = kotlin_io_arrow_kt_arrow_core.$_$.g;
67
+ var raisedOrRethrow = kotlin_io_arrow_kt_arrow_core.$_$.b;
68
+ var CancellationException = kotlin_kotlin.$_$.e6;
69
+ var getKClass = kotlin_kotlin.$_$.d;
70
+ var nonEmptyListOf = kotlin_io_arrow_kt_arrow_core.$_$.f;
71
+ var Companion_getInstance = kotlin_kotlin.$_$.d3;
72
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.m1;
73
+ var createFailure = kotlin_kotlin.$_$.ma;
74
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.p1;
75
+ var isObject = kotlin_kotlin.$_$.k7;
76
+ var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.o1;
77
+ var emptyList = kotlin_kotlin.$_$.r4;
78
+ var lastOrNull = kotlin_kotlin.$_$.e5;
79
+ var removePrefix = kotlin_kotlin.$_$.t8;
80
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.g1;
81
+ var ensureNotNull = kotlin_kotlin.$_$.na;
82
+ var println = kotlin_kotlin.$_$.h6;
83
+ //endregion
84
+ //region block: pre-declaration
85
+ setMetadataFor(Reported, 'Reported', classMeta, Enum);
86
+ setMetadataFor(Wirespec, 'Wirespec', objectMeta);
87
+ function withLogging(_this__u8e3s4, logger, block) {
88
+ return logger.ok('Emitting Definition: Type', block);
89
+ }
90
+ function withLogging_0(_this__u8e3s4, logger, block) {
91
+ return logger.ok('Emitting Definition: Type Shape', block);
92
+ }
93
+ function withLogging_1(_this__u8e3s4, logger, block) {
94
+ return logger.ok('Emitting Definition: Type Shape Field', block);
95
+ }
96
+ function withLogging_2(_this__u8e3s4, logger, block) {
97
+ return logger.ok('Emitting Definition: Type Shape Field Key', block);
98
+ }
99
+ function withLogging_3(_this__u8e3s4, logger, block) {
100
+ return logger.ok('Emitting Definition: Type Shape Field Value', block);
101
+ }
102
+ setMetadataFor(TypeDefinitionEmitterLogger, 'TypeDefinitionEmitterLogger', interfaceMeta);
103
+ function withLogging_4(_this__u8e3s4, logger, block) {
104
+ return logger.ok('Emitting Definition: Endpoint', block);
105
+ }
106
+ setMetadataFor(EnumDefinitionEmitterLogger, 'EnumDefinitionEmitterLogger', interfaceMeta);
107
+ function withLogging_5(_this__u8e3s4, logger, block) {
108
+ return logger.ok('Emitting Definition: Refined', block);
109
+ }
110
+ function withLogging_6(_this__u8e3s4, logger, block) {
111
+ return logger.ok('Emitting Definition: Refined Validator', block);
112
+ }
113
+ setMetadataFor(RefinedTypeDefinitionEmitterLogger, 'RefinedTypeDefinitionEmitterLogger', interfaceMeta);
114
+ function withLogging_7(_this__u8e3s4, logger, block) {
115
+ return logger.ok('Emitting Definition: Endpoint', block);
116
+ }
117
+ function withLogging_8(_this__u8e3s4, logger, block) {
118
+ return logger.ok('Emitting Definition: Endpoint Segment', block);
119
+ }
120
+ setMetadataFor(EndpointDefinitionEmitterLogger, 'EndpointDefinitionEmitterLogger', interfaceMeta);
121
+ setMetadataFor(Emitter, 'Emitter', classMeta, VOID, [TypeDefinitionEmitterLogger, EnumDefinitionEmitterLogger, RefinedTypeDefinitionEmitterLogger, EndpointDefinitionEmitterLogger]);
122
+ setMetadataFor(JavaEmitter, 'JavaEmitter', classMeta, Emitter);
123
+ setMetadataFor(KotlinEmitter, 'KotlinEmitter', classMeta, Emitter);
124
+ setMetadataFor(Companion, 'Companion', objectMeta);
125
+ setMetadataFor(ScalaEmitter, 'ScalaEmitter', classMeta, Emitter);
126
+ setMetadataFor(TypeScriptEmitter, 'TypeScriptEmitter', classMeta, Emitter);
127
+ setMetadataFor(WirespecEmitter, 'WirespecEmitter', classMeta, Emitter);
128
+ setMetadataFor(Companion_0, 'Companion', objectMeta);
129
+ setMetadataFor(WirespecException, 'WirespecException', classMeta, RuntimeException);
130
+ setMetadataFor(CompilerException, 'CompilerException', classMeta, WirespecException);
131
+ setMetadataFor(ParserException, 'ParserException', classMeta, CompilerException);
132
+ setMetadataFor(NullTokenException, 'NullTokenException', classMeta, ParserException);
133
+ setMetadataFor(StartingException, 'StartingException', classMeta, NullTokenException);
134
+ setMetadataFor(NextException, 'NextException', classMeta, NullTokenException);
135
+ setMetadataFor(WrongTokenException, 'WrongTokenException', classMeta, ParserException);
136
+ setMetadataFor(Type, 'Type', classMeta, Enum);
137
+ setMetadataFor(Custom, 'Custom', classMeta);
138
+ setMetadataFor(Primitive, 'Primitive', classMeta);
139
+ setMetadataFor(Identifier, 'Identifier', classMeta);
140
+ setMetadataFor(Field, 'Field', classMeta);
141
+ setMetadataFor(Shape, 'Shape', classMeta);
142
+ setMetadataFor(Type_0, 'Type', classMeta);
143
+ setMetadataFor(Literal, 'Literal', classMeta);
144
+ setMetadataFor(Param, 'Param', classMeta);
145
+ setMetadataFor(Method, 'Method', classMeta, Enum);
146
+ setMetadataFor(Request, 'Request', classMeta);
147
+ setMetadataFor(Response, 'Response', classMeta);
148
+ setMetadataFor(Content, 'Content', classMeta);
149
+ setMetadataFor(Endpoint, 'Endpoint', classMeta);
150
+ setMetadataFor(Enum_0, 'Enum', classMeta);
151
+ setMetadataFor(Validator, 'Validator', classMeta);
152
+ setMetadataFor(Refined, 'Refined', classMeta);
153
+ setMetadataFor(Parser, 'Parser', classMeta);
154
+ setMetadataFor(TokenProvider, 'TokenProvider', classMeta);
155
+ setMetadataFor(IdxAndLength, 'IdxAndLength', classMeta);
156
+ setMetadataFor(Coordinates, 'Coordinates', classMeta);
157
+ setMetadataFor(Token, 'Token', classMeta);
158
+ function name() {
159
+ return ensureNotNull(getKClassFromExpression(this).fc());
160
+ }
161
+ setMetadataFor(TokenType, 'TokenType', interfaceMeta);
162
+ setMetadataFor(WsTypeDef, 'WsTypeDef', objectMeta, VOID, [TokenType]);
163
+ setMetadataFor(WsEnumTypeDef, 'WsEnumTypeDef', objectMeta, VOID, [TokenType]);
164
+ setMetadataFor(WsRefinedTypeDef, 'WsRefinedTypeDef', objectMeta, VOID, [TokenType]);
165
+ setMetadataFor(WhiteSpace, 'WhiteSpace', interfaceMeta, VOID, [TokenType]);
166
+ setMetadataFor(WhiteSpaceExceptNewLine, 'WhiteSpaceExceptNewLine', objectMeta, VOID, [WhiteSpace]);
167
+ setMetadataFor(NewLine, 'NewLine', objectMeta, VOID, [WhiteSpace]);
168
+ setMetadataFor(LeftCurly, 'LeftCurly', objectMeta, VOID, [TokenType]);
169
+ setMetadataFor(Colon, 'Colon', objectMeta, VOID, [TokenType]);
170
+ setMetadataFor(Comma, 'Comma', objectMeta, VOID, [TokenType]);
171
+ setMetadataFor(QuestionMark, 'QuestionMark', objectMeta, VOID, [TokenType]);
172
+ setMetadataFor(Brackets, 'Brackets', objectMeta, VOID, [TokenType]);
173
+ setMetadataFor(WsType, 'WsType', interfaceMeta, VOID, [TokenType]);
174
+ setMetadataFor(WsString, 'WsString', objectMeta, VOID, [WsType]);
175
+ setMetadataFor(WsInteger, 'WsInteger', objectMeta, VOID, [WsType]);
176
+ setMetadataFor(WsBoolean, 'WsBoolean', objectMeta, VOID, [WsType]);
177
+ setMetadataFor(RightCurly, 'RightCurly', objectMeta, VOID, [TokenType]);
178
+ setMetadataFor(CustomValue, 'CustomValue', objectMeta, VOID, [TokenType]);
179
+ setMetadataFor(CustomType, 'CustomType', objectMeta, VOID, [WsType]);
180
+ setMetadataFor(CustomRegex, 'CustomRegex', objectMeta, VOID, [TokenType]);
181
+ setMetadataFor(Invalid, 'Invalid', objectMeta, VOID, [TokenType]);
182
+ setMetadataFor(EndOfProgram, 'EndOfProgram', objectMeta, VOID, [TokenType]);
183
+ setMetadataFor(Logger, 'Logger', classMeta);
184
+ setMetadataFor(noLogger$1, VOID, classMeta, Logger);
185
+ //endregion
186
+ function compile(_this__u8e3s4, source) {
187
+ return compile$lambda(_this__u8e3s4, source);
188
+ }
189
+ var Reported_TOKENIZED_instance;
190
+ var Reported_PARSED_instance;
191
+ var Reported_VALIDATED_instance;
192
+ var Reported_EMITTED_instance;
193
+ function Reported$report$lambda($logger, this$0) {
194
+ return function (it) {
195
+ $logger.ih('********** ' + this$0.p4_1 + ' **********\n' + toString(it) + '\n########## ' + this$0.p4_1 + ' ##########');
196
+ return Unit_getInstance();
197
+ };
198
+ }
199
+ var Reported_entriesInitialized;
200
+ function Reported_initEntries() {
201
+ if (Reported_entriesInitialized)
202
+ return Unit_getInstance();
203
+ Reported_entriesInitialized = true;
204
+ Reported_TOKENIZED_instance = new Reported('TOKENIZED', 0);
205
+ Reported_PARSED_instance = new Reported('PARSED', 1);
206
+ Reported_VALIDATED_instance = new Reported('VALIDATED', 2);
207
+ Reported_EMITTED_instance = new Reported('EMITTED', 3);
208
+ }
209
+ function Reported(name, ordinal) {
210
+ Enum.call(this, name, ordinal);
211
+ }
212
+ protoOf(Reported).lh = function (logger) {
213
+ return Reported$report$lambda(logger, this);
214
+ };
215
+ function Reported$report$ref($boundThis) {
216
+ var l = function (p0) {
217
+ return $boundThis.lh(p0);
218
+ };
219
+ l.callableName = 'report';
220
+ return l;
221
+ }
222
+ function Reported$report$ref_0($boundThis) {
223
+ var l = function (p0) {
224
+ return $boundThis.lh(p0);
225
+ };
226
+ l.callableName = 'report';
227
+ return l;
228
+ }
229
+ function Reported$report$ref_1($boundThis) {
230
+ var l = function (p0) {
231
+ return $boundThis.lh(p0);
232
+ };
233
+ l.callableName = 'report';
234
+ return l;
235
+ }
236
+ function Reported$report$ref_2($boundThis) {
237
+ var l = function (p0) {
238
+ return $boundThis.lh(p0);
239
+ };
240
+ l.callableName = 'report';
241
+ return l;
242
+ }
243
+ function Reported$report$ref_3($boundThis) {
244
+ var l = function (p0) {
245
+ return $boundThis.lh(p0);
246
+ };
247
+ l.callableName = 'report';
248
+ return l;
249
+ }
250
+ function compile$lambda$lambda($this_compile, $source, $logger) {
251
+ return function (emitter) {
252
+ var tmp$ret$14;
253
+ // Inline function 'kotlin.also' call
254
+ var tmp$ret$13;
255
+ // Inline function 'arrow.core.Either.map' call
256
+ var tmp$ret$9;
257
+ // Inline function 'kotlin.also' call
258
+ var tmp$ret$8;
259
+ // Inline function 'arrow.core.Either.map' call
260
+ var tmp$ret$4;
261
+ // Inline function 'kotlin.also' call
262
+ var tmp$ret$3;
263
+ // Inline function 'kotlin.let' call
264
+ var tmp$ret$1;
265
+ // Inline function 'kotlin.also' call
266
+ var tmp$ret$0;
267
+ // Inline function 'kotlin.also' call
268
+ var tmp0_also = tokenize($this_compile, $source);
269
+ var tmp1_also = Reported$report$ref(Reported_TOKENIZED_getInstance())($logger);
270
+ // Inline function 'kotlin.contracts.contract' call
271
+ tmp1_also(tmp0_also);
272
+ tmp$ret$0 = tmp0_also;
273
+ var tmp2_also = optimize(tmp$ret$0);
274
+ var tmp3_also = Reported$report$ref_0(Reported_VALIDATED_getInstance())($logger);
275
+ // Inline function 'kotlin.contracts.contract' call
276
+ tmp3_also(tmp2_also);
277
+ tmp$ret$1 = tmp2_also;
278
+ var tmp4_let = tmp$ret$1;
279
+ // Inline function 'kotlin.contracts.contract' call
280
+ var tmp$ret$2;
281
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
282
+ tmp$ret$2 = (new Parser($logger)).nh(tmp4_let);
283
+ tmp$ret$3 = tmp$ret$2;
284
+ var tmp5_also = tmp$ret$3;
285
+ var tmp6_also = Reported$report$ref_1(Reported_PARSED_getInstance())($logger);
286
+ // Inline function 'kotlin.contracts.contract' call
287
+ tmp6_also(tmp5_also);
288
+ tmp$ret$4 = tmp5_also;
289
+ var tmp8_map = tmp$ret$4;
290
+ // Inline function 'kotlin.contracts.contract' call
291
+ var tmp$ret$7;
292
+ // Inline function 'arrow.core.flatMap' call
293
+ // Inline function 'kotlin.contracts.contract' call
294
+ var tmp0_subject = tmp8_map;
295
+ var tmp;
296
+ if (tmp0_subject instanceof Right) {
297
+ var tmp$ret$6;
298
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
299
+ var tmp7__anonymous__b0knam = tmp8_map.og_1;
300
+ var tmp$ret$5;
301
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
302
+ tmp$ret$5 = validate(tmp7__anonymous__b0knam);
303
+ tmp$ret$6 = new Right(tmp$ret$5);
304
+ tmp = tmp$ret$6;
305
+ } else {
306
+ if (tmp0_subject instanceof Left) {
307
+ tmp = tmp8_map;
308
+ } else {
309
+ noWhenBranchMatchedException();
310
+ }
311
+ }
312
+ tmp$ret$7 = tmp;
313
+ tmp$ret$8 = tmp$ret$7;
314
+ var tmp9_also = tmp$ret$8;
315
+ var tmp10_also = Reported$report$ref_2(Reported_VALIDATED_getInstance())($logger);
316
+ // Inline function 'kotlin.contracts.contract' call
317
+ tmp10_also(tmp9_also);
318
+ tmp$ret$9 = tmp9_also;
319
+ var tmp12_map = tmp$ret$9;
320
+ // Inline function 'kotlin.contracts.contract' call
321
+ var tmp$ret$12;
322
+ // Inline function 'arrow.core.flatMap' call
323
+ // Inline function 'kotlin.contracts.contract' call
324
+ var tmp0_subject_0 = tmp12_map;
325
+ var tmp_0;
326
+ if (tmp0_subject_0 instanceof Right) {
327
+ var tmp$ret$11;
328
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
329
+ var tmp11__anonymous__tkubxh = tmp12_map.og_1;
330
+ var tmp$ret$10;
331
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
332
+ tmp$ret$10 = emitter.qh(tmp11__anonymous__tkubxh);
333
+ tmp$ret$11 = new Right(tmp$ret$10);
334
+ tmp_0 = tmp$ret$11;
335
+ } else {
336
+ if (tmp0_subject_0 instanceof Left) {
337
+ tmp_0 = tmp12_map;
338
+ } else {
339
+ noWhenBranchMatchedException();
340
+ }
341
+ }
342
+ tmp$ret$12 = tmp_0;
343
+ tmp$ret$13 = tmp$ret$12;
344
+ var tmp13_also = tmp$ret$13;
345
+ var tmp14_also = Reported$report$ref_3(Reported_EMITTED_getInstance())($logger);
346
+ // Inline function 'kotlin.contracts.contract' call
347
+ tmp14_also(tmp13_also);
348
+ tmp$ret$14 = tmp13_also;
349
+ return tmp$ret$14;
350
+ };
351
+ }
352
+ function compile$lambda($this_compile, $source) {
353
+ return function (logger) {
354
+ return compile$lambda$lambda($this_compile, $source, logger);
355
+ };
356
+ }
357
+ function Reported_TOKENIZED_getInstance() {
358
+ Reported_initEntries();
359
+ return Reported_TOKENIZED_instance;
360
+ }
361
+ function Reported_PARSED_getInstance() {
362
+ Reported_initEntries();
363
+ return Reported_PARSED_instance;
364
+ }
365
+ function Reported_VALIDATED_getInstance() {
366
+ Reported_initEntries();
367
+ return Reported_VALIDATED_instance;
368
+ }
369
+ function Reported_EMITTED_getInstance() {
370
+ Reported_initEntries();
371
+ return Reported_EMITTED_instance;
372
+ }
373
+ function Wirespec() {
374
+ Wirespec_instance = this;
375
+ this.rh_1 = listOf([to(Regex_init_$Create$('^type'), WsTypeDef_getInstance()), to(Regex_init_$Create$('^enum'), WsEnumTypeDef_getInstance()), to(Regex_init_$Create$('^refined'), WsRefinedTypeDef_getInstance()), to(Regex_init_$Create$('^[^\\S\\r\\n]+'), WhiteSpaceExceptNewLine_getInstance()), to(Regex_init_$Create$('^[\\r\\n]'), NewLine_getInstance()), to(Regex_init_$Create$('^\\{'), LeftCurly_getInstance()), to(Regex_init_$Create$('^:'), Colon_getInstance()), to(Regex_init_$Create$('^,'), Comma_getInstance()), to(Regex_init_$Create$('^\\?'), QuestionMark_getInstance()), to(Regex_init_$Create$('^\\[\\]'), Brackets_getInstance()), to(Regex_init_$Create$('^String'), WsString_getInstance()), to(Regex_init_$Create$('^Integer'), WsInteger_getInstance()), to(Regex_init_$Create$('^Boolean'), WsBoolean_getInstance()), to(Regex_init_$Create$('^\\}'), RightCurly_getInstance()), to(Regex_init_$Create$('^[a-z][a-zA-Z]*'), CustomValue_getInstance()), to(Regex_init_$Create$('^[A-Z][a-zA-Z]*'), CustomType_getInstance()), to(Regex_init_$Create$('^/.*/g'), CustomRegex_getInstance()), to(Regex_init_$Create$('^.'), Invalid_getInstance())]);
376
+ }
377
+ protoOf(Wirespec).sh = function () {
378
+ return this.rh_1;
379
+ };
380
+ var Wirespec_instance;
381
+ function Wirespec_getInstance() {
382
+ if (Wirespec_instance == null)
383
+ new Wirespec();
384
+ return Wirespec_instance;
385
+ }
386
+ function emitPrimaryType(_this__u8e3s4, $this) {
387
+ return $this.th(_this__u8e3s4, $this.oh_1, JavaEmitter$emitPrimaryType$lambda(_this__u8e3s4));
388
+ }
389
+ function emit(_this__u8e3s4, $this, endpoint) {
390
+ Companion_getInstance_1();
391
+ var tmp = emitContentType(_this__u8e3s4.uh_1, $this);
392
+ var tmp0_safe_receiver = _this__u8e3s4.uh_1;
393
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
394
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.di(tmp1_safe_receiver);
395
+ var tmp_0 = tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
396
+ Companion_getInstance_1();
397
+ Companion_getInstance_1();
398
+ Companion_getInstance_1();
399
+ Companion_getInstance_1();
400
+ Companion_getInstance_1();
401
+ Companion_getInstance_1();
402
+ Companion_getInstance_1();
403
+ Companion_getInstance_1();
404
+ Companion_getInstance_1();
405
+ Companion_getInstance_1();
406
+ var tmp3_safe_receiver = _this__u8e3s4.uh_1;
407
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.wh_1;
408
+ var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : $this.di(tmp4_safe_receiver);
409
+ var tmp_1 = tmp5_elvis_lhs == null ? 'Void' : tmp5_elvis_lhs;
410
+ Companion_getInstance_1();
411
+ Companion_getInstance_1();
412
+ var tmp_2 = emitContentType(_this__u8e3s4.uh_1, $this);
413
+ var tmp_3 = emitRequestSignature(endpoint, $this, _this__u8e3s4.uh_1);
414
+ Companion_getInstance_1();
415
+ Companion_getInstance_1();
416
+ Companion_getInstance_1();
417
+ var tmp_4 = emitPath(endpoint.gi_1, $this);
418
+ Companion_getInstance_1();
419
+ Companion_getInstance_1();
420
+ Companion_getInstance_1();
421
+ Companion_getInstance_1();
422
+ Companion_getInstance_1();
423
+ Companion_getInstance_1();
424
+ var tmp_5 = emitMap(endpoint.hi_1, $this);
425
+ Companion_getInstance_1();
426
+ Companion_getInstance_1();
427
+ Companion_getInstance_1();
428
+ var tmp_6 = emitMap(endpoint.ii_1, $this);
429
+ Companion_getInstance_1();
430
+ Companion_getInstance_1();
431
+ Companion_getInstance_1();
432
+ var tmp6_safe_receiver = _this__u8e3s4.uh_1;
433
+ var tmp_7;
434
+ if (tmp6_safe_receiver == null) {
435
+ tmp_7 = null;
436
+ } else {
437
+ var tmp$ret$1;
438
+ // Inline function 'kotlin.let' call
439
+ // Inline function 'kotlin.contracts.contract' call
440
+ var tmp$ret$0;
441
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
442
+ tmp$ret$0 = 'new WirespecShared.Content("' + tmp6_safe_receiver.vh_1 + '", body)';
443
+ tmp$ret$1 = tmp$ret$0;
444
+ tmp_7 = tmp$ret$1;
445
+ }
446
+ var tmp7_elvis_lhs = tmp_7;
447
+ var tmp_8 = tmp7_elvis_lhs == null ? 'null' : tmp7_elvis_lhs;
448
+ Companion_getInstance_1();
449
+ Companion_getInstance_1();
450
+ Companion_getInstance_1();
451
+ Companion_getInstance_1();
452
+ Companion_getInstance_1();
453
+ Companion_getInstance_1();
454
+ Companion_getInstance_1();
455
+ Companion_getInstance_1();
456
+ Companion_getInstance_1();
457
+ Companion_getInstance_1();
458
+ Companion_getInstance_1();
459
+ Companion_getInstance_1();
460
+ var tmp8_safe_receiver = _this__u8e3s4.uh_1;
461
+ var tmp9_safe_receiver = tmp8_safe_receiver == null ? null : tmp8_safe_receiver.wh_1;
462
+ var tmp10_elvis_lhs = tmp9_safe_receiver == null ? null : $this.di(tmp9_safe_receiver);
463
+ var tmp_9 = tmp10_elvis_lhs == null ? 'Void' : tmp10_elvis_lhs;
464
+ Companion_getInstance_1();
465
+ return trimMargin('\n |' + ' ' + 'class Request' + tmp + ' implements Request<' + tmp_0 + '> {\n |' + ' ' + ' ' + 'private final String path;\n |' + ' ' + ' ' + 'private final WirespecShared.Method method;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> query;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> headers;\n |' + ' ' + ' ' + 'private final WirespecShared.Content<' + tmp_1 + '> content;\n |' + ' ' + ' ' + 'public Request' + tmp_2 + '(' + tmp_3 + ') {\n |' + ' ' + ' ' + ' ' + 'this.path = ' + tmp_4 + ';\n |' + ' ' + ' ' + ' ' + 'this.method = WirespecShared.Method.' + endpoint.fi_1.p4_1 + ';\n |' + ' ' + ' ' + ' ' + 'this.query = ' + tmp_5 + ';\n |' + ' ' + ' ' + ' ' + 'this.headers = ' + tmp_6 + ';\n |' + ' ' + ' ' + ' ' + 'this.content = ' + tmp_8 + ';\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + '@Override public String getPath() {return path;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Method getMethod() {return method;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getQuery() {return query;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getHeaders() {return headers;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Content<' + tmp_9 + '> getContent() {return content;}\n |' + ' ' + '}\n ');
466
+ }
467
+ function emit_0(_this__u8e3s4, $this) {
468
+ Companion_getInstance_1();
469
+ var tmp = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
470
+ var tmp_0 = emitContentType(_this__u8e3s4.ni_1, $this);
471
+ var tmp$ret$1;
472
+ // Inline function 'kotlin.takeIf' call
473
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
474
+ // Inline function 'kotlin.contracts.contract' call
475
+ var tmp_1;
476
+ var tmp$ret$0;
477
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
478
+ tmp$ret$0 = isInt(tmp0_takeIf, $this);
479
+ if (tmp$ret$0) {
480
+ tmp_1 = tmp0_takeIf;
481
+ } else {
482
+ tmp_1 = null;
483
+ }
484
+ tmp$ret$1 = tmp_1;
485
+ var tmp0_safe_receiver = tmp$ret$1;
486
+ var tmp_2 = orEmptyString(tmp0_safe_receiver == null ? null : groupStatus(tmp0_safe_receiver, $this), $this);
487
+ var tmp1_safe_receiver = _this__u8e3s4.ni_1;
488
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.wh_1;
489
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : $this.di(tmp2_safe_receiver);
490
+ var tmp_3 = tmp3_elvis_lhs == null ? 'Void' : tmp3_elvis_lhs;
491
+ Companion_getInstance_1();
492
+ Companion_getInstance_1();
493
+ Companion_getInstance_1();
494
+ Companion_getInstance_1();
495
+ Companion_getInstance_1();
496
+ Companion_getInstance_1();
497
+ var tmp4_safe_receiver = _this__u8e3s4.ni_1;
498
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
499
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : $this.di(tmp5_safe_receiver);
500
+ var tmp_4 = tmp6_elvis_lhs == null ? 'Void' : tmp6_elvis_lhs;
501
+ Companion_getInstance_1();
502
+ Companion_getInstance_1();
503
+ var tmp_5 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
504
+ var tmp_6 = emitContentType(_this__u8e3s4.ni_1, $this);
505
+ var tmp$ret$3;
506
+ // Inline function 'kotlin.takeIf' call
507
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
508
+ // Inline function 'kotlin.contracts.contract' call
509
+ var tmp_7;
510
+ var tmp$ret$2;
511
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
512
+ tmp$ret$2 = !isInt(tmp1_takeIf, $this);
513
+ if (tmp$ret$2) {
514
+ tmp_7 = tmp1_takeIf;
515
+ } else {
516
+ tmp_7 = null;
517
+ }
518
+ tmp$ret$3 = tmp_7;
519
+ var tmp7_safe_receiver = tmp$ret$3;
520
+ var tmp_8;
521
+ if (tmp7_safe_receiver == null) {
522
+ tmp_8 = null;
523
+ } else {
524
+ var tmp$ret$5;
525
+ // Inline function 'kotlin.let' call
526
+ // Inline function 'kotlin.contracts.contract' call
527
+ var tmp$ret$4;
528
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
529
+ tmp$ret$4 = 'int status, ';
530
+ tmp$ret$5 = tmp$ret$4;
531
+ tmp_8 = tmp$ret$5;
532
+ }
533
+ var tmp_9 = orEmptyString(tmp_8, $this);
534
+ var tmp8_safe_receiver = _this__u8e3s4.ni_1;
535
+ var tmp_10;
536
+ if (tmp8_safe_receiver == null) {
537
+ tmp_10 = null;
538
+ } else {
539
+ var tmp$ret$7;
540
+ // Inline function 'kotlin.let' call
541
+ // Inline function 'kotlin.contracts.contract' call
542
+ var tmp$ret$6;
543
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
544
+ tmp$ret$6 = ', ' + $this.di(tmp8_safe_receiver.wh_1) + ' body';
545
+ tmp$ret$7 = tmp$ret$6;
546
+ tmp_10 = tmp$ret$7;
547
+ }
548
+ var tmp9_elvis_lhs = tmp_10;
549
+ var tmp_11 = tmp9_elvis_lhs == null ? '' : tmp9_elvis_lhs;
550
+ Companion_getInstance_1();
551
+ Companion_getInstance_1();
552
+ Companion_getInstance_1();
553
+ var tmp$ret$9;
554
+ // Inline function 'kotlin.takeIf' call
555
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
556
+ // Inline function 'kotlin.contracts.contract' call
557
+ var tmp_12;
558
+ var tmp$ret$8;
559
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
560
+ tmp$ret$8 = isInt(tmp2_takeIf, $this);
561
+ if (tmp$ret$8) {
562
+ tmp_12 = tmp2_takeIf;
563
+ } else {
564
+ tmp_12 = null;
565
+ }
566
+ tmp$ret$9 = tmp_12;
567
+ var tmp10_elvis_lhs = tmp$ret$9;
568
+ var tmp_13 = tmp10_elvis_lhs == null ? 'status' : tmp10_elvis_lhs;
569
+ Companion_getInstance_1();
570
+ Companion_getInstance_1();
571
+ Companion_getInstance_1();
572
+ Companion_getInstance_1();
573
+ Companion_getInstance_1();
574
+ Companion_getInstance_1();
575
+ var tmp11_safe_receiver = _this__u8e3s4.ni_1;
576
+ var tmp_14;
577
+ if (tmp11_safe_receiver == null) {
578
+ tmp_14 = null;
579
+ } else {
580
+ var tmp$ret$11;
581
+ // Inline function 'kotlin.let' call
582
+ // Inline function 'kotlin.contracts.contract' call
583
+ var tmp$ret$10;
584
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
585
+ tmp$ret$10 = 'new WirespecShared.Content("' + tmp11_safe_receiver.vh_1 + '", body)';
586
+ tmp$ret$11 = tmp$ret$10;
587
+ tmp_14 = tmp$ret$11;
588
+ }
589
+ var tmp12_elvis_lhs = tmp_14;
590
+ var tmp_15 = tmp12_elvis_lhs == null ? 'null' : tmp12_elvis_lhs;
591
+ Companion_getInstance_1();
592
+ Companion_getInstance_1();
593
+ Companion_getInstance_1();
594
+ Companion_getInstance_1();
595
+ Companion_getInstance_1();
596
+ Companion_getInstance_1();
597
+ Companion_getInstance_1();
598
+ Companion_getInstance_1();
599
+ var tmp13_safe_receiver = _this__u8e3s4.ni_1;
600
+ var tmp14_safe_receiver = tmp13_safe_receiver == null ? null : tmp13_safe_receiver.wh_1;
601
+ var tmp15_elvis_lhs = tmp14_safe_receiver == null ? null : $this.di(tmp14_safe_receiver);
602
+ var tmp_16 = tmp15_elvis_lhs == null ? 'Void' : tmp15_elvis_lhs;
603
+ Companion_getInstance_1();
604
+ return trimMargin('\n |' + ' ' + 'class Response' + tmp + tmp_0 + ' implements Response' + tmp_2 + '<' + tmp_3 + '> {\n |' + ' ' + ' ' + 'private final int status;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> headers;\n |' + ' ' + ' ' + 'private final WirespecShared.Content<' + tmp_4 + '> content;\n |' + ' ' + ' ' + 'public Response' + tmp_5 + tmp_6 + '(' + tmp_9 + 'java.util.Map<String, java.util.List<Object>> headers' + tmp_11 + ') {\n |' + ' ' + ' ' + ' ' + 'this.status = ' + tmp_13 + ';\n |' + ' ' + ' ' + ' ' + 'this.headers = headers;\n |' + ' ' + ' ' + ' ' + 'this.content = ' + tmp_15 + ';\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + '@Override public int getStatus() {return status;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getHeaders() {return headers;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Content<' + tmp_16 + '> getContent() {return content;}\n |' + ' ' + '}\n ');
605
+ }
606
+ function emitResponseMapper(_this__u8e3s4, $this) {
607
+ Companion_getInstance_1();
608
+ var tmp = joinToString(_this__u8e3s4, '', VOID, VOID, VOID, VOID, JavaEmitter$emitResponseMapper$lambda($this));
609
+ Companion_getInstance_1();
610
+ Companion_getInstance_1();
611
+ Companion_getInstance_1();
612
+ return trimMargin('\n |' + ' ' + 'static <B> Response RESPONSE_MAPPER(WirespecShared.ContentMapper<B> contentMapper, int status, java.util.Map<String, java.util.List<Object>> headers, WirespecShared.Content<B> content) {\n |' + tmp + '\n |' + ' ' + ' ' + 'throw new IllegalStateException("Unknown response type");\n |' + ' ' + '}\n ');
613
+ }
614
+ function emitResponseMapperCondition(_this__u8e3s4, $this) {
615
+ var tmp0_subject = _this__u8e3s4.ni_1;
616
+ var tmp;
617
+ if (tmp0_subject == null) {
618
+ Companion_getInstance_1();
619
+ Companion_getInstance_1();
620
+ Companion_getInstance_1();
621
+ var tmp$ret$1;
622
+ // Inline function 'kotlin.takeIf' call
623
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
624
+ // Inline function 'kotlin.contracts.contract' call
625
+ var tmp_0;
626
+ var tmp$ret$0;
627
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
628
+ tmp$ret$0 = isInt(tmp0_takeIf, $this);
629
+ if (tmp$ret$0) {
630
+ tmp_0 = tmp0_takeIf;
631
+ } else {
632
+ tmp_0 = null;
633
+ }
634
+ tmp$ret$1 = tmp_0;
635
+ var tmp1_safe_receiver = tmp$ret$1;
636
+ var tmp_1;
637
+ if (tmp1_safe_receiver == null) {
638
+ tmp_1 = null;
639
+ } else {
640
+ var tmp$ret$3;
641
+ // Inline function 'kotlin.let' call
642
+ // Inline function 'kotlin.contracts.contract' call
643
+ var tmp$ret$2;
644
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
645
+ tmp$ret$2 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
646
+ tmp$ret$3 = tmp$ret$2;
647
+ tmp_1 = tmp$ret$3;
648
+ }
649
+ var tmp_2 = orEmptyString(tmp_1, $this);
650
+ var tmp_3 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
651
+ var tmp$ret$5;
652
+ // Inline function 'kotlin.takeIf' call
653
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
654
+ // Inline function 'kotlin.contracts.contract' call
655
+ var tmp_4;
656
+ var tmp$ret$4;
657
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
658
+ tmp$ret$4 = !isInt(tmp1_takeIf, $this);
659
+ if (tmp$ret$4) {
660
+ tmp_4 = tmp1_takeIf;
661
+ } else {
662
+ tmp_4 = null;
663
+ }
664
+ tmp$ret$5 = tmp_4;
665
+ var tmp2_safe_receiver = tmp$ret$5;
666
+ var tmp_5;
667
+ if (tmp2_safe_receiver == null) {
668
+ tmp_5 = null;
669
+ } else {
670
+ var tmp$ret$7;
671
+ // Inline function 'kotlin.let' call
672
+ // Inline function 'kotlin.contracts.contract' call
673
+ var tmp$ret$6;
674
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
675
+ tmp$ret$6 = 'status, ';
676
+ tmp$ret$7 = tmp$ret$6;
677
+ tmp_5 = tmp$ret$7;
678
+ }
679
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + 'if(' + tmp_2 + 'content == null) { return new Response' + tmp_3 + 'Void(' + orEmptyString(tmp_5, $this) + 'headers); }\n |\n ');
680
+ } else {
681
+ Companion_getInstance_1();
682
+ Companion_getInstance_1();
683
+ Companion_getInstance_1();
684
+ var tmp$ret$9;
685
+ // Inline function 'kotlin.takeIf' call
686
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
687
+ // Inline function 'kotlin.contracts.contract' call
688
+ var tmp_6;
689
+ var tmp$ret$8;
690
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
691
+ tmp$ret$8 = isInt(tmp2_takeIf, $this);
692
+ if (tmp$ret$8) {
693
+ tmp_6 = tmp2_takeIf;
694
+ } else {
695
+ tmp_6 = null;
696
+ }
697
+ tmp$ret$9 = tmp_6;
698
+ var tmp3_safe_receiver = tmp$ret$9;
699
+ var tmp_7;
700
+ if (tmp3_safe_receiver == null) {
701
+ tmp_7 = null;
702
+ } else {
703
+ var tmp$ret$11;
704
+ // Inline function 'kotlin.let' call
705
+ // Inline function 'kotlin.contracts.contract' call
706
+ var tmp$ret$10;
707
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
708
+ tmp$ret$10 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
709
+ tmp$ret$11 = tmp$ret$10;
710
+ tmp_7 = tmp$ret$11;
711
+ }
712
+ var tmp_8 = orEmptyString(tmp_7, $this);
713
+ Companion_getInstance_1();
714
+ Companion_getInstance_1();
715
+ Companion_getInstance_1();
716
+ Companion_getInstance_1();
717
+ var tmp_9 = $this.di(_this__u8e3s4.ni_1.wh_1);
718
+ var tmp_10 = emitPrimaryType(_this__u8e3s4.ni_1.wh_1, $this);
719
+ var tmp_11 = _this__u8e3s4.ni_1.wh_1.qi();
720
+ Companion_getInstance_1();
721
+ Companion_getInstance_1();
722
+ Companion_getInstance_1();
723
+ Companion_getInstance_1();
724
+ var tmp_12 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
725
+ var tmp_13 = emitContentType(_this__u8e3s4.ni_1, $this);
726
+ var tmp$ret$13;
727
+ // Inline function 'kotlin.takeIf' call
728
+ var tmp3_takeIf = _this__u8e3s4.mi_1;
729
+ // Inline function 'kotlin.contracts.contract' call
730
+ var tmp_14;
731
+ var tmp$ret$12;
732
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
733
+ tmp$ret$12 = !isInt(tmp3_takeIf, $this);
734
+ if (tmp$ret$12) {
735
+ tmp_14 = tmp3_takeIf;
736
+ } else {
737
+ tmp_14 = null;
738
+ }
739
+ tmp$ret$13 = tmp_14;
740
+ var tmp4_safe_receiver = tmp$ret$13;
741
+ var tmp_15;
742
+ if (tmp4_safe_receiver == null) {
743
+ tmp_15 = null;
744
+ } else {
745
+ var tmp$ret$15;
746
+ // Inline function 'kotlin.let' call
747
+ // Inline function 'kotlin.contracts.contract' call
748
+ var tmp$ret$14;
749
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
750
+ tmp$ret$14 = 'status, ';
751
+ tmp$ret$15 = tmp$ret$14;
752
+ tmp_15 = tmp$ret$15;
753
+ }
754
+ var tmp_16 = orEmptyString(tmp_15, $this);
755
+ Companion_getInstance_1();
756
+ Companion_getInstance_1();
757
+ Companion_getInstance_1();
758
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + 'if(' + tmp_8 + 'content.type().equals("' + _this__u8e3s4.ni_1.vh_1 + '")) {\n |' + ' ' + ' ' + ' ' + ' ' + 'WirespecShared.Content<' + tmp_9 + '> c = contentMapper.read(content, WirespecShared.getType(' + tmp_10 + '.class, ' + tmp_11 + '));\n |' + ' ' + ' ' + ' ' + ' ' + 'return new Response' + tmp_12 + tmp_13 + '(' + tmp_16 + 'headers, c.body());\n |' + ' ' + ' ' + ' ' + '}\n |\n ');
759
+ }
760
+ return tmp;
761
+ }
762
+ function emitContentType(_this__u8e3s4, $this) {
763
+ var tmp0_safe_receiver = _this__u8e3s4;
764
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.vh_1;
765
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : split(tmp1_safe_receiver, ['/']);
766
+ var tmp;
767
+ if (tmp2_safe_receiver == null) {
768
+ tmp = null;
769
+ } else {
770
+ tmp = joinToString(tmp2_safe_receiver, '', VOID, VOID, VOID, VOID, JavaEmitter$emitContentType$lambda);
771
+ }
772
+ var tmp3_elvis_lhs = tmp;
773
+ return tmp3_elvis_lhs == null ? 'Void' : tmp3_elvis_lhs;
774
+ }
775
+ function emit_1(_this__u8e3s4, $this) {
776
+ return $this.ri(_this__u8e3s4, $this.oh_1, JavaEmitter$emit$lambda_8(_this__u8e3s4));
777
+ }
778
+ function emitRequestSignature(_this__u8e3s4, $this, content) {
779
+ var tmp$ret$4;
780
+ // Inline function 'kotlin.collections.map' call
781
+ var tmp$ret$1;
782
+ // Inline function 'kotlin.collections.filterIsInstance' call
783
+ var tmp1_filterIsInstance = _this__u8e3s4.gi_1;
784
+ var tmp$ret$0;
785
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
786
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
787
+ var tmp0_iterator = tmp1_filterIsInstance.c();
788
+ while (tmp0_iterator.d()) {
789
+ var element = tmp0_iterator.e();
790
+ if (element instanceof Param) {
791
+ tmp0_filterIsInstanceTo.a(element);
792
+ }
793
+ }
794
+ tmp$ret$0 = tmp0_filterIsInstanceTo;
795
+ tmp$ret$1 = tmp$ret$0;
796
+ var tmp3_map = tmp$ret$1;
797
+ var tmp$ret$3;
798
+ // Inline function 'kotlin.collections.mapTo' call
799
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
800
+ var tmp0_iterator_0 = tmp3_map.c();
801
+ while (tmp0_iterator_0.d()) {
802
+ var item = tmp0_iterator_0.e();
803
+ var tmp$ret$2;
804
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitRequestSignature.<anonymous>' call
805
+ tmp$ret$2 = new Field(item.si_1, item.ti_1, false);
806
+ tmp2_mapTo.a(tmp$ret$2);
807
+ }
808
+ tmp$ret$3 = tmp2_mapTo;
809
+ tmp$ret$4 = tmp$ret$3;
810
+ var pathField = tmp$ret$4;
811
+ var parameters = plus(plus(plus(pathField, _this__u8e3s4.hi_1), _this__u8e3s4.ii_1), _this__u8e3s4.ji_1);
812
+ var tmp0_safe_receiver = content;
813
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
814
+ var tmp = filterNotNull(plus_0(parameters, tmp1_safe_receiver == null ? null : toField(tmp1_safe_receiver, 'body', false)));
815
+ return joinToString(tmp, ', ', VOID, VOID, VOID, VOID, JavaEmitter$emitRequestSignature$lambda($this));
816
+ }
817
+ function emitMap(_this__u8e3s4, $this) {
818
+ return joinToString(_this__u8e3s4, ', ', 'java.util.Map.of(', ')', VOID, VOID, JavaEmitter$emitMap$lambda($this));
819
+ }
820
+ function emitSegment(_this__u8e3s4, $this) {
821
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, JavaEmitter$emitSegment$lambda);
822
+ }
823
+ function emitPath(_this__u8e3s4, $this) {
824
+ return '"/" + ' + joinToString(_this__u8e3s4, ' + "/" + ', VOID, VOID, VOID, VOID, JavaEmitter$emitPath$lambda($this));
825
+ }
826
+ function orEmptyString(_this__u8e3s4, $this) {
827
+ var tmp0_elvis_lhs = _this__u8e3s4;
828
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
829
+ }
830
+ function isInt(_this__u8e3s4, $this) {
831
+ return !(toIntOrNull(_this__u8e3s4) == null);
832
+ }
833
+ function groupStatus(_this__u8e3s4, $this) {
834
+ var tmp;
835
+ if (isInt(_this__u8e3s4, $this)) {
836
+ var tmp$ret$1;
837
+ // Inline function 'kotlin.text.substring' call
838
+ var tmp$ret$0;
839
+ // Inline function 'kotlin.js.asDynamic' call
840
+ tmp$ret$0 = _this__u8e3s4;
841
+ tmp$ret$1 = tmp$ret$0.substring(0, 1);
842
+ tmp = tmp$ret$1 + 'XX';
843
+ } else {
844
+ tmp = Companion_getInstance_1().pi(_this__u8e3s4);
845
+ }
846
+ return tmp;
847
+ }
848
+ function JavaEmitter$emit$lambda($this_emit, this$0) {
849
+ return function () {
850
+ return trimMargin('public record ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |) {};\n |');
851
+ };
852
+ }
853
+ function JavaEmitter$emit$lambda$lambda(this$0) {
854
+ return function (it) {
855
+ return this$0.xi(it);
856
+ };
857
+ }
858
+ function JavaEmitter$emit$lambda_0($this_emit, this$0) {
859
+ return function () {
860
+ return joinToString($this_emit.yi_1, ',\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda(this$0));
861
+ };
862
+ }
863
+ function JavaEmitter$emit$lambda_1($this_emit, this$0) {
864
+ return function () {
865
+ Companion_getInstance_1();
866
+ return ' ' + ($this_emit.bj_1 ? 'java.util.Optional<' + this$0.di($this_emit.aj_1) + '>' : this$0.di($this_emit.aj_1)) + ' ' + this$0.cj($this_emit.zi_1);
867
+ };
868
+ }
869
+ function JavaEmitter$emit$lambda_2($this_emit) {
870
+ return function () {
871
+ return $this_emit.dj_1;
872
+ };
873
+ }
874
+ function JavaEmitter$emitPrimaryType$lambda($this_emitPrimaryType) {
875
+ return function () {
876
+ var tmp0_subject = $this_emitPrimaryType;
877
+ var tmp;
878
+ if (tmp0_subject instanceof Custom) {
879
+ tmp = $this_emitPrimaryType.gj_1;
880
+ } else {
881
+ if (tmp0_subject instanceof Primitive) {
882
+ var tmp1_subject = $this_emitPrimaryType.ej_1;
883
+ var tmp0 = tmp1_subject.q4_1;
884
+ var tmp_0;
885
+ switch (tmp0) {
886
+ case 0:
887
+ tmp_0 = 'String';
888
+ break;
889
+ case 1:
890
+ tmp_0 = 'Integer';
891
+ break;
892
+ case 2:
893
+ tmp_0 = 'Boolean';
894
+ break;
895
+ default:
896
+ noWhenBranchMatchedException();
897
+ break;
898
+ }
899
+ tmp = tmp_0;
900
+ } else {
901
+ noWhenBranchMatchedException();
902
+ }
903
+ }
904
+ return tmp;
905
+ };
906
+ }
907
+ function JavaEmitter$emit$lambda_3(this$0, $this_emit) {
908
+ return function () {
909
+ var tmp$ret$1;
910
+ // Inline function 'kotlin.let' call
911
+ var tmp0_let = emitPrimaryType($this_emit, this$0);
912
+ // Inline function 'kotlin.contracts.contract' call
913
+ var tmp$ret$0;
914
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
915
+ tmp$ret$0 = $this_emit.qi() ? 'java.util.List<' + tmp0_let + '>' : tmp0_let;
916
+ tmp$ret$1 = tmp$ret$0;
917
+ return tmp$ret$1;
918
+ };
919
+ }
920
+ function JavaEmitter$emit$lambda_4($this_emit) {
921
+ return function () {
922
+ Companion_getInstance_1();
923
+ return 'enum ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + ';\n}\n';
924
+ };
925
+ }
926
+ function JavaEmitter$emit$lambda_5($this_emit, this$0) {
927
+ return function () {
928
+ Companion_getInstance_1();
929
+ Companion_getInstance_1();
930
+ var tmp = this$0.mj($this_emit.lj_1);
931
+ Companion_getInstance_1();
932
+ return trimMargin('public record ' + $this_emit.kj_1 + '(String value) {\n |' + ' ' + 'static void validate(' + $this_emit.kj_1 + ' record) {\n |' + ' ' + tmp + '\n |' + ' ' + '}\n |}\n |');
933
+ };
934
+ }
935
+ function JavaEmitter$emit$lambda_6($this_emit) {
936
+ return function () {
937
+ Companion_getInstance_1();
938
+ return ' ' + 'java.util.regex.Pattern.compile(' + $this_emit.nj_1 + ').matcher(record.value).find();';
939
+ };
940
+ }
941
+ function JavaEmitter$emit$lambda$lambda_0(this$0, $this_emit) {
942
+ return function (it) {
943
+ return emit(it, this$0, $this_emit);
944
+ };
945
+ }
946
+ function JavaEmitter$emit$lambda$lambda_1(it) {
947
+ Companion_getInstance_1();
948
+ return ' ' + 'interface Response' + it + '<T> extends Response<T>{};';
949
+ }
950
+ function JavaEmitter$emit$lambda$lambda_2(this$0) {
951
+ return function (it) {
952
+ Companion_getInstance_1();
953
+ return ' ' + 'interface Response' + it + '<T> extends Response' + groupStatus(it, this$0) + '<T>{};';
954
+ };
955
+ }
956
+ function JavaEmitter$emit$lambda$lambda_3(this$0) {
957
+ return function (it) {
958
+ return emit_0(it, this$0);
959
+ };
960
+ }
961
+ function JavaEmitter$emit$lambda_7($this_emit, this$0) {
962
+ return function () {
963
+ Companion_getInstance_1();
964
+ var tmp = emitSegment($this_emit.gi_1, this$0);
965
+ var tmp_0 = emitResponseMapper($this_emit.li_1, this$0);
966
+ Companion_getInstance_1();
967
+ var tmp_1 = joinToString($this_emit.ki_1, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_0(this$0, $this_emit));
968
+ Companion_getInstance_1();
969
+ var tmp$ret$2;
970
+ // Inline function 'kotlin.collections.map' call
971
+ var tmp1_map = $this_emit.li_1;
972
+ var tmp$ret$1;
973
+ // Inline function 'kotlin.collections.mapTo' call
974
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
975
+ var tmp0_iterator = tmp1_map.c();
976
+ while (tmp0_iterator.d()) {
977
+ var item = tmp0_iterator.e();
978
+ var tmp$ret$0;
979
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
980
+ tmp$ret$0 = groupStatus(item.mi_1, this$0);
981
+ tmp0_mapTo.a(tmp$ret$0);
982
+ }
983
+ tmp$ret$1 = tmp0_mapTo;
984
+ tmp$ret$2 = tmp$ret$1;
985
+ var tmp_2 = toSet(tmp$ret$2);
986
+ var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_1);
987
+ var tmp$ret$8;
988
+ // Inline function 'kotlin.collections.map' call
989
+ var tmp$ret$5;
990
+ // Inline function 'kotlin.collections.filter' call
991
+ var tmp3_filter = $this_emit.li_1;
992
+ var tmp$ret$4;
993
+ // Inline function 'kotlin.collections.filterTo' call
994
+ var tmp2_filterTo = ArrayList_init_$Create$();
995
+ var tmp0_iterator_0 = tmp3_filter.c();
996
+ while (tmp0_iterator_0.d()) {
997
+ var element = tmp0_iterator_0.e();
998
+ var tmp$ret$3;
999
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
1000
+ tmp$ret$3 = isInt(element.mi_1, this$0);
1001
+ if (tmp$ret$3) {
1002
+ tmp2_filterTo.a(element);
1003
+ }
1004
+ }
1005
+ tmp$ret$4 = tmp2_filterTo;
1006
+ tmp$ret$5 = tmp$ret$4;
1007
+ var tmp5_map = tmp$ret$5;
1008
+ var tmp$ret$7;
1009
+ // Inline function 'kotlin.collections.mapTo' call
1010
+ var tmp4_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_map, 10));
1011
+ var tmp0_iterator_1 = tmp5_map.c();
1012
+ while (tmp0_iterator_1.d()) {
1013
+ var item_0 = tmp0_iterator_1.e();
1014
+ var tmp$ret$6;
1015
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
1016
+ tmp$ret$6 = item_0.mi_1;
1017
+ tmp4_mapTo.a(tmp$ret$6);
1018
+ }
1019
+ tmp$ret$7 = tmp4_mapTo;
1020
+ tmp$ret$8 = tmp$ret$7;
1021
+ var tmp_4 = tmp$ret$8;
1022
+ var tmp_5 = joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_2(this$0));
1023
+ var tmp_6 = joinToString($this_emit.li_1, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_3(this$0));
1024
+ Companion_getInstance_1();
1025
+ return trimMargin('public interface ' + $this_emit.ei_1 + ' {\n |' + ' ' + 'static String PATH = "' + tmp + '";\n |' + tmp_0 + '\n |' + ' ' + 'interface Request<T> extends WirespecShared.Request<T> {}\n |' + tmp_1 + '\n |' + ' ' + 'interface Response<T> extends WirespecShared.Response<T> {}\n |' + tmp_3 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + ' ' + 'public Response ' + Companion_getInstance_1().oj($this_emit.ei_1) + '(Request request);\n |}\n |');
1026
+ };
1027
+ }
1028
+ function JavaEmitter$emitResponseMapper$lambda(this$0) {
1029
+ return function (it) {
1030
+ return emitResponseMapperCondition(it, this$0);
1031
+ };
1032
+ }
1033
+ function JavaEmitter$emitContentType$lambda(it) {
1034
+ return Companion_getInstance_1().pi(it);
1035
+ }
1036
+ function JavaEmitter$emit$lambda_8($this_emit) {
1037
+ return function () {
1038
+ var tmp0_subject = $this_emit;
1039
+ var tmp;
1040
+ if (tmp0_subject instanceof Literal) {
1041
+ tmp = '"' + $this_emit.pj_1 + '"';
1042
+ } else {
1043
+ if (tmp0_subject instanceof Param) {
1044
+ tmp = $this_emit.si_1.dj_1;
1045
+ } else {
1046
+ noWhenBranchMatchedException();
1047
+ }
1048
+ }
1049
+ return tmp;
1050
+ };
1051
+ }
1052
+ function JavaEmitter$emitRequestSignature$lambda(this$0) {
1053
+ return function (it) {
1054
+ return this$0.xi(it);
1055
+ };
1056
+ }
1057
+ function JavaEmitter$emitMap$lambda(this$0) {
1058
+ return function (it) {
1059
+ return '"' + this$0.cj(it.zi_1) + '", java.util.List.of(' + this$0.cj(it.zi_1) + ')';
1060
+ };
1061
+ }
1062
+ function JavaEmitter$emitSegment$lambda(it) {
1063
+ var tmp0_subject = it;
1064
+ var tmp;
1065
+ if (tmp0_subject instanceof Param) {
1066
+ tmp = '{' + it.si_1.dj_1 + '}';
1067
+ } else {
1068
+ if (tmp0_subject instanceof Literal) {
1069
+ tmp = it.pj_1;
1070
+ } else {
1071
+ noWhenBranchMatchedException();
1072
+ }
1073
+ }
1074
+ return tmp;
1075
+ }
1076
+ function JavaEmitter$emitPath$lambda(this$0) {
1077
+ return function (it) {
1078
+ return emit_1(it, this$0);
1079
+ };
1080
+ }
1081
+ function JavaEmitter(packageName, logger) {
1082
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
1083
+ logger = logger === VOID ? get_noLogger() : logger;
1084
+ Emitter.call(this, logger, true);
1085
+ this.ai_1 = packageName;
1086
+ var tmp = this;
1087
+ Companion_getInstance_1();
1088
+ Companion_getInstance_1();
1089
+ Companion_getInstance_1();
1090
+ Companion_getInstance_1();
1091
+ Companion_getInstance_1();
1092
+ Companion_getInstance_1();
1093
+ Companion_getInstance_1();
1094
+ Companion_getInstance_1();
1095
+ Companion_getInstance_1();
1096
+ Companion_getInstance_1();
1097
+ Companion_getInstance_1();
1098
+ Companion_getInstance_1();
1099
+ Companion_getInstance_1();
1100
+ Companion_getInstance_1();
1101
+ Companion_getInstance_1();
1102
+ Companion_getInstance_1();
1103
+ Companion_getInstance_1();
1104
+ Companion_getInstance_1();
1105
+ Companion_getInstance_1();
1106
+ Companion_getInstance_1();
1107
+ Companion_getInstance_1();
1108
+ Companion_getInstance_1();
1109
+ Companion_getInstance_1();
1110
+ Companion_getInstance_1();
1111
+ Companion_getInstance_1();
1112
+ Companion_getInstance_1();
1113
+ Companion_getInstance_1();
1114
+ Companion_getInstance_1();
1115
+ Companion_getInstance_1();
1116
+ Companion_getInstance_1();
1117
+ Companion_getInstance_1();
1118
+ Companion_getInstance_1();
1119
+ Companion_getInstance_1();
1120
+ Companion_getInstance_1();
1121
+ Companion_getInstance_1();
1122
+ Companion_getInstance_1();
1123
+ tmp.bi_1 = trimMargin('\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |\n |public interface WirespecShared {\n |' + ' ' + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE };\n |' + ' ' + 'record Content<T> (String type, T body) {};\n |' + ' ' + 'interface Request<T> { String getPath(); Method getMethod(); java.util.Map<String, java.util.List<Object>> getQuery(); java.util.Map<String, java.util.List<Object>> getHeaders(); Content<T> getContent(); }\n |' + ' ' + 'interface Response<T> { int getStatus(); java.util.Map<String, java.util.List<Object>> getHeaders(); Content<T> getContent(); }\n |' + ' ' + 'interface ContentMapper<B> { <T> Content<T> read(Content<B> content, Type valueType); <T> Content<B> write(Content<T> content); }\n |' + ' ' + 'static Type getType(final Class<?> type, final boolean isIterable) {\n |' + ' ' + ' ' + 'if(isIterable) {\n |' + ' ' + ' ' + ' ' + 'return new ParameterizedType() {\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type getRawType() {return java.util.List.class;}\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type[] getActualTypeArguments() {Class<?>[] types = {type};return types;}\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type getOwnerType() {return null;}\n |' + ' ' + ' ' + ' ' + '};\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + 'else {\n |' + ' ' + ' ' + ' ' + 'return type;\n |' + ' ' + ' ' + '}\n |' + ' ' + '}\n |}\n ');
1124
+ this.ci_1 = isBlank(this.ai_1) ? '' : 'package ' + this.ai_1 + ';';
1125
+ }
1126
+ protoOf(JavaEmitter).qh = function (ast) {
1127
+ var tmp$ret$2;
1128
+ // Inline function 'kotlin.collections.map' call
1129
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
1130
+ var tmp$ret$1;
1131
+ // Inline function 'kotlin.collections.mapTo' call
1132
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1133
+ var tmp0_iterator = tmp1_map.c();
1134
+ while (tmp0_iterator.d()) {
1135
+ var item = tmp0_iterator.e();
1136
+ var tmp$ret$0;
1137
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
1138
+ var name = item.i3();
1139
+ var result = item.j3();
1140
+ tmp$ret$0 = to(name, this.ci_1 + '\n\n' + result);
1141
+ tmp0_mapTo.a(tmp$ret$0);
1142
+ }
1143
+ tmp$ret$1 = tmp0_mapTo;
1144
+ tmp$ret$2 = tmp$ret$1;
1145
+ return plus_0(tmp$ret$2, to('WirespecShared', this.ci_1 + '\n\n' + this.bi_1));
1146
+ };
1147
+ protoOf(JavaEmitter).qj = function (_this__u8e3s4) {
1148
+ return this.rj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda(_this__u8e3s4, this));
1149
+ };
1150
+ protoOf(JavaEmitter).wi = function (_this__u8e3s4) {
1151
+ return this.sj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_0(_this__u8e3s4, this));
1152
+ };
1153
+ protoOf(JavaEmitter).xi = function (_this__u8e3s4) {
1154
+ return this.tj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_1(_this__u8e3s4, this));
1155
+ };
1156
+ protoOf(JavaEmitter).cj = function (_this__u8e3s4) {
1157
+ return this.uj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_2(_this__u8e3s4));
1158
+ };
1159
+ protoOf(JavaEmitter).di = function (_this__u8e3s4) {
1160
+ return this.th(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_3(this, _this__u8e3s4));
1161
+ };
1162
+ protoOf(JavaEmitter).vj = function (_this__u8e3s4) {
1163
+ return this.wj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_4(_this__u8e3s4));
1164
+ };
1165
+ protoOf(JavaEmitter).xj = function (_this__u8e3s4) {
1166
+ return this.yj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_5(_this__u8e3s4, this));
1167
+ };
1168
+ protoOf(JavaEmitter).mj = function (_this__u8e3s4) {
1169
+ return this.zj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_6(_this__u8e3s4));
1170
+ };
1171
+ protoOf(JavaEmitter).ak = function (_this__u8e3s4) {
1172
+ return this.bk(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_7(_this__u8e3s4, this));
1173
+ };
1174
+ function hasEndpoints(_this__u8e3s4, $this) {
1175
+ var tmp$ret$0;
1176
+ $l$block_0: {
1177
+ // Inline function 'kotlin.collections.any' call
1178
+ var tmp;
1179
+ if (isInterface(_this__u8e3s4, Collection)) {
1180
+ tmp = _this__u8e3s4.g();
1181
+ } else {
1182
+ tmp = false;
1183
+ }
1184
+ if (tmp) {
1185
+ tmp$ret$0 = false;
1186
+ break $l$block_0;
1187
+ }
1188
+ var tmp0_iterator = _this__u8e3s4.c();
1189
+ while (tmp0_iterator.d()) {
1190
+ var element = tmp0_iterator.e();
1191
+ var tmp$ret$1;
1192
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.hasEndpoints.<anonymous>' call
1193
+ tmp$ret$1 = element instanceof Endpoint;
1194
+ if (tmp$ret$1) {
1195
+ tmp$ret$0 = true;
1196
+ break $l$block_0;
1197
+ }
1198
+ }
1199
+ tmp$ret$0 = false;
1200
+ }
1201
+ return tmp$ret$0;
1202
+ }
1203
+ function emitRequestSignature_0(_this__u8e3s4, $this, content) {
1204
+ var tmp$ret$4;
1205
+ // Inline function 'kotlin.collections.map' call
1206
+ var tmp$ret$1;
1207
+ // Inline function 'kotlin.collections.filterIsInstance' call
1208
+ var tmp1_filterIsInstance = _this__u8e3s4.gi_1;
1209
+ var tmp$ret$0;
1210
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
1211
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
1212
+ var tmp0_iterator = tmp1_filterIsInstance.c();
1213
+ while (tmp0_iterator.d()) {
1214
+ var element = tmp0_iterator.e();
1215
+ if (element instanceof Param) {
1216
+ tmp0_filterIsInstanceTo.a(element);
1217
+ }
1218
+ }
1219
+ tmp$ret$0 = tmp0_filterIsInstanceTo;
1220
+ tmp$ret$1 = tmp$ret$0;
1221
+ var tmp3_map = tmp$ret$1;
1222
+ var tmp$ret$3;
1223
+ // Inline function 'kotlin.collections.mapTo' call
1224
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
1225
+ var tmp0_iterator_0 = tmp3_map.c();
1226
+ while (tmp0_iterator_0.d()) {
1227
+ var item = tmp0_iterator_0.e();
1228
+ var tmp$ret$2;
1229
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitRequestSignature.<anonymous>' call
1230
+ tmp$ret$2 = new Field(item.si_1, item.ti_1, false);
1231
+ tmp2_mapTo.a(tmp$ret$2);
1232
+ }
1233
+ tmp$ret$3 = tmp2_mapTo;
1234
+ tmp$ret$4 = tmp$ret$3;
1235
+ var pathField = tmp$ret$4;
1236
+ var parameters = plus(plus(plus(pathField, _this__u8e3s4.hi_1), _this__u8e3s4.ii_1), _this__u8e3s4.ji_1);
1237
+ var tmp0_safe_receiver = content;
1238
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
1239
+ var tmp = filterNotNull(plus_0(parameters, tmp1_safe_receiver == null ? null : toField(tmp1_safe_receiver, 'body', false)));
1240
+ return trimMargin('\n |(' + joinToString(tmp, ', ', VOID, VOID, VOID, VOID, KotlinEmitter$emitRequestSignature$lambda($this)) + ')\n ');
1241
+ }
1242
+ function emitSegment_0(_this__u8e3s4, $this) {
1243
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, KotlinEmitter$emitSegment$lambda);
1244
+ }
1245
+ function emitMap_0(_this__u8e3s4, $this) {
1246
+ return joinToString(_this__u8e3s4, ', ', VOID, VOID, VOID, VOID, KotlinEmitter$emitMap$lambda($this));
1247
+ }
1248
+ function emit_2(_this__u8e3s4, $this) {
1249
+ return $this.ri(_this__u8e3s4, $this.oh_1, KotlinEmitter$emit$lambda_8(_this__u8e3s4));
1250
+ }
1251
+ function emitPath_0(_this__u8e3s4, $this) {
1252
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, KotlinEmitter$emitPath$lambda($this));
1253
+ }
1254
+ function emitResponseMapper_0(_this__u8e3s4, $this) {
1255
+ Companion_getInstance_1();
1256
+ Companion_getInstance_1();
1257
+ Companion_getInstance_1();
1258
+ var tmp$ret$2;
1259
+ // Inline function 'kotlin.collections.filter' call
1260
+ var tmp$ret$1;
1261
+ // Inline function 'kotlin.collections.filterTo' call
1262
+ var tmp0_filterTo = ArrayList_init_$Create$();
1263
+ var tmp0_iterator = _this__u8e3s4.c();
1264
+ while (tmp0_iterator.d()) {
1265
+ var element = tmp0_iterator.e();
1266
+ var tmp$ret$0;
1267
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapper.<anonymous>' call
1268
+ tmp$ret$0 = isInt_0(element.mi_1);
1269
+ if (tmp$ret$0) {
1270
+ tmp0_filterTo.a(element);
1271
+ }
1272
+ }
1273
+ tmp$ret$1 = tmp0_filterTo;
1274
+ tmp$ret$2 = tmp$ret$1;
1275
+ var tmp = tmp$ret$2;
1276
+ var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitResponseMapper$lambda($this));
1277
+ var tmp$ret$5;
1278
+ // Inline function 'kotlin.collections.filter' call
1279
+ var tmp$ret$4;
1280
+ // Inline function 'kotlin.collections.filterTo' call
1281
+ var tmp1_filterTo = ArrayList_init_$Create$();
1282
+ var tmp0_iterator_0 = _this__u8e3s4.c();
1283
+ while (tmp0_iterator_0.d()) {
1284
+ var element_0 = tmp0_iterator_0.e();
1285
+ var tmp$ret$3;
1286
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapper.<anonymous>' call
1287
+ tmp$ret$3 = !isInt_0(element_0.mi_1);
1288
+ if (tmp$ret$3) {
1289
+ tmp1_filterTo.a(element_0);
1290
+ }
1291
+ }
1292
+ tmp$ret$4 = tmp1_filterTo;
1293
+ tmp$ret$5 = tmp$ret$4;
1294
+ var tmp_1 = tmp$ret$5;
1295
+ var tmp_2 = joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitResponseMapper$lambda_0($this));
1296
+ Companion_getInstance_1();
1297
+ Companion_getInstance_1();
1298
+ Companion_getInstance_1();
1299
+ return trimMargin('\n |fun <B> RESPONSE_MAPPER(contentMapper: WirespecShared.ContentMapper<B>) =\n |' + ' ' + 'fun(status: Int, headers:Map<String, List<Any?>>, content: WirespecShared.Content<B>?) =\n |' + ' ' + ' ' + 'when {\n |' + tmp_0 + '\n |' + tmp_2 + '\n |' + ' ' + ' ' + ' ' + 'else -> error("Cannot map response with status $status")\n ');
1300
+ }
1301
+ function emitResponseMapperCondition_0(_this__u8e3s4, $this) {
1302
+ var tmp0_subject = _this__u8e3s4.ni_1;
1303
+ var tmp;
1304
+ if (tmp0_subject == null) {
1305
+ Companion_getInstance_1();
1306
+ Companion_getInstance_1();
1307
+ Companion_getInstance_1();
1308
+ var tmp$ret$1;
1309
+ // Inline function 'kotlin.takeIf' call
1310
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
1311
+ // Inline function 'kotlin.contracts.contract' call
1312
+ var tmp_0;
1313
+ var tmp$ret$0;
1314
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1315
+ tmp$ret$0 = isInt_0(tmp0_takeIf);
1316
+ if (tmp$ret$0) {
1317
+ tmp_0 = tmp0_takeIf;
1318
+ } else {
1319
+ tmp_0 = null;
1320
+ }
1321
+ tmp$ret$1 = tmp_0;
1322
+ var tmp1_safe_receiver = tmp$ret$1;
1323
+ var tmp_1;
1324
+ if (tmp1_safe_receiver == null) {
1325
+ tmp_1 = null;
1326
+ } else {
1327
+ var tmp$ret$3;
1328
+ // Inline function 'kotlin.let' call
1329
+ // Inline function 'kotlin.contracts.contract' call
1330
+ var tmp$ret$2;
1331
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1332
+ tmp$ret$2 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
1333
+ tmp$ret$3 = tmp$ret$2;
1334
+ tmp_1 = tmp$ret$3;
1335
+ }
1336
+ var tmp_2 = orEmptyString_0(tmp_1);
1337
+ var tmp_3 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
1338
+ var tmp$ret$5;
1339
+ // Inline function 'kotlin.takeIf' call
1340
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
1341
+ // Inline function 'kotlin.contracts.contract' call
1342
+ var tmp_4;
1343
+ var tmp$ret$4;
1344
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1345
+ tmp$ret$4 = !isInt_0(tmp1_takeIf);
1346
+ if (tmp$ret$4) {
1347
+ tmp_4 = tmp1_takeIf;
1348
+ } else {
1349
+ tmp_4 = null;
1350
+ }
1351
+ tmp$ret$5 = tmp_4;
1352
+ var tmp2_safe_receiver = tmp$ret$5;
1353
+ var tmp_5;
1354
+ if (tmp2_safe_receiver == null) {
1355
+ tmp_5 = null;
1356
+ } else {
1357
+ var tmp$ret$7;
1358
+ // Inline function 'kotlin.let' call
1359
+ // Inline function 'kotlin.contracts.contract' call
1360
+ var tmp$ret$6;
1361
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1362
+ tmp$ret$6 = 'status, ';
1363
+ tmp$ret$7 = tmp$ret$6;
1364
+ tmp_5 = tmp$ret$7;
1365
+ }
1366
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + tmp_2 + 'content == null -> Response' + tmp_3 + 'Unit(' + orEmptyString_0(tmp_5) + 'headers)\n ');
1367
+ } else {
1368
+ Companion_getInstance_1();
1369
+ Companion_getInstance_1();
1370
+ Companion_getInstance_1();
1371
+ var tmp$ret$9;
1372
+ // Inline function 'kotlin.takeIf' call
1373
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
1374
+ // Inline function 'kotlin.contracts.contract' call
1375
+ var tmp_6;
1376
+ var tmp$ret$8;
1377
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1378
+ tmp$ret$8 = isInt_0(tmp2_takeIf);
1379
+ if (tmp$ret$8) {
1380
+ tmp_6 = tmp2_takeIf;
1381
+ } else {
1382
+ tmp_6 = null;
1383
+ }
1384
+ tmp$ret$9 = tmp_6;
1385
+ var tmp3_safe_receiver = tmp$ret$9;
1386
+ var tmp_7;
1387
+ if (tmp3_safe_receiver == null) {
1388
+ tmp_7 = null;
1389
+ } else {
1390
+ var tmp$ret$11;
1391
+ // Inline function 'kotlin.let' call
1392
+ // Inline function 'kotlin.contracts.contract' call
1393
+ var tmp$ret$10;
1394
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1395
+ tmp$ret$10 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
1396
+ tmp$ret$11 = tmp$ret$10;
1397
+ tmp_7 = tmp$ret$11;
1398
+ }
1399
+ var tmp_8 = orEmptyString_0(tmp_7);
1400
+ Companion_getInstance_1();
1401
+ Companion_getInstance_1();
1402
+ Companion_getInstance_1();
1403
+ Companion_getInstance_1();
1404
+ var tmp_9 = $this.di(_this__u8e3s4.ni_1.wh_1);
1405
+ var tmp_10 = $this.di(_this__u8e3s4.ni_1.wh_1);
1406
+ Companion_getInstance_1();
1407
+ Companion_getInstance_1();
1408
+ Companion_getInstance_1();
1409
+ Companion_getInstance_1();
1410
+ var tmp_11 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
1411
+ var tmp_12 = emitContentType_0(_this__u8e3s4.ni_1);
1412
+ var tmp$ret$13;
1413
+ // Inline function 'kotlin.takeIf' call
1414
+ var tmp3_takeIf = _this__u8e3s4.mi_1;
1415
+ // Inline function 'kotlin.contracts.contract' call
1416
+ var tmp_13;
1417
+ var tmp$ret$12;
1418
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1419
+ tmp$ret$12 = !isInt_0(tmp3_takeIf);
1420
+ if (tmp$ret$12) {
1421
+ tmp_13 = tmp3_takeIf;
1422
+ } else {
1423
+ tmp_13 = null;
1424
+ }
1425
+ tmp$ret$13 = tmp_13;
1426
+ var tmp4_safe_receiver = tmp$ret$13;
1427
+ var tmp_14;
1428
+ if (tmp4_safe_receiver == null) {
1429
+ tmp_14 = null;
1430
+ } else {
1431
+ var tmp$ret$15;
1432
+ // Inline function 'kotlin.let' call
1433
+ // Inline function 'kotlin.contracts.contract' call
1434
+ var tmp$ret$14;
1435
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1436
+ tmp$ret$14 = 'status, ';
1437
+ tmp$ret$15 = tmp$ret$14;
1438
+ tmp_14 = tmp$ret$15;
1439
+ }
1440
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + tmp_8 + 'content?.type == "' + _this__u8e3s4.ni_1.vh_1 + '" -> contentMapper\n |' + ' ' + ' ' + ' ' + ' ' + '.read<' + tmp_9 + '>(content, typeOf<' + tmp_10 + '>())\n |' + ' ' + ' ' + ' ' + ' ' + '.let{ Response' + tmp_11 + tmp_12 + '(' + orEmptyString_0(tmp_14) + 'headers, it.body) }\n ');
1441
+ }
1442
+ return tmp;
1443
+ }
1444
+ function KotlinEmitter$emit$lambda($this_emit, this$0) {
1445
+ return function () {
1446
+ return trimMargin('|data class ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |)\n |');
1447
+ };
1448
+ }
1449
+ function KotlinEmitter$emit$lambda$lambda(this$0) {
1450
+ return function (it) {
1451
+ Companion_getInstance_1();
1452
+ return ' ' + 'val ' + this$0.xi(it);
1453
+ };
1454
+ }
1455
+ function KotlinEmitter$emit$lambda_0($this_emit, this$0) {
1456
+ return function () {
1457
+ return joinToString($this_emit.yi_1, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda(this$0));
1458
+ };
1459
+ }
1460
+ function KotlinEmitter$emit$lambda_1(this$0, $this_emit) {
1461
+ return function () {
1462
+ return this$0.cj($this_emit.zi_1) + ': ' + this$0.di($this_emit.aj_1) + ($this_emit.bj_1 ? '? = null' : '');
1463
+ };
1464
+ }
1465
+ function KotlinEmitter$emit$lambda_2($this_emit) {
1466
+ return function () {
1467
+ var tmp$ret$2;
1468
+ // Inline function 'kotlin.collections.mapIndexed' call
1469
+ var tmp1_mapIndexed = split($this_emit.dj_1, ['-']);
1470
+ var tmp$ret$1;
1471
+ // Inline function 'kotlin.collections.mapIndexedTo' call
1472
+ var tmp0_mapIndexedTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_mapIndexed, 10));
1473
+ var index = 0;
1474
+ var tmp0_iterator = tmp1_mapIndexed.c();
1475
+ while (tmp0_iterator.d()) {
1476
+ var item = tmp0_iterator.e();
1477
+ var tmp$ret$0;
1478
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1479
+ var tmp1 = index;
1480
+ index = tmp1 + 1 | 0;
1481
+ var tmp2__anonymous__z9zvc9 = checkIndexOverflow(tmp1);
1482
+ tmp$ret$0 = tmp2__anonymous__z9zvc9 > 0 ? Companion_getInstance_1().pi(item) : item;
1483
+ tmp0_mapIndexedTo.a(tmp$ret$0);
1484
+ }
1485
+ tmp$ret$1 = tmp0_mapIndexedTo;
1486
+ tmp$ret$2 = tmp$ret$1;
1487
+ return joinToString(tmp$ret$2, '');
1488
+ };
1489
+ }
1490
+ function KotlinEmitter$emit$lambda_3($this_emit) {
1491
+ return function () {
1492
+ var tmp$ret$1;
1493
+ // Inline function 'kotlin.let' call
1494
+ var tmp0_subject = $this_emit;
1495
+ var tmp;
1496
+ if (tmp0_subject instanceof Custom) {
1497
+ tmp = $this_emit.gj_1;
1498
+ } else {
1499
+ if (tmp0_subject instanceof Primitive) {
1500
+ var tmp1_subject = $this_emit.ej_1;
1501
+ var tmp0 = tmp1_subject.q4_1;
1502
+ var tmp_0;
1503
+ switch (tmp0) {
1504
+ case 0:
1505
+ tmp_0 = 'String';
1506
+ break;
1507
+ case 1:
1508
+ tmp_0 = 'Int';
1509
+ break;
1510
+ case 2:
1511
+ tmp_0 = 'Boolean';
1512
+ break;
1513
+ default:
1514
+ noWhenBranchMatchedException();
1515
+ break;
1516
+ }
1517
+ tmp = tmp_0;
1518
+ } else {
1519
+ noWhenBranchMatchedException();
1520
+ }
1521
+ }
1522
+ var tmp0_let = tmp;
1523
+ // Inline function 'kotlin.contracts.contract' call
1524
+ var tmp$ret$0;
1525
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1526
+ tmp$ret$0 = $this_emit.qi() ? 'List<' + tmp0_let + '>' : tmp0_let;
1527
+ tmp$ret$1 = tmp$ret$0;
1528
+ return tmp$ret$1;
1529
+ };
1530
+ }
1531
+ function KotlinEmitter$emit$lambda_4($this_emit) {
1532
+ return function () {
1533
+ Companion_getInstance_1();
1534
+ return 'enum class ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + '\n}\n';
1535
+ };
1536
+ }
1537
+ function KotlinEmitter$emit$lambda_5($this_emit, this$0) {
1538
+ return function () {
1539
+ return trimMargin('data class ' + $this_emit.kj_1 + '(val value: String)\n |fun ' + $this_emit.kj_1 + '.validate() = ' + this$0.mj($this_emit.lj_1) + '\n |');
1540
+ };
1541
+ }
1542
+ function KotlinEmitter$emit$lambda_6($this_emit) {
1543
+ return function () {
1544
+ return 'Regex(' + $this_emit.nj_1 + ').find(value)';
1545
+ };
1546
+ }
1547
+ function KotlinEmitter$emit$lambda$lambda_0(this$0, $this_emit) {
1548
+ return function (it) {
1549
+ Companion_getInstance_1();
1550
+ var tmp0_safe_receiver = it.uh_1;
1551
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1552
+ var tmp = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1553
+ var tmp_0 = emitRequestSignature_0($this_emit, this$0, it.uh_1);
1554
+ var tmp2_safe_receiver = it.uh_1;
1555
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.wh_1;
1556
+ var tmp4_elvis_lhs = tmp3_safe_receiver == null ? null : this$0.di(tmp3_safe_receiver);
1557
+ var tmp_1 = tmp4_elvis_lhs == null ? 'Unit' : tmp4_elvis_lhs;
1558
+ var tmp_2 = emitPath_0($this_emit.gi_1, this$0);
1559
+ var tmp_3 = emitMap_0($this_emit.hi_1, this$0);
1560
+ var tmp_4 = emitMap_0($this_emit.ii_1, this$0);
1561
+ var tmp5_safe_receiver = it.uh_1;
1562
+ var tmp_5;
1563
+ if (tmp5_safe_receiver == null) {
1564
+ tmp_5 = null;
1565
+ } else {
1566
+ var tmp$ret$1;
1567
+ // Inline function 'kotlin.let' call
1568
+ // Inline function 'kotlin.contracts.contract' call
1569
+ var tmp$ret$0;
1570
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1571
+ tmp$ret$0 = 'WirespecShared.Content("' + tmp5_safe_receiver.vh_1 + '", body)';
1572
+ tmp$ret$1 = tmp$ret$0;
1573
+ tmp_5 = tmp$ret$1;
1574
+ }
1575
+ var tmp6_elvis_lhs = tmp_5;
1576
+ return ' ' + 'class Request' + tmp + ' ' + tmp_0 + ': Request<' + tmp_1 + '> {override val path = "' + tmp_2 + '"; override val method = WirespecShared.Method.' + $this_emit.fi_1.p4_1 + '; override val query = mapOf<String, List<Any?>>(' + tmp_3 + '); override val headers = mapOf<String, List<Any?>>(' + tmp_4 + '); override val content = ' + (tmp6_elvis_lhs == null ? 'null' : tmp6_elvis_lhs) + '}';
1577
+ };
1578
+ }
1579
+ function KotlinEmitter$emit$lambda$lambda_1(it) {
1580
+ Companion_getInstance_1();
1581
+ return ' ' + 'sealed interface Response' + it + '<T>: Response<T>';
1582
+ }
1583
+ function KotlinEmitter$emit$lambda$lambda_2(it) {
1584
+ Companion_getInstance_1();
1585
+ return ' ' + 'sealed interface Response' + it + '<T>: Response' + groupStatus_0(it) + '<T>';
1586
+ }
1587
+ function KotlinEmitter$emit$lambda$lambda_3(this$0) {
1588
+ return function (it) {
1589
+ Companion_getInstance_1();
1590
+ var tmp0_safe_receiver = it.ni_1;
1591
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1592
+ var tmp = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1593
+ var tmp2_safe_receiver = it.ni_1;
1594
+ var tmp_0;
1595
+ if (tmp2_safe_receiver == null) {
1596
+ tmp_0 = null;
1597
+ } else {
1598
+ var tmp$ret$1;
1599
+ // Inline function 'kotlin.let' call
1600
+ // Inline function 'kotlin.contracts.contract' call
1601
+ var tmp$ret$0;
1602
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1603
+ tmp$ret$0 = ', body: ' + this$0.di(tmp2_safe_receiver.wh_1);
1604
+ tmp$ret$1 = tmp$ret$0;
1605
+ tmp_0 = tmp$ret$1;
1606
+ }
1607
+ var tmp3_elvis_lhs = tmp_0;
1608
+ var tmp_1 = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
1609
+ var tmp4_safe_receiver = it.ni_1;
1610
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
1611
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : this$0.di(tmp5_safe_receiver);
1612
+ var tmp_2 = tmp6_elvis_lhs == null ? 'Unit' : tmp6_elvis_lhs;
1613
+ var tmp7_safe_receiver = it.ni_1;
1614
+ var tmp_3;
1615
+ if (tmp7_safe_receiver == null) {
1616
+ tmp_3 = null;
1617
+ } else {
1618
+ var tmp$ret$3;
1619
+ // Inline function 'kotlin.let' call
1620
+ // Inline function 'kotlin.contracts.contract' call
1621
+ var tmp$ret$2;
1622
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1623
+ tmp$ret$2 = 'WirespecShared.Content("' + tmp7_safe_receiver.vh_1 + '", body)';
1624
+ tmp$ret$3 = tmp$ret$2;
1625
+ tmp_3 = tmp$ret$3;
1626
+ }
1627
+ var tmp8_elvis_lhs = tmp_3;
1628
+ return ' ' + 'class Response' + it.mi_1 + tmp + ' (override val headers: Map<String, List<Any?>>' + tmp_1 + ' ): Response' + it.mi_1 + '<' + tmp_2 + '> { override val status = ' + it.mi_1 + '; override val content = ' + (tmp8_elvis_lhs == null ? 'null' : tmp8_elvis_lhs) + '}';
1629
+ };
1630
+ }
1631
+ function KotlinEmitter$emit$lambda$lambda_4(this$0) {
1632
+ return function (it) {
1633
+ Companion_getInstance_1();
1634
+ var tmp = Companion_getInstance_1().pi(it.mi_1);
1635
+ var tmp0_safe_receiver = it.ni_1;
1636
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1637
+ var tmp_0 = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1638
+ var tmp2_safe_receiver = it.ni_1;
1639
+ var tmp_1;
1640
+ if (tmp2_safe_receiver == null) {
1641
+ tmp_1 = null;
1642
+ } else {
1643
+ var tmp$ret$1;
1644
+ // Inline function 'kotlin.let' call
1645
+ // Inline function 'kotlin.contracts.contract' call
1646
+ var tmp$ret$0;
1647
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1648
+ tmp$ret$0 = ', body: ' + this$0.di(tmp2_safe_receiver.wh_1);
1649
+ tmp$ret$1 = tmp$ret$0;
1650
+ tmp_1 = tmp$ret$1;
1651
+ }
1652
+ var tmp3_elvis_lhs = tmp_1;
1653
+ var tmp_2 = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
1654
+ var tmp_3 = Companion_getInstance_1().pi(it.mi_1);
1655
+ var tmp4_safe_receiver = it.ni_1;
1656
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
1657
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : this$0.di(tmp5_safe_receiver);
1658
+ var tmp_4 = tmp6_elvis_lhs == null ? 'Unit' : tmp6_elvis_lhs;
1659
+ var tmp7_safe_receiver = it.ni_1;
1660
+ var tmp_5;
1661
+ if (tmp7_safe_receiver == null) {
1662
+ tmp_5 = null;
1663
+ } else {
1664
+ var tmp$ret$3;
1665
+ // Inline function 'kotlin.let' call
1666
+ // Inline function 'kotlin.contracts.contract' call
1667
+ var tmp$ret$2;
1668
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1669
+ tmp$ret$2 = 'WirespecShared.Content("' + tmp7_safe_receiver.vh_1 + '", body)';
1670
+ tmp$ret$3 = tmp$ret$2;
1671
+ tmp_5 = tmp$ret$3;
1672
+ }
1673
+ var tmp8_elvis_lhs = tmp_5;
1674
+ return ' ' + 'class Response' + tmp + tmp_0 + ' (override val status: Int, override val headers: Map<String, List<Any?>>' + tmp_2 + ' ): Response' + tmp_3 + '<' + tmp_4 + '> { override val content = ' + (tmp8_elvis_lhs == null ? 'null' : tmp8_elvis_lhs) + '}';
1675
+ };
1676
+ }
1677
+ function KotlinEmitter$emit$lambda_7($this_emit, this$0) {
1678
+ return function () {
1679
+ Companion_getInstance_1();
1680
+ var tmp = joinToString($this_emit.ki_1, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_0(this$0, $this_emit));
1681
+ Companion_getInstance_1();
1682
+ var tmp$ret$2;
1683
+ // Inline function 'kotlin.collections.map' call
1684
+ var tmp1_map = $this_emit.li_1;
1685
+ var tmp$ret$1;
1686
+ // Inline function 'kotlin.collections.mapTo' call
1687
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1688
+ var tmp0_iterator = tmp1_map.c();
1689
+ while (tmp0_iterator.d()) {
1690
+ var item = tmp0_iterator.e();
1691
+ var tmp$ret$0;
1692
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1693
+ tmp$ret$0 = groupStatus_0(item.mi_1);
1694
+ tmp0_mapTo.a(tmp$ret$0);
1695
+ }
1696
+ tmp$ret$1 = tmp0_mapTo;
1697
+ tmp$ret$2 = tmp$ret$1;
1698
+ var tmp_0 = toSet(tmp$ret$2);
1699
+ var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_1);
1700
+ var tmp$ret$8;
1701
+ // Inline function 'kotlin.collections.map' call
1702
+ var tmp$ret$5;
1703
+ // Inline function 'kotlin.collections.filter' call
1704
+ var tmp3_filter = $this_emit.li_1;
1705
+ var tmp$ret$4;
1706
+ // Inline function 'kotlin.collections.filterTo' call
1707
+ var tmp2_filterTo = ArrayList_init_$Create$();
1708
+ var tmp0_iterator_0 = tmp3_filter.c();
1709
+ while (tmp0_iterator_0.d()) {
1710
+ var element = tmp0_iterator_0.e();
1711
+ var tmp$ret$3;
1712
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1713
+ tmp$ret$3 = isInt_0(element.mi_1);
1714
+ if (tmp$ret$3) {
1715
+ tmp2_filterTo.a(element);
1716
+ }
1717
+ }
1718
+ tmp$ret$4 = tmp2_filterTo;
1719
+ tmp$ret$5 = tmp$ret$4;
1720
+ var tmp5_map = tmp$ret$5;
1721
+ var tmp$ret$7;
1722
+ // Inline function 'kotlin.collections.mapTo' call
1723
+ var tmp4_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_map, 10));
1724
+ var tmp0_iterator_1 = tmp5_map.c();
1725
+ while (tmp0_iterator_1.d()) {
1726
+ var item_0 = tmp0_iterator_1.e();
1727
+ var tmp$ret$6;
1728
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1729
+ tmp$ret$6 = item_0.mi_1;
1730
+ tmp4_mapTo.a(tmp$ret$6);
1731
+ }
1732
+ tmp$ret$7 = tmp4_mapTo;
1733
+ tmp$ret$8 = tmp$ret$7;
1734
+ var tmp_2 = tmp$ret$8;
1735
+ var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_2);
1736
+ var tmp$ret$11;
1737
+ // Inline function 'kotlin.collections.filter' call
1738
+ var tmp7_filter = $this_emit.li_1;
1739
+ var tmp$ret$10;
1740
+ // Inline function 'kotlin.collections.filterTo' call
1741
+ var tmp6_filterTo = ArrayList_init_$Create$();
1742
+ var tmp0_iterator_2 = tmp7_filter.c();
1743
+ while (tmp0_iterator_2.d()) {
1744
+ var element_0 = tmp0_iterator_2.e();
1745
+ var tmp$ret$9;
1746
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1747
+ tmp$ret$9 = isInt_0(element_0.mi_1);
1748
+ if (tmp$ret$9) {
1749
+ tmp6_filterTo.a(element_0);
1750
+ }
1751
+ }
1752
+ tmp$ret$10 = tmp6_filterTo;
1753
+ tmp$ret$11 = tmp$ret$10;
1754
+ var tmp_4 = tmp$ret$11;
1755
+ var tmp_5 = joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_3(this$0));
1756
+ var tmp$ret$14;
1757
+ // Inline function 'kotlin.collections.filter' call
1758
+ var tmp9_filter = $this_emit.li_1;
1759
+ var tmp$ret$13;
1760
+ // Inline function 'kotlin.collections.filterTo' call
1761
+ var tmp8_filterTo = ArrayList_init_$Create$();
1762
+ var tmp0_iterator_3 = tmp9_filter.c();
1763
+ while (tmp0_iterator_3.d()) {
1764
+ var element_1 = tmp0_iterator_3.e();
1765
+ var tmp$ret$12;
1766
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1767
+ tmp$ret$12 = !isInt_0(element_1.mi_1);
1768
+ if (tmp$ret$12) {
1769
+ tmp8_filterTo.a(element_1);
1770
+ }
1771
+ }
1772
+ tmp$ret$13 = tmp8_filterTo;
1773
+ tmp$ret$14 = tmp$ret$13;
1774
+ var tmp_6 = tmp$ret$14;
1775
+ var tmp_7 = joinToString(tmp_6, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_4(this$0));
1776
+ var tmp_8 = Companion_getInstance_1().oj($this_emit.ei_1);
1777
+ Companion_getInstance_1();
1778
+ Companion_getInstance_1();
1779
+ Companion_getInstance_1();
1780
+ var tmp_9 = emitSegment_0($this_emit.gi_1, this$0);
1781
+ Companion_getInstance_1();
1782
+ Companion_getInstance_1();
1783
+ var tmp_10 = emitResponseMapper_0($this_emit.li_1, this$0);
1784
+ Companion_getInstance_1();
1785
+ Companion_getInstance_1();
1786
+ Companion_getInstance_1();
1787
+ return trimMargin('interface ' + $this_emit.ei_1 + ' {\n |' + ' ' + 'sealed interface Request<T>: WirespecShared.Request<T>\n |' + tmp + '\n |' + ' ' + 'sealed interface Response<T>: WirespecShared.Response<T>\n |' + tmp_1 + '\n |' + tmp_3 + '\n |' + tmp_5 + '\n |' + tmp_7 + '\n |suspend fun ' + tmp_8 + '(request: Request<*>): Response<*>\n |' + ' ' + 'companion object{\n |' + ' ' + ' ' + 'const val PATH = "' + tmp_9 + '"\n |' + ' ' + ' ' + tmp_10 + '\n |' + ' ' + ' ' + '}\n |' + ' ' + '}\n |}\n |');
1788
+ };
1789
+ }
1790
+ function KotlinEmitter$emitRequestSignature$lambda(this$0) {
1791
+ return function (it) {
1792
+ return this$0.xi(it);
1793
+ };
1794
+ }
1795
+ function KotlinEmitter$emitSegment$lambda(it) {
1796
+ var tmp0_subject = it;
1797
+ var tmp;
1798
+ if (tmp0_subject instanceof Param) {
1799
+ tmp = '{' + it.si_1.dj_1 + '}';
1800
+ } else {
1801
+ if (tmp0_subject instanceof Literal) {
1802
+ tmp = it.pj_1;
1803
+ } else {
1804
+ noWhenBranchMatchedException();
1805
+ }
1806
+ }
1807
+ return tmp;
1808
+ }
1809
+ function KotlinEmitter$emitMap$lambda(this$0) {
1810
+ return function (it) {
1811
+ return '"' + this$0.cj(it.zi_1) + '" to listOf(' + this$0.cj(it.zi_1) + ')';
1812
+ };
1813
+ }
1814
+ function KotlinEmitter$emit$lambda_8($this_emit) {
1815
+ return function () {
1816
+ var tmp0_subject = $this_emit;
1817
+ var tmp;
1818
+ if (tmp0_subject instanceof Literal) {
1819
+ tmp = $this_emit.pj_1;
1820
+ } else {
1821
+ if (tmp0_subject instanceof Param) {
1822
+ tmp = '${' + $this_emit.si_1.dj_1 + '}';
1823
+ } else {
1824
+ noWhenBranchMatchedException();
1825
+ }
1826
+ }
1827
+ return tmp;
1828
+ };
1829
+ }
1830
+ function KotlinEmitter$emitPath$lambda(this$0) {
1831
+ return function (it) {
1832
+ return emit_2(it, this$0);
1833
+ };
1834
+ }
1835
+ function KotlinEmitter$emitResponseMapper$lambda(this$0) {
1836
+ return function (it) {
1837
+ return emitResponseMapperCondition_0(it, this$0);
1838
+ };
1839
+ }
1840
+ function KotlinEmitter$emitResponseMapper$lambda_0(this$0) {
1841
+ return function (it) {
1842
+ return emitResponseMapperCondition_0(it, this$0);
1843
+ };
1844
+ }
1845
+ function KotlinEmitter(packageName, logger) {
1846
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
1847
+ logger = logger === VOID ? get_noLogger() : logger;
1848
+ Emitter.call(this, logger);
1849
+ this.ek_1 = packageName;
1850
+ var tmp = this;
1851
+ Companion_getInstance_1();
1852
+ Companion_getInstance_1();
1853
+ Companion_getInstance_1();
1854
+ Companion_getInstance_1();
1855
+ Companion_getInstance_1();
1856
+ tmp.fk_1 = trimMargin('\n |import kotlin.reflect.KType\n |import kotlin.reflect.typeOf\n |object WirespecShared {\n |' + ' ' + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + ' ' + 'data class Content<T> (val type:String, val body:T )\n |' + ' ' + 'interface Request<T> { val path:String; val method: Method; val query: Map<String, List<Any?>>; val headers: Map<String, List<Any?>>; val content:Content<T>? }\n |' + ' ' + 'interface Response<T> { val status:Int; val headers: Map<String, List<Any?>>; val content:Content<T>? }\n |' + ' ' + 'interface ContentMapper<B> { fun <T> read(content: Content<B>, valueType: KType): Content<T> fun <T> write(content: Content<T>): Content<B> }\n |}\n ');
1857
+ }
1858
+ protoOf(KotlinEmitter).qh = function (ast) {
1859
+ var tmp$ret$3;
1860
+ // Inline function 'kotlin.collections.map' call
1861
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
1862
+ var tmp$ret$2;
1863
+ // Inline function 'kotlin.collections.mapTo' call
1864
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1865
+ var tmp0_iterator = tmp1_map.c();
1866
+ while (tmp0_iterator.d()) {
1867
+ var item = tmp0_iterator.e();
1868
+ var tmp$ret$1;
1869
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>' call
1870
+ var name = item.i3();
1871
+ var result = item.j3();
1872
+ var tmp$ret$0;
1873
+ // Inline function 'kotlin.text.trimStart' call
1874
+ var tmp0_trimStart = trimMargin('\n |' + (isBlank(this.ek_1) ? '' : 'package ' + this.ek_1) + '\n |' + (hasEndpoints(ast, this) ? this.fk_1 : '') + '\n |' + result + '\n ');
1875
+ tmp$ret$0 = toString(trimStart(isCharSequence(tmp0_trimStart) ? tmp0_trimStart : THROW_CCE()));
1876
+ tmp$ret$1 = to(name, tmp$ret$0);
1877
+ tmp0_mapTo.a(tmp$ret$1);
1878
+ }
1879
+ tmp$ret$2 = tmp0_mapTo;
1880
+ tmp$ret$3 = tmp$ret$2;
1881
+ return tmp$ret$3;
1882
+ };
1883
+ protoOf(KotlinEmitter).qj = function (_this__u8e3s4) {
1884
+ return this.rj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda(_this__u8e3s4, this));
1885
+ };
1886
+ protoOf(KotlinEmitter).wi = function (_this__u8e3s4) {
1887
+ return this.sj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_0(_this__u8e3s4, this));
1888
+ };
1889
+ protoOf(KotlinEmitter).xi = function (_this__u8e3s4) {
1890
+ return this.tj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_1(this, _this__u8e3s4));
1891
+ };
1892
+ protoOf(KotlinEmitter).cj = function (_this__u8e3s4) {
1893
+ return this.uj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_2(_this__u8e3s4));
1894
+ };
1895
+ protoOf(KotlinEmitter).di = function (_this__u8e3s4) {
1896
+ return this.th(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_3(_this__u8e3s4));
1897
+ };
1898
+ protoOf(KotlinEmitter).vj = function (_this__u8e3s4) {
1899
+ return this.wj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_4(_this__u8e3s4));
1900
+ };
1901
+ protoOf(KotlinEmitter).xj = function (_this__u8e3s4) {
1902
+ return this.yj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_5(_this__u8e3s4, this));
1903
+ };
1904
+ protoOf(KotlinEmitter).mj = function (_this__u8e3s4) {
1905
+ return this.zj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_6(_this__u8e3s4));
1906
+ };
1907
+ protoOf(KotlinEmitter).ak = function (_this__u8e3s4) {
1908
+ return this.bk(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_7(_this__u8e3s4, this));
1909
+ };
1910
+ function emitContentType_0(_this__u8e3s4) {
1911
+ var tmp = split(_this__u8e3s4.vh_1, ['/']);
1912
+ return joinToString(tmp, '', VOID, VOID, VOID, VOID, emitContentType$lambda);
1913
+ }
1914
+ function groupStatus_0(_this__u8e3s4) {
1915
+ var tmp;
1916
+ if (isInt_0(_this__u8e3s4)) {
1917
+ var tmp$ret$1;
1918
+ // Inline function 'kotlin.text.substring' call
1919
+ var tmp$ret$0;
1920
+ // Inline function 'kotlin.js.asDynamic' call
1921
+ tmp$ret$0 = _this__u8e3s4;
1922
+ tmp$ret$1 = tmp$ret$0.substring(0, 1);
1923
+ tmp = tmp$ret$1 + 'XX';
1924
+ } else {
1925
+ tmp = Companion_getInstance_1().pi(_this__u8e3s4);
1926
+ }
1927
+ return tmp;
1928
+ }
1929
+ function isInt_0(_this__u8e3s4) {
1930
+ return !(toIntOrNull(_this__u8e3s4) == null);
1931
+ }
1932
+ function toField(_this__u8e3s4, identifier, isNullable) {
1933
+ return new Field(new Identifier(identifier), _this__u8e3s4, isNullable);
1934
+ }
1935
+ function orEmptyString_0(_this__u8e3s4) {
1936
+ var tmp0_elvis_lhs = _this__u8e3s4;
1937
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
1938
+ }
1939
+ function emitContentType$lambda(it) {
1940
+ return Companion_getInstance_1().pi(it);
1941
+ }
1942
+ function Companion() {
1943
+ Companion_instance = this;
1944
+ this.gk_1 = listOf(['abstract', 'case', 'catch', 'class', 'def', 'do', 'else', 'extends', 'false', 'final', 'finally', 'for', 'forSome', 'if', 'implicit', 'import', 'lazy', 'match', 'new', 'null', 'object', 'override', 'package', 'private', 'protected', 'return', 'sealed', 'super', 'this', 'throw', 'trait', 'true', 'try', 'type', 'val', 'var', 'while', 'with', 'yield']);
1945
+ }
1946
+ var Companion_instance;
1947
+ function Companion_getInstance_0() {
1948
+ if (Companion_instance == null)
1949
+ new Companion();
1950
+ return Companion_instance;
1951
+ }
1952
+ function ScalaEmitter$emit$lambda($this_emit, this$0) {
1953
+ return function () {
1954
+ return trimMargin('case class ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |)\n |\n |');
1955
+ };
1956
+ }
1957
+ function ScalaEmitter$emit$lambda$lambda(this$0) {
1958
+ return function (it) {
1959
+ return this$0.xi(it);
1960
+ };
1961
+ }
1962
+ function ScalaEmitter$emit$lambda_0($this_emit, this$0) {
1963
+ return function () {
1964
+ return dropLast(joinToString($this_emit.yi_1, '\n', VOID, VOID, VOID, VOID, ScalaEmitter$emit$lambda$lambda(this$0)), 1);
1965
+ };
1966
+ }
1967
+ function ScalaEmitter$emit$lambda_1(this$0, $this_emit) {
1968
+ return function () {
1969
+ Companion_getInstance_1();
1970
+ return ' ' + 'val ' + this$0.cj($this_emit.zi_1) + ': ' + ($this_emit.bj_1 ? 'Option[' + this$0.di($this_emit.aj_1) + ']' : this$0.di($this_emit.aj_1)) + ',';
1971
+ };
1972
+ }
1973
+ function ScalaEmitter$emit$lambda_2($this_emit) {
1974
+ return function () {
1975
+ return Companion_getInstance_0().gk_1.i1($this_emit.dj_1) ? '`' + $this_emit.dj_1 + '`' : $this_emit.dj_1;
1976
+ };
1977
+ }
1978
+ function ScalaEmitter$emit$lambda_3($this_emit) {
1979
+ return function () {
1980
+ var tmp$ret$1;
1981
+ // Inline function 'kotlin.let' call
1982
+ var tmp0_subject = $this_emit;
1983
+ var tmp;
1984
+ if (tmp0_subject instanceof Custom) {
1985
+ tmp = $this_emit.gj_1;
1986
+ } else {
1987
+ if (tmp0_subject instanceof Primitive) {
1988
+ var tmp1_subject = $this_emit.ej_1;
1989
+ var tmp0 = tmp1_subject.q4_1;
1990
+ var tmp_0;
1991
+ switch (tmp0) {
1992
+ case 0:
1993
+ tmp_0 = 'String';
1994
+ break;
1995
+ case 1:
1996
+ tmp_0 = 'Int';
1997
+ break;
1998
+ case 2:
1999
+ tmp_0 = 'Boolean';
2000
+ break;
2001
+ default:
2002
+ noWhenBranchMatchedException();
2003
+ break;
2004
+ }
2005
+ tmp = tmp_0;
2006
+ } else {
2007
+ noWhenBranchMatchedException();
2008
+ }
2009
+ }
2010
+ var tmp0_let = tmp;
2011
+ // Inline function 'kotlin.contracts.contract' call
2012
+ var tmp$ret$0;
2013
+ // Inline function 'community.flock.wirespec.compiler.core.emit.ScalaEmitter.emit.<anonymous>.<anonymous>' call
2014
+ tmp$ret$0 = $this_emit.qi() ? 'List[' + tmp0_let + ']' : tmp0_let;
2015
+ tmp$ret$1 = tmp$ret$0;
2016
+ return tmp$ret$1;
2017
+ };
2018
+ }
2019
+ function ScalaEmitter$emit$lambda$lambda_0($this_emit) {
2020
+ return function (it) {
2021
+ Companion_getInstance_1();
2022
+ return ' ' + 'final case object ' + it + ' extends ' + $this_emit.ij_1 + '(label = "' + it + '")';
2023
+ };
2024
+ }
2025
+ function ScalaEmitter$emit$lambda_4($this_emit) {
2026
+ return function () {
2027
+ return trimMargin('\n |sealed abstract class ' + $this_emit.ij_1 + '(val label: String)\n |object ' + $this_emit.ij_1 + ' {\n |' + joinToString($this_emit.jj_1, '\n', VOID, VOID, VOID, VOID, ScalaEmitter$emit$lambda$lambda_0($this_emit)) + '\n |}\n |');
2028
+ };
2029
+ }
2030
+ function ScalaEmitter$emit$lambda_5($this_emit, this$0) {
2031
+ return function () {
2032
+ Companion_getInstance_1();
2033
+ var tmp = this$0.mj($this_emit.lj_1);
2034
+ Companion_getInstance_1();
2035
+ return trimMargin('case class ' + $this_emit.kj_1 + '(val value: String) {\n |' + ' ' + 'implicit class ' + $this_emit.kj_1 + 'Ops(val that: ' + $this_emit.kj_1 + ') {\n |' + tmp + '\n |' + ' ' + '}\n |}\n |\n |');
2036
+ };
2037
+ }
2038
+ function ScalaEmitter$emit$lambda_6($this_emit) {
2039
+ return function () {
2040
+ Companion_getInstance_1();
2041
+ Companion_getInstance_1();
2042
+ Companion_getInstance_1();
2043
+ Companion_getInstance_1();
2044
+ return trimMargin(' ' + ' ' + 'val regex = new scala.util.matching.Regex(' + $this_emit.nj_1 + ')\n |' + ' ' + ' ' + 'regex.findFirstIn(that.value)');
2045
+ };
2046
+ }
2047
+ function ScalaEmitter$emit$lambda_7() {
2048
+ return '// TODO("Not yet implemented")\n';
2049
+ }
2050
+ function ScalaEmitter(packageName, logger) {
2051
+ Companion_getInstance_0();
2052
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
2053
+ logger = logger === VOID ? get_noLogger() : logger;
2054
+ Emitter.call(this, logger);
2055
+ this.jk_1 = packageName;
2056
+ }
2057
+ protoOf(ScalaEmitter).qh = function (ast) {
2058
+ var tmp$ret$2;
2059
+ // Inline function 'kotlin.collections.map' call
2060
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
2061
+ var tmp$ret$1;
2062
+ // Inline function 'kotlin.collections.mapTo' call
2063
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
2064
+ var tmp0_iterator = tmp1_map.c();
2065
+ while (tmp0_iterator.d()) {
2066
+ var item = tmp0_iterator.e();
2067
+ var tmp$ret$0;
2068
+ // Inline function 'community.flock.wirespec.compiler.core.emit.ScalaEmitter.emit.<anonymous>' call
2069
+ var name = item.i3();
2070
+ var result = item.j3();
2071
+ tmp$ret$0 = to(name, isBlank(this.jk_1) ? '' : 'package ' + this.jk_1 + '\n\n' + result);
2072
+ tmp0_mapTo.a(tmp$ret$0);
2073
+ }
2074
+ tmp$ret$1 = tmp0_mapTo;
2075
+ tmp$ret$2 = tmp$ret$1;
2076
+ return tmp$ret$2;
2077
+ };
2078
+ protoOf(ScalaEmitter).qj = function (_this__u8e3s4) {
2079
+ return this.rj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda(_this__u8e3s4, this));
2080
+ };
2081
+ protoOf(ScalaEmitter).wi = function (_this__u8e3s4) {
2082
+ return this.sj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_0(_this__u8e3s4, this));
2083
+ };
2084
+ protoOf(ScalaEmitter).xi = function (_this__u8e3s4) {
2085
+ return this.tj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_1(this, _this__u8e3s4));
2086
+ };
2087
+ protoOf(ScalaEmitter).cj = function (_this__u8e3s4) {
2088
+ return this.uj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_2(_this__u8e3s4));
2089
+ };
2090
+ protoOf(ScalaEmitter).di = function (_this__u8e3s4) {
2091
+ return this.th(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_3(_this__u8e3s4));
2092
+ };
2093
+ protoOf(ScalaEmitter).vj = function (_this__u8e3s4) {
2094
+ return this.wj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_4(_this__u8e3s4));
2095
+ };
2096
+ protoOf(ScalaEmitter).xj = function (_this__u8e3s4) {
2097
+ return this.yj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_5(_this__u8e3s4, this));
2098
+ };
2099
+ protoOf(ScalaEmitter).mj = function (_this__u8e3s4) {
2100
+ return this.zj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_6(_this__u8e3s4));
2101
+ };
2102
+ protoOf(ScalaEmitter).ak = function (_this__u8e3s4) {
2103
+ return this.bk(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_7);
2104
+ };
2105
+ function TypeScriptEmitter$emit$lambda($this_emit, this$0) {
2106
+ return function () {
2107
+ return trimMargin('interface ' + $this_emit.ui_1 + ' {\n |' + this$0.wi($this_emit.vi_1) + '\n |}\n |\n |');
2108
+ };
2109
+ }
2110
+ function TypeScriptEmitter$emit$lambda$lambda(this$0) {
2111
+ return function (it) {
2112
+ return this$0.xi(it);
2113
+ };
2114
+ }
2115
+ function TypeScriptEmitter$emit$lambda_0($this_emit, this$0) {
2116
+ return function () {
2117
+ return dropLast(joinToString($this_emit.yi_1, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda(this$0)), 1);
2118
+ };
2119
+ }
2120
+ function TypeScriptEmitter$emit$lambda_1(this$0, $this_emit) {
2121
+ return function () {
2122
+ Companion_getInstance_1();
2123
+ return ' ' + this$0.cj($this_emit.zi_1) + ($this_emit.bj_1 ? '?' : '') + ': ' + this$0.di($this_emit.aj_1) + ',';
2124
+ };
2125
+ }
2126
+ function TypeScriptEmitter$emit$lambda_2($this_emit) {
2127
+ return function () {
2128
+ return $this_emit.dj_1;
2129
+ };
2130
+ }
2131
+ function TypeScriptEmitter$emit$lambda_3($this_emit) {
2132
+ return function () {
2133
+ var tmp$ret$1;
2134
+ // Inline function 'kotlin.let' call
2135
+ var tmp0_subject = $this_emit;
2136
+ var tmp;
2137
+ if (tmp0_subject instanceof Custom) {
2138
+ tmp = $this_emit.gj_1;
2139
+ } else {
2140
+ if (tmp0_subject instanceof Primitive) {
2141
+ var tmp1_subject = $this_emit.ej_1;
2142
+ var tmp0 = tmp1_subject.q4_1;
2143
+ var tmp_0;
2144
+ switch (tmp0) {
2145
+ case 0:
2146
+ tmp_0 = 'string';
2147
+ break;
2148
+ case 1:
2149
+ tmp_0 = 'number';
2150
+ break;
2151
+ case 2:
2152
+ tmp_0 = 'boolean';
2153
+ break;
2154
+ default:
2155
+ noWhenBranchMatchedException();
2156
+ break;
2157
+ }
2158
+ tmp = tmp_0;
2159
+ } else {
2160
+ noWhenBranchMatchedException();
2161
+ }
2162
+ }
2163
+ var tmp0_let = tmp;
2164
+ // Inline function 'kotlin.contracts.contract' call
2165
+ var tmp$ret$0;
2166
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>' call
2167
+ tmp$ret$0 = $this_emit.qi() ? tmp0_let + '[]' : tmp0_let;
2168
+ tmp$ret$1 = tmp$ret$0;
2169
+ return tmp$ret$1;
2170
+ };
2171
+ }
2172
+ function TypeScriptEmitter$emit$lambda$lambda_0(it) {
2173
+ return '"' + it + '"';
2174
+ }
2175
+ function TypeScriptEmitter$emit$lambda_4($this_emit) {
2176
+ return function () {
2177
+ return 'type ' + $this_emit.ij_1 + ' = ' + joinToString($this_emit.jj_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_0) + '\n';
2178
+ };
2179
+ }
2180
+ function TypeScriptEmitter$emit$lambda_5($this_emit, this$0) {
2181
+ return function () {
2182
+ Companion_getInstance_1();
2183
+ return trimMargin('interface ' + $this_emit.kj_1 + ' {\n |' + ' ' + 'value: string\n |}\n |const validate' + $this_emit.kj_1 + ' = (type: ' + $this_emit.kj_1 + ') => (' + this$0.mj($this_emit.lj_1) + ').test(type.value);\n |\n |');
2184
+ };
2185
+ }
2186
+ function TypeScriptEmitter$emit$lambda_6($this_emit) {
2187
+ return function () {
2188
+ return "new RegExp('" + dropLast(drop($this_emit.nj_1, 1), 1) + "')";
2189
+ };
2190
+ }
2191
+ function TypeScriptEmitter$emit$lambda_7() {
2192
+ return '// TODO("Not yet implemented")\n';
2193
+ }
2194
+ function TypeScriptEmitter(logger) {
2195
+ logger = logger === VOID ? get_noLogger() : logger;
2196
+ Emitter.call(this, logger);
2197
+ }
2198
+ protoOf(TypeScriptEmitter).qj = function (_this__u8e3s4) {
2199
+ return this.rj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda(_this__u8e3s4, this));
2200
+ };
2201
+ protoOf(TypeScriptEmitter).wi = function (_this__u8e3s4) {
2202
+ return this.sj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_0(_this__u8e3s4, this));
2203
+ };
2204
+ protoOf(TypeScriptEmitter).xi = function (_this__u8e3s4) {
2205
+ return this.tj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_1(this, _this__u8e3s4));
2206
+ };
2207
+ protoOf(TypeScriptEmitter).cj = function (_this__u8e3s4) {
2208
+ return this.uj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_2(_this__u8e3s4));
2209
+ };
2210
+ protoOf(TypeScriptEmitter).di = function (_this__u8e3s4) {
2211
+ return this.th(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_3(_this__u8e3s4));
2212
+ };
2213
+ protoOf(TypeScriptEmitter).vj = function (_this__u8e3s4) {
2214
+ return this.wj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_4(_this__u8e3s4));
2215
+ };
2216
+ protoOf(TypeScriptEmitter).xj = function (_this__u8e3s4) {
2217
+ return this.yj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_5(_this__u8e3s4, this));
2218
+ };
2219
+ protoOf(TypeScriptEmitter).mj = function (_this__u8e3s4) {
2220
+ return this.zj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_6(_this__u8e3s4));
2221
+ };
2222
+ protoOf(TypeScriptEmitter).ak = function (_this__u8e3s4) {
2223
+ return this.bk(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_7);
2224
+ };
2225
+ function WirespecEmitter$emit$lambda($this_emit, this$0) {
2226
+ return function () {
2227
+ return trimMargin('type ' + $this_emit.ui_1 + ' {\n |' + this$0.wi($this_emit.vi_1) + '\n |}\n |');
2228
+ };
2229
+ }
2230
+ function WirespecEmitter$emit$lambda$lambda(this$0) {
2231
+ return function (it) {
2232
+ return this$0.xi(it);
2233
+ };
2234
+ }
2235
+ function WirespecEmitter$emit$lambda_0($this_emit, this$0) {
2236
+ return function () {
2237
+ return dropLast(joinToString($this_emit.yi_1, '\n', VOID, VOID, VOID, VOID, WirespecEmitter$emit$lambda$lambda(this$0)), 1);
2238
+ };
2239
+ }
2240
+ function WirespecEmitter$emit$lambda_1(this$0, $this_emit) {
2241
+ return function () {
2242
+ Companion_getInstance_1();
2243
+ return ' ' + this$0.cj($this_emit.zi_1) + ($this_emit.bj_1 ? '?' : '') + ': ' + this$0.di($this_emit.aj_1) + ',';
2244
+ };
2245
+ }
2246
+ function WirespecEmitter$emit$lambda_2($this_emit) {
2247
+ return function () {
2248
+ return $this_emit.dj_1;
2249
+ };
2250
+ }
2251
+ function WirespecEmitter$emit$lambda_3($this_emit) {
2252
+ return function () {
2253
+ var tmp$ret$1;
2254
+ // Inline function 'kotlin.let' call
2255
+ var tmp0_subject = $this_emit;
2256
+ var tmp;
2257
+ if (tmp0_subject instanceof Custom) {
2258
+ tmp = $this_emit.gj_1;
2259
+ } else {
2260
+ if (tmp0_subject instanceof Primitive) {
2261
+ var tmp1_subject = $this_emit.ej_1;
2262
+ var tmp0 = tmp1_subject.q4_1;
2263
+ var tmp_0;
2264
+ switch (tmp0) {
2265
+ case 0:
2266
+ tmp_0 = 'String';
2267
+ break;
2268
+ case 1:
2269
+ tmp_0 = 'Integer';
2270
+ break;
2271
+ case 2:
2272
+ tmp_0 = 'Boolean';
2273
+ break;
2274
+ default:
2275
+ noWhenBranchMatchedException();
2276
+ break;
2277
+ }
2278
+ tmp = tmp_0;
2279
+ } else {
2280
+ noWhenBranchMatchedException();
2281
+ }
2282
+ }
2283
+ var tmp0_let = tmp;
2284
+ // Inline function 'kotlin.contracts.contract' call
2285
+ var tmp$ret$0;
2286
+ // Inline function 'community.flock.wirespec.compiler.core.emit.WirespecEmitter.emit.<anonymous>.<anonymous>' call
2287
+ tmp$ret$0 = $this_emit.qi() ? tmp0_let + '[]' : tmp0_let;
2288
+ tmp$ret$1 = tmp$ret$0;
2289
+ return tmp$ret$1;
2290
+ };
2291
+ }
2292
+ function WirespecEmitter$emit$lambda_4($this_emit) {
2293
+ return function () {
2294
+ Companion_getInstance_1();
2295
+ return 'enum ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + '\n}\n';
2296
+ };
2297
+ }
2298
+ function WirespecEmitter$emit$lambda_5($this_emit, this$0) {
2299
+ return function () {
2300
+ return 'refined ' + $this_emit.kj_1 + ' ' + this$0.mj($this_emit.lj_1) + '\n';
2301
+ };
2302
+ }
2303
+ function WirespecEmitter$emit$lambda_6($this_emit) {
2304
+ return function () {
2305
+ return '/' + dropLast(drop($this_emit.nj_1, 1), 1) + '/g';
2306
+ };
2307
+ }
2308
+ function WirespecEmitter$emit$lambda_7() {
2309
+ return '// TODO("Not yet implemented")\n';
2310
+ }
2311
+ function WirespecEmitter(logger) {
2312
+ logger = logger === VOID ? get_noLogger() : logger;
2313
+ Emitter.call(this, logger);
2314
+ }
2315
+ protoOf(WirespecEmitter).qj = function (_this__u8e3s4) {
2316
+ return this.rj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda(_this__u8e3s4, this));
2317
+ };
2318
+ protoOf(WirespecEmitter).wi = function (_this__u8e3s4) {
2319
+ return this.sj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_0(_this__u8e3s4, this));
2320
+ };
2321
+ protoOf(WirespecEmitter).xi = function (_this__u8e3s4) {
2322
+ return this.tj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_1(this, _this__u8e3s4));
2323
+ };
2324
+ protoOf(WirespecEmitter).cj = function (_this__u8e3s4) {
2325
+ return this.uj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_2(_this__u8e3s4));
2326
+ };
2327
+ protoOf(WirespecEmitter).di = function (_this__u8e3s4) {
2328
+ return this.th(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_3(_this__u8e3s4));
2329
+ };
2330
+ protoOf(WirespecEmitter).vj = function (_this__u8e3s4) {
2331
+ return this.wj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_4(_this__u8e3s4));
2332
+ };
2333
+ protoOf(WirespecEmitter).xj = function (_this__u8e3s4) {
2334
+ return this.yj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_5(_this__u8e3s4, this));
2335
+ };
2336
+ protoOf(WirespecEmitter).mj = function (_this__u8e3s4) {
2337
+ return this.zj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_6(_this__u8e3s4));
2338
+ };
2339
+ protoOf(WirespecEmitter).ak = function (_this__u8e3s4) {
2340
+ return this.bk(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_7);
2341
+ };
2342
+ function get_DEFAULT_PACKAGE_NAME() {
2343
+ return DEFAULT_PACKAGE_NAME;
2344
+ }
2345
+ var DEFAULT_PACKAGE_NAME;
2346
+ function Companion_0() {
2347
+ Companion_instance_0 = this;
2348
+ this.oi_1 = ' ';
2349
+ }
2350
+ protoOf(Companion_0).pi = function (_this__u8e3s4) {
2351
+ var tmp$ret$6;
2352
+ // Inline function 'kotlin.text.replaceFirstChar' call
2353
+ var tmp;
2354
+ var tmp$ret$0;
2355
+ // Inline function 'kotlin.text.isNotEmpty' call
2356
+ tmp$ret$0 = charSequenceLength(_this__u8e3s4) > 0;
2357
+ if (tmp$ret$0) {
2358
+ var tmp$ret$3;
2359
+ // Inline function 'kotlin.text.uppercase' call
2360
+ var tmp2_uppercase = charSequenceGet(_this__u8e3s4, 0);
2361
+ var tmp$ret$2;
2362
+ // Inline function 'kotlin.js.unsafeCast' call
2363
+ var tmp$ret$1;
2364
+ // Inline function 'kotlin.js.asDynamic' call
2365
+ var tmp0_asDynamic = toString_0(tmp2_uppercase);
2366
+ tmp$ret$1 = tmp0_asDynamic;
2367
+ var tmp1_unsafeCast = tmp$ret$1.toUpperCase();
2368
+ tmp$ret$2 = tmp1_unsafeCast;
2369
+ tmp$ret$3 = tmp$ret$2;
2370
+ var tmp_0 = toString(tmp$ret$3);
2371
+ var tmp$ret$5;
2372
+ // Inline function 'kotlin.text.substring' call
2373
+ var tmp$ret$4;
2374
+ // Inline function 'kotlin.js.asDynamic' call
2375
+ tmp$ret$4 = _this__u8e3s4;
2376
+ tmp$ret$5 = tmp$ret$4.substring(1);
2377
+ tmp = tmp_0 + tmp$ret$5;
2378
+ } else {
2379
+ tmp = _this__u8e3s4;
2380
+ }
2381
+ tmp$ret$6 = tmp;
2382
+ return tmp$ret$6;
2383
+ };
2384
+ protoOf(Companion_0).oj = function (_this__u8e3s4) {
2385
+ var tmp$ret$6;
2386
+ // Inline function 'kotlin.text.replaceFirstChar' call
2387
+ var tmp;
2388
+ var tmp$ret$0;
2389
+ // Inline function 'kotlin.text.isNotEmpty' call
2390
+ tmp$ret$0 = charSequenceLength(_this__u8e3s4) > 0;
2391
+ if (tmp$ret$0) {
2392
+ var tmp$ret$3;
2393
+ // Inline function 'kotlin.text.lowercase' call
2394
+ var tmp2_lowercase = charSequenceGet(_this__u8e3s4, 0);
2395
+ var tmp$ret$2;
2396
+ // Inline function 'kotlin.js.unsafeCast' call
2397
+ var tmp$ret$1;
2398
+ // Inline function 'kotlin.js.asDynamic' call
2399
+ var tmp0_asDynamic = toString_0(tmp2_lowercase);
2400
+ tmp$ret$1 = tmp0_asDynamic;
2401
+ var tmp1_unsafeCast = tmp$ret$1.toLowerCase();
2402
+ tmp$ret$2 = tmp1_unsafeCast;
2403
+ tmp$ret$3 = tmp$ret$2;
2404
+ var tmp_0 = toString(tmp$ret$3);
2405
+ var tmp$ret$5;
2406
+ // Inline function 'kotlin.text.substring' call
2407
+ var tmp$ret$4;
2408
+ // Inline function 'kotlin.js.asDynamic' call
2409
+ tmp$ret$4 = _this__u8e3s4;
2410
+ tmp$ret$5 = tmp$ret$4.substring(1);
2411
+ tmp = tmp_0 + tmp$ret$5;
2412
+ } else {
2413
+ tmp = _this__u8e3s4;
2414
+ }
2415
+ tmp$ret$6 = tmp;
2416
+ return tmp$ret$6;
2417
+ };
2418
+ var Companion_instance_0;
2419
+ function Companion_getInstance_1() {
2420
+ if (Companion_instance_0 == null)
2421
+ new Companion_0();
2422
+ return Companion_instance_0;
2423
+ }
2424
+ function Emitter$emit$lambda(it) {
2425
+ return it.h3_1;
2426
+ }
2427
+ function Emitter(logger, split) {
2428
+ Companion_getInstance_1();
2429
+ split = split === VOID ? false : split;
2430
+ this.oh_1 = logger;
2431
+ this.ph_1 = split;
2432
+ }
2433
+ protoOf(Emitter).qh = function (ast) {
2434
+ var tmp$ret$4;
2435
+ // Inline function 'kotlin.run' call
2436
+ var tmp$ret$2;
2437
+ // Inline function 'kotlin.collections.map' call
2438
+ var tmp$ret$1;
2439
+ // Inline function 'kotlin.collections.mapTo' call
2440
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(ast, 10));
2441
+ var tmp0_iterator = ast.c();
2442
+ while (tmp0_iterator.d()) {
2443
+ var item = tmp0_iterator.e();
2444
+ var tmp$ret$0;
2445
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Emitter.emit.<anonymous>' call
2446
+ this.oh_1.ih('Emitting Node ' + this);
2447
+ var tmp0_subject = item;
2448
+ var tmp;
2449
+ if (tmp0_subject instanceof Type_0) {
2450
+ tmp = to(item.ui_1, this.qj(item));
2451
+ } else {
2452
+ if (tmp0_subject instanceof Endpoint) {
2453
+ tmp = to(item.ei_1, this.ak(item));
2454
+ } else {
2455
+ if (tmp0_subject instanceof Enum_0) {
2456
+ tmp = to(item.ij_1, this.vj(item));
2457
+ } else {
2458
+ if (tmp0_subject instanceof Refined) {
2459
+ tmp = to(item.kj_1, this.xj(item));
2460
+ } else {
2461
+ noWhenBranchMatchedException();
2462
+ }
2463
+ }
2464
+ }
2465
+ }
2466
+ tmp$ret$0 = tmp;
2467
+ tmp0_mapTo.a(tmp$ret$0);
2468
+ }
2469
+ tmp$ret$1 = tmp0_mapTo;
2470
+ tmp$ret$2 = tmp$ret$1;
2471
+ var tmp1_run = tmp$ret$2;
2472
+ // Inline function 'kotlin.contracts.contract' call
2473
+ var tmp$ret$3;
2474
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Emitter.emit.<anonymous>' call
2475
+ var tmp_0;
2476
+ if (this.ph_1) {
2477
+ tmp_0 = tmp1_run;
2478
+ } else {
2479
+ tmp_0 = listOf_0(to('NoName', joinToString(tmp1_run, '\n', VOID, VOID, VOID, VOID, Emitter$emit$lambda)));
2480
+ }
2481
+ tmp$ret$3 = tmp_0;
2482
+ tmp$ret$4 = tmp$ret$3;
2483
+ return tmp$ret$4;
2484
+ };
2485
+ function EndpointDefinitionEmitterLogger() {
2486
+ }
2487
+ function EnumDefinitionEmitterLogger() {
2488
+ }
2489
+ function RefinedTypeDefinitionEmitterLogger() {
2490
+ }
2491
+ function TypeDefinitionEmitterLogger() {
2492
+ }
2493
+ function StartingException() {
2494
+ NullTokenException.call(this, 'Starting Token', new Coordinates());
2495
+ captureStack(this, StartingException);
2496
+ }
2497
+ function NextException(coordinates) {
2498
+ NullTokenException.call(this, 'Next Token', coordinates);
2499
+ captureStack(this, NextException);
2500
+ }
2501
+ function WrongTokenException(expected, actual) {
2502
+ ParserException.call(this, actual.rk_1, '' + expected.fc() + ' expected, not: ' + getKClassFromExpression(actual.pk_1).fc() + ' at line ' + actual.rk_1.sk_1 + ' and position ' + (actual.rk_1.tk_1 - actual.qk_1.length | 0));
2503
+ captureStack(this, WrongTokenException);
2504
+ }
2505
+ function NullTokenException(message, coordinates) {
2506
+ ParserException.call(this, coordinates, message + ' cannot be null');
2507
+ captureStack(this, NullTokenException);
2508
+ }
2509
+ function ParserException(coordinates, message) {
2510
+ CompilerException.call(this, message, coordinates);
2511
+ captureStack(this, ParserException);
2512
+ }
2513
+ function CompilerException(message, coordinates) {
2514
+ WirespecException.call(this, message, coordinates);
2515
+ captureStack(this, CompilerException);
2516
+ }
2517
+ function WirespecException(message, coordinates) {
2518
+ RuntimeException_init_$Init$(message, this);
2519
+ captureStack(this, WirespecException);
2520
+ this.vk_1 = coordinates;
2521
+ }
2522
+ function optimize(_this__u8e3s4) {
2523
+ var tmp$ret$2;
2524
+ // Inline function 'kotlin.collections.map' call
2525
+ var tmp$ret$1;
2526
+ // Inline function 'kotlin.collections.mapTo' call
2527
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(_this__u8e3s4, 10));
2528
+ var tmp0_iterator = _this__u8e3s4.c();
2529
+ while (tmp0_iterator.d()) {
2530
+ var item = tmp0_iterator.e();
2531
+ var tmp$ret$0;
2532
+ // Inline function 'community.flock.wirespec.compiler.core.optimize.optimize.<anonymous>' call
2533
+ var tmp0_subject = item.pk_1;
2534
+ var tmp;
2535
+ if (tmp0_subject instanceof CustomRegex) {
2536
+ tmp = item.wk(VOID, '"' + dropLast(drop(item.qk_1, 1), 2) + '"');
2537
+ } else {
2538
+ tmp = item;
2539
+ }
2540
+ tmp$ret$0 = tmp;
2541
+ tmp0_mapTo.a(tmp$ret$0);
2542
+ }
2543
+ tmp$ret$1 = tmp0_mapTo;
2544
+ tmp$ret$2 = tmp$ret$1;
2545
+ return tmp$ret$2;
2546
+ }
2547
+ var Type_String_instance;
2548
+ var Type_Integer_instance;
2549
+ var Type_Boolean_instance;
2550
+ var Type_entriesInitialized;
2551
+ function Type_initEntries() {
2552
+ if (Type_entriesInitialized)
2553
+ return Unit_getInstance();
2554
+ Type_entriesInitialized = true;
2555
+ Type_String_instance = new Type('String', 0);
2556
+ Type_Integer_instance = new Type('Integer', 1);
2557
+ Type_Boolean_instance = new Type('Boolean', 2);
2558
+ }
2559
+ function Type(name, ordinal) {
2560
+ Enum.call(this, name, ordinal);
2561
+ }
2562
+ function Type_String_getInstance() {
2563
+ Type_initEntries();
2564
+ return Type_String_instance;
2565
+ }
2566
+ function Type_Integer_getInstance() {
2567
+ Type_initEntries();
2568
+ return Type_Integer_instance;
2569
+ }
2570
+ function Type_Boolean_getInstance() {
2571
+ Type_initEntries();
2572
+ return Type_Boolean_instance;
2573
+ }
2574
+ function Custom(value, isIterable) {
2575
+ this.gj_1 = value;
2576
+ this.hj_1 = isIterable;
2577
+ }
2578
+ protoOf(Custom).qi = function () {
2579
+ return this.hj_1;
2580
+ };
2581
+ protoOf(Custom).toString = function () {
2582
+ return 'Custom(value=' + this.gj_1 + ', isIterable=' + this.hj_1 + ')';
2583
+ };
2584
+ protoOf(Custom).hashCode = function () {
2585
+ var result = getStringHashCode(this.gj_1);
2586
+ result = imul(result, 31) + (this.hj_1 | 0) | 0;
2587
+ return result;
2588
+ };
2589
+ protoOf(Custom).equals = function (other) {
2590
+ if (this === other)
2591
+ return true;
2592
+ if (!(other instanceof Custom))
2593
+ return false;
2594
+ var tmp0_other_with_cast = other instanceof Custom ? other : THROW_CCE();
2595
+ if (!(this.gj_1 === tmp0_other_with_cast.gj_1))
2596
+ return false;
2597
+ if (!(this.hj_1 === tmp0_other_with_cast.hj_1))
2598
+ return false;
2599
+ return true;
2600
+ };
2601
+ function Primitive(type, isIterable) {
2602
+ this.ej_1 = type;
2603
+ this.fj_1 = isIterable;
2604
+ }
2605
+ protoOf(Primitive).qi = function () {
2606
+ return this.fj_1;
2607
+ };
2608
+ protoOf(Primitive).toString = function () {
2609
+ return 'Primitive(type=' + this.ej_1 + ', isIterable=' + this.fj_1 + ')';
2610
+ };
2611
+ protoOf(Primitive).hashCode = function () {
2612
+ var result = this.ej_1.hashCode();
2613
+ result = imul(result, 31) + (this.fj_1 | 0) | 0;
2614
+ return result;
2615
+ };
2616
+ protoOf(Primitive).equals = function (other) {
2617
+ if (this === other)
2618
+ return true;
2619
+ if (!(other instanceof Primitive))
2620
+ return false;
2621
+ var tmp0_other_with_cast = other instanceof Primitive ? other : THROW_CCE();
2622
+ if (!this.ej_1.equals(tmp0_other_with_cast.ej_1))
2623
+ return false;
2624
+ if (!(this.fj_1 === tmp0_other_with_cast.fj_1))
2625
+ return false;
2626
+ return true;
2627
+ };
2628
+ function Identifier(value) {
2629
+ this.dj_1 = value;
2630
+ }
2631
+ protoOf(Identifier).toString = function () {
2632
+ return 'Identifier(value=' + this.dj_1 + ')';
2633
+ };
2634
+ protoOf(Identifier).hashCode = function () {
2635
+ return getStringHashCode(this.dj_1);
2636
+ };
2637
+ protoOf(Identifier).equals = function (other) {
2638
+ if (this === other)
2639
+ return true;
2640
+ if (!(other instanceof Identifier))
2641
+ return false;
2642
+ var tmp0_other_with_cast = other instanceof Identifier ? other : THROW_CCE();
2643
+ if (!(this.dj_1 === tmp0_other_with_cast.dj_1))
2644
+ return false;
2645
+ return true;
2646
+ };
2647
+ function Field(identifier, reference, isNullable) {
2648
+ this.zi_1 = identifier;
2649
+ this.aj_1 = reference;
2650
+ this.bj_1 = isNullable;
2651
+ }
2652
+ protoOf(Field).toString = function () {
2653
+ return 'Field(identifier=' + this.zi_1 + ', reference=' + this.aj_1 + ', isNullable=' + this.bj_1 + ')';
2654
+ };
2655
+ protoOf(Field).hashCode = function () {
2656
+ var result = this.zi_1.hashCode();
2657
+ result = imul(result, 31) + hashCode(this.aj_1) | 0;
2658
+ result = imul(result, 31) + (this.bj_1 | 0) | 0;
2659
+ return result;
2660
+ };
2661
+ protoOf(Field).equals = function (other) {
2662
+ if (this === other)
2663
+ return true;
2664
+ if (!(other instanceof Field))
2665
+ return false;
2666
+ var tmp0_other_with_cast = other instanceof Field ? other : THROW_CCE();
2667
+ if (!this.zi_1.equals(tmp0_other_with_cast.zi_1))
2668
+ return false;
2669
+ if (!equals(this.aj_1, tmp0_other_with_cast.aj_1))
2670
+ return false;
2671
+ if (!(this.bj_1 === tmp0_other_with_cast.bj_1))
2672
+ return false;
2673
+ return true;
2674
+ };
2675
+ function Shape(value) {
2676
+ this.yi_1 = value;
2677
+ }
2678
+ protoOf(Shape).toString = function () {
2679
+ return 'Shape(value=' + this.yi_1 + ')';
2680
+ };
2681
+ protoOf(Shape).hashCode = function () {
2682
+ return hashCode(this.yi_1);
2683
+ };
2684
+ protoOf(Shape).equals = function (other) {
2685
+ if (this === other)
2686
+ return true;
2687
+ if (!(other instanceof Shape))
2688
+ return false;
2689
+ var tmp0_other_with_cast = other instanceof Shape ? other : THROW_CCE();
2690
+ if (!equals(this.yi_1, tmp0_other_with_cast.yi_1))
2691
+ return false;
2692
+ return true;
2693
+ };
2694
+ function Type_0(name, shape) {
2695
+ this.ui_1 = name;
2696
+ this.vi_1 = shape;
2697
+ }
2698
+ protoOf(Type_0).toString = function () {
2699
+ return 'Type(name=' + this.ui_1 + ', shape=' + this.vi_1 + ')';
2700
+ };
2701
+ protoOf(Type_0).hashCode = function () {
2702
+ var result = getStringHashCode(this.ui_1);
2703
+ result = imul(result, 31) + this.vi_1.hashCode() | 0;
2704
+ return result;
2705
+ };
2706
+ protoOf(Type_0).equals = function (other) {
2707
+ if (this === other)
2708
+ return true;
2709
+ if (!(other instanceof Type_0))
2710
+ return false;
2711
+ var tmp0_other_with_cast = other instanceof Type_0 ? other : THROW_CCE();
2712
+ if (!(this.ui_1 === tmp0_other_with_cast.ui_1))
2713
+ return false;
2714
+ if (!this.vi_1.equals(tmp0_other_with_cast.vi_1))
2715
+ return false;
2716
+ return true;
2717
+ };
2718
+ var Method_GET_instance;
2719
+ var Method_POST_instance;
2720
+ var Method_PUT_instance;
2721
+ var Method_DELETE_instance;
2722
+ var Method_OPTIONS_instance;
2723
+ var Method_HEAD_instance;
2724
+ var Method_PATCH_instance;
2725
+ var Method_TRACE_instance;
2726
+ function values() {
2727
+ return [Method_GET_getInstance(), Method_POST_getInstance(), Method_PUT_getInstance(), Method_DELETE_getInstance(), Method_OPTIONS_getInstance(), Method_HEAD_getInstance(), Method_PATCH_getInstance(), Method_TRACE_getInstance()];
2728
+ }
2729
+ var Method_entriesInitialized;
2730
+ function Method_initEntries() {
2731
+ if (Method_entriesInitialized)
2732
+ return Unit_getInstance();
2733
+ Method_entriesInitialized = true;
2734
+ Method_GET_instance = new Method('GET', 0);
2735
+ Method_POST_instance = new Method('POST', 1);
2736
+ Method_PUT_instance = new Method('PUT', 2);
2737
+ Method_DELETE_instance = new Method('DELETE', 3);
2738
+ Method_OPTIONS_instance = new Method('OPTIONS', 4);
2739
+ Method_HEAD_instance = new Method('HEAD', 5);
2740
+ Method_PATCH_instance = new Method('PATCH', 6);
2741
+ Method_TRACE_instance = new Method('TRACE', 7);
2742
+ }
2743
+ function Literal(value) {
2744
+ this.pj_1 = value;
2745
+ }
2746
+ protoOf(Literal).toString = function () {
2747
+ return 'Literal(value=' + this.pj_1 + ')';
2748
+ };
2749
+ protoOf(Literal).hashCode = function () {
2750
+ return getStringHashCode(this.pj_1);
2751
+ };
2752
+ protoOf(Literal).equals = function (other) {
2753
+ if (this === other)
2754
+ return true;
2755
+ if (!(other instanceof Literal))
2756
+ return false;
2757
+ var tmp0_other_with_cast = other instanceof Literal ? other : THROW_CCE();
2758
+ if (!(this.pj_1 === tmp0_other_with_cast.pj_1))
2759
+ return false;
2760
+ return true;
2761
+ };
2762
+ function Param(identifier, reference) {
2763
+ this.si_1 = identifier;
2764
+ this.ti_1 = reference;
2765
+ }
2766
+ protoOf(Param).toString = function () {
2767
+ return 'Param(identifier=' + this.si_1 + ', reference=' + this.ti_1 + ')';
2768
+ };
2769
+ protoOf(Param).hashCode = function () {
2770
+ var result = this.si_1.hashCode();
2771
+ result = imul(result, 31) + hashCode(this.ti_1) | 0;
2772
+ return result;
2773
+ };
2774
+ protoOf(Param).equals = function (other) {
2775
+ if (this === other)
2776
+ return true;
2777
+ if (!(other instanceof Param))
2778
+ return false;
2779
+ var tmp0_other_with_cast = other instanceof Param ? other : THROW_CCE();
2780
+ if (!this.si_1.equals(tmp0_other_with_cast.si_1))
2781
+ return false;
2782
+ if (!equals(this.ti_1, tmp0_other_with_cast.ti_1))
2783
+ return false;
2784
+ return true;
2785
+ };
2786
+ function Method(name, ordinal) {
2787
+ Enum.call(this, name, ordinal);
2788
+ }
2789
+ function Request(content) {
2790
+ this.uh_1 = content;
2791
+ }
2792
+ protoOf(Request).toString = function () {
2793
+ return 'Request(content=' + this.uh_1 + ')';
2794
+ };
2795
+ protoOf(Request).hashCode = function () {
2796
+ return this.uh_1 == null ? 0 : this.uh_1.hashCode();
2797
+ };
2798
+ protoOf(Request).equals = function (other) {
2799
+ if (this === other)
2800
+ return true;
2801
+ if (!(other instanceof Request))
2802
+ return false;
2803
+ var tmp0_other_with_cast = other instanceof Request ? other : THROW_CCE();
2804
+ if (!equals(this.uh_1, tmp0_other_with_cast.uh_1))
2805
+ return false;
2806
+ return true;
2807
+ };
2808
+ function Response(status, content) {
2809
+ this.mi_1 = status;
2810
+ this.ni_1 = content;
2811
+ }
2812
+ protoOf(Response).toString = function () {
2813
+ return 'Response(status=' + this.mi_1 + ', content=' + this.ni_1 + ')';
2814
+ };
2815
+ protoOf(Response).hashCode = function () {
2816
+ var result = getStringHashCode(this.mi_1);
2817
+ result = imul(result, 31) + (this.ni_1 == null ? 0 : this.ni_1.hashCode()) | 0;
2818
+ return result;
2819
+ };
2820
+ protoOf(Response).equals = function (other) {
2821
+ if (this === other)
2822
+ return true;
2823
+ if (!(other instanceof Response))
2824
+ return false;
2825
+ var tmp0_other_with_cast = other instanceof Response ? other : THROW_CCE();
2826
+ if (!(this.mi_1 === tmp0_other_with_cast.mi_1))
2827
+ return false;
2828
+ if (!equals(this.ni_1, tmp0_other_with_cast.ni_1))
2829
+ return false;
2830
+ return true;
2831
+ };
2832
+ function Content(type, reference, isNullable) {
2833
+ this.vh_1 = type;
2834
+ this.wh_1 = reference;
2835
+ this.xh_1 = isNullable;
2836
+ }
2837
+ protoOf(Content).toString = function () {
2838
+ return 'Content(type=' + this.vh_1 + ', reference=' + this.wh_1 + ', isNullable=' + this.xh_1 + ')';
2839
+ };
2840
+ protoOf(Content).hashCode = function () {
2841
+ var result = getStringHashCode(this.vh_1);
2842
+ result = imul(result, 31) + hashCode(this.wh_1) | 0;
2843
+ result = imul(result, 31) + (this.xh_1 | 0) | 0;
2844
+ return result;
2845
+ };
2846
+ protoOf(Content).equals = function (other) {
2847
+ if (this === other)
2848
+ return true;
2849
+ if (!(other instanceof Content))
2850
+ return false;
2851
+ var tmp0_other_with_cast = other instanceof Content ? other : THROW_CCE();
2852
+ if (!(this.vh_1 === tmp0_other_with_cast.vh_1))
2853
+ return false;
2854
+ if (!equals(this.wh_1, tmp0_other_with_cast.wh_1))
2855
+ return false;
2856
+ if (!(this.xh_1 === tmp0_other_with_cast.xh_1))
2857
+ return false;
2858
+ return true;
2859
+ };
2860
+ function Method_GET_getInstance() {
2861
+ Method_initEntries();
2862
+ return Method_GET_instance;
2863
+ }
2864
+ function Method_POST_getInstance() {
2865
+ Method_initEntries();
2866
+ return Method_POST_instance;
2867
+ }
2868
+ function Method_PUT_getInstance() {
2869
+ Method_initEntries();
2870
+ return Method_PUT_instance;
2871
+ }
2872
+ function Method_DELETE_getInstance() {
2873
+ Method_initEntries();
2874
+ return Method_DELETE_instance;
2875
+ }
2876
+ function Method_OPTIONS_getInstance() {
2877
+ Method_initEntries();
2878
+ return Method_OPTIONS_instance;
2879
+ }
2880
+ function Method_HEAD_getInstance() {
2881
+ Method_initEntries();
2882
+ return Method_HEAD_instance;
2883
+ }
2884
+ function Method_PATCH_getInstance() {
2885
+ Method_initEntries();
2886
+ return Method_PATCH_instance;
2887
+ }
2888
+ function Method_TRACE_getInstance() {
2889
+ Method_initEntries();
2890
+ return Method_TRACE_instance;
2891
+ }
2892
+ function Endpoint(name, method, path, query, headers, cookies, requests, responses) {
2893
+ this.ei_1 = name;
2894
+ this.fi_1 = method;
2895
+ this.gi_1 = path;
2896
+ this.hi_1 = query;
2897
+ this.ii_1 = headers;
2898
+ this.ji_1 = cookies;
2899
+ this.ki_1 = requests;
2900
+ this.li_1 = responses;
2901
+ }
2902
+ protoOf(Endpoint).toString = function () {
2903
+ return 'Endpoint(name=' + this.ei_1 + ', method=' + this.fi_1 + ', path=' + this.gi_1 + ', query=' + this.hi_1 + ', headers=' + this.ii_1 + ', cookies=' + this.ji_1 + ', requests=' + this.ki_1 + ', responses=' + this.li_1 + ')';
2904
+ };
2905
+ protoOf(Endpoint).hashCode = function () {
2906
+ var result = getStringHashCode(this.ei_1);
2907
+ result = imul(result, 31) + this.fi_1.hashCode() | 0;
2908
+ result = imul(result, 31) + hashCode(this.gi_1) | 0;
2909
+ result = imul(result, 31) + hashCode(this.hi_1) | 0;
2910
+ result = imul(result, 31) + hashCode(this.ii_1) | 0;
2911
+ result = imul(result, 31) + hashCode(this.ji_1) | 0;
2912
+ result = imul(result, 31) + hashCode(this.ki_1) | 0;
2913
+ result = imul(result, 31) + hashCode(this.li_1) | 0;
2914
+ return result;
2915
+ };
2916
+ protoOf(Endpoint).equals = function (other) {
2917
+ if (this === other)
2918
+ return true;
2919
+ if (!(other instanceof Endpoint))
2920
+ return false;
2921
+ var tmp0_other_with_cast = other instanceof Endpoint ? other : THROW_CCE();
2922
+ if (!(this.ei_1 === tmp0_other_with_cast.ei_1))
2923
+ return false;
2924
+ if (!this.fi_1.equals(tmp0_other_with_cast.fi_1))
2925
+ return false;
2926
+ if (!equals(this.gi_1, tmp0_other_with_cast.gi_1))
2927
+ return false;
2928
+ if (!equals(this.hi_1, tmp0_other_with_cast.hi_1))
2929
+ return false;
2930
+ if (!equals(this.ii_1, tmp0_other_with_cast.ii_1))
2931
+ return false;
2932
+ if (!equals(this.ji_1, tmp0_other_with_cast.ji_1))
2933
+ return false;
2934
+ if (!equals(this.ki_1, tmp0_other_with_cast.ki_1))
2935
+ return false;
2936
+ if (!equals(this.li_1, tmp0_other_with_cast.li_1))
2937
+ return false;
2938
+ return true;
2939
+ };
2940
+ function Enum_0(name, entries) {
2941
+ this.ij_1 = name;
2942
+ this.jj_1 = entries;
2943
+ }
2944
+ protoOf(Enum_0).toString = function () {
2945
+ return 'Enum(name=' + this.ij_1 + ', entries=' + this.jj_1 + ')';
2946
+ };
2947
+ protoOf(Enum_0).hashCode = function () {
2948
+ var result = getStringHashCode(this.ij_1);
2949
+ result = imul(result, 31) + hashCode(this.jj_1) | 0;
2950
+ return result;
2951
+ };
2952
+ protoOf(Enum_0).equals = function (other) {
2953
+ if (this === other)
2954
+ return true;
2955
+ if (!(other instanceof Enum_0))
2956
+ return false;
2957
+ var tmp0_other_with_cast = other instanceof Enum_0 ? other : THROW_CCE();
2958
+ if (!(this.ij_1 === tmp0_other_with_cast.ij_1))
2959
+ return false;
2960
+ if (!equals(this.jj_1, tmp0_other_with_cast.jj_1))
2961
+ return false;
2962
+ return true;
2963
+ };
2964
+ function Validator(value) {
2965
+ this.nj_1 = value;
2966
+ }
2967
+ protoOf(Validator).toString = function () {
2968
+ return 'Validator(value=' + this.nj_1 + ')';
2969
+ };
2970
+ protoOf(Validator).hashCode = function () {
2971
+ return getStringHashCode(this.nj_1);
2972
+ };
2973
+ protoOf(Validator).equals = function (other) {
2974
+ if (this === other)
2975
+ return true;
2976
+ if (!(other instanceof Validator))
2977
+ return false;
2978
+ var tmp0_other_with_cast = other instanceof Validator ? other : THROW_CCE();
2979
+ if (!(this.nj_1 === tmp0_other_with_cast.nj_1))
2980
+ return false;
2981
+ return true;
2982
+ };
2983
+ function Refined(name, validator) {
2984
+ this.kj_1 = name;
2985
+ this.lj_1 = validator;
2986
+ }
2987
+ protoOf(Refined).toString = function () {
2988
+ return 'Refined(name=' + this.kj_1 + ', validator=' + this.lj_1 + ')';
2989
+ };
2990
+ protoOf(Refined).hashCode = function () {
2991
+ var result = getStringHashCode(this.kj_1);
2992
+ result = imul(result, 31) + this.lj_1.hashCode() | 0;
2993
+ return result;
2994
+ };
2995
+ protoOf(Refined).equals = function (other) {
2996
+ if (this === other)
2997
+ return true;
2998
+ if (!(other instanceof Refined))
2999
+ return false;
3000
+ var tmp0_other_with_cast = other instanceof Refined ? other : THROW_CCE();
3001
+ if (!(this.kj_1 === tmp0_other_with_cast.kj_1))
3002
+ return false;
3003
+ if (!this.lj_1.equals(tmp0_other_with_cast.lj_1))
3004
+ return false;
3005
+ return true;
3006
+ };
3007
+ function parse(_this__u8e3s4, $this) {
3008
+ var tmp$ret$11;
3009
+ // Inline function 'arrow.core.raise.either' call
3010
+ var tmp$ret$10;
3011
+ // Inline function 'arrow.core.raise.fold' call
3012
+ // Inline function 'kotlin.contracts.contract' call
3013
+ var tmp$ret$9;
3014
+ // Inline function 'arrow.core.raise.fold' call
3015
+ // Inline function 'kotlin.contracts.contract' call
3016
+ var raise = new DefaultRaise(false);
3017
+ var tmp;
3018
+ try {
3019
+ var tmp$ret$6;
3020
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3021
+ var tmp$ret$5;
3022
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>' call
3023
+ var tmp$ret$4;
3024
+ // Inline function 'kotlin.collections.map' call
3025
+ var tmp$ret$1;
3026
+ // Inline function 'kotlin.apply' call
3027
+ var tmp$ret$0;
3028
+ // Inline function 'kotlin.collections.mutableListOf' call
3029
+ tmp$ret$0 = ArrayList_init_$Create$();
3030
+ var tmp0_apply = tmp$ret$0;
3031
+ // Inline function 'kotlin.contracts.contract' call
3032
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>.<anonymous>' call
3033
+ while (_this__u8e3s4.d()) {
3034
+ tmp0_apply.a(parseDefinition(_this__u8e3s4, $this));
3035
+ }
3036
+ tmp$ret$1 = tmp0_apply;
3037
+ var tmp2_map = tmp$ret$1;
3038
+ var tmp$ret$3;
3039
+ // Inline function 'kotlin.collections.mapTo' call
3040
+ var tmp1_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp2_map, 10));
3041
+ var tmp0_iterator = tmp2_map.c();
3042
+ while (tmp0_iterator.d()) {
3043
+ var item = tmp0_iterator.e();
3044
+ var tmp$ret$2;
3045
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>.<anonymous>' call
3046
+ tmp$ret$2 = raise.ch(item);
3047
+ tmp1_mapTo.a(tmp$ret$2);
3048
+ }
3049
+ tmp$ret$3 = tmp1_mapTo;
3050
+ tmp$ret$4 = tmp$ret$3;
3051
+ tmp$ret$5 = tmp$ret$4;
3052
+ tmp$ret$6 = tmp$ret$5;
3053
+ var res = tmp$ret$6;
3054
+ raise.zg();
3055
+ var tmp$ret$7;
3056
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3057
+ tmp$ret$7 = new Right(res);
3058
+ tmp = tmp$ret$7;
3059
+ } catch ($p) {
3060
+ var tmp_0;
3061
+ if ($p instanceof CancellationException) {
3062
+ var e = $p;
3063
+ raise.zg();
3064
+ var tmp$ret$8;
3065
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3066
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3067
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3068
+ tmp_0 = tmp$ret$8;
3069
+ } else {
3070
+ if ($p instanceof Error) {
3071
+ var e_0 = $p;
3072
+ raise.zg();
3073
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3074
+ throw tmp0__anonymous__q1qw7t;
3075
+ } else {
3076
+ throw $p;
3077
+ }
3078
+ }
3079
+ tmp = tmp_0;
3080
+ }
3081
+ tmp$ret$9 = tmp;
3082
+ tmp$ret$10 = tmp$ret$9;
3083
+ tmp$ret$11 = tmp$ret$10;
3084
+ return tmp$ret$11;
3085
+ }
3086
+ function parseDefinition(_this__u8e3s4, $this) {
3087
+ var tmp$ret$8;
3088
+ // Inline function 'arrow.core.raise.either' call
3089
+ var tmp$ret$7;
3090
+ // Inline function 'arrow.core.raise.fold' call
3091
+ // Inline function 'kotlin.contracts.contract' call
3092
+ var tmp$ret$6;
3093
+ // Inline function 'arrow.core.raise.fold' call
3094
+ // Inline function 'kotlin.contracts.contract' call
3095
+ var raise = new DefaultRaise(false);
3096
+ var tmp;
3097
+ try {
3098
+ var tmp$ret$3;
3099
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3100
+ var tmp$ret$2;
3101
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseDefinition.<anonymous>' call
3102
+ log(_this__u8e3s4.zk_1, $this);
3103
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3104
+ var tmp_0;
3105
+ if (tmp0_subject instanceof WsTypeDef) {
3106
+ tmp_0 = raise.ch(parseTypeDeclaration(_this__u8e3s4, $this));
3107
+ } else {
3108
+ if (tmp0_subject instanceof WsEnumTypeDef) {
3109
+ tmp_0 = raise.ch(parseEnumTypeDeclaration(_this__u8e3s4, $this));
3110
+ } else {
3111
+ if (tmp0_subject instanceof WsRefinedTypeDef) {
3112
+ tmp_0 = raise.ch(parseRefinedTypeDeclaration(_this__u8e3s4, $this));
3113
+ } else {
3114
+ var tmp$ret$1;
3115
+ // Inline function 'arrow.core.nel' call
3116
+ var tmp$ret$0;
3117
+ // Inline function 'kotlin.also' call
3118
+ var tmp0_also = new WrongTokenException(getKClass(WsTypeDef), _this__u8e3s4.zk_1);
3119
+ // Inline function 'kotlin.contracts.contract' call
3120
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseDefinition.<anonymous>.<anonymous>' call
3121
+ _this__u8e3s4.bl();
3122
+ tmp$ret$0 = tmp0_also;
3123
+ var tmp1_nel = tmp$ret$0;
3124
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3125
+ raise.bh(tmp$ret$1);
3126
+ }
3127
+ }
3128
+ }
3129
+ tmp$ret$2 = tmp_0;
3130
+ tmp$ret$3 = tmp$ret$2;
3131
+ var res = tmp$ret$3;
3132
+ raise.zg();
3133
+ var tmp$ret$4;
3134
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3135
+ tmp$ret$4 = new Right(res);
3136
+ tmp = tmp$ret$4;
3137
+ } catch ($p) {
3138
+ var tmp_1;
3139
+ if ($p instanceof CancellationException) {
3140
+ var e = $p;
3141
+ raise.zg();
3142
+ var tmp$ret$5;
3143
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3144
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3145
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3146
+ tmp_1 = tmp$ret$5;
3147
+ } else {
3148
+ if ($p instanceof Error) {
3149
+ var e_0 = $p;
3150
+ raise.zg();
3151
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3152
+ throw tmp0__anonymous__q1qw7t;
3153
+ } else {
3154
+ throw $p;
3155
+ }
3156
+ }
3157
+ tmp = tmp_1;
3158
+ }
3159
+ tmp$ret$6 = tmp;
3160
+ tmp$ret$7 = tmp$ret$6;
3161
+ tmp$ret$8 = tmp$ret$7;
3162
+ return tmp$ret$8;
3163
+ }
3164
+ function parseTypeDeclaration(_this__u8e3s4, $this) {
3165
+ var tmp$ret$8;
3166
+ // Inline function 'arrow.core.raise.either' call
3167
+ var tmp$ret$7;
3168
+ // Inline function 'arrow.core.raise.fold' call
3169
+ // Inline function 'kotlin.contracts.contract' call
3170
+ var tmp$ret$6;
3171
+ // Inline function 'arrow.core.raise.fold' call
3172
+ // Inline function 'kotlin.contracts.contract' call
3173
+ var raise = new DefaultRaise(false);
3174
+ var tmp;
3175
+ try {
3176
+ var tmp$ret$3;
3177
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3178
+ var tmp$ret$2;
3179
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDeclaration.<anonymous>' call
3180
+ _this__u8e3s4.bl();
3181
+ log(_this__u8e3s4.zk_1, $this);
3182
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3183
+ var tmp_0;
3184
+ if (tmp0_subject instanceof CustomType) {
3185
+ tmp_0 = raise.ch(parseTypeDefinition(_this__u8e3s4, $this, _this__u8e3s4.zk_1.qk_1));
3186
+ } else {
3187
+ var tmp$ret$1;
3188
+ // Inline function 'arrow.core.nel' call
3189
+ var tmp$ret$0;
3190
+ // Inline function 'kotlin.also' call
3191
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3192
+ // Inline function 'kotlin.contracts.contract' call
3193
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDeclaration.<anonymous>.<anonymous>' call
3194
+ _this__u8e3s4.bl();
3195
+ tmp$ret$0 = tmp0_also;
3196
+ var tmp1_nel = tmp$ret$0;
3197
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3198
+ raise.bh(tmp$ret$1);
3199
+ }
3200
+ tmp$ret$2 = tmp_0;
3201
+ tmp$ret$3 = tmp$ret$2;
3202
+ var res = tmp$ret$3;
3203
+ raise.zg();
3204
+ var tmp$ret$4;
3205
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3206
+ tmp$ret$4 = new Right(res);
3207
+ tmp = tmp$ret$4;
3208
+ } catch ($p) {
3209
+ var tmp_1;
3210
+ if ($p instanceof CancellationException) {
3211
+ var e = $p;
3212
+ raise.zg();
3213
+ var tmp$ret$5;
3214
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3215
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3216
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3217
+ tmp_1 = tmp$ret$5;
3218
+ } else {
3219
+ if ($p instanceof Error) {
3220
+ var e_0 = $p;
3221
+ raise.zg();
3222
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3223
+ throw tmp0__anonymous__q1qw7t;
3224
+ } else {
3225
+ throw $p;
3226
+ }
3227
+ }
3228
+ tmp = tmp_1;
3229
+ }
3230
+ tmp$ret$6 = tmp;
3231
+ tmp$ret$7 = tmp$ret$6;
3232
+ tmp$ret$8 = tmp$ret$7;
3233
+ return tmp$ret$8;
3234
+ }
3235
+ function parseTypeDefinition(_this__u8e3s4, $this, typeName) {
3236
+ var tmp$ret$11;
3237
+ // Inline function 'arrow.core.raise.either' call
3238
+ var tmp$ret$10;
3239
+ // Inline function 'arrow.core.raise.fold' call
3240
+ // Inline function 'kotlin.contracts.contract' call
3241
+ var tmp$ret$9;
3242
+ // Inline function 'arrow.core.raise.fold' call
3243
+ // Inline function 'kotlin.contracts.contract' call
3244
+ var raise = new DefaultRaise(false);
3245
+ var tmp;
3246
+ try {
3247
+ var tmp$ret$6;
3248
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3249
+ var tmp$ret$5;
3250
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>' call
3251
+ _this__u8e3s4.bl();
3252
+ log(_this__u8e3s4.zk_1, $this);
3253
+ var tmp$ret$4;
3254
+ // Inline function 'kotlin.also' call
3255
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3256
+ var tmp_0;
3257
+ if (tmp0_subject instanceof LeftCurly) {
3258
+ tmp_0 = new Type_0(typeName, raise.ch(parseTypeShape(_this__u8e3s4, $this)));
3259
+ } else {
3260
+ var tmp$ret$1;
3261
+ // Inline function 'arrow.core.nel' call
3262
+ var tmp$ret$0;
3263
+ // Inline function 'kotlin.also' call
3264
+ var tmp0_also = new WrongTokenException(getKClass(LeftCurly), _this__u8e3s4.zk_1);
3265
+ // Inline function 'kotlin.contracts.contract' call
3266
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>' call
3267
+ _this__u8e3s4.bl();
3268
+ tmp$ret$0 = tmp0_also;
3269
+ var tmp1_nel = tmp$ret$0;
3270
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3271
+ raise.bh(tmp$ret$1);
3272
+ }
3273
+ var tmp2_also = tmp_0;
3274
+ // Inline function 'kotlin.contracts.contract' call
3275
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>' call
3276
+ var tmp0_subject_0 = _this__u8e3s4.zk_1.pk_1;
3277
+ if (tmp0_subject_0 instanceof RightCurly) {
3278
+ _this__u8e3s4.bl();
3279
+ } else {
3280
+ var tmp$ret$3;
3281
+ // Inline function 'arrow.core.nel' call
3282
+ var tmp$ret$2;
3283
+ // Inline function 'kotlin.also' call
3284
+ var tmp0_also_0 = new WrongTokenException(getKClass(RightCurly), _this__u8e3s4.zk_1);
3285
+ // Inline function 'kotlin.contracts.contract' call
3286
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>.<anonymous>' call
3287
+ _this__u8e3s4.bl();
3288
+ tmp$ret$2 = tmp0_also_0;
3289
+ var tmp1_nel_0 = tmp$ret$2;
3290
+ tmp$ret$3 = nonEmptyListOf(tmp1_nel_0, []);
3291
+ raise.bh(tmp$ret$3);
3292
+ }
3293
+ tmp$ret$4 = tmp2_also;
3294
+ tmp$ret$5 = tmp$ret$4;
3295
+ tmp$ret$6 = tmp$ret$5;
3296
+ var res = tmp$ret$6;
3297
+ raise.zg();
3298
+ var tmp$ret$7;
3299
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3300
+ tmp$ret$7 = new Right(res);
3301
+ tmp = tmp$ret$7;
3302
+ } catch ($p) {
3303
+ var tmp_1;
3304
+ if ($p instanceof CancellationException) {
3305
+ var e = $p;
3306
+ raise.zg();
3307
+ var tmp$ret$8;
3308
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3309
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3310
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3311
+ tmp_1 = tmp$ret$8;
3312
+ } else {
3313
+ if ($p instanceof Error) {
3314
+ var e_0 = $p;
3315
+ raise.zg();
3316
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3317
+ throw tmp0__anonymous__q1qw7t;
3318
+ } else {
3319
+ throw $p;
3320
+ }
3321
+ }
3322
+ tmp = tmp_1;
3323
+ }
3324
+ tmp$ret$9 = tmp;
3325
+ tmp$ret$10 = tmp$ret$9;
3326
+ tmp$ret$11 = tmp$ret$10;
3327
+ return tmp$ret$11;
3328
+ }
3329
+ function parseTypeShape(_this__u8e3s4, $this) {
3330
+ var tmp$ret$13;
3331
+ // Inline function 'arrow.core.raise.either' call
3332
+ var tmp$ret$12;
3333
+ // Inline function 'arrow.core.raise.fold' call
3334
+ // Inline function 'kotlin.contracts.contract' call
3335
+ var tmp$ret$11;
3336
+ // Inline function 'arrow.core.raise.fold' call
3337
+ // Inline function 'kotlin.contracts.contract' call
3338
+ var raise = new DefaultRaise(false);
3339
+ var tmp;
3340
+ try {
3341
+ var tmp$ret$8;
3342
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3343
+ var tmp$ret$7;
3344
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>' call
3345
+ _this__u8e3s4.bl();
3346
+ log(_this__u8e3s4.zk_1, $this);
3347
+ var tmp$ret$6;
3348
+ // Inline function 'kotlin.let' call
3349
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3350
+ var tmp_0;
3351
+ if (tmp0_subject instanceof CustomValue) {
3352
+ var tmp$ret$3;
3353
+ // Inline function 'kotlin.apply' call
3354
+ var tmp$ret$0;
3355
+ // Inline function 'kotlin.collections.mutableListOf' call
3356
+ tmp$ret$0 = ArrayList_init_$Create$();
3357
+ var tmp0_apply = tmp$ret$0;
3358
+ // Inline function 'kotlin.contracts.contract' call
3359
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>' call
3360
+ tmp0_apply.a(raise.ch(parseField(_this__u8e3s4, $this, new Identifier(_this__u8e3s4.zk_1.qk_1))));
3361
+ while (equals(_this__u8e3s4.zk_1.pk_1, Comma_getInstance())) {
3362
+ _this__u8e3s4.bl();
3363
+ var tmp0_subject_0 = _this__u8e3s4.zk_1.pk_1;
3364
+ if (tmp0_subject_0 instanceof CustomValue) {
3365
+ tmp0_apply.a(raise.ch(parseField(_this__u8e3s4, $this, new Identifier(_this__u8e3s4.zk_1.qk_1))));
3366
+ } else {
3367
+ var tmp$ret$2;
3368
+ // Inline function 'arrow.core.nel' call
3369
+ var tmp$ret$1;
3370
+ // Inline function 'kotlin.also' call
3371
+ var tmp0_also = new WrongTokenException(getKClass(CustomValue), _this__u8e3s4.zk_1);
3372
+ // Inline function 'kotlin.contracts.contract' call
3373
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>.<anonymous>' call
3374
+ _this__u8e3s4.bl();
3375
+ tmp$ret$1 = tmp0_also;
3376
+ var tmp1_nel = tmp$ret$1;
3377
+ tmp$ret$2 = nonEmptyListOf(tmp1_nel, []);
3378
+ raise.bh(tmp$ret$2);
3379
+ }
3380
+ }
3381
+ tmp$ret$3 = tmp0_apply;
3382
+ tmp_0 = tmp$ret$3;
3383
+ } else {
3384
+ var tmp$ret$5;
3385
+ // Inline function 'arrow.core.nel' call
3386
+ var tmp$ret$4;
3387
+ // Inline function 'kotlin.also' call
3388
+ var tmp1_also = new WrongTokenException(getKClass(CustomValue), _this__u8e3s4.zk_1);
3389
+ // Inline function 'kotlin.contracts.contract' call
3390
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>' call
3391
+ _this__u8e3s4.bl();
3392
+ tmp$ret$4 = tmp1_also;
3393
+ var tmp2_nel = tmp$ret$4;
3394
+ tmp$ret$5 = nonEmptyListOf(tmp2_nel, []);
3395
+ raise.bh(tmp$ret$5);
3396
+ }
3397
+ var tmp3_let = tmp_0;
3398
+ // Inline function 'kotlin.contracts.contract' call
3399
+ tmp$ret$6 = new Shape(tmp3_let);
3400
+ tmp$ret$7 = tmp$ret$6;
3401
+ tmp$ret$8 = tmp$ret$7;
3402
+ var res = tmp$ret$8;
3403
+ raise.zg();
3404
+ var tmp$ret$9;
3405
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3406
+ tmp$ret$9 = new Right(res);
3407
+ tmp = tmp$ret$9;
3408
+ } catch ($p) {
3409
+ var tmp_1;
3410
+ if ($p instanceof CancellationException) {
3411
+ var e = $p;
3412
+ raise.zg();
3413
+ var tmp$ret$10;
3414
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3415
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3416
+ tmp$ret$10 = new Left(tmp1__anonymous__uwfjfc);
3417
+ tmp_1 = tmp$ret$10;
3418
+ } else {
3419
+ if ($p instanceof Error) {
3420
+ var e_0 = $p;
3421
+ raise.zg();
3422
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3423
+ throw tmp0__anonymous__q1qw7t;
3424
+ } else {
3425
+ throw $p;
3426
+ }
3427
+ }
3428
+ tmp = tmp_1;
3429
+ }
3430
+ tmp$ret$11 = tmp;
3431
+ tmp$ret$12 = tmp$ret$11;
3432
+ tmp$ret$13 = tmp$ret$12;
3433
+ return tmp$ret$13;
3434
+ }
3435
+ function parseField(_this__u8e3s4, $this, identifier) {
3436
+ var tmp$ret$11;
3437
+ // Inline function 'arrow.core.raise.either' call
3438
+ var tmp$ret$10;
3439
+ // Inline function 'arrow.core.raise.fold' call
3440
+ // Inline function 'kotlin.contracts.contract' call
3441
+ var tmp$ret$9;
3442
+ // Inline function 'arrow.core.raise.fold' call
3443
+ // Inline function 'kotlin.contracts.contract' call
3444
+ var raise = new DefaultRaise(false);
3445
+ var tmp;
3446
+ try {
3447
+ var tmp$ret$6;
3448
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3449
+ var tmp$ret$5;
3450
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>' call
3451
+ _this__u8e3s4.bl();
3452
+ log(_this__u8e3s4.zk_1, $this);
3453
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3454
+ if (tmp0_subject instanceof Colon) {
3455
+ _this__u8e3s4.bl();
3456
+ } else {
3457
+ var tmp$ret$1;
3458
+ // Inline function 'arrow.core.nel' call
3459
+ var tmp$ret$0;
3460
+ // Inline function 'kotlin.also' call
3461
+ var tmp0_also = new WrongTokenException(getKClass(Colon), _this__u8e3s4.zk_1);
3462
+ // Inline function 'kotlin.contracts.contract' call
3463
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3464
+ _this__u8e3s4.bl();
3465
+ tmp$ret$0 = tmp0_also;
3466
+ var tmp1_nel = tmp$ret$0;
3467
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3468
+ raise.bh(tmp$ret$1);
3469
+ }
3470
+ var type = _this__u8e3s4.zk_1.pk_1;
3471
+ var tmp_0;
3472
+ if (isInterface(type, WsType)) {
3473
+ var tmp_1 = parseFieldValue(_this__u8e3s4, $this, type, _this__u8e3s4.zk_1.qk_1);
3474
+ var tmp$ret$2;
3475
+ // Inline function 'kotlin.also' call
3476
+ var tmp_2 = _this__u8e3s4.zk_1.pk_1;
3477
+ var tmp2_also = tmp_2 instanceof QuestionMark;
3478
+ // Inline function 'kotlin.contracts.contract' call
3479
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3480
+ if (tmp2_also) {
3481
+ _this__u8e3s4.bl();
3482
+ }
3483
+ tmp$ret$2 = tmp2_also;
3484
+ tmp_0 = new Field(identifier, tmp_1, tmp$ret$2);
3485
+ } else {
3486
+ var tmp$ret$4;
3487
+ // Inline function 'arrow.core.nel' call
3488
+ var tmp$ret$3;
3489
+ // Inline function 'kotlin.also' call
3490
+ var tmp3_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3491
+ // Inline function 'kotlin.contracts.contract' call
3492
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3493
+ _this__u8e3s4.bl();
3494
+ tmp$ret$3 = tmp3_also;
3495
+ var tmp4_nel = tmp$ret$3;
3496
+ tmp$ret$4 = nonEmptyListOf(tmp4_nel, []);
3497
+ raise.bh(tmp$ret$4);
3498
+ }
3499
+ tmp$ret$5 = tmp_0;
3500
+ tmp$ret$6 = tmp$ret$5;
3501
+ var res = tmp$ret$6;
3502
+ raise.zg();
3503
+ var tmp$ret$7;
3504
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3505
+ tmp$ret$7 = new Right(res);
3506
+ tmp = tmp$ret$7;
3507
+ } catch ($p) {
3508
+ var tmp_3;
3509
+ if ($p instanceof CancellationException) {
3510
+ var e = $p;
3511
+ raise.zg();
3512
+ var tmp$ret$8;
3513
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3514
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3515
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3516
+ tmp_3 = tmp$ret$8;
3517
+ } else {
3518
+ if ($p instanceof Error) {
3519
+ var e_0 = $p;
3520
+ raise.zg();
3521
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3522
+ throw tmp0__anonymous__q1qw7t;
3523
+ } else {
3524
+ throw $p;
3525
+ }
3526
+ }
3527
+ tmp = tmp_3;
3528
+ }
3529
+ tmp$ret$9 = tmp;
3530
+ tmp$ret$10 = tmp$ret$9;
3531
+ tmp$ret$11 = tmp$ret$10;
3532
+ return tmp$ret$11;
3533
+ }
3534
+ function parseFieldValue(_this__u8e3s4, $this, wsType, value) {
3535
+ var tmp$ret$2;
3536
+ // Inline function 'kotlin.run' call
3537
+ // Inline function 'kotlin.contracts.contract' call
3538
+ var tmp$ret$1;
3539
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseFieldValue.<anonymous>' call
3540
+ _this__u8e3s4.bl();
3541
+ log(_this__u8e3s4.zk_1, $this);
3542
+ var tmp$ret$0;
3543
+ // Inline function 'kotlin.also' call
3544
+ var tmp = _this__u8e3s4.zk_1.pk_1;
3545
+ var tmp0_also = tmp instanceof Brackets;
3546
+ // Inline function 'kotlin.contracts.contract' call
3547
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseFieldValue.<anonymous>.<anonymous>' call
3548
+ if (tmp0_also) {
3549
+ _this__u8e3s4.bl();
3550
+ }
3551
+ tmp$ret$0 = tmp0_also;
3552
+ var isIterable = tmp$ret$0;
3553
+ var tmp0_subject = wsType;
3554
+ var tmp_0;
3555
+ if (tmp0_subject instanceof WsString) {
3556
+ tmp_0 = new Primitive(Type_String_getInstance(), isIterable);
3557
+ } else {
3558
+ if (tmp0_subject instanceof WsInteger) {
3559
+ tmp_0 = new Primitive(Type_Integer_getInstance(), isIterable);
3560
+ } else {
3561
+ if (tmp0_subject instanceof WsBoolean) {
3562
+ tmp_0 = new Primitive(Type_Boolean_getInstance(), isIterable);
3563
+ } else {
3564
+ if (tmp0_subject instanceof CustomType) {
3565
+ tmp_0 = new Custom(value, isIterable);
3566
+ } else {
3567
+ noWhenBranchMatchedException();
3568
+ }
3569
+ }
3570
+ }
3571
+ }
3572
+ tmp$ret$1 = tmp_0;
3573
+ tmp$ret$2 = tmp$ret$1;
3574
+ return tmp$ret$2;
3575
+ }
3576
+ function parseEnumTypeDeclaration(_this__u8e3s4, $this) {
3577
+ var tmp$ret$8;
3578
+ // Inline function 'arrow.core.raise.either' call
3579
+ var tmp$ret$7;
3580
+ // Inline function 'arrow.core.raise.fold' call
3581
+ // Inline function 'kotlin.contracts.contract' call
3582
+ var tmp$ret$6;
3583
+ // Inline function 'arrow.core.raise.fold' call
3584
+ // Inline function 'kotlin.contracts.contract' call
3585
+ var raise = new DefaultRaise(false);
3586
+ var tmp;
3587
+ try {
3588
+ var tmp$ret$3;
3589
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3590
+ var tmp$ret$2;
3591
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDeclaration.<anonymous>' call
3592
+ _this__u8e3s4.bl();
3593
+ log(_this__u8e3s4.zk_1, $this);
3594
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3595
+ var tmp_0;
3596
+ if (tmp0_subject instanceof CustomType) {
3597
+ tmp_0 = raise.ch(parseEnumTypeDefinition(_this__u8e3s4, $this, _this__u8e3s4.zk_1.qk_1));
3598
+ } else {
3599
+ var tmp$ret$1;
3600
+ // Inline function 'arrow.core.nel' call
3601
+ var tmp$ret$0;
3602
+ // Inline function 'kotlin.also' call
3603
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3604
+ // Inline function 'kotlin.contracts.contract' call
3605
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDeclaration.<anonymous>.<anonymous>' call
3606
+ _this__u8e3s4.bl();
3607
+ tmp$ret$0 = tmp0_also;
3608
+ var tmp1_nel = tmp$ret$0;
3609
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3610
+ raise.bh(tmp$ret$1);
3611
+ }
3612
+ tmp$ret$2 = tmp_0;
3613
+ tmp$ret$3 = tmp$ret$2;
3614
+ var res = tmp$ret$3;
3615
+ raise.zg();
3616
+ var tmp$ret$4;
3617
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3618
+ tmp$ret$4 = new Right(res);
3619
+ tmp = tmp$ret$4;
3620
+ } catch ($p) {
3621
+ var tmp_1;
3622
+ if ($p instanceof CancellationException) {
3623
+ var e = $p;
3624
+ raise.zg();
3625
+ var tmp$ret$5;
3626
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3627
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3628
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3629
+ tmp_1 = tmp$ret$5;
3630
+ } else {
3631
+ if ($p instanceof Error) {
3632
+ var e_0 = $p;
3633
+ raise.zg();
3634
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3635
+ throw tmp0__anonymous__q1qw7t;
3636
+ } else {
3637
+ throw $p;
3638
+ }
3639
+ }
3640
+ tmp = tmp_1;
3641
+ }
3642
+ tmp$ret$6 = tmp;
3643
+ tmp$ret$7 = tmp$ret$6;
3644
+ tmp$ret$8 = tmp$ret$7;
3645
+ return tmp$ret$8;
3646
+ }
3647
+ function parseEnumTypeDefinition(_this__u8e3s4, $this, typeName) {
3648
+ var tmp$ret$11;
3649
+ // Inline function 'arrow.core.raise.either' call
3650
+ var tmp$ret$10;
3651
+ // Inline function 'arrow.core.raise.fold' call
3652
+ // Inline function 'kotlin.contracts.contract' call
3653
+ var tmp$ret$9;
3654
+ // Inline function 'arrow.core.raise.fold' call
3655
+ // Inline function 'kotlin.contracts.contract' call
3656
+ var raise = new DefaultRaise(false);
3657
+ var tmp;
3658
+ try {
3659
+ var tmp$ret$6;
3660
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3661
+ var tmp$ret$5;
3662
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>' call
3663
+ _this__u8e3s4.bl();
3664
+ log(_this__u8e3s4.zk_1, $this);
3665
+ var tmp$ret$4;
3666
+ // Inline function 'kotlin.also' call
3667
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3668
+ var tmp_0;
3669
+ if (tmp0_subject instanceof LeftCurly) {
3670
+ tmp_0 = new Enum_0(typeName, raise.ch(parseEnumTypeEntries(_this__u8e3s4, $this)));
3671
+ } else {
3672
+ var tmp$ret$1;
3673
+ // Inline function 'arrow.core.nel' call
3674
+ var tmp$ret$0;
3675
+ // Inline function 'kotlin.also' call
3676
+ var tmp0_also = new WrongTokenException(getKClass(LeftCurly), _this__u8e3s4.zk_1);
3677
+ // Inline function 'kotlin.contracts.contract' call
3678
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>' call
3679
+ _this__u8e3s4.bl();
3680
+ tmp$ret$0 = tmp0_also;
3681
+ var tmp1_nel = tmp$ret$0;
3682
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3683
+ raise.bh(tmp$ret$1);
3684
+ }
3685
+ var tmp2_also = tmp_0;
3686
+ // Inline function 'kotlin.contracts.contract' call
3687
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>' call
3688
+ var tmp0_subject_0 = _this__u8e3s4.zk_1.pk_1;
3689
+ if (tmp0_subject_0 instanceof RightCurly) {
3690
+ _this__u8e3s4.bl();
3691
+ } else {
3692
+ var tmp$ret$3;
3693
+ // Inline function 'arrow.core.nel' call
3694
+ var tmp$ret$2;
3695
+ // Inline function 'kotlin.also' call
3696
+ var tmp0_also_0 = new WrongTokenException(getKClass(RightCurly), _this__u8e3s4.zk_1);
3697
+ // Inline function 'kotlin.contracts.contract' call
3698
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>.<anonymous>' call
3699
+ _this__u8e3s4.bl();
3700
+ tmp$ret$2 = tmp0_also_0;
3701
+ var tmp1_nel_0 = tmp$ret$2;
3702
+ tmp$ret$3 = nonEmptyListOf(tmp1_nel_0, []);
3703
+ raise.bh(tmp$ret$3);
3704
+ }
3705
+ tmp$ret$4 = tmp2_also;
3706
+ tmp$ret$5 = tmp$ret$4;
3707
+ tmp$ret$6 = tmp$ret$5;
3708
+ var res = tmp$ret$6;
3709
+ raise.zg();
3710
+ var tmp$ret$7;
3711
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3712
+ tmp$ret$7 = new Right(res);
3713
+ tmp = tmp$ret$7;
3714
+ } catch ($p) {
3715
+ var tmp_1;
3716
+ if ($p instanceof CancellationException) {
3717
+ var e = $p;
3718
+ raise.zg();
3719
+ var tmp$ret$8;
3720
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3721
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3722
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3723
+ tmp_1 = tmp$ret$8;
3724
+ } else {
3725
+ if ($p instanceof Error) {
3726
+ var e_0 = $p;
3727
+ raise.zg();
3728
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3729
+ throw tmp0__anonymous__q1qw7t;
3730
+ } else {
3731
+ throw $p;
3732
+ }
3733
+ }
3734
+ tmp = tmp_1;
3735
+ }
3736
+ tmp$ret$9 = tmp;
3737
+ tmp$ret$10 = tmp$ret$9;
3738
+ tmp$ret$11 = tmp$ret$10;
3739
+ return tmp$ret$11;
3740
+ }
3741
+ function parseEnumTypeEntries(_this__u8e3s4, $this) {
3742
+ var tmp$ret$13;
3743
+ // Inline function 'arrow.core.raise.either' call
3744
+ var tmp$ret$12;
3745
+ // Inline function 'arrow.core.raise.fold' call
3746
+ // Inline function 'kotlin.contracts.contract' call
3747
+ var tmp$ret$11;
3748
+ // Inline function 'arrow.core.raise.fold' call
3749
+ // Inline function 'kotlin.contracts.contract' call
3750
+ var raise = new DefaultRaise(false);
3751
+ var tmp;
3752
+ try {
3753
+ var tmp$ret$8;
3754
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3755
+ var tmp$ret$7;
3756
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>' call
3757
+ _this__u8e3s4.bl();
3758
+ log(_this__u8e3s4.zk_1, $this);
3759
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3760
+ var tmp_0;
3761
+ if (tmp0_subject instanceof CustomType) {
3762
+ var tmp$ret$4;
3763
+ // Inline function 'kotlin.apply' call
3764
+ var tmp$ret$0;
3765
+ // Inline function 'kotlin.collections.mutableListOf' call
3766
+ tmp$ret$0 = ArrayList_init_$Create$();
3767
+ var tmp0_apply = tmp$ret$0;
3768
+ // Inline function 'kotlin.contracts.contract' call
3769
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>' call
3770
+ tmp0_apply.a(_this__u8e3s4.zk_1.qk_1);
3771
+ _this__u8e3s4.bl();
3772
+ while (equals(_this__u8e3s4.zk_1.pk_1, Comma_getInstance())) {
3773
+ _this__u8e3s4.bl();
3774
+ var tmp0_subject_0 = _this__u8e3s4.zk_1.pk_1;
3775
+ if (tmp0_subject_0 instanceof CustomType) {
3776
+ var tmp$ret$1;
3777
+ // Inline function 'kotlin.also' call
3778
+ var tmp0_also = tmp0_apply.a(_this__u8e3s4.zk_1.qk_1);
3779
+ // Inline function 'kotlin.contracts.contract' call
3780
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>.<anonymous>' call
3781
+ _this__u8e3s4.bl();
3782
+ tmp$ret$1 = tmp0_also;
3783
+ } else {
3784
+ var tmp$ret$3;
3785
+ // Inline function 'arrow.core.nel' call
3786
+ var tmp$ret$2;
3787
+ // Inline function 'kotlin.also' call
3788
+ var tmp1_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3789
+ // Inline function 'kotlin.contracts.contract' call
3790
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>.<anonymous>' call
3791
+ _this__u8e3s4.bl();
3792
+ tmp$ret$2 = tmp1_also;
3793
+ var tmp2_nel = tmp$ret$2;
3794
+ tmp$ret$3 = nonEmptyListOf(tmp2_nel, []);
3795
+ raise.bh(tmp$ret$3);
3796
+ }
3797
+ }
3798
+ tmp$ret$4 = tmp0_apply;
3799
+ tmp_0 = tmp$ret$4;
3800
+ } else {
3801
+ var tmp$ret$6;
3802
+ // Inline function 'arrow.core.nel' call
3803
+ var tmp$ret$5;
3804
+ // Inline function 'kotlin.also' call
3805
+ var tmp1_also_0 = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3806
+ // Inline function 'kotlin.contracts.contract' call
3807
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>' call
3808
+ _this__u8e3s4.bl();
3809
+ tmp$ret$5 = tmp1_also_0;
3810
+ var tmp2_nel_0 = tmp$ret$5;
3811
+ tmp$ret$6 = nonEmptyListOf(tmp2_nel_0, []);
3812
+ raise.bh(tmp$ret$6);
3813
+ }
3814
+ tmp$ret$7 = toSet(tmp_0);
3815
+ tmp$ret$8 = tmp$ret$7;
3816
+ var res = tmp$ret$8;
3817
+ raise.zg();
3818
+ var tmp$ret$9;
3819
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3820
+ tmp$ret$9 = new Right(res);
3821
+ tmp = tmp$ret$9;
3822
+ } catch ($p) {
3823
+ var tmp_1;
3824
+ if ($p instanceof CancellationException) {
3825
+ var e = $p;
3826
+ raise.zg();
3827
+ var tmp$ret$10;
3828
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3829
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3830
+ tmp$ret$10 = new Left(tmp1__anonymous__uwfjfc);
3831
+ tmp_1 = tmp$ret$10;
3832
+ } else {
3833
+ if ($p instanceof Error) {
3834
+ var e_0 = $p;
3835
+ raise.zg();
3836
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3837
+ throw tmp0__anonymous__q1qw7t;
3838
+ } else {
3839
+ throw $p;
3840
+ }
3841
+ }
3842
+ tmp = tmp_1;
3843
+ }
3844
+ tmp$ret$11 = tmp;
3845
+ tmp$ret$12 = tmp$ret$11;
3846
+ tmp$ret$13 = tmp$ret$12;
3847
+ return tmp$ret$13;
3848
+ }
3849
+ function parseRefinedTypeDeclaration(_this__u8e3s4, $this) {
3850
+ var tmp$ret$8;
3851
+ // Inline function 'arrow.core.raise.either' call
3852
+ var tmp$ret$7;
3853
+ // Inline function 'arrow.core.raise.fold' call
3854
+ // Inline function 'kotlin.contracts.contract' call
3855
+ var tmp$ret$6;
3856
+ // Inline function 'arrow.core.raise.fold' call
3857
+ // Inline function 'kotlin.contracts.contract' call
3858
+ var raise = new DefaultRaise(false);
3859
+ var tmp;
3860
+ try {
3861
+ var tmp$ret$3;
3862
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3863
+ var tmp$ret$2;
3864
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseRefinedTypeDeclaration.<anonymous>' call
3865
+ _this__u8e3s4.bl();
3866
+ log(_this__u8e3s4.zk_1, $this);
3867
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3868
+ var tmp_0;
3869
+ if (tmp0_subject instanceof CustomType) {
3870
+ tmp_0 = raise.ch(parseCustomRegex(_this__u8e3s4, $this, _this__u8e3s4.zk_1.qk_1));
3871
+ } else {
3872
+ var tmp$ret$1;
3873
+ // Inline function 'arrow.core.nel' call
3874
+ var tmp$ret$0;
3875
+ // Inline function 'kotlin.also' call
3876
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.zk_1);
3877
+ // Inline function 'kotlin.contracts.contract' call
3878
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseRefinedTypeDeclaration.<anonymous>.<anonymous>' call
3879
+ _this__u8e3s4.bl();
3880
+ tmp$ret$0 = tmp0_also;
3881
+ var tmp1_nel = tmp$ret$0;
3882
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3883
+ raise.bh(tmp$ret$1);
3884
+ }
3885
+ tmp$ret$2 = tmp_0;
3886
+ tmp$ret$3 = tmp$ret$2;
3887
+ var res = tmp$ret$3;
3888
+ raise.zg();
3889
+ var tmp$ret$4;
3890
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3891
+ tmp$ret$4 = new Right(res);
3892
+ tmp = tmp$ret$4;
3893
+ } catch ($p) {
3894
+ var tmp_1;
3895
+ if ($p instanceof CancellationException) {
3896
+ var e = $p;
3897
+ raise.zg();
3898
+ var tmp$ret$5;
3899
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3900
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3901
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3902
+ tmp_1 = tmp$ret$5;
3903
+ } else {
3904
+ if ($p instanceof Error) {
3905
+ var e_0 = $p;
3906
+ raise.zg();
3907
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3908
+ throw tmp0__anonymous__q1qw7t;
3909
+ } else {
3910
+ throw $p;
3911
+ }
3912
+ }
3913
+ tmp = tmp_1;
3914
+ }
3915
+ tmp$ret$6 = tmp;
3916
+ tmp$ret$7 = tmp$ret$6;
3917
+ tmp$ret$8 = tmp$ret$7;
3918
+ return tmp$ret$8;
3919
+ }
3920
+ function parseCustomRegex(_this__u8e3s4, $this, typeName) {
3921
+ var tmp$ret$9;
3922
+ // Inline function 'arrow.core.raise.either' call
3923
+ var tmp$ret$8;
3924
+ // Inline function 'arrow.core.raise.fold' call
3925
+ // Inline function 'kotlin.contracts.contract' call
3926
+ var tmp$ret$7;
3927
+ // Inline function 'arrow.core.raise.fold' call
3928
+ // Inline function 'kotlin.contracts.contract' call
3929
+ var raise = new DefaultRaise(false);
3930
+ var tmp;
3931
+ try {
3932
+ var tmp$ret$4;
3933
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3934
+ var tmp$ret$3;
3935
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>' call
3936
+ _this__u8e3s4.bl();
3937
+ log(_this__u8e3s4.zk_1, $this);
3938
+ var tmp$ret$2;
3939
+ // Inline function 'kotlin.also' call
3940
+ var tmp0_subject = _this__u8e3s4.zk_1.pk_1;
3941
+ var tmp_0;
3942
+ if (tmp0_subject instanceof CustomRegex) {
3943
+ tmp_0 = new Refined(typeName, new Validator(_this__u8e3s4.zk_1.qk_1));
3944
+ } else {
3945
+ var tmp$ret$1;
3946
+ // Inline function 'arrow.core.nel' call
3947
+ var tmp$ret$0;
3948
+ // Inline function 'kotlin.also' call
3949
+ var tmp0_also = new WrongTokenException(getKClass(CustomRegex), _this__u8e3s4.zk_1);
3950
+ // Inline function 'kotlin.contracts.contract' call
3951
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>.<anonymous>' call
3952
+ _this__u8e3s4.bl();
3953
+ tmp$ret$0 = tmp0_also;
3954
+ var tmp1_nel = tmp$ret$0;
3955
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3956
+ raise.bh(tmp$ret$1);
3957
+ }
3958
+ var tmp2_also = tmp_0;
3959
+ // Inline function 'kotlin.contracts.contract' call
3960
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>.<anonymous>' call
3961
+ _this__u8e3s4.bl();
3962
+ tmp$ret$2 = tmp2_also;
3963
+ tmp$ret$3 = tmp$ret$2;
3964
+ tmp$ret$4 = tmp$ret$3;
3965
+ var res = tmp$ret$4;
3966
+ raise.zg();
3967
+ var tmp$ret$5;
3968
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3969
+ tmp$ret$5 = new Right(res);
3970
+ tmp = tmp$ret$5;
3971
+ } catch ($p) {
3972
+ var tmp_1;
3973
+ if ($p instanceof CancellationException) {
3974
+ var e = $p;
3975
+ raise.zg();
3976
+ var tmp$ret$6;
3977
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3978
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3979
+ tmp$ret$6 = new Left(tmp1__anonymous__uwfjfc);
3980
+ tmp_1 = tmp$ret$6;
3981
+ } else {
3982
+ if ($p instanceof Error) {
3983
+ var e_0 = $p;
3984
+ raise.zg();
3985
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3986
+ throw tmp0__anonymous__q1qw7t;
3987
+ } else {
3988
+ throw $p;
3989
+ }
3990
+ }
3991
+ tmp = tmp_1;
3992
+ }
3993
+ tmp$ret$7 = tmp;
3994
+ tmp$ret$8 = tmp$ret$7;
3995
+ tmp$ret$9 = tmp$ret$8;
3996
+ return tmp$ret$9;
3997
+ }
3998
+ function log(_this__u8e3s4, $this) {
3999
+ return $this.mh_1.ih('Parsing ' + _this__u8e3s4.pk_1 + ' at line ' + _this__u8e3s4.rk_1.sk_1 + ' position ' + _this__u8e3s4.rk_1.tk_1);
4000
+ }
4001
+ function Parser(logger) {
4002
+ this.mh_1 = logger;
4003
+ }
4004
+ protoOf(Parser).nh = function (tokens) {
4005
+ var tmp$ret$2;
4006
+ // Inline function 'kotlin.collections.filterNot' call
4007
+ var tmp$ret$1;
4008
+ // Inline function 'kotlin.collections.filterNotTo' call
4009
+ var tmp0_filterNotTo = ArrayList_init_$Create$();
4010
+ var tmp0_iterator = tokens.c();
4011
+ while (tmp0_iterator.d()) {
4012
+ var element = tmp0_iterator.e();
4013
+ var tmp$ret$0;
4014
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>' call
4015
+ var tmp = element.pk_1;
4016
+ tmp$ret$0 = isInterface(tmp, WhiteSpace);
4017
+ if (!tmp$ret$0) {
4018
+ tmp0_filterNotTo.a(element);
4019
+ }
4020
+ }
4021
+ tmp$ret$1 = tmp0_filterNotTo;
4022
+ tmp$ret$2 = tmp$ret$1;
4023
+ return parse(toProvider(tmp$ret$2, this.mh_1), this);
4024
+ };
4025
+ function printTokens($this, previousToken) {
4026
+ var tmp$ret$6;
4027
+ // Inline function 'kotlin.run' call
4028
+ // Inline function 'kotlin.contracts.contract' call
4029
+ var tmp0_safe_receiver = previousToken;
4030
+ var tmp;
4031
+ if (tmp0_safe_receiver == null) {
4032
+ tmp = null;
4033
+ } else {
4034
+ var tmp$ret$1;
4035
+ // Inline function 'kotlin.run' call
4036
+ // Inline function 'kotlin.contracts.contract' call
4037
+ var tmp$ret$0;
4038
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4039
+ tmp$ret$0 = "Eating: '" + tmp0_safe_receiver.qk_1 + "', ";
4040
+ tmp$ret$1 = tmp$ret$0;
4041
+ tmp = tmp$ret$1;
4042
+ }
4043
+ var tmp1_elvis_lhs = tmp;
4044
+ var prev = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
4045
+ var tmp$ret$3;
4046
+ // Inline function 'kotlin.run' call
4047
+ var tmp0_run = $this.zk_1;
4048
+ // Inline function 'kotlin.contracts.contract' call
4049
+ var tmp$ret$2;
4050
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4051
+ tmp$ret$2 = "Current: '" + tmp0_run.qk_1 + "'";
4052
+ tmp$ret$3 = tmp$ret$2;
4053
+ var curr = tmp$ret$3;
4054
+ var tmp2_safe_receiver = $this.al_1;
4055
+ var tmp_0;
4056
+ if (tmp2_safe_receiver == null) {
4057
+ tmp_0 = null;
4058
+ } else {
4059
+ var tmp$ret$5;
4060
+ // Inline function 'kotlin.run' call
4061
+ // Inline function 'kotlin.contracts.contract' call
4062
+ var tmp$ret$4;
4063
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4064
+ tmp$ret$4 = ", Next: '" + tmp2_safe_receiver.qk_1 + "'";
4065
+ tmp$ret$5 = tmp$ret$4;
4066
+ tmp_0 = tmp$ret$5;
4067
+ }
4068
+ var tmp3_elvis_lhs = tmp_0;
4069
+ var next = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
4070
+ $this.xk_1.ih(prev + curr + next);
4071
+ tmp$ret$6 = Unit_getInstance();
4072
+ return tmp$ret$6;
4073
+ }
4074
+ function printTokens$default($this, previousToken, $super) {
4075
+ previousToken = previousToken === VOID ? null : previousToken;
4076
+ return printTokens($this, previousToken);
4077
+ }
4078
+ function nextToken($this) {
4079
+ var tmp$ret$4;
4080
+ // Inline function 'kotlin.Result.getOrNull' call
4081
+ var tmp$ret$3;
4082
+ // Inline function 'kotlin.runCatching' call
4083
+ var tmp;
4084
+ try {
4085
+ var tmp$ret$1;
4086
+ // Inline function 'kotlin.Companion.success' call
4087
+ var tmp0_success = Companion_getInstance();
4088
+ var tmp$ret$0;
4089
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.nextToken.<anonymous>' call
4090
+ tmp$ret$0 = $this.yk_1.e();
4091
+ var tmp1_success = tmp$ret$0;
4092
+ tmp$ret$1 = _Result___init__impl__xyqfz8(tmp1_success);
4093
+ tmp = tmp$ret$1;
4094
+ } catch ($p) {
4095
+ var tmp_0;
4096
+ if ($p instanceof Error) {
4097
+ var e = $p;
4098
+ var tmp$ret$2;
4099
+ // Inline function 'kotlin.Companion.failure' call
4100
+ var tmp2_failure = Companion_getInstance();
4101
+ tmp$ret$2 = _Result___init__impl__xyqfz8(createFailure(e));
4102
+ tmp_0 = tmp$ret$2;
4103
+ } else {
4104
+ throw $p;
4105
+ }
4106
+ tmp = tmp_0;
4107
+ }
4108
+ tmp$ret$3 = tmp;
4109
+ var tmp3_getOrNull = tmp$ret$3;
4110
+ var tmp_1;
4111
+ if (_Result___get_isFailure__impl__jpiriv(tmp3_getOrNull)) {
4112
+ tmp_1 = null;
4113
+ } else {
4114
+ var tmp_2 = _Result___get_value__impl__bjfvqg(tmp3_getOrNull);
4115
+ tmp_1 = (tmp_2 == null ? true : isObject(tmp_2)) ? tmp_2 : THROW_CCE();
4116
+ }
4117
+ tmp$ret$4 = tmp_1;
4118
+ return tmp$ret$4;
4119
+ }
4120
+ function TokenProvider(logger, tokenIterator) {
4121
+ this.xk_1 = logger;
4122
+ this.yk_1 = tokenIterator;
4123
+ var tmp = this;
4124
+ var tmp0_elvis_lhs = nextToken(this);
4125
+ var tmp_0;
4126
+ if (tmp0_elvis_lhs == null) {
4127
+ throw new StartingException();
4128
+ } else {
4129
+ tmp_0 = tmp0_elvis_lhs;
4130
+ }
4131
+ tmp.zk_1 = tmp_0;
4132
+ this.al_1 = nextToken(this);
4133
+ printTokens$default(this);
4134
+ }
4135
+ protoOf(TokenProvider).d = function () {
4136
+ return !(this.al_1 == null);
4137
+ };
4138
+ protoOf(TokenProvider).bl = function () {
4139
+ var previousToken = this.zk_1;
4140
+ var tmp = this;
4141
+ var tmp0_elvis_lhs = this.al_1;
4142
+ var tmp_0;
4143
+ if (tmp0_elvis_lhs == null) {
4144
+ throw new NextException(previousToken.rk_1);
4145
+ } else {
4146
+ tmp_0 = tmp0_elvis_lhs;
4147
+ }
4148
+ tmp.zk_1 = tmp_0;
4149
+ this.al_1 = nextToken(this);
4150
+ printTokens(this, previousToken);
4151
+ };
4152
+ function toProvider(_this__u8e3s4, logger) {
4153
+ return new TokenProvider(logger, _this__u8e3s4.c());
4154
+ }
4155
+ function IdxAndLength(idx, length) {
4156
+ idx = idx === VOID ? 0 : idx;
4157
+ length = length === VOID ? 0 : length;
4158
+ this.cl_1 = idx;
4159
+ this.dl_1 = length;
4160
+ }
4161
+ protoOf(IdxAndLength).toString = function () {
4162
+ return 'IdxAndLength(idx=' + this.cl_1 + ', length=' + this.dl_1 + ')';
4163
+ };
4164
+ protoOf(IdxAndLength).hashCode = function () {
4165
+ var result = this.cl_1;
4166
+ result = imul(result, 31) + this.dl_1 | 0;
4167
+ return result;
4168
+ };
4169
+ protoOf(IdxAndLength).equals = function (other) {
4170
+ if (this === other)
4171
+ return true;
4172
+ if (!(other instanceof IdxAndLength))
4173
+ return false;
4174
+ var tmp0_other_with_cast = other instanceof IdxAndLength ? other : THROW_CCE();
4175
+ if (!(this.cl_1 === tmp0_other_with_cast.cl_1))
4176
+ return false;
4177
+ if (!(this.dl_1 === tmp0_other_with_cast.dl_1))
4178
+ return false;
4179
+ return true;
4180
+ };
4181
+ function Coordinates(line, position, idxAndLength) {
4182
+ line = line === VOID ? 1 : line;
4183
+ position = position === VOID ? 1 : position;
4184
+ idxAndLength = idxAndLength === VOID ? new IdxAndLength() : idxAndLength;
4185
+ this.sk_1 = line;
4186
+ this.tk_1 = position;
4187
+ this.uk_1 = idxAndLength;
4188
+ }
4189
+ protoOf(Coordinates).el = function (line, position, idxAndLength) {
4190
+ return new Coordinates(line, position, idxAndLength);
4191
+ };
4192
+ protoOf(Coordinates).fl = function (line, position, idxAndLength, $super) {
4193
+ line = line === VOID ? this.sk_1 : line;
4194
+ position = position === VOID ? this.tk_1 : position;
4195
+ idxAndLength = idxAndLength === VOID ? this.uk_1 : idxAndLength;
4196
+ return $super === VOID ? this.el(line, position, idxAndLength) : $super.el.call(this, line, position, idxAndLength);
4197
+ };
4198
+ protoOf(Coordinates).toString = function () {
4199
+ return 'Coordinates(line=' + this.sk_1 + ', position=' + this.tk_1 + ', idxAndLength=' + this.uk_1 + ')';
4200
+ };
4201
+ protoOf(Coordinates).hashCode = function () {
4202
+ var result = this.sk_1;
4203
+ result = imul(result, 31) + this.tk_1 | 0;
4204
+ result = imul(result, 31) + this.uk_1.hashCode() | 0;
4205
+ return result;
4206
+ };
4207
+ protoOf(Coordinates).equals = function (other) {
4208
+ if (this === other)
4209
+ return true;
4210
+ if (!(other instanceof Coordinates))
4211
+ return false;
4212
+ var tmp0_other_with_cast = other instanceof Coordinates ? other : THROW_CCE();
4213
+ if (!(this.sk_1 === tmp0_other_with_cast.sk_1))
4214
+ return false;
4215
+ if (!(this.tk_1 === tmp0_other_with_cast.tk_1))
4216
+ return false;
4217
+ if (!this.uk_1.equals(tmp0_other_with_cast.uk_1))
4218
+ return false;
4219
+ return true;
4220
+ };
4221
+ function Token(type, value, coordinates) {
4222
+ this.pk_1 = type;
4223
+ this.qk_1 = value;
4224
+ this.rk_1 = coordinates;
4225
+ }
4226
+ protoOf(Token).gl = function (type, value, coordinates) {
4227
+ return new Token(type, value, coordinates);
4228
+ };
4229
+ protoOf(Token).wk = function (type, value, coordinates, $super) {
4230
+ type = type === VOID ? this.pk_1 : type;
4231
+ value = value === VOID ? this.qk_1 : value;
4232
+ coordinates = coordinates === VOID ? this.rk_1 : coordinates;
4233
+ return $super === VOID ? this.gl(type, value, coordinates) : $super.gl.call(this, type, value, coordinates);
4234
+ };
4235
+ protoOf(Token).toString = function () {
4236
+ return 'Token(type=' + this.pk_1 + ', value=' + this.qk_1 + ', coordinates=' + this.rk_1 + ')';
4237
+ };
4238
+ protoOf(Token).hashCode = function () {
4239
+ var result = hashCode(this.pk_1);
4240
+ result = imul(result, 31) + getStringHashCode(this.qk_1) | 0;
4241
+ result = imul(result, 31) + this.rk_1.hashCode() | 0;
4242
+ return result;
4243
+ };
4244
+ protoOf(Token).equals = function (other) {
4245
+ if (this === other)
4246
+ return true;
4247
+ if (!(other instanceof Token))
4248
+ return false;
4249
+ var tmp0_other_with_cast = other instanceof Token ? other : THROW_CCE();
4250
+ if (!equals(this.pk_1, tmp0_other_with_cast.pk_1))
4251
+ return false;
4252
+ if (!(this.qk_1 === tmp0_other_with_cast.qk_1))
4253
+ return false;
4254
+ if (!this.rk_1.equals(tmp0_other_with_cast.rk_1))
4255
+ return false;
4256
+ return true;
4257
+ };
4258
+ function plus_1(_this__u8e3s4, length) {
4259
+ return new IdxAndLength(_this__u8e3s4.cl_1 + length | 0, length);
4260
+ }
4261
+ function plus_2(_this__u8e3s4, length) {
4262
+ return _this__u8e3s4.fl(VOID, _this__u8e3s4.tk_1 + length | 0, plus_1(_this__u8e3s4.uk_1, length));
4263
+ }
4264
+ function tokenize(_this__u8e3s4, source) {
4265
+ var tmp$ret$1;
4266
+ // Inline function 'kotlin.let' call
4267
+ var tmp0_let = tokenize_0(_this__u8e3s4, source, emptyList());
4268
+ // Inline function 'kotlin.contracts.contract' call
4269
+ var tmp$ret$0;
4270
+ // Inline function 'community.flock.wirespec.compiler.core.tokenize.tokenize.<anonymous>' call
4271
+ var tmp = EndOfProgram_getInstance();
4272
+ EndOfProgram_getInstance();
4273
+ var tmp_0 = lastCoordinates(tmp0_let);
4274
+ var tmp_1 = EndOfProgram_getInstance();
4275
+ EndOfProgram_getInstance();
4276
+ tmp$ret$0 = plus_0(tmp0_let, new Token(tmp, 'EOP', nextCoordinates(tmp_0, tmp_1, 'EOP')));
4277
+ tmp$ret$1 = tmp$ret$0;
4278
+ return tmp$ret$1;
4279
+ }
4280
+ function nextCoordinates(_this__u8e3s4, type, value) {
4281
+ var tmp0_subject = type;
4282
+ var tmp;
4283
+ if (tmp0_subject instanceof NewLine) {
4284
+ tmp = new Coordinates(_this__u8e3s4.sk_1 + 1 | 0, VOID, plus_1(_this__u8e3s4.uk_1, value.length));
4285
+ } else {
4286
+ tmp = plus_2(_this__u8e3s4, value.length);
4287
+ }
4288
+ return tmp;
4289
+ }
4290
+ function lastCoordinates(_this__u8e3s4) {
4291
+ var tmp0_safe_receiver = lastOrNull(_this__u8e3s4);
4292
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.rk_1;
4293
+ return tmp1_elvis_lhs == null ? new Coordinates() : tmp1_elvis_lhs;
4294
+ }
4295
+ function tokenize_0(_this__u8e3s4, source, tokens) {
4296
+ var $this = _this__u8e3s4;
4297
+ var source_0 = source;
4298
+ var tokens_0 = tokens;
4299
+ $l$1: do {
4300
+ $l$0: do {
4301
+ var token = findToken($this, lastCoordinates(tokens_0), source_0);
4302
+ var newSource = removePrefix(source_0, token.qk_1);
4303
+ var newTokens = plus_0(tokens_0, token);
4304
+ var tmp;
4305
+ var tmp$ret$0;
4306
+ // Inline function 'kotlin.text.isEmpty' call
4307
+ tmp$ret$0 = charSequenceLength(newSource) === 0;
4308
+ if (tmp$ret$0) {
4309
+ tmp = newTokens;
4310
+ } else {
4311
+ var tmp0 = $this;
4312
+ var tmp1 = newSource;
4313
+ var tmp2 = newTokens;
4314
+ $this = tmp0;
4315
+ source_0 = tmp1;
4316
+ tokens_0 = tmp2;
4317
+ continue $l$0;
4318
+ }
4319
+ return tmp;
4320
+ }
4321
+ while (false);
4322
+ }
4323
+ while (true);
4324
+ }
4325
+ function findToken(_this__u8e3s4, previousTokenCoordinates, source) {
4326
+ var tmp$ret$2;
4327
+ // Inline function 'kotlin.collections.firstNotNullOf' call
4328
+ var tmp0_firstNotNullOf = _this__u8e3s4.sh();
4329
+ var tmp$ret$1;
4330
+ $l$block: {
4331
+ // Inline function 'kotlin.collections.firstNotNullOfOrNull' call
4332
+ var tmp0_iterator = tmp0_firstNotNullOf.c();
4333
+ while (tmp0_iterator.d()) {
4334
+ var element = tmp0_iterator.e();
4335
+ var tmp$ret$0;
4336
+ // Inline function 'community.flock.wirespec.compiler.core.tokenize.findToken.<anonymous>' call
4337
+ var regex = element.i3();
4338
+ var tokenType = element.j3();
4339
+ var tmp0_safe_receiver = regex.ae(source);
4340
+ tmp$ret$0 = tmp0_safe_receiver == null ? null : toToken(tmp0_safe_receiver, tokenType, previousTokenCoordinates);
4341
+ var result = tmp$ret$0;
4342
+ if (!(result == null)) {
4343
+ tmp$ret$1 = result;
4344
+ break $l$block;
4345
+ }
4346
+ }
4347
+ tmp$ret$1 = null;
4348
+ }
4349
+ var tmp0_elvis_lhs = tmp$ret$1;
4350
+ var tmp;
4351
+ if (tmp0_elvis_lhs == null) {
4352
+ throw NoSuchElementException_init_$Create$('No element of the collection was transformed to a non-null value.');
4353
+ } else {
4354
+ tmp = tmp0_elvis_lhs;
4355
+ }
4356
+ tmp$ret$2 = tmp;
4357
+ return tmp$ret$2;
4358
+ }
4359
+ function toToken(_this__u8e3s4, type, previousTokenCoordinates) {
4360
+ return new Token(type, _this__u8e3s4.w(), nextCoordinates(previousTokenCoordinates, type, _this__u8e3s4.w()));
4361
+ }
4362
+ function TokenType() {
4363
+ }
4364
+ function WsTypeDef() {
4365
+ WsTypeDef_instance = this;
4366
+ }
4367
+ var WsTypeDef_instance;
4368
+ function WsTypeDef_getInstance() {
4369
+ if (WsTypeDef_instance == null)
4370
+ new WsTypeDef();
4371
+ return WsTypeDef_instance;
4372
+ }
4373
+ function WsEnumTypeDef() {
4374
+ WsEnumTypeDef_instance = this;
4375
+ }
4376
+ var WsEnumTypeDef_instance;
4377
+ function WsEnumTypeDef_getInstance() {
4378
+ if (WsEnumTypeDef_instance == null)
4379
+ new WsEnumTypeDef();
4380
+ return WsEnumTypeDef_instance;
4381
+ }
4382
+ function WsRefinedTypeDef() {
4383
+ WsRefinedTypeDef_instance = this;
4384
+ }
4385
+ var WsRefinedTypeDef_instance;
4386
+ function WsRefinedTypeDef_getInstance() {
4387
+ if (WsRefinedTypeDef_instance == null)
4388
+ new WsRefinedTypeDef();
4389
+ return WsRefinedTypeDef_instance;
4390
+ }
4391
+ function WhiteSpaceExceptNewLine() {
4392
+ WhiteSpaceExceptNewLine_instance = this;
4393
+ }
4394
+ var WhiteSpaceExceptNewLine_instance;
4395
+ function WhiteSpaceExceptNewLine_getInstance() {
4396
+ if (WhiteSpaceExceptNewLine_instance == null)
4397
+ new WhiteSpaceExceptNewLine();
4398
+ return WhiteSpaceExceptNewLine_instance;
4399
+ }
4400
+ function NewLine() {
4401
+ NewLine_instance = this;
4402
+ }
4403
+ var NewLine_instance;
4404
+ function NewLine_getInstance() {
4405
+ if (NewLine_instance == null)
4406
+ new NewLine();
4407
+ return NewLine_instance;
4408
+ }
4409
+ function LeftCurly() {
4410
+ LeftCurly_instance = this;
4411
+ }
4412
+ var LeftCurly_instance;
4413
+ function LeftCurly_getInstance() {
4414
+ if (LeftCurly_instance == null)
4415
+ new LeftCurly();
4416
+ return LeftCurly_instance;
4417
+ }
4418
+ function Colon() {
4419
+ Colon_instance = this;
4420
+ }
4421
+ var Colon_instance;
4422
+ function Colon_getInstance() {
4423
+ if (Colon_instance == null)
4424
+ new Colon();
4425
+ return Colon_instance;
4426
+ }
4427
+ function Comma() {
4428
+ Comma_instance = this;
4429
+ }
4430
+ var Comma_instance;
4431
+ function Comma_getInstance() {
4432
+ if (Comma_instance == null)
4433
+ new Comma();
4434
+ return Comma_instance;
4435
+ }
4436
+ function QuestionMark() {
4437
+ QuestionMark_instance = this;
4438
+ }
4439
+ var QuestionMark_instance;
4440
+ function QuestionMark_getInstance() {
4441
+ if (QuestionMark_instance == null)
4442
+ new QuestionMark();
4443
+ return QuestionMark_instance;
4444
+ }
4445
+ function Brackets() {
4446
+ Brackets_instance = this;
4447
+ }
4448
+ var Brackets_instance;
4449
+ function Brackets_getInstance() {
4450
+ if (Brackets_instance == null)
4451
+ new Brackets();
4452
+ return Brackets_instance;
4453
+ }
4454
+ function WsString() {
4455
+ WsString_instance = this;
4456
+ }
4457
+ var WsString_instance;
4458
+ function WsString_getInstance() {
4459
+ if (WsString_instance == null)
4460
+ new WsString();
4461
+ return WsString_instance;
4462
+ }
4463
+ function WsInteger() {
4464
+ WsInteger_instance = this;
4465
+ }
4466
+ var WsInteger_instance;
4467
+ function WsInteger_getInstance() {
4468
+ if (WsInteger_instance == null)
4469
+ new WsInteger();
4470
+ return WsInteger_instance;
4471
+ }
4472
+ function WsBoolean() {
4473
+ WsBoolean_instance = this;
4474
+ }
4475
+ var WsBoolean_instance;
4476
+ function WsBoolean_getInstance() {
4477
+ if (WsBoolean_instance == null)
4478
+ new WsBoolean();
4479
+ return WsBoolean_instance;
4480
+ }
4481
+ function RightCurly() {
4482
+ RightCurly_instance = this;
4483
+ }
4484
+ var RightCurly_instance;
4485
+ function RightCurly_getInstance() {
4486
+ if (RightCurly_instance == null)
4487
+ new RightCurly();
4488
+ return RightCurly_instance;
4489
+ }
4490
+ function CustomValue() {
4491
+ CustomValue_instance = this;
4492
+ }
4493
+ var CustomValue_instance;
4494
+ function CustomValue_getInstance() {
4495
+ if (CustomValue_instance == null)
4496
+ new CustomValue();
4497
+ return CustomValue_instance;
4498
+ }
4499
+ function CustomType() {
4500
+ CustomType_instance = this;
4501
+ }
4502
+ var CustomType_instance;
4503
+ function CustomType_getInstance() {
4504
+ if (CustomType_instance == null)
4505
+ new CustomType();
4506
+ return CustomType_instance;
4507
+ }
4508
+ function CustomRegex() {
4509
+ CustomRegex_instance = this;
4510
+ }
4511
+ var CustomRegex_instance;
4512
+ function CustomRegex_getInstance() {
4513
+ if (CustomRegex_instance == null)
4514
+ new CustomRegex();
4515
+ return CustomRegex_instance;
4516
+ }
4517
+ function Invalid() {
4518
+ Invalid_instance = this;
4519
+ }
4520
+ var Invalid_instance;
4521
+ function Invalid_getInstance() {
4522
+ if (Invalid_instance == null)
4523
+ new Invalid();
4524
+ return Invalid_instance;
4525
+ }
4526
+ function EndOfProgram() {
4527
+ EndOfProgram_instance = this;
4528
+ this.il_1 = 'EOP';
4529
+ }
4530
+ var EndOfProgram_instance;
4531
+ function EndOfProgram_getInstance() {
4532
+ if (EndOfProgram_instance == null)
4533
+ new EndOfProgram();
4534
+ return EndOfProgram_instance;
4535
+ }
4536
+ function WhiteSpace() {
4537
+ }
4538
+ function WsType() {
4539
+ }
4540
+ function validate(_this__u8e3s4) {
4541
+ return _this__u8e3s4;
4542
+ }
4543
+ function get_noLogger() {
4544
+ _init_properties_Logger_kt__mpqsw();
4545
+ return noLogger;
4546
+ }
4547
+ var noLogger;
4548
+ function Logger(enableLogging) {
4549
+ this.hh_1 = enableLogging;
4550
+ }
4551
+ protoOf(Logger).ih = function (s) {
4552
+ var tmp;
4553
+ if (this.hh_1) {
4554
+ println(s);
4555
+ tmp = Unit_getInstance();
4556
+ } else {
4557
+ tmp = Unit_getInstance();
4558
+ }
4559
+ return tmp;
4560
+ };
4561
+ protoOf(Logger).ok = function (s, block) {
4562
+ var tmp$ret$1;
4563
+ // Inline function 'kotlin.run' call
4564
+ // Inline function 'kotlin.contracts.contract' call
4565
+ var tmp$ret$0;
4566
+ // Inline function 'community.flock.wirespec.compiler.utils.Logger.log.<anonymous>' call
4567
+ this.ih(s);
4568
+ tmp$ret$0 = block();
4569
+ tmp$ret$1 = tmp$ret$0;
4570
+ return tmp$ret$1;
4571
+ };
4572
+ function noLogger$1() {
4573
+ Logger.call(this, false);
4574
+ }
4575
+ var properties_initialized_Logger_kt_6n8a9a;
4576
+ function _init_properties_Logger_kt__mpqsw() {
4577
+ if (properties_initialized_Logger_kt_6n8a9a) {
4578
+ } else {
4579
+ properties_initialized_Logger_kt_6n8a9a = true;
4580
+ noLogger = new noLogger$1();
4581
+ }
4582
+ }
4583
+ //region block: post-declaration
4584
+ protoOf(JavaEmitter).rj = withLogging;
4585
+ protoOf(JavaEmitter).sj = withLogging_0;
4586
+ protoOf(JavaEmitter).tj = withLogging_1;
4587
+ protoOf(JavaEmitter).uj = withLogging_2;
4588
+ protoOf(JavaEmitter).th = withLogging_3;
4589
+ protoOf(JavaEmitter).wj = withLogging_4;
4590
+ protoOf(JavaEmitter).yj = withLogging_5;
4591
+ protoOf(JavaEmitter).zj = withLogging_6;
4592
+ protoOf(JavaEmitter).bk = withLogging_7;
4593
+ protoOf(JavaEmitter).ri = withLogging_8;
4594
+ protoOf(KotlinEmitter).rj = withLogging;
4595
+ protoOf(KotlinEmitter).sj = withLogging_0;
4596
+ protoOf(KotlinEmitter).tj = withLogging_1;
4597
+ protoOf(KotlinEmitter).uj = withLogging_2;
4598
+ protoOf(KotlinEmitter).th = withLogging_3;
4599
+ protoOf(KotlinEmitter).wj = withLogging_4;
4600
+ protoOf(KotlinEmitter).yj = withLogging_5;
4601
+ protoOf(KotlinEmitter).zj = withLogging_6;
4602
+ protoOf(KotlinEmitter).bk = withLogging_7;
4603
+ protoOf(KotlinEmitter).ri = withLogging_8;
4604
+ protoOf(ScalaEmitter).rj = withLogging;
4605
+ protoOf(ScalaEmitter).sj = withLogging_0;
4606
+ protoOf(ScalaEmitter).tj = withLogging_1;
4607
+ protoOf(ScalaEmitter).uj = withLogging_2;
4608
+ protoOf(ScalaEmitter).th = withLogging_3;
4609
+ protoOf(ScalaEmitter).wj = withLogging_4;
4610
+ protoOf(ScalaEmitter).yj = withLogging_5;
4611
+ protoOf(ScalaEmitter).zj = withLogging_6;
4612
+ protoOf(ScalaEmitter).bk = withLogging_7;
4613
+ protoOf(TypeScriptEmitter).rj = withLogging;
4614
+ protoOf(TypeScriptEmitter).sj = withLogging_0;
4615
+ protoOf(TypeScriptEmitter).tj = withLogging_1;
4616
+ protoOf(TypeScriptEmitter).uj = withLogging_2;
4617
+ protoOf(TypeScriptEmitter).th = withLogging_3;
4618
+ protoOf(TypeScriptEmitter).wj = withLogging_4;
4619
+ protoOf(TypeScriptEmitter).yj = withLogging_5;
4620
+ protoOf(TypeScriptEmitter).zj = withLogging_6;
4621
+ protoOf(TypeScriptEmitter).bk = withLogging_7;
4622
+ protoOf(WirespecEmitter).rj = withLogging;
4623
+ protoOf(WirespecEmitter).sj = withLogging_0;
4624
+ protoOf(WirespecEmitter).tj = withLogging_1;
4625
+ protoOf(WirespecEmitter).uj = withLogging_2;
4626
+ protoOf(WirespecEmitter).th = withLogging_3;
4627
+ protoOf(WirespecEmitter).wj = withLogging_4;
4628
+ protoOf(WirespecEmitter).yj = withLogging_5;
4629
+ protoOf(WirespecEmitter).zj = withLogging_6;
4630
+ protoOf(WirespecEmitter).bk = withLogging_7;
4631
+ protoOf(WsTypeDef).hl = name;
4632
+ protoOf(WsEnumTypeDef).hl = name;
4633
+ protoOf(WsRefinedTypeDef).hl = name;
4634
+ protoOf(WhiteSpaceExceptNewLine).hl = name;
4635
+ protoOf(NewLine).hl = name;
4636
+ protoOf(LeftCurly).hl = name;
4637
+ protoOf(Colon).hl = name;
4638
+ protoOf(Comma).hl = name;
4639
+ protoOf(QuestionMark).hl = name;
4640
+ protoOf(Brackets).hl = name;
4641
+ protoOf(WsString).hl = name;
4642
+ protoOf(WsInteger).hl = name;
4643
+ protoOf(WsBoolean).hl = name;
4644
+ protoOf(RightCurly).hl = name;
4645
+ protoOf(CustomValue).hl = name;
4646
+ protoOf(CustomType).hl = name;
4647
+ protoOf(CustomRegex).hl = name;
4648
+ protoOf(Invalid).hl = name;
4649
+ protoOf(EndOfProgram).hl = name;
4650
+ //endregion
4651
+ //region block: init
4652
+ DEFAULT_PACKAGE_NAME = 'community.flock.wirespec.generated';
4653
+ //endregion
4654
+ //region block: exports
4655
+ _.$_$ = _.$_$ || {};
4656
+ _.$_$.a = get_DEFAULT_PACKAGE_NAME;
4657
+ _.$_$.b = JavaEmitter;
4658
+ _.$_$.c = KotlinEmitter;
4659
+ _.$_$.d = ScalaEmitter;
4660
+ _.$_$.e = TypeScriptEmitter;
4661
+ _.$_$.f = WirespecEmitter;
4662
+ _.$_$.g = Content;
4663
+ _.$_$.h = values;
4664
+ _.$_$.i = Request;
4665
+ _.$_$.j = Response;
4666
+ _.$_$.k = Literal;
4667
+ _.$_$.l = Param;
4668
+ _.$_$.m = Endpoint;
4669
+ _.$_$.n = Parser;
4670
+ _.$_$.o = Identifier;
4671
+ _.$_$.p = Custom;
4672
+ _.$_$.q = Primitive;
4673
+ _.$_$.r = Field;
4674
+ _.$_$.s = Shape;
4675
+ _.$_$.t = Type_0;
4676
+ _.$_$.u = tokenize;
4677
+ _.$_$.v = compile;
4678
+ _.$_$.w = Logger;
4679
+ _.$_$.x = Type_Boolean_getInstance;
4680
+ _.$_$.y = Type_Integer_getInstance;
4681
+ _.$_$.z = Type_String_getInstance;
4682
+ _.$_$.a1 = Wirespec_getInstance;
4683
+ //endregion
4684
+ return _;
4685
+ }));
4686
+
4687
+ //# sourceMappingURL=wirespec-core.js.map