raspberry_games_server_game_logic 1.8.248

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 (68) hide show
  1. package/Kosi-Kaverit-kaverit.js +339 -0
  2. package/Kosi-Kaverit-kaverit.js.map +1 -0
  3. package/Kosi-Kodein-kodein-di.js +2389 -0
  4. package/Kosi-Kodein-kodein-di.js.map +1 -0
  5. package/Kotlin-DateTime-library-kotlinx-datetime.js +6215 -0
  6. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  7. package/Logic_Debertz-core.js +6885 -0
  8. package/Logic_Debertz-core.js.map +1 -0
  9. package/Logic_Debertz-engine.js +52055 -0
  10. package/Logic_Debertz-engine.js.map +1 -0
  11. package/Logic_Debertz-game_server.d.ts +1918 -0
  12. package/Logic_Debertz-game_server.js +5140 -0
  13. package/Logic_Debertz-game_server.js.map +1 -0
  14. package/kotlin-kotlin-stdlib.js +15597 -0
  15. package/kotlin-kotlin-stdlib.js.map +1 -0
  16. package/kotlin-kotlinx-atomicfu-runtime.js +15 -0
  17. package/kotlin-kotlinx-atomicfu-runtime.js.map +1 -0
  18. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
  19. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
  20. package/kotlinx-atomicfu.js +276 -0
  21. package/kotlinx-atomicfu.js.map +1 -0
  22. package/kotlinx-coroutines-core.js +11628 -0
  23. package/kotlinx-coroutines-core.js.map +1 -0
  24. package/kotlinx-io-kotlinx-io-bytestring.js +15 -0
  25. package/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  26. package/kotlinx-io-kotlinx-io-core.js +1557 -0
  27. package/kotlinx-io-kotlinx-io-core.js.map +1 -0
  28. package/kotlinx-serialization-kotlinx-serialization-core.js +6315 -0
  29. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  30. package/kotlinx-serialization-kotlinx-serialization-json.js +5092 -0
  31. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  32. package/ktor-ktor-client-content-negotiation.js +713 -0
  33. package/ktor-ktor-client-content-negotiation.js.map +1 -0
  34. package/ktor-ktor-client-core.js +7235 -0
  35. package/ktor-ktor-client-core.js.map +1 -0
  36. package/ktor-ktor-client-js.js +15 -0
  37. package/ktor-ktor-client-js.js.map +1 -0
  38. package/ktor-ktor-client-logging.js +1530 -0
  39. package/ktor-ktor-client-logging.js.map +1 -0
  40. package/ktor-ktor-events.js +97 -0
  41. package/ktor-ktor-events.js.map +1 -0
  42. package/ktor-ktor-http.js +3285 -0
  43. package/ktor-ktor-http.js.map +1 -0
  44. package/ktor-ktor-io.js +6463 -0
  45. package/ktor-ktor-io.js.map +1 -0
  46. package/ktor-ktor-serialization-kotlinx-json.js +67 -0
  47. package/ktor-ktor-serialization-kotlinx-json.js.map +1 -0
  48. package/ktor-ktor-serialization-kotlinx.js +893 -0
  49. package/ktor-ktor-serialization-kotlinx.js.map +1 -0
  50. package/ktor-ktor-serialization.js +395 -0
  51. package/ktor-ktor-serialization.js.map +1 -0
  52. package/ktor-ktor-utils.js +2659 -0
  53. package/ktor-ktor-utils.js.map +1 -0
  54. package/ktor-ktor-websocket-serialization.js +15 -0
  55. package/ktor-ktor-websocket-serialization.js.map +1 -0
  56. package/ktor-ktor-websockets.js +466 -0
  57. package/ktor-ktor-websockets.js.map +1 -0
  58. package/package.json +13 -0
  59. package/raspberry-cardgame-lib-core.js +1429 -0
  60. package/raspberry-cardgame-lib-core.js.map +1 -0
  61. package/raspberry-cardgame-lib-logger.js +423 -0
  62. package/raspberry-cardgame-lib-logger.js.map +1 -0
  63. package/raspberry-cardgame-lib-random.js +3060 -0
  64. package/raspberry-cardgame-lib-random.js.map +1 -0
  65. package/secure-random-secure-random.js +173 -0
  66. package/secure-random-secure-random.js.map +1 -0
  67. package/uuid.js +163 -0
  68. package/uuid.js.map +1 -0
