@sddsjs/design-system-builder-cli 0.0.0-stage → 0.2.0

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 (63) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +969 -2
  3. package/bin/dsbuilder.js +2 -0
  4. package/dist/kotlin/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +3170 -0
  5. package/dist/kotlin/Stately-stately-concurrency.js +32 -0
  6. package/dist/kotlin/Stately-stately-concurrent-collections.js +302 -0
  7. package/dist/kotlin/Stately-stately-strict.js +12 -0
  8. package/dist/kotlin/clikt-clikt-mordant.js +304 -0
  9. package/dist/kotlin/clikt-clikt.js +6960 -0
  10. package/dist/kotlin/colormath-root-colormath.js +1653 -0
  11. package/dist/kotlin/design-system-builder-frontend-analytics-metrica.js +1026 -0
  12. package/dist/kotlin/design-system-builder-frontend-cli.js +10690 -0
  13. package/dist/kotlin/design-system-builder-frontend-core-analytics.js +128 -0
  14. package/dist/kotlin/design-system-builder-frontend-core-application.js +3634 -0
  15. package/dist/kotlin/design-system-builder-frontend-core-auth.js +1772 -0
  16. package/dist/kotlin/design-system-builder-frontend-core-domain.js +501 -0
  17. package/dist/kotlin/design-system-builder-frontend-core-network.js +3318 -0
  18. package/dist/kotlin/design-system-builder-frontend-core-platform.js +972 -0
  19. package/dist/kotlin/design-system-builder-frontend-core-process.js +236 -0
  20. package/dist/kotlin/design-system-builder-frontend-core-workspace.js +1058 -0
  21. package/dist/kotlin/design-system-builder-frontend-feature-auth.js +1664 -0
  22. package/dist/kotlin/design-system-builder-frontend-feature-components.js +24819 -0
  23. package/dist/kotlin/design-system-builder-frontend-feature-docs.js +7625 -0
  24. package/dist/kotlin/design-system-builder-frontend-feature-ds.js +2219 -0
  25. package/dist/kotlin/design-system-builder-frontend-feature-init.js +318 -0
  26. package/dist/kotlin/design-system-builder-frontend-feature-projects.js +624 -0
  27. package/dist/kotlin/design-system-builder-frontend-feature-status.js +984 -0
  28. package/dist/kotlin/design-system-builder-frontend-feature-theme.js +10456 -0
  29. package/dist/kotlin/design-system-builder-frontend-feature-toolchain.js +586 -0
  30. package/dist/kotlin/design-system-builder-frontend-mcp-server-core.js +6878 -0
  31. package/dist/kotlin/design-system-builder-frontend-platform-android.js +451 -0
  32. package/dist/kotlin/design-system-builder-frontend-platform-ios.js +1858 -0
  33. package/dist/kotlin/design-system-builder-frontend-platform-web.js +1555 -0
  34. package/dist/kotlin/design-system-builder-frontend-runtime-node.js +1763 -0
  35. package/dist/kotlin/kotlin-kotlin-stdlib.js +17881 -0
  36. package/dist/kotlin/kotlin-logging.js +440 -0
  37. package/dist/kotlin/kotlin-sdk-kotlin-sdk-core.js +20228 -0
  38. package/dist/kotlin/kotlin-sdk-kotlin-sdk-server.js +2771 -0
  39. package/dist/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  40. package/dist/kotlin/kotlinx-atomicfu.js +252 -0
  41. package/dist/kotlin/kotlinx-coroutines-core.js +10822 -0
  42. package/dist/kotlin/kotlinx-io-kotlinx-io-bytestring.js +203 -0
  43. package/dist/kotlin/kotlinx-io-kotlinx-io-core.js +2032 -0
  44. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +6171 -0
  45. package/dist/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +5690 -0
  46. package/dist/kotlin/ktor-ktor-client-core.js +8382 -0
  47. package/dist/kotlin/ktor-ktor-events.js +80 -0
  48. package/dist/kotlin/ktor-ktor-http-cio.js +2252 -0
  49. package/dist/kotlin/ktor-ktor-http.js +3320 -0
  50. package/dist/kotlin/ktor-ktor-io.js +3328 -0
  51. package/dist/kotlin/ktor-ktor-serialization.js +8 -0
  52. package/dist/kotlin/ktor-ktor-server-core.js +12 -0
  53. package/dist/kotlin/ktor-ktor-server-sse.js +8 -0
  54. package/dist/kotlin/ktor-ktor-server-websockets.js +8 -0
  55. package/dist/kotlin/ktor-ktor-sse.js +8 -0
  56. package/dist/kotlin/ktor-ktor-utils.js +2524 -0
  57. package/dist/kotlin/ktor-ktor-websocket-serialization.js +8 -0
  58. package/dist/kotlin/ktor-ktor-websockets.js +433 -0
  59. package/dist/kotlin/mordant-mordant-omnibus.js +8 -0
  60. package/dist/kotlin/mordant-mordant.js +12111 -0
  61. package/dist/kotlin/okio-parent-okio.js +2335 -0
  62. package/dist/kotlin/projects-core-koin-core.js +1285 -0
  63. package/package.json +26 -5
