cubing 0.61.2 → 0.61.3

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 (27) hide show
  1. package/dist/bin/chunks/{chunk-BIRBVHTR.js → chunk-5WXNSJ2M.js} +2 -2
  2. package/dist/bin/order.js +1 -1
  3. package/dist/bin/order.js.map +1 -1
  4. package/dist/bin/puzzle-geometry-bin.js +1 -1
  5. package/dist/bin/puzzle-geometry-bin.js.map +1 -1
  6. package/dist/bin/scramble.js +1 -1
  7. package/dist/bin/scramble.js.map +1 -1
  8. package/dist/lib/cubing/chunks/{chunk-FKKRSXUI.js → chunk-E3YLQC45.js} +2 -2
  9. package/dist/lib/cubing/chunks/chunk-E3YLQC45.js.map +7 -0
  10. package/dist/lib/cubing/chunks/{chunk-IHFKNNCV.js → chunk-XITTJ75E.js} +1 -1
  11. package/dist/lib/cubing/chunks/{inside-UAY7NCJR.js → inside-FGQBCNHY.js} +3 -3
  12. package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-QVAXVZBA.js → search-dynamic-solve-4x4x4-OBPW4YC2.js} +2 -2
  13. package/dist/lib/cubing/chunks/search-worker-entry.js +1 -1
  14. package/dist/lib/cubing/chunks/{twips-UDB2NAAU.js → twips-OVT324QJ.js} +32 -32
  15. package/dist/lib/cubing/chunks/{twips-UDB2NAAU.js.map → twips-OVT324QJ.js.map} +3 -3
  16. package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js +10 -0
  17. package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js.map +7 -0
  18. package/dist/lib/cubing/scramble/index.js +1 -1
  19. package/dist/lib/cubing/search/index.js +1 -1
  20. package/package.json +1 -1
  21. package/dist/lib/cubing/chunks/chunk-FKKRSXUI.js.map +0 -7
  22. package/dist/lib/cubing/chunks/twips_wasm_bg-TPXD7W4R-2BXON3G5.js +0 -10
  23. package/dist/lib/cubing/chunks/twips_wasm_bg-TPXD7W4R-2BXON3G5.js.map +0 -7
  24. /package/dist/bin/chunks/{chunk-BIRBVHTR.js.map → chunk-5WXNSJ2M.js.map} +0 -0
  25. /package/dist/lib/cubing/chunks/{chunk-IHFKNNCV.js.map → chunk-XITTJ75E.js.map} +0 -0
  26. /package/dist/lib/cubing/chunks/{inside-UAY7NCJR.js.map → inside-FGQBCNHY.js.map} +0 -0
  27. /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-QVAXVZBA.js.map → search-dynamic-solve-4x4x4-OBPW4YC2.js.map} +0 -0
@@ -5,10 +5,10 @@ import "path-class";
5
5
  var packageVersion = (
6
6
  // biome-ignore lint/suspicious/noTsIgnore: This comment is stil present in the compiled file, where an error is *not* expected.
7
7
  /** @ts-ignore Populated by `esbuild` at compile time. */
8
- "0.61.2"
8
+ "0.61.3"
9
9
  );
10
10
 
11
11
  export {
12
12
  packageVersion
13
13
  };
14
- //# sourceMappingURL=chunk-BIRBVHTR.js.map
14
+ //# sourceMappingURL=chunk-5WXNSJ2M.js.map
package/dist/bin/order.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-BIRBVHTR.js";
4
+ } from "./chunks/chunk-5WXNSJ2M.js";
5
5
 
6
6
  // src/bin/order.ts
7
7
  import { argv } from "node:process";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/order.ts"],
4
- "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run ./src/bin/order.ts -- 3x3x3 \"R U R' U R U2' R'\"\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\norder --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(order --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport { argument, map, message, object, string } from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Alg } from \"cubing/alg\";\nimport { KPuzzle } from \"cubing/kpuzzle\";\nimport { getPuzzleGeometryByName } from \"cubing/puzzle-geometry\";\nimport { puzzles } from \"cubing/puzzles\";\nimport { Path } from \"path-class\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst args = run(\n object({\n puzzleGeometryID: argument(string({ metavar: \"PUZZLE\" }), {\n description: message`Puzzle geometry ID`,\n }),\n alg: map(\n argument(string({ metavar: \"ALG\" }), {\n description: message`Alg`,\n }),\n Alg.fromString,\n ),\n }),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`Example: order 3x3x3 \"R U R' U R U2' R'\"`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nconst { puzzleGeometryID, alg } = args;\n\n/*\n * Turn a name into a geometry.\n */\nconst puzzleLoader = puzzles[puzzleGeometryID];\nconst kpuzzle = await (async () => {\n if (puzzleLoader) {\n return await puzzles[puzzleGeometryID].kpuzzle();\n } else {\n const pg = getPuzzleGeometryByName(puzzleGeometryID, {\n allMoves: true,\n });\n return new KPuzzle(pg.getKPuzzleDefinition(true));\n }\n})();\n\nconst order = kpuzzle.algToTransformation(alg).repetitionOrder();\nconsole.log(order);\n"],
4
+ "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run -- ./src/bin/order.ts 3x3x3 \"R U R' U R U2' R'\"\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\norder --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(order --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport { argument, map, message, object, string } from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Alg } from \"cubing/alg\";\nimport { KPuzzle } from \"cubing/kpuzzle\";\nimport { getPuzzleGeometryByName } from \"cubing/puzzle-geometry\";\nimport { puzzles } from \"cubing/puzzles\";\nimport { Path } from \"path-class\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst args = run(\n object({\n puzzleGeometryID: argument(string({ metavar: \"PUZZLE\" }), {\n description: message`Puzzle geometry ID`,\n }),\n alg: map(\n argument(string({ metavar: \"ALG\" }), {\n description: message`Alg`,\n }),\n Alg.fromString,\n ),\n }),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`Example: order 3x3x3 \"R U R' U R U2' R'\"`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nconst { puzzleGeometryID, alg } = args;\n\n/*\n * Turn a name into a geometry.\n */\nconst puzzleLoader = puzzles[puzzleGeometryID];\nconst kpuzzle = await (async () => {\n if (puzzleLoader) {\n return await puzzles[puzzleGeometryID].kpuzzle();\n } else {\n const pg = getPuzzleGeometryByName(puzzleGeometryID, {\n allMoves: true,\n });\n return new KPuzzle(pg.getKPuzzleDefinition(true));\n }\n})();\n\nconst order = kpuzzle.algToTransformation(alg).repetitionOrder();\nconsole.log(order);\n"],
5
5
  "mappings": ";;;;;;AA0BA,SAAS,YAAY;AACrB,SAAS,UAAU,KAAK,SAAS,QAAQ,cAAc;AACvD,SAAS,WAAW;AACpB,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,eAAe;AACxB,SAAS,YAAY;AAGrB,IAAM,OAAO;AAAA,EACX,OAAO;AAAA,IACL,kBAAkB,SAAS,OAAO,EAAE,SAAS,SAAS,CAAC,GAAG;AAAA,MACxD,aAAa;AAAA,IACf,CAAC;AAAA,IACD,KAAK;AAAA,MACH,SAAS,OAAO,EAAE,SAAS,MAAM,CAAC,GAAG;AAAA,QACnC,aAAa;AAAA,MACf,CAAC;AAAA,MACD,IAAI;AAAA,IACN;AAAA,EACF,CAAC;AAAA,EACD;AAAA,IACE,aAAa,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,SAAS;AAAA,IACxC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,YAAY;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,EAAE,kBAAkB,IAAI,IAAI;AAKlC,IAAM,eAAe,QAAQ,gBAAgB;AAC7C,IAAM,UAAU,OAAO,YAAY;AACjC,MAAI,cAAc;AAChB,WAAO,MAAM,QAAQ,gBAAgB,EAAE,QAAQ;AAAA,EACjD,OAAO;AACL,UAAM,KAAK,wBAAwB,kBAAkB;AAAA,MACnD,UAAU;AAAA,IACZ,CAAC;AACD,WAAO,IAAI,QAAQ,GAAG,qBAAqB,IAAI,CAAC;AAAA,EAClD;AACF,GAAG;AAEH,IAAM,QAAQ,QAAQ,oBAAoB,GAAG,EAAE,gBAAgB;AAC/D,QAAQ,IAAI,KAAK;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-BIRBVHTR.js";