@@ -0,0 +1,1429 @@
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-serialization-kotlinx-serialization-core.js', './raspberry-cardgame-lib-random.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./raspberry-cardgame-lib-random.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'raspberry-cardgame-lib-core'.");
9
+ }
10
+ if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-core'] === 'undefined') {
11
+ throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'kotlinx-serialization-kotlinx-serialization-core' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-core' is loaded prior to 'raspberry-cardgame-lib-core'.");
12
+ }
13
+ if (typeof globalThis['raspberry-cardgame-lib-random'] === 'undefined') {
14
+ throw new Error("Error loading module 'raspberry-cardgame-lib-core'. Its dependency 'raspberry-cardgame-lib-random' was not found. Please, check whether 'raspberry-cardgame-lib-random' is loaded prior to 'raspberry-cardgame-lib-core'.");
15
+ }
16
+ globalThis['raspberry-cardgame-lib-core'] = factory(typeof globalThis['raspberry-cardgame-lib-core'] === 'undefined' ? {} : globalThis['raspberry-cardgame-lib-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-serialization-kotlinx-serialization-core'], globalThis['raspberry-cardgame-lib-random']);
17
+ }
18
+ }(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_io_raspberryapps_cardgame_random) {
19
+ 'use strict';
20
+ //region block: imports
21
+ var imul = Math.imul;
22
+ var protoOf = kotlin_kotlin.$_$.uc;
23
+ var initMetadataForObject = kotlin_kotlin.$_$.yb;
24
+ var defineProp = kotlin_kotlin.$_$.kb;
25
+ var THROW_CCE = kotlin_kotlin.$_$.rg;
26
+ var Comparator = kotlin_kotlin.$_$.eg;
27
+ var VOID = kotlin_kotlin.$_$.f;
28
+ var take = kotlin_kotlin.$_$.o9;
29
+ var toList = kotlin_kotlin.$_$.s9;
30
+ var Unit_instance = kotlin_kotlin.$_$.p5;
31
+ var takeLast = kotlin_kotlin.$_$.n9;
32
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.n;
33
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.ph;
34
+ var initMetadataForCompanion = kotlin_kotlin.$_$.ub;
35
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.w1;
36
+ var Enum = kotlin_kotlin.$_$.hg;
37
+ var initMetadataForClass = kotlin_kotlin.$_$.tb;
38
+ var createSimpleEnumSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.e2;
39
+ var enumEntries = kotlin_kotlin.$_$.xa;
40
+ var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.k;
41
+ var lazy = kotlin_kotlin.$_$.nh;
42
+ var SerializerFactory = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.c2;
43
+ var initMetadataForInterface = kotlin_kotlin.$_$.wb;
44
+ var until = kotlin_kotlin.$_$.kd;
45
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.s6;
46
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.m;
47
+ var SecureRandom = kotlin_io_raspberryapps_cardgame_random.$_$.j;
48
+ var CoroutineImpl = kotlin_kotlin.$_$.va;
49
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ga;
50
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.vb;
51
+ var count = kotlin_kotlin.$_$.j7;
52
+ var Result = kotlin_kotlin.$_$.pg;
53
+ var Result__exceptionOrNull_impl_p6xea9 = kotlin_kotlin.$_$.g3;
54
+ var throwOnFailure = kotlin_kotlin.$_$.th;
55
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.j3;
56
+ var _Result___get_isSuccess__impl__sndoy8 = kotlin_kotlin.$_$.i3;
57
+ var addAll = kotlin_kotlin.$_$.g6;
58
+ var Collection = kotlin_kotlin.$_$.r5;
59
+ var isInterface = kotlin_kotlin.$_$.hc;
60
+ var toMutableList = kotlin_kotlin.$_$.w9;
61
+ var listOf = kotlin_kotlin.$_$.q8;
62
+ var first = kotlin_kotlin.$_$.v7;
63
+ var sorted = kotlin_kotlin.$_$.l9;
64
+ var asReversed = kotlin_kotlin.$_$.k6;
65
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.d2;
66
+ var equals = kotlin_kotlin.$_$.lb;
67
+ var FunctionAdapter = kotlin_kotlin.$_$.za;
68
+ var hashCode = kotlin_kotlin.$_$.sb;
69
+ var first_0 = kotlin_kotlin.$_$.u7;
70
+ var compareValues = kotlin_kotlin.$_$.ea;
71
+ var sortWith = kotlin_kotlin.$_$.j9;
72
+ var lastOrNull = kotlin_kotlin.$_$.k8;
73
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.w;
74
+ var sortedWith = kotlin_kotlin.$_$.k9;
75
+ var NoSuchElementException_init_$Create$_0 = kotlin_kotlin.$_$.b2;
76
+ var compareTo = kotlin_kotlin.$_$.jb;
77
+ var toString = kotlin_kotlin.$_$.yc;
78
+ var dropLast = kotlin_kotlin.$_$.l7;
79
+ var plus = kotlin_kotlin.$_$.z8;
80
+ var minus = kotlin_kotlin.$_$.u8;
81
+ var plus_0 = kotlin_kotlin.$_$.a9;
82
+ //endregion
83
+ //region block: pre-declaration
84
+ initMetadataForObject(CoreConfig, 'CoreConfig');
85
+ initMetadataForObject(CardIndexComparator, 'CardIndexComparator', VOID, VOID, [Comparator]);
86
+ initMetadataForObject(CardNumberComparator, 'CardNumberComparator', VOID, VOID, [Comparator]);
87
+ initMetadataForCompanion(Companion);
88
+ initMetadataForClass(CardName, 'CardName', VOID, Enum);
89
+ initMetadataForCompanion(Companion_0);
90
+ initMetadataForClass(GameCard, 'GameCard');
91
+ initMetadataForCompanion(Companion_1, VOID, [SerializerFactory]);
92
+ initMetadataForClass(Suit, 'Suit', VOID, Enum, VOID, VOID, VOID, {0: Companion_getInstance_1});
93
+ initMetadataForClass(CardsRandomProvider, 'CardsRandomProvider', VOID, Enum);
94
+ function standardShuffledCards$default(cards, times, $super) {
95
+ times = times === VOID ? 3 : times;
96
+ return $super === VOID ? this.o63(cards, times) : $super.o63.call(this, cards, times);
97
+ }
98
+ initMetadataForInterface(CardsDealerProvider, 'CardsDealerProvider', VOID, VOID, VOID, [5]);
99
+ initMetadataForCompanion(Companion_2);
100
+ initMetadataForCoroutine($createNewShuffledCardDeckCOROUTINE$0, CoroutineImpl);
101
+ initMetadataForCoroutine($getRandomOrgCardsCOROUTINE$1, CoroutineImpl);
102
+ initMetadataForClass(CardsDealerProviderImpl, 'CardsDealerProviderImpl', VOID, VOID, [CardsDealerProvider], [5]);
103
+ initMetadataForCompanion(Companion_3);
104
+ initMetadataForClass(FakeCardsDealerProvider, 'FakeCardsDealerProvider', FakeCardsDealerProvider, VOID, [CardsDealerProvider], [5]);
105
+ function findCardsInRowCombinations$default(cards, supportedCombinations, checkFromIndex, includeCardNames, suit, $super) {
106
+ checkFromIndex = checkFromIndex === VOID ? first(supportedCombinations) : checkFromIndex;
107
+ includeCardNames = includeCardNames === VOID ? null : includeCardNames;
108
+ suit = suit === VOID ? null : suit;
109
+ return $super === VOID ? this.k65(cards, supportedCombinations, checkFromIndex, includeCardNames, suit) : $super.k65.call(this, cards, supportedCombinations, checkFromIndex, includeCardNames, suit);
110
+ }
111
+ function findSameCardsNumberCombinations$default(cards, cardsCount, includeCardNames, $super) {
112
+ cardsCount = cardsCount === VOID ? 4 : cardsCount;
113
+ includeCardNames = includeCardNames === VOID ? null : includeCardNames;
114
+ return $super === VOID ? this.m65(cards, cardsCount, includeCardNames) : $super.m65.call(this, cards, cardsCount, includeCardNames);
115
+ }
116
+ initMetadataForInterface(CombinationsCheckerProvider, 'CombinationsCheckerProvider');
117
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
118
+ initMetadataForClass(CombinationsCheckerProviderImpl, 'CombinationsCheckerProviderImpl', CombinationsCheckerProviderImpl, VOID, [CombinationsCheckerProvider]);
119
+ initMetadataForInterface(DealerReducer, 'DealerReducer');
120
+ initMetadataForClass(DealerReducerImpl, 'DealerReducerImpl', VOID, VOID, [DealerReducer]);
121
+ //endregion
122
+ function CoreConfig() {
123
+ this.version = '0.0.37';
124
+ }
125
+ protoOf(CoreConfig).a2w = function () {
126
+ return this.version;
127
+ };
128
+ var CoreConfig_instance;
129
+ function CoreConfig_getInstance() {
130
+ return CoreConfig_instance;
131
+ }
132
+ function CardIndexComparator() {
133
+ }
134
+ protoOf(CardIndexComparator).u62 = function (a, b) {
135
+ return a.v62_1 - b.v62_1 | 0;
136
+ };
137
+ protoOf(CardIndexComparator).compare = function (a, b) {
138
+ var tmp = a instanceof GameCard ? a : THROW_CCE();
139
+ return this.u62(tmp, b instanceof GameCard ? b : THROW_CCE());
140
+ };
141
+ var CardIndexComparator_instance;
142
+ function CardIndexComparator_getInstance() {
143
+ return CardIndexComparator_instance;
144
+ }
145
+ function CardNumberComparator() {
146
+ }
147
+ protoOf(CardNumberComparator).u62 = function (a, b) {
148
+ return b.w62() - a.w62() | 0;
149
+ };
150
+ protoOf(CardNumberComparator).compare = function (a, b) {
151
+ var tmp = a instanceof GameCard ? a : THROW_CCE();
152
+ return this.u62(tmp, b instanceof GameCard ? b : THROW_CCE());
153
+ };
154
+ var CardNumberComparator_instance;
155
+ function CardNumberComparator_getInstance() {
156
+ return CardNumberComparator_instance;
157
+ }
158
+ function distributeCardsBottom(_this__u8e3s4, count) {
159
+ var cardsToDeal = toList(take(_this__u8e3s4, count));
160
+ _this__u8e3s4.z1(cardsToDeal);
161
+ return cardsToDeal;
162
+ }
163
+ function distributeCardsTop(_this__u8e3s4, count) {
164
+ var cardsToDeal = toList(takeLast(_this__u8e3s4, count));
165
+ _this__u8e3s4.z1(cardsToDeal);
166
+ return cardsToDeal;
167
+ }
168
+ function filterByCardName(_this__u8e3s4, name) {
169
+ // Inline function 'kotlin.collections.filter' call
170
+ var predicate = byCardNamePredicate(name.slice());
171
+ // Inline function 'kotlin.collections.filterTo' call
172
+ var destination = ArrayList_init_$Create$();
173
+ var tmp0_iterator = _this__u8e3s4.j();
174
+ while (tmp0_iterator.k()) {
175
+ var element = tmp0_iterator.l();
176
+ if (predicate(element)) {
177
+ destination.e(element);
178
+ }
179
+ }
180
+ return destination;
181
+ }
182
+ function byCardNamePredicate(types) {
183
+ return byCardNamePredicate$lambda(types);
184
+ }
185
+ function byCardNamePredicate$lambda($types) {
186
+ return function (p1) {
187
+ var tmp$ret$1;
188
+ $l$block: {
189
+ // Inline function 'kotlin.collections.any' call
190
+ var indexedObject = $types;
191
+ var inductionVariable = 0;
192
+ var last = indexedObject.length;
193
+ while (inductionVariable < last) {
194
+ var element = indexedObject[inductionVariable];
195
+ inductionVariable = inductionVariable + 1 | 0;
196
+ // Inline function 'io.raspberryapps.card_game.core.data.models.cards.byCardNamePredicate.<anonymous>.<anonymous>' call
197
+ if (p1.o2().equals(element)) {
198
+ tmp$ret$1 = true;
199
+ break $l$block;
200
+ }
201
+ }
202
+ tmp$ret$1 = false;
203
+ }
204
+ return tmp$ret$1;
205
+ };
206
+ }
207
+ var CardName_ACE_instance;
208
+ var CardName_KING_instance;
209
+ var CardName_DAME_instance;
210
+ var CardName_JACK_instance;
211
+ var CardName_TEN_instance;
212
+ var CardName_NINE_instance;
213
+ var CardName_EIGHT_instance;
214
+ var CardName_SEVEN_instance;
215
+ var CardName_SIX_instance;
216
+ var CardName_FIVE_instance;
217
+ var CardName_FOUR_instance;
218
+ var CardName_TREE_instance;
219
+ var CardName_TWO_instance;
220
+ var CardName_STUB_instance;
221
+ function getShortName($this) {
222
+ var tmp;
223
+ switch ($this.n2_1) {
224
+ case 0:
225
+ tmp = 'A';
226
+ break;
227
+ case 1:
228
+ tmp = 'K';
229
+ break;
230
+ case 2:
231
+ tmp = 'D';
232
+ break;
233
+ case 3:
234
+ tmp = 'J';
235
+ break;
236
+ case 4:
237
+ tmp = '10';
238
+ break;
239
+ case 5:
240
+ tmp = '9';
241
+ break;
242
+ case 6:
243
+ tmp = '8';
244
+ break;
245
+ case 7:
246
+ tmp = '7';
247
+ break;
248
+ case 8:
249
+ tmp = '6';
250
+ break;
251
+ case 9:
252
+ tmp = '5';
253
+ break;
254
+ case 10:
255
+ tmp = '4';
256
+ break;
257
+ case 11:
258
+ tmp = '3';
259
+ break;
260
+ case 12:
261
+ tmp = '2';
262
+ break;
263
+ case 13:
264
+ tmp = 'STUB';
265
+ break;
266
+ default:
267
+ noWhenBranchMatchedException();
268
+ break;
269
+ }
270
+ return tmp;
271
+ }
272
+ var CardName_entriesInitialized;
273
+ function CardName_initEntries() {
274
+ if (CardName_entriesInitialized)
275
+ return Unit_instance;
276
+ CardName_entriesInitialized = true;
277
+ CardName_ACE_instance = new CardName('ACE', 0);
278
+ CardName_KING_instance = new CardName('KING', 1);
279
+ CardName_DAME_instance = new CardName('DAME', 2);
280
+ CardName_JACK_instance = new CardName('JACK', 3);
281
+ CardName_TEN_instance = new CardName('TEN', 4);
282
+ CardName_NINE_instance = new CardName('NINE', 5);
283
+ CardName_EIGHT_instance = new CardName('EIGHT', 6);
284
+ CardName_SEVEN_instance = new CardName('SEVEN', 7);
285
+ CardName_SIX_instance = new CardName('SIX', 8);
286
+ CardName_FIVE_instance = new CardName('FIVE', 9);
287
+ CardName_FOUR_instance = new CardName('FOUR', 10);
288
+ CardName_TREE_instance = new CardName('TREE', 11);
289
+ CardName_TWO_instance = new CardName('TWO', 12);
290
+ CardName_STUB_instance = new CardName('STUB', 13);
291
+ }
292
+ function Companion() {
293
+ }
294
+ protoOf(Companion).x62 = function (suit, number) {
295
+ return new GameCard(getNumber(Companion_instance_0, getName(Companion_instance_0, number), suit));
296
+ };
297
+ protoOf(Companion).y62 = function (suit, cardNumber) {
298
+ return new GameCard(getNumber(Companion_instance_0, cardNumber, suit));
299
+ };
300
+ protoOf(Companion).z62 = function (index) {
301
+ return new GameCard(index);
302
+ };
303
+ protoOf(Companion).a63 = function (position, playerIndex, previousStubCardWithMaxIndex, reverse) {
304
+ var tmp;
305
+ if (previousStubCardWithMaxIndex == null) {
306
+ tmp = null;
307
+ } else {
308
+ // Inline function 'kotlin.takeIf' call
309
+ // Inline function 'kotlin.contracts.contract' call
310
+ var tmp_0;
311
+ // Inline function 'io.raspberryapps.card_game.core.data.models.cards.Companion.createUniqueStub.<anonymous>' call
312
+ if (previousStubCardWithMaxIndex.b63()) {
313
+ tmp_0 = previousStubCardWithMaxIndex;
314
+ } else {
315
+ tmp_0 = null;
316
+ }
317
+ tmp = tmp_0;
318
+ }
319
+ var tmp3_safe_receiver = tmp;
320
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.v62_1;
321
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : Companion_instance_0.g63(tmp4_safe_receiver, playerIndex, reverse);
322
+ var tmp_1;
323
+ if (tmp5_safe_receiver == null) {
324
+ tmp_1 = null;
325
+ } else {
326
+ // Inline function 'kotlin.let' call
327
+ // Inline function 'kotlin.contracts.contract' call
328
+ // Inline function 'io.raspberryapps.card_game.core.data.models.cards.Companion.createUniqueStub.<anonymous>' call
329
+ tmp_1 = tmp5_safe_receiver + 1 | 0;
330
+ }
331
+ var tmp0_elvis_lhs = tmp_1;
332
+ var previousGameCardIndex = tmp0_elvis_lhs == null ? 0 : tmp0_elvis_lhs;
333
+ var tmp_2;
334
+ if (reverse) {
335
+ tmp_2 = ((53 + imul(playerIndex, 14) | 0) - position | 0) - previousGameCardIndex | 0;
336
+ } else {
337
+ tmp_2 = ((53 + imul(playerIndex, 13) | 0) + position | 0) + previousGameCardIndex | 0;
338
+ }
339
+ var index = tmp_2;
340
+ return new GameCard(index);
341
+ };
342
+ protoOf(Companion).h63 = function (position, playerIndex, previousStubCardWithMaxIndex, reverse, $super) {
343
+ previousStubCardWithMaxIndex = previousStubCardWithMaxIndex === VOID ? null : previousStubCardWithMaxIndex;
344
+ reverse = reverse === VOID ? false : reverse;
345
+ return $super === VOID ? this.a63(position, playerIndex, previousStubCardWithMaxIndex, reverse) : $super.a63.call(this, position, playerIndex, previousStubCardWithMaxIndex, reverse);
346
+ };
347
+ var Companion_instance;
348
+ function Companion_getInstance() {
349
+ return Companion_instance;
350
+ }
351
+ function getNumber($this, cardNumber, suit) {
352
+ return imul(getIndex(suit), 13) + getCardNumber($this, cardNumber) | 0;
353
+ }
354
+ function getCardNumber($this, number) {
355
+ var tmp;
356
+ switch (number.n2_1) {
357
+ case 12:
358
+ tmp = 0;
359
+ break;
360
+ case 11:
361
+ tmp = 1;
362
+ break;
363
+ case 10:
364
+ tmp = 2;
365
+ break;
366
+ case 9:
367
+ tmp = 3;
368
+ break;
369
+ case 8:
370
+ tmp = 4;
371
+ break;
372
+ case 7:
373
+ tmp = 5;
374
+ break;
375
+ case 6:
376
+ tmp = 6;
377
+ break;
378
+ case 5:
379
+ tmp = 7;
380
+ break;
381
+ case 4:
382
+ tmp = 8;
383
+ break;
384
+ case 3:
385
+ tmp = 9;
386
+ break;
387
+ case 2:
388
+ tmp = 10;
389
+ break;
390
+ case 1:
391
+ tmp = 11;
392
+ break;
393
+ case 0:
394
+ tmp = 12;
395
+ break;
396
+ default:
397
+ throw IllegalStateException_init_$Create$('Invalid CardNumber ' + number.toString());
398
+ }
399
+ return tmp;
400
+ }
401
+ function getName($this, number) {
402
+ var tmp;
403
+ switch (number) {
404
+ case 0:
405
+ tmp = CardName_TWO_getInstance();
406
+ break;
407
+ case 1:
408
+ tmp = CardName_TREE_getInstance();
409
+ break;
410
+ case 2:
411
+ tmp = CardName_FOUR_getInstance();
412
+ break;
413
+ case 3:
414
+ tmp = CardName_FIVE_getInstance();
415
+ break;
416
+ case 4:
417
+ tmp = CardName_SIX_getInstance();
418
+ break;
419
+ case 5:
420
+ tmp = CardName_SEVEN_getInstance();
421
+ break;
422
+ case 6:
423
+ tmp = CardName_EIGHT_getInstance();
424
+ break;
425
+ case 7:
426
+ tmp = CardName_NINE_getInstance();
427
+ break;
428
+ case 8:
429
+ tmp = CardName_TEN_getInstance();
430
+ break;
431
+ case 9:
432
+ tmp = CardName_JACK_getInstance();
433
+ break;
434
+ case 10:
435
+ tmp = CardName_DAME_getInstance();
436
+ break;
437
+ case 11:
438
+ tmp = CardName_KING_getInstance();
439
+ break;
440
+ case 12:
441
+ tmp = CardName_ACE_getInstance();
442
+ break;
443
+ default:
444
+ throw IllegalStateException_init_$Create$('Invalid index name in Card.getName() ' + number);
445
+ }
446
+ return tmp;
447
+ }
448
+ function _get_isShirt__vd98rp($this) {
449
+ return $this.v62_1 === 52;
450
+ }
451
+ function CardName(name, ordinal) {
452
+ Enum.call(this, name, ordinal);
453
+ }
454
+ protoOf(CardName).toString = function () {
455
+ return getShortName(this);
456
+ };
457
+ function Companion_0() {
458
+ this.c63_1 = -1;
459
+ this.d63_1 = 13;
460
+ this.e63_1 = 52;
461
+ this.f63_1 = 53;
462
+ }
463
+ protoOf(Companion_0).g63 = function (_this__u8e3s4, playerIndex, reverse) {
464
+ var tmp;
465
+ if (reverse) {
466
+ tmp = _this__u8e3s4 + (53 + imul(playerIndex, 14) | 0) | 0;
467
+ } else {
468
+ tmp = _this__u8e3s4 - (53 + imul(playerIndex, 13) | 0) | 0;
469
+ }
470
+ return tmp;
471
+ };
472
+ var Companion_instance_0;
473
+ function Companion_getInstance_0() {
474
+ return Companion_instance_0;
475
+ }
476
+ function CardName_ACE_getInstance() {
477
+ CardName_initEntries();
478
+ return CardName_ACE_instance;
479
+ }
480
+ function CardName_KING_getInstance() {
481
+ CardName_initEntries();
482
+ return CardName_KING_instance;
483
+ }
484
+ function CardName_DAME_getInstance() {
485
+ CardName_initEntries();
486
+ return CardName_DAME_instance;
487
+ }
488
+ function CardName_JACK_getInstance() {
489
+ CardName_initEntries();
490
+ return CardName_JACK_instance;
491
+ }
492
+ function CardName_TEN_getInstance() {
493
+ CardName_initEntries();
494
+ return CardName_TEN_instance;
495
+ }
496
+ function CardName_NINE_getInstance() {
497
+ CardName_initEntries();
498
+ return CardName_NINE_instance;
499
+ }
500
+ function CardName_EIGHT_getInstance() {
501
+ CardName_initEntries();
502
+ return CardName_EIGHT_instance;
503
+ }
504
+ function CardName_SEVEN_getInstance() {
505
+ CardName_initEntries();
506
+ return CardName_SEVEN_instance;
507
+ }
508
+ function CardName_SIX_getInstance() {
509
+ CardName_initEntries();
510
+ return CardName_SIX_instance;
511
+ }
512
+ function CardName_FIVE_getInstance() {
513
+ CardName_initEntries();
514
+ return CardName_FIVE_instance;
515
+ }
516
+ function CardName_FOUR_getInstance() {
517
+ CardName_initEntries();
518
+ return CardName_FOUR_instance;
519
+ }
520
+ function CardName_TREE_getInstance() {
521
+ CardName_initEntries();
522
+ return CardName_TREE_instance;
523
+ }
524
+ function CardName_TWO_getInstance() {
525
+ CardName_initEntries();
526
+ return CardName_TWO_instance;
527
+ }
528
+ function CardName_STUB_getInstance() {
529
+ CardName_initEntries();
530
+ return CardName_STUB_instance;
531
+ }
532
+ function GameCard(index) {
533
+ this.v62_1 = index;
534
+ }
535
+ protoOf(GameCard).i63 = function () {
536
+ var tmp;
537
+ var containsArg = this.v62_1;
538
+ if (0 <= containsArg ? containsArg <= 13 : false) {
539
+ tmp = Suit_DIAMOND_getInstance();
540
+ } else {
541
+ if (this.v62_1 <= 26) {
542
+ tmp = Suit_SPADE_getInstance();
543
+ } else {
544
+ if (this.v62_1 <= 39) {
545
+ tmp = Suit_HEART_getInstance();
546
+ } else {
547
+ if (this.v62_1 <= 52) {
548
+ tmp = Suit_CLUB_getInstance();
549
+ } else {
550
+ throw IllegalStateException_init_$Create$('Invalid suitCard in Card.getValue() ' + this.v62_1);
551
+ }
552
+ }
553
+ }
554
+ }
555
+ return tmp;
556
+ };
557
+ protoOf(GameCard).w62 = function () {
558
+ var tmp;
559
+ if (this.b63()) {
560
+ tmp = -1;
561
+ } else {
562
+ tmp = this.v62_1 - imul(13, getIndex(this.i63())) | 0;
563
+ }
564
+ return tmp;
565
+ };
566
+ protoOf(GameCard).o2 = function () {
567
+ return this.b63() ? CardName_STUB_getInstance() : getName(Companion_instance_0, this.w62());
568
+ };
569
+ protoOf(GameCard).j63 = function () {
570
+ return !_get_isShirt__vd98rp(this) && !this.b63();
571
+ };
572
+ protoOf(GameCard).b63 = function () {
573
+ return this.v62_1 >= 53;
574
+ };
575
+ protoOf(GameCard).toString = function () {
576
+ if (_get_isShirt__vd98rp(this)) {
577
+ return 'GameCard(SHIRT)';
578
+ }
579
+ if (this.b63()) {
580
+ return 'GameCard(STUB, ' + this.v62_1 + ')';
581
+ }
582
+ return 'GameCard(' + this.i63().toString() + this.o2().toString() + ', ' + this.v62_1 + ')';
583
+ };
584
+ protoOf(GameCard).hashCode = function () {
585
+ return this.v62_1;
586
+ };
587
+ protoOf(GameCard).equals = function (other) {
588
+ if (this === other)
589
+ return true;
590
+ if (!(other instanceof GameCard))
591
+ return false;
592
+ var tmp0_other_with_cast = other instanceof GameCard ? other : THROW_CCE();
593
+ if (!(this.v62_1 === tmp0_other_with_cast.v62_1))
594
+ return false;
595
+ return true;
596
+ };
597
+ function _get_$cachedSerializer__te6jhj($this) {
598
+ return $this.k63_1.u();
599
+ }
600
+ function Suit$Companion$_anonymous__cbm2iq() {
601
+ return createSimpleEnumSerializer('io.raspberryapps.card_game.core.data.models.cards.Suit', values());
602
+ }
603
+ var Suit_DIAMOND_instance;
604
+ var Suit_SPADE_instance;
605
+ var Suit_HEART_instance;
606
+ var Suit_CLUB_instance;
607
+ function getSuitEmoji($this) {
608
+ var tmp;
609
+ switch ($this.n2_1) {
610
+ case 0:
611
+ tmp = '\u2666\uFE0F';
612
+ break;
613
+ case 1:
614
+ tmp = '\u2663\uFE0F\uFE0F';
615
+ break;
616
+ case 2:
617
+ tmp = '\u2665\uFE0F';
618
+ break;
619
+ case 3:
620
+ tmp = '\u2660\uFE0F';
621
+ break;
622
+ default:
623
+ noWhenBranchMatchedException();
624
+ break;
625
+ }
626
+ return tmp;
627
+ }
628
+ function values() {
629
+ return [Suit_DIAMOND_getInstance(), Suit_SPADE_getInstance(), Suit_HEART_getInstance(), Suit_CLUB_getInstance()];
630
+ }
631
+ function get_entries() {
632
+ if ($ENTRIES == null)
633
+ $ENTRIES = enumEntries(values());
634
+ return $ENTRIES;
635
+ }
636
+ function Companion_1() {
637
+ Companion_instance_1 = this;
638
+ var tmp = this;
639
+ var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
640
+ tmp.k63_1 = lazy(tmp_0, Suit$Companion$_anonymous__cbm2iq);
641
+ }
642
+ protoOf(Companion_1).j4t = function () {
643
+ return _get_$cachedSerializer__te6jhj(this);
644
+ };
645
+ protoOf(Companion_1).g4d = function (typeParamsSerializers) {
646
+ return this.j4t();
647
+ };
648
+ var Companion_instance_1;
649
+ function Companion_getInstance_1() {
650
+ Suit_initEntries();
651
+ if (Companion_instance_1 == null)
652
+ new Companion_1();
653
+ return Companion_instance_1;
654
+ }
655
+ var Suit_entriesInitialized;
656
+ function Suit_initEntries() {
657
+ if (Suit_entriesInitialized)
658
+ return Unit_instance;
659
+ Suit_entriesInitialized = true;
660
+ Suit_DIAMOND_instance = new Suit('DIAMOND', 0);
661
+ Suit_SPADE_instance = new Suit('SPADE', 1);
662
+ Suit_HEART_instance = new Suit('HEART', 2);
663
+ Suit_CLUB_instance = new Suit('CLUB', 3);
664
+ Companion_getInstance_1();
665
+ }
666
+ var $ENTRIES;
667
+ function Suit(name, ordinal) {
668
+ Enum.call(this, name, ordinal);
669
+ }
670
+ protoOf(Suit).toString = function () {
671
+ return getSuitEmoji(this);
672
+ };
673
+ function Suit_DIAMOND_getInstance() {
674
+ Suit_initEntries();
675
+ return Suit_DIAMOND_instance;
676
+ }
677
+ function Suit_SPADE_getInstance() {
678
+ Suit_initEntries();
679
+ return Suit_SPADE_instance;
680
+ }
681
+ function Suit_HEART_getInstance() {
682
+ Suit_initEntries();
683
+ return Suit_HEART_instance;
684
+ }
685
+ function Suit_CLUB_getInstance() {
686
+ Suit_initEntries();
687
+ return Suit_CLUB_instance;
688
+ }
689
+ function getIndex(_this__u8e3s4) {
690
+ var tmp;
691
+ switch (_this__u8e3s4.n2_1) {
692
+ case 0:
693
+ tmp = 0;
694
+ break;
695
+ case 1:
696
+ tmp = 1;
697
+ break;
698
+ case 2:
699
+ tmp = 2;
700
+ break;
701
+ case 3:
702
+ tmp = 3;
703
+ break;
704
+ default:
705
+ noWhenBranchMatchedException();
706
+ break;
707
+ }
708
+ return tmp;
709
+ }
710
+ var CardsRandomProvider_CUSTOM_instance;
711
+ var CardsRandomProvider_RANDOM_ORG_instance;
712
+ var CardsRandomProvider_RANDOM_ORG_SIGNED_instance;
713
+ var CardsRandomProvider_entriesInitialized;
714
+ function CardsRandomProvider_initEntries() {
715
+ if (CardsRandomProvider_entriesInitialized)
716
+ return Unit_instance;
717
+ CardsRandomProvider_entriesInitialized = true;
718
+ CardsRandomProvider_CUSTOM_instance = new CardsRandomProvider('CUSTOM', 0);
719
+ CardsRandomProvider_RANDOM_ORG_instance = new CardsRandomProvider('RANDOM_ORG', 1);
720
+ CardsRandomProvider_RANDOM_ORG_SIGNED_instance = new CardsRandomProvider('RANDOM_ORG_SIGNED', 2);
721
+ }
722
+ function CardsRandomProvider(name, ordinal) {
723
+ Enum.call(this, name, ordinal);
724
+ }
725
+ function CardsRandomProvider_CUSTOM_getInstance() {
726
+ CardsRandomProvider_initEntries();
727
+ return CardsRandomProvider_CUSTOM_instance;
728
+ }
729
+ function CardsRandomProvider_RANDOM_ORG_getInstance() {
730
+ CardsRandomProvider_initEntries();
731
+ return CardsRandomProvider_RANDOM_ORG_instance;
732
+ }
733
+ function CardsRandomProvider_RANDOM_ORG_SIGNED_getInstance() {
734
+ CardsRandomProvider_initEntries();
735
+ return CardsRandomProvider_RANDOM_ORG_SIGNED_instance;
736
+ }
737
+ function CardsDealerProvider() {
738
+ }
739
+ function getCardsRange($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
740
+ return until(leftCardIndexForEachSuit, 13 - rightCardIndexForEachSuit | 0);
741
+ }
742
+ function getRandomOrgCards($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, signed, $completion) {
743
+ var tmp = new $getRandomOrgCardsCOROUTINE$1($this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, signed, $completion);
744
+ tmp.g9_1 = Unit_instance;
745
+ tmp.h9_1 = null;
746
+ return tmp.m9();
747
+ }
748
+ function normalizeCards($this, cards, leftCardIndexForEachSuit) {
749
+ var oneSuitCount = cards.m() / get_entries().m() | 0;
750
+ // Inline function 'kotlin.collections.map' call
751
+ // Inline function 'kotlin.collections.mapTo' call
752
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(cards, 10));
753
+ var tmp0_iterator = cards.j();
754
+ while (tmp0_iterator.k()) {
755
+ var item = tmp0_iterator.l();
756
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.normalizeCards.<anonymous>' call
757
+ var previousSuitNumber = item / oneSuitCount | 0;
758
+ var cardIndexShift = imul(leftCardIndexForEachSuit, previousSuitNumber + 1 | 0);
759
+ var newIndex = item + cardIndexShift | 0;
760
+ destination.e(newIndex);
761
+ }
762
+ var newIndexes = destination;
763
+ return newIndexes;
764
+ }
765
+ function Companion_2() {
766
+ }
767
+ protoOf(Companion_2).l64 = function (randomPoolProvider, logger) {
768
+ var tmp17_random = new SecureRandom(logger);
769
+ return new CardsDealerProviderImpl(tmp17_random, randomPoolProvider, logger);
770
+ };
771
+ var Companion_instance_2;
772
+ function Companion_getInstance_2() {
773
+ return Companion_instance_2;
774
+ }
775
+ function $createNewShuffledCardDeckCOROUTINE$0(_this__u8e3s4, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, provider, resultContinuation) {
776
+ CoroutineImpl.call(this, resultContinuation);
777
+ this.u64_1 = _this__u8e3s4;
778
+ this.v64_1 = leftCardIndexForEachSuit;
779
+ this.w64_1 = rightCardIndexForEachSuit;
780
+ this.x64_1 = approximateRoundCountForGame;
781
+ this.y64_1 = userData;
782
+ this.z64_1 = provider;
783
+ }
784
+ protoOf($createNewShuffledCardDeckCOROUTINE$0).m9 = function () {
785
+ var suspendResult = this.g9_1;
786
+ $sm: do
787
+ try {
788
+ var tmp = this.e9_1;
789
+ switch (tmp) {
790
+ case 0:
791
+ this.f9_1 = 4;
792
+ this.a65_1 = this.z64_1;
793
+ this.b65_1 = this.a65_1.n2_1;
794
+ if (this.b65_1 === 0) {
795
+ var tmp_0 = this;
796
+ var it = this.u64_1.l63(this.v64_1, this.w64_1);
797
+ tmp_0.c65_1 = this.u64_1.p63(it);
798
+ this.e9_1 = 3;
799
+ continue $sm;
800
+ } else {
801
+ if (this.b65_1 === 1) {
802
+ this.e9_1 = 2;
803
+ suspendResult = getRandomOrgCards(this.u64_1, this.v64_1, this.w64_1, this.x64_1, this.y64_1, false, this);
804
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
805
+ return suspendResult;
806
+ }
807
+ continue $sm;
808
+ } else {
809
+ if (this.b65_1 === 2) {
810
+ this.e9_1 = 1;
811
+ suspendResult = getRandomOrgCards(this.u64_1, this.v64_1, this.w64_1, this.x64_1, this.y64_1, true, this);
812
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
813
+ return suspendResult;
814
+ }
815
+ continue $sm;
816
+ } else {
817
+ var tmp_1 = this;
818
+ noWhenBranchMatchedException();
819
+ }
820
+ }
821
+ }
822
+
823
+ break;
824
+ case 1:
825
+ this.c65_1 = suspendResult;
826
+ this.e9_1 = 3;
827
+ continue $sm;
828
+ case 2:
829
+ this.c65_1 = suspendResult;
830
+ this.e9_1 = 3;
831
+ continue $sm;
832
+ case 3:
833
+ return this.c65_1;
834
+ case 4:
835
+ throw this.h9_1;
836
+ }
837
+ } catch ($p) {
838
+ var e = $p;
839
+ if (this.f9_1 === 4) {
840
+ throw e;
841
+ } else {
842
+ this.e9_1 = this.f9_1;
843
+ this.h9_1 = e;
844
+ }
845
+ }
846
+ while (true);
847
+ };
848
+ function $getRandomOrgCardsCOROUTINE$1(_this__u8e3s4, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundsCount, userData, signed, resultContinuation) {
849
+ CoroutineImpl.call(this, resultContinuation);
850
+ this.y63_1 = _this__u8e3s4;
851
+ this.z63_1 = leftCardIndexForEachSuit;
852
+ this.a64_1 = rightCardIndexForEachSuit;
853
+ this.b64_1 = approximateRoundsCount;
854
+ this.c64_1 = userData;
855
+ this.d64_1 = signed;
856
+ }
857
+ protoOf($getRandomOrgCardsCOROUTINE$1).m9 = function () {
858
+ var suspendResult = this.g9_1;
859
+ $sm: do
860
+ try {
861
+ var tmp = this.e9_1;
862
+ switch (tmp) {
863
+ case 0:
864
+ this.f9_1 = 5;
865
+ var tmp_0 = this;
866
+ var sum = 0;
867
+ var tmp0_iterator = get_entries().j();
868
+ while (tmp0_iterator.k()) {
869
+ var element = tmp0_iterator.l();
870
+ var tmp_1 = sum;
871
+ sum = tmp_1 + count(getCardsRange(this.y63_1, this.z63_1, this.a64_1)) | 0;
872
+ }
873
+
874
+ tmp_0.e64_1 = sum;
875
+ this.f64_1 = this.y63_1.e65_1;
876
+ this.g64_1 = this.e64_1 - 1 | 0;
877
+ this.e9_1 = 1;
878
+ suspendResult = this.f64_1.q5n(this.b64_1, this.c64_1, 0, this.g64_1, this.e64_1, this.d64_1, VOID, this);
879
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
880
+ return suspendResult;
881
+ }
882
+
883
+ this.e9_1 = 2;
884
+ continue $sm;
885
+ case 1:
886
+ this.h64_1 = suspendResult.dk_1;
887
+ suspendResult = new Result(this.h64_1);
888
+ this.e9_1 = 2;
889
+ continue $sm;
890
+ case 2:
891
+ this.i64_1 = suspendResult.dk_1;
892
+ if (_Result___get_isSuccess__impl__sndoy8(this.i64_1)) {
893
+ var tmp_2 = this;
894
+ var this_0 = this.i64_1;
895
+ throwOnFailure(this_0);
896
+ var tmp_3 = _Result___get_value__impl__bjfvqg(this_0);
897
+ var tmp14_cards = ((tmp_3 == null ? true : !(tmp_3 == null)) ? tmp_3 : THROW_CCE()).cards;
898
+ var this_1 = normalizeCards(this.y63_1, tmp14_cards, this.z63_1);
899
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
900
+ var tmp0_iterator_0 = this_1.j();
901
+ while (tmp0_iterator_0.k()) {
902
+ var item = tmp0_iterator_0.l();
903
+ destination.e(Companion_instance.z62(item));
904
+ }
905
+ tmp_2.j64_1 = destination;
906
+ this.e9_1 = 4;
907
+ continue $sm;
908
+ } else {
909
+ this.k64_1 = Result__exceptionOrNull_impl_p6xea9(this.i64_1);
910
+ var tmp15_safe_receiver = this.k64_1;
911
+ this.y63_1.f65_1.w('CardsDealerProvider', 'createNewShuffledCardDeck error message = ' + (tmp15_safe_receiver == null ? null : tmp15_safe_receiver.message), this.k64_1);
912
+ this.e9_1 = 3;
913
+ suspendResult = this.y63_1.m63(this.z63_1, this.a64_1, this.b64_1, this.c64_1, CardsRandomProvider_CUSTOM_getInstance(), this);
914
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
915
+ return suspendResult;
916
+ }
917
+ continue $sm;
918
+ }
919
+
920
+ case 3:
921
+ this.j64_1 = suspendResult;
922
+ this.e9_1 = 4;
923
+ continue $sm;
924
+ case 4:
925
+ return this.j64_1;
926
+ case 5:
927
+ throw this.h9_1;
928
+ }
929
+ } catch ($p) {
930
+ var e = $p;
931
+ if (this.f9_1 === 5) {
932
+ throw e;
933
+ } else {
934
+ this.e9_1 = this.f9_1;
935
+ this.h9_1 = e;
936
+ }
937
+ }
938
+ while (true);
939
+ };
940
+ function CardsDealerProviderImpl(random, randomPoolProvider, logger) {
941
+ this.d65_1 = random;
942
+ this.e65_1 = randomPoolProvider;
943
+ this.f65_1 = logger;
944
+ }
945
+ protoOf(CardsDealerProviderImpl).l63 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
946
+ // Inline function 'kotlin.collections.flatMap' call
947
+ // Inline function 'kotlin.collections.flatMapTo' call
948
+ var this_0 = get_entries();
949
+ var destination = ArrayList_init_$Create$();
950
+ var tmp0_iterator = this_0.j();
951
+ while (tmp0_iterator.k()) {
952
+ var element = tmp0_iterator.l();
953
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.createNewCardDeck.<anonymous>' call
954
+ // Inline function 'kotlin.collections.map' call
955
+ var this_1 = getCardsRange(this, leftCardIndexForEachSuit, rightCardIndexForEachSuit);
956
+ // Inline function 'kotlin.collections.mapTo' call
957
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
958
+ var inductionVariable = this_1.a1_1;
959
+ var last = this_1.b1_1;
960
+ if (inductionVariable <= last)
961
+ do {
962
+ var item = inductionVariable;
963
+ inductionVariable = inductionVariable + 1 | 0;
964
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.createNewCardDeck.<anonymous>.<anonymous>' call
965
+ var it = item;
966
+ var tmp$ret$0 = Companion_instance.x62(element, it);
967
+ destination_0.e(tmp$ret$0);
968
+ }
969
+ while (!(item === last));
970
+ var list = destination_0;
971
+ addAll(destination, list);
972
+ }
973
+ return destination;
974
+ };
975
+ protoOf(CardsDealerProviderImpl).m63 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, provider, $completion) {
976
+ var tmp = new $createNewShuffledCardDeckCOROUTINE$0(this, leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, provider, $completion);
977
+ tmp.g9_1 = Unit_instance;
978
+ tmp.h9_1 = null;
979
+ return tmp.m9();
980
+ };
981
+ protoOf(CardsDealerProviderImpl).n63 = function (count, cards) {
982
+ // Inline function 'kotlin.apply' call
983
+ // Inline function 'kotlin.collections.mutableListOf' call
984
+ var this_0 = ArrayList_init_$Create$();
985
+ // Inline function 'kotlin.contracts.contract' call
986
+ $l$block: {
987
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.getNRandomUniqueCards.<anonymous>' call
988
+ var _iterator__ex2g4s = cards.j();
989
+ $l$loop_0: while (_iterator__ex2g4s.k()) {
990
+ var card = _iterator__ex2g4s.l();
991
+ if (this_0.m() === count) {
992
+ break $l$block;
993
+ }
994
+ var hasSimilarCard = this_0.s1(card);
995
+ if (hasSimilarCard) {
996
+ continue $l$loop_0;
997
+ }
998
+ var tmp$ret$2;
999
+ $l$block_1: {
1000
+ // Inline function 'kotlin.collections.any' call
1001
+ var tmp;
1002
+ if (isInterface(this_0, Collection)) {
1003
+ tmp = this_0.p();
1004
+ } else {
1005
+ tmp = false;
1006
+ }
1007
+ if (tmp) {
1008
+ tmp$ret$2 = false;
1009
+ break $l$block_1;
1010
+ }
1011
+ var tmp0_iterator = this_0.j();
1012
+ while (tmp0_iterator.k()) {
1013
+ var element = tmp0_iterator.l();
1014
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.getNRandomUniqueCards.<anonymous>.<anonymous>' call
1015
+ if (element.w62() === card.w62()) {
1016
+ tmp$ret$2 = true;
1017
+ break $l$block_1;
1018
+ }
1019
+ }
1020
+ tmp$ret$2 = false;
1021
+ }
1022
+ if (tmp$ret$2) {
1023
+ continue $l$loop_0;
1024
+ }
1025
+ this_0.e(card);
1026
+ }
1027
+ }
1028
+ return this_0;
1029
+ };
1030
+ protoOf(CardsDealerProviderImpl).o63 = function (cards, times) {
1031
+ // Inline function 'kotlin.let' call
1032
+ // Inline function 'kotlin.contracts.contract' call
1033
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.CardsDealerProviderImpl.standardShuffledCards.<anonymous>' call
1034
+ var shuffled = toMutableList(cards);
1035
+ var inductionVariable = 0;
1036
+ if (inductionVariable < times)
1037
+ do {
1038
+ var i = inductionVariable;
1039
+ inductionVariable = inductionVariable + 1 | 0;
1040
+ shuffled = this.d65_1.s5s(shuffled);
1041
+ }
1042
+ while (inductionVariable < times);
1043
+ return shuffled;
1044
+ };
1045
+ function Companion_3() {
1046
+ }
1047
+ protoOf(Companion_3).g65 = function () {
1048
+ // Inline function 'kotlin.apply' call
1049
+ // Inline function 'kotlin.collections.mutableListOf' call
1050
+ var this_0 = ArrayList_init_$Create$();
1051
+ // Inline function 'kotlin.contracts.contract' call
1052
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.cards.Companion.getCards.<anonymous>' call
1053
+ this_0.n(listOf([Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_NINE_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_TEN_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_JACK_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_KING_getInstance())]));
1054
+ this_0.n(listOf([Companion_instance.y62(Suit_CLUB_getInstance(), CardName_JACK_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_ACE_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_NINE_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_TEN_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_JACK_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_EIGHT_getInstance())]));
1055
+ this_0.n(listOf([Companion_instance.y62(Suit_CLUB_getInstance(), CardName_DAME_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_ACE_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_DAME_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_KING_getInstance())]));
1056
+ this_0.n(listOf([Companion_instance.y62(Suit_SPADE_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_TEN_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_TEN_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_JACK_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_DAME_getInstance())]));
1057
+ this_0.n(listOf([Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_ACE_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_EIGHT_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_KING_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_NINE_getInstance()), Companion_instance.y62(Suit_CLUB_getInstance(), CardName_ACE_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_KING_getInstance()), Companion_instance.y62(Suit_DIAMOND_getInstance(), CardName_DAME_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_NINE_getInstance())]));
1058
+ return this_0;
1059
+ };
1060
+ protoOf(Companion_3).h65 = function () {
1061
+ return listOf([Companion_instance.y62(Suit_CLUB_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_HEART_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_SEVEN_getInstance()), Companion_instance.y62(Suit_SPADE_getInstance(), CardName_EIGHT_getInstance())]);
1062
+ };
1063
+ var Companion_instance_3;
1064
+ function Companion_getInstance_3() {
1065
+ return Companion_instance_3;
1066
+ }
1067
+ function FakeCardsDealerProvider(cards, cardsForLot) {
1068
+ cards = cards === VOID ? Companion_instance_3.g65() : cards;
1069
+ cardsForLot = cardsForLot === VOID ? Companion_instance_3.h65() : cardsForLot;
1070
+ this.i65_1 = cards;
1071
+ this.j65_1 = cardsForLot;
1072
+ }
1073
+ protoOf(FakeCardsDealerProvider).l63 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit) {
1074
+ return this.i65_1;
1075
+ };
1076
+ protoOf(FakeCardsDealerProvider).m63 = function (leftCardIndexForEachSuit, rightCardIndexForEachSuit, approximateRoundCountForGame, userData, provider, $completion) {
1077
+ return this.i65_1;
1078
+ };
1079
+ protoOf(FakeCardsDealerProvider).n63 = function (count, cards) {
1080
+ return this.j65_1;
1081
+ };
1082
+ protoOf(FakeCardsDealerProvider).o63 = function (cards, times) {
1083
+ return cards;
1084
+ };
1085
+ function CombinationsCheckerProvider() {
1086
+ }
1087
+ function createCombination($this, cards, supportedCombinations) {
1088
+ var size = cards.m();
1089
+ if (supportedCombinations.s1(size)) {
1090
+ return cards;
1091
+ }
1092
+ var fromLongestCombinations = asReversed(sorted(supportedCombinations));
1093
+ var tmp$ret$1;
1094
+ $l$block: {
1095
+ // Inline function 'kotlin.collections.first' call
1096
+ var tmp0_iterator = fromLongestCombinations.j();
1097
+ while (tmp0_iterator.k()) {
1098
+ var element = tmp0_iterator.l();
1099
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombination.<anonymous>' call
1100
+ if (element <= size) {
1101
+ tmp$ret$1 = element;
1102
+ break $l$block;
1103
+ }
1104
+ }
1105
+ throw NoSuchElementException_init_$Create$('Collection contains no element matching the predicate.');
1106
+ }
1107
+ var longestCombinationSupport = tmp$ret$1;
1108
+ return takeLast(cards, longestCombinationSupport);
1109
+ }
1110
+ function sam$kotlin_Comparator$0(function_0) {
1111
+ this.p65_1 = function_0;
1112
+ }
1113
+ protoOf(sam$kotlin_Comparator$0).mc = function (a, b) {
1114
+ return this.p65_1(a, b);
1115
+ };
1116
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
1117
+ return this.mc(a, b);
1118
+ };
1119
+ protoOf(sam$kotlin_Comparator$0).o3 = function () {
1120
+ return this.p65_1;
1121
+ };
1122
+ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
1123
+ var tmp;
1124
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1125
+ var tmp_0;
1126
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1127
+ tmp_0 = equals(this.o3(), other.o3());
1128
+ } else {
1129
+ tmp_0 = false;
1130
+ }
1131
+ tmp = tmp_0;
1132
+ } else {
1133
+ tmp = false;
1134
+ }
1135
+ return tmp;
1136
+ };
1137
+ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
1138
+ return hashCode(this.o3());
1139
+ };
1140
+ function CombinationsCheckerProviderImpl$createCombinationsFromCardsInRow$lambda(a, b) {
1141
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1142
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
1143
+ var tmp = first_0(a).v62_1;
1144
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
1145
+ var tmp$ret$1 = first_0(b).v62_1;
1146
+ return compareValues(tmp, tmp$ret$1);
1147
+ }
1148
+ function CombinationsCheckerProviderImpl() {
1149
+ }
1150
+ protoOf(CombinationsCheckerProviderImpl).k65 = function (cards, supportedCombinations, checkFromIndex, includeCardNames, suit) {
1151
+ // Inline function 'kotlin.collections.filter' call
1152
+ // Inline function 'kotlin.apply' call
1153
+ var this_0 = toMutableList(cards);
1154
+ // Inline function 'kotlin.contracts.contract' call
1155
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findCardsInRowCombinations.<anonymous>' call
1156
+ sortWith(this_0, CardIndexComparator_instance);
1157
+ // Inline function 'kotlin.collections.filterTo' call
1158
+ var destination = ArrayList_init_$Create$();
1159
+ var tmp0_iterator = this_0.j();
1160
+ while (tmp0_iterator.k()) {
1161
+ var element = tmp0_iterator.l();
1162
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findCardsInRowCombinations.<anonymous>' call
1163
+ if (element.j63()) {
1164
+ destination.e(element);
1165
+ }
1166
+ }
1167
+ var sortedByIndexCards = toList(destination);
1168
+ // Inline function 'kotlin.collections.mutableListOf' call
1169
+ var combinations = ArrayList_init_$Create$();
1170
+ // Inline function 'kotlin.collections.mutableListOf' call
1171
+ var combinationCards = ArrayList_init_$Create$();
1172
+ var inductionVariable = 0;
1173
+ var last = sortedByIndexCards.m() - 1 | 0;
1174
+ if (inductionVariable <= last)
1175
+ do {
1176
+ var i = inductionVariable;
1177
+ inductionVariable = inductionVariable + 1 | 0;
1178
+ var previousCard = lastOrNull(combinationCards);
1179
+ var currentCard = sortedByIndexCards.o(i);
1180
+ var isNextInRow = !(previousCard == null) && currentCard.v62_1 === (previousCard.v62_1 + 1 | 0) && currentCard.i63().equals(previousCard.i63());
1181
+ var passedCardNamesCheck = includeCardNames == null || includeCardNames.s1(currentCard.o2());
1182
+ var passedSuitCheck = suit == null || currentCard.i63().equals(suit);
1183
+ if (isNextInRow && passedSuitCheck && passedCardNamesCheck) {
1184
+ combinationCards.e(currentCard);
1185
+ } else {
1186
+ if (combinationCards.m() > (checkFromIndex - 1 | 0)) {
1187
+ combinations.n(this.o65(toMutableList(combinationCards), supportedCombinations));
1188
+ }
1189
+ combinationCards.a2();
1190
+ if (passedSuitCheck && passedCardNamesCheck) {
1191
+ combinationCards.e(currentCard);
1192
+ }
1193
+ }
1194
+ }
1195
+ while (inductionVariable <= last);
1196
+ if (combinationCards.m() > (checkFromIndex - 1 | 0)) {
1197
+ combinations.n(this.o65(toMutableList(combinationCards), supportedCombinations));
1198
+ }
1199
+ return combinations;
1200
+ };
1201
+ protoOf(CombinationsCheckerProviderImpl).m65 = function (cards, cardsCount, includeCardNames) {
1202
+ // Inline function 'kotlin.collections.filter' call
1203
+ // Inline function 'kotlin.collections.filter' call
1204
+ // Inline function 'kotlin.apply' call
1205
+ var this_0 = toMutableList(cards);
1206
+ // Inline function 'kotlin.contracts.contract' call
1207
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1208
+ sortWith(this_0, CardIndexComparator_instance);
1209
+ // Inline function 'kotlin.collections.filterTo' call
1210
+ var destination = ArrayList_init_$Create$();
1211
+ var tmp0_iterator = this_0.j();
1212
+ while (tmp0_iterator.k()) {
1213
+ var element = tmp0_iterator.l();
1214
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1215
+ if (element.j63()) {
1216
+ destination.e(element);
1217
+ }
1218
+ }
1219
+ // Inline function 'kotlin.collections.filterTo' call
1220
+ var destination_0 = ArrayList_init_$Create$();
1221
+ var tmp0_iterator_0 = destination.j();
1222
+ while (tmp0_iterator_0.k()) {
1223
+ var element_0 = tmp0_iterator_0.l();
1224
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1225
+ if (includeCardNames == null || includeCardNames.s1(element_0.o2())) {
1226
+ destination_0.e(element_0);
1227
+ }
1228
+ }
1229
+ var sortedByNumberCards = toList(destination_0);
1230
+ // Inline function 'kotlin.collections.filter' call
1231
+ // Inline function 'kotlin.collections.groupBy' call
1232
+ // Inline function 'kotlin.collections.groupByTo' call
1233
+ var destination_1 = LinkedHashMap_init_$Create$();
1234
+ var tmp0_iterator_1 = sortedByNumberCards.j();
1235
+ while (tmp0_iterator_1.k()) {
1236
+ var element_1 = tmp0_iterator_1.l();
1237
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1238
+ var key = element_1.w62();
1239
+ // Inline function 'kotlin.collections.getOrPut' call
1240
+ var value = destination_1.g2(key);
1241
+ var tmp;
1242
+ if (value == null) {
1243
+ // Inline function 'kotlin.collections.groupByTo.<anonymous>' call
1244
+ var answer = ArrayList_init_$Create$();
1245
+ destination_1.j2(key, answer);
1246
+ tmp = answer;
1247
+ } else {
1248
+ tmp = value;
1249
+ }
1250
+ var list = tmp;
1251
+ list.e(element_1);
1252
+ }
1253
+ // Inline function 'kotlin.collections.filterTo' call
1254
+ var destination_2 = LinkedHashMap_init_$Create$();
1255
+ // Inline function 'kotlin.collections.iterator' call
1256
+ var tmp0_iterator_2 = destination_1.s().j();
1257
+ while (tmp0_iterator_2.k()) {
1258
+ var element_2 = tmp0_iterator_2.l();
1259
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1260
+ if (element_2.u().m() >= cardsCount) {
1261
+ destination_2.j2(element_2.t(), element_2.u());
1262
+ }
1263
+ }
1264
+ var combinations = destination_2.i2();
1265
+ // Inline function 'kotlin.collections.map' call
1266
+ // Inline function 'kotlin.collections.mapTo' call
1267
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(combinations, 10));
1268
+ var tmp0_iterator_3 = combinations.j();
1269
+ while (tmp0_iterator_3.k()) {
1270
+ var item = tmp0_iterator_3.l();
1271
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.findSameCardsNumberCombinations.<anonymous>' call
1272
+ var tmp$ret$16 = sortedWith(item, CardIndexComparator_instance);
1273
+ destination_3.e(tmp$ret$16);
1274
+ }
1275
+ return destination_3;
1276
+ };
1277
+ protoOf(CombinationsCheckerProviderImpl).o65 = function (cards, supportedCombinations) {
1278
+ // Inline function 'kotlin.collections.minOf' call
1279
+ var iterator = supportedCombinations.j();
1280
+ if (!iterator.k())
1281
+ throw NoSuchElementException_init_$Create$_0();
1282
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
1283
+ var minValue = iterator.l();
1284
+ while (iterator.k()) {
1285
+ // Inline function 'io.raspberryapps.card_game.core.data.providers.combinations.CombinationsCheckerProviderImpl.createCombinationsFromCardsInRow.<anonymous>' call
1286
+ var v = iterator.l();
1287
+ if (compareTo(minValue, v) > 0) {
1288
+ minValue = v;
1289
+ }
1290
+ }
1291
+ var shortestCombinationSupport = minValue;
1292
+ var cardsToCheck = toMutableList(cards);
1293
+ // Inline function 'kotlin.collections.mutableListOf' call
1294
+ var combinations = ArrayList_init_$Create$();
1295
+ while (cardsToCheck.m() >= shortestCombinationSupport) {
1296
+ var combinationCards = createCombination(this, cardsToCheck, supportedCombinations);
1297
+ combinations.e(toList(combinationCards));
1298
+ cardsToCheck.z1(combinationCards);
1299
+ }
1300
+ // Inline function 'kotlin.collections.sortedBy' call
1301
+ // Inline function 'kotlin.comparisons.compareBy' call
1302
+ var tmp = CombinationsCheckerProviderImpl$createCombinationsFromCardsInRow$lambda;
1303
+ var tmp$ret$4 = new sam$kotlin_Comparator$0(tmp);
1304
+ return sortedWith(combinations, tmp$ret$4);
1305
+ };
1306
+ function DealerReducerImpl(logger, enableLogs) {
1307
+ this.q65_1 = logger;
1308
+ this.r65_1 = enableLogs;
1309
+ }
1310
+ protoOf(DealerReducerImpl).s65 = function (cards, cardsToRemove) {
1311
+ var list = cards;
1312
+ var _iterator__ex2g4s = cardsToRemove.j();
1313
+ while (_iterator__ex2g4s.k()) {
1314
+ var gameCard = _iterator__ex2g4s.l();
1315
+ list = this.t65(list, gameCard);
1316
+ }
1317
+ return list;
1318
+ };
1319
+ protoOf(DealerReducerImpl).t65 = function (cards, cardToRemove) {
1320
+ var tmp;
1321
+ if (!cardToRemove.b63() && cards.s1(cardToRemove)) {
1322
+ if (this.r65_1) {
1323
+ this.q65_1.d('Dealer', 'Card removed: ' + cardToRemove.toString() + ', size: ' + (cards.m() - 1 | 0));
1324
+ }
1325
+ tmp = minus(cards, cardToRemove);
1326
+ } else {
1327
+ if (this.r65_1) {
1328
+ this.q65_1.d('Dealer', 'Card removed as stub: ' + cardToRemove.toString() + ', size: ' + (cards.m() - 1 | 0));
1329
+ }
1330
+ // Inline function 'kotlin.collections.filterNot' call
1331
+ // Inline function 'kotlin.collections.filterNotTo' call
1332
+ var destination = ArrayList_init_$Create$();
1333
+ var tmp0_iterator = cards.j();
1334
+ while (tmp0_iterator.k()) {
1335
+ var element = tmp0_iterator.l();
1336
+ // Inline function 'io.raspberryapps.card_game.core.domain.dealer.DealerReducerImpl.removeCard.<anonymous>' call
1337
+ if (!element.b63()) {
1338
+ destination.e(element);
1339
+ }
1340
+ }
1341
+ var notStubCards = destination;
1342
+ // Inline function 'kotlin.collections.filter' call
1343
+ // Inline function 'kotlin.collections.filterTo' call
1344
+ var destination_0 = ArrayList_init_$Create$();
1345
+ var tmp0_iterator_0 = cards.j();
1346
+ while (tmp0_iterator_0.k()) {
1347
+ var element_0 = tmp0_iterator_0.l();
1348
+ // Inline function 'io.raspberryapps.card_game.core.domain.dealer.DealerReducerImpl.removeCard.<anonymous>' call
1349
+ if (element_0.b63()) {
1350
+ destination_0.e(element_0);
1351
+ }
1352
+ }
1353
+ var stubCards = destination_0;
1354
+ if (stubCards.p()) {
1355
+ this.q65_1.w('Dealer', "Can't find card to delete for player, " + ('cards:' + toString(cards) + ', ') + ('cardToRemove: ' + cardToRemove.toString()));
1356
+ }
1357
+ tmp = plus(notStubCards, dropLast(stubCards, 1));
1358
+ }
1359
+ return tmp;
1360
+ };
1361
+ protoOf(DealerReducerImpl).u65 = function (cards, cardToAdd) {
1362
+ if (this.r65_1) {
1363
+ this.q65_1.d('Dealer', 'Card added: ' + cardToAdd.toString() + ', size: ' + (cards.m() + 1 | 0));
1364
+ }
1365
+ if (cards.s1(cardToAdd)) {
1366
+ this.q65_1.w('Dealer', 'Card already exists for player, ' + ('cards:' + toString(cards) + ', ') + ('cardToAdd: ' + cardToAdd.toString()));
1367
+ }
1368
+ return plus_0(cards, cardToAdd);
1369
+ };
1370
+ function DealerReducer() {
1371
+ }
1372
+ //region block: post-declaration
1373
+ protoOf(CardsDealerProviderImpl).p63 = standardShuffledCards$default;
1374
+ protoOf(FakeCardsDealerProvider).p63 = standardShuffledCards$default;
1375
+ protoOf(CombinationsCheckerProviderImpl).l65 = findCardsInRowCombinations$default;
1376
+ protoOf(CombinationsCheckerProviderImpl).n65 = findSameCardsNumberCombinations$default;
1377
+ //endregion
1378
+ //region block: init
1379
+ CoreConfig_instance = new CoreConfig();
1380
+ CardIndexComparator_instance = new CardIndexComparator();
1381
+ CardNumberComparator_instance = new CardNumberComparator();
1382
+ Companion_instance = new Companion();
1383
+ Companion_instance_0 = new Companion_0();
1384
+ Companion_instance_2 = new Companion_2();
1385
+ Companion_instance_3 = new Companion_3();
1386
+ //endregion
1387
+ //region block: exports
1388
+ function $jsExportAll$(_) {
1389
+ var $io = _.io || (_.io = {});
1390
+ var $io$raspberryapps = $io.raspberryapps || ($io.raspberryapps = {});
1391
+ var $io$raspberryapps$cardgame = $io$raspberryapps.cardgame || ($io$raspberryapps.cardgame = {});
1392
+ var $io$raspberryapps$cardgame$core = $io$raspberryapps$cardgame.core || ($io$raspberryapps$cardgame.core = {});
1393
+ defineProp($io$raspberryapps$cardgame$core, 'CoreConfig', CoreConfig_getInstance);
1394
+ }
1395
+ $jsExportAll$(_);
1396
+ _.$jsExportAll$ = $jsExportAll$;
1397
+ _.$_$ = _.$_$ || {};
1398
+ _.$_$.a = CardName_ACE_getInstance;
1399
+ _.$_$.b = CardName_DAME_getInstance;
1400
+ _.$_$.c = CardName_EIGHT_getInstance;
1401
+ _.$_$.d = CardName_JACK_getInstance;
1402
+ _.$_$.e = CardName_KING_getInstance;
1403
+ _.$_$.f = CardName_NINE_getInstance;
1404
+ _.$_$.g = CardName_SEVEN_getInstance;
1405
+ _.$_$.h = CardName_TEN_getInstance;
1406
+ _.$_$.i = CardsRandomProvider_CUSTOM_getInstance;
1407
+ _.$_$.j = CardsRandomProvider_RANDOM_ORG_SIGNED_getInstance;
1408
+ _.$_$.k = CardsRandomProvider_RANDOM_ORG_getInstance;
1409
+ _.$_$.l = CardIndexComparator_instance;
1410
+ _.$_$.m = CardNumberComparator_instance;
1411
+ _.$_$.n = Companion_instance;
1412
+ _.$_$.o = Companion_getInstance_1;
1413
+ _.$_$.p = Companion_instance_2;
1414
+ _.$_$.q = GameCard;
1415
+ _.$_$.r = values;
1416
+ _.$_$.s = distributeCardsBottom;
1417
+ _.$_$.t = distributeCardsTop;
1418
+ _.$_$.u = filterByCardName;
1419
+ _.$_$.v = CardsDealerProvider;
1420
+ _.$_$.w = FakeCardsDealerProvider;
1421
+ _.$_$.x = CombinationsCheckerProviderImpl;
1422
+ _.$_$.y = CombinationsCheckerProvider;
1423
+ _.$_$.z = DealerReducerImpl;
1424
+ _.$_$.a1 = DealerReducer;
1425
+ //endregion
1426
+ return _;
1427
+ }));
1428
+
1429
+ //# sourceMappingURL=raspberry-cardgame-lib-core.js.map