cubing 0.22.1 → 0.23.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 (141) hide show
  1. package/README.md +1 -1
  2. package/alg/package.json +1 -3
  3. package/bluetooth/package.json +1 -3
  4. package/dist/bundle-global/cubing.bundle-global.js +2979 -242
  5. package/dist/esm/2x2x2.sgs.json-FRBWMMA7.js +122 -0
  6. package/dist/esm/2x2x2.sgs.json-FRBWMMA7.js.map +7 -0
  7. package/dist/esm/{3d-M7GBIT3X.js → 3d-Q4WSD4BC.js} +3 -3
  8. package/dist/esm/{3d-M7GBIT3X.js.map → 3d-Q4WSD4BC.js.map} +0 -0
  9. package/dist/esm/bluetooth/index.d.ts +1 -1
  10. package/dist/esm/bluetooth/index.js +1 -1
  11. package/dist/esm/chunk-37EHU3GZ.js +66 -0
  12. package/dist/esm/chunk-37EHU3GZ.js.map +7 -0
  13. package/dist/esm/chunk-BJIOROQC.js +18 -0
  14. package/dist/esm/chunk-BJIOROQC.js.map +7 -0
  15. package/dist/esm/{chunk-R3HRHYIW.js → chunk-DK6PXBB2.js} +1 -1
  16. package/dist/esm/{chunk-R3HRHYIW.js.map → chunk-DK6PXBB2.js.map} +0 -0
  17. package/dist/esm/chunk-DPMEZY7V.js +1552 -0
  18. package/dist/esm/chunk-DPMEZY7V.js.map +7 -0
  19. package/dist/esm/chunk-FK2SCC3Z.js +499 -0
  20. package/dist/esm/chunk-FK2SCC3Z.js.map +7 -0
  21. package/dist/esm/chunk-JZWB7AIU.js +115 -0
  22. package/dist/esm/chunk-JZWB7AIU.js.map +7 -0
  23. package/dist/esm/chunk-MLOCDLUF.js +226 -0
  24. package/dist/esm/chunk-MLOCDLUF.js.map +7 -0
  25. package/dist/esm/{chunk-GF76PWEV.js → chunk-N3RNWU5T.js} +2 -2
  26. package/dist/esm/{chunk-GF76PWEV.js.map → chunk-N3RNWU5T.js.map} +0 -0
  27. package/dist/esm/chunk-PUPUQWJC.js +4065 -0
  28. package/dist/esm/chunk-PUPUQWJC.js.map +7 -0
  29. package/dist/esm/chunk-XVZOMB6J.js +89 -0
  30. package/dist/esm/chunk-XVZOMB6J.js.map +7 -0
  31. package/dist/esm/chunk-Z6X7HTPP.js +103 -0
  32. package/dist/esm/chunk-Z6X7HTPP.js.map +7 -0
  33. package/dist/esm/entry-L6CE2HLF.js +531 -0
  34. package/dist/esm/entry-L6CE2HLF.js.map +7 -0
  35. package/dist/esm/esm-test-worker.js +3 -14
  36. package/dist/esm/esm-test-worker.js.map +3 -3
  37. package/dist/esm/fto.sgs.json-62YNULOK.js +649 -0
  38. package/dist/esm/fto.sgs.json-62YNULOK.js.map +7 -0
  39. package/dist/esm/gwt-B7CBESZR.js +1669 -0
  40. package/dist/esm/gwt-B7CBESZR.js.map +7 -0
  41. package/dist/esm/megaminx.sgs.json-PRL46G5J.js +16 -0
  42. package/dist/esm/megaminx.sgs.json-PRL46G5J.js.map +7 -0
  43. package/dist/esm/module-entry-J2N3UZP7.js +18 -0
  44. package/dist/esm/module-entry-J2N3UZP7.js.map +7 -0
  45. package/dist/esm/{node-HFBX5WHK.js → node-W3AD4HBK.js} +2 -1
  46. package/dist/esm/node-W3AD4HBK.js.map +7 -0
  47. package/dist/esm/puzzle-geometry/index.js +11 -4051
  48. package/dist/esm/puzzle-geometry/index.js.map +3 -3
  49. package/dist/esm/puzzles/index.js +1 -1
  50. package/dist/esm/pyraminx.sgs.json-7QMPT5XP.js +14 -0
  51. package/dist/esm/pyraminx.sgs.json-7QMPT5XP.js.map +7 -0
  52. package/dist/esm/scramble/index.js +4 -2
  53. package/dist/esm/scramble_444-JP3CWLJM.js +2572 -0
  54. package/dist/esm/scramble_444-JP3CWLJM.js.map +7 -0
  55. package/dist/esm/scramble_sq1-PQ2AYBFW.js +706 -0
  56. package/dist/esm/scramble_sq1-PQ2AYBFW.js.map +7 -0
  57. package/dist/esm/search/index.js +6 -3
  58. package/dist/esm/skewb.sgs.json-FWHYACJG.js +16 -0
  59. package/dist/esm/skewb.sgs.json-FWHYACJG.js.map +7 -0
  60. package/dist/esm/twisty/index.js +3 -3
  61. package/dist/esm/worker-inside-generated-string-OWJA5IIQ.js +3450 -0
  62. package/dist/esm/worker-inside-generated-string-OWJA5IIQ.js.map +7 -0
  63. package/dist/types/search/inside/module-entry-path-getter.d.ts +2 -0
  64. package/dist/types/search/inside/module-entry-path-getter.d.ts.map +1 -0
  65. package/dist/types/search/inside/module-entry.d.ts +2 -0
  66. package/dist/types/search/inside/module-entry.d.ts.map +1 -0
  67. package/dist/types/search/inside/solve/puzzles/3x3x3/index.d.ts.map +1 -1
  68. package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts +2 -1
  69. package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts.map +1 -1
  70. package/dist/types/search/inside/solve/puzzles/sq1.d.ts.map +1 -1
  71. package/dist/types/search/instantiator.d.ts +1 -2
  72. package/dist/types/search/instantiator.d.ts.map +1 -1
  73. package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
  74. package/dist/types/search/worker-inside-generated-string.d.ts.map +1 -1
  75. package/dist/types/vendor/comlink-everywhere/outside/node.d.ts.map +1 -1
  76. package/docs/.DS_Store +0 -0
  77. package/docs/cubing/.DS_Store +0 -0
  78. package/docs/cubing/index.html +1 -1
  79. package/kpuzzle/package.json +1 -3
  80. package/notation/package.json +1 -3
  81. package/package.json +2 -6
  82. package/protocol/package.json +1 -3
  83. package/puzzle-geometry/package.json +1 -3
  84. package/puzzles/package.json +1 -3
  85. package/scramble/package.json +1 -3
  86. package/search/package.json +1 -3
  87. package/src/cubing/.DS_Store +0 -0
  88. package/src/cubing/search/.DS_Store +0 -0
  89. package/src/cubing/search/inside/.DS_Store +0 -0
  90. package/src/cubing/search/inside/module-entry-path-getter.ts +5 -0
  91. package/src/cubing/search/inside/module-entry.ts +20 -0
  92. package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +13 -3
  93. package/src/cubing/search/inside/solve/puzzles/4x4x4.ts +19 -5
  94. package/src/cubing/search/inside/solve/puzzles/fto.sgs.json.ts +356 -13
  95. package/src/cubing/search/inside/solve/puzzles/sq1.ts +12 -2
  96. package/src/cubing/search/instantiator.ts +75 -40
  97. package/src/cubing/search/worker-inside-generated-string.js +1 -1
  98. package/src/cubing/vendor/.DS_Store +0 -0
  99. package/src/cubing/vendor/comlink-everywhere/.DS_Store +0 -0
  100. package/src/cubing/vendor/comlink-everywhere/outside/node.js +1 -0
  101. package/src/cubing/vendor/cstimer/.DS_Store +0 -0
  102. package/src/cubing/{search/inside/solve/puzzles → vendor/cstimer/src}/.DS_Store +0 -0
  103. package/src/cubing/vendor/random-uint-below/random53BitValue.ts +1 -1
  104. package/src/cubing/vendor/sq12phase/scramble_sq1.js +2 -2
  105. package/src/cubing/{twisty/heavy-code-imports → vendor/three}/.DS_Store +0 -0
  106. package/src/cubing/{twisty/old/animation → vendor/three/examples}/.DS_Store +0 -0
  107. package/stream/package.json +1 -3
  108. package/twisty/package.json +1 -3
  109. package/alg/index.d.ts +0 -1
  110. package/bluetooth/index.d.ts +0 -1
  111. package/dist/.DS_Store +0 -0
  112. package/dist/esm/chunk-6BZSKSG7.js +0 -1368
  113. package/dist/esm/chunk-6BZSKSG7.js.map +0 -7
  114. package/dist/esm/index.d.ts +0 -1
  115. package/dist/esm/node-HFBX5WHK.js.map +0 -7
  116. package/dist/esm/worker-inside-generated-string-RQYYANYQ.js +0 -3107
  117. package/dist/esm/worker-inside-generated-string-RQYYANYQ.js.map +0 -7
  118. package/kpuzzle/index.d.ts +0 -1
  119. package/notation/index.d.ts +0 -1
  120. package/protocol/index.d.ts +0 -1
  121. package/puzzle-geometry/index.d.ts +0 -1
  122. package/puzzles/index.d.ts +0 -1
  123. package/scramble/index.d.ts +0 -1
  124. package/search/index.d.ts +0 -1
  125. package/src/cubing/puzzles/.DS_Store +0 -0
  126. package/src/cubing/puzzles/implementations/.DS_Store +0 -0
  127. package/src/cubing/search/inside/solve/.DS_Store +0 -0
  128. package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
  129. package/src/cubing/twisty/.DS_Store +0 -0
  130. package/src/cubing/twisty/controllers/.DS_Store +0 -0
  131. package/src/cubing/twisty/controllers/animation/.DS_Store +0 -0
  132. package/src/cubing/twisty/controllers/indexer/.DS_Store +0 -0
  133. package/src/cubing/twisty/model/.DS_Store +0 -0
  134. package/src/cubing/twisty/model/props/.DS_Store +0 -0
  135. package/src/cubing/twisty/model/props/puzzle/.DS_Store +0 -0
  136. package/src/cubing/twisty/old/.DS_Store +0 -0
  137. package/src/cubing/twisty/old/dom/.DS_Store +0 -0
  138. package/src/cubing/twisty/views/.DS_Store +0 -0
  139. package/src/cubing/twisty/views/3D/.DS_Store +0 -0
  140. package/stream/index.d.ts +0 -1
  141. package/twisty/index.d.ts +0 -1