4
+ } from "./chunks/chunk-5WXNSJ2M.js";
5
5
 
6
6
  // src/bin/puzzle-geometry-bin.ts
7
7
  import { argv } from "node:process";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/puzzle-geometry-bin.ts"],
4
- "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run ./src/bin/puzzle-geometry-bin.ts -- <program args>\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\npuzzle-geometry --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(puzzle-geometry --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport {\n argument,\n constant,\n flag,\n integer,\n type Message,\n map,\n merge,\n message,\n multiple,\n type OptionName,\n object,\n option,\n optional,\n or,\n string,\n} from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Move } from \"cubing/alg\";\nimport {\n type ExperimentalPuzzleGeometryOptions,\n getPG3DNamedPuzzles,\n PuzzleGeometry,\n parsePuzzleDescription,\n} from \"cubing/puzzle-geometry\";\nimport { Path } from \"path-class\";\nimport { PrintableShellCommand } from \"printable-shell-command\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst puzzleList = getPG3DNamedPuzzles();\n\n// TODO: make this a `ValueParser`?\nfunction antiBool(optionName: OptionName, description: Message) {\n return optional(\n map(\n flag(optionName, {\n description,\n }),\n (v) => !v,\n ),\n );\n}\n\n// Include using `...subcommandDefaults` at the *beginning* of a subcommand `object({ \u2026 })`.\nconst subcommandDefaults = {\n commentStyle: constant(\"hash\"),\n forceQuiet: constant(undefined),\n} as const;\n\nconst args = run(\n merge(\n object({\n verbosity: optional(\n or(\n map(multiple(flag(\"--verbose\", \"-v\")), (v) => v.length),\n map(flag(\"--quiet\", \"-q\"), () => 0),\n ),\n ),\n }),\n or(\n object({\n ...subcommandDefaults,\n subcommand: constant(\"KSolve\"),\n subcommandFlag: flag(\"--ksolve\", {\n description: message`Print KSolve (\\`.tws\\`).`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"SVG\"),\n subcommandFlag: flag(\"--svg\", {\n description: message`Print SVG. Forces \\`--quiet\\`.`,\n }),\n commentStyle: constant(\"none\"),\n svg3D: optional(\n option(\"--3d\", {\n description: message`Use 3D format for SVG file.`,\n }),\n ),\n verbosity: constant(0),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"GAP\"),\n subcommandFlag: flag(\"--gap\", {\n description: message`Print GAP output.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Mathematica\"),\n subcommandFlag: flag(\"--mathematica\", {\n description: message`Print Mathematica output.`,\n }),\n commentStyle: constant(\"Pascal\"),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Schreier-Sims\"),\n subcommandFlag: flag(\"--ss\", {\n description: message`Perform Schrier-Sims calculation.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Canonical string analysis\"),\n subcommandFlag: flag(\"--canon\", {\n description: message`Print canonical string analysis.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"3D\"),\n subcommandFlag: flag(\"--3d\", {\n description: message`Print 3D information.`,\n }),\n }),\n ),\n object({\n // This doesn't apply to SVG, but we place it here so that it doesn't print once for each non-SVG subcommand in the help string.\n optimizeOrbits: option(\"--optimize\", {\n description: message`Optimize output (when possible).`,\n }),\n addRotations: option(\"--rotations\", {\n description: message`Include full-puzzle rotations as moves.`,\n }),\n allMoves: option(\"--allmoves\", {\n description: message`Includes all moves (i.e., slice moves for 3x3x3).`,\n }),\n outerBlockMoves: option(\"--outerblockmoves\", {\n description: message`Use outer block moves rather than slice moves.`,\n }),\n vertexMoves: option(\"--vertexmoves\", {\n description: message`For tetrahedral puzzles, prefer vertex moves to face moves.`,\n }),\n includeCornerOrbits: antiBool(\n \"--nocorners\",\n message`Ignore all corners.`,\n ),\n excludeOrbits: optional(\n map(\n option(\"--omit\", string({ metavar: \"COMMA_SEPARATED_ORBITS\" }), {\n description: message`Omit orbits.`,\n }),\n (s) => s.split(\",\"),\n ),\n ),\n includeEdgeOrbits: antiBool(\"--noedges\", message`Ignore all edges.`),\n includeCenterOrbits: antiBool(\n \"--nocenters\",\n message`Ignore all centers.`,\n ),\n grayCorners: option(\"--graycorners\", {\n description: message`Gray corners.`,\n }),\n grayEdges: option(\"--grayedges\", { description: message`Gray edges.` }),\n grayCenters: option(\"--graycenters\", {\n description: message`Gray centers.`,\n }),\n fixedOrientation: option(\"--noorientation\", {\n description: message`Ignore orientations.`,\n }),\n orientCenters: option(\"--orientcenters\", {\n description: message`Give centers an orientation.`,\n }),\n }),\n optional(\n or(\n object({\n puzzleOrientation: optional(\n map(\n option(\n \"--puzzleorientation\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientation.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n puzzleOrientations: constant(undefined),\n }),\n object({\n puzzleOrientation: constant(undefined),\n puzzleOrientations: optional(\n map(\n option(\n \"--puzzleorientations\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientations.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n }),\n ),\n ),\n object({\n fixedPieceType: optional(\n or(\n map(\n flag(\"--fixcorner\", {\n description: message`Auto-select a subset of moves to keep a corner fixed in place.`,\n }),\n () => \"v\" as const,\n ),\n map(\n flag(\"--fixedge\", {\n description: message`Auto-select a subset of moves to keep an edge fixed in place.`,\n }),\n () => \"e\" as const,\n ),\n map(\n flag(\"--fixcenter\", {\n description: message`Auto-select a subset of moves to keep a center fixed in place.`,\n }),\n () => \"f\" as const,\n ),\n ),\n ),\n // TODO: this doesn't make sense for all subcommands?\n scrambleAmount: optional(\n option(\"--scramble\", integer({ min: 0 }), {\n description: message`Scramble solved position.`,\n }),\n ),\n moveList: optional(\n map(\n option(\"--moves\", string({ metavar: \"COMMA_SEPARATED_MOVES\" }), {\n description: message`Restrict moves to this list. Example: \\\"U2,F,r\\\").`,\n }),\n (s) => s.split(\",\").map((m) => Move.fromString(m)),\n ),\n ),\n puzzle: map(\n argument(string({ metavar: \"PUZZLE\" }), {\n description: message`The puzzle can be given as a geometric description or by name.\nThe geometric description starts with one of:\n\n- \\`c\\` (cube),\\n\n- \\`t\\` (tetrahedron),\\n\n- \\`d\\` (dodecahedron),\\n\n- \\`i\\` (icosahedron),\\n\n- \\`o\\` (octahedron),\\n\n\nthen a space, then a series of cuts. Each cut begins with one of:\n\n- \\`f\\` (for a cut parallel to faces),\\n\n- \\`v\\` (for a cut perpendicular to a ray from the center through a corner),\\n\n- \\`e\\` (for a cut perpendicular to a ray from the center through an edge),\\n\n\nfollowed by a decimal number giving a distance, where 1 is the distance\nbetween the center of the puzzle and the center of a face.\n\nExample description: \\`c f 0 v 0.577350269189626 e 0\\`. Corresponds to: https://alpha.twizzle.net/explore/?puzzle=2x2x2+%2B+dino+%2B+little+chop\n\nThe recognized puzzle names are: ${Object.keys(puzzleList)\n .map((p) => JSON.stringify(p))\n .join(\", \")}`,\n }),\n (s) => {\n const parsed = parsePuzzleDescription(puzzleList[s] ?? s);\n if (parsed === null) {\n throw new Error(\"Could not parse puzzle description!\");\n }\n return parsed;\n },\n ),\n }),\n ),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`\nExamples:\n\n puzzle-geometry --ss 2x2x2\\n\n puzzle-geometry --ss --fixcorner 2x2x2\\n\n puzzle-geometry --ss --moves U,F2,r 4x4x4\\n\n puzzle-geometry --ksolve --optimize --moves U,F,R megaminx\\n\n puzzle-geometry --gap --noedges megaminx\n`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nif (args.verbosity !== 0) {\n const cmd = () => {\n const [command, ...args] = argv;\n return new PrintableShellCommand(command, args).getPrintableCommand({\n argumentLineWrapping: \"inline\",\n });\n };\n\n switch (args.commentStyle) {\n case \"hash\": {\n console.log(`# ${cmd()}`);\n break;\n }\n case \"none\": {\n break;\n }\n case \"Pascal\": {\n console.log(`(* ${cmd()} *)`);\n break;\n }\n default:\n throw new Error(\"Invalid comment style.\") as never;\n }\n}\n\nfunction buildPuzzleGeometry(): PuzzleGeometry {\n const {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n } = args;\n const options: ExperimentalPuzzleGeometryOptions = {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n };\n\n const puzzleGeometry = new PuzzleGeometry(args.puzzle, options);\n // TODO: why are these calls needed?\n puzzleGeometry.allstickers();\n puzzleGeometry.genperms();\n return puzzleGeometry;\n}\n\nswitch (args.subcommand) {\n case \"KSolve\": {\n console.log(buildPuzzleGeometry().writeksolve());\n break;\n }\n case \"SVG\": {\n console.log(\n buildPuzzleGeometry().generatesvg(\n undefined,\n undefined,\n undefined,\n args.svg3D,\n ),\n );\n break;\n }\n case \"GAP\": {\n console.log(buildPuzzleGeometry().writegap());\n break;\n }\n case \"Mathematica\": {\n console.log(buildPuzzleGeometry().writemathematica());\n break;\n }\n case \"Schreier-Sims\": {\n buildPuzzleGeometry().writeSchreierSims(console.log);\n break;\n }\n case \"Canonical string analysis\": {\n buildPuzzleGeometry().showcanon(console.log);\n break;\n }\n case \"3D\": {\n console.log(JSON.stringify(buildPuzzleGeometry().get3d(), null, \" \"));\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n}\n"],
4
+ "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run -- ./src/bin/puzzle-geometry-bin.ts <program args>\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\npuzzle-geometry --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(puzzle-geometry --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport {\n argument,\n constant,\n flag,\n integer,\n type Message,\n map,\n merge,\n message,\n multiple,\n type OptionName,\n object,\n option,\n optional,\n or,\n string,\n} from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport { Move } from \"cubing/alg\";\nimport {\n type ExperimentalPuzzleGeometryOptions,\n getPG3DNamedPuzzles,\n PuzzleGeometry,\n parsePuzzleDescription,\n} from \"cubing/puzzle-geometry\";\nimport { Path } from \"path-class\";\nimport { PrintableShellCommand } from \"printable-shell-command\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst puzzleList = getPG3DNamedPuzzles();\n\n// TODO: make this a `ValueParser`?\nfunction antiBool(optionName: OptionName, description: Message) {\n return optional(\n map(\n flag(optionName, {\n description,\n }),\n (v) => !v,\n ),\n );\n}\n\n// Include using `...subcommandDefaults` at the *beginning* of a subcommand `object({ \u2026 })`.\nconst subcommandDefaults = {\n commentStyle: constant(\"hash\"),\n forceQuiet: constant(undefined),\n} as const;\n\nconst args = run(\n merge(\n object({\n verbosity: optional(\n or(\n map(multiple(flag(\"--verbose\", \"-v\")), (v) => v.length),\n map(flag(\"--quiet\", \"-q\"), () => 0),\n ),\n ),\n }),\n or(\n object({\n ...subcommandDefaults,\n subcommand: constant(\"KSolve\"),\n subcommandFlag: flag(\"--ksolve\", {\n description: message`Print KSolve (\\`.tws\\`).`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"SVG\"),\n subcommandFlag: flag(\"--svg\", {\n description: message`Print SVG. Forces \\`--quiet\\`.`,\n }),\n commentStyle: constant(\"none\"),\n svg3D: optional(\n option(\"--3d\", {\n description: message`Use 3D format for SVG file.`,\n }),\n ),\n verbosity: constant(0),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"GAP\"),\n subcommandFlag: flag(\"--gap\", {\n description: message`Print GAP output.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Mathematica\"),\n subcommandFlag: flag(\"--mathematica\", {\n description: message`Print Mathematica output.`,\n }),\n commentStyle: constant(\"Pascal\"),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Schreier-Sims\"),\n subcommandFlag: flag(\"--ss\", {\n description: message`Perform Schrier-Sims calculation.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"Canonical string analysis\"),\n subcommandFlag: flag(\"--canon\", {\n description: message`Print canonical string analysis.`,\n }),\n }),\n object({\n ...subcommandDefaults,\n subcommand: constant(\"3D\"),\n subcommandFlag: flag(\"--3d\", {\n description: message`Print 3D information.`,\n }),\n }),\n ),\n object({\n // This doesn't apply to SVG, but we place it here so that it doesn't print once for each non-SVG subcommand in the help string.\n optimizeOrbits: option(\"--optimize\", {\n description: message`Optimize output (when possible).`,\n }),\n addRotations: option(\"--rotations\", {\n description: message`Include full-puzzle rotations as moves.`,\n }),\n allMoves: option(\"--allmoves\", {\n description: message`Includes all moves (i.e., slice moves for 3x3x3).`,\n }),\n outerBlockMoves: option(\"--outerblockmoves\", {\n description: message`Use outer block moves rather than slice moves.`,\n }),\n vertexMoves: option(\"--vertexmoves\", {\n description: message`For tetrahedral puzzles, prefer vertex moves to face moves.`,\n }),\n includeCornerOrbits: antiBool(\n \"--nocorners\",\n message`Ignore all corners.`,\n ),\n excludeOrbits: optional(\n map(\n option(\"--omit\", string({ metavar: \"COMMA_SEPARATED_ORBITS\" }), {\n description: message`Omit orbits.`,\n }),\n (s) => s.split(\",\"),\n ),\n ),\n includeEdgeOrbits: antiBool(\"--noedges\", message`Ignore all edges.`),\n includeCenterOrbits: antiBool(\n \"--nocenters\",\n message`Ignore all centers.`,\n ),\n grayCorners: option(\"--graycorners\", {\n description: message`Gray corners.`,\n }),\n grayEdges: option(\"--grayedges\", { description: message`Gray edges.` }),\n grayCenters: option(\"--graycenters\", {\n description: message`Gray centers.`,\n }),\n fixedOrientation: option(\"--noorientation\", {\n description: message`Ignore orientations.`,\n }),\n orientCenters: option(\"--orientcenters\", {\n description: message`Give centers an orientation.`,\n }),\n }),\n optional(\n or(\n object({\n puzzleOrientation: optional(\n map(\n option(\n \"--puzzleorientation\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientation.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n puzzleOrientations: constant(undefined),\n }),\n object({\n puzzleOrientation: constant(undefined),\n puzzleOrientations: optional(\n map(\n option(\n \"--puzzleorientations\",\n string({ metavar: \"JSON_STRING\" }),\n {\n description: message`For 3D formats, give puzzle orientations.`,\n },\n ),\n (s) => JSON.parse(s),\n ),\n ),\n }),\n ),\n ),\n object({\n fixedPieceType: optional(\n or(\n map(\n flag(\"--fixcorner\", {\n description: message`Auto-select a subset of moves to keep a corner fixed in place.`,\n }),\n () => \"v\" as const,\n ),\n map(\n flag(\"--fixedge\", {\n description: message`Auto-select a subset of moves to keep an edge fixed in place.`,\n }),\n () => \"e\" as const,\n ),\n map(\n flag(\"--fixcenter\", {\n description: message`Auto-select a subset of moves to keep a center fixed in place.`,\n }),\n () => \"f\" as const,\n ),\n ),\n ),\n // TODO: this doesn't make sense for all subcommands?\n scrambleAmount: optional(\n option(\"--scramble\", integer({ min: 0 }), {\n description: message`Scramble solved position.`,\n }),\n ),\n moveList: optional(\n map(\n option(\"--moves\", string({ metavar: \"COMMA_SEPARATED_MOVES\" }), {\n description: message`Restrict moves to this list. Example: \\\"U2,F,r\\\").`,\n }),\n (s) => s.split(\",\").map((m) => Move.fromString(m)),\n ),\n ),\n puzzle: map(\n argument(string({ metavar: \"PUZZLE\" }), {\n description: message`The puzzle can be given as a geometric description or by name.\nThe geometric description starts with one of:\n\n- \\`c\\` (cube),\\n\n- \\`t\\` (tetrahedron),\\n\n- \\`d\\` (dodecahedron),\\n\n- \\`i\\` (icosahedron),\\n\n- \\`o\\` (octahedron),\\n\n\nthen a space, then a series of cuts. Each cut begins with one of:\n\n- \\`f\\` (for a cut parallel to faces),\\n\n- \\`v\\` (for a cut perpendicular to a ray from the center through a corner),\\n\n- \\`e\\` (for a cut perpendicular to a ray from the center through an edge),\\n\n\nfollowed by a decimal number giving a distance, where 1 is the distance\nbetween the center of the puzzle and the center of a face.\n\nExample description: \\`c f 0 v 0.577350269189626 e 0\\`. Corresponds to: https://alpha.twizzle.net/explore/?puzzle=2x2x2+%2B+dino+%2B+little+chop\n\nThe recognized puzzle names are: ${Object.keys(puzzleList)\n .map((p) => JSON.stringify(p))\n .join(\", \")}`,\n }),\n (s) => {\n const parsed = parsePuzzleDescription(puzzleList[s] ?? s);\n if (parsed === null) {\n throw new Error(\"Could not parse puzzle description!\");\n }\n return parsed;\n },\n ),\n }),\n ),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`\nExamples:\n\n puzzle-geometry --ss 2x2x2\\n\n puzzle-geometry --ss --fixcorner 2x2x2\\n\n puzzle-geometry --ss --moves U,F2,r 4x4x4\\n\n puzzle-geometry --ksolve --optimize --moves U,F,R megaminx\\n\n puzzle-geometry --gap --noedges megaminx\n`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nif (args.verbosity !== 0) {\n const cmd = () => {\n const [command, ...args] = argv;\n return new PrintableShellCommand(command, args).getPrintableCommand({\n argumentLineWrapping: \"inline\",\n });\n };\n\n switch (args.commentStyle) {\n case \"hash\": {\n console.log(`# ${cmd()}`);\n break;\n }\n case \"none\": {\n break;\n }\n case \"Pascal\": {\n console.log(`(* ${cmd()} *)`);\n break;\n }\n default:\n throw new Error(\"Invalid comment style.\") as never;\n }\n}\n\nfunction buildPuzzleGeometry(): PuzzleGeometry {\n const {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n } = args;\n const options: ExperimentalPuzzleGeometryOptions = {\n verbosity,\n optimizeOrbits,\n addRotations,\n allMoves,\n outerBlockMoves,\n vertexMoves,\n includeCornerOrbits,\n includeCenterOrbits,\n includeEdgeOrbits,\n excludeOrbits,\n grayCorners,\n grayEdges,\n grayCenters,\n fixedOrientation,\n orientCenters,\n puzzleOrientation,\n puzzleOrientations,\n fixedPieceType,\n scrambleAmount,\n moveList,\n };\n\n const puzzleGeometry = new PuzzleGeometry(args.puzzle, options);\n // TODO: why are these calls needed?\n puzzleGeometry.allstickers();\n puzzleGeometry.genperms();\n return puzzleGeometry;\n}\n\nswitch (args.subcommand) {\n case \"KSolve\": {\n console.log(buildPuzzleGeometry().writeksolve());\n break;\n }\n case \"SVG\": {\n console.log(\n buildPuzzleGeometry().generatesvg(\n undefined,\n undefined,\n undefined,\n args.svg3D,\n ),\n );\n break;\n }\n case \"GAP\": {\n console.log(buildPuzzleGeometry().writegap());\n break;\n }\n case \"Mathematica\": {\n console.log(buildPuzzleGeometry().writemathematica());\n break;\n }\n case \"Schreier-Sims\": {\n buildPuzzleGeometry().writeSchreierSims(console.log);\n break;\n }\n case \"Canonical string analysis\": {\n buildPuzzleGeometry().showcanon(console.log);\n break;\n }\n case \"3D\": {\n console.log(JSON.stringify(buildPuzzleGeometry().get3d(), null, \" \"));\n break;\n }\n default:\n throw new Error(\"Invalid subcommand.\") as never;\n}\n"],
5
5
  "mappings": ";;;;;;AA0BA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW;AACpB,SAAS,YAAY;AACrB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAGtC,IAAM,aAAa,oBAAoB;AAGvC,SAAS,SAAS,YA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AACV,YAAQ;AAAA,MACN,oBAAoB,EAAE;AAAA,QACpB;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,MACP;AAAA,IACF;AACA;AAAA,EACF;AAAA,EACA,KAAK,OAAO;AACV,YAAQ,IAAI,oBAAoB,EAAE,SAAS,CAAC;AAC5C;AAAA,EACF;AAAA,EACA,KAAK,eAAe;AAClB,YAAQ,IAAI,oBAAoB,EAAE,iBAAiB,CAAC;AACpD;AAAA,EACF;AAAA,EACA,KAAK,iBAAiB;AACpB,wBAAoB,EAAE,kBAAkB,QAAQ,GAAG;AACnD;AAAA,EACF;AAAA,EACA,KAAK,6BAA6B;AAChC,wBAAoB,EAAE,UAAU,QAAQ,GAAG;AAC3C;AAAA,EACF;AAAA,EACA,KAAK,MAAM;AACT,YAAQ,IAAI,KAAK,UAAU,oBAAoB,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC;AACrE;AAAA,EACF;AAAA,EACA;AACE,UAAM,IAAI,MAAM,qBAAqB;AACzC;",
