@flock/wirespec 0.17.20 → 0.18.1-RC.2

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 (87) hide show
  1. package/arrow-arrow-annotations.mjs.map +1 -1
  2. package/arrow-arrow-atomic.mjs +13 -13
  3. package/arrow-arrow-atomic.mjs.map +1 -1
  4. package/arrow-arrow-core.mjs +588 -431
  5. package/arrow-arrow-core.mjs.map +1 -1
  6. package/arrow-arrow-exception-utils.mjs +30 -0
  7. package/arrow-arrow-exception-utils.mjs.map +1 -0
  8. package/clikt-clikt-mordant.mjs +318 -0
  9. package/clikt-clikt-mordant.mjs.map +1 -0
  10. package/clikt-clikt.mjs +3834 -3696
  11. package/clikt-clikt.mjs.map +1 -1
  12. package/colormath-root-colormath.mjs +619 -682
  13. package/colormath-root-colormath.mjs.map +1 -1
  14. package/kotlin-js-core.mjs +4 -0
  15. package/kotlin-js-core.mjs.map +1 -0
  16. package/kotlin-js.mjs +4 -0
  17. package/kotlin-js.mjs.map +1 -0
  18. package/kotlin-kotlin-stdlib.mjs +6284 -5825
  19. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  20. package/kotlin-openapi-bindings.mjs +8163 -8198
  21. package/kotlin-openapi-bindings.mjs.map +1 -1
  22. package/kotlin-plugins-js-plain-objects-runtime.mjs +4 -0
  23. package/kotlin-plugins-js-plain-objects-runtime.mjs.map +1 -0
  24. package/kotlin-rgxgen.mjs +2007 -2062
  25. package/kotlin-rgxgen.mjs.map +1 -1
  26. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -1
  27. package/kotlinx-atomicfu.mjs +4 -0
  28. package/kotlinx-atomicfu.mjs.map +1 -0
  29. package/kotlinx-coroutines-core.mjs +4 -0
  30. package/kotlinx-coroutines-core.mjs.map +1 -0
  31. package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -1
  32. package/kotlinx-io-kotlinx-io-core.mjs +803 -839
  33. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
  34. package/kotlinx-serialization-kotlinx-serialization-core.mjs +2483 -2553
  35. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  36. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1861 -1928
  37. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  38. package/mordant-mordant-omnibus.mjs +4 -0
  39. package/mordant-mordant-omnibus.mjs.map +1 -0
  40. package/mordant-mordant.mjs +2525 -4426
  41. package/mordant-mordant.mjs.map +1 -1
  42. package/package.json +4 -7
  43. package/seskar-core.mjs +4 -0
  44. package/seskar-core.mjs.map +1 -0
  45. package/wirespec-bin.mjs +13 -1
  46. package/wirespec-fetch.d.ts +4 -1
  47. package/wirespec-fetch.mjs +34 -0
  48. package/wirespec-serialization.d.ts +13 -2
  49. package/wirespec-serialization.mjs +22 -1
  50. package/wirespec-src-compiler-core.mjs +2857 -3909
  51. package/wirespec-src-compiler-core.mjs.map +1 -1
  52. package/wirespec-src-compiler-emitters-java.mjs +1370 -413
  53. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  54. package/wirespec-src-compiler-emitters-kotlin.mjs +1015 -337
  55. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  56. package/wirespec-src-compiler-emitters-python.mjs +1465 -387
  57. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  58. package/wirespec-src-compiler-emitters-rust.mjs +2461 -0
  59. package/wirespec-src-compiler-emitters-rust.mjs.map +1 -0
  60. package/wirespec-src-compiler-emitters-scala.mjs +1010 -0
  61. package/wirespec-src-compiler-emitters-scala.mjs.map +1 -0
  62. package/wirespec-src-compiler-emitters-typescript.mjs +1533 -450
  63. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  64. package/wirespec-src-compiler-emitters-wirespec.mjs +122 -144
  65. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  66. package/wirespec-src-compiler-ir.mjs +17369 -0
  67. package/wirespec-src-compiler-ir.mjs.map +1 -0
  68. package/wirespec-src-compiler-lib.mjs +662 -728
  69. package/wirespec-src-compiler-lib.mjs.map +1 -1
  70. package/wirespec-src-converter-avro.mjs +630 -656
  71. package/wirespec-src-converter-avro.mjs.map +1 -1
  72. package/wirespec-src-converter-common.mjs.map +1 -1
  73. package/wirespec-src-converter-openapi.mjs +1705 -2024
  74. package/wirespec-src-converter-openapi.mjs.map +1 -1
  75. package/wirespec-src-plugin-arguments.mjs +418 -459
  76. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  77. package/wirespec-src-plugin-cli.mjs +367 -331
  78. package/wirespec-src-plugin-cli.mjs.map +1 -1
  79. package/{wirespec-src-plugin-npm.d.ts → wirespec-src-plugin-npm.d.mts} +247 -0
  80. package/wirespec-src-plugin-npm.mjs +166 -359
  81. package/wirespec-src-plugin-npm.mjs.map +1 -1
  82. package/wirespec-src-tools-generator.mjs +79 -106
  83. package/wirespec-src-tools-generator.mjs.map +1 -1
  84. package/arrow-arrow-continuations.mjs +0 -18
  85. package/arrow-arrow-continuations.mjs.map +0 -1
  86. package/markdown.mjs +0 -6756
  87. package/markdown.mjs.map +0 -1
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  importReferencesy4xv7r53sjjs as importReferences,
3
3
  LanguageEmitterxhzgykhux3qm as LanguageEmitter,
4
- Companion_instance2ag0h5twtdral as Companion_instance,
5
- Companion_instance26a9xkw31611z as Companion_instance_0,
6
- FileExtension_Java_getInstance2uobrrnxaf610 as FileExtension_Java_getInstance,
4
+ Companion_instance1a2xqc448tlhh as Companion_instance,
5
+ Companion_instance2ryk3262e300f as Companion_instance_0,
6
+ FileExtension_Java_getInstance6j3tok5j3omd as FileExtension_Java_getInstance,
7
7
  Emitted12h24rpo4uifw as Emitted,
8
8
  plus3lrm73de10b42 as plus,
9
- Companion_instance2piryw1e8zn12 as Companion_instance_1,
9
+ Companion_instancebcq57hoyp8c2 as Companion_instance_1,
10
10
  Iterable29qbzfup67wqp as Iterable,
11
11
  get_pathParamsf41cxx5qebxt as get_pathParams,
12
12
  orNull2zq556ke3x99j as orNull,
13
- Spacer_instancel9yep7i0q3er as Spacer_instance,
13
+ Spacer_instance1p6915grp4mfk as Spacer_instance,
14
14
  get_indexedPathParams2pzt0qs62068 as get_indexedPathParams,
15
15
  distinctByStatus134zrt4nyr6p2 as distinctByStatus,
16
16
  emit2koty5c8abmj3 as emit,
