@flock/wirespec 0.22.4 → 0.22.6

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 (49) hide show
  1. package/arrow-arrow-core.mjs +13 -8
  2. package/arrow-arrow-core.mjs.map +1 -1
  3. package/clikt-clikt-mordant.mjs +79 -79
  4. package/clikt-clikt.mjs +1367 -1366
  5. package/clikt-clikt.mjs.map +1 -1
  6. package/colormath-root-colormath.mjs +436 -436
  7. package/kotlin-kotlin-stdlib.mjs +304 -239
  8. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  9. package/kotlin-openapi-bindings.mjs +10221 -10221
  10. package/kotlin-rgxgen.mjs +1771 -1771
  11. package/kotlinx-io-kotlinx-io-core.mjs +425 -425
  12. package/kotlinx-serialization-kotlinx-serialization-core.mjs +1824 -1824
  13. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1509 -1509
  14. package/mordant-mordant.mjs +1246 -1246
  15. package/package.json +1 -1
  16. package/wirespec-src-compiler-core.mjs +5972 -5367
  17. package/wirespec-src-compiler-core.mjs.map +1 -1
  18. package/wirespec-src-compiler-emitters-java.mjs +171 -187
  19. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  20. package/wirespec-src-compiler-emitters-kotlin.mjs +174 -165
  21. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  22. package/wirespec-src-compiler-emitters-python.mjs +147 -160
  23. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  24. package/wirespec-src-compiler-emitters-rust.mjs +356 -370
  25. package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
  26. package/wirespec-src-compiler-emitters-scala.mjs +165 -175
  27. package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
  28. package/wirespec-src-compiler-emitters-typescript.mjs +187 -313
  29. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  30. package/wirespec-src-compiler-emitters-wirespec.mjs +81 -81
  31. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  32. package/wirespec-src-compiler-lib.mjs +194 -194
  33. package/wirespec-src-converter-asyncapi.mjs +545 -545
  34. package/wirespec-src-converter-avro.mjs +570 -514
  35. package/wirespec-src-converter-avro.mjs.map +1 -1
  36. package/wirespec-src-converter-common.mjs +11 -11
  37. package/wirespec-src-converter-graphql.mjs +942 -942
  38. package/wirespec-src-converter-openapi.mjs +453 -453
  39. package/wirespec-src-ide-lsp.mjs +1359 -1359
  40. package/wirespec-src-plugin-arguments.mjs +419 -224
  41. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  42. package/wirespec-src-plugin-cli.mjs +170 -137
  43. package/wirespec-src-plugin-cli.mjs.map +1 -1
  44. package/wirespec-src-plugin-extensions.mjs +4874 -0
  45. package/wirespec-src-plugin-extensions.mjs.map +1 -0
  46. package/wirespec-src-plugin-npm.d.mts +43 -1
  47. package/wirespec-src-plugin-npm.mjs +230 -54
  48. package/wirespec-src-plugin-npm.mjs.map +1 -1
  49. package/wirespec-src-tools-generator.mjs +17 -17