@@ -0,0 +1,2572 @@
1
+ import {
2
+ mustBeInsideWorker,
3
+ random333Scramble
4
+ } from "./chunk-FK2SCC3Z.js";
5
+ import {
6
+ randomUIntBelowFactory
7
+ } from "./chunk-37EHU3GZ.js";
8
+ import "./chunk-DK6PXBB2.js";
9
+ import "./chunk-X6JHXPDX.js";
10
+ import {
11
+ Alg
12
+ } from "./chunk-EWRBHQFX.js";
13
+ import "./chunk-WO2AXYFE.js";
14
+
15
+ // src/cubing/vendor/cstimer/src/js/lib/mathlib.ts
16
+ var Cnk = [];
17
+ var fact = [1];
18
+ for (let i = 0; i < 32; ++i) {
19
+ Cnk[i] = [];
20
+ for (let j = 0; j < 32; ++j) {
21
+ Cnk[i][j] = 0;
22
+ }
23
+ }
24
+ for (let i = 0; i < 32; ++i) {
25
+ Cnk[i][0] = Cnk[i][i] = 1;
26
+ fact[i + 1] = fact[i] * (i + 1);
27
+ for (let j = 1; j < i; ++j) {
28
+ Cnk[i][j] = Cnk[i - 1][j - 1] + Cnk[i - 1][j];
29
+ }
30
+ }
31
+ function circle(arr, ...moreArgs) {
32
+ const length = moreArgs.length, temp = arr[moreArgs[length - 1]];
33
+ for (let i = length; i > 0; i--) {
34
+ arr[moreArgs[i]] = arr[moreArgs[i - 1]];
35
+ }
36
+ arr[moreArgs[0]] = temp;
37
+ return circle;
38
+ }
39
+ function set8Perm(arr, idx, n, even) {
40
+ n = (n || 8) - 1;
41
+ let val = 1985229328;
42
+ let prt = 0;
43
+ even ?? (even = 0);
44
+ if (even < 0) {
45
+ idx <<= 1;
46
+ }
47
+ for (let i = 0; i < n; ++i) {
48
+ const p = fact[n - i];
49
+ let v = ~~(idx / p);
50
+ prt ^= v;
51
+ idx %= p;
52
+ v <<= 2;
53
+ arr[i] = val >> v & 7;
54
+ const m = (1 << v) - 1;
55
+ val = (val & m) + (val >> 4 & ~m);
56
+ }
57
+ if (even < 0 && (prt & 1) !== 0) {
58
+ arr[n] = arr[n - 1];
59
+ arr[n - 1] = val & 7;
60
+ } else {
61
+ arr[n] = val & 7;
62
+ }
63
+ return arr;
64
+ }
65
+
66
+ // src/cubing/vendor/cstimer/src/js/scramble/scramble_444.ts
67
+ function createArray(length1, length2) {
68
+ const result = new Array(length1);
69
+ if (length2 !== void 0) {
70
+ for (let i = 0; i < length1; i++) {
71
+ result[i] = new Array(length2);
72
+ }
73
+ }
74
+ return result;
75
+ }
76
+ var _;
77
+ var seedTable = {};
78
+ var CM$ = {};
79
+ var Q$Object = 0;
80
+ var Q$Serializable = 30;
81
+ var Q$Center1 = 21;
82
+ var Q$CornerCube = 22;
83
+ var Q$Edge3 = 23;
84
+ var Q$FullCube_0 = 24;
85
+ var Q$FullCube_$1 = 25;
86
+ var Q$Comparable = 34;
87
+ var Q$Search_0 = 26;
88
+ var Q$Object_$1 = 40;
89
+ function newSeed(id) {
90
+ return new seedTable[id]();
91
+ }
92
+ function defineSeed(id, superSeed, castableTypeMap, ...moreArgs) {
93
+ let seed = seedTable[id];
94
+ if (seed && !seed.___clazz$) {
95
+ _ = seed.prototype;
96
+ } else {
97
+ !seed && (seed = seedTable[id] = function() {
98
+ });
99
+ _ = seed.prototype = superSeed < 0 ? {} : newSeed(superSeed);
100
+ _.castableTypeMap$ = castableTypeMap;
101
+ }
102
+ for (const arg of moreArgs) {
103
+ arg.prototype = _;
104
+ }
105
+ if (seed.___clazz$) {
106
+ _.___clazz$ = seed.___clazz$;
107
+ seed.___clazz$ = null;
108
+ }
109
+ }
110
+ function makeCastMap(a) {
111
+ const result = {};
112
+ for (let i_0 = 0, c = a.length; i_0 < c; ++i_0) {
113
+ result[a[i_0]] = 1;
114
+ }
115
+ return result;
116
+ }
117
+ defineSeed(1, -1, CM$);
118
+ _.value = null;
119
+ function Array_0() {
120
+ }
121
+ function createFrom(a, length_0) {
122
+ const result = createFromSeed(0, length_0);
123
+ initValues(a.___clazz$, a.castableTypeMap$, a.queryId$, result);
124
+ return result;
125
+ }
126
+ function createFromSeed(seedType, length_0) {
127
+ const array = new Array(length_0);
128
+ if (seedType === 3) {
129
+ for (let i_0 = 0; i_0 < length_0; ++i_0) {
130
+ const value = {
131
+ m: 0,
132
+ l: 0,
133
+ h: 0
134
+ };
135
+ value.l = value.m = value.h = 0;
136
+ array[i_0] = value;
137
+ }
138
+ } else if (seedType > 0) {
139
+ const value = [null, 0, false][seedType];
140
+ for (let i_0 = 0; i_0 < length_0; ++i_0) {
141
+ array[i_0] = value;
142
+ }
143
+ }
144
+ return array;
145
+ }
146
+ function initDim(arrayClass, castableTypeMap, queryId, length_0, seedType) {
147
+ const result = createFromSeed(seedType, length_0);
148
+ initValues(arrayClass, castableTypeMap, queryId, result);
149
+ return result;
150
+ }
151
+ function initValues(arrayClass, castableTypeMap, queryId, array) {
152
+ $clinit_Array$ExpandoWrapper();
153
+ wrapArray(array, expandoNames_0, expandoValues_0);
154
+ array.___clazz$ = arrayClass;
155
+ array.castableTypeMap$ = castableTypeMap;
156
+ array.queryId$ = queryId;
157
+ return array;
158
+ }
159
+ function setCheck(array, index, value) {
160
+ return array[index] = value;
161
+ }
162
+ defineSeed(73, 1, {}, Array_0);
163
+ _.queryId$ = 0;
164
+ var ran$clinit_Array$ExpandoWrapper = false;
165
+ function $clinit_Array$ExpandoWrapper() {
166
+ if (ran$clinit_Array$ExpandoWrapper) {
167
+ return;
168
+ }
169
+ ran$clinit_Array$ExpandoWrapper = true;
170
+ expandoNames_0 = [];
171
+ expandoValues_0 = [];
172
+ initExpandos(new Array_0(), expandoNames_0, expandoValues_0);
173
+ }
174
+ function initExpandos(protoType, expandoNames, expandoValues) {
175
+ let i_0 = 0, value;
176
+ for (const name_0 in protoType) {
177
+ if (value = protoType[name_0]) {
178
+ expandoNames[i_0] = name_0;
179
+ expandoValues[i_0] = value;
180
+ ++i_0;
181
+ }
182
+ }
183
+ }
184
+ function wrapArray(array, expandoNames, expandoValues) {
185
+ $clinit_Array$ExpandoWrapper();
186
+ for (let i_0 = 0, c = expandoNames.length; i_0 < c; ++i_0) {
187
+ array[expandoNames[i_0]] = expandoValues[i_0];
188
+ }
189
+ }
190
+ var expandoNames_0;
191
+ var expandoValues_0;
192
+ function canCast(src, dstId) {
193
+ return src.castableTypeMap$ && !!src.castableTypeMap$[dstId];
194
+ }
195
+ function instanceOf(src, dstId) {
196
+ return src !== null && canCast(src, dstId);
197
+ }
198
+ var ran$clinit_Center1 = false;
199
+ function $clinit_Center1() {
200
+ if (ran$clinit_Center1) {
201
+ return false;
202
+ }
203
+ ran$clinit_Center1 = true;
204
+ ctsmv = createArray(15582, 36);
205
+ sym2raw = createArray(15582);
206
+ csprun = createArray(15582);
207
+ symmult = createArray(48, 48);
208
+ symmove = createArray(48, 36);
209
+ syminv = createArray(48);
210
+ finish_0 = createArray(48);
211
+ }
212
+ function $$init_1(this$static) {
213
+ this$static.ct = createArray(24);
214
+ }
215
+ function $equals(this$static, obj) {
216
+ let c, i_0;
217
+ if (instanceOf(obj, Q$Center1)) {
218
+ c = obj;
219
+ for (i_0 = 0; i_0 < 24; ++i_0) {
220
+ if (this$static.ct[i_0] !== c.ct[i_0]) {
221
+ return false;
222
+ }
223
+ }
224
+ return true;
225
+ }
226
+ return false;
227
+ }
228
+ function $get_1(this$static) {
229
+ let i_0, idx, r;
230
+ idx = 0;
231
+ r = 8;
232
+ for (i_0 = 23; i_0 >= 0; --i_0) {
233
+ this$static.ct[i_0] === 1 && (idx += Cnk[i_0][r--]);
234
+ }
235
+ return idx;
236
+ }
237
+ function $getsym(this$static) {
238
+ let cord, j;
239
+ if (raw2sym !== null) {
240
+ return raw2sym[$get_1(this$static)];
241
+ }
242
+ for (j = 0; j < 48; ++j) {
243
+ cord = raw2sym_0($get_1(this$static));
244
+ if (cord !== -1)
245
+ return cord * 64 + j;
246
+ $rot(this$static, 0);
247
+ j % 2 === 1 && $rot(this$static, 1);
248
+ j % 8 === 7 && $rot(this$static, 2);
249
+ j % 16 === 15 && $rot(this$static, 3);
250
+ }
251
+ }
252
+ function $move(this$static, m_0) {
253
+ const key = m_0 % 3;
254
+ m_0 = ~~(m_0 / 3);
255
+ switch (m_0) {
256
+ case 0:
257
+ swap(this$static.ct, 0, 1, 2, 3, key);
258
+ break;
259
+ case 1:
260
+ swap(this$static.ct, 16, 17, 18, 19, key);
261
+ break;
262
+ case 2:
263
+ swap(this$static.ct, 8, 9, 10, 11, key);
264
+ break;
265
+ case 3:
266
+ swap(this$static.ct, 4, 5, 6, 7, key);
267
+ break;
268
+ case 4:
269
+ swap(this$static.ct, 20, 21, 22, 23, key);
270
+ break;
271
+ case 5:
272
+ swap(this$static.ct, 12, 13, 14, 15, key);
273
+ break;
274
+ case 6:
275
+ swap(this$static.ct, 0, 1, 2, 3, key);
276
+ swap(this$static.ct, 8, 20, 12, 16, key);
277
+ swap(this$static.ct, 9, 21, 13, 17, key);
278
+ break;
279
+ case 7:
280
+ swap(this$static.ct, 16, 17, 18, 19, key);
281
+ swap(this$static.ct, 1, 15, 5, 9, key);
282
+ swap(this$static.ct, 2, 12, 6, 10, key);
283
+ break;
284
+ case 8:
285
+ swap(this$static.ct, 8, 9, 10, 11, key);
286
+ swap(this$static.ct, 2, 19, 4, 21, key);
287
+ swap(this$static.ct, 3, 16, 5, 22, key);
288
+ break;
289
+ case 9:
290
+ swap(this$static.ct, 4, 5, 6, 7, key);
291
+ swap(this$static.ct, 10, 18, 14, 22, key);
292
+ swap(this$static.ct, 11, 19, 15, 23, key);
293
+ break;
294
+ case 10:
295
+ swap(this$static.ct, 20, 21, 22, 23, key);
296
+ swap(this$static.ct, 0, 8, 4, 14, key);
297
+ swap(this$static.ct, 3, 11, 7, 13, key);
298
+ break;
299
+ case 11:
300
+ swap(this$static.ct, 12, 13, 14, 15, key);
301
+ swap(this$static.ct, 1, 20, 7, 18, key);
302
+ swap(this$static.ct, 0, 23, 6, 17, key);
303
+ }
304
+ }
305
+ function $rot(this$static, r) {
306
+ switch (r) {
307
+ case 0:
308
+ $move(this$static, 19);
309
+ $move(this$static, 28);
310
+ break;
311
+ case 1:
312
+ $move(this$static, 21);
313
+ $move(this$static, 32);
314
+ break;
315
+ case 2:
316
+ swap(this$static.ct, 0, 3, 1, 2, 1);
317
+ swap(this$static.ct, 8, 11, 9, 10, 1);
318
+ swap(this$static.ct, 4, 7, 5, 6, 1);
319
+ swap(this$static.ct, 12, 15, 13, 14, 1);
320
+ swap(this$static.ct, 16, 19, 21, 22, 1);
321
+ swap(this$static.ct, 17, 18, 20, 23, 1);
322
+ break;
323
+ case 3:
324
+ $move(this$static, 18);
325
+ $move(this$static, 29);
326
+ $move(this$static, 24);
327
+ $move(this$static, 35);
328
+ }
329
+ }
330
+ function $rotate(this$static, r) {
331
+ let j;
332
+ for (j = 0; j < r; ++j) {
333
+ $rot(this$static, 0);
334
+ j % 2 === 1 && $rot(this$static, 1);
335
+ j % 8 === 7 && $rot(this$static, 2);
336
+ j % 16 === 15 && $rot(this$static, 3);
337
+ }
338
+ }
339
+ function $set_0(this$static, idx) {
340
+ let i_0, r;
341
+ r = 8;
342
+ for (i_0 = 23; i_0 >= 0; --i_0) {
343
+ this$static.ct[i_0] = 0;
344
+ if (idx >= Cnk[i_0][r]) {
345
+ idx -= Cnk[i_0][r--];
346
+ this$static.ct[i_0] = 1;
347
+ }
348
+ }
349
+ }
350
+ function $set_1(this$static, c) {
351
+ let i_0;
352
+ for (i_0 = 0; i_0 < 24; ++i_0) {
353
+ this$static.ct[i_0] = c.ct[i_0];
354
+ }
355
+ }
356
+ function Center1_0() {
357
+ let i_0;
358
+ $$init_1(this);
359
+ for (i_0 = 0; i_0 < 8; ++i_0) {
360
+ this.ct[i_0] = 1;
361
+ }
362
+ for (i_0 = 8; i_0 < 24; ++i_0) {
363
+ this.ct[i_0] = 0;
364
+ }
365
+ }
366
+ function Center1_1(c, urf) {
367
+ let i_0;
368
+ $$init_1(this);
369
+ for (i_0 = 0; i_0 < 24; ++i_0) {
370
+ this.ct[i_0] = ~~(c.ct[i_0] / 2) === urf ? 1 : 0;
371
+ }
372
+ }
373
+ function Center1_2(ct) {
374
+ let i_0;
375
+ $$init_1(this);
376
+ for (i_0 = 0; i_0 < 24; ++i_0) {
377
+ this.ct[i_0] = ct[i_0];
378
+ }
379
+ }
380
+ function createMoveTable() {
381
+ let i_0, m_0;
382
+ const c = new Center1_0();
383
+ const d = new Center1_0();
384
+ for (i_0 = 0; i_0 < 15582; ++i_0) {
385
+ $set_0(d, sym2raw[i_0]);
386
+ for (m_0 = 0; m_0 < 36; ++m_0) {
387
+ $set_1(c, d);
388
+ $move(c, m_0);
389
+ ctsmv[i_0][m_0] = $getsym(c);
390
+ }
391
+ }
392
+ }
393
+ function createPrun() {
394
+ let check, depth, done, i_0, idx, inv, m_0, select;
395
+ fill_0(csprun);
396
+ csprun[0] = 0;
397
+ depth = 0;
398
+ done = 1;
399
+ while (done !== 15582) {
400
+ inv = depth > 4;
401
+ select = inv ? -1 : depth;
402
+ check = inv ? depth : -1;
403
+ ++depth;
404
+ for (i_0 = 0; i_0 < 15582; ++i_0) {
405
+ if (csprun[i_0] !== select) {
406
+ continue;
407
+ }
408
+ for (m_0 = 0; m_0 < 27; ++m_0) {
409
+ idx = ~~ctsmv[i_0][m_0] >>> 6;
410
+ if (csprun[idx] !== check) {
411
+ continue;
412
+ }
413
+ ++done;
414
+ if (inv) {
415
+ csprun[i_0] = depth;
416
+ break;
417
+ } else {
418
+ csprun[idx] = depth;
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ function getSolvedSym(cube) {
425
+ let check, i_0, j;
426
+ const c = new Center1_2(cube.ct);
427
+ for (j = 0; j < 48; ++j) {
428
+ check = true;
429
+ for (i_0 = 0; i_0 < 24; ++i_0) {
430
+ if (c.ct[i_0] !== ~~(i_0 / 4)) {
431
+ check = false;
432
+ break;
433
+ }
434
+ }
435
+ if (check) {
436
+ return j;
437
+ }
438
+ $rot(c, 0);
439
+ j % 2 === 1 && $rot(c, 1);
440
+ j % 8 === 7 && $rot(c, 2);
441
+ j % 16 === 15 && $rot(c, 3);
442
+ }
443
+ return -1;
444
+ }
445
+ function initSym_0() {
446
+ let i_0, j, k_0;
447
+ const c = new Center1_0();
448
+ for (i_0 = 0; i_0 < 24; ++i_0) {
449
+ c.ct[i_0] = i_0;
450
+ }
451
+ const d = new Center1_2(c.ct);
452
+ const e = new Center1_2(c.ct);
453
+ const f = new Center1_2(c.ct);
454
+ for (i_0 = 0; i_0 < 48; ++i_0) {
455
+ for (j = 0; j < 48; ++j) {
456
+ for (k_0 = 0; k_0 < 48; ++k_0) {
457
+ if ($equals(c, d)) {
458
+ symmult[i_0][j] = k_0;
459
+ k_0 === 0 && (syminv[i_0] = j);
460
+ }
461
+ $rot(d, 0);
462
+ k_0 % 2 === 1 && $rot(d, 1);
463
+ k_0 % 8 === 7 && $rot(d, 2);
464
+ k_0 % 16 === 15 && $rot(d, 3);
465
+ }
466
+ $rot(c, 0);
467
+ j % 2 === 1 && $rot(c, 1);
468
+ j % 8 === 7 && $rot(c, 2);
469
+ j % 16 === 15 && $rot(c, 3);
470
+ }
471
+ $rot(c, 0);
472
+ i_0 % 2 === 1 && $rot(c, 1);
473
+ i_0 % 8 === 7 && $rot(c, 2);
474
+ i_0 % 16 === 15 && $rot(c, 3);
475
+ }
476
+ for (i_0 = 0; i_0 < 48; ++i_0) {
477
+ $set_1(c, e);
478
+ $rotate(c, syminv[i_0]);
479
+ for (j = 0; j < 36; ++j) {
480
+ $set_1(d, c);
481
+ $move(d, j);
482
+ $rotate(d, i_0);
483
+ for (k_0 = 0; k_0 < 36; ++k_0) {
484
+ $set_1(f, e);
485
+ $move(f, k_0);
486
+ if ($equals(f, d)) {
487
+ symmove[i_0][j] = k_0;
488
+ break;
489
+ }
490
+ }
491
+ }
492
+ }
493
+ $set_0(c, 0);
494
+ for (i_0 = 0; i_0 < 48; ++i_0) {
495
+ finish_0[syminv[i_0]] = $get_1(c);
496
+ $rot(c, 0);
497
+ i_0 % 2 === 1 && $rot(c, 1);
498
+ i_0 % 8 === 7 && $rot(c, 2);
499
+ i_0 % 16 === 15 && $rot(c, 3);
500
+ }
501
+ }
502
+ function initSym2Raw() {
503
+ let count, i_0, idx, j;
504
+ const c = new Center1_0();
505
+ const occ = createArray(22984);
506
+ for (i_0 = 0; i_0 < 22984; i_0++) {
507
+ occ[i_0] = 0;
508
+ }
509
+ count = 0;
510
+ for (i_0 = 0; i_0 < 735471; ++i_0) {
511
+ if ((occ[~~i_0 >>> 5] & 1 << (i_0 & 31)) === 0) {
512
+ $set_0(c, i_0);
513
+ for (j = 0; j < 48; ++j) {
514
+ idx = $get_1(c);
515
+ occ[~~idx >>> 5] |= 1 << (idx & 31);
516
+ raw2sym !== null && (raw2sym[idx] = count << 6 | syminv[j]);
517
+ $rot(c, 0);
518
+ j % 2 === 1 && $rot(c, 1);
519
+ j % 8 === 7 && $rot(c, 2);
520
+ j % 16 === 15 && $rot(c, 3);
521
+ }
522
+ sym2raw[count++] = i_0;
523
+ }
524
+ }
525
+ }
526
+ function raw2sym_0(n) {
527
+ const m_0 = binarySearch_0(sym2raw, n);
528
+ return m_0 >= 0 ? m_0 : -1;
529
+ }
530
+ defineSeed(153, 1, makeCastMap([Q$Center1]), Center1_0, Center1_1, Center1_2);
531
+ var csprun;
532
+ var ctsmv;
533
+ var finish_0;
534
+ var raw2sym = null;
535
+ var sym2raw;
536
+ var syminv;
537
+ var symmove;
538
+ var symmult;
539
+ var ran$clinit_Center2 = false;
540
+ function $clinit_Center2() {
541
+ if (ran$clinit_Center2) {
542
+ return;
543
+ }
544
+ ran$clinit_Center2 = true;
545
+ rlmv = createArray(70, 28);
546
+ ctmv = createArray(6435, 28);
547
+ rlrot = createArray(70, 16);
548
+ ctrot = createArray(6435, 16);
549
+ ctprun = createArray(450450);
550
+ pmv = [
551
+ 0,
552
+ 0,
553
+ 0,
554
+ 0,
555
+ 0,
556
+ 0,
557
+ 0,
558
+ 0,
559
+ 0,
560
+ 0,
561
+ 0,
562
+ 0,
563
+ 0,
564
+ 0,
565
+ 0,
566
+ 0,
567
+ 0,
568
+ 0,
569
+ 0,
570
+ 0,
571
+ 0,
572
+ 1,
573
+ 0,
574
+ 1,
575
+ 0,
576
+ 0,
577
+ 0,
578
+ 0,
579
+ 0,
580
+ 0,
581
+ 1,
582
+ 0,
583
+ 1,
584
+ 0,
585
+ 0,
586
+ 0
587
+ ];
588
+ }
589
+ function $getct(this$static) {
590
+ let i_0, idx, r;
591
+ idx = 0;
592
+ r = 8;
593
+ for (i_0 = 14; i_0 >= 0; --i_0) {
594
+ this$static.ct[i_0] !== this$static.ct[15] && (idx += Cnk[i_0][r--]);
595
+ }
596
+ return idx;
597
+ }
598
+ function $getrl(this$static) {
599
+ let i_0, idx, r;
600
+ idx = 0;
601
+ r = 4;
602
+ for (i_0 = 6; i_0 >= 0; --i_0) {
603
+ this$static.rl[i_0] !== this$static.rl[7] && (idx += Cnk[i_0][r--]);
604
+ }
605
+ return idx * 2 + this$static.parity;
606
+ }
607
+ function $move_0(this$static, m_0) {
608
+ this$static.parity ^= pmv[m_0];
609
+ const key = m_0 % 3;
610
+ m_0 = ~~(m_0 / 3);
611
+ switch (m_0) {
612
+ case 0:
613
+ swap(this$static.ct, 0, 1, 2, 3, key);
614
+ break;
615
+ case 1:
616
+ swap(this$static.rl, 0, 1, 2, 3, key);
617
+ break;
618
+ case 2:
619
+ swap(this$static.ct, 8, 9, 10, 11, key);
620
+ break;
621
+ case 3:
622
+ swap(this$static.ct, 4, 5, 6, 7, key);
623
+ break;
624
+ case 4:
625
+ swap(this$static.rl, 4, 5, 6, 7, key);
626
+ break;
627
+ case 5:
628
+ swap(this$static.ct, 12, 13, 14, 15, key);
629
+ break;
630
+ case 6:
631
+ swap(this$static.ct, 0, 1, 2, 3, key);
632
+ swap(this$static.rl, 0, 5, 4, 1, key);
633
+ swap(this$static.ct, 8, 9, 12, 13, key);
634
+ break;
635
+ case 7:
636
+ swap(this$static.rl, 0, 1, 2, 3, key);
637
+ swap(this$static.ct, 1, 15, 5, 9, key);
638
+ swap(this$static.ct, 2, 12, 6, 10, key);
639
+ break;
640
+ case 8:
641
+ swap(this$static.ct, 8, 9, 10, 11, key);
642
+ swap(this$static.rl, 0, 3, 6, 5, key);
643
+ swap(this$static.ct, 3, 2, 5, 4, key);
644
+ break;
645
+ case 9:
646
+ swap(this$static.ct, 4, 5, 6, 7, key);
647
+ swap(this$static.rl, 3, 2, 7, 6, key);
648
+ swap(this$static.ct, 11, 10, 15, 14, key);
649
+ break;
650
+ case 10:
651
+ swap(this$static.rl, 4, 5, 6, 7, key);
652
+ swap(this$static.ct, 0, 8, 4, 14, key);
653
+ swap(this$static.ct, 3, 11, 7, 13, key);
654
+ break;
655
+ case 11:
656
+ swap(this$static.ct, 12, 13, 14, 15, key);
657
+ swap(this$static.rl, 1, 4, 7, 2, key);
658
+ swap(this$static.ct, 1, 0, 7, 6, key);
659
+ }
660
+ }
661
+ function $rot_0(this$static, r) {
662
+ switch (r) {
663
+ case 0:
664
+ $move_0(this$static, 19);
665
+ $move_0(this$static, 28);
666
+ break;
667
+ case 1:
668
+ $move_0(this$static, 21);
669
+ $move_0(this$static, 32);
670
+ break;
671
+ case 2:
672
+ swap(this$static.ct, 0, 3, 1, 2, 1);
673
+ swap(this$static.ct, 8, 11, 9, 10, 1);
674
+ swap(this$static.ct, 4, 7, 5, 6, 1);
675
+ swap(this$static.ct, 12, 15, 13, 14, 1);
676
+ swap(this$static.rl, 0, 3, 5, 6, 1);
677
+ swap(this$static.rl, 1, 2, 4, 7, 1);
678
+ }
679
+ }
680
+ function $set_2(this$static, c, edgeParity) {
681
+ let i_0;
682
+ for (i_0 = 0; i_0 < 16; ++i_0) {
683
+ this$static.ct[i_0] = ~~(c.ct[i_0] / 2);
684
+ }
685
+ for (i_0 = 0; i_0 < 8; ++i_0) {
686
+ this$static.rl[i_0] = c.ct[i_0 + 16];
687
+ }
688
+ this$static.parity = edgeParity;
689
+ }
690
+ function $setct(this$static, idx) {
691
+ let i_0, r;
692
+ r = 8;
693
+ this$static.ct[15] = 0;
694
+ for (i_0 = 14; i_0 >= 0; --i_0) {
695
+ if (idx >= Cnk[i_0][r]) {
696
+ idx -= Cnk[i_0][r--];
697
+ this$static.ct[i_0] = 1;
698
+ } else {
699
+ this$static.ct[i_0] = 0;
700
+ }
701
+ }
702
+ }
703
+ function $setrl(this$static, idx) {
704
+ let i_0, r;
705
+ this$static.parity = idx & 1;
706
+ idx >>>= 1;
707
+ r = 4;
708
+ this$static.rl[7] = 0;
709
+ for (i_0 = 6; i_0 >= 0; --i_0) {
710
+ if (idx >= Cnk[i_0][r]) {
711
+ idx -= Cnk[i_0][r--];
712
+ this$static.rl[i_0] = 1;
713
+ } else {
714
+ this$static.rl[i_0] = 0;
715
+ }
716
+ }
717
+ }
718
+ function Center2_0() {
719
+ this.rl = createArray(8);
720
+ this.ct = createArray(16);
721
+ }
722
+ function init_3() {
723
+ let ct, ctx, depth, done, i_0, idx, j, m_0, rl, rlx;
724
+ const c = new Center2_0();
725
+ for (i_0 = 0; i_0 < 70; ++i_0) {
726
+ for (m_0 = 0; m_0 < 28; ++m_0) {
727
+ $setrl(c, i_0);
728
+ $move_0(c, move2std[m_0]);
729
+ rlmv[i_0][m_0] = $getrl(c);
730
+ }
731
+ }
732
+ for (i_0 = 0; i_0 < 70; ++i_0) {
733
+ $setrl(c, i_0);
734
+ for (j = 0; j < 16; ++j) {
735
+ rlrot[i_0][j] = $getrl(c);
736
+ $rot_0(c, 0);
737
+ j % 2 === 1 && $rot_0(c, 1);
738
+ j % 8 === 7 && $rot_0(c, 2);
739
+ }
740
+ }
741
+ for (i_0 = 0; i_0 < 6435; ++i_0) {
742
+ $setct(c, i_0);
743
+ for (j = 0; j < 16; ++j) {
744
+ ctrot[i_0][j] = $getct(c) & 65535;
745
+ $rot_0(c, 0);
746
+ j % 2 === 1 && $rot_0(c, 1);
747
+ j % 8 === 7 && $rot_0(c, 2);
748
+ }
749
+ }
750
+ for (i_0 = 0; i_0 < 6435; ++i_0) {
751
+ for (m_0 = 0; m_0 < 28; ++m_0) {
752
+ $setct(c, i_0);
753
+ $move_0(c, move2std[m_0]);
754
+ ctmv[i_0][m_0] = $getct(c) & 65535;
755
+ }
756
+ }
757
+ fill_0(ctprun);
758
+ ctprun[0] = ctprun[18] = ctprun[28] = ctprun[46] = ctprun[54] = ctprun[56] = 0;
759
+ depth = 0;
760
+ done = 6;
761
+ while (done !== 450450) {
762
+ const inv = depth > 6;
763
+ const select = inv ? -1 : depth;
764
+ const check = inv ? depth : -1;
765
+ ++depth;
766
+ for (i_0 = 0; i_0 < 450450; ++i_0) {
767
+ if (ctprun[i_0] !== select) {
768
+ continue;
769
+ }
770
+ ct = ~~(i_0 / 70);
771
+ rl = i_0 % 70;
772
+ for (m_0 = 0; m_0 < 23; ++m_0) {
773
+ ctx = ctmv[ct][m_0];
774
+ rlx = rlmv[rl][m_0];
775
+ idx = ctx * 70 + rlx;
776
+ if (ctprun[idx] !== check) {
777
+ continue;
778
+ }
779
+ ++done;
780
+ if (inv) {
781
+ ctprun[i_0] = depth;
782
+ break;
783
+ } else {
784
+ ctprun[idx] = depth;
785
+ }
786
+ }
787
+ }
788
+ }
789
+ }
790
+ defineSeed(154, 1, {}, Center2_0);
791
+ _.parity = 0;
792
+ var ctmv;
793
+ var ctprun;
794
+ var ctrot;
795
+ var pmv;
796
+ var rlmv;
797
+ var rlrot;
798
+ var ran$clinit_Center3 = false;
799
+ function $clinit_Center3() {
800
+ if (ran$clinit_Center3) {
801
+ return;
802
+ }
803
+ ran$clinit_Center3 = true;
804
+ ctmove = createArray(29400, 20);
805
+ pmove = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1];
806
+ prun_0 = createArray(29400);
807
+ rl2std = [0, 9, 14, 23, 27, 28, 41, 42, 46, 55, 60, 69];
808
+ std2rl = createArray(70);
809
+ }
810
+ function $getct_0(this$static) {
811
+ let i_0, idx, idxrl, r;
812
+ idx = 0;
813
+ r = 4;
814
+ for (i_0 = 6; i_0 >= 0; --i_0) {
815
+ this$static.ud[i_0] !== this$static.ud[7] && (idx += Cnk[i_0][r--]);
816
+ }
817
+ idx *= 35;
818
+ r = 4;
819
+ for (i_0 = 6; i_0 >= 0; --i_0) {
820
+ this$static.fb[i_0] !== this$static.fb[7] && (idx += Cnk[i_0][r--]);
821
+ }
822
+ idx *= 12;
823
+ const check = this$static.fb[7] ^ this$static.ud[7];
824
+ idxrl = 0;
825
+ r = 4;
826
+ for (i_0 = 7; i_0 >= 0; --i_0) {
827
+ this$static.rl[i_0] !== check && (idxrl += Cnk[i_0][r--]);
828
+ }
829
+ return this$static.parity + 2 * (idx + std2rl[idxrl]);
830
+ }
831
+ function $move_1(this$static, i_0) {
832
+ this$static.parity ^= pmove[i_0];
833
+ switch (i_0) {
834
+ case 0:
835
+ case 1:
836
+ case 2:
837
+ swap(this$static.ud, 0, 1, 2, 3, i_0 % 3);
838
+ break;
839
+ case 3:
840
+ swap(this$static.rl, 0, 1, 2, 3, 1);
841
+ break;
842
+ case 4:
843
+ case 5:
844
+ case 6:
845
+ swap(this$static.fb, 0, 1, 2, 3, (i_0 - 1) % 3);
846
+ break;
847
+ case 7:
848
+ case 8:
849
+ case 9:
850
+ swap(this$static.ud, 4, 5, 6, 7, (i_0 - 1) % 3);
851
+ break;
852
+ case 10:
853
+ swap(this$static.rl, 4, 5, 6, 7, 1);
854
+ break;
855
+ case 11:
856
+ case 12:
857
+ case 13:
858
+ swap(this$static.fb, 4, 5, 6, 7, (i_0 + 1) % 3);
859
+ break;
860
+ case 14:
861
+ swap(this$static.ud, 0, 1, 2, 3, 1);
862
+ swap(this$static.rl, 0, 5, 4, 1, 1);
863
+ swap(this$static.fb, 0, 5, 4, 1, 1);
864
+ break;
865
+ case 15:
866
+ swap(this$static.rl, 0, 1, 2, 3, 1);
867
+ swap(this$static.fb, 1, 4, 7, 2, 1);
868
+ swap(this$static.ud, 1, 6, 5, 2, 1);
869
+ break;
870
+ case 16:
871
+ swap(this$static.fb, 0, 1, 2, 3, 1);
872
+ swap(this$static.ud, 3, 2, 5, 4, 1);
873
+ swap(this$static.rl, 0, 3, 6, 5, 1);
874
+ break;
875
+ case 17:
876
+ swap(this$static.ud, 4, 5, 6, 7, 1);
877
+ swap(this$static.rl, 3, 2, 7, 6, 1);
878
+ swap(this$static.fb, 3, 2, 7, 6, 1);
879
+ break;
880
+ case 18:
881
+ swap(this$static.rl, 4, 5, 6, 7, 1);
882
+ swap(this$static.fb, 0, 3, 6, 5, 1);
883
+ swap(this$static.ud, 0, 3, 4, 7, 1);
884
+ break;
885
+ case 19:
886
+ swap(this$static.fb, 4, 5, 6, 7, 1);
887
+ swap(this$static.ud, 0, 7, 6, 1, 1);
888
+ swap(this$static.rl, 1, 4, 7, 2, 1);
889
+ }
890
+ }
891
+ function $set_3(this$static, c, eXc_parity) {
892
+ let i_0;
893
+ const parity = (c.ct[0] > c.ct[8] ? 1 : 0) ^ (c.ct[8] > c.ct[16] ? 1 : 0) ^ (c.ct[0] > c.ct[16] ? 1 : 0) ? 1 : 0;
894
+ for (i_0 = 0; i_0 < 8; ++i_0) {
895
+ this$static.ud[i_0] = c.ct[i_0] & 1 ^ 1;
896
+ this$static.fb[i_0] = c.ct[i_0 + 8] & 1 ^ 1;
897
+ this$static.rl[i_0] = c.ct[i_0 + 16] & 1 ^ 1 ^ parity;
898
+ }
899
+ this$static.parity = parity ^ eXc_parity;
900
+ }
901
+ function $setct_0(this$static, idx) {
902
+ let i_0, idxfb, idxrl, r;
903
+ this$static.parity = idx & 1;
904
+ idx >>>= 1;
905
+ idxrl = rl2std[idx % 12];
906
+ idx = ~~(idx / 12);
907
+ r = 4;
908
+ for (i_0 = 7; i_0 >= 0; --i_0) {
909
+ this$static.rl[i_0] = 0;
910
+ if (idxrl >= Cnk[i_0][r]) {
911
+ idxrl -= Cnk[i_0][r--];
912
+ this$static.rl[i_0] = 1;
913
+ }
914
+ }
915
+ idxfb = idx % 35;
916
+ idx = ~~(idx / 35);
917
+ r = 4;
918
+ this$static.fb[7] = 0;
919
+ for (i_0 = 6; i_0 >= 0; --i_0) {
920
+ if (idxfb >= Cnk[i_0][r]) {
921
+ idxfb -= Cnk[i_0][r--];
922
+ this$static.fb[i_0] = 1;
923
+ } else {
924
+ this$static.fb[i_0] = 0;
925
+ }
926
+ }
927
+ r = 4;
928
+ this$static.ud[7] = 0;
929
+ for (i_0 = 6; i_0 >= 0; --i_0) {
930
+ if (idx >= Cnk[i_0][r]) {
931
+ idx -= Cnk[i_0][r--];
932
+ this$static.ud[i_0] = 1;
933
+ } else {
934
+ this$static.ud[i_0] = 0;
935
+ }
936
+ }
937
+ }
938
+ function Center3_0() {
939
+ this.ud = createArray(8);
940
+ this.rl = createArray(8);
941
+ this.fb = createArray(8);
942
+ }
943
+ function init_4() {
944
+ let depth, done, i_0, m_0;
945
+ for (i_0 = 0; i_0 < 12; ++i_0) {
946
+ std2rl[rl2std[i_0]] = i_0;
947
+ }
948
+ const c = new Center3_0();
949
+ for (i_0 = 0; i_0 < 29400; ++i_0) {
950
+ for (m_0 = 0; m_0 < 20; ++m_0) {
951
+ $setct_0(c, i_0);
952
+ $move_1(c, m_0);
953
+ ctmove[i_0][m_0] = $getct_0(c) & 65535;
954
+ }
955
+ }
956
+ fill_0(prun_0);
957
+ prun_0[0] = 0;
958
+ depth = 0;
959
+ done = 1;
960
+ while (done !== 29400) {
961
+ for (i_0 = 0; i_0 < 29400; ++i_0) {
962
+ if (prun_0[i_0] !== depth) {
963
+ continue;
964
+ }
965
+ for (m_0 = 0; m_0 < 17; ++m_0) {
966
+ if (prun_0[ctmove[i_0][m_0]] === -1) {
967
+ prun_0[ctmove[i_0][m_0]] = depth + 1;
968
+ ++done;
969
+ }
970
+ }
971
+ }
972
+ ++depth;
973
+ }
974
+ }
975
+ defineSeed(155, 1, {}, Center3_0);
976
+ _.parity = 0;
977
+ var ctmove;
978
+ var pmove;
979
+ var prun_0;
980
+ var rl2std;
981
+ var std2rl;
982
+ function $copy_1(this$static, c) {
983
+ let i_0;
984
+ for (i_0 = 0; i_0 < 24; ++i_0) {
985
+ this$static.ct[i_0] = c.ct[i_0];
986
+ }
987
+ }
988
+ function $move_2(this$static, m_0) {
989
+ const key = m_0 % 3;
990
+ m_0 = ~~(m_0 / 3);
991
+ switch (m_0) {
992
+ case 0:
993
+ swap(this$static.ct, 0, 1, 2, 3, key);
994
+ break;
995
+ case 1:
996
+ swap(this$static.ct, 16, 17, 18, 19, key);
997
+ break;
998
+ case 2:
999
+ swap(this$static.ct, 8, 9, 10, 11, key);
1000
+ break;
1001
+ case 3:
1002
+ swap(this$static.ct, 4, 5, 6, 7, key);
1003
+ break;
1004
+ case 4:
1005
+ swap(this$static.ct, 20, 21, 22, 23, key);
1006
+ break;
1007
+ case 5:
1008
+ swap(this$static.ct, 12, 13, 14, 15, key);
1009
+ break;
1010
+ case 6:
1011
+ swap(this$static.ct, 0, 1, 2, 3, key);
1012
+ swap(this$static.ct, 8, 20, 12, 16, key);
1013
+ swap(this$static.ct, 9, 21, 13, 17, key);
1014
+ break;
1015
+ case 7:
1016
+ swap(this$static.ct, 16, 17, 18, 19, key);
1017
+ swap(this$static.ct, 1, 15, 5, 9, key);
1018
+ swap(this$static.ct, 2, 12, 6, 10, key);
1019
+ break;
1020
+ case 8:
1021
+ swap(this$static.ct, 8, 9, 10, 11, key);
1022
+ swap(this$static.ct, 2, 19, 4, 21, key);
1023
+ swap(this$static.ct, 3, 16, 5, 22, key);
1024
+ break;
1025
+ case 9:
1026
+ swap(this$static.ct, 4, 5, 6, 7, key);
1027
+ swap(this$static.ct, 10, 18, 14, 22, key);
1028
+ swap(this$static.ct, 11, 19, 15, 23, key);
1029
+ break;
1030
+ case 10:
1031
+ swap(this$static.ct, 20, 21, 22, 23, key);
1032
+ swap(this$static.ct, 0, 8, 4, 14, key);
1033
+ swap(this$static.ct, 3, 11, 7, 13, key);
1034
+ break;
1035
+ case 11:
1036
+ swap(this$static.ct, 12, 13, 14, 15, key);
1037
+ swap(this$static.ct, 1, 20, 7, 18, key);
1038
+ swap(this$static.ct, 0, 23, 6, 17, key);
1039
+ }
1040
+ }
1041
+ function CenterCube_0() {
1042
+ let i_0;
1043
+ this.ct = createArray(24);
1044
+ for (i_0 = 0; i_0 < 24; ++i_0) {
1045
+ this.ct[i_0] = ~~(i_0 / 4);
1046
+ }
1047
+ }
1048
+ function CenterCube_1(randomUIntBelow) {
1049
+ let i_0, m_0, t;
1050
+ CenterCube_0.call(this);
1051
+ for (i_0 = 0; i_0 < 23; ++i_0) {
1052
+ t = i_0 + randomUIntBelow(24 - i_0);
1053
+ if (this.ct[t] !== this.ct[i_0]) {
1054
+ m_0 = this.ct[i_0];
1055
+ this.ct[i_0] = this.ct[t];
1056
+ this.ct[t] = m_0;
1057
+ }
1058
+ }
1059
+ }
1060
+ defineSeed(156, 1, {}, CenterCube_0, CenterCube_1);
1061
+ var ran$clinit_CornerCube = false;
1062
+ function $clinit_CornerCube() {
1063
+ if (ran$clinit_CornerCube) {
1064
+ return;
1065
+ }
1066
+ ran$clinit_CornerCube = true;
1067
+ moveCube_0 = createArray(18);
1068
+ initMove_0();
1069
+ }
1070
+ function $$init_2(this$static) {
1071
+ this$static.cp = [0, 1, 2, 3, 4, 5, 6, 7];
1072
+ this$static.co = [0, 0, 0, 0, 0, 0, 0, 0];
1073
+ }
1074
+ function $copy_2(this$static, c) {
1075
+ let i_0;
1076
+ for (i_0 = 0; i_0 < 8; ++i_0) {
1077
+ this$static.cp[i_0] = c.cp[i_0];
1078
+ this$static.co[i_0] = c.co[i_0];
1079
+ }
1080
+ }
1081
+ function $move_3(this$static, idx) {
1082
+ !this$static.temps && (this$static.temps = new CornerCube_0());
1083
+ CornMult_0(this$static, moveCube_0[idx], this$static.temps);
1084
+ $copy_2(this$static, this$static.temps);
1085
+ }
1086
+ function $setTwist_0(this$static, idx) {
1087
+ let i_0, twst;
1088
+ twst = 0;
1089
+ for (i_0 = 6; i_0 >= 0; --i_0) {
1090
+ twst += this$static.co[i_0] = idx % 3;
1091
+ idx = ~~(idx / 3);
1092
+ }
1093
+ this$static.co[7] = (15 - twst) % 3;
1094
+ }
1095
+ function CornMult_0(a, b, prod) {
1096
+ let corn, ori, oriA, oriB;
1097
+ for (corn = 0; corn < 8; ++corn) {
1098
+ prod.cp[corn] = a.cp[b.cp[corn]];
1099
+ oriA = a.co[b.cp[corn]];
1100
+ oriB = b.co[corn];
1101
+ ori = oriA;
1102
+ ori = ori + (oriA < 3 ? oriB : 6 - oriB);
1103
+ ori = ori % 3;
1104
+ (oriA >= 3 ? 1 : 0) ^ (oriB >= 3 ? 1 : 0) && (ori = ori + 3);
1105
+ prod.co[corn] = ori;
1106
+ }
1107
+ }
1108
+ function CornerCube_0() {
1109
+ $$init_2(this);
1110
+ }
1111
+ function CornerCube_1(cperm, twist) {
1112
+ $$init_2(this);
1113
+ set8Perm(this.cp, cperm);
1114
+ $setTwist_0(this, twist);
1115
+ }
1116
+ function CornerCube_2(randomUIntBelow) {
1117
+ CornerCube_1.call(this, randomUIntBelow(40320), randomUIntBelow(2187));
1118
+ }
1119
+ function initMove_0() {
1120
+ let a, p_0;
1121
+ moveCube_0[0] = new CornerCube_1(15120, 0);
1122
+ moveCube_0[3] = new CornerCube_1(21021, 1494);
1123
+ moveCube_0[6] = new CornerCube_1(8064, 1236);
1124
+ moveCube_0[9] = new CornerCube_1(9, 0);
1125
+ moveCube_0[12] = new CornerCube_1(1230, 412);
1126
+ moveCube_0[15] = new CornerCube_1(224, 137);
1127
+ for (a = 0; a < 18; a += 3) {
1128
+ for (p_0 = 0; p_0 < 2; ++p_0) {
1129
+ moveCube_0[a + p_0 + 1] = new CornerCube_0();
1130
+ CornMult_0(moveCube_0[a + p_0], moveCube_0[a], moveCube_0[a + p_0 + 1]);
1131
+ }
1132
+ }
1133
+ }
1134
+ defineSeed(157, 1, makeCastMap([Q$CornerCube]), CornerCube_0, CornerCube_1, CornerCube_2);
1135
+ _.temps = null;
1136
+ var moveCube_0;
1137
+ var ran$clinit_Edge3 = false;
1138
+ function $clinit_Edge3() {
1139
+ if (ran$clinit_Edge3) {
1140
+ return;
1141
+ }
1142
+ ran$clinit_Edge3 = true;
1143
+ eprun = createArray(1937880);
1144
+ sym2raw_0 = createArray(1538);
1145
+ symstate = createArray(1538);
1146
+ raw2sym_1 = createArray(11880);
1147
+ syminv_0 = [0, 1, 6, 3, 4, 5, 2, 7];
1148
+ mvrot = createArray(160, 12);
1149
+ mvroto = createArray(160, 12);
1150
+ factX = [
1151
+ 1,
1152
+ 1,
1153
+ 1,
1154
+ 3,
1155
+ 12,
1156
+ 60,
1157
+ 360,
1158
+ 2520,
1159
+ 20160,
1160
+ 181440,
1161
+ 1814400,
1162
+ 19958400,
1163
+ 239500800
1164
+ ];
1165
+ FullEdgeMap = [0, 2, 4, 6, 1, 3, 7, 5, 8, 9, 10, 11];
1166
+ }
1167
+ function $circlex(this$static, a, b, c, d) {
1168
+ const temp = this$static.edgeo[d];
1169
+ this$static.edgeo[d] = this$static.edge[c];
1170
+ this$static.edge[c] = this$static.edgeo[b];
1171
+ this$static.edgeo[b] = this$static.edge[a];
1172
+ this$static.edge[a] = temp;
1173
+ }
1174
+ function $get_2(this$static, end) {
1175
+ let i_0, idx, v, valh, vall;
1176
+ this$static.isStd || $std(this$static);
1177
+ idx = 0;
1178
+ vall = 1985229328;
1179
+ valh = 47768;
1180
+ for (i_0 = 0; i_0 < end; ++i_0) {
1181
+ v = this$static.edge[i_0] << 2;
1182
+ idx *= 12 - i_0;
1183
+ if (v >= 32) {
1184
+ idx += valh >> v - 32 & 15;
1185
+ valh -= 4368 << v - 32;
1186
+ } else {
1187
+ idx += vall >> v & 15;
1188
+ valh -= 4369;
1189
+ vall -= 286331152 << v;
1190
+ }
1191
+ }
1192
+ return idx;
1193
+ }
1194
+ function $getsym_0(this$static) {
1195
+ let symcord1x;
1196
+ const cord1x = $get_2(this$static, 4);
1197
+ symcord1x = raw2sym_1[cord1x];
1198
+ const symx = symcord1x & 7;
1199
+ symcord1x >>= 3;
1200
+ $rotate_0(this$static, symx);
1201
+ const cord2x = $get_2(this$static, 10) % 20160;
1202
+ return symcord1x * 20160 + cord2x;
1203
+ }
1204
+ function $move_4(this$static, i_0) {
1205
+ this$static.isStd = false;
1206
+ switch (i_0) {
1207
+ case 0:
1208
+ circle(this$static.edge, 0, 4, 1, 5);
1209
+ circle(this$static.edgeo, 0, 4, 1, 5);
1210
+ break;
1211
+ case 1:
1212
+ $swap_0(this$static.edge, 0, 4, 1, 5);
1213
+ $swap_0(this$static.edgeo, 0, 4, 1, 5);
1214
+ break;
1215
+ case 2:
1216
+ circle(this$static.edge, 0, 5, 1, 4);
1217
+ circle(this$static.edgeo, 0, 5, 1, 4);
1218
+ break;
1219
+ case 3:
1220
+ $swap_0(this$static.edge, 5, 10, 6, 11);
1221
+ $swap_0(this$static.edgeo, 5, 10, 6, 11);
1222
+ break;
1223
+ case 4:
1224
+ circle(this$static.edge, 0, 11, 3, 8);
1225
+ circle(this$static.edgeo, 0, 11, 3, 8);
1226
+ break;
1227
+ case 5:
1228
+ $swap_0(this$static.edge, 0, 11, 3, 8);
1229
+ $swap_0(this$static.edgeo, 0, 11, 3, 8);
1230
+ break;
1231
+ case 6:
1232
+ circle(this$static.edge, 0, 8, 3, 11);
1233
+ circle(this$static.edgeo, 0, 8, 3, 11);
1234
+ break;
1235
+ case 7:
1236
+ circle(this$static.edge, 2, 7, 3, 6);
1237
+ circle(this$static.edgeo, 2, 7, 3, 6);
1238
+ break;
1239
+ case 8:
1240
+ $swap_0(this$static.edge, 2, 7, 3, 6);
1241
+ $swap_0(this$static.edgeo, 2, 7, 3, 6);
1242
+ break;
1243
+ case 9:
1244
+ circle(this$static.edge, 2, 6, 3, 7);
1245
+ circle(this$static.edgeo, 2, 6, 3, 7);
1246
+ break;
1247
+ case 10:
1248
+ $swap_0(this$static.edge, 4, 8, 7, 9);
1249
+ $swap_0(this$static.edgeo, 4, 8, 7, 9);
1250
+ break;
1251
+ case 11:
1252
+ circle(this$static.edge, 1, 9, 2, 10);
1253
+ circle(this$static.edgeo, 1, 9, 2, 10);
1254
+ break;
1255
+ case 12:
1256
+ $swap_0(this$static.edge, 1, 9, 2, 10);
1257
+ $swap_0(this$static.edgeo, 1, 9, 2, 10);
1258
+ break;
1259
+ case 13:
1260
+ circle(this$static.edge, 1, 10, 2, 9);
1261
+ circle(this$static.edgeo, 1, 10, 2, 9);
1262
+ break;
1263
+ case 14:
1264
+ $swap_0(this$static.edge, 0, 4, 1, 5);
1265
+ $swap_0(this$static.edgeo, 0, 4, 1, 5);
1266
+ circle(this$static.edge, 9, 11);
1267
+ circle(this$static.edgeo, 8, 10);
1268
+ break;
1269
+ case 15:
1270
+ $swap_0(this$static.edge, 5, 10, 6, 11);
1271
+ $swap_0(this$static.edgeo, 5, 10, 6, 11);
1272
+ circle(this$static.edge, 1, 3);
1273
+ circle(this$static.edgeo, 0, 2);
1274
+ break;
1275
+ case 16:
1276
+ $swap_0(this$static.edge, 0, 11, 3, 8);
1277
+ $swap_0(this$static.edgeo, 0, 11, 3, 8);
1278
+ circle(this$static.edge, 5, 7);
1279
+ circle(this$static.edgeo, 4, 6);
1280
+ break;
1281
+ case 17:
1282
+ $swap_0(this$static.edge, 2, 7, 3, 6);
1283
+ $swap_0(this$static.edgeo, 2, 7, 3, 6);
1284
+ circle(this$static.edge, 8, 10);
1285
+ circle(this$static.edgeo, 9, 11);
1286
+ break;
1287
+ case 18:
1288
+ $swap_0(this$static.edge, 4, 8, 7, 9);
1289
+ $swap_0(this$static.edgeo, 4, 8, 7, 9);
1290
+ circle(this$static.edge, 0, 2);
1291
+ circle(this$static.edgeo, 1, 3);
1292
+ break;
1293
+ case 19:
1294
+ $swap_0(this$static.edge, 1, 9, 2, 10);
1295
+ $swap_0(this$static.edgeo, 1, 9, 2, 10);
1296
+ circle(this$static.edge, 4, 6);
1297
+ circle(this$static.edgeo, 5, 7);
1298
+ }
1299
+ }
1300
+ function $rot_1(this$static, r) {
1301
+ this$static.isStd = false;
1302
+ switch (r) {
1303
+ case 0:
1304
+ $move_4(this$static, 14);
1305
+ $move_4(this$static, 17);
1306
+ break;
1307
+ case 1:
1308
+ $circlex(this$static, 11, 5, 10, 6);
1309
+ $circlex(this$static, 5, 10, 6, 11);
1310
+ $circlex(this$static, 1, 2, 3, 0);
1311
+ $circlex(this$static, 4, 9, 7, 8);
1312
+ $circlex(this$static, 8, 4, 9, 7);
1313
+ $circlex(this$static, 0, 1, 2, 3);
1314
+ break;
1315
+ case 2:
1316
+ $swapx(this$static, 4, 5);
1317
+ $swapx(this$static, 5, 4);
1318
+ $swapx(this$static, 11, 8);
1319
+ $swapx(this$static, 8, 11);
1320
+ $swapx(this$static, 7, 6);
1321
+ $swapx(this$static, 6, 7);
1322
+ $swapx(this$static, 9, 10);
1323
+ $swapx(this$static, 10, 9);
1324
+ $swapx(this$static, 1, 1);
1325
+ $swapx(this$static, 0, 0);
1326
+ $swapx(this$static, 3, 3);
1327
+ $swapx(this$static, 2, 2);
1328
+ }
1329
+ }
1330
+ function $rotate_0(this$static, r) {
1331
+ while (r >= 2) {
1332
+ r -= 2;
1333
+ $rot_1(this$static, 1);
1334
+ $rot_1(this$static, 2);
1335
+ }
1336
+ r !== 0 && $rot_1(this$static, 0);
1337
+ }
1338
+ function $set_4(this$static, idx) {
1339
+ let i_0, p_0, parity, v, vall, valh;
1340
+ vall = 1985229328;
1341
+ valh = 47768;
1342
+ parity = 0;
1343
+ for (i_0 = 0; i_0 < 11; ++i_0) {
1344
+ p_0 = factX[11 - i_0];
1345
+ v = ~~(idx / p_0);
1346
+ idx = idx % p_0;
1347
+ parity ^= v;
1348
+ v <<= 2;
1349
+ if (v >= 32) {
1350
+ v = v - 32;
1351
+ this$static.edge[i_0] = valh >> v & 15;
1352
+ const m = (1 << v) - 1;
1353
+ valh = (valh & m) + (valh >> 4 & ~m);
1354
+ } else {
1355
+ this$static.edge[i_0] = vall >> v & 15;
1356
+ const m = (1 << v) - 1;
1357
+ vall = (vall & m) + (vall >>> 4 & ~m) + (valh << 28);
1358
+ valh = valh >> 4;
1359
+ }
1360
+ }
1361
+ if ((parity & 1) === 0) {
1362
+ this$static.edge[11] = vall;
1363
+ } else {
1364
+ this$static.edge[11] = this$static.edge[10];
1365
+ this$static.edge[10] = vall;
1366
+ }
1367
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1368
+ this$static.edgeo[i_0] = i_0;
1369
+ }
1370
+ this$static.isStd = true;
1371
+ }
1372
+ function $set_5(this$static, e) {
1373
+ let i_0;
1374
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1375
+ this$static.edge[i_0] = e.edge[i_0];
1376
+ this$static.edgeo[i_0] = e.edgeo[i_0];
1377
+ }
1378
+ this$static.isStd = e.isStd;
1379
+ }
1380
+ function $set_6(this$static, c) {
1381
+ let i_0, parity, s, t;
1382
+ this$static.temp === null && (this$static.temp = createArray(12));
1383
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1384
+ this$static.temp[i_0] = i_0;
1385
+ this$static.edge[i_0] = c.ep[FullEdgeMap[i_0] + 12] % 12;
1386
+ }
1387
+ parity = 1;
1388
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1389
+ while (this$static.edge[i_0] !== i_0) {
1390
+ t = this$static.edge[i_0];
1391
+ this$static.edge[i_0] = this$static.edge[t];
1392
+ this$static.edge[t] = t;
1393
+ s = this$static.temp[i_0];
1394
+ this$static.temp[i_0] = this$static.temp[t];
1395
+ this$static.temp[t] = s;
1396
+ parity ^= 1;
1397
+ }
1398
+ }
1399
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1400
+ this$static.edge[i_0] = this$static.temp[c.ep[FullEdgeMap[i_0]] % 12];
1401
+ }
1402
+ return parity;
1403
+ }
1404
+ function $std(this$static) {
1405
+ let i_0;
1406
+ this$static.temp === null && (this$static.temp = createArray(12));
1407
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1408
+ this$static.temp[this$static.edgeo[i_0]] = i_0;
1409
+ }
1410
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1411
+ this$static.edge[i_0] = this$static.temp[this$static.edge[i_0]];
1412
+ this$static.edgeo[i_0] = i_0;
1413
+ }
1414
+ this$static.isStd = true;
1415
+ }
1416
+ function $swap_0(arr, a, b, c, d) {
1417
+ let temp;
1418
+ temp = arr[a];
1419
+ arr[a] = arr[c];
1420
+ arr[c] = temp;
1421
+ temp = arr[b];
1422
+ arr[b] = arr[d];
1423
+ arr[d] = temp;
1424
+ }
1425
+ function $swapx(this$static, x, y) {
1426
+ const temp = this$static.edge[x];
1427
+ this$static.edge[x] = this$static.edgeo[y];
1428
+ this$static.edgeo[y] = temp;
1429
+ }
1430
+ function Edge3_0() {
1431
+ this.edge = createArray(12);
1432
+ this.edgeo = createArray(12);
1433
+ }
1434
+ function createPrun_0() {
1435
+ let chk, cord1, cord1x, cord2, cord2x, dep1m3, depm3, depth, end, find_0, i_0, i_, idx, idxx, inv, j, m_0, symState, symcord1, symcord1x, symx, val;
1436
+ const e = new Edge3_0();
1437
+ const f = new Edge3_0();
1438
+ const g = new Edge3_0();
1439
+ fill_0(eprun);
1440
+ depth = 0;
1441
+ done_0 = 1;
1442
+ setPruning_0(eprun, 0, 0);
1443
+ while (done_0 !== 31006080) {
1444
+ inv = depth > 9;
1445
+ depm3 = depth % 3;
1446
+ dep1m3 = (depth + 1) % 3;
1447
+ find_0 = inv ? 3 : depm3;
1448
+ chk = inv ? depm3 : 3;
1449
+ if (depth >= 9) {
1450
+ break;
1451
+ }
1452
+ for (i_ = 0; i_ < 31006080; i_ += 16) {
1453
+ val = eprun[~~i_ >> 4];
1454
+ if (!inv && val === -1) {
1455
+ continue;
1456
+ }
1457
+ for (i_0 = i_, end = i_ + 16; i_0 < end; ++i_0, val >>= 2) {
1458
+ if ((val & 3) !== find_0) {
1459
+ continue;
1460
+ }
1461
+ symcord1 = ~~(i_0 / 20160);
1462
+ cord1 = sym2raw_0[symcord1];
1463
+ cord2 = i_0 % 20160;
1464
+ $set_4(e, cord1 * 20160 + cord2);
1465
+ for (m_0 = 0; m_0 < 17; ++m_0) {
1466
+ cord1x = getmvrot(e.edge, m_0 << 3, 4);
1467
+ symcord1x = raw2sym_1[cord1x];
1468
+ symx = symcord1x & 7;
1469
+ symcord1x >>= 3;
1470
+ cord2x = getmvrot(e.edge, m_0 << 3 | symx, 10) % 20160;
1471
+ idx = symcord1x * 20160 + cord2x;
1472
+ if (getPruning_0(eprun, idx) !== chk) {
1473
+ continue;
1474
+ }
1475
+ setPruning_0(eprun, inv ? i_0 : idx, dep1m3);
1476
+ ++done_0;
1477
+ if (inv) {
1478
+ break;
1479
+ }
1480
+ symState = symstate[symcord1x];
1481
+ if (symState === 1) {
1482
+ continue;
1483
+ }
1484
+ $set_5(f, e);
1485
+ $move_4(f, m_0);
1486
+ $rotate_0(f, symx);
1487
+ for (j = 1; (symState = ~~symState >> 1 & 65535) !== 0; ++j) {
1488
+ if ((symState & 1) !== 1) {
1489
+ continue;
1490
+ }
1491
+ $set_5(g, f);
1492
+ $rotate_0(g, j);
1493
+ idxx = symcord1x * 20160 + $get_2(g, 10) % 20160;
1494
+ if (getPruning_0(eprun, idxx) === chk) {
1495
+ setPruning_0(eprun, idxx, dep1m3);
1496
+ ++done_0;
1497
+ }
1498
+ }
1499
+ }
1500
+ }
1501
+ }
1502
+ ++depth;
1503
+ }
1504
+ }
1505
+ function getPruning_0(table, index) {
1506
+ return table[index >> 4] >> ((index & 15) << 1) & 3;
1507
+ }
1508
+ function getmvrot(ep, mrIdx, end) {
1509
+ let i_0, idx, v, valh, vall;
1510
+ const movo = mvroto[mrIdx];
1511
+ const mov = mvrot[mrIdx];
1512
+ idx = 0;
1513
+ vall = 1985229328;
1514
+ valh = 47768;
1515
+ for (i_0 = 0; i_0 < end; ++i_0) {
1516
+ v = movo[ep[mov[i_0]]] << 2;
1517
+ idx *= 12 - i_0;
1518
+ if (v >= 32) {
1519
+ idx += valh >> v - 32 & 15;
1520
+ valh -= 4368 << v - 32;
1521
+ } else {
1522
+ idx += vall >> v & 15;
1523
+ valh -= 4369;
1524
+ vall -= 286331152 << v;
1525
+ }
1526
+ }
1527
+ return idx;
1528
+ }
1529
+ function getprun(edge) {
1530
+ let cord1, cord1x, cord2, cord2x, depm3, depth, idx, m_0, symcord1, symcord1x, symx;
1531
+ const e = new Edge3_0();
1532
+ depth = 0;
1533
+ depm3 = getPruning_0(eprun, edge);
1534
+ if (depm3 === 3) {
1535
+ return 10;
1536
+ }
1537
+ while (edge !== 0) {
1538
+ depm3 === 0 ? depm3 = 2 : --depm3;
1539
+ symcord1 = ~~(edge / 20160);
1540
+ cord1 = sym2raw_0[symcord1];
1541
+ cord2 = edge % 20160;
1542
+ $set_4(e, cord1 * 20160 + cord2);
1543
+ for (m_0 = 0; m_0 < 17; ++m_0) {
1544
+ cord1x = getmvrot(e.edge, m_0 << 3, 4);
1545
+ symcord1x = raw2sym_1[cord1x];
1546
+ symx = symcord1x & 7;
1547
+ symcord1x >>= 3;
1548
+ cord2x = getmvrot(e.edge, m_0 << 3 | symx, 10) % 20160;
1549
+ idx = symcord1x * 20160 + cord2x;
1550
+ if (getPruning_0(eprun, idx) === depm3) {
1551
+ ++depth;
1552
+ edge = idx;
1553
+ break;
1554
+ }
1555
+ }
1556
+ }
1557
+ return depth;
1558
+ }
1559
+ function getprun_0(edge, prun) {
1560
+ const depm3 = getPruning_0(eprun, edge);
1561
+ if (depm3 === 3) {
1562
+ return 10;
1563
+ }
1564
+ return (1227133513 << depm3 >> prun & 3) + prun - 1;
1565
+ }
1566
+ function initMvrot() {
1567
+ let i_0, m_0, r;
1568
+ const e = new Edge3_0();
1569
+ for (m_0 = 0; m_0 < 20; ++m_0) {
1570
+ for (r = 0; r < 8; ++r) {
1571
+ $set_4(e, 0);
1572
+ $move_4(e, m_0);
1573
+ $rotate_0(e, r);
1574
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1575
+ mvrot[m_0 << 3 | r][i_0] = e.edge[i_0];
1576
+ }
1577
+ $std(e);
1578
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1579
+ mvroto[m_0 << 3 | r][i_0] = e.temp[i_0];
1580
+ }
1581
+ }
1582
+ }
1583
+ }
1584
+ function initRaw2Sym() {
1585
+ let count, i_0, idx, j;
1586
+ const e = new Edge3_0();
1587
+ const occ = createArray(1485);
1588
+ for (i_0 = 0; i_0 < 1485; i_0++) {
1589
+ occ[i_0] = 0;
1590
+ }
1591
+ count = 0;
1592
+ for (i_0 = 0; i_0 < 11880; ++i_0) {
1593
+ if ((occ[~~i_0 >>> 3] & 1 << (i_0 & 7)) === 0) {
1594
+ $set_4(e, i_0 * factX[8]);
1595
+ for (j = 0; j < 8; ++j) {
1596
+ idx = $get_2(e, 4);
1597
+ idx === i_0 && (symstate[count] = (symstate[count] | 1 << j) & 65535);
1598
+ occ[~~idx >> 3] = occ[~~idx >> 3] | 1 << (idx & 7);
1599
+ raw2sym_1[idx] = count << 3 | syminv_0[j];
1600
+ $rot_1(e, 0);
1601
+ if (j % 2 === 1) {
1602
+ $rot_1(e, 1);
1603
+ $rot_1(e, 2);
1604
+ }
1605
+ }
1606
+ sym2raw_0[count++] = i_0;
1607
+ }
1608
+ }
1609
+ }
1610
+ function setPruning_0(table, index, value) {
1611
+ table[index >> 4] ^= (3 ^ value) << ((index & 15) << 1);
1612
+ }
1613
+ defineSeed(158, 1, makeCastMap([Q$Edge3]), Edge3_0);
1614
+ _.isStd = true;
1615
+ _.temp = null;
1616
+ var FullEdgeMap;
1617
+ var done_0 = 0;
1618
+ var eprun;
1619
+ var factX;
1620
+ var mvrot;
1621
+ var mvroto;
1622
+ var raw2sym_1;
1623
+ var sym2raw_0;
1624
+ var syminv_0;
1625
+ var symstate;
1626
+ var ran$clinit_EdgeCube = false;
1627
+ function $clinit_EdgeCube() {
1628
+ if (ran$clinit_EdgeCube) {
1629
+ return;
1630
+ }
1631
+ ran$clinit_EdgeCube = true;
1632
+ }
1633
+ function $checkEdge(this$static) {
1634
+ let ck, i_0, parity;
1635
+ ck = 0;
1636
+ parity = false;
1637
+ for (i_0 = 0; i_0 < 12; ++i_0) {
1638
+ ck |= 1 << this$static.ep[i_0];
1639
+ parity = parity !== this$static.ep[i_0] >= 12;
1640
+ }
1641
+ ck &= ~~ck >> 12;
1642
+ return ck === 0 && !parity;
1643
+ }
1644
+ function $copy_3(this$static, c) {
1645
+ let i_0;
1646
+ for (i_0 = 0; i_0 < 24; ++i_0) {
1647
+ this$static.ep[i_0] = c.ep[i_0];
1648
+ }
1649
+ }
1650
+ function $move_5(this$static, m_0) {
1651
+ const key = m_0 % 3;
1652
+ m_0 = ~~(m_0 / 3);
1653
+ switch (m_0) {
1654
+ case 0:
1655
+ swap(this$static.ep, 0, 1, 2, 3, key);
1656
+ swap(this$static.ep, 12, 13, 14, 15, key);
1657
+ break;
1658
+ case 1:
1659
+ swap(this$static.ep, 11, 15, 10, 19, key);
1660
+ swap(this$static.ep, 23, 3, 22, 7, key);
1661
+ break;
1662
+ case 2:
1663
+ swap(this$static.ep, 0, 11, 6, 8, key);
1664
+ swap(this$static.ep, 12, 23, 18, 20, key);
1665
+ break;
1666
+ case 3:
1667
+ swap(this$static.ep, 4, 5, 6, 7, key);
1668
+ swap(this$static.ep, 16, 17, 18, 19, key);
1669
+ break;
1670
+ case 4:
1671
+ swap(this$static.ep, 1, 20, 5, 21, key);
1672
+ swap(this$static.ep, 13, 8, 17, 9, key);
1673
+ break;
1674
+ case 5:
1675
+ swap(this$static.ep, 2, 9, 4, 10, key);
1676
+ swap(this$static.ep, 14, 21, 16, 22, key);
1677
+ break;
1678
+ case 6:
1679
+ swap(this$static.ep, 0, 1, 2, 3, key);
1680
+ swap(this$static.ep, 12, 13, 14, 15, key);
1681
+ swap(this$static.ep, 9, 22, 11, 20, key);
1682
+ break;
1683
+ case 7:
1684
+ swap(this$static.ep, 11, 15, 10, 19, key);
1685
+ swap(this$static.ep, 23, 3, 22, 7, key);
1686
+ swap(this$static.ep, 2, 16, 6, 12, key);
1687
+ break;
1688
+ case 8:
1689
+ swap(this$static.ep, 0, 11, 6, 8, key);
1690
+ swap(this$static.ep, 12, 23, 18, 20, key);
1691
+ swap(this$static.ep, 3, 19, 5, 13, key);
1692
+ break;
1693
+ case 9:
1694
+ swap(this$static.ep, 4, 5, 6, 7, key);
1695
+ swap(this$static.ep, 16, 17, 18, 19, key);
1696
+ swap(this$static.ep, 8, 23, 10, 21, key);
1697
+ break;
1698
+ case 10:
1699
+ swap(this$static.ep, 1, 20, 5, 21, key);
1700
+ swap(this$static.ep, 13, 8, 17, 9, key);
1701
+ swap(this$static.ep, 14, 0, 18, 4, key);
1702
+ break;
1703
+ case 11:
1704
+ swap(this$static.ep, 2, 9, 4, 10, key);
1705
+ swap(this$static.ep, 14, 21, 16, 22, key);
1706
+ swap(this$static.ep, 7, 15, 1, 17, key);
1707
+ }
1708
+ }
1709
+ function EdgeCube_0() {
1710
+ let i_0;
1711
+ this.ep = createArray(24);
1712
+ for (i_0 = 0; i_0 < 24; ++i_0) {
1713
+ this.ep[i_0] = i_0;
1714
+ }
1715
+ }
1716
+ function EdgeCube_1(randomUIntBelow) {
1717
+ let i_0, m_0, t;
1718
+ EdgeCube_0.call(this);
1719
+ for (i_0 = 0; i_0 < 23; ++i_0) {
1720
+ t = i_0 + randomUIntBelow(24 - i_0);
1721
+ if (t !== i_0) {
1722
+ m_0 = this.ep[i_0];
1723
+ this.ep[i_0] = this.ep[t];
1724
+ this.ep[t] = m_0;
1725
+ }
1726
+ }
1727
+ }
1728
+ defineSeed(159, 1, {}, EdgeCube_0, EdgeCube_1);
1729
+ var ran$clinit_FullCube_0 = false;
1730
+ function $clinit_FullCube_0() {
1731
+ if (ran$clinit_FullCube_0) {
1732
+ return;
1733
+ }
1734
+ ran$clinit_FullCube_0 = true;
1735
+ move2rot = [35, 1, 34, 2, 4, 6, 22, 5, 19];
1736
+ }
1737
+ function $$init_3(this$static) {
1738
+ this$static.moveBuffer = createArray(60);
1739
+ }
1740
+ function $compareTo_1(this$static, c) {
1741
+ return this$static.value - c.value;
1742
+ }
1743
+ function $copy_4(this$static, c) {
1744
+ let i_0;
1745
+ $copy_3(this$static.edge, c.edge);
1746
+ $copy_1(this$static.center, c.center);
1747
+ $copy_2(this$static.corner, c.corner);
1748
+ this$static.value = c.value;
1749
+ this$static.add1 = c.add1;
1750
+ this$static.length1 = c.length1;
1751
+ this$static.length2 = c.length2;
1752
+ this$static.length3 = c.length3;
1753
+ this$static.sym = c.sym;
1754
+ for (i_0 = 0; i_0 < 60; ++i_0) {
1755
+ this$static.moveBuffer[i_0] = c.moveBuffer[i_0];
1756
+ }
1757
+ this$static.moveLength = c.moveLength;
1758
+ this$static.edgeAvail = c.edgeAvail;
1759
+ this$static.centerAvail = c.centerAvail;
1760
+ this$static.cornerAvail = c.cornerAvail;
1761
+ }
1762
+ function $getCenter(this$static) {
1763
+ while (this$static.centerAvail < this$static.moveLength) {
1764
+ $move_2(this$static.center, this$static.moveBuffer[this$static.centerAvail++]);
1765
+ }
1766
+ return this$static.center;
1767
+ }
1768
+ function $getCorner(this$static) {
1769
+ while (this$static.cornerAvail < this$static.moveLength) {
1770
+ $move_3(this$static.corner, this$static.moveBuffer[this$static.cornerAvail++] % 18);
1771
+ }
1772
+ return this$static.corner;
1773
+ }
1774
+ function $getEdge(this$static) {
1775
+ while (this$static.edgeAvail < this$static.moveLength) {
1776
+ $move_5(this$static.edge, this$static.moveBuffer[this$static.edgeAvail++]);
1777
+ }
1778
+ return this$static.edge;
1779
+ }
1780
+ function $getMoveString(this$static) {
1781
+ let i_0, idx, move, rot, sb, sym;
1782
+ const fixedMoves = new Array(this$static.moveLength - (this$static.add1 ? 2 : 0));
1783
+ idx = 0;
1784
+ for (i_0 = 0; i_0 < this$static.length1; ++i_0) {
1785
+ fixedMoves[idx++] = this$static.moveBuffer[i_0];
1786
+ }
1787
+ sym = this$static.sym;
1788
+ for (i_0 = this$static.length1 + (this$static.add1 ? 2 : 0); i_0 < this$static.moveLength; ++i_0) {
1789
+ if (symmove[sym][this$static.moveBuffer[i_0]] >= 27) {
1790
+ fixedMoves[idx++] = symmove[sym][this$static.moveBuffer[i_0]] - 9;
1791
+ rot = move2rot[symmove[sym][this$static.moveBuffer[i_0]] - 27];
1792
+ sym = symmult[sym][rot];
1793
+ } else {
1794
+ fixedMoves[idx++] = symmove[sym][this$static.moveBuffer[i_0]];
1795
+ }
1796
+ }
1797
+ const finishSym = symmult[syminv[sym]][getSolvedSym($getCenter(this$static))];
1798
+ sb = "";
1799
+ sym = finishSym;
1800
+ for (i_0 = idx - 1; i_0 >= 0; --i_0) {
1801
+ move = fixedMoves[i_0];
1802
+ move = ~~(move / 3) * 3 + (2 - move % 3);
1803
+ if (symmove[sym][move] >= 27) {
1804
+ sb = sb + move2str_1[symmove[sym][move] - 9] + " ";
1805
+ rot = move2rot[symmove[sym][move] - 27];
1806
+ sym = symmult[sym][rot];
1807
+ } else {
1808
+ sb = sb + move2str_1[symmove[sym][move]] + " ";
1809
+ }
1810
+ }
1811
+ return sb;
1812
+ }
1813
+ function $move_6(this$static, m_0) {
1814
+ this$static.moveBuffer[this$static.moveLength++] = m_0;
1815
+ return;
1816
+ }
1817
+ function FullCube_3() {
1818
+ $$init_3(this);
1819
+ this.edge = new EdgeCube_0();
1820
+ this.center = new CenterCube_0();
1821
+ this.corner = new CornerCube_0();
1822
+ }
1823
+ function FullCube_4(c) {
1824
+ FullCube_3.call(this);
1825
+ $copy_4(this, c);
1826
+ }
1827
+ function FullCube_5(randomUIntBelow) {
1828
+ $$init_3(this);
1829
+ this.edge = new EdgeCube_1(randomUIntBelow);
1830
+ this.center = new CenterCube_1(randomUIntBelow);
1831
+ this.corner = new CornerCube_2(randomUIntBelow);
1832
+ }
1833
+ defineSeed(160, 1, makeCastMap([Q$FullCube_0, Q$Comparable]), FullCube_3, FullCube_4, FullCube_5);
1834
+ _.compareTo$ = function compareTo_1(c) {
1835
+ return $compareTo_1(this, c);
1836
+ };
1837
+ _.add1 = false;
1838
+ _.center = null;
1839
+ _.centerAvail = 0;
1840
+ _.corner = null;
1841
+ _.cornerAvail = 0;
1842
+ _.edge = null;
1843
+ _.edgeAvail = 0;
1844
+ _.length1 = 0;
1845
+ _.length2 = 0;
1846
+ _.length3 = 0;
1847
+ _.moveLength = 0;
1848
+ _.sym = 0;
1849
+ _.value = 0;
1850
+ var move2rot;
1851
+ function $compare(c1, c2) {
1852
+ return c2.value - c1.value;
1853
+ }
1854
+ function $compare_0(c1, c2) {
1855
+ return $compare(c1, c2);
1856
+ }
1857
+ function FullCube$ValueComparator_0() {
1858
+ }
1859
+ defineSeed(161, 1, {}, FullCube$ValueComparator_0);
1860
+ _.compare = function compare(c1, c2) {
1861
+ return $compare_0(c1, c2);
1862
+ };
1863
+ var ran$clinit_Moves = false;
1864
+ function $clinit_Moves() {
1865
+ if (ran$clinit_Moves) {
1866
+ return;
1867
+ }
1868
+ ran$clinit_Moves = true;
1869
+ let i_0, j;
1870
+ move2str_1 = [
1871
+ "U ",
1872
+ "U2 ",
1873
+ "U' ",
1874
+ "R ",
1875
+ "R2 ",
1876
+ "R' ",
1877
+ "F ",
1878
+ "F2 ",
1879
+ "F' ",
1880
+ "D ",
1881
+ "D2 ",
1882
+ "D' ",
1883
+ "L ",
1884
+ "L2 ",
1885
+ "L' ",
1886
+ "B ",
1887
+ "B2 ",
1888
+ "B' ",
1889
+ "Uw ",
1890
+ "Uw2",
1891
+ "Uw'",
1892
+ "Rw ",
1893
+ "Rw2",
1894
+ "Rw'",
1895
+ "Fw ",
1896
+ "Fw2",
1897
+ "Fw'",
1898
+ "Dw ",
1899
+ "Dw2",
1900
+ "Dw'",
1901
+ "Lw ",
1902
+ "Lw2",
1903
+ "Lw'",
1904
+ "Bw ",
1905
+ "Bw2",
1906
+ "Bw'"
1907
+ ];
1908
+ move2std = [
1909
+ 0,
1910
+ 1,
1911
+ 2,
1912
+ 3,
1913
+ 4,
1914
+ 5,
1915
+ 6,
1916
+ 7,
1917
+ 8,
1918
+ 9,
1919
+ 10,
1920
+ 11,
1921
+ 12,
1922
+ 13,
1923
+ 14,
1924
+ 15,
1925
+ 16,
1926
+ 17,
1927
+ 19,
1928
+ 21,
1929
+ 22,
1930
+ 23,
1931
+ 25,
1932
+ 28,
1933
+ 30,
1934
+ 31,
1935
+ 32,
1936
+ 34,
1937
+ 36
1938
+ ];
1939
+ move3std = [
1940
+ 0,
1941
+ 1,
1942
+ 2,
1943
+ 4,
1944
+ 6,
1945
+ 7,
1946
+ 8,
1947
+ 9,
1948
+ 10,
1949
+ 11,
1950
+ 13,
1951
+ 15,
1952
+ 16,
1953
+ 17,
1954
+ 19,
1955
+ 22,
1956
+ 25,
1957
+ 28,
1958
+ 31,
1959
+ 34,
1960
+ 36
1961
+ ];
1962
+ std2move = createArray(37);
1963
+ std3move = createArray(37);
1964
+ ckmv = createArray(37, 36);
1965
+ ckmv2_0 = createArray(29, 28);
1966
+ ckmv3 = createArray(21, 20);
1967
+ skipAxis = createArray(36);
1968
+ skipAxis2 = createArray(28);
1969
+ skipAxis3 = createArray(20);
1970
+ for (i_0 = 0; i_0 < 29; ++i_0) {
1971
+ std2move[move2std[i_0]] = i_0;
1972
+ }
1973
+ for (i_0 = 0; i_0 < 21; ++i_0) {
1974
+ std3move[move3std[i_0]] = i_0;
1975
+ }
1976
+ for (i_0 = 0; i_0 < 36; ++i_0) {
1977
+ for (j = 0; j < 36; ++j) {
1978
+ ckmv[i_0][j] = ~~(i_0 / 3) === ~~(j / 3) || ~~(i_0 / 3) % 3 === ~~(j / 3) % 3 && i_0 > j;
1979
+ }
1980
+ ckmv[36][i_0] = false;
1981
+ }
1982
+ for (i_0 = 0; i_0 < 29; ++i_0) {
1983
+ for (j = 0; j < 28; ++j) {
1984
+ ckmv2_0[i_0][j] = ckmv[move2std[i_0]][move2std[j]];
1985
+ }
1986
+ }
1987
+ for (i_0 = 0; i_0 < 21; ++i_0) {
1988
+ for (j = 0; j < 20; ++j) {
1989
+ ckmv3[i_0][j] = ckmv[move3std[i_0]][move3std[j]];
1990
+ }
1991
+ }
1992
+ for (i_0 = 0; i_0 < 36; ++i_0) {
1993
+ skipAxis[i_0] = 36;
1994
+ for (j = i_0; j < 36; ++j) {
1995
+ if (!ckmv[i_0][j]) {
1996
+ skipAxis[i_0] = j - 1;
1997
+ break;
1998
+ }
1999
+ }
2000
+ }
2001
+ for (i_0 = 0; i_0 < 28; ++i_0) {
2002
+ skipAxis2[i_0] = 28;
2003
+ for (j = i_0; j < 28; ++j) {
2004
+ if (!ckmv2_0[i_0][j]) {
2005
+ skipAxis2[i_0] = j - 1;
2006
+ break;
2007
+ }
2008
+ }
2009
+ }
2010
+ for (i_0 = 0; i_0 < 20; ++i_0) {
2011
+ skipAxis3[i_0] = 20;
2012
+ for (j = i_0; j < 20; ++j) {
2013
+ if (!ckmv3[i_0][j]) {
2014
+ skipAxis3[i_0] = j - 1;
2015
+ break;
2016
+ }
2017
+ }
2018
+ }
2019
+ }
2020
+ var ckmv;
2021
+ var ckmv2_0;
2022
+ var ckmv3;
2023
+ var move2std;
2024
+ var move2str_1;
2025
+ var move3std;
2026
+ var skipAxis;
2027
+ var skipAxis2;
2028
+ var skipAxis3;
2029
+ var std2move;
2030
+ var std3move;
2031
+ function $doSearch(this$static) {
2032
+ let MAX_LENGTH2, MAX_LENGTH3, ct, edge, eparity, i_0, index, length12, length123, prun, s2ct, s2rl;
2033
+ this$static.solution = "";
2034
+ const ud = $getsym(new Center1_1($getCenter(this$static.c), 0));
2035
+ const fb = $getsym(new Center1_1($getCenter(this$static.c), 1));
2036
+ const rl = $getsym(new Center1_1($getCenter(this$static.c), 2));
2037
+ const udprun = csprun[~~ud >> 6];
2038
+ const fbprun = csprun[~~fb >> 6];
2039
+ const rlprun = csprun[~~rl >> 6];
2040
+ this$static.p1SolsCnt = 0;
2041
+ this$static.arr2idx = 0;
2042
+ $clear(this$static.p1sols.heap);
2043
+ for (this$static.length1 = (udprun < fbprun ? udprun : fbprun) < rlprun ? udprun < fbprun ? udprun : fbprun : rlprun; this$static.length1 < 100; ++this$static.length1) {
2044
+ if (rlprun <= this$static.length1 && $search1(this$static, ~~rl >>> 6, rl & 63, this$static.length1, -1, 0) || udprun <= this$static.length1 && $search1(this$static, ~~ud >>> 6, ud & 63, this$static.length1, -1, 0) || fbprun <= this$static.length1 && $search1(this$static, ~~fb >>> 6, fb & 63, this$static.length1, -1, 0)) {
2045
+ break;
2046
+ }
2047
+ }
2048
+ const p1SolsArr = $toArray_1(this$static.p1sols, initDim(_3Lcs_threephase_FullCube_2_classLit, makeCastMap([Q$FullCube_$1, Q$Serializable, Q$Object_$1]), Q$FullCube_0, 0, 0));
2049
+ p1SolsArr.sort(function(a, b) {
2050
+ return a.value - b.value;
2051
+ });
2052
+ MAX_LENGTH2 = 9;
2053
+ do {
2054
+ OUT:
2055
+ for (length12 = p1SolsArr[0].value; length12 < 100; ++length12) {
2056
+ for (i_0 = 0; i_0 < p1SolsArr.length; ++i_0) {
2057
+ if (p1SolsArr[i_0].value > length12) {
2058
+ break;
2059
+ }
2060
+ if (length12 - p1SolsArr[i_0].length1 > MAX_LENGTH2) {
2061
+ continue;
2062
+ }
2063
+ $copy_4(this$static.c1, p1SolsArr[i_0]);
2064
+ $set_2(this$static.ct2, $getCenter(this$static.c1), parity_0($getEdge(this$static.c1).ep));
2065
+ s2ct = $getct(this$static.ct2);
2066
+ s2rl = $getrl(this$static.ct2);
2067
+ this$static.length1 = p1SolsArr[i_0].length1;
2068
+ this$static.length2 = length12 - p1SolsArr[i_0].length1;
2069
+ if ($search2(this$static, s2ct, s2rl, this$static.length2, 28, 0)) {
2070
+ break OUT;
2071
+ }
2072
+ }
2073
+ }
2074
+ ++MAX_LENGTH2;
2075
+ } while (length12 === 100);
2076
+ this$static.arr2.sort(function(a, b) {
2077
+ return a.value - b.value;
2078
+ });
2079
+ index = 0;
2080
+ MAX_LENGTH3 = 13;
2081
+ do {
2082
+ OUT2:
2083
+ for (length123 = this$static.arr2[0].value; length123 < 100; ++length123) {
2084
+ for (i_0 = 0; i_0 < Math.min(this$static.arr2idx, 100); ++i_0) {
2085
+ if (this$static.arr2[i_0].value > length123) {
2086
+ break;
2087
+ }
2088
+ if (length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2 > MAX_LENGTH3) {
2089
+ continue;
2090
+ }
2091
+ eparity = $set_6(this$static.e12, $getEdge(this$static.arr2[i_0]));
2092
+ $set_3(this$static.ct3, $getCenter(this$static.arr2[i_0]), eparity ^ parity_0($getCorner(this$static.arr2[i_0]).cp));
2093
+ ct = $getct_0(this$static.ct3);
2094
+ edge = $get_2(this$static.e12, 10);
2095
+ prun = getprun($getsym_0(this$static.e12));
2096
+ if (prun <= length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2 && $search3(this$static, edge, ct, prun, length123 - this$static.arr2[i_0].length1 - this$static.arr2[i_0].length2, 20, 0)) {
2097
+ index = i_0;
2098
+ break OUT2;
2099
+ }
2100
+ }
2101
+ }
2102
+ ++MAX_LENGTH3;
2103
+ } while (length123 === 100);
2104
+ const solcube = new FullCube_4(this$static.arr2[index]);
2105
+ this$static.length1 = solcube.length1;
2106
+ this$static.length2 = solcube.length2;
2107
+ const length_0 = length123 - this$static.length1 - this$static.length2;
2108
+ for (i_0 = 0; i_0 < length_0; ++i_0) {
2109
+ $move_6(solcube, move3std[this$static.move3[i_0]]);
2110
+ }
2111
+ this$static.solution = $getMoveString(solcube);
2112
+ }
2113
+ function $init2_0(this$static, sym) {
2114
+ let i_0, next;
2115
+ $copy_4(this$static.c1, this$static.c);
2116
+ for (i_0 = 0; i_0 < this$static.length1; ++i_0) {
2117
+ $move_6(this$static.c1, this$static.move1[i_0]);
2118
+ }
2119
+ switch (finish_0[sym]) {
2120
+ case 0:
2121
+ $move_6(this$static.c1, 24);
2122
+ $move_6(this$static.c1, 35);
2123
+ this$static.move1[this$static.length1] = 24;
2124
+ this$static.move1[this$static.length1 + 1] = 35;
2125
+ this$static.add1 = true;
2126
+ sym = 19;
2127
+ break;
2128
+ case 12869:
2129
+ $move_6(this$static.c1, 18);
2130
+ $move_6(this$static.c1, 29);
2131
+ this$static.move1[this$static.length1] = 18;
2132
+ this$static.move1[this$static.length1 + 1] = 29;
2133
+ this$static.add1 = true;
2134
+ sym = 34;
2135
+ break;
2136
+ case 735470:
2137
+ this$static.add1 = false;
2138
+ sym = 0;
2139
+ }
2140
+ $set_2(this$static.ct2, $getCenter(this$static.c1), parity_0($getEdge(this$static.c1).ep));
2141
+ const s2ct = $getct(this$static.ct2);
2142
+ const s2rl = $getrl(this$static.ct2);
2143
+ const ctp = ctprun[s2ct * 70 + s2rl];
2144
+ this$static.c1.value = ctp + this$static.length1;
2145
+ this$static.c1.length1 = this$static.length1;
2146
+ this$static.c1.add1 = this$static.add1;
2147
+ this$static.c1.sym = sym;
2148
+ ++this$static.p1SolsCnt;
2149
+ if (this$static.p1sols.heap.size < 500) {
2150
+ next = new FullCube_4(this$static.c1);
2151
+ } else {
2152
+ next = $poll(this$static.p1sols);
2153
+ next.value > this$static.c1.value && $copy_4(next, this$static.c1);
2154
+ }
2155
+ $add(this$static.p1sols, next);
2156
+ return this$static.p1SolsCnt === 1e4;
2157
+ }
2158
+ function $init3(this$static) {
2159
+ let i_0;
2160
+ $copy_4(this$static.c2, this$static.c1);
2161
+ for (i_0 = 0; i_0 < this$static.length2; ++i_0) {
2162
+ $move_6(this$static.c2, this$static.move2[i_0]);
2163
+ }
2164
+ if (!$checkEdge($getEdge(this$static.c2))) {
2165
+ return false;
2166
+ }
2167
+ const eparity = $set_6(this$static.e12, $getEdge(this$static.c2));
2168
+ $set_3(this$static.ct3, $getCenter(this$static.c2), eparity ^ parity_0($getCorner(this$static.c2).cp));
2169
+ const ct = $getct_0(this$static.ct3);
2170
+ $get_2(this$static.e12, 10);
2171
+ const prun = getprun($getsym_0(this$static.e12));
2172
+ !this$static.arr2[this$static.arr2idx] ? this$static.arr2[this$static.arr2idx] = new FullCube_4(this$static.c2) : $copy_4(this$static.arr2[this$static.arr2idx], this$static.c2);
2173
+ this$static.arr2[this$static.arr2idx].value = this$static.length1 + this$static.length2 + Math.max(prun, prun_0[ct]);
2174
+ this$static.arr2[this$static.arr2idx].length2 = this$static.length2;
2175
+ ++this$static.arr2idx;
2176
+ return this$static.arr2idx === this$static.arr2.length;
2177
+ }
2178
+ function $randomState(this$static, randomUIntBelow) {
2179
+ init_5();
2180
+ this$static.c = new FullCube_5(randomUIntBelow);
2181
+ $doSearch(this$static);
2182
+ return this$static.solution;
2183
+ }
2184
+ function $search1(this$static, ct, sym, maxl, lm, depth) {
2185
+ let axis, ctx, m_0, power, prun, symx;
2186
+ if (ct === 0) {
2187
+ return maxl === 0 && $init2_0(this$static, sym);
2188
+ }
2189
+ for (axis = 0; axis < 27; axis += 3) {
2190
+ if (axis === lm || axis === lm - 9 || axis === lm - 18) {
2191
+ continue;
2192
+ }
2193
+ for (power = 0; power < 3; ++power) {
2194
+ m_0 = axis + power;
2195
+ ctx = ctsmv[ct][symmove[sym][m_0]];
2196
+ prun = csprun[~~ctx >>> 6];
2197
+ if (prun >= maxl) {
2198
+ if (prun > maxl) {
2199
+ break;
2200
+ }
2201
+ continue;
2202
+ }
2203
+ symx = symmult[sym][ctx & 63];
2204
+ ctx >>>= 6;
2205
+ this$static.move1[depth] = m_0;
2206
+ if ($search1(this$static, ctx, symx, maxl - 1, axis, depth + 1)) {
2207
+ return true;
2208
+ }
2209
+ }
2210
+ }
2211
+ return false;
2212
+ }
2213
+ function $search2(this$static, ct, rl, maxl, lm, depth) {
2214
+ let ctx, m_0, prun, rlx;
2215
+ if (ct === 0 && ctprun[rl] === 0) {
2216
+ return maxl === 0 && $init3(this$static);
2217
+ }
2218
+ for (m_0 = 0; m_0 < 23; ++m_0) {
2219
+ if (ckmv2_0[lm][m_0]) {
2220
+ m_0 = skipAxis2[m_0];
2221
+ continue;
2222
+ }
2223
+ ctx = ctmv[ct][m_0];
2224
+ rlx = rlmv[rl][m_0];
2225
+ prun = ctprun[ctx * 70 + rlx];
2226
+ if (prun >= maxl) {
2227
+ prun > maxl && (m_0 = skipAxis2[m_0]);
2228
+ continue;
2229
+ }
2230
+ this$static.move2[depth] = move2std[m_0];
2231
+ if ($search2(this$static, ctx, rlx, maxl - 1, m_0, depth + 1)) {
2232
+ return true;
2233
+ }
2234
+ }
2235
+ return false;
2236
+ }
2237
+ function $search3(this$static, edge, ct, prun, maxl, lm, depth) {
2238
+ let cord1x, cord2x, ctx, edgex, m_0, prun1, prunx, symcord1x, symx;
2239
+ if (maxl === 0) {
2240
+ return edge === 0 && ct === 0;
2241
+ }
2242
+ $set_4(this$static.tempe[depth], edge);
2243
+ for (m_0 = 0; m_0 < 17; ++m_0) {
2244
+ if (ckmv3[lm][m_0]) {
2245
+ m_0 = skipAxis3[m_0];
2246
+ continue;
2247
+ }
2248
+ ctx = ctmove[ct][m_0];
2249
+ prun1 = prun_0[ctx];
2250
+ if (prun1 >= maxl) {
2251
+ prun1 > maxl && m_0 < 14 && (m_0 = skipAxis3[m_0]);
2252
+ continue;
2253
+ }
2254
+ edgex = getmvrot(this$static.tempe[depth].edge, m_0 << 3, 10);
2255
+ cord1x = ~~(edgex / 20160);
2256
+ symcord1x = raw2sym_1[cord1x];
2257
+ symx = symcord1x & 7;
2258
+ symcord1x >>= 3;
2259
+ cord2x = getmvrot(this$static.tempe[depth].edge, m_0 << 3 | symx, 10) % 20160;
2260
+ prunx = getprun_0(symcord1x * 20160 + cord2x, prun);
2261
+ if (prunx >= maxl) {
2262
+ prunx > maxl && m_0 < 14 && (m_0 = skipAxis3[m_0]);
2263
+ continue;
2264
+ }
2265
+ if ($search3(this$static, edgex, ctx, prunx, maxl - 1, m_0, depth + 1)) {
2266
+ this$static.move3[depth] = m_0;
2267
+ return true;
2268
+ }
2269
+ }
2270
+ return false;
2271
+ }
2272
+ function Search_4() {
2273
+ let i_0;
2274
+ this.p1sols = new PriorityQueue_0(new FullCube$ValueComparator_0());
2275
+ this.move1 = createArray(15);
2276
+ this.move2 = createArray(20);
2277
+ this.move3 = createArray(20);
2278
+ this.c1 = new FullCube_3();
2279
+ this.c2 = new FullCube_3();
2280
+ this.ct2 = new Center2_0();
2281
+ this.ct3 = new Center3_0();
2282
+ this.e12 = new Edge3_0();
2283
+ this.tempe = createArray(20);
2284
+ this.arr2 = createArray(100);
2285
+ for (i_0 = 0; i_0 < 20; ++i_0) {
2286
+ this.tempe[i_0] = new Edge3_0();
2287
+ }
2288
+ }
2289
+ function init_5() {
2290
+ if (inited_2) {
2291
+ return;
2292
+ }
2293
+ initSym_0();
2294
+ raw2sym = createArray(735471);
2295
+ initSym2Raw();
2296
+ createMoveTable();
2297
+ raw2sym = null;
2298
+ createPrun();
2299
+ init_3();
2300
+ init_4();
2301
+ initMvrot();
2302
+ initRaw2Sym();
2303
+ createPrun_0();
2304
+ inited_2 = true;
2305
+ }
2306
+ defineSeed(163, 1, makeCastMap([Q$Search_0]), Search_4);
2307
+ _.add1 = false;
2308
+ _.arr2idx = 0;
2309
+ _.c = null;
2310
+ _.length1 = 0;
2311
+ _.length2 = 0;
2312
+ _.p1SolsCnt = 0;
2313
+ _.solution = "";
2314
+ var inited_2 = false;
2315
+ var ran$clinit_Util_0 = false;
2316
+ function $clinit_Util_0() {
2317
+ if (ran$clinit_Util_0) {
2318
+ return;
2319
+ }
2320
+ ran$clinit_Util_0 = true;
2321
+ }
2322
+ function parity_0(arr) {
2323
+ let i_0, j, len, parity;
2324
+ parity = 0;
2325
+ for (i_0 = 0, len = arr.length; i_0 < len; ++i_0) {
2326
+ for (j = i_0; j < len; ++j) {
2327
+ arr[i_0] > arr[j] && (parity ^= 1);
2328
+ }
2329
+ }
2330
+ return parity;
2331
+ }
2332
+ function swap(arr, a, b, c, d, key) {
2333
+ let temp;
2334
+ switch (key) {
2335
+ case 0:
2336
+ temp = arr[d];
2337
+ arr[d] = arr[c];
2338
+ arr[c] = arr[b];
2339
+ arr[b] = arr[a];
2340
+ arr[a] = temp;
2341
+ return;
2342
+ case 1:
2343
+ temp = arr[a];
2344
+ arr[a] = arr[c];
2345
+ arr[c] = temp;
2346
+ temp = arr[b];
2347
+ arr[b] = arr[d];
2348
+ arr[d] = temp;
2349
+ return;
2350
+ case 2:
2351
+ temp = arr[a];
2352
+ arr[a] = arr[b];
2353
+ arr[b] = arr[c];
2354
+ arr[c] = arr[d];
2355
+ arr[d] = temp;
2356
+ return;
2357
+ }
2358
+ }
2359
+ function Class_0() {
2360
+ }
2361
+ function createForArray(packageName, className, seedId, componentType) {
2362
+ const clazz = new Class_0();
2363
+ clazz.typeName = packageName + className;
2364
+ isInstantiable(seedId !== 0 ? -seedId : 0) && setClassLiteral(seedId !== 0 ? -seedId : 0, clazz);
2365
+ clazz.modifiers = 4;
2366
+ clazz.superclass = Ljava_lang_Object_2_classLit;
2367
+ clazz.componentType = componentType;
2368
+ return clazz;
2369
+ }
2370
+ function createForClass(packageName, className, seedId, superclass) {
2371
+ const clazz = new Class_0();
2372
+ clazz.typeName = packageName + className;
2373
+ isInstantiable(seedId) && setClassLiteral(seedId, clazz);
2374
+ clazz.superclass = superclass;
2375
+ return clazz;
2376
+ }
2377
+ function getSeedFunction(clazz) {
2378
+ const func = seedTable[clazz.seedId];
2379
+ clazz = null;
2380
+ return func;
2381
+ }
2382
+ function isInstantiable(seedId) {
2383
+ return typeof seedId === "number" && seedId > 0;
2384
+ }
2385
+ function setClassLiteral(seedId, clazz) {
2386
+ let proto;
2387
+ clazz.seedId = seedId;
2388
+ if (seedId === 2) {
2389
+ proto = String.prototype;
2390
+ } else {
2391
+ if (seedId > 0) {
2392
+ let seed = getSeedFunction(clazz);
2393
+ if (seed) {
2394
+ proto = seed.prototype;
2395
+ } else {
2396
+ seed = seedTable[seedId] = function() {
2397
+ };
2398
+ seed.___clazz$ = clazz;
2399
+ return;
2400
+ }
2401
+ } else {
2402
+ return;
2403
+ }
2404
+ }
2405
+ proto.___clazz$ = clazz;
2406
+ }
2407
+ _.val$outerIter = null;
2408
+ function $add(this$static, o) {
2409
+ if ($offer(this$static, o)) {
2410
+ return true;
2411
+ }
2412
+ }
2413
+ function $$init_6(this$static) {
2414
+ this$static.array = initDim(_3Ljava_lang_Object_2_classLit, makeCastMap([Q$Serializable, Q$Object_$1]), Q$Object, 0, 0);
2415
+ }
2416
+ function $add_0(this$static, o) {
2417
+ setCheck(this$static.array, this$static.size++, o);
2418
+ return true;
2419
+ }
2420
+ function $clear(this$static) {
2421
+ this$static.array = initDim(_3Ljava_lang_Object_2_classLit, makeCastMap([Q$Serializable, Q$Object_$1]), Q$Object, 0, 0);
2422
+ this$static.size = 0;
2423
+ }
2424
+ function $get_4(this$static, index) {
2425
+ return this$static.array[index];
2426
+ }
2427
+ function $remove_0(this$static, index) {
2428
+ const previous = this$static.array[index];
2429
+ splice_0(this$static.array, index, 1);
2430
+ --this$static.size;
2431
+ return previous;
2432
+ }
2433
+ function $set_7(this$static, index, o) {
2434
+ const previous = this$static.array[index];
2435
+ setCheck(this$static.array, index, o);
2436
+ return previous;
2437
+ }
2438
+ function $toArray_0(this$static, out) {
2439
+ let i_0;
2440
+ out.length < this$static.size && (out = createFrom(out, this$static.size));
2441
+ for (i_0 = 0; i_0 < this$static.size; ++i_0) {
2442
+ setCheck(out, i_0, this$static.array[i_0]);
2443
+ }
2444
+ out.length > this$static.size && setCheck(out, this$static.size, null);
2445
+ return out;
2446
+ }
2447
+ function ArrayList_1() {
2448
+ $$init_6(this);
2449
+ this.array.length = 500;
2450
+ }
2451
+ function splice_0(array, index, deleteCount) {
2452
+ array.splice(index, deleteCount);
2453
+ }
2454
+ _.size = 0;
2455
+ function binarySearch_0(sortedArray, key) {
2456
+ let high, low, mid, midVal;
2457
+ low = 0;
2458
+ high = sortedArray.length - 1;
2459
+ while (low <= high) {
2460
+ mid = low + (~~(high - low) >> 1);
2461
+ midVal = sortedArray[mid];
2462
+ if (midVal < key) {
2463
+ low = mid + 1;
2464
+ } else if (midVal > key) {
2465
+ high = mid - 1;
2466
+ } else {
2467
+ return mid;
2468
+ }
2469
+ }
2470
+ return -low - 1;
2471
+ }
2472
+ function fill_0(a) {
2473
+ fill_1(a, a.length);
2474
+ }
2475
+ function fill_1(a, toIndex) {
2476
+ let i_0;
2477
+ for (i_0 = 0; i_0 < toIndex; ++i_0) {
2478
+ a[i_0] = -1;
2479
+ }
2480
+ }
2481
+ function $mergeHeaps(this$static, node) {
2482
+ let smallestChild, leftChild, rightChild, smallestChild_0;
2483
+ const heapSize = this$static.heap.size;
2484
+ const value = $get_4(this$static.heap, node);
2485
+ while (node * 2 + 1 < heapSize) {
2486
+ smallestChild = (leftChild = 2 * node + 1, rightChild = leftChild + 1, smallestChild_0 = leftChild, rightChild < heapSize && $compare_0($get_4(this$static.heap, rightChild), $get_4(this$static.heap, leftChild)) < 0 && (smallestChild_0 = rightChild), smallestChild_0);
2487
+ if ($compare_0(value, $get_4(this$static.heap, smallestChild)) < 0) {
2488
+ break;
2489
+ }
2490
+ $set_7(this$static.heap, node, $get_4(this$static.heap, smallestChild));
2491
+ node = smallestChild;
2492
+ }
2493
+ $set_7(this$static.heap, node, value);
2494
+ }
2495
+ function $offer(this$static, e) {
2496
+ let childNode, node;
2497
+ node = this$static.heap.size;
2498
+ $add_0(this$static.heap, e);
2499
+ while (node > 0) {
2500
+ childNode = node;
2501
+ node = ~~((node - 1) / 2);
2502
+ if ($compare_0($get_4(this$static.heap, node), e) <= 0) {
2503
+ $set_7(this$static.heap, childNode, e);
2504
+ return true;
2505
+ }
2506
+ $set_7(this$static.heap, childNode, $get_4(this$static.heap, node));
2507
+ }
2508
+ $set_7(this$static.heap, node, e);
2509
+ return true;
2510
+ }
2511
+ function $poll(this$static) {
2512
+ if (this$static.heap.size === 0) {
2513
+ return null;
2514
+ }
2515
+ const value = $get_4(this$static.heap, 0);
2516
+ $removeAtIndex(this$static);
2517
+ return value;
2518
+ }
2519
+ function $removeAtIndex(this$static) {
2520
+ const lastValue = $remove_0(this$static.heap, this$static.heap.size - 1);
2521
+ if (0 < this$static.heap.size) {
2522
+ $set_7(this$static.heap, 0, lastValue);
2523
+ $mergeHeaps(this$static, 0);
2524
+ }
2525
+ }
2526
+ function $toArray_1(this$static, a) {
2527
+ return $toArray_0(this$static.heap, a);
2528
+ }
2529
+ function PriorityQueue_0(cmp) {
2530
+ this.heap = new ArrayList_1();
2531
+ this.cmp = cmp;
2532
+ }
2533
+ defineSeed(239, 1, {}, PriorityQueue_0);
2534
+ _.cmp = null;
2535
+ _.heap = null;
2536
+ var Ljava_lang_Object_2_classLit = createForClass("java.lang.", "Object", 1, null);
2537
+ var _3Ljava_lang_Object_2_classLit = createForArray("[Ljava.lang.", "Object;", 356, Ljava_lang_Object_2_classLit);
2538
+ var Lcs_threephase_FullCube_2_classLit = createForClass("cs.threephase.", "FullCube", 160, Ljava_lang_Object_2_classLit);
2539
+ var _3Lcs_threephase_FullCube_2_classLit = createForArray("[Lcs.threephase.", "FullCube;", 381, Lcs_threephase_FullCube_2_classLit);
2540
+ var searcher;
2541
+ var raninit = false;
2542
+ function init() {
2543
+ if (raninit) {
2544
+ return;
2545
+ }
2546
+ raninit = true;
2547
+ $clinit_Moves();
2548
+ $clinit_Util_0();
2549
+ $clinit_Center1();
2550
+ $clinit_Center2();
2551
+ $clinit_Center3();
2552
+ $clinit_Edge3();
2553
+ $clinit_CornerCube();
2554
+ $clinit_EdgeCube();
2555
+ $clinit_FullCube_0();
2556
+ searcher = new Search_4();
2557
+ }
2558
+ function initialize() {
2559
+ init();
2560
+ init_5();
2561
+ }
2562
+ async function random444Scramble() {
2563
+ mustBeInsideWorker();
2564
+ init();
2565
+ const suffix = Alg.fromString($randomState(searcher, await randomUIntBelowFactory()));
2566
+ return (await random333Scramble()).concat(suffix);
2567
+ }
2568
+ export {
2569
+ initialize,
2570
+ random444Scramble
2571
+ };
2572
+ //# sourceMappingURL=scramble_444-JP3CWLJM.js.map