cubing 0.36.2 → 0.37.0-pre1
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.
- package/dist/esm/alg/index.js +1 -1
- package/dist/esm/bluetooth/index.js +5 -5
- package/dist/esm/{chunk-CS3NN22U.js → chunk-6XZN5QCJ.js} +46 -39
- package/dist/esm/chunk-6XZN5QCJ.js.map +7 -0
- package/dist/esm/{chunk-BT4N5EGX.js → chunk-7MSAVSVG.js} +3 -3
- package/dist/esm/chunk-7QE2OVHX.js +9 -0
- package/dist/esm/{chunk-RHC3DIN3.js.map → chunk-7QE2OVHX.js.map} +1 -1
- package/dist/esm/{chunk-KPYYHLXC.js → chunk-GGJSIUGA.js} +4 -4
- package/dist/esm/{chunk-QWQ3WKAJ.js → chunk-L4PH24KU.js} +3 -3
- package/dist/esm/{chunk-IKK6NEES.js → chunk-L7WY7BIO.js} +3 -3
- package/dist/esm/{chunk-EODSL4J7.js → chunk-O64NYJ3S.js} +5 -5
- package/dist/esm/{chunk-UIGRNWPE.js → chunk-RSF22LKP.js} +2 -2
- package/dist/esm/{chunk-2OZSC5I6.js → chunk-TM7SKFJD.js} +3 -2
- package/dist/esm/{chunk-2OZSC5I6.js.map → chunk-TM7SKFJD.js.map} +2 -2
- package/dist/esm/{chunk-Z4KB5H3Q.js → chunk-TNBM5BTH.js} +13 -13
- package/dist/esm/{chunk-HNCNLZCQ.js → chunk-WWCSMIJO.js} +22 -9
- package/dist/esm/{chunk-HNCNLZCQ.js.map → chunk-WWCSMIJO.js.map} +2 -2
- package/dist/esm/{chunk-HPHL232Y.js → chunk-ZIFM3JF6.js} +2 -2
- package/dist/esm/inside-PD4VUO4N.js +17 -0
- package/dist/esm/{search-worker-js-entry-Z7ZJHXOP.js.map → inside-PD4VUO4N.js.map} +1 -1
- package/dist/esm/kpuzzle/index.js +2 -2
- package/dist/esm/notation/index.js +6 -8
- package/dist/esm/protocol/index.js +4 -4
- package/dist/esm/puzzle-geometry/index.js +1 -1
- package/dist/esm/puzzles/index.js +4 -4
- package/dist/esm/scramble/index.js +9 -9
- package/dist/esm/search/index.js +10 -10
- package/dist/esm/{search-worker-ts-entry-7OR7E6EC.js → search/worker-workarounds/search-worker-entry.js} +6 -6
- package/dist/esm/search/worker-workarounds/search-worker-entry.js.map +7 -0
- package/dist/esm/{search-dynamic-sgs-side-events-X3HJIH2M.js → search-dynamic-sgs-side-events-U7UKYK6F.js} +6 -6
- package/dist/esm/{search-dynamic-sgs-unofficial-4DTLRYXW.js → search-dynamic-sgs-unofficial-MGKPYZK5.js} +6 -6
- package/dist/esm/{search-dynamic-solve-4x4x4-KOSBPTFL.js → search-dynamic-solve-4x4x4-YRWEYWTY.js} +6 -6
- package/dist/esm/{search-dynamic-solve-kilominx-QJWWB2PY.js → search-dynamic-solve-kilominx-HCOWDD7C.js} +2 -2
- package/dist/esm/stream/index.js +1 -1
- package/dist/esm/twisty/index.js +26 -19
- package/dist/esm/twisty/index.js.map +2 -2
- package/dist/esm/{twisty-dynamic-3d-XRLWOI7Y.js → twisty-dynamic-3d-JRADYLKK.js} +6 -6
- package/dist/esm/{twsearch-FMALADRY.js → twsearch-JCPGQMKW.js} +2 -2
- package/dist/types/notation/index.d.ts +2 -3
- package/dist/types/{outside-ef4dd4d1.d.ts → outside-7959a3cd.d.ts} +3 -2
- package/dist/types/scramble/index.d.ts +1 -1
- package/dist/types/search/index.d.ts +1 -1
- package/package.json +1 -2
- package/dist/esm/chunk-CS3NN22U.js.map +0 -7
- package/dist/esm/chunk-RHC3DIN3.js +0 -9
- package/dist/esm/search-worker-inside-generated-string-EFAMJBWG.js +0 -4337
- package/dist/esm/search-worker-inside-generated-string-EFAMJBWG.js.map +0 -7
- package/dist/esm/search-worker-js-entry-Z7ZJHXOP.js +0 -17
- package/dist/esm/search-worker-ts-entry-7OR7E6EC.js.map +0 -7
- /package/dist/esm/{chunk-BT4N5EGX.js.map → chunk-7MSAVSVG.js.map} +0 -0
- /package/dist/esm/{chunk-KPYYHLXC.js.map → chunk-GGJSIUGA.js.map} +0 -0
- /package/dist/esm/{chunk-QWQ3WKAJ.js.map → chunk-L4PH24KU.js.map} +0 -0
- /package/dist/esm/{chunk-IKK6NEES.js.map → chunk-L7WY7BIO.js.map} +0 -0
- /package/dist/esm/{chunk-EODSL4J7.js.map → chunk-O64NYJ3S.js.map} +0 -0
- /package/dist/esm/{chunk-UIGRNWPE.js.map → chunk-RSF22LKP.js.map} +0 -0
- /package/dist/esm/{chunk-Z4KB5H3Q.js.map → chunk-TNBM5BTH.js.map} +0 -0
- /package/dist/esm/{chunk-HPHL232Y.js.map → chunk-ZIFM3JF6.js.map} +0 -0
- /package/dist/esm/{search-dynamic-sgs-side-events-X3HJIH2M.js.map → search-dynamic-sgs-side-events-U7UKYK6F.js.map} +0 -0
- /package/dist/esm/{search-dynamic-sgs-unofficial-4DTLRYXW.js.map → search-dynamic-sgs-unofficial-MGKPYZK5.js.map} +0 -0
- /package/dist/esm/{search-dynamic-solve-4x4x4-KOSBPTFL.js.map → search-dynamic-solve-4x4x4-YRWEYWTY.js.map} +0 -0
- /package/dist/esm/{search-dynamic-solve-kilominx-QJWWB2PY.js.map → search-dynamic-solve-kilominx-HCOWDD7C.js.map} +0 -0
- /package/dist/esm/{twisty-dynamic-3d-XRLWOI7Y.js.map → twisty-dynamic-3d-JRADYLKK.js.map} +0 -0
- /package/dist/esm/{twsearch-FMALADRY.js.map → twsearch-JCPGQMKW.js.map} +0 -0
|
@@ -7,28 +7,28 @@ import {
|
|
|
7
7
|
random333Scramble,
|
|
8
8
|
setIsInsideWorker,
|
|
9
9
|
solve333
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-O64NYJ3S.js";
|
|
11
11
|
import {
|
|
12
12
|
countMoves
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WWCSMIJO.js";
|
|
14
14
|
import {
|
|
15
15
|
cube2x2x2,
|
|
16
16
|
puzzles
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GGJSIUGA.js";
|
|
18
18
|
import {
|
|
19
19
|
from,
|
|
20
20
|
normalize2x2x2Orientation
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-L4PH24KU.js";
|
|
22
22
|
import {
|
|
23
23
|
KPuzzle,
|
|
24
24
|
KState
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RSF22LKP.js";
|
|
26
26
|
import {
|
|
27
27
|
Alg,
|
|
28
28
|
AlgBuilder,
|
|
29
29
|
Move,
|
|
30
30
|
QuantumMove
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TM7SKFJD.js";
|
|
32
32
|
|
|
33
33
|
// src/cubing/search/inside/solve/puzzles/2x2x2.ts
|
|
34
34
|
import { randomPermuteInPlace, randomUIntBelow } from "random-uint-below";
|
|
@@ -172,10 +172,10 @@ function randomStateFromSGS(kpuzzle, sgs) {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
// src/cubing/search/inside/solve/puzzles/dynamic/sgs-side-events/index.ts
|
|
175
|
-
var searchDynamicSideEvents = from(() => import("./search-dynamic-sgs-side-events-
|
|
175
|
+
var searchDynamicSideEvents = from(() => import("./search-dynamic-sgs-side-events-U7UKYK6F.js"));
|
|
176
176
|
|
|
177
177
|
// src/cubing/search/inside/solve/twsearch.ts
|
|
178
|
-
var twsearchPromise = from(async () => import("./twsearch-
|
|
178
|
+
var twsearchPromise = from(async () => import("./twsearch-JCPGQMKW.js"));
|
|
179
179
|
var existingPuzzleDefString;
|
|
180
180
|
var existingMoveSubsetString;
|
|
181
181
|
function mustBeNaturalNumber(meaning, n) {
|
|
@@ -359,7 +359,7 @@ async function random222Scramble() {
|
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
// src/cubing/search/inside/solve/puzzles/dynamic/4x4x4/index.ts
|
|
362
|
-
var dynamic4x4x4Solver = from(() => import("./search-dynamic-solve-4x4x4-
|
|
362
|
+
var dynamic4x4x4Solver = from(() => import("./search-dynamic-solve-4x4x4-YRWEYWTY.js"));
|
|
363
363
|
|
|
364
364
|
// src/cubing/search/inside/solve/puzzles/4x4x4.ts
|
|
365
365
|
var randomSuffixes = [
|
|
@@ -452,14 +452,14 @@ async function oriented555RandomMoves() {
|
|
|
452
452
|
var dynamicFTOSolver = from(() => import("./search-dynamic-solve-fto-IDE3JR5R.js"));
|
|
453
453
|
|
|
454
454
|
// src/cubing/search/inside/solve/puzzles/fto.ts
|
|
455
|
-
var dynamic = from(() => import("./search-dynamic-sgs-unofficial-
|
|
455
|
+
var dynamic = from(() => import("./search-dynamic-sgs-unofficial-MGKPYZK5.js"));
|
|
456
456
|
async function randomFTOScramble() {
|
|
457
457
|
mustBeInsideWorker();
|
|
458
458
|
return new Alg(await (await dynamicFTOSolver).randomFTOScrambleString());
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
// src/cubing/search/inside/solve/puzzles/dynamic/kilominx/index.ts
|
|
462
|
-
var dynamicKilominxSolver = from(() => import("./search-dynamic-solve-kilominx-
|
|
462
|
+
var dynamicKilominxSolver = from(() => import("./search-dynamic-solve-kilominx-HCOWDD7C.js"));
|
|
463
463
|
|
|
464
464
|
// src/cubing/search/inside/solve/puzzles/kilominx.ts
|
|
465
465
|
async function randomKilominxScramble() {
|
|
@@ -540,7 +540,7 @@ async function randomPyraminxScrambleFixedOrientation() {
|
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
// src/cubing/search/inside/solve/puzzles/dynamic/sgs-unofficial/index.ts
|
|
543
|
-
var searchDynamicUnofficial = from(() => import("./search-dynamic-sgs-unofficial-
|
|
543
|
+
var searchDynamicUnofficial = from(() => import("./search-dynamic-sgs-unofficial-MGKPYZK5.js"));
|
|
544
544
|
|
|
545
545
|
// src/cubing/search/inside/solve/puzzles/redi_cube.ts
|
|
546
546
|
async function randomRediCubeScramble() {
|
|
@@ -797,4 +797,4 @@ var insideAPI = {
|
|
|
797
797
|
export {
|
|
798
798
|
insideAPI
|
|
799
799
|
};
|
|
800
|
-
//# sourceMappingURL=chunk-
|
|
800
|
+
//# sourceMappingURL=chunk-TNBM5BTH.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cube3x3x3KPuzzleDefinition
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L4PH24KU.js";
|
|
4
4
|
import {
|
|
5
5
|
TraversalUp,
|
|
6
6
|
functionFromTraversal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TM7SKFJD.js";
|
|
8
8
|
|
|
9
9
|
// src/cubing/notation/commonMetrics.ts
|
|
10
10
|
var CommonMetric = /* @__PURE__ */ ((CommonMetric2) => {
|
|
@@ -146,21 +146,27 @@ function baseMetric(move) {
|
|
|
146
146
|
function etmMetric(_move) {
|
|
147
147
|
return 1;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function rangeBlockTurnMetric(move) {
|
|
150
150
|
const fam = move.family;
|
|
151
151
|
if (isCharUppercase(fam[0]) && fam[fam.length - 1] === "v" || fam === "x" || fam === "y" || fam === "z" || fam === "T") {
|
|
152
152
|
return 0;
|
|
153
153
|
} else {
|
|
154
|
-
return
|
|
154
|
+
return 1;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
function quantumMetric(move) {
|
|
158
|
+
return Math.abs(move.amount) * rangeBlockTurnMetric(move);
|
|
159
|
+
}
|
|
157
160
|
var countMoves = functionFromTraversal(CountMoves, [baseMetric]);
|
|
158
161
|
var countMovesETM = functionFromTraversal(CountMoves, [etmMetric]);
|
|
159
|
-
var
|
|
162
|
+
var countRangeBlockQuantumMovesPG = functionFromTraversal(CountMoves, [
|
|
160
163
|
quantumMetric
|
|
161
164
|
]);
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
var countRangeBlockMovesPG = functionFromTraversal(CountMoves, [
|
|
166
|
+
rangeBlockTurnMetric
|
|
167
|
+
]);
|
|
168
|
+
function countMetricMoves(puzzleLoader, metric, alg) {
|
|
169
|
+
if (puzzleLoader.id === "3x3x3") {
|
|
164
170
|
if (metric in costFactorsByMetric) {
|
|
165
171
|
return functionFromTraversal(CountMoves, [
|
|
166
172
|
(move) => countMove3x3x3(metric, move)
|
|
@@ -170,6 +176,14 @@ function countMetricMoves(puzzle, metric, alg) {
|
|
|
170
176
|
switch (metric) {
|
|
171
177
|
case "ETM" /* ExecutionTurnMetric */:
|
|
172
178
|
return countMovesETM(alg);
|
|
179
|
+
case "RBTM" /* RangeBlockTurnMetric */:
|
|
180
|
+
if (puzzleLoader.pg) {
|
|
181
|
+
return countRangeBlockMovesPG(alg);
|
|
182
|
+
}
|
|
183
|
+
case "RBQTM" /* RangeBlockQuantumTurnMetric */:
|
|
184
|
+
if (puzzleLoader.pg) {
|
|
185
|
+
return countRangeBlockQuantumMovesPG(alg);
|
|
186
|
+
}
|
|
173
187
|
}
|
|
174
188
|
}
|
|
175
189
|
throw new Error("Unsupported puzzle or metric.");
|
|
@@ -213,8 +227,7 @@ export {
|
|
|
213
227
|
CommonMetricAlias,
|
|
214
228
|
countMoves,
|
|
215
229
|
countMovesETM,
|
|
216
|
-
countQuantumMoves,
|
|
217
230
|
countMetricMoves,
|
|
218
231
|
countAnimatedLeaves
|
|
219
232
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
233
|
+
//# sourceMappingURL=chunk-WWCSMIJO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cubing/notation/commonMetrics.ts", "../../src/cubing/notation/cube3x3x3Metrics.ts", "../../src/cubing/notation/CountMoves.ts", "../../src/cubing/notation/CountAnimatedLeaves.ts"],
|
|
4
|
-
"sourcesContent": ["export enum CommonMetric {\n // OBTM (Outer Block Turn Metric)\n OuterBlockTurnMetric = \"OBTM\",\n // RBTM (Range Block Turn Metric)\n RangeBlockTurnMetric = \"RBTM\",\n // SSTM (Single Slice Turn Metric)\n SingleSliceTurnMetric = \"SSTM\",\n // OBQTM (Outer Block Quantum Turn Metric)\n OuterBlockQuantumTurnMetric = \"OBQTM\",\n // RBQTM (Range Block Quantum Turn Metric)\n RangeBlockQuantumTurnMetric = \"RBQTM\",\n // SSQTM (Single Slice Quantum Turn Metric)\n SingleSliceQuantumTurnMetric = \"SSQTM\",\n ExecutionTurnMetric = \"ETM\",\n}\n\nexport enum CommonMetricAlias {\n // QTM (Quantum Turn Metric)\n QuantumTurnMetric = \"OBQTM\",\n // HTM (Hand Turn Metric)\n HandTurnMetric = \"OBTM\",\n // STM (Slice Turn Metric)\n SliceTurnMetric = \"RBTM\",\n}\n", "// TODO: move this into the 3x3x3 puzzle loader.\n\nimport type { Move } from \"../alg\";\nimport { experimentalCube3x3x3KPuzzleDefinition } from \"../puzzles/cubing-private\";\nimport { CommonMetric } from \"./commonMetrics\";\n\nenum MoveType {\n Rotation = \"Rotation\",\n Outer = \"Outer\",\n Inner = \"Inner\",\n}\n\nfunction uncachedMoveCount(moveQuantumString: string): MoveType {\n if (\n moveQuantumString.endsWith(\"v\") ||\n [\"x\", \"y\", \"z\"].includes(moveQuantumString)\n ) {\n // Rv\n return MoveType.Rotation;\n }\n if (\n moveQuantumString.startsWith(\"2\") ||\n [\"M\", \"E\", \"S\"].includes(moveQuantumString)\n ) {\n return MoveType.Inner;\n }\n return MoveType.Outer;\n}\n\nlet cache: Record<string, MoveType> | undefined;\nfunction getCache(): Record<string, MoveType> {\n if (cache) {\n return cache;\n }\n cache = {};\n const moveQuantumStrings = [\n ...Object.keys(experimentalCube3x3x3KPuzzleDefinition.moves),\n ...Object.keys(\n experimentalCube3x3x3KPuzzleDefinition.experimentalDerivedMoves!,\n ),\n ];\n for (const moveQuantumString of moveQuantumStrings) {\n cache[moveQuantumString] = uncachedMoveCount(moveQuantumString);\n }\n return cache;\n}\n\n// Ancient wisdom: https://github.com/cubing/alg.js/blob/0599fad84d81b8d943ad3ea3e5dc191db8b6c157/alg.js#L638-L651\n/**\n * A move with an amount of 0 always has 0 cost. Else, the cost is\n *\n * constantFactor + amountFactor * Math.abs(move.amount)\n *\n */\nexport const costFactorsByMetric: Partial<\n Record<\n CommonMetric,\n Record<\n MoveType,\n {\n constantFactor: number;\n amountFactor: number;\n }\n >\n >\n> = {\n // Note: these are hardcoded for 3x3x3. They will not automatically generalize to any other puzzles.\n [CommonMetric.OuterBlockTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 2, amountFactor: 0 },\n },\n [CommonMetric.RangeBlockTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 1, amountFactor: 0 },\n },\n [CommonMetric.OuterBlockQuantumTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 0, amountFactor: 1 },\n [MoveType.Inner]: { constantFactor: 0, amountFactor: 2 },\n },\n [CommonMetric.RangeBlockQuantumTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 0, amountFactor: 1 },\n [MoveType.Inner]: { constantFactor: 0, amountFactor: 1 },\n },\n [CommonMetric.ExecutionTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 1, amountFactor: 0 },\n },\n};\n\nexport function countMove3x3x3(metric: CommonMetric, move: Move): number {\n const costFactors = costFactorsByMetric[metric];\n if (!costFactors) {\n throw new Error(`Invalid metric for 3x3x3: ${metric}`);\n }\n const cache = getCache();\n const moveQuantumString = move.quantum.toString();\n if (!(moveQuantumString in cache)) {\n throw new Error(`Invalid move for 3x3x3 ${metric}: ${moveQuantumString}`);\n }\n const costType = cache[moveQuantumString];\n const { constantFactor, amountFactor } = costFactors[costType];\n return constantFactor + amountFactor * Math.abs(move.amount);\n}\n", "// TODO: move this file somewhere permanent.\nimport {\n Alg,\n Commutator,\n Conjugate,\n functionFromTraversal,\n Grouping,\n LineComment,\n Move,\n Newline,\n Pause,\n TraversalUp,\n} from \"../alg\";\nimport type { PuzzleLoader } from \"../puzzles\";\nimport { CommonMetric } from \"./commonMetrics\";\nimport { costFactorsByMetric, countMove3x3x3 } from \"./cube3x3x3Metrics\";\n\n/*\n * For movecount, that understands puzzle rotations. This code\n * should be moved to the alg class, probably.\n */\nclass CountMoves extends TraversalUp<number> {\n constructor(private metric: (move: Move) => number) {\n super();\n }\n\n public traverseAlg(alg: Alg): number {\n let r = 0;\n for (const algNode of alg.childAlgNodes()) {\n r += this.traverseAlgNode(algNode);\n }\n return r;\n }\n\n public traverseGrouping(grouping: Grouping): number {\n const alg: Alg = grouping.alg;\n return this.traverseAlg(alg) * Math.abs(grouping.amount);\n }\n\n public traverseMove(move: Move): number {\n return this.metric(move);\n }\n\n public traverseCommutator(commutator: Commutator): number {\n return (\n 2 * (this.traverseAlg(commutator.A) + this.traverseAlg(commutator.B))\n );\n }\n\n public traverseConjugate(conjugate: Conjugate): number {\n return 2 * this.traverseAlg(conjugate.A) + this.traverseAlg(conjugate.B);\n }\n\n // TODO: Remove spaces between repeated pauses (in traverseSequence)\n public traversePause(_pause: Pause): number {\n return 0;\n }\n\n public traverseNewline(_newLine: Newline): number {\n return 0;\n }\n\n // TODO: Enforce being followed by a newline (or the end of the alg)?\n public traverseLineComment(_comment: LineComment): number {\n return 0;\n }\n}\n\nfunction isCharUppercase(c: string): boolean {\n return \"A\" <= c && c <= \"Z\";\n}\n\n// TODO: Implement a puzzle-specific way to calculate this.\nfunction baseMetric(move: Move): number {\n const fam = move.family;\n if (\n (isCharUppercase(fam[0]) && fam[fam.length - 1] === \"v\") ||\n fam === \"x\" ||\n fam === \"y\" ||\n fam === \"z\" ||\n fam === \"T\"\n ) {\n return 0;\n } else {\n return 1;\n }\n}\n\nfunction etmMetric(_move: Move): number {\n return 1;\n}\n\n// TODO: Implement a puzzle-specific way to calculate this.\nfunction
|
|
5
|
-
"mappings": ";;;;;;;;;AAAO,IAAK,eAAL,kBAAKA,kBAAL;AAEL,EAAAA,cAAA,0BAAuB;AAEvB,EAAAA,cAAA,0BAAuB;AAEvB,EAAAA,cAAA,2BAAwB;AAExB,EAAAA,cAAA,iCAA8B;AAE9B,EAAAA,cAAA,iCAA8B;AAE9B,EAAAA,cAAA,kCAA+B;AAC/B,EAAAA,cAAA,yBAAsB;AAbZ,SAAAA;AAAA,GAAA;AAgBL,IAAK,oBAAL,kBAAKC,uBAAL;AAEL,EAAAA,mBAAA,uBAAoB;AAEpB,EAAAA,mBAAA,oBAAiB;AAEjB,EAAAA,mBAAA,qBAAkB;AANR,SAAAA;AAAA,GAAA;;;ACJZ,SAAS,kBAAkB,mBAAqC;AAC9D,MACE,kBAAkB,SAAS,GAAG,KAC9B,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,iBAAiB,GAC1C;AAEA,WAAO;AAAA,EACT;AACA,MACE,kBAAkB,WAAW,GAAG,KAChC,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,iBAAiB,GAC1C;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAI;AACJ,SAAS,WAAqC;AAC5C,MAAI,OAAO;AACT,WAAO;AAAA,EACT;AACA,UAAQ,CAAC;AACT,QAAM,qBAAqB;AAAA,IACzB,GAAG,OAAO,KAAK,2BAAuC,KAAK;AAAA,IAC3D,GAAG,OAAO;AAAA,MACR,2BAAuC;AAAA,IACzC;AAAA,EACF;AACA,aAAW,qBAAqB,oBAAoB;AAClD,UAAM,iBAAiB,IAAI,kBAAkB,iBAAiB;AAAA,EAChE;AACA,SAAO;AACT;AASO,IAAM,sBAWT;AAAA;AAAA,EAEF,kCAAkC,GAAG;AAAA,IACnC,CAAC,yBAAi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MAAoB;AACtC,QAAM,MAAM,KAAK;AACjB,MACG,gBAAgB,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,SAAS,CAAC,MAAM,OACpD,QAAQ,OACR,QAAQ,OACR,QAAQ,OACR,QAAQ,KACR;AACA,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAEA,SAAS,UAAU,OAAqB;AACtC,SAAO;AACT;AAGA,SAAS,
|
|
4
|
+
"sourcesContent": ["export enum CommonMetric {\n // OBTM (Outer Block Turn Metric)\n OuterBlockTurnMetric = \"OBTM\",\n // RBTM (Range Block Turn Metric)\n RangeBlockTurnMetric = \"RBTM\",\n // SSTM (Single Slice Turn Metric)\n SingleSliceTurnMetric = \"SSTM\",\n // OBQTM (Outer Block Quantum Turn Metric)\n OuterBlockQuantumTurnMetric = \"OBQTM\",\n // RBQTM (Range Block Quantum Turn Metric)\n RangeBlockQuantumTurnMetric = \"RBQTM\",\n // SSQTM (Single Slice Quantum Turn Metric)\n SingleSliceQuantumTurnMetric = \"SSQTM\",\n ExecutionTurnMetric = \"ETM\",\n}\n\nexport enum CommonMetricAlias {\n // QTM (Quantum Turn Metric)\n QuantumTurnMetric = \"OBQTM\",\n // HTM (Hand Turn Metric)\n HandTurnMetric = \"OBTM\",\n // STM (Slice Turn Metric)\n SliceTurnMetric = \"RBTM\",\n}\n", "// TODO: move this into the 3x3x3 puzzle loader.\n\nimport type { Move } from \"../alg\";\nimport { experimentalCube3x3x3KPuzzleDefinition } from \"../puzzles/cubing-private\";\nimport { CommonMetric } from \"./commonMetrics\";\n\nenum MoveType {\n Rotation = \"Rotation\",\n Outer = \"Outer\",\n Inner = \"Inner\",\n}\n\nfunction uncachedMoveCount(moveQuantumString: string): MoveType {\n if (\n moveQuantumString.endsWith(\"v\") ||\n [\"x\", \"y\", \"z\"].includes(moveQuantumString)\n ) {\n // Rv\n return MoveType.Rotation;\n }\n if (\n moveQuantumString.startsWith(\"2\") ||\n [\"M\", \"E\", \"S\"].includes(moveQuantumString)\n ) {\n return MoveType.Inner;\n }\n return MoveType.Outer;\n}\n\nlet cache: Record<string, MoveType> | undefined;\nfunction getCache(): Record<string, MoveType> {\n if (cache) {\n return cache;\n }\n cache = {};\n const moveQuantumStrings = [\n ...Object.keys(experimentalCube3x3x3KPuzzleDefinition.moves),\n ...Object.keys(\n experimentalCube3x3x3KPuzzleDefinition.experimentalDerivedMoves!,\n ),\n ];\n for (const moveQuantumString of moveQuantumStrings) {\n cache[moveQuantumString] = uncachedMoveCount(moveQuantumString);\n }\n return cache;\n}\n\n// Ancient wisdom: https://github.com/cubing/alg.js/blob/0599fad84d81b8d943ad3ea3e5dc191db8b6c157/alg.js#L638-L651\n/**\n * A move with an amount of 0 always has 0 cost. Else, the cost is\n *\n * constantFactor + amountFactor * Math.abs(move.amount)\n *\n */\nexport const costFactorsByMetric: Partial<\n Record<\n CommonMetric,\n Record<\n MoveType,\n {\n constantFactor: number;\n amountFactor: number;\n }\n >\n >\n> = {\n // Note: these are hardcoded for 3x3x3. They will not automatically generalize to any other puzzles.\n [CommonMetric.OuterBlockTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 2, amountFactor: 0 },\n },\n [CommonMetric.RangeBlockTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 1, amountFactor: 0 },\n },\n [CommonMetric.OuterBlockQuantumTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 0, amountFactor: 1 },\n [MoveType.Inner]: { constantFactor: 0, amountFactor: 2 },\n },\n [CommonMetric.RangeBlockQuantumTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 0, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 0, amountFactor: 1 },\n [MoveType.Inner]: { constantFactor: 0, amountFactor: 1 },\n },\n [CommonMetric.ExecutionTurnMetric]: {\n [MoveType.Rotation]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Outer]: { constantFactor: 1, amountFactor: 0 },\n [MoveType.Inner]: { constantFactor: 1, amountFactor: 0 },\n },\n};\n\nexport function countMove3x3x3(metric: CommonMetric, move: Move): number {\n const costFactors = costFactorsByMetric[metric];\n if (!costFactors) {\n throw new Error(`Invalid metric for 3x3x3: ${metric}`);\n }\n const cache = getCache();\n const moveQuantumString = move.quantum.toString();\n if (!(moveQuantumString in cache)) {\n throw new Error(`Invalid move for 3x3x3 ${metric}: ${moveQuantumString}`);\n }\n const costType = cache[moveQuantumString];\n const { constantFactor, amountFactor } = costFactors[costType];\n return constantFactor + amountFactor * Math.abs(move.amount);\n}\n", "// TODO: move this file somewhere permanent.\nimport {\n Alg,\n Commutator,\n Conjugate,\n functionFromTraversal,\n Grouping,\n LineComment,\n Move,\n Newline,\n Pause,\n TraversalUp,\n} from \"../alg\";\nimport type { PuzzleLoader } from \"../puzzles\";\nimport { CommonMetric } from \"./commonMetrics\";\nimport { costFactorsByMetric, countMove3x3x3 } from \"./cube3x3x3Metrics\";\n\n/*\n * For movecount, that understands puzzle rotations. This code\n * should be moved to the alg class, probably.\n */\nclass CountMoves extends TraversalUp<number> {\n constructor(private metric: (move: Move) => number) {\n super();\n }\n\n public traverseAlg(alg: Alg): number {\n let r = 0;\n for (const algNode of alg.childAlgNodes()) {\n r += this.traverseAlgNode(algNode);\n }\n return r;\n }\n\n public traverseGrouping(grouping: Grouping): number {\n const alg: Alg = grouping.alg;\n return this.traverseAlg(alg) * Math.abs(grouping.amount);\n }\n\n public traverseMove(move: Move): number {\n return this.metric(move);\n }\n\n public traverseCommutator(commutator: Commutator): number {\n return (\n 2 * (this.traverseAlg(commutator.A) + this.traverseAlg(commutator.B))\n );\n }\n\n public traverseConjugate(conjugate: Conjugate): number {\n return 2 * this.traverseAlg(conjugate.A) + this.traverseAlg(conjugate.B);\n }\n\n // TODO: Remove spaces between repeated pauses (in traverseSequence)\n public traversePause(_pause: Pause): number {\n return 0;\n }\n\n public traverseNewline(_newLine: Newline): number {\n return 0;\n }\n\n // TODO: Enforce being followed by a newline (or the end of the alg)?\n public traverseLineComment(_comment: LineComment): number {\n return 0;\n }\n}\n\nfunction isCharUppercase(c: string): boolean {\n return \"A\" <= c && c <= \"Z\";\n}\n\n// TODO: Implement a puzzle-specific way to calculate this.\nfunction baseMetric(move: Move): number {\n const fam = move.family;\n if (\n (isCharUppercase(fam[0]) && fam[fam.length - 1] === \"v\") ||\n fam === \"x\" ||\n fam === \"y\" ||\n fam === \"z\" ||\n fam === \"T\"\n ) {\n return 0;\n } else {\n return 1;\n }\n}\n\nfunction etmMetric(_move: Move): number {\n return 1;\n}\n\n// TODO: Implement a puzzle-specific way to calculate this.\nfunction rangeBlockTurnMetric(move: Move): number {\n const fam = move.family;\n if (\n (isCharUppercase(fam[0]) && fam[fam.length - 1] === \"v\") ||\n fam === \"x\" ||\n fam === \"y\" ||\n fam === \"z\" ||\n fam === \"T\"\n ) {\n return 0;\n } else {\n return 1;\n }\n}\n\n// TODO: Implement a puzzle-specific way to calculate this.\nfunction quantumMetric(move: Move): number {\n return Math.abs(move.amount) * rangeBlockTurnMetric(move);\n}\n\nexport const countMoves = functionFromTraversal(CountMoves, [baseMetric]);\nexport const countMovesETM = functionFromTraversal(CountMoves, [etmMetric]);\nexport const countRangeBlockQuantumMovesPG = functionFromTraversal(CountMoves, [\n quantumMetric,\n]);\nexport const countRangeBlockMovesPG = functionFromTraversal(CountMoves, [\n rangeBlockTurnMetric,\n]);\n\n/**\n * Only implemented so far:\n *\n * - 3x3x3: OBTM, RBTM, ETM\n */\nexport function countMetricMoves(\n puzzleLoader: PuzzleLoader,\n metric: CommonMetric,\n alg: Alg,\n): number {\n if (puzzleLoader.id === \"3x3x3\") {\n if (metric in costFactorsByMetric) {\n return functionFromTraversal(CountMoves, [\n (move: Move) => countMove3x3x3(metric, move),\n ])(alg);\n }\n } else {\n switch (metric) {\n case CommonMetric.ExecutionTurnMetric:\n return countMovesETM(alg);\n case CommonMetric.RangeBlockTurnMetric:\n if (puzzleLoader.pg) {\n return countRangeBlockMovesPG(alg);\n }\n case CommonMetric.RangeBlockQuantumTurnMetric:\n if (puzzleLoader.pg) {\n return countRangeBlockQuantumMovesPG(alg);\n }\n }\n }\n throw new Error(\"Unsupported puzzle or metric.\");\n}\n", "import {\n Alg,\n Commutator,\n Conjugate,\n Grouping,\n LineComment,\n Move,\n Newline,\n Pause,\n TraversalUp,\n} from \"../alg\";\nimport { functionFromTraversal } from \"../alg\";\n\n// TODO: Include Pause, include amounts\nclass CountAnimatedLeaves extends TraversalUp<number, number> {\n public traverseAlg(alg: Alg): number {\n let total = 0;\n for (const part of alg.childAlgNodes()) {\n total += this.traverseAlgNode(part);\n }\n return total;\n }\n\n public traverseGrouping(grouping: Grouping): number {\n return this.traverseAlg(grouping.alg) * Math.abs(grouping.amount);\n }\n\n public traverseMove(_move: Move): number {\n return 1;\n }\n\n public traverseCommutator(commutator: Commutator): number {\n return (\n 2 * (this.traverseAlg(commutator.A) + this.traverseAlg(commutator.B))\n );\n }\n\n public traverseConjugate(conjugate: Conjugate): number {\n return 2 * this.traverseAlg(conjugate.A) + this.traverseAlg(conjugate.B);\n }\n\n public traversePause(_pause: Pause): number {\n return 1;\n }\n\n public traverseNewline(_newline: Newline): number {\n return 0;\n }\n\n public traverseLineComment(_comment: LineComment): number {\n return 0;\n }\n}\n\nexport const countAnimatedLeaves = functionFromTraversal(CountAnimatedLeaves);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAO,IAAK,eAAL,kBAAKA,kBAAL;AAEL,EAAAA,cAAA,0BAAuB;AAEvB,EAAAA,cAAA,0BAAuB;AAEvB,EAAAA,cAAA,2BAAwB;AAExB,EAAAA,cAAA,iCAA8B;AAE9B,EAAAA,cAAA,iCAA8B;AAE9B,EAAAA,cA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,aAAa,OAAqB;AACvC,WAAO;AAAA,EACT;AAAA,EAEO,mBAAmB,YAAgC;AACxD,WACE,KAAK,KAAK,YAAY,WAAW,CAAC,IAAI,KAAK,YAAY,WAAW,CAAC;AAAA,EAEvE;AAAA,EAEO,kBAAkB,WAA8B;AACrD,WAAO,IAAI,KAAK,YAAY,UAAU,CAAC,IAAI,KAAK,YAAY,UAAU,CAAC;AAAA,EACzE;AAAA,EAEO,cAAc,QAAuB;AAC1C,WAAO;AAAA,EACT;AAAA,EAEO,gBAAgB,UAA2B;AAChD,WAAO;AAAA,EACT;AAAA,EAEO,oBAAoB,UAA+B;AACxD,WAAO;AAAA,EACT;AACF;AAEO,IAAM,sBAAsB,sBAAsB,mBAAmB;",
|
|
6
6
|
"names": ["CommonMetric", "CommonMetricAlias", "cache"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Alg
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TM7SKFJD.js";
|
|
4
4
|
|
|
5
5
|
// src/cubing/search/inside/solve/parseSGS.ts
|
|
6
6
|
function parseSGS(kpuzzle, sgs) {
|
|
@@ -85,4 +85,4 @@ function parseSGS(kpuzzle, sgs) {
|
|
|
85
85
|
export {
|
|
86
86
|
parseSGS
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-ZIFM3JF6.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
expose
|
|
3
|
+
} from "./chunk-6OUID4YZ.js";
|
|
4
|
+
import {
|
|
5
|
+
insideAPI
|
|
6
|
+
} from "./chunk-TNBM5BTH.js";
|
|
7
|
+
import "./chunk-O64NYJ3S.js";
|
|
8
|
+
import "./chunk-ZYCJIZDN.js";
|
|
9
|
+
import "./chunk-WWCSMIJO.js";
|
|
10
|
+
import "./chunk-GGJSIUGA.js";
|
|
11
|
+
import "./chunk-L4PH24KU.js";
|
|
12
|
+
import "./chunk-RSF22LKP.js";
|
|
13
|
+
import "./chunk-TM7SKFJD.js";
|
|
14
|
+
|
|
15
|
+
// src/cubing/search/inside/index.ts
|
|
16
|
+
expose(insideAPI);
|
|
17
|
+
//# sourceMappingURL=inside-PD4VUO4N.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/cubing/search/inside/
|
|
3
|
+
"sources": ["../../src/cubing/search/inside/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { expose } from \"../../vendor/apache/comlink-everywhere/inside\";\nimport { insideAPI } from \"./api\";\n\nexpose(insideAPI);\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;AAGA,OAAO,SAAS;",
|
|
6
6
|
"names": []
|
|
@@ -4,19 +4,17 @@ import {
|
|
|
4
4
|
countAnimatedLeaves,
|
|
5
5
|
countMetricMoves,
|
|
6
6
|
countMoves,
|
|
7
|
-
countMovesETM
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-2OZSC5I6.js";
|
|
7
|
+
countMovesETM
|
|
8
|
+
} from "../chunk-WWCSMIJO.js";
|
|
9
|
+
import "../chunk-L4PH24KU.js";
|
|
10
|
+
import "../chunk-RSF22LKP.js";
|
|
11
|
+
import "../chunk-TM7SKFJD.js";
|
|
13
12
|
export {
|
|
14
13
|
CommonMetric as ExperimentalCommonMetric,
|
|
15
14
|
CommonMetricAlias as ExperimentalCommonMetricAlias,
|
|
16
15
|
countAnimatedLeaves as experimentalCountAnimatedLeaves,
|
|
17
16
|
countMetricMoves as experimentalCountMetricMoves,
|
|
18
17
|
countMoves as experimentalCountMoves,
|
|
19
|
-
countMovesETM as experimentalCountMovesETM
|
|
20
|
-
countQuantumMoves as experimentalCountQuantumMoves
|
|
18
|
+
countMovesETM as experimentalCountMovesETM
|
|
21
19
|
};
|
|
22
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
spacedHexToBuffer,
|
|
6
6
|
twizzleBinaryToBinaryComponents,
|
|
7
7
|
twizzleBinaryToReid3x3x3
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-L7WY7BIO.js";
|
|
9
|
+
import "../chunk-L4PH24KU.js";
|
|
10
|
+
import "../chunk-RSF22LKP.js";
|
|
11
|
+
import "../chunk-TM7SKFJD.js";
|
|
12
12
|
export {
|
|
13
13
|
binaryComponentsToReid3x3x3 as experimentalBinaryComponentsToReid3x3x3,
|
|
14
14
|
bufferToSpacedHex as experimentalBufferToSpacedHex,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
twizzleEvents,
|
|
7
7
|
wcaEventInfo,
|
|
8
8
|
wcaEvents
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-GGJSIUGA.js";
|
|
10
|
+
import "../chunk-L4PH24KU.js";
|
|
11
|
+
import "../chunk-RSF22LKP.js";
|
|
12
|
+
import "../chunk-TM7SKFJD.js";
|
|
13
13
|
export {
|
|
14
14
|
cube2x2x2,
|
|
15
15
|
cube3x3x3,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
randomScrambleForEvent
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-6XZN5QCJ.js";
|
|
4
|
+
import "../chunk-TNBM5BTH.js";
|
|
5
|
+
import "../chunk-O64NYJ3S.js";
|
|
6
|
+
import "../chunk-7QE2OVHX.js";
|
|
6
7
|
import "../chunk-ZYCJIZDN.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-2OZSC5I6.js";
|
|
8
|
+
import "../chunk-WWCSMIJO.js";
|
|
9
|
+
import "../chunk-GGJSIUGA.js";
|
|
10
|
+
import "../chunk-L4PH24KU.js";
|
|
11
|
+
import "../chunk-RSF22LKP.js";
|
|
12
|
+
import "../chunk-TM7SKFJD.js";
|
|
13
13
|
export {
|
|
14
14
|
randomScrambleForEvent
|
|
15
15
|
};
|
package/dist/esm/search/index.js
CHANGED
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
solvePyraminx,
|
|
7
7
|
solveSkewb,
|
|
8
8
|
solveTwsearch
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-RHC3DIN3.js";
|
|
12
|
-
import "../chunk-ZYCJIZDN.js";
|
|
9
|
+
} from "../chunk-6XZN5QCJ.js";
|
|
10
|
+
import "../chunk-TNBM5BTH.js";
|
|
13
11
|
import {
|
|
14
12
|
random333State
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-O64NYJ3S.js";
|
|
14
|
+
import "../chunk-7QE2OVHX.js";
|
|
15
|
+
import "../chunk-ZYCJIZDN.js";
|
|
16
|
+
import "../chunk-WWCSMIJO.js";
|
|
17
|
+
import "../chunk-GGJSIUGA.js";
|
|
18
|
+
import "../chunk-L4PH24KU.js";
|
|
19
|
+
import "../chunk-RSF22LKP.js";
|
|
20
|
+
import "../chunk-TM7SKFJD.js";
|
|
21
21
|
export {
|
|
22
22
|
experimentalSolve2x2x2,
|
|
23
23
|
experimentalSolve3x3x3IgnoringCenters,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
nodeEndpointPort
|
|
3
|
-
} from "
|
|
3
|
+
} from "../../chunk-6OUID4YZ.js";
|
|
4
4
|
import {
|
|
5
5
|
exposeAPI
|
|
6
|
-
} from "
|
|
7
|
-
import "
|
|
6
|
+
} from "../../chunk-7QE2OVHX.js";
|
|
7
|
+
import "../../chunk-ZYCJIZDN.js";
|
|
8
8
|
|
|
9
|
-
// src/cubing/search/
|
|
9
|
+
// src/cubing/search/worker-workarounds/search-worker-entry.js
|
|
10
10
|
if (exposeAPI.expose) {
|
|
11
11
|
(async () => {
|
|
12
|
-
await import("
|
|
12
|
+
await import("../../inside-PD4VUO4N.js");
|
|
13
13
|
const messagePort = globalThis.postMessage ? globalThis : await nodeEndpointPort();
|
|
14
14
|
messagePort.postMessage("comlink-exposed");
|
|
15
15
|
})();
|
|
@@ -18,4 +18,4 @@ var WORKER_ENTRY_FILE_URL = import.meta.url;
|
|
|
18
18
|
export {
|
|
19
19
|
WORKER_ENTRY_FILE_URL
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=search-worker-
|
|
21
|
+
//# sourceMappingURL=search-worker-entry.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/cubing/search/worker-workarounds/search-worker-entry.js"],
|
|
4
|
+
"sourcesContent": ["import { nodeEndpointPort } from \"../../vendor/apache/comlink-everywhere/inside/index\";\nimport { exposeAPI } from \"./worker-guard\";\n\nif (exposeAPI.expose) {\n (async () => {\n await import(\"../inside\");\n\n // Workaround for `node`\n const messagePort = globalThis.postMessage\n ? globalThis\n : await nodeEndpointPort();\n messagePort.postMessage(\"comlink-exposed\"); // TODO: remove this\n })();\n}\n\n// Workaround for `esbuild`: https://github.com/evanw/esbuild/issues/312#issuecomment-1092195778\nexport const WORKER_ENTRY_FILE_URL = import.meta.url;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAGA,IAAI,UAAU,QAAQ;AACpB,GAAC,YAAY;AACX,UAAM,OAAO,0BAAW;AAGxB,UAAM,cAAc,WAAW,cAC3B,aACA,MAAM,iBAAiB;AAC3B,gBAAY,YAAY,iBAAiB;AAAA,EAC3C,GAAG;AACL;AAGO,IAAM,wBAAwB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZIFM3JF6.js";
|
|
4
4
|
import {
|
|
5
5
|
cube2x2x2,
|
|
6
6
|
puzzles
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-GGJSIUGA.js";
|
|
8
|
+
import "./chunk-L4PH24KU.js";
|
|
9
9
|
import {
|
|
10
10
|
KPuzzle
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-RSF22LKP.js";
|
|
12
|
+
import "./chunk-TM7SKFJD.js";
|
|
13
13
|
|
|
14
14
|
// src/cubing/search/inside/solve/puzzles/dynamic/sgs-side-events/2x2x2.sgs.ts
|
|
15
15
|
var cachedData = null;
|
|
@@ -1888,4 +1888,4 @@ export {
|
|
|
1888
1888
|
sgsDataSkewbFixedCorner,
|
|
1889
1889
|
skewbKPuzzleWithoutMOCached
|
|
1890
1890
|
};
|
|
1891
|
-
//# sourceMappingURL=search-dynamic-sgs-side-events-
|
|
1891
|
+
//# sourceMappingURL=search-dynamic-sgs-side-events-U7UKYK6F.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZIFM3JF6.js";
|
|
4
4
|
import {
|
|
5
5
|
puzzles
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-GGJSIUGA.js";
|
|
7
|
+
import "./chunk-L4PH24KU.js";
|
|
8
|
+
import "./chunk-RSF22LKP.js";
|
|
9
9
|
import {
|
|
10
10
|
Alg
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TM7SKFJD.js";
|
|
12
12
|
|
|
13
13
|
// src/cubing/search/inside/solve/puzzles/dynamic/sgs-unofficial/fto.sgs.ts
|
|
14
14
|
var cachedData = null;
|
|
@@ -1265,4 +1265,4 @@ export {
|
|
|
1265
1265
|
getRandomRediCubeScramble,
|
|
1266
1266
|
sgsDataFTO
|
|
1267
1267
|
};
|
|
1268
|
-
//# sourceMappingURL=search-dynamic-sgs-unofficial-
|
|
1268
|
+
//# sourceMappingURL=search-dynamic-sgs-unofficial-MGKPYZK5.js.map
|
package/dist/esm/{search-dynamic-solve-4x4x4-KOSBPTFL.js → search-dynamic-solve-4x4x4-YRWEYWTY.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mustBeInsideWorker,
|
|
3
3
|
random333Scramble
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-O64NYJ3S.js";
|
|
5
|
+
import "./chunk-GGJSIUGA.js";
|
|
6
|
+
import "./chunk-L4PH24KU.js";
|
|
7
|
+
import "./chunk-RSF22LKP.js";
|
|
8
8
|
import {
|
|
9
9
|
Alg
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TM7SKFJD.js";
|
|
11
11
|
|
|
12
12
|
// src/cubing/vendor/gpl/cs0x7f/cstimer/src/js/lib/mathlib.ts
|
|
13
13
|
var Cnk = [];
|
|
@@ -2921,4 +2921,4 @@ export {
|
|
|
2921
2921
|
initialize,
|
|
2922
2922
|
random444Scramble
|
|
2923
2923
|
};
|
|
2924
|
-
//# sourceMappingURL=search-dynamic-solve-4x4x4-
|
|
2924
|
+
//# sourceMappingURL=search-dynamic-solve-4x4x4-YRWEYWTY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Alg
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TM7SKFJD.js";
|
|
4
4
|
|
|
5
5
|
// src/cubing/vendor/mpl/xyzzy/kilosolver.js
|
|
6
6
|
import { randomUIntBelow } from "random-uint-below";
|
|
@@ -768,4 +768,4 @@ function getRandomKilominxScramble() {
|
|
|
768
768
|
export {
|
|
769
769
|
getRandomKilominxScramble
|
|
770
770
|
};
|
|
771
|
-
//# sourceMappingURL=search-dynamic-solve-kilominx-
|
|
771
|
+
//# sourceMappingURL=search-dynamic-solve-kilominx-HCOWDD7C.js.map
|