@@ -0,0 +1,1858 @@
1
+ (function (_, kotlin_kotlin, kotlin_design_system_builder_frontend_core_platform, kotlin_design_system_builder_frontend_core_process, kotlin_design_system_builder_frontend_core_domain, kotlin_io_insert_koin_koin_core, kotlin_design_system_builder_frontend_core_workspace, kotlin_design_system_builder_frontend_core_auth, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var protoOf = kotlin_kotlin.$_$.te;
6
+ var getStringHashCode = kotlin_kotlin.$_$.od;
7
+ var initMetadataForClass = kotlin_kotlin.$_$.qd;
8
+ var Unit_instance = kotlin_kotlin.$_$.r5;
9
+ var listOf = kotlin_kotlin.$_$.e9;
10
+ var listOf_0 = kotlin_kotlin.$_$.f9;
11
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.vl;
12
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m;
13
+ var joinToString = kotlin_kotlin.$_$.r8;
14
+ var CoroutineImpl = kotlin_kotlin.$_$.tb;
15
+ var Missing = kotlin_design_system_builder_frontend_core_platform.$_$.r;
16
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.db;
17
+ var Ready = kotlin_design_system_builder_frontend_core_platform.$_$.s;
18
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.sd;
19
+ var VOID = kotlin_kotlin.$_$.c;
20
+ var ProcessRequest = kotlin_design_system_builder_frontend_core_process.$_$.b;
21
+ var ProcessLaunchException = kotlin_design_system_builder_frontend_core_process.$_$.a;
22
+ var THROW_CCE = kotlin_kotlin.$_$.wk;
23
+ var isCharSequence = kotlin_kotlin.$_$.be;
24
+ var trim = kotlin_kotlin.$_$.uj;
25
+ var toString = kotlin_kotlin.$_$.we;
26
+ var ToolchainMissing = kotlin_design_system_builder_frontend_core_platform.$_$.d;
27
+ var Failed = kotlin_design_system_builder_frontend_core_platform.$_$.c;
28
+ var Completed = kotlin_design_system_builder_frontend_core_platform.$_$.b;
29
+ var _ToolchainId___init__impl__eu7bv9 = kotlin_design_system_builder_frontend_core_platform.$_$.z;
30
+ var TargetPlatform_SWIFT_UI_getInstance = kotlin_design_system_builder_frontend_core_domain.$_$.q;
31
+ var setOf = kotlin_kotlin.$_$.y9;
32
+ var Capability_THEME_getInstance = kotlin_design_system_builder_frontend_core_platform.$_$.y;
33
+ var Capability_COMPONENTS_getInstance = kotlin_design_system_builder_frontend_core_platform.$_$.v;
34
+ var Capability_DOCS_AGGREGATE_getInstance = kotlin_design_system_builder_frontend_core_platform.$_$.x;
35
+ var Capability_DESIGN_SYSTEM_getInstance = kotlin_design_system_builder_frontend_core_platform.$_$.w;
36
+ var setOf_0 = kotlin_kotlin.$_$.z9;
37
+ var module_0 = kotlin_io_insert_koin_koin_core.$_$.g;
38
+ var Companion_getInstance = kotlin_io_insert_koin_koin_core.$_$.b;
39
+ var Kind_Singleton_getInstance = kotlin_io_insert_koin_koin_core.$_$.a;
40
+ var emptyList = kotlin_kotlin.$_$.y7;
41
+ var getKClass = kotlin_kotlin.$_$.qf;
42
+ var BeanDefinition = kotlin_io_insert_koin_koin_core.$_$.c;
43
+ var SingleInstanceFactory = kotlin_io_insert_koin_koin_core.$_$.e;
44
+ var KoinDefinition = kotlin_io_insert_koin_koin_core.$_$.d;
45
+ var ProcessRunner = kotlin_design_system_builder_frontend_core_process.$_$.d;
46
+ var WorkspaceFileSystem = kotlin_design_system_builder_frontend_core_workspace.$_$.i;
47
+ var EnvironmentReader = kotlin_design_system_builder_frontend_core_auth.$_$.i;
48
+ var get_jsonPrimitive = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.x;
49
+ var JsonObject = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.n;
50
+ var IllegalArgumentException = kotlin_kotlin.$_$.nk;
51
+ var JsonArray = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.j;
52
+ var startsWith = kotlin_kotlin.$_$.gi;
53
+ var Json = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.r;
54
+ var initMetadataForCompanion = kotlin_kotlin.$_$.rd;
55
+ var isBlank = kotlin_kotlin.$_$.gh;
56
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.w2;
57
+ var substringAfterLast = kotlin_kotlin.$_$.ki;
58
+ var removeSuffix = kotlin_kotlin.$_$.xh;
59
+ var removePrefix = kotlin_kotlin.$_$.wh;
60
+ var Failed_0 = kotlin_design_system_builder_frontend_core_platform.$_$.n;
61
+ var Installed = kotlin_design_system_builder_frontend_core_platform.$_$.o;
62
+ var getBooleanHashCode = kotlin_kotlin.$_$.ld;
63
+ var split = kotlin_kotlin.$_$.fi;
64
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.y6;
65
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l;
66
+ //endregion
67
+ //region block: pre-declaration
68
+ initMetadataForClass(Reported, 'Reported');
69
+ initMetadataForClass(Unavailable, 'Unavailable');
70
+ initMetadataForCoroutine($doctorCOROUTINE$, CoroutineImpl);
71
+ initMetadataForCoroutine($readVersionCOROUTINE$, CoroutineImpl);
72
+ initMetadataForCoroutine($runCOROUTINE$, CoroutineImpl);
73
+ initMetadataForClass(IosCliDelegate, 'IosCliDelegate', VOID, VOID, VOID, [2, 1]);
74
+ initMetadataForCompanion(Companion);
75
+ initMetadataForCoroutine($resolveCOROUTINE$, CoroutineImpl);
76
+ initMetadataForCoroutine($fetchCOROUTINE$, CoroutineImpl);
77
+ initMetadataForClass(IosReleaseSource, 'IosReleaseSource', VOID, VOID, VOID, [1]);
78
+ initMetadataForClass(Found, 'Found');
79
+ initMetadataForClass(Failed_1, 'Failed');
80
+ initMetadataForClass(Body, 'Body');
81
+ initMetadataForClass(Failed_2, 'Failed');
82
+ initMetadataForCompanion(Companion_0);
83
+ initMetadataForCoroutine($installCOROUTINE$, CoroutineImpl);
84
+ initMetadataForCoroutine($supportsArm64COROUTINE$, CoroutineImpl);
85
+ initMetadataForCoroutine($resolveSourceCOROUTINE$, CoroutineImpl);
86
+ initMetadataForCoroutine($downloadCOROUTINE$, CoroutineImpl);
87
+ initMetadataForCoroutine($unpackCOROUTINE$, CoroutineImpl);
88
+ initMetadataForCoroutine($activateCOROUTINE$, CoroutineImpl);
89
+ initMetadataForCoroutine($removeCOROUTINE$, CoroutineImpl);
90
+ initMetadataForCoroutine($runCOROUTINE$_0, CoroutineImpl);
91
+ initMetadataForClass(IosToolchainInstaller, 'IosToolchainInstaller', VOID, VOID, VOID, [1, 2, 4, 3]);
92
+ initMetadataForClass(Resolved, 'Resolved');
93
+ initMetadataForClass(Failed_3, 'Failed');
94
+ initMetadataForClass(RunResult, 'RunResult');
95
+ initMetadataForClass(IosToolchainLocator, 'IosToolchainLocator');
96
+ //endregion
97
+ function Reported(value) {
98
+ this.cbf_1 = value;
99
+ }
100
+ protoOf(Reported).toString = function () {
101
+ return 'Reported(value=' + this.cbf_1 + ')';
102
+ };
103
+ protoOf(Reported).hashCode = function () {
104
+ return getStringHashCode(this.cbf_1);
105
+ };
106
+ protoOf(Reported).equals = function (other) {
107
+ if (this === other)
108
+ return true;
109
+ if (!(other instanceof Reported))
110
+ return false;
111
+ if (!(this.cbf_1 === other.cbf_1))
112
+ return false;
113
+ return true;
114
+ };
115
+ function Unavailable(reason) {
116
+ this.dbf_1 = reason;
117
+ }
118
+ protoOf(Unavailable).toString = function () {
119
+ return 'Unavailable(reason=' + this.dbf_1 + ')';
120
+ };
121
+ protoOf(Unavailable).hashCode = function () {
122
+ return getStringHashCode(this.dbf_1);
123
+ };
124
+ protoOf(Unavailable).equals = function (other) {
125
+ if (this === other)
126
+ return true;
127
+ if (!(other instanceof Unavailable))
128
+ return false;
129
+ if (!(this.dbf_1 === other.dbf_1))
130
+ return false;
131
+ return true;
132
+ };
133
+ function readVersion($this, executable, workspace, $completion) {
134
+ var tmp = new $readVersionCOROUTINE$($this, executable, workspace, $completion);
135
+ tmp.y8_1 = Unit_instance;
136
+ tmp.z8_1 = null;
137
+ return tmp.e9();
138
+ }
139
+ function commands($this, invocation) {
140
+ var tmp;
141
+ switch (invocation.s66_1.o2_1) {
142
+ case 0:
143
+ tmp = listOf(generationArguments($this, 'theme', invocation));
144
+ break;
145
+ case 1:
146
+ tmp = listOf(generationArguments($this, 'components', invocation));
147
+ break;
148
+ case 3:
149
+ tmp = listOf_0([generationArguments($this, 'theme', invocation), generationArguments($this, 'components', invocation)]);
150
+ break;
151
+ case 2:
152
+ tmp = listOf(docsArguments($this, invocation));
153
+ break;
154
+ default:
155
+ noWhenBranchMatchedException();
156
+ break;
157
+ }
158
+ return tmp;
159
+ }
160
+ function generationArguments($this, command, invocation) {
161
+ // Inline function 'kotlin.collections.buildList' call
162
+ // Inline function 'kotlin.collections.buildListInternal' call
163
+ // Inline function 'kotlin.apply' call
164
+ var this_0 = ArrayList_init_$Create$();
165
+ this_0.j(command);
166
+ this_0.j('generate');
167
+ this_0.j('--sdds');
168
+ this_0.j(invocation.u66_1.m66_1);
169
+ var tmp0_safe_receiver = invocation.v66_1;
170
+ if (tmp0_safe_receiver == null)
171
+ null;
172
+ else {
173
+ // Inline function 'kotlin.let' call
174
+ this_0.j('--output');
175
+ this_0.j(tmp0_safe_receiver);
176
+ }
177
+ this_0.q(invocation.w66_1);
178
+ return this_0.b5();
179
+ }
180
+ function docsArguments($this, invocation) {
181
+ // Inline function 'kotlin.collections.buildList' call
182
+ // Inline function 'kotlin.collections.buildListInternal' call
183
+ // Inline function 'kotlin.apply' call
184
+ var this_0 = ArrayList_init_$Create$();
185
+ this_0.j('docs');
186
+ this_0.j('aggregate');
187
+ this_0.j('--sdds');
188
+ this_0.j(invocation.u66_1.m66_1);
189
+ var tmp0_safe_receiver = invocation.v66_1;
190
+ if (tmp0_safe_receiver == null)
191
+ null;
192
+ else {
193
+ // Inline function 'kotlin.let' call
194
+ this_0.j('--output');
195
+ this_0.j(tmp0_safe_receiver);
196
+ }
197
+ this_0.q(invocation.w66_1);
198
+ return this_0.b5();
199
+ }
200
+ function completedSummary($this, invocation) {
201
+ var tmp;
202
+ switch (invocation.s66_1.o2_1) {
203
+ case 0:
204
+ tmp = 'Theme generated from ' + invocation.u66_1.m66_1 + '.';
205
+ break;
206
+ case 1:
207
+ tmp = 'Component variations generated from ' + invocation.u66_1.m66_1 + '.';
208
+ break;
209
+ case 2:
210
+ tmp = 'Documentation tree aggregated from ' + invocation.u66_1.m66_1 + '.';
211
+ break;
212
+ case 3:
213
+ tmp = 'Design system generated from ' + invocation.u66_1.m66_1 + '.';
214
+ break;
215
+ default:
216
+ noWhenBranchMatchedException();
217
+ break;
218
+ }
219
+ return tmp;
220
+ }
221
+ function missingHint($this, toolOverride) {
222
+ var tmp;
223
+ if (!(toolOverride == null)) {
224
+ tmp = 'dsbuilder-ios was not found at ' + toolOverride + ', the path given by --tool.';
225
+ } else {
226
+ tmp = 'dsbuilder-ios was not found. Checked: ' + joinToString($this.rbf_1.xbf()) + '. ' + 'Install it from the plasma-ios release or pass --tool <path>.';
227
+ }
228
+ return tmp;
229
+ }
230
+ function $doctorCOROUTINE$(_this__u8e3s4, workspace, toolOverride, resultContinuation) {
231
+ CoroutineImpl.call(this, resultContinuation);
232
+ this.gbg_1 = _this__u8e3s4;
233
+ this.hbg_1 = workspace;
234
+ this.ibg_1 = toolOverride;
235
+ }
236
+ protoOf($doctorCOROUTINE$).e9 = function () {
237
+ var suspendResult = this.y8_1;
238
+ $sm: do
239
+ try {
240
+ var tmp = this.w8_1;
241
+ switch (tmp) {
242
+ case 0:
243
+ this.x8_1 = 2;
244
+ var tmp_0 = this;
245
+ var tmp0_elvis_lhs = this.gbg_1.rbf_1.kbg(this.ibg_1);
246
+ var tmp_1;
247
+ if (tmp0_elvis_lhs == null) {
248
+ return new Missing(missingHint(this.gbg_1, this.ibg_1));
249
+ } else {
250
+ tmp_1 = tmp0_elvis_lhs;
251
+ }
252
+
253
+ tmp_0.jbg_1 = tmp_1;
254
+ this.w8_1 = 1;
255
+ suspendResult = readVersion(this.gbg_1, this.jbg_1, this.hbg_1, this);
256
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
257
+ return suspendResult;
258
+ }
259
+
260
+ continue $sm;
261
+ case 1:
262
+ var version = suspendResult;
263
+ var tmp_2;
264
+ if (version instanceof Reported) {
265
+ tmp_2 = new Ready(this.jbg_1, version.cbf_1);
266
+ } else {
267
+ if (version instanceof Unavailable) {
268
+ tmp_2 = new Missing(version.dbf_1);
269
+ } else {
270
+ noWhenBranchMatchedException();
271
+ }
272
+ }
273
+
274
+ return tmp_2;
275
+ case 2:
276
+ throw this.z8_1;
277
+ }
278
+ } catch ($p) {
279
+ var e = $p;
280
+ if (this.x8_1 === 2) {
281
+ throw e;
282
+ } else {
283
+ this.w8_1 = this.x8_1;
284
+ this.z8_1 = e;
285
+ }
286
+ }
287
+ while (true);
288
+ };
289
+ function $readVersionCOROUTINE$(_this__u8e3s4, executable, workspace, resultContinuation) {
290
+ CoroutineImpl.call(this, resultContinuation);
291
+ this.mbf_1 = _this__u8e3s4;
292
+ this.nbf_1 = executable;
293
+ this.obf_1 = workspace;
294
+ }
295
+ protoOf($readVersionCOROUTINE$).e9 = function () {
296
+ var suspendResult = this.y8_1;
297
+ $sm: do
298
+ try {
299
+ var tmp = this.w8_1;
300
+ switch (tmp) {
301
+ case 0:
302
+ this.x8_1 = 3;
303
+ this.x8_1 = 2;
304
+ this.w8_1 = 1;
305
+ suspendResult = this.mbf_1.qbf_1.j5o(new ProcessRequest(this.nbf_1, listOf('--version'), this.obf_1.n66_1, VOID, false), this);
306
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
307
+ return suspendResult;
308
+ }
309
+
310
+ continue $sm;
311
+ case 1:
312
+ this.pbf_1 = suspendResult;
313
+ this.x8_1 = 3;
314
+ this.w8_1 = 4;
315
+ continue $sm;
316
+ case 2:
317
+ this.x8_1 = 3;
318
+ var tmp_0 = this.z8_1;
319
+ if (tmp_0 instanceof ProcessLaunchException) {
320
+ var error = this.z8_1;
321
+ var tmp_1 = this;
322
+ return new Unavailable(this.nbf_1 + ' cannot be started: ' + error.message);
323
+ } else {
324
+ throw this.z8_1;
325
+ }
326
+
327
+ case 3:
328
+ throw this.z8_1;
329
+ case 4:
330
+ this.x8_1 = 3;
331
+ var result = this.pbf_1;
332
+ var tmp_2;
333
+ if (result.k5o_1 === 0) {
334
+ var this_0 = result.l5o_1;
335
+ tmp_2 = new Reported(toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())));
336
+ } else {
337
+ tmp_2 = new Unavailable(this.nbf_1 + ' --version failed with exit code ' + result.k5o_1 + '.');
338
+ }
339
+
340
+ return tmp_2;
341
+ }
342
+ } catch ($p) {
343
+ var e = $p;
344
+ if (this.x8_1 === 3) {
345
+ throw e;
346
+ } else {
347
+ this.w8_1 = this.x8_1;
348
+ this.z8_1 = e;
349
+ }
350
+ }
351
+ while (true);
352
+ };
353
+ function $runCOROUTINE$(_this__u8e3s4, invocation, resultContinuation) {
354
+ CoroutineImpl.call(this, resultContinuation);
355
+ this.tbg_1 = _this__u8e3s4;
356
+ this.ubg_1 = invocation;
357
+ }
358
+ protoOf($runCOROUTINE$).e9 = function () {
359
+ var suspendResult = this.y8_1;
360
+ $sm: do
361
+ try {
362
+ var tmp = this.w8_1;
363
+ switch (tmp) {
364
+ case 0:
365
+ this.x8_1 = 8;
366
+ var commands_0 = commands(this.tbg_1, this.ubg_1);
367
+ var tmp_0 = this;
368
+ var tmp0_elvis_lhs = this.tbg_1.rbf_1.kbg(this.ubg_1.x66_1);
369
+ var tmp_1;
370
+ if (tmp0_elvis_lhs == null) {
371
+ return new ToolchainMissing(missingHint(this.tbg_1, this.ubg_1.x66_1));
372
+ } else {
373
+ tmp_1 = tmp0_elvis_lhs;
374
+ }
375
+
376
+ tmp_0.wbg_1 = tmp_1;
377
+ this.x8_1 = 7;
378
+ var tmp_2 = this;
379
+ tmp_2.zbg_1 = commands_0;
380
+ this.w8_1 = 1;
381
+ continue $sm;
382
+ case 1:
383
+ this.ybg_1 = this.zbg_1.l();
384
+ this.w8_1 = 2;
385
+ continue $sm;
386
+ case 2:
387
+ if (!this.ybg_1.m()) {
388
+ this.w8_1 = 5;
389
+ continue $sm;
390
+ }
391
+
392
+ var element = this.ybg_1.n();
393
+ this.w8_1 = 3;
394
+ suspendResult = this.tbg_1.qbf_1.j5o(new ProcessRequest(this.wbg_1, element, this.ubg_1.u66_1.n66_1), this);
395
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
396
+ return suspendResult;
397
+ }
398
+
399
+ continue $sm;
400
+ case 3:
401
+ var this_0 = suspendResult.k5o_1;
402
+ var tmp_3;
403
+ if (!(this_0 === 0)) {
404
+ tmp_3 = this_0;
405
+ } else {
406
+ tmp_3 = null;
407
+ }
408
+
409
+ var result = tmp_3;
410
+ if (!(result == null)) {
411
+ this.xbg_1 = result;
412
+ this.w8_1 = 6;
413
+ continue $sm;
414
+ } else {
415
+ this.w8_1 = 4;
416
+ continue $sm;
417
+ }
418
+
419
+ case 4:
420
+ this.w8_1 = 2;
421
+ continue $sm;
422
+ case 5:
423
+ this.xbg_1 = null;
424
+ if (false) {
425
+ this.w8_1 = 1;
426
+ continue $sm;
427
+ }
428
+
429
+ this.w8_1 = 6;
430
+ continue $sm;
431
+ case 6:
432
+ var failed = this.xbg_1;
433
+ var tmp_4 = this;
434
+ var tmp_5;
435
+ if (failed == null) {
436
+ tmp_5 = new Completed(completedSummary(this.tbg_1, this.ubg_1));
437
+ } else {
438
+ tmp_5 = new Failed(failed, 'see the output of ' + this.wbg_1 + ' above');
439
+ }
440
+
441
+ tmp_4.vbg_1 = tmp_5;
442
+ this.x8_1 = 8;
443
+ this.w8_1 = 9;
444
+ continue $sm;
445
+ case 7:
446
+ this.x8_1 = 8;
447
+ var tmp_6 = this.z8_1;
448
+ if (tmp_6 instanceof ProcessLaunchException) {
449
+ var error = this.z8_1;
450
+ var tmp_7 = this;
451
+ tmp_7.vbg_1 = new ToolchainMissing(this.wbg_1 + ' cannot be started: ' + error.message);
452
+ this.w8_1 = 9;
453
+ continue $sm;
454
+ } else {
455
+ throw this.z8_1;
456
+ }
457
+
458
+ case 8:
459
+ throw this.z8_1;
460
+ case 9:
461
+ this.x8_1 = 8;
462
+ return this.vbg_1;
463
+ }
464
+ } catch ($p) {
465
+ var e = $p;
466
+ if (this.x8_1 === 8) {
467
+ throw e;
468
+ } else {
469
+ this.w8_1 = this.x8_1;
470
+ this.z8_1 = e;
471
+ }
472
+ }
473
+ while (true);
474
+ };
475
+ function IosCliDelegate(processRunner, locator) {
476
+ this.qbf_1 = processRunner;
477
+ this.rbf_1 = locator;
478
+ this.sbf_1 = _ToolchainId___init__impl__eu7bv9('ios');
479
+ this.tbf_1 = setOf(TargetPlatform_SWIFT_UI_getInstance());
480
+ this.ubf_1 = setOf_0([Capability_THEME_getInstance(), Capability_COMPONENTS_getInstance(), Capability_DOCS_AGGREGATE_getInstance(), Capability_DESIGN_SYSTEM_getInstance()]);
481
+ }
482
+ protoOf(IosCliDelegate).t64 = function () {
483
+ return this.sbf_1;
484
+ };
485
+ protoOf(IosCliDelegate).k66 = function () {
486
+ return this.tbf_1;
487
+ };
488
+ protoOf(IosCliDelegate).w65 = function () {
489
+ return this.ubf_1;
490
+ };
491
+ protoOf(IosCliDelegate).y65 = function (workspace, toolOverride, $completion) {
492
+ var tmp = new $doctorCOROUTINE$(this, workspace, toolOverride, $completion);
493
+ tmp.y8_1 = Unit_instance;
494
+ tmp.z8_1 = null;
495
+ return tmp.e9();
496
+ };
497
+ protoOf(IosCliDelegate).c66 = function (invocation, $completion) {
498
+ var tmp = new $runCOROUTINE$(this, invocation, $completion);
499
+ tmp.y8_1 = Unit_instance;
500
+ tmp.z8_1 = null;
501
+ return tmp.e9();
502
+ };
503
+ function iosPlatformModule() {
504
+ return module_0(VOID, iosPlatformModule$lambda);
505
+ }
506
+ function iosPlatformModule$lambda($this$module) {
507
+ // Inline function 'org.koin.core.module.Module.single' call
508
+ // Inline function 'org.koin.core.module._singleInstanceFactory' call
509
+ var definition = iosPlatformModule$lambda$lambda;
510
+ var scopeQualifier = Companion_getInstance().u56_1;
511
+ // Inline function 'org.koin.core.definition._createDefinition' call
512
+ var kind = Kind_Singleton_getInstance();
513
+ var secondaryTypes = emptyList();
514
+ var def = new BeanDefinition(scopeQualifier, getKClass(IosCliDelegate), null, definition, kind, secondaryTypes);
515
+ var factory = new SingleInstanceFactory(def);
516
+ $this$module.k58(factory);
517
+ if (false || $this$module.e58_1) {
518
+ $this$module.m58(factory);
519
+ }
520
+ new KoinDefinition($this$module, factory);
521
+ // Inline function 'org.koin.core.module.Module.single' call
522
+ // Inline function 'org.koin.core.module._singleInstanceFactory' call
523
+ var definition_0 = iosPlatformModule$lambda$lambda_0;
524
+ var scopeQualifier_0 = Companion_getInstance().u56_1;
525
+ // Inline function 'org.koin.core.definition._createDefinition' call
526
+ var kind_0 = Kind_Singleton_getInstance();
527
+ var secondaryTypes_0 = emptyList();
528
+ var def_0 = new BeanDefinition(scopeQualifier_0, getKClass(IosToolchainInstaller), null, definition_0, kind_0, secondaryTypes_0);
529
+ var factory_0 = new SingleInstanceFactory(def_0);
530
+ $this$module.k58(factory_0);
531
+ if (false || $this$module.e58_1) {
532
+ $this$module.m58(factory_0);
533
+ }
534
+ new KoinDefinition($this$module, factory_0);
535
+ return Unit_instance;
536
+ }
537
+ function iosPlatformModule$lambda$lambda($this$single, it) {
538
+ // Inline function 'org.koin.core.scope.Scope.get' call
539
+ var tmp = $this$single.j59(getKClass(ProcessRunner), null, null);
540
+ // Inline function 'org.koin.core.scope.Scope.get' call
541
+ var tmp_0 = $this$single.j59(getKClass(WorkspaceFileSystem), null, null);
542
+ // Inline function 'org.koin.core.scope.Scope.get' call
543
+ var tmp$ret$2 = $this$single.j59(getKClass(EnvironmentReader), null, null);
544
+ return new IosCliDelegate(tmp, new IosToolchainLocator(tmp_0, tmp$ret$2));
545
+ }
546
+ function iosPlatformModule$lambda$lambda_0($this$single, it) {
547
+ // Inline function 'org.koin.core.scope.Scope.get' call
548
+ var tmp = $this$single.j59(getKClass(ProcessRunner), null, null);
549
+ // Inline function 'org.koin.core.scope.Scope.get' call
550
+ var tmp_0 = $this$single.j59(getKClass(WorkspaceFileSystem), null, null);
551
+ // Inline function 'org.koin.core.scope.Scope.get' call
552
+ var tmp_1 = $this$single.j59(getKClass(EnvironmentReader), null, null);
553
+ return new IosToolchainInstaller(tmp, tmp_0, tmp_1, iosPlatformModule$lambda$lambda$lambda($this$single));
554
+ }
555
+ function iosPlatformModule$lambda$lambda$lambda($this_single) {
556
+ return function (workingDirectory) {
557
+ // Inline function 'org.koin.core.scope.Scope.get' call
558
+ var tmp$ret$0 = $this_single.j59(getKClass(ProcessRunner), null, null);
559
+ return new IosReleaseSource(tmp$ret$0, workingDirectory);
560
+ };
561
+ }
562
+ function IosReleaseSource$Companion$JSON$lambda($this$Json) {
563
+ $this$Json.j36_1 = true;
564
+ return Unit_instance;
565
+ }
566
+ function parse($this, body, version) {
567
+ var tmp0_elvis_lhs = releaseObject($this, body);
568
+ var tmp;
569
+ if (tmp0_elvis_lhs == null) {
570
+ return new Failed_1(releaseHint($this, version, 'unexpected response'));
571
+ } else {
572
+ tmp = tmp0_elvis_lhs;
573
+ }
574
+ var release = tmp;
575
+ var tmp1_safe_receiver = release.xd('tag_name');
576
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : get_jsonPrimitive(tmp1_safe_receiver);
577
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : contentOrNullSafe(tmp2_safe_receiver);
578
+ var tmp_0;
579
+ if (tmp3_elvis_lhs == null) {
580
+ return new Failed_1(releaseHint($this, version, 'the response has no tag_name'));
581
+ } else {
582
+ tmp_0 = tmp3_elvis_lhs;
583
+ }
584
+ var tag = tmp_0;
585
+ return toolAsset($this, release, tag, version);
586
+ }
587
+ function releaseObject($this, body) {
588
+ var tmp;
589
+ try {
590
+ var tmp_0 = Companion_getInstance_0().abh_1.s35(body);
591
+ tmp = tmp_0 instanceof JsonObject ? tmp_0 : null;
592
+ } catch ($p) {
593
+ var tmp_1;
594
+ if ($p instanceof IllegalArgumentException) {
595
+ var error = $p;
596
+ tmp_1 = null;
597
+ } else {
598
+ throw $p;
599
+ }
600
+ tmp = tmp_1;
601
+ }
602
+ return tmp;
603
+ }
604
+ function toolAsset($this, release, tag, version) {
605
+ var tmp = release.xd('assets');
606
+ // Inline function 'kotlin.collections.orEmpty' call
607
+ var tmp0_elvis_lhs = tmp instanceof JsonArray ? tmp : null;
608
+ // Inline function 'kotlin.collections.mapNotNull' call
609
+ var tmp0 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
610
+ // Inline function 'kotlin.collections.mapNotNullTo' call
611
+ var destination = ArrayList_init_$Create$();
612
+ // Inline function 'kotlin.collections.forEach' call
613
+ var _iterator__ex2g4s = tmp0.l();
614
+ while (_iterator__ex2g4s.m()) {
615
+ var element = _iterator__ex2g4s.n();
616
+ var tmp0_safe_receiver = element instanceof JsonObject ? element : null;
617
+ if (tmp0_safe_receiver == null)
618
+ null;
619
+ else {
620
+ // Inline function 'kotlin.let' call
621
+ destination.j(tmp0_safe_receiver);
622
+ }
623
+ }
624
+ var tmp$ret$9;
625
+ $l$block: {
626
+ // Inline function 'kotlin.collections.firstOrNull' call
627
+ var _iterator__ex2g4s_0 = destination.l();
628
+ while (_iterator__ex2g4s_0.m()) {
629
+ var element_0 = _iterator__ex2g4s_0.n();
630
+ if (startsWith(assetName(element_0), 'dsbuilder-ios-cli')) {
631
+ tmp$ret$9 = element_0;
632
+ break $l$block;
633
+ }
634
+ }
635
+ tmp$ret$9 = null;
636
+ }
637
+ var tmp0_elvis_lhs_0 = tmp$ret$9;
638
+ var tmp_0;
639
+ if (tmp0_elvis_lhs_0 == null) {
640
+ return new Failed_1('Release ' + tag + ' of salute-developers/plasma-ios has no dsbuilder-ios-cli asset. ' + 'Install it with --from <path|url> or pick another release with --version <tag>.');
641
+ } else {
642
+ tmp_0 = tmp0_elvis_lhs_0;
643
+ }
644
+ var asset = tmp_0;
645
+ var tmp1_safe_receiver = asset.xd('browser_download_url');
646
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : get_jsonPrimitive(tmp1_safe_receiver);
647
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : contentOrNullSafe(tmp2_safe_receiver);
648
+ var tmp_1;
649
+ if (tmp3_elvis_lhs == null) {
650
+ return new Failed_1(releaseHint($this, version, 'asset of release ' + tag + ' has no download url'));
651
+ } else {
652
+ tmp_1 = tmp3_elvis_lhs;
653
+ }
654
+ var downloadUrl = tmp_1;
655
+ return new Found(tag, downloadUrl);
656
+ }
657
+ function fetch($this, url, $completion) {
658
+ var tmp = new $fetchCOROUTINE$($this, url, $completion);
659
+ tmp.y8_1 = Unit_instance;
660
+ tmp.z8_1 = null;
661
+ return tmp.e9();
662
+ }
663
+ function releaseHint($this, version, reason) {
664
+ var tmp;
665
+ if (version == null) {
666
+ tmp = null;
667
+ } else {
668
+ // Inline function 'kotlin.let' call
669
+ tmp = 'release ' + version;
670
+ }
671
+ var tmp1_elvis_lhs = tmp;
672
+ var release = tmp1_elvis_lhs == null ? 'the latest release' : tmp1_elvis_lhs;
673
+ return 'Cannot read ' + release + ' of salute-developers/plasma-ios: ' + reason + '.';
674
+ }
675
+ function Companion() {
676
+ Companion_instance = this;
677
+ var tmp = this;
678
+ tmp.abh_1 = Json(VOID, IosReleaseSource$Companion$JSON$lambda);
679
+ }
680
+ var Companion_instance;
681
+ function Companion_getInstance_0() {
682
+ if (Companion_instance == null)
683
+ new Companion();
684
+ return Companion_instance;
685
+ }
686
+ function $resolveCOROUTINE$(_this__u8e3s4, version, resultContinuation) {
687
+ CoroutineImpl.call(this, resultContinuation);
688
+ this.ubh_1 = _this__u8e3s4;
689
+ this.vbh_1 = version;
690
+ }
691
+ protoOf($resolveCOROUTINE$).e9 = function () {
692
+ var suspendResult = this.y8_1;
693
+ $sm: do
694
+ try {
695
+ var tmp = this.w8_1;
696
+ switch (tmp) {
697
+ case 0:
698
+ this.x8_1 = 2;
699
+ var path = this.vbh_1 == null ? 'releases/latest' : 'releases/tags/' + this.vbh_1;
700
+ var url = 'https://api.github.com/repos/salute-developers/plasma-ios/' + path;
701
+ this.w8_1 = 1;
702
+ suspendResult = fetch(this.ubh_1, url, this);
703
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
704
+ return suspendResult;
705
+ }
706
+
707
+ continue $sm;
708
+ case 1:
709
+ var response = suspendResult;
710
+ var tmp_0;
711
+ if (response instanceof Failed_2) {
712
+ tmp_0 = new Failed_1(releaseHint(this.ubh_1, this.vbh_1, response.xbh_1));
713
+ } else {
714
+ if (response instanceof Body) {
715
+ tmp_0 = parse(this.ubh_1, response.wbh_1, this.vbh_1);
716
+ } else {
717
+ noWhenBranchMatchedException();
718
+ }
719
+ }
720
+
721
+ return tmp_0;
722
+ case 2:
723
+ throw this.z8_1;
724
+ }
725
+ } catch ($p) {
726
+ var e = $p;
727
+ if (this.x8_1 === 2) {
728
+ throw e;
729
+ } else {
730
+ this.w8_1 = this.x8_1;
731
+ this.z8_1 = e;
732
+ }
733
+ }
734
+ while (true);
735
+ };
736
+ function $fetchCOROUTINE$(_this__u8e3s4, url, resultContinuation) {
737
+ CoroutineImpl.call(this, resultContinuation);
738
+ this.jbh_1 = _this__u8e3s4;
739
+ this.kbh_1 = url;
740
+ }
741
+ protoOf($fetchCOROUTINE$).e9 = function () {
742
+ var suspendResult = this.y8_1;
743
+ $sm: do
744
+ try {
745
+ var tmp = this.w8_1;
746
+ switch (tmp) {
747
+ case 0:
748
+ this.x8_1 = 3;
749
+ this.x8_1 = 2;
750
+ this.w8_1 = 1;
751
+ suspendResult = this.jbh_1.ybh_1.j5o(new ProcessRequest('/usr/bin/curl', listOf_0(['--fail', '--silent', '--show-error', '--location', this.kbh_1]), this.jbh_1.zbh_1, VOID, false), this);
752
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
753
+ return suspendResult;
754
+ }
755
+
756
+ continue $sm;
757
+ case 1:
758
+ this.lbh_1 = suspendResult;
759
+ this.x8_1 = 3;
760
+ this.w8_1 = 4;
761
+ continue $sm;
762
+ case 2:
763
+ this.x8_1 = 3;
764
+ var tmp_0 = this.z8_1;
765
+ if (tmp_0 instanceof ProcessLaunchException) {
766
+ var error = this.z8_1;
767
+ var tmp_1 = this;
768
+ return new Failed_2('/usr/bin/curl cannot be started: ' + error.message);
769
+ } else {
770
+ throw this.z8_1;
771
+ }
772
+
773
+ case 3:
774
+ throw this.z8_1;
775
+ case 4:
776
+ this.x8_1 = 3;
777
+ var result = this.lbh_1;
778
+ var tmp_2;
779
+ if (result.k5o_1 === 0) {
780
+ tmp_2 = new Body(result.l5o_1);
781
+ } else {
782
+ var this_0 = result.l5o_1;
783
+ tmp_2 = new Failed_2('/usr/bin/curl exited with code ' + result.k5o_1 + ': ' + toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())));
784
+ }
785
+
786
+ return tmp_2;
787
+ }
788
+ } catch ($p) {
789
+ var e = $p;
790
+ if (this.x8_1 === 3) {
791
+ throw e;
792
+ } else {
793
+ this.w8_1 = this.x8_1;
794
+ this.z8_1 = e;
795
+ }
796
+ }
797
+ while (true);
798
+ };
799
+ function IosReleaseSource(processRunner, workingDirectory) {
800
+ Companion_getInstance_0();
801
+ this.ybh_1 = processRunner;
802
+ this.zbh_1 = workingDirectory;
803
+ }
804
+ protoOf(IosReleaseSource).abi = function (version, $completion) {
805
+ var tmp = new $resolveCOROUTINE$(this, version, $completion);
806
+ tmp.y8_1 = Unit_instance;
807
+ tmp.z8_1 = null;
808
+ return tmp.e9();
809
+ };
810
+ function Found(version, downloadUrl) {
811
+ this.bbi_1 = version;
812
+ this.cbi_1 = downloadUrl;
813
+ }
814
+ protoOf(Found).toString = function () {
815
+ return 'Found(version=' + this.bbi_1 + ', downloadUrl=' + this.cbi_1 + ')';
816
+ };
817
+ protoOf(Found).hashCode = function () {
818
+ var result = getStringHashCode(this.bbi_1);
819
+ result = imul(result, 31) + getStringHashCode(this.cbi_1) | 0;
820
+ return result;
821
+ };
822
+ protoOf(Found).equals = function (other) {
823
+ if (this === other)
824
+ return true;
825
+ if (!(other instanceof Found))
826
+ return false;
827
+ if (!(this.bbi_1 === other.bbi_1))
828
+ return false;
829
+ if (!(this.cbi_1 === other.cbi_1))
830
+ return false;
831
+ return true;
832
+ };
833
+ function Failed_1(message) {
834
+ this.dbi_1 = message;
835
+ }
836
+ protoOf(Failed_1).toString = function () {
837
+ return 'Failed(message=' + this.dbi_1 + ')';
838
+ };
839
+ protoOf(Failed_1).hashCode = function () {
840
+ return getStringHashCode(this.dbi_1);
841
+ };
842
+ protoOf(Failed_1).equals = function (other) {
843
+ if (this === other)
844
+ return true;
845
+ if (!(other instanceof Failed_1))
846
+ return false;
847
+ if (!(this.dbi_1 === other.dbi_1))
848
+ return false;
849
+ return true;
850
+ };
851
+ function Body(value) {
852
+ this.wbh_1 = value;
853
+ }
854
+ protoOf(Body).toString = function () {
855
+ return 'Body(value=' + this.wbh_1 + ')';
856
+ };
857
+ protoOf(Body).hashCode = function () {
858
+ return getStringHashCode(this.wbh_1);
859
+ };
860
+ protoOf(Body).equals = function (other) {
861
+ if (this === other)
862
+ return true;
863
+ if (!(other instanceof Body))
864
+ return false;
865
+ if (!(this.wbh_1 === other.wbh_1))
866
+ return false;
867
+ return true;
868
+ };
869
+ function Failed_2(message) {
870
+ this.xbh_1 = message;
871
+ }
872
+ protoOf(Failed_2).toString = function () {
873
+ return 'Failed(message=' + this.xbh_1 + ')';
874
+ };
875
+ protoOf(Failed_2).hashCode = function () {
876
+ return getStringHashCode(this.xbh_1);
877
+ };
878
+ protoOf(Failed_2).equals = function (other) {
879
+ if (this === other)
880
+ return true;
881
+ if (!(other instanceof Failed_2))
882
+ return false;
883
+ if (!(this.xbh_1 === other.xbh_1))
884
+ return false;
885
+ return true;
886
+ };
887
+ function contentOrNullSafe(_this__u8e3s4) {
888
+ // Inline function 'kotlin.takeIf' call
889
+ var this_0 = _this__u8e3s4.d38();
890
+ var tmp;
891
+ var tmp_0;
892
+ // Inline function 'kotlin.text.isNotBlank' call
893
+ if (!isBlank(this_0)) {
894
+ tmp_0 = !(this_0 === 'null');
895
+ } else {
896
+ tmp_0 = false;
897
+ }
898
+ if (tmp_0) {
899
+ tmp = this_0;
900
+ } else {
901
+ tmp = null;
902
+ }
903
+ return tmp;
904
+ }
905
+ function assetName(_this__u8e3s4) {
906
+ var tmp0_safe_receiver = _this__u8e3s4.xd('name');
907
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : get_jsonPrimitive(tmp0_safe_receiver);
908
+ // Inline function 'kotlin.text.orEmpty' call
909
+ var tmp0_elvis_lhs = tmp1_safe_receiver == null ? null : contentOrNullSafe(tmp1_safe_receiver);
910
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
911
+ }
912
+ function supportsArm64($this, home, $completion) {
913
+ var tmp = new $supportsArm64COROUTINE$($this, home, $completion);
914
+ tmp.y8_1 = Unit_instance;
915
+ tmp.z8_1 = null;
916
+ return tmp.e9();
917
+ }
918
+ function resolveSource($this, request, root, $completion) {
919
+ var tmp = new $resolveSourceCOROUTINE$($this, request, root, $completion);
920
+ tmp.y8_1 = Unit_instance;
921
+ tmp.z8_1 = null;
922
+ return tmp.e9();
923
+ }
924
+ function download($this, source, root, $completion) {
925
+ var tmp = new $downloadCOROUTINE$($this, source, root, $completion);
926
+ tmp.y8_1 = Unit_instance;
927
+ tmp.z8_1 = null;
928
+ return tmp.e9();
929
+ }
930
+ function unpack($this, archive, staging, root, version, $completion) {
931
+ var tmp = new $unpackCOROUTINE$($this, archive, staging, root, version, $completion);
932
+ tmp.y8_1 = Unit_instance;
933
+ tmp.z8_1 = null;
934
+ return tmp.e9();
935
+ }
936
+ function activate($this, toolDirectory, root, version, $completion) {
937
+ var tmp = new $activateCOROUTINE$($this, toolDirectory, root, version, $completion);
938
+ tmp.y8_1 = Unit_instance;
939
+ tmp.z8_1 = null;
940
+ return tmp.e9();
941
+ }
942
+ function findToolDirectory($this, unpacked) {
943
+ if ($this.tbk_1.v4y($this.tbk_1.k4z(unpacked, 'dsbuilder-ios'))) {
944
+ return unpacked;
945
+ }
946
+ // Inline function 'kotlin.collections.filter' call
947
+ var tmp0 = $this.tbk_1.f5o(unpacked);
948
+ // Inline function 'kotlin.collections.filterTo' call
949
+ var destination = ArrayList_init_$Create$();
950
+ var _iterator__ex2g4s = tmp0.l();
951
+ while (_iterator__ex2g4s.m()) {
952
+ var element = _iterator__ex2g4s.n();
953
+ if ($this.tbk_1.g5o(element)) {
954
+ destination.j(element);
955
+ }
956
+ }
957
+ var tmp$ret$4;
958
+ $l$block: {
959
+ // Inline function 'kotlin.collections.firstOrNull' call
960
+ var _iterator__ex2g4s_0 = destination.l();
961
+ while (_iterator__ex2g4s_0.m()) {
962
+ var element_0 = _iterator__ex2g4s_0.n();
963
+ if ($this.tbk_1.v4y($this.tbk_1.k4z(element_0, 'dsbuilder-ios'))) {
964
+ tmp$ret$4 = element_0;
965
+ break $l$block;
966
+ }
967
+ }
968
+ tmp$ret$4 = null;
969
+ }
970
+ return tmp$ret$4;
971
+ }
972
+ function remove($this, path, root, $completion) {
973
+ var tmp = new $removeCOROUTINE$($this, path, root, $completion);
974
+ tmp.y8_1 = Unit_instance;
975
+ tmp.z8_1 = null;
976
+ return tmp.e9();
977
+ }
978
+ function run($this, executable, args, workingDirectory, $completion) {
979
+ var tmp = new $runCOROUTINE$_0($this, executable, args, workingDirectory, $completion);
980
+ tmp.y8_1 = Unit_instance;
981
+ tmp.z8_1 = null;
982
+ return tmp.e9();
983
+ }
984
+ function versionFromArchiveName($this, archive) {
985
+ var name = removeSuffix(substringAfterLast(archive, _Char___init__impl__6a9atx(47)), '.zip');
986
+ // Inline function 'kotlin.takeIf' call
987
+ var this_0 = removePrefix(name, 'dsbuilder-ios-cli-');
988
+ var tmp;
989
+ var tmp_0;
990
+ // Inline function 'kotlin.text.isNotBlank' call
991
+ if (!isBlank(this_0)) {
992
+ tmp_0 = !(this_0 === name);
993
+ } else {
994
+ tmp_0 = false;
995
+ }
996
+ if (tmp_0) {
997
+ tmp = this_0;
998
+ } else {
999
+ tmp = null;
1000
+ }
1001
+ var tmp0_elvis_lhs = tmp;
1002
+ return tmp0_elvis_lhs == null ? 'local' : tmp0_elvis_lhs;
1003
+ }
1004
+ function Companion_0() {
1005
+ this.vbl_1 = -1;
1006
+ }
1007
+ var Companion_instance_0;
1008
+ function Companion_getInstance_1() {
1009
+ return Companion_instance_0;
1010
+ }
1011
+ function $installCOROUTINE$(_this__u8e3s4, request, resultContinuation) {
1012
+ CoroutineImpl.call(this, resultContinuation);
1013
+ this.ebm_1 = _this__u8e3s4;
1014
+ this.fbm_1 = request;
1015
+ }
1016
+ protoOf($installCOROUTINE$).e9 = function () {
1017
+ var suspendResult = this.y8_1;
1018
+ $sm: do
1019
+ try {
1020
+ var tmp = this.w8_1;
1021
+ switch (tmp) {
1022
+ case 0:
1023
+ this.x8_1 = 6;
1024
+ var tmp_0 = this;
1025
+ var tmp0_safe_receiver = this.ebm_1.ubk_1.xd('HOME');
1026
+ var tmp_1;
1027
+ if (tmp0_safe_receiver == null) {
1028
+ tmp_1 = null;
1029
+ } else {
1030
+ var tmp_2;
1031
+ if (!isBlank(tmp0_safe_receiver)) {
1032
+ tmp_2 = tmp0_safe_receiver;
1033
+ } else {
1034
+ tmp_2 = null;
1035
+ }
1036
+ tmp_1 = tmp_2;
1037
+ }
1038
+
1039
+ var tmp1_elvis_lhs = tmp_1;
1040
+ var tmp_3;
1041
+ if (tmp1_elvis_lhs == null) {
1042
+ return new Failed_0('Cannot install the toolchain: HOME is not set.');
1043
+ } else {
1044
+ tmp_3 = tmp1_elvis_lhs;
1045
+ }
1046
+
1047
+ tmp_0.ibm_1 = tmp_3;
1048
+ this.w8_1 = 1;
1049
+ suspendResult = supportsArm64(this.ebm_1, this.ibm_1, this);
1050
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1051
+ return suspendResult;
1052
+ }
1053
+
1054
+ continue $sm;
1055
+ case 1:
1056
+ if (!suspendResult) {
1057
+ return new Failed_0('The published dsbuilder-ios CLI requires Apple Silicon (arm64); it cannot be installed on this Mac.');
1058
+ } else {
1059
+ this.w8_1 = 2;
1060
+ continue $sm;
1061
+ }
1062
+
1063
+ case 2:
1064
+ this.hbm_1 = this.ebm_1.tbk_1.k4z(this.ibm_1, '.dsbuilder/toolchains/ios');
1065
+ this.ebm_1.tbk_1.w4y(this.hbm_1);
1066
+ this.w8_1 = 3;
1067
+ suspendResult = resolveSource(this.ebm_1, this.fbm_1, this.hbm_1, this);
1068
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1069
+ return suspendResult;
1070
+ }
1071
+
1072
+ continue $sm;
1073
+ case 3:
1074
+ var source = suspendResult;
1075
+ if (source instanceof Failed_3) {
1076
+ this.gbm_1 = new Failed_0(source.jbm_1);
1077
+ this.w8_1 = 5;
1078
+ continue $sm;
1079
+ } else {
1080
+ if (source instanceof Resolved) {
1081
+ this.w8_1 = 4;
1082
+ suspendResult = download(this.ebm_1, source, this.hbm_1, this);
1083
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1084
+ return suspendResult;
1085
+ }
1086
+ continue $sm;
1087
+ } else {
1088
+ var tmp_4 = this;
1089
+ noWhenBranchMatchedException();
1090
+ }
1091
+ }
1092
+
1093
+ break;
1094
+ case 4:
1095
+ this.gbm_1 = suspendResult;
1096
+ this.w8_1 = 5;
1097
+ continue $sm;
1098
+ case 5:
1099
+ return this.gbm_1;
1100
+ case 6:
1101
+ throw this.z8_1;
1102
+ }
1103
+ } catch ($p) {
1104
+ var e = $p;
1105
+ if (this.x8_1 === 6) {
1106
+ throw e;
1107
+ } else {
1108
+ this.w8_1 = this.x8_1;
1109
+ this.z8_1 = e;
1110
+ }
1111
+ }
1112
+ while (true);
1113
+ };
1114
+ function $supportsArm64COROUTINE$(_this__u8e3s4, home, resultContinuation) {
1115
+ CoroutineImpl.call(this, resultContinuation);
1116
+ this.mbi_1 = _this__u8e3s4;
1117
+ this.nbi_1 = home;
1118
+ }
1119
+ protoOf($supportsArm64COROUTINE$).e9 = function () {
1120
+ var suspendResult = this.y8_1;
1121
+ $sm: do
1122
+ try {
1123
+ var tmp = this.w8_1;
1124
+ switch (tmp) {
1125
+ case 0:
1126
+ this.x8_1 = 3;
1127
+ this.x8_1 = 2;
1128
+ this.w8_1 = 1;
1129
+ suspendResult = this.mbi_1.sbk_1.j5o(new ProcessRequest('/usr/sbin/sysctl', listOf_0(['-n', 'hw.optional.arm64']), this.nbi_1, VOID, false), this);
1130
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1131
+ return suspendResult;
1132
+ }
1133
+
1134
+ continue $sm;
1135
+ case 1:
1136
+ var result = suspendResult;
1137
+ var tmp_0 = this;
1138
+ var tmp_1;
1139
+ if (result.k5o_1 === 0) {
1140
+ var this_0 = result.l5o_1;
1141
+ tmp_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) === '1';
1142
+ } else {
1143
+ tmp_1 = false;
1144
+ }
1145
+
1146
+ tmp_0.obi_1 = tmp_1;
1147
+ this.x8_1 = 3;
1148
+ this.w8_1 = 4;
1149
+ continue $sm;
1150
+ case 2:
1151
+ this.x8_1 = 3;
1152
+ var tmp_2 = this.z8_1;
1153
+ if (tmp_2 instanceof ProcessLaunchException) {
1154
+ var _unused_var__etf5q3 = this.z8_1;
1155
+ var tmp_3 = this;
1156
+ tmp_3.obi_1 = false;
1157
+ this.w8_1 = 4;
1158
+ continue $sm;
1159
+ } else {
1160
+ throw this.z8_1;
1161
+ }
1162
+
1163
+ case 3:
1164
+ throw this.z8_1;
1165
+ case 4:
1166
+ this.x8_1 = 3;
1167
+ return this.obi_1;
1168
+ }
1169
+ } catch ($p) {
1170
+ var e = $p;
1171
+ if (this.x8_1 === 3) {
1172
+ throw e;
1173
+ } else {
1174
+ this.w8_1 = this.x8_1;
1175
+ this.z8_1 = e;
1176
+ }
1177
+ }
1178
+ while (true);
1179
+ };
1180
+ function $resolveSourceCOROUTINE$(_this__u8e3s4, request, root, resultContinuation) {
1181
+ CoroutineImpl.call(this, resultContinuation);
1182
+ this.xbi_1 = _this__u8e3s4;
1183
+ this.ybi_1 = request;
1184
+ this.zbi_1 = root;
1185
+ }
1186
+ protoOf($resolveSourceCOROUTINE$).e9 = function () {
1187
+ var suspendResult = this.y8_1;
1188
+ $sm: do
1189
+ try {
1190
+ var tmp = this.w8_1;
1191
+ switch (tmp) {
1192
+ case 0:
1193
+ this.x8_1 = 3;
1194
+ var tmp0_elvis_lhs = this.ybi_1.c67_1;
1195
+ if (tmp0_elvis_lhs == null) {
1196
+ this.w8_1 = 1;
1197
+ suspendResult = this.xbi_1.vbk_1(this.zbi_1).abi(this.ybi_1.b67_1, this);
1198
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1199
+ return suspendResult;
1200
+ }
1201
+ continue $sm;
1202
+ } else {
1203
+ this.abj_1 = tmp0_elvis_lhs;
1204
+ this.w8_1 = 2;
1205
+ continue $sm;
1206
+ }
1207
+
1208
+ case 1:
1209
+ var release = suspendResult;
1210
+ var tmp_0 = this;
1211
+ var tmp_1;
1212
+ if (release instanceof Failed_1) {
1213
+ tmp_1 = new Failed_3(release.dbi_1);
1214
+ } else {
1215
+ if (release instanceof Found) {
1216
+ tmp_1 = new Resolved(release.bbi_1, release.cbi_1, true);
1217
+ } else {
1218
+ noWhenBranchMatchedException();
1219
+ }
1220
+ }
1221
+
1222
+ return tmp_1;
1223
+ case 2:
1224
+ var archive = this.abj_1;
1225
+ var tmp1_elvis_lhs = this.ybi_1.b67_1;
1226
+ var version = tmp1_elvis_lhs == null ? versionFromArchiveName(this.xbi_1, archive) : tmp1_elvis_lhs;
1227
+ var remote = startsWith(archive, 'http://') || startsWith(archive, 'https://');
1228
+ if (!remote && !this.xbi_1.tbk_1.v4y(archive)) {
1229
+ return new Failed_3('Archive ' + archive + ' does not exist.');
1230
+ }
1231
+
1232
+ return new Resolved(version, archive, remote);
1233
+ case 3:
1234
+ throw this.z8_1;
1235
+ }
1236
+ } catch ($p) {
1237
+ var e = $p;
1238
+ if (this.x8_1 === 3) {
1239
+ throw e;
1240
+ } else {
1241
+ this.w8_1 = this.x8_1;
1242
+ this.z8_1 = e;
1243
+ }
1244
+ }
1245
+ while (true);
1246
+ };
1247
+ function $downloadCOROUTINE$(_this__u8e3s4, source, root, resultContinuation) {
1248
+ CoroutineImpl.call(this, resultContinuation);
1249
+ this.jbj_1 = _this__u8e3s4;
1250
+ this.kbj_1 = source;
1251
+ this.lbj_1 = root;
1252
+ }
1253
+ protoOf($downloadCOROUTINE$).e9 = function () {
1254
+ var suspendResult = this.y8_1;
1255
+ $sm: do
1256
+ try {
1257
+ var tmp = this.w8_1;
1258
+ switch (tmp) {
1259
+ case 0:
1260
+ this.x8_1 = 7;
1261
+ this.nbj_1 = this.jbj_1.tbk_1.k4z(this.lbj_1, '.staging');
1262
+ this.w8_1 = 1;
1263
+ suspendResult = remove(this.jbj_1, this.nbj_1, this.lbj_1, this);
1264
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1265
+ return suspendResult;
1266
+ }
1267
+
1268
+ continue $sm;
1269
+ case 1:
1270
+ this.jbj_1.tbk_1.w4y(this.nbj_1);
1271
+ if (!this.kbj_1.mbm_1) {
1272
+ this.w8_1 = 6;
1273
+ suspendResult = unpack(this.jbj_1, this.kbj_1.lbm_1, this.nbj_1, this.lbj_1, this.kbj_1.kbm_1, this);
1274
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1275
+ return suspendResult;
1276
+ }
1277
+ continue $sm;
1278
+ } else {
1279
+ this.w8_1 = 2;
1280
+ continue $sm;
1281
+ }
1282
+
1283
+ case 2:
1284
+ this.obj_1 = this.jbj_1.tbk_1.k4z(this.nbj_1, 'dsbuilder-ios-cli.zip');
1285
+ var arguments_0 = listOf_0(['--fail', '--silent', '--show-error', '--location', '--output', this.obj_1, this.kbj_1.lbm_1]);
1286
+ this.w8_1 = 3;
1287
+ suspendResult = run(this.jbj_1, '/usr/bin/curl', arguments_0, this.lbj_1, this);
1288
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1289
+ return suspendResult;
1290
+ }
1291
+
1292
+ continue $sm;
1293
+ case 3:
1294
+ var fetched = suspendResult;
1295
+ if (fetched.nbm_1 === 0) {
1296
+ this.w8_1 = 4;
1297
+ suspendResult = unpack(this.jbj_1, this.obj_1, this.nbj_1, this.lbj_1, this.kbj_1.kbm_1, this);
1298
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1299
+ return suspendResult;
1300
+ }
1301
+ continue $sm;
1302
+ } else {
1303
+ var tmp_0 = this;
1304
+ tmp_0.mbj_1 = new Failed_0('Cannot download ' + this.kbj_1.lbm_1 + ': ' + fetched.pbm());
1305
+ this.w8_1 = 5;
1306
+ continue $sm;
1307
+ }
1308
+
1309
+ case 4:
1310
+ this.mbj_1 = suspendResult;
1311
+ this.w8_1 = 5;
1312
+ continue $sm;
1313
+ case 5:
1314
+ return this.mbj_1;
1315
+ case 6:
1316
+ return suspendResult;
1317
+ case 7:
1318
+ throw this.z8_1;
1319
+ }
1320
+ } catch ($p) {
1321
+ var e = $p;
1322
+ if (this.x8_1 === 7) {
1323
+ throw e;
1324
+ } else {
1325
+ this.w8_1 = this.x8_1;
1326
+ this.z8_1 = e;
1327
+ }
1328
+ }
1329
+ while (true);
1330
+ };
1331
+ function $unpackCOROUTINE$(_this__u8e3s4, archive, staging, root, version, resultContinuation) {
1332
+ CoroutineImpl.call(this, resultContinuation);
1333
+ this.xbj_1 = _this__u8e3s4;
1334
+ this.ybj_1 = archive;
1335
+ this.zbj_1 = staging;
1336
+ this.abk_1 = root;
1337
+ this.bbk_1 = version;
1338
+ }
1339
+ protoOf($unpackCOROUTINE$).e9 = function () {
1340
+ var suspendResult = this.y8_1;
1341
+ $sm: do
1342
+ try {
1343
+ var tmp = this.w8_1;
1344
+ switch (tmp) {
1345
+ case 0:
1346
+ this.x8_1 = 3;
1347
+ this.cbk_1 = this.xbj_1.tbk_1.k4z(this.zbj_1, 'unpacked');
1348
+ this.w8_1 = 1;
1349
+ suspendResult = run(this.xbj_1, '/usr/bin/unzip', listOf_0(['-o', '-q', this.ybj_1, '-d', this.cbk_1]), this.abk_1, this);
1350
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1351
+ return suspendResult;
1352
+ }
1353
+
1354
+ continue $sm;
1355
+ case 1:
1356
+ var extracted = suspendResult;
1357
+ if (!(extracted.nbm_1 === 0)) {
1358
+ return new Failed_0('Cannot unpack ' + this.ybj_1 + ': ' + extracted.pbm());
1359
+ }
1360
+
1361
+ var tmp0_elvis_lhs = findToolDirectory(this.xbj_1, this.cbk_1);
1362
+ var tmp_0;
1363
+ if (tmp0_elvis_lhs == null) {
1364
+ return new Failed_0('Archive ' + this.ybj_1 + ' has no dsbuilder-ios inside.');
1365
+ } else {
1366
+ tmp_0 = tmp0_elvis_lhs;
1367
+ }
1368
+
1369
+ var toolDirectory = tmp_0;
1370
+ this.w8_1 = 2;
1371
+ suspendResult = activate(this.xbj_1, toolDirectory, this.abk_1, this.bbk_1, this);
1372
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1373
+ return suspendResult;
1374
+ }
1375
+
1376
+ continue $sm;
1377
+ case 2:
1378
+ return suspendResult;
1379
+ case 3:
1380
+ throw this.z8_1;
1381
+ }
1382
+ } catch ($p) {
1383
+ var e = $p;
1384
+ if (this.x8_1 === 3) {
1385
+ throw e;
1386
+ } else {
1387
+ this.w8_1 = this.x8_1;
1388
+ this.z8_1 = e;
1389
+ }
1390
+ }
1391
+ while (true);
1392
+ };
1393
+ function $activateCOROUTINE$(_this__u8e3s4, toolDirectory, root, version, resultContinuation) {
1394
+ CoroutineImpl.call(this, resultContinuation);
1395
+ this.lbk_1 = _this__u8e3s4;
1396
+ this.mbk_1 = toolDirectory;
1397
+ this.nbk_1 = root;
1398
+ this.obk_1 = version;
1399
+ }
1400
+ protoOf($activateCOROUTINE$).e9 = function () {
1401
+ var suspendResult = this.y8_1;
1402
+ $sm: do
1403
+ try {
1404
+ var tmp = this.w8_1;
1405
+ switch (tmp) {
1406
+ case 0:
1407
+ this.x8_1 = 7;
1408
+ this.qbk_1 = this.lbk_1.tbk_1.k4z(this.nbk_1, this.obk_1);
1409
+ this.w8_1 = 1;
1410
+ suspendResult = remove(this.lbk_1, this.qbk_1, this.nbk_1, this);
1411
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1412
+ return suspendResult;
1413
+ }
1414
+
1415
+ continue $sm;
1416
+ case 1:
1417
+ this.w8_1 = 2;
1418
+ suspendResult = run(this.lbk_1, '/bin/mv', listOf_0([this.mbk_1, this.qbk_1]), this.nbk_1, this);
1419
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1420
+ return suspendResult;
1421
+ }
1422
+
1423
+ continue $sm;
1424
+ case 2:
1425
+ var moved = suspendResult;
1426
+ if (!(moved.nbm_1 === 0)) {
1427
+ return new Failed_0('Cannot install into ' + this.qbk_1 + ': ' + moved.pbm());
1428
+ }
1429
+
1430
+ this.pbk_1 = this.lbk_1.tbk_1.k4z(this.qbk_1, 'dsbuilder-ios');
1431
+ this.w8_1 = 3;
1432
+ suspendResult = run(this.lbk_1, '/bin/chmod', listOf_0(['+x', this.pbk_1]), this.nbk_1, this);
1433
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1434
+ return suspendResult;
1435
+ }
1436
+
1437
+ continue $sm;
1438
+ case 3:
1439
+ this.rbk_1 = this.lbk_1.tbk_1.k4z(this.nbk_1, 'current');
1440
+ this.w8_1 = 4;
1441
+ suspendResult = remove(this.lbk_1, this.rbk_1, this.nbk_1, this);
1442
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1443
+ return suspendResult;
1444
+ }
1445
+
1446
+ continue $sm;
1447
+ case 4:
1448
+ this.w8_1 = 5;
1449
+ suspendResult = run(this.lbk_1, '/bin/ln', listOf_0(['-s', this.qbk_1, this.rbk_1]), this.nbk_1, this);
1450
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1451
+ return suspendResult;
1452
+ }
1453
+
1454
+ continue $sm;
1455
+ case 5:
1456
+ var linked = suspendResult;
1457
+ if (!(linked.nbm_1 === 0)) {
1458
+ return new Failed_0('Cannot point current at ' + this.qbk_1 + ': ' + linked.pbm());
1459
+ }
1460
+
1461
+ this.w8_1 = 6;
1462
+ suspendResult = remove(this.lbk_1, this.lbk_1.tbk_1.k4z(this.nbk_1, '.staging'), this.nbk_1, this);
1463
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1464
+ return suspendResult;
1465
+ }
1466
+
1467
+ continue $sm;
1468
+ case 6:
1469
+ return new Installed(this.obk_1, this.pbk_1);
1470
+ case 7:
1471
+ throw this.z8_1;
1472
+ }
1473
+ } catch ($p) {
1474
+ var e = $p;
1475
+ if (this.x8_1 === 7) {
1476
+ throw e;
1477
+ } else {
1478
+ this.w8_1 = this.x8_1;
1479
+ this.z8_1 = e;
1480
+ }
1481
+ }
1482
+ while (true);
1483
+ };
1484
+ function $removeCOROUTINE$(_this__u8e3s4, path, root, resultContinuation) {
1485
+ CoroutineImpl.call(this, resultContinuation);
1486
+ this.fbl_1 = _this__u8e3s4;
1487
+ this.gbl_1 = path;
1488
+ this.hbl_1 = root;
1489
+ }
1490
+ protoOf($removeCOROUTINE$).e9 = function () {
1491
+ var suspendResult = this.y8_1;
1492
+ $sm: do
1493
+ try {
1494
+ var tmp = this.w8_1;
1495
+ switch (tmp) {
1496
+ case 0:
1497
+ this.x8_1 = 3;
1498
+ if (startsWith(this.gbl_1, this.hbl_1 + '/')) {
1499
+ this.w8_1 = 1;
1500
+ suspendResult = run(this.fbl_1, '/bin/rm', listOf_0(['-rf', this.gbl_1]), this.hbl_1, this);
1501
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1502
+ return suspendResult;
1503
+ }
1504
+ continue $sm;
1505
+ } else {
1506
+ this.w8_1 = 2;
1507
+ continue $sm;
1508
+ }
1509
+
1510
+ case 1:
1511
+ this.w8_1 = 2;
1512
+ continue $sm;
1513
+ case 2:
1514
+ return Unit_instance;
1515
+ case 3:
1516
+ throw this.z8_1;
1517
+ }
1518
+ } catch ($p) {
1519
+ var e = $p;
1520
+ if (this.x8_1 === 3) {
1521
+ throw e;
1522
+ } else {
1523
+ this.w8_1 = this.x8_1;
1524
+ this.z8_1 = e;
1525
+ }
1526
+ }
1527
+ while (true);
1528
+ };
1529
+ function $runCOROUTINE$_0(_this__u8e3s4, executable, args, workingDirectory, resultContinuation) {
1530
+ CoroutineImpl.call(this, resultContinuation);
1531
+ this.qbl_1 = _this__u8e3s4;
1532
+ this.rbl_1 = executable;
1533
+ this.sbl_1 = args;
1534
+ this.tbl_1 = workingDirectory;
1535
+ }
1536
+ protoOf($runCOROUTINE$_0).e9 = function () {
1537
+ var suspendResult = this.y8_1;
1538
+ $sm: do
1539
+ try {
1540
+ var tmp = this.w8_1;
1541
+ switch (tmp) {
1542
+ case 0:
1543
+ this.x8_1 = 4;
1544
+ this.qbl_1.tbk_1.w4y(this.tbl_1);
1545
+ this.x8_1 = 2;
1546
+ this.w8_1 = 1;
1547
+ suspendResult = this.qbl_1.sbk_1.j5o(new ProcessRequest(this.rbl_1, this.sbl_1, this.tbl_1, VOID, false), this);
1548
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1549
+ return suspendResult;
1550
+ }
1551
+
1552
+ continue $sm;
1553
+ case 1:
1554
+ var result = suspendResult;
1555
+ this.ubl_1 = new RunResult(result.k5o_1, result.l5o_1);
1556
+ this.x8_1 = 4;
1557
+ this.w8_1 = 3;
1558
+ continue $sm;
1559
+ case 2:
1560
+ this.x8_1 = 4;
1561
+ var tmp_0 = this.z8_1;
1562
+ if (tmp_0 instanceof ProcessLaunchException) {
1563
+ var error = this.z8_1;
1564
+ var tmp_1 = this;
1565
+ tmp_1.ubl_1 = new RunResult(-1, this.rbl_1 + ' cannot be started: ' + error.message);
1566
+ this.w8_1 = 3;
1567
+ continue $sm;
1568
+ } else {
1569
+ throw this.z8_1;
1570
+ }
1571
+
1572
+ case 3:
1573
+ this.x8_1 = 4;
1574
+ return this.ubl_1;
1575
+ case 4:
1576
+ throw this.z8_1;
1577
+ }
1578
+ } catch ($p) {
1579
+ var e = $p;
1580
+ if (this.x8_1 === 4) {
1581
+ throw e;
1582
+ } else {
1583
+ this.w8_1 = this.x8_1;
1584
+ this.z8_1 = e;
1585
+ }
1586
+ }
1587
+ while (true);
1588
+ };
1589
+ function IosToolchainInstaller(processRunner, fileSystem, environmentReader, releaseSource) {
1590
+ this.sbk_1 = processRunner;
1591
+ this.tbk_1 = fileSystem;
1592
+ this.ubk_1 = environmentReader;
1593
+ this.vbk_1 = releaseSource;
1594
+ this.wbk_1 = _ToolchainId___init__impl__eu7bv9('ios');
1595
+ }
1596
+ protoOf(IosToolchainInstaller).t64 = function () {
1597
+ return this.wbk_1;
1598
+ };
1599
+ protoOf(IosToolchainInstaller).sbd = function (request, $completion) {
1600
+ var tmp = new $installCOROUTINE$(this, request, $completion);
1601
+ tmp.y8_1 = Unit_instance;
1602
+ tmp.z8_1 = null;
1603
+ return tmp.e9();
1604
+ };
1605
+ function Resolved(version, url, remote) {
1606
+ this.kbm_1 = version;
1607
+ this.lbm_1 = url;
1608
+ this.mbm_1 = remote;
1609
+ }
1610
+ protoOf(Resolved).toString = function () {
1611
+ return 'Resolved(version=' + this.kbm_1 + ', url=' + this.lbm_1 + ', remote=' + this.mbm_1 + ')';
1612
+ };
1613
+ protoOf(Resolved).hashCode = function () {
1614
+ var result = getStringHashCode(this.kbm_1);
1615
+ result = imul(result, 31) + getStringHashCode(this.lbm_1) | 0;
1616
+ result = imul(result, 31) + getBooleanHashCode(this.mbm_1) | 0;
1617
+ return result;
1618
+ };
1619
+ protoOf(Resolved).equals = function (other) {
1620
+ if (this === other)
1621
+ return true;
1622
+ if (!(other instanceof Resolved))
1623
+ return false;
1624
+ if (!(this.kbm_1 === other.kbm_1))
1625
+ return false;
1626
+ if (!(this.lbm_1 === other.lbm_1))
1627
+ return false;
1628
+ if (!(this.mbm_1 === other.mbm_1))
1629
+ return false;
1630
+ return true;
1631
+ };
1632
+ function Failed_3(message) {
1633
+ this.jbm_1 = message;
1634
+ }
1635
+ protoOf(Failed_3).toString = function () {
1636
+ return 'Failed(message=' + this.jbm_1 + ')';
1637
+ };
1638
+ protoOf(Failed_3).hashCode = function () {
1639
+ return getStringHashCode(this.jbm_1);
1640
+ };
1641
+ protoOf(Failed_3).equals = function (other) {
1642
+ if (this === other)
1643
+ return true;
1644
+ if (!(other instanceof Failed_3))
1645
+ return false;
1646
+ if (!(this.jbm_1 === other.jbm_1))
1647
+ return false;
1648
+ return true;
1649
+ };
1650
+ function RunResult(exitCode, output) {
1651
+ this.nbm_1 = exitCode;
1652
+ this.obm_1 = output;
1653
+ }
1654
+ protoOf(RunResult).pbm = function () {
1655
+ // Inline function 'kotlin.text.trim' call
1656
+ var this_0 = this.obm_1;
1657
+ // Inline function 'kotlin.text.ifBlank' call
1658
+ var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1659
+ var tmp;
1660
+ if (isBlank(this_1)) {
1661
+ tmp = 'exit code ' + this.nbm_1;
1662
+ } else {
1663
+ tmp = this_1;
1664
+ }
1665
+ return tmp;
1666
+ };
1667
+ protoOf(RunResult).toString = function () {
1668
+ return 'RunResult(exitCode=' + this.nbm_1 + ', output=' + this.obm_1 + ')';
1669
+ };
1670
+ protoOf(RunResult).hashCode = function () {
1671
+ var result = this.nbm_1;
1672
+ result = imul(result, 31) + getStringHashCode(this.obm_1) | 0;
1673
+ return result;
1674
+ };
1675
+ protoOf(RunResult).equals = function (other) {
1676
+ if (this === other)
1677
+ return true;
1678
+ if (!(other instanceof RunResult))
1679
+ return false;
1680
+ if (!(this.nbm_1 === other.nbm_1))
1681
+ return false;
1682
+ if (!(this.obm_1 === other.obm_1))
1683
+ return false;
1684
+ return true;
1685
+ };
1686
+ function environmentTool($this) {
1687
+ var tmp0_safe_receiver = $this.wbf_1.xd('DSBUILDER_IOS_TOOL');
1688
+ var tmp;
1689
+ if (tmp0_safe_receiver == null) {
1690
+ tmp = null;
1691
+ } else {
1692
+ // Inline function 'kotlin.takeIf' call
1693
+ var tmp_0;
1694
+ var tmp_1;
1695
+ // Inline function 'kotlin.text.isNotBlank' call
1696
+ if (!isBlank(tmp0_safe_receiver)) {
1697
+ tmp_1 = $this.vbf_1.v4y(tmp0_safe_receiver);
1698
+ } else {
1699
+ tmp_1 = false;
1700
+ }
1701
+ if (tmp_1) {
1702
+ tmp_0 = tmp0_safe_receiver;
1703
+ } else {
1704
+ tmp_0 = null;
1705
+ }
1706
+ tmp = tmp_0;
1707
+ }
1708
+ return tmp;
1709
+ }
1710
+ function managedTool($this) {
1711
+ var tmp0_safe_receiver = $this.wbf_1.xd('HOME');
1712
+ var tmp;
1713
+ if (tmp0_safe_receiver == null) {
1714
+ tmp = null;
1715
+ } else {
1716
+ // Inline function 'kotlin.takeIf' call
1717
+ var tmp_0;
1718
+ // Inline function 'kotlin.text.isNotBlank' call
1719
+ if (!isBlank(tmp0_safe_receiver)) {
1720
+ tmp_0 = tmp0_safe_receiver;
1721
+ } else {
1722
+ tmp_0 = null;
1723
+ }
1724
+ tmp = tmp_0;
1725
+ }
1726
+ var tmp1_safe_receiver = tmp;
1727
+ var tmp_1;
1728
+ if (tmp1_safe_receiver == null) {
1729
+ tmp_1 = null;
1730
+ } else {
1731
+ // Inline function 'kotlin.let' call
1732
+ tmp_1 = $this.vbf_1.k4z(tmp1_safe_receiver, '.dsbuilder/toolchains/ios/current');
1733
+ }
1734
+ var tmp2_safe_receiver = tmp_1;
1735
+ var tmp_2;
1736
+ if (tmp2_safe_receiver == null) {
1737
+ tmp_2 = null;
1738
+ } else {
1739
+ // Inline function 'kotlin.let' call
1740
+ tmp_2 = $this.vbf_1.k4z(tmp2_safe_receiver, 'dsbuilder-ios');
1741
+ }
1742
+ var tmp3_safe_receiver = tmp_2;
1743
+ var tmp_3;
1744
+ if (tmp3_safe_receiver == null) {
1745
+ tmp_3 = null;
1746
+ } else {
1747
+ // Inline function 'kotlin.takeIf' call
1748
+ var tmp_4;
1749
+ if ($this.vbf_1.v4y(tmp3_safe_receiver)) {
1750
+ tmp_4 = tmp3_safe_receiver;
1751
+ } else {
1752
+ tmp_4 = null;
1753
+ }
1754
+ tmp_3 = tmp_4;
1755
+ }
1756
+ return tmp_3;
1757
+ }
1758
+ function pathTool($this) {
1759
+ var tmp0_safe_receiver = $this.wbf_1.xd('PATH');
1760
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : split(tmp0_safe_receiver, [':']);
1761
+ var tmp;
1762
+ if (tmp1_safe_receiver == null) {
1763
+ tmp = null;
1764
+ } else {
1765
+ // Inline function 'kotlin.collections.filter' call
1766
+ // Inline function 'kotlin.collections.filterTo' call
1767
+ var destination = ArrayList_init_$Create$();
1768
+ var _iterator__ex2g4s = tmp1_safe_receiver.l();
1769
+ while (_iterator__ex2g4s.m()) {
1770
+ var element = _iterator__ex2g4s.n();
1771
+ // Inline function 'kotlin.text.isNotBlank' call
1772
+ if (!isBlank(element)) {
1773
+ destination.j(element);
1774
+ }
1775
+ }
1776
+ tmp = destination;
1777
+ }
1778
+ var tmp2_safe_receiver = tmp;
1779
+ var tmp_0;
1780
+ if (tmp2_safe_receiver == null) {
1781
+ tmp_0 = null;
1782
+ } else {
1783
+ // Inline function 'kotlin.collections.map' call
1784
+ // Inline function 'kotlin.collections.mapTo' call
1785
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp2_safe_receiver, 10));
1786
+ var _iterator__ex2g4s_0 = tmp2_safe_receiver.l();
1787
+ while (_iterator__ex2g4s_0.m()) {
1788
+ var item = _iterator__ex2g4s_0.n();
1789
+ var tmp$ret$4 = $this.vbf_1.k4z(item, 'dsbuilder-ios');
1790
+ destination_0.j(tmp$ret$4);
1791
+ }
1792
+ tmp_0 = destination_0;
1793
+ }
1794
+ var tmp3_safe_receiver = tmp_0;
1795
+ var tmp_1;
1796
+ if (tmp3_safe_receiver == null) {
1797
+ tmp_1 = null;
1798
+ } else {
1799
+ var tmp$ret$8;
1800
+ $l$block: {
1801
+ // Inline function 'kotlin.collections.firstOrNull' call
1802
+ var _iterator__ex2g4s_1 = tmp3_safe_receiver.l();
1803
+ while (_iterator__ex2g4s_1.m()) {
1804
+ var element_0 = _iterator__ex2g4s_1.n();
1805
+ if ($this.vbf_1.v4y(element_0)) {
1806
+ tmp$ret$8 = element_0;
1807
+ break $l$block;
1808
+ }
1809
+ }
1810
+ tmp$ret$8 = null;
1811
+ }
1812
+ tmp_1 = tmp$ret$8;
1813
+ }
1814
+ return tmp_1;
1815
+ }
1816
+ function IosToolchainLocator(fileSystem, environmentReader) {
1817
+ this.vbf_1 = fileSystem;
1818
+ this.wbf_1 = environmentReader;
1819
+ }
1820
+ protoOf(IosToolchainLocator).kbg = function (override) {
1821
+ if (!(override == null)) {
1822
+ // Inline function 'kotlin.takeIf' call
1823
+ var tmp;
1824
+ if (this.vbf_1.v4y(override)) {
1825
+ tmp = override;
1826
+ } else {
1827
+ tmp = null;
1828
+ }
1829
+ return tmp;
1830
+ }
1831
+ var tmp0_elvis_lhs = environmentTool(this);
1832
+ var tmp1_elvis_lhs = tmp0_elvis_lhs == null ? managedTool(this) : tmp0_elvis_lhs;
1833
+ return tmp1_elvis_lhs == null ? pathTool(this) : tmp1_elvis_lhs;
1834
+ };
1835
+ protoOf(IosToolchainLocator).xbf = function () {
1836
+ // Inline function 'kotlin.collections.buildList' call
1837
+ // Inline function 'kotlin.collections.buildListInternal' call
1838
+ // Inline function 'kotlin.apply' call
1839
+ var this_0 = ArrayList_init_$Create$();
1840
+ this_0.j('DSBUILDER_IOS_TOOL env variable');
1841
+ var tmp0_elvis_lhs = managedTool(this);
1842
+ this_0.j(tmp0_elvis_lhs == null ? '~/.dsbuilder/toolchains/ios/current/dsbuilder-ios' : tmp0_elvis_lhs);
1843
+ this_0.j('PATH');
1844
+ return this_0.b5();
1845
+ };
1846
+ //region block: init
1847
+ Companion_instance_0 = new Companion_0();
1848
+ //endregion
1849
+ //region block: exports
1850
+ _.$_$ = _.$_$ || {};
1851
+ _.$_$.a = IosCliDelegate;
1852
+ _.$_$.b = IosToolchainInstaller;
1853
+ _.$_$.c = iosPlatformModule;
1854
+ //endregion
1855
+ return _;
1856
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./design-system-builder-frontend-core-platform.js'), require('./design-system-builder-frontend-core-process.js'), require('./design-system-builder-frontend-core-domain.js'), require('./projects-core-koin-core.js'), require('./design-system-builder-frontend-core-workspace.js'), require('./design-system-builder-frontend-core-auth.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js')));
1857
+
1858
+ //# sourceMappingURL=design-system-builder-frontend-platform-ios.js.map