@@ -21,8 +21,10 @@ import {
21
21
  spacer28p2fwyb64afn as spacer,
22
22
  FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
23
23
  DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
24
- Bytes_instance2qx139msy62dm as Bytes_instance,
25
- Boolean_instance15dmfsx1e5thd as Boolean_instance,
24
+ Shared1uygqfbd22ukz as Shared,
25
+ plus14o24vdaiongg as plus_0,
26
+ Bytes_instance1o9u095wd3kx6 as Bytes_instance,
27
+ Boolean_instance237vwt01w3hs8 as Boolean_instance,
26
28
  RegExpiyof7szm5zfu as RegExp_0,
27
29
  String1czvr8pxnm6on as String_0,
28
30
  Number1mui0heypwdhp as Number_0,
@@ -38,11 +40,11 @@ import {
38
40
  TypeDefinitionEmitter18est4d94fpw8 as TypeDefinitionEmitter,
39
41
  } from './wirespec-src-compiler-core.mjs';
40
42
  import {
41
- ArrayList_init_$Create$2rimpp4x9tjd3 as ArrayList_init_$Create$,
42
- Unit_instanceat14thlj150z as Unit_instance,
43
+ ArrayList_init_$Create$1jemgvhi5v0js as ArrayList_init_$Create$,
44
+ Unit_instance28fytmsmm6r23 as Unit_instance,
43
45
  collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
44
- ArrayList_init_$Create$3m1kyiqequwm5 as ArrayList_init_$Create$_0,
45
- VOID7hggqo3abtya as VOID,
46
+ ArrayList_init_$Create$3ivpeip4ouddx as ArrayList_init_$Create$_0,
47
+ VOID3gxj6tk5isa35 as VOID,
46
48
  joinToString1cxrrlmo0chqs as joinToString,
47
49
  THROW_CCE2g6jy02ryeudk as THROW_CCE,
48
50
  isCharSequence1ju9jr1w86plq as isCharSequence,
@@ -60,13 +62,14 @@ import {
60
62
  Char19o2r8palgjof as Char,
61
63
  first58ocm7j58k3q as first_0,
62
64
  noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
63
- toString14fd7g605f91p as toString_0,
65
+ toString3dhdjl9yf50de as toString_0,
66
+ substring3saq8ornu0luv as substring,
64
67
  startsWith26w8qjqapeeq6 as startsWith,
65
68
  split2bvyvnrlcifjv as split,
66
69
  setOf45ia9pnfhe90 as setOf,
67
70
  initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
68
71
  isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
69
- _Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
72
+ _Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
70
73
  listOfvhqybd2zx248 as listOf,
71
74
  checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
72
75
  asSequence3lsvgkvyzox0q as asSequence,
@@ -74,24 +77,108 @@ import {
74
77
  joinToStringooja5rkatz3u as joinToString_0,
75
78
  firstOrNulltrxqttxfxqju as firstOrNull,
76
79
  isDigit3mimrri4wkzop as isDigit,
80
+ Paire9pteg33gng7 as Pair,
81
+ plus310ted5e4i90h as plus_1,
82
+ emptyList1g2z5xcrvp2zy as emptyList,
83
+ StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
84
+ charSequenceLength3278n89t01tmv as charSequenceLength,
85
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
86
+ isInterface3d6p8outrmvmk as isInterface,
77
87
  equals2au1ep9vhcato as equals,
88
+ listOf1jh22dvmctj1r as listOf_0,
89
+ firstOrNull1982767dljvdy as firstOrNull_0,
90
+ last1vo29oleiqj36 as last,
91
+ dropLast1vpiyky649o34 as dropLast,
92
+ to2cs3ny02qtbcb as to,
93
+ mapOf2zpbbmyqk8xpf as mapOf,
94
+ plus20p0vtfmu0596 as plus_2,
95
+ addAll1k27qatfgp3k5 as addAll,
96
+ HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
97
+ Collection1k04j3hzsbod0 as Collection,
78
98
  initMetadataForObject1cxne3s9w65el as initMetadataForObject,
79
- dropLastlqc2oyv04br0 as dropLast,
80
- charSequenceLength3278n89t01tmv as charSequenceLength,
99
+ dropLastlqc2oyv04br0 as dropLast_0,
81
100
  replace3le3ie7l9k8aq as replace,
82
101
  } from './kotlin-kotlin-stdlib.mjs';
102
+ import {
103
+ NonEmptyList3ak25ihy2gcvs as NonEmptyList,
104
+ NonEmptyList__plus_impl_xqmb92tle8a7jcf2wm as NonEmptyList__plus_impl_xqmb9,
105
+ } from './arrow-arrow-core.mjs';
106
+ import {
107
+ Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
108
+ Package2tniq694j1763 as Package,
109
+ File3dimy4iqmuock as File,
110
+ transformChildrend9p91tpcqdkx as transformChildren,
111
+ withElements2toq84v08e72 as withElements,
112
+ Namespace345pal554qu3j as Namespace,
113
+ import5uhkz67bd8tt as import_0,
114
+ TransformScopeyrd3lf4zrk76 as TransformScope,
115
+ TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
116
+ transform3eti8i2bqvifx as transform,
117
+ Elementitq62jg6fid3 as Element,
118
+ structo1silz79n3nu as struct,
119
+ Dict22iqrhoo0g8et as Dict_0,
120
+ Array2goj74t0aak7b as Array_0,
121
+ Nullable3wjn6l6q3h6o as Nullable,
122
+ Custom2si7lto3wompr as Custom_0,
123
+ Unit_instanceyaei45a6t5rv as Unit_instance_0,
124
+ Any_instance2998xag3cdzh3 as Any_instance,
125
+ Bytes_instance3edm2lhbrwd51 as Bytes_instance_0,
126
+ Boolean_instance27opaqtiiiysz as Boolean_instance_0,
127
+ String_instance3uxvo48ki208u as String_instance,
128
+ Number3azxs9q1cyulb as Number_1,
129
+ Integer1uwg1wvo5lp6z as Integer_0,
130
+ Nameoqr8dt2fim9d as Name,
131
+ FunctionCall30872kpnbr7op as FunctionCall,
132
+ transformChildren2mszeagj5nq4c as transformChildren_0,
133
+ convert13xvfhgrf57n5 as convert,
134
+ convertClientServer3s89ijty7q130 as convertClientServer,
135
+ toGetterAccessors2z6mndbqwlczg as toGetterAccessors,
136
+ rawttvqxl50flj9 as raw,
137
+ generateJavaxqkwhkjcf0ke as generateJava,
138
+ RawElement2yts1x2rbem1g as RawElement,
139
+ VariableReference2vlynnhaw1i64 as VariableReference,
140
+ withLabelField33ehya4zusm70 as withLabelField,
141
+ function12vu2kapzno4w as function_0,
142
+ plusd54zq6f7l8fy as plus_3,
143
+ Enumlszg09mwd24f as Enum,
144
+ convert2loxpwk8n2r8c as convert_0,
145
+ Function21cuq8qizkin7 as Function,
146
+ Struct39wf79cwtn4ty as Struct,
147
+ Interface3pn84xq686t2r as Interface,
148
+ ReturnStatement29qlfkn9kpy10 as ReturnStatement,
149
+ Assignment3kcxc8wlcbmkn as Assignment,
150
+ RawExpression2bo7ldfrptjia as RawExpression,
151
+ Wildcard_instance2ga1ytfwj78ra as Wildcard_instance,
152
+ TypeDescriptor1hvcpxrtxcqsx as TypeDescriptor,
153
+ JavaGenerator_instance753fwcs3a4n9 as JavaGenerator_instance,
154
+ SanitizationConfig11mmn3p2c03c1 as SanitizationConfig,
155
+ emit3bzdcd0f6nwtj as emit_0,
156
+ withSharedSource1qgrajaccojj3 as withSharedSource,
157
+ emitn3eihixilqyh as emit_1,
158
+ prependImports32gcj3yb8voha as prependImports,
159
+ placeInPackage1ffljbk9me4ug as placeInPackage,
160
+ convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
161
+ sanitizeNames2wqmyf8vafp9x as sanitizeNames,
162
+ convert11ert2po54h1y as convert_1,
163
+ convert37aabdzvtv9vg as convert_2,
164
+ convert17zcptkz4mhr4 as convert_3,
165
+ convert32tuiui3czihh as convert_4,
166
+ convert1cn4bolzoed8c as convert_5,
167
+ emitEndpointClient1meajc90wf3el as emitEndpointClient,
168
+ emitClient32kfwzg2hm5vj as emitClient,
169
+ emit1oxjujel6f3jb as emit_2,
170
+ IrEmitterh2m93ojzvkep as IrEmitter,
171
+ } from './wirespec-src-compiler-ir.mjs';
83
172
  //region block: imports
84
173
  //endregion
85
174
  //region block: pre-declaration
86
- function emit_0(type, module_0) {
87
- var tmp = this.y25(type.x23_1);
88
- var tmp_0 = this.x24(type.y23_1);
175
+ function emit_3(type, module_0) {
176
+ var tmp = this.wq(type.vo_1);
177
+ var tmp_0 = this.vp(type.wo_1);
89
178
  // Inline function 'kotlin.run' call
90
- // Inline function 'kotlin.contracts.contract' call
91
- // Inline function 'community.flock.wirespec.emitters.java.JavaTypeDefinitionEmitter.emit.<anonymous>' call
92
- var $this$run = type.z23_1;
179
+ var $this$run = type.xo_1;
93
180
  var tmp_1;
94
- if ($this$run.l()) {
181
+ if ($this$run.r()) {
95
182
  tmp_1 = '';
96
183
  } else {
97
184
  tmp_1 = ' implements ' + joinToString($this$run, ', ', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda(this));
@@ -99,38 +186,36 @@ function emit_0(type, module_0) {
99
186
  var tmp$ret$1 = tmp_1;
100
187
  return trimMargin('\n |public record ' + tmp + ' (\n |' + tmp_0 + '\n |)' + tmp$ret$1 + ' {\n |};\n |\n ');
101
188
  }
102
- function emit_1(_this__u8e3s4) {
103
- return dropLast(joinToString(_this__u8e3s4.u23_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
189
+ function emit_4(_this__u8e3s4) {
190
+ return dropLast_0(joinToString(_this__u8e3s4.so_1, '\n', VOID, VOID, VOID, VOID, JavaTypeDefinitionEmitter$emit$lambda_0(this)), 1);
104
191
  }
105
- function emit_2(_this__u8e3s4) {
106
- return this.z24(_this__u8e3s4.d24_1) + ' ' + this.y25(_this__u8e3s4.c24_1);
192
+ function emit_5(_this__u8e3s4) {
193
+ return this.xp(_this__u8e3s4.bp_1) + ' ' + this.wq(_this__u8e3s4.ap_1);
107
194
  }
108
- function emit_3(_this__u8e3s4) {
195
+ function emit_6(_this__u8e3s4) {
109
196
  // Inline function 'kotlin.let' call
110
- // Inline function 'kotlin.contracts.contract' call
111
- // Inline function 'community.flock.wirespec.emitters.java.JavaTypeDefinitionEmitter.emit.<anonymous>' call
112
- var it = emitType(_this__u8e3s4, this);
113
- return _this__u8e3s4.jm() ? 'java.util.Optional<' + it + '>' : it;
197
+ var it = emitType(this, _this__u8e3s4);
198
+ return _this__u8e3s4.du() ? 'java.util.Optional<' + it + '>' : it;
114
199
  }
115
200
  function emitRoot(_this__u8e3s4, void_0) {
116
201
  var tmp;
117
202
  if (_this__u8e3s4 instanceof Dict) {
118
- tmp = this.d2b(_this__u8e3s4.e23_1);
203
+ tmp = this.l1v(_this__u8e3s4.co_1);
119
204
  } else {
120
205
  if (_this__u8e3s4 instanceof Iterable) {
121
- tmp = this.d2b(_this__u8e3s4.b23_1);
206
+ tmp = this.l1v(_this__u8e3s4.zn_1);
122
207
  } else {
123
208
  if (_this__u8e3s4 instanceof Unit) {
124
209
  tmp = void_0;
125
210
  } else {
126
211
  if (_this__u8e3s4 instanceof Any) {
127
- tmp = emitType(_this__u8e3s4, this);
212
+ tmp = emitType(this, _this__u8e3s4);
128
213
  } else {
129
214
  if (_this__u8e3s4 instanceof Custom) {
130
- tmp = emitType(_this__u8e3s4, this);
215
+ tmp = emitType(this, _this__u8e3s4);
131
216
  } else {
132
217
  if (_this__u8e3s4 instanceof Primitive) {
133
- tmp = emitType(_this__u8e3s4, this);
218
+ tmp = emitType(this, _this__u8e3s4);
134
219
  } else {
135
220
  if (_this__u8e3s4 == null) {
136
221
  tmp = void_0;
@@ -147,34 +232,30 @@ function emitRoot(_this__u8e3s4, void_0) {
147
232
  }
148
233
  function emitRoot$default(_this__u8e3s4, void_0, $super) {
149
234
  void_0 = void_0 === VOID ? 'void' : void_0;
150
- return $super === VOID ? this.e2b(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
235
+ return $super === VOID ? this.m1v(_this__u8e3s4, void_0) : emitRoot(_this__u8e3s4, void_0);
151
236
  }
152
- function emit_4(_this__u8e3s4) {
237
+ function emit_7(_this__u8e3s4) {
153
238
  var tmp;
154
239
  if (_this__u8e3s4 instanceof RegExp_0) {
155
- tmp = 'return java.util.regex.Pattern.compile("' + replace(this.b25(_this__u8e3s4.a28_1), '\\', '\\\\') + '").matcher(record.value).find();';
240
+ tmp = 'return java.util.regex.Pattern.compile("' + replace(this.zp(_this__u8e3s4.ys_1), '\\', '\\\\') + '").matcher(value).find();';
156
241
  } else {
157
242
  if (_this__u8e3s4 instanceof Bound) {
158
- var tmp1_safe_receiver = _this__u8e3s4.q28_1;
243
+ var tmp1_safe_receiver = _this__u8e3s4.pt_1;
159
244
  var tmp_0;
160
245
  if (tmp1_safe_receiver == null) {
161
246
  tmp_0 = null;
162
247
  } else {
163
248
  // Inline function 'kotlin.let' call
164
- // Inline function 'kotlin.contracts.contract' call
165
- // Inline function 'community.flock.wirespec.emitters.java.JavaTypeDefinitionEmitter.emit.<anonymous>' call
166
- tmp_0 = tmp1_safe_receiver + ' < record.value';
249
+ tmp_0 = tmp1_safe_receiver + ' < value';
167
250
  }
168
251
  var minCheck = tmp_0;
169
- var tmp2_safe_receiver = _this__u8e3s4.r28_1;
252
+ var tmp2_safe_receiver = _this__u8e3s4.qt_1;
170
253
  var tmp_1;
171
254
  if (tmp2_safe_receiver == null) {
172
255
  tmp_1 = null;
173
256
  } else {
174
257
  // Inline function 'kotlin.let' call
175
- // Inline function 'kotlin.contracts.contract' call
176
- // Inline function 'community.flock.wirespec.emitters.java.JavaTypeDefinitionEmitter.emit.<anonymous>' call
177
- tmp_1 = 'record.value < ' + tmp2_safe_receiver;
258
+ tmp_1 = 'value < ' + tmp2_safe_receiver;
178
259
  }
179
260
  var maxCheck = tmp_1;
180
261
  var checks = joinToString(listOfNotNull([minCheck, maxCheck]), ' && ');
@@ -193,89 +274,17 @@ function emit_4(_this__u8e3s4) {
193
274
  return tmp;
194
275
  }
195
276
  initMetadataForInterface(JavaTypeDefinitionEmitter, 'JavaTypeDefinitionEmitter', VOID, VOID, [TypeDefinitionEmitter]);
196
- function emit_5(channel) {
197
- return trimMargin('\n |' + emitImports(channel, this) + '\n |\n |@FunctionalInterface\n |public interface ' + this.y25(channel.o23_1) + ' {\n | void invoke(' + emitFullyQualified(channel, this, channel.p23_1) + this.d2b(channel.p23_1) + ' message);\n |}\n |\n ');
277
+ function emit_8(channel) {
278
+ return trimMargin('\n |' + emitImports(this, channel) + '\n |\n |@FunctionalInterface\n |public interface ' + this.wq(channel.mo_1) + ' {\n | void invoke(' + emitFullyQualified(this, channel, channel.no_1) + this.l1v(channel.no_1) + ' message);\n |}\n |\n ');
198
279
  }
199
280
  initMetadataForInterface(JavaChannelDefinitionEmitter, 'JavaChannelDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
200
- function emit_6(endpoint) {
201
- var tmp = emitImports_0(endpoint, this);
202
- var tmp_0 = this.y25(endpoint.g24_1);
203
- var tmp_1 = get_pathParams(endpoint);
204
- var tmp_2 = emitObject(tmp_1, this, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
205
- var tmp_3 = emitObject(endpoint.j24_1, this, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
206
- var tmp_4 = emitObject(endpoint.k24_1, this, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
207
- var tmp_5 = this.v2a(first_0(endpoint.l24_1), endpoint);
208
- var tmp_6 = Spacer_instance.toString();
209
- var tmp_7 = emitStatusInterfaces(endpoint, this);
210
- var tmp_8 = emitResponseInterfaces(endpoint, this);
211
- var tmp_9 = distinctByStatus(endpoint.m24_1);
212
- var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
213
- var tmp_11 = Spacer_instance.toString();
214
- var tmp_12 = emitRequestFunctions(first_0(endpoint.l24_1), this, endpoint);
215
- var tmp_13 = Spacer_instance.s26(2);
216
- var tmp_14 = distinctByStatus(endpoint.m24_1);
217
- var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
218
- var tmp_16 = Spacer_instance.s26(3);
219
- var tmp_17 = Spacer_instance.s26(2);
220
- var tmp_18 = Spacer_instance.s26(2);
221
- var tmp_19 = emitFromResponse(endpoint, this);
222
- var tmp_20 = Spacer_instance.s26(2);
223
- var tmp_21 = Spacer_instance.s26(2);
224
- var tmp_22 = this.x2a(endpoint);
225
- var tmp_23 = Spacer_instance.s26(2);
226
- var tmp_24 = Spacer_instance.s26(3);
227
- return trimMargin('\n |' + tmp + '\n |\n |public interface ' + tmp_0 + ' extends Wirespec.Endpoint {\n |' + tmp_2 + '\n |\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + 'sealed interface Response<T> extends Wirespec.Response<T> {}\n |' + tmp_7 + '\n |' + tmp_8 + '\n |\n |' + tmp_10 + '\n |\n |' + tmp_11 + 'interface Handler extends Wirespec.Handler {\n |\n |' + tmp_12 + '\n |\n |' + tmp_13 + 'static Wirespec.RawResponse toResponse(Wirespec.Serializer serialization, Response<?> response) {\n |' + tmp_15 + '\n |' + tmp_16 + 'else { throw new IllegalStateException("Cannot match response with status: " + response.status());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + '\n |' + tmp_20 + '}\n |\n |' + tmp_21 + tmp_22 + '\n |' + tmp_23 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_24 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.i24_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.s26(3) + '@Override public String getMethod() { return "' + endpoint.h24_1.toString() + '"; }\n |' + Spacer_instance.s26(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.s26(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.s26(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.s26(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.s26(4) + '};\n |' + Spacer_instance.s26(3) + '}\n |' + Spacer_instance.s26(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.s26(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.s26(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.s26(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.s26(4) + '};\n |' + Spacer_instance.s26(3) + '}\n |' + Spacer_instance.s26(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
228
- }
229
- function emitHandleFunction(endpoint) {
230
- return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.r25(this.y25(endpoint.g24_1)) + '(Request request);';
231
- }
232
- function emit_7(_this__u8e3s4, endpoint) {
233
- return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.s26(2) + 'Path path,\n |' + Spacer_instance.s26(2) + 'Wirespec.Method method,\n |' + Spacer_instance.s26(2) + 'Queries queries,\n |' + Spacer_instance.s26(2) + 'RequestHeaders headers,\n |' + Spacer_instance.s26(2) + emit_13(_this__u8e3s4.p24_1, this) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_13(_this__u8e3s4.p24_1, this) + '> {\n |' + Spacer_instance.s26(2) + emitConstructor(_this__u8e3s4, this, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
234
- }
235
- function emit_8(_this__u8e3s4) {
236
- var tmp = Spacer_instance.toString();
237
- var tmp_0 = Companion_instance_1.q25(_this__u8e3s4.s24_1);
238
- var tmp_1 = Spacer_instance.s26(2);
239
- var tmp_2 = Spacer_instance.s26(2);
240
- var tmp_3 = Spacer_instance.s26(2);
241
- var tmp_4 = emit_13(_this__u8e3s4.u24_1, this);
242
- var tmp_5 = Spacer_instance.toString();
243
- var tmp_6 = toString_0(first(_this__u8e3s4.s24_1));
244
- var tmp_7 = emit_13(_this__u8e3s4.u24_1, this);
245
- var tmp_8 = concatGenerics(emit_13(_this__u8e3s4.u24_1, this));
246
- var tmp_9 = Spacer_instance.s26(2);
247
- var tmp_10 = Companion_instance_1.q25(_this__u8e3s4.s24_1);
248
- var tmp_11 = orNull(joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
249
- var tmp0_safe_receiver = _this__u8e3s4.u24_1;
250
- var tmp_12;
251
- if (tmp0_safe_receiver == null) {
252
- tmp_12 = null;
253
- } else {
254
- // Inline function 'kotlin.let' call
255
- // Inline function 'kotlin.contracts.contract' call
256
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emit.<anonymous>' call
257
- tmp_12 = emit_13(tmp0_safe_receiver, this) + ' body';
258
- }
259
- var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
260
- var tmp_14 = Spacer_instance.s26(3);
261
- var tmp_15 = fixStatus(_this__u8e3s4.s24_1);
262
- // Inline function 'kotlin.let' call
263
- // Inline function 'kotlin.contracts.contract' call
264
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emit.<anonymous>' call
265
- var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
266
- var tmp_17 = _this__u8e3s4.u24_1 == null ? 'null' : 'body';
267
- var tmp_18 = Spacer_instance.s26(2);
268
- var tmp_19 = Spacer_instance.s26(1);
269
- return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(\n |' + tmp_1 + 'int status,\n |' + tmp_2 + 'Headers headers,\n |' + tmp_3 + tmp_4 + ' body\n |' + tmp_5 + ') implements Response' + tmp_6 + 'XX<' + tmp_7 + '>, Response' + tmp_8 + ' {\n |' + tmp_9 + 'public Response' + tmp_10 + '(' + tmp_13 + ') {\n |' + tmp_14 + 'this(' + tmp_15 + ', ' + tmp_16 + ', ' + tmp_17 + ');\n |' + tmp_18 + '}\n |' + tmp_19 + emitObject(_this__u8e3s4.t24_1, this, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
270
- }
271
- initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
272
281
  function emit_9(identifier) {
273
282
  var tmp;
274
283
  if (identifier instanceof DefinitionIdentifier) {
275
- tmp = this.n2b(identifier.b1());
284
+ tmp = this.w1v(identifier.l1());
276
285
  } else {
277
286
  if (identifier instanceof FieldIdentifier) {
278
- tmp = this.l2a(this.n2b(identifier.b1()));
287
+ tmp = this.a1w(this.w1v(identifier.l1()));
279
288
  } else {
280
289
  noWhenBranchMatchedException();
281
290
  }
@@ -288,17 +297,16 @@ function sanitizeSymbol(_this__u8e3s4) {
288
297
  // Inline function 'kotlin.collections.mapIndexedTo' call
289
298
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
290
299
  var index = 0;
291
- var tmp0_iterator = this_0.g();
292
- while (tmp0_iterator.h()) {
293
- var item = tmp0_iterator.i();
294
- // Inline function 'community.flock.wirespec.emitters.java.JavaIdentifierEmitter.sanitizeSymbol.<anonymous>' call
295
- var tmp1 = index;
296
- index = tmp1 + 1 | 0;
297
- var tmp$ret$0 = checkIndexOverflow(tmp1) > 0 ? Companion_instance_1.q25(item) : item;
298
- destination.e(tmp$ret$0);
300
+ var _iterator__ex2g4s = this_0.t();
301
+ while (_iterator__ex2g4s.u()) {
302
+ var item = _iterator__ex2g4s.v();
303
+ var _unary__edvuaz = index;
304
+ index = _unary__edvuaz + 1 | 0;
305
+ var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
306
+ destination.x(tmp$ret$0);
299
307
  }
300
308
  var tmp = asSequence(joinToString(destination, ''));
301
- return this.k2a(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
309
+ return this.z1v(joinToString_0(filter(tmp, JavaIdentifierEmitter$sanitizeSymbol$lambda), ''));
302
310
  }
303
311
  function sanitizeFirstIsDigit(_this__u8e3s4) {
304
312
  var tmp;
@@ -318,34 +326,44 @@ function sanitizeFirstIsDigit(_this__u8e3s4) {
318
326
  return tmp;
319
327
  }
320
328
  function sanitizeKeywords(_this__u8e3s4) {
321
- return Companion_getInstance().o2b_1.o1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
329
+ return Companion_getInstance_0().c1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
322
330
  }
323
331
  initMetadataForInterface(JavaIdentifierEmitter, 'JavaIdentifierEmitter');
324
- function emit_10(refined) {
325
- return trimMargin('\n |public record ' + this.y25(refined.d26_1) + ' (' + this.z24(refined.e26_1) + ' value) implements Wirespec.Refined<' + this.z24(refined.e26_1) + '> {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value.toString(); }\n |' + Spacer_instance.toString() + 'public static boolean validate(' + this.y25(refined.d26_1) + ' record) {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + this.m26(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.z24(refined.e26_1) + ' getValue() { return value; }\n |}\n |\n ');
332
+ function emit_10(enum_0, module_0) {
333
+ var tmp = this.wq(enum_0.gr_1);
334
+ return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.hr_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.wq(enum_0.gr_1) + '(String label) {\n |' + Spacer_instance.qr(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String label() {\n |' + Spacer_instance.qr(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
335
+ }
336
+ initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
337
+ function emit_11(union) {
338
+ var tmp = this.wq(union.qo_1);
339
+ return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.ro_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
340
+ }
341
+ initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
342
+ function emit_12(refined) {
343
+ return trimMargin('\n |public record ' + this.wq(refined.br_1) + ' (' + this.xp(refined.cr_1) + ' value) implements Wirespec.Refined<' + this.xp(refined.cr_1) + '> {\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() { return value.toString(); }\n |' + Spacer_instance.toString() + 'public boolean validate() {\n |' + Spacer_instance.toString() + Spacer_instance.toString() + this.kr(refined) + '\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public ' + this.xp(refined.cr_1) + ' value() { return value; }\n |}\n |\n ');
326
344
  }
327
345
  function emitValidator(_this__u8e3s4) {
328
346
  var defaultReturn = 'return true;';
329
- var type = _this__u8e3s4.e26_1.p29_1;
347
+ var type = _this__u8e3s4.cr_1.pu_1;
330
348
  var tmp;
331
349
  if (type instanceof Integer) {
332
- var tmp0_safe_receiver = type.v28_1;
333
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.a25(tmp0_safe_receiver);
350
+ var tmp0_safe_receiver = type.ut_1;
351
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : this.yp(tmp0_safe_receiver);
334
352
  tmp = tmp1_elvis_lhs == null ? defaultReturn : tmp1_elvis_lhs;
335
353
  } else {
336
354
  if (type instanceof Number_0) {
337
- var tmp2_safe_receiver = type.y28_1;
338
- var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.a25(tmp2_safe_receiver);
355
+ var tmp2_safe_receiver = type.xt_1;
356
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : this.yp(tmp2_safe_receiver);
339
357
  tmp = tmp3_elvis_lhs == null ? defaultReturn : tmp3_elvis_lhs;
340
358
  } else {
341
359
  if (type instanceof String_0) {
342
- var tmp4_safe_receiver = type.s28_1;
360
+ var tmp4_safe_receiver = type.rt_1;
343
361
  var tmp_0;
344
362
  var tmp_1 = tmp4_safe_receiver;
345
363
  if ((tmp_1 == null ? null : new RegExp_0(tmp_1)) == null) {
346
364
  tmp_0 = null;
347
365
  } else {
348
- tmp_0 = this.a25(new RegExp_0(tmp4_safe_receiver));
366
+ tmp_0 = this.yp(new RegExp_0(tmp4_safe_receiver));
349
367
  }
350
368
  var tmp5_elvis_lhs = tmp_0;
351
369
  tmp = tmp5_elvis_lhs == null ? defaultReturn : tmp5_elvis_lhs;
@@ -365,50 +383,109 @@ function emitValidator(_this__u8e3s4) {
365
383
  return tmp;
366
384
  }
367
385
  initMetadataForInterface(JavaRefinedTypeDefinitionEmitter, 'JavaRefinedTypeDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
368
- function emit_11(enum_0, module_0) {
369
- var tmp = this.y25(enum_0.i26_1);
370
- return trimMargin('\n |public enum ' + tmp + ' implements Wirespec.Enum {\n |' + spacer(joinToString(enum_0.j26_1, ',\n', VOID, VOID, VOID, VOID, JavaEnumDefinitionEmitter$emit$lambda(this))) + ';\n |' + Spacer_instance.toString() + 'public final String label;\n |' + Spacer_instance.toString() + this.y25(enum_0.i26_1) + '(String label) {\n |' + Spacer_instance.s26(2) + 'this.label = label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String toString() {\n |' + Spacer_instance.s26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + '@Override\n |' + Spacer_instance.toString() + 'public String getLabel() {\n |' + Spacer_instance.s26(2) + 'return label;\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
386
+ function emit_13(endpoint) {
387
+ var tmp = emitImports_0(this, endpoint);
388
+ var tmp_0 = this.wq(endpoint.ep_1);
389
+ var tmp_1 = get_pathParams(endpoint);
390
+ var tmp_2 = emitObject(this, tmp_1, 'Path', 'Wirespec.Path', JavaEndpointDefinitionEmitter$emit$lambda(this));
391
+ var tmp_3 = emitObject(this, endpoint.hp_1, 'Queries', 'Wirespec.Queries', JavaEndpointDefinitionEmitter$emit$lambda_0(this));
392
+ var tmp_4 = emitObject(this, endpoint.ip_1, 'RequestHeaders', 'Wirespec.Request.Headers', JavaEndpointDefinitionEmitter$emit$lambda_1(this));
393
+ var tmp_5 = this.x1v(first_0(endpoint.jp_1), endpoint);
394
+ var tmp_6 = Spacer_instance.toString();
395
+ var tmp_7 = emitStatusInterfaces(this, endpoint);
396
+ var tmp_8 = emitResponseInterfaces(this, endpoint);
397
+ var tmp_9 = distinctByStatus(endpoint.kp_1);
398
+ var tmp_10 = joinToString(tmp_9, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_2(this));
399
+ var tmp_11 = Spacer_instance.toString();
400
+ var tmp_12 = emitRequestFunctions(this, first_0(endpoint.jp_1), endpoint);
401
+ var tmp_13 = Spacer_instance.qr(2);
402
+ var tmp_14 = distinctByStatus(endpoint.kp_1);
403
+ var tmp_15 = joinToString(tmp_14, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_3(this));
404
+ var tmp_16 = Spacer_instance.qr(3);
405
+ var tmp_17 = Spacer_instance.qr(2);
406
+ var tmp_18 = Spacer_instance.qr(2);
407
+ var tmp_19 = emitFromResponse(this, endpoint);
408
+ var tmp_20 = Spacer_instance.qr(2);
409
+ var tmp_21 = Spacer_instance.qr(2);
410
+ var tmp_22 = this.b1w(endpoint);
411
+ var tmp_23 = Spacer_instance.qr(2);
412
+ var tmp_24 = Spacer_instance.qr(3);
413
+ return trimMargin('\n |' + tmp + '\n |\n |public interface ' + tmp_0 + ' extends Wirespec.Endpoint {\n |' + tmp_2 + '\n |\n |' + tmp_3 + '\n |\n |' + tmp_4 + '\n |\n |' + tmp_5 + '\n |\n |' + tmp_6 + 'sealed interface Response<T> extends Wirespec.Response<T> {}\n |' + tmp_7 + '\n |' + tmp_8 + '\n |\n |' + tmp_10 + '\n |\n |' + tmp_11 + 'interface Handler extends Wirespec.Handler {\n |\n |' + tmp_12 + '\n |\n |' + tmp_13 + 'static Wirespec.RawResponse toResponse(Wirespec.Serializer serialization, Response<?> response) {\n |' + tmp_15 + '\n |' + tmp_16 + 'else { throw new IllegalStateException("Cannot match response with status: " + response.status());}\n |' + tmp_17 + '}\n |\n |' + tmp_18 + 'static Response<?> fromResponse(Wirespec.Deserializer serialization, Wirespec.RawResponse response) {\n |' + tmp_19 + '\n |' + tmp_20 + '}\n |\n |' + tmp_21 + tmp_22 + '\n |' + tmp_23 + 'class Handlers implements Wirespec.Server<Request, Response<?>>, Wirespec.Client<Request, Response<?>> {\n |' + tmp_24 + '@Override public String getPathTemplate() { return "/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_4) + '"; }\n |' + Spacer_instance.qr(3) + '@Override public String getMethod() { return "' + endpoint.fp_1.toString() + '"; }\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ServerEdge<Request, Response<?>> getServer(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ServerEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Request from(Wirespec.RawRequest request) { return fromRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawResponse to(Response<?> response) { return toResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(3) + '@Override public Wirespec.ClientEdge<Request, Response<?>> getClient(Wirespec.Serialization serialization) {\n |' + Spacer_instance.qr(4) + 'return new Wirespec.ClientEdge<>() {\n |' + Spacer_instance.qr(5) + '@Override public Wirespec.RawRequest to(Request request) { return toRequest(serialization, request); }\n |' + Spacer_instance.qr(5) + '@Override public Response<?> from(Wirespec.RawResponse response) { return fromResponse(serialization, response); }\n |' + Spacer_instance.qr(4) + '};\n |' + Spacer_instance.qr(3) + '}\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
371
414
  }
372
- initMetadataForInterface(JavaEnumDefinitionEmitter, 'JavaEnumDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
373
- function emit_12(union) {
374
- var tmp = this.y25(union.s23_1);
375
- return trimMargin('\n |public sealed interface ' + tmp + ' permits ' + joinToString(union.t23_1, VOID, VOID, VOID, VOID, VOID, JavaUnionDefinitionEmitter$emit$lambda) + ' {}\n |\n ');
415
+ function emitHandleFunction(endpoint) {
416
+ return 'java.util.concurrent.CompletableFuture<Response<?>> ' + Companion_instance_1.pq(this.wq(endpoint.ep_1)) + '(Request request);';
376
417
  }
377
- initMetadataForInterface(JavaUnionDefinitionEmitter, 'JavaUnionDefinitionEmitter', VOID, VOID, [JavaIdentifierEmitter]);
378
- initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEndpointDefinitionEmitter, JavaIdentifierEmitter, JavaChannelDefinitionEmitter, JavaTypeDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, LanguageEmitter]);
418
+ function emit_14(_this__u8e3s4, endpoint) {
419
+ return trimMargin('\n |' + Spacer_instance.toString() + 'record Request (\n |' + Spacer_instance.qr(2) + 'Path path,\n |' + Spacer_instance.qr(2) + 'Wirespec.Method method,\n |' + Spacer_instance.qr(2) + 'Queries queries,\n |' + Spacer_instance.qr(2) + 'RequestHeaders headers,\n |' + Spacer_instance.qr(2) + emit_16(this, _this__u8e3s4.np_1) + ' body\n |' + Spacer_instance.toString() + ') implements Wirespec.Request<' + emit_16(this, _this__u8e3s4.np_1) + '> {\n |' + Spacer_instance.qr(2) + emitConstructor(this, _this__u8e3s4, endpoint) + '\n |' + Spacer_instance.toString() + '}\n ');
420
+ }
421
+ function emit_15(_this__u8e3s4) {
422
+ var tmp = Spacer_instance.toString();
423
+ var tmp_0 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
424
+ var tmp_1 = Spacer_instance.qr(2);
425
+ var tmp_2 = Spacer_instance.qr(2);
426
+ var tmp_3 = Spacer_instance.qr(2);
427
+ var tmp_4 = emit_16(this, _this__u8e3s4.sp_1);
428
+ var tmp_5 = Spacer_instance.toString();
429
+ var tmp_6 = toString_0(first(_this__u8e3s4.qp_1));
430
+ var tmp_7 = emit_16(this, _this__u8e3s4.sp_1);
431
+ var tmp_8 = concatGenerics(emit_16(this, _this__u8e3s4.sp_1));
432
+ var tmp_9 = Spacer_instance.qr(2);
433
+ var tmp_10 = Companion_instance_1.oq(_this__u8e3s4.qp_1);
434
+ var tmp_11 = orNull(joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_5(this)));
435
+ var tmp0_safe_receiver = _this__u8e3s4.sp_1;
436
+ var tmp_12;
437
+ if (tmp0_safe_receiver == null) {
438
+ tmp_12 = null;
439
+ } else {
440
+ // Inline function 'kotlin.let' call
441
+ tmp_12 = emit_16(this, tmp0_safe_receiver) + ' body';
442
+ }
443
+ var tmp_13 = joinToString(listOfNotNull([tmp_11, tmp_12]));
444
+ var tmp_14 = Spacer_instance.qr(3);
445
+ var tmp_15 = fixStatus(_this__u8e3s4.qp_1);
446
+ // Inline function 'kotlin.let' call
447
+ var tmp_16 = 'new Headers(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emit$lambda_6(this)) + ')';
448
+ var tmp_17 = _this__u8e3s4.sp_1 == null ? 'null' : 'body';
449
+ var tmp_18 = Spacer_instance.qr(2);
450
+ var tmp_19 = Spacer_instance.qr(1);
451
+ return trimMargin('\n |' + tmp + 'record Response' + tmp_0 + '(\n |' + tmp_1 + 'Integer status,\n |' + tmp_2 + 'Headers headers,\n |' + tmp_3 + tmp_4 + ' body\n |' + tmp_5 + ') implements Response' + tmp_6 + 'XX<' + tmp_7 + '>, Response' + tmp_8 + ' {\n |' + tmp_9 + 'public Response' + tmp_10 + '(' + tmp_13 + ') {\n |' + tmp_14 + 'this(' + tmp_15 + ', ' + tmp_16 + ', ' + tmp_17 + ');\n |' + tmp_18 + '}\n |' + tmp_19 + emitObject(this, _this__u8e3s4.rp_1, 'Headers', 'Wirespec.Response.Headers', JavaEndpointDefinitionEmitter$emit$lambda_7(this)) + '\n |' + Spacer_instance.toString() + '}\n ');
452
+ }
453
+ initMetadataForInterface(JavaEndpointDefinitionEmitter, 'JavaEndpointDefinitionEmitter', VOID, VOID, [JavaTypeDefinitionEmitter]);
454
+ initMetadataForClass(JavaEmitter, 'JavaEmitter', JavaEmitter, LanguageEmitter, [JavaEnumDefinitionEmitter, JavaUnionDefinitionEmitter, JavaRefinedTypeDefinitionEmitter, JavaChannelDefinitionEmitter, JavaTypeDefinitionEmitter, JavaIdentifierEmitter, JavaEndpointDefinitionEmitter, LanguageEmitter]);
379
455
  initMetadataForCompanion(Companion);
456
+ initMetadataForCompanion(Companion_0);
457
+ initMetadataForClass(JavaIrEmitter$shared$1);
458
+ initMetadataForClass(JavaIrEmitter, 'JavaIrEmitter', JavaIrEmitter, VOID, [IrEmitter]);
380
459
  initMetadataForObject(JavaShared, 'JavaShared');
381
460
  //endregion
382
- function emitImports(_this__u8e3s4, $this) {
383
- // Inline function 'kotlin.collections.map' call
461
+ function emitImports($this, _this__u8e3s4) {
384
462
  // Inline function 'kotlin.collections.filter' call
463
+ var tmp0 = importReferences(_this__u8e3s4);
385
464
  // Inline function 'kotlin.collections.filterTo' call
386
- var this_0 = importReferences(_this__u8e3s4);
387
465
  var destination = ArrayList_init_$Create$();
388
- var tmp0_iterator = this_0.g();
389
- while (tmp0_iterator.h()) {
390
- var element = tmp0_iterator.i();
391
- // Inline function 'community.flock.wirespec.emitters.java.JavaChannelDefinitionEmitter.emitImports.<anonymous>' call
392
- if (!(_this__u8e3s4.x25().b1() === element.l29_1)) {
393
- destination.e(element);
466
+ var _iterator__ex2g4s = tmp0.t();
467
+ while (_iterator__ex2g4s.u()) {
468
+ var element = _iterator__ex2g4s.v();
469
+ if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
470
+ destination.x(element);
394
471
  }
395
472
  }
473
+ // Inline function 'kotlin.collections.map' call
396
474
  // Inline function 'kotlin.collections.mapTo' call
397
475
  var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
398
- var tmp0_iterator_0 = destination.g();
399
- while (tmp0_iterator_0.h()) {
400
- var item = tmp0_iterator_0.i();
401
- // Inline function 'community.flock.wirespec.emitters.java.JavaChannelDefinitionEmitter.emitImports.<anonymous>' call
402
- var tmp$ret$3 = 'import ' + $this.i2a().o26_1 + '.model.' + item.l29_1 + ';';
403
- destination_0.e(tmp$ret$3);
476
+ var _iterator__ex2g4s_0 = destination.t();
477
+ while (_iterator__ex2g4s_0.u()) {
478
+ var item = _iterator__ex2g4s_0.v();
479
+ var tmp$ret$3 = 'import ' + $this.k1v().mr_1 + '.model.' + item.lu_1 + ';';
480
+ destination_0.x(tmp$ret$3);
404
481
  }
405
482
  var tmp = destination_0;
406
483
  return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaChannelDefinitionEmitter$emitImports$lambda);
407
484
  }
408
- function emitFullyQualified(_this__u8e3s4, $this, reference) {
485
+ function emitFullyQualified($this, _this__u8e3s4, reference) {
409
486
  var tmp;
410
- if (_this__u8e3s4.x25().b1() === reference.b1()) {
411
- tmp = $this.i2a().o26_1 + '.model.';
487
+ if (_this__u8e3s4.vq().l1() === reference.l1()) {
488
+ tmp = $this.k1v().mr_1 + '.model.';
412
489
  } else {
413
490
  tmp = '';
414
491
  }
@@ -421,53 +498,49 @@ function JavaChannelDefinitionEmitter$emitImports$lambda(it) {
421
498
  function JavaChannelDefinitionEmitter() {
422
499
  }
423
500
  function JavaEmitter(packageName, emitShared) {
424
- packageName = packageName === VOID ? Companion_instance.n26('community.flock.wirespec.generated') : packageName;
425
- emitShared = emitShared === VOID ? Companion_instance_0.i23() : emitShared;
501
+ packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
502
+ emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
426
503
  LanguageEmitter.call(this);
427
- this.f2b_1 = packageName;
428
- this.g2b_1 = emitShared;
429
- this.h2b_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
430
- this.i2b_1 = FileExtension_Java_getInstance();
431
- this.j2b_1 = JavaShared_getInstance();
432
- this.k2b_1 = '//';
433
- }
434
- protoOf(JavaEmitter).i2a = function () {
435
- return this.f2b_1;
504
+ this.n1v_1 = packageName;
505
+ this.o1v_1 = emitShared;
506
+ this.p1v_1 = '\nimport community.flock.wirespec.java.Wirespec;\n';
507
+ this.q1v_1 = FileExtension_Java_getInstance();
508
+ this.r1v_1 = JavaShared_getInstance();
509
+ this.s1v_1 = '//';
510
+ }
511
+ protoOf(JavaEmitter).k1v = function () {
512
+ return this.n1v_1;
436
513
  };
437
- protoOf(JavaEmitter).g25 = function () {
438
- return this.i2b_1;
514
+ protoOf(JavaEmitter).eq = function () {
515
+ return this.q1v_1;
439
516
  };
440
- protoOf(JavaEmitter).s2a = function () {
441
- return this.j2b_1;
517
+ protoOf(JavaEmitter).t1v = function () {
518
+ return this.r1v_1;
442
519
  };
443
- protoOf(JavaEmitter).h25 = function () {
444
- return this.k2b_1;
520
+ protoOf(JavaEmitter).fq = function () {
521
+ return this.s1v_1;
445
522
  };
446
- protoOf(JavaEmitter).v25 = function (module_0, logger) {
523
+ protoOf(JavaEmitter).tq = function (module_0, logger) {
447
524
  // Inline function 'kotlin.let' call
448
- // Inline function 'kotlin.contracts.contract' call
449
- // Inline function 'community.flock.wirespec.emitters.java.JavaEmitter.emit.<anonymous>' call
450
- var it = protoOf(LanguageEmitter).v25.call(this, module_0, logger);
451
- return this.g2b_1.j23_1 ? it.vk(new Emitted(Companion_instance.n26('community.flock.wirespec.java').q26() + 'Wirespec', this.s2a().m2b_1)) : it;
525
+ var it = protoOf(LanguageEmitter).tq.call(this, module_0, logger);
526
+ return this.o1v_1.ho_1 ? NonEmptyList__plus_impl_xqmb9(it, new Emitted(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec', this.t1v().v1v_1)) : it;
452
527
  };
453
- protoOf(JavaEmitter).w25 = function (definition, module_0, logger) {
528
+ protoOf(JavaEmitter).uq = function (definition, module_0, logger) {
454
529
  // Inline function 'kotlin.let' call
455
- // Inline function 'kotlin.contracts.contract' call
456
- // Inline function 'community.flock.wirespec.emitters.java.JavaEmitter.emit.<anonymous>' call
457
- var it = protoOf(LanguageEmitter).w25.call(this, definition, module_0, logger);
458
- var subPackageName = plus(this.i2a(), definition);
459
- var tmp = subPackageName.q26() + this.n2b(it.k23_1);
530
+ var it = protoOf(LanguageEmitter).uq.call(this, definition, module_0, logger);
531
+ var subPackageName = plus(this.k1v(), definition);
532
+ var tmp = subPackageName.or() + this.w1v(it.io_1);
460
533
  // Inline function 'kotlin.text.trimStart' call
461
- var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.s25(module_0) ? this.h2b_1 : '') + '\n |' + it.l23_1 + '\n ');
534
+ var this_0 = trimMargin('\n |package ' + subPackageName.toString() + ';\n |' + (Companion_instance_1.qq(module_0) ? this.p1v_1 : '') + '\n |' + it.jo_1 + '\n ');
462
535
  var tmp$ret$0 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
463
536
  return new Emitted(tmp, tmp$ret$0);
464
537
  };
465
- function emitGetType(_this__u8e3s4, $this) {
466
- return 'Wirespec.getType(' + $this.e2b(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw(_this__u8e3s4, $this) + ')';
538
+ function emitGetType($this, _this__u8e3s4) {
539
+ return 'Wirespec.getType(' + $this.m1v(_this__u8e3s4, 'Void') + '.class, ' + emitGetTypeRaw($this, _this__u8e3s4) + ')';
467
540
  }
468
- function emitGetTypeRaw(_this__u8e3s4, $this) {
541
+ function emitGetTypeRaw($this, _this__u8e3s4) {
469
542
  var tmp;
470
- var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.jm();
543
+ var tmp1_elvis_lhs = _this__u8e3s4 == null ? null : _this__u8e3s4.du();
471
544
  if (tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs) {
472
545
  tmp = 'java.util.Optional.class';
473
546
  } else {
@@ -479,209 +552,189 @@ function emitGetTypeRaw(_this__u8e3s4, $this) {
479
552
  }
480
553
  return tmp;
481
554
  }
482
- function emitConstructor(_this__u8e3s4, $this, endpoint) {
555
+ function emitConstructor($this, _this__u8e3s4, endpoint) {
483
556
  var tmp = get_pathParams(endpoint);
484
557
  var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda($this)));
485
- var tmp_1 = orNull(joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
486
- var tmp_2 = orNull(joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
487
- var tmp0_safe_receiver = _this__u8e3s4.p24_1;
558
+ var tmp_1 = orNull(joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_0($this)));
559
+ var tmp_2 = orNull(joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_1($this)));
560
+ var tmp0_safe_receiver = _this__u8e3s4.np_1;
488
561
  var tmp_3;
489
562
  if (tmp0_safe_receiver == null) {
490
563
  tmp_3 = null;
491
564
  } else {
492
565
  // Inline function 'kotlin.let' call
493
- // Inline function 'kotlin.contracts.contract' call
494
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
495
- tmp_3 = emit_13(tmp0_safe_receiver, $this) + ' body';
566
+ tmp_3 = emit_16($this, tmp0_safe_receiver) + ' body';
496
567
  }
497
568
  var tmp_4 = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]));
498
- var tmp_5 = Spacer_instance.s26(3);
499
- // Inline function 'kotlin.let' call
569
+ var tmp_5 = Spacer_instance.qr(3);
500
570
  var tmp_6 = get_pathParams(endpoint);
501
- // Inline function 'kotlin.contracts.contract' call
502
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
571
+ // Inline function 'kotlin.let' call
503
572
  var tmp$ret$3 = 'new Path(' + joinToString(tmp_6, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_2($this)) + ')';
504
573
  var tmp1_elvis_lhs = orNull(tmp$ret$3);
505
574
  var tmp_7 = tmp1_elvis_lhs == null ? 'new Path()' : tmp1_elvis_lhs;
506
- var tmp_8 = 'Wirespec.Method.' + endpoint.h24_1.q2_1;
575
+ var tmp_8 = 'Wirespec.Method.' + endpoint.fp_1.a3_1;
507
576
  // Inline function 'kotlin.let' call
508
- // Inline function 'kotlin.contracts.contract' call
509
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
510
- var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
577
+ var tmp$ret$5 = 'new Queries(' + joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_3($this)) + ')';
511
578
  var tmp2_elvis_lhs = orNull(tmp$ret$5);
512
579
  var tmp_9 = tmp2_elvis_lhs == null ? 'new Queries()' : tmp2_elvis_lhs;
513
580
  // Inline function 'kotlin.let' call
514
- // Inline function 'kotlin.contracts.contract' call
515
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
516
- var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
581
+ var tmp$ret$7 = 'new RequestHeaders(' + joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitConstructor$lambda_4($this)) + ')';
517
582
  var tmp3_elvis_lhs = orNull(tmp$ret$7);
518
583
  var tmp_10 = tmp3_elvis_lhs == null ? 'new RequestHeaders()' : tmp3_elvis_lhs;
519
584
  var tmp_11;
520
- if (_this__u8e3s4.p24_1 == null) {
585
+ if (_this__u8e3s4.np_1 == null) {
521
586
  tmp_11 = null;
522
587
  } else {
523
588
  // Inline function 'kotlin.let' call
524
- // Inline function 'kotlin.contracts.contract' call
525
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitConstructor.<anonymous>' call
526
589
  tmp_11 = 'body';
527
590
  }
528
591
  var tmp5_elvis_lhs = tmp_11;
529
- return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.s26(2) + '}';
592
+ return 'public Request(' + tmp_4 + ') {\n' + tmp_5 + 'this(' + joinToString(listOfNotNull([tmp_7, tmp_8, tmp_9, tmp_10, tmp5_elvis_lhs == null ? 'null' : tmp5_elvis_lhs])) + ');\n' + Spacer_instance.qr(2) + '}';
530
593
  }
531
- function emitDeserializedParams(_this__u8e3s4, $this, endpoint) {
532
- // Inline function 'kotlin.let' call
594
+ function emitDeserializedParams($this, _this__u8e3s4, endpoint) {
533
595
  var tmp = get_indexedPathParams(endpoint);
534
596
  var tmp_0 = orNull(joinToString(tmp, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda($this)));
535
- var tmp_1 = orNull(joinToString(endpoint.j24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
536
- var tmp_2 = orNull(joinToString(endpoint.k24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
537
- var tmp0_safe_receiver = _this__u8e3s4.p24_1;
597
+ var tmp_1 = orNull(joinToString(endpoint.hp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0($this)));
598
+ var tmp_2 = orNull(joinToString(endpoint.ip_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1($this)));
599
+ var tmp0_safe_receiver = _this__u8e3s4.np_1;
538
600
  var tmp_3;
539
601
  if (tmp0_safe_receiver == null) {
540
602
  tmp_3 = null;
541
603
  } else {
542
604
  // Inline function 'kotlin.let' call
543
- // Inline function 'kotlin.contracts.contract' call
544
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
545
- tmp_3 = Spacer_instance.s26(4) + 'request.body().<' + emit_13(tmp0_safe_receiver, $this) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType(tmp0_safe_receiver.r24_1, $this) + ')).orElse(null)';
605
+ tmp_3 = Spacer_instance.qr(4) + 'request.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.pp_1) + ')).orElse(null)';
546
606
  }
547
- // Inline function 'kotlin.contracts.contract' call
548
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
607
+ // Inline function 'kotlin.let' call
549
608
  var it = joinToString(listOfNotNull([tmp_0, tmp_1, tmp_2, tmp_3]), ',\n');
550
- return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.s26(3);
609
+ return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.qr(3);
551
610
  }
552
- function emitDeserializedParams_0(_this__u8e3s4, $this) {
553
- // Inline function 'kotlin.let' call
554
- var tmp = orNull(joinToString(_this__u8e3s4.t24_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
555
- var tmp0_safe_receiver = _this__u8e3s4.u24_1;
611
+ function emitDeserializedParams_0($this, _this__u8e3s4) {
612
+ var tmp = orNull(joinToString(_this__u8e3s4.rp_1, ',\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2($this)));
613
+ var tmp0_safe_receiver = _this__u8e3s4.sp_1;
556
614
  var tmp_0;
557
615
  if (tmp0_safe_receiver == null) {
558
616
  tmp_0 = null;
559
617
  } else {
560
618
  // Inline function 'kotlin.let' call
561
- // Inline function 'kotlin.contracts.contract' call
562
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
563
- tmp_0 = Spacer_instance.s26(5) + 'response.body().<' + emit_13(tmp0_safe_receiver, $this) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType(tmp0_safe_receiver.r24_1, $this) + ')).orElse(null)';
619
+ tmp_0 = Spacer_instance.qr(5) + 'response.body().<' + emit_16($this, tmp0_safe_receiver) + '>map(body -> serialization.deserializeBody(body, ' + emitGetType($this, tmp0_safe_receiver.pp_1) + ')).orElse(null)';
564
620
  }
565
- // Inline function 'kotlin.contracts.contract' call
566
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitDeserializedParams.<anonymous>' call
621
+ // Inline function 'kotlin.let' call
567
622
  var it = joinToString(listOfNotNull([tmp, tmp_0]), ',\n');
568
- return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.s26(4);
623
+ return isBlank(it) ? '' : '\n' + it + '\n' + Spacer_instance.qr(4);
569
624
  }
570
- function emitSerialized(_this__u8e3s4, $this) {
625
+ function emitSerialized($this, _this__u8e3s4) {
571
626
  var tmp;
572
- if (!(_this__u8e3s4.u24_1 == null)) {
573
- tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType(ensureNotNull(_this__u8e3s4.u24_1).r24_1, $this) + '))';
627
+ if (!(_this__u8e3s4.sp_1 == null)) {
628
+ tmp = 'java.util.Optional.ofNullable(serialization.serializeBody(r.body, ' + emitGetType($this, ensureNotNull(_this__u8e3s4.sp_1).pp_1) + '))';
574
629
  } else {
575
630
  tmp = 'java.util.Optional.empty()';
576
631
  }
577
632
  var body = tmp;
578
633
  var tmp_0;
579
634
  // Inline function 'kotlin.collections.isNotEmpty' call
580
- if (!_this__u8e3s4.t24_1.l()) {
581
- tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.t24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
635
+ if (!_this__u8e3s4.rp_1.r()) {
636
+ tmp_0 = 'java.util.Map.ofEntries(' + joinToString(_this__u8e3s4.rp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitSerialized$lambda($this)) + ')';
582
637
  } else {
583
638
  tmp_0 = 'java.util.Collections.emptyMap()';
584
639
  }
585
640
  var headers = tmp_0;
586
- return Spacer_instance.s26(3) + 'if (response instanceof Response' + Companion_instance_1.q25(_this__u8e3s4.s24_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
641
+ return Spacer_instance.qr(3) + 'if (response instanceof Response' + Companion_instance_1.oq(_this__u8e3s4.qp_1) + ' r) { return new Wirespec.RawResponse(r.status(), ' + headers + ', ' + body + '); }';
587
642
  }
588
- function emitDeserialized(_this__u8e3s4, $this) {
589
- return Spacer_instance.s26(4) + 'case ' + _this__u8e3s4.s24_1 + ' -> new Response' + Companion_instance_1.q25(_this__u8e3s4.s24_1) + '(' + emitDeserializedParams_0(_this__u8e3s4, $this) + ');';
643
+ function emitDeserialized($this, _this__u8e3s4) {
644
+ return Spacer_instance.qr(4) + 'case ' + _this__u8e3s4.qp_1 + ' -> new Response' + Companion_instance_1.oq(_this__u8e3s4.qp_1) + '(' + emitDeserializedParams_0($this, _this__u8e3s4) + ');';
590
645
  }
591
- function emitSerializedParams(_this__u8e3s4, $this, fields) {
592
- return 'java.util.Map.entry("' + _this__u8e3s4.c24_1.b1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.y25(_this__u8e3s4.c24_1) + '(), ' + emitGetType(_this__u8e3s4.d24_1, $this) + '))';
646
+ function emitSerializedParams($this, _this__u8e3s4, fields) {
647
+ return 'java.util.Map.entry("' + _this__u8e3s4.ap_1.l1() + '", serialization.serializeParam(request.' + (fields === 'queries' ? 'queries' : 'headers') + '().' + $this.wq(_this__u8e3s4.ap_1) + '(), ' + emitGetType($this, _this__u8e3s4.bp_1) + '))';
593
648
  }
594
- function emitDeserialized_0(_this__u8e3s4, $this) {
595
- return Spacer_instance.s26(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.qd_1 + '), ' + emitGetType(_this__u8e3s4.rd_1.o24_1, $this) + ')';
649
+ function emitDeserialized_0($this, _this__u8e3s4) {
650
+ return Spacer_instance.qr(4) + 'serialization.deserializePath(request.path().get(' + _this__u8e3s4.le_1 + '), ' + emitGetType($this, _this__u8e3s4.me_1.mp_1) + ')';
596
651
  }
597
- function emitDeserializedParams_1(_this__u8e3s4, $this, fields, caseSensitive) {
652
+ function emitDeserializedParams_1($this, _this__u8e3s4, fields, caseSensitive) {
598
653
  var tmp;
599
654
  if (caseSensitive) {
600
- tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.c24_1.b1() + '", java.util.Collections.emptyList())';
655
+ tmp = 'request.' + fields + '().getOrDefault("' + _this__u8e3s4.ap_1.l1() + '", java.util.Collections.emptyList())';
601
656
  } else {
602
- tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.c24_1.b1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
657
+ tmp = 'request.' + fields + '().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + _this__u8e3s4.ap_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList())';
603
658
  }
604
659
  var valuesFromField = tmp;
605
- return Spacer_instance.s26(4) + 'serialization.<' + $this.z24(_this__u8e3s4.d24_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType(_this__u8e3s4.d24_1, $this) + ')';
660
+ return Spacer_instance.qr(4) + 'serialization.<' + $this.xp(_this__u8e3s4.bp_1) + '>deserializeParam(' + valuesFromField + ', ' + emitGetType($this, _this__u8e3s4.bp_1) + ')';
606
661
  }
607
- function emitSerializedHeader(_this__u8e3s4, $this) {
608
- return 'java.util.Map.entry("' + _this__u8e3s4.c24_1.b1() + '", serialization.<' + $this.z24(_this__u8e3s4.d24_1) + '>serializeParam(r.headers().' + $this.y25(_this__u8e3s4.c24_1) + '(), ' + emitGetType(_this__u8e3s4.d24_1, $this) + '))';
662
+ function emitSerializedHeader($this, _this__u8e3s4) {
663
+ return 'java.util.Map.entry("' + _this__u8e3s4.ap_1.l1() + '", serialization.<' + $this.xp(_this__u8e3s4.bp_1) + '>serializeParam(r.headers().' + $this.wq(_this__u8e3s4.ap_1) + '(), ' + emitGetType($this, _this__u8e3s4.bp_1) + '))';
609
664
  }
610
- function emitIdentifier(_this__u8e3s4, $this) {
611
- return 'serialization.serializePath(request.path().' + Companion_instance_1.r25($this.y25(_this__u8e3s4.n24_1)) + '(), ' + emitGetType(_this__u8e3s4.o24_1, $this) + ')';
665
+ function emitIdentifier($this, _this__u8e3s4) {
666
+ return 'serialization.serializePath(request.path().' + Companion_instance_1.pq($this.wq(_this__u8e3s4.lp_1)) + '(), ' + emitGetType($this, _this__u8e3s4.mp_1) + ')';
612
667
  }
613
- function emit_13(_this__u8e3s4, $this) {
614
- var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.r24_1;
615
- var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.z24(tmp1_safe_receiver);
668
+ function emit_16($this, _this__u8e3s4) {
669
+ var tmp1_safe_receiver = _this__u8e3s4 == null ? null : _this__u8e3s4.pp_1;
670
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.xp(tmp1_safe_receiver);
616
671
  return tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
617
672
  }
618
- function emit_14(_this__u8e3s4, $this) {
619
- return $this.z24(_this__u8e3s4.o24_1) + ' ' + $this.y25(_this__u8e3s4.n24_1);
673
+ function emit_17($this, _this__u8e3s4) {
674
+ return $this.xp(_this__u8e3s4.mp_1) + ' ' + $this.wq(_this__u8e3s4.lp_1);
620
675
  }
621
- function emitImports_0(_this__u8e3s4, $this) {
622
- // Inline function 'kotlin.collections.map' call
676
+ function emitImports_0($this, _this__u8e3s4) {
623
677
  // Inline function 'kotlin.collections.filter' call
678
+ var tmp0 = importReferences(_this__u8e3s4);
624
679
  // Inline function 'kotlin.collections.filterTo' call
625
- var this_0 = importReferences(_this__u8e3s4);
626
680
  var destination = ArrayList_init_$Create$();
627
- var tmp0_iterator = this_0.g();
628
- while (tmp0_iterator.h()) {
629
- var element = tmp0_iterator.i();
630
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitImports.<anonymous>' call
631
- if (!(_this__u8e3s4.x25().b1() === element.l29_1)) {
632
- destination.e(element);
681
+ var _iterator__ex2g4s = tmp0.t();
682
+ while (_iterator__ex2g4s.u()) {
683
+ var element = _iterator__ex2g4s.v();
684
+ if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
685
+ destination.x(element);
633
686
  }
634
687
  }
688
+ // Inline function 'kotlin.collections.map' call
635
689
  // Inline function 'kotlin.collections.mapTo' call
636
690
  var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
637
- var tmp0_iterator_0 = destination.g();
638
- while (tmp0_iterator_0.h()) {
639
- var item = tmp0_iterator_0.i();
640
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitImports.<anonymous>' call
641
- var tmp$ret$3 = 'import ' + $this.i2a().o26_1 + '.model.' + item.l29_1 + ';';
642
- destination_0.e(tmp$ret$3);
691
+ var _iterator__ex2g4s_0 = destination.t();
692
+ while (_iterator__ex2g4s_0.u()) {
693
+ var item = _iterator__ex2g4s_0.v();
694
+ var tmp$ret$3 = 'import ' + $this.k1v().mr_1 + '.model.' + item.lu_1 + ';';
695
+ destination_0.x(tmp$ret$3);
643
696
  }
644
697
  var tmp = destination_0;
645
698
  return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitImports$lambda);
646
699
  }
647
- function emitRequestFunctions(_this__u8e3s4, $this, endpoint) {
648
- var tmp = Spacer_instance.s26(2);
649
- var tmp_0 = Spacer_instance.s26(3);
650
- var tmp_1 = Spacer_instance.s26(4);
651
- var tmp_2 = Spacer_instance.s26(4);
652
- var tmp_3 = joinToString(endpoint.i24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
653
- var tmp_4 = Spacer_instance.s26(4);
700
+ function emitRequestFunctions($this, _this__u8e3s4, endpoint) {
701
+ var tmp = Spacer_instance.qr(2);
702
+ var tmp_0 = Spacer_instance.qr(3);
703
+ var tmp_1 = Spacer_instance.qr(4);
704
+ var tmp_2 = Spacer_instance.qr(4);
705
+ var tmp_3 = joinToString(endpoint.gp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda($this));
706
+ var tmp_4 = Spacer_instance.qr(4);
654
707
  var tmp_5;
655
708
  // Inline function 'kotlin.collections.isNotEmpty' call
656
- if (!endpoint.j24_1.l()) {
657
- tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.j24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
709
+ if (!endpoint.hp_1.r()) {
710
+ tmp_5 = 'java.util.Map.ofEntries(' + joinToString(endpoint.hp_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0($this)) + ')';
658
711
  } else {
659
712
  tmp_5 = 'java.util.Collections.emptyMap()';
660
713
  }
661
714
  var tmp_6 = tmp_5;
662
- var tmp_7 = Spacer_instance.s26(4);
715
+ var tmp_7 = Spacer_instance.qr(4);
663
716
  var tmp_8;
664
717
  // Inline function 'kotlin.collections.isNotEmpty' call
665
- if (!endpoint.k24_1.l()) {
666
- tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.k24_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
718
+ if (!endpoint.ip_1.r()) {
719
+ tmp_8 = 'java.util.Map.ofEntries(' + joinToString(endpoint.ip_1, VOID, VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1($this)) + ')';
667
720
  } else {
668
721
  tmp_8 = 'java.util.Collections.emptyMap()';
669
722
  }
670
723
  var tmp_9 = tmp_8;
671
- var tmp_10 = Spacer_instance.s26(4);
724
+ var tmp_10 = Spacer_instance.qr(4);
672
725
  var tmp_11;
673
- if (!(_this__u8e3s4.p24_1 == null)) {
674
- var tmp0_safe_receiver = _this__u8e3s4.p24_1;
675
- var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.r24_1;
676
- tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType(tmp1_safe_receiver, $this)) + '))';
726
+ if (!(_this__u8e3s4.np_1 == null)) {
727
+ var tmp0_safe_receiver = _this__u8e3s4.np_1;
728
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.pp_1;
729
+ tmp_11 = 'java.util.Optional.ofNullable(serialization.serializeBody(request.body(), ' + (tmp1_safe_receiver == null ? null : emitGetType($this, tmp1_safe_receiver)) + '))';
677
730
  } else {
678
731
  tmp_11 = 'java.util.Optional.empty()';
679
732
  }
680
- return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.s26(3) + ');\n |' + Spacer_instance.s26(2) + '}\n |\n |' + Spacer_instance.s26(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.s26(3) + 'return new Request(' + emitDeserializedParams(_this__u8e3s4, $this, endpoint) + ');\n |' + Spacer_instance.s26(2) + '}\n ');
733
+ return trimMargin('\n |' + tmp + 'static Wirespec.RawRequest toRequest(Wirespec.Serializer serialization, Request request) {\n |' + tmp_0 + 'return new Wirespec.RawRequest(\n |' + tmp_1 + 'request.method().name(),\n |' + tmp_2 + 'java.util.List.of(' + tmp_3 + '),\n |' + tmp_4 + tmp_6 + ',\n |' + tmp_7 + tmp_9 + ',\n |' + tmp_10 + tmp_11 + '\n |' + Spacer_instance.qr(3) + ');\n |' + Spacer_instance.qr(2) + '}\n |\n |' + Spacer_instance.qr(2) + 'static Request fromRequest(Wirespec.Deserializer serialization, Wirespec.RawRequest request) {\n |' + Spacer_instance.qr(3) + 'return new Request(' + emitDeserializedParams($this, _this__u8e3s4, endpoint) + ');\n |' + Spacer_instance.qr(2) + '}\n ');
681
734
  }
682
- function emitObject(_this__u8e3s4, $this, name, extends_0, block) {
735
+ function emitObject($this, _this__u8e3s4, name, extends_0, block) {
683
736
  var tmp;
684
- if (_this__u8e3s4.l()) {
737
+ if (_this__u8e3s4.r()) {
685
738
  tmp = Spacer_instance.toString() + 'static class ' + name + ' implements ' + extends_0 + ' {}';
686
739
  } else {
687
740
  var tmp_0 = Spacer_instance.toString();
@@ -689,85 +742,82 @@ function emitObject(_this__u8e3s4, $this, name, extends_0, block) {
689
742
  }
690
743
  return tmp;
691
744
  }
692
- function emitResponseInterfaces(_this__u8e3s4, $this) {
745
+ function emitResponseInterfaces($this, _this__u8e3s4) {
693
746
  // Inline function 'kotlin.collections.map' call
694
- var this_0 = distinctByStatus(_this__u8e3s4.m24_1);
747
+ var this_0 = distinctByStatus(_this__u8e3s4.kp_1);
695
748
  // Inline function 'kotlin.collections.mapTo' call
696
749
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
697
- var tmp0_iterator = this_0.g();
698
- while (tmp0_iterator.h()) {
699
- var item = tmp0_iterator.i();
700
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitResponseInterfaces.<anonymous>' call
701
- var tmp$ret$0 = emit_13(item.u24_1, $this);
702
- destination.e(tmp$ret$0);
750
+ var _iterator__ex2g4s = this_0.t();
751
+ while (_iterator__ex2g4s.u()) {
752
+ var item = _iterator__ex2g4s.v();
753
+ var tmp$ret$0 = emit_16($this, item.sp_1);
754
+ destination.x(tmp$ret$0);
703
755
  }
704
756
  var tmp = distinct(destination);
705
757
  return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda);
706
758
  }
707
- function emitStatusInterfaces(_this__u8e3s4, $this) {
759
+ function emitStatusInterfaces($this, _this__u8e3s4) {
708
760
  // Inline function 'kotlin.collections.map' call
709
- var this_0 = _this__u8e3s4.m24_1;
761
+ var this_0 = _this__u8e3s4.kp_1;
710
762
  // Inline function 'kotlin.collections.mapTo' call
711
763
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
712
- var tmp0_iterator = this_0.g();
713
- while (tmp0_iterator.h()) {
714
- var item = tmp0_iterator.i();
715
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitStatusInterfaces.<anonymous>' call
716
- var tmp$ret$0 = new Char(first(item.s24_1));
717
- destination.e(tmp$ret$0);
764
+ var _iterator__ex2g4s = this_0.t();
765
+ while (_iterator__ex2g4s.u()) {
766
+ var item = _iterator__ex2g4s.v();
767
+ var tmp$ret$0 = new Char(first(item.qp_1));
768
+ destination.x(tmp$ret$0);
718
769
  }
719
770
  var tmp = distinct(destination);
720
771
  return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda);
721
772
  }
722
- function emitFromResponse(_this__u8e3s4, $this) {
773
+ function emitFromResponse($this, _this__u8e3s4) {
723
774
  // Inline function 'kotlin.collections.filter' call
775
+ var tmp0 = distinctByStatus(_this__u8e3s4.kp_1);
724
776
  // Inline function 'kotlin.collections.filterTo' call
725
- var this_0 = distinctByStatus(_this__u8e3s4.m24_1);
726
777
  var destination = ArrayList_init_$Create$();
727
- var tmp0_iterator = this_0.g();
728
- while (tmp0_iterator.h()) {
729
- var element = tmp0_iterator.i();
730
- // Inline function 'community.flock.wirespec.emitters.java.JavaEndpointDefinitionEmitter.emitFromResponse.<anonymous>' call
731
- if (Companion_instance_1.t25(element.s24_1)) {
732
- destination.e(element);
778
+ var _iterator__ex2g4s = tmp0.t();
779
+ while (_iterator__ex2g4s.u()) {
780
+ var element = _iterator__ex2g4s.v();
781
+ if (Companion_instance_1.rq(element.qp_1)) {
782
+ destination.x(element);
733
783
  }
734
784
  }
735
785
  var statusResponses = destination;
736
786
  var tmp;
737
- if (statusResponses.l()) {
738
- tmp = trimMargin('\n |' + Spacer_instance.s26(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
739
- } else if (statusResponses.j() === 1) {
787
+ if (statusResponses.r()) {
788
+ tmp = trimMargin('\n |' + Spacer_instance.qr(3) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n ');
789
+ } else if (statusResponses.a1() === 1) {
740
790
  var response = first_0(statusResponses);
741
- tmp = trimMargin('\n |' + Spacer_instance.s26(3) + 'if (response.statusCode() == ' + response.s24_1 + ') {\n |' + Spacer_instance.s26(4) + 'return new Response' + Companion_instance_1.q25(response.s24_1) + '(' + emitDeserializedParams_0(response, $this) + ');\n |' + Spacer_instance.s26(3) + '} else {\n |' + Spacer_instance.s26(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.s26(3) + '}\n ');
791
+ tmp = trimMargin('\n |' + Spacer_instance.qr(3) + 'if (response.statusCode() == ' + response.qp_1 + ') {\n |' + Spacer_instance.qr(4) + 'return new Response' + Companion_instance_1.oq(response.qp_1) + '(' + emitDeserializedParams_0($this, response) + ');\n |' + Spacer_instance.qr(3) + '} else {\n |' + Spacer_instance.qr(4) + 'throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.qr(3) + '}\n ');
742
792
  } else {
743
- var tmp_0 = Spacer_instance.s26(3);
744
- tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.s26(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.s26(3) + '};\n ');
793
+ var tmp_0 = Spacer_instance.qr(3);
794
+ tmp = trimMargin('\n |' + tmp_0 + 'return switch (response.statusCode()) {\n |' + joinToString(statusResponses, '\n', VOID, VOID, VOID, VOID, JavaEndpointDefinitionEmitter$emitFromResponse$lambda($this)) + '\n |' + Spacer_instance.qr(4) + 'default -> throw new IllegalStateException("Cannot match response with status: " + response.statusCode());\n |' + Spacer_instance.qr(3) + '};\n ');
745
795
  }
746
796
  return tmp;
747
797
  }
748
798
  function JavaEndpointDefinitionEmitter$emit$lambda(this$0) {
749
799
  return function (it) {
750
- return emit_14(it, this$0);
800
+ return emit_17(this$0, it);
751
801
  };
752
802
  }
753
803
  function JavaEndpointDefinitionEmitter$emit$lambda_0(this$0) {
754
804
  return function (it) {
755
- return this$0.y24(it);
805
+ return this$0.wp(it);
756
806
  };
757
807
  }
758
808
  function JavaEndpointDefinitionEmitter$emit$lambda_1(this$0) {
759
809
  return function (it) {
760
- return this$0.y24(it);
810
+ return this$0.wp(it);
761
811
  };
762
812
  }
763
813
  function JavaEndpointDefinitionEmitter$emit$lambda_2(this$0) {
764
814
  return function (it) {
765
- return this$0.w2a(it);
815
+ return this$0.y1v(it);
766
816
  };
767
817
  }
768
818
  function JavaEndpointDefinitionEmitter$emit$lambda_3(this$0) {
769
819
  return function (it) {
770
- return emitSerialized(it, this$0);
820
+ return emitSerialized(this$0, it);
771
821
  };
772
822
  }
773
823
  function JavaEndpointDefinitionEmitter$emit$lambda_4(it) {
@@ -775,72 +825,72 @@ function JavaEndpointDefinitionEmitter$emit$lambda_4(it) {
775
825
  }
776
826
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda(this$0) {
777
827
  return function (it) {
778
- return emit_14(it, this$0);
828
+ return emit_17(this$0, it);
779
829
  };
780
830
  }
781
831
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda_0(this$0) {
782
832
  return function (it) {
783
- return this$0.y24(it);
833
+ return this$0.wp(it);
784
834
  };
785
835
  }
786
836
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda_1(this$0) {
787
837
  return function (it) {
788
- return this$0.y24(it);
838
+ return this$0.wp(it);
789
839
  };
790
840
  }
791
841
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda_2(this$0) {
792
842
  return function (it) {
793
- return this$0.y25(it.n24_1);
843
+ return this$0.wq(it.lp_1);
794
844
  };
795
845
  }
796
846
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda_3(this$0) {
797
847
  return function (it) {
798
- return this$0.y25(it.c24_1);
848
+ return this$0.wq(it.ap_1);
799
849
  };
800
850
  }
801
851
  function JavaEndpointDefinitionEmitter$emitConstructor$lambda_4(this$0) {
802
852
  return function (it) {
803
- return this$0.y25(it.c24_1);
853
+ return this$0.wq(it.ap_1);
804
854
  };
805
855
  }
806
856
  function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda(this$0) {
807
857
  return function (it) {
808
- return emitDeserialized_0(it, this$0);
858
+ return emitDeserialized_0(this$0, it);
809
859
  };
810
860
  }
811
861
  function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_0(this$0) {
812
862
  return function (it) {
813
- return emitDeserializedParams_1(it, this$0, 'queries', true);
863
+ return emitDeserializedParams_1(this$0, it, 'queries', true);
814
864
  };
815
865
  }
816
866
  function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_1(this$0) {
817
867
  return function (it) {
818
- return emitDeserializedParams_1(it, this$0, 'headers', false);
868
+ return emitDeserializedParams_1(this$0, it, 'headers', false);
819
869
  };
820
870
  }
821
871
  function JavaEndpointDefinitionEmitter$emit$lambda_5(this$0) {
822
872
  return function (it) {
823
- return this$0.y24(it);
873
+ return this$0.wp(it);
824
874
  };
825
875
  }
826
876
  function JavaEndpointDefinitionEmitter$emit$lambda_6(this$0) {
827
877
  return function (it) {
828
- return this$0.y25(it.c24_1);
878
+ return this$0.wq(it.ap_1);
829
879
  };
830
880
  }
831
881
  function JavaEndpointDefinitionEmitter$emit$lambda_7(this$0) {
832
882
  return function (it) {
833
- return this$0.y24(it);
883
+ return this$0.wp(it);
834
884
  };
835
885
  }
836
886
  function JavaEndpointDefinitionEmitter$emitDeserializedParams$lambda_2(this$0) {
837
887
  return function (it) {
838
- return Spacer_instance.s26(5) + 'serialization.<' + this$0.z24(it.d24_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.c24_1.b1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(it.d24_1, this$0) + ')';
888
+ return Spacer_instance.qr(5) + 'serialization.<' + this$0.xp(it.bp_1) + '>deserializeParam(response.headers().entrySet().stream().filter(e -> e.getKey().equalsIgnoreCase("' + it.ap_1.l1() + '")).findFirst().map(java.util.Map.Entry::getValue).orElse(java.util.Collections.emptyList()), ' + emitGetType(this$0, it.bp_1) + ')';
839
889
  };
840
890
  }
841
891
  function JavaEndpointDefinitionEmitter$emitSerialized$lambda(this$0) {
842
892
  return function (it) {
843
- return emitSerializedHeader(it, this$0);
893
+ return emitSerializedHeader(this$0, it);
844
894
  };
845
895
  }
846
896
  function JavaEndpointDefinitionEmitter$emitImports$lambda(it) {
@@ -851,10 +901,10 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
851
901
  return function (it) {
852
902
  var tmp;
853
903
  if (it instanceof Literal) {
854
- tmp = '"' + it.j25_1 + '"';
904
+ tmp = '"' + it.hq_1 + '"';
855
905
  } else {
856
906
  if (it instanceof Param) {
857
- tmp = emitIdentifier(it, this$0);
907
+ tmp = emitIdentifier(this$0, it);
858
908
  } else {
859
909
  noWhenBranchMatchedException();
860
910
  }
@@ -864,75 +914,982 @@ function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda(this$0) {
864
914
  }
865
915
  function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_0(this$0) {
866
916
  return function (it) {
867
- return emitSerializedParams(it, this$0, 'queries');
917
+ return emitSerializedParams(this$0, it, 'queries');
868
918
  };
869
919
  }
870
920
  function JavaEndpointDefinitionEmitter$emitRequestFunctions$lambda_1(this$0) {
871
921
  return function (it) {
872
- return emitSerializedParams(it, this$0, 'headers');
922
+ return emitSerializedParams(this$0, it, 'headers');
873
923
  };
874
924
  }
875
925
  function JavaEndpointDefinitionEmitter$emitObject$lambda($block) {
876
926
  return function (it) {
877
- return Spacer_instance.s26(2) + $block(it);
927
+ return Spacer_instance.qr(2) + $block(it);
878
928
  };
879
929
  }
880
930
  function JavaEndpointDefinitionEmitter$emitResponseInterfaces$lambda(it) {
881
931
  return Spacer_instance.toString() + 'sealed interface Response' + concatGenerics(it) + ' extends Response<' + it + '> {}';
882
932
  }
883
933
  function JavaEndpointDefinitionEmitter$emitStatusInterfaces$lambda(it) {
884
- return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.x_1) + 'XX<T> extends Response<T> {}';
934
+ return Spacer_instance.toString() + 'sealed interface Response' + toString_0(it.h1_1) + 'XX<T> extends Response<T> {}';
885
935
  }
886
936
  function JavaEndpointDefinitionEmitter$emitFromResponse$lambda(this$0) {
887
937
  return function (it) {
888
- return emitDeserialized(it, this$0);
938
+ return emitDeserialized(this$0, it);
889
939
  };
890
940
  }
891
941
  function JavaEndpointDefinitionEmitter() {
892
942
  }
893
- function sanitizeNegative(_this__u8e3s4, $this) {
894
- var tmp;
895
- if (startsWith(_this__u8e3s4, '-')) {
896
- // Inline function 'kotlin.text.substring' call
897
- // Inline function 'kotlin.js.asDynamic' call
898
- tmp = '__' + _this__u8e3s4.substring(1);
899
- } else {
900
- tmp = _this__u8e3s4;
901
- }
902
- return tmp;
943
+ function sanitizeNegative($this, _this__u8e3s4) {
944
+ return startsWith(_this__u8e3s4, '-') ? '__' + substring(_this__u8e3s4, 1) : _this__u8e3s4;
903
945
  }
904
- function sanitizeEnum(_this__u8e3s4, $this) {
905
- return $this.l2a($this.k2a(joinToString(split(sanitizeNegative(_this__u8e3s4, $this), ['-', ', ', '.', ' ', '//']), '_')));
946
+ function sanitizeEnum($this, _this__u8e3s4) {
947
+ return $this.a1w($this.z1v(joinToString(split(sanitizeNegative($this, _this__u8e3s4), ['-', ', ', '.', ' ', '//']), '_')));
906
948
  }
907
949
  function JavaEnumDefinitionEmitter$emit$lambda(this$0) {
908
950
  return function (it) {
909
- return sanitizeEnum(it, this$0) + '("' + it + '")';
951
+ return sanitizeEnum(this$0, it) + '("' + it + '")';
910
952
  };
911
953
  }
912
954
  function JavaEnumDefinitionEmitter() {
913
955
  }
914
956
  function Companion() {
915
957
  Companion_instance_2 = this;
916
- this.o2b_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
958
+ this.c1w_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
917
959
  }
918
960
  var Companion_instance_2;
919
- function Companion_getInstance() {
961
+ function Companion_getInstance_0() {
920
962
  if (Companion_instance_2 == null)
921
963
  new Companion();
922
964
  return Companion_instance_2;
923
965
  }
924
966
  function JavaIdentifierEmitter$sanitizeSymbol$lambda(it) {
925
- return isLetterOrDigit(it.x_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).o1(it);
967
+ return isLetterOrDigit(it.h1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).u1(it);
926
968
  }
927
969
  function JavaIdentifierEmitter() {
928
970
  }
971
+ function JavaIrEmitter$shared$o$clientServer$lambda(name) {
972
+ switch (name.s1h()) {
973
+ case 'client':
974
+ return Companion_getInstance().m1h('getClient');
975
+ case 'server':
976
+ return Companion_getInstance().m1h('getServer');
977
+ default:
978
+ return null;
979
+ }
980
+ }
981
+ function JavaIrEmitter$shared$o$wirespecFile$lambda(this$0) {
982
+ return function (element, transformer) {
983
+ var tmp;
984
+ if (element instanceof File) {
985
+ // Inline function 'kotlin.collections.partition' call
986
+ var this_0 = element.u1m_1;
987
+ var first = ArrayList_init_$Create$();
988
+ var second = ArrayList_init_$Create$();
989
+ var _iterator__ex2g4s = this_0.t();
990
+ while (_iterator__ex2g4s.u()) {
991
+ var element_0 = _iterator__ex2g4s.v();
992
+ if (element_0 instanceof Package) {
993
+ first.x(element_0);
994
+ } else {
995
+ second.x(element_0);
996
+ }
997
+ }
998
+ var _destruct__k2r9zo = new Pair(first, second);
999
+ var packageElements = _destruct__k2r9zo.ne();
1000
+ var rest = _destruct__k2r9zo.oe();
1001
+ tmp = element.x1m(VOID, plus_1(plus_1(packageElements, this$0.f1w_1), rest));
1002
+ } else {
1003
+ tmp = element;
1004
+ }
1005
+ var transformed = tmp;
1006
+ return transformChildren(transformed, transformer);
1007
+ };
1008
+ }
1009
+ function JavaIrEmitter$shared$o$wirespecFile$lambda_0(this$0) {
1010
+ return function (element, transformer) {
1011
+ var tmp;
1012
+ if (element instanceof Namespace) {
1013
+ var injected = element.z1m_1.equals(Companion_getInstance().m1h('Wirespec')) ? this$0.g1w_1 : emptyList();
1014
+ var tmp_0;
1015
+ // Inline function 'kotlin.collections.isNotEmpty' call
1016
+ if (!injected.r()) {
1017
+ tmp_0 = withElements(element, plus_1(element.v1m(), injected));
1018
+ } else {
1019
+ tmp_0 = element;
1020
+ }
1021
+ tmp = tmp_0;
1022
+ } else {
1023
+ tmp = element;
1024
+ }
1025
+ var transformed = tmp;
1026
+ return transformChildren(transformed, transformer);
1027
+ };
1028
+ }
1029
+ function sanitizeSymbol_0($this, _this__u8e3s4) {
1030
+ // Inline function 'kotlin.collections.mapIndexed' call
1031
+ var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
1032
+ // Inline function 'kotlin.collections.mapIndexedTo' call
1033
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1034
+ var index = 0;
1035
+ var _iterator__ex2g4s = this_0.t();
1036
+ while (_iterator__ex2g4s.u()) {
1037
+ var item = _iterator__ex2g4s.v();
1038
+ var _unary__edvuaz = index;
1039
+ index = _unary__edvuaz + 1 | 0;
1040
+ var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance_1.oq(item) : item;
1041
+ destination.x(tmp$ret$0);
1042
+ }
1043
+ // Inline function 'kotlin.text.filter' call
1044
+ var tmp0 = joinToString(destination, '');
1045
+ // Inline function 'kotlin.text.filterTo' call
1046
+ var destination_0 = StringBuilder_init_$Create$();
1047
+ var inductionVariable = 0;
1048
+ var last = charSequenceLength(tmp0);
1049
+ if (inductionVariable < last)
1050
+ do {
1051
+ var index_0 = inductionVariable;
1052
+ inductionVariable = inductionVariable + 1 | 0;
1053
+ var element = charSequenceGet(tmp0, index_0);
1054
+ if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
1055
+ destination_0.s(element);
1056
+ }
1057
+ }
1058
+ while (inductionVariable < last);
1059
+ var tmp$ret$5 = destination_0.toString();
1060
+ return sanitizeFirstIsDigit_0($this, tmp$ret$5);
1061
+ }
1062
+ function sanitizeFirstIsDigit_0($this, _this__u8e3s4) {
1063
+ var tmp;
1064
+ var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
1065
+ var tmp_0;
1066
+ var tmp_1 = tmp0_safe_receiver;
1067
+ if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
1068
+ tmp_0 = null;
1069
+ } else {
1070
+ tmp_0 = isDigit(tmp0_safe_receiver);
1071
+ }
1072
+ if (tmp_0 === true) {
1073
+ tmp = '_' + _this__u8e3s4;
1074
+ } else {
1075
+ tmp = _this__u8e3s4;
1076
+ }
1077
+ return tmp;
1078
+ }
1079
+ function sanitizeKeywords_0($this, _this__u8e3s4) {
1080
+ return Companion_getInstance_1().j1w_1.u1(_this__u8e3s4) ? '_' + _this__u8e3s4 : _this__u8e3s4;
1081
+ }
1082
+ function sanitizeEnum_0($this, _this__u8e3s4) {
1083
+ return sanitizeKeywords_0($this, sanitizeFirstIsDigit_0($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
1084
+ }
1085
+ function buildImports($this, _this__u8e3s4) {
1086
+ // Inline function 'kotlin.collections.filter' call
1087
+ var tmp0 = importReferences(_this__u8e3s4);
1088
+ // Inline function 'kotlin.collections.filterTo' call
1089
+ var destination = ArrayList_init_$Create$();
1090
+ var _iterator__ex2g4s = tmp0.t();
1091
+ while (_iterator__ex2g4s.u()) {
1092
+ var element = _iterator__ex2g4s.v();
1093
+ if (!(_this__u8e3s4.vq().l1() === element.lu_1)) {
1094
+ destination.x(element);
1095
+ }
1096
+ }
1097
+ // Inline function 'kotlin.collections.map' call
1098
+ // Inline function 'kotlin.collections.mapTo' call
1099
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
1100
+ var _iterator__ex2g4s_0 = destination.t();
1101
+ while (_iterator__ex2g4s_0.u()) {
1102
+ var item = _iterator__ex2g4s_0.v();
1103
+ var tmp$ret$3 = import_0($this.k1v().mr_1 + '.model', item.lu_1);
1104
+ destination_0.x(tmp$ret$3);
1105
+ }
1106
+ return destination_0;
1107
+ }
1108
+ function injectHandleFunction($this, _this__u8e3s4, endpoint) {
1109
+ var handlersStruct = buildHandlers($this, endpoint);
1110
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1111
+ var scope = new TransformScope(_this__u8e3s4);
1112
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1113
+ var tmp = scope;
1114
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1115
+ var this_0 = scope.z1t_1;
1116
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1117
+ // Inline function 'kotlin.apply' call
1118
+ var this_1 = new TransformerBuilder();
1119
+ this_1.d1h(JavaIrEmitter$injectHandleFunction$lambda(handlersStruct));
1120
+ var tmp$ret$2 = this_1.e1h();
1121
+ tmp.z1t_1 = transform(this_0, tmp$ret$2);
1122
+ var tmp_0 = scope.z1t_1;
1123
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
1124
+ }
1125
+ function buildHandlers($this, endpoint) {
1126
+ var pathTemplate = '/' + joinToString(endpoint.gp_1, '/', VOID, VOID, VOID, VOID, JavaIrEmitter$buildHandlers$lambda);
1127
+ return struct('Handlers', JavaIrEmitter$buildHandlers$lambda_0(pathTemplate, endpoint));
1128
+ }
1129
+ function withFullyQualifiedPrefix($this, _this__u8e3s4, prefix) {
1130
+ var tmp;
1131
+ // Inline function 'kotlin.text.isNotEmpty' call
1132
+ if (charSequenceLength(prefix) > 0) {
1133
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1134
+ var scope = new TransformScope(_this__u8e3s4);
1135
+ var tmp_0 = JavaIrEmitter$withFullyQualifiedPrefix$lambda;
1136
+ scope.c1u(tmp_0, JavaIrEmitter$withFullyQualifiedPrefix$lambda_0(prefix));
1137
+ var tmp_1 = scope.z1t_1;
1138
+ tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
1139
+ } else {
1140
+ tmp = _this__u8e3s4;
1141
+ }
1142
+ return tmp;
1143
+ }
1144
+ function transformTypeDescriptors($this, _this__u8e3s4) {
1145
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1146
+ var scope = new TransformScope(_this__u8e3s4);
1147
+ scope.i1u(JavaIrEmitter$transformTypeDescriptors$lambda($this));
1148
+ var tmp = scope.z1t_1;
1149
+ return isInterface(tmp, Element) ? tmp : THROW_CCE();
1150
+ }
1151
+ function findRoot($this, _this__u8e3s4) {
1152
+ var tmp;
1153
+ if (_this__u8e3s4 instanceof Nullable) {
1154
+ tmp = findRoot($this, _this__u8e3s4.o1h_1);
1155
+ } else {
1156
+ if (_this__u8e3s4 instanceof Array_0) {
1157
+ tmp = findRoot($this, _this__u8e3s4.p1h_1);
1158
+ } else {
1159
+ if (_this__u8e3s4 instanceof Dict_0) {
1160
+ tmp = findRoot($this, _this__u8e3s4.k1m_1);
1161
+ } else {
1162
+ tmp = _this__u8e3s4;
1163
+ }
1164
+ }
1165
+ }
1166
+ return tmp;
1167
+ }
1168
+ function rawContainerClass($this, _this__u8e3s4) {
1169
+ var tmp;
1170
+ if (_this__u8e3s4 instanceof Nullable) {
1171
+ tmp = 'java.util.Optional';
1172
+ } else {
1173
+ if (_this__u8e3s4 instanceof Array_0) {
1174
+ tmp = 'java.util.List';
1175
+ } else {
1176
+ if (_this__u8e3s4 instanceof Dict_0) {
1177
+ tmp = 'java.util.Map';
1178
+ } else {
1179
+ tmp = null;
1180
+ }
1181
+ }
1182
+ }
1183
+ return tmp;
1184
+ }
1185
+ function toJavaName($this, _this__u8e3s4) {
1186
+ var tmp;
1187
+ if (_this__u8e3s4 instanceof Integer_0) {
1188
+ var tmp_0;
1189
+ switch (_this__u8e3s4.g1m_1.b3_1) {
1190
+ case 0:
1191
+ tmp_0 = 'Integer';
1192
+ break;
1193
+ case 1:
1194
+ tmp_0 = 'Long';
1195
+ break;
1196
+ default:
1197
+ noWhenBranchMatchedException();
1198
+ break;
1199
+ }
1200
+ tmp = tmp_0;
1201
+ } else {
1202
+ if (_this__u8e3s4 instanceof Number_1) {
1203
+ var tmp_1;
1204
+ switch (_this__u8e3s4.h1m_1.b3_1) {
1205
+ case 0:
1206
+ tmp_1 = 'Float';
1207
+ break;
1208
+ case 1:
1209
+ tmp_1 = 'Double';
1210
+ break;
1211
+ default:
1212
+ noWhenBranchMatchedException();
1213
+ break;
1214
+ }
1215
+ tmp = tmp_1;
1216
+ } else {
1217
+ if (equals(_this__u8e3s4, String_instance)) {
1218
+ tmp = 'String';
1219
+ } else {
1220
+ if (equals(_this__u8e3s4, Boolean_instance_0)) {
1221
+ tmp = 'Boolean';
1222
+ } else {
1223
+ if (equals(_this__u8e3s4, Bytes_instance_0)) {
1224
+ tmp = 'byte[]';
1225
+ } else {
1226
+ if (equals(_this__u8e3s4, Any_instance)) {
1227
+ tmp = 'Object';
1228
+ } else {
1229
+ if (equals(_this__u8e3s4, Unit_instance_0)) {
1230
+ tmp = 'Void';
1231
+ } else {
1232
+ if (_this__u8e3s4 instanceof Custom_0) {
1233
+ tmp = _this__u8e3s4.q1h_1;
1234
+ } else {
1235
+ tmp = 'Object';
1236
+ }
1237
+ }
1238
+ }
1239
+ }
1240
+ }
1241
+ }
1242
+ }
1243
+ }
1244
+ return tmp;
1245
+ }
1246
+ function Companion_0() {
1247
+ Companion_instance_3 = this;
1248
+ this.j1w_1 = setOf(['abstract', 'continue', 'for', 'new', 'switch', 'assert', 'default', 'goto', 'package', 'synchronized', 'boolean', 'do', 'if', 'private', 'this', 'break', 'double', 'implements', 'protected', 'throw', 'byte', 'else', 'import', 'public', 'throws', 'case', 'enum', 'instanceof', 'return', 'transient', 'catch', 'extends', 'int', 'short', 'try', 'char', 'final', 'interface', 'static', 'void', 'class', 'finally', 'long', 'strictfp', 'volatile', 'const', 'float', 'native', 'super', 'while', 'true', 'false']);
1249
+ }
1250
+ var Companion_instance_3;
1251
+ function Companion_getInstance_1() {
1252
+ if (Companion_instance_3 == null)
1253
+ new Companion_0();
1254
+ return Companion_instance_3;
1255
+ }
1256
+ function JavaIrEmitter$sanitizationConfig$lambda(it) {
1257
+ return '_' + it;
1258
+ }
1259
+ function JavaIrEmitter$sanitizationConfig$lambda_0(name) {
1260
+ return name.n1h_1.a1() > 1 ? new Name(listOf(name.r1l())) : name;
1261
+ }
1262
+ function JavaIrEmitter$sanitizationConfig$lambda_1(name) {
1263
+ return new Name(listOf(name.r1l()));
1264
+ }
1265
+ function JavaIrEmitter$sanitizationConfig$lambda_2(this$0) {
1266
+ return function (it) {
1267
+ return sanitizeSymbol_0(this$0, it);
1268
+ };
1269
+ }
1270
+ function JavaIrEmitter$sanitizationConfig$lambda_3(stmt, tr) {
1271
+ var tmp;
1272
+ var tmp_0;
1273
+ if (stmt instanceof FunctionCall) {
1274
+ tmp_0 = stmt.b1m_1.s1h() === 'validate';
1275
+ } else {
1276
+ tmp_0 = false;
1277
+ }
1278
+ if (tmp_0) {
1279
+ tmp = transformChildren_0(stmt.f1m(VOID, emptyList()), tr);
1280
+ } else {
1281
+ tmp = transformChildren_0(stmt, tr);
1282
+ }
1283
+ return tmp;
1284
+ }
1285
+ function JavaIrEmitter$shared$1() {
1286
+ this.d1w_1 = 'community.flock.wirespec.java';
1287
+ this.e1w_1 = convert(new Shared(this.d1w_1));
1288
+ this.f1w_1 = listOf_0([import_0('java.lang.reflect', 'Type'), import_0('java.lang.reflect', 'ParameterizedType'), import_0('java.util', 'List'), import_0('java.util', 'Map')]);
1289
+ var tmp = this;
1290
+ // Inline function 'kotlin.collections.map' call
1291
+ var this_0 = convertClientServer(new Shared(this.d1w_1));
1292
+ // Inline function 'kotlin.collections.mapTo' call
1293
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1294
+ var _iterator__ex2g4s = this_0.t();
1295
+ while (_iterator__ex2g4s.u()) {
1296
+ var item = _iterator__ex2g4s.v();
1297
+ var tmp$ret$0 = toGetterAccessors(item, JavaIrEmitter$shared$o$clientServer$lambda);
1298
+ destination.x(tmp$ret$0);
1299
+ }
1300
+ tmp.g1w_1 = plus_1(destination, listOf(raw('public static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n if(rawType != null) {\n return new ParameterizedType() {\n public Type getRawType() { return rawType; }\n public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n public Type getOwnerType() { return null; }\n };\n }\n else { return actualTypeArguments; }\n}')));
1301
+ var tmp_0 = this;
1302
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1303
+ var this_1 = this.e1w_1;
1304
+ var scope = new TransformScope(this_1);
1305
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1306
+ var tmp_1 = scope;
1307
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1308
+ var this_2 = scope.z1t_1;
1309
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1310
+ // Inline function 'kotlin.apply' call
1311
+ var this_3 = new TransformerBuilder();
1312
+ this_3.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda(this));
1313
+ var tmp$ret$5 = this_3.e1h();
1314
+ tmp_1.z1t_1 = transform(this_2, tmp$ret$5);
1315
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
1316
+ var tmp_2 = scope;
1317
+ // Inline function 'community.flock.wirespec.ir.core.injectAfter' call
1318
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1319
+ var this_4 = scope.z1t_1;
1320
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1321
+ // Inline function 'kotlin.apply' call
1322
+ var this_5 = new TransformerBuilder();
1323
+ this_5.d1h(JavaIrEmitter$shared$o$wirespecFile$lambda_0(this));
1324
+ var tmp$ret$10 = this_5.e1h();
1325
+ tmp_2.z1t_1 = transform(this_4, tmp$ret$10);
1326
+ var tmp_3 = scope.z1t_1;
1327
+ tmp_0.h1w_1 = isInterface(tmp_3, Element) ? tmp_3 : THROW_CCE();
1328
+ this.i1w_1 = generateJava(this.h1w_1);
1329
+ }
1330
+ protoOf(JavaIrEmitter$shared$1).r1w = function () {
1331
+ return this.i1w_1;
1332
+ };
1333
+ function JavaIrEmitter$emit$lambda(this$0) {
1334
+ return function () {
1335
+ return new File(Companion_getInstance().m1h(Companion_instance.lr('community.flock.wirespec.java').or() + 'Wirespec'), listOf(new RawElement(this$0.t1v().r1w())));
1336
+ };
1337
+ }
1338
+ function JavaIrEmitter$emit$lambda$lambda(this$0) {
1339
+ return function (it) {
1340
+ return sanitizeEnum_0(this$0, it);
1341
+ };
1342
+ }
1343
+ function JavaIrEmitter$emit$lambda$lambda_0($this$function) {
1344
+ $this$function.k1i(String_instance);
1345
+ $this$function.j1k(new VariableReference(Companion_getInstance().m1h('label')));
1346
+ return Unit_instance;
1347
+ }
1348
+ function JavaIrEmitter$emit$lambda_0(this$0) {
1349
+ return function (element, transformer) {
1350
+ var tmp;
1351
+ if (element instanceof Enum) {
1352
+ var tmp_0 = withLabelField(element, JavaIrEmitter$emit$lambda$lambda(this$0));
1353
+ tmp = plus_3(tmp_0, function_0('label', VOID, VOID, JavaIrEmitter$emit$lambda$lambda_0));
1354
+ } else {
1355
+ tmp = element;
1356
+ }
1357
+ var transformed = tmp;
1358
+ return transformChildren(transformed, transformer);
1359
+ };
1360
+ }
1361
+ function JavaIrEmitter$emit$lambda$lambda_1($refined) {
1362
+ return function ($this$function) {
1363
+ $this$function.k1i(convert_0($refined.cr_1));
1364
+ $this$function.j1k(new VariableReference(Companion_getInstance().m1h('value')));
1365
+ return Unit_instance;
1366
+ };
1367
+ }
1368
+ function JavaIrEmitter$emit$lambda_1($refined) {
1369
+ return function (element, transformer) {
1370
+ var tmp;
1371
+ if (element instanceof Struct) {
1372
+ var tmp_0 = listOf(new Custom_0('Wirespec.Refined'));
1373
+ // Inline function 'kotlin.collections.map' call
1374
+ var this_0 = element.j1n_1;
1375
+ // Inline function 'kotlin.collections.mapTo' call
1376
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1377
+ var _iterator__ex2g4s = this_0.t();
1378
+ while (_iterator__ex2g4s.u()) {
1379
+ var item = _iterator__ex2g4s.v();
1380
+ var tmp_1;
1381
+ if (item instanceof Function) {
1382
+ tmp_1 = item.b1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
1383
+ } else {
1384
+ tmp_1 = item;
1385
+ }
1386
+ var tmp$ret$0 = tmp_1;
1387
+ destination.x(tmp$ret$0);
1388
+ }
1389
+ var tmp_2 = element.l1n(VOID, VOID, VOID, tmp_0, destination);
1390
+ tmp = plus_3(tmp_2, function_0('value', VOID, true, JavaIrEmitter$emit$lambda$lambda_1($refined)));
1391
+ } else {
1392
+ tmp = element;
1393
+ }
1394
+ var transformed = tmp;
1395
+ return transformChildren(transformed, transformer);
1396
+ };
1397
+ }
1398
+ function JavaIrEmitter$emit$lambda_2($imports) {
1399
+ return function (element, transformer) {
1400
+ var tmp;
1401
+ if (element instanceof File) {
1402
+ tmp = element.x1m(VOID, plus_1($imports, element.u1m_1));
1403
+ } else {
1404
+ tmp = element;
1405
+ }
1406
+ var transformed = tmp;
1407
+ return transformChildren(transformed, transformer);
1408
+ };
1409
+ }
1410
+ function JavaIrEmitter$emit$lambda_3(this$0, $fullyQualifiedPrefix) {
1411
+ return function (element, transformer) {
1412
+ var tmp;
1413
+ if (element instanceof Interface) {
1414
+ tmp = withFullyQualifiedPrefix(this$0, element, $fullyQualifiedPrefix);
1415
+ } else {
1416
+ tmp = element;
1417
+ }
1418
+ var transformed = tmp;
1419
+ return transformChildren(transformed, transformer);
1420
+ };
1421
+ }
1422
+ function JavaIrEmitter$emit$lambda_4(element, transformer) {
1423
+ var tmp;
1424
+ if (element instanceof File) {
1425
+ // Inline function 'community.flock.wirespec.ir.core.findElement' call
1426
+ // Inline function 'kotlin.collections.filterIsInstance' call
1427
+ var tmp0 = element.v1m();
1428
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
1429
+ var destination = ArrayList_init_$Create$();
1430
+ var _iterator__ex2g4s = tmp0.t();
1431
+ while (_iterator__ex2g4s.u()) {
1432
+ var element_0 = _iterator__ex2g4s.v();
1433
+ if (element_0 instanceof Interface) {
1434
+ destination.x(element_0);
1435
+ }
1436
+ }
1437
+ var tmp$ret$2 = firstOrNull_0(destination);
1438
+ var interfaceElement = ensureNotNull(tmp$ret$2);
1439
+ tmp = element.x1m(VOID, listOf_0([new RawElement('@FunctionalInterface\n'), interfaceElement]));
1440
+ } else {
1441
+ tmp = element;
1442
+ }
1443
+ var transformed = tmp;
1444
+ return transformChildren(transformed, transformer);
1445
+ }
1446
+ function JavaIrEmitter$emitEndpointClient$lambda($endpointName) {
1447
+ return function (element, transformer) {
1448
+ var tmp;
1449
+ if (element instanceof Function) {
1450
+ var tmp_0;
1451
+ if (element.y1j_1 && element.x1j_1.a1() >= 2) {
1452
+ var transportAssign = element.x1j_1.f1(element.x1j_1.a1() - 2 | 0);
1453
+ var returnStmt = last(element.x1j_1);
1454
+ var tmp_1;
1455
+ var tmp_2;
1456
+ if (transportAssign instanceof Assignment) {
1457
+ tmp_2 = returnStmt instanceof ReturnStatement;
1458
+ } else {
1459
+ tmp_2 = false;
1460
+ }
1461
+ if (tmp_2) {
1462
+ var bodyPrefix = dropLast(element.x1j_1, 2);
1463
+ var tmp0_name = Companion_getInstance().m1h('thenApply');
1464
+ var tmp1_receiver = transportAssign.w1o_1;
1465
+ var tmp2_arguments = mapOf(to(Companion_getInstance().m1h('mapper'), new RawExpression('rawResponse -> ' + $endpointName + '.fromRawResponse(serialization(), rawResponse)')));
1466
+ tmp_1 = element.b1k(VOID, VOID, VOID, VOID, plus_2(bodyPrefix, new ReturnStatement(new FunctionCall(tmp1_receiver, VOID, tmp0_name, tmp2_arguments))));
1467
+ } else {
1468
+ tmp_1 = element;
1469
+ }
1470
+ tmp_0 = tmp_1;
1471
+ } else {
1472
+ tmp_0 = element;
1473
+ }
1474
+ tmp = tmp_0;
1475
+ } else {
1476
+ tmp = element;
1477
+ }
1478
+ var transformed = tmp;
1479
+ return transformChildren(transformed, transformer);
1480
+ };
1481
+ }
1482
+ function JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct) {
1483
+ return function (element, transformer) {
1484
+ var tmp;
1485
+ if (element instanceof Interface) {
1486
+ var injected = listOf($handlersStruct);
1487
+ var tmp_0;
1488
+ // Inline function 'kotlin.collections.isNotEmpty' call
1489
+ if (!injected.r()) {
1490
+ tmp_0 = withElements(element, plus_1(element.v1m(), injected));
1491
+ } else {
1492
+ tmp_0 = element;
1493
+ }
1494
+ tmp = tmp_0;
1495
+ } else {
1496
+ tmp = element;
1497
+ }
1498
+ var transformed = tmp;
1499
+ return transformChildren(transformed, transformer);
1500
+ };
1501
+ }
1502
+ function JavaIrEmitter$injectHandleFunction$lambda($handlersStruct) {
1503
+ return function (element, transformer) {
1504
+ var tmp;
1505
+ if (element instanceof Interface) {
1506
+ var tmp_0;
1507
+ if (element.m1o_1.equals(Companion_getInstance().m1h('Handler'))) {
1508
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1509
+ var scope = new TransformScope(element);
1510
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
1511
+ var tmp_1 = scope;
1512
+ // Inline function 'community.flock.wirespec.ir.core.injectAfter' call
1513
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1514
+ var this_0 = scope.z1t_1;
1515
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1516
+ // Inline function 'kotlin.apply' call
1517
+ var this_1 = new TransformerBuilder();
1518
+ this_1.d1h(JavaIrEmitter$injectHandleFunction$lambda$lambda($handlersStruct));
1519
+ var tmp$ret$2 = this_1.e1h();
1520
+ tmp_1.z1t_1 = transform(this_0, tmp$ret$2);
1521
+ var tmp_2 = scope.z1t_1;
1522
+ tmp_0 = isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
1523
+ } else {
1524
+ tmp_0 = element;
1525
+ }
1526
+ tmp = tmp_0;
1527
+ } else {
1528
+ tmp = element;
1529
+ }
1530
+ var transformed = tmp;
1531
+ return transformChildren(transformed, transformer);
1532
+ };
1533
+ }
1534
+ function JavaIrEmitter$buildHandlers$lambda(it) {
1535
+ var tmp;
1536
+ if (it instanceof Literal) {
1537
+ tmp = it.hq_1;
1538
+ } else {
1539
+ if (it instanceof Param) {
1540
+ tmp = '{' + it.lp_1.l1() + '}';
1541
+ } else {
1542
+ noWhenBranchMatchedException();
1543
+ }
1544
+ }
1545
+ return tmp;
1546
+ }
1547
+ function JavaIrEmitter$buildHandlers$lambda$lambda($pathTemplate) {
1548
+ return function ($this$function) {
1549
+ $this$function.k1i(String_instance);
1550
+ $this$function.j1k($this$function.c1t($pathTemplate));
1551
+ return Unit_instance;
1552
+ };
1553
+ }
1554
+ function JavaIrEmitter$buildHandlers$lambda$lambda_0($endpoint) {
1555
+ return function ($this$function) {
1556
+ $this$function.k1i(String_instance);
1557
+ $this$function.j1k($this$function.c1t($endpoint.fp_1.a3_1));
1558
+ return Unit_instance;
1559
+ };
1560
+ }
1561
+ function JavaIrEmitter$buildHandlers$lambda$lambda_1($this$function) {
1562
+ $this$function.k1i($this$function.t1h('Wirespec.ServerEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
1563
+ $this$function.l1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
1564
+ $this$function.j1k(new RawExpression('new Wirespec.ServerEdge<>() {\n@Override public Request from(Wirespec.RawRequest request) {\n return fromRawRequest(serialization, request);\n}\n@Override public Wirespec.RawResponse to(Response<?> response) {\n return toRawResponse(serialization, response);\n}\n}'));
1565
+ return Unit_instance;
1566
+ }
1567
+ function JavaIrEmitter$buildHandlers$lambda$lambda_2($this$function) {
1568
+ $this$function.k1i($this$function.t1h('Wirespec.ClientEdge', [$this$function.t1h('Request', []), $this$function.t1h('Response', [Wildcard_instance])]));
1569
+ $this$function.l1i('serialization', $this$function.t1h('Wirespec.Serialization', []));
1570
+ $this$function.j1k(new RawExpression('new Wirespec.ClientEdge<>() {\n@Override public Wirespec.RawRequest to(Request request) {\n return toRawRequest(serialization, request);\n}\n@Override public Response<?> from(Wirespec.RawResponse response) {\n return fromRawResponse(serialization, response);\n}\n}'));
1571
+ return Unit_instance;
1572
+ }
1573
+ function JavaIrEmitter$buildHandlers$lambda_0($pathTemplate, $endpoint) {
1574
+ return function ($this$struct) {
1575
+ $this$struct.k1k($this$struct.t1h('Wirespec.Server', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
1576
+ $this$struct.k1k($this$struct.t1h('Wirespec.Client', [$this$struct.t1h('Request', []), $this$struct.t1h('Response', [Wildcard_instance])]));
1577
+ $this$struct.b1i('getPathTemplate', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda($pathTemplate));
1578
+ $this$struct.b1i('getMethod', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_0($endpoint));
1579
+ $this$struct.b1i('getServer', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_1);
1580
+ $this$struct.b1i('getClient', VOID, true, JavaIrEmitter$buildHandlers$lambda$lambda_2);
1581
+ return Unit_instance;
1582
+ };
1583
+ }
1584
+ function JavaIrEmitter$withFullyQualifiedPrefix$lambda(it) {
1585
+ return it.v1n_1.equals(Companion_getInstance().m1h('message'));
1586
+ }
1587
+ function JavaIrEmitter$withFullyQualifiedPrefix$lambda_0($prefix) {
1588
+ return function (param) {
1589
+ var t = param.w1n_1;
1590
+ var tmp;
1591
+ if (t instanceof Custom_0) {
1592
+ tmp = param.y1n(VOID, t.n1m($prefix + t.q1h_1));
1593
+ } else {
1594
+ tmp = param;
1595
+ }
1596
+ return tmp;
1597
+ };
1598
+ }
1599
+ function JavaIrEmitter$transformTypeDescriptors$lambda(this$0) {
1600
+ return function (stmt, tr) {
1601
+ var tmp;
1602
+ if (stmt instanceof TypeDescriptor) {
1603
+ var rootType = findRoot(this$0, stmt.h1p_1);
1604
+ var containerStr = rawContainerClass(this$0, stmt.h1p_1);
1605
+ var rootStr = toJavaName(this$0, rootType) + '.class';
1606
+ var tmp_0;
1607
+ if (containerStr == null) {
1608
+ tmp_0 = null;
1609
+ } else {
1610
+ // Inline function 'kotlin.let' call
1611
+ tmp_0 = containerStr + '.class';
1612
+ }
1613
+ var tmp2_elvis_lhs = tmp_0;
1614
+ var containerArg = tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs;
1615
+ tmp = new RawExpression('Wirespec.getType(' + rootStr + ', ' + containerArg + ')');
1616
+ } else {
1617
+ tmp = transformChildren_0(stmt, tr);
1618
+ }
1619
+ return tmp;
1620
+ };
1621
+ }
1622
+ function JavaIrEmitter(packageName, emitShared) {
1623
+ Companion_getInstance_1();
1624
+ packageName = packageName === VOID ? Companion_instance.lr('community.flock.wirespec.generated') : packageName;
1625
+ emitShared = emitShared === VOID ? Companion_instance_0.go() : emitShared;
1626
+ this.k1w_1 = packageName;
1627
+ this.l1w_1 = emitShared;
1628
+ this.m1w_1 = JavaGenerator_instance;
1629
+ this.n1w_1 = FileExtension_Java_getInstance();
1630
+ this.o1w_1 = listOf(import_0('community.flock.wirespec.java', 'Wirespec'));
1631
+ var tmp = this;
1632
+ var tmp_0 = Companion_getInstance_1().j1w_1;
1633
+ var tmp_1 = JavaIrEmitter$sanitizationConfig$lambda;
1634
+ var tmp_2 = JavaIrEmitter$sanitizationConfig$lambda_0;
1635
+ var tmp_3 = JavaIrEmitter$sanitizationConfig$lambda_1;
1636
+ var tmp_4 = JavaIrEmitter$sanitizationConfig$lambda_2(this);
1637
+ tmp.p1w_1 = new SanitizationConfig(tmp_0, tmp_1, tmp_2, tmp_3, tmp_4, JavaIrEmitter$sanitizationConfig$lambda_3);
1638
+ var tmp_5 = this;
1639
+ tmp_5.q1w_1 = new JavaIrEmitter$shared$1();
1640
+ }
1641
+ protoOf(JavaIrEmitter).k1v = function () {
1642
+ return this.k1w_1;
1643
+ };
1644
+ protoOf(JavaIrEmitter).m1u = function () {
1645
+ return this.m1w_1;
1646
+ };
1647
+ protoOf(JavaIrEmitter).eq = function () {
1648
+ return this.n1w_1;
1649
+ };
1650
+ protoOf(JavaIrEmitter).t1v = function () {
1651
+ return this.q1w_1;
1652
+ };
1653
+ protoOf(JavaIrEmitter).n1u = function (module_0, logger) {
1654
+ var tmp = emit_0.call(this, module_0, logger);
1655
+ return withSharedSource(tmp, this.l1w_1, JavaIrEmitter$emit$lambda(this));
1656
+ };
1657
+ protoOf(JavaIrEmitter).uq = function (definition, module_0, logger) {
1658
+ var file = emit_1.call(this, definition, module_0, logger);
1659
+ var tmp = file.x1m(Companion_getInstance().m1h(sanitizeSymbol_0(this, file.t1m_1.x1l())));
1660
+ // Inline function 'kotlin.takeIf' call
1661
+ var this_0 = this.o1w_1;
1662
+ var tmp_0;
1663
+ if (Companion_instance_1.qq(module_0)) {
1664
+ tmp_0 = this_0;
1665
+ } else {
1666
+ tmp_0 = null;
1667
+ }
1668
+ var tmp$ret$1 = tmp_0;
1669
+ return placeInPackage(prependImports(tmp, tmp$ret$1), this.k1v(), definition);
1670
+ };
1671
+ protoOf(JavaIrEmitter).up = function (type, module_0) {
1672
+ return sanitizeNames(convertWithValidation(type, module_0), this.p1w_1);
1673
+ };
1674
+ protoOf(JavaIrEmitter).ir = function (enum_0, module_0) {
1675
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1676
+ var this_0 = convert_1(enum_0);
1677
+ var scope = new TransformScope(this_0);
1678
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1679
+ var tmp = scope;
1680
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1681
+ var this_1 = scope.z1t_1;
1682
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1683
+ // Inline function 'kotlin.apply' call
1684
+ var this_2 = new TransformerBuilder();
1685
+ this_2.d1h(JavaIrEmitter$emit$lambda_0(this));
1686
+ var tmp$ret$2 = this_2.e1h();
1687
+ tmp.z1t_1 = transform(this_1, tmp$ret$2);
1688
+ var tmp_0 = scope.z1t_1;
1689
+ var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
1690
+ return sanitizeNames(tmp$ret$6, this.p1w_1);
1691
+ };
1692
+ protoOf(JavaIrEmitter).yq = function (union) {
1693
+ return sanitizeNames(convert_2(union), this.p1w_1);
1694
+ };
1695
+ protoOf(JavaIrEmitter).dr = function (refined) {
1696
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1697
+ var this_0 = convert_3(refined);
1698
+ var scope = new TransformScope(this_0);
1699
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1700
+ var tmp = scope;
1701
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1702
+ var this_1 = scope.z1t_1;
1703
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1704
+ // Inline function 'kotlin.apply' call
1705
+ var this_2 = new TransformerBuilder();
1706
+ this_2.d1h(JavaIrEmitter$emit$lambda_1(refined));
1707
+ var tmp$ret$2 = this_2.e1h();
1708
+ tmp.z1t_1 = transform(this_1, tmp$ret$2);
1709
+ var tmp_0 = scope.z1t_1;
1710
+ var tmp$ret$6 = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
1711
+ return sanitizeNames(tmp$ret$6, this.p1w_1);
1712
+ };
1713
+ protoOf(JavaIrEmitter).jr = function (endpoint) {
1714
+ var imports = buildImports(this, endpoint);
1715
+ // Inline function 'kotlin.let' call
1716
+ var file = sanitizeNames(transformTypeDescriptors(this, injectHandleFunction(this, convert_4(endpoint), endpoint)), this.p1w_1);
1717
+ var tmp;
1718
+ // Inline function 'kotlin.collections.isNotEmpty' call
1719
+ if (!imports.r()) {
1720
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1721
+ var scope = new TransformScope(file);
1722
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1723
+ var tmp_0 = scope;
1724
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1725
+ var this_0 = scope.z1t_1;
1726
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1727
+ // Inline function 'kotlin.apply' call
1728
+ var this_1 = new TransformerBuilder();
1729
+ this_1.d1h(JavaIrEmitter$emit$lambda_2(imports));
1730
+ var tmp$ret$3 = this_1.e1h();
1731
+ tmp_0.z1t_1 = transform(this_0, tmp$ret$3);
1732
+ var tmp_1 = scope.z1t_1;
1733
+ tmp = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
1734
+ } else {
1735
+ tmp = file;
1736
+ }
1737
+ return tmp;
1738
+ };
1739
+ protoOf(JavaIrEmitter).xq = function (channel) {
1740
+ var tmp;
1741
+ if (channel.mo_1.l1() === channel.no_1.l1()) {
1742
+ tmp = this.k1v().mr_1 + '.model.';
1743
+ } else {
1744
+ tmp = '';
1745
+ }
1746
+ var fullyQualifiedPrefix = tmp;
1747
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1748
+ var this_0 = sanitizeNames(convert_5(channel), this.p1w_1);
1749
+ var scope = new TransformScope(this_0);
1750
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1751
+ var tmp_0 = scope;
1752
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1753
+ var this_1 = scope.z1t_1;
1754
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1755
+ // Inline function 'kotlin.apply' call
1756
+ var this_2 = new TransformerBuilder();
1757
+ this_2.d1h(JavaIrEmitter$emit$lambda_3(this, fullyQualifiedPrefix));
1758
+ var tmp$ret$2 = this_2.e1h();
1759
+ tmp_0.z1t_1 = transform(this_1, tmp$ret$2);
1760
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1761
+ var tmp_1 = scope;
1762
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1763
+ var this_3 = scope.z1t_1;
1764
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1765
+ // Inline function 'kotlin.apply' call
1766
+ var this_4 = new TransformerBuilder();
1767
+ this_4.d1h(JavaIrEmitter$emit$lambda_4);
1768
+ var tmp$ret$7 = this_4.e1h();
1769
+ tmp_1.z1t_1 = transform(this_3, tmp$ret$7);
1770
+ var tmp_2 = scope.z1t_1;
1771
+ return isInterface(tmp_2, Element) ? tmp_2 : THROW_CCE();
1772
+ };
1773
+ protoOf(JavaIrEmitter).q1u = function (endpoint) {
1774
+ var imports = buildImports(this, endpoint);
1775
+ var endpointImport = import_0(this.k1v().mr_1 + '.endpoint', endpoint.ep_1.l1());
1776
+ var file = transformTypeDescriptors(this, sanitizeNames(emitEndpointClient.call(this, endpoint), this.p1w_1));
1777
+ var endpointName = endpoint.ep_1.l1();
1778
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
1779
+ var scope = new TransformScope(file);
1780
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
1781
+ var tmp = scope;
1782
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
1783
+ var this_0 = scope.z1t_1;
1784
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
1785
+ // Inline function 'kotlin.apply' call
1786
+ var this_1 = new TransformerBuilder();
1787
+ this_1.d1h(JavaIrEmitter$emitEndpointClient$lambda(endpointName));
1788
+ var tmp$ret$2 = this_1.e1h();
1789
+ tmp.z1t_1 = transform(this_0, tmp$ret$2);
1790
+ var tmp_0 = scope.z1t_1;
1791
+ var transformedFile = isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
1792
+ var subPackageName = plus_0(this.k1v(), 'client');
1793
+ return new File(Companion_getInstance().m1h(subPackageName.or() + sanitizeSymbol_0(this, transformedFile.t1m_1.x1l())), plus_1(plus_1(plus_1(plus_1(listOf(new Package(subPackageName.mr_1)), this.o1w_1), imports), listOf(endpointImport)), transformedFile.u1m_1));
1794
+ };
1795
+ protoOf(JavaIrEmitter).p1u = function (endpoints, logger) {
1796
+ // Inline function 'kotlin.collections.flatMap' call
1797
+ // Inline function 'kotlin.collections.flatMapTo' call
1798
+ var destination = ArrayList_init_$Create$();
1799
+ var _iterator__ex2g4s = endpoints.t();
1800
+ while (_iterator__ex2g4s.u()) {
1801
+ var element = _iterator__ex2g4s.v();
1802
+ var list = importReferences(element);
1803
+ addAll(destination, list);
1804
+ }
1805
+ // Inline function 'kotlin.collections.distinctBy' call
1806
+ var set = HashSet_init_$Create$();
1807
+ var list_0 = ArrayList_init_$Create$();
1808
+ var _iterator__ex2g4s_0 = destination.t();
1809
+ while (_iterator__ex2g4s_0.u()) {
1810
+ var e = _iterator__ex2g4s_0.v();
1811
+ var key = e.lu_1;
1812
+ if (set.x(key)) {
1813
+ list_0.x(e);
1814
+ }
1815
+ }
1816
+ // Inline function 'kotlin.collections.filter' call
1817
+ // Inline function 'kotlin.collections.filterTo' call
1818
+ var destination_0 = ArrayList_init_$Create$();
1819
+ var _iterator__ex2g4s_1 = list_0.t();
1820
+ while (_iterator__ex2g4s_1.u()) {
1821
+ var element_0 = _iterator__ex2g4s_1.v();
1822
+ var tmp$ret$5;
1823
+ $l$block_0: {
1824
+ // Inline function 'kotlin.collections.none' call
1825
+ var tmp;
1826
+ if (isInterface(endpoints, Collection)) {
1827
+ tmp = endpoints.r();
1828
+ } else {
1829
+ tmp = false;
1830
+ }
1831
+ if (tmp) {
1832
+ tmp$ret$5 = true;
1833
+ break $l$block_0;
1834
+ }
1835
+ var _iterator__ex2g4s_2 = endpoints.t();
1836
+ while (_iterator__ex2g4s_2.u()) {
1837
+ var element_1 = _iterator__ex2g4s_2.v();
1838
+ if (element_1.ep_1.l1() === element_0.lu_1) {
1839
+ tmp$ret$5 = false;
1840
+ break $l$block_0;
1841
+ }
1842
+ }
1843
+ tmp$ret$5 = true;
1844
+ }
1845
+ if (tmp$ret$5) {
1846
+ destination_0.x(element_0);
1847
+ }
1848
+ }
1849
+ // Inline function 'kotlin.collections.map' call
1850
+ // Inline function 'kotlin.collections.mapTo' call
1851
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
1852
+ var _iterator__ex2g4s_3 = destination_0.t();
1853
+ while (_iterator__ex2g4s_3.u()) {
1854
+ var item = _iterator__ex2g4s_3.v();
1855
+ var tmp$ret$10 = import_0(this.k1v().mr_1 + '.model', item.lu_1);
1856
+ destination_1.x(tmp$ret$10);
1857
+ }
1858
+ var imports = destination_1;
1859
+ // Inline function 'kotlin.collections.map' call
1860
+ // Inline function 'kotlin.collections.mapTo' call
1861
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
1862
+ var _iterator__ex2g4s_4 = endpoints.t();
1863
+ while (_iterator__ex2g4s_4.u()) {
1864
+ var item_0 = _iterator__ex2g4s_4.v();
1865
+ var tmp$ret$13 = import_0(this.k1v().mr_1 + '.endpoint', item_0.ep_1.l1());
1866
+ destination_2.x(tmp$ret$13);
1867
+ }
1868
+ var endpointImports = destination_2;
1869
+ // Inline function 'kotlin.collections.map' call
1870
+ // Inline function 'kotlin.collections.mapTo' call
1871
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
1872
+ var _iterator__ex2g4s_5 = endpoints.t();
1873
+ while (_iterator__ex2g4s_5.u()) {
1874
+ var item_1 = _iterator__ex2g4s_5.v();
1875
+ var tmp$ret$16 = import_0(this.k1v().mr_1 + '.client', item_1.ep_1.l1() + 'Client');
1876
+ destination_3.x(tmp$ret$16);
1877
+ }
1878
+ var clientImports = destination_3;
1879
+ var allImports = plus_1(plus_1(imports, endpointImports), clientImports);
1880
+ var file = sanitizeNames(emitClient.call(this, endpoints, logger), this.p1w_1);
1881
+ return new File(Companion_getInstance().m1h(this.k1v().or() + sanitizeSymbol_0(this, file.t1m_1.x1l())), plus_1(plus_1(plus_1(listOf(new Package(this.k1v().mr_1)), this.o1w_1), allImports), file.u1m_1));
1882
+ };
929
1883
  function JavaRefinedTypeDefinitionEmitter() {
930
1884
  }
931
1885
  function JavaShared() {
932
1886
  JavaShared_instance = this;
933
- this.l2b_1 = 'community.flock.wirespec.java';
934
- this.m2b_1 = trimMargin('\n |package ' + this.l2b_1 + ';\n |\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |import java.util.List;\n |import java.util.Map;\n |import java.util.Optional;\n |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String getLabel(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined<T> { T getValue(); }\n |' + Spacer_instance.toString() + 'interface Path {}\n |' + Spacer_instance.toString() + 'interface Queries {}\n |' + Spacer_instance.toString() + 'interface Headers {}\n |' + Spacer_instance.toString() + 'interface Handler {}\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.s26(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.s26(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'String getPathTemplate();\n |' + Spacer_instance.s26(2) + 'String getMethod();\n |' + Spacer_instance.s26(2) + 'ClientEdge<Req, Res> getClient(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.s26(2) + 'String getPathTemplate();\n |' + Spacer_instance.s26(2) + 'String getMethod();\n |' + Spacer_instance.s26(2) + 'ServerEdge<Req, Res> getServer(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T> { Path path(); Method method(); Queries queries(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Response<T> { int status(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Serialization extends Serializer, Deserializer {}\n |' + Spacer_instance.toString() + 'interface Serializer extends BodySerializer, PathSerializer, ParamSerializer {}\n |' + Spacer_instance.toString() + 'interface Deserializer extends BodyDeserializer, PathDeserializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerialization extends BodySerializer, BodyDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerializer { <T> byte[] serializeBody(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { <T> T deserializeBody(byte[] raw, Type type); }\n |' + Spacer_instance.toString() + 'interface PathSerialization extends PathSerializer, PathDeserializer {}\n |' + Spacer_instance.toString() + 'interface PathSerializer { <T> String serializePath(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { <T> T deserializePath(String raw, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamSerialization extends ParamSerializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface ParamSerializer { <T> List<String> serializeParam(T value, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { <T> T deserializeParam(List<String> values, Type type); }\n |' + Spacer_instance.toString() + 'record RawRequest(String method, List<String> path, Map<String, List<String>> queries, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'record RawResponse(int statusCode, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n |' + Spacer_instance.s26(2) + 'if(rawType != null) {\n |' + Spacer_instance.s26(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.s26(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.s26(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.s26(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.s26(3) + '};\n |' + Spacer_instance.s26(2) + '}\n |' + Spacer_instance.s26(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
1887
+ this.u1v_1 = 'community.flock.wirespec.java';
1888
+ this.v1v_1 = trimMargin('\n |package ' + this.u1v_1 + ';\n |\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |import java.util.List;\n |import java.util.Map;\n |import java.util.Optional;\n |\n |public interface Wirespec {\n |' + Spacer_instance.toString() + 'interface Enum { String label(); }\n |' + Spacer_instance.toString() + 'interface Endpoint {}\n |' + Spacer_instance.toString() + 'interface Refined<T> { T value(); }\n |' + Spacer_instance.toString() + 'interface Path {}\n |' + Spacer_instance.toString() + 'interface Queries {}\n |' + Spacer_instance.toString() + 'interface Headers {}\n |' + Spacer_instance.toString() + 'interface Handler {}\n |' + Spacer_instance.toString() + 'interface ServerEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'Req from(RawRequest request);\n |' + Spacer_instance.qr(2) + 'RawResponse to(Res response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface ClientEdge<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'RawRequest to(Req request);\n |' + Spacer_instance.qr(2) + 'Res from(RawResponse response);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Client<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(2) + 'ClientEdge<Req, Res> getClient(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'interface Server<Req extends Request<?>, Res extends Response<?>> {\n |' + Spacer_instance.qr(2) + 'String getPathTemplate();\n |' + Spacer_instance.qr(2) + 'String getMethod();\n |' + Spacer_instance.qr(2) + 'ServerEdge<Req, Res> getServer(Serialization serialization);\n |' + Spacer_instance.toString() + '}\n |' + Spacer_instance.toString() + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + Spacer_instance.toString() + 'interface Request<T> { Path path(); Method method(); Queries queries(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Response<T> { Integer status(); Headers headers(); T body(); interface Headers extends Wirespec.Headers {} }\n |' + Spacer_instance.toString() + 'interface Serialization extends Serializer, Deserializer {}\n |' + Spacer_instance.toString() + 'interface Serializer extends BodySerializer, PathSerializer, ParamSerializer {}\n |' + Spacer_instance.toString() + 'interface Deserializer extends BodyDeserializer, PathDeserializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerialization extends BodySerializer, BodyDeserializer {}\n |' + Spacer_instance.toString() + 'interface BodySerializer { <T> byte[] serializeBody(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface BodyDeserializer { <T> T deserializeBody(byte[] raw, Type type); }\n |' + Spacer_instance.toString() + 'interface PathSerialization extends PathSerializer, PathDeserializer {}\n |' + Spacer_instance.toString() + 'interface PathSerializer { <T> String serializePath(T t, Type type); }\n |' + Spacer_instance.toString() + 'interface PathDeserializer { <T> T deserializePath(String raw, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamSerialization extends ParamSerializer, ParamDeserializer {}\n |' + Spacer_instance.toString() + 'interface ParamSerializer { <T> List<String> serializeParam(T value, Type type); }\n |' + Spacer_instance.toString() + 'interface ParamDeserializer { <T> T deserializeParam(List<String> values, Type type); }\n |' + Spacer_instance.toString() + 'record RawRequest(String method, List<String> path, Map<String, List<String>> queries, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'record RawResponse(int statusCode, Map<String, List<String>> headers, Optional<byte[]> body) {}\n |' + Spacer_instance.toString() + 'static Type getType(final Class<?> actualTypeArguments, final Class<?> rawType) {\n |' + Spacer_instance.qr(2) + 'if(rawType != null) {\n |' + Spacer_instance.qr(3) + 'return new ParameterizedType() {\n |' + Spacer_instance.qr(4) + 'public Type getRawType() { return rawType; }\n |' + Spacer_instance.qr(4) + 'public Type[] getActualTypeArguments() { return new Class<?>[]{actualTypeArguments}; }\n |' + Spacer_instance.qr(4) + 'public Type getOwnerType() { return null; }\n |' + Spacer_instance.qr(3) + '};\n |' + Spacer_instance.qr(2) + '}\n |' + Spacer_instance.qr(2) + 'else { return actualTypeArguments; }\n |' + Spacer_instance.toString() + '}\n |}\n |\n ');
935
1889
  }
1890
+ protoOf(JavaShared).r1w = function () {
1891
+ return this.v1v_1;
1892
+ };
936
1893
  protoOf(JavaShared).toString = function () {
937
1894
  return 'JavaShared';
938
1895
  };
@@ -944,7 +1901,6 @@ protoOf(JavaShared).equals = function (other) {
944
1901
  return true;
945
1902
  if (!(other instanceof JavaShared))
946
1903
  return false;
947
- other instanceof JavaShared || THROW_CCE();
948
1904
  return true;
949
1905
  };
950
1906
  var JavaShared_instance;
@@ -953,13 +1909,13 @@ function JavaShared_getInstance() {
953
1909
  new JavaShared();
954
1910
  return JavaShared_instance;
955
1911
  }
956
- function emitType(_this__u8e3s4, $this) {
1912
+ function emitType($this, _this__u8e3s4) {
957
1913
  var tmp;
958
1914
  if (_this__u8e3s4 instanceof Dict) {
959
- tmp = 'java.util.Map<String, ' + $this.z24(_this__u8e3s4.e23_1) + '>';
1915
+ tmp = 'java.util.Map<String, ' + $this.xp(_this__u8e3s4.co_1) + '>';
960
1916
  } else {
961
1917
  if (_this__u8e3s4 instanceof Iterable) {
962
- tmp = 'java.util.List<' + $this.z24(_this__u8e3s4.b23_1) + '>';
1918
+ tmp = 'java.util.List<' + $this.xp(_this__u8e3s4.zn_1) + '>';
963
1919
  } else {
964
1920
  if (_this__u8e3s4 instanceof Unit) {
965
1921
  tmp = 'void';
@@ -968,10 +1924,10 @@ function emitType(_this__u8e3s4, $this) {
968
1924
  tmp = 'Object';
969
1925
  } else {
970
1926
  if (_this__u8e3s4 instanceof Custom) {
971
- tmp = _this__u8e3s4.l29_1;
1927
+ tmp = _this__u8e3s4.lu_1;
972
1928
  } else {
973
1929
  if (_this__u8e3s4 instanceof Primitive) {
974
- tmp = emit_15(_this__u8e3s4, $this);
1930
+ tmp = emit_18($this, _this__u8e3s4);
975
1931
  } else {
976
1932
  noWhenBranchMatchedException();
977
1933
  }
@@ -982,15 +1938,15 @@ function emitType(_this__u8e3s4, $this) {
982
1938
  }
983
1939
  return tmp;
984
1940
  }
985
- function emit_15(_this__u8e3s4, $this) {
986
- var t = _this__u8e3s4.p29_1;
1941
+ function emit_18($this, _this__u8e3s4) {
1942
+ var t = _this__u8e3s4.pu_1;
987
1943
  var tmp;
988
1944
  if (t instanceof String_0) {
989
1945
  tmp = 'String';
990
1946
  } else {
991
1947
  if (t instanceof Integer) {
992
1948
  var tmp_0;
993
- switch (t.u28_1.r2_1) {
1949
+ switch (t.tt_1.b3_1) {
994
1950
  case 0:
995
1951
  tmp_0 = 'Integer';
996
1952
  break;
@@ -1005,7 +1961,7 @@ function emit_15(_this__u8e3s4, $this) {
1005
1961
  } else {
1006
1962
  if (t instanceof Number_0) {
1007
1963
  var tmp_1;
1008
- switch (t.x28_1.r2_1) {
1964
+ switch (t.wt_1.b3_1) {
1009
1965
  case 0:
1010
1966
  tmp_1 = 'Float';
1011
1967
  break;
@@ -1034,47 +1990,48 @@ function emit_15(_this__u8e3s4, $this) {
1034
1990
  }
1035
1991
  function JavaTypeDefinitionEmitter$emit$lambda(this$0) {
1036
1992
  return function (it) {
1037
- return this$0.z24(it);
1993
+ return this$0.xp(it);
1038
1994
  };
1039
1995
  }
1040
1996
  function JavaTypeDefinitionEmitter$emit$lambda_0(this$0) {
1041
1997
  return function (it) {
1042
- return Spacer_instance.toString() + this$0.y24(it) + ',';
1998
+ return Spacer_instance.toString() + this$0.wp(it) + ',';
1043
1999
  };
1044
2000
  }
1045
2001
  function JavaTypeDefinitionEmitter() {
1046
2002
  }
1047
2003
  function JavaUnionDefinitionEmitter$emit$lambda(it) {
1048
- return it.b1();
2004
+ return it.l1();
1049
2005
  }
1050
2006
  function JavaUnionDefinitionEmitter() {
1051
2007
  }
1052
2008
  //region block: post-declaration
1053
- protoOf(JavaEmitter).y25 = emit_9;
1054
- protoOf(JavaEmitter).w24 = emit_0;
1055
- protoOf(JavaEmitter).x24 = emit_1;
1056
- protoOf(JavaEmitter).y24 = emit_2;
1057
- protoOf(JavaEmitter).z24 = emit_3;
1058
- protoOf(JavaEmitter).a25 = emit_4;
1059
- protoOf(JavaEmitter).l26 = emit_6;
1060
- protoOf(JavaEmitter).v2a = emit_7;
1061
- protoOf(JavaEmitter).w2a = emit_8;
1062
- protoOf(JavaEmitter).z25 = emit_5;
1063
- protoOf(JavaEmitter).k26 = emit_11;
1064
- protoOf(JavaEmitter).a26 = emit_12;
1065
- protoOf(JavaEmitter).f26 = emit_10;
1066
- protoOf(JavaEmitter).n2b = sanitizeSymbol;
1067
- protoOf(JavaEmitter).k2a = sanitizeFirstIsDigit;
1068
- protoOf(JavaEmitter).l2a = sanitizeKeywords;
1069
- protoOf(JavaEmitter).e2b = emitRoot;
1070
- protoOf(JavaEmitter).d2b = emitRoot$default;
1071
- protoOf(JavaEmitter).x2a = emitHandleFunction;
1072
- protoOf(JavaEmitter).m26 = emitValidator;
2009
+ protoOf(JavaEmitter).wq = emit_9;
2010
+ protoOf(JavaEmitter).up = emit_3;
2011
+ protoOf(JavaEmitter).vp = emit_4;
2012
+ protoOf(JavaEmitter).wp = emit_5;
2013
+ protoOf(JavaEmitter).xp = emit_6;
2014
+ protoOf(JavaEmitter).yp = emit_7;
2015
+ protoOf(JavaEmitter).jr = emit_13;
2016
+ protoOf(JavaEmitter).x1v = emit_14;
2017
+ protoOf(JavaEmitter).y1v = emit_15;
2018
+ protoOf(JavaEmitter).xq = emit_8;
2019
+ protoOf(JavaEmitter).ir = emit_10;
2020
+ protoOf(JavaEmitter).yq = emit_11;
2021
+ protoOf(JavaEmitter).dr = emit_12;
2022
+ protoOf(JavaEmitter).w1v = sanitizeSymbol;
2023
+ protoOf(JavaEmitter).z1v = sanitizeFirstIsDigit;
2024
+ protoOf(JavaEmitter).a1w = sanitizeKeywords;
2025
+ protoOf(JavaEmitter).m1v = emitRoot;
2026
+ protoOf(JavaEmitter).l1v = emitRoot$default;
2027
+ protoOf(JavaEmitter).b1w = emitHandleFunction;
2028
+ protoOf(JavaEmitter).kr = emitValidator;
2029
+ protoOf(JavaIrEmitter).on = emit_2;
1073
2030
  //endregion
1074
2031
  //region block: exports
1075
2032
  export {
1076
2033
  JavaEmitter as JavaEmitter1ye60adpym6m1,
1077
- JavaShared_getInstance as JavaShared_getInstance1dymryq5p96,
2034
+ JavaIrEmitter as JavaIrEmittereoab4zj7i4gq,
1078
2035
  };
1079
2036
  //endregion
1080
2037