6
6
  "names": ["args"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --
2
2
  import {
3
3
  packageVersion
4
- } from "./chunks/chunk-BIRBVHTR.js";
4
+ } from "./chunks/chunk-5WXNSJ2M.js";
5
5
 
6
6
  // src/bin/scramble.ts
7
7
  import { argv } from "node:process";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/scramble.ts"],
4
- "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run ./src/bin/scramble.ts -- 333\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\nscramble --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(scramble --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport {\n argument,\n choice,\n integer,\n map,\n merge,\n message,\n object,\n option,\n withDefault,\n} from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo, twizzleEvents } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\nimport { Path } from \"path-class\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst outputFormats = [\"auto\", \"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\nconst eventIDs = Object.entries(twizzleEvents)\n .filter(([_, eventInfo]) => !!eventInfo.scramblesImplemented)\n .map(([eventID, _]) => eventID);\n\nconst args = run(\n merge(\n object({\n amount: withDefault(\n option(\"--amount\", \"-n\", integer({ metavar: \"AMOUNT\", min: 1 }), {\n description: message`Amount of scrambles.`,\n }),\n 1,\n ),\n notation: withDefault(\n option(\"--notation\", choice(notationTypes, { metavar: \"NOTATION\" })),\n \"auto\",\n ),\n }),\n object({\n format: withDefault(\n option(\"--format\", \"-f\", choice(outputFormats, { metavar: \"FORMAT\" })),\n \"auto\",\n ),\n }),\n object({\n // TODO: consolidate this with `format`: https://github.com/dahlia/optique/issues/57\n text: map(\n option(\"--text\", \"-t\", {\n description: message`Convenient shorthand for \\`--format text\\`.`,\n }),\n () => \"text\",\n ),\n }),\n object({\n eventID: argument(choice(eventIDs, { metavar: \"EVENT_ID\" }), {\n description: message`WCA or unoffiical event ID.`,\n }),\n }),\n ),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`Example: order 3x3x3 \"R U R' U R U2' R'\"`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nconst { amount, format: argsFormat, notation, text, eventID } = args;\nconst format = argsFormat ?? text ?? (!process.stdout.isTTY ? \"text\" : \"auto\");\n\nsetSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\nfunction scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n}\n\nfunction scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n}\n\nclass JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n}\n\n// Possibly: https://github.com/nodejs/node/issues/55468 Technically we could\n// just remove `await` from the called function, but this is semantically\n// unsound. This function encapsulates the unsoundness.\nfunction nodeForgetTopLevelAwaitWorkaround(\n _promise: Promise<void>,\n): Promise<void> {\n return Promise.resolve();\n}\n\nawait nodeForgetTopLevelAwaitWorkaround(\n (async () => {\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-expect-error This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n default: {\n throw new Error(\"Invalid format!\") as never;\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n default: {\n throw new Error(\"Invalid format!\") as never;\n }\n }\n }\n jsonListPrinter?.finish();\n }\n })(),\n);\n"],
4
+ "sourcesContent": ["/**\n\nTo run this file directly:\n\n```shell\nbun run -- ./src/bin/scramble.ts 333\n```\n\nTo test completions:\n\n```shell\n# fish (from repo root)\nset PATH (pwd)/src/test/bin-path $PATH\nscramble --completions fish | source\n```\n\n```shell\n# zsh (from repo root)\nautoload -Uz compinit\ncompinit\nexport PATH=$(pwd)/src/test/bin-path:$PATH\nsource <(scramble --completions zsh)\n```\n\n*/\n\nimport { argv } from \"node:process\";\nimport {\n argument,\n choice,\n integer,\n map,\n merge,\n message,\n object,\n option,\n withDefault,\n} from \"@optique/core\";\nimport { run } from \"@optique/run\";\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo, twizzleEvents } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\nimport { Path } from \"path-class\";\nimport { packageVersion } from \"../metadata/packageVersion\";\n\nconst outputFormats = [\"auto\", \"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\nconst eventIDs = Object.entries(twizzleEvents)\n .filter(([_, eventInfo]) => !!eventInfo.scramblesImplemented)\n .map(([eventID, _]) => eventID);\n\nconst args = run(\n merge(\n object({\n amount: withDefault(\n option(\"--amount\", \"-n\", integer({ metavar: \"AMOUNT\", min: 1 }), {\n description: message`Amount of scrambles.`,\n }),\n 1,\n ),\n notation: withDefault(\n option(\"--notation\", choice(notationTypes, { metavar: \"NOTATION\" })),\n \"auto\",\n ),\n }),\n object({\n format: withDefault(\n option(\"--format\", \"-f\", choice(outputFormats, { metavar: \"FORMAT\" })),\n \"auto\",\n ),\n }),\n object({\n // TODO: consolidate this with `format`: https://github.com/dahlia/optique/issues/57\n text: map(\n option(\"--text\", \"-t\", {\n description: message`Convenient shorthand for \\`--format text\\`.`,\n }),\n () => \"text\",\n ),\n }),\n object({\n eventID: argument(choice(eventIDs, { metavar: \"EVENT_ID\" }), {\n description: message`WCA or unoffiical event ID.`,\n }),\n }),\n ),\n {\n programName: new Path(argv[1]).basename.path,\n description: message`Example: order 3x3x3 \"R U R' U R U2' R'\"`,\n help: \"option\",\n completion: {\n mode: \"option\",\n name: \"plural\",\n },\n version: {\n mode: \"option\",\n value: packageVersion,\n },\n },\n);\n\nconst { amount, format: argsFormat, notation, text, eventID } = args;\nconst format = argsFormat ?? text ?? (!process.stdout.isTTY ? \"text\" : \"auto\");\n\nsetSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\nfunction scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n}\n\nfunction scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n}\n\nclass JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n}\n\n// Possibly: https://github.com/nodejs/node/issues/55468 Technically we could\n// just remove `await` from the called function, but this is semantically\n// unsound. This function encapsulates the unsoundness.\nfunction nodeForgetTopLevelAwaitWorkaround(\n _promise: Promise<void>,\n): Promise<void> {\n return Promise.resolve();\n}\n\nawait nodeForgetTopLevelAwaitWorkaround(\n (async () => {\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-expect-error This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n default: {\n throw new Error(\"Invalid format!\") as never;\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n default: {\n throw new Error(\"Invalid format!\") as never;\n }\n }\n }\n jsonListPrinter?.finish();\n }\n })(),\n);\n"],
5
5
  "mappings": ";;;;;;AA0BA,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAC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,UACnC;AAAA,QACF;AAAA,MACF;AACA,uBAAiB,OAAO;AAAA,IAC1B;AAAA,EACF,GAAG;AACL;",
