@flock/wirespec 0.8.47 → 0.8.49

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 (33) hide show
  1. package/arrow-arrow-atomic.js +16 -16
  2. package/arrow-arrow-continuations.js +3 -3
  3. package/arrow-arrow-core.js +109 -88
  4. package/arrow-arrow-core.js.map +1 -1
  5. package/clikt-clikt.js +6790 -0
  6. package/clikt-clikt.js.map +1 -0
  7. package/colormath-root-colormath.js +1403 -0
  8. package/colormath-root-colormath.js.map +1 -0
  9. package/kotlin-kotlin-stdlib-js-ir.js +4150 -2107
  10. package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
  11. package/kotlin-openapi-bindings.js +3574 -3574
  12. package/kotlin-openapi-bindings.js.map +1 -1
  13. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +1551 -1550
  14. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -1
  15. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +1183 -1172
  16. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -1
  17. package/markdown.js +6858 -0
  18. package/markdown.js.map +1 -0
  19. package/mordant-mordant.js +11604 -0
  20. package/mordant-mordant.js.map +1 -0
  21. package/package.json +3 -3
  22. package/wirespec-bin.js +3 -0
  23. package/wirespec-src-compiler-core.js +2436 -1676
  24. package/wirespec-src-compiler-core.js.map +1 -1
  25. package/wirespec-src-compiler-lib.js +502 -471
  26. package/wirespec-src-compiler-lib.js.map +1 -1
  27. package/wirespec-src-converter-openapi.js +571 -571
  28. package/wirespec-src-converter-openapi.js.map +1 -1
  29. package/wirespec-src-plugin-arguments.js +543 -0
  30. package/wirespec-src-plugin-arguments.js.map +1 -0
  31. package/wirespec-src-plugin-cli.js +1027 -0
  32. package/wirespec-src-plugin-cli.js.map +1 -0
  33. package/wirespec-src-compiler-lib.d.ts +0 -356