@@ -0,0 +1,4874 @@
1
+ import {
2
+ toString1pkumu07cwy4m as toString,
3
+ IllegalStateException_init_$Create$1h4bcfod21ri0 as IllegalStateException_init_$Create$,
4
+ ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$,
5
+ Unit_instancev9v8hjid95df as Unit_instance,
6
+ plus310ted5e4i90h as plus,
7
+ protoOf180f3jzyo7rfj as protoOf,
8
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
9
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
10
+ split2bvyvnrlcifjv as split,
11
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
12
+ ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$_0,
13
+ checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
14
+ joinToString1cxrrlmo0chqs as joinToString,
15
+ asSequence3lsvgkvyzox0q as asSequence,
16
+ filter184huxd00uyfg as filter,
17
+ joinToStringooja5rkatz3u as joinToString_0,
18
+ firstOrNulltrxqttxfxqju as firstOrNull,
19
+ isDigit3mimrri4wkzop as isDigit,
20
+ Char19o2r8palgjof as Char,
21
+ trimMarginhyd3fsmh8iev as trimMargin,
22
+ NotImplementedErrorfzlkpv14xxr8 as NotImplementedError,
23
+ isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
24
+ _Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
25
+ listOfvhqybd2zx248 as listOf,
26
+ equals2au1ep9vhcato as equals,
27
+ emptyList1g2z5xcrvp2zy as emptyList,
28
+ to2cs3ny02qtbcb as to,
29
+ replace3le3ie7l9k8aq as replace,
30
+ Collection1k04j3hzsbod0 as Collection,
31
+ isInterface3d6p8outrmvmk as isInterface,
32
+ mutableListOf6oorvk2mtdmp as mutableListOf,
33
+ VOID3gxj6tk5isa35 as VOID,
34
+ LinkedHashSet_init_$Create$t7gzf3ihb6pk as LinkedHashSet_init_$Create$,
35
+ getKClass3t8tygqu4lcxf as getKClass,
36
+ arrayOf1akklvh2at202 as arrayOf,
37
+ createKType31ecntyyaay3k as createKType,
38
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
39
+ mapCapacity1h45rc3eh9p2l as mapCapacity,
40
+ coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
41
+ LinkedHashMap_init_$Create$1gzy1x4a46gd4 as LinkedHashMap_init_$Create$,
42
+ setOf45ia9pnfhe90 as setOf,
43
+ listOf1jh22dvmctj1r as listOf_0,
44
+ addAll1k27qatfgp3k5 as addAll,
45
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
46
+ asSequence2phdjljfh9jhx as asSequence_0,
47
+ flatMap1gb3cjy1dqv3d as flatMap,
48
+ Sequence1quqbxersk0bb as Sequence,
49
+ mapsbvh18eqox7a as map,
50
+ toSet2morh2kqexfa2 as toSet,
51
+ Enum3alwj03lh1n41 as Enum,
52
+ plus20p0vtfmu0596 as plus_0,
53
+ isCharSequence1ju9jr1w86plq as isCharSequence,
54
+ trim11nh7r46at6sx as trim,
55
+ charArrayOf27f4r3dozbrk1 as charArrayOf,
56
+ trim6jpmwojjgb3l as trim_0,
57
+ mapOf2zpbbmyqk8xpf as mapOf,
58
+ mapOf1xd03cq9cnmy8 as mapOf_0,
59
+ getStringHashCode26igk1bx568vk as getStringHashCode,
60
+ hashCodeq5arwsb9dgti as hashCode,
61
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
62
+ charSequenceLength3278n89t01tmv as charSequenceLength,
63
+ charCodeAt1yspne1d8erbm as charCodeAt,
64
+ uppercaseChar6lahngw3wvwg as uppercaseChar,
65
+ substring3saq8ornu0luv as substring,
66
+ toString22rbkbhdb5cl2 as toString_0,
67
+ StringBuilder_init_$Create$3ds9zx2kx9u4d as StringBuilder_init_$Create$,
68
+ toSet2orjxp16sotqu as toSet_0,
69
+ trimEnd17pt8cbotbalj as trimEnd,
70
+ toString30pk9tzaqopn as toString_1,
71
+ getBooleanHashCode1bbj3u6b3v0a7 as getBooleanHashCode,
72
+ firstOrNull1982767dljvdy as firstOrNull_0,
73
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
74
+ HashSet_init_$Create$2w31ptb4ree5i as HashSet_init_$Create$,
75
+ distinct10qe1scfdvu5k as distinct,
76
+ KtMap140uvy3s5zad8 as KtMap,
77
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface,
78
+ single3ds7xj9roxi5z as single,
79
+ plus2lr02ok6jhhxu as plus_1,
80
+ getValue48kllevslyh6 as getValue,
81
+ listOfNotNull2woi2boe01ub4 as listOfNotNull,
82
+ singleo93pzdgfc557 as single_0,
83
+ trimStart5ewg8zf6cs5u as trimStart,
84
+ startsWith26w8qjqapeeq6 as startsWith,
85
+ listOfNotNull1v4ggfackvuny as listOfNotNull_0,
86
+ } from './kotlin-kotlin-stdlib.mjs';
87
+ import {
88
+ NonEmptyList3ak25ihy2gcvs as NonEmptyList,
89
+ toNonEmptyListOrNull2ovnnazjb3msz as toNonEmptyListOrNull,
90
+ escaped3qm4ls9c1n1xp as escaped,
91
+ _NonEmptyList___get_all__impl__pmf5092xnz0i2teaa6d as _NonEmptyList___get_all__impl__pmf509,
92
+ _NonEmptyList___init__impl__fxd0xprpnd63likgzm as _NonEmptyList___init__impl__fxd0xp,
93
+ NonEmptyList__toList_impl_t5xcy266xhxpenbpfx as NonEmptyList__toList_impl_t5xcy2,
94
+ NonEmptyList__plus_impl_xqmb918nwrkd75m2j6 as NonEmptyList__plus_impl_xqmb9,
95
+ } from './arrow-arrow-core.mjs';
96
+ import {
97
+ JavaGenerator_getInstance1vn8n4kivtqjx as JavaGenerator_getInstance,
98
+ FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
99
+ DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
100
+ Companion_instance27ueeez2qu1l as Companion_instance,
101
+ Bytes3eoc50vgt1uem as Bytes,
102
+ Boolean1fpfi8m5jt3fg as Boolean_0,
103
+ Number1mui0heypwdhp as Number_0,
104
+ Integer39lqx4uc63u28 as Integer,
105
+ String1czvr8pxnm6on as String_0,
106
+ Primitive1i8my14jkp3nk as Primitive,
107
+ Custom1lu6o8txpimqz as Custom,
108
+ Anyv7qdq63z63rc as Any,
109
+ Unit2z95clvxm08vr as Unit,
110
+ Iterable29qbzfup67wqp as Iterable,
111
+ Dict3g7w5wia7rncj as Dict,
112
+ Bytes_instance1cqd1xiwjq94x as Bytes_instance,
113
+ Enum3l2iuc342kle6 as Enum_0,
114
+ get_fields1vhfmr41isbcc as get_fields,
115
+ Type12n1gx16iqtcu as Type,
116
+ addBackticks1di5q03fw4yhx as addBackticks,
117
+ KotlinGenerator_getInstance2e31cf8vh2zcv as KotlinGenerator_getInstance,
118
+ Name_init_$Create$19g584jeznbgc as Name_init_$Create$,
119
+ file2ll80wvxq4yo9 as file,
120
+ Companion_getInstance34fvro4h6bumb as Companion_getInstance,
121
+ RawExpressionfqemfbo6j6cq as RawExpression,
122
+ Expressiontyri3lwschqs as Expression,
123
+ ConstructorStatement1edouznvc71xv as ConstructorStatement,
124
+ VariableReferencesji1q1tq3ygo as VariableReference,
125
+ Structakfq94wrq695 as Struct,
126
+ Uniontffpdks00nyc as Union,
127
+ Field26remk4nlwax4 as Field,
128
+ RawElement3huqlgf21e29z as RawElement,
129
+ File12q75sqvz964e as File,
130
+ fieldList2mdp34yzu6ln6 as fieldList,
131
+ Custom_init_$Create$kfegfgqdjj1p as Custom_init_$Create$,
132
+ Namespacex2gpe17ntoag as Namespace,
133
+ NullableEmpty_instance3dvt16jxiwxjj as NullableEmpty_instance,
134
+ ReturnStatement2onvxq5s96j3a as ReturnStatement,
135
+ Function1wme41sk2huri as Function,
136
+ NullableOfflpxqp5wf7qq as NullableOf,
137
+ Nullable3he31tqc4yy1q as Nullable,
138
+ Visibility_PUBLIC_getInstance32vt79oefqy1j as Visibility_PUBLIC_getInstance,
139
+ Name1ijtblv1phm3y as Name,
140
+ Parameter37d5p43ul6u79 as Parameter,
141
+ FunctionCall1a3g4e6bcljl6 as FunctionCall,
142
+ FieldCall2nusnrnm7uuow as FieldCall,
143
+ convert32i7359nc4b5g as convert,
144
+ Unit_instance25jwel3twibm6 as Unit_instance_0,
145
+ Visibility_INTERNAL_getInstance22ckk1xt7us4h as Visibility_INTERNAL_getInstance,
146
+ String_instance2j5u8j0qc6lge as String_instance,
147
+ Companion_instance21vwhhqsaytqt as Companion_instance_0,
148
+ Function6mdi096lkwmv as Function_0,
149
+ escapeKotlinIdentifier3izquqyuy1mot as escapeKotlinIdentifier,
150
+ VariableReference_init_$Create$dglcn81435zt as VariableReference_init_$Create$,
151
+ Boolean_instance2uah59h3vb1ch as Boolean_instance,
152
+ Visibility_PRIVATE_getInstance26717aoqlr0nv as Visibility_PRIVATE_getInstance,
153
+ Dict27tp4weviyg4b as Dict_0,
154
+ Array2vay9bq78aua1 as Array_0,
155
+ Paramvfwnys2w6aj1 as Param,
156
+ struct1gzvysjt73bn4 as struct,
157
+ Field2nwjpxu9j2svq as Field_0,
158
+ convertToGenerator1arvbkvdv4bro as convertToGenerator,
159
+ forEachElement2kk527cjhfon1 as forEachElement,
160
+ Shape2rkbve9uak0g8 as Shape,
161
+ Package1a6hdgk3p4frd as Package,
162
+ raw1mm1rmqheq474 as raw,
163
+ Refined1lkzc0dg6wey7 as Refined,
164
+ Endpoint1jsq06yr3xdhp as Endpoint,
165
+ Channel2fhxi4a4pwb64 as Channel,
166
+ Rpc1w89psy5tk702 as Rpc,
167
+ Enumoqsp4e7al89r as Enum_1,
168
+ HasName33ghsv8lnn7sd as HasName,
169
+ Unionccsavx6nrdr2 as Union_0,
170
+ TransformScope3fhztkr2eyk36 as TransformScope,
171
+ TransformerBuilder26pbjl5nmg6wa as TransformerBuilder,
172
+ transformhd96z3w1u5uc as transform,
173
+ Element3p1xrn21d2w4b as Element,
174
+ Main3fexakddcxfff as Main,
175
+ Interface2g99rmjjt5ne as Interface,
176
+ transformChildren14suh59vxsgt as transformChildren,
177
+ Literal331hu9r04vptz as Literal,
178
+ Model1nx3had6rojzt as Model,
179
+ } from './wirespec-src-compiler-core.mjs';
180
+ import {
181
+ AvroJsonEmitter_getInstanceqxb8ioshyd02 as AvroJsonEmitter_getInstance,
182
+ Typel89stdvlxo83 as Type_0,
183
+ TypeList_init_$Create$1bhvhw1us1a8l as TypeList_init_$Create$,
184
+ UnionType3n98xd02zrhnq as UnionType,
185
+ MapTypevzpmekpvqxab as MapType,
186
+ SimpleTypenolspnvnvo3r as SimpleType,
187
+ LogicalType1elm7nlw6tr66 as LogicalType,
188
+ EnumType3tyyyxtu65wva as EnumType,
189
+ ArrayTypexditgxyp5c9c as ArrayType,
190
+ RecordType2zxu8wkaapzdc as RecordType,
191
+ } from './wirespec-src-converter-avro.mjs';
192
+ import { Default_getInstancejyc493d440j2 as Default_getInstance } from './kotlinx-serialization-kotlinx-serialization-json.mjs';
193
+ import {
194
+ serializer1i4e9ym37oxmo as serializer,
195
+ KSerializerzf77vz1967fq as KSerializer,
196
+ } from './kotlinx-serialization-kotlinx-serialization-core.mjs';
197
+ //region block: imports
198
+ var imul = Math.imul;
199
+ //endregion
200
+ //region block: pre-declaration
201
+ initMetadataForClass(AvroExtension, 'AvroExtension');
202
+ initMetadataForClass(JavaAvroSource, 'JavaAvroSource');
203
+ initMetadataForClass(KotlinAvroSource, 'KotlinAvroSource');
204
+ initMetadataForCompanion(Companion);
205
+ initMetadataForClass(JacksonExtension, 'JacksonExtension', JacksonExtension);
206
+ initMetadataForClass(Target, 'Target', VOID, Enum);
207
+ initMetadataForClass(Model_0, 'Model');
208
+ initMetadataForCompanion(Companion_0);
209
+ initMetadataForClass(JvmBuilderExtension, 'JvmBuilderExtension');
210
+ initMetadataForCompanion(Companion_1);
211
+ initMetadataForClass(ChannelShape, 'ChannelShape');
212
+ initMetadataForObject(ChannelDslFile, 'ChannelDslFile');
213
+ initMetadataForClass(Slot, 'Slot');
214
+ initMetadataForObject(EndpointDslFile, 'EndpointDslFile');
215
+ initMetadataForClass(Primitive_0, 'Primitive');
216
+ initMetadataForClass(Nested, 'Nested');
217
+ initMetadataForClass(NamedTypedField, 'NamedTypedField');
218
+ initMetadataForClass(ResponseVariantShape, 'ResponseVariantShape');
219
+ initMetadataForClass(BodyKind, 'BodyKind', VOID, Enum);
220
+ initMetadataForCompanion(Companion_2);
221
+ initMetadataForClass(EndpointShape, 'EndpointShape');
222
+ initMetadataForObject(RecordBuilder, 'RecordBuilder');
223
+ initMetadataForCompanion(Companion_3);
224
+ initMetadataForClass(RecordRef, 'RecordRef');
225
+ function wrap(expr, depth) {
226
+ var v = 'v' + depth;
227
+ var call = this.ot() ? '?.' : '.';
228
+ var tmp;
229
+ if (this instanceof Wrap) {
230
+ tmp = this.q35_1 ? expr + '?.let { ' + v + ' -> ' + this.p35_1 + '(' + v + ') }' : this.p35_1 + '(' + expr + ')';
231
+ } else {
232
+ if (this instanceof Each) {
233
+ tmp = expr + call + 'map { ' + v + ' -> ' + this.s35_1.r35(v, depth + 1 | 0) + ' }';
234
+ } else {
235
+ if (this instanceof Values) {
236
+ tmp = expr + call + 'mapValues { (_, ' + v + ') -> ' + this.u35_1.r35(v, depth + 1 | 0) + ' }';
237
+ } else {
238
+ noWhenBranchMatchedException();
239
+ }
240
+ }
241
+ }
242
+ return tmp;
243
+ }
244
+ function wrap$default(expr, depth, $super) {
245
+ depth = depth === VOID ? 0 : depth;
246
+ return $super === VOID ? this.r35(expr, depth) : wrap(expr, depth);
247
+ }
248
+ initMetadataForInterface(Refinement, 'Refinement');
249
+ initMetadataForClass(Wrap, 'Wrap', VOID, VOID, [Refinement]);
250
+ initMetadataForClass(Each, 'Each', VOID, VOID, [Refinement]);
251
+ initMetadataForClass(Values, 'Values', VOID, VOID, [Refinement]);
252
+ initMetadataForCompanion(Companion_4);
253
+ initMetadataForObject(RpcDslFile, 'RpcDslFile');
254
+ initMetadataForClass(Request, 'Request');
255
+ initMetadataForClass(Value, 'Value');
256
+ initMetadataForCompanion(Companion_5);
257
+ initMetadataForClass(Outcome, 'Outcome');
258
+ initMetadataForCompanion(Companion_6);
259
+ initMetadataForClass(RpcShape, 'RpcShape');
260
+ initMetadataForObject(TypeDslFile, 'TypeDslFile');
261
+ initMetadataForCompanion(Companion_7);
262
+ initMetadataForClass(TypeShape, 'TypeShape');
263
+ initMetadataForClass(KotestDslExtension, 'KotestDslExtension');
264
+ initMetadataForCompanion(Companion_8);
265
+ initMetadataForClass(KotlinxSerializationExtension, 'KotlinxSerializationExtension', KotlinxSerializationExtension);
266
+ initMetadataForClass(SpringMappingAnnotationsExtension, 'SpringMappingAnnotationsExtension');
267
+ initMetadataForClass(SpringNativeHintsExtension, 'SpringNativeHintsExtension');
268
+ //endregion
269
+ function get_AVRO_PRIMITIVES() {
270
+ _init_properties_AvroExtension_kt__50nkjp();
271
+ return AVRO_PRIMITIVES;
272
+ }
273
+ var AVRO_PRIMITIVES;
274
+ function AvroExtension(packageName, language) {
275
+ var tmp = this;
276
+ var tmp_0;
277
+ switch (language.e3_1) {
278
+ case 0:
279
+ tmp_0 = new JavaAvroSource(packageName);
280
+ break;
281
+ case 1:
282
+ tmp_0 = new KotlinAvroSource(packageName);
283
+ break;
284
+ default:
285
+ // Inline function 'kotlin.error' call
286
+
287
+ var message = 'AvroExtension supports Java and Kotlin targets only, got ' + toString(language);
288
+ throw IllegalStateException_init_$Create$(toString(message));
289
+ }
290
+ tmp.c33_1 = tmp_0;
291
+ }
292
+ protoOf(AvroExtension).f1b = function (ir, ast) {
293
+ // Inline function 'kotlin.collections.buildList' call
294
+ // Inline function 'kotlin.collections.buildListInternal' call
295
+ // Inline function 'kotlin.apply' call
296
+ var this_0 = ArrayList_init_$Create$();
297
+ // Inline function 'kotlin.collections.forEach' call
298
+ var _iterator__ex2g4s = (new NonEmptyList(ast.ep_1)).t();
299
+ while (_iterator__ex2g4s.u()) {
300
+ var element = _iterator__ex2g4s.v();
301
+ // Inline function 'kotlin.collections.forEach' call
302
+ var _iterator__ex2g4s_0 = (new NonEmptyList(element.gp_1)).t();
303
+ while (_iterator__ex2g4s_0.u()) {
304
+ var element_0 = _iterator__ex2g4s_0.v();
305
+ this_0.g1(this.c33_1.d33(element_0, element));
306
+ }
307
+ }
308
+ var avroFiles = this_0.q5();
309
+ var base = new NonEmptyList(ir);
310
+ var tmp0_elvis_lhs = toNonEmptyListOrNull(plus(base, avroFiles));
311
+ var tmp;
312
+ var tmp_0 = tmp0_elvis_lhs;
313
+ if ((tmp_0 == null ? null : new NonEmptyList(tmp_0)) == null) {
314
+ tmp = ir;
315
+ } else {
316
+ tmp = tmp0_elvis_lhs;
317
+ }
318
+ return tmp;
319
+ };
320
+ function emit($this, identifier) {
321
+ var tmp;
322
+ if (identifier instanceof DefinitionIdentifier) {
323
+ tmp = sanitizeSymbol($this, identifier.o1());
324
+ } else {
325
+ if (identifier instanceof FieldIdentifier) {
326
+ // Inline function 'kotlin.let' call
327
+ var it = sanitizeSymbol($this, identifier.o1());
328
+ tmp = JavaGenerator_getInstance().i1c_1.i1(it) ? '_' + it : it;
329
+ } else {
330
+ noWhenBranchMatchedException();
331
+ }
332
+ }
333
+ return tmp;
334
+ }
335
+ function sanitizeSymbol($this, $receiver) {
336
+ // Inline function 'kotlin.collections.mapIndexed' call
337
+ var this_0 = split($receiver, ['.', ' ', '-']);
338
+ // Inline function 'kotlin.collections.mapIndexedTo' call
339
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
340
+ var index = 0;
341
+ var _iterator__ex2g4s = this_0.t();
342
+ while (_iterator__ex2g4s.u()) {
343
+ var item = _iterator__ex2g4s.v();
344
+ var _unary__edvuaz = index;
345
+ index = _unary__edvuaz + 1 | 0;
346
+ var tmp$ret$2 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.yr(item) : item;
347
+ destination.x(tmp$ret$2);
348
+ }
349
+ var tmp = asSequence(joinToString(destination, ''));
350
+ // Inline function 'kotlin.let' call
351
+ var it = joinToString_0(filter(tmp, JavaAvroSource$sanitizeSymbol$lambda), '');
352
+ var tmp_0;
353
+ var tmp0_safe_receiver = firstOrNull(it);
354
+ var tmp_1;
355
+ var tmp_2 = tmp0_safe_receiver;
356
+ if ((tmp_2 == null ? null : new Char(tmp_2)) == null) {
357
+ tmp_1 = null;
358
+ } else {
359
+ tmp_1 = isDigit(tmp0_safe_receiver);
360
+ }
361
+ if (tmp_1 === true) {
362
+ tmp_0 = '_' + it;
363
+ } else {
364
+ tmp_0 = it;
365
+ }
366
+ return tmp_0;
367
+ }
368
+ function emit_0($this, $receiver) {
369
+ // Inline function 'kotlin.let' call
370
+ var it = emitType($this, $receiver);
371
+ return $receiver.ot() ? 'java.util.Optional<' + it + '>' : it;
372
+ }
373
+ function emitType($this, $receiver) {
374
+ var tmp;
375
+ if ($receiver instanceof Dict) {
376
+ tmp = 'java.util.Map<String, ' + emit_0($this, $receiver.bq_1) + '>';
377
+ } else {
378
+ if ($receiver instanceof Iterable) {
379
+ tmp = 'java.util.List<' + emit_0($this, $receiver.yp_1) + '>';
380
+ } else {
381
+ if ($receiver instanceof Unit) {
382
+ tmp = 'void';
383
+ } else {
384
+ if ($receiver instanceof Any) {
385
+ tmp = 'Object';
386
+ } else {
387
+ if ($receiver instanceof Custom) {
388
+ tmp = $receiver.x19_1;
389
+ } else {
390
+ if ($receiver instanceof Primitive) {
391
+ var t = $receiver.z19_1;
392
+ var tmp_0;
393
+ if (t instanceof String_0) {
394
+ tmp_0 = 'String';
395
+ } else {
396
+ if (t instanceof Integer) {
397
+ var tmp_1;
398
+ switch (t.h1a_1.e3_1) {
399
+ case 0:
400
+ tmp_1 = 'Integer';
401
+ break;
402
+ case 1:
403
+ tmp_1 = 'Long';
404
+ break;
405
+ default:
406
+ noWhenBranchMatchedException();
407
+ break;
408
+ }
409
+ tmp_0 = tmp_1;
410
+ } else {
411
+ if (t instanceof Number_0) {
412
+ var tmp_2;
413
+ switch (t.c1a_1.e3_1) {
414
+ case 0:
415
+ tmp_2 = 'Float';
416
+ break;
417
+ case 1:
418
+ tmp_2 = 'Double';
419
+ break;
420
+ default:
421
+ noWhenBranchMatchedException();
422
+ break;
423
+ }
424
+ tmp_0 = tmp_2;
425
+ } else {
426
+ if (t instanceof Boolean_0) {
427
+ tmp_0 = 'Boolean';
428
+ } else {
429
+ if (t instanceof Bytes) {
430
+ tmp_0 = 'byte[]';
431
+ } else {
432
+ noWhenBranchMatchedException();
433
+ }
434
+ }
435
+ }
436
+ }
437
+ }
438
+ tmp = tmp_0;
439
+ } else {
440
+ noWhenBranchMatchedException();
441
+ }
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+ return tmp;
448
+ }
449
+ function emitRoot($this, $receiver) {
450
+ var tmp;
451
+ if ($receiver instanceof Dict) {
452
+ tmp = emitRoot($this, $receiver.bq_1);
453
+ } else {
454
+ if ($receiver instanceof Iterable) {
455
+ tmp = emitRoot($this, $receiver.yp_1);
456
+ } else {
457
+ if ($receiver instanceof Unit) {
458
+ tmp = 'void';
459
+ } else {
460
+ tmp = emitType($this, $receiver);
461
+ }
462
+ }
463
+ }
464
+ return tmp;
465
+ }
466
+ function schemaField($this, definition, module_0) {
467
+ return trimMargin('\n |public static final org.apache.avro.Schema SCHEMA =\n | new org.apache.avro.Schema.Parser().parse("' + schema($this.e33_1, definition, module_0) + '");\n |\n ');
468
+ }
469
+ function toValue($this, field) {
470
+ var reference = field.pp_1;
471
+ var tmp;
472
+ if (reference instanceof Iterable) {
473
+ tmp = 'data.' + emit($this, field.op_1) + '().stream().map(it -> ' + avroClass(reference.yp_1.o1()) + '.to(it)).toList()';
474
+ } else {
475
+ if (reference instanceof Custom) {
476
+ tmp = avroClass(emit_0($this, field.pp_1)) + '.to(data.' + emit($this, field.op_1) + '())';
477
+ } else {
478
+ if (reference instanceof Primitive) {
479
+ var tmp_0;
480
+ if (reference.z19_1 instanceof Bytes) {
481
+ tmp_0 = 'java.nio.ByteBuffer.wrap(data.' + emit($this, field.op_1) + '())';
482
+ } else {
483
+ tmp_0 = 'data.' + emit($this, field.op_1) + '()' + (reference.a1a_1 ? '.orElse(null)' : '');
484
+ }
485
+ tmp = tmp_0;
486
+ } else {
487
+ // Inline function 'kotlin.TODO' call
488
+ throw new NotImplementedError();
489
+ }
490
+ }
491
+ }
492
+ return tmp;
493
+ }
494
+ function fromValue($this, module_0) {
495
+ return JavaAvroSource$fromValue$lambda($this, module_0);
496
+ }
497
+ function JavaAvroSource$sanitizeSymbol$lambda(it) {
498
+ return isLetterOrDigit(it.k1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).i1(it);
499
+ }
500
+ function JavaAvroSource$fromValue$lambda(this$0, $module) {
501
+ return function (index, field) {
502
+ var reference = field.pp_1;
503
+ var tmp;
504
+ if (reference instanceof Iterable) {
505
+ tmp = '((java.util.List<org.apache.avro.generic.GenericData.Record>) record.get(' + index + ')).stream().map(it -> ' + avroClass(emitRoot(this$0, reference.yp_1)) + '.from(it)).toList()';
506
+ } else {
507
+ if (reference instanceof Custom) {
508
+ tmp = reference.y19_1 ? '(' + emit_0(this$0, reference) + ') java.util.Optional.ofNullable((' + emitRoot(this$0, field.pp_1) + ') record.get(' + index + '))' : isEnum(reference, $module) ? avroClass(emit_0(this$0, field.pp_1)) + '.from((org.apache.avro.generic.GenericData.EnumSymbol) record.get(' + index + '))' : avroClass(emit_0(this$0, field.pp_1)) + '.from((org.apache.avro.generic.GenericData.Record) record.get(' + index + '))';
509
+ } else {
510
+ if (reference instanceof Primitive) {
511
+ tmp = reference.a1a_1 ? '(' + emit_0(this$0, reference) + ') java.util.Optional.ofNullable((' + emitRoot(this$0, field.pp_1) + ') record.get(' + index + '))' : equals(reference.z19_1, Bytes_instance) ? '(' + emit_0(this$0, reference) + ') ((java.nio.ByteBuffer) record.get(' + index + ')).array()' : equals(reference.z19_1, new String_0(null)) ? '(' + emit_0(this$0, reference) + ') record.get(' + index + ').toString()' : '(' + emit_0(this$0, reference) + ') record.get(' + index + ')';
512
+ } else {
513
+ tmp = '(' + emit_0(this$0, reference) + ') record.get(' + index + ')';
514
+ }
515
+ }
516
+ }
517
+ return tmp;
518
+ };
519
+ }
520
+ function JavaAvroSource(packageName) {
521
+ this.e33_1 = packageName;
522
+ }
523
+ protoOf(JavaAvroSource).d33 = function (definition, module_0) {
524
+ var tmp;
525
+ if (definition instanceof Type) {
526
+ var tmp_0 = emit(this, definition.kp_1);
527
+ var tmp_1 = schemaField(this, definition, module_0);
528
+ // Inline function 'kotlin.collections.mapIndexed' call
529
+ var this_0 = get_fields(definition.lp_1);
530
+ // Inline function 'kotlin.collections.mapIndexedTo' call
531
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
532
+ var index = 0;
533
+ var _iterator__ex2g4s = this_0.t();
534
+ while (_iterator__ex2g4s.u()) {
535
+ var item = _iterator__ex2g4s.v();
536
+ var _unary__edvuaz = index;
537
+ index = _unary__edvuaz + 1 | 0;
538
+ var index_0 = checkIndexOverflow(_unary__edvuaz);
539
+ var tmp$ret$2 = to(emit(this, item.op_1), fromValue(this, module_0)(index_0, item));
540
+ destination.x(tmp$ret$2);
541
+ }
542
+ var tmp_2 = destination;
543
+ // Inline function 'kotlin.collections.mapIndexed' call
544
+ var this_1 = get_fields(definition.lp_1);
545
+ // Inline function 'kotlin.collections.mapIndexedTo' call
546
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
547
+ var index_1 = 0;
548
+ var _iterator__ex2g4s_0 = this_1.t();
549
+ while (_iterator__ex2g4s_0.u()) {
550
+ var item_0 = _iterator__ex2g4s_0.v();
551
+ var _unary__edvuaz_0 = index_1;
552
+ index_1 = _unary__edvuaz_0 + 1 | 0;
553
+ var tmp$ret$5 = 'record.put(' + checkIndexOverflow(_unary__edvuaz_0) + ', ' + toValue(this, item_0) + ')';
554
+ destination_0.x(tmp$ret$5);
555
+ }
556
+ tmp = listOf(typeAvroFile(this.e33_1, tmp_0, tmp_1, 'new org.apache.avro.generic.GenericData.Record(SCHEMA)', tmp_2, destination_0));
557
+ } else {
558
+ if (definition instanceof Enum_0) {
559
+ tmp = listOf(enumAvroFile(this.e33_1, emit(this, definition.qs_1), schemaField(this, definition, module_0), emit(this, definition.qs_1) + '.valueOf(record.toString())', 'new org.apache.avro.generic.GenericData.EnumSymbol(SCHEMA, data.name())'));
560
+ } else {
561
+ tmp = emptyList();
562
+ }
563
+ }
564
+ return tmp;
565
+ };
566
+ function emit_1($this, identifier) {
567
+ var tmp;
568
+ if (identifier instanceof DefinitionIdentifier) {
569
+ tmp = sanitize($this, identifier);
570
+ } else {
571
+ if (identifier instanceof FieldIdentifier) {
572
+ // Inline function 'kotlin.let' call
573
+ var it = sanitize($this, identifier);
574
+ tmp = KotlinGenerator_getInstance().k1c_1.i1(it) ? addBackticks(it) : it;
575
+ } else {
576
+ noWhenBranchMatchedException();
577
+ }
578
+ }
579
+ return tmp;
580
+ }
581
+ function sanitize($this, $receiver) {
582
+ // Inline function 'kotlin.collections.mapIndexed' call
583
+ var this_0 = split($receiver.o1(), ['.', ' ']);
584
+ // Inline function 'kotlin.collections.mapIndexedTo' call
585
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
586
+ var index = 0;
587
+ var _iterator__ex2g4s = this_0.t();
588
+ while (_iterator__ex2g4s.u()) {
589
+ var item = _iterator__ex2g4s.v();
590
+ var _unary__edvuaz = index;
591
+ index = _unary__edvuaz + 1 | 0;
592
+ var tmp$ret$2 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.yr(item) : item;
593
+ destination.x(tmp$ret$2);
594
+ }
595
+ var tmp = asSequence(joinToString(destination, ''));
596
+ // Inline function 'kotlin.let' call
597
+ var it = joinToString_0(filter(tmp, KotlinAvroSource$sanitize$lambda), '');
598
+ var tmp_0;
599
+ var tmp0_safe_receiver = firstOrNull(it);
600
+ var tmp_1;
601
+ var tmp_2 = tmp0_safe_receiver;
602
+ if ((tmp_2 == null ? null : new Char(tmp_2)) == null) {
603
+ tmp_1 = null;
604
+ } else {
605
+ tmp_1 = isDigit(tmp0_safe_receiver);
606
+ }
607
+ if (tmp_1 === true) {
608
+ tmp_0 = '_' + it;
609
+ } else {
610
+ tmp_0 = it;
611
+ }
612
+ return tmp_0;
613
+ }
614
+ function emit_2($this, $receiver) {
615
+ var tmp;
616
+ if ($receiver instanceof Dict) {
617
+ tmp = 'Map<String, ' + emit_2($this, $receiver.bq_1) + '>';
618
+ } else {
619
+ if ($receiver instanceof Iterable) {
620
+ tmp = 'List<' + emit_2($this, $receiver.yp_1) + '>';
621
+ } else {
622
+ if ($receiver instanceof Unit) {
623
+ tmp = 'Unit';
624
+ } else {
625
+ if ($receiver instanceof Any) {
626
+ tmp = 'Any';
627
+ } else {
628
+ if ($receiver instanceof Custom) {
629
+ tmp = $receiver.x19_1;
630
+ } else {
631
+ if ($receiver instanceof Primitive) {
632
+ var t = $receiver.z19_1;
633
+ var tmp_0;
634
+ if (t instanceof String_0) {
635
+ tmp_0 = 'String';
636
+ } else {
637
+ if (t instanceof Integer) {
638
+ var tmp_1;
639
+ switch (t.h1a_1.e3_1) {
640
+ case 0:
641
+ tmp_1 = 'Int';
642
+ break;
643
+ case 1:
644
+ tmp_1 = 'Long';
645
+ break;
646
+ default:
647
+ noWhenBranchMatchedException();
648
+ break;
649
+ }
650
+ tmp_0 = tmp_1;
651
+ } else {
652
+ if (t instanceof Number_0) {
653
+ var tmp_2;
654
+ switch (t.c1a_1.e3_1) {
655
+ case 0:
656
+ tmp_2 = 'Float';
657
+ break;
658
+ case 1:
659
+ tmp_2 = 'Double';
660
+ break;
661
+ default:
662
+ noWhenBranchMatchedException();
663
+ break;
664
+ }
665
+ tmp_0 = tmp_2;
666
+ } else {
667
+ if (t instanceof Boolean_0) {
668
+ tmp_0 = 'Boolean';
669
+ } else {
670
+ if (t instanceof Bytes) {
671
+ tmp_0 = 'ByteArray';
672
+ } else {
673
+ noWhenBranchMatchedException();
674
+ }
675
+ }
676
+ }
677
+ }
678
+ }
679
+ tmp = tmp_0;
680
+ } else {
681
+ noWhenBranchMatchedException();
682
+ }
683
+ }
684
+ }
685
+ }
686
+ }
687
+ }
688
+ // Inline function 'kotlin.let' call
689
+ var it = tmp;
690
+ return $receiver.ot() ? it + '?' : it;
691
+ }
692
+ function avroObject($this, reference) {
693
+ return avroClass(emit_2($this, reference.t1a(false)));
694
+ }
695
+ function schemaField_0($this, definition, module_0, explicitType) {
696
+ var declaration = explicitType ? 'val SCHEMA: org.apache.avro.Schema' : 'val SCHEMA';
697
+ return declaration + ' = org.apache.avro.Schema.Parser().parse("' + schema($this.f33_1, definition, module_0) + '")';
698
+ }
699
+ function toValue_0($this, field) {
700
+ var value = 'data.' + emit_1($this, field.op_1);
701
+ var access = field.pp_1.ot() ? value + '?' : value;
702
+ var reference = field.pp_1;
703
+ var tmp;
704
+ if (reference instanceof Iterable) {
705
+ var tmp_0;
706
+ if (reference.yp_1 instanceof Custom) {
707
+ tmp_0 = access + '.map{' + avroObject($this, reference.yp_1) + '.to(it)}';
708
+ } else {
709
+ tmp_0 = value;
710
+ }
711
+ tmp = tmp_0;
712
+ } else {
713
+ if (reference instanceof Dict) {
714
+ var tmp_1;
715
+ if (reference.bq_1 instanceof Custom) {
716
+ tmp_1 = access + '.mapValues{' + avroObject($this, reference.bq_1) + '.to(it.value)}';
717
+ } else {
718
+ tmp_1 = value;
719
+ }
720
+ tmp = tmp_1;
721
+ } else {
722
+ if (reference instanceof Custom) {
723
+ tmp = field.pp_1.ot() ? access + '.let{' + avroObject($this, reference) + '.to(it)}' : avroObject($this, reference) + '.to(' + value + ')';
724
+ } else {
725
+ if (reference instanceof Primitive) {
726
+ tmp = equals(reference.z19_1, Bytes_instance) && reference.a1a_1 ? access + '.let{java.nio.ByteBuffer.wrap(it)}' : equals(reference.z19_1, Bytes_instance) ? 'java.nio.ByteBuffer.wrap(' + value + ')' : value;
727
+ } else {
728
+ // Inline function 'kotlin.error' call
729
+ var message = 'Cannot emit Avro: ' + toString(reference);
730
+ throw IllegalStateException_init_$Create$(toString(message));
731
+ }
732
+ }
733
+ }
734
+ }
735
+ return tmp;
736
+ }
737
+ function fromValue_0($this, module_0) {
738
+ return KotlinAvroSource$fromValue$lambda($this, module_0);
739
+ }
740
+ function element($this, module_0, reference, value) {
741
+ var tmp;
742
+ if (reference instanceof Custom) {
743
+ tmp = isEnum(reference, module_0) ? avroObject($this, reference) + '.from(' + value + ' as org.apache.avro.generic.GenericData.EnumSymbol)' : avroObject($this, reference) + '.from(' + value + ' as org.apache.avro.generic.GenericData.Record)';
744
+ } else {
745
+ if (reference instanceof Primitive) {
746
+ var tmp_0;
747
+ if (reference.z19_1 instanceof String_0) {
748
+ tmp_0 = value + '.toString()';
749
+ } else {
750
+ tmp_0 = value + ' as ' + emit_2($this, reference);
751
+ }
752
+ tmp = tmp_0;
753
+ } else {
754
+ // Inline function 'kotlin.error' call
755
+ var message = 'Cannot emit Avro element: ' + toString(reference);
756
+ throw IllegalStateException_init_$Create$(toString(message));
757
+ }
758
+ }
759
+ return tmp;
760
+ }
761
+ function KotlinAvroSource$sanitize$lambda(it) {
762
+ return isLetterOrDigit(it.k1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).i1(it);
763
+ }
764
+ function KotlinAvroSource$fromValue$lambda(this$0, $module) {
765
+ return function (index, field) {
766
+ var reference = field.pp_1;
767
+ var get = 'record.get(' + index + ')';
768
+ var orNull = reference.ot() ? '?' : '';
769
+ var tmp;
770
+ if (reference instanceof Iterable) {
771
+ tmp = '(' + get + ' as kotlin.collections.List<*>' + orNull + ')' + orNull + '.map{' + element(this$0, $module, reference.yp_1, 'it') + '}';
772
+ } else {
773
+ if (reference instanceof Dict) {
774
+ tmp = '(' + get + ' as kotlin.collections.Map<*, *>' + orNull + ')' + orNull + '.entries' + orNull + '.associate{it.key.toString() to ' + element(this$0, $module, reference.bq_1, 'it.value') + '}';
775
+ } else {
776
+ if (reference instanceof Custom) {
777
+ var carrier = isEnum(reference, $module) ? 'org.apache.avro.generic.GenericData.EnumSymbol' : 'org.apache.avro.generic.GenericData.Record';
778
+ tmp = reference.y19_1 ? '(' + get + ' as ' + carrier + '?)?.let{' + avroObject(this$0, reference) + '.from(it)}' : element(this$0, $module, reference, get);
779
+ } else {
780
+ if (reference instanceof Primitive) {
781
+ var tmp1_subject = reference.z19_1;
782
+ var tmp_0;
783
+ if (tmp1_subject instanceof Bytes) {
784
+ tmp_0 = '(' + get + ' as java.nio.ByteBuffer' + orNull + ')' + orNull + '.array()';
785
+ } else {
786
+ if (tmp1_subject instanceof String_0) {
787
+ tmp_0 = get + orNull + '.toString() as ' + emit_2(this$0, reference);
788
+ } else {
789
+ tmp_0 = get + ' as ' + emit_2(this$0, reference);
790
+ }
791
+ }
792
+ tmp = tmp_0;
793
+ } else {
794
+ // Inline function 'kotlin.error' call
795
+ var message = 'Cannot emit Avro: ' + toString(reference);
796
+ throw IllegalStateException_init_$Create$(toString(message));
797
+ }
798
+ }
799
+ }
800
+ }
801
+ return tmp;
802
+ };
803
+ }
804
+ function KotlinAvroSource(packageName) {
805
+ this.f33_1 = packageName;
806
+ }
807
+ protoOf(KotlinAvroSource).d33 = function (definition, module_0) {
808
+ var tmp;
809
+ if (definition instanceof Type) {
810
+ var tmp_0 = emit_1(this, definition.kp_1);
811
+ var tmp_1 = schemaField_0(this, definition, module_0, false);
812
+ // Inline function 'kotlin.collections.mapIndexed' call
813
+ var this_0 = get_fields(definition.lp_1);
814
+ // Inline function 'kotlin.collections.mapIndexedTo' call
815
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
816
+ var index = 0;
817
+ var _iterator__ex2g4s = this_0.t();
818
+ while (_iterator__ex2g4s.u()) {
819
+ var item = _iterator__ex2g4s.v();
820
+ var _unary__edvuaz = index;
821
+ index = _unary__edvuaz + 1 | 0;
822
+ var index_0 = checkIndexOverflow(_unary__edvuaz);
823
+ var tmp$ret$2 = to(emit_1(this, item.op_1), fromValue_0(this, module_0)(index_0, item));
824
+ destination.x(tmp$ret$2);
825
+ }
826
+ var tmp_2 = destination;
827
+ // Inline function 'kotlin.collections.mapIndexed' call
828
+ var this_1 = get_fields(definition.lp_1);
829
+ // Inline function 'kotlin.collections.mapIndexedTo' call
830
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
831
+ var index_1 = 0;
832
+ var _iterator__ex2g4s_0 = this_1.t();
833
+ while (_iterator__ex2g4s_0.u()) {
834
+ var item_0 = _iterator__ex2g4s_0.v();
835
+ var _unary__edvuaz_0 = index_1;
836
+ index_1 = _unary__edvuaz_0 + 1 | 0;
837
+ var tmp$ret$5 = 'record.put(' + checkIndexOverflow(_unary__edvuaz_0) + ', ' + toValue_0(this, item_0) + ')';
838
+ destination_0.x(tmp$ret$5);
839
+ }
840
+ tmp = listOf(typeAvroFile(this.f33_1, tmp_0, tmp_1, 'org.apache.avro.generic.GenericData.Record(SCHEMA)', tmp_2, destination_0));
841
+ } else {
842
+ if (definition instanceof Enum_0) {
843
+ tmp = listOf(enumAvroFile(this.f33_1, emit_1(this, definition.qs_1), schemaField_0(this, definition, module_0, true), emit_1(this, definition.qs_1) + '.valueOf(record.toString())', 'org.apache.avro.generic.GenericData.EnumSymbol(SCHEMA, data.name)'));
844
+ } else {
845
+ tmp = emptyList();
846
+ }
847
+ }
848
+ return tmp;
849
+ };
850
+ function typeAvroFile(packageName, typeName, schemaField, recordConstructor, fromArgs, toPuts) {
851
+ _init_properties_AvroExtension_kt__50nkjp();
852
+ var tmp = Name_init_$Create$([packageName.dt() + 'avro/' + typeName + 'Avro']);
853
+ return file(tmp, typeAvroFile$lambda(packageName, typeName, schemaField, fromArgs, recordConstructor, toPuts));
854
+ }
855
+ function enumAvroFile(packageName, enumName, schemaField, fromExpr, toExpr) {
856
+ _init_properties_AvroExtension_kt__50nkjp();
857
+ var tmp = Name_init_$Create$([packageName.dt() + 'avro/' + enumName + 'Avro']);
858
+ return file(tmp, enumAvroFile$lambda(packageName, enumName, schemaField, fromExpr, toExpr));
859
+ }
860
+ function schema(packageName, definition, module_0) {
861
+ _init_properties_AvroExtension_kt__50nkjp();
862
+ var tmp0_safe_receiver = emitAvroSchema(packageName, definition, module_0);
863
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : replace(tmp0_safe_receiver, '\\"<<<<<', '" + ');
864
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : replace(tmp1_safe_receiver, '>>>>>\\"', 'Avro.SCHEMA + "');
865
+ var tmp;
866
+ if (tmp2_elvis_lhs == null) {
867
+ // Inline function 'kotlin.error' call
868
+ var message = 'Cannot emit avro: ' + definition.ds().o1();
869
+ throw IllegalStateException_init_$Create$(toString(message));
870
+ } else {
871
+ tmp = tmp2_elvis_lhs;
872
+ }
873
+ return tmp;
874
+ }
875
+ function avroClass(_this__u8e3s4) {
876
+ _init_properties_AvroExtension_kt__50nkjp();
877
+ return replace(_this__u8e3s4, '.model.', '.avro.') + 'Avro';
878
+ }
879
+ function isEnum(_this__u8e3s4, module_0) {
880
+ _init_properties_AvroExtension_kt__50nkjp();
881
+ // Inline function 'kotlin.collections.filterIsInstance' call
882
+ var tmp0 = new NonEmptyList(module_0.gp_1);
883
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
884
+ var destination = ArrayList_init_$Create$();
885
+ var _iterator__ex2g4s = tmp0.t();
886
+ while (_iterator__ex2g4s.u()) {
887
+ var element = _iterator__ex2g4s.v();
888
+ if (element instanceof Enum_0) {
889
+ destination.x(element);
890
+ }
891
+ }
892
+ var tmp$ret$2;
893
+ $l$block_0: {
894
+ // Inline function 'kotlin.collections.any' call
895
+ var tmp;
896
+ if (isInterface(destination, Collection)) {
897
+ tmp = destination.r();
898
+ } else {
899
+ tmp = false;
900
+ }
901
+ if (tmp) {
902
+ tmp$ret$2 = false;
903
+ break $l$block_0;
904
+ }
905
+ var _iterator__ex2g4s_0 = destination.t();
906
+ while (_iterator__ex2g4s_0.u()) {
907
+ var element_0 = _iterator__ex2g4s_0.v();
908
+ if (element_0.qs_1.o1() === _this__u8e3s4.o1()) {
909
+ tmp$ret$2 = true;
910
+ break $l$block_0;
911
+ }
912
+ }
913
+ tmp$ret$2 = false;
914
+ }
915
+ return tmp$ret$2;
916
+ }
917
+ function emitAvroSchema(packageName, definition, module_0) {
918
+ _init_properties_AvroExtension_kt__50nkjp();
919
+ // Inline function 'kotlin.with' call
920
+ var $this$with = AvroJsonEmitter_getInstance();
921
+ var tmp;
922
+ if (definition instanceof Type) {
923
+ tmp = $this$with.n31(definition, module_0, mutableListOf([definition.kp_1.o1()])).m32(VOID, VOID, packageName.bt_1);
924
+ } else {
925
+ if (definition instanceof Enum_0) {
926
+ tmp = $this$with.k31(definition);
927
+ } else {
928
+ tmp = null;
929
+ }
930
+ }
931
+ var tmp0_safe_receiver = tmp;
932
+ var tmp_0;
933
+ if (tmp0_safe_receiver == null) {
934
+ tmp_0 = null;
935
+ } else {
936
+ // Inline function 'kotlin.collections.mutableSetOf' call
937
+ var tmp$ret$2 = LinkedHashSet_init_$Create$();
938
+ tmp_0 = flatten(tmp0_safe_receiver, tmp$ret$2);
939
+ }
940
+ var tmp1_safe_receiver = tmp_0;
941
+ var tmp_1;
942
+ if (tmp1_safe_receiver == null) {
943
+ tmp_1 = null;
944
+ } else {
945
+ // Inline function 'kotlin.let' call
946
+ // Inline function 'kotlinx.serialization.encodeToString' call
947
+ var this_0 = Default_getInstance();
948
+ // Inline function 'kotlinx.serialization.serializer' call
949
+ var this_1 = this_0.g25();
950
+ // Inline function 'kotlinx.serialization.internal.cast' call
951
+ var this_2 = serializer(this_1, createKType(getKClass(Type_0), arrayOf([]), false));
952
+ var tmp$ret$6 = isInterface(this_2, KSerializer) ? this_2 : THROW_CCE();
953
+ tmp_1 = this_0.l2m(tmp$ret$6, tmp1_safe_receiver);
954
+ }
955
+ var tmp2_safe_receiver = tmp_1;
956
+ return tmp2_safe_receiver == null ? null : escaped(tmp2_safe_receiver);
957
+ }
958
+ function flatten(_this__u8e3s4, defined) {
959
+ _init_properties_AvroExtension_kt__50nkjp();
960
+ var tmp;
961
+ if (_this__u8e3s4 instanceof RecordType) {
962
+ defined.x(_this__u8e3s4.q30_1);
963
+ // Inline function 'kotlin.collections.map' call
964
+ var this_0 = _this__u8e3s4.s30_1;
965
+ // Inline function 'kotlin.collections.mapTo' call
966
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
967
+ var _iterator__ex2g4s = this_0.t();
968
+ while (_iterator__ex2g4s.u()) {
969
+ var item = _iterator__ex2g4s.v();
970
+ // Inline function 'kotlin.collections.map' call
971
+ var this_1 = item.x30_1;
972
+ // Inline function 'kotlin.collections.mapTo' call
973
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
974
+ var _iterator__ex2g4s_0 = this_1.t();
975
+ while (_iterator__ex2g4s_0.u()) {
976
+ var item_0 = _iterator__ex2g4s_0.v();
977
+ var tmp$ret$5 = flatten(item_0, defined);
978
+ destination_0.x(tmp$ret$5);
979
+ }
980
+ var tmp$ret$2 = item.h32(VOID, TypeList_init_$Create$(destination_0));
981
+ destination.x(tmp$ret$2);
982
+ }
983
+ tmp = _this__u8e3s4.m32(VOID, VOID, VOID, destination);
984
+ } else {
985
+ if (_this__u8e3s4 instanceof ArrayType) {
986
+ tmp = _this__u8e3s4.o32(VOID, flatten(_this__u8e3s4.v30_1, defined));
987
+ } else {
988
+ if (_this__u8e3s4 instanceof EnumType) {
989
+ // Inline function 'kotlin.also' call
990
+ defined.x(_this__u8e3s4.m30_1);
991
+ tmp = _this__u8e3s4;
992
+ } else {
993
+ if (_this__u8e3s4 instanceof LogicalType) {
994
+ tmp = _this__u8e3s4;
995
+ } else {
996
+ if (_this__u8e3s4 instanceof SimpleType) {
997
+ var tmp_0;
998
+ if (get_AVRO_PRIMITIVES().i1(_this__u8e3s4.c30_1) || defined.i1(_this__u8e3s4.c30_1)) {
999
+ tmp_0 = _this__u8e3s4;
1000
+ } else {
1001
+ defined.x(_this__u8e3s4.c30_1);
1002
+ tmp_0 = _this__u8e3s4.k32('<<<<<' + _this__u8e3s4.c30_1 + '>>>>>');
1003
+ }
1004
+ tmp = tmp_0;
1005
+ } else {
1006
+ if (_this__u8e3s4 instanceof MapType) {
1007
+ tmp = _this__u8e3s4.p32(VOID, flatten(_this__u8e3s4.g30_1, defined));
1008
+ } else {
1009
+ if (_this__u8e3s4 instanceof UnionType) {
1010
+ // Inline function 'kotlin.collections.map' call
1011
+ var this_2 = _this__u8e3s4.e30_1;
1012
+ // Inline function 'kotlin.collections.mapTo' call
1013
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
1014
+ var _iterator__ex2g4s_1 = this_2.t();
1015
+ while (_iterator__ex2g4s_1.u()) {
1016
+ var item_1 = _iterator__ex2g4s_1.v();
1017
+ var tmp$ret$10 = flatten(item_1, defined);
1018
+ destination_1.x(tmp$ret$10);
1019
+ }
1020
+ tmp = _this__u8e3s4.r32(VOID, TypeList_init_$Create$(destination_1));
1021
+ } else {
1022
+ noWhenBranchMatchedException();
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ return tmp;
1031
+ }
1032
+ function typeAvroFile$lambda$lambda$lambda($typeName, $fromArgs) {
1033
+ return function ($this$function) {
1034
+ $this$function.w13('record', $this$function.a15('org.apache.avro.generic.GenericData.Record', []));
1035
+ $this$function.t13($this$function.a15($typeName, []));
1036
+ var tmp = $this$function.a15($typeName, []);
1037
+ // Inline function 'kotlin.collections.associate' call
1038
+ var this_0 = $fromArgs;
1039
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1040
+ // Inline function 'kotlin.collections.associateTo' call
1041
+ var destination = LinkedHashMap_init_$Create$(capacity);
1042
+ var _iterator__ex2g4s = this_0.t();
1043
+ while (_iterator__ex2g4s.u()) {
1044
+ var element = _iterator__ex2g4s.v();
1045
+ var name = element.ze();
1046
+ var value = element.af();
1047
+ var tmp_0 = Companion_getInstance().wt(name);
1048
+ var tmp_1 = new RawExpression(value);
1049
+ // Inline function 'kotlin.collections.plusAssign' call
1050
+ var pair = to(tmp_0, isInterface(tmp_1, Expression) ? tmp_1 : THROW_CCE());
1051
+ destination.v2(pair.ff_1, pair.gf_1);
1052
+ }
1053
+ $this$function.z13(new ConstructorStatement(tmp, destination));
1054
+ return Unit_instance;
1055
+ };
1056
+ }
1057
+ function typeAvroFile$lambda$lambda$lambda_0($typeName, $recordConstructor, $toPuts) {
1058
+ return function ($this$function) {
1059
+ $this$function.w13('data', $this$function.a15($typeName, []));
1060
+ $this$function.t13($this$function.a15('org.apache.avro.generic.GenericData.Record', []));
1061
+ $this$function.a14('record', new RawExpression($recordConstructor));
1062
+ // Inline function 'kotlin.collections.forEach' call
1063
+ var _iterator__ex2g4s = $toPuts.t();
1064
+ while (_iterator__ex2g4s.u()) {
1065
+ var element = _iterator__ex2g4s.v();
1066
+ $this$function.s14(element);
1067
+ }
1068
+ $this$function.z13(new VariableReference(Companion_getInstance().wt('record')));
1069
+ return Unit_instance;
1070
+ };
1071
+ }
1072
+ function typeAvroFile$lambda$lambda($schemaField, $typeName, $fromArgs, $recordConstructor, $toPuts) {
1073
+ return function ($this$namespace) {
1074
+ $this$namespace.s14($schemaField);
1075
+ $this$namespace.g16('from', true, VOID, typeAvroFile$lambda$lambda$lambda($typeName, $fromArgs));
1076
+ $this$namespace.g16('to', true, VOID, typeAvroFile$lambda$lambda$lambda_0($typeName, $recordConstructor, $toPuts));
1077
+ return Unit_instance;
1078
+ };
1079
+ }
1080
+ function typeAvroFile$lambda($packageName, $typeName, $schemaField, $fromArgs, $recordConstructor, $toPuts) {
1081
+ return function ($this$file) {
1082
+ $this$file.o17($packageName.bt_1 + '.avro');
1083
+ $this$file.c16($packageName.bt_1 + '.model', $typeName);
1084
+ var tmp = $typeName + 'Avro';
1085
+ $this$file.o16(tmp, VOID, typeAvroFile$lambda$lambda($schemaField, $typeName, $fromArgs, $recordConstructor, $toPuts));
1086
+ return Unit_instance;
1087
+ };
1088
+ }
1089
+ function enumAvroFile$lambda$lambda$lambda($enumName, $fromExpr) {
1090
+ return function ($this$function) {
1091
+ $this$function.w13('record', $this$function.a15('org.apache.avro.generic.GenericData.EnumSymbol', []));
1092
+ $this$function.t13($this$function.a15($enumName, []));
1093
+ $this$function.z13(new RawExpression($fromExpr));
1094
+ return Unit_instance;
1095
+ };
1096
+ }
1097
+ function enumAvroFile$lambda$lambda$lambda_0($enumName, $toExpr) {
1098
+ return function ($this$function) {
1099
+ $this$function.w13('data', $this$function.a15($enumName, []));
1100
+ $this$function.t13($this$function.a15('org.apache.avro.generic.GenericData.EnumSymbol', []));
1101
+ $this$function.z13(new RawExpression($toExpr));
1102
+ return Unit_instance;
1103
+ };
1104
+ }
1105
+ function enumAvroFile$lambda$lambda($schemaField, $enumName, $fromExpr, $toExpr) {
1106
+ return function ($this$namespace) {
1107
+ $this$namespace.s14($schemaField);
1108
+ $this$namespace.g16('from', true, VOID, enumAvroFile$lambda$lambda$lambda($enumName, $fromExpr));
1109
+ $this$namespace.g16('to', true, VOID, enumAvroFile$lambda$lambda$lambda_0($enumName, $toExpr));
1110
+ return Unit_instance;
1111
+ };
1112
+ }
1113
+ function enumAvroFile$lambda($packageName, $enumName, $schemaField, $fromExpr, $toExpr) {
1114
+ return function ($this$file) {
1115
+ $this$file.o17($packageName.bt_1 + '.avro');
1116
+ $this$file.c16($packageName.bt_1 + '.model', $enumName);
1117
+ var tmp = $enumName + 'Avro';
1118
+ $this$file.o16(tmp, VOID, enumAvroFile$lambda$lambda($schemaField, $enumName, $fromExpr, $toExpr));
1119
+ return Unit_instance;
1120
+ };
1121
+ }
1122
+ var properties_initialized_AvroExtension_kt_gftbwd;
1123
+ function _init_properties_AvroExtension_kt__50nkjp() {
1124
+ if (!properties_initialized_AvroExtension_kt_gftbwd) {
1125
+ properties_initialized_AvroExtension_kt_gftbwd = true;
1126
+ AVRO_PRIMITIVES = setOf(['boolean', 'int', 'long', 'float', 'double', 'bytes', 'string', 'null']);
1127
+ }
1128
+ }
1129
+ function annotate($this, $receiver, recordNames, unionMemberNames) {
1130
+ // Inline function 'kotlin.collections.flatMap' call
1131
+ var tmp0 = $receiver.cv_1;
1132
+ // Inline function 'kotlin.collections.flatMapTo' call
1133
+ var destination = ArrayList_init_$Create$();
1134
+ var _iterator__ex2g4s = tmp0.t();
1135
+ while (_iterator__ex2g4s.u()) {
1136
+ var element = _iterator__ex2g4s.v();
1137
+ var tmp;
1138
+ if (element instanceof Union) {
1139
+ tmp = listOf_0([Companion_getInstance_0().h33_1, element]);
1140
+ } else {
1141
+ if (element instanceof Struct) {
1142
+ var pascal = element.bx_1.zt();
1143
+ tmp = !recordNames.i1(pascal) ? listOf(element) : unionMemberNames.i1(pascal) ? listOf_0([Companion_getInstance_0().i33(pascal), annotateFields($this, element)]) : listOf(annotateFields($this, element));
1144
+ } else {
1145
+ tmp = listOf(element);
1146
+ }
1147
+ }
1148
+ var list = tmp;
1149
+ addAll(destination, list);
1150
+ }
1151
+ return $receiver.fv(VOID, destination);
1152
+ }
1153
+ function annotateFields($this, $receiver) {
1154
+ // Inline function 'kotlin.collections.flatMap' call
1155
+ var tmp0 = $receiver.cx_1;
1156
+ // Inline function 'kotlin.collections.flatMapTo' call
1157
+ var destination = ArrayList_init_$Create$();
1158
+ var _iterator__ex2g4s = tmp0.t();
1159
+ while (_iterator__ex2g4s.u()) {
1160
+ var element = _iterator__ex2g4s.v();
1161
+ var tmp;
1162
+ if (element instanceof Field) {
1163
+ tmp = listOf_0([Companion_getInstance_0().j33(element.wv_1.xt()), element]);
1164
+ } else {
1165
+ tmp = listOf(element);
1166
+ }
1167
+ var list = tmp;
1168
+ addAll(destination, list);
1169
+ }
1170
+ return $receiver.mx(VOID, destination);
1171
+ }
1172
+ function Companion() {
1173
+ Companion_instance_1 = this;
1174
+ this.g33_1 = 'com.fasterxml.jackson.annotation';
1175
+ this.h33_1 = new RawElement('@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY, property = "type")\n');
1176
+ }
1177
+ protoOf(Companion).j33 = function (name) {
1178
+ return new RawElement('@com.fasterxml.jackson.annotation.JsonProperty("' + name + '")');
1179
+ };
1180
+ protoOf(Companion).i33 = function (name) {
1181
+ return new RawElement('@com.fasterxml.jackson.annotation.JsonTypeName("' + name + '")\n');
1182
+ };
1183
+ var Companion_instance_1;
1184
+ function Companion_getInstance_0() {
1185
+ if (Companion_instance_1 == null)
1186
+ new Companion();
1187
+ return Companion_instance_1;
1188
+ }
1189
+ function JacksonExtension$extend$lambda(it) {
1190
+ return new NonEmptyList(it.gp_1);
1191
+ }
1192
+ function JacksonExtension$extend$lambda_0(it) {
1193
+ return it instanceof Type;
1194
+ }
1195
+ function JacksonExtension$extend$lambda_1(it) {
1196
+ return it.kp_1.o1();
1197
+ }
1198
+ function Name$Companion$of$ref(p0) {
1199
+ var l = function (_this__u8e3s4) {
1200
+ return p0.wt(_this__u8e3s4);
1201
+ };
1202
+ l.callableName = 'of';
1203
+ return l;
1204
+ }
1205
+ function JacksonExtension$extend$lambda_2(it) {
1206
+ return it.zt();
1207
+ }
1208
+ function JacksonExtension$extend$lambda_3(it) {
1209
+ return it instanceof File;
1210
+ }
1211
+ function JacksonExtension$extend$lambda_4(it) {
1212
+ return it.cv_1;
1213
+ }
1214
+ function JacksonExtension$extend$lambda_5(it) {
1215
+ return it instanceof Union;
1216
+ }
1217
+ function JacksonExtension$extend$lambda_6(it) {
1218
+ return it.jw_1;
1219
+ }
1220
+ function JacksonExtension$extend$lambda_7(it) {
1221
+ return it.nu_1.zt();
1222
+ }
1223
+ function JacksonExtension() {
1224
+ Companion_getInstance_0();
1225
+ }
1226
+ protoOf(JacksonExtension).f1b = function (ir, ast) {
1227
+ var tmp = asSequence_0(new NonEmptyList(ast.ep_1));
1228
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1229
+ var this_0 = flatMap(tmp, JacksonExtension$extend$lambda);
1230
+ var tmp_0 = filter(this_0, JacksonExtension$extend$lambda_0);
1231
+ var tmp_1 = isInterface(tmp_0, Sequence) ? tmp_0 : THROW_CCE();
1232
+ var tmp_2 = map(tmp_1, JacksonExtension$extend$lambda_1);
1233
+ var tmp_3 = map(tmp_2, Name$Companion$of$ref(Companion_getInstance()));
1234
+ var recordNames = toSet(map(tmp_3, JacksonExtension$extend$lambda_2));
1235
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1236
+ var this_1 = asSequence_0(new NonEmptyList(ir));
1237
+ var tmp_4 = filter(this_1, JacksonExtension$extend$lambda_3);
1238
+ var tmp_5 = isInterface(tmp_4, Sequence) ? tmp_4 : THROW_CCE();
1239
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1240
+ var this_2 = flatMap(tmp_5, JacksonExtension$extend$lambda_4);
1241
+ var tmp_6 = filter(this_2, JacksonExtension$extend$lambda_5);
1242
+ var tmp_7 = isInterface(tmp_6, Sequence) ? tmp_6 : THROW_CCE();
1243
+ var tmp_8 = flatMap(tmp_7, JacksonExtension$extend$lambda_6);
1244
+ var unionMemberNames = toSet(map(tmp_8, JacksonExtension$extend$lambda_7));
1245
+ // Inline function 'arrow.core.NonEmptyList.map' call
1246
+ // Inline function 'kotlin.collections.map' call
1247
+ var this_3 = _NonEmptyList___get_all__impl__pmf509(ir);
1248
+ // Inline function 'kotlin.collections.mapTo' call
1249
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
1250
+ var _iterator__ex2g4s = this_3.t();
1251
+ while (_iterator__ex2g4s.u()) {
1252
+ var item = _iterator__ex2g4s.v();
1253
+ var tmp0_safe_receiver = item instanceof File ? item : null;
1254
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : annotate(this, tmp0_safe_receiver, recordNames, unionMemberNames);
1255
+ var tmp$ret$6 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
1256
+ destination.x(tmp$ret$6);
1257
+ }
1258
+ return _NonEmptyList___init__impl__fxd0xp(destination);
1259
+ };
1260
+ var Target_Java_instance;
1261
+ var Target_Kotlin_instance;
1262
+ var Target_Scala_instance;
1263
+ var Target_entriesInitialized;
1264
+ function Target_initEntries() {
1265
+ if (Target_entriesInitialized)
1266
+ return Unit_instance;
1267
+ Target_entriesInitialized = true;
1268
+ Target_Java_instance = new Target('Java', 0);
1269
+ Target_Kotlin_instance = new Target('Kotlin', 1);
1270
+ Target_Scala_instance = new Target('Scala', 2);
1271
+ }
1272
+ function Target(name, ordinal) {
1273
+ Enum.call(this, name, ordinal);
1274
+ }
1275
+ function Model_0(type, builder, fields) {
1276
+ this.k33_1 = type;
1277
+ this.l33_1 = builder;
1278
+ this.m33_1 = fields;
1279
+ }
1280
+ function withBuilders($this, $receiver, target, recordNames) {
1281
+ // Inline function 'kotlin.collections.flatMap' call
1282
+ var tmp0 = $receiver.cv_1;
1283
+ // Inline function 'kotlin.collections.flatMapTo' call
1284
+ var destination = ArrayList_init_$Create$();
1285
+ var _iterator__ex2g4s = tmp0.t();
1286
+ while (_iterator__ex2g4s.u()) {
1287
+ var element = _iterator__ex2g4s.v();
1288
+ var tmp0_safe_receiver = element instanceof Struct ? element : null;
1289
+ var tmp;
1290
+ if (tmp0_safe_receiver == null) {
1291
+ tmp = null;
1292
+ } else {
1293
+ // Inline function 'kotlin.takeIf' call
1294
+ var tmp_0;
1295
+ if (isRecord($this, tmp0_safe_receiver, recordNames)) {
1296
+ tmp_0 = tmp0_safe_receiver;
1297
+ } else {
1298
+ tmp_0 = null;
1299
+ }
1300
+ tmp = tmp_0;
1301
+ }
1302
+ var tmp1_safe_receiver = tmp;
1303
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : withBuilder($this, tmp1_safe_receiver, target);
1304
+ var list = tmp2_elvis_lhs == null ? listOf(element) : tmp2_elvis_lhs;
1305
+ addAll(destination, list);
1306
+ }
1307
+ return $receiver.fv(VOID, destination);
1308
+ }
1309
+ function isRecord($this, $receiver, recordNames) {
1310
+ var tmp;
1311
+ var tmp_0;
1312
+ if (recordNames.i1($receiver.bx_1.zt())) {
1313
+ // Inline function 'kotlin.collections.isNotEmpty' call
1314
+ tmp_0 = !fieldList($receiver).r();
1315
+ } else {
1316
+ tmp_0 = false;
1317
+ }
1318
+ if (tmp_0) {
1319
+ var tmp0 = $receiver.fx_1;
1320
+ var tmp$ret$1;
1321
+ $l$block_0: {
1322
+ // Inline function 'kotlin.collections.none' call
1323
+ var tmp_1;
1324
+ if (isInterface(tmp0, Collection)) {
1325
+ tmp_1 = tmp0.r();
1326
+ } else {
1327
+ tmp_1 = false;
1328
+ }
1329
+ if (tmp_1) {
1330
+ tmp$ret$1 = true;
1331
+ break $l$block_0;
1332
+ }
1333
+ var _iterator__ex2g4s = tmp0.t();
1334
+ while (_iterator__ex2g4s.u()) {
1335
+ var element = _iterator__ex2g4s.v();
1336
+ var tmp_2;
1337
+ if (element instanceof Struct) {
1338
+ tmp_2 = element.bx_1.equals(Companion_getInstance_1().n33_1);
1339
+ } else {
1340
+ tmp_2 = false;
1341
+ }
1342
+ if (tmp_2) {
1343
+ tmp$ret$1 = false;
1344
+ break $l$block_0;
1345
+ }
1346
+ }
1347
+ tmp$ret$1 = true;
1348
+ }
1349
+ tmp = tmp$ret$1;
1350
+ } else {
1351
+ tmp = false;
1352
+ }
1353
+ return tmp;
1354
+ }
1355
+ function withBuilder($this, $receiver, target) {
1356
+ // Inline function 'kotlin.let' call
1357
+ var pascal = $receiver.bx_1.zt();
1358
+ var tmp;
1359
+ switch (target.e3_1) {
1360
+ case 0:
1361
+ case 1:
1362
+ tmp = Custom_init_$Create$(Companion_getInstance_1().n33_1.xt());
1363
+ break;
1364
+ case 2:
1365
+ tmp = Custom_init_$Create$(pascal + '.' + Companion_getInstance_1().n33_1.xt());
1366
+ break;
1367
+ default:
1368
+ noWhenBranchMatchedException();
1369
+ break;
1370
+ }
1371
+ var builder_0 = tmp;
1372
+ var model = new Model_0(Custom_init_$Create$(pascal), builder_0, fieldList($receiver));
1373
+ var tmp_0;
1374
+ switch (target.e3_1) {
1375
+ case 0:
1376
+ tmp_0 = listOf($receiver.mx(VOID, VOID, VOID, VOID, plus_0(plus_0(plus_0($receiver.fx_1, entryPoint($this, model)), toBuilder($this, model)), builder($this, model, target))));
1377
+ break;
1378
+ case 1:
1379
+ // Inline function 'kotlin.collections.filterNot' call
1380
+
1381
+ var tmp0 = $receiver.fx_1;
1382
+ // Inline function 'kotlin.collections.filterNotTo' call
1383
+
1384
+ var destination = ArrayList_init_$Create$();
1385
+ var _iterator__ex2g4s = tmp0.t();
1386
+ while (_iterator__ex2g4s.u()) {
1387
+ var element = _iterator__ex2g4s.v();
1388
+ var tmp_1;
1389
+ if (element instanceof RawElement) {
1390
+ // Inline function 'kotlin.text.trim' call
1391
+ var this_0 = element.ay_1;
1392
+ tmp_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) === 'companion object';
1393
+ } else {
1394
+ tmp_1 = false;
1395
+ }
1396
+ if (!tmp_1) {
1397
+ destination.x(element);
1398
+ }
1399
+ }
1400
+
1401
+ tmp_0 = listOf($receiver.mx(VOID, VOID, VOID, VOID, plus_0(plus_0(plus_0(destination, Companion_getInstance_1().p33_1), toBuilder($this, model)), builder($this, model, target))));
1402
+ break;
1403
+ case 2:
1404
+ tmp_0 = listOf_0([$receiver.mx(VOID, VOID, VOID, VOID, plus_0($receiver.fx_1, toBuilder($this, model))), new Namespace($receiver.bx_1, listOf_0([entryPoint($this, model), builder($this, model, target)]))]);
1405
+ break;
1406
+ default:
1407
+ noWhenBranchMatchedException();
1408
+ break;
1409
+ }
1410
+ return tmp_0;
1411
+ }
1412
+ function entryPoint($this, $receiver) {
1413
+ var tmp = Companion_getInstance().wt('builder');
1414
+ var tmp_0 = emptyList();
1415
+ // Inline function 'kotlin.collections.associate' call
1416
+ var this_0 = $receiver.m33_1;
1417
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1418
+ // Inline function 'kotlin.collections.associateTo' call
1419
+ var destination = LinkedHashMap_init_$Create$(capacity);
1420
+ var _iterator__ex2g4s = this_0.t();
1421
+ while (_iterator__ex2g4s.u()) {
1422
+ var element = _iterator__ex2g4s.v();
1423
+ // Inline function 'kotlin.collections.plusAssign' call
1424
+ var pair = to(element.wv_1, NullableEmpty_instance);
1425
+ destination.v2(pair.ff_1, pair.gf_1);
1426
+ }
1427
+ return new Function(tmp, VOID, tmp_0, $receiver.l33_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.l33_1, destination))), VOID, true);
1428
+ }
1429
+ function toBuilder($this, $receiver) {
1430
+ var tmp = Companion_getInstance().wt('toBuilder');
1431
+ var tmp_0 = emptyList();
1432
+ // Inline function 'kotlin.collections.associate' call
1433
+ var this_0 = $receiver.m33_1;
1434
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1435
+ // Inline function 'kotlin.collections.associateTo' call
1436
+ var destination = LinkedHashMap_init_$Create$(capacity);
1437
+ var _iterator__ex2g4s = this_0.t();
1438
+ while (_iterator__ex2g4s.u()) {
1439
+ var element = _iterator__ex2g4s.v();
1440
+ // Inline function 'kotlin.let' call
1441
+ var self_1 = self_0($this, element);
1442
+ var tmp_1;
1443
+ var tmp_2 = element.xv_1;
1444
+ if (tmp_2 instanceof Nullable) {
1445
+ tmp_1 = self_1;
1446
+ } else {
1447
+ tmp_1 = new NullableOf(self_1);
1448
+ }
1449
+ var tmp$ret$3 = tmp_1;
1450
+ // Inline function 'kotlin.collections.plusAssign' call
1451
+ var pair = to(element.wv_1, tmp$ret$3);
1452
+ destination.v2(pair.ff_1, pair.gf_1);
1453
+ }
1454
+ return new Function(tmp, VOID, tmp_0, $receiver.l33_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.l33_1, destination))));
1455
+ }
1456
+ function builder($this, $receiver, target) {
1457
+ var tmp = Companion_getInstance_1().n33_1;
1458
+ // Inline function 'kotlin.collections.map' call
1459
+ var this_0 = $receiver.m33_1;
1460
+ // Inline function 'kotlin.collections.mapTo' call
1461
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1462
+ var _iterator__ex2g4s = this_0.t();
1463
+ while (_iterator__ex2g4s.u()) {
1464
+ var item = _iterator__ex2g4s.v();
1465
+ var tmp$ret$2 = new Field(item.wv_1, optional($this, item.xv_1), VOID, VOID, VOID, VOID, VOID, NullableEmpty_instance);
1466
+ destination.x(tmp$ret$2);
1467
+ }
1468
+ var tmp_0 = destination;
1469
+ // Inline function 'kotlin.collections.map' call
1470
+ var this_1 = $receiver.m33_1;
1471
+ // Inline function 'kotlin.collections.mapTo' call
1472
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1473
+ var _iterator__ex2g4s_0 = this_1.t();
1474
+ while (_iterator__ex2g4s_0.u()) {
1475
+ var item_0 = _iterator__ex2g4s_0.v();
1476
+ var tmp$ret$5 = wither($this, $receiver, item_0);
1477
+ destination_0.x(tmp$ret$5);
1478
+ }
1479
+ return new Struct(tmp, tmp_0, VOID, VOID, plus_0(destination_0, build($this, $receiver, target)), VOID, Visibility_PUBLIC_getInstance());
1480
+ }
1481
+ function wither($this, $receiver, field) {
1482
+ var tmp = new Name(plus(listOf('with'), Companion_getInstance().wt(field.wv_1.xt()).ut_1));
1483
+ var tmp_0 = listOf(new Parameter(Companion_getInstance_1().o33_1, required($this, field.xv_1)));
1484
+ // Inline function 'kotlin.collections.associate' call
1485
+ var this_0 = $receiver.m33_1;
1486
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1487
+ // Inline function 'kotlin.collections.associateTo' call
1488
+ var destination = LinkedHashMap_init_$Create$(capacity);
1489
+ var _iterator__ex2g4s = this_0.t();
1490
+ while (_iterator__ex2g4s.u()) {
1491
+ var element = _iterator__ex2g4s.v();
1492
+ // Inline function 'kotlin.collections.plusAssign' call
1493
+ var pair = to(element.wv_1, element.wv_1.equals(field.wv_1) ? new NullableOf(new VariableReference(Companion_getInstance_1().o33_1)) : self_0($this, element));
1494
+ destination.v2(pair.ff_1, pair.gf_1);
1495
+ }
1496
+ return new Function(tmp, VOID, tmp_0, $receiver.l33_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.l33_1, destination))));
1497
+ }
1498
+ function build($this, $receiver, target) {
1499
+ var tmp = Companion_getInstance().wt('build');
1500
+ var tmp_0 = emptyList();
1501
+ // Inline function 'kotlin.collections.associate' call
1502
+ var this_0 = $receiver.m33_1;
1503
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1504
+ // Inline function 'kotlin.collections.associateTo' call
1505
+ var destination = LinkedHashMap_init_$Create$(capacity);
1506
+ var _iterator__ex2g4s = this_0.t();
1507
+ while (_iterator__ex2g4s.u()) {
1508
+ var element = _iterator__ex2g4s.v();
1509
+ var tmp_1;
1510
+ var tmp_2 = element.xv_1;
1511
+ if (tmp_2 instanceof Nullable) {
1512
+ tmp_1 = self_0($this, element);
1513
+ } else {
1514
+ tmp_1 = require_0($this, element, target, $receiver.k33_1);
1515
+ }
1516
+ // Inline function 'kotlin.collections.plusAssign' call
1517
+ var pair = to(element.wv_1, tmp_1);
1518
+ destination.v2(pair.ff_1, pair.gf_1);
1519
+ }
1520
+ return new Function(tmp, VOID, tmp_0, $receiver.k33_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.k33_1, destination))));
1521
+ }
1522
+ function require_0($this, $receiver, target, model) {
1523
+ // Inline function 'kotlin.let' call
1524
+ var message = model.nu_1.zt() + '.' + trim_0($receiver.wv_1.xt(), charArrayOf([_Char___init__impl__6a9atx(96)])) + ' is required';
1525
+ var tmp;
1526
+ switch (target.e3_1) {
1527
+ case 0:
1528
+ tmp = new FunctionCall(self_0($this, $receiver), VOID, Companion_getInstance().wt('orElseThrow'), mapOf(to(Companion_getInstance().wt('exceptionSupplier'), new RawExpression('() -> new IllegalStateException("' + message + '")'))));
1529
+ break;
1530
+ case 1:
1531
+ tmp = new FunctionCall(VOID, VOID, Companion_getInstance().wt('checkNotNull'), mapOf_0([to(Companion_getInstance_1().o33_1, self_0($this, $receiver)), to(Companion_getInstance().wt('lazyMessage'), new RawExpression('{ "' + message + '" }'))]));
1532
+ break;
1533
+ case 2:
1534
+ tmp = new FunctionCall(self_0($this, $receiver), VOID, Companion_getInstance().wt('getOrElse'), mapOf(to(Companion_getInstance().wt('default'), new RawExpression('throw new IllegalStateException("' + message + '")'))));
1535
+ break;
1536
+ default:
1537
+ noWhenBranchMatchedException();
1538
+ break;
1539
+ }
1540
+ return tmp;
1541
+ }
1542
+ function self_0($this, $receiver) {
1543
+ return new FieldCall(new RawExpression('this'), $receiver.wv_1);
1544
+ }
1545
+ function optional($this, $receiver) {
1546
+ var tmp0_elvis_lhs = $receiver instanceof Nullable ? $receiver : null;
1547
+ return tmp0_elvis_lhs == null ? new Nullable($receiver) : tmp0_elvis_lhs;
1548
+ }
1549
+ function required($this, $receiver) {
1550
+ var tmp0_safe_receiver = $receiver instanceof Nullable ? $receiver : null;
1551
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.ru_1;
1552
+ return tmp1_elvis_lhs == null ? $receiver : tmp1_elvis_lhs;
1553
+ }
1554
+ function Companion_0() {
1555
+ Companion_instance_2 = this;
1556
+ this.n33_1 = Companion_getInstance().wt('Builder');
1557
+ this.o33_1 = Companion_getInstance().wt('value');
1558
+ this.p33_1 = new RawElement('companion object {\n fun builder(): Builder = Builder()\n}');
1559
+ }
1560
+ var Companion_instance_2;
1561
+ function Companion_getInstance_1() {
1562
+ if (Companion_instance_2 == null)
1563
+ new Companion_0();
1564
+ return Companion_instance_2;
1565
+ }
1566
+ function JvmBuilderExtension$extend$lambda(it) {
1567
+ return new NonEmptyList(it.gp_1);
1568
+ }
1569
+ function JvmBuilderExtension$extend$lambda_0(it) {
1570
+ return it instanceof Type;
1571
+ }
1572
+ function JvmBuilderExtension$extend$lambda_1(it) {
1573
+ return Companion_getInstance().wt(it.kp_1.o1()).zt();
1574
+ }
1575
+ function Target_Java_getInstance() {
1576
+ Target_initEntries();
1577
+ return Target_Java_instance;
1578
+ }
1579
+ function Target_Kotlin_getInstance() {
1580
+ Target_initEntries();
1581
+ return Target_Kotlin_instance;
1582
+ }
1583
+ function Target_Scala_getInstance() {
1584
+ Target_initEntries();
1585
+ return Target_Scala_instance;
1586
+ }
1587
+ function JvmBuilderExtension(language) {
1588
+ Companion_getInstance_1();
1589
+ this.q33_1 = language;
1590
+ var tmp = this;
1591
+ var tmp_0;
1592
+ switch (this.q33_1.e3_1) {
1593
+ case 0:
1594
+ tmp_0 = Target_Java_getInstance();
1595
+ break;
1596
+ case 1:
1597
+ tmp_0 = Target_Kotlin_getInstance();
1598
+ break;
1599
+ case 5:
1600
+ tmp_0 = Target_Scala_getInstance();
1601
+ break;
1602
+ case 2:
1603
+ case 3:
1604
+ case 4:
1605
+ case 6:
1606
+ case 7:
1607
+ case 8:
1608
+ case 9:
1609
+ case 10:
1610
+ case 11:
1611
+ tmp_0 = null;
1612
+ break;
1613
+ default:
1614
+ noWhenBranchMatchedException();
1615
+ break;
1616
+ }
1617
+ tmp.r33_1 = tmp_0;
1618
+ }
1619
+ protoOf(JvmBuilderExtension).f1b = function (ir, ast) {
1620
+ var tmp0_safe_receiver = this.r33_1;
1621
+ var tmp;
1622
+ if (tmp0_safe_receiver == null) {
1623
+ tmp = null;
1624
+ } else {
1625
+ // Inline function 'kotlin.let' call
1626
+ var tmp_0 = asSequence_0(new NonEmptyList(ast.ep_1));
1627
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1628
+ var this_0 = flatMap(tmp_0, JvmBuilderExtension$extend$lambda);
1629
+ var tmp_1 = filter(this_0, JvmBuilderExtension$extend$lambda_0);
1630
+ var tmp_2 = isInterface(tmp_1, Sequence) ? tmp_1 : THROW_CCE();
1631
+ var recordNames = toSet(map(tmp_2, JvmBuilderExtension$extend$lambda_1));
1632
+ // Inline function 'arrow.core.NonEmptyList.map' call
1633
+ // Inline function 'kotlin.collections.map' call
1634
+ var this_1 = _NonEmptyList___get_all__impl__pmf509(ir);
1635
+ // Inline function 'kotlin.collections.mapTo' call
1636
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1637
+ var _iterator__ex2g4s = this_1.t();
1638
+ while (_iterator__ex2g4s.u()) {
1639
+ var item = _iterator__ex2g4s.v();
1640
+ var tmp0_safe_receiver_0 = item instanceof File ? item : null;
1641
+ var tmp1_elvis_lhs = tmp0_safe_receiver_0 == null ? null : withBuilders(this, tmp0_safe_receiver_0, tmp0_safe_receiver, recordNames);
1642
+ var tmp$ret$6 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
1643
+ destination.x(tmp$ret$6);
1644
+ }
1645
+ tmp = _NonEmptyList___init__impl__fxd0xp(destination);
1646
+ }
1647
+ var tmp1_elvis_lhs_0 = tmp;
1648
+ var tmp_3;
1649
+ var tmp_4 = tmp1_elvis_lhs_0;
1650
+ if ((tmp_4 == null ? null : new NonEmptyList(tmp_4)) == null) {
1651
+ tmp_3 = ir;
1652
+ } else {
1653
+ tmp_3 = tmp1_elvis_lhs_0;
1654
+ }
1655
+ return tmp_3;
1656
+ };
1657
+ function Companion_1() {
1658
+ }
1659
+ protoOf(Companion_1).s33 = function (channel, types, refined) {
1660
+ var payloadRef = channel.yq_1;
1661
+ var payloadType = KotlinGenerator_getInstance().l1c(convert(payloadRef));
1662
+ var payloadCustom = payloadRef instanceof Custom ? payloadRef : null;
1663
+ var tmp;
1664
+ if (payloadCustom == null) {
1665
+ tmp = null;
1666
+ } else {
1667
+ // Inline function 'kotlin.let' call
1668
+ tmp = Companion_instance_4.t33(payloadCustom.x19_1, types, refined);
1669
+ }
1670
+ var tmp1_elvis_lhs = tmp;
1671
+ var payloadFieldShapes = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
1672
+ return new ChannelShape(Companion_getInstance().wt(channel.xq_1.o1()).zt(), payloadType, payloadFieldShapes, Companion_instance_4.u33(listOf(payloadRef)));
1673
+ };
1674
+ var Companion_instance_3;
1675
+ function Companion_getInstance_2() {
1676
+ return Companion_instance_3;
1677
+ }
1678
+ function ChannelShape(name, payloadType, payloadFieldShapes, modelImports) {
1679
+ this.v33_1 = name;
1680
+ this.w33_1 = payloadType;
1681
+ this.x33_1 = payloadFieldShapes;
1682
+ this.y33_1 = modelImports;
1683
+ }
1684
+ protoOf(ChannelShape).toString = function () {
1685
+ return 'ChannelShape(name=' + this.v33_1 + ', payloadType=' + this.w33_1 + ', payloadFieldShapes=' + toString(this.x33_1) + ', modelImports=' + toString(this.y33_1) + ')';
1686
+ };
1687
+ protoOf(ChannelShape).hashCode = function () {
1688
+ var result = getStringHashCode(this.v33_1);
1689
+ result = imul(result, 31) + getStringHashCode(this.w33_1) | 0;
1690
+ result = imul(result, 31) + hashCode(this.x33_1) | 0;
1691
+ result = imul(result, 31) + hashCode(this.y33_1) | 0;
1692
+ return result;
1693
+ };
1694
+ protoOf(ChannelShape).equals = function (other) {
1695
+ if (this === other)
1696
+ return true;
1697
+ if (!(other instanceof ChannelShape))
1698
+ return false;
1699
+ if (!(this.v33_1 === other.v33_1))
1700
+ return false;
1701
+ if (!(this.w33_1 === other.w33_1))
1702
+ return false;
1703
+ if (!equals(this.x33_1, other.x33_1))
1704
+ return false;
1705
+ if (!equals(this.y33_1, other.y33_1))
1706
+ return false;
1707
+ return true;
1708
+ };
1709
+ function ChannelDslFile$build$lambda$lambda$lambda($builder, $arbPayload, $payload) {
1710
+ return function ($this$function) {
1711
+ $this$function.v13(Visibility_PUBLIC_getInstance());
1712
+ $this$function.y13('block', $this$function.c15(Unit_instance_0, Custom_init_$Create$($builder)), $this$function.d15('{}'));
1713
+ $this$function.t13($arbPayload);
1714
+ $this$function.s14('val builder = ' + $builder + '().apply(block)');
1715
+ $this$function.s14('return generatedGen { generator, rs -> builder.applyTo(' + $payload + 'Generator.generate(generator, emptyList()), rs) }');
1716
+ return Unit_instance;
1717
+ };
1718
+ }
1719
+ function ChannelDslFile$build$lambda$lambda$lambda_0($arbPayload, $payload, $shape) {
1720
+ return function ($this$function) {
1721
+ $this$function.v13(Visibility_PUBLIC_getInstance());
1722
+ $this$function.t13($arbPayload);
1723
+ $this$function.z13($this$function.d15('channelCall<' + $payload + '>(' + $shape.v33_1 + '::class).messageGen()'));
1724
+ return Unit_instance;
1725
+ };
1726
+ }
1727
+ function ChannelDslFile$build$lambda$lambda($isRecord, $payload, $arbPayload, $shape) {
1728
+ return function ($this$struct) {
1729
+ $this$struct.r15();
1730
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
1731
+ $this$struct.s15(Visibility_INTERNAL_getInstance());
1732
+ var tmp;
1733
+ if ($isRecord) {
1734
+ var builder = RecordBuilder_instance.z33($payload);
1735
+ $this$struct.g16('message', VOID, VOID, ChannelDslFile$build$lambda$lambda$lambda(builder, $arbPayload, $payload));
1736
+ tmp = Unit_instance;
1737
+ } else {
1738
+ $this$struct.g16('message', VOID, VOID, ChannelDslFile$build$lambda$lambda$lambda_0($arbPayload, $payload, $shape));
1739
+ tmp = Unit_instance;
1740
+ }
1741
+ return Unit_instance;
1742
+ };
1743
+ }
1744
+ function ChannelDslFile$build$lambda$lambda_0($genPayload, $payload, $shape) {
1745
+ return function ($this$asyncFunction) {
1746
+ $this$asyncFunction.v13(Visibility_PUBLIC_getInstance());
1747
+ $this$asyncFunction.u13($genPayload);
1748
+ $this$asyncFunction.y13('topic', new Nullable(String_instance), $this$asyncFunction.d15('null'));
1749
+ $this$asyncFunction.y13('key', new Nullable(String_instance), $this$asyncFunction.d15('null'));
1750
+ $this$asyncFunction.t13(Custom_init_$Create$($payload));
1751
+ $this$asyncFunction.s14('val call = channelCall<' + $payload + '>(' + $shape.v33_1 + '::class)');
1752
+ $this$asyncFunction.s14('topic?.let { call.topic(it) }');
1753
+ $this$asyncFunction.s14('key?.let { call.key(it) }');
1754
+ $this$asyncFunction.z13($this$asyncFunction.d15('call.send(this)'));
1755
+ return Unit_instance;
1756
+ };
1757
+ }
1758
+ function ChannelDslFile$build$lambda($kotestPkg, $shape, $emitSend, $packageName, $payload, $channelPkg, $modelPkg, $arbPayload, $genPayload) {
1759
+ return function ($this$file) {
1760
+ $this$file.o17($kotestPkg);
1761
+ // Inline function 'kotlin.collections.isNotEmpty' call
1762
+ var isRecord = !$shape.x33_1.r();
1763
+ var tmp;
1764
+ if ($emitSend || !isRecord) {
1765
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'channelCall');
1766
+ tmp = Unit_instance;
1767
+ }
1768
+ var tmp_0;
1769
+ if (isRecord) {
1770
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'generatedGen');
1771
+ $this$file.c16($packageName.bt_1 + '.generator', $payload + 'Generator');
1772
+ tmp_0 = Unit_instance;
1773
+ }
1774
+ $this$file.c16('io.kotest.property', 'Arb');
1775
+ $this$file.c16('io.kotest.property', 'Gen');
1776
+ $this$file.c16($channelPkg, $shape.v33_1);
1777
+ // Inline function 'kotlin.collections.forEach' call
1778
+ var _iterator__ex2g4s = $shape.y33_1.t();
1779
+ while (_iterator__ex2g4s.u()) {
1780
+ var element = _iterator__ex2g4s.v();
1781
+ $this$file.c16($modelPkg, Companion_getInstance().wt(element).zt());
1782
+ }
1783
+ var tmp_1 = $shape.v33_1 + 'Generate';
1784
+ $this$file.p17(tmp_1, ChannelDslFile$build$lambda$lambda(isRecord, $payload, $arbPayload, $shape));
1785
+ $this$file.e16('generate', Custom_init_$Create$($shape.v33_1 + 'Generate'), VOID, Visibility_PUBLIC_getInstance(), Custom_init_$Create$($shape.v33_1), VOID, VOID, new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.v33_1 + 'Generate')));
1786
+ var tmp_2;
1787
+ if ($emitSend) {
1788
+ $this$file.k16('send', VOID, VOID, ChannelDslFile$build$lambda$lambda_0($genPayload, $payload, $shape));
1789
+ tmp_2 = Unit_instance;
1790
+ }
1791
+ return Unit_instance;
1792
+ };
1793
+ }
1794
+ function ChannelDslFile() {
1795
+ }
1796
+ protoOf(ChannelDslFile).a34 = function (channel, packageName, types, refined, emitSend) {
1797
+ var shape = Companion_instance_3.s33(channel, types, refined);
1798
+ var kotestPkg = packageName.bt_1 + '.kotest';
1799
+ var channelPkg = packageName.bt_1 + '.channel';
1800
+ var modelPkg = packageName.bt_1 + '.model';
1801
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.v33_1 + 'Dsl');
1802
+ var payload = shape.w33_1;
1803
+ var genPayload = Custom_init_$Create$('Gen', listOf(Custom_init_$Create$(payload)));
1804
+ var arbPayload = Custom_init_$Create$('Arb', listOf(Custom_init_$Create$(payload)));
1805
+ var tmp = Companion_getInstance().wt(fileName);
1806
+ return file(tmp, ChannelDslFile$build$lambda(kotestPkg, shape, emitSend, packageName, payload, channelPkg, modelPkg, arbPayload, genPayload));
1807
+ };
1808
+ var ChannelDslFile_instance;
1809
+ function ChannelDslFile_getInstance() {
1810
+ return ChannelDslFile_instance;
1811
+ }
1812
+ function Slot(name, genFn, fields) {
1813
+ this.b34_1 = name;
1814
+ this.c34_1 = genFn;
1815
+ this.d34_1 = fields;
1816
+ }
1817
+ protoOf(Slot).toString = function () {
1818
+ return 'Slot(name=' + this.b34_1 + ', genFn=' + this.c34_1 + ', fields=' + toString(this.d34_1) + ')';
1819
+ };
1820
+ protoOf(Slot).hashCode = function () {
1821
+ var result = getStringHashCode(this.b34_1);
1822
+ result = imul(result, 31) + getStringHashCode(this.c34_1) | 0;
1823
+ result = imul(result, 31) + hashCode(this.d34_1) | 0;
1824
+ return result;
1825
+ };
1826
+ protoOf(Slot).equals = function (other) {
1827
+ if (this === other)
1828
+ return true;
1829
+ if (!(other instanceof Slot))
1830
+ return false;
1831
+ if (!(this.b34_1 === other.b34_1))
1832
+ return false;
1833
+ if (!(this.c34_1 === other.c34_1))
1834
+ return false;
1835
+ if (!equals(this.d34_1, other.d34_1))
1836
+ return false;
1837
+ return true;
1838
+ };
1839
+ function presentSlots($this, shape) {
1840
+ // Inline function 'kotlin.collections.filter' call
1841
+ var tmp0 = listOf_0([new Slot('path', 'pathGen', shape.f34_1), new Slot('query', 'queryGen', shape.g34_1), new Slot('header', 'headerGen', shape.h34_1)]);
1842
+ // Inline function 'kotlin.collections.filterTo' call
1843
+ var destination = ArrayList_init_$Create$();
1844
+ var _iterator__ex2g4s = tmp0.t();
1845
+ while (_iterator__ex2g4s.u()) {
1846
+ var element = _iterator__ex2g4s.v();
1847
+ // Inline function 'kotlin.collections.isNotEmpty' call
1848
+ if (!element.d34_1.r()) {
1849
+ destination.x(element);
1850
+ }
1851
+ }
1852
+ return destination;
1853
+ }
1854
+ function requiredSlots($this, shape) {
1855
+ // Inline function 'kotlin.collections.filter' call
1856
+ var tmp0 = presentSlots($this, shape);
1857
+ // Inline function 'kotlin.collections.filterTo' call
1858
+ var destination = ArrayList_init_$Create$();
1859
+ var _iterator__ex2g4s = tmp0.t();
1860
+ while (_iterator__ex2g4s.u()) {
1861
+ var element = _iterator__ex2g4s.v();
1862
+ var tmp0_0 = element.d34_1;
1863
+ var tmp$ret$3;
1864
+ $l$block_0: {
1865
+ // Inline function 'kotlin.collections.any' call
1866
+ var tmp;
1867
+ if (isInterface(tmp0_0, Collection)) {
1868
+ tmp = tmp0_0.r();
1869
+ } else {
1870
+ tmp = false;
1871
+ }
1872
+ if (tmp) {
1873
+ tmp$ret$3 = false;
1874
+ break $l$block_0;
1875
+ }
1876
+ var _iterator__ex2g4s_0 = tmp0_0.t();
1877
+ while (_iterator__ex2g4s_0.u()) {
1878
+ var element_0 = _iterator__ex2g4s_0.v();
1879
+ if (!element_0.q34_1) {
1880
+ tmp$ret$3 = true;
1881
+ break $l$block_0;
1882
+ }
1883
+ }
1884
+ tmp$ret$3 = false;
1885
+ }
1886
+ if (tmp$ret$3) {
1887
+ destination.x(element);
1888
+ }
1889
+ }
1890
+ return destination;
1891
+ }
1892
+ function cap($this, name) {
1893
+ // Inline function 'kotlin.text.replaceFirstChar' call
1894
+ var tmp;
1895
+ // Inline function 'kotlin.text.isNotEmpty' call
1896
+ if (charSequenceLength(name) > 0) {
1897
+ var p0 = charCodeAt(name, 0);
1898
+ var tmp0 = uppercaseChar(p0);
1899
+ // Inline function 'kotlin.text.plus' call
1900
+ var other = substring(name, 1);
1901
+ tmp = toString_0(tmp0) + other;
1902
+ } else {
1903
+ tmp = name;
1904
+ }
1905
+ return tmp;
1906
+ }
1907
+ function slotBuilderName($this, shape, slot) {
1908
+ return shape.e34_1 + cap($this, slot.b34_1) + 'Builder';
1909
+ }
1910
+ function genOf($this, inner) {
1911
+ return Custom_init_$Create$('Gen', listOf(inner));
1912
+ }
1913
+ function genOf_0($this, inner) {
1914
+ return genOf($this, Custom_init_$Create$(inner));
1915
+ }
1916
+ function arbOf($this, inner) {
1917
+ return Custom_init_$Create$('Arb', listOf(inner));
1918
+ }
1919
+ function arbOf_0($this, inner) {
1920
+ return arbOf($this, Custom_init_$Create$(inner));
1921
+ }
1922
+ function genNullableOf($this, inner) {
1923
+ return new Nullable(genOf($this, inner));
1924
+ }
1925
+ function blockType($this, builder) {
1926
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(builder));
1927
+ }
1928
+ function suspendScopeType($this, scope) {
1929
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(scope), true);
1930
+ }
1931
+ function buildGenerateWrapper($this, $receiver, shape) {
1932
+ var tmp = shape.e34_1 + 'Generate';
1933
+ $receiver.p17(tmp, EndpointDslFile$buildGenerateWrapper$lambda(shape));
1934
+ }
1935
+ function buildRequestCall($this, $receiver, shape) {
1936
+ $receiver.k16('call', VOID, VOID, EndpointDslFile$buildRequestCall$lambda(shape));
1937
+ }
1938
+ function buildResponseMock($this, $receiver, shape) {
1939
+ $receiver.k16('mock', VOID, VOID, EndpointDslFile$buildResponseMock$lambda(shape));
1940
+ }
1941
+ function buildResponseScope($this, $receiver, shape, variant) {
1942
+ var scopeName = shape.e34_1 + variant.s34_1 + 'Scope';
1943
+ var variantType = shape.e34_1 + '.' + variant.s34_1;
1944
+ var tmp0_safe_receiver = variant.u34_1;
1945
+ var tmp;
1946
+ if (tmp0_safe_receiver == null) {
1947
+ tmp = null;
1948
+ } else {
1949
+ // Inline function 'kotlin.takeIf' call
1950
+ var tmp_0;
1951
+ if (!variant.t34_1.equals(BodyKind_None_getInstance())) {
1952
+ tmp_0 = tmp0_safe_receiver;
1953
+ } else {
1954
+ tmp_0 = null;
1955
+ }
1956
+ tmp = tmp_0;
1957
+ }
1958
+ var bodyType = tmp;
1959
+ $receiver.p17(scopeName, EndpointDslFile$buildResponseScope$lambda(shape, variantType, bodyType, variant));
1960
+ }
1961
+ function buildScopeClass($this, $receiver, shape, present, required) {
1962
+ var tmp = shape.e34_1 + 'Scope';
1963
+ $receiver.p17(tmp, EndpointDslFile$buildScopeClass$lambda(shape, present, required));
1964
+ }
1965
+ function renderFlushBody($this, shape, present, required) {
1966
+ // Inline function 'kotlin.text.buildString' call
1967
+ // Inline function 'kotlin.apply' call
1968
+ var this_0 = StringBuilder_init_$Create$();
1969
+ // Inline function 'kotlin.collections.map' call
1970
+ // Inline function 'kotlin.collections.mapTo' call
1971
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(required, 10));
1972
+ var _iterator__ex2g4s = required.t();
1973
+ while (_iterator__ex2g4s.u()) {
1974
+ var item = _iterator__ex2g4s.v();
1975
+ var tmp$ret$5 = item.b34_1;
1976
+ destination.x(tmp$ret$5);
1977
+ }
1978
+ var requiredNames = toSet_0(destination);
1979
+ // Inline function 'kotlin.text.appendLine' call
1980
+ var value = 'if (flushed) return';
1981
+ // Inline function 'kotlin.text.appendLine' call
1982
+ this_0.q(value).s(_Char___init__impl__6a9atx(10));
1983
+ // Inline function 'kotlin.text.appendLine' call
1984
+ var value_0 = 'flushed = true';
1985
+ // Inline function 'kotlin.text.appendLine' call
1986
+ this_0.q(value_0).s(_Char___init__impl__6a9atx(10));
1987
+ // Inline function 'kotlin.collections.forEach' call
1988
+ var _iterator__ex2g4s_0 = present.t();
1989
+ while (_iterator__ex2g4s_0.u()) {
1990
+ var element = _iterator__ex2g4s_0.v();
1991
+ var builderClass = slotBuilderName(EndpointDslFile_instance, shape, element);
1992
+ var builderVar = element.b34_1 + 'Builder';
1993
+ if (requiredNames.i1(element.b34_1)) {
1994
+ // Inline function 'kotlin.text.appendLine' call
1995
+ var value_1 = 'val ' + builderVar + ' = ' + builderClass + '().apply(' + element.b34_1 + ' ?: error("' + shape.e34_1 + ': required `' + element.b34_1 + '` block is missing"))';
1996
+ // Inline function 'kotlin.text.appendLine' call
1997
+ this_0.q(value_1).s(_Char___init__impl__6a9atx(10));
1998
+ // Inline function 'kotlin.collections.forEach' call
1999
+ var _iterator__ex2g4s_1 = element.d34_1.t();
2000
+ while (_iterator__ex2g4s_1.u()) {
2001
+ var element_0 = _iterator__ex2g4s_1.v();
2002
+ // Inline function 'kotlin.text.appendLine' call
2003
+ var value_2 = registerLine(EndpointDslFile_instance, shape, element, builderVar, element_0, '');
2004
+ // Inline function 'kotlin.text.appendLine' call
2005
+ this_0.q(value_2).s(_Char___init__impl__6a9atx(10));
2006
+ }
2007
+ } else {
2008
+ // Inline function 'kotlin.text.appendLine' call
2009
+ var value_3 = 'val ' + builderVar + ' = ' + element.b34_1 + '?.let { block -> ' + builderClass + '().apply(block) }';
2010
+ // Inline function 'kotlin.text.appendLine' call
2011
+ this_0.q(value_3).s(_Char___init__impl__6a9atx(10));
2012
+ // Inline function 'kotlin.collections.forEach' call
2013
+ var _iterator__ex2g4s_2 = element.d34_1.t();
2014
+ while (_iterator__ex2g4s_2.u()) {
2015
+ var element_1 = _iterator__ex2g4s_2.v();
2016
+ // Inline function 'kotlin.text.appendLine' call
2017
+ var value_4 = registerLine(EndpointDslFile_instance, shape, element, builderVar, element_1, '', true);
2018
+ // Inline function 'kotlin.text.appendLine' call
2019
+ this_0.q(value_4).s(_Char___init__impl__6a9atx(10));
2020
+ }
2021
+ }
2022
+ }
2023
+ // Inline function 'kotlin.collections.isNotEmpty' call
2024
+ if (!shape.l34_1.r()) {
2025
+ var elementType = requireBodyElementType(EndpointDslFile_instance, shape);
2026
+ var isList = shape.i34_1.equals(BodyKind_List_getInstance());
2027
+ var body = new RecordRef(elementType, isList, false, false);
2028
+ // Inline function 'kotlin.text.appendLine' call
2029
+ var value_5 = 'body?.let { block ->';
2030
+ // Inline function 'kotlin.text.appendLine' call
2031
+ this_0.q(value_5).s(_Char___init__impl__6a9atx(10));
2032
+ // Inline function 'kotlin.text.appendLine' call
2033
+ var value_6 = ' val builder = ' + RecordBuilder_instance.z33(elementType) + '().apply(block)';
2034
+ // Inline function 'kotlin.text.appendLine' call
2035
+ this_0.q(value_6).s(_Char___init__impl__6a9atx(10));
2036
+ if (isList) {
2037
+ // Inline function 'kotlin.text.appendLine' call
2038
+ var value_7 = ' inner.bodyListSize(Arb.int(bodyCount))';
2039
+ // Inline function 'kotlin.text.appendLine' call
2040
+ this_0.q(value_7).s(_Char___init__impl__6a9atx(10));
2041
+ }
2042
+ // Inline function 'kotlin.text.appendLine' call
2043
+ var value_8 = ' inner.bodyTransform { base, rs -> ' + body.b35('base', 'builder') + ' }';
2044
+ // Inline function 'kotlin.text.appendLine' call
2045
+ this_0.q(value_8).s(_Char___init__impl__6a9atx(10));
2046
+ // Inline function 'kotlin.text.appendLine' call
2047
+ // Inline function 'kotlin.text.appendLine' call
2048
+ this_0.q('}').s(_Char___init__impl__6a9atx(10));
2049
+ }
2050
+ if (shape.i34_1.equals(BodyKind_Primitive_getInstance())) {
2051
+ // Inline function 'kotlin.text.appendLine' call
2052
+ var value_9 = 'body?.let { gen ->';
2053
+ // Inline function 'kotlin.text.appendLine' call
2054
+ this_0.q(value_9).s(_Char___init__impl__6a9atx(10));
2055
+ // Inline function 'kotlin.text.appendLine' call
2056
+ var value_10 = ' inner.bodyTransform { _, rs -> gen.draw(rs) }';
2057
+ // Inline function 'kotlin.text.appendLine' call
2058
+ this_0.q(value_10).s(_Char___init__impl__6a9atx(10));
2059
+ // Inline function 'kotlin.text.appendLine' call
2060
+ // Inline function 'kotlin.text.appendLine' call
2061
+ this_0.q('}').s(_Char___init__impl__6a9atx(10));
2062
+ }
2063
+ return this_0.toString();
2064
+ }
2065
+ function registerLine($this, shape, slot, builderVar, field, indent, nullableBuilder) {
2066
+ nullableBuilder = nullableBuilder === VOID ? false : nullableBuilder;
2067
+ var access = nullableBuilder ? '?.' : '.';
2068
+ var ref = builderVar + access + escapeKotlinIdentifier(field.o34_1);
2069
+ var tmp;
2070
+ if (field.q34_1) {
2071
+ tmp = 'Arb.constant(null)';
2072
+ } else {
2073
+ tmp = 'error("' + shape.e34_1 + '.' + slot.b34_1 + ': required `' + field.o34_1 + '` is missing")';
2074
+ }
2075
+ var fallback = tmp;
2076
+ return indent + 'inner.' + slot.c34_1 + '("' + field.o34_1 + '", ' + ref + ' ?: ' + fallback + ')';
2077
+ }
2078
+ function buildSlotBuilder($this, $receiver, shape, slot) {
2079
+ var tmp = slotBuilderName($this, shape, slot);
2080
+ $receiver.p17(tmp, EndpointDslFile$buildSlotBuilder$lambda(slot));
2081
+ }
2082
+ function requireBodyElementType($this, $receiver) {
2083
+ var tmp0_elvis_lhs = $receiver.j34_1;
2084
+ var tmp;
2085
+ if (tmp0_elvis_lhs == null) {
2086
+ // Inline function 'kotlin.error' call
2087
+ var message = 'bodyFieldShapes present but no bodyElementType for ' + $receiver.e34_1;
2088
+ throw IllegalStateException_init_$Create$(toString(message));
2089
+ } else {
2090
+ tmp = tmp0_elvis_lhs;
2091
+ }
2092
+ return tmp;
2093
+ }
2094
+ function requireBodyPrimitiveType($this, $receiver) {
2095
+ var tmp0_elvis_lhs = $receiver.k34_1;
2096
+ var tmp;
2097
+ if (tmp0_elvis_lhs == null) {
2098
+ // Inline function 'kotlin.error' call
2099
+ var message = 'BodyKind.Primitive but no bodyPrimitiveType for ' + $receiver.e34_1;
2100
+ throw IllegalStateException_init_$Create$(toString(message));
2101
+ } else {
2102
+ tmp = tmp0_elvis_lhs;
2103
+ }
2104
+ return tmp;
2105
+ }
2106
+ function EndpointDslFile$build$lambda($kotestPkg, $shape, $endpointPkg, $present, $modelPkg, $required) {
2107
+ return function ($this$file) {
2108
+ $this$file.o17($kotestPkg);
2109
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'endpointCall');
2110
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'requestCall');
2111
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'WirespecScenarioDsl');
2112
+ var tmp;
2113
+ // Inline function 'kotlin.collections.isNotEmpty' call
2114
+ if (!$shape.m34_1.r()) {
2115
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'responseCall');
2116
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'responseMock');
2117
+ tmp = Unit_instance;
2118
+ }
2119
+ var tmp_0;
2120
+ if ($shape.i34_1.equals(BodyKind_Primitive_getInstance())) {
2121
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'draw');
2122
+ tmp_0 = Unit_instance;
2123
+ }
2124
+ $this$file.c16($endpointPkg, $shape.e34_1);
2125
+ $this$file.c16('io.kotest.property', 'Gen');
2126
+ $this$file.c16('io.kotest.property', 'Arb');
2127
+ var isListBody = $shape.i34_1.equals(BodyKind_List_getInstance());
2128
+ var tmp_1;
2129
+ var tmp_2;
2130
+ var tmp_3;
2131
+ var tmp0 = plus(plus($shape.f34_1, $shape.g34_1), $shape.h34_1);
2132
+ var tmp$ret$1;
2133
+ $l$block_0: {
2134
+ // Inline function 'kotlin.collections.any' call
2135
+ var tmp_4;
2136
+ if (isInterface(tmp0, Collection)) {
2137
+ tmp_4 = tmp0.r();
2138
+ } else {
2139
+ tmp_4 = false;
2140
+ }
2141
+ if (tmp_4) {
2142
+ tmp$ret$1 = false;
2143
+ break $l$block_0;
2144
+ }
2145
+ var _iterator__ex2g4s = tmp0.t();
2146
+ while (_iterator__ex2g4s.u()) {
2147
+ var element = _iterator__ex2g4s.v();
2148
+ if (element.q34_1) {
2149
+ tmp$ret$1 = true;
2150
+ break $l$block_0;
2151
+ }
2152
+ }
2153
+ tmp$ret$1 = false;
2154
+ }
2155
+ if (tmp$ret$1) {
2156
+ tmp_3 = true;
2157
+ } else {
2158
+ // Inline function 'kotlin.collections.isNotEmpty' call
2159
+ tmp_3 = !$present.r();
2160
+ }
2161
+ if (tmp_3) {
2162
+ tmp_2 = true;
2163
+ } else {
2164
+ tmp_2 = $shape.i34_1.equals(BodyKind_Primitive_getInstance());
2165
+ }
2166
+ if (tmp_2) {
2167
+ tmp_1 = true;
2168
+ } else {
2169
+ var tmp0_0 = $shape.m34_1;
2170
+ var tmp$ret$4;
2171
+ $l$block_2: {
2172
+ // Inline function 'kotlin.collections.any' call
2173
+ var tmp_5;
2174
+ if (isInterface(tmp0_0, Collection)) {
2175
+ tmp_5 = tmp0_0.r();
2176
+ } else {
2177
+ tmp_5 = false;
2178
+ }
2179
+ if (tmp_5) {
2180
+ tmp$ret$4 = false;
2181
+ break $l$block_2;
2182
+ }
2183
+ var _iterator__ex2g4s_0 = tmp0_0.t();
2184
+ while (_iterator__ex2g4s_0.u()) {
2185
+ var element_0 = _iterator__ex2g4s_0.v();
2186
+ var tmp_6;
2187
+ if (!(element_0.u34_1 == null)) {
2188
+ tmp_6 = true;
2189
+ } else {
2190
+ // Inline function 'kotlin.collections.isNotEmpty' call
2191
+ tmp_6 = !element_0.w34_1.r();
2192
+ }
2193
+ if (tmp_6) {
2194
+ tmp$ret$4 = true;
2195
+ break $l$block_2;
2196
+ }
2197
+ }
2198
+ tmp$ret$4 = false;
2199
+ }
2200
+ tmp_1 = tmp$ret$4;
2201
+ }
2202
+ var needsArbConstant = tmp_1;
2203
+ var tmp_7;
2204
+ if (isListBody) {
2205
+ $this$file.c16('io.kotest.property.arbitrary', 'int');
2206
+ tmp_7 = Unit_instance;
2207
+ }
2208
+ var tmp_8;
2209
+ if (needsArbConstant) {
2210
+ $this$file.c16('io.kotest.property.arbitrary', 'constant');
2211
+ tmp_8 = Unit_instance;
2212
+ }
2213
+ // Inline function 'kotlin.collections.forEach' call
2214
+ var _iterator__ex2g4s_1 = $shape.n34_1.t();
2215
+ while (_iterator__ex2g4s_1.u()) {
2216
+ var element_1 = _iterator__ex2g4s_1.v();
2217
+ $this$file.c16($modelPkg, Companion_getInstance().wt(element_1).zt());
2218
+ }
2219
+ buildGenerateWrapper(EndpointDslFile_instance, $this$file, $shape);
2220
+ $this$file.e16('generate', Custom_init_$Create$($shape.e34_1 + 'Generate'), VOID, Visibility_PUBLIC_getInstance(), Custom_init_$Create$($shape.e34_1), VOID, VOID, new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.e34_1 + 'Generate')));
2221
+ buildRequestCall(EndpointDslFile_instance, $this$file, $shape);
2222
+ var tmp_9;
2223
+ // Inline function 'kotlin.collections.isNotEmpty' call
2224
+ if (!$shape.m34_1.r()) {
2225
+ buildResponseMock(EndpointDslFile_instance, $this$file, $shape);
2226
+ tmp_9 = Unit_instance;
2227
+ }
2228
+ buildScopeClass(EndpointDslFile_instance, $this$file, $shape, $present, $required);
2229
+ // Inline function 'kotlin.collections.forEach' call
2230
+ var _iterator__ex2g4s_2 = $shape.m34_1.t();
2231
+ while (_iterator__ex2g4s_2.u()) {
2232
+ var element_2 = _iterator__ex2g4s_2.v();
2233
+ buildResponseScope(EndpointDslFile_instance, $this$file, $shape, element_2);
2234
+ }
2235
+ // Inline function 'kotlin.collections.forEach' call
2236
+ var _iterator__ex2g4s_3 = $present.t();
2237
+ while (_iterator__ex2g4s_3.u()) {
2238
+ var element_3 = _iterator__ex2g4s_3.v();
2239
+ buildSlotBuilder(EndpointDslFile_instance, $this$file, $shape, element_3);
2240
+ }
2241
+ return Unit_instance;
2242
+ };
2243
+ }
2244
+ function EndpointDslFile$buildGenerateWrapper$lambda$lambda($shape) {
2245
+ return function ($this$asyncFunction) {
2246
+ $this$asyncFunction.v13(Visibility_PUBLIC_getInstance());
2247
+ $this$asyncFunction.w13('block', suspendScopeType(EndpointDslFile_instance, $shape.e34_1 + 'Scope'));
2248
+ $this$asyncFunction.t13(arbOf_0(EndpointDslFile_instance, $shape.e34_1 + '.Request'));
2249
+ $this$asyncFunction.a14('scope', new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.e34_1 + 'Scope')));
2250
+ $this$asyncFunction.k14('block', VariableReference_init_$Create$('scope'));
2251
+ $this$asyncFunction.z13(new FunctionCall(VariableReference_init_$Create$('scope'), VOID, Companion_getInstance().wt('buildRequest')));
2252
+ return Unit_instance;
2253
+ };
2254
+ }
2255
+ function EndpointDslFile$buildGenerateWrapper$lambda$lambda_0($scopeName, $shape, $variant) {
2256
+ return function ($this$function) {
2257
+ $this$function.v13(Visibility_PUBLIC_getInstance());
2258
+ $this$function.y13('block', blockType(EndpointDslFile_instance, $scopeName), $this$function.d15('{}'));
2259
+ $this$function.t13(arbOf_0(EndpointDslFile_instance, $shape.e34_1 + '.' + $variant.s34_1));
2260
+ $this$function.z13($this$function.d15($scopeName + '().apply(block).build()'));
2261
+ return Unit_instance;
2262
+ };
2263
+ }
2264
+ function EndpointDslFile$buildGenerateWrapper$lambda($shape) {
2265
+ return function ($this$struct) {
2266
+ $this$struct.r15();
2267
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
2268
+ $this$struct.s15(Visibility_INTERNAL_getInstance());
2269
+ $this$struct.k16('request', VOID, VOID, EndpointDslFile$buildGenerateWrapper$lambda$lambda($shape));
2270
+ // Inline function 'kotlin.collections.forEach' call
2271
+ var _iterator__ex2g4s = $shape.m34_1.t();
2272
+ while (_iterator__ex2g4s.u()) {
2273
+ var element = _iterator__ex2g4s.v();
2274
+ var scopeName = $shape.e34_1 + element.s34_1 + 'Scope';
2275
+ var tmp = 'response' + element.r34_1;
2276
+ $this$struct.g16(tmp, VOID, VOID, EndpointDslFile$buildGenerateWrapper$lambda$lambda_0(scopeName, $shape, element));
2277
+ }
2278
+ return Unit_instance;
2279
+ };
2280
+ }
2281
+ function EndpointDslFile$buildRequestCall$lambda($shape) {
2282
+ return function ($this$asyncFunction) {
2283
+ $this$asyncFunction.v13(Visibility_PUBLIC_getInstance());
2284
+ $this$asyncFunction.u13(genOf_0(EndpointDslFile_instance, $shape.e34_1 + '.Request'));
2285
+ $this$asyncFunction.t13(Custom_init_$Create$($shape.e34_1 + '.Response<*>'));
2286
+ $this$asyncFunction.z13($this$asyncFunction.d15('requestCall(' + $shape.e34_1 + '.api, ' + $shape.e34_1 + ', this)'));
2287
+ return Unit_instance;
2288
+ };
2289
+ }
2290
+ function EndpointDslFile$buildResponseMock$lambda($shape) {
2291
+ return function ($this$asyncFunction) {
2292
+ $this$asyncFunction.v13(Visibility_PUBLIC_getInstance());
2293
+ $this$asyncFunction.u13(genOf_0(EndpointDslFile_instance, $shape.e34_1 + '.Response<*>'));
2294
+ $this$asyncFunction.w13('predicate', new Function_0(listOf(Custom_init_$Create$($shape.e34_1 + '.Request')), Boolean_instance));
2295
+ $this$asyncFunction.t13(Unit_instance_0);
2296
+ $this$asyncFunction.z13($this$asyncFunction.d15('responseMock(' + $shape.e34_1 + '.api, this, predicate)'));
2297
+ return Unit_instance;
2298
+ };
2299
+ }
2300
+ function EndpointDslFile$buildResponseScope$lambda$lambda($variantType, $bodyType, $variant) {
2301
+ return function ($this$function) {
2302
+ $this$function.v13(Visibility_PUBLIC_getInstance());
2303
+ $this$function.t13(arbOf_0(EndpointDslFile_instance, $variantType));
2304
+ var tmp;
2305
+ if (!($bodyType == null)) {
2306
+ $this$function.s14('body?.let { inner.body(it) }');
2307
+ tmp = Unit_instance;
2308
+ }
2309
+ // Inline function 'kotlin.collections.forEach' call
2310
+ var _iterator__ex2g4s = $variant.w34_1.t();
2311
+ while (_iterator__ex2g4s.u()) {
2312
+ var element = _iterator__ex2g4s.v();
2313
+ $this$function.s14(escapeKotlinIdentifier(element.o34_1) + '?.let { inner.headerGen("' + element.o34_1 + '", it) }');
2314
+ }
2315
+ $this$function.s14('@Suppress("UNCHECKED_CAST")');
2316
+ $this$function.z13($this$function.f15(new FunctionCall(VariableReference_init_$Create$('inner'), VOID, Companion_getInstance().wt('buildGen')), arbOf_0(EndpointDslFile_instance, $variantType)));
2317
+ return Unit_instance;
2318
+ };
2319
+ }
2320
+ function EndpointDslFile$buildResponseScope$lambda($shape, $variantType, $bodyType, $variant) {
2321
+ return function ($this$struct) {
2322
+ $this$struct.r15();
2323
+ $this$struct.q15('@WirespecScenarioDsl');
2324
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
2325
+ $this$struct.s15(Visibility_INTERNAL_getInstance());
2326
+ $this$struct.s14('private val inner = responseCall(' + $shape.e34_1 + ', ' + $variantType + '::class)');
2327
+ var tmp;
2328
+ if (!($bodyType == null)) {
2329
+ $this$struct.e16('body', genNullableOf(EndpointDslFile_instance, $bodyType), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('null'));
2330
+ valueSetter($this$struct, 'body', $bodyType);
2331
+ tmp = Unit_instance;
2332
+ }
2333
+ // Inline function 'kotlin.collections.forEach' call
2334
+ var _iterator__ex2g4s = $variant.w34_1.t();
2335
+ while (_iterator__ex2g4s.u()) {
2336
+ var element = _iterator__ex2g4s.v();
2337
+ $this$struct.e16(element.o34_1, genNullableOf(EndpointDslFile_instance, element.p34_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('null'));
2338
+ valueSetter($this$struct, element.o34_1, element.p34_1);
2339
+ }
2340
+ $this$struct.g16('build', VOID, VOID, EndpointDslFile$buildResponseScope$lambda$lambda($variantType, $bodyType, $variant));
2341
+ return Unit_instance;
2342
+ };
2343
+ }
2344
+ function EndpointDslFile$buildScopeClass$lambda$lambda($builderClass, $slot) {
2345
+ return function ($this$function) {
2346
+ $this$function.v13(Visibility_PUBLIC_getInstance());
2347
+ $this$function.w13('block', blockType(EndpointDslFile_instance, $builderClass));
2348
+ $this$function.s14('this.' + $slot.b34_1 + ' = block');
2349
+ return Unit_instance;
2350
+ };
2351
+ }
2352
+ function EndpointDslFile$buildScopeClass$lambda$lambda_0($builderName) {
2353
+ return function ($this$function) {
2354
+ $this$function.v13(Visibility_PUBLIC_getInstance());
2355
+ $this$function.w13('block', blockType(EndpointDslFile_instance, $builderName));
2356
+ $this$function.s14('this.body = block');
2357
+ return Unit_instance;
2358
+ };
2359
+ }
2360
+ function EndpointDslFile$buildScopeClass$lambda$lambda_1($shape, $present, $required) {
2361
+ return function ($this$function) {
2362
+ $this$function.v13(Visibility_PRIVATE_getInstance());
2363
+ // Inline function 'kotlin.text.trimEnd' call
2364
+ var this_0 = renderFlushBody(EndpointDslFile_instance, $shape, $present, $required);
2365
+ var tmp$ret$0 = toString(trimEnd(isCharSequence(this_0) ? this_0 : THROW_CCE()));
2366
+ $this$function.s14(tmp$ret$0);
2367
+ return Unit_instance;
2368
+ };
2369
+ }
2370
+ function EndpointDslFile$buildScopeClass$lambda$lambda_2($shape) {
2371
+ return function ($this$function) {
2372
+ $this$function.v13(Visibility_PUBLIC_getInstance());
2373
+ $this$function.t13(arbOf_0(EndpointDslFile_instance, $shape.e34_1 + '.Request'));
2374
+ $this$function.s14('flush()');
2375
+ $this$function.z13($this$function.d15('inner.buildRequestGen()'));
2376
+ return Unit_instance;
2377
+ };
2378
+ }
2379
+ function EndpointDslFile$buildScopeClass$lambda($shape, $present, $required) {
2380
+ return function ($this$struct) {
2381
+ $this$struct.r15();
2382
+ $this$struct.q15('@WirespecScenarioDsl');
2383
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
2384
+ $this$struct.s15(Visibility_INTERNAL_getInstance());
2385
+ $this$struct.s14('private val inner = endpointCall(' + $shape.e34_1 + '.api, ' + $shape.e34_1 + ')');
2386
+ // Inline function 'kotlin.collections.forEach' call
2387
+ var _iterator__ex2g4s = $present.t();
2388
+ while (_iterator__ex2g4s.u()) {
2389
+ var element = _iterator__ex2g4s.v();
2390
+ var builderClass = slotBuilderName(EndpointDslFile_instance, $shape, element);
2391
+ $this$struct.e16(element.b34_1, new Nullable(blockType(EndpointDslFile_instance, builderClass)), true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.d15('null'));
2392
+ $this$struct.g16(element.b34_1, VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda(builderClass, element));
2393
+ }
2394
+ var tmp;
2395
+ // Inline function 'kotlin.collections.isNotEmpty' call
2396
+ if (!$shape.l34_1.r()) {
2397
+ var builderName = RecordBuilder_instance.z33(requireBodyElementType(EndpointDslFile_instance, $shape));
2398
+ $this$struct.e16('body', new Nullable(blockType(EndpointDslFile_instance, builderName)), true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.d15('null'));
2399
+ $this$struct.g16('body', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_0(builderName));
2400
+ var tmp_0;
2401
+ if ($shape.i34_1.equals(BodyKind_List_getInstance())) {
2402
+ $this$struct.e16('bodyCount', Custom_init_$Create$('IntRange'), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('1..3'));
2403
+ tmp_0 = Unit_instance;
2404
+ }
2405
+ tmp = tmp_0;
2406
+ }
2407
+ var tmp_1;
2408
+ if ($shape.i34_1.equals(BodyKind_Primitive_getInstance())) {
2409
+ var bodyType = requireBodyPrimitiveType(EndpointDslFile_instance, $shape);
2410
+ $this$struct.e16('body', genNullableOf(EndpointDslFile_instance, bodyType), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('null'));
2411
+ valueSetter($this$struct, 'body', bodyType);
2412
+ tmp_1 = Unit_instance;
2413
+ }
2414
+ $this$struct.e16('flushed', Boolean_instance, true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.d15('false'));
2415
+ $this$struct.g16('flush', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_1($shape, $present, $required));
2416
+ $this$struct.g16('buildRequest', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_2($shape));
2417
+ return Unit_instance;
2418
+ };
2419
+ }
2420
+ function EndpointDslFile$buildSlotBuilder$lambda($slot) {
2421
+ return function ($this$struct) {
2422
+ $this$struct.r15();
2423
+ $this$struct.q15('@WirespecScenarioDsl');
2424
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
2425
+ // Inline function 'kotlin.collections.forEach' call
2426
+ var _iterator__ex2g4s = $slot.d34_1.t();
2427
+ while (_iterator__ex2g4s.u()) {
2428
+ var element = _iterator__ex2g4s.v();
2429
+ $this$struct.e16(element.o34_1, genNullableOf(EndpointDslFile_instance, element.p34_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('null'));
2430
+ valueSetter($this$struct, element.o34_1, element.p34_1);
2431
+ }
2432
+ return Unit_instance;
2433
+ };
2434
+ }
2435
+ function EndpointDslFile() {
2436
+ }
2437
+ protoOf(EndpointDslFile).c35 = function (endpoint, packageName, types, refined) {
2438
+ var shape = Companion_instance_4.d35(endpoint, types, refined);
2439
+ var present = presentSlots(this, shape);
2440
+ var required = requiredSlots(this, shape);
2441
+ var kotestPkg = packageName.bt_1 + '.kotest';
2442
+ var endpointPkg = packageName.bt_1 + '.endpoint';
2443
+ var modelPkg = packageName.bt_1 + '.model';
2444
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.e34_1 + 'Dsl');
2445
+ var tmp = Companion_getInstance().wt(fileName);
2446
+ return file(tmp, EndpointDslFile$build$lambda(kotestPkg, shape, endpointPkg, present, modelPkg, required));
2447
+ };
2448
+ var EndpointDslFile_instance;
2449
+ function EndpointDslFile_getInstance() {
2450
+ return EndpointDslFile_instance;
2451
+ }
2452
+ var BodyKind_None_instance;
2453
+ var BodyKind_Object_instance;
2454
+ var BodyKind_List_instance;
2455
+ var BodyKind_Primitive_instance;
2456
+ var BodyKind_entriesInitialized;
2457
+ function BodyKind_initEntries() {
2458
+ if (BodyKind_entriesInitialized)
2459
+ return Unit_instance;
2460
+ BodyKind_entriesInitialized = true;
2461
+ BodyKind_None_instance = new BodyKind('None', 0);
2462
+ BodyKind_Object_instance = new BodyKind('Object', 1);
2463
+ BodyKind_List_instance = new BodyKind('List', 2);
2464
+ BodyKind_Primitive_instance = new BodyKind('Primitive', 3);
2465
+ }
2466
+ function Primitive_0(name, type, refinement) {
2467
+ this.e35_1 = name;
2468
+ this.f35_1 = type;
2469
+ this.g35_1 = refinement;
2470
+ }
2471
+ protoOf(Primitive_0).m = function () {
2472
+ return this.e35_1;
2473
+ };
2474
+ protoOf(Primitive_0).toString = function () {
2475
+ return 'Primitive(name=' + this.e35_1 + ', type=' + toString(this.f35_1) + ', refinement=' + toString_1(this.g35_1) + ')';
2476
+ };
2477
+ protoOf(Primitive_0).hashCode = function () {
2478
+ var result = getStringHashCode(this.e35_1);
2479
+ result = imul(result, 31) + hashCode(this.f35_1) | 0;
2480
+ result = imul(result, 31) + (this.g35_1 == null ? 0 : hashCode(this.g35_1)) | 0;
2481
+ return result;
2482
+ };
2483
+ protoOf(Primitive_0).equals = function (other) {
2484
+ if (this === other)
2485
+ return true;
2486
+ if (!(other instanceof Primitive_0))
2487
+ return false;
2488
+ if (!(this.e35_1 === other.e35_1))
2489
+ return false;
2490
+ if (!equals(this.f35_1, other.f35_1))
2491
+ return false;
2492
+ if (!equals(this.g35_1, other.g35_1))
2493
+ return false;
2494
+ return true;
2495
+ };
2496
+ function Nested(name, record) {
2497
+ this.h35_1 = name;
2498
+ this.i35_1 = record;
2499
+ }
2500
+ protoOf(Nested).m = function () {
2501
+ return this.h35_1;
2502
+ };
2503
+ protoOf(Nested).toString = function () {
2504
+ return 'Nested(name=' + this.h35_1 + ', record=' + this.i35_1.toString() + ')';
2505
+ };
2506
+ protoOf(Nested).hashCode = function () {
2507
+ var result = getStringHashCode(this.h35_1);
2508
+ result = imul(result, 31) + this.i35_1.hashCode() | 0;
2509
+ return result;
2510
+ };
2511
+ protoOf(Nested).equals = function (other) {
2512
+ if (this === other)
2513
+ return true;
2514
+ if (!(other instanceof Nested))
2515
+ return false;
2516
+ if (!(this.h35_1 === other.h35_1))
2517
+ return false;
2518
+ if (!this.i35_1.equals(other.i35_1))
2519
+ return false;
2520
+ return true;
2521
+ };
2522
+ function classifyBody($this, reference) {
2523
+ var tmp;
2524
+ var tmp_0;
2525
+ if (reference == null) {
2526
+ tmp_0 = true;
2527
+ } else {
2528
+ tmp_0 = reference instanceof Unit;
2529
+ }
2530
+ if (tmp_0) {
2531
+ tmp = to(BodyKind_None_getInstance(), null);
2532
+ } else {
2533
+ if (reference instanceof Custom) {
2534
+ tmp = to(BodyKind_Object_getInstance(), reference.x19_1);
2535
+ } else {
2536
+ if (reference instanceof Iterable) {
2537
+ var tmp_1 = reference.yp_1;
2538
+ var tmp1_safe_receiver = tmp_1 instanceof Custom ? tmp_1 : null;
2539
+ var tmp_2;
2540
+ if (tmp1_safe_receiver == null) {
2541
+ tmp_2 = null;
2542
+ } else {
2543
+ // Inline function 'kotlin.let' call
2544
+ tmp_2 = to(BodyKind_List_getInstance(), tmp1_safe_receiver.x19_1);
2545
+ }
2546
+ var tmp2_elvis_lhs = tmp_2;
2547
+ tmp = tmp2_elvis_lhs == null ? to(BodyKind_None_getInstance(), null) : tmp2_elvis_lhs;
2548
+ } else {
2549
+ if (reference instanceof Primitive) {
2550
+ tmp = to(BodyKind_Primitive_getInstance(), null);
2551
+ } else {
2552
+ tmp = to(BodyKind_None_getInstance(), null);
2553
+ }
2554
+ }
2555
+ }
2556
+ }
2557
+ return tmp;
2558
+ }
2559
+ function mapWithRefinedUnwrap($this, reference, refined) {
2560
+ var tmp;
2561
+ if (reference instanceof Custom) {
2562
+ var tmp1_safe_receiver = refined.s2(reference.x19_1);
2563
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.ms_1;
2564
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.u1f(VOID, reference.y19_1);
2565
+ var tmp4_elvis_lhs = tmp3_safe_receiver == null ? null : convert(tmp3_safe_receiver);
2566
+ tmp = tmp4_elvis_lhs == null ? convert(reference) : tmp4_elvis_lhs;
2567
+ } else {
2568
+ if (reference instanceof Iterable) {
2569
+ // Inline function 'kotlin.let' call
2570
+ var it = new Array_0(mapWithRefinedUnwrap($this, reference.yp_1, refined));
2571
+ tmp = reference.zp_1 ? new Nullable(it) : it;
2572
+ } else {
2573
+ if (reference instanceof Dict) {
2574
+ // Inline function 'kotlin.let' call
2575
+ var it_0 = new Dict_0(String_instance, mapWithRefinedUnwrap($this, reference.bq_1, refined));
2576
+ tmp = reference.cq_1 ? new Nullable(it_0) : it_0;
2577
+ } else {
2578
+ tmp = convert(reference);
2579
+ }
2580
+ }
2581
+ }
2582
+ return tmp;
2583
+ }
2584
+ function NamedTypedField(name, type, isNullable) {
2585
+ isNullable = isNullable === VOID ? false : isNullable;
2586
+ this.o34_1 = name;
2587
+ this.p34_1 = type;
2588
+ this.q34_1 = isNullable;
2589
+ }
2590
+ protoOf(NamedTypedField).toString = function () {
2591
+ return 'NamedTypedField(name=' + this.o34_1 + ', type=' + toString(this.p34_1) + ', isNullable=' + this.q34_1 + ')';
2592
+ };
2593
+ protoOf(NamedTypedField).hashCode = function () {
2594
+ var result = getStringHashCode(this.o34_1);
2595
+ result = imul(result, 31) + hashCode(this.p34_1) | 0;
2596
+ result = imul(result, 31) + getBooleanHashCode(this.q34_1) | 0;
2597
+ return result;
2598
+ };
2599
+ protoOf(NamedTypedField).equals = function (other) {
2600
+ if (this === other)
2601
+ return true;
2602
+ if (!(other instanceof NamedTypedField))
2603
+ return false;
2604
+ if (!(this.o34_1 === other.o34_1))
2605
+ return false;
2606
+ if (!equals(this.p34_1, other.p34_1))
2607
+ return false;
2608
+ if (!(this.q34_1 === other.q34_1))
2609
+ return false;
2610
+ return true;
2611
+ };
2612
+ function ResponseVariantShape(status, className, bodyKind, bodyType, bodyElementType, headerFields) {
2613
+ this.r34_1 = status;
2614
+ this.s34_1 = className;
2615
+ this.t34_1 = bodyKind;
2616
+ this.u34_1 = bodyType;
2617
+ this.v34_1 = bodyElementType;
2618
+ this.w34_1 = headerFields;
2619
+ }
2620
+ protoOf(ResponseVariantShape).toString = function () {
2621
+ return 'ResponseVariantShape(status=' + this.r34_1 + ', className=' + this.s34_1 + ', bodyKind=' + this.t34_1.toString() + ', bodyType=' + toString_1(this.u34_1) + ', bodyElementType=' + this.v34_1 + ', headerFields=' + toString(this.w34_1) + ')';
2622
+ };
2623
+ protoOf(ResponseVariantShape).hashCode = function () {
2624
+ var result = getStringHashCode(this.r34_1);
2625
+ result = imul(result, 31) + getStringHashCode(this.s34_1) | 0;
2626
+ result = imul(result, 31) + this.t34_1.hashCode() | 0;
2627
+ result = imul(result, 31) + (this.u34_1 == null ? 0 : hashCode(this.u34_1)) | 0;
2628
+ result = imul(result, 31) + (this.v34_1 == null ? 0 : getStringHashCode(this.v34_1)) | 0;
2629
+ result = imul(result, 31) + hashCode(this.w34_1) | 0;
2630
+ return result;
2631
+ };
2632
+ protoOf(ResponseVariantShape).equals = function (other) {
2633
+ if (this === other)
2634
+ return true;
2635
+ if (!(other instanceof ResponseVariantShape))
2636
+ return false;
2637
+ if (!(this.r34_1 === other.r34_1))
2638
+ return false;
2639
+ if (!(this.s34_1 === other.s34_1))
2640
+ return false;
2641
+ if (!this.t34_1.equals(other.t34_1))
2642
+ return false;
2643
+ if (!equals(this.u34_1, other.u34_1))
2644
+ return false;
2645
+ if (!(this.v34_1 == other.v34_1))
2646
+ return false;
2647
+ if (!equals(this.w34_1, other.w34_1))
2648
+ return false;
2649
+ return true;
2650
+ };
2651
+ function BodyKind(name, ordinal) {
2652
+ Enum.call(this, name, ordinal);
2653
+ }
2654
+ function Companion_2() {
2655
+ }
2656
+ protoOf(Companion_2).d35 = function (endpoint, types, refined) {
2657
+ // Inline function 'kotlin.collections.filterIsInstance' call
2658
+ var tmp0 = endpoint.hr_1;
2659
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
2660
+ var destination = ArrayList_init_$Create$();
2661
+ var _iterator__ex2g4s = tmp0.t();
2662
+ while (_iterator__ex2g4s.u()) {
2663
+ var element = _iterator__ex2g4s.v();
2664
+ if (element instanceof Param) {
2665
+ destination.x(element);
2666
+ }
2667
+ }
2668
+ // Inline function 'kotlin.collections.map' call
2669
+ // Inline function 'kotlin.collections.mapTo' call
2670
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
2671
+ var _iterator__ex2g4s_0 = destination.t();
2672
+ while (_iterator__ex2g4s_0.u()) {
2673
+ var item = _iterator__ex2g4s_0.v();
2674
+ var tmp$ret$4 = new NamedTypedField(item.mr_1.o1(), convert(item.nr_1), item.nr_1.ot());
2675
+ destination_0.x(tmp$ret$4);
2676
+ }
2677
+ var pathFields = destination_0;
2678
+ // Inline function 'kotlin.collections.map' call
2679
+ var this_0 = get_fields(endpoint.ir_1);
2680
+ // Inline function 'kotlin.collections.mapTo' call
2681
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
2682
+ var _iterator__ex2g4s_1 = this_0.t();
2683
+ while (_iterator__ex2g4s_1.u()) {
2684
+ var item_0 = _iterator__ex2g4s_1.v();
2685
+ var tmp$ret$7 = new NamedTypedField(item_0.op_1.o1(), convert(item_0.pp_1), item_0.pp_1.ot());
2686
+ destination_1.x(tmp$ret$7);
2687
+ }
2688
+ var queryFields = destination_1;
2689
+ // Inline function 'kotlin.collections.map' call
2690
+ var this_1 = get_fields(endpoint.jr_1);
2691
+ // Inline function 'kotlin.collections.mapTo' call
2692
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
2693
+ var _iterator__ex2g4s_2 = this_1.t();
2694
+ while (_iterator__ex2g4s_2.u()) {
2695
+ var item_1 = _iterator__ex2g4s_2.v();
2696
+ var tmp$ret$10 = new NamedTypedField(item_1.op_1.o1(), convert(item_1.pp_1), item_1.pp_1.ot());
2697
+ destination_2.x(tmp$ret$10);
2698
+ }
2699
+ var headerFields = destination_2;
2700
+ var tmp0_safe_receiver = firstOrNull_0(endpoint.kr_1);
2701
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.or_1;
2702
+ var bodyRef = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.qr_1;
2703
+ var _destruct__k2r9zo = classifyBody(this, bodyRef);
2704
+ var bodyKind = _destruct__k2r9zo.ze();
2705
+ var bodyElementType = _destruct__k2r9zo.af();
2706
+ var tmp;
2707
+ if (bodyRef == null) {
2708
+ tmp = null;
2709
+ } else {
2710
+ // Inline function 'kotlin.takeIf' call
2711
+ var tmp_0;
2712
+ if (bodyKind.equals(BodyKind_Primitive_getInstance())) {
2713
+ tmp_0 = bodyRef;
2714
+ } else {
2715
+ tmp_0 = null;
2716
+ }
2717
+ tmp = tmp_0;
2718
+ }
2719
+ var tmp3_safe_receiver = tmp;
2720
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : convert(tmp3_safe_receiver);
2721
+ var tmp_1;
2722
+ if (tmp4_safe_receiver == null) {
2723
+ tmp_1 = null;
2724
+ } else {
2725
+ // Inline function 'kotlin.let' call
2726
+ var tmp_2;
2727
+ if (tmp4_safe_receiver instanceof Nullable) {
2728
+ tmp_2 = tmp4_safe_receiver.ru_1;
2729
+ } else {
2730
+ tmp_2 = tmp4_safe_receiver;
2731
+ }
2732
+ tmp_1 = tmp_2;
2733
+ }
2734
+ var bodyPrimitiveType = tmp_1;
2735
+ var tmp_3;
2736
+ if (bodyElementType == null) {
2737
+ tmp_3 = null;
2738
+ } else {
2739
+ // Inline function 'kotlin.let' call
2740
+ tmp_3 = Companion_instance_4.t33(bodyElementType, types, refined);
2741
+ }
2742
+ var tmp6_elvis_lhs = tmp_3;
2743
+ var bodyFieldShapes = tmp6_elvis_lhs == null ? emptyList() : tmp6_elvis_lhs;
2744
+ // Inline function 'kotlin.collections.mapNotNull' call
2745
+ var tmp0_0 = endpoint.lr_1;
2746
+ // Inline function 'kotlin.collections.mapNotNullTo' call
2747
+ var destination_3 = ArrayList_init_$Create$();
2748
+ // Inline function 'kotlin.collections.forEach' call
2749
+ var _iterator__ex2g4s_3 = tmp0_0.t();
2750
+ while (_iterator__ex2g4s_3.u()) {
2751
+ var element_0 = _iterator__ex2g4s_3.v();
2752
+ var tmp$ret$21;
2753
+ $l$block_0: {
2754
+ // Inline function 'kotlin.takeIf' call
2755
+ var this_2 = element_0.rr_1;
2756
+ var tmp_4;
2757
+ var tmp$ret$24;
2758
+ $l$block: {
2759
+ // Inline function 'kotlin.text.all' call
2760
+ var inductionVariable = 0;
2761
+ while (inductionVariable < charSequenceLength(this_2)) {
2762
+ var element_1 = charSequenceGet(this_2, inductionVariable);
2763
+ inductionVariable = inductionVariable + 1 | 0;
2764
+ if (!isDigit(element_1)) {
2765
+ tmp$ret$24 = false;
2766
+ break $l$block;
2767
+ }
2768
+ }
2769
+ tmp$ret$24 = true;
2770
+ }
2771
+ if (tmp$ret$24) {
2772
+ tmp_4 = this_2;
2773
+ } else {
2774
+ tmp_4 = null;
2775
+ }
2776
+ var tmp0_elvis_lhs = tmp_4;
2777
+ var tmp_5;
2778
+ if (tmp0_elvis_lhs == null) {
2779
+ tmp$ret$21 = null;
2780
+ break $l$block_0;
2781
+ } else {
2782
+ tmp_5 = tmp0_elvis_lhs;
2783
+ }
2784
+ var status = tmp_5;
2785
+ var tmp1_safe_receiver_0 = element_0.tr_1;
2786
+ var respBodyRef = tmp1_safe_receiver_0 == null ? null : tmp1_safe_receiver_0.qr_1;
2787
+ var tmp_6;
2788
+ if (respBodyRef == null) {
2789
+ tmp_6 = null;
2790
+ } else {
2791
+ // Inline function 'kotlin.let' call
2792
+ var tmp_7;
2793
+ if (respBodyRef instanceof Unit) {
2794
+ tmp_7 = null;
2795
+ } else {
2796
+ tmp_7 = convert(respBodyRef);
2797
+ }
2798
+ tmp_6 = tmp_7;
2799
+ }
2800
+ var respBodyType = tmp_6;
2801
+ var _destruct__k2r9zo_0 = classifyBody(Companion_instance_4, respBodyRef);
2802
+ var respBodyKind = _destruct__k2r9zo_0.ze();
2803
+ var respElementName = _destruct__k2r9zo_0.af();
2804
+ var tmp_8 = 'Response' + status;
2805
+ // Inline function 'kotlin.collections.map' call
2806
+ var this_3 = get_fields(element_0.sr_1);
2807
+ // Inline function 'kotlin.collections.mapTo' call
2808
+ var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
2809
+ var _iterator__ex2g4s_4 = this_3.t();
2810
+ while (_iterator__ex2g4s_4.u()) {
2811
+ var item_2 = _iterator__ex2g4s_4.v();
2812
+ var tmp$ret$30 = new NamedTypedField(item_2.op_1.o1(), convert(item_2.pp_1), item_2.pp_1.ot());
2813
+ destination_4.x(tmp$ret$30);
2814
+ }
2815
+ tmp$ret$21 = new ResponseVariantShape(status, tmp_8, respBodyKind, respBodyType, respElementName, destination_4);
2816
+ }
2817
+ var tmp0_safe_receiver_0 = tmp$ret$21;
2818
+ if (tmp0_safe_receiver_0 == null)
2819
+ null;
2820
+ else {
2821
+ // Inline function 'kotlin.let' call
2822
+ destination_3.x(tmp0_safe_receiver_0);
2823
+ }
2824
+ }
2825
+ // Inline function 'kotlin.collections.distinctBy' call
2826
+ var set = HashSet_init_$Create$();
2827
+ var list = ArrayList_init_$Create$();
2828
+ var _iterator__ex2g4s_5 = destination_3.t();
2829
+ while (_iterator__ex2g4s_5.u()) {
2830
+ var e = _iterator__ex2g4s_5.v();
2831
+ var key = e.r34_1;
2832
+ if (set.x(key)) {
2833
+ list.x(e);
2834
+ }
2835
+ }
2836
+ var responseVariants = list;
2837
+ // Inline function 'kotlin.collections.buildList' call
2838
+ // Inline function 'kotlin.collections.buildListInternal' call
2839
+ // Inline function 'kotlin.apply' call
2840
+ var this_4 = ArrayList_init_$Create$();
2841
+ // Inline function 'kotlin.collections.filterIsInstance' call
2842
+ var tmp0_1 = endpoint.hr_1;
2843
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
2844
+ var destination_5 = ArrayList_init_$Create$();
2845
+ var _iterator__ex2g4s_6 = tmp0_1.t();
2846
+ while (_iterator__ex2g4s_6.u()) {
2847
+ var element_2 = _iterator__ex2g4s_6.v();
2848
+ if (element_2 instanceof Param) {
2849
+ destination_5.x(element_2);
2850
+ }
2851
+ }
2852
+ // Inline function 'kotlin.collections.forEach' call
2853
+ var _iterator__ex2g4s_7 = destination_5.t();
2854
+ while (_iterator__ex2g4s_7.u()) {
2855
+ var element_3 = _iterator__ex2g4s_7.v();
2856
+ this_4.x(element_3.nr_1);
2857
+ }
2858
+ // Inline function 'kotlin.collections.forEach' call
2859
+ var _iterator__ex2g4s_8 = get_fields(endpoint.ir_1).t();
2860
+ while (_iterator__ex2g4s_8.u()) {
2861
+ var element_4 = _iterator__ex2g4s_8.v();
2862
+ this_4.x(element_4.pp_1);
2863
+ }
2864
+ // Inline function 'kotlin.collections.forEach' call
2865
+ var _iterator__ex2g4s_9 = get_fields(endpoint.jr_1).t();
2866
+ while (_iterator__ex2g4s_9.u()) {
2867
+ var element_5 = _iterator__ex2g4s_9.v();
2868
+ this_4.x(element_5.pp_1);
2869
+ }
2870
+ if (!(bodyRef == null)) {
2871
+ this_4.x(bodyRef);
2872
+ }
2873
+ // Inline function 'kotlin.collections.forEach' call
2874
+ var _iterator__ex2g4s_10 = endpoint.lr_1.t();
2875
+ while (_iterator__ex2g4s_10.u()) {
2876
+ var element_6 = _iterator__ex2g4s_10.v();
2877
+ var tmp0_safe_receiver_1 = element_6.tr_1;
2878
+ var tmp1_safe_receiver_1 = tmp0_safe_receiver_1 == null ? null : tmp0_safe_receiver_1.qr_1;
2879
+ if (tmp1_safe_receiver_1 == null)
2880
+ null;
2881
+ else {
2882
+ // Inline function 'kotlin.let' call
2883
+ this_4.x(tmp1_safe_receiver_1);
2884
+ }
2885
+ // Inline function 'kotlin.collections.forEach' call
2886
+ var _iterator__ex2g4s_11 = get_fields(element_6.sr_1).t();
2887
+ while (_iterator__ex2g4s_11.u()) {
2888
+ var element_7 = _iterator__ex2g4s_11.v();
2889
+ this_4.x(element_7.pp_1);
2890
+ }
2891
+ }
2892
+ var refs = this_4.q5();
2893
+ var modelImports = this.u33(refs);
2894
+ return new EndpointShape(Companion_getInstance().wt(endpoint.fr_1.o1()).zt(), pathFields, queryFields, headerFields, bodyKind, bodyElementType, bodyPrimitiveType, bodyFieldShapes, responseVariants, modelImports);
2895
+ };
2896
+ protoOf(Companion_2).u33 = function (refs) {
2897
+ // Inline function 'kotlin.collections.flatMap' call
2898
+ // Inline function 'kotlin.collections.flatMapTo' call
2899
+ var destination = ArrayList_init_$Create$();
2900
+ var _iterator__ex2g4s = refs.t();
2901
+ while (_iterator__ex2g4s.u()) {
2902
+ var element = _iterator__ex2g4s.v();
2903
+ var list = this.j35(element);
2904
+ addAll(destination, list);
2905
+ }
2906
+ return distinct(destination);
2907
+ };
2908
+ protoOf(Companion_2).j35 = function (reference) {
2909
+ var tmp;
2910
+ if (reference instanceof Custom) {
2911
+ tmp = listOf(reference.x19_1);
2912
+ } else {
2913
+ if (reference instanceof Iterable) {
2914
+ tmp = this.j35(reference.yp_1);
2915
+ } else {
2916
+ if (reference instanceof Dict) {
2917
+ tmp = this.j35(reference.bq_1);
2918
+ } else {
2919
+ tmp = emptyList();
2920
+ }
2921
+ }
2922
+ }
2923
+ return tmp;
2924
+ };
2925
+ protoOf(Companion_2).t33 = function (typeName, types, refined) {
2926
+ var tmp0_safe_receiver = types.s2(typeName);
2927
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.lp_1;
2928
+ // Inline function 'kotlin.collections.orEmpty' call
2929
+ var tmp0_elvis_lhs = tmp1_safe_receiver == null ? null : get_fields(tmp1_safe_receiver);
2930
+ // Inline function 'kotlin.collections.map' call
2931
+ var this_0 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
2932
+ // Inline function 'kotlin.collections.mapTo' call
2933
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
2934
+ var _iterator__ex2g4s = this_0.t();
2935
+ while (_iterator__ex2g4s.u()) {
2936
+ var item = _iterator__ex2g4s.v();
2937
+ var tmp0_safe_receiver_0 = Companion_instance_5.k35(item.pp_1, types);
2938
+ var tmp;
2939
+ if (tmp0_safe_receiver_0 == null) {
2940
+ tmp = null;
2941
+ } else {
2942
+ // Inline function 'kotlin.let' call
2943
+ tmp = new Nested(item.op_1.o1(), tmp0_safe_receiver_0);
2944
+ }
2945
+ var tmp1_elvis_lhs = tmp;
2946
+ var tmp$ret$3 = tmp1_elvis_lhs == null ? new Primitive_0(item.op_1.o1(), mapWithRefinedUnwrap(Companion_instance_4, item.pp_1, refined), Companion_instance_6.l35(item.pp_1, refined)) : tmp1_elvis_lhs;
2947
+ destination.x(tmp$ret$3);
2948
+ }
2949
+ return destination;
2950
+ };
2951
+ var Companion_instance_4;
2952
+ function Companion_getInstance_3() {
2953
+ return Companion_instance_4;
2954
+ }
2955
+ function BodyKind_None_getInstance() {
2956
+ BodyKind_initEntries();
2957
+ return BodyKind_None_instance;
2958
+ }
2959
+ function BodyKind_Object_getInstance() {
2960
+ BodyKind_initEntries();
2961
+ return BodyKind_Object_instance;
2962
+ }
2963
+ function BodyKind_List_getInstance() {
2964
+ BodyKind_initEntries();
2965
+ return BodyKind_List_instance;
2966
+ }
2967
+ function BodyKind_Primitive_getInstance() {
2968
+ BodyKind_initEntries();
2969
+ return BodyKind_Primitive_instance;
2970
+ }
2971
+ function EndpointShape(name, pathFields, queryFields, headerFields, bodyKind, bodyElementType, bodyPrimitiveType, bodyFieldShapes, responseVariants, modelImports) {
2972
+ this.e34_1 = name;
2973
+ this.f34_1 = pathFields;
2974
+ this.g34_1 = queryFields;
2975
+ this.h34_1 = headerFields;
2976
+ this.i34_1 = bodyKind;
2977
+ this.j34_1 = bodyElementType;
2978
+ this.k34_1 = bodyPrimitiveType;
2979
+ this.l34_1 = bodyFieldShapes;
2980
+ this.m34_1 = responseVariants;
2981
+ this.n34_1 = modelImports;
2982
+ }
2983
+ protoOf(EndpointShape).toString = function () {
2984
+ return 'EndpointShape(name=' + this.e34_1 + ', pathFields=' + toString(this.f34_1) + ', queryFields=' + toString(this.g34_1) + ', headerFields=' + toString(this.h34_1) + ', bodyKind=' + this.i34_1.toString() + ', bodyElementType=' + this.j34_1 + ', bodyPrimitiveType=' + toString_1(this.k34_1) + ', bodyFieldShapes=' + toString(this.l34_1) + ', responseVariants=' + toString(this.m34_1) + ', modelImports=' + toString(this.n34_1) + ')';
2985
+ };
2986
+ protoOf(EndpointShape).hashCode = function () {
2987
+ var result = getStringHashCode(this.e34_1);
2988
+ result = imul(result, 31) + hashCode(this.f34_1) | 0;
2989
+ result = imul(result, 31) + hashCode(this.g34_1) | 0;
2990
+ result = imul(result, 31) + hashCode(this.h34_1) | 0;
2991
+ result = imul(result, 31) + this.i34_1.hashCode() | 0;
2992
+ result = imul(result, 31) + (this.j34_1 == null ? 0 : getStringHashCode(this.j34_1)) | 0;
2993
+ result = imul(result, 31) + (this.k34_1 == null ? 0 : hashCode(this.k34_1)) | 0;
2994
+ result = imul(result, 31) + hashCode(this.l34_1) | 0;
2995
+ result = imul(result, 31) + hashCode(this.m34_1) | 0;
2996
+ result = imul(result, 31) + hashCode(this.n34_1) | 0;
2997
+ return result;
2998
+ };
2999
+ protoOf(EndpointShape).equals = function (other) {
3000
+ if (this === other)
3001
+ return true;
3002
+ if (!(other instanceof EndpointShape))
3003
+ return false;
3004
+ if (!(this.e34_1 === other.e34_1))
3005
+ return false;
3006
+ if (!equals(this.f34_1, other.f34_1))
3007
+ return false;
3008
+ if (!equals(this.g34_1, other.g34_1))
3009
+ return false;
3010
+ if (!equals(this.h34_1, other.h34_1))
3011
+ return false;
3012
+ if (!this.i34_1.equals(other.i34_1))
3013
+ return false;
3014
+ if (!(this.j34_1 == other.j34_1))
3015
+ return false;
3016
+ if (!equals(this.k34_1, other.k34_1))
3017
+ return false;
3018
+ if (!equals(this.l34_1, other.l34_1))
3019
+ return false;
3020
+ if (!equals(this.m34_1, other.m34_1))
3021
+ return false;
3022
+ if (!equals(this.n34_1, other.n34_1))
3023
+ return false;
3024
+ return true;
3025
+ };
3026
+ function genNullable($this, element) {
3027
+ return new Nullable(Custom_init_$Create$('Gen', listOf(element)));
3028
+ }
3029
+ function blockType_0($this, nested) {
3030
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(nested));
3031
+ }
3032
+ function blockField($this, fieldName) {
3033
+ return escapeKotlinIdentifier('_' + fieldName + 'Block');
3034
+ }
3035
+ function nestedBlock($this, $receiver, fieldName, record) {
3036
+ var nested = $this.z33(record.x34_1);
3037
+ $receiver.e16(fieldName, genNullable($this, record.m35()), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $receiver.d15('null'));
3038
+ valueSetter($receiver, fieldName, record.m35());
3039
+ $receiver.e16('_' + fieldName + 'Block', new Nullable(blockType_0($this, nested)), true, Visibility_PRIVATE_getInstance(), VOID, VOID, $receiver.d15('null'));
3040
+ var tmp = fieldName + 'Block';
3041
+ $receiver.g16(tmp, VOID, VOID, RecordBuilder$nestedBlock$lambda(nested, fieldName));
3042
+ }
3043
+ function copyExpr($this, fields) {
3044
+ return joinToString(fields, ',\n', 'base.copy(\n', ',\n)', VOID, VOID, RecordBuilder$copyExpr$lambda);
3045
+ }
3046
+ function RecordBuilder$buildBuilderClass$lambda$lambda($model, $fields) {
3047
+ return function ($this$function) {
3048
+ $this$function.v13(Visibility_INTERNAL_getInstance());
3049
+ $this$function.w13('base', $model);
3050
+ $this$function.w13('rs', Custom_init_$Create$('RandomSource'));
3051
+ $this$function.t13($model);
3052
+ // Inline function 'kotlin.takeIf' call
3053
+ var this_0 = $fields;
3054
+ var tmp;
3055
+ // Inline function 'kotlin.collections.isNotEmpty' call
3056
+ if (!this_0.r()) {
3057
+ tmp = this_0;
3058
+ } else {
3059
+ tmp = null;
3060
+ }
3061
+ var tmp0_safe_receiver = tmp;
3062
+ var tmp_0;
3063
+ if (tmp0_safe_receiver == null) {
3064
+ tmp_0 = null;
3065
+ } else {
3066
+ // Inline function 'kotlin.let' call
3067
+ tmp_0 = copyExpr(RecordBuilder_instance, tmp0_safe_receiver);
3068
+ }
3069
+ var tmp1_elvis_lhs = tmp_0;
3070
+ $this$function.z13($this$function.d15(tmp1_elvis_lhs == null ? 'base' : tmp1_elvis_lhs));
3071
+ return Unit_instance;
3072
+ };
3073
+ }
3074
+ function RecordBuilder$buildBuilderClass$lambda($fields, $typeName) {
3075
+ return function ($this$struct) {
3076
+ $this$struct.r15();
3077
+ $this$struct.q15('@WirespecScenarioDsl');
3078
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
3079
+ // Inline function 'kotlin.collections.forEach' call
3080
+ var _iterator__ex2g4s = $fields.t();
3081
+ while (_iterator__ex2g4s.u()) {
3082
+ var element = _iterator__ex2g4s.v();
3083
+ if (element instanceof Primitive_0) {
3084
+ $this$struct.e16(element.e35_1, genNullable(RecordBuilder_instance, element.f35_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.d15('null'));
3085
+ valueSetter($this$struct, element.e35_1, element.f35_1);
3086
+ } else {
3087
+ if (element instanceof Nested) {
3088
+ nestedBlock(RecordBuilder_instance, $this$struct, element.h35_1, element.i35_1);
3089
+ } else {
3090
+ noWhenBranchMatchedException();
3091
+ }
3092
+ }
3093
+ }
3094
+ var model = Custom_init_$Create$(Companion_getInstance().wt($typeName).zt());
3095
+ $this$struct.g16('applyTo', VOID, VOID, RecordBuilder$buildBuilderClass$lambda$lambda(model, $fields));
3096
+ return Unit_instance;
3097
+ };
3098
+ }
3099
+ function RecordBuilder$nestedBlock$lambda($nested, $fieldName) {
3100
+ return function ($this$function) {
3101
+ $this$function.v13(Visibility_PUBLIC_getInstance());
3102
+ $this$function.w13('block', blockType_0(RecordBuilder_instance, $nested));
3103
+ $this$function.s14(blockField(RecordBuilder_instance, $fieldName) + ' = block');
3104
+ return Unit_instance;
3105
+ };
3106
+ }
3107
+ function RecordBuilder$copyExpr$lambda(f) {
3108
+ var name = escapeKotlinIdentifier(f.m());
3109
+ var pinned = 'this.' + name;
3110
+ var base = 'base.' + name;
3111
+ var tmp;
3112
+ if (f instanceof Primitive_0) {
3113
+ var tmp1_safe_receiver = f.g35_1;
3114
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.n35('gen.draw(rs)');
3115
+ tmp = pinned + '.let { gen -> if (gen == null) ' + base + ' else ' + (tmp2_elvis_lhs == null ? 'gen.draw(rs)' : tmp2_elvis_lhs) + ' }';
3116
+ } else {
3117
+ if (f instanceof Nested) {
3118
+ var nested = RecordBuilder_instance.z33(f.i35_1.x34_1) + '().apply(block)';
3119
+ var tmp_0;
3120
+ if (f.i35_1.y34_1) {
3121
+ tmp_0 = '?.let { block -> ' + nested + ' }?.let { nested -> ' + f.i35_1.b35(base, 'nested') + ' }';
3122
+ } else {
3123
+ tmp_0 = '?.let { block -> ' + f.i35_1.b35(base, nested) + ' }';
3124
+ }
3125
+ var viaBlock = tmp_0;
3126
+ tmp = pinned + '?.draw(rs) ?: this.' + blockField(RecordBuilder_instance, f.h35_1) + viaBlock + ' ?: ' + base;
3127
+ } else {
3128
+ noWhenBranchMatchedException();
3129
+ }
3130
+ }
3131
+ var value = tmp;
3132
+ return ' ' + name + ' = ' + value;
3133
+ }
3134
+ function RecordBuilder() {
3135
+ }
3136
+ protoOf(RecordBuilder).z33 = function (typeName) {
3137
+ return Companion_getInstance().wt(typeName).zt() + 'Builder';
3138
+ };
3139
+ protoOf(RecordBuilder).o35 = function (typeName, fields) {
3140
+ var tmp = this.z33(typeName);
3141
+ return struct(tmp, RecordBuilder$buildBuilderClass$lambda(fields, typeName));
3142
+ };
3143
+ var RecordBuilder_instance;
3144
+ function RecordBuilder_getInstance() {
3145
+ return RecordBuilder_instance;
3146
+ }
3147
+ function Companion_3() {
3148
+ }
3149
+ protoOf(Companion_3).k35 = function (reference, types) {
3150
+ var tmp;
3151
+ if (reference instanceof Custom) {
3152
+ // Inline function 'kotlin.takeIf' call
3153
+ var tmp_0;
3154
+ // Inline function 'kotlin.collections.contains' call
3155
+ // Inline function 'kotlin.collections.containsKey' call
3156
+ var key = reference.x19_1;
3157
+ if ((isInterface(types, KtMap) ? types : THROW_CCE()).q2(key)) {
3158
+ tmp_0 = reference;
3159
+ } else {
3160
+ tmp_0 = null;
3161
+ }
3162
+ var tmp1_safe_receiver = tmp_0;
3163
+ var tmp_1;
3164
+ if (tmp1_safe_receiver == null) {
3165
+ tmp_1 = null;
3166
+ } else {
3167
+ // Inline function 'kotlin.let' call
3168
+ tmp_1 = new RecordRef(tmp1_safe_receiver.x19_1, false, tmp1_safe_receiver.y19_1, false);
3169
+ }
3170
+ tmp = tmp_1;
3171
+ } else {
3172
+ if (reference instanceof Iterable) {
3173
+ var tmp_2 = reference.yp_1;
3174
+ var tmp2_safe_receiver = tmp_2 instanceof Custom ? tmp_2 : null;
3175
+ var tmp_3;
3176
+ if (tmp2_safe_receiver == null) {
3177
+ tmp_3 = null;
3178
+ } else {
3179
+ // Inline function 'kotlin.takeIf' call
3180
+ var tmp_4;
3181
+ // Inline function 'kotlin.collections.contains' call
3182
+ // Inline function 'kotlin.collections.containsKey' call
3183
+ var key_0 = tmp2_safe_receiver.x19_1;
3184
+ if ((isInterface(types, KtMap) ? types : THROW_CCE()).q2(key_0)) {
3185
+ tmp_4 = tmp2_safe_receiver;
3186
+ } else {
3187
+ tmp_4 = null;
3188
+ }
3189
+ tmp_3 = tmp_4;
3190
+ }
3191
+ var tmp3_safe_receiver = tmp_3;
3192
+ var tmp_5;
3193
+ if (tmp3_safe_receiver == null) {
3194
+ tmp_5 = null;
3195
+ } else {
3196
+ // Inline function 'kotlin.let' call
3197
+ tmp_5 = new RecordRef(tmp3_safe_receiver.x19_1, true, reference.zp_1, tmp3_safe_receiver.y19_1);
3198
+ }
3199
+ tmp = tmp_5;
3200
+ } else {
3201
+ tmp = null;
3202
+ }
3203
+ }
3204
+ return tmp;
3205
+ };
3206
+ var Companion_instance_5;
3207
+ function Companion_getInstance_4() {
3208
+ return Companion_instance_5;
3209
+ }
3210
+ function RecordRef(typeName, isList, isNullable, isElementNullable) {
3211
+ this.x34_1 = typeName;
3212
+ this.y34_1 = isList;
3213
+ this.z34_1 = isNullable;
3214
+ this.a35_1 = isElementNullable;
3215
+ }
3216
+ protoOf(RecordRef).m35 = function () {
3217
+ // Inline function 'kotlin.let' call
3218
+ var it = Custom_init_$Create$(this.x34_1);
3219
+ return this.y34_1 ? new Array_0(it) : it;
3220
+ };
3221
+ protoOf(RecordRef).b35 = function (value, builder) {
3222
+ return this.y34_1 ? value + (this.z34_1 ? '?.' : '.') + 'map { e -> ' + ((this.a35_1 ? 'e?.let { ' + builder + '.applyTo(it, rs) }' : builder + '.applyTo(e, rs)') + ' }') : this.z34_1 ? value + '?.let { ' + builder + '.applyTo(it, rs) }' : builder + '.applyTo(' + value + ', rs)';
3223
+ };
3224
+ protoOf(RecordRef).toString = function () {
3225
+ return 'RecordRef(typeName=' + this.x34_1 + ', isList=' + this.y34_1 + ', isNullable=' + this.z34_1 + ', isElementNullable=' + this.a35_1 + ')';
3226
+ };
3227
+ protoOf(RecordRef).hashCode = function () {
3228
+ var result = getStringHashCode(this.x34_1);
3229
+ result = imul(result, 31) + getBooleanHashCode(this.y34_1) | 0;
3230
+ result = imul(result, 31) + getBooleanHashCode(this.z34_1) | 0;
3231
+ result = imul(result, 31) + getBooleanHashCode(this.a35_1) | 0;
3232
+ return result;
3233
+ };
3234
+ protoOf(RecordRef).equals = function (other) {
3235
+ if (this === other)
3236
+ return true;
3237
+ if (!(other instanceof RecordRef))
3238
+ return false;
3239
+ if (!(this.x34_1 === other.x34_1))
3240
+ return false;
3241
+ if (!(this.y34_1 === other.y34_1))
3242
+ return false;
3243
+ if (!(this.z34_1 === other.z34_1))
3244
+ return false;
3245
+ if (!(this.a35_1 === other.a35_1))
3246
+ return false;
3247
+ return true;
3248
+ };
3249
+ function Wrap(typeName, isNullable) {
3250
+ this.p35_1 = typeName;
3251
+ this.q35_1 = isNullable;
3252
+ }
3253
+ protoOf(Wrap).ot = function () {
3254
+ return this.q35_1;
3255
+ };
3256
+ protoOf(Wrap).toString = function () {
3257
+ return 'Wrap(typeName=' + this.p35_1 + ', isNullable=' + this.q35_1 + ')';
3258
+ };
3259
+ protoOf(Wrap).hashCode = function () {
3260
+ var result = getStringHashCode(this.p35_1);
3261
+ result = imul(result, 31) + getBooleanHashCode(this.q35_1) | 0;
3262
+ return result;
3263
+ };
3264
+ protoOf(Wrap).equals = function (other) {
3265
+ if (this === other)
3266
+ return true;
3267
+ if (!(other instanceof Wrap))
3268
+ return false;
3269
+ if (!(this.p35_1 === other.p35_1))
3270
+ return false;
3271
+ if (!(this.q35_1 === other.q35_1))
3272
+ return false;
3273
+ return true;
3274
+ };
3275
+ function Each(element, isNullable) {
3276
+ this.s35_1 = element;
3277
+ this.t35_1 = isNullable;
3278
+ }
3279
+ protoOf(Each).ot = function () {
3280
+ return this.t35_1;
3281
+ };
3282
+ protoOf(Each).toString = function () {
3283
+ return 'Each(element=' + toString(this.s35_1) + ', isNullable=' + this.t35_1 + ')';
3284
+ };
3285
+ protoOf(Each).hashCode = function () {
3286
+ var result = hashCode(this.s35_1);
3287
+ result = imul(result, 31) + getBooleanHashCode(this.t35_1) | 0;
3288
+ return result;
3289
+ };
3290
+ protoOf(Each).equals = function (other) {
3291
+ if (this === other)
3292
+ return true;
3293
+ if (!(other instanceof Each))
3294
+ return false;
3295
+ if (!equals(this.s35_1, other.s35_1))
3296
+ return false;
3297
+ if (!(this.t35_1 === other.t35_1))
3298
+ return false;
3299
+ return true;
3300
+ };
3301
+ function Values(value, isNullable) {
3302
+ this.u35_1 = value;
3303
+ this.v35_1 = isNullable;
3304
+ }
3305
+ protoOf(Values).ot = function () {
3306
+ return this.v35_1;
3307
+ };
3308
+ protoOf(Values).toString = function () {
3309
+ return 'Values(value=' + toString(this.u35_1) + ', isNullable=' + this.v35_1 + ')';
3310
+ };
3311
+ protoOf(Values).hashCode = function () {
3312
+ var result = hashCode(this.u35_1);
3313
+ result = imul(result, 31) + getBooleanHashCode(this.v35_1) | 0;
3314
+ return result;
3315
+ };
3316
+ protoOf(Values).equals = function (other) {
3317
+ if (this === other)
3318
+ return true;
3319
+ if (!(other instanceof Values))
3320
+ return false;
3321
+ if (!equals(this.u35_1, other.u35_1))
3322
+ return false;
3323
+ if (!(this.v35_1 === other.v35_1))
3324
+ return false;
3325
+ return true;
3326
+ };
3327
+ function Companion_4() {
3328
+ }
3329
+ protoOf(Companion_4).l35 = function (reference, refined) {
3330
+ var tmp;
3331
+ if (reference instanceof Custom) {
3332
+ // Inline function 'kotlin.takeIf' call
3333
+ var this_0 = new Wrap(Companion_getInstance().wt(reference.x19_1).zt(), reference.y19_1);
3334
+ var tmp_0;
3335
+ // Inline function 'kotlin.collections.contains' call
3336
+ // Inline function 'kotlin.collections.containsKey' call
3337
+ var key = reference.x19_1;
3338
+ if ((isInterface(refined, KtMap) ? refined : THROW_CCE()).q2(key)) {
3339
+ tmp_0 = this_0;
3340
+ } else {
3341
+ tmp_0 = null;
3342
+ }
3343
+ tmp = tmp_0;
3344
+ } else {
3345
+ if (reference instanceof Iterable) {
3346
+ var tmp1_safe_receiver = this.l35(reference.yp_1, refined);
3347
+ var tmp_1;
3348
+ if (tmp1_safe_receiver == null) {
3349
+ tmp_1 = null;
3350
+ } else {
3351
+ // Inline function 'kotlin.let' call
3352
+ tmp_1 = new Each(tmp1_safe_receiver, reference.zp_1);
3353
+ }
3354
+ tmp = tmp_1;
3355
+ } else {
3356
+ if (reference instanceof Dict) {
3357
+ var tmp2_safe_receiver = this.l35(reference.bq_1, refined);
3358
+ var tmp_2;
3359
+ if (tmp2_safe_receiver == null) {
3360
+ tmp_2 = null;
3361
+ } else {
3362
+ // Inline function 'kotlin.let' call
3363
+ tmp_2 = new Values(tmp2_safe_receiver, reference.cq_1);
3364
+ }
3365
+ tmp = tmp_2;
3366
+ } else {
3367
+ tmp = null;
3368
+ }
3369
+ }
3370
+ }
3371
+ return tmp;
3372
+ };
3373
+ var Companion_instance_6;
3374
+ function Companion_getInstance_5() {
3375
+ return Companion_instance_6;
3376
+ }
3377
+ function Refinement() {
3378
+ }
3379
+ function buildRequestClass($this, $receiver, shape) {
3380
+ $receiver.p17(shape.y35_1, RpcDslFile$buildRequestClass$lambda(shape));
3381
+ }
3382
+ function buildGenerateWrapper_0($this, $receiver, shape) {
3383
+ var tmp = shape.w35_1 + 'Generate';
3384
+ $receiver.p17(tmp, RpcDslFile$buildGenerateWrapper$lambda(shape));
3385
+ }
3386
+ function outcomeFunction($this, $receiver, name, outcome) {
3387
+ var tmp0_safe_receiver = outcome.i36_1;
3388
+ var tmp;
3389
+ if (tmp0_safe_receiver == null) {
3390
+ tmp = null;
3391
+ } else {
3392
+ // Inline function 'kotlin.let' call
3393
+ tmp = Companion_instance_7.n36(tmp0_safe_receiver.k36_1);
3394
+ }
3395
+ var value = tmp;
3396
+ var wrap = RpcDslFile$outcomeFunction$lambda(outcome);
3397
+ var record = outcome.j36_1;
3398
+ $receiver.g16(name, VOID, VOID, RpcDslFile$outcomeFunction$lambda_0(outcome, value, wrap, record));
3399
+ }
3400
+ function buildCall($this, $receiver, shape) {
3401
+ var args = joinToString(shape.z35_1, ', ', VOID, VOID, VOID, VOID, RpcDslFile$buildCall$lambda);
3402
+ var request = shape.z35_1.r() ? '_' : 'request';
3403
+ $receiver.k16('call', VOID, VOID, RpcDslFile$buildCall$lambda_0(shape, request, args));
3404
+ }
3405
+ function buildValueGenerator($this, $receiver, value, module_0) {
3406
+ var tmp = Companion_instance_7.o36(value.m());
3407
+ $receiver.g16(tmp, VOID, VOID, RpcDslFile$buildValueGenerator$lambda(value, module_0));
3408
+ }
3409
+ function RpcDslFile$build$lambda($kotestPkg, $shape, $packageName, $module) {
3410
+ return function ($this$file) {
3411
+ $this$file.o17($kotestPkg);
3412
+ var tmp;
3413
+ // Inline function 'kotlin.collections.isNotEmpty' call
3414
+ if (!$shape.p36().r()) {
3415
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'generatedGen');
3416
+ $this$file.c16('community.flock.wirespec.kotlin', 'Wirespec');
3417
+ tmp = Unit_instance;
3418
+ }
3419
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'rpcCall');
3420
+ var tmp_0;
3421
+ // Inline function 'kotlin.collections.isNotEmpty' call
3422
+ if (!$shape.a36_1.r()) {
3423
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'WirespecScenarioDsl');
3424
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'draw');
3425
+ $this$file.c16('io.kotest.property', 'RandomSource');
3426
+ tmp_0 = Unit_instance;
3427
+ }
3428
+ $this$file.c16('io.kotest.property.arbitrary', 'constant');
3429
+ var tmp_1;
3430
+ // Inline function 'kotlin.collections.isNotEmpty' call
3431
+ if (!$shape.f36_1.r()) {
3432
+ $this$file.c16('kotlin.reflect', 'typeOf');
3433
+ tmp_1 = Unit_instance;
3434
+ }
3435
+ $this$file.c16('io.kotest.property', 'Arb');
3436
+ $this$file.c16('io.kotest.property', 'Gen');
3437
+ $this$file.c16($packageName.bt_1 + '.rpc', $shape.w35_1);
3438
+ // Inline function 'kotlin.collections.forEach' call
3439
+ var _iterator__ex2g4s = $shape.e36_1.t();
3440
+ while (_iterator__ex2g4s.u()) {
3441
+ var element = _iterator__ex2g4s.v();
3442
+ $this$file.c16($packageName.bt_1 + '.model', Companion_getInstance().wt(element).zt());
3443
+ }
3444
+ // Inline function 'kotlin.collections.forEach' call
3445
+ var _iterator__ex2g4s_0 = $shape.f36_1.t();
3446
+ while (_iterator__ex2g4s_0.u()) {
3447
+ var element_0 = _iterator__ex2g4s_0.v();
3448
+ $this$file.c16($packageName.bt_1 + '.generator', Companion_getInstance().wt(element_0).zt() + 'Generator');
3449
+ }
3450
+ buildRequestClass(RpcDslFile_instance, $this$file, $shape);
3451
+ buildGenerateWrapper_0(RpcDslFile_instance, $this$file, $shape);
3452
+ $this$file.e16('generate', Custom_init_$Create$($shape.w35_1 + 'Generate'), VOID, Visibility_PUBLIC_getInstance(), Custom_init_$Create$($shape.w35_1), VOID, VOID, new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.w35_1 + 'Generate')));
3453
+ buildCall(RpcDslFile_instance, $this$file, $shape);
3454
+ var tmp_2;
3455
+ // Inline function 'kotlin.collections.isNotEmpty' call
3456
+ if (!$shape.a36_1.r()) {
3457
+ $this$file.n17_1.x(RecordBuilder_instance.o35($shape.y35_1, $shape.a36_1));
3458
+ tmp_2 = Unit_instance;
3459
+ }
3460
+ // Inline function 'kotlin.collections.forEach' call
3461
+ var _iterator__ex2g4s_1 = $shape.p36().t();
3462
+ while (_iterator__ex2g4s_1.u()) {
3463
+ var element_1 = _iterator__ex2g4s_1.v();
3464
+ buildValueGenerator(RpcDslFile_instance, $this$file, element_1, $module);
3465
+ }
3466
+ return Unit_instance;
3467
+ };
3468
+ }
3469
+ function RpcDslFile$buildRequestClass$lambda$lambda($this$constructo) {
3470
+ return Unit_instance;
3471
+ }
3472
+ function RpcDslFile$buildRequestClass$lambda($shape) {
3473
+ return function ($this$struct) {
3474
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
3475
+ // Inline function 'kotlin.collections.forEach' call
3476
+ var _iterator__ex2g4s = $shape.z35_1.t();
3477
+ while (_iterator__ex2g4s.u()) {
3478
+ var element = _iterator__ex2g4s.v();
3479
+ $this$struct.x15(new Name(listOf(escapeKotlinIdentifier(element.op_1.o1()))), convert(element.pp_1));
3480
+ }
3481
+ var tmp;
3482
+ if ($shape.z35_1.r()) {
3483
+ $this$struct.y15(RpcDslFile$buildRequestClass$lambda$lambda);
3484
+ tmp = Unit_instance;
3485
+ }
3486
+ return Unit_instance;
3487
+ };
3488
+ }
3489
+ function RpcDslFile$buildGenerateWrapper$lambda$lambda($builder, $requestArb, $shape) {
3490
+ return function ($this$function) {
3491
+ $this$function.v13(Visibility_PUBLIC_getInstance());
3492
+ $this$function.y13('block', $this$function.c15(Unit_instance_0, Custom_init_$Create$($builder)), $this$function.d15('{}'));
3493
+ $this$function.t13($requestArb);
3494
+ $this$function.s14('val builder = ' + $builder + '().apply(block)');
3495
+ $this$function.s14('return generatedGen { generator, rs -> builder.applyTo(' + Companion_instance_7.n36($shape.y35_1) + ', rs) }');
3496
+ return Unit_instance;
3497
+ };
3498
+ }
3499
+ function RpcDslFile$buildGenerateWrapper$lambda$lambda_0($requestArb, $shape) {
3500
+ return function ($this$function) {
3501
+ $this$function.v13(Visibility_PUBLIC_getInstance());
3502
+ $this$function.t13($requestArb);
3503
+ $this$function.z13($this$function.d15('Arb.constant(' + $shape.y35_1 + ')'));
3504
+ return Unit_instance;
3505
+ };
3506
+ }
3507
+ function RpcDslFile$buildGenerateWrapper$lambda($shape) {
3508
+ return function ($this$struct) {
3509
+ $this$struct.r15();
3510
+ $this$struct.v13(Visibility_PUBLIC_getInstance());
3511
+ $this$struct.s15(Visibility_INTERNAL_getInstance());
3512
+ var requestArb = Custom_init_$Create$('Arb', listOf(Custom_init_$Create$($shape.y35_1)));
3513
+ var tmp;
3514
+ // Inline function 'kotlin.collections.isNotEmpty' call
3515
+ if (!$shape.a36_1.r()) {
3516
+ var builder = RecordBuilder_instance.z33($shape.y35_1);
3517
+ $this$struct.g16('request', VOID, VOID, RpcDslFile$buildGenerateWrapper$lambda$lambda(builder, requestArb, $shape));
3518
+ tmp = Unit_instance;
3519
+ } else {
3520
+ $this$struct.g16('request', VOID, VOID, RpcDslFile$buildGenerateWrapper$lambda$lambda_0(requestArb, $shape));
3521
+ tmp = Unit_instance;
3522
+ }
3523
+ outcomeFunction(RpcDslFile_instance, $this$struct, 'result', $shape.b36_1);
3524
+ var tmp0_safe_receiver = $shape.c36_1;
3525
+ if (tmp0_safe_receiver == null)
3526
+ null;
3527
+ else {
3528
+ // Inline function 'kotlin.let' call
3529
+ outcomeFunction(RpcDslFile_instance, $this$struct, 'error', tmp0_safe_receiver);
3530
+ }
3531
+ return Unit_instance;
3532
+ };
3533
+ }
3534
+ function RpcDslFile$outcomeFunction$lambda($outcome) {
3535
+ return function (drawn) {
3536
+ var tmp0_safe_receiver = $outcome.h36_1;
3537
+ var tmp;
3538
+ if (tmp0_safe_receiver == null) {
3539
+ tmp = null;
3540
+ } else {
3541
+ // Inline function 'kotlin.let' call
3542
+ tmp = tmp0_safe_receiver + '(' + drawn + ')';
3543
+ }
3544
+ var tmp1_elvis_lhs = tmp;
3545
+ return tmp1_elvis_lhs == null ? drawn : tmp1_elvis_lhs;
3546
+ };
3547
+ }
3548
+ function RpcDslFile$outcomeFunction$lambda_0($outcome, $value, $wrap, $record) {
3549
+ return function ($this$function) {
3550
+ $this$function.v13(Visibility_PUBLIC_getInstance());
3551
+ $this$function.t13(Custom_init_$Create$('Arb', listOf(Custom_init_$Create$($outcome.g36_1))));
3552
+ var tmp;
3553
+ if ($value == null) {
3554
+ $this$function.z13($this$function.d15('Arb.constant(' + $wrap('Unit') + ')'));
3555
+ tmp = Unit_instance;
3556
+ } else if ($record == null) {
3557
+ $this$function.z13($this$function.d15('generatedGen { generator, _ -> ' + $wrap($value) + ' }'));
3558
+ tmp = Unit_instance;
3559
+ } else {
3560
+ var builder = RecordBuilder_instance.z33($record.x34_1);
3561
+ $this$function.y13('block', $this$function.c15(Unit_instance_0, Custom_init_$Create$(builder)), $this$function.d15('{}'));
3562
+ $this$function.s14('val builder = ' + builder + '().apply(block)');
3563
+ $this$function.s14('return generatedGen { generator, rs -> ' + $wrap($record.b35($value, 'builder')) + ' }');
3564
+ tmp = Unit_instance;
3565
+ }
3566
+ return Unit_instance;
3567
+ };
3568
+ }
3569
+ function RpcDslFile$buildCall$lambda(it) {
3570
+ return 'request.' + escapeKotlinIdentifier(it.op_1.o1());
3571
+ }
3572
+ function RpcDslFile$buildCall$lambda_0($shape, $request, $args) {
3573
+ return function ($this$asyncFunction) {
3574
+ $this$asyncFunction.v13(Visibility_PUBLIC_getInstance());
3575
+ $this$asyncFunction.u13(Custom_init_$Create$('Gen', listOf(Custom_init_$Create$($shape.y35_1))));
3576
+ $this$asyncFunction.t13(Custom_init_$Create$($shape.d36_1));
3577
+ $this$asyncFunction.z13($this$asyncFunction.d15('rpcCall(' + $shape.w35_1 + '.Service::class, this) { service, ' + $request + ' -> service.' + $shape.x35_1 + '(' + $args + ') }'));
3578
+ return Unit_instance;
3579
+ };
3580
+ }
3581
+ function RpcDslFile$buildValueGenerator$lambda($value, $module) {
3582
+ return function ($this$function) {
3583
+ $this$function.v13(Visibility_PRIVATE_getInstance());
3584
+ $this$function.w13('generator', Custom_init_$Create$('Wirespec.Generator'));
3585
+ $this$function.w13('path', new Array_0(String_instance));
3586
+ $this$function.t13(Custom_init_$Create$($value.b1i()));
3587
+ $this$function.z13($value.q36($module));
3588
+ return Unit_instance;
3589
+ };
3590
+ }
3591
+ function RpcDslFile() {
3592
+ }
3593
+ protoOf(RpcDslFile).r36 = function (rpc, packageName, module_0, types, refined) {
3594
+ var shape = Companion_instance_8.s36(rpc, types, refined);
3595
+ var kotestPkg = packageName.bt_1 + '.kotest';
3596
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.w35_1 + 'Dsl');
3597
+ var tmp = Companion_getInstance().wt(fileName);
3598
+ return file(tmp, RpcDslFile$build$lambda(kotestPkg, shape, packageName, module_0));
3599
+ };
3600
+ var RpcDslFile_instance;
3601
+ function RpcDslFile_getInstance() {
3602
+ return RpcDslFile_instance;
3603
+ }
3604
+ function Request(name, parameters) {
3605
+ this.t36_1 = name;
3606
+ this.u36_1 = parameters;
3607
+ this.v36_1 = this.t36_1;
3608
+ }
3609
+ protoOf(Request).m = function () {
3610
+ return this.t36_1;
3611
+ };
3612
+ protoOf(Request).b1i = function () {
3613
+ return this.v36_1;
3614
+ };
3615
+ protoOf(Request).q36 = function (module_0) {
3616
+ // Inline function 'kotlin.let' call
3617
+ var constructed = generatorConstructor(this.t36_1, this.u36_1, module_0);
3618
+ // Inline function 'kotlin.collections.mapKeys' call
3619
+ var this_0 = constructed.du_1;
3620
+ // Inline function 'kotlin.collections.mapKeysTo' call
3621
+ var destination = LinkedHashMap_init_$Create$(mapCapacity(this_0.c1()));
3622
+ // Inline function 'kotlin.collections.associateByTo' call
3623
+ var _iterator__ex2g4s = this_0.m1().t();
3624
+ while (_iterator__ex2g4s.u()) {
3625
+ var element = _iterator__ex2g4s.v();
3626
+ // Inline function 'kotlin.collections.component1' call
3627
+ var key = element.n1();
3628
+ var tmp = new Name(listOf(escapeKotlinIdentifier(key.xt())));
3629
+ var tmp$ret$7 = element.o1();
3630
+ destination.v2(tmp, tmp$ret$7);
3631
+ }
3632
+ return constructed.fu(VOID, destination);
3633
+ };
3634
+ protoOf(Request).toString = function () {
3635
+ return 'Request(name=' + this.t36_1 + ', parameters=' + toString(this.u36_1) + ')';
3636
+ };
3637
+ protoOf(Request).hashCode = function () {
3638
+ var result = getStringHashCode(this.t36_1);
3639
+ result = imul(result, 31) + hashCode(this.u36_1) | 0;
3640
+ return result;
3641
+ };
3642
+ protoOf(Request).equals = function (other) {
3643
+ if (this === other)
3644
+ return true;
3645
+ if (!(other instanceof Request))
3646
+ return false;
3647
+ if (!(this.t36_1 === other.t36_1))
3648
+ return false;
3649
+ if (!equals(this.u36_1, other.u36_1))
3650
+ return false;
3651
+ return true;
3652
+ };
3653
+ function Value(name, type, reference) {
3654
+ this.k36_1 = name;
3655
+ this.l36_1 = type;
3656
+ this.m36_1 = reference;
3657
+ }
3658
+ protoOf(Value).m = function () {
3659
+ return this.k36_1;
3660
+ };
3661
+ protoOf(Value).b1i = function () {
3662
+ return this.l36_1;
3663
+ };
3664
+ protoOf(Value).q36 = function (module_0) {
3665
+ var tmp = single(generatorConstructor(this.k36_1, listOf(new Field_0(emptyList(), new FieldIdentifier('value'), this.m36_1)), module_0).du_1.u2());
3666
+ // Inline function 'kotlin.let' call
3667
+ var it = tmp instanceof FunctionCall ? tmp : THROW_CCE();
3668
+ return it.qy(VOID, VOID, VOID, plus_1(it.ny_1, to(Companion_getInstance().wt('path'), new VariableReference(Companion_getInstance().wt('path')))));
3669
+ };
3670
+ protoOf(Value).toString = function () {
3671
+ return 'Value(name=' + this.k36_1 + ', type=' + this.l36_1 + ', reference=' + toString(this.m36_1) + ')';
3672
+ };
3673
+ protoOf(Value).hashCode = function () {
3674
+ var result = getStringHashCode(this.k36_1);
3675
+ result = imul(result, 31) + getStringHashCode(this.l36_1) | 0;
3676
+ result = imul(result, 31) + hashCode(this.m36_1) | 0;
3677
+ return result;
3678
+ };
3679
+ protoOf(Value).equals = function (other) {
3680
+ if (this === other)
3681
+ return true;
3682
+ if (!(other instanceof Value))
3683
+ return false;
3684
+ if (!(this.k36_1 === other.k36_1))
3685
+ return false;
3686
+ if (!(this.l36_1 === other.l36_1))
3687
+ return false;
3688
+ if (!equals(this.m36_1, other.m36_1))
3689
+ return false;
3690
+ return true;
3691
+ };
3692
+ function Companion_5() {
3693
+ }
3694
+ protoOf(Companion_5).o36 = function (name) {
3695
+ return 'generate' + name;
3696
+ };
3697
+ protoOf(Companion_5).n36 = function (name) {
3698
+ return this.o36(name) + '(generator, emptyList())';
3699
+ };
3700
+ var Companion_instance_7;
3701
+ function Companion_getInstance_6() {
3702
+ return Companion_instance_7;
3703
+ }
3704
+ function outcome($this, rpcName, kind, reference, wrapped, types) {
3705
+ var valueType = KotlinGenerator_getInstance().l1c(convert(reference));
3706
+ var tmp = wrapped ? rpcName + '.' + kind : valueType;
3707
+ // Inline function 'kotlin.takeIf' call
3708
+ var this_0 = rpcName + '.' + kind;
3709
+ var tmp_0;
3710
+ if (wrapped) {
3711
+ tmp_0 = this_0;
3712
+ } else {
3713
+ tmp_0 = null;
3714
+ }
3715
+ var tmp_1 = tmp_0;
3716
+ // Inline function 'kotlin.takeIf' call
3717
+ var this_1 = new Value(rpcName + kind, valueType, reference);
3718
+ var tmp_2;
3719
+ if (!(reference instanceof Unit)) {
3720
+ tmp_2 = this_1;
3721
+ } else {
3722
+ tmp_2 = null;
3723
+ }
3724
+ var tmp_3 = tmp_2;
3725
+ var tmp0_safe_receiver = Companion_instance_5.k35(reference, types);
3726
+ var tmp_4;
3727
+ if (tmp0_safe_receiver == null) {
3728
+ tmp_4 = null;
3729
+ } else {
3730
+ // Inline function 'kotlin.takeIf' call
3731
+ var tmp_5;
3732
+ // Inline function 'kotlin.collections.isNotEmpty' call
3733
+ if (!get_fields(getValue(types, tmp0_safe_receiver.x34_1).lp_1).r()) {
3734
+ tmp_5 = tmp0_safe_receiver;
3735
+ } else {
3736
+ tmp_5 = null;
3737
+ }
3738
+ tmp_4 = tmp_5;
3739
+ }
3740
+ return new Outcome(tmp, tmp_1, tmp_3, tmp_4);
3741
+ }
3742
+ function Outcome(type, wrapper, generated, record) {
3743
+ this.g36_1 = type;
3744
+ this.h36_1 = wrapper;
3745
+ this.i36_1 = generated;
3746
+ this.j36_1 = record;
3747
+ }
3748
+ protoOf(Outcome).toString = function () {
3749
+ return 'Outcome(type=' + this.g36_1 + ', wrapper=' + this.h36_1 + ', generated=' + toString_1(this.i36_1) + ', record=' + toString_1(this.j36_1) + ')';
3750
+ };
3751
+ protoOf(Outcome).hashCode = function () {
3752
+ var result = getStringHashCode(this.g36_1);
3753
+ result = imul(result, 31) + (this.h36_1 == null ? 0 : getStringHashCode(this.h36_1)) | 0;
3754
+ result = imul(result, 31) + (this.i36_1 == null ? 0 : this.i36_1.hashCode()) | 0;
3755
+ result = imul(result, 31) + (this.j36_1 == null ? 0 : this.j36_1.hashCode()) | 0;
3756
+ return result;
3757
+ };
3758
+ protoOf(Outcome).equals = function (other) {
3759
+ if (this === other)
3760
+ return true;
3761
+ if (!(other instanceof Outcome))
3762
+ return false;
3763
+ if (!(this.g36_1 === other.g36_1))
3764
+ return false;
3765
+ if (!(this.h36_1 == other.h36_1))
3766
+ return false;
3767
+ if (!equals(this.i36_1, other.i36_1))
3768
+ return false;
3769
+ if (!equals(this.j36_1, other.j36_1))
3770
+ return false;
3771
+ return true;
3772
+ };
3773
+ function Companion_6() {
3774
+ }
3775
+ protoOf(Companion_6).s36 = function (rpc, types, refined) {
3776
+ var name = Companion_getInstance().wt(rpc.rq_1.o1()).zt();
3777
+ var requestName = name + 'Request';
3778
+ var parameters = get_fields(rpc.sq_1);
3779
+ var requestFields = Companion_instance_4.t33(requestName, plus_1(types, to(requestName, syntheticType(requestName, parameters))), refined);
3780
+ var result = outcome(this, name, 'Result', rpc.tq_1, !(rpc.uq_1 == null), types);
3781
+ // Inline function 'kotlin.collections.map' call
3782
+ // Inline function 'kotlin.collections.mapTo' call
3783
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(parameters, 10));
3784
+ var _iterator__ex2g4s = parameters.t();
3785
+ while (_iterator__ex2g4s.u()) {
3786
+ var item = _iterator__ex2g4s.v();
3787
+ var tmp$ret$2 = item.pp_1;
3788
+ destination.x(tmp$ret$2);
3789
+ }
3790
+ var references = plus(destination, listOfNotNull([rpc.tq_1, rpc.uq_1]));
3791
+ var tmp = escapeKotlinIdentifier(Companion_getInstance().wt(rpc.rq_1.o1()).yt());
3792
+ var tmp0_safe_receiver = rpc.uq_1;
3793
+ var tmp_0;
3794
+ if (tmp0_safe_receiver == null) {
3795
+ tmp_0 = null;
3796
+ } else {
3797
+ // Inline function 'kotlin.let' call
3798
+ tmp_0 = outcome(Companion_instance_8, name, 'Error', tmp0_safe_receiver, true, types);
3799
+ }
3800
+ var tmp_1 = tmp_0;
3801
+ var tmp_2 = !(rpc.uq_1 == null) ? name + '.Response' : result.g36_1;
3802
+ var tmp_3 = Companion_instance_4.u33(references);
3803
+ // Inline function 'kotlin.collections.flatMap' call
3804
+ // Inline function 'kotlin.collections.flatMapTo' call
3805
+ var destination_0 = ArrayList_init_$Create$();
3806
+ var _iterator__ex2g4s_0 = references.t();
3807
+ while (_iterator__ex2g4s_0.u()) {
3808
+ var element = _iterator__ex2g4s_0.v();
3809
+ var list = Companion_instance_4.j35(element);
3810
+ addAll(destination_0, list);
3811
+ }
3812
+ return new RpcShape(name, tmp, requestName, parameters, requestFields, result, tmp_1, tmp_2, tmp_3, distinct(destination_0));
3813
+ };
3814
+ var Companion_instance_8;
3815
+ function Companion_getInstance_7() {
3816
+ return Companion_instance_8;
3817
+ }
3818
+ function RpcShape(name, functionName, requestName, parameters, requestFields, result, error, callReturnType, modelImports, generatorImports) {
3819
+ this.w35_1 = name;
3820
+ this.x35_1 = functionName;
3821
+ this.y35_1 = requestName;
3822
+ this.z35_1 = parameters;
3823
+ this.a36_1 = requestFields;
3824
+ this.b36_1 = result;
3825
+ this.c36_1 = error;
3826
+ this.d36_1 = callReturnType;
3827
+ this.e36_1 = modelImports;
3828
+ this.f36_1 = generatorImports;
3829
+ }
3830
+ protoOf(RpcShape).p36 = function () {
3831
+ // Inline function 'kotlin.takeIf' call
3832
+ var this_0 = new Request(this.y35_1, this.z35_1);
3833
+ var tmp;
3834
+ // Inline function 'kotlin.collections.isNotEmpty' call
3835
+ if (!this.z35_1.r()) {
3836
+ tmp = this_0;
3837
+ } else {
3838
+ tmp = null;
3839
+ }
3840
+ var tmp_0 = tmp;
3841
+ var tmp0_safe_receiver = this.c36_1;
3842
+ return listOfNotNull([tmp_0, this.b36_1.i36_1, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.i36_1]);
3843
+ };
3844
+ protoOf(RpcShape).toString = function () {
3845
+ return 'RpcShape(name=' + this.w35_1 + ', functionName=' + this.x35_1 + ', requestName=' + this.y35_1 + ', parameters=' + toString(this.z35_1) + ', requestFields=' + toString(this.a36_1) + ', result=' + this.b36_1.toString() + ', error=' + toString_1(this.c36_1) + ', callReturnType=' + this.d36_1 + ', modelImports=' + toString(this.e36_1) + ', generatorImports=' + toString(this.f36_1) + ')';
3846
+ };
3847
+ protoOf(RpcShape).hashCode = function () {
3848
+ var result = getStringHashCode(this.w35_1);
3849
+ result = imul(result, 31) + getStringHashCode(this.x35_1) | 0;
3850
+ result = imul(result, 31) + getStringHashCode(this.y35_1) | 0;
3851
+ result = imul(result, 31) + hashCode(this.z35_1) | 0;
3852
+ result = imul(result, 31) + hashCode(this.a36_1) | 0;
3853
+ result = imul(result, 31) + this.b36_1.hashCode() | 0;
3854
+ result = imul(result, 31) + (this.c36_1 == null ? 0 : this.c36_1.hashCode()) | 0;
3855
+ result = imul(result, 31) + getStringHashCode(this.d36_1) | 0;
3856
+ result = imul(result, 31) + hashCode(this.e36_1) | 0;
3857
+ result = imul(result, 31) + hashCode(this.f36_1) | 0;
3858
+ return result;
3859
+ };
3860
+ protoOf(RpcShape).equals = function (other) {
3861
+ if (this === other)
3862
+ return true;
3863
+ if (!(other instanceof RpcShape))
3864
+ return false;
3865
+ if (!(this.w35_1 === other.w35_1))
3866
+ return false;
3867
+ if (!(this.x35_1 === other.x35_1))
3868
+ return false;
3869
+ if (!(this.y35_1 === other.y35_1))
3870
+ return false;
3871
+ if (!equals(this.z35_1, other.z35_1))
3872
+ return false;
3873
+ if (!equals(this.a36_1, other.a36_1))
3874
+ return false;
3875
+ if (!this.b36_1.equals(other.b36_1))
3876
+ return false;
3877
+ if (!equals(this.c36_1, other.c36_1))
3878
+ return false;
3879
+ if (!(this.d36_1 === other.d36_1))
3880
+ return false;
3881
+ if (!equals(this.e36_1, other.e36_1))
3882
+ return false;
3883
+ if (!equals(this.f36_1, other.f36_1))
3884
+ return false;
3885
+ return true;
3886
+ };
3887
+ function generatorConstructor(name, fields, module_0) {
3888
+ // Inline function 'community.flock.wirespec.compiler.core.ir.findAll' call
3889
+ var this_0 = convertToGenerator(syntheticType(name, fields), module_0);
3890
+ // Inline function 'kotlin.collections.buildList' call
3891
+ // Inline function 'kotlin.collections.buildListInternal' call
3892
+ // Inline function 'kotlin.apply' call
3893
+ var this_1 = ArrayList_init_$Create$();
3894
+ forEachElement(this_0, generatorConstructor$lambda(this_1));
3895
+ var tmp$ret$0 = this_1.q5();
3896
+ // Inline function 'kotlin.collections.filterIsInstance' call
3897
+ var tmp0 = single_0(tmp$ret$0).rx_1;
3898
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3899
+ var destination = ArrayList_init_$Create$();
3900
+ var _iterator__ex2g4s = tmp0.t();
3901
+ while (_iterator__ex2g4s.u()) {
3902
+ var element = _iterator__ex2g4s.v();
3903
+ if (element instanceof ReturnStatement) {
3904
+ destination.x(element);
3905
+ }
3906
+ }
3907
+ var tmp = single_0(destination).iy_1;
3908
+ return tmp instanceof ConstructorStatement ? tmp : THROW_CCE();
3909
+ }
3910
+ function syntheticType(name, fields) {
3911
+ return new Type(null, emptyList(), new DefinitionIdentifier(name), new Shape(fields), emptyList());
3912
+ }
3913
+ function generatorConstructor$lambda($$this$buildList) {
3914
+ return function (element) {
3915
+ var tmp;
3916
+ if (element instanceof Function) {
3917
+ $$this$buildList.x(element);
3918
+ tmp = Unit_instance;
3919
+ }
3920
+ return Unit_instance;
3921
+ };
3922
+ }
3923
+ function TypeDslFile$build$lambda$lambda($receiver, $builder, $model) {
3924
+ return function ($this$function) {
3925
+ $this$function.v13(Visibility_PUBLIC_getInstance());
3926
+ $this$function.u13(Custom_init_$Create$($receiver));
3927
+ $this$function.y13('block', $this$function.c15(Unit_instance_0, Custom_init_$Create$($builder)), $this$function.d15('{}'));
3928
+ $this$function.t13(Custom_init_$Create$('Arb', listOf(Custom_init_$Create$($model))));
3929
+ $this$function.s14('val builder = ' + $builder + '().apply(block)');
3930
+ $this$function.s14('return generatedGen { generator, rs -> builder.applyTo(' + $model + 'Generator.generate(generator, emptyList()), rs) }');
3931
+ return Unit_instance;
3932
+ };
3933
+ }
3934
+ function TypeDslFile$build$lambda($kotestPkg, $shape, $modelPkg, $packageName, $model, $receiver, $builder) {
3935
+ return function ($this$file) {
3936
+ $this$file.o17($kotestPkg);
3937
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'generatedGen');
3938
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'WirespecScenarioDsl');
3939
+ $this$file.c16('io.kotest.property', 'Arb');
3940
+ $this$file.c16('io.kotest.property', 'RandomSource');
3941
+ var tmp;
3942
+ // Inline function 'kotlin.collections.isNotEmpty' call
3943
+ if (!$shape.x36_1.r()) {
3944
+ $this$file.c16('community.flock.wirespec.integration.kotest.dsl', 'draw');
3945
+ $this$file.c16('io.kotest.property', 'Gen');
3946
+ $this$file.c16('io.kotest.property.arbitrary', 'constant');
3947
+ tmp = Unit_instance;
3948
+ }
3949
+ // Inline function 'kotlin.collections.forEach' call
3950
+ var _iterator__ex2g4s = distinct(plus(listOf($shape.w36_1), $shape.y36_1)).t();
3951
+ while (_iterator__ex2g4s.u()) {
3952
+ var element = _iterator__ex2g4s.v();
3953
+ $this$file.c16($modelPkg, Companion_getInstance().wt(element).zt());
3954
+ }
3955
+ $this$file.c16($packageName.bt_1 + '.generator', $model + 'Generator');
3956
+ $this$file.g16('generate', VOID, VOID, TypeDslFile$build$lambda$lambda($receiver, $builder, $model));
3957
+ $this$file.n17_1.x(RecordBuilder_instance.o35($shape.w36_1, $shape.x36_1));
3958
+ return Unit_instance;
3959
+ };
3960
+ }
3961
+ function TypeDslFile() {
3962
+ }
3963
+ protoOf(TypeDslFile).z36 = function (type, packageName, types, refined) {
3964
+ var shape = Companion_instance_9.a37(type, types, refined);
3965
+ var kotestPkg = packageName.bt_1 + '.kotest';
3966
+ var modelPkg = packageName.bt_1 + '.model';
3967
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.w36_1 + 'Dsl');
3968
+ var model = Companion_getInstance().wt(shape.w36_1).zt();
3969
+ var builder = RecordBuilder_instance.z33(shape.w36_1);
3970
+ var receiver = shape.x36_1.r() ? model : model + '.Companion';
3971
+ var tmp = Companion_getInstance().wt(fileName);
3972
+ return file(tmp, TypeDslFile$build$lambda(kotestPkg, shape, modelPkg, packageName, model, receiver, builder));
3973
+ };
3974
+ var TypeDslFile_instance;
3975
+ function TypeDslFile_getInstance() {
3976
+ return TypeDslFile_instance;
3977
+ }
3978
+ function Companion_7() {
3979
+ }
3980
+ protoOf(Companion_7).a37 = function (type, types, refined) {
3981
+ var name = type.kp_1.o1();
3982
+ var fields = Companion_instance_4.t33(name, types, refined);
3983
+ var tmp = Companion_instance_4;
3984
+ // Inline function 'kotlin.collections.map' call
3985
+ var this_0 = get_fields(type.lp_1);
3986
+ // Inline function 'kotlin.collections.mapTo' call
3987
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3988
+ var _iterator__ex2g4s = this_0.t();
3989
+ while (_iterator__ex2g4s.u()) {
3990
+ var item = _iterator__ex2g4s.v();
3991
+ var tmp$ret$2 = item.pp_1;
3992
+ destination.x(tmp$ret$2);
3993
+ }
3994
+ var modelImports = tmp.u33(destination);
3995
+ return new TypeShape(name, fields, modelImports);
3996
+ };
3997
+ var Companion_instance_9;
3998
+ function Companion_getInstance_8() {
3999
+ return Companion_instance_9;
4000
+ }
4001
+ function TypeShape(name, fields, modelImports) {
4002
+ this.w36_1 = name;
4003
+ this.x36_1 = fields;
4004
+ this.y36_1 = modelImports;
4005
+ }
4006
+ protoOf(TypeShape).toString = function () {
4007
+ return 'TypeShape(name=' + this.w36_1 + ', fields=' + toString(this.x36_1) + ', modelImports=' + toString(this.y36_1) + ')';
4008
+ };
4009
+ protoOf(TypeShape).hashCode = function () {
4010
+ var result = getStringHashCode(this.w36_1);
4011
+ result = imul(result, 31) + hashCode(this.x36_1) | 0;
4012
+ result = imul(result, 31) + hashCode(this.y36_1) | 0;
4013
+ return result;
4014
+ };
4015
+ protoOf(TypeShape).equals = function (other) {
4016
+ if (this === other)
4017
+ return true;
4018
+ if (!(other instanceof TypeShape))
4019
+ return false;
4020
+ if (!(this.w36_1 === other.w36_1))
4021
+ return false;
4022
+ if (!equals(this.x36_1, other.x36_1))
4023
+ return false;
4024
+ if (!equals(this.y36_1, other.y36_1))
4025
+ return false;
4026
+ return true;
4027
+ };
4028
+ function valueSetter(_this__u8e3s4, fieldName, type) {
4029
+ var escaped = escapeKotlinIdentifier(fieldName);
4030
+ _this__u8e3s4.g16(fieldName, VOID, VOID, valueSetter$lambda(type, escaped));
4031
+ }
4032
+ function valueSetter$lambda($type, $escaped) {
4033
+ return function ($this$function) {
4034
+ $this$function.v13(Visibility_PUBLIC_getInstance());
4035
+ $this$function.w13('value', $type);
4036
+ $this$function.s14('this.' + $escaped + ' = Arb.constant(value)');
4037
+ return Unit_instance;
4038
+ };
4039
+ }
4040
+ function injectRecordCompanion($this, $receiver, recordNames, modelPkg) {
4041
+ var tmp;
4042
+ var tmp_0;
4043
+ if ($receiver instanceof File) {
4044
+ var tmp0 = $receiver.cv_1;
4045
+ var tmp$ret$0;
4046
+ $l$block_0: {
4047
+ // Inline function 'kotlin.collections.any' call
4048
+ var tmp_1;
4049
+ if (isInterface(tmp0, Collection)) {
4050
+ tmp_1 = tmp0.r();
4051
+ } else {
4052
+ tmp_1 = false;
4053
+ }
4054
+ if (tmp_1) {
4055
+ tmp$ret$0 = false;
4056
+ break $l$block_0;
4057
+ }
4058
+ var _iterator__ex2g4s = tmp0.t();
4059
+ while (_iterator__ex2g4s.u()) {
4060
+ var element = _iterator__ex2g4s.v();
4061
+ var tmp_2;
4062
+ if (element instanceof Package) {
4063
+ tmp_2 = element.gv_1 === modelPkg;
4064
+ } else {
4065
+ tmp_2 = false;
4066
+ }
4067
+ if (tmp_2) {
4068
+ tmp$ret$0 = true;
4069
+ break $l$block_0;
4070
+ }
4071
+ }
4072
+ tmp$ret$0 = false;
4073
+ }
4074
+ tmp_0 = tmp$ret$0;
4075
+ } else {
4076
+ tmp_0 = false;
4077
+ }
4078
+ if (tmp_0) {
4079
+ // Inline function 'kotlin.collections.map' call
4080
+ var this_0 = $receiver.cv_1;
4081
+ // Inline function 'kotlin.collections.mapTo' call
4082
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
4083
+ var _iterator__ex2g4s_0 = this_0.t();
4084
+ while (_iterator__ex2g4s_0.u()) {
4085
+ var item = _iterator__ex2g4s_0.v();
4086
+ var tmp_3;
4087
+ var tmp_4;
4088
+ var tmp_5;
4089
+ var tmp_6;
4090
+ if (item instanceof Struct) {
4091
+ tmp_6 = recordNames.i1(item.bx_1.zt());
4092
+ } else {
4093
+ tmp_6 = false;
4094
+ }
4095
+ if (tmp_6) {
4096
+ // Inline function 'kotlin.collections.isNotEmpty' call
4097
+ tmp_5 = !fieldList(item).r();
4098
+ } else {
4099
+ tmp_5 = false;
4100
+ }
4101
+ if (tmp_5) {
4102
+ tmp_4 = !hasCompanion($this, item);
4103
+ } else {
4104
+ tmp_4 = false;
4105
+ }
4106
+ if (tmp_4) {
4107
+ tmp_3 = item.mx(VOID, VOID, VOID, VOID, plus_0(item.fx_1, raw('companion object')));
4108
+ } else {
4109
+ tmp_3 = item;
4110
+ }
4111
+ var tmp$ret$4 = tmp_3;
4112
+ destination.x(tmp$ret$4);
4113
+ }
4114
+ tmp = $receiver.fv(VOID, destination);
4115
+ } else {
4116
+ tmp = $receiver;
4117
+ }
4118
+ return tmp;
4119
+ }
4120
+ function hasCompanion($this, $receiver) {
4121
+ var tmp0 = $receiver.fx_1;
4122
+ var tmp$ret$0;
4123
+ $l$block_0: {
4124
+ // Inline function 'kotlin.collections.any' call
4125
+ var tmp;
4126
+ if (isInterface(tmp0, Collection)) {
4127
+ tmp = tmp0.r();
4128
+ } else {
4129
+ tmp = false;
4130
+ }
4131
+ if (tmp) {
4132
+ tmp$ret$0 = false;
4133
+ break $l$block_0;
4134
+ }
4135
+ var _iterator__ex2g4s = tmp0.t();
4136
+ while (_iterator__ex2g4s.u()) {
4137
+ var element = _iterator__ex2g4s.v();
4138
+ var tmp_0;
4139
+ if (element instanceof RawElement) {
4140
+ // Inline function 'kotlin.text.trimStart' call
4141
+ var this_0 = element.ay_1;
4142
+ var tmp$ret$2 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
4143
+ tmp_0 = startsWith(tmp$ret$2, 'companion object');
4144
+ } else {
4145
+ tmp_0 = false;
4146
+ }
4147
+ if (tmp_0) {
4148
+ tmp$ret$0 = true;
4149
+ break $l$block_0;
4150
+ }
4151
+ }
4152
+ tmp$ret$0 = false;
4153
+ }
4154
+ return tmp$ret$0;
4155
+ }
4156
+ function KotestDslExtension(packageName) {
4157
+ this.b37_1 = packageName;
4158
+ }
4159
+ protoOf(KotestDslExtension).f1b = function (ir, ast) {
4160
+ var modules = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4161
+ // Inline function 'kotlin.collections.flatMap' call
4162
+ // Inline function 'kotlin.collections.flatMapTo' call
4163
+ var destination = ArrayList_init_$Create$();
4164
+ var _iterator__ex2g4s = modules.t();
4165
+ while (_iterator__ex2g4s.u()) {
4166
+ var element = _iterator__ex2g4s.v();
4167
+ var list = NonEmptyList__toList_impl_t5xcy2(element.gp_1);
4168
+ addAll(destination, list);
4169
+ }
4170
+ var allStatements = destination;
4171
+ // Inline function 'kotlin.collections.filterIsInstance' call
4172
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4173
+ var destination_0 = ArrayList_init_$Create$();
4174
+ var _iterator__ex2g4s_0 = allStatements.t();
4175
+ while (_iterator__ex2g4s_0.u()) {
4176
+ var element_0 = _iterator__ex2g4s_0.v();
4177
+ if (element_0 instanceof Type) {
4178
+ destination_0.x(element_0);
4179
+ }
4180
+ }
4181
+ // Inline function 'kotlin.collections.associateBy' call
4182
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_0, 10)), 16);
4183
+ // Inline function 'kotlin.collections.associateByTo' call
4184
+ var destination_1 = LinkedHashMap_init_$Create$(capacity);
4185
+ var _iterator__ex2g4s_1 = destination_0.t();
4186
+ while (_iterator__ex2g4s_1.u()) {
4187
+ var element_1 = _iterator__ex2g4s_1.v();
4188
+ var tmp$ret$7 = element_1.kp_1.o1();
4189
+ destination_1.v2(tmp$ret$7, element_1);
4190
+ }
4191
+ var types = destination_1;
4192
+ // Inline function 'kotlin.collections.filterIsInstance' call
4193
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4194
+ var destination_2 = ArrayList_init_$Create$();
4195
+ var _iterator__ex2g4s_2 = allStatements.t();
4196
+ while (_iterator__ex2g4s_2.u()) {
4197
+ var element_2 = _iterator__ex2g4s_2.v();
4198
+ if (element_2 instanceof Refined) {
4199
+ destination_2.x(element_2);
4200
+ }
4201
+ }
4202
+ // Inline function 'kotlin.collections.associateBy' call
4203
+ var capacity_0 = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_2, 10)), 16);
4204
+ // Inline function 'kotlin.collections.associateByTo' call
4205
+ var destination_3 = LinkedHashMap_init_$Create$(capacity_0);
4206
+ var _iterator__ex2g4s_3 = destination_2.t();
4207
+ while (_iterator__ex2g4s_3.u()) {
4208
+ var element_3 = _iterator__ex2g4s_3.v();
4209
+ var tmp$ret$12 = element_3.ls_1.o1();
4210
+ destination_3.v2(tmp$ret$12, element_3);
4211
+ }
4212
+ var refined = destination_3;
4213
+ // Inline function 'kotlin.collections.filterIsInstance' call
4214
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4215
+ var destination_4 = ArrayList_init_$Create$();
4216
+ var _iterator__ex2g4s_4 = allStatements.t();
4217
+ while (_iterator__ex2g4s_4.u()) {
4218
+ var element_4 = _iterator__ex2g4s_4.v();
4219
+ if (element_4 instanceof Endpoint) {
4220
+ destination_4.x(element_4);
4221
+ }
4222
+ }
4223
+ var endpoints = destination_4;
4224
+ // Inline function 'kotlin.collections.filterIsInstance' call
4225
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4226
+ var destination_5 = ArrayList_init_$Create$();
4227
+ var _iterator__ex2g4s_5 = allStatements.t();
4228
+ while (_iterator__ex2g4s_5.u()) {
4229
+ var element_5 = _iterator__ex2g4s_5.v();
4230
+ if (element_5 instanceof Channel) {
4231
+ destination_5.x(element_5);
4232
+ }
4233
+ }
4234
+ var channels = destination_5;
4235
+ // Inline function 'kotlin.collections.map' call
4236
+ var this_0 = types.u2();
4237
+ // Inline function 'kotlin.collections.mapTo' call
4238
+ var destination_6 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
4239
+ var _iterator__ex2g4s_6 = this_0.t();
4240
+ while (_iterator__ex2g4s_6.u()) {
4241
+ var item = _iterator__ex2g4s_6.v();
4242
+ var tmp$ret$19 = TypeDslFile_instance.z36(item, this.b37_1, types, refined);
4243
+ destination_6.x(tmp$ret$19);
4244
+ }
4245
+ var typeDsl = destination_6;
4246
+ // Inline function 'kotlin.collections.map' call
4247
+ // Inline function 'kotlin.collections.mapTo' call
4248
+ var destination_7 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
4249
+ var _iterator__ex2g4s_7 = endpoints.t();
4250
+ while (_iterator__ex2g4s_7.u()) {
4251
+ var item_0 = _iterator__ex2g4s_7.v();
4252
+ var tmp$ret$22 = EndpointDslFile_instance.c35(item_0, this.b37_1, types, refined);
4253
+ destination_7.x(tmp$ret$22);
4254
+ }
4255
+ var endpointDsl = destination_7;
4256
+ // Inline function 'kotlin.collections.mutableSetOf' call
4257
+ var sendPayloads = LinkedHashSet_init_$Create$();
4258
+ // Inline function 'kotlin.collections.map' call
4259
+ // Inline function 'kotlin.collections.mapTo' call
4260
+ var destination_8 = ArrayList_init_$Create$_0(collectionSizeOrDefault(channels, 10));
4261
+ var _iterator__ex2g4s_8 = channels.t();
4262
+ while (_iterator__ex2g4s_8.u()) {
4263
+ var item_1 = _iterator__ex2g4s_8.v();
4264
+ var payload = Companion_instance_3.s33(item_1, types, refined).w33_1;
4265
+ var tmp$ret$26 = ChannelDslFile_instance.a34(item_1, this.b37_1, types, refined, sendPayloads.x(payload));
4266
+ destination_8.x(tmp$ret$26);
4267
+ }
4268
+ var channelDsl = destination_8;
4269
+ // Inline function 'kotlin.collections.flatMap' call
4270
+ // Inline function 'kotlin.collections.flatMapTo' call
4271
+ var destination_9 = ArrayList_init_$Create$();
4272
+ var _iterator__ex2g4s_9 = modules.t();
4273
+ while (_iterator__ex2g4s_9.u()) {
4274
+ var element_6 = _iterator__ex2g4s_9.v();
4275
+ // Inline function 'kotlin.collections.filterIsInstance' call
4276
+ var tmp0 = new NonEmptyList(element_6.gp_1);
4277
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4278
+ var destination_10 = ArrayList_init_$Create$();
4279
+ var _iterator__ex2g4s_10 = tmp0.t();
4280
+ while (_iterator__ex2g4s_10.u()) {
4281
+ var element_7 = _iterator__ex2g4s_10.v();
4282
+ if (element_7 instanceof Rpc) {
4283
+ destination_10.x(element_7);
4284
+ }
4285
+ }
4286
+ // Inline function 'kotlin.collections.map' call
4287
+ // Inline function 'kotlin.collections.mapTo' call
4288
+ var destination_11 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_10, 10));
4289
+ var _iterator__ex2g4s_11 = destination_10.t();
4290
+ while (_iterator__ex2g4s_11.u()) {
4291
+ var item_2 = _iterator__ex2g4s_11.v();
4292
+ var tmp$ret$34 = RpcDslFile_instance.r36(item_2, this.b37_1, element_6, types, refined);
4293
+ destination_11.x(tmp$ret$34);
4294
+ }
4295
+ var list_0 = destination_11;
4296
+ addAll(destination_9, list_0);
4297
+ }
4298
+ var rpcDsl = destination_9;
4299
+ var extra = plus(plus(plus(typeDsl, endpointDsl), channelDsl), rpcDsl);
4300
+ // Inline function 'kotlin.collections.map' call
4301
+ var this_1 = types.u2();
4302
+ // Inline function 'kotlin.collections.mapTo' call
4303
+ var destination_12 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
4304
+ var _iterator__ex2g4s_12 = this_1.t();
4305
+ while (_iterator__ex2g4s_12.u()) {
4306
+ var item_3 = _iterator__ex2g4s_12.v();
4307
+ var tmp$ret$37 = Companion_getInstance().wt(item_3.kp_1.o1()).zt();
4308
+ destination_12.x(tmp$ret$37);
4309
+ }
4310
+ var recordNames = toSet_0(destination_12);
4311
+ var modelPkg = this.b37_1.bt_1 + '.model';
4312
+ // Inline function 'arrow.core.NonEmptyList.map' call
4313
+ // Inline function 'kotlin.collections.map' call
4314
+ var this_2 = _NonEmptyList___get_all__impl__pmf509(ir);
4315
+ // Inline function 'kotlin.collections.mapTo' call
4316
+ var destination_13 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
4317
+ var _iterator__ex2g4s_13 = this_2.t();
4318
+ while (_iterator__ex2g4s_13.u()) {
4319
+ var item_4 = _iterator__ex2g4s_13.v();
4320
+ var tmp$ret$41 = injectRecordCompanion(this, item_4, recordNames, modelPkg);
4321
+ destination_13.x(tmp$ret$41);
4322
+ }
4323
+ var withCompanions = _NonEmptyList___init__impl__fxd0xp(destination_13);
4324
+ return NonEmptyList__plus_impl_xqmb9(withCompanions, extra);
4325
+ };
4326
+ function annotateSerializable($this, $receiver, serialNames, serializableOnlyNames) {
4327
+ // Inline function 'kotlin.collections.flatMap' call
4328
+ var tmp0 = $receiver.cv_1;
4329
+ // Inline function 'kotlin.collections.flatMapTo' call
4330
+ var destination = ArrayList_init_$Create$();
4331
+ var _iterator__ex2g4s = tmp0.t();
4332
+ while (_iterator__ex2g4s.u()) {
4333
+ var element = _iterator__ex2g4s.v();
4334
+ var tmp;
4335
+ var tmp_0;
4336
+ if (element instanceof Struct) {
4337
+ // Inline function 'kotlin.collections.contains' call
4338
+ // Inline function 'kotlin.collections.containsKey' call
4339
+ var key = element.bx_1.zt();
4340
+ tmp_0 = (isInterface(serialNames, KtMap) ? serialNames : THROW_CCE()).q2(key);
4341
+ } else {
4342
+ tmp_0 = false;
4343
+ }
4344
+ if (tmp_0) {
4345
+ tmp = listOf_0([Companion_getInstance_9().c37_1, Companion_getInstance_9().d37(getValue(serialNames, element.bx_1.zt())), element]);
4346
+ } else {
4347
+ var tmp_1;
4348
+ var tmp_2;
4349
+ if (isInterface(element, HasName)) {
4350
+ var tmp_3;
4351
+ if (element instanceof Union) {
4352
+ tmp_3 = true;
4353
+ } else {
4354
+ tmp_3 = element instanceof Enum_1;
4355
+ }
4356
+ tmp_2 = tmp_3;
4357
+ } else {
4358
+ tmp_2 = false;
4359
+ }
4360
+ if (tmp_2) {
4361
+ tmp_1 = serializableOnlyNames.i1(element.m().zt());
4362
+ } else {
4363
+ tmp_1 = false;
4364
+ }
4365
+ if (tmp_1) {
4366
+ tmp = listOf_0([Companion_getInstance_9().c37_1, element]);
4367
+ } else {
4368
+ tmp = listOf(element);
4369
+ }
4370
+ }
4371
+ var list = tmp;
4372
+ addAll(destination, list);
4373
+ }
4374
+ return $receiver.fv(VOID, destination);
4375
+ }
4376
+ function Companion_8() {
4377
+ Companion_instance_10 = this;
4378
+ this.c37_1 = new RawElement('@kotlinx.serialization.Serializable');
4379
+ }
4380
+ protoOf(Companion_8).d37 = function (name) {
4381
+ return new RawElement('@kotlinx.serialization.SerialName("' + name + '")');
4382
+ };
4383
+ var Companion_instance_10;
4384
+ function Companion_getInstance_9() {
4385
+ if (Companion_instance_10 == null)
4386
+ new Companion_8();
4387
+ return Companion_instance_10;
4388
+ }
4389
+ function KotlinxSerializationExtension() {
4390
+ Companion_getInstance_9();
4391
+ }
4392
+ protoOf(KotlinxSerializationExtension).f1b = function (ir, ast) {
4393
+ // Inline function 'kotlin.collections.flatMap' call
4394
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4395
+ // Inline function 'kotlin.collections.flatMapTo' call
4396
+ var destination = ArrayList_init_$Create$();
4397
+ var _iterator__ex2g4s = tmp0.t();
4398
+ while (_iterator__ex2g4s.u()) {
4399
+ var element = _iterator__ex2g4s.v();
4400
+ var list = new NonEmptyList(element.gp_1);
4401
+ addAll(destination, list);
4402
+ }
4403
+ var definitions = destination;
4404
+ // Inline function 'kotlin.collections.filter' call
4405
+ // Inline function 'kotlin.collections.filterTo' call
4406
+ var destination_0 = ArrayList_init_$Create$();
4407
+ var _iterator__ex2g4s_0 = definitions.t();
4408
+ while (_iterator__ex2g4s_0.u()) {
4409
+ var element_0 = _iterator__ex2g4s_0.v();
4410
+ var tmp;
4411
+ if (element_0 instanceof Type) {
4412
+ tmp = true;
4413
+ } else {
4414
+ tmp = element_0 instanceof Refined;
4415
+ }
4416
+ if (tmp) {
4417
+ destination_0.x(element_0);
4418
+ }
4419
+ }
4420
+ // Inline function 'kotlin.collections.associate' call
4421
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_0, 10)), 16);
4422
+ // Inline function 'kotlin.collections.associateTo' call
4423
+ var destination_1 = LinkedHashMap_init_$Create$(capacity);
4424
+ var _iterator__ex2g4s_1 = destination_0.t();
4425
+ while (_iterator__ex2g4s_1.u()) {
4426
+ var element_1 = _iterator__ex2g4s_1.v();
4427
+ // Inline function 'kotlin.collections.plusAssign' call
4428
+ var pair = to(Companion_getInstance().wt(element_1.ds().o1()).zt(), element_1.ds().o1());
4429
+ destination_1.v2(pair.ff_1, pair.gf_1);
4430
+ }
4431
+ var serialNames = destination_1;
4432
+ // Inline function 'kotlin.collections.filter' call
4433
+ // Inline function 'kotlin.collections.filterTo' call
4434
+ var destination_2 = ArrayList_init_$Create$();
4435
+ var _iterator__ex2g4s_2 = definitions.t();
4436
+ while (_iterator__ex2g4s_2.u()) {
4437
+ var element_2 = _iterator__ex2g4s_2.v();
4438
+ var tmp_0;
4439
+ if (element_2 instanceof Union_0) {
4440
+ tmp_0 = true;
4441
+ } else {
4442
+ tmp_0 = element_2 instanceof Enum_0;
4443
+ }
4444
+ if (tmp_0) {
4445
+ destination_2.x(element_2);
4446
+ }
4447
+ }
4448
+ // Inline function 'kotlin.collections.map' call
4449
+ // Inline function 'kotlin.collections.mapTo' call
4450
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
4451
+ var _iterator__ex2g4s_3 = destination_2.t();
4452
+ while (_iterator__ex2g4s_3.u()) {
4453
+ var item = _iterator__ex2g4s_3.v();
4454
+ var tmp$ret$15 = Companion_getInstance().wt(item.ds().o1()).zt();
4455
+ destination_3.x(tmp$ret$15);
4456
+ }
4457
+ var serializableOnlyNames = toSet_0(destination_3);
4458
+ // Inline function 'arrow.core.NonEmptyList.map' call
4459
+ // Inline function 'kotlin.collections.map' call
4460
+ var this_0 = _NonEmptyList___get_all__impl__pmf509(ir);
4461
+ // Inline function 'kotlin.collections.mapTo' call
4462
+ var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
4463
+ var _iterator__ex2g4s_4 = this_0.t();
4464
+ while (_iterator__ex2g4s_4.u()) {
4465
+ var item_0 = _iterator__ex2g4s_4.v();
4466
+ var tmp_1;
4467
+ if (item_0 instanceof File) {
4468
+ tmp_1 = annotateSerializable(this, item_0, serialNames, serializableOnlyNames);
4469
+ } else {
4470
+ tmp_1 = item_0;
4471
+ }
4472
+ var tmp$ret$19 = tmp_1;
4473
+ destination_4.x(tmp$ret$19);
4474
+ }
4475
+ return _NonEmptyList___init__impl__fxd0xp(destination_4);
4476
+ };
4477
+ function annotateEndpointHandler($this, $receiver, endpoints) {
4478
+ // Inline function 'kotlin.collections.find' call
4479
+ var tmp$ret$1;
4480
+ $l$block: {
4481
+ // Inline function 'kotlin.collections.firstOrNull' call
4482
+ var _iterator__ex2g4s = endpoints.t();
4483
+ while (_iterator__ex2g4s.u()) {
4484
+ var element = _iterator__ex2g4s.v();
4485
+ if (containsEndpointNamespace($this, $receiver, element)) {
4486
+ tmp$ret$1 = element;
4487
+ break $l$block;
4488
+ }
4489
+ }
4490
+ tmp$ret$1 = null;
4491
+ }
4492
+ var tmp0_elvis_lhs = tmp$ret$1;
4493
+ var tmp;
4494
+ if (tmp0_elvis_lhs == null) {
4495
+ return $receiver;
4496
+ } else {
4497
+ tmp = tmp0_elvis_lhs;
4498
+ }
4499
+ var endpoint = tmp;
4500
+ return injectSpringAnnotationBeforeHandler($receiver, springAnnotation(endpoint, $this.e37_1));
4501
+ }
4502
+ function containsEndpointNamespace($this, $receiver, endpoint) {
4503
+ // Inline function 'community.flock.wirespec.compiler.core.ir.findAll' call
4504
+ // Inline function 'kotlin.collections.buildList' call
4505
+ // Inline function 'kotlin.collections.buildListInternal' call
4506
+ // Inline function 'kotlin.apply' call
4507
+ var this_0 = ArrayList_init_$Create$();
4508
+ forEachElement($receiver, SpringMappingAnnotationsExtension$containsEndpointNamespace$lambda(this_0));
4509
+ var tmp0 = this_0.q5();
4510
+ var tmp$ret$5;
4511
+ $l$block_0: {
4512
+ // Inline function 'kotlin.collections.any' call
4513
+ var tmp;
4514
+ if (isInterface(tmp0, Collection)) {
4515
+ tmp = tmp0.r();
4516
+ } else {
4517
+ tmp = false;
4518
+ }
4519
+ if (tmp) {
4520
+ tmp$ret$5 = false;
4521
+ break $l$block_0;
4522
+ }
4523
+ var _iterator__ex2g4s = tmp0.t();
4524
+ while (_iterator__ex2g4s.u()) {
4525
+ var element = _iterator__ex2g4s.v();
4526
+ var tmp_0;
4527
+ var tmp0_safe_receiver = element.jv_1;
4528
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nu_1;
4529
+ if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver.xt()) === 'Wirespec.Endpoint') {
4530
+ tmp_0 = element.hv_1.zt() === Companion_getInstance().wt(endpoint.fr_1.o1()).zt();
4531
+ } else {
4532
+ tmp_0 = false;
4533
+ }
4534
+ if (tmp_0) {
4535
+ tmp$ret$5 = true;
4536
+ break $l$block_0;
4537
+ }
4538
+ }
4539
+ tmp$ret$5 = false;
4540
+ }
4541
+ return tmp$ret$5;
4542
+ }
4543
+ function SpringMappingAnnotationsExtension$containsEndpointNamespace$lambda($$this$buildList) {
4544
+ return function (element) {
4545
+ var tmp;
4546
+ if (element instanceof Namespace) {
4547
+ $$this$buildList.x(element);
4548
+ tmp = Unit_instance;
4549
+ }
4550
+ return Unit_instance;
4551
+ };
4552
+ }
4553
+ function SpringMappingAnnotationsExtension(language) {
4554
+ this.e37_1 = language;
4555
+ }
4556
+ protoOf(SpringMappingAnnotationsExtension).f1b = function (ir, ast) {
4557
+ // Inline function 'kotlin.collections.flatMap' call
4558
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4559
+ // Inline function 'kotlin.collections.flatMapTo' call
4560
+ var destination = ArrayList_init_$Create$();
4561
+ var _iterator__ex2g4s = tmp0.t();
4562
+ while (_iterator__ex2g4s.u()) {
4563
+ var element = _iterator__ex2g4s.v();
4564
+ var list = new NonEmptyList(element.gp_1);
4565
+ addAll(destination, list);
4566
+ }
4567
+ // Inline function 'kotlin.collections.filterIsInstance' call
4568
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4569
+ var destination_0 = ArrayList_init_$Create$();
4570
+ var _iterator__ex2g4s_0 = destination.t();
4571
+ while (_iterator__ex2g4s_0.u()) {
4572
+ var element_0 = _iterator__ex2g4s_0.v();
4573
+ if (element_0 instanceof Endpoint) {
4574
+ destination_0.x(element_0);
4575
+ }
4576
+ }
4577
+ var endpoints = destination_0;
4578
+ // Inline function 'arrow.core.NonEmptyList.map' call
4579
+ // Inline function 'kotlin.collections.map' call
4580
+ var this_0 = _NonEmptyList___get_all__impl__pmf509(ir);
4581
+ // Inline function 'kotlin.collections.mapTo' call
4582
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
4583
+ var _iterator__ex2g4s_1 = this_0.t();
4584
+ while (_iterator__ex2g4s_1.u()) {
4585
+ var item = _iterator__ex2g4s_1.v();
4586
+ var tmp;
4587
+ if (item instanceof File) {
4588
+ tmp = annotateEndpointHandler(this, item, endpoints);
4589
+ } else {
4590
+ tmp = item;
4591
+ }
4592
+ var tmp$ret$8 = tmp;
4593
+ destination_1.x(tmp$ret$8);
4594
+ }
4595
+ return _NonEmptyList___init__impl__fxd0xp(destination_1);
4596
+ };
4597
+ function injectSpringAnnotationBeforeHandler(_this__u8e3s4, annotation) {
4598
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
4599
+ var scope = new TransformScope(_this__u8e3s4);
4600
+ // Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.injectBefore' call
4601
+ var tmp = scope;
4602
+ // Inline function 'community.flock.wirespec.compiler.core.ir.injectBefore' call
4603
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
4604
+ var this_0 = scope.a19_1;
4605
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
4606
+ // Inline function 'kotlin.apply' call
4607
+ var this_1 = new TransformerBuilder();
4608
+ this_1.u19(injectSpringAnnotationBeforeHandler$lambda(annotation));
4609
+ var tmp$ret$5 = this_1.p19();
4610
+ tmp.a19_1 = transform(this_0, tmp$ret$5);
4611
+ var tmp_0 = scope.a19_1;
4612
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
4613
+ }
4614
+ function springAnnotation(_this__u8e3s4, language) {
4615
+ var pathString = '/' + joinToString(_this__u8e3s4.hr_1, '/', VOID, VOID, VOID, VOID, springAnnotation$lambda);
4616
+ var prefix = 'org.springframework.web.bind.annotation';
4617
+ var tmp;
4618
+ switch (_this__u8e3s4.gr_1.e3_1) {
4619
+ case 0:
4620
+ tmp = '@' + prefix + '.GetMapping("' + pathString + '")';
4621
+ break;
4622
+ case 1:
4623
+ tmp = '@' + prefix + '.PostMapping("' + pathString + '")';
4624
+ break;
4625
+ case 2:
4626
+ tmp = '@' + prefix + '.PutMapping("' + pathString + '")';
4627
+ break;
4628
+ case 3:
4629
+ tmp = '@' + prefix + '.DeleteMapping("' + pathString + '")';
4630
+ break;
4631
+ case 6:
4632
+ tmp = '@' + prefix + '.PatchMapping("' + pathString + '")';
4633
+ break;
4634
+ case 4:
4635
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'OPTIONS');
4636
+ break;
4637
+ case 5:
4638
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'HEAD');
4639
+ break;
4640
+ case 7:
4641
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'TRACE');
4642
+ break;
4643
+ default:
4644
+ noWhenBranchMatchedException();
4645
+ break;
4646
+ }
4647
+ return tmp;
4648
+ }
4649
+ function injectSpringAnnotationBeforeHandler$lambda($annotation) {
4650
+ return function (element, transformer) {
4651
+ var tmp;
4652
+ if (element instanceof Interface) {
4653
+ var injected = element.nv_1.equals(Companion_getInstance().wt('Handler')) ? listOf(new RawElement($annotation)) : emptyList();
4654
+ var tmp_0;
4655
+ // Inline function 'kotlin.collections.isNotEmpty' call
4656
+ if (!injected.r()) {
4657
+ // Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
4658
+ var elements = plus(injected, element.dv());
4659
+ var tmp_1;
4660
+ if (element instanceof File) {
4661
+ tmp_1 = element.fv(VOID, elements);
4662
+ } else {
4663
+ if (element instanceof Struct) {
4664
+ tmp_1 = element.mx(VOID, VOID, VOID, VOID, elements);
4665
+ } else {
4666
+ if (element instanceof Namespace) {
4667
+ tmp_1 = element.mv(VOID, elements);
4668
+ } else {
4669
+ if (element instanceof Interface) {
4670
+ tmp_1 = element.vv(VOID, elements);
4671
+ } else {
4672
+ if (element instanceof Enum_1) {
4673
+ tmp_1 = element.ax(VOID, VOID, VOID, VOID, VOID, elements);
4674
+ } else {
4675
+ if (element instanceof Main) {
4676
+ tmp_1 = element;
4677
+ } else {
4678
+ tmp_1 = element;
4679
+ }
4680
+ }
4681
+ }
4682
+ }
4683
+ }
4684
+ }
4685
+ var tmp_2 = tmp_1;
4686
+ tmp_0 = tmp_2 instanceof Interface ? tmp_2 : THROW_CCE();
4687
+ } else {
4688
+ tmp_0 = element;
4689
+ }
4690
+ tmp = tmp_0;
4691
+ } else {
4692
+ tmp = element;
4693
+ }
4694
+ var transformed = tmp;
4695
+ return transformChildren(transformed, transformer);
4696
+ };
4697
+ }
4698
+ function springAnnotation$lambda(it) {
4699
+ var tmp;
4700
+ if (it instanceof Literal) {
4701
+ tmp = it.a1b_1;
4702
+ } else {
4703
+ if (it instanceof Param) {
4704
+ tmp = '{' + it.mr_1.o1() + '}';
4705
+ } else {
4706
+ noWhenBranchMatchedException();
4707
+ }
4708
+ }
4709
+ return tmp;
4710
+ }
4711
+ function springAnnotation$requestMapping($language, prefix, pathString, method) {
4712
+ return $language.e3_1 === 1 ? '@' + prefix + '.RequestMapping(value=["' + pathString + '"], method = [' + prefix + '.RequestMethod.' + method + '])' : '@' + prefix + '.RequestMapping(value="' + pathString + '", method = ' + prefix + '.RequestMethod.' + method + ')';
4713
+ }
4714
+ function nativeHintsFile($this, ast) {
4715
+ // Inline function 'kotlin.collections.flatMap' call
4716
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4717
+ // Inline function 'kotlin.collections.flatMapTo' call
4718
+ var destination = ArrayList_init_$Create$();
4719
+ var _iterator__ex2g4s = tmp0.t();
4720
+ while (_iterator__ex2g4s.u()) {
4721
+ var element = _iterator__ex2g4s.v();
4722
+ var list = new NonEmptyList(element.gp_1);
4723
+ addAll(destination, list);
4724
+ }
4725
+ var definitions = destination;
4726
+ // Inline function 'kotlin.collections.filterIsInstance' call
4727
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4728
+ var destination_0 = ArrayList_init_$Create$();
4729
+ var _iterator__ex2g4s_0 = definitions.t();
4730
+ while (_iterator__ex2g4s_0.u()) {
4731
+ var element_0 = _iterator__ex2g4s_0.v();
4732
+ if (!(element_0 == null) ? isInterface(element_0, Model) : false) {
4733
+ destination_0.x(element_0);
4734
+ }
4735
+ }
4736
+ // Inline function 'kotlin.collections.map' call
4737
+ // Inline function 'kotlin.collections.mapTo' call
4738
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
4739
+ var _iterator__ex2g4s_1 = destination_0.t();
4740
+ while (_iterator__ex2g4s_1.u()) {
4741
+ var item = _iterator__ex2g4s_1.v();
4742
+ var tmp$ret$7 = Companion_getInstance().wt(item.ds().o1()).zt();
4743
+ destination_1.x(tmp$ret$7);
4744
+ }
4745
+ var modelNames = destination_1;
4746
+ // Inline function 'kotlin.collections.filter' call
4747
+ // Inline function 'kotlin.collections.filterTo' call
4748
+ var destination_2 = ArrayList_init_$Create$();
4749
+ var _iterator__ex2g4s_2 = definitions.t();
4750
+ while (_iterator__ex2g4s_2.u()) {
4751
+ var element_1 = _iterator__ex2g4s_2.v();
4752
+ var tmp;
4753
+ if (element_1 instanceof Endpoint) {
4754
+ tmp = true;
4755
+ } else {
4756
+ tmp = element_1 instanceof Channel;
4757
+ }
4758
+ if (tmp) {
4759
+ destination_2.x(element_1);
4760
+ }
4761
+ }
4762
+ // Inline function 'kotlin.collections.map' call
4763
+ // Inline function 'kotlin.collections.mapTo' call
4764
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
4765
+ var _iterator__ex2g4s_3 = destination_2.t();
4766
+ while (_iterator__ex2g4s_3.u()) {
4767
+ var item_0 = _iterator__ex2g4s_3.v();
4768
+ var tmp$ret$13 = Companion_getInstance().wt(item_0.ds().o1()).zt();
4769
+ destination_3.x(tmp$ret$13);
4770
+ }
4771
+ var endpointNames = destination_3;
4772
+ if (modelNames.r() && endpointNames.r())
4773
+ return null;
4774
+ var pkg = $this.f37_1.bt_1;
4775
+ var tmp_0 = Companion_getInstance().wt($this.f37_1.dt() + 'WirespecNativeHints');
4776
+ return file(tmp_0, SpringNativeHintsExtension$nativeHintsFile$lambda(pkg, modelNames, endpointNames, $this));
4777
+ }
4778
+ function nativeHintsClassBody($this, names) {
4779
+ var tmp;
4780
+ switch ($this.g37_1.e3_1) {
4781
+ case 1:
4782
+ tmp = kotlinNativeHintsClassBody($this, names);
4783
+ break;
4784
+ case 0:
4785
+ tmp = javaNativeHintsClassBody($this, names);
4786
+ break;
4787
+ default:
4788
+ // Inline function 'kotlin.error' call
4789
+
4790
+ var message = 'SpringNativeHintsExtension supports Kotlin and Java targets only, got ' + toString($this.g37_1);
4791
+ throw IllegalStateException_init_$Create$(toString(message));
4792
+ }
4793
+ return tmp;
4794
+ }
4795
+ function kotlinNativeHintsClassBody($this, names) {
4796
+ var registrations = joinToString(names, '\n', VOID, VOID, VOID, VOID, SpringNativeHintsExtension$kotlinNativeHintsClassBody$lambda);
4797
+ return trimMargin('\n |@Configuration\n |@ImportRuntimeHints(WirespecNativeHints.GeneratedHints::class)\n |open class WirespecNativeHints {\n |\n | class GeneratedHints : RuntimeHintsRegistrar {\n | override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {\n | val allMembers = MemberCategory.entries.toTypedArray()\n |' + registrations + '\n | }\n |\n | private fun registerWithInnerClasses(hints: RuntimeHints, clazz: Class<*>, categories: Array<MemberCategory>) {\n | hints.reflection().registerType(clazz, *categories)\n | for (inner in clazz.declaredClasses) {\n | registerWithInnerClasses(hints, inner, categories)\n | }\n | }\n | }\n |}\n ');
4798
+ }
4799
+ function javaNativeHintsClassBody($this, names) {
4800
+ var registrations = joinToString(names, '\n', VOID, VOID, VOID, VOID, SpringNativeHintsExtension$javaNativeHintsClassBody$lambda);
4801
+ return trimMargin('\n |@Configuration\n |@ImportRuntimeHints(WirespecNativeHints.GeneratedHints.class)\n |public class WirespecNativeHints {\n |\n | static class GeneratedHints implements RuntimeHintsRegistrar {\n | @Override\n | public void registerHints(RuntimeHints hints, ClassLoader classLoader) {\n | var allMembers = MemberCategory.values();\n |' + registrations + '\n | }\n |\n | private static void registerWithInnerClasses(RuntimeHints hints, Class<?> clazz, MemberCategory[] categories) {\n | hints.reflection().registerType(clazz, categories);\n | for (Class<?> inner : clazz.getDeclaredClasses()) {\n | registerWithInnerClasses(hints, inner, categories);\n | }\n | }\n | }\n |}\n ');
4802
+ }
4803
+ function SpringNativeHintsExtension$nativeHintsFile$lambda($pkg, $modelNames, $endpointNames, this$0) {
4804
+ return function ($this$file) {
4805
+ $this$file.o17($pkg);
4806
+ // Inline function 'kotlin.collections.forEach' call
4807
+ var _iterator__ex2g4s = $modelNames.t();
4808
+ while (_iterator__ex2g4s.u()) {
4809
+ var element = _iterator__ex2g4s.v();
4810
+ $this$file.c16($pkg + '.model', element);
4811
+ }
4812
+ // Inline function 'kotlin.collections.forEach' call
4813
+ var _iterator__ex2g4s_0 = $endpointNames.t();
4814
+ while (_iterator__ex2g4s_0.u()) {
4815
+ var element_0 = _iterator__ex2g4s_0.v();
4816
+ $this$file.c16($pkg + '.endpoint', element_0);
4817
+ }
4818
+ $this$file.c16('org.springframework.aot.hint', 'MemberCategory');
4819
+ $this$file.c16('org.springframework.aot.hint', 'RuntimeHints');
4820
+ $this$file.c16('org.springframework.aot.hint', 'RuntimeHintsRegistrar');
4821
+ $this$file.c16('org.springframework.context.annotation', 'Configuration');
4822
+ $this$file.c16('org.springframework.context.annotation', 'ImportRuntimeHints');
4823
+ $this$file.s14(nativeHintsClassBody(this$0, plus($modelNames, $endpointNames)));
4824
+ return Unit_instance;
4825
+ };
4826
+ }
4827
+ function SpringNativeHintsExtension$kotlinNativeHintsClassBody$lambda(it) {
4828
+ return ' registerWithInnerClasses(hints, ' + it + '::class.java, allMembers)';
4829
+ }
4830
+ function SpringNativeHintsExtension$javaNativeHintsClassBody$lambda(it) {
4831
+ return ' registerWithInnerClasses(hints, ' + it + '.class, allMembers);';
4832
+ }
4833
+ function SpringNativeHintsExtension(packageName, language) {
4834
+ this.f37_1 = packageName;
4835
+ this.g37_1 = language;
4836
+ }
4837
+ protoOf(SpringNativeHintsExtension).f1b = function (ir, ast) {
4838
+ return NonEmptyList__plus_impl_xqmb9(ir, listOfNotNull_0(nativeHintsFile(this, ast)));
4839
+ };
4840
+ //region block: post-declaration
4841
+ protoOf(Wrap).r35 = wrap;
4842
+ protoOf(Wrap).n35 = wrap$default;
4843
+ protoOf(Each).r35 = wrap;
4844
+ protoOf(Each).n35 = wrap$default;
4845
+ protoOf(Values).r35 = wrap;
4846
+ protoOf(Values).n35 = wrap$default;
4847
+ //endregion
4848
+ //region block: init
4849
+ Companion_instance_3 = new Companion_1();
4850
+ ChannelDslFile_instance = new ChannelDslFile();
4851
+ EndpointDslFile_instance = new EndpointDslFile();
4852
+ Companion_instance_4 = new Companion_2();
4853
+ RecordBuilder_instance = new RecordBuilder();
4854
+ Companion_instance_5 = new Companion_3();
4855
+ Companion_instance_6 = new Companion_4();
4856
+ RpcDslFile_instance = new RpcDslFile();
4857
+ Companion_instance_7 = new Companion_5();
4858
+ Companion_instance_8 = new Companion_6();
4859
+ TypeDslFile_instance = new TypeDslFile();
4860
+ Companion_instance_9 = new Companion_7();
4861
+ //endregion
4862
+ //region block: exports
4863
+ export {
4864
+ AvroExtension as AvroExtension2wwjmwjwaw598,
4865
+ JacksonExtension as JacksonExtension2apty7n2u8qwe,
4866
+ JvmBuilderExtension as JvmBuilderExtension2kiaqxykl1i7i,
4867
+ KotestDslExtension as KotestDslExtension3b1gkjx78hy8l,
4868
+ KotlinxSerializationExtension as KotlinxSerializationExtension2mu27sgt74cx0,
4869
+ SpringMappingAnnotationsExtension as SpringMappingAnnotationsExtension2ztar9kzbv7sb,
4870
+ SpringNativeHintsExtension as SpringNativeHintsExtension1dir3w0zn6fa3,
4871
+ };
4872
+ //endregion
4873
+
4874
+ //# sourceMappingURL=wirespec-src-plugin-extensions.mjs.map