6
6
  "names": ["eventInfo", "eventID"]
7
7
  }
@@ -1,4 +1,4 @@
1
- // src/cubing/vendor/mpl/twips/chunks/chunk-44VDESDN.js
1
+ // src/cubing/vendor/mpl/twips/chunks/chunk-4VODYKQX.js
2
2
  var __toBinary = /* @__PURE__ */ (() => {
3
3
  var table = new Uint8Array(128);
4
4
  for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;
@@ -18,4 +18,4 @@ var __toBinary = /* @__PURE__ */ (() => {
18
18
  export {
19
19
  __toBinary
20
20
  };
21
- //# sourceMappingURL=chunk-FKKRSXUI.js.map
21
+ //# sourceMappingURL=chunk-E3YLQC45.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cubing/vendor/mpl/twips/chunks/chunk-4VODYKQX.js"],
4
+ "sourcesContent": ["// Generated from `twips` v0.11.3\n\n// @ts-nocheck\n\nvar __toBinary = /* @__PURE__ */ (() => {\n var table = new Uint8Array(128);\n for (var i = 0; i < 64; i++) table[i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i * 4 - 205] = i;\n return (base64) => {\n var n = base64.length, bytes = new Uint8Array((n - (base64[n - 1] == \"=\") - (base64[n - 2] == \"=\")) * 3 / 4 | 0);\n for (var i2 = 0, j = 0; i2 < n; ) {\n var c0 = table[base64.charCodeAt(i2++)], c1 = table[base64.charCodeAt(i2++)];\n var c2 = table[base64.charCodeAt(i2++)], c3 = table[base64.charCodeAt(i2++)];\n bytes[j++] = c0 << 2 | c1 >> 4;\n bytes[j++] = c1 << 4 | c2 >> 2;\n bytes[j++] = c2 << 6 | c3;\n }\n return bytes;\n };\n})();\n\nexport {\n __toBinary\n};\n//# sourceMappingURL=chunk-4VODYKQX.js.map\n"],
5
+ "mappings": ";AAIA,IAAI,aAA8B,uBAAM;AACtC,MAAI,QAAQ,IAAI,WAAW,GAAG;AAC9B,WAAS,IAAI,GAAG,IAAI,IAAI,IAAK,OAAM,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,GAAG,IAAI;AACvG,SAAO,CAAC,WAAW;AACjB,QAAI,IAAI,OAAO,QAAQ,QAAQ,IAAI,YAAY,KAAK,OAAO,IAAI,CAAC,KAAK,QAAQ,OAAO,IAAI,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC;AAC/G,aAAS,KAAK,GAAG,IAAI,GAAG,KAAK,KAAK;AAChC,UAAI,KAAK,MAAM,OAAO,WAAW,IAAI,CAAC,GAAG,KAAK,MAAM,OAAO,WAAW,IAAI,CAAC;AAC3E,UAAI,KAAK,MAAM,OAAO,WAAW,IAAI,CAAC,GAAG,KAAK,MAAM,OAAO,WAAW,IAAI,CAAC;AAC3E,YAAM,GAAG,IAAI,MAAM,IAAI,MAAM;AAC7B,YAAM,GAAG,IAAI,MAAM,IAAI,MAAM;AAC7B,YAAM,GAAG,IAAI,MAAM,IAAI;AAAA,IACzB;AACA,WAAO;AAAA,EACT;AACF,GAAG;",
6
+ "names": []
7
+ }
@@ -348,4 +348,4 @@ export {
348
348
  solveTwips,
349
349
  setSearchDebug
350
350
  };
351
- //# sourceMappingURL=chunk-IHFKNNCV.js.map
351
+ //# sourceMappingURL=chunk-XITTJ75E.js.map
@@ -164,7 +164,7 @@ var TrembleSolver = class {
164
164
  };
165
165
 
166
166
  // src/cubing/search/inside/solve/twips.ts
167
- var twipsPromise = from(async () => import("./twips-UDB2NAAU.js"));
167
+ var twipsPromise = from(async () => import("./twips-OVT324QJ.js"));
168
168
  async function wasmTwips(def, pattern, options) {
169
169
  const { wasmTwips: wasmTwips2 } = await twipsPromise;
170
170
  return wasmTwips2(def, pattern, options);
@@ -208,7 +208,7 @@ async function solve222(pattern) {
208
208
  }
209
209
 
210
210
  // src/cubing/search/inside/solve/puzzles/dynamic/4x4x4/index.ts
211
- var dynamic4x4x4Solver = from(() => import("./search-dynamic-solve-4x4x4-QVAXVZBA.js"));
211
+ var dynamic4x4x4Solver = from(() => import("./search-dynamic-solve-4x4x4-OBPW4YC2.js"));
212
212
 
213
213
  // src/cubing/search/inside/solve/puzzles/4x4x4.ts
214
214
  var randomSuffixes = [
@@ -569,4 +569,4 @@ var insideAPI = {
569
569
 
570
570
  // src/cubing/search/inside/index.ts
571
571
  expose(insideAPI);
572
- //# sourceMappingURL=inside-UAY7NCJR.js.map
572
+ //# sourceMappingURL=inside-FGQBCNHY.js.map
@@ -1,5 +1,5 @@
1
1
  import "./chunk-NAPITA3L.js";
2
- import "./chunk-IHFKNNCV.js";
2
+ import "./chunk-XITTJ75E.js";
3
3
  import {
4
4
  random333Scramble
5
5
  } from "./chunk-ZGT5MZSV.js";
@@ -2921,4 +2921,4 @@ export {
2921
2921
  initialize,
2922
2922
  random444Scramble
2923
2923
  };
2924
- //# sourceMappingURL=search-dynamic-solve-4x4x4-QVAXVZBA.js.map
2924
+ //# sourceMappingURL=search-dynamic-solve-4x4x4-OBPW4YC2.js.map
@@ -9,7 +9,7 @@ import "./chunk-ZKJKRQKY.js";
9
9
  // src/cubing/search/worker-workarounds/search-worker-entry.js
10
10
  if (exposeAPI.expose) {
11
11
  (async () => {
12
- await import("./inside-UAY7NCJR.js");
12
+ await import("./inside-FGQBCNHY.js");
13
13
  const messagePort = globalThis.postMessage ? globalThis : await nodeEndpointPort();
14
14
  messagePort.postMessage("comlink-exposed");
15
15
  })();
@@ -1,4 +1,4 @@
1
- import "./chunk-FKKRSXUI.js";
1
+ import "./chunk-E3YLQC45.js";
2
2
  import {
3
3
  Alg
4
4
  } from "./chunk-7D7ZUWUK.js";
@@ -159,35 +159,6 @@ function takeFromExternrefTable0(idx) {
159
159
  wasm.__externref_table_dealloc(idx);
160
160
  return value;
161
161
  }
162
- function wasmDeriveScrambleForEvent(hex_derivation_seed_str, derivation_salt_hierarchy_str, subevent_str) {
163
- let deferred5_0;
164
- let deferred5_1;
165
- try {
166
- const ptr0 = passStringToWasm0(hex_derivation_seed_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
167
- const len0 = WASM_VECTOR_LEN;
168
- const ptr1 = passStringToWasm0(derivation_salt_hierarchy_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
- const len1 = WASM_VECTOR_LEN;
170
- const ptr2 = passStringToWasm0(subevent_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
171
- const len2 = WASM_VECTOR_LEN;
172
- const ret = wasm.wasmDeriveScrambleForEvent(ptr0, len0, ptr1, len1, ptr2, len2);
173
- var ptr4 = ret[0];
174
- var len4 = ret[1];
175
- if (ret[3]) {
176
- ptr4 = 0;
177
- len4 = 0;
178
- throw takeFromExternrefTable0(ret[2]);
179
- }
180
- deferred5_0 = ptr4;
181
- deferred5_1 = len4;
182
- return getStringFromWasm0(ptr4, len4);
183
- } finally {
184
- wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
185
- }
186
- }
187
- function wasmFreeMemoryForAllScrambleFinders() {
188
- const ret = wasm.wasmFreeMemoryForAllScrambleFinders();
189
- return ret >>> 0;
190
- }
191
162
  function wasmTwips(kpuzzle_json, search_pattern_json, options_json) {
192
163
  let deferred5_0;
193
164
  let deferred5_1;
@@ -234,6 +205,35 @@ function wasmRandomScrambleForEvent(event_str) {
234
205
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
235
206
  }
236
207
  }
208
+ function wasmDeriveScrambleForEvent(hex_derivation_seed_str, derivation_salt_hierarchy_str, subevent_str) {
209
+ let deferred5_0;
210
+ let deferred5_1;
211
+ try {
212
+ const ptr0 = passStringToWasm0(hex_derivation_seed_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
213
+ const len0 = WASM_VECTOR_LEN;
214
+ const ptr1 = passStringToWasm0(derivation_salt_hierarchy_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
215
+ const len1 = WASM_VECTOR_LEN;
216
+ const ptr2 = passStringToWasm0(subevent_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
+ const len2 = WASM_VECTOR_LEN;
218
+ const ret = wasm.wasmDeriveScrambleForEvent(ptr0, len0, ptr1, len1, ptr2, len2);
219
+ var ptr4 = ret[0];
220
+ var len4 = ret[1];
221
+ if (ret[3]) {
222
+ ptr4 = 0;
223
+ len4 = 0;
224
+ throw takeFromExternrefTable0(ret[2]);
225
+ }
226
+ deferred5_0 = ptr4;
227
+ deferred5_1 = len4;
228
+ return getStringFromWasm0(ptr4, len4);
229
+ } finally {
230
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
231
+ }
232
+ }
233
+ function wasmFreeMemoryForAllScrambleFinders() {
234
+ const ret = wasm.wasmFreeMemoryForAllScrambleFinders();
235
+ return ret >>> 0;
236
+ }
237
237
  var EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
238
238
  async function __wbg_load(module, imports) {
239
239
  if (typeof Response === "function" && module instanceof Response) {
@@ -387,7 +387,7 @@ var twips_wasm_default = __wbg_init;
387
387
  var cachedInitWrapper;
388
388
  async function initWrapper() {
389
389
  await (cachedInitWrapper ??= (async () => {
390
- const wasmUint8Array = (await import("./twips_wasm_bg-TPXD7W4R-2BXON3G5.js")).default;
390
+ const wasmUint8Array = (await import("./twips_wasm_bg-RWVQBVBA-5YCKA6O5.js")).default;
391
391
  await twips_wasm_default({ module_or_path: wasmUint8Array.buffer });
392
392
  })());
393
393
  }
@@ -430,4 +430,4 @@ export {
430
430
  wasmRandomScrambleForEvent2 as wasmRandomScrambleForEvent,
431
431
  wasmTwips2 as wasmTwips
432
432
  };
433
- //# sourceMappingURL=twips-UDB2NAAU.js.map
433
+ //# sourceMappingURL=twips-OVT324QJ.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/cubing/vendor/src/wasm-package/index.ts", "../../../../src/cubing/vendor/.temp/rust-wasm/twips_wasm.js"],
4
- "sourcesContent": ["import { Alg } from \"cubing/alg\";\nimport type { KPattern, KPuzzleDefinition } from \"cubing/kpuzzle\";\nimport {\n default as init,\n wasmDeriveScrambleForEvent as rawWasmDeriveScrambleForEvent,\n wasmFreeMemoryForAllScrambleFinders as rawWasmFreeMemoryForAllScrambleFinders,\n wasmRandomScrambleForEvent as rawWasmRandomScrambleForEvent,\n wasmTwips as rawWasmTwips,\n} from \"../../.temp/rust-wasm/twips_wasm\";\n\nlet cachedInitWrapper: Promise<void> | undefined;\nasync function initWrapper(): Promise<void> {\n // biome-ignore lint/suspicious/noAssignInExpressions: This is a caching pattern.\n await (cachedInitWrapper ??= (async () => {\n // TODO: keep this as a `.wasm` file (instead of embedding it in JS) as soon as `esbuild` supports it out of the box.\n // - https://github.com/evanw/esbuild/issues/795\n // - https://github.com/evanw/esbuild/issues/2866\n const wasmUint8Array = (\n await import(\"../../.temp/rust-wasm/twips_wasm_bg.wasm\")\n ).default as unknown as Uint8Array;\n await init({ module_or_path: wasmUint8Array.buffer as BufferSource });\n })());\n}\n\nexport async function wasmRandomScrambleForEvent(\n eventID: string,\n): Promise<Alg> {\n await initWrapper();\n return new Alg(rawWasmRandomScrambleForEvent(eventID));\n}\n\nexport async function wasmDeriveScrambleForEvent(\n hexDerivationSeed: string,\n derivationSaltHierarchy: string[],\n eventId: string,\n): Promise<Alg> {\n for (const derivationSalt of derivationSaltHierarchy) {\n if (derivationSalt.includes(\"/\")) {\n throw new Error(\"Derivation salts cannot contain slashes.\");\n }\n }\n await initWrapper();\n return new Alg(\n rawWasmDeriveScrambleForEvent(\n hexDerivationSeed,\n derivationSaltHierarchy.join(\"/\"),\n eventId,\n ),\n );\n}\n\nexport async function wasmTwips(\n kpuzzleDefinition: KPuzzleDefinition,\n searchPattern: KPattern,\n options?: { minDepth?: number },\n): Promise<Alg> {\n await initWrapper();\n return new Alg(\n rawWasmTwips(\n JSON.stringify(kpuzzleDefinition),\n // biome-ignore lint/complexity/useLiteralKeys: JSON field access\n JSON.stringify(searchPattern.toJSON()[\"patternData\"]),\n JSON.stringify(options),\n ),\n );\n}\n\nexport function wasmFreeMemoryForAllScrambleFinders(): number {\n return rawWasmFreeMemoryForAllScrambleFinders();\n}\n", "let wasm;\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches && builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n }\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nfunction addToExternrefTable0(obj) {\n const idx = wasm.__externref_table_alloc();\n wasm.__wbindgen_externrefs.set(idx, obj);\n return idx;\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n const idx = addToExternrefTable0(e);\n wasm.__wbindgen_exn_store(idx);\n }\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n/**\n * @param {string} hex_derivation_seed_str\n * @param {string} derivation_salt_hierarchy_str\n * @param {string} subevent_str\n * @returns {string}\n */\nexport function wasmDeriveScrambleForEvent(hex_derivation_seed_str, derivation_salt_hierarchy_str, subevent_str) {\n let deferred5_0;\n let deferred5_1;\n try {\n const ptr0 = passStringToWasm0(hex_derivation_seed_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(derivation_salt_hierarchy_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(subevent_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.wasmDeriveScrambleForEvent(ptr0, len0, ptr1, len1, ptr2, len2);\n var ptr4 = ret[0];\n var len4 = ret[1];\n if (ret[3]) {\n ptr4 = 0; len4 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * @returns {number}\n */\nexport function wasmFreeMemoryForAllScrambleFinders() {\n const ret = wasm.wasmFreeMemoryForAllScrambleFinders();\n return ret >>> 0;\n}\n\n/**\n * @param {string} kpuzzle_json\n * @param {string} search_pattern_json\n * @param {string} options_json\n * @returns {string}\n */\nexport function wasmTwips(kpuzzle_json, search_pattern_json, options_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const ptr0 = passStringToWasm0(kpuzzle_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(search_pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.wasmTwips(ptr0, len0, ptr1, len1, ptr2, len2);\n var ptr4 = ret[0];\n var len4 = ret[1];\n if (ret[3]) {\n ptr4 = 0; len4 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * @param {string} event_str\n * @returns {string}\n */\nexport function wasmRandomScrambleForEvent(event_str) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passStringToWasm0(event_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.wasmRandomScrambleForEvent(ptr0, len0);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0; len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {\n const ret = debugString(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {\n const ret = arg0 === undefined;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {\n const ret = arg0.call(arg1);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);\n }\n };\n imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {\n globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));\n }, arguments) };\n imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {\n const ret = Reflect.get(arg0, arg1);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {\n const ret = new Error();\n return ret;\n };\n imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {\n const ret = new Function(getStringFromWasm0(arg0, arg1));\n return ret;\n };\n imports.wbg.__wbg_now_f5ba683d8ce2c571 = function(arg0) {\n const ret = arg0.now();\n return ret;\n };\n imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {\n const ret = arg1.stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {\n const ret = typeof global === 'undefined' ? null : global;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {\n const ret = typeof globalThis === 'undefined' ? null : globalThis;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {\n const ret = typeof self === 'undefined' ? null : self;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {\n const ret = typeof window === 'undefined' ? null : window;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('twips_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],
5
- "mappings": ";;;;;;ACII,IAAA;AACA,SAAI,YAAQ,KAAY;AACpB,QAAA,OAAW,OAAG;AAClB,MAAA,QAAA,YAAA,QAAA,aAAA,OAAA,MAAA;AACA,WAAI,GAAQ,GAAA;EACR;AACJ,MAAA,QAAA,UAAA;AACA,WAAI,IAAQ,GAAA;EACR;AACA,MAAA,QAAI,UAAe;AACf,UAAA,cAAO,IAAA;AACX,QAAA,eAAO,MAAA;AACH,aAAO;IACX,OAAA;AACJ,aAAA,UAAA,WAAA;IACA;EACI;AACA,MAAA,QAAI,YAAe;AACf,UAAA,OAAO,IAAA;AACX,QAAA,OAAO,QAAA,YAAA,KAAA,SAAA,GAAA;AACH,aAAO,YAAA,IAAA;IACX,OAAA;AACJ,aAAA;IAEA;EACI;AACA,MAAA,MAAI,QAAQ,GAAA,GAAA;AACZ,UAAI,SAAS,IAAG;AACZ,QAAA,QAAS;AACb,QAAA,SAAA,GAAA;AACA,eAAQ,YAAW,IAAA,CAAQ,CAAA;IACvB;AACJ,aAAA,IAAA,GAAA,IAAA,QAAA,KAAA;AACA,eAAS,OAAA,YAAA,IAAA,CAAA,CAAA;IACT;AACJ,aAAA;AAEA,WAAM;EACN;AACA,QAAI,iBAAkB,sBAAe,KAAY,SAAA,KAAA,GAAA,CAAA;AAC7C,MAAA;AACJ,MAAA,kBAAO,eAAA,SAAA,GAAA;AAEH,gBAAO,eAAiB,CAAA;EAC5B,OAAA;AACA,WAAI,SAAa,KAAA,GAAA;EAIb;AACI,MAAA,aAAO,UAAY;AACvB,QAAA;AACI,aAAO,YAAA,KAAA,UAAA,GAAA,IAAA;IACX,SAAA,GAAA;AACJ,aAAA;IAEA;EACI;AAAuC,MAAI,eAAK,OAAA;AACpD,WAAA,GAAA,I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A;AAChC,aAAM,kBAAU,yBAAA;AAClB,QAAA,eAAA,SAAA,GAAA,GAAA;AACF,YAAA,IAAA,MAAA,0CAAA;IACA;EACA;AAAW,QACT,YAAA;AAAA,SACE,IAAA;IAAA;MAEA;MACF,wBAAA,KAAA,GAAA;MACF;IACF;EAEA;AAKE;AACA,eAAW,WAAA,mBAAA,eAAA,SAAA;AAAA,QACT,YAAA;AAAA,SACE,IAAK;IAA2B;MAEhC,KAAK,UAAU,iBAAc;;MAE/B,KAAA,UAAA,cAAA,OAAA,EAAA,aAAA,CAAA;MACF,KAAA,UAAA,OAAA;IACF;EAEO;AACL;AACF,SAAA,uCAAA;;;",
6
- "names": ["ptr", "wasmDeriveScrambleForEvent"]
4
+ "sourcesContent": ["import { Alg } from \"cubing/alg\";\nimport type { KPattern, KPuzzleDefinition } from \"cubing/kpuzzle\";\nimport {\n default as init,\n wasmDeriveScrambleForEvent as rawWasmDeriveScrambleForEvent,\n wasmFreeMemoryForAllScrambleFinders as rawWasmFreeMemoryForAllScrambleFinders,\n wasmRandomScrambleForEvent as rawWasmRandomScrambleForEvent,\n wasmTwips as rawWasmTwips,\n} from \"../../.temp/rust-wasm/twips_wasm\";\n\nlet cachedInitWrapper: Promise<void> | undefined;\nasync function initWrapper(): Promise<void> {\n // biome-ignore lint/suspicious/noAssignInExpressions: This is a caching pattern.\n await (cachedInitWrapper ??= (async () => {\n // TODO: keep this as a `.wasm` file (instead of embedding it in JS) as soon as `esbuild` supports it out of the box.\n // - https://github.com/evanw/esbuild/issues/795\n // - https://github.com/evanw/esbuild/issues/2866\n const wasmUint8Array = (\n await import(\"../../.temp/rust-wasm/twips_wasm_bg.wasm\")\n ).default as unknown as Uint8Array;\n await init({ module_or_path: wasmUint8Array.buffer as BufferSource });\n })());\n}\n\nexport async function wasmRandomScrambleForEvent(\n eventID: string,\n): Promise<Alg> {\n await initWrapper();\n return new Alg(rawWasmRandomScrambleForEvent(eventID));\n}\n\nexport async function wasmDeriveScrambleForEvent(\n hexDerivationSeed: string,\n derivationSaltHierarchy: string[],\n eventId: string,\n): Promise<Alg> {\n for (const derivationSalt of derivationSaltHierarchy) {\n if (derivationSalt.includes(\"/\")) {\n throw new Error(\"Derivation salts cannot contain slashes.\");\n }\n }\n await initWrapper();\n return new Alg(\n rawWasmDeriveScrambleForEvent(\n hexDerivationSeed,\n derivationSaltHierarchy.join(\"/\"),\n eventId,\n ),\n );\n}\n\nexport async function wasmTwips(\n kpuzzleDefinition: KPuzzleDefinition,\n searchPattern: KPattern,\n options?: { minDepth?: number },\n): Promise<Alg> {\n await initWrapper();\n return new Alg(\n rawWasmTwips(\n JSON.stringify(kpuzzleDefinition),\n // biome-ignore lint/complexity/useLiteralKeys: JSON field access\n JSON.stringify(searchPattern.toJSON()[\"patternData\"]),\n JSON.stringify(options),\n ),\n );\n}\n\nexport function wasmFreeMemoryForAllScrambleFinders(): number {\n return rawWasmFreeMemoryForAllScrambleFinders();\n}\n", "let wasm;\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches && builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n }\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nfunction addToExternrefTable0(obj) {\n const idx = wasm.__externref_table_alloc();\n wasm.__wbindgen_externrefs.set(idx, obj);\n return idx;\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n const idx = addToExternrefTable0(e);\n wasm.__wbindgen_exn_store(idx);\n }\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n/**\n * @param {string} kpuzzle_json\n * @param {string} search_pattern_json\n * @param {string} options_json\n * @returns {string}\n */\nexport function wasmTwips(kpuzzle_json, search_pattern_json, options_json) {\n let deferred5_0;\n let deferred5_1;\n try {\n const ptr0 = passStringToWasm0(kpuzzle_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(search_pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.wasmTwips(ptr0, len0, ptr1, len1, ptr2, len2);\n var ptr4 = ret[0];\n var len4 = ret[1];\n if (ret[3]) {\n ptr4 = 0; len4 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * @param {string} event_str\n * @returns {string}\n */\nexport function wasmRandomScrambleForEvent(event_str) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passStringToWasm0(event_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.wasmRandomScrambleForEvent(ptr0, len0);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0; len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * @param {string} hex_derivation_seed_str\n * @param {string} derivation_salt_hierarchy_str\n * @param {string} subevent_str\n * @returns {string}\n */\nexport function wasmDeriveScrambleForEvent(hex_derivation_seed_str, derivation_salt_hierarchy_str, subevent_str) {\n let deferred5_0;\n let deferred5_1;\n try {\n const ptr0 = passStringToWasm0(hex_derivation_seed_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(derivation_salt_hierarchy_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(subevent_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.wasmDeriveScrambleForEvent(ptr0, len0, ptr1, len1, ptr2, len2);\n var ptr4 = ret[0];\n var len4 = ret[1];\n if (ret[3]) {\n ptr4 = 0; len4 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred5_0 = ptr4;\n deferred5_1 = len4;\n return getStringFromWasm0(ptr4, len4);\n } finally {\n wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);\n }\n}\n\n/**\n * @returns {number}\n */\nexport function wasmFreeMemoryForAllScrambleFinders() {\n const ret = wasm.wasmFreeMemoryForAllScrambleFinders();\n return ret >>> 0;\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {\n const ret = debugString(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {\n const ret = arg0 === undefined;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n imports.wbg.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {\n const ret = arg0.call(arg1);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);\n }\n };\n imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {\n globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));\n }, arguments) };\n imports.wbg.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {\n const ret = Reflect.get(arg0, arg1);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {\n const ret = new Error();\n return ret;\n };\n imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {\n const ret = new Function(getStringFromWasm0(arg0, arg1));\n return ret;\n };\n imports.wbg.__wbg_now_f5ba683d8ce2c571 = function(arg0) {\n const ret = arg0.now();\n return ret;\n };\n imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {\n const ret = arg1.stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {\n const ret = typeof global === 'undefined' ? null : global;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {\n const ret = typeof globalThis === 'undefined' ? null : globalThis;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {\n const ret = typeof self === 'undefined' ? null : self;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {\n const ret = typeof window === 'undefined' ? null : window;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n };\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('twips_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],
5
+ "mappings": ";;;;;;ACAA,IAAI;AAEJ,SAAS,YAAY,KAAK;AAEtB,QAAM,OAAO,OAAO;AACpB,MAAI,QAAQ,YAAY,QAAQ,aAAa,OAAO,MAAM;AACtD,WAAQ,GAAG,GAAG;EAClB;AACA,MAAI,QAAQ,UAAU;AAClB,WAAO,IAAI,GAAG;EAClB;AACA,MAAI,QAAQ,UAAU;AAClB,UAAM,cAAc,IAAI;AACxB,QAAI,eAAe,MAAM;AACrB,aAAO;IACX,OAAO;AACH,aAAO,UAAU,WAAW;IAChC;EACJ;AACA,MAAI,QAAQ,YAAY;AACpB,UAAM,OAAO,IAAI;AACjB,QAAI,OAAO,QAAQ,YAAY,KAAK,SAAS,GAAG;AAC5C,aAAO,YAAY,IAAI;IAC3B,OAAO;AACH,aAAO;IACX;EACJ;AAEA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACpB,UAAM,SAAS,IAAI;AACnB,QAAI,QAAQ;AACZ,QAAI,SAAS,GAAG;AACZ,eAAS,YAAY,IAAI,CAAC,CAAC;IAC/B;AACA,aAAQ,IAAI,GAAG,IAAI,QAAQ,KAAK;AAC5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