@@ -0,0 +1,1027 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './clikt-clikt.js', './wirespec-src-compiler-core.js', './wirespec-src-plugin-arguments.js', './wirespec-src-converter-openapi.js', './arrow-arrow-core.js', './wirespec-src-compiler-lib.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./clikt-clikt.js'), require('./wirespec-src-compiler-core.js'), require('./wirespec-src-plugin-arguments.js'), require('./wirespec-src-converter-openapi.js'), require('./arrow-arrow-core.js'), require('./wirespec-src-compiler-lib.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
8
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'wirespec-src-plugin-cli'.");
9
+ }
10
+ if (typeof this['clikt-clikt'] === 'undefined') {
11
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'clikt-clikt' was not found. Please, check whether 'clikt-clikt' is loaded prior to 'wirespec-src-plugin-cli'.");
12
+ }
13
+ if (typeof this['wirespec-src-compiler-core'] === 'undefined') {
14
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-core' was not found. Please, check whether 'wirespec-src-compiler-core' is loaded prior to 'wirespec-src-plugin-cli'.");
15
+ }
16
+ if (typeof this['wirespec-src-plugin-arguments'] === 'undefined') {
17
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-plugin-arguments' was not found. Please, check whether 'wirespec-src-plugin-arguments' is loaded prior to 'wirespec-src-plugin-cli'.");
18
+ }
19
+ if (typeof this['wirespec-src-converter-openapi'] === 'undefined') {
20
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-converter-openapi' was not found. Please, check whether 'wirespec-src-converter-openapi' is loaded prior to 'wirespec-src-plugin-cli'.");
21
+ }
22
+ if (typeof this['arrow-arrow-core'] === 'undefined') {
23
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-src-plugin-cli'.");
24
+ }
25
+ if (typeof this['wirespec-src-compiler-lib'] === 'undefined') {
26
+ throw new Error("Error loading module 'wirespec-src-plugin-cli'. Its dependency 'wirespec-src-compiler-lib' was not found. Please, check whether 'wirespec-src-compiler-lib' is loaded prior to 'wirespec-src-plugin-cli'.");
27
+ }
28
+ root['wirespec-src-plugin-cli'] = factory(typeof this['wirespec-src-plugin-cli'] === 'undefined' ? {} : this['wirespec-src-plugin-cli'], this['kotlin-kotlin-stdlib-js-ir'], this['clikt-clikt'], this['wirespec-src-compiler-core'], this['wirespec-src-plugin-arguments'], this['wirespec-src-converter-openapi'], this['arrow-arrow-core'], this['wirespec-src-compiler-lib']);
29
+ }
30
+ }(this, function (_, kotlin_kotlin, kotlin_clikt_clikt, kotlin_community_flock_wirespec_compiler_core, kotlin_community_flock_wirespec_plugin_arguments_arguments, kotlin_community_flock_wirespec_converter_openapi, kotlin_io_arrow_kt_arrow_core, kotlin_community_flock_wirespec_compiler_lib) {
31
+ 'use strict';
32
+ //region block: imports
33
+ var Unit_getInstance = kotlin_kotlin.$_$.t3;
34
+ var Enum = kotlin_kotlin.$_$.cd;
35
+ var protoOf = kotlin_kotlin.$_$.q9;
36
+ var classMeta = kotlin_kotlin.$_$.l8;
37
+ var VOID = kotlin_kotlin.$_$.ke;
38
+ var setMetadataFor = kotlin_kotlin.$_$.r9;
39
+ var subcommands = kotlin_clikt_clikt.$_$.c;
40
+ var objectMeta = kotlin_kotlin.$_$.p9;
41
+ var NoOpCliktCommand = kotlin_clikt_clikt.$_$.b;
42
+ var CliktCommand = kotlin_clikt_clikt.$_$.a;
43
+ var option = kotlin_clikt_clikt.$_$.h;
44
+ var get_DEFAULT_PACKAGE_NAME = kotlin_community_flock_wirespec_compiler_core.$_$.a;
45
+ var default_0 = kotlin_clikt_clikt.$_$.e;
46
+ var flag = kotlin_clikt_clikt.$_$.f;
47
+ var Companion_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.t;
48
+ var FullDirPath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.d;
49
+ var Console_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.s;
50
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.j1;
51
+ var Companion_getInstance_0 = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.u;
52
+ var choice = kotlin_clikt_clikt.$_$.j;
53
+ var multiple = kotlin_clikt_clikt.$_$.g;
54
+ var Compile_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.v;
55
+ var toSet = kotlin_kotlin.$_$.o7;
56
+ var CompilerArguments = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.a;
57
+ var argument = kotlin_clikt_clikt.$_$.d;
58
+ var values = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.c;
59
+ var mapCapacity = kotlin_kotlin.$_$.m6;
60
+ var coerceAtLeast = kotlin_kotlin.$_$.aa;
61
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.r;
62
+ var choice_0 = kotlin_clikt_clikt.$_$.i;
63
+ var Spec_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.r;
64
+ var listOf = kotlin_kotlin.$_$.k6;
65
+ var Convert = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.g;
66
+ var setOf = kotlin_kotlin.$_$.x6;
67
+ var KProperty1 = kotlin_kotlin.$_$.ja;
68
+ var getPropertyCallableRef = kotlin_kotlin.$_$.r8;
69
+ var numberRangeToNumber = kotlin_kotlin.$_$.k9;
70
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j;
71
+ var copyToArray = kotlin_kotlin.$_$.d5;
72
+ var Logger = kotlin_community_flock_wirespec_compiler_core.$_$.d1;
73
+ var toString = kotlin_kotlin.$_$.v9;
74
+ var FileExtension_Wirespec_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.m;
75
+ var FullFilePath = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.e;
76
+ var Console = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.b;
77
+ var Compile = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.f;
78
+ var THROW_CCE = kotlin_kotlin.$_$.ld;
79
+ var Companion_getInstance_1 = kotlin_community_flock_wirespec_converter_openapi.$_$.a;
80
+ var Companion_getInstance_2 = kotlin_community_flock_wirespec_converter_openapi.$_$.b;
81
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.ge;
82
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.q4;
83
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.i;
84
+ var to = kotlin_kotlin.$_$.je;
85
+ var charSequenceLength = kotlin_kotlin.$_$.j8;
86
+ var charSequenceGet = kotlin_kotlin.$_$.i8;
87
+ var toString_0 = kotlin_kotlin.$_$.v1;
88
+ var first = kotlin_kotlin.$_$.n5;
89
+ var Emitted = kotlin_community_flock_wirespec_compiler_core.$_$.b;
90
+ var Wirespec_getInstance = kotlin_community_flock_wirespec_compiler_core.$_$.k1;
91
+ var compile = kotlin_community_flock_wirespec_compiler_core.$_$.b1;
92
+ var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
93
+ var Companion_getInstance_3 = kotlin_community_flock_wirespec_compiler_core.$_$.j1;
94
+ var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
95
+ var println = kotlin_kotlin.$_$.z7;
96
+ var WirespecEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.g;
97
+ var equals = kotlin_kotlin.$_$.o8;
98
+ var TypeScriptEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.f;
99
+ var FileExtension_TypeScript_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.l;
100
+ var Script_TypeScript_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.q;
101
+ var ScalaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.e;
102
+ var FileExtension_Scala_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.k;
103
+ var Jvm_Scala_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.p;
104
+ var KotlinEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.d;
105
+ var FileExtension_Kotlin_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.j;
106
+ var Jvm_Kotlin_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.o;
107
+ var JavaEmitter = kotlin_community_flock_wirespec_compiler_core.$_$.c;
108
+ var FileExtension_Java_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.h;
109
+ var Jvm_Java_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.n;
110
+ var print = kotlin_kotlin.$_$.b8;
111
+ var ensureNotNull = kotlin_kotlin.$_$.ae;
112
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r1;
113
+ var charArrayOf = kotlin_kotlin.$_$.g8;
114
+ var split = kotlin_kotlin.$_$.ac;
115
+ var joinToString = kotlin_kotlin.$_$.x5;
116
+ var FileExtension_Json_getInstance = kotlin_community_flock_wirespec_plugin_arguments_arguments.$_$.i;
117
+ var parse = kotlin_community_flock_wirespec_compiler_core.$_$.c1;
118
+ var get_noLogger = kotlin_community_flock_wirespec_compiler_core.$_$.e1;
119
+ var Definition = kotlin_community_flock_wirespec_compiler_core.$_$.h;
120
+ var isInterface = kotlin_kotlin.$_$.d9;
121
+ var produce = kotlin_community_flock_wirespec_compiler_lib.$_$.a;
122
+ var endsWith = kotlin_kotlin.$_$.bb;
123
+ var dropLast = kotlin_kotlin.$_$.za;
124
+ var iterator = kotlin_kotlin.$_$.h9;
125
+ var asSequence = kotlin_kotlin.$_$.la;
126
+ var map = kotlin_kotlin.$_$.qa;
127
+ var filter = kotlin_kotlin.$_$.ma;
128
+ var toSet_0 = kotlin_kotlin.$_$.sa;
129
+ var split_0 = kotlin_kotlin.$_$.bc;
130
+ var Companion_getInstance_4 = kotlin_kotlin.$_$.o3;
131
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.w1;
132
+ var createFailure = kotlin_kotlin.$_$.zd;
133
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.a2;
134
+ var isObject = kotlin_kotlin.$_$.f9;
135
+ var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.y1;
136
+ var isArray = kotlin_kotlin.$_$.v8;
137
+ //endregion
138
+ //region block: pre-declaration
139
+ setMetadataFor(Options, 'Options', classMeta, Enum);
140
+ setMetadataFor(Companion, 'Companion', objectMeta);
141
+ setMetadataFor(WirespecCli, 'WirespecCli', classMeta, NoOpCliktCommand);
142
+ setMetadataFor(CommonOptions, 'CommonOptions', classMeta, CliktCommand);
143
+ setMetadataFor(Compile_0, 'Compile', classMeta, CommonOptions);
144
+ setMetadataFor(Convert_0, 'Convert', classMeta, CommonOptions);
145
+ setMetadataFor(File, 'File', classMeta);
146
+ setMetadataFor(JavaFile, 'JavaFile', classMeta, File);
147
+ setMetadataFor(JsonFile, 'JsonFile', classMeta, File);
148
+ setMetadataFor(KotlinFile, 'KotlinFile', classMeta, File);
149
+ setMetadataFor(ScalaFile, 'ScalaFile', classMeta, File);
150
+ setMetadataFor(TypeScriptFile, 'TypeScriptFile', classMeta, File);
151
+ setMetadataFor(WirespecFile, 'WirespecFile', classMeta, File);
152
+ setMetadataFor(Directory, 'Directory', classMeta);
153
+ //endregion
154
+ var Options_InputDir_instance;
155
+ var Options_InputFile_instance;
156
+ var Options_OutputDir_instance;
157
+ var Options_Language_instance;
158
+ var Options_PackageName_instance;
159
+ var Options_Strict_instance;
160
+ var Options_Debug_instance;
161
+ var Options_entriesInitialized;
162
+ function Options_initEntries() {
163
+ if (Options_entriesInitialized)
164
+ return Unit_getInstance();
165
+ Options_entriesInitialized = true;
166
+ Options_InputDir_instance = new Options('InputDir', 0, ['-d', '--input-dir']);
167
+ Options_InputFile_instance = new Options('InputFile', 1, ['-f', '--input-file']);
168
+ Options_OutputDir_instance = new Options('OutputDir', 2, ['-o', '--output-dir']);
169
+ Options_Language_instance = new Options('Language', 3, ['-l', '--language']);
170
+ Options_PackageName_instance = new Options('PackageName', 4, ['-p', '--package']);
171
+ Options_Strict_instance = new Options('Strict', 5, ['--strict']);
172
+ Options_Debug_instance = new Options('Debug', 6, ['--debug']);
173
+ }
174
+ function Options(name, ordinal, flags) {
175
+ Enum.call(this, name, ordinal);
176
+ this.r3s_1 = flags;
177
+ }
178
+ function WirespecCli$main$ref($boundThis) {
179
+ var l = function (p0) {
180
+ $boundThis.p3g(p0);
181
+ return Unit_getInstance();
182
+ };
183
+ l.callableName = 'main';
184
+ return l;
185
+ }
186
+ function Companion() {
187
+ Companion_instance = this;
188
+ }
189
+ protoOf(Companion).s3s = function (compile, convert) {
190
+ return WirespecCli$main$ref(subcommands(new WirespecCli(), [new Compile_0(compile), new Convert_0(convert)]));
191
+ };
192
+ var Companion_instance;
193
+ function Companion_getInstance_5() {
194
+ if (Companion_instance == null)
195
+ new Companion();
196
+ return Companion_instance;
197
+ }
198
+ function WirespecCli() {
199
+ Companion_getInstance_5();
200
+ NoOpCliktCommand.call(this, VOID, VOID, 'wirespec');
201
+ }
202
+ function _get_inputFile__x1bqj($this) {
203
+ return $this.k3t_1.r3p($this, inputFile$factory_0());
204
+ }
205
+ function CommonOptions() {
206
+ CliktCommand.call(this);
207
+ this.k3t_1 = option(this, Options_InputFile_getInstance().r3s_1.slice(), 'Input file').t3q(this, inputFile$factory());
208
+ this.l3t_1 = option(this, Options_InputDir_getInstance().r3s_1.slice(), 'Input directory').t3q(this, inputDir$factory());
209
+ this.m3t_1 = option(this, Options_OutputDir_getInstance().r3s_1.slice(), 'Output directory').t3q(this, outputDir$factory());
210
+ this.n3t_1 = default_0(option(this, Options_PackageName_getInstance().r3s_1.slice(), 'Package name'), get_DEFAULT_PACKAGE_NAME()).t3q(this, packageName$factory());
211
+ this.o3t_1 = flag(option(this, Options_Strict_getInstance().r3s_1.slice(), 'Strict mode'), []).t3q(this, strict$factory());
212
+ this.p3t_1 = flag(option(this, Options_Debug_getInstance().r3s_1.slice(), 'Debug mode'), []).t3q(this, debug$factory());
213
+ }
214
+ protoOf(CommonOptions).q3t = function () {
215
+ return this.l3t_1.r3p(this, inputDir$factory_0());
216
+ };
217
+ protoOf(CommonOptions).r3t = function () {
218
+ return this.m3t_1.r3p(this, outputDir$factory_0());
219
+ };
220
+ protoOf(CommonOptions).s3t = function () {
221
+ return this.n3t_1.r3p(this, packageName$factory_0());
222
+ };
223
+ protoOf(CommonOptions).t3t = function () {
224
+ return this.o3t_1.r3p(this, strict$factory_0());
225
+ };
226
+ protoOf(CommonOptions).u3t = function () {
227
+ return this.p3t_1.r3p(this, debug$factory_0());
228
+ };
229
+ protoOf(CommonOptions).v3t = function (inputDir) {
230
+ var tmp;
231
+ if (!(inputDir == null) ? !(_get_inputFile__x1bqj(this) == null) : false) {
232
+ throw IllegalStateException_init_$Create$('Choose either a file or a directory. Not Both.');
233
+ } else {
234
+ var tmp0_safe_receiver = _get_inputFile__x1bqj(this);
235
+ var tmp_0;
236
+ if (tmp0_safe_receiver == null) {
237
+ tmp_0 = null;
238
+ } else {
239
+ // Inline function 'kotlin.let' call
240
+ // Inline function 'kotlin.contracts.contract' call
241
+ tmp_0 = Companion_getInstance().a22(tmp0_safe_receiver);
242
+ }
243
+ var tmp2_elvis_lhs = tmp_0;
244
+ var tmp_1;
245
+ if (tmp2_elvis_lhs == null) {
246
+ var tmp_2;
247
+ if (inputDir == null) {
248
+ tmp_2 = null;
249
+ } else {
250
+ // Inline function 'kotlin.let' call
251
+ // Inline function 'kotlin.contracts.contract' call
252
+ tmp_2 = new FullDirPath(inputDir);
253
+ }
254
+ tmp_1 = tmp_2;
255
+ } else {
256
+ tmp_1 = tmp2_elvis_lhs;
257
+ }
258
+ var tmp3_elvis_lhs = tmp_1;
259
+ tmp = tmp3_elvis_lhs == null ? Console_getInstance() : tmp3_elvis_lhs;
260
+ }
261
+ return tmp;
262
+ };
263
+ function _get_languages__ojonze($this) {
264
+ return $this.u3u_1.r3p($this, languages$factory_0());
265
+ }
266
+ function Compile_0(block) {
267
+ CommonOptions.call(this);
268
+ this.t3u_1 = block;
269
+ this.u3u_1 = multiple(choice(option(this, Options_Language_getInstance().r3s_1.slice(), 'Language'), Companion_getInstance_0().k22()), VOID, true).t3q(this, languages$factory());
270
+ }
271
+ protoOf(Compile_0).q3g = function () {
272
+ // Inline function 'kotlin.let' call
273
+ var tmp0_let = new CompilerArguments(Compile_getInstance(), this.v3t(this.q3t()), this.r3t(), toSet(_get_languages__ojonze(this)), this.s3t(), this.t3t(), this.u3t());
274
+ // Inline function 'kotlin.contracts.contract' call
275
+ this.t3u_1(tmp0_let);
276
+ };
277
+ function _get_format__qlarck($this) {
278
+ return $this.t3v_1.r3p($this, format$factory_0());
279
+ }
280
+ function _get_languages__ojonze_0($this) {
281
+ return $this.u3v_1.r3p($this, languages$factory_2());
282
+ }
283
+ function Convert_0(block) {
284
+ CommonOptions.call(this);
285
+ this.s3v_1 = block;
286
+ var tmp = this;
287
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
288
+ var tmp0_enum = argument(this, VOID, 'Input format');
289
+ // Inline function 'kotlin.collections.associateBy' call
290
+ // Inline function 'kotlin.enumValues' call
291
+ var tmp0_associateBy = values();
292
+ var capacity = coerceAtLeast(mapCapacity(tmp0_associateBy.length), 16);
293
+ // Inline function 'kotlin.collections.associateByTo' call
294
+ var tmp0_associateByTo = LinkedHashMap_init_$Create$(capacity);
295
+ var inductionVariable = 0;
296
+ var last = tmp0_associateBy.length;
297
+ while (inductionVariable < last) {
298
+ var element = tmp0_associateBy[inductionVariable];
299
+ inductionVariable = inductionVariable + 1 | 0;
300
+ var tmp$ret$2;
301
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
302
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
303
+ tmp$ret$2 = element.o5_1;
304
+ tmp0_associateByTo.n3(tmp$ret$2, element);
305
+ }
306
+ tmp.t3v_1 = choice_0(tmp0_enum, tmp0_associateByTo, true).x3o(this, format$factory());
307
+ this.u3v_1 = multiple(choice(option(this, Options_Language_getInstance().r3s_1.slice(), 'Language'), Companion_getInstance_0().k22(), VOID, true), listOf(Spec_Wirespec_getInstance())).t3q(this, languages$factory_1());
308
+ }
309
+ protoOf(Convert_0).q3g = function () {
310
+ if (this.q3t() == null)
311
+ null;
312
+ else {
313
+ // Inline function 'kotlin.let' call
314
+ // Inline function 'kotlin.contracts.contract' call
315
+ this.j3g('To convert, please specify a file', VOID, true);
316
+ }
317
+ // Inline function 'kotlin.let' call
318
+ var tmp = new Convert(_get_format__qlarck(this));
319
+ var tmp_0 = this.v3t(null);
320
+ var tmp_1 = this.r3t();
321
+ var tmp$ret$2;
322
+ // Inline function 'kotlin.collections.ifEmpty' call
323
+ var tmp0_ifEmpty = toSet(_get_languages__ojonze_0(this));
324
+ var tmp_2;
325
+ if (tmp0_ifEmpty.g()) {
326
+ // Inline function 'community.flock.wirespec.plugin.cli.Convert.run.<anonymous>' call
327
+ tmp_2 = setOf(Spec_Wirespec_getInstance());
328
+ } else {
329
+ tmp_2 = tmp0_ifEmpty;
330
+ }
331
+ tmp$ret$2 = tmp_2;
332
+ var tmp1_let = new CompilerArguments(tmp, tmp_0, tmp_1, tmp$ret$2, this.s3t(), this.t3t(), this.u3t());
333
+ // Inline function 'kotlin.contracts.contract' call
334
+ this.s3v_1(tmp1_let);
335
+ };
336
+ function Options_InputDir_getInstance() {
337
+ Options_initEntries();
338
+ return Options_InputDir_instance;
339
+ }
340
+ function Options_InputFile_getInstance() {
341
+ Options_initEntries();
342
+ return Options_InputFile_instance;
343
+ }
344
+ function Options_OutputDir_getInstance() {
345
+ Options_initEntries();
346
+ return Options_OutputDir_instance;
347
+ }
348
+ function Options_Language_getInstance() {
349
+ Options_initEntries();
350
+ return Options_Language_instance;
351
+ }
352
+ function Options_PackageName_getInstance() {
353
+ Options_initEntries();
354
+ return Options_PackageName_instance;
355
+ }
356
+ function Options_Strict_getInstance() {
357
+ Options_initEntries();
358
+ return Options_Strict_instance;
359
+ }
360
+ function Options_Debug_getInstance() {
361
+ Options_initEntries();
362
+ return Options_Debug_instance;
363
+ }
364
+ function inputFile$factory() {
365
+ return getPropertyCallableRef('inputFile', 1, KProperty1, function (receiver) {
366
+ return _get_inputFile__x1bqj(receiver);
367
+ }, null);
368
+ }
369
+ function inputDir$factory() {
370
+ return getPropertyCallableRef('inputDir', 1, KProperty1, function (receiver) {
371
+ return receiver.q3t();
372
+ }, null);
373
+ }
374
+ function outputDir$factory() {
375
+ return getPropertyCallableRef('outputDir', 1, KProperty1, function (receiver) {
376
+ return receiver.r3t();
377
+ }, null);
378
+ }
379
+ function packageName$factory() {
380
+ return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
381
+ return receiver.s3t();
382
+ }, null);
383
+ }
384
+ function strict$factory() {
385
+ return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
386
+ return receiver.t3t();
387
+ }, null);
388
+ }
389
+ function debug$factory() {
390
+ return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
391
+ return receiver.u3t();
392
+ }, null);
393
+ }
394
+ function inputFile$factory_0() {
395
+ return getPropertyCallableRef('inputFile', 1, KProperty1, function (receiver) {
396
+ return _get_inputFile__x1bqj(receiver);
397
+ }, null);
398
+ }
399
+ function inputDir$factory_0() {
400
+ return getPropertyCallableRef('inputDir', 1, KProperty1, function (receiver) {
401
+ return receiver.q3t();
402
+ }, null);
403
+ }
404
+ function outputDir$factory_0() {
405
+ return getPropertyCallableRef('outputDir', 1, KProperty1, function (receiver) {
406
+ return receiver.r3t();
407
+ }, null);
408
+ }
409
+ function packageName$factory_0() {
410
+ return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
411
+ return receiver.s3t();
412
+ }, null);
413
+ }
414
+ function strict$factory_0() {
415
+ return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
416
+ return receiver.t3t();
417
+ }, null);
418
+ }
419
+ function debug$factory_0() {
420
+ return getPropertyCallableRef('debug', 1, KProperty1, function (receiver) {
421
+ return receiver.u3t();
422
+ }, null);
423
+ }
424
+ function languages$factory() {
425
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
426
+ return _get_languages__ojonze(receiver);
427
+ }, null);
428
+ }
429
+ function languages$factory_0() {
430
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
431
+ return _get_languages__ojonze(receiver);
432
+ }, null);
433
+ }
434
+ function format$factory() {
435
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
436
+ return _get_format__qlarck(receiver);
437
+ }, null);
438
+ }
439
+ function languages$factory_1() {
440
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
441
+ return _get_languages__ojonze_0(receiver);
442
+ }, null);
443
+ }
444
+ function format$factory_0() {
445
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
446
+ return _get_format__qlarck(receiver);
447
+ }, null);
448
+ }
449
+ function languages$factory_2() {
450
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
451
+ return _get_languages__ojonze_0(receiver);
452
+ }, null);
453
+ }
454
+ function main(args) {
455
+ // Inline function 'kotlin.let' call
456
+ // Inline function 'kotlin.collections.toTypedArray' call
457
+ // Inline function 'kotlin.collections.mapNotNull' call
458
+ var tmp0_mapNotNull = numberRangeToNumber(0, 20);
459
+ // Inline function 'kotlin.collections.mapNotNullTo' call
460
+ var tmp0_mapNotNullTo = ArrayList_init_$Create$();
461
+ // Inline function 'kotlin.collections.forEach' call
462
+ var inductionVariable = tmp0_mapNotNull.a1_1;
463
+ var last = tmp0_mapNotNull.b1_1;
464
+ if (inductionVariable <= last)
465
+ do {
466
+ var element = inductionVariable;
467
+ inductionVariable = inductionVariable + 1 | 0;
468
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
469
+ var tmp0_safe_receiver = orNull(args, element);
470
+ if (tmp0_safe_receiver == null)
471
+ null;
472
+ else {
473
+ // Inline function 'kotlin.let' call
474
+ // Inline function 'kotlin.contracts.contract' call
475
+ tmp0_mapNotNullTo.a(tmp0_safe_receiver);
476
+ }
477
+ }
478
+ while (!(element === last));
479
+ var tmp2_let = copyToArray(tmp0_mapNotNullTo);
480
+ var tmp = Companion_getInstance_5();
481
+ var tmp_0 = compile$ref();
482
+ // Inline function 'kotlin.contracts.contract' call
483
+ tmp.s3s(tmp_0, convert$ref())(tmp2_let);
484
+ }
485
+ function convert(arguments_0) {
486
+ return compile_0(arguments_0);
487
+ }
488
+ function compile_0(arguments_0) {
489
+ var input = arguments_0.t21_1;
490
+ var output = arguments_0.u21_1;
491
+ var languages = arguments_0.v21_1;
492
+ var packageName = arguments_0.w21_1;
493
+ var logger = new Logger(arguments_0.y21_1);
494
+ var operation = arguments_0.s21_1;
495
+ if (operation instanceof Convert) {
496
+ var fullPath = input instanceof FullFilePath ? input : THROW_CCE();
497
+ var file = new JsonFile(fullPath);
498
+ var strict = arguments_0.x21_1;
499
+ var format = operation.z21_1;
500
+ var tmp;
501
+ switch (format.p5_1) {
502
+ case 0:
503
+ tmp = Companion_getInstance_1().m22(file.q11(), !strict);
504
+ break;
505
+ case 1:
506
+ tmp = Companion_getInstance_2().m22(file.q11(), !strict);
507
+ break;
508
+ default:
509
+ noWhenBranchMatchedException();
510
+ break;
511
+ }
512
+ var ast = tmp;
513
+ var path = out(fullPath, packageName, output);
514
+ // Inline function 'kotlin.collections.map' call
515
+ // Inline function 'kotlin.collections.map' call
516
+ var tmp0_map = emitters(languages, packageName, path, logger);
517
+ // Inline function 'kotlin.collections.mapTo' call
518
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
519
+ var tmp0_iterator = tmp0_map.c();
520
+ while (tmp0_iterator.d()) {
521
+ var item = tmp0_iterator.e();
522
+ var tmp$ret$7;
523
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
524
+ var emitter = item.e3();
525
+ var file_0 = item.f3();
526
+ var results = emitter.y1q(ast);
527
+ var tmp_0;
528
+ if (!emitter.i1w()) {
529
+ var tmp$ret$6;
530
+ // Inline function 'kotlin.text.replaceFirstChar' call
531
+ var tmp0_replaceFirstChar = fullPath.f22_1;
532
+ var tmp_1;
533
+ // Inline function 'kotlin.text.isNotEmpty' call
534
+ if (charSequenceLength(tmp0_replaceFirstChar) > 0) {
535
+ var tmp$ret$3;
536
+ // Inline function 'kotlin.text.uppercase' call
537
+ var tmp1_uppercase = charSequenceGet(tmp0_replaceFirstChar, 0);
538
+ // Inline function 'kotlin.js.unsafeCast' call
539
+ // Inline function 'kotlin.js.asDynamic' call
540
+ tmp$ret$3 = toString_0(tmp1_uppercase).toUpperCase();
541
+ var tmp_2 = toString(tmp$ret$3);
542
+ // Inline function 'kotlin.text.substring' call
543
+ // Inline function 'kotlin.js.asDynamic' call
544
+ tmp_1 = tmp_2 + tmp0_replaceFirstChar.substring(1);
545
+ } else {
546
+ tmp_1 = tmp0_replaceFirstChar;
547
+ }
548
+ tmp$ret$6 = tmp_1;
549
+ tmp_0 = to(listOf(new Emitted(tmp$ret$6, first(results).p1s_1)), file_0);
550
+ } else {
551
+ tmp_0 = to(results, file_0);
552
+ }
553
+ tmp$ret$7 = tmp_0;
554
+ tmp0_mapTo.a(tmp$ret$7);
555
+ }
556
+ // Inline function 'kotlin.collections.mapTo' call
557
+ var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
558
+ var tmp0_iterator_0 = tmp0_mapTo.c();
559
+ while (tmp0_iterator_0.d()) {
560
+ var item_0 = tmp0_iterator_0.e();
561
+ var results_0 = item_0.e3();
562
+ var file_1 = item_0.f3();
563
+ write(results_0, file_1);
564
+ tmp0_mapTo_0.a(Unit_getInstance());
565
+ }
566
+ } else {
567
+ if (operation instanceof Compile) {
568
+ if (input instanceof Console) {
569
+ wirespec(input, languages, packageName, compile$lambda(output), logger);
570
+ } else {
571
+ if (input instanceof FullDirPath) {
572
+ // Inline function 'kotlin.collections.forEach' call
573
+ var tmp0_iterator_1 = (new Directory(input.j22_1)).x3v().c();
574
+ while (tmp0_iterator_1.d()) {
575
+ var element = tmp0_iterator_1.e();
576
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
577
+ wirespec(element, languages, packageName, out(element.v3v_1, packageName, output), logger);
578
+ }
579
+ } else {
580
+ if (input instanceof FullFilePath)
581
+ if (input.g22_1.equals(FileExtension_Wirespec_getInstance())) {
582
+ // Inline function 'kotlin.let' call
583
+ var tmp3_let = new WirespecFile(input);
584
+ // Inline function 'kotlin.contracts.contract' call
585
+ wirespec(tmp3_let, languages, packageName, out(tmp3_let.v3v_1, packageName, output), logger);
586
+ } else {
587
+ // Inline function 'kotlin.error' call
588
+ var tmp4_error = 'Path ' + input + ' is not a Wirespec file';
589
+ throw IllegalStateException_init_$Create$(toString(tmp4_error));
590
+ }
591
+ }
592
+ }
593
+ }
594
+ }
595
+ }
596
+ function wirespec(_this__u8e3s4, languages, packageName, path, logger) {
597
+ // Inline function 'kotlin.collections.map' call
598
+ // Inline function 'kotlin.let' call
599
+ // Inline function 'kotlin.let' call
600
+ var tmp0_let = _this__u8e3s4.q11();
601
+ var tmp1_let_this = Wirespec_getInstance();
602
+ // Inline function 'kotlin.contracts.contract' call
603
+ var tmp2_let = compile(tmp1_let_this, tmp0_let)(logger);
604
+ // Inline function 'kotlin.contracts.contract' call
605
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
606
+ // Inline function 'kotlin.collections.map' call
607
+ var tmp0_map = emitters(languages, packageName, path, logger);
608
+ // Inline function 'kotlin.collections.mapTo' call
609
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_map, 10));
610
+ var tmp0_iterator = tmp0_map.c();
611
+ while (tmp0_iterator.d()) {
612
+ var item = tmp0_iterator.e();
613
+ var tmp$ret$6;
614
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
615
+ var emitter = item.e3();
616
+ var file = item.f3();
617
+ var results = tmp2_let(emitter);
618
+ var tmp;
619
+ if (!emitter.i1w()) {
620
+ var tmp$ret$5;
621
+ // Inline function 'arrow.core.Either.map' call
622
+ // Inline function 'kotlin.contracts.contract' call
623
+ // Inline function 'arrow.core.flatMap' call
624
+ // Inline function 'kotlin.contracts.contract' call
625
+ var tmp_0;
626
+ if (results instanceof Right) {
627
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
628
+ var tmp0_anonymous = results.x1p_1;
629
+ var tmp$ret$2;
630
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>.<anonymous>' call
631
+ tmp$ret$2 = listOf(new Emitted(Companion_getInstance_3().z1r(path(FileExtension_Wirespec_getInstance()).f22_1), first(tmp0_anonymous).p1s_1));
632
+ tmp_0 = new Right(tmp$ret$2);
633
+ } else {
634
+ if (results instanceof Left) {
635
+ tmp_0 = results;
636
+ } else {
637
+ noWhenBranchMatchedException();
638
+ }
639
+ }
640
+ tmp$ret$5 = tmp_0;
641
+ tmp = to(tmp$ret$5, file);
642
+ } else {
643
+ tmp = to(results, file);
644
+ }
645
+ tmp$ret$6 = tmp;
646
+ tmp0_mapTo.a(tmp$ret$6);
647
+ }
648
+ // Inline function 'kotlin.collections.mapTo' call
649
+ var tmp0_mapTo_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp0_mapTo, 10));
650
+ var tmp0_iterator_0 = tmp0_mapTo.c();
651
+ while (tmp0_iterator_0.d()) {
652
+ var item_0 = tmp0_iterator_0.e();
653
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
654
+ var results_0 = item_0.e3();
655
+ var file_0 = item_0.f3();
656
+ if (results_0 instanceof Right) {
657
+ write(results_0.x1p_1, file_0);
658
+ } else {
659
+ if (results_0 instanceof Left) {
660
+ println(results_0.r1p_1);
661
+ }
662
+ }
663
+ tmp0_mapTo_0.a(Unit_getInstance());
664
+ }
665
+ }
666
+ function emitters(_this__u8e3s4, packageName, path, logger) {
667
+ // Inline function 'kotlin.collections.map' call
668
+ // Inline function 'kotlin.collections.mapTo' call
669
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(_this__u8e3s4, 10));
670
+ var tmp0_iterator = _this__u8e3s4.c();
671
+ while (tmp0_iterator.d()) {
672
+ var item = tmp0_iterator.e();
673
+ var tmp$ret$10;
674
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>' call
675
+ var tmp;
676
+ if (equals(item, Jvm_Java_getInstance())) {
677
+ var tmp_0 = new JavaEmitter(packageName, logger);
678
+ var tmp_1;
679
+ if (path == null) {
680
+ tmp_1 = null;
681
+ } else {
682
+ // Inline function 'kotlin.let' call
683
+ // Inline function 'kotlin.contracts.contract' call
684
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
685
+ tmp_1 = new JavaFile(path(FileExtension_Java_getInstance()));
686
+ }
687
+ tmp = to(tmp_0, tmp_1);
688
+ } else if (equals(item, Jvm_Kotlin_getInstance())) {
689
+ var tmp_2 = new KotlinEmitter(packageName, logger);
690
+ var tmp_3;
691
+ if (path == null) {
692
+ tmp_3 = null;
693
+ } else {
694
+ // Inline function 'kotlin.let' call
695
+ // Inline function 'kotlin.contracts.contract' call
696
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
697
+ tmp_3 = new KotlinFile(path(FileExtension_Kotlin_getInstance()));
698
+ }
699
+ tmp = to(tmp_2, tmp_3);
700
+ } else if (equals(item, Jvm_Scala_getInstance())) {
701
+ var tmp_4 = new ScalaEmitter(packageName, logger);
702
+ var tmp_5;
703
+ if (path == null) {
704
+ tmp_5 = null;
705
+ } else {
706
+ // Inline function 'kotlin.let' call
707
+ // Inline function 'kotlin.contracts.contract' call
708
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
709
+ tmp_5 = new ScalaFile(path(FileExtension_Scala_getInstance()));
710
+ }
711
+ tmp = to(tmp_4, tmp_5);
712
+ } else if (equals(item, Script_TypeScript_getInstance())) {
713
+ var tmp_6 = new TypeScriptEmitter(logger);
714
+ var tmp_7;
715
+ if (path == null) {
716
+ tmp_7 = null;
717
+ } else {
718
+ // Inline function 'kotlin.let' call
719
+ // Inline function 'kotlin.contracts.contract' call
720
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
721
+ tmp_7 = new TypeScriptFile(path(FileExtension_TypeScript_getInstance()));
722
+ }
723
+ tmp = to(tmp_6, tmp_7);
724
+ } else if (equals(item, Spec_Wirespec_getInstance())) {
725
+ var tmp_8 = new WirespecEmitter(logger);
726
+ var tmp_9;
727
+ if (path == null) {
728
+ tmp_9 = null;
729
+ } else {
730
+ // Inline function 'kotlin.let' call
731
+ // Inline function 'kotlin.contracts.contract' call
732
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>.<anonymous>' call
733
+ tmp_9 = new WirespecFile(path(FileExtension_Wirespec_getInstance()));
734
+ }
735
+ tmp = to(tmp_8, tmp_9);
736
+ } else {
737
+ noWhenBranchMatchedException();
738
+ }
739
+ tmp$ret$10 = tmp;
740
+ tmp0_mapTo.a(tmp$ret$10);
741
+ }
742
+ return tmp0_mapTo;
743
+ }
744
+ function write(output, file) {
745
+ // Inline function 'kotlin.collections.forEach' call
746
+ var tmp0_iterator = output.c();
747
+ while (tmp0_iterator.d()) {
748
+ var element = tmp0_iterator.e();
749
+ // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
750
+ var name = element.e3();
751
+ var result = element.f3();
752
+ var tmp1_safe_receiver = file == null ? null : file.j24(name);
753
+ var tmp;
754
+ if (tmp1_safe_receiver == null) {
755
+ tmp = null;
756
+ } else {
757
+ tmp1_safe_receiver.y3v(result);
758
+ tmp = Unit_getInstance();
759
+ }
760
+ if (tmp == null) {
761
+ print(result);
762
+ }
763
+ }
764
+ }
765
+ function out(_this__u8e3s4, packageName, output) {
766
+ return out$lambda(output, _this__u8e3s4, packageName);
767
+ }
768
+ function compile$ref() {
769
+ var l = function (p0) {
770
+ compile_0(p0);
771
+ return Unit_getInstance();
772
+ };
773
+ l.callableName = 'compile';
774
+ return l;
775
+ }
776
+ function convert$ref() {
777
+ var l = function (p0) {
778
+ convert(p0);
779
+ return Unit_getInstance();
780
+ };
781
+ l.callableName = 'convert';
782
+ return l;
783
+ }
784
+ function compile$lambda($output) {
785
+ return function (it) {
786
+ return new FullFilePath(ensureNotNull($output), 'console', it);
787
+ };
788
+ }
789
+ function out$lambda($output, $this_out, $packageName) {
790
+ return function (extension) {
791
+ var tmp0_elvis_lhs = $output;
792
+ var tmp;
793
+ if (tmp0_elvis_lhs == null) {
794
+ var tmp$ret$1;
795
+ // Inline function 'kotlin.text.lowercase' call
796
+ var tmp0_lowercase = extension.o5_1;
797
+ var tmp$ret$0;
798
+ // Inline function 'kotlin.js.asDynamic' call
799
+ tmp$ret$0 = tmp0_lowercase;
800
+ tmp$ret$1 = tmp$ret$0.toLowerCase();
801
+ tmp = $this_out.e22_1 + '/out/' + tmp$ret$1;
802
+ } else {
803
+ tmp = tmp0_elvis_lhs;
804
+ }
805
+ var dir = tmp;
806
+ return $this_out.i22(dir + '/' + joinToString(split($packageName, charArrayOf([_Char___init__impl__6a9atx(46)])), '/'), VOID, extension);
807
+ };
808
+ }
809
+ function JavaFile(path) {
810
+ File.call(this, path.i22(VOID, VOID, FileExtension_Java_getInstance()));
811
+ }
812
+ protoOf(JavaFile).j24 = function (fileName) {
813
+ return new JavaFile(this.v3v_1.i22(VOID, fileName));
814
+ };
815
+ function JsonFile(path) {
816
+ File.call(this, path.i22(VOID, VOID, FileExtension_Json_getInstance()));
817
+ }
818
+ protoOf(JsonFile).j24 = function (fileName) {
819
+ return new JsonFile(this.v3v_1.i22(VOID, fileName));
820
+ };
821
+ function KotlinFile(path) {
822
+ File.call(this, path.i22(VOID, VOID, FileExtension_Kotlin_getInstance()));
823
+ }
824
+ protoOf(KotlinFile).j24 = function (fileName) {
825
+ return new KotlinFile(this.v3v_1.i22(VOID, fileName));
826
+ };
827
+ function ScalaFile(path) {
828
+ File.call(this, path.i22(VOID, VOID, FileExtension_Scala_getInstance()));
829
+ }
830
+ protoOf(ScalaFile).j24 = function (fileName) {
831
+ return new ScalaFile(this.v3v_1.i22(VOID, fileName));
832
+ };
833
+ function TypeScriptFile(path) {
834
+ File.call(this, path.i22(VOID, VOID, FileExtension_TypeScript_getInstance()));
835
+ }
836
+ protoOf(TypeScriptFile).j24 = function (fileName) {
837
+ return new TypeScriptFile(this.v3v_1.i22(VOID, fileName));
838
+ };
839
+ function WirespecFile(path) {
840
+ File.call(this, path.i22(VOID, VOID, FileExtension_Wirespec_getInstance()));
841
+ }
842
+ protoOf(WirespecFile).j24 = function (fileName) {
843
+ return new WirespecFile(this.v3v_1.i22(VOID, fileName));
844
+ };
845
+ function cli(args) {
846
+ main(args);
847
+ }
848
+ function parser(source) {
849
+ var tmp0_safe_receiver = parse(Wirespec_getInstance(), source)(get_noLogger()).w1p();
850
+ var tmp;
851
+ if (tmp0_safe_receiver == null) {
852
+ tmp = null;
853
+ } else {
854
+ // Inline function 'kotlin.collections.filterIsInstance' call
855
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
856
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
857
+ var tmp0_iterator = tmp0_safe_receiver.c();
858
+ while (tmp0_iterator.d()) {
859
+ var element = tmp0_iterator.e();
860
+ if (!(element == null) ? isInterface(element, Definition) : false) {
861
+ tmp0_filterIsInstanceTo.a(element);
862
+ }
863
+ }
864
+ tmp = tmp0_filterIsInstanceTo;
865
+ }
866
+ var tmp1_safe_receiver = tmp;
867
+ var tmp_0;
868
+ if (tmp1_safe_receiver == null) {
869
+ tmp_0 = null;
870
+ } else {
871
+ // Inline function 'kotlin.collections.map' call
872
+ // Inline function 'kotlin.collections.mapTo' call
873
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_safe_receiver, 10));
874
+ var tmp0_iterator_0 = tmp1_safe_receiver.c();
875
+ while (tmp0_iterator_0.d()) {
876
+ var item = tmp0_iterator_0.e();
877
+ var tmp$ret$2;
878
+ // Inline function 'community.flock.wirespec.plugin.cli.parser.<anonymous>' call
879
+ tmp$ret$2 = produce(item);
880
+ tmp0_mapTo.a(tmp$ret$2);
881
+ }
882
+ tmp_0 = tmp0_mapTo;
883
+ }
884
+ var tmp2_safe_receiver = tmp_0;
885
+ var tmp_1;
886
+ if (tmp2_safe_receiver == null) {
887
+ tmp_1 = null;
888
+ } else {
889
+ // Inline function 'kotlin.collections.toTypedArray' call
890
+ tmp_1 = copyToArray(tmp2_safe_receiver);
891
+ }
892
+ var tmp3_elvis_lhs = tmp_1;
893
+ var tmp_2;
894
+ if (tmp3_elvis_lhs == null) {
895
+ throw IllegalStateException_init_$Create$('Cannot parse source');
896
+ } else {
897
+ tmp_2 = tmp3_elvis_lhs;
898
+ }
899
+ return tmp_2;
900
+ }
901
+ function Directory$wirespecFiles$lambda(it) {
902
+ // Inline function 'kotlin.js.unsafeCast' call
903
+ return it;
904
+ }
905
+ function Directory$wirespecFiles$lambda_0(it) {
906
+ return endsWith(it, FileExtension_Wirespec_getInstance().d22_1);
907
+ }
908
+ function Directory$wirespecFiles$lambda_1(it) {
909
+ return dropLast(it, FileExtension_Wirespec_getInstance().d22_1.length + 1 | 0);
910
+ }
911
+ function Directory$wirespecFiles$lambda_2(this$0) {
912
+ return function (it) {
913
+ return new FullFilePath(this$0.w3v_1, it);
914
+ };
915
+ }
916
+ function WirespecFile$_init_$ref_cj1n5j() {
917
+ var l = function (p0) {
918
+ return new WirespecFile(p0);
919
+ };
920
+ l.callableName = '<init>';
921
+ return l;
922
+ }
923
+ function Directory(path) {
924
+ this.w3v_1 = path;
925
+ }
926
+ protoOf(Directory).x3v = function () {
927
+ var tmp = asSequence(iterator(get_fs().readdirSync(this.w3v_1, 'utf-8')));
928
+ var tmp_0 = map(tmp, Directory$wirespecFiles$lambda);
929
+ var tmp_1 = filter(tmp_0, Directory$wirespecFiles$lambda_0);
930
+ var tmp_2 = map(tmp_1, Directory$wirespecFiles$lambda_1);
931
+ var tmp_3 = map(tmp_2, Directory$wirespecFiles$lambda_2(this));
932
+ return toSet_0(map(tmp_3, WirespecFile$_init_$ref_cj1n5j()));
933
+ };
934
+ function File(path) {
935
+ this.v3v_1 = path;
936
+ }
937
+ protoOf(File).q11 = function () {
938
+ // Inline function 'kotlin.js.unsafeCast' call
939
+ return get_fs().readFileSync(this.v3v_1.toString(), 'utf-8');
940
+ };
941
+ protoOf(File).y3v = function (text) {
942
+ // Inline function 'kotlin.run' call
943
+ var tmp0_run = this.v3v_1.i22(joinToString(split_0(this.v3v_1.e22_1, ['out']), 'out/node'));
944
+ // Inline function 'kotlin.contracts.contract' call
945
+ // Inline function 'community.flock.wirespec.plugin.cli.io.File.write.<anonymous>' call
946
+ // Inline function 'kotlin.js.unsafeCast' call
947
+ if (!get_fs().existsSync(tmp0_run.e22_1)) {
948
+ get_fs().mkdirSync(tmp0_run.e22_1, {recursive: true});
949
+ }
950
+ get_fs().writeFileSync(tmp0_run.toString(), text);
951
+ };
952
+ function get_fs() {
953
+ _init_properties_JavaScriptBindings_kt__clolet();
954
+ return fs;
955
+ }
956
+ var fs;
957
+ var properties_initialized_JavaScriptBindings_kt_6og6hv;
958
+ function _init_properties_JavaScriptBindings_kt__clolet() {
959
+ if (!properties_initialized_JavaScriptBindings_kt_6og6hv) {
960
+ properties_initialized_JavaScriptBindings_kt_6og6hv = true;
961
+ fs = require('fs');
962
+ }
963
+ }
964
+ function get_nodeArgs() {
965
+ _init_properties_CommandLineArguments_kt__b5v7hl();
966
+ return nodeArgs;
967
+ }
968
+ var nodeArgs;
969
+ function orNull(_this__u8e3s4, idx) {
970
+ _init_properties_CommandLineArguments_kt__b5v7hl();
971
+ // Inline function 'kotlin.Result.getOrNull' call
972
+ // Inline function 'kotlin.runCatching' call
973
+ var tmp;
974
+ try {
975
+ // Inline function 'kotlin.Companion.success' call
976
+ Companion_getInstance_4();
977
+ // Inline function 'community.flock.wirespec.plugin.utils.orNull.<anonymous>' call
978
+ var tmp1_success = get_nodeArgs()[idx];
979
+ tmp = _Result___init__impl__xyqfz8(tmp1_success);
980
+ } catch ($p) {
981
+ var tmp_0;
982
+ if ($p instanceof Error) {
983
+ var e = $p;
984
+ // Inline function 'kotlin.Companion.failure' call
985
+ Companion_getInstance_4();
986
+ tmp_0 = _Result___init__impl__xyqfz8(createFailure(e));
987
+ } else {
988
+ throw $p;
989
+ }
990
+ tmp = tmp_0;
991
+ }
992
+ var tmp0_getOrNull = tmp;
993
+ var tmp_1;
994
+ if (_Result___get_isFailure__impl__jpiriv(tmp0_getOrNull)) {
995
+ tmp_1 = null;
996
+ } else {
997
+ var tmp_2 = _Result___get_value__impl__bjfvqg(tmp0_getOrNull);
998
+ tmp_1 = (tmp_2 == null ? true : isObject(tmp_2)) ? tmp_2 : THROW_CCE();
999
+ }
1000
+ return tmp_1;
1001
+ }
1002
+ var properties_initialized_CommandLineArguments_kt_ekn5uh;
1003
+ function _init_properties_CommandLineArguments_kt__b5v7hl() {
1004
+ if (!properties_initialized_CommandLineArguments_kt_ekn5uh) {
1005
+ properties_initialized_CommandLineArguments_kt_ekn5uh = true;
1006
+ var tmp = process.argv.slice(2);
1007
+ nodeArgs = (!(tmp == null) ? isArray(tmp) : false) ? tmp : THROW_CCE();
1008
+ }
1009
+ }
1010
+ //region block: exports
1011
+ function $jsExportAll$(_) {
1012
+ var $community = _.community || (_.community = {});
1013
+ var $community$flock = $community.flock || ($community.flock = {});
1014
+ var $community$flock$wirespec = $community$flock.wirespec || ($community$flock.wirespec = {});
1015
+ var $community$flock$wirespec$plugin = $community$flock$wirespec.plugin || ($community$flock$wirespec.plugin = {});
1016
+ var $community$flock$wirespec$plugin$cli = $community$flock$wirespec$plugin.cli || ($community$flock$wirespec$plugin.cli = {});
1017
+ $community$flock$wirespec$plugin$cli.cli = cli;
1018
+ $community$flock$wirespec$plugin$cli.parser = parser;
1019
+ }
1020
+ $jsExportAll$(_);
1021
+ kotlin_community_flock_wirespec_compiler_lib.$jsExportAll$(_);
1022
+ //endregion
1023
+ main([]);
1024
+ return _;
1025
+ }));
1026
+
1027
+ //# sourceMappingURL=wirespec-src-plugin-cli.js.map