cubing 0.26.7 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/esm/alg/index.js +5 -9
  2. package/dist/esm/bluetooth/index.js +6 -7
  3. package/dist/esm/bluetooth/index.js.map +2 -2
  4. package/dist/esm/{chunk-GLII3KIK.js → chunk-3Y4PK4XI.js} +2 -2
  5. package/dist/esm/{chunk-GLII3KIK.js.map → chunk-3Y4PK4XI.js.map} +0 -0
  6. package/dist/esm/{chunk-J4SZZ5OP.js → chunk-AU3UW5N4.js} +3 -3
  7. package/dist/esm/{chunk-J4SZZ5OP.js.map → chunk-AU3UW5N4.js.map} +2 -2
  8. package/dist/esm/{chunk-KSNW26OV.js → chunk-DSAZCGT2.js} +4 -4
  9. package/dist/esm/{chunk-KSNW26OV.js.map → chunk-DSAZCGT2.js.map} +0 -0
  10. package/dist/esm/{chunk-ITRA3DUQ.js → chunk-HIMSRIID.js} +2 -2
  11. package/dist/esm/{chunk-ITRA3DUQ.js.map → chunk-HIMSRIID.js.map} +0 -0
  12. package/dist/esm/{chunk-P637ZWHR.js → chunk-KJYODR27.js} +4 -4
  13. package/dist/esm/{chunk-P637ZWHR.js.map → chunk-KJYODR27.js.map} +0 -0
  14. package/dist/esm/{chunk-ASOUBXFO.js → chunk-LNUPGLIU.js} +3 -3
  15. package/dist/esm/{chunk-ASOUBXFO.js.map → chunk-LNUPGLIU.js.map} +2 -2
  16. package/dist/esm/{chunk-FCB447RN.js → chunk-NQORDEXF.js} +91 -31
  17. package/dist/esm/chunk-NQORDEXF.js.map +7 -0
  18. package/dist/esm/{chunk-KT3AIQTR.js → chunk-NS5XT5ZV.js} +2 -2
  19. package/dist/esm/{chunk-KT3AIQTR.js.map → chunk-NS5XT5ZV.js.map} +2 -2
  20. package/dist/esm/{chunk-LKISJU2L.js → chunk-RECTK3R2.js} +5 -2
  21. package/dist/esm/{chunk-LKISJU2L.js.map → chunk-RECTK3R2.js.map} +2 -2
  22. package/dist/esm/{chunk-QK4WH7WZ.js → chunk-VY7VF4MA.js} +2 -2
  23. package/dist/esm/{chunk-QK4WH7WZ.js.map → chunk-VY7VF4MA.js.map} +0 -0
  24. package/dist/esm/{chunk-YEXEZWAK.js → chunk-VYMKSHDI.js} +3 -3
  25. package/dist/esm/{chunk-YEXEZWAK.js.map → chunk-VYMKSHDI.js.map} +0 -0
  26. package/dist/esm/kpuzzle/index.js +2 -2
  27. package/dist/esm/notation/index.js +2 -2
  28. package/dist/esm/protocol/index.js +8 -8
  29. package/dist/esm/puzzle-geometry/index.js +2 -2
  30. package/dist/esm/puzzles/index.js +4 -4
  31. package/dist/esm/scramble/index.js +2 -2
  32. package/dist/esm/search/index.js +6 -6
  33. package/dist/esm/{search-dynamic-sgs-side-events-OUCE5RN6.js → search-dynamic-sgs-side-events-4UF3XJRB.js} +7 -7
  34. package/dist/esm/{search-dynamic-sgs-side-events-OUCE5RN6.js.map → search-dynamic-sgs-side-events-4UF3XJRB.js.map} +0 -0
  35. package/dist/esm/{search-dynamic-sgs-unofficial-KS2IT3DM.js → search-dynamic-sgs-unofficial-ZEUVDMBT.js} +6 -6
  36. package/dist/esm/{search-dynamic-sgs-unofficial-KS2IT3DM.js.map → search-dynamic-sgs-unofficial-ZEUVDMBT.js.map} +0 -0
  37. package/dist/esm/{search-dynamic-solve-4x4x4-6IIZNXXP.js → search-dynamic-solve-4x4x4-FKEWH5MW.js} +6 -6
  38. package/dist/esm/{search-dynamic-solve-4x4x4-6IIZNXXP.js.map → search-dynamic-solve-4x4x4-FKEWH5MW.js.map} +0 -0
  39. package/dist/esm/{search-dynamic-solve-kilominx-UEFJENHO.js → search-dynamic-solve-kilominx-JVBOIWI2.js} +2 -2
  40. package/dist/esm/{search-dynamic-solve-kilominx-UEFJENHO.js.map → search-dynamic-solve-kilominx-JVBOIWI2.js.map} +0 -0
  41. package/dist/esm/{search-worker-inside-generated-string-GNBQVERX.js → search-worker-inside-generated-string-KTF5N656.js} +27 -27
  42. package/dist/esm/search-worker-inside-generated-string-KTF5N656.js.map +7 -0
  43. package/dist/esm/{search-worker-js-entry-4A3O552B.js → search-worker-js-entry-NTV7KFZ5.js} +12 -12
  44. package/dist/esm/{search-worker-js-entry-4A3O552B.js.map → search-worker-js-entry-NTV7KFZ5.js.map} +0 -0
  45. package/dist/esm/{search-worker-ts-entry-NUFPSU6U.js → search-worker-ts-entry-EUKJTYA6.js} +2 -2
  46. package/dist/esm/{search-worker-ts-entry-NUFPSU6U.js.map → search-worker-ts-entry-EUKJTYA6.js.map} +0 -0
  47. package/dist/esm/stream/index.js +4 -4
  48. package/dist/esm/twisty/index.js +37 -14
  49. package/dist/esm/twisty/index.js.map +2 -2
  50. package/dist/esm/{twisty-dynamic-3d-YI5E4NWB.js → twisty-dynamic-3d-UJR5FP6R.js} +6 -6
  51. package/dist/esm/{twisty-dynamic-3d-YI5E4NWB.js.map → twisty-dynamic-3d-UJR5FP6R.js.map} +0 -0
  52. package/dist/types/{Alg-5cf4b166.d.ts → Alg-1b229e63.d.ts} +27 -18
  53. package/dist/types/{KState-836cc3c7.d.ts → KState-7a536c23.d.ts} +2 -1
  54. package/dist/types/{TwizzleLink-4f0a162d.d.ts → TwizzleLink-0fbaf9bd.d.ts} +9 -3
  55. package/dist/types/alg/index.d.ts +9 -4
  56. package/dist/types/bluetooth/index.d.ts +17 -7
  57. package/dist/types/{bluetooth-puzzle-b1d62cb5.d.ts → bluetooth-puzzle-7065b808.d.ts} +6 -9
  58. package/dist/types/kpuzzle/index.d.ts +2 -2
  59. package/dist/types/notation/index.d.ts +1 -1
  60. package/dist/types/{outside-a6c8f46b.d.ts → outside-f12ca41a.d.ts} +2 -2
  61. package/dist/types/{parse-9db7ee51.d.ts → parse-7cf1a92b.d.ts} +1 -1
  62. package/dist/types/protocol/index.d.ts +7 -3
  63. package/dist/types/puzzle-geometry/index.d.ts +3 -3
  64. package/dist/types/puzzles/index.d.ts +10 -5
  65. package/dist/types/scramble/index.d.ts +3 -3
  66. package/dist/types/search/index.d.ts +3 -3
  67. package/dist/types/stream/index.d.ts +4 -4
  68. package/dist/types/twisty/index.d.ts +5 -5
  69. package/package.json +3 -1
  70. package/dist/esm/chunk-FCB447RN.js.map +0 -7
  71. package/dist/esm/search-worker-inside-generated-string-GNBQVERX.js.map +0 -7
@@ -1,24 +1,24 @@
1
1
  import "./chunk-MGJA5U5O.js";
2
2
 
3
3
  // src/cubing/search/search-worker-inside-generated-string.js
4
- var workerSource = `var um=Object.defineProperty;var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bt=(e,t)=>{for(var r in t)um(e,r,{get:t[r],enumerable:!0})};var w0=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var d=(e,t,r)=>(w0(e,t,"read from private field"),r?r.call(e):t.get(e)),oe=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},V=(e,t,r,n)=>(w0(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),v0=(e,t,r,n)=>({set _(o){V(e,t,o,r)},get _(){return d(e,t,n)}}),m2=(e,t,r)=>(w0(e,t,"access private method"),r);var bm,El,Ie,Zt=y(()=>{bm=!1,El=class{is(t){return this instanceof t}as(t){return this instanceof t?this:null}},Ie=class extends El{constructor(){super();bm&&Object.defineProperty(this,"_debugStr",{get:()=>this.toString()})}get log(){return console.log.bind(console,this,this.toString())}}});function y2(e,t=!0){if(!t)return e;switch(e){case 1:return-1;case-1:return 1}}function z0(e,t){return t===-1?Array.from(e).reverse():e}function U2(e){return Array.from(e).reverse()}var bt=y(()=>{});var Sn,C0=y(()=>{Sn="2^31 - 1"});var jr,Rt,P0=y(()=>{Jt();Rt=class{constructor(){oe(this,jr,[])}push(t){d(this,jr).push(t)}experimentalPushAlg(t){for(let r of t.units())this.push(r)}experimentalNumUnits(){return d(this,jr).length}toAlg(){return new E(d(this,jr))}reset(){V(this,jr,[])}};jr=new WeakMap});var qr,Vr,_l,We,wo=y(()=>{Jt();Zt();bt();_l=class extends Ie{constructor(t,r){super();oe(this,qr,void 0);oe(this,Vr,void 0);V(this,qr,cr(t)),V(this,Vr,cr(r))}get A(){return d(this,qr)}get B(){return d(this,Vr)}isIdentical(t){let r=t.as(_l);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new _l(d(this,Vr),d(this,qr))}*experimentalExpand(t=1,r){r??(r=1/0),r===0?yield t===1?this:this.invert():t===1?(yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(1,r-1),yield*this.A.experimentalExpand(-1,r-1),yield*this.B.experimentalExpand(-1,r-1)):(yield*this.B.experimentalExpand(1,r-1),yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(-1,r-1),yield*this.A.experimentalExpand(-1,r-1))}toString(){return\`[\${d(this,qr).toString()}, \${d(this,Vr).toString()}]\`}},We=_l;qr=new WeakMap,Vr=new WeakMap});var wn,vn,kl,Ke,vo=y(()=>{Jt();Zt();bt();kl=class extends Ie{constructor(t,r){super();oe(this,wn,void 0);oe(this,vn,void 0);V(this,wn,cr(t)),V(this,vn,cr(r))}get A(){return d(this,wn)}get B(){return d(this,vn)}isIdentical(t){let r=t.as(kl);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new kl(d(this,wn),d(this,vn).invert())}*experimentalExpand(t,r){r??(r=1/0),r===0?yield t===1?this:this.invert():(yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(t,r-1),yield*this.A.experimentalExpand(-1,r-1))}toString(){return\`[\${this.A}: \${this.B}]\`}},Ke=kl;wn=new WeakMap,vn=new WeakMap});var Lr,M0,St,Eo=y(()=>{Zt();bt();M0=class extends Ie{constructor(t){super();oe(this,Lr,void 0);if(t.includes(\`
5
- \`)||t.includes("\\r"))throw new Error("LineComment cannot contain newline");V(this,Lr,t)}get text(){return d(this,Lr)}isIdentical(t){let r=t;return t.is(M0)&&d(this,Lr)===d(r,Lr)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}toString(){return\`//\${d(this,Lr)}\`}},St=M0;Lr=new WeakMap});var Xe,_o=y(()=>{Zt();bt();Xe=class extends Ie{toString(){return\`
6
- \`}isIdentical(t){return t.is(Xe)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});var $e,ko=y(()=>{Zt();bt();$e=class extends Ie{toString(){return"."}isIdentical(t){return t.is($e)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});function zl(e,t){return e?parseInt(e):t}function N0(e){return new Cl().parseAlg(e)}function b2(e){return new Cl().parseMove(e)}function S2(e){return new Cl().parseQuantumMove(e)}function et(e,t,r){let n=e;return n.startCharIndex=t,n.endCharIndex=r,n}function w2(e,t){return"startCharIndex"in e&&(t.startCharIndex=e.startCharIndex),"endCharIndex"in e&&(t.endCharIndex=e.endCharIndex),t}var x2,Sm,wm,vm,Em,_m,lt,I,Cl,T0=y(()=>{Jt();P0();wo();vo();Pl();Eo();Yt();_o();ko();x2=/^(\\d+)?('?)/,Sm=/^[_\\dA-Za-z]/,wm=/^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)?/,vm=/^[^\\n]*/,Em=/^(-?\\d+), ?/,_m=/^(-?\\d+)\\)/;Cl=class{constructor(){oe(this,lt,"");oe(this,I,0)}parseAlg(t){V(this,lt,t),V(this,I,0);let r=this.parseAlgWithStopping([]);return this.mustBeAtEndOfInput(),r}parseMove(t){V(this,lt,t),V(this,I,0);let r=this.parseMoveImpl();return this.mustBeAtEndOfInput(),r}parseQuantumMove(t){V(this,lt,t),V(this,I,0);let r=this.parseQuantumMoveImpl();return this.mustBeAtEndOfInput(),r}mustBeAtEndOfInput(){if(d(this,I)!==d(this,lt).length)throw new Error("parsing unexpectedly ended early")}parseAlgWithStopping(t){let r=d(this,I),n=d(this,I),o=new Rt,l=!1,i=s=>{if(l)throw new Error(\`Unexpected character at index \${s}. Are you missing a space?\`)};e:for(;d(this,I)<d(this,lt).length;){let s=d(this,I);if(t.includes(d(this,lt)[d(this,I)]))return et(o.toAlg(),r,n);if(this.tryConsumeNext(" ")){l=!1,o.experimentalNumUnits()===0&&(r=d(this,I));continue e}else if(Sm.test(d(this,lt)[d(this,I)])){i(s);let a=this.parseMoveImpl();o.push(a),l=!0,n=d(this,I);continue e}else if(this.tryConsumeNext("(")){i(s);let a=this.tryRegex(Em);if(a){let f=a[1],u=d(this,I),g=this.parseRegex(_m),p=et(new B(new z("U_SQ_"),parseInt(f)),s+1,s+1+f.length),c=et(new B(new z("D_SQ_"),parseInt(g[1])),u,d(this,I)-1),L=et(new E([p,c]),s+1,d(this,I)-1);o.push(et(new ct(L),s,d(this,I))),l=!0,n=d(this,I);continue e}else{let f=this.parseAlgWithStopping([")"]);this.mustConsumeNext(")");let u=this.parseAmount();o.push(et(new ct(f,u),s,d(this,I))),l=!0,n=d(this,I);continue e}}else if(this.tryConsumeNext("[")){i(s);let a=this.parseAlgWithStopping([",",":"]),f=this.popNext(),u=this.parseAlgWithStopping(["]"]);switch(this.mustConsumeNext("]"),f){case":":o.push(et(new Ke(a,u),s,d(this,I))),l=!0,n=d(this,I);continue e;case",":o.push(et(new We(a,u),s,d(this,I))),l=!0,n=d(this,I);continue e;default:throw new Error("unexpected parsing error")}}else if(this.tryConsumeNext(\`
7
- \`)){o.push(et(new Xe,s,d(this,I))),l=!1,n=d(this,I);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(s);let[a]=this.parseRegex(vm);o.push(et(new St(a),s,d(this,I))),l=!1,n=d(this,I);continue e}else{o.push(et(new B("_SLASH_"),s,d(this,I))),l=!0,n=d(this,I);continue e}else if(this.tryConsumeNext(".")){i(s),o.push(et(new $e,s,d(this,I))),l=!0,n=d(this,I);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(d(this,I)!==d(this,lt).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return et(o.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(wm);return new z(n,zl(r,void 0),zl(t,void 0))}parseMoveImpl(){let t=d(this,I);if(this.tryConsumeNext("/"))return et(new B("_SLASH_"),t,d(this,I));let r=this.parseQuantumMoveImpl(),[n,o]=this.parseAmountAndTrackEmptyAbsAmount(),l=this.parseMoveSuffix();if(l){if(n<0)throw new Error("uh-oh");if((l==="++"||l==="--")&&n!==1)throw new Error("Pochmann ++ or -- moves cannot have an amount other than 1.");if((l==="++"||l==="--")&&!o)throw new Error("Pochmann ++ or -- moves cannot have an amount written as a number.");if((l==="+"||l==="-")&&o)throw new Error("Clock dial moves must have an amount written as a natural number followed by + or -.");l.startsWith("+")&&(r=r.modified({family:\`\${r.family}_\${l==="+"?"PLUS":"PLUSPLUS"}_\`})),l.startsWith("-")&&(r=r.modified({family:\`\${r.family}_\${l==="-"?"PLUS":"PLUSPLUS"}_\`}),n*=-1)}return et(new B(r,n),t,d(this,I))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=d(this,I),[,r,n]=this.parseRegex(x2);if(r?.startsWith("0")&&r!=="0")throw new Error(\`Error at char index \${t}: An amount can only start with 0 if it's exactly the digit 0.\`);return[zl(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=d(this,I),[,r,n]=this.parseRegex(x2);if(r?.startsWith("0")&&r!=="0")throw new Error(\`Error at char index \${t}: An amount number can only start with 0 if it's exactly the digit 0.\`);return zl(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return V(this,I,d(this,I)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(V(this,I,d(this,I)+r[0].length),r)}remaining(){return d(this,lt).slice(d(this,I))}popNext(){let t=d(this,lt)[d(this,I)];return v0(this,I)._++,t}tryConsumeNext(t){return d(this,lt)[d(this,I)]===t?(v0(this,I)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};lt=new WeakMap,I=new WeakMap});function Ml(e){v2.has(e)||(console.warn(e),v2.add(e))}var v2,O0=y(()=>{v2=new Set});var En,G0=y(()=>{bt();C0();En=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<-2147483648||this.amount>2147483647)throw new Error(\`Unit amount absolute value must be a non-negative integer from \${Sn} to \${Sn}.\`)}suffix(){let t="",r=Math.abs(this.amount);return r!==1&&(t+=r),this.amount<0&&(t+="'"),t}isIdentical(t){return this.quantum.isIdentical(t.quantum)&&this.amount===t.amount}*experimentalExpand(t,r){let n=Math.abs(this.amount),o=y2(t,this.amount<0);for(let l=0;l<n;l++)yield*this.quantum.experimentalExpand(o,r)}}});var Xt,Qe,je,Tl,z,Me,_n,B,Yt=y(()=>{Zt();bt();C0();T0();O0();G0();Tl=class extends El{constructor(t,r,n){super();oe(this,Xt,void 0);oe(this,Qe,void 0);oe(this,je,void 0);if(V(this,Xt,t),V(this,Qe,r??null),V(this,je,n??null),Object.freeze(this),d(this,Qe)!==null&&(!Number.isInteger(d(this,Qe))||d(this,Qe)<1||d(this,Qe)>2147483647))throw new Error(\`QuantumMove inner layer must be a positive integer below \${Sn}.\`);if(d(this,je)!==null&&(!Number.isInteger(d(this,je))||d(this,je)<1||d(this,je)>2147483647))throw new Error(\`QuantumMove outer layer must be a positive integer below \${Sn}.\`);if(d(this,je)!==null&&d(this,Qe)!==null&&d(this,Qe)<=d(this,je))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(d(this,je)!==null&&d(this,Qe)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(t){return S2(t)}modified(t){return new Tl(t.family??d(this,Xt),t.innerLayer??d(this,Qe),t.outerLayer??d(this,je))}isIdentical(t){let r=t;return t.is(Tl)&&d(this,Xt)===d(r,Xt)&&d(this,Qe)===d(r,Qe)&&d(this,je)===d(r,je)}get family(){return d(this,Xt)}get outerLayer(){return d(this,je)}get innerLayer(){return d(this,Qe)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let t=d(this,Xt);return d(this,Qe)!==null&&(t=String(d(this,Qe))+t,d(this,je)!==null&&(t=String(d(this,je))+"-"+t)),t}},z=Tl;Xt=new WeakMap,Qe=new WeakMap,je=new WeakMap;_n=class extends Ie{constructor(...t){super();oe(this,Me,void 0);if(typeof t[0]=="string")if(t[1]??null){V(this,Me,new En(z.fromString(t[0]),t[1]));return}else return _n.fromString(t[0]);V(this,Me,new En(t[0],t[1]))}isIdentical(t){let r=t.as(_n);return!!r&&d(this,Me).isIdentical(d(r,Me))}invert(){return w2(this,new _n(d(this,Me).quantum,-this.amount))}*experimentalExpand(t=1){t===1?yield this:yield this.modified({amount:-this.amount})}get quantum(){return d(this,Me).quantum}modified(t){return new _n(d(this,Me).quantum.modified(t),t.amount??this.amount)}static fromString(t){return b2(t)}get amount(){return d(this,Me).amount}get type(){return Ml("deprecated: type"),"blockMove"}get family(){return d(this,Me).quantum.family??void 0}get outerLayer(){return d(this,Me).quantum.outerLayer??void 0}get innerLayer(){return d(this,Me).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return d(this,Me).quantum.toString().slice(0,-6)+Math.abs(this.amount)+(this.amount<0?"-":"+");if(this.family.endsWith("_PLUSPLUS_")){let t=Math.abs(this.amount);return d(this,Me).quantum.toString().slice(0,-10)+(t===1?"":t)+(this.amount<0?"--":"++")}return d(this,Me).quantum.toString()+d(this,Me).suffix()}},B=_n;Me=new WeakMap});var _2,E2,it,Ol,ct,Pl=y(()=>{Jt();Zt();bt();Yt();G0();_2=class{constructor(){this.quantumU_SQ_=null;this.quantumD_SQ_=null}format(t){let r=this.tuple(t);return r?\`(\${r.map(n=>n.amount).join(", ")})\`:null}tuple(t){this.quantumU_SQ_||(this.quantumU_SQ_=new z("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new z("D_SQ_"));let r=t.alg;if(r.experimentalNumUnits()===2){let[n,o]=r.units();if(n.as(B)?.quantum.isIdentical(this.quantumU_SQ_)&&o.as(B)?.quantum.isIdentical(this.quantumD_SQ_)){if(t.amount!==1)throw new Error("Square-1 tuples cannot have an amount other than 1.");return[n,o]}}return null}},E2=new _2,Ol=class extends Ie{constructor(t,r){super();oe(this,it,void 0);let n=cr(t);V(this,it,new En(n,r))}isIdentical(t){let r=t;return t.is(Ol)&&d(this,it).isIdentical(d(r,it))}get alg(){return d(this,it).quantum}get amount(){return d(this,it).amount}get experimentalRepetitionSuffix(){return d(this,it).suffix()}invert(){return new Ol(d(this,it).quantum,-d(this,it).amount)}*experimentalExpand(t=1,r){r??(r=1/0),r===0?yield t===1?this:this.invert():yield*d(this,it).experimentalExpand(t,r-1)}static fromString(){throw new Error("unimplemented")}toString(){return E2.format(this)??\`(\${d(this,it).quantum.toString()})\${d(this,it).suffix()}\`}experimentalAsSquare1Tuple(){return E2.tuple(this)}},ct=Ol;it=new WeakMap});var Gl=y(()=>{Pl();Eo();wo();vo();Yt();_o();ko()});function wt(e,t){return e instanceof t}function k2(e){return wt(e,ct)||wt(e,St)||wt(e,We)||wt(e,Ke)||wt(e,B)||wt(e,Xe)||wt(e,$e)}var I0=y(()=>{Gl()});function C2(e,t,r){if(t.is(ct))return e.traverseGrouping(t,r);if(t.is(B))return e.traverseMove(t,r);if(t.is(We))return e.traverseCommutator(t,r);if(t.is(Ke))return e.traverseConjugate(t,r);if(t.is($e))return e.traversePause(t,r);if(t.is(Xe))return e.traverseNewline(t,r);if(t.is(St))return e.traverseLineComment(t,r);throw new Error("unknown unit")}function P2(e){if(e.is(ct)||e.is(B)||e.is(We)||e.is(Ke)||e.is($e)||e.is(Xe)||e.is(St))return e;throw new Error("internal error: expected unit")}var kn,zn,Il,zm,K0,W0,z2,M2,Q0=y(()=>{Pl();wo();Yt();_o();ko();vo();Eo();kn=class{traverseUnit(t,r){return C2(this,t,r)}traverseIntoUnit(t,r){return P2(this.traverseUnit(t,r))}},zn=class extends kn{traverseUnit(t){return C2(this,t,void 0)}traverseIntoUnit(t){return P2(this.traverseUnit(t))}},K0=class extends kn{*traverseAlg(t,r){if(r.depth===0){yield*t.units();return}let n=[],o=null,l=r?.collapseMoves??!0;function i(f,u){var c;let g=m2(c=K0,Il,zm).call(c,f,u,r);if(g===0)return!1;let p=new B(f.quantum,g);return n.push(p),o=p,!0}function s(f){l&&o?.is(B)&&f.is(B)&&o.quantum.isIdentical(f.quantum)?(n.pop(),i(o,f.amount)||(o=n.slice(-1)[0])):f.is(B)?i(f,0):(n.push(f),o=f)}let a={depth:r.depth?r.depth-1:null};for(let f of t.units())for(let u of this.traverseUnit(f,a))s(u);for(let f of n)yield f}*traverseGrouping(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new ct(this.traverseAlg(t.alg,n))}*traverseMove(t,r){yield t}*traverseCommutator(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new We(this.traverseAlg(t.A,n),this.traverseAlg(t.B,n))}*traverseConjugate(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new Ke(this.traverseAlg(t.A,n),this.traverseAlg(t.B,n))}*traversePause(t,r){yield t}*traverseNewline(t,r){yield t}*traverseLineComment(t,r){yield t}},W0=K0;Il=new WeakSet,zm=function(t,r,n){let o=t.amount+r;if(n?.quantumMoveOrder){let l=n.quantumMoveOrder(t.quantum),i=Math.floor(l/2)+1-l;o=(o%l+l-i)%l+i}return o},oe(W0,Il);z2=new W0,M2=z2.traverseAlg.bind(z2)});function N2(e){if(!e)return[];if(wt(e,E))return e.units();if(typeof e=="string")return N0(e).units();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw new Error("Invalid unit")}function cr(e){return wt(e,E)?e:new E(e)}function Cm(e,t){return e.is(Xe)||t.is(Xe)?"":e.is(St)&&!t.is(Xe)?\`
8
- \`:" "}var st,Hr,E,Jt=y(()=>{Zt();I0();bt();T0();Q0();Eo();Yt();_o();O0();Hr=class extends Ie{constructor(t){super();oe(this,st,void 0);V(this,st,Array.from(N2(t)));for(let r of d(this,st))if(!k2(r))throw new Error("An alg can only contain units.")}isIdentical(t){let r=t;if(!t.is(Hr))return!1;let n=Array.from(d(this,st)),o=Array.from(d(r,st));if(n.length!==o.length)return!1;for(let l=0;l<n.length;l++)if(!n[l].isIdentical(o[l]))return!1;return!0}invert(){return new Hr(U2(Array.from(d(this,st)).map(t=>t.invert())))}*experimentalExpand(t=1,r){r??(r=1/0);for(let n of z0(d(this,st),t))yield*n.experimentalExpand(t,r)}expand(t){return new Hr(this.experimentalExpand(1,t?.depth??1/0))}*experimentalLeafMoves(){for(let t of this.experimentalExpand())t.is(B)&&(yield t)}concat(t){return new Hr(Array.from(d(this,st)).concat(Array.from(N2(t))))}experimentalIsEmpty(){for(let t of d(this,st))return!1;return!0}static fromString(t){return N0(t)}*units(){for(let t of d(this,st))yield t}experimentalNumUnits(){return Array.from(d(this,st)).length}get type(){return Ml("deprecated: type"),"sequence"}toString(){let t="",r=null;for(let n of d(this,st))r&&(t+=Cm(r,n)),t+=n.toString(),r=n;return t}simplify(t){return new Hr(M2(this,t??{}))}},E=Hr;st=new WeakMap});var Pm,T2=y(()=>{Jt();Gl();wo();vo();Yt();ko();Pm={Sune:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",1),new B("R",1),new B("U",-2),new B("R",-1)]),AntiSune:new E([new B("R",1),new B("U",2),new B("R",-1),new B("U",-1),new B("R",1),new B("U",-1),new B("R",-1)]),SuneCommutator:new E([new We(new E([new B("R",1),new B("U",1),new B("R",-2)]),new E([new Ke(new E([new B("R",1)]),new E([new B("U",1)]))]))]),Niklas:new E([new B("R",1),new B("U",-1),new B("L",-1),new B("U",1),new B("R",-1),new B("U",-1),new B("L",1),new B("U",1)]),EPerm:new E([new B("x",-1),new We(new E([new Ke(new E([new B("R",1)]),new E([new B("U",-1)]))]),new E([new B("D",1)])),new We(new E([new Ke(new E([new B("R",1)]),new E([new B("U",1)]))]),new E([new B("D",1)])),new B("x",1)]),FURURFCompact:new E([new Ke(new E([new B("F",1)]),new E([new We(new E([new B("U",1)]),new E([new B("R",1)]))]))]),APermCompact:new E([new Ke(new E([new B("R",2)]),new E([new We(new E([new B("F",2)]),new E([new B("R",-1),new B("B",-1),new B("R",1)]))]))]),FURURFMoves:new E([new B("F",1),new B("U",1),new B("R",1),new B("U",-1),new B("R",-1),new B("F",-1)]),TPerm:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",-1),new B("R",-1),new B("F",1),new B("R",2),new B("U",-1),new B("R",-1),new B("U",-1),new B("R",1),new B("U",1),new B("R",-1),new B("F",-1)]),HeadlightSwaps:new E([new Ke(new E([new B("F",1)]),new E([new ct(new E([new We(new E([new B("R",1)]),new E([new B("U",1)]))]),3)]))]),TriplePause:new E([new $e,new $e,new $e])}});var UA,O2=y(()=>{Yt();UA={73:new B("R"),75:new B("R'"),87:new B("B"),79:new B("B'"),83:new B("D"),76:new B("D'"),68:new B("L"),69:new B("L'"),74:new B("U"),70:new B("U'"),72:new B("F"),71:new B("F'"),78:new B("x'"),67:new B("l"),82:new B("l'"),85:new B("r"),77:new B("r'"),88:new B("d"),188:new B("d'"),84:new B("x"),89:new B("x"),66:new B("x'"),186:new B("y"),59:new B("y"),65:new B("y'"),80:new B("z"),81:new B("z'"),90:new B("M'"),190:new B("M'")}});var G2=y(()=>{});var I2=y(()=>{Jt()});var Be=y(()=>{Jt();P0();Q0();T2();O2();Gl();Yt();G2();I2();I0();bt()});function Co(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],s=r[o];if(zo(l.numOrientations,s))n[o]=i;else if(zo(l.numOrientations,i))n[o]=s;else{let a=new Array(l.numPieces);if(l.numOrientations===1){for(let f=0;f<l.numPieces;f++)a[f]=i.permutation[s.permutation[f]];n[o]={permutation:a,orientation:i.orientation}}else{let f=new Array(l.numPieces);for(let u=0;u<l.numPieces;u++)f[u]=(i.orientation[s.permutation[u]]+s.orientation[u])%l.numOrientations,a[u]=i.permutation[s.permutation[u]];n[o]={permutation:a,orientation:f}}}}return n}function j0(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],s=r[o];if(zo(l.numOrientations,s))n[o]=i;else{let a=new Array(l.numPieces);if(l.numOrientations===1){for(let f=0;f<l.numPieces;f++)a[f]=i.pieces[s.permutation[f]];n[o]={pieces:a,orientation:i.orientation}}else{let f=new Array(l.numPieces);for(let u=0;u<l.numPieces;u++)f[u]=(i.orientation[s.permutation[u]]+s.orientation[u])%l.numOrientations,a[u]=i.pieces[s.permutation[u]];n[o]={pieces:a,orientation:f}}}}return n}var Wl=y(()=>{Po()});function Mm(e){let t=W2.get(e);if(t)return t;let r=new Array(e),n=new Array(e);for(let l=0;l<e;l++)r[l]=l,n[l]=0;let o={permutation:r,orientation:n};return K2&&(Object.freeze(r),Object.freeze(n),Object.freeze(o)),W2.set(e,o),o}function Q2(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=Mm(n.numPieces);return K2&&Object.freeze(t),t}function j2(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(!n){let i=e.definition.experimentalDerivedMoves?.[r];i&&(n=e.algToTransformation(i).transformationData)}if(n)return Br(e,n,t.amount);let o=e.definition.moves[t.toString()];if(o)return o;let l=e.definition.moves[t.invert().toString()];if(l)return Br(e,l,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var K2,W2,q0=y(()=>{Po();K2=!1,W2=new Map});var ce,Kl=y(()=>{Wl();Mo();ce=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),stateData:this.stateData}}static fromTransformation(t){let r=j0(t.kpuzzle.definition,t.kpuzzle.definition.startStateData,t.transformationData);return new ce(t.kpuzzle,r)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(t.isIdentityTransformation())return new ce(this.kpuzzle,this.stateData);let r=j0(this.kpuzzle.definition,this.stateData,t.transformationData);return new ce(this.kpuzzle,r)}applyMove(t){return this.applyTransformation(this.kpuzzle.moveToTransformation(t))}applyAlg(t){return this.applyTransformation(this.kpuzzle.algToTransformation(t))}experimentalToTransformation(){if(!this.kpuzzle.canConvertStateToUniqueTransformation())return null;let t={};for(let[r,n]of Object.entries(this.stateData)){let o={permutation:n.pieces,orientation:n.orientation};t[r]=o}return new vt(this.kpuzzle,t)}experimentalIsSolved(t){if(!this.kpuzzle.definition.experimentalIsStateSolved)throw new Error("\`KState.experimentalIsSolved()\` is not supported for this puzzle at the moment.");return this.kpuzzle.definition.experimentalIsStateSolved(this,t)}}});var Zr,Rr,vt,Mo=y(()=>{Po();Wl();q0();Kl();Rr=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;oe(this,Zr,void 0)}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),transformationData:this.transformationData}}invert(){return new Rr(this.kpuzzle,V0(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return d(this,Zr)??V(this,Zr,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new Rr(t,Q2(t.definition));return V(r,Zr,!0),r}isIdentical(t){return q2(this.kpuzzle,this.transformationData,t.transformationData)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(this.kpuzzle!==t.kpuzzle)throw new Error(\`Tried to apply a transformation for a KPuzzle (\${t.kpuzzle.name()}) to a different KPuzzle (\${this.kpuzzle.name()}).\`);return d(this,Zr)?new Rr(this.kpuzzle,t.transformationData):d(t,Zr)?new Rr(this.kpuzzle,this.transformationData):new Rr(this.kpuzzle,Co(this.kpuzzle.definition,this.transformationData,t.transformationData))}applyMove(t){return this.applyTransformation(this.kpuzzle.moveToTransformation(t))}applyAlg(t){return this.applyTransformation(this.kpuzzle.algToTransformation(t))}toKState(){return ce.fromTransformation(this)}repetitionOrder(){return V2(this.kpuzzle.definition,this)}selfMultiply(t){return new Rr(this.kpuzzle,Br(this.kpuzzle,this.transformationData,t))}},vt=Rr;Zr=new WeakMap});function zo(e,t){let{permutation:r}=t,n=r.length;for(let o=0;o<n;o++)if(r[o]!==o)return!1;if(e>1){let{orientation:o}=t;for(let l=0;l<n;l++)if(o[l]!==0)return!1}return!0}function Nm(e,t,r,n={}){for(let o=0;o<e.numPieces;o++)if(!n?.ignoreOrientation&&t.orientation[o]!==r.orientation[o]||!n?.ignorePermutation&&t.permutation[o]!==r.permutation[o])return!1;return!0}function q2(e,t,r){for(let[n,o]of Object.entries(e.definition.orbits))if(!Nm(o,t[n],r[n]))return!1;return!0}function V0(e,t){let r={};for(let n in e.definition.orbits){let o=e.definition.orbits[n],l=t[n];if(zo(o.numOrientations,l))r[n]=l;else if(o.numOrientations===1){let i=new Array(o.numPieces);for(let s=0;s<o.numPieces;s++)i[l.permutation[s]]=s;r[n]={permutation:i,orientation:l.orientation}}else{let i=new Array(o.numPieces),s=new Array(o.numPieces);for(let a=0;a<o.numPieces;a++){let f=l.permutation[a];i[f]=a,s[f]=(o.numOrientations-l.orientation[a]+o.numOrientations)%o.numOrientations}r[n]={permutation:i,orientation:s}}}return r}function Br(e,t,r){if(r===1)return t;if(r<0)return Br(e,V0(e,t),-r);if(r===0){let{transformationData:l}=e.identityTransformation();return l}let n=t;r!==2&&(n=Br(e,t,Math.floor(r/2)));let o=Co(e.definition,n,n);return r%2===0?o:Co(e.definition,t,o)}function H0(e,t){return t?H0(t,e%t):e}function V2(e,t){let r=1;for(let n in e.orbits){let o=e.orbits[n],l=t.transformationData[n],i=new Array(o.numPieces);for(let s=0;s<o.numPieces;s++)if(!i[s]){let a=s,f=0,u=0;for(;i[a]=!0,f=f+l.orientation[a],u=u+1,a=l.permutation[a],a!==s;);f!==0&&(u=u*o.numOrientations/H0(o.numOrientations,f)),r=r*u/H0(r,u)}}return r}var Z2,H2,J2,Po=y(()=>{Be();Wl();Mo();Z2=class extends kn{traverseAlg(t,r){let n=null;for(let o of t.units())n?n=n.applyTransformation(this.traverseUnit(o,r)):n=this.traverseUnit(o,r);return n??r.identityTransformation()}traverseGrouping(t,r){let n=this.traverseAlg(t.alg,r);return new vt(r,Br(r,n.transformationData,t.amount))}traverseMove(t,r){return r.moveToTransformation(t)}traverseCommutator(t,r){let n=this.traverseAlg(t.A,r),o=this.traverseAlg(t.B,r);return n.applyTransformation(o).applyTransformation(n.invert()).applyTransformation(o.invert())}traverseConjugate(t,r){let n=this.traverseAlg(t.A,r),o=this.traverseAlg(t.B,r);return n.applyTransformation(o).applyTransformation(n.invert())}traversePause(t,r){return r.identityTransformation()}traverseNewline(t,r){return r.identityTransformation()}traverseLineComment(t,r){return r.identityTransformation()}},H2=new Z2,J2=H2.traverseAlg.bind(H2)});var Cn,Ql,be,Y2=y(()=>{Be();Po();q0();Kl();Mo();be=class{constructor(t,r){this.definition=t;oe(this,Cn,new Map);oe(this,Ql,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return vt.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new B(t));let r=t.toString(),n=d(this,Cn).get(r);if(n)return new vt(this,n);if(this.experimentalPGNotation){let l=this.experimentalPGNotation.lookupMove(t);if(!l)throw new Error(\`could not map to internal move: \${t}\`);return d(this,Cn).set(r,l),new vt(this,l)}let o=j2(this,t);return d(this,Cn).set(r,o),new vt(this,o)}algToTransformation(t){return typeof t=="string"&&(t=new E(t)),J2(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(E)?this.algToTransformation(t):t?.is?.(B)?this.moveToTransformation(t):t}startState(){return new ce(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return d(this,Ql)??V(this,Ql,(()=>{for(let[t,r]of Object.entries(this.definition.orbits)){let n=new Array(r.numPieces).fill(!1);for(let o of this.definition.startStateData[t].pieces)n[o]=!0;for(let o of n)if(!o)return!1}return!0})())}get state(){throw new Error("KPuzzle is now a different (stateless) class.")}reset(){throw new Error("KPuzzle is now a different (stateless) class.")}applyMove(t){throw new Error("KPuzzle is now a different class. Try \`.moveToTransformation()\` to get the transformation for a move.")}applyAlg(t){throw new Error("KPuzzle is now a different class. Try \`.algToTransformation()\` to get the transformation for an alg.")}};Cn=new WeakMap,Ql=new WeakMap});var qe=y(()=>{Y2();Kl();Mo()});var Tm,by,X2=y(()=>{Tm={"333":{puzzleID:"3x3x3",eventName:"3x3x3 Cube"},"222":{puzzleID:"2x2x2",eventName:"2x2x2 Cube"},"444":{puzzleID:"4x4x4",eventName:"4x4x4 Cube"},"555":{puzzleID:"5x5x5",eventName:"5x5x5 Cube"},"666":{puzzleID:"6x6x6",eventName:"6x6x6 Cube"},"777":{puzzleID:"7x7x7",eventName:"7x7x7 Cube"},"333bf":{puzzleID:"3x3x3",eventName:"3x3x3 Blindfolded"},"333fm":{puzzleID:"3x3x3",eventName:"3x3x3 Fewest Moves"},"333oh":{puzzleID:"3x3x3",eventName:"3x3x3 One-Handed"},clock:{puzzleID:"clock",eventName:"Clock"},minx:{puzzleID:"megaminx",eventName:"Megaminx"},pyram:{puzzleID:"pyraminx",eventName:"Pyraminx"},skewb:{puzzleID:"skewb",eventName:"Skewb"},sq1:{puzzleID:"square1",eventName:"Square-1"},"444bf":{puzzleID:"4x4x4",eventName:"4x4x4 Blindfolded"},"555bf":{puzzleID:"5x5x5",eventName:"5x5x5 Blindfolded"},"333mb":{puzzleID:"3x3x3",eventName:"3x3x3 Multi-Blind"}},by={...Tm,fto:{puzzleID:"fto",eventName:"Face-Turning Octahedron"},master_tetraminx:{puzzleID:"master_tetraminx",eventName:"Master Tetraminx"},kilominx:{puzzleID:"kilominx",eventName:"Kilominx"},redi_cube:{puzzleID:"redi_cube",eventName:"Redi Cube"}}});function Hm(e){switch(e){case"Regular":return Om;case"Dim":return jm;case"Ignored":return Gm;case"OrientationStickers":return Im;case"Invisible":return Wm;case"IgnoreNonPrimary":return Km;case"PermuteNonPrimary":return Qm;case"Ignoriented":return qm;case"OrientationWithoutPermutation":return Vm}}var Jr,Ot,Ve,Pn,jl,Yr,Om,Gm,Im,Wm,Km,Qm,jm,qm,Vm,No,To,ql=y(()=>{Jr=class{constructor(t,r){this.stickerings=new Map;for(let[n,o]of Object.entries(t.definition.orbits))this.stickerings.set(n,new Array(o.numPieces).fill(r))}},Ot="regular",Ve="ignored",Pn="oriented",jl="invisible",Yr="dim",Om={facelets:[Ot,Ot,Ot,Ot,Ot]},Gm={facelets:[Ve,Ve,Ve,Ve,Ve]},Im={facelets:[Pn,Pn,Pn,Pn,Pn]},Wm={facelets:[jl,jl,jl,jl]},Km={facelets:[Ot,Ve,Ve,Ve,Ve]},Qm={facelets:[Yr,Ot,Ot,Ot,Ot]},jm={facelets:[Yr,Yr,Yr,Yr,Yr]},qm={facelets:[Yr,Ve,Ve,Ve,Ve]},Vm={facelets:[Pn,Ve,Ve,Ve,Ve]};No=class extends Jr{constructor(t){super(t,"Regular")}set(t,r){for(let[n,o]of this.stickerings.entries())for(let l=0;l<o.length;l++)t.stickerings.get(n)[l]&&(o[l]=r);return this}toAppearance(){let t={orbits:{}};for(let[r,n]of this.stickerings.entries()){let o=[],l={pieces:o};t.orbits[r]=l;for(let i of n)o.push(Hm(i))}return t}},To=class{constructor(t){this.kpuzzle=t}and(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let l=0;l<o.numPieces;l++){r.stickerings.get(n)[l]=!0;for(let i of t)if(!i.stickerings.get(n)[l]){r.stickerings.get(n)[l]=!1;continue e}}}return r}or(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let l=0;l<o.numPieces;l++){r.stickerings.get(n)[l]=!1;for(let i of t)if(i.stickerings.get(n)[l]){r.stickerings.get(n)[l]=!0;continue e}}}return r}not(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits))for(let l=0;l<o.numPieces;l++)r.stickerings.get(n)[l]=!t.stickerings.get(n)[l];return r}all(){return this.and(this.moves([]))}move(t){let r=this.kpuzzle.moveToTransformation(t),n=new Jr(this.kpuzzle,!1);for(let[o,l]of Object.entries(this.kpuzzle.definition.orbits))for(let i=0;i<l.numPieces;i++)(r.transformationData[o].permutation[i]!==i||r.transformationData[o].orientation[i]!==0)&&(n.stickerings.get(o)[i]=!0);return n}moves(t){return t.map(r=>this.move(r))}orbits(t){let r=new Jr(this.kpuzzle,!1);for(let n of t)r.stickerings.get(n).fill(!0);return r}}});var Z0,J0=y(()=>{Z0={full:{groups:{"3x3x3":"Stickering"}},OLL:{groups:{"3x3x3":"Last Layer"}},PLL:{groups:{"3x3x3":"Last Layer"}},LL:{groups:{"3x3x3":"Last Layer"}},COLL:{groups:{"3x3x3":"Last Layer"}},OCLL:{groups:{"3x3x3":"Last Layer"}},CLL:{groups:{"3x3x3":"Last Layer"}},ELL:{groups:{"3x3x3":"Last Layer"}},ZBLL:{groups:{"3x3x3":"Last Layer"}},LS:{groups:{"3x3x3":"Last Slot"}},ELS:{groups:{"3x3x3":"Last Slot"}},CLS:{groups:{"3x3x3":"Last Slot"}},ZBLS:{groups:{"3x3x3":"Last Slot"}},VLS:{groups:{"3x3x3":"Last Slot"}},WVLS:{groups:{"3x3x3":"Last Slot"}},F2L:{groups:{"3x3x3":"CFOP (Fridrich)"}},Daisy:{groups:{"3x3x3":"CFOP (Fridrich)"}},Cross:{groups:{"3x3x3":"CFOP (Fridrich)"}},EO:{groups:{"3x3x3":"ZZ"}},EOline:{groups:{"3x3x3":"ZZ"}},EOcross:{groups:{"3x3x3":"ZZ"}},CMLL:{groups:{"3x3x3":"Roux"}},L10P:{groups:{"3x3x3":"Roux"}},L6E:{groups:{"3x3x3":"Roux"}},L6EO:{groups:{"3x3x3":"Roux"}},"2x2x2":{groups:{"3x3x3":"Petrus"}},"2x2x3":{groups:{"3x3x3":"Petrus"}},"Void Cube":{groups:{"3x3x3":"Miscellaneous"}},invisible:{groups:{"3x3x3":"Miscellaneous"}},picture:{groups:{"3x3x3":"Miscellaneous"}},"centers-only":{groups:{"3x3x3":"Miscellaneous"}},"experimental-centers-U":{},"experimental-centers-U-D":{},"experimental-centers-U-L-D":{},"experimental-centers-U-L-B-D":{},"experimental-centers":{},"experimental-fto-fc":{groups:{fto:"Bencisco"}},"experimental-fto-f2t":{groups:{fto:"Bencisco"}},"experimental-fto-sc":{groups:{fto:"Bencisco"}},"experimental-fto-l2c":{groups:{fto:"Bencisco"}},"experimental-fto-lbt":{groups:{fto:"Bencisco"}},"experimental-fto-l3t":{groups:{fto:"Bencisco"}}}});async function $t(e,t){let r=await e.kpuzzle(),n=new No(r),o=new To(r),l=()=>o.move("U"),i=()=>o.or(o.moves(["U","D"])),s=()=>o.or(o.moves(["L","R"])),a=()=>o.not(s()),f=()=>o.not(l()),u=()=>o.and([l(),o.orbits(["CENTERS"])]),g=()=>o.orbits(["CENTERS"]),p=()=>o.orbits(["EDGES"]),c=()=>o.orbits(["CORNERS"]),L=()=>o.or([a(),o.and([l(),p()])]),m=()=>o.and([o.and(o.moves(["F","R"])),p()]),R=()=>o.and([o.and(o.moves(["F","R"])),c(),o.not(l())]),F=()=>o.or([R(),m()]);function A(){n.set(f(),"Dim")}function U(){n.set(l(),"PermuteNonPrimary"),n.set(u(),"Dim")}function b(){n.set(l(),"IgnoreNonPrimary"),n.set(u(),"Regular")}function S(){n.set(l(),"Ignoriented"),n.set(u(),"Dim")}switch(t){case"full":break;case"PLL":A(),U();break;case"CLS":A(),n.set(R(),"Regular"),n.set(l(),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"OLL":A(),b();break;case"COLL":A(),n.set(o.and([l(),p()]),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"Regular");break;case"OCLL":A(),S(),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"CLL":A(),n.set(o.not(o.and([c(),l()])),"Dim");break;case"ELL":A(),n.set(l(),"Dim"),n.set(o.and([l(),p()]),"Regular");break;case"ELS":A(),b(),n.set(o.and([l(),c()]),"Ignored"),n.set(m(),"Regular"),n.set(R(),"Ignored");break;case"LL":A();break;case"F2L":n.set(l(),"Ignored");break;case"ZBLL":A(),n.set(l(),"PermuteNonPrimary"),n.set(u(),"Dim"),n.set(o.and([l(),c()]),"Regular");break;case"ZBLS":A(),n.set(F(),"Regular"),b(),n.set(o.and([l(),c()]),"Ignored");break;case"VLS":A(),n.set(F(),"Regular"),b();break;case"WVLS":A(),n.set(F(),"Regular"),n.set(o.and([l(),p()]),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"LS":A(),n.set(F(),"Regular"),n.set(l(),"Ignored"),n.set(u(),"Dim");break;case"EO":n.set(c(),"Ignored"),n.set(p(),"OrientationWithoutPermutation");break;case"EOline":n.set(c(),"Ignored"),n.set(p(),"OrientationWithoutPermutation"),n.set(o.and(o.moves(["D","M"])),"Regular");break;case"EOcross":n.set(p(),"OrientationWithoutPermutation"),n.set(o.move("D"),"Regular"),n.set(c(),"Ignored");break;case"CMLL":n.set(f(),"Dim"),n.set(L(),"Ignored"),n.set(o.and([l(),c()]),"Regular");break;case"L10P":n.set(o.not(L()),"Dim"),n.set(o.and([c(),l()]),"Regular");break;case"L6E":n.set(o.not(L()),"Dim");break;case"L6EO":n.set(o.not(L()),"Dim"),n.set(L(),"OrientationWithoutPermutation"),n.set(o.and([g(),i()]),"OrientationStickers");break;case"Daisy":n.set(o.all(),"Ignored"),n.set(g(),"Dim"),n.set(o.and([o.move("D"),g()]),"Regular"),n.set(o.and([o.move("U"),p()]),"IgnoreNonPrimary");break;case"Cross":n.set(o.all(),"Ignored"),n.set(g(),"Dim"),n.set(o.and([o.move("D"),g()]),"Regular"),n.set(o.and([o.move("D"),p()]),"Regular");break;case"2x2x2":n.set(o.or(o.moves(["U","F","R"])),"Ignored"),n.set(o.and([o.or(o.moves(["U","F","R"])),g()]),"Dim");break;case"2x2x3":n.set(o.all(),"Dim"),n.set(o.or(o.moves(["U","F","R"])),"Ignored"),n.set(o.and([o.or(o.moves(["U","F","R"])),g()]),"Dim"),n.set(o.and([o.move("F"),o.not(o.or(o.moves(["U","R"])))]),"Regular");break;case"Void Cube":n.set(g(),"Invisible");break;case"picture":case"invisible":n.set(o.all(),"Invisible");break;case"centers-only":n.set(o.not(g()),"Ignored");break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),"Dim")}return n.toAppearance()}async function Mn(){let e=[];for(let[t,r]of Object.entries(Z0))r.groups&&"3x3x3"in r.groups&&e.push(t);return e}var Oo=y(()=>{ql();J0()});function he(e){let t=null;return()=>t??(t=e())}var Gt=y(()=>{});var Go,$2=y(()=>{Go=class{constructor(t,r){this.facenames=t;this.prefixFree=!0;this.gripnames=[];r&&(this.gripnames=r);for(let n=0;this.prefixFree&&n<t.length;n++)for(let o=0;this.prefixFree&&o<t.length;o++)n!==o&&t[n].startsWith(t[o])&&(this.prefixFree=!1)}setGripNames(t){this.gripnames=t}splitByFaceNames(t){let r=[],n=0;for(;n<t.length;){n>0&&n<t.length&&t[n]==="_"&&n++;let o=-1;for(let l=0;l<this.facenames.length;l++)t.substr(n).startsWith(this.facenames[l])&&(o<0||this.facenames[l].length>this.facenames[o].length)&&(o=l);if(o>=0)r.push(o),n+=this.facenames[o].length;else throw new Error("Could not split "+t+" into face names.")}return r}joinByFaceIndices(t){let r="",n=[];for(let o=0;o<t.length;o++)n.push(r),n.push(this.facenames[t[o]]),this.prefixFree||(r="_");return n.join("")}spinmatch(t,r){if(t===r)return!0;try{let n=this.splitByFaceNames(t),o=this.splitByFaceNames(r);if(n.length!==o.length&&n.length<3)return!1;for(let l=0;l<n.length;l++){for(let s=0;s<l;s++)if(n[l]===n[s])return!1;let i=!1;for(let s=0;s<o.length;s++)if(n[l]===o[s]){i=!0;break}if(!i)return!1}return!0}catch{return!1}}spinmatchv(t,r){return t.endsWith("v")&&r.endsWith("v")?this.spinmatch(t.slice(0,t.length-1),r.slice(0,r.length-1)):this.spinmatch(t,r)}unswizzle(t){(t.endsWith("v")||t.endsWith("w"))&&t[0]<="Z"&&(t=t.slice(0,t.length-1));let r=t.toUpperCase();for(let n=0;n<this.gripnames.length;n++){let o=this.gripnames[n];if(this.spinmatch(r,o))return o}return t}}});var Nn,ef=y(()=>{Nn=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var Vl,tf=y(()=>{Be();Vl=class{constructor(t,r){this.child=t;this.sw=r}notationToInternal(t){return t.family==="T"&&t.innerLayer===void 0&&t.outerLayer===void 0?new B(new z("FLRv",t.innerLayer,t.outerLayer),t.amount):this.child.notationToInternal(t)}notationToExternal(t){let r=t.family;return r.length>0&&r[r.length-1]==="v"&&(r=r.substring(0,r.length-1)),this.sw.spinmatch(r,"FLUR")?new B(new z("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var Io,rf=y(()=>{Be();Io=class{constructor(t,r){this.internalNames=t;this.externalNames=r}convertString(t,r,n){let o="";(t.endsWith("v")||t.endsWith("v"))&&t<="_"&&(o=t.slice(t.length-1),t=t.slice(0,t.length-1));let l=t.toUpperCase(),i=!1;return t!==l&&(i=!0,t=l),t=n.joinByFaceIndices(r.splitByFaceNames(t)),i&&(t=t.toLowerCase()),t+o}convert(t,r,n){let o=t.family,l=this.convertString(o,r,n);return o===l?t:new B(new z(l,t.innerLayer,t.outerLayer),t.amount)}notationToInternal(t){return this.convert(t,this.externalNames,this.internalNames)}notationToExternal(t){return this.convert(t,this.internalNames,this.externalNames)}}});var Hl,nf=y(()=>{Be();Hl=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer===void 0&&t.outerLayer===void 0){if(Math.abs(t.amount)===1){if(t.family==="R++")return new B(new z("L",3,2),-2*t.amount);if(t.family==="R--")return new B(new z("L",3,2),2*t.amount);if(t.family==="D++")return new B(new z("U",3,2),-2*t.amount);if(t.family==="D--")return new B(new z("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new B(new z("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new B(new z("U",3,2),-2*t.amount)}if(t.family==="y")return new B("Uv",t.amount);if(t.family==="x"&&Math.abs(t.amount)===2)return new B("ERv",t.amount/2)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="ERv"&&Math.abs(t.amount)===1?new B(new z("x",t.innerLayer,t.outerLayer),t.amount*2):t.family==="ILv"&&Math.abs(t.amount)===1?new B(new z("x",t.innerLayer,t.outerLayer),-t.amount*2):t.family==="Uv"?new B(new z("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new B("y",-t.amount):this.child.notationToExternal(t)}}});var Zl,of=y(()=>{Be();Zl=class{constructor(t){this.slices=t}notationToInternal(t){let r=t.family;return!t.innerLayer&&!t.outerLayer&&(r==="x"?t=new B("Rv",t.amount):r==="y"?t=new B("Uv",t.amount):r==="z"&&(t=new B("Fv",t.amount)),(this.slices&1)===1&&(r==="E"?t=new B(new z("D",(this.slices+1)/2),t.amount):r==="M"?t=new B(new z("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new B(new z("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new B(new z("D",this.slices-1,2),t.amount):r==="m"?t=new B(new z("L",this.slices-1,2),t.amount):r==="s"&&(t=new B(new z("F",this.slices-1,2),t.amount)))),t}notationToExternal(t){let r=t.family;if(!t.innerLayer&&!t.outerLayer){if(r==="Rv")return new B("x",t.amount);if(r==="Uv")return new B("y",t.amount);if(r==="Fv")return new B("z",t.amount);if(r==="Lv")return new B("x",-t.amount);if(r==="Dv")return new B("y",-t.amount);if(r==="Bv")return new B("z",-t.amount)}return t}}});var Jm,Ym,lf,sf,af,Wo,Jl,ff=y(()=>{Be();Jm={U:"frl",L:"fld",R:"fdr",B:"dlr",u:"FRL",l:"FLD",r:"FDR",b:"DLR",Uv:"FRLv",Lv:"FLDv",Rv:"FDRv",Bv:"DLRv",D:"D",F:"F",BL:"L",BR:"R"},Ym={U:"FRL",L:"FLD",R:"FDR",B:"DLR",u:"frl",l:"fld",r:"fdr",b:"dlr",Uv:"FRLv",Lv:"FLDv",Rv:"FDRv",Bv:"DLRv",D:"D",F:"F",BL:"L",BR:"R",d:"d",f:"f",bl:"l",br:"r"},lf={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},sf=new z("y"),af=new z("Dv"),Wo=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=Jm}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=lf[t.family];if(n)return new B(new z(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new B(new z(r,t.innerLayer,t.outerLayer),t.amount):sf.isIdentical(t.quantum)?new B(af,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(lf))if(this.child.spinmatch(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount)}for(let[r,n]of Object.entries(this.map))if(this.child.spinmatch(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount);return af.isIdentical(t.quantum)?new B(sf,-t.amount):null}},Jl=class extends Wo{constructor(t){super(t);this.wcaHack=!0;this.map=Ym}}});var uf,Y0,gf,Xm,X0,pf,$m,$0,cf,eL,Yl,mf=y(()=>{Be();uf={U:"UBL",UL:"ULF",F:"UFR",UR:"URB",B:"DBL",D:"DFR",L:"DLF",R:"DRB",Uv:"UBLv",ULv:"ULFv",Fv:"UFRv",URv:"URBv",Bv:"DBLv",Dv:"DFRv",Lv:"DLFv",Rv:"DRBv"},Y0=new z("x"),gf=new z("Rv"),Xm=new z("Lv"),X0=new z("y"),pf=new z("Uv"),$m=new z("Dv"),$0=new z("z"),cf=new z("Fv"),eL=new z("Bv"),Yl=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=uf[t.family];return r?new B(new z(r,t.outerLayer,t.innerLayer),t.amount):Y0.isIdentical(t.quantum)?new B(gf,t.amount):X0.isIdentical(t.quantum)?new B(pf,t.amount):$0.isIdentical(t.quantum)?new B(cf,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(uf))if(this.child.spinmatchv(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount);return gf.isIdentical(t.quantum)?new B(Y0,t.amount):Xm.isIdentical(t.quantum)?new B(Y0,-t.amount):pf.isIdentical(t.quantum)?new B(X0,t.amount):$m.isIdentical(t.quantum)?new B(X0,-t.amount):cf.isIdentical(t.quantum)?new B($0,t.amount):eL.isIdentical(t.quantum)?new B($0,-t.amount):null}}});var es=y(()=>{ef();tf();rf();nf();of();ff();mf()});function Lf(e){let t=0,r={};for(;t<e.length&&e[t][0]==="-";){let o=e[t++];if(o==="--rotations")r.addRotations=!0;else if(o==="--allmoves")r.allMoves=!0;else if(o==="--outerblockmoves")r.outerBlockMoves=!0;else if(o==="--vertexmoves")r.vertexMoves=!0;else if(o==="--nocorners")r.includeCornerOrbits=!1;else if(o==="--noedges")r.includeEdgeOrbits=!1;else if(o==="--noorientation")r.fixedOrientation=!0;else if(o==="--nocenters")r.includeCenterOrbits=!1;else if(o==="--omit")r.excludeOrbits=e[t].split(","),t++;else if(o==="--moves")r.moveList=e[t].split(","),t++;else if(o==="--optimize")r.optimizeOrbits=!0;else if(o==="--scramble")r.scrambleAmount=100;else if(o==="--fixcorner")r.fixedPieceType="v";else if(o==="--fixedge")r.fixedPieceType="e";else if(o==="--fixcenter")r.fixedPieceType="f";else if(o==="--orientcenters")r.orientCenters=!0;else if(o==="--puzzleorientation")r.puzzleOrientation=JSON.parse(e[t]),t++;else throw new Error("Bad option: "+o)}return{puzzleDescription:Ko(e.slice(t).join(" ")),options:r}}var ts,rs=y(()=>{Qo();ts=class{constructor(t={}){this.verbosity=0;this.allMoves=!1;this.vertexMoves=!1;this.addRotations=!1;this.moveList=null;this.fixedOrientation=!1;this.fixedPieceType=null;this.orientCenters=!1;this.includeCornerOrbits=!0;this.includeCenterOrbits=!0;this.includeEdgeOrbits=!0;this.excludeOrbits=[];this.optimizeOrbits=!1;this.grayCorners=!1;this.grayCenters=!1;this.grayEdges=!1;this.puzzleOrientation=null;this.puzzleOrientations=null;this.scrambleAmount=0;Object.assign(this,t)}}});function dr(e){if(!ns[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;ns[e]=t}return ns[e]}function It(e){if(!os[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;os[e]=t}return os[e]}function Bf(e){return new dt(It(e))}function Rf(e){let t=1n;for(;e>1;)t*=BigInt(e),e--;return t}function tL(e,t){if(e>t){let r=e;e=t,t=r}for(;e>0;){let r=t%e;t=e,e=r}return t}function ls(e,t){return e/tL(e,t)*t}var ns,os,dt,Xl=y(()=>{ns=[],os=[];dt=class{constructor(t){this.n=t.length,this.p=t}toString(){return"Perm["+this.p.join(" ")+"]"}mul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=t.p[this.p[n]];return new dt(r)}rmul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=this.p[t.p[n]];return new dt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new dt(t)}compareTo(t){for(let r=0;r<this.n;r++)if(this.p[r]!==t.p[r])return this.p[r]-t.p[r];return 0}toGap(){let t=new Array,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let o=new Array;for(let l=n;!r[l];l=this.p[l])o.push(1+l),r[l]=!0;t.push("("+o.join(",")+")")}return t.join("")}order(){let t=1,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let o=0;for(let l=n;!r[l];l=this.p[l])o++,r[l]=!0;t=ls(t,o)}return t}}});function $l(e,t){let r=B.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function df(e,t){let r=e.moveops.length;if(r>30)throw new Error("Canon info too big for bitmask");let n=[],o=[];for(let i=0;i<r;i++){let s=e.moveops[i];n.push(s.order());let a=0;for(let f=0;f<r;f++){if(f===i)continue;let u=e.moveops[f];s.mul(u).equal(u.mul(s))&&(a|=1<<f)}o.push(a)}let l={};l[0]=1;for(let i=0;i<100;i++){let s=0,a={},f=0;for(let u in l){let g=+u,p=l[g];s+=p,f++;for(let c=0;c<n.length;c++)if((g>>c&1)===0&&(g&o[c]&(1<<c)-1)===0){let L=g&o[c]|1<<c;a[L]===void 0&&(a[L]=0),a[L]+=(n[c]-1)*p}}t(\`\${i}: canonseq \${s} states \${f}\`),l=a}}var jo,rL,Tn,Et,er,ss,hr,On,is,hf=y(()=>{Be();es();Xl();jo=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return Rf(this.size)*BigInt(this.mod)**BigInt(this.size)}},rL=0;Tn=class{constructor(t,r,n,o,l,i,s){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=o;this.moveops=l;this.isRotation=i;this.forcenames=s}transformToKTransformationData(t){let r={};for(let n=0;n<this.orbitnames.length;n++)r[this.orbitnames[n]]=t.orbits[n].toKPuzzle();return r}static transformToKTransformationData(t,r){let n={};for(let o=0;o<t.length;o++)n[t[o]]=r.orbits[o].toKPuzzle();return n}describeSet(t,r,n){let o=this.orbitdefs[t].size,l=new Array(o);for(let i=0;i<o;i++)l[i]=[];for(let i=0;i<this.movenames.length;i++){if(this.isRotation[i])continue;let s=this.movenames[i];this.forcenames[i]||(s=$l(n,s),s[s.length-1]==="'"&&(s=s.substring(0,s.length-1)));let a=this.moveops[i].orbits[t];for(let f=0;f<o;f++)(a.perm[f]!=f||a.ori[f]!=0)&&l[f].push(s)}for(let i=0;i<o;i++)r.push("# "+(i+1)+" "+l[i].join(" "))}toKsolve(t,r=new Nn){let n=[];n.push("Name "+t),n.push("");for(let o=0;o<this.orbitnames.length;o++)n.push(\`Set \${this.orbitnames[o]} \${this.orbitdefs[o].size} \${this.orbitdefs[o].mod}\`),this.describeSet(o,n,r);n.push(""),n.push("Solved");for(let o=0;o<this.orbitnames.length;o++)this.solved.orbits[o].appendDefinition(n,this.orbitnames[o],!1,!1);n.push("End");for(let o=0;o<this.movenames.length;o++){n.push("");let l=this.movenames[o];this.forcenames[o]||(l=$l(r,this.movenames[o]));let i=!1;l[l.length-1]==="'"&&(i=!0,l=l.substring(0,l.length-1)),n.push("Move "+l);for(let s=0;s<this.orbitnames.length;s++)i?this.moveops[o].orbits[s].inv().appendDefinition(n,this.orbitnames[s],!0):this.moveops[o].orbits[s].appendDefinition(n,this.orbitnames[s],!0);n.push("End")}return n}toKPuzzleDefinition(t){let r={},n={};for(let l=0;l<this.orbitnames.length;l++){r[this.orbitnames[l]]={numPieces:this.orbitdefs[l].size,numOrientations:this.orbitdefs[l].mod};let i=this.solved.orbits[l].toKPuzzle();n[this.orbitnames[l]]={pieces:i.permutation,orientation:i.orientation}}let o={};if(t)for(let l=0;l<this.movenames.length;l++)o[this.movenames[l]]=this.transformToKTransformationData(this.moveops[l]);return{name:\`PG3D #\${++rL}\`,orbits:r,startStateData:n,moves:o}}optimize(){let t=[],r=[],n=[],o=[];for(let l=0;l<this.moveops.length;l++)o.push([]);for(let l=0;l<this.orbitdefs.length;l++){let i=this.orbitdefs[l].mod,s=this.orbitdefs[l].size,a=new is(s),f=new Array(this.orbitdefs[l].size);for(let c=0;c<s;c++)f[c]=!1;for(let c=0;c<this.moveops.length;c++)if(!this.isRotation[c])for(let L=0;L<s;L++)(this.moveops[c].orbits[l].perm[L]!==L||this.moveops[c].orbits[l].ori[L]!==0)&&(f[L]=!0,a.union(L,this.moveops[c].orbits[l].perm[L]));let u=!0;if(i>1){u=!1;let c=new is(this.orbitdefs[l].size*i);for(let L=0;L<this.moveops.length;L++)for(let m=0;m<s;m++)if(this.moveops[L].orbits[l].perm[m]!==m||this.moveops[L].orbits[l].ori[m]!==0)for(let R=0;R<i;R++)c.union(m*i+R,this.moveops[L].orbits[l].perm[m]*i+(R+this.moveops[L].orbits[l].ori[m])%i);for(let L=0;!u&&L<s;L++)for(let m=1;m<i;m++)c.find(L*i)===c.find(L*i+m)&&(u=!0);for(let L=0;!u&&L<s;L++)for(let m=0;m<L;m++)this.solved.orbits[l].perm[L]===this.solved.orbits[l].perm[m]&&(u=!0)}let g=-1,p=!1;for(let c=0;c<this.orbitdefs[l].size;c++)if(f[c]){let L=a.find(c);g<0?g=L:g!==L&&(p=!0)}for(let c=0;c<this.orbitdefs[l].size;c++){if(!f[c]||a.find(c)!==c)continue;let m=[],R=[],F=0;for(let A=0;A<this.orbitdefs[l].size;A++)a.find(A)===c&&(m[F]=A,R[A]=F,F++);if(p?t.push(\`\${this.orbitnames[l]}_p\${c}\`):t.push(this.orbitnames[l]),u){r.push(new jo(F,this.orbitdefs[l].mod)),n.push(this.solved.orbits[l].remapVS(m,F));for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(m,R,F))}else{r.push(new jo(F,1)),n.push(this.solved.orbits[l].remapVS(m,F).killOri());for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(m,R,F).killOri())}}}return new Tn(t,r,new On(n),this.movenames,o.map(l=>new hr(l)),this.isRotation,this.forcenames)}scramble(t){this.solved=this.solved.mul(this.getScrambleTransformation(t))}getScrambleTransformation(t){t<100&&(t=100);let r=[];for(let o=0;o<this.moveops.length;o++)r[o]=this.moveops[o];for(let o=0;o<r.length;o++){let l=Math.floor(Math.random()*r.length),i=r[o];r[o]=r[l],r[l]=i}t<r.length&&(t=r.length);for(let o=0;o<t;o++){let l=Math.floor(Math.random()*r.length),i=Math.floor(Math.random()*r.length),s=Math.floor(Math.random()*this.moveops.length);r[l]=r[l].mul(r[i]).mul(this.moveops[s]),Math.random()<.1&&(r[l]=r[l].mul(this.moveops[s]))}let n=r[0];for(let o=1;o<r.length;o++)n=n.mul(r[o]);return n}reassemblySize(){let t=1n;for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},Et=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new Et(It(t),dr(t),r)}mul(t){let r=this.perm.length,n=new Array(r);if(this.orimod===1){for(let o=0;o<r;o++)n[o]=this.perm[t.perm[o]];return new Et(n,this.ori,this.orimod)}else{let o=new Array(r);for(let l=0;l<r;l++)n[l]=this.perm[t.perm[l]],o[l]=(this.ori[t.perm[l]]+t.ori[l])%this.orimod;return new Et(n,o,this.orimod)}}inv(){let t=this.perm.length,r=new Array(t),n=new Array(t);for(let o=0;o<t;o++)r[this.perm[o]]=o,n[this.perm[o]]=(this.orimod-this.ori[o])%this.orimod;return new Et(r,n,this.orimod)}equal(t){let r=this.perm.length;for(let n=0;n<r;n++)if(this.perm[n]!==t.perm[n]||this.ori[n]!==t.ori[n])return!1;return!0}killOri(){let t=this.perm.length;for(let r=0;r<t;r++)this.ori[r]=0;return this.orimod=1,this}toPerm(){let t=this.orimod;if(t===1)return new dt(this.perm);let r=this.perm.length,n=new Array(r*t);for(let o=0;o<r;o++)for(let l=0;l<t;l++)n[o*t+l]=t*this.perm[o]+(this.ori[o]+l)%t;return new dt(n)}identicalPieces(){let t=[],r=this.perm.length,n=[];for(let o=0;o<r;o++){let l=this.perm[o];if(t[l]===void 0){let i=[o];t[l]=!0;for(let s=o+1;s<r;s++)this.perm[s]===l&&i.push(s);n.push(i)}}return n}order(){return this.toPerm().order()}isIdentity(){let t=this.perm.length;if(this.perm===It(t)&&this.ori===dr(t))return!0;for(let r=0;r<t;r++)if(this.perm[r]!==r||this.ori[r]!==0)return!1;return!0}zeroOris(){let t=this.perm.length;if(this.ori===dr(t))return!0;for(let r=0;r<t;r++)if(this.ori[r]!==0)return!1;return!0}remap(t,r,n){let o=new Array(n),l=new Array(n);for(let i=0;i<n;i++)o[i]=r[this.perm[t[i]]],l[i]=this.ori[t[i]];return new Et(o,l,this.orimod)}remapVS(t,r){let n=new Array(r),o=new Array(r),l=0,i=[];for(let s=0;s<r;s++){let a=this.perm[t[s]];i[a]===void 0&&(i[a]=l++),n[s]=i[a],o[s]=this.ori[t[s]]}return new Et(n,o,this.orimod)}appendDefinition(t,r,n,o=!0){if(!(o&&this.isIdentity())&&(t.push(r),t.push(this.perm.map(l=>l+1).join(" ")),!this.zeroOris()))if(n){let l=new Array(this.ori.length);for(let i=0;i<l.length;i++)l[this.perm[i]]=this.ori[i];t.push(l.join(" "))}else t.push(this.ori.join(" "))}toKPuzzle(){let t=this.perm.length;return this.isIdentity()?(Et.kcache[t]||(Et.kcache[t]={permutation:It(t),orientation:dr(t)}),Et.kcache[t]):{permutation:this.perm,orientation:this.ori}}},er=Et;er.kcache=[];ss=class{constructor(t){this.orbits=t}internalMul(t){let r=[];for(let n=0;n<this.orbits.length;n++)r.push(this.orbits[n].mul(t.orbits[n]));return r}internalInv(){let t=[];for(let r of this.orbits)t.push(r.inv());return t}equal(t){for(let r=0;r<this.orbits.length;r++)if(!this.orbits[r].equal(t.orbits[r]))return!1;return!0}killOri(){for(let t of this.orbits)t.killOri();return this}toPerm(){let t=new Array,r=0;for(let o of this.orbits){let l=o.toPerm();t.push(l),r+=l.n}let n=new Array(r);r=0;for(let o of t){for(let l=0;l<o.n;l++)n[r+l]=r+o.p[l];r+=o.n}return new dt(n)}identicalPieces(){let t=[],r=0;for(let n of this.orbits){let o=n.orimod,l=n.identicalPieces();for(let i=0;i<l.length;i++)t.push(l[i].map(s=>s*o+r));r+=o*n.perm.length}return t}order(){let t=1;for(let r of this.orbits)t=ls(t,r.order());return t}},hr=class extends ss{constructor(t){super(t)}mul(t){return new hr(this.internalMul(t))}mulScalar(t){if(t===0)return this.e();let r=this;for(t<0&&(r=r.inv(),t=-t);(t&1)===0;)r=r.mul(r),t>>=1;if(t===1)return r;let n=r,o=this.e();for(;t>0;)t&1&&(o=o.mul(n)),t>1&&(n=n.mul(n)),t>>=1;return o}inv(){return new hr(this.internalInv())}e(){return new hr(this.orbits.map(t=>er.e(t.perm.length,t.orimod)))}},On=class extends ss{constructor(t){super(t)}mul(t){return new On(this.internalMul(t))}},is=class{constructor(t){this.n=t;this.heads=new Array(t);for(let r=0;r<t;r++)this.heads[r]=r}find(t){let r=this.heads[t];return this.heads[r]===r||(r=this.find(this.heads[r]),this.heads[t]=r),r}union(t,r){let n=this.find(t),o=this.find(r);n<o?this.heads[o]=n:n>o&&(this.heads[n]=o)}}});var ei,Ff=y(()=>{ei={"2x2x2":"c f 0","3x3x3":"c f 0.333333333333333","4x4x4":"c f 0.5 f 0","5x5x5":"c f 0.6 f 0.2","6x6x6":"c f 0.666666666666667 f 0.333333333333333 f 0","7x7x7":"c f 0.714285714285714 f 0.428571428571429 f 0.142857142857143","8x8x8":"c f 0.75 f 0.5 f 0.25 f 0","9x9x9":"c f 0.777777777777778 f 0.555555555555556 f 0.333333333333333 f 0.111111111111111","10x10x10":"c f 0.8 f 0.6 f 0.4 f 0.2 f 0","11x11x11":"c f 0.818181818181818 f 0.636363636363636 f 0.454545454545455 f 0.272727272727273 f 0.0909090909090909","12x12x12":"c f 0.833333333333333 f 0.666666666666667 f 0.5 f 0.333333333333333 f 0.166666666666667 f 0","13x13x13":"c f 0.846153846153846 f 0.692307692307692 f 0.538461538461538 f 0.384615384615385 f 0.230769230769231 f 0.0769230769230769","20x20x20":"c f 0 f .1 f .2 f .3 f .4 f .5 f .6 f .7 f .8 f .9","30x30x30":"c f 0 f .066667 f .133333 f .2 f .266667 f .333333 f .4 f .466667 f .533333 f .6 f .666667 f .733333 f .8 f .866667 f .933333","40x40x40":"c f 0 f .05 f .1 f .15 f .2 f .25 f .3 f .35 f .4 f .45 f .5 f .55 f .6 f .65 f .7 f .75 f .8 f .85 f .9 f .95",skewb:"c v 0","master skewb":"c v 0.275","professor skewb":"c v 0 v 0.38","compy cube":"c v 0.915641442663986",helicopter:"c e 0.707106781186547","curvy copter":"c e 0.83",dino:"c v 0.577350269189626","little chop":"c e 0",pyramorphix:"t e 0",mastermorphix:"t e 0.346184634065199",pyraminx:"t v 0.333333333333333 v 1.66666666666667",tetraminx:"t v 0.333333333333333","master pyraminx":"t v 0 v 1 v 2","master tetraminx":"t v 0 v 1","professor pyraminx":"t v -0.2 v 0.6 v 1.4 v 2.2","professor tetraminx":"t v -0.2 v 0.6 v 1.4","Jing pyraminx":"t f 0","master pyramorphix":"t e 0.866025403784437",megaminx:"d f 0.7",gigaminx:"d f 0.64 f 0.82",teraminx:"d f 0.64 f 0.76 f 0.88",petaminx:"d f 0.64 f 0.73 f 0.82 f 0.91",examinx:"d f 0.64 f 0.712 f 0.784 f 0.856 f 0.928",zetaminx:"d f 0.64 f 0.7 f 0.76 f 0.82 f 0.88 f 0.94",yottaminx:"d f 0.64 f 0.6914 f 0.7429 f 0.7943 f 0.8457 f 0.8971 f 0.9486",pentultimate:"d f 0","master pentultimate":"d f 0.1","elite pentultimate":"d f 0 f 0.145905",starminx:"d v 0.937962370425399","starminx 2":"d f 0.23606797749979","pyraminx crystal":"d f 0.447213595499989",chopasaurus:"d v 0","big chop":"d e 0","skewb diamond":"o f 0",FTO:"o f 0.333333333333333","master FTO":"o f 0.5 f 0","Christopher's jewel":"o v 0.577350269189626",octastar:"o e 0","Trajber's octahedron":"o v 0.433012701892219","radio chop":"i f 0",icosamate:"i v 0","icosahedron 2":"i v 0.18759247376021","icosahedron 3":"i v 0.18759247376021 e 0","icosahedron static faces":"i v 0.84","icosahedron moving faces":"i v 0.73","Eitan's star":"i f 0.61803398874989","2x2x2 + dino":"c f 0 v 0.577350269189626","2x2x2 + little chop":"c f 0 e 0","dino + little chop":"c v 0.577350269189626 e 0","2x2x2 + dino + little chop":"c f 0 v 0.577350269189626 e 0","megaminx + chopasaurus":"d f 0.61803398875 v 0","starminx combo":"d f 0.23606797749979 v 0.937962370425399"}});function ti(e){let t=new W(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function Df(e,t,r,n){let o=n[e].intersect3(n[t],n[r]);if(!o)return o;for(let l=0;l<n.length;l++)if(l!==e&&l!==t&&l!==r){let i=n[l].b*o.b+n[l].c*o.c+n[l].d*o.d;if(n[l].a>0&&i>n[l].a||n[l].a<0&&i<n[l].a)return!1}return o}var W,ri=y(()=>{W=class{constructor(t,r,n,o){this.a=t;this.b=r;this.c=n;this.d=o}mul(t){return new W(this.a*t.a-this.b*t.b-this.c*t.c-this.d*t.d,this.a*t.b+this.b*t.a+this.c*t.d-this.d*t.c,this.a*t.c-this.b*t.d+this.c*t.a+this.d*t.b,this.a*t.d+this.b*t.c-this.c*t.b+this.d*t.a)}toString(){return\`Q[\${this.a},\${this.b},\${this.c},\${this.d}]\`}dist(t){return Math.hypot(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}len(){return Math.hypot(this.a,this.b,this.c,this.d)}cross(t){return new W(0,this.c*t.d-this.d*t.c,this.d*t.b-this.b*t.d,this.b*t.c-this.c*t.b)}dot(t){return this.b*t.b+this.c*t.c+this.d*t.d}normalize(){let t=Math.sqrt(this.dot(this));return new W(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new W(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new W(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new W(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new W(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new W(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}angle(){return 2*Math.acos(this.a)}invrot(){return new W(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,o,l,i,s,a,f){return t*(l*f-i*a)+r*(i*s-o*f)+n*(o*a-l*s)}rotateplane(t){let r=t.mul(new W(0,this.b,this.c,this.d)).mul(t.invrot());return r.a=this.a,r}orthogonal(){let t=Math.abs(this.b),r=Math.abs(this.c),n=Math.abs(this.d);return t<r&&t<n?this.cross(new W(0,1,0,0)).normalize():r<t&&r<n?this.cross(new W(0,0,1,0)).normalize():this.cross(new W(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<1e-9)return new W(1,0,0,0);let n=r.sum(t);n.len()<1e-9?n=n.orthogonal():n=n.normalize();let o=r.cross(n);return o.a=r.dot(n),o}unproject(t){return this.sum(t.smul(-this.dot(t)/(this.len()*t.len())))}rotatepoint(t){return t.mul(this).mul(t.invrot())}rotateface(t){return t.map(r=>r.rotatepoint(this))}intersect3(t,r){let n=this.det3x3(this.b,this.c,this.d,t.b,t.c,t.d,r.b,r.c,r.d);return Math.abs(n)<1e-9?!1:new W(0,this.det3x3(this.a,this.c,this.d,t.a,t.c,t.d,r.a,r.c,r.d)/n,this.det3x3(this.b,this.a,this.d,t.b,t.a,t.d,r.b,r.a,r.d)/n,this.det3x3(this.b,this.c,this.a,t.b,t.c,t.a,r.b,r.c,r.a)/n)}side(t){return t>1e-9?1:t<-1e-9?-1:0}cutface(t){let r=this.a,n=0,o=null;for(let l=0;l<t.length;l++)n|=1<<this.side(t[l].dot(this)-r)+1;if((n&5)===5){o=[];let l=t.map(i=>this.side(i.dot(this)-r));for(let i=-1;i<=1;i+=2){let s=[];for(let a=0;a<t.length;a++){(l[a]===i||l[a]===0)&&s.push(t[a]);let f=(a+1)%t.length;if(l[a]+l[f]===0&&l[a]!==0){let u=t[a].dot(this)-r,g=t[f].dot(this)-r,p=u/(u-g),c=t[a].smul(1-p).sum(t[f].smul(p));s.push(c)}}o.push(s)}}return o}cutfaces(t){let r=[];for(let n=0;n<t.length;n++){let o=t[n],l=this.cutface(o);l?(r.push(l[0]),r.push(l[1])):r.push(o)}return r}faceside(t){let r=this.a;for(let n=0;n<t.length;n++){let o=this.side(t[n].dot(this)-r);if(o!==0)return o}throw new Error("Could not determine side of plane in faceside")}sameplane(t){let r=this.normalize(),n=t.normalize();return r.dist(n)<1e-9||r.dist(n.smul(-1))<1e-9}makecut(t){return new W(t,this.b,this.c,this.d)}}});function Af(){let e=Math.sqrt(.5);return[new W(e,e,0,0),new W(e,0,e,0)]}function yf(){return[new W(.5,.5,.5,.5),new W(.5,.5,.5,-.5)]}function Uf(){let e=2*Math.PI/10,t=.5+.3*Math.sqrt(5),r=.5+.1*Math.sqrt(5),n=Math.sqrt(t*t+r*r);return t/=n,r/=n,[new W(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new W(.5,.5,.5,.5)]}function xf(){let e=.16666666666666666+Math.sqrt(5)/6,t=2/3+Math.sqrt(5)/3,r=Math.sqrt(e*e+t*t);e/=r,t/=r;let n=2*Math.PI/6;return[new W(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new W(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function bf(){let e=Math.sqrt(.5);return[new W(.5,.5,.5,.5),new W(e,0,0,e)]}function Sf(e){let t=[new W(1,0,0,0)];for(let r=0;r<t.length;r++)for(let n=0;n<e.length;n++){let o=e[n].mul(t[r]),l=o.smul(-1),i=!1;for(let s=0;s<t.length;s++)if(o.dist(t[s])<ni||l.dist(t[s])<ni){i=!0;break}i||t.push(o)}return t}function as(e,t){let r=[],n=[];for(let o=0;o<t.length;o++){let l=e.rotateplane(t[o]),i=!1;for(let s=0;s<r.length;s++)if(l.dist(r[s])<ni){i=!0;break}i||(r.push(l),n.push(t[o]))}return n}function fs(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let o=Df(0,r,n,e);if(o){let l=!1;for(let i=0;i<t.length;i++)if(o.dist(t[i])<ni){l=!0;break}l||t.push(o)}}for(;;){let r=!1;for(let n=0;n<t.length;n++){let o=(n+1)%t.length;if(e[0].dot(t[n].cross(t[o]))<0){let l=t[n];t[n]=t[o],t[o]=l,r=!0}}if(!r)break}return t}var ni,wf=y(()=>{ri();ni=1e-9});function oi(e,t){let r=e[0].p.length,n=Bf(r),o=[],l=[],i=[],s=[],a=[];function f(c){for(let L=c.p.length-1;L>=0;L--){let m=c.p[L];if(m!==L){if(!o[L][m])return!1;c=c.mul(l[L][m])}}return!0}function u(c,L,m){s[c].push(L),a[c].push(m);for(let R=0;R<o[c].length;R++)o[c][R]&&g(c,o[c][R].mul(L),m+i[c][R])}function g(c,L,m){let R=L.p[c];if(!o[c][R]){o[c][R]=L,l[c][R]=L.inv(),i[c][R]=m;for(let A=0;A<s[c].length;A++)g(c,L.mul(s[c][A]),m+a[c][A]);return}let F=L.mul(l[c][R]);f(F)||u(c-1,F,m+i[c][R])}function p(){o=[],l=[],s=[],i=[],a=[];for(let m=0;m<r;m++)o.push([]),l.push([]),i.push([]),s.push([]),a.push([]),o[m][m]=n,l[m][m]=n,i[m][m]=0;let c=0,L=1n;for(let m=0;m<e.length;m++){u(r-1,e[m],1),L=1n;let R=0,F=0,A=[],U=new vf;for(let b=0;b<r;b++){let S=0,M=0;for(let C=0;C<r;C++)o[b][C]&&(S++,M+=i[b][C],b!==C&&c++);R+=s[b].length,L*=BigInt(S),S>1&&U.multiply(S);let J=M/S;A.push(J),F+=J}t(\`\${m}: sz \${L} T \${R} sol \${F} none \${c} mults \${U.toString()}\`)}return L}return p()}var vf,us=y(()=>{Xl();vf=class{constructor(){this.mult=[]}multiply(t){for(let r=2;r*r<=t;r++)for(;t%r===0;)this.mult[r]!==void 0?this.mult[r]++:this.mult[r]=1,t/=r;t>1&&(this.mult[t]!==void 0?this.mult[t]++:this.mult[t]=1)}toString(){let t="";for(let r=0;r<this.mult.length;r++)this.mult[r]!==void 0&&(t!==""&&(t+="*"),t+=r,this.mult[r]>1&&(t+=\`^\${this.mult[r]}\`));return t}}});function nL(e,t){let r=[];for(let n of e)for(let o of t)r.push(o.rotate(n));return r}function iL(){return{4:[["F","D","L","R"]],6:[["F","D","L","U","R"],["R","F","","B",""]],8:[["F","D","L","R"],["D","F","BR",""],["BR","D","","BB"],["BB","BR","U","BL"]],12:[["U","F","","","",""],["F","U","R","C","A","L"],["R","F","","","E",""],["E","R","","BF","",""],["BF","E","BR","BL","I","D"]],20:[["R","C","F","E"],["F","R","L","U"],["L","F","A",""],["E","R","G","I"],["I","E","S","H"],["S","I","J","B"],["B","S","K","D"],["K","B","M","O"],["O","K","P","N"],["P","O","Q",""]]}}function sL(){return{4:{F:"#00ff00",D:"#ffff00",L:"#ff0000",R:"#0000ff"},6:{U:"#ffffff",F:"#00ff00",R:"#ff0000",D:"#ffff00",B:"#0000ff",L:"#ff8000"},8:{U:"#ffffff",F:"#ff0000",R:"#00bb00",D:"#ffff00",BB:"#1122ff",L:"#9524c5",BL:"#ff8800",BR:"#aaaaaa"},12:{U:"#ffffff",F:"#006633",R:"#ff0000",C:"#ffffd0",A:"#3399ff",L:"#660099",E:"#ff66cc",BF:"#99ff00",BR:"#0000ff",BL:"#ffff00",I:"#ff6633",D:"#999999"},20:{R:"#db69f0",C:"#178fde",F:"#23238b",E:"#9cc726",L:"#2c212d",U:"#177fa7",A:"#e0de7f",G:"#2b57c0",I:"#41126b",S:"#4b8c28",H:"#7c098d",J:"#7fe7b4",B:"#85fb74",K:"#3f4bc3",D:"#0ff555",M:"#f1c2c8",O:"#58d340",P:"#c514f2",N:"#14494e",Q:"#8b1be1"}}}function fL(){return{4:[["FLR",[0,1,0]],["F",[0,0,1]]],6:[["U",[0,1,0]],["F",[0,0,1]]],8:[["U",[0,1,0]],["F",[0,0,1]]],12:[["U",[0,1,0]],["F",[0,0,1]]],20:[["GUQMJ",[0,1,0]],["F",[0,0,1]]]}}function li(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<Se)return r;throw new Error("Element not found")}function Ef(){return ei}function _f(e){return ei[e]}function Ko(e){let t=e.split(/ /).filter(Boolean);if(t.length%2===0)return null;let r=t[0];if(r!=="o"&&r!=="c"&&r!=="i"&&r!=="d"&&r!=="t")return null;let n=[];for(let o=1;o<t.length;o+=2){if(t[o]!=="f"&&t[o]!=="v"&&t[o]!=="e")return null;n.push({cutType:t[o],distance:parseFloat(t[o+1])})}return{shape:r,cuts:n}}function ps(e,t={}){let r=Ko(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new si(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function Gn(e,t){return ps(ei[e],t)}function uL(e,t,r){let n=!1;r-t[1]<t[0]&&(e=[e[2],e[3],e[0],e[1]],t=[r-t[1],r-t[0]],n=!0);let o=e[0],l="";if(t[0]===0&&t[1]===r)o=o+"v";else if(t[0]===t[1])t[1]>0&&(l=String(t[1]+1));else if(t[0]===0)o=o.toLowerCase(),t[1]>1&&(l=String(t[1]+1));else throw new Error(\`We only support slice and outer block moves right now. \${t}\`);return[l+o,n]}function gL(e,t){let r=[],n=0;for(;n<e.length;){n>0&&n<e.length&&e[n]==="_"&&n++;let o="";for(let l of t)e.substr(n).startsWith(l[1])&&l[1].length>o.length&&(o=l[1]);if(o!=="")r.push(o),n+=o.length;else throw new Error("Could not split "+e+" into face names.")}return r}function ii(e,t){return[e.b/t,-e.c/t,e.d/t]}function gs(e,t){let r=[],n=e.length;for(let o=0;o<n;o++){let l=ii(e.get(n-o-1),t);r[3*o]=l[0],r[3*o+1]=l[1],r[3*o+2]=l[2]}return r}var Xr,qo,Se,oL,lL,aL,kf,zf,si,$r,Qo=y(()=>{Be();$2();es();rs();Xl();hf();Ff();wf();ri();us();Xr=class{constructor(t){this.coords=new Array(t.length*3);for(let r=0;r<t.length;r++)this.coords[3*r]=t[r].b,this.coords[3*r+1]=t[r].c,this.coords[3*r+2]=t[r].d;this.length=t.length}get(t){return new W(0,this.coords[3*t],this.coords[3*t+1],this.coords[3*t+2])}centermass(){let t=0,r=0,n=0;for(let o=0;o<this.length;o++)t+=this.coords[3*o],r+=this.coords[3*o+1],n+=this.coords[3*o+2];return new W(0,t/this.length,r/this.length,n/this.length)}rotate(t){let r=[];for(let n=0;n<this.length;n++)r.push(this.get(n).rotatepoint(t));return new Xr(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new Xr(t)}},qo=class{constructor(t,r,n){this.face=t;this.left=r;this.right=n}split(t){let r=t.cutface(this.face);return r!==null&&(this.left===void 0?(this.left=new qo(r[0]),this.right=new qo(r[1])):(this.left=this.left?.split(t),this.right=this.right?.split(t))),this}collect(t,r){return this.left===void 0?t.push(new Xr(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};Se=1e-9,oL="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",lL=!1;aL={4:{v:["DFR","DLF","DRL","FLR"],e:["FR","LF","DF","DL","RD","RL"],c:["DF","FD","RL","LR"]},6:{v:["URF","UBR","ULB","UFL","DFR","DRB","DBL","DLF"],e:["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],c:["UB","LU","FU","RU","BU","DF"]},8:{v:["UBBBRR","URFL","ULBLBB","DBRBBBL","DBLLF","DFRBR"],e:["UL","UBB","UR","BRD","BLD","FD","BRR","FR","FL","BLL","BLBB","BRBB"],c:["BBU","LU","RU","BRD","FD","BLD","DF","UBB"]},12:{v:["URF","UFL","ULBL","UBLBR","UBRR","DEBF","DBFI","DIA","DAC","DCE","LAI","ALF","FCA","CFR","REC","ERBR","BRBFE","BFBRBL","BLIBF","IBLL"],e:["UF","UR","UBR","UBL","UL","ER","EBR","EBF","ED","EC","IBF","IBL","IL","IA","ID","AC","CF","FA","BFBR","BRBL","BLBF","CD","AD","AL","FL","FR","CR","BFD","BRR","BLL"],c:["UF","FU","DBF","BFD","AD","CD","BRU","BLU","LA","RA","EBR","IBL"]},20:{v:["FLPQU","FUGER","FRCAL","HCREI","ISBDH","JSIEG","BSJMK","MQPOK","ONDBK","NOPLA","UQMJG","DNACH"],e:["FU","FL","FR","EG","ER","EI","SJ","SI","SB","KM","KB","KO","PQ","PO","PL","UG","JG","MQ","UQ","HC","HD","ND","NA","JM","CA","AL","CR","HI","DB","NO"],c:["FU","UF","GE","EG","JS","SJ","MK","KM","QP","PQ","LA","AL","RC","CR","IH","HI","BD","DB","ON","NO"]}};kf=["c","t","o","d","i"],zf=["f","v","e"];si=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.notationMapper=new Nn;this.addNotationMapper="";this.setReidOrder=!1;let n="genperms";this.options=new ts(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let o=null;switch(r){case"c":o=Af();break;case"o":o=bf();break;case"i":o=xf();break;case"t":o=yf();break;case"d":o=Uf();break;default:throw new Error("Bad shape argument: "+r)}this.rotations=Sf(o),this.options.verbosity&&console.log("# Rotations: "+this.rotations.length);let l=o[0];this.baseplanerot=as(l,this.rotations);let i=this.baseplanerot.map(D=>l.rotateplane(D));this.baseplanes=i,this.baseFaceCount=i.length;let s=iL()[i.length];this.net=s,this.colors=sL()[i.length],this.options.verbosity>0&&console.log("# Base planes: "+i.length);let a=fs(i),f=new W(0,0,0,0);this.options.verbosity>0&&console.log("# Face vertices: "+a.length);let u=i[0].makenormal(),g=a[0].sum(a[1]).makenormal(),p=a[0].makenormal(),c=new W(1,u.b,u.c,u.d);this.options.verbosity>0&&console.log("# Boundary is "+c);let m=as(c,this.rotations).map(D=>c.rotateplane(D)),R=fs(m);this.edgedistance=R[0].sum(R[1]).smul(.5).dist(f),this.vertexdistance=R[0].dist(f);let F=[],A=[],U=!1,b=!1,S=!1;for(let D of n){let _=null,G=0;switch(D.cutType){case"f":_=u,G=1,U=!0;break;case"v":_=p,G=this.vertexdistance,S=!0;break;case"e":_=g,G=this.edgedistance,b=!0;break;default:throw new Error("Bad cut argument: "+D.cutType)}F.push(_.makecut(D.distance)),A.push(D.distance<G)}this.options.addRotations&&(U||F.push(u.makecut(10)),S||F.push(p.makecut(10)),b||F.push(g.makecut(10))),this.basefaces=[];for(let D of this.baseplanerot){let _=D.rotateface(R);this.basefaces.push(new Xr(_))}let M=[],J=[],C=[],Q=[],x=R.length;function k(D,_,G){for(let T of D)if(T[0].dist(_)<Se){T.push(G);return}D.push([_,G])}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R);for(let G=0;G<_.length;G++){let T=(G+1)%_.length,$=_[G].sum(_[T]).smul(.5);k(Q,$,D)}}let P=[];for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),G=[];for(let T=0;T<_.length;T++){let $=(T+1)%_.length,se=_[T].sum(_[$]).smul(.5),Pe=Q[li(Q,se)];if(D===Pe[1])G.push(Pe[2]);else if(D===Pe[2])G.push(Pe[1]);else throw new Error("Could not find edge")}P.push(G)}let w={},v=[];v.push(s[0][0]),w[s[0][0]]=0,v[P[0][0]]=s[0][1],w[s[0][1]]=P[0][0];for(let D of s){let _=D[0],G=w[_];if(G===void 0)throw new Error("Bad edge description; first edge not connected");let T=-1;for(let $=0;$<P[G].length;$++){let se=v[P[G][$]];if(se!==void 0&&se===D[1]){T=$;break}}if(T<0)throw new Error("First element of a net not known");for(let $=2;$<D.length;$++){if(D[$]==="")continue;let se=P[G][($+T-1)%x],Pe=v[se];if(Pe!==void 0&&Pe!==D[$])throw new Error("Face mismatch in net");v[se]=D[$],w[D[$]]=se}}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),G=c.rotateplane(this.baseplanerot[D]),T=v[D];M.push([_,T]),J.push([G,T])}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),G=v[D];for(let T=0;T<_.length;T++){let $=(T+1)%_.length,se=_[T].sum(_[$]).smul(.5),Pe=(T+2)%_.length,sm=_[$].sum(_[Pe]).smul(.5),am=li(Q,se),fm=li(Q,sm);k(C,_[$],[G,fm,am])}}this.swizzler=new Go(M.map(D=>D[1]));let N=this.swizzler.prefixFree?"":"_",j=aL[this.baseFaceCount],q=[];for(let D=0;D<this.baseFaceCount;D++)q[1<<D]=D;{let D=j.v;for(let _ of D){let G=this.swizzler.splitByFaceNames(_),T=0;for(let $ of G)T|=1<<$;q[T]=G[0]}}{let D=j.e;for(let _ of D){let G=this.swizzler.splitByFaceNames(_),T=0;for(let $ of G)T|=1<<$;q[T]=G[0]}}{let D=j.c;for(let _ of D){let G=this.swizzler.splitByFaceNames(_),T=1<<G[0]|1<<this.baseFaceCount;q[T]=G[1]}}for(let D=0;D<Q.length;D++){if(Q[D].length!==3)throw new Error("Bad length in edge names "+Q[D]);let _=Q[D][1],G=Q[D][2],T=v[_],$=v[G],se=1<<_|1<<G;q[se]==_?T=T+N+$:T=$+N+T,Q[D]=[Q[D][0],T]}for(let D=0;D<C.length;D++){let _=0;if(C[D].length<4)throw new Error("Bad length in vertex names");for(let se=1;se<C[D].length;se++)_|=1<<w[C[D][se][0]];let G=q[_],T=-1;for(let se=1;se<C[D].length;se++)G===w[C[D][se][0]]&&(T=se);if(T<0)throw new Error("Internal error; couldn't find face name when fixing corners");let $="";for(let se=1;se<C[D].length;se++){se===1?$=C[D][T][0]:$=$+N+C[D][T][0];for(let Pe=1;Pe<C[D].length;Pe++)if(C[D][T][1]===C[D][Pe][2]){T=Pe;break}}C[D]=[C[D][0],$]}this.markedface=q,this.options.verbosity>1&&(console.log("# Face names: "+M.map(D=>D[1]).join(" ")),console.log("# Edge names: "+Q.map(D=>D[1]).join(" ")),console.log("# Vertex names: "+C.map(D=>D[1]).join(" ")));let ie=[];for(let D of J)ie.push([D[0].makenormal(),D[1],"f"]);for(let D of Q)ie.push([D[0].makenormal(),D[1],"e"]);for(let D of C)ie.push([D[0].makenormal(),D[1],"v"]);this.facenames=M,this.faceplanes=J,this.edgenames=Q,this.vertexnames=C,this.geonormals=ie;let de=ie.map(D=>D[1]);this.swizzler.setGripNames(de),this.options.verbosity>0&&console.log("# Distances: face "+1+" edge "+this.edgedistance+" vertex "+this.vertexdistance);for(let D=0;D<F.length;D++)for(let _ of this.rotations){let G=F[D].rotateplane(_),T=!1;for(let $ of this.moveplanes)if(G.sameplane($)){T=!0;break}T||(this.moveplanes.push(G),A[D]&&this.moveplanes2.push(G))}let xe=new qo(R),Ze=this.moveplanes2.slice(),xt=31;for(let D=0;D<Ze.length;D++){let _=D+Math.floor((Ze.length-D)*(xt/65536));xe=xe.split(Ze[_]),Ze[_]=Ze[D],xt=(xt*1657+101)%65536}let Le=xe.collect([],!0);this.faces=Le,this.options.verbosity>0&&console.log("# Faces is now "+Le.length),this.stickersperface=Le.length;let Lt=[],ot=ti(R);for(let D of this.rotations){let _=D.rotateface(R);ot.dist(ti(_))<Se&&Lt.push(D)}let pt=new Array(Le.length),ze=[];for(let D=0;D<Le.length;D++){let _=Le[D].centermass();ze.push([ot.dist(_),_,D])}ze.sort((D,_)=>D[0]-_[0]);for(let D=0;D<Le.length;D++){let _=ze[D][2];if(!pt[_]){pt[_]=!0;for(let G of Lt){let T=Le[_].rotate(G),$=T.centermass();for(let se=D+1;se<Le.length&&!(ze[se][0]-ze[D][0]>Se);se++){let Pe=ze[se][2];if(!pt[Pe]&&$.dist(ze[se][1])<Se){pt[Pe]=!0,Le[Pe]=T;break}}}}}this.shortedge=1e99;for(let D of Le)for(let _=0;_<D.length;_++){let G=(_+1)%D.length,T=D.get(_).dist(D.get(G));T<this.shortedge&&(this.shortedge=T)}this.options.verbosity>0&&console.log("# Short edge is "+this.shortedge),r==="c"&&U&&!b&&!S&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&S&&!U&&!b&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(S||U)&&!b&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&U&&(this.notationMapper=new Io(this.swizzler,new Go(["F","D","L","BL","R","U","BR","B"])),!b&&!S&&(this.addNotationMapper="FTOMapper")),r==="d"&&U&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new Io(this.swizzler,new Go(["U","F","L","BL","BR","R","FR","FL","DL","B","DR","D"])))}keyface(t){return this.keyface2(t.centermass())}keyface2(t){let r="",n=String.fromCharCode;for(let o of this.moveplanesets)if(o.length>0){let l=t.dot(o[0]),i=0,s=1;for(;s*2<=o.length;)s*=2;for(;s>0;s>>=1)i+s<=o.length&&l>o[i+s-1].a&&(i+=s);if(i<47)r=r+n(33+i);else if(i<47+47*47)r=r+n(33+47+Math.floor(i/47)-1)+n(33+i%47);else if(i<47+47*47+47*47*47)r=r+n(33+47+Math.floor((i-47)/(47*47)-1))+n(33+47+Math.floor((i-47)/47)%47)+n(33+i%47);else throw Error("Too many slices for cubie encoding")}return r}keyface3(t){let r=t.centermass(),n=[];for(let o of this.moveplanesets)if(o.length>0){let l=r.dot(o[0]),i=0,s=1;for(;s*2<=o.length;)s*=2;for(;s>0;s>>=1)i+s<=o.length&&l>o[i+s-1].a&&(i+=s);n.push(i)}return n}findface(t){let r=this.keyface2(t),n=this.facelisthash.get(r);if(n.length===1)return n[0];for(let o=0;o+1<n.length;o++){let l=this.facelisthash.get(r)[o];if(Math.abs(t.dist(this.facecentermass[l]))<Se)return l}return n[n.length-1]}project2d(t,r,n){let o=this.facenames[t][0],l=(r+1)%o.length,i=this.baseplanes[t],s=o[l].sub(o[r]),a=s.len();s=s.normalize();let f=s.cross(i).normalize(),u=n[1].sub(n[0]),g=u.len()/a;u=u.normalize();let p=u.b,c=u.c,L=s.smul(p).sub(f.smul(c)).smul(g),m=f.smul(p).sum(s.smul(c)).smul(g),R=new W(0,n[0].b-L.dot(o[r]),n[0].c-m.dot(o[r]),0);return[L,m,R]}allstickers(){let t="allstickers";this.faces=nL(this.baseplanerot,this.faces),this.options.verbosity>0&&console.log("# Total stickers is now "+this.faces.length),this.facecentermass=new Array(this.faces.length);for(let x=0;x<this.faces.length;x++)this.facecentermass[x]=this.faces[x].centermass();let r=[],n=[];for(let x of this.moveplanes){let k=x.makenormal(),P=!1;for(let w of n)k.sameplane(w.makenormal())&&(P=!0);P||(n.push(k),r.push([]))}for(let x of this.moveplanes2){let k=x.makenormal();for(let P=0;P<n.length;P++)if(k.sameplane(n[P])){r[P].push(x);break}}for(let x=0;x<r.length;x++){let k=r[x].map(w=>w.normalizeplane()),P=n[x];for(let w=0;w<k.length;w++)k[w].makenormal().dist(P)>Se&&(k[w]=k[w].smul(-1));k.sort((w,v)=>w.a-v.a),r[x]=k}this.moveplanesets=r,this.moveplanenormals=n;let o=r.map(x=>x.length);this.options.verbosity>0&&console.log("# Move plane sets: "+o);let l=[];for(let x=0;x<r.length;x++)l.push([]);for(let x of this.rotations){if(Math.abs(Math.abs(x.a)-1)<Se)continue;let k=x.makenormal();for(let P=0;P<r.length;P++)if(k.sameplane(n[P])){l[P].push(x);break}}this.moverotations=l;for(let x=0;x<l.length;x++){let k=l[x],P=k[0].makenormal();for(let w=0;w<k.length;w++)P.dist(k[w].makenormal())>Se&&(k[w]=k[w].smul(-1));k.sort((w,v)=>w.angle()-v.angle()),l[x][0].dot(n[x])<0&&k.reverse()}let i=l.map(x=>1+x.length);this.movesetorders=i;let s=[],a="?";for(let x=0;x<r.length;x++){let k=n[x],P=null,w=null;for(let v of this.geonormals){let N=k.dot(v[0]);Math.abs(N-1)<Se?(w=[v[1],v[2]],a=v[2]):Math.abs(N+1)<Se&&(P=[v[1],v[2]],a=v[2])}if(w===null||P===null)throw new Error("Saw positive or negative sides as null");s.push([w[0],w[1],P[0],P[1],1+r[x].length]),this.addNotationMapper==="NxNxNCubeMapper"&&a==="f"&&(this.notationMapper=new Zl(1+r[x].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new Yl(this.swizzler),this.addNotationMapper=""),this.addNotationMapper==="PyraminxOrTetraminxMapper"&&(r[0].length===2&&r[0][0].a===.333333333333333&&r[0][1].a===1.66666666666667?(this.notationMapper=new Wo(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new Jl(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&a==="f"&&(1+r[x].length===3&&(this.notationMapper=new Hl(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&a==="f"&&(1+r[x].length===3&&(this.notationMapper=new Vl(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=s;let f=new Map,u=this.faces;for(let x=0;x<u.length;x++){let k=u[x],P=this.keyface(k);if(!f.get(P))f.set(P,[x]);else{let w=f.get(P);if(w.push(x),w.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let v=0;v<w.length;v++){let N=P+" "+v;f.set(N,[w[v]])}}}}this.facelisthash=f,this.options.verbosity>0&&console.log("# Cubies: "+f.size);let g=[],p=[],c=[];for(let x of f.values())if(x.length!==this.baseFaceCount){if(x.length>1){let k=x.map(j=>u[j].centermass()),P=ti(k);for(let j=0;x.length>2;j++){let q=!1;for(let ie=0;ie<x.length;ie++){let de=(ie+1)%x.length;if(P.dot(k[ie].cross(k[de]))<0){let xe=k[ie];k[ie]=k[de],k[de]=xe;let Ze=x[ie];x[ie]=x[de],x[de]=Ze,q=!0}}if(!q)break;if(j>1e3)throw new Error("Bad epsilon math; too close to border")}let w=0;for(let j of x)w|=1<<Math.floor(j/this.stickersperface);let v=this.markedface[w],N=-1;for(let j=0;j<x.length;j++)Math.floor(x[j]/this.stickersperface)===v&&(N=j);if(N<0)throw new Error("Could not find marked face in list");if(N!==0){let j=x.slice();for(let q=0;q<x.length;q++)x[q]=j[(N+q)%x.length]}}for(let k=0;k<x.length;k++){let P=x[k];p[P]=g.length,c[P]=k}g.push(x)}this.cubies=g,this.facetocubie=p,this.facetoord=c;let L=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],m=[],R=[0,0,0,0,0,0],F=[],A=[],U=0,b=[],S=[],M=[],J=[],C=x=>g[x].map(k=>this.getfaceindex(k)).join(" "),Q=[];for(let x=0;x<g.length;x++){let k=g[x];if(k.length===0||A[x])continue;let P={},w=0;M.push(0),Q.push([]);let v=k.length,N=R[v]++,j=L[v];(j===void 0||v===this.baseFaceCount)&&(j="CORE"),j=j+(N===0?"":N+1),m[U]=j,F[U]=v;let q=[x],ie=0;for(A[x]=!0;ie<q.length;){let de=q[ie++],xe=C(de);if((k.length>1||P[xe]===void 0)&&(P[xe]=w++),J[de]=P[xe],b[de]=U,Q[U].push(de),S[de]=M[U]++,q.length<this.rotations.length){let Ze=this.facecentermass[g[de][0]];for(let xt of l){let Le=this.facetocubie[this.findface(Ze.rotatepoint(xt[0]))];A[Le]||(q.push(Le),A[Le]=!0)}}}U++}if(this.setReidOrder&&4<=this.stickersperface&&this.stickersperface<=9){let x=[["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],["UFR","URB","UBL","ULF","DRF","DFL","DLB","DBR"],["U","L","F","R","B","D"]],k={};for(let P of x)for(let w=0;w<P.length;w++){let v=0;for(let N=0;N<P[w].length;N++)v|=1<<P[w].charCodeAt(N)-65;k[v]=w}for(let P of Q)for(let w of P){let v=0;for(let N of g[w])v|=1<<this.facenames[this.getfaceindex(N)][1].charCodeAt(0)-65;S[w]=k[v]}}if(this.cubiesetnums=b,this.cubieordnums=S,this.cubiesetnames=m,this.cubieords=M,this.orbitoris=F,this.cubievaluemap=J,this.cubiesetcubies=Q,this.options.fixedPieceType!==null){for(let x=0;x<g.length;x++)if(this.options.fixedPieceType==="v"&&g[x].length>2||this.options.fixedPieceType==="e"&&g[x].length===2||this.options.fixedPieceType==="f"&&g[x].length===1){this.fixedCubie=x;break}if(this.fixedCubie<0)throw new Error("Could not find a cubie of type "+this.options.fixedPieceType+" to fix.")}this.options.verbosity>0&&console.log("# Cubie orbit sizes "+M)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?null:r.modified({family:this.swizzler.unswizzle(r.family)})}stringToBlockMove(t){let r=RegExp("^(([0-9]+)-)?([0-9]+)?([^0-9]+)([0-9]+'?)?$"),n=t.match(r);if(n===null)throw new Error("Bad move passed "+t);let o=n[4],l,i;if(n[2]!==void 0){if(n[3]===void 0)throw new Error("Missing second number in range");l=parseInt(n[2],10)}n[3]!==void 0&&(i=parseInt(n[3],10));let s="1",a=1;return n[5]!==void 0&&(s=n[5],s[0]==="'"&&(s="-"+s.substring(1)),a=parseInt(s,10)),new B(new z(o,i,l),a)}parseMove(t){let r=this.notationMapper.notationToInternal(t);if(r===null)throw new Error("Bad move "+t.family);t=r;let n=t.family,o=!1;if(n.endsWith("v")&&n[0]<="Z"){if(t.innerLayer!==void 0||t.outerLayer!==void 0)throw new Error("Cannot use a prefix with full cube rotations");n=n.slice(0,-1),o=!0}n.endsWith("w")&&n[0]<="Z"&&(n=n.slice(0,-1).toLowerCase());let l,i=-1,s=this.swizzler.unswizzle(n),a=!1;for(let g=0;g<this.movesetgeos.length;g++){let p=this.movesetgeos[g];s===p[0]&&(a=!0,l=p,i=g),s===p[2]&&(a=!1,l=p,i=g)}let f=1,u=1;if(n.toUpperCase()!==n&&(u=2),l===void 0)throw new Error("Bad grip in move "+t.family);if(t.outerLayer!==void 0&&(f=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(u=t.innerLayer,n<="Z"?f=u:f=1):u=t.innerLayer),f--,u--,o&&(f=0,u=this.moveplanesets[i].length),f<0||f>this.moveplanesets[i].length||u<0||u>this.moveplanesets[i].length)throw new Error("Bad slice spec "+f+" "+u+" vs "+this.moveplanesets[i].length);if(!lL&&f===0&&u===this.moveplanesets[i].length&&!o)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,f,u,a,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t="genperms";if(this.cmovesbyslice.length>0)return;let r=[];if(this.options.orientCenters){for(let n=0;n<this.cubies.length;n++)if(this.cubies[n].length===1){let o=this.cubies[n][0],l=this.getfaceindex(o),i=this.basefaces[l].centermass();if(i.dist(this.facecentermass[o])<Se){let s=1<<l|1<<this.baseFaceCount,a=this.markedface[s],f=this.baseplanes[a].makenormal(),u=-1,g=-1;for(let L=0;L<this.faces[o].length;L++){let m=this.faces[o].get(L),R=f.dot(m.sub(i));R>u&&(u=R,g=L)}let p=(g+1)%this.faces[o].length;if(Math.abs(f.dot(this.faces[o].get(p).sub(i))-u)<Se&&(g=p),g!=0){let L=[];for(let m=0;m<this.faces[o].length;m++)L.push(this.faces[o].get((m+g)%this.faces[o].length));this.faces[o]=new Xr(L)}let c=this.basefaces[l].length;for(let L=1;L<c;L++)this.cubies[n].push(this.cubies[n][L-1]);this.duplicatedFaces[o]=c,this.duplicatedCubies[n]=c,this.orbitoris[this.cubiesetnums[n]]=c}}}for(let n=0;n<this.moveplanesets.length;n++){let o=this.moveplanesets[n],l=[],i=[o.length+1,0],s=1;for(;s*2<=o.length;)s*=2;for(let u=0;u<this.faces.length;u++){let g=0;if(o.length>0){let p=this.facecentermass[u].dot(o[0]);for(let c=s;c>0;c>>=1)g+c<=o.length&&p>o[g+c-1].a&&(g+=c);g=o.length-g}for(l.push(g);i.length<=g;)i.push(0);i[g]++}let a=new Array(i.length);for(let u=0;u<i.length;u++)a[u]=[];let f=[];for(let u=0;u<this.faces.length;u++){if(l[u]<0)continue;let g=[this.facetocubie[u],this.facetoord[u]],p=this.facecentermass[u],c=p,L=u,m=l[L];for(;;){l[L]=-1;let R=p.rotatepoint(this.moverotations[n][0]);if(R.dist(c)<Se)break;L=this.findface(R),g.push(this.facetocubie[L],this.facetoord[L]),p=R}if(g.length>2&&this.options.orientCenters&&(this.cubies[g[0]].length===1||this.duplicatedCubies[g[0]]>1)&&this.facecentermass[u].dist(this.basefaces[this.getfaceindex(u)].centermass())<Se){let R=this.faces[this.cubies[g[0]][0]];for(let F=0;F<g.length;F+=2){let A=this.faces[this.cubies[g[F]][0]],U=-1;for(let b=0;b<R.length;b++)if(A.get(b).dist(R.get(0))<Se){U=b;break}if(U<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");g[F+1]=U,R=R.rotate(this.moverotations[n][0])}}if(g.length===2&&this.options.orientCenters)for(let R=1;R<this.movesetorders[n];R++)m===0?g.push(g[0],R):g.push(g[0],(this.movesetorders[n]-R)%this.movesetorders[n]);if(g.length>2&&!f[g[0]]){if(g.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let R of g)a[m].push(R)}for(let R=0;R<g.length;R+=2)f[g[R]]=!0}for(let u=0;u<a.length;u++)a[u]=a[u].slice();r.push(a)}if(this.cmovesbyslice=r,this.options.moveList){let n=[];for(let o of this.options.moveList)n.push(this.parsemove(o));this.parsedmovelist=n}this.facelisthash.clear(),this.facecentermass=[]}getboundarygeometry(){return{baseplanes:this.baseplanes,facenames:this.facenames,faceplanes:this.faceplanes,vertexnames:this.vertexnames,edgenames:this.edgenames,geonormals:this.geonormals}}getmovesets(t){let r=this.moveplanesets[t].length,n=[];if(this.parsedmovelist!==void 0)for(let o of this.parsedmovelist)o[1]===t&&(o[4]?n.push([o[2],o[3]]):n.push([r-o[3],r-o[2]]),n.push(o[5]));else if(this.options.vertexMoves&&!this.options.allMoves){let o=this.movesetgeos[t];if(o[1]!==o[3])for(let l=0;l<r;l++)o[1]!=="v"?(this.options.outerBlockMoves?n.push([l+1,r]):n.push([l+1]),n.push(1)):(this.options.outerBlockMoves?n.push([0,l]):n.push([l,l]),n.push(1))}else for(let o=0;o<=r;o++)!this.options.allMoves&&o+o===r||(this.options.outerBlockMoves?o+o>r?n.push([o,r]):n.push([0,o]):n.push([o,o]),n.push(1));if(this.fixedCubie>=0){let o=this.keyface3(this.faces[this.cubies[this.fixedCubie][0]])[t],l=[];for(let i=0;i<n.length;i+=2){let s=n[i];if(o>=s[0]&&o<=s[1])if(s[0]===0)s=[s[1]+1,r];else if(r===s[1])s=[0,s[0]-1];else throw Error("fixed cubie option would disconnect move");let a=!1;for(let f=0;f<l.length;f+=2)if(l[f][0]===s[0]&&l[f][1]===s[1]&&l[f+1]===n[i+1]){a=!0;break}a||(l.push(s),l.push(n[i+1]))}n=l}return n}graybyori(t){let r=this.cubies[t].length;return this.duplicatedCubies[t]&&(r=1),r===1&&(this.options.grayCenters||!this.options.includeCenterOrbits)||r===2&&(this.options.grayEdges||!this.options.includeEdgeOrbits)||r>2&&(this.options.grayCorners||!this.options.includeCornerOrbits)}skipbyori(t){let r=this.cubies[t].length;return this.duplicatedCubies[t]&&(r=1),r===1&&!this.options.includeCenterOrbits||r===2&&!this.options.includeEdgeOrbits||r>2&&!this.options.includeCornerOrbits}skipcubie(t){return this.skipbyori(t)}header(t){return t+oL+\`
4
+ var workerSource = `var Bm=Object.defineProperty;var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bt=(e,t)=>{for(var r in t)Bm(e,r,{get:t[r],enumerable:!0})};var ka=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var d=(e,t,r)=>(ka(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},V=(e,t,r,n)=>(ka(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),za=(e,t,r,n)=>({set _(o){V(e,t,o,r)},get _(){return d(e,t,n)}}),kl=(e,t,r)=>(ka(e,t,"access private method"),r);var km,Cl,We,Zt=y(()=>{km=!1,Cl=class{is(t){return this instanceof t}as(t){return this instanceof t?this:null}},We=class extends Cl{constructor(){super();km&&Object.defineProperty(this,"_debugStr",{get:()=>this.toString()})}get log(){return console.log.bind(console,this,this.toString())}}});function x2(e,t=!0){if(!t)return e;switch(e){case 1:return-1;case-1:return 1}}function S2(e,t){return t===-1?Array.from(e).reverse():e}function w2(e){return Array.from(e).reverse()}var Tt=y(()=>{});var wo,Na=y(()=>{wo="2^31 - 1"});var Qr,Rt,Ta=y(()=>{Jt();Rt=class{constructor(){ee(this,Qr,[])}push(t){d(this,Qr).push(t)}experimentalPushAlg(t){for(let r of t.units())this.push(r)}experimentalNumUnits(){return d(this,Qr).length}toAlg(){return new E(d(this,Qr))}reset(){V(this,Qr,[])}};Qr=new WeakMap});var v2,Ga=y(()=>{v2={caratNISSNotationEnabled:!1}});var jr,qr,Pl,Ke,vo=y(()=>{Jt();Zt();Tt();Pl=class extends We{constructor(t,r){super();ee(this,jr,void 0);ee(this,qr,void 0);V(this,jr,cr(t)),V(this,qr,cr(r))}get A(){return d(this,jr)}get B(){return d(this,qr)}isIdentical(t){let r=t.as(Pl);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new Pl(d(this,qr),d(this,jr))}*experimentalExpand(t=1,r){r??(r=1/0),r===0?yield t===1?this:this.invert():t===1?(yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(1,r-1),yield*this.A.experimentalExpand(-1,r-1),yield*this.B.experimentalExpand(-1,r-1)):(yield*this.B.experimentalExpand(1,r-1),yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(-1,r-1),yield*this.A.experimentalExpand(-1,r-1))}toString(){return\`[\${d(this,jr).toString()}, \${d(this,qr).toString()}]\`}},Ke=Pl;jr=new WeakMap,qr=new WeakMap});var Sn,wn,Ml,Qe,Eo=y(()=>{Jt();Zt();Tt();Ml=class extends We{constructor(t,r){super();ee(this,Sn,void 0);ee(this,wn,void 0);V(this,Sn,cr(t)),V(this,wn,cr(r))}get A(){return d(this,Sn)}get B(){return d(this,wn)}isIdentical(t){let r=t.as(Ml);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new Ml(d(this,Sn),d(this,wn).invert())}*experimentalExpand(t,r){r??(r=1/0),r===0?yield t===1?this:this.invert():(yield*this.A.experimentalExpand(1,r-1),yield*this.B.experimentalExpand(t,r-1),yield*this.A.experimentalExpand(-1,r-1))}toString(){return\`[\${this.A}: \${this.B}]\`}},Qe=Ml;Sn=new WeakMap,wn=new WeakMap});var mr,Oa,xt,_o=y(()=>{Zt();Tt();Oa=class extends We{constructor(t){super();ee(this,mr,void 0);if(t.includes(\`
5
+ \`)||t.includes("\\r"))throw new Error("LineComment cannot contain newline");V(this,mr,t)}get text(){return d(this,mr)}isIdentical(t){let r=t;return t.is(Oa)&&d(this,mr)===d(r,mr)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}toString(){return\`//\${d(this,mr)}\`}},xt=Oa;mr=new WeakMap});var et,ko=y(()=>{Zt();Tt();et=class extends We{toString(){return\`
6
+ \`}isIdentical(t){return t.is(et)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});var Ce,zo=y(()=>{Zt();Tt();Ce=class extends We{toString(){return"."}isIdentical(t){return t.is(Ce)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});function Nl(e,t){return e?parseInt(e):t}function Ia(e){return new Tl().parseAlg(e)}function _2(e){return new Tl().parseMove(e)}function k2(e){return new Tl().parseQuantumMove(e)}function tt(e,t,r){let n=e;return n.startCharIndex=t,n.endCharIndex=r,n}function z2(e,t){return"startCharIndex"in e&&(t.startCharIndex=e.startCharIndex),"endCharIndex"in e&&(t.endCharIndex=e.endCharIndex),t}var E2,zm,Cm,Pm,Mm,Nm,it,I,vn,Tl,Wa=y(()=>{Jt();Ta();Ga();vo();Eo();Gl();_o();Yt();ko();zo();E2=/^(\\d+)?('?)/,zm=/^[_\\dA-Za-z]/,Cm=/^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)?/,Pm=/^[^\\n]*/,Mm=/^(-?\\d+), ?/,Nm=/^(-?\\d+)\\)/;Tl=class{constructor(){ee(this,it,"");ee(this,I,0);ee(this,vn,[])}parseAlg(t){V(this,it,t),V(this,I,0);let r=this.parseAlgWithStopping([]);this.mustBeAtEndOfInput();let n=Array.from(r.units());if(d(this,vn).length>0)for(let o of d(this,vn).reverse())n.push(o);return new E(n)}parseMove(t){V(this,it,t),V(this,I,0);let r=this.parseMoveImpl();return this.mustBeAtEndOfInput(),r}parseQuantumMove(t){V(this,it,t),V(this,I,0);let r=this.parseQuantumMoveImpl();return this.mustBeAtEndOfInput(),r}mustBeAtEndOfInput(){if(d(this,I)!==d(this,it).length)throw new Error("parsing unexpectedly ended early")}parseAlgWithStopping(t){let r=d(this,I),n=d(this,I),o=new Rt,l=!1,i=a=>{if(l)throw new Error(\`Unexpected character at index \${a}. Are you missing a space?\`)};e:for(;d(this,I)<d(this,it).length;){let a=d(this,I);if(t.includes(d(this,it)[d(this,I)]))return tt(o.toAlg(),r,n);if(this.tryConsumeNext(" ")){l=!1,o.experimentalNumUnits()===0&&(r=d(this,I));continue e}else if(zm.test(d(this,it)[d(this,I)])){i(a);let s=this.parseMoveImpl();o.push(s),l=!0,n=d(this,I);continue e}else if(this.tryConsumeNext("(")){i(a);let s=this.tryRegex(Mm);if(s){let f=s[1],u=d(this,I),g=this.parseRegex(Nm),p=tt(new B(new z("U_SQ_"),parseInt(f)),a+1,a+1+f.length),c=tt(new B(new z("D_SQ_"),parseInt(g[1])),u,d(this,I)-1),L=tt(new E([p,c]),a+1,d(this,I)-1);o.push(tt(new je(L),a,d(this,I))),l=!0,n=d(this,I);continue e}else{let f=this.parseAlgWithStopping([")"]);this.mustConsumeNext(")");let u=this.parseAmount();o.push(tt(new je(f,u),a,d(this,I))),l=!0,n=d(this,I);continue e}}else if(this.tryConsumeNext("^")){if(!v2.caratNISSNotationEnabled)throw new Error("Alg contained a carat but carat NISS notation is not enabled.");this.mustConsumeNext("(");let s=this.parseAlgWithStopping([")"]);this.popNext();let f=new je(s,-1),u=new Ce;f.experimentalNISSPlaceholder=u,u.experimentalNISSGrouping=f,d(this,vn).push(f),o.push(u)}else if(this.tryConsumeNext("[")){i(a);let s=this.parseAlgWithStopping([",",":"]),f=this.popNext(),u=this.parseAlgWithStopping(["]"]);switch(this.mustConsumeNext("]"),f){case":":o.push(tt(new Qe(s,u),a,d(this,I))),l=!0,n=d(this,I);continue e;case",":o.push(tt(new Ke(s,u),a,d(this,I))),l=!0,n=d(this,I);continue e;default:throw new Error("unexpected parsing error")}}else if(this.tryConsumeNext(\`
7
+ \`)){o.push(tt(new et,a,d(this,I))),l=!1,n=d(this,I);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(a);let[s]=this.parseRegex(Pm);o.push(tt(new xt(s),a,d(this,I))),l=!1,n=d(this,I);continue e}else{o.push(tt(new B("_SLASH_"),a,d(this,I))),l=!0,n=d(this,I);continue e}else if(this.tryConsumeNext(".")){i(a),o.push(tt(new Ce,a,d(this,I))),l=!0,n=d(this,I);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(d(this,I)!==d(this,it).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return tt(o.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(Cm);return new z(n,Nl(r,void 0),Nl(t,void 0))}parseMoveImpl(){let t=d(this,I);if(this.tryConsumeNext("/"))return tt(new B("_SLASH_"),t,d(this,I));let r=this.parseQuantumMoveImpl(),[n,o]=this.parseAmountAndTrackEmptyAbsAmount(),l=this.parseMoveSuffix();if(l){if(n<0)throw new Error("uh-oh");if((l==="++"||l==="--")&&n!==1)throw new Error("Pochmann ++ or -- moves cannot have an amount other than 1.");if((l==="++"||l==="--")&&!o)throw new Error("Pochmann ++ or -- moves cannot have an amount written as a number.");if((l==="+"||l==="-")&&o)throw new Error("Clock dial moves must have an amount written as a natural number followed by + or -.");l.startsWith("+")&&(r=r.modified({family:\`\${r.family}_\${l==="+"?"PLUS":"PLUSPLUS"}_\`})),l.startsWith("-")&&(r=r.modified({family:\`\${r.family}_\${l==="-"?"PLUS":"PLUSPLUS"}_\`}),n*=-1)}return tt(new B(r,n),t,d(this,I))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=d(this,I),[,r,n]=this.parseRegex(E2);if(r?.startsWith("0")&&r!=="0")throw new Error(\`Error at char index \${t}: An amount can only start with 0 if it's exactly the digit 0.\`);return[Nl(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=d(this,I),[,r,n]=this.parseRegex(E2);if(r?.startsWith("0")&&r!=="0")throw new Error(\`Error at char index \${t}: An amount number can only start with 0 if it's exactly the digit 0.\`);return Nl(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return V(this,I,d(this,I)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(V(this,I,d(this,I)+r[0].length),r)}remaining(){return d(this,it).slice(d(this,I))}popNext(){let t=d(this,it)[d(this,I)];return za(this,I)._++,t}tryConsumeNext(t){return d(this,it)[d(this,I)]===t?(za(this,I)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};it=new WeakMap,I=new WeakMap,vn=new WeakMap});function Ol(e){C2.has(e)||(console.warn(e),C2.add(e))}var C2,Ka=y(()=>{C2=new Set});var En,Qa=y(()=>{Tt();Na();En=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<-2147483648||this.amount>2147483647)throw new Error(\`Unit amount absolute value must be a non-negative integer below \${wo}.\`)}suffix(){let t="",r=Math.abs(this.amount);return r!==1&&(t+=r),this.amount<0&&(t+="'"),t}isIdentical(t){return this.quantum.isIdentical(t.quantum)&&this.amount===t.amount}*experimentalExpand(t,r){let n=Math.abs(this.amount),o=x2(t,this.amount<0);for(let l=0;l<n;l++)yield*this.quantum.experimentalExpand(o,r)}}});var Xt,qe,Ve,Wl,z,Ne,_n,B,Yt=y(()=>{Zt();Tt();Na();Wa();Ka();Qa();Wl=class extends Cl{constructor(t,r,n){super();ee(this,Xt,void 0);ee(this,qe,void 0);ee(this,Ve,void 0);if(V(this,Xt,t),V(this,qe,r??null),V(this,Ve,n??null),Object.freeze(this),d(this,qe)!==null&&(!Number.isInteger(d(this,qe))||d(this,qe)<1||d(this,qe)>2147483647))throw new Error(\`QuantumMove inner layer must be a positive integer below \${wo}.\`);if(d(this,Ve)!==null&&(!Number.isInteger(d(this,Ve))||d(this,Ve)<1||d(this,Ve)>2147483647))throw new Error(\`QuantumMove outer layer must be a positive integer below \${wo}.\`);if(d(this,Ve)!==null&&d(this,qe)!==null&&d(this,qe)<=d(this,Ve))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(d(this,Ve)!==null&&d(this,qe)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(t){return k2(t)}modified(t){return new Wl(t.family??d(this,Xt),t.innerLayer??d(this,qe),t.outerLayer??d(this,Ve))}isIdentical(t){let r=t;return t.is(Wl)&&d(this,Xt)===d(r,Xt)&&d(this,qe)===d(r,qe)&&d(this,Ve)===d(r,Ve)}get family(){return d(this,Xt)}get outerLayer(){return d(this,Ve)}get innerLayer(){return d(this,qe)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let t=d(this,Xt);return d(this,qe)!==null&&(t=String(d(this,qe))+t,d(this,Ve)!==null&&(t=String(d(this,Ve))+"-"+t)),t}},z=Wl;Xt=new WeakMap,qe=new WeakMap,Ve=new WeakMap;_n=class extends We{constructor(...t){super();ee(this,Ne,void 0);if(typeof t[0]=="string")if(t[1]??null){V(this,Ne,new En(z.fromString(t[0]),t[1]));return}else return _n.fromString(t[0]);V(this,Ne,new En(t[0],t[1]))}isIdentical(t){let r=t.as(_n);return!!r&&d(this,Ne).isIdentical(d(r,Ne))}invert(){return z2(this,new _n(d(this,Ne).quantum,-this.amount))}*experimentalExpand(t=1){t===1?yield this:yield this.modified({amount:-this.amount})}get quantum(){return d(this,Ne).quantum}modified(t){return new _n(d(this,Ne).quantum.modified(t),t.amount??this.amount)}static fromString(t){return _2(t)}get amount(){return d(this,Ne).amount}get type(){return Ol("deprecated: type"),"blockMove"}get family(){return d(this,Ne).quantum.family??void 0}get outerLayer(){return d(this,Ne).quantum.outerLayer??void 0}get innerLayer(){return d(this,Ne).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return d(this,Ne).quantum.toString().slice(0,-6)+Math.abs(this.amount)+(this.amount<0?"-":"+");if(this.family.endsWith("_PLUSPLUS_")){let t=Math.abs(this.amount);return d(this,Ne).quantum.toString().slice(0,-10)+(t===1?"":t)+(this.amount<0?"--":"++")}return d(this,Ne).quantum.toString()+d(this,Ne).suffix()}},B=_n;Ne=new WeakMap});var M2,P2,at,Kl,je,Gl=y(()=>{Jt();Zt();Tt();Yt();Qa();M2=class{constructor(){this.quantumU_SQ_=null;this.quantumD_SQ_=null}format(t){let r=this.tuple(t);return r?\`(\${r.map(n=>n.amount).join(", ")})\`:null}tuple(t){this.quantumU_SQ_||(this.quantumU_SQ_=new z("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new z("D_SQ_"));let r=t.alg;if(r.experimentalNumUnits()===2){let[n,o]=r.units();if(n.as(B)?.quantum.isIdentical(this.quantumU_SQ_)&&o.as(B)?.quantum.isIdentical(this.quantumD_SQ_)){if(t.amount!==1)throw new Error("Square-1 tuples cannot have an amount other than 1.");return[n,o]}}return null}},P2=new M2,Kl=class extends We{constructor(t,r){super();ee(this,at,void 0);let n=cr(t);V(this,at,new En(n,r))}isIdentical(t){let r=t;return t.is(Kl)&&d(this,at).isIdentical(d(r,at))}get alg(){return d(this,at).quantum}get amount(){return d(this,at).amount}get experimentalRepetitionSuffix(){return d(this,at).suffix()}invert(){return new Kl(d(this,at).quantum,-d(this,at).amount)}*experimentalExpand(t=1,r){r??(r=1/0),r===0?yield t===1?this:this.invert():yield*d(this,at).experimentalExpand(t,r-1)}static fromString(){throw new Error("unimplemented")}toString(){return P2.format(this)??\`(\${d(this,at).quantum.toString()})\${d(this,at).suffix()}\`}experimentalAsSquare1Tuple(){return P2.tuple(this)}},je=Kl;at=new WeakMap});var Co=y(()=>{Gl();_o();vo();Eo();Yt();ko();zo()});function St(e,t){return e instanceof t}function N2(e){return St(e,je)||St(e,xt)||St(e,Ke)||St(e,Qe)||St(e,B)||St(e,et)||St(e,Ce)}var ja=y(()=>{Co()});function O2(e,t,r){if(t.is(je))return e.traverseGrouping(t,r);if(t.is(B))return e.traverseMove(t,r);if(t.is(Ke))return e.traverseCommutator(t,r);if(t.is(Qe))return e.traverseConjugate(t,r);if(t.is(Ce))return e.traversePause(t,r);if(t.is(et))return e.traverseNewline(t,r);if(t.is(xt))return e.traverseLineComment(t,r);throw new Error("unknown unit")}function I2(e){if(e.is(je)||e.is(B)||e.is(Ke)||e.is(Qe)||e.is(Ce)||e.is(et)||e.is(xt))return e;throw new Error("internal error: expected unit")}var kn,zn,Ql,Po,T2,jl,Gm,Va,qa,G2,W2,Ha=y(()=>{Gl();vo();Yt();ko();zo();Eo();_o();kn=class{traverseUnit(t,r){return O2(this,t,r)}traverseIntoUnit(t,r){return I2(this.traverseUnit(t,r))}},zn=class extends kn{traverseUnit(t){return O2(this,t,void 0)}traverseIntoUnit(t){return I2(this.traverseUnit(t))}},Va=class extends kn{constructor(){super(...arguments);ee(this,Po);ee(this,Ql,void 0)}*traverseAlg(t,r){if(r.depth===0){yield*t.units();return}let n=[],o=null,l=r?.collapseMoves??!0;function i(f,u){var c;let g=kl(c=Va,jl,Gm).call(c,f,u,r);if(g===0)return!1;let p=new B(f.quantum,g);return n.push(p),o=p,!0}function a(f){l&&o?.is(B)&&f.is(B)&&o.quantum.isIdentical(f.quantum)?(n.pop(),i(o,f.amount)||(o=n.slice(-1)[0])):f.is(B)?i(f,0):(n.push(f),o=f)}let s={depth:r.depth?r.depth-1:null};for(let f of t.units())for(let u of this.traverseUnit(f,s))a(u);for(let f of n)yield f}*traverseGrouping(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null},o=new je(this.traverseAlg(t.alg,n),t.amount),l=kl(this,Po,T2).call(this).get(t);l&&(o.experimentalNISSPlaceholder=l,l.experimentalNISSGrouping=o),yield o}*traverseMove(t,r){yield t}*traverseCommutator(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new Ke(this.traverseAlg(t.A,n),this.traverseAlg(t.B,n))}*traverseConjugate(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new Qe(this.traverseAlg(t.A,n),this.traverseAlg(t.B,n))}*traversePause(t,r){if(t.experimentalNISSGrouping){let n=new Ce;kl(this,Po,T2).call(this).set(t.experimentalNISSGrouping,n),yield n}else yield t}*traverseNewline(t,r){yield t}*traverseLineComment(t,r){yield t}},qa=Va;Ql=new WeakMap,Po=new WeakSet,T2=function(){return d(this,Ql)??V(this,Ql,new Map)},jl=new WeakSet,Gm=function(t,r,n){let o=t.amount+r;if(n?.quantumMoveOrder){let l=n.quantumMoveOrder(t.quantum),i=Math.floor(l/2)+1-l;o=(o%l+l-i)%l+i}return o},ee(qa,jl);G2=new qa,W2=G2.traverseAlg.bind(G2)});function K2(e){if(!e)return[];if(St(e,E))return e.units();if(typeof e=="string")return Ia(e).units();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw new Error("Invalid unit")}function cr(e){return St(e,E)?e:new E(e)}function Om(e,t){return e.is(et)||t.is(et)||t.as(je)?.experimentalNISSPlaceholder?"":e.is(xt)&&!t.is(et)?\`
8
+ \`:" "}var st,Hr,E,Jt=y(()=>{Zt();ja();Tt();Wa();Ha();Co();_o();Yt();ko();Ka();Hr=class extends We{constructor(t){super();ee(this,st,void 0);V(this,st,Array.from(K2(t)));for(let r of d(this,st))if(!N2(r))throw new Error("An alg can only contain units.")}isIdentical(t){let r=t;if(!t.is(Hr))return!1;let n=Array.from(d(this,st)),o=Array.from(d(r,st));if(n.length!==o.length)return!1;for(let l=0;l<n.length;l++)if(!n[l].isIdentical(o[l]))return!1;return!0}invert(){return new Hr(w2(Array.from(d(this,st)).map(t=>t.invert())))}*experimentalExpand(t=1,r){r??(r=1/0);for(let n of S2(d(this,st),t))yield*n.experimentalExpand(t,r)}expand(t){return new Hr(this.experimentalExpand(1,t?.depth??1/0))}*experimentalLeafMoves(){for(let t of this.experimentalExpand())t.is(B)&&(yield t)}concat(t){return new Hr(Array.from(d(this,st)).concat(Array.from(K2(t))))}experimentalIsEmpty(){for(let t of d(this,st))return!1;return!0}static fromString(t){return Ia(t)}*units(){for(let t of d(this,st))yield t}experimentalNumUnits(){return Array.from(d(this,st)).length}get type(){return Ol("deprecated: type"),"sequence"}toString(){let t="",r=null;for(let n of d(this,st)){r&&(t+=Om(r,n));let o=n.as(Ce)?.experimentalNISSGrouping;if(o){if(o.amount!==-1)throw new Error("Invalid NISS Grouping amount!");t+=\`^(\${o.alg.toString()})\`}else n.as(je)?.experimentalNISSPlaceholder||(t+=n.toString());r=n}return t}simplify(t){return new Hr(W2(this,t??{}))}},E=Hr;st=new WeakMap});var Im,Q2=y(()=>{Jt();Co();vo();Eo();Yt();zo();Im={Sune:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",1),new B("R",1),new B("U",-2),new B("R",-1)]),AntiSune:new E([new B("R",1),new B("U",2),new B("R",-1),new B("U",-1),new B("R",1),new B("U",-1),new B("R",-1)]),SuneCommutator:new E([new Ke(new E([new B("R",1),new B("U",1),new B("R",-2)]),new E([new Qe(new E([new B("R",1)]),new E([new B("U",1)]))]))]),Niklas:new E([new B("R",1),new B("U",-1),new B("L",-1),new B("U",1),new B("R",-1),new B("U",-1),new B("L",1),new B("U",1)]),EPerm:new E([new B("x",-1),new Ke(new E([new Qe(new E([new B("R",1)]),new E([new B("U",-1)]))]),new E([new B("D",1)])),new Ke(new E([new Qe(new E([new B("R",1)]),new E([new B("U",1)]))]),new E([new B("D",1)])),new B("x",1)]),FURURFCompact:new E([new Qe(new E([new B("F",1)]),new E([new Ke(new E([new B("U",1)]),new E([new B("R",1)]))]))]),APermCompact:new E([new Qe(new E([new B("R",2)]),new E([new Ke(new E([new B("F",2)]),new E([new B("R",-1),new B("B",-1),new B("R",1)]))]))]),FURURFMoves:new E([new B("F",1),new B("U",1),new B("R",1),new B("U",-1),new B("R",-1),new B("F",-1)]),TPerm:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",-1),new B("R",-1),new B("F",1),new B("R",2),new B("U",-1),new B("R",-1),new B("U",-1),new B("R",1),new B("U",1),new B("R",-1),new B("F",-1)]),HeadlightSwaps:new E([new Qe(new E([new B("F",1)]),new E([new je(new E([new Ke(new E([new B("R",1)]),new E([new B("U",1)]))]),3)]))]),TriplePause:new E([new Ce,new Ce,new Ce])}});var zA,j2=y(()=>{Yt();zA={73:new B("R"),75:new B("R'"),87:new B("B"),79:new B("B'"),83:new B("D"),76:new B("D'"),68:new B("L"),69:new B("L'"),74:new B("U"),70:new B("U'"),72:new B("F"),71:new B("F'"),78:new B("x'"),67:new B("l"),82:new B("l'"),85:new B("r"),77:new B("r'"),88:new B("d"),188:new B("d'"),84:new B("x"),89:new B("x"),66:new B("x'"),186:new B("y"),59:new B("y"),65:new B("y'"),80:new B("z"),81:new B("z'"),90:new B("M'"),190:new B("M'")}});var q2=y(()=>{});var V2=y(()=>{Jt()});var Be=y(()=>{Jt();Ta();Ha();Q2();j2();Co();Yt();q2();V2();ja();Ga()});function No(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Mo(l.numOrientations,a))n[o]=i;else if(Mo(l.numOrientations,i))n[o]=a;else{let s=new Array(l.numPieces);if(l.numOrientations===1){for(let f=0;f<l.numPieces;f++)s[f]=i.permutation[a.permutation[f]];n[o]={permutation:s,orientation:i.orientation}}else{let f=new Array(l.numPieces);for(let u=0;u<l.numPieces;u++)f[u]=(i.orientation[a.permutation[u]]+a.orientation[u])%l.numOrientations,s[u]=i.permutation[a.permutation[u]];n[o]={permutation:s,orientation:f}}}}return n}function Za(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Mo(l.numOrientations,a))n[o]=i;else{let s=new Array(l.numPieces);if(l.numOrientations===1){for(let f=0;f<l.numPieces;f++)s[f]=i.pieces[a.permutation[f]];n[o]={pieces:s,orientation:i.orientation}}else{let f=new Array(l.numPieces);for(let u=0;u<l.numPieces;u++)f[u]=(i.orientation[a.permutation[u]]+a.orientation[u])%l.numOrientations,s[u]=i.pieces[a.permutation[u]];n[o]={pieces:s,orientation:f}}}}return n}var ql=y(()=>{To()});function Wm(e){let t=H2.get(e);if(t)return t;let r=new Array(e),n=new Array(e);for(let l=0;l<e;l++)r[l]=l,n[l]=0;let o={permutation:r,orientation:n};return Z2&&(Object.freeze(r),Object.freeze(n),Object.freeze(o)),H2.set(e,o),o}function J2(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=Wm(n.numPieces);return Z2&&Object.freeze(t),t}function Y2(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(!n){let i=e.definition.experimentalDerivedMoves?.[r];i&&(n=e.algToTransformation(i).transformationData)}if(n)return Lr(e,n,t.amount);let o=e.definition.moves[t.toString()];if(o)return o;let l=e.definition.moves[t.invert().toString()];if(l)return Lr(e,l,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var Z2,H2,Ja=y(()=>{To();Z2=!1,H2=new Map});var ce,Vl=y(()=>{ql();Go();ce=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),stateData:this.stateData}}static fromTransformation(t){let r=Za(t.kpuzzle.definition,t.kpuzzle.definition.startStateData,t.transformationData);return new ce(t.kpuzzle,r)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(t.isIdentityTransformation())return new ce(this.kpuzzle,this.stateData);let r=Za(this.kpuzzle.definition,this.stateData,t.transformationData);return new ce(this.kpuzzle,r)}applyMove(t){return this.applyTransformation(this.kpuzzle.moveToTransformation(t))}applyAlg(t){return this.applyTransformation(this.kpuzzle.algToTransformation(t))}experimentalToTransformation(){if(!this.kpuzzle.canConvertStateToUniqueTransformation())return null;let t={};for(let[r,n]of Object.entries(this.stateData)){let o={permutation:n.pieces,orientation:n.orientation};t[r]=o}return new wt(this.kpuzzle,t)}experimentalIsSolved(t){if(!this.kpuzzle.definition.experimentalIsStateSolved)throw new Error("\`KState.experimentalIsSolved()\` is not supported for this puzzle at the moment.");return this.kpuzzle.definition.experimentalIsStateSolved(this,t)}}});var Zr,Br,wt,Go=y(()=>{To();ql();Ja();Vl();Br=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;ee(this,Zr,void 0)}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),transformationData:this.transformationData}}invert(){return new Br(this.kpuzzle,Ya(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return d(this,Zr)??V(this,Zr,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new Br(t,J2(t.definition));return V(r,Zr,!0),r}isIdentical(t){return X2(this.kpuzzle,this.transformationData,t.transformationData)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(this.kpuzzle!==t.kpuzzle)throw new Error(\`Tried to apply a transformation for a KPuzzle (\${t.kpuzzle.name()}) to a different KPuzzle (\${this.kpuzzle.name()}).\`);return d(this,Zr)?new Br(this.kpuzzle,t.transformationData):d(t,Zr)?new Br(this.kpuzzle,this.transformationData):new Br(this.kpuzzle,No(this.kpuzzle.definition,this.transformationData,t.transformationData))}applyMove(t){return this.applyTransformation(this.kpuzzle.moveToTransformation(t))}applyAlg(t){return this.applyTransformation(this.kpuzzle.algToTransformation(t))}toKState(){return ce.fromTransformation(this)}repetitionOrder(){return $2(this.kpuzzle.definition,this)}selfMultiply(t){return new Br(this.kpuzzle,Lr(this.kpuzzle,this.transformationData,t))}},wt=Br;Zr=new WeakMap});function Mo(e,t){let{permutation:r}=t,n=r.length;for(let o=0;o<n;o++)if(r[o]!==o)return!1;if(e>1){let{orientation:o}=t;for(let l=0;l<n;l++)if(o[l]!==0)return!1}return!0}function Km(e,t,r,n={}){for(let o=0;o<e.numPieces;o++)if(!n?.ignoreOrientation&&t.orientation[o]!==r.orientation[o]||!n?.ignorePermutation&&t.permutation[o]!==r.permutation[o])return!1;return!0}function X2(e,t,r){for(let[n,o]of Object.entries(e.definition.orbits))if(!Km(o,t[n],r[n]))return!1;return!0}function Ya(e,t){let r={};for(let n in e.definition.orbits){let o=e.definition.orbits[n],l=t[n];if(Mo(o.numOrientations,l))r[n]=l;else if(o.numOrientations===1){let i=new Array(o.numPieces);for(let a=0;a<o.numPieces;a++)i[l.permutation[a]]=a;r[n]={permutation:i,orientation:l.orientation}}else{let i=new Array(o.numPieces),a=new Array(o.numPieces);for(let s=0;s<o.numPieces;s++){let f=l.permutation[s];i[f]=s,a[f]=(o.numOrientations-l.orientation[s]+o.numOrientations)%o.numOrientations}r[n]={permutation:i,orientation:a}}}return r}function Lr(e,t,r){if(r===1)return t;if(r<0)return Lr(e,Ya(e,t),-r);if(r===0){let{transformationData:l}=e.identityTransformation();return l}let n=t;r!==2&&(n=Lr(e,t,Math.floor(r/2)));let o=No(e.definition,n,n);return r%2===0?o:No(e.definition,t,o)}function Xa(e,t){return t?Xa(t,e%t):e}function $2(e,t){let r=1;for(let n in e.orbits){let o=e.orbits[n],l=t.transformationData[n],i=new Array(o.numPieces);for(let a=0;a<o.numPieces;a++)if(!i[a]){let s=a,f=0,u=0;for(;i[s]=!0,f=f+l.orientation[s],u=u+1,s=l.permutation[s],s!==a;);f!==0&&(u=u*o.numOrientations/Xa(o.numOrientations,f)),r=r*u/Xa(r,u)}}return r}var tf,ef,rf,To=y(()=>{Be();ql();Go();tf=class extends kn{traverseAlg(t,r){let n=null;for(let o of t.units())n?n=n.applyTransformation(this.traverseUnit(o,r)):n=this.traverseUnit(o,r);return n??r.identityTransformation()}traverseGrouping(t,r){let n=this.traverseAlg(t.alg,r);return new wt(r,Lr(r,n.transformationData,t.amount))}traverseMove(t,r){return r.moveToTransformation(t)}traverseCommutator(t,r){let n=this.traverseAlg(t.A,r),o=this.traverseAlg(t.B,r);return n.applyTransformation(o).applyTransformation(n.invert()).applyTransformation(o.invert())}traverseConjugate(t,r){let n=this.traverseAlg(t.A,r),o=this.traverseAlg(t.B,r);return n.applyTransformation(o).applyTransformation(n.invert())}traversePause(t,r){return r.identityTransformation()}traverseNewline(t,r){return r.identityTransformation()}traverseLineComment(t,r){return r.identityTransformation()}},ef=new tf,rf=ef.traverseAlg.bind(ef)});var Cn,Hl,xe,nf=y(()=>{Be();To();Ja();Vl();Go();xe=class{constructor(t,r){this.definition=t;ee(this,Cn,new Map);ee(this,Hl,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return wt.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new B(t));let r=t.toString(),n=d(this,Cn).get(r);if(n)return new wt(this,n);if(this.experimentalPGNotation){let l=this.experimentalPGNotation.lookupMove(t);if(!l)throw new Error(\`could not map to internal move: \${t}\`);return d(this,Cn).set(r,l),new wt(this,l)}let o=Y2(this,t);return d(this,Cn).set(r,o),new wt(this,o)}algToTransformation(t){return typeof t=="string"&&(t=new E(t)),rf(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(E)?this.algToTransformation(t):t?.is?.(B)?this.moveToTransformation(t):t}startState(){return new ce(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return d(this,Hl)??V(this,Hl,(()=>{for(let[t,r]of Object.entries(this.definition.orbits)){let n=new Array(r.numPieces).fill(!1);for(let o of this.definition.startStateData[t].pieces)n[o]=!0;for(let o of n)if(!o)return!1}return!0})())}get state(){throw new Error("KPuzzle is now a different (stateless) class.")}reset(){throw new Error("KPuzzle is now a different (stateless) class.")}applyMove(t){throw new Error("KPuzzle is now a different class. Try \`.moveToTransformation()\` to get the transformation for a move.")}applyAlg(t){throw new Error("KPuzzle is now a different class. Try \`.algToTransformation()\` to get the transformation for an alg.")}};Cn=new WeakMap,Hl=new WeakMap});var He=y(()=>{nf();Vl();Go()});var Qm,Py,of=y(()=>{Qm={"333":{puzzleID:"3x3x3",eventName:"3x3x3 Cube"},"222":{puzzleID:"2x2x2",eventName:"2x2x2 Cube"},"444":{puzzleID:"4x4x4",eventName:"4x4x4 Cube"},"555":{puzzleID:"5x5x5",eventName:"5x5x5 Cube"},"666":{puzzleID:"6x6x6",eventName:"6x6x6 Cube"},"777":{puzzleID:"7x7x7",eventName:"7x7x7 Cube"},"333bf":{puzzleID:"3x3x3",eventName:"3x3x3 Blindfolded"},"333fm":{puzzleID:"3x3x3",eventName:"3x3x3 Fewest Moves"},"333oh":{puzzleID:"3x3x3",eventName:"3x3x3 One-Handed"},clock:{puzzleID:"clock",eventName:"Clock"},minx:{puzzleID:"megaminx",eventName:"Megaminx"},pyram:{puzzleID:"pyraminx",eventName:"Pyraminx"},skewb:{puzzleID:"skewb",eventName:"Skewb"},sq1:{puzzleID:"square1",eventName:"Square-1"},"444bf":{puzzleID:"4x4x4",eventName:"4x4x4 Blindfolded"},"555bf":{puzzleID:"5x5x5",eventName:"5x5x5 Blindfolded"},"333mb":{puzzleID:"3x3x3",eventName:"3x3x3 Multi-Blind"}},Py={...Qm,fto:{puzzleID:"fto",eventName:"Face-Turning Octahedron"},master_tetraminx:{puzzleID:"master_tetraminx",eventName:"Master Tetraminx"},kilominx:{puzzleID:"kilominx",eventName:"Kilominx"},redi_cube:{puzzleID:"redi_cube",eventName:"Redi Cube"}}});function eL(e){switch(e){case"Regular":return jm;case"Dim":return Ym;case"Ignored":return qm;case"OrientationStickers":return Vm;case"Invisible":return Hm;case"IgnoreNonPrimary":return Zm;case"PermuteNonPrimary":return Jm;case"Ignoriented":return Xm;case"OrientationWithoutPermutation":return $m}}var Jr,Gt,Ze,Pn,Zl,Yr,jm,qm,Vm,Hm,Zm,Jm,Ym,Xm,$m,Oo,Io,Jl=y(()=>{Jr=class{constructor(t,r){this.stickerings=new Map;for(let[n,o]of Object.entries(t.definition.orbits))this.stickerings.set(n,new Array(o.numPieces).fill(r))}},Gt="regular",Ze="ignored",Pn="oriented",Zl="invisible",Yr="dim",jm={facelets:[Gt,Gt,Gt,Gt,Gt]},qm={facelets:[Ze,Ze,Ze,Ze,Ze]},Vm={facelets:[Pn,Pn,Pn,Pn,Pn]},Hm={facelets:[Zl,Zl,Zl,Zl]},Zm={facelets:[Gt,Ze,Ze,Ze,Ze]},Jm={facelets:[Yr,Gt,Gt,Gt,Gt]},Ym={facelets:[Yr,Yr,Yr,Yr,Yr]},Xm={facelets:[Yr,Ze,Ze,Ze,Ze]},$m={facelets:[Pn,Ze,Ze,Ze,Ze]};Oo=class extends Jr{constructor(t){super(t,"Regular")}set(t,r){for(let[n,o]of this.stickerings.entries())for(let l=0;l<o.length;l++)t.stickerings.get(n)[l]&&(o[l]=r);return this}toAppearance(){let t={orbits:{}};for(let[r,n]of this.stickerings.entries()){let o=[],l={pieces:o};t.orbits[r]=l;for(let i of n)o.push(eL(i))}return t}},Io=class{constructor(t){this.kpuzzle=t}and(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let l=0;l<o.numPieces;l++){r.stickerings.get(n)[l]=!0;for(let i of t)if(!i.stickerings.get(n)[l]){r.stickerings.get(n)[l]=!1;continue e}}}return r}or(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let l=0;l<o.numPieces;l++){r.stickerings.get(n)[l]=!1;for(let i of t)if(i.stickerings.get(n)[l]){r.stickerings.get(n)[l]=!0;continue e}}}return r}not(t){let r=new Jr(this.kpuzzle,!1);for(let[n,o]of Object.entries(this.kpuzzle.definition.orbits))for(let l=0;l<o.numPieces;l++)r.stickerings.get(n)[l]=!t.stickerings.get(n)[l];return r}all(){return this.and(this.moves([]))}move(t){let r=this.kpuzzle.moveToTransformation(t),n=new Jr(this.kpuzzle,!1);for(let[o,l]of Object.entries(this.kpuzzle.definition.orbits))for(let i=0;i<l.numPieces;i++)(r.transformationData[o].permutation[i]!==i||r.transformationData[o].orientation[i]!==0)&&(n.stickerings.get(o)[i]=!0);return n}moves(t){return t.map(r=>this.move(r))}orbits(t){let r=new Jr(this.kpuzzle,!1);for(let n of t)r.stickerings.get(n).fill(!0);return r}}});var $a,es=y(()=>{$a={full:{groups:{"3x3x3":"Stickering"}},OLL:{groups:{"3x3x3":"Last Layer"}},PLL:{groups:{"3x3x3":"Last Layer"}},LL:{groups:{"3x3x3":"Last Layer"}},COLL:{groups:{"3x3x3":"Last Layer"}},OCLL:{groups:{"3x3x3":"Last Layer"}},CLL:{groups:{"3x3x3":"Last Layer"}},ELL:{groups:{"3x3x3":"Last Layer"}},ZBLL:{groups:{"3x3x3":"Last Layer"}},LS:{groups:{"3x3x3":"Last Slot"}},ELS:{groups:{"3x3x3":"Last Slot"}},CLS:{groups:{"3x3x3":"Last Slot"}},ZBLS:{groups:{"3x3x3":"Last Slot"}},VLS:{groups:{"3x3x3":"Last Slot"}},WVLS:{groups:{"3x3x3":"Last Slot"}},F2L:{groups:{"3x3x3":"CFOP (Fridrich)"}},Daisy:{groups:{"3x3x3":"CFOP (Fridrich)"}},Cross:{groups:{"3x3x3":"CFOP (Fridrich)"}},EO:{groups:{"3x3x3":"ZZ"}},EOline:{groups:{"3x3x3":"ZZ"}},EOcross:{groups:{"3x3x3":"ZZ"}},CMLL:{groups:{"3x3x3":"Roux"}},L10P:{groups:{"3x3x3":"Roux"}},L6E:{groups:{"3x3x3":"Roux"}},L6EO:{groups:{"3x3x3":"Roux"}},"2x2x2":{groups:{"3x3x3":"Petrus"}},"2x2x3":{groups:{"3x3x3":"Petrus"}},"Void Cube":{groups:{"3x3x3":"Miscellaneous"}},invisible:{groups:{"3x3x3":"Miscellaneous"}},picture:{groups:{"3x3x3":"Miscellaneous"}},"centers-only":{groups:{"3x3x3":"Miscellaneous"}},"experimental-centers-U":{},"experimental-centers-U-D":{},"experimental-centers-U-L-D":{},"experimental-centers-U-L-B-D":{},"experimental-centers":{},"experimental-fto-fc":{groups:{fto:"Bencisco"}},"experimental-fto-f2t":{groups:{fto:"Bencisco"}},"experimental-fto-sc":{groups:{fto:"Bencisco"}},"experimental-fto-l2c":{groups:{fto:"Bencisco"}},"experimental-fto-lbt":{groups:{fto:"Bencisco"}},"experimental-fto-l3t":{groups:{fto:"Bencisco"}}}});async function $t(e,t){let r=await e.kpuzzle(),n=new Oo(r),o=new Io(r),l=()=>o.move("U"),i=()=>o.or(o.moves(["U","D"])),a=()=>o.or(o.moves(["L","R"])),s=()=>o.not(a()),f=()=>o.not(l()),u=()=>o.and([l(),o.orbits(["CENTERS"])]),g=()=>o.orbits(["CENTERS"]),p=()=>o.orbits(["EDGES"]),c=()=>o.orbits(["CORNERS"]),L=()=>o.or([s(),o.and([l(),p()])]),m=()=>o.and([o.and(o.moves(["F","R"])),p()]),R=()=>o.and([o.and(o.moves(["F","R"])),c(),o.not(l())]),F=()=>o.or([R(),m()]);function A(){n.set(f(),"Dim")}function U(){n.set(l(),"PermuteNonPrimary"),n.set(u(),"Dim")}function x(){n.set(l(),"IgnoreNonPrimary"),n.set(u(),"Regular")}function S(){n.set(l(),"Ignoriented"),n.set(u(),"Dim")}switch(t){case"full":break;case"PLL":A(),U();break;case"CLS":A(),n.set(R(),"Regular"),n.set(l(),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"OLL":A(),x();break;case"COLL":A(),n.set(o.and([l(),p()]),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"Regular");break;case"OCLL":A(),S(),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"CLL":A(),n.set(o.not(o.and([c(),l()])),"Dim");break;case"ELL":A(),n.set(l(),"Dim"),n.set(o.and([l(),p()]),"Regular");break;case"ELS":A(),x(),n.set(o.and([l(),c()]),"Ignored"),n.set(m(),"Regular"),n.set(R(),"Ignored");break;case"LL":A();break;case"F2L":n.set(l(),"Ignored");break;case"ZBLL":A(),n.set(l(),"PermuteNonPrimary"),n.set(u(),"Dim"),n.set(o.and([l(),c()]),"Regular");break;case"ZBLS":A(),n.set(F(),"Regular"),x(),n.set(o.and([l(),c()]),"Ignored");break;case"VLS":A(),n.set(F(),"Regular"),x();break;case"WVLS":A(),n.set(F(),"Regular"),n.set(o.and([l(),p()]),"Ignoriented"),n.set(o.and([l(),g()]),"Dim"),n.set(o.and([l(),c()]),"IgnoreNonPrimary");break;case"LS":A(),n.set(F(),"Regular"),n.set(l(),"Ignored"),n.set(u(),"Dim");break;case"EO":n.set(c(),"Ignored"),n.set(p(),"OrientationWithoutPermutation");break;case"EOline":n.set(c(),"Ignored"),n.set(p(),"OrientationWithoutPermutation"),n.set(o.and(o.moves(["D","M"])),"Regular");break;case"EOcross":n.set(p(),"OrientationWithoutPermutation"),n.set(o.move("D"),"Regular"),n.set(c(),"Ignored");break;case"CMLL":n.set(f(),"Dim"),n.set(L(),"Ignored"),n.set(o.and([l(),c()]),"Regular");break;case"L10P":n.set(o.not(L()),"Dim"),n.set(o.and([c(),l()]),"Regular");break;case"L6E":n.set(o.not(L()),"Dim");break;case"L6EO":n.set(o.not(L()),"Dim"),n.set(L(),"OrientationWithoutPermutation"),n.set(o.and([g(),i()]),"OrientationStickers");break;case"Daisy":n.set(o.all(),"Ignored"),n.set(g(),"Dim"),n.set(o.and([o.move("D"),g()]),"Regular"),n.set(o.and([o.move("U"),p()]),"IgnoreNonPrimary");break;case"Cross":n.set(o.all(),"Ignored"),n.set(g(),"Dim"),n.set(o.and([o.move("D"),g()]),"Regular"),n.set(o.and([o.move("D"),p()]),"Regular");break;case"2x2x2":n.set(o.or(o.moves(["U","F","R"])),"Ignored"),n.set(o.and([o.or(o.moves(["U","F","R"])),g()]),"Dim");break;case"2x2x3":n.set(o.all(),"Dim"),n.set(o.or(o.moves(["U","F","R"])),"Ignored"),n.set(o.and([o.or(o.moves(["U","F","R"])),g()]),"Dim"),n.set(o.and([o.move("F"),o.not(o.or(o.moves(["U","R"])))]),"Regular");break;case"Void Cube":n.set(g(),"Invisible");break;case"picture":case"invisible":n.set(o.all(),"Invisible");break;case"centers-only":n.set(o.not(g()),"Ignored");break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),"Dim")}return n.toAppearance()}async function Mn(){let e=[];for(let[t,r]of Object.entries($a))r.groups&&"3x3x3"in r.groups&&e.push(t);return e}var Wo=y(()=>{Jl();es()});function he(e){let t=null;return()=>t??(t=e())}var Ot=y(()=>{});var Ko,lf=y(()=>{Ko=class{constructor(t,r){this.facenames=t;this.prefixFree=!0;this.gripnames=[];r&&(this.gripnames=r);for(let n=0;this.prefixFree&&n<t.length;n++)for(let o=0;this.prefixFree&&o<t.length;o++)n!==o&&t[n].startsWith(t[o])&&(this.prefixFree=!1)}setGripNames(t){this.gripnames=t}splitByFaceNames(t){let r=[],n=0;for(;n<t.length;){n>0&&n<t.length&&t[n]==="_"&&n++;let o=-1;for(let l=0;l<this.facenames.length;l++)t.substr(n).startsWith(this.facenames[l])&&(o<0||this.facenames[l].length>this.facenames[o].length)&&(o=l);if(o>=0)r.push(o),n+=this.facenames[o].length;else throw new Error("Could not split "+t+" into face names.")}return r}joinByFaceIndices(t){let r="",n=[];for(let o=0;o<t.length;o++)n.push(r),n.push(this.facenames[t[o]]),this.prefixFree||(r="_");return n.join("")}spinmatch(t,r){if(t===r)return!0;try{let n=this.splitByFaceNames(t),o=this.splitByFaceNames(r);if(n.length!==o.length&&n.length<3)return!1;for(let l=0;l<n.length;l++){for(let a=0;a<l;a++)if(n[l]===n[a])return!1;let i=!1;for(let a=0;a<o.length;a++)if(n[l]===o[a]){i=!0;break}if(!i)return!1}return!0}catch{return!1}}spinmatchv(t,r){return t.endsWith("v")&&r.endsWith("v")?this.spinmatch(t.slice(0,t.length-1),r.slice(0,r.length-1)):this.spinmatch(t,r)}unswizzle(t){(t.endsWith("v")||t.endsWith("w"))&&t[0]<="Z"&&(t=t.slice(0,t.length-1));let r=t.toUpperCase();for(let n=0;n<this.gripnames.length;n++){let o=this.gripnames[n];if(this.spinmatch(r,o))return o}return t}}});var Nn,af=y(()=>{Nn=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var Yl,sf=y(()=>{Be();Yl=class{constructor(t,r){this.child=t;this.sw=r}notationToInternal(t){return t.family==="T"&&t.innerLayer===void 0&&t.outerLayer===void 0?new B(new z("FLRv",t.innerLayer,t.outerLayer),t.amount):this.child.notationToInternal(t)}notationToExternal(t){let r=t.family;return r.length>0&&r[r.length-1]==="v"&&(r=r.substring(0,r.length-1)),this.sw.spinmatch(r,"FLUR")?new B(new z("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var Qo,ff=y(()=>{Be();Qo=class{constructor(t,r){this.internalNames=t;this.externalNames=r}convertString(t,r,n){let o="";(t.endsWith("v")||t.endsWith("v"))&&t<="_"&&(o=t.slice(t.length-1),t=t.slice(0,t.length-1));let l=t.toUpperCase(),i=!1;return t!==l&&(i=!0,t=l),t=n.joinByFaceIndices(r.splitByFaceNames(t)),i&&(t=t.toLowerCase()),t+o}convert(t,r,n){let o=t.family,l=this.convertString(o,r,n);return o===l?t:new B(new z(l,t.innerLayer,t.outerLayer),t.amount)}notationToInternal(t){return this.convert(t,this.externalNames,this.internalNames)}notationToExternal(t){return this.convert(t,this.internalNames,this.externalNames)}}});var Xl,uf=y(()=>{Be();Xl=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer===void 0&&t.outerLayer===void 0){if(Math.abs(t.amount)===1){if(t.family==="R++")return new B(new z("L",3,2),-2*t.amount);if(t.family==="R--")return new B(new z("L",3,2),2*t.amount);if(t.family==="D++")return new B(new z("U",3,2),-2*t.amount);if(t.family==="D--")return new B(new z("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new B(new z("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new B(new z("U",3,2),-2*t.amount)}if(t.family==="y")return new B("Uv",t.amount);if(t.family==="x"&&Math.abs(t.amount)===2)return new B("ERv",t.amount/2)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="ERv"&&Math.abs(t.amount)===1?new B(new z("x",t.innerLayer,t.outerLayer),t.amount*2):t.family==="ILv"&&Math.abs(t.amount)===1?new B(new z("x",t.innerLayer,t.outerLayer),-t.amount*2):t.family==="Uv"?new B(new z("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new B("y",-t.amount):this.child.notationToExternal(t)}}});var $l,gf=y(()=>{Be();$l=class{constructor(t){this.slices=t}notationToInternal(t){let r=t.family;return!t.innerLayer&&!t.outerLayer&&(r==="x"?t=new B("Rv",t.amount):r==="y"?t=new B("Uv",t.amount):r==="z"&&(t=new B("Fv",t.amount)),(this.slices&1)===1&&(r==="E"?t=new B(new z("D",(this.slices+1)/2),t.amount):r==="M"?t=new B(new z("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new B(new z("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new B(new z("D",this.slices-1,2),t.amount):r==="m"?t=new B(new z("L",this.slices-1,2),t.amount):r==="s"&&(t=new B(new z("F",this.slices-1,2),t.amount)))),t}notationToExternal(t){let r=t.family;if(!t.innerLayer&&!t.outerLayer){if(r==="Rv")return new B("x",t.amount);if(r==="Uv")return new B("y",t.amount);if(r==="Fv")return new B("z",t.amount);if(r==="Lv")return new B("x",-t.amount);if(r==="Dv")return new B("y",-t.amount);if(r==="Bv")return new B("z",-t.amount)}return t}}});var rL,nL,pf,cf,mf,jo,ei,Lf=y(()=>{Be();rL={U:"frl",L:"fld",R:"fdr",B:"dlr",u:"FRL",l:"FLD",r:"FDR",b:"DLR",Uv:"FRLv",Lv:"FLDv",Rv:"FDRv",Bv:"DLRv",D:"D",F:"F",BL:"L",BR:"R"},nL={U:"FRL",L:"FLD",R:"FDR",B:"DLR",u:"frl",l:"fld",r:"fdr",b:"dlr",Uv:"FRLv",Lv:"FLDv",Rv:"FDRv",Bv:"DLRv",D:"D",F:"F",BL:"L",BR:"R",d:"d",f:"f",bl:"l",br:"r"},pf={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},cf=new z("y"),mf=new z("Dv"),jo=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=rL}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=pf[t.family];if(n)return new B(new z(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new B(new z(r,t.innerLayer,t.outerLayer),t.amount):cf.isIdentical(t.quantum)?new B(mf,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(pf))if(this.child.spinmatch(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount)}for(let[r,n]of Object.entries(this.map))if(this.child.spinmatch(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount);return mf.isIdentical(t.quantum)?new B(cf,-t.amount):null}},ei=class extends jo{constructor(t){super(t);this.wcaHack=!0;this.map=nL}}});var Bf,ts,Rf,oL,rs,df,lL,ns,hf,iL,ti,Ff=y(()=>{Be();Bf={U:"UBL",UL:"ULF",F:"UFR",UR:"URB",B:"DBL",D:"DFR",L:"DLF",R:"DRB",Uv:"UBLv",ULv:"ULFv",Fv:"UFRv",URv:"URBv",Bv:"DBLv",Dv:"DFRv",Lv:"DLFv",Rv:"DRBv"},ts=new z("x"),Rf=new z("Rv"),oL=new z("Lv"),rs=new z("y"),df=new z("Uv"),lL=new z("Dv"),ns=new z("z"),hf=new z("Fv"),iL=new z("Bv"),ti=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=Bf[t.family];return r?new B(new z(r,t.outerLayer,t.innerLayer),t.amount):ts.isIdentical(t.quantum)?new B(Rf,t.amount):rs.isIdentical(t.quantum)?new B(df,t.amount):ns.isIdentical(t.quantum)?new B(hf,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(Bf))if(this.child.spinmatchv(t.family,n))return new B(new z(r,t.innerLayer,t.outerLayer),t.amount);return Rf.isIdentical(t.quantum)?new B(ts,t.amount):oL.isIdentical(t.quantum)?new B(ts,-t.amount):df.isIdentical(t.quantum)?new B(rs,t.amount):lL.isIdentical(t.quantum)?new B(rs,-t.amount):hf.isIdentical(t.quantum)?new B(ns,t.amount):iL.isIdentical(t.quantum)?new B(ns,-t.amount):null}}});var os=y(()=>{af();sf();ff();uf();gf();Lf();Ff()});function Df(e){let t=0,r={};for(;t<e.length&&e[t][0]==="-";){let o=e[t++];if(o==="--rotations")r.addRotations=!0;else if(o==="--allmoves")r.allMoves=!0;else if(o==="--outerblockmoves")r.outerBlockMoves=!0;else if(o==="--vertexmoves")r.vertexMoves=!0;else if(o==="--nocorners")r.includeCornerOrbits=!1;else if(o==="--noedges")r.includeEdgeOrbits=!1;else if(o==="--noorientation")r.fixedOrientation=!0;else if(o==="--nocenters")r.includeCenterOrbits=!1;else if(o==="--omit")r.excludeOrbits=e[t].split(","),t++;else if(o==="--moves")r.moveList=e[t].split(","),t++;else if(o==="--optimize")r.optimizeOrbits=!0;else if(o==="--scramble")r.scrambleAmount=100;else if(o==="--fixcorner")r.fixedPieceType="v";else if(o==="--fixedge")r.fixedPieceType="e";else if(o==="--fixcenter")r.fixedPieceType="f";else if(o==="--orientcenters")r.orientCenters=!0;else if(o==="--puzzleorientation")r.puzzleOrientation=JSON.parse(e[t]),t++;else throw new Error("Bad option: "+o)}return{puzzleDescription:qo(e.slice(t).join(" ")),options:r}}var ls,is=y(()=>{Vo();ls=class{constructor(t={}){this.verbosity=0;this.allMoves=!1;this.vertexMoves=!1;this.addRotations=!1;this.moveList=null;this.fixedOrientation=!1;this.fixedPieceType=null;this.orientCenters=!1;this.includeCornerOrbits=!0;this.includeCenterOrbits=!0;this.includeEdgeOrbits=!0;this.excludeOrbits=[];this.optimizeOrbits=!1;this.grayCorners=!1;this.grayCenters=!1;this.grayEdges=!1;this.puzzleOrientation=null;this.puzzleOrientations=null;this.scrambleAmount=0;Object.assign(this,t)}}});function Rr(e){if(!as[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;as[e]=t}return as[e]}function It(e){if(!ss[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;ss[e]=t}return ss[e]}function Af(e){return new dt(It(e))}function yf(e){let t=1n;for(;e>1;)t*=BigInt(e),e--;return t}function aL(e,t){if(e>t){let r=e;e=t,t=r}for(;e>0;){let r=t%e;t=e,e=r}return t}function fs(e,t){return e/aL(e,t)*t}var as,ss,dt,ri=y(()=>{as=[],ss=[];dt=class{constructor(t){this.n=t.length,this.p=t}toString(){return"Perm["+this.p.join(" ")+"]"}mul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=t.p[this.p[n]];return new dt(r)}rmul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=this.p[t.p[n]];return new dt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new dt(t)}compareTo(t){for(let r=0;r<this.n;r++)if(this.p[r]!==t.p[r])return this.p[r]-t.p[r];return 0}toGap(){let t=new Array,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let o=new Array;for(let l=n;!r[l];l=this.p[l])o.push(1+l),r[l]=!0;t.push("("+o.join(",")+")")}return t.join("")}order(){let t=1,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let o=0;for(let l=n;!r[l];l=this.p[l])o++,r[l]=!0;t=fs(t,o)}return t}}});function ni(e,t){let r=B.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function Uf(e,t){let r=e.moveops.length;if(r>30)throw new Error("Canon info too big for bitmask");let n=[],o=[];for(let i=0;i<r;i++){let a=e.moveops[i];n.push(a.order());let s=0;for(let f=0;f<r;f++){if(f===i)continue;let u=e.moveops[f];a.mul(u).equal(u.mul(a))&&(s|=1<<f)}o.push(s)}let l={};l[0]=1;for(let i=0;i<100;i++){let a=0,s={},f=0;for(let u in l){let g=+u,p=l[g];a+=p,f++;for(let c=0;c<n.length;c++)if((g>>c&1)===0&&(g&o[c]&(1<<c)-1)===0){let L=g&o[c]|1<<c;s[L]===void 0&&(s[L]=0),s[L]+=(n[c]-1)*p}}t(\`\${i}: canonseq \${a} states \${f}\`),l=s}}var Ho,sL,Tn,vt,er,gs,dr,Gn,us,bf=y(()=>{Be();os();ri();Ho=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return yf(this.size)*BigInt(this.mod)**BigInt(this.size)}},sL=0;Tn=class{constructor(t,r,n,o,l,i,a){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=o;this.moveops=l;this.isRotation=i;this.forcenames=a}transformToKTransformationData(t){let r={};for(let n=0;n<this.orbitnames.length;n++)r[this.orbitnames[n]]=t.orbits[n].toKPuzzle();return r}static transformToKTransformationData(t,r){let n={};for(let o=0;o<t.length;o++)n[t[o]]=r.orbits[o].toKPuzzle();return n}describeSet(t,r,n){let o=this.orbitdefs[t].size,l=new Array(o);for(let i=0;i<o;i++)l[i]=[];for(let i=0;i<this.movenames.length;i++){if(this.isRotation[i])continue;let a=this.movenames[i];this.forcenames[i]||(a=ni(n,a),a[a.length-1]==="'"&&(a=a.substring(0,a.length-1)));let s=this.moveops[i].orbits[t];for(let f=0;f<o;f++)(s.perm[f]!=f||s.ori[f]!=0)&&l[f].push(a)}for(let i=0;i<o;i++)r.push("# "+(i+1)+" "+l[i].join(" "))}toKsolve(t,r=new Nn){let n=[];n.push("Name "+t),n.push("");for(let o=0;o<this.orbitnames.length;o++)n.push(\`Set \${this.orbitnames[o]} \${this.orbitdefs[o].size} \${this.orbitdefs[o].mod}\`),this.describeSet(o,n,r);n.push(""),n.push("Solved");for(let o=0;o<this.orbitnames.length;o++)this.solved.orbits[o].appendDefinition(n,this.orbitnames[o],!1,!1);n.push("End");for(let o=0;o<this.movenames.length;o++){n.push("");let l=this.movenames[o];this.forcenames[o]||(l=ni(r,this.movenames[o]));let i=!1;l[l.length-1]==="'"&&(i=!0,l=l.substring(0,l.length-1)),n.push("Move "+l);for(let a=0;a<this.orbitnames.length;a++)i?this.moveops[o].orbits[a].inv().appendDefinition(n,this.orbitnames[a],!0):this.moveops[o].orbits[a].appendDefinition(n,this.orbitnames[a],!0);n.push("End")}return n}toKPuzzleDefinition(t){let r={},n={};for(let l=0;l<this.orbitnames.length;l++){r[this.orbitnames[l]]={numPieces:this.orbitdefs[l].size,numOrientations:this.orbitdefs[l].mod};let i=this.solved.orbits[l].toKPuzzle();n[this.orbitnames[l]]={pieces:i.permutation,orientation:i.orientation}}let o={};if(t)for(let l=0;l<this.movenames.length;l++)o[this.movenames[l]]=this.transformToKTransformationData(this.moveops[l]);return{name:\`PG3D #\${++sL}\`,orbits:r,startStateData:n,moves:o}}optimize(){let t=[],r=[],n=[],o=[];for(let l=0;l<this.moveops.length;l++)o.push([]);for(let l=0;l<this.orbitdefs.length;l++){let i=this.orbitdefs[l].mod,a=this.orbitdefs[l].size,s=new us(a),f=new Array(this.orbitdefs[l].size);for(let c=0;c<a;c++)f[c]=!1;for(let c=0;c<this.moveops.length;c++)if(!this.isRotation[c])for(let L=0;L<a;L++)(this.moveops[c].orbits[l].perm[L]!==L||this.moveops[c].orbits[l].ori[L]!==0)&&(f[L]=!0,s.union(L,this.moveops[c].orbits[l].perm[L]));let u=!0;if(i>1){u=!1;let c=new us(this.orbitdefs[l].size*i);for(let L=0;L<this.moveops.length;L++)for(let m=0;m<a;m++)if(this.moveops[L].orbits[l].perm[m]!==m||this.moveops[L].orbits[l].ori[m]!==0)for(let R=0;R<i;R++)c.union(m*i+R,this.moveops[L].orbits[l].perm[m]*i+(R+this.moveops[L].orbits[l].ori[m])%i);for(let L=0;!u&&L<a;L++)for(let m=1;m<i;m++)c.find(L*i)===c.find(L*i+m)&&(u=!0);for(let L=0;!u&&L<a;L++)for(let m=0;m<L;m++)this.solved.orbits[l].perm[L]===this.solved.orbits[l].perm[m]&&(u=!0)}let g=-1,p=!1;for(let c=0;c<this.orbitdefs[l].size;c++)if(f[c]){let L=s.find(c);g<0?g=L:g!==L&&(p=!0)}for(let c=0;c<this.orbitdefs[l].size;c++){if(!f[c]||s.find(c)!==c)continue;let m=[],R=[],F=0;for(let A=0;A<this.orbitdefs[l].size;A++)s.find(A)===c&&(m[F]=A,R[A]=F,F++);if(p?t.push(\`\${this.orbitnames[l]}_p\${c}\`):t.push(this.orbitnames[l]),u){r.push(new Ho(F,this.orbitdefs[l].mod)),n.push(this.solved.orbits[l].remapVS(m,F));for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(m,R,F))}else{r.push(new Ho(F,1)),n.push(this.solved.orbits[l].remapVS(m,F).killOri());for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(m,R,F).killOri())}}}return new Tn(t,r,new Gn(n),this.movenames,o.map(l=>new dr(l)),this.isRotation,this.forcenames)}scramble(t){this.solved=this.solved.mul(this.getScrambleTransformation(t))}getScrambleTransformation(t){t<100&&(t=100);let r=[];for(let o=0;o<this.moveops.length;o++)r[o]=this.moveops[o];for(let o=0;o<r.length;o++){let l=Math.floor(Math.random()*r.length),i=r[o];r[o]=r[l],r[l]=i}t<r.length&&(t=r.length);for(let o=0;o<t;o++){let l=Math.floor(Math.random()*r.length),i=Math.floor(Math.random()*r.length),a=Math.floor(Math.random()*this.moveops.length);r[l]=r[l].mul(r[i]).mul(this.moveops[a]),Math.random()<.1&&(r[l]=r[l].mul(this.moveops[a]))}let n=r[0];for(let o=1;o<r.length;o++)n=n.mul(r[o]);return n}reassemblySize(){let t=1n;for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},vt=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new vt(It(t),Rr(t),r)}mul(t){let r=this.perm.length,n=new Array(r);if(this.orimod===1){for(let o=0;o<r;o++)n[o]=this.perm[t.perm[o]];return new vt(n,this.ori,this.orimod)}else{let o=new Array(r);for(let l=0;l<r;l++)n[l]=this.perm[t.perm[l]],o[l]=(this.ori[t.perm[l]]+t.ori[l])%this.orimod;return new vt(n,o,this.orimod)}}inv(){let t=this.perm.length,r=new Array(t),n=new Array(t);for(let o=0;o<t;o++)r[this.perm[o]]=o,n[this.perm[o]]=(this.orimod-this.ori[o])%this.orimod;return new vt(r,n,this.orimod)}equal(t){let r=this.perm.length;for(let n=0;n<r;n++)if(this.perm[n]!==t.perm[n]||this.ori[n]!==t.ori[n])return!1;return!0}killOri(){let t=this.perm.length;for(let r=0;r<t;r++)this.ori[r]=0;return this.orimod=1,this}toPerm(){let t=this.orimod;if(t===1)return new dt(this.perm);let r=this.perm.length,n=new Array(r*t);for(let o=0;o<r;o++)for(let l=0;l<t;l++)n[o*t+l]=t*this.perm[o]+(this.ori[o]+l)%t;return new dt(n)}identicalPieces(){let t=[],r=this.perm.length,n=[];for(let o=0;o<r;o++){let l=this.perm[o];if(t[l]===void 0){let i=[o];t[l]=!0;for(let a=o+1;a<r;a++)this.perm[a]===l&&i.push(a);n.push(i)}}return n}order(){return this.toPerm().order()}isIdentity(){let t=this.perm.length;if(this.perm===It(t)&&this.ori===Rr(t))return!0;for(let r=0;r<t;r++)if(this.perm[r]!==r||this.ori[r]!==0)return!1;return!0}zeroOris(){let t=this.perm.length;if(this.ori===Rr(t))return!0;for(let r=0;r<t;r++)if(this.ori[r]!==0)return!1;return!0}remap(t,r,n){let o=new Array(n),l=new Array(n);for(let i=0;i<n;i++)o[i]=r[this.perm[t[i]]],l[i]=this.ori[t[i]];return new vt(o,l,this.orimod)}remapVS(t,r){let n=new Array(r),o=new Array(r),l=0,i=[];for(let a=0;a<r;a++){let s=this.perm[t[a]];i[s]===void 0&&(i[s]=l++),n[a]=i[s],o[a]=this.ori[t[a]]}return new vt(n,o,this.orimod)}appendDefinition(t,r,n,o=!0){if(!(o&&this.isIdentity())&&(t.push(r),t.push(this.perm.map(l=>l+1).join(" ")),!this.zeroOris()))if(n){let l=new Array(this.ori.length);for(let i=0;i<l.length;i++)l[this.perm[i]]=this.ori[i];t.push(l.join(" "))}else t.push(this.ori.join(" "))}toKPuzzle(){let t=this.perm.length;return this.isIdentity()?(vt.kcache[t]||(vt.kcache[t]={permutation:It(t),orientation:Rr(t)}),vt.kcache[t]):{permutation:this.perm,orientation:this.ori}}},er=vt;er.kcache=[];gs=class{constructor(t){this.orbits=t}internalMul(t){let r=[];for(let n=0;n<this.orbits.length;n++)r.push(this.orbits[n].mul(t.orbits[n]));return r}internalInv(){let t=[];for(let r of this.orbits)t.push(r.inv());return t}equal(t){for(let r=0;r<this.orbits.length;r++)if(!this.orbits[r].equal(t.orbits[r]))return!1;return!0}killOri(){for(let t of this.orbits)t.killOri();return this}toPerm(){let t=new Array,r=0;for(let o of this.orbits){let l=o.toPerm();t.push(l),r+=l.n}let n=new Array(r);r=0;for(let o of t){for(let l=0;l<o.n;l++)n[r+l]=r+o.p[l];r+=o.n}return new dt(n)}identicalPieces(){let t=[],r=0;for(let n of this.orbits){let o=n.orimod,l=n.identicalPieces();for(let i=0;i<l.length;i++)t.push(l[i].map(a=>a*o+r));r+=o*n.perm.length}return t}order(){let t=1;for(let r of this.orbits)t=fs(t,r.order());return t}},dr=class extends gs{constructor(t){super(t)}mul(t){return new dr(this.internalMul(t))}mulScalar(t){if(t===0)return this.e();let r=this;for(t<0&&(r=r.inv(),t=-t);(t&1)===0;)r=r.mul(r),t>>=1;if(t===1)return r;let n=r,o=this.e();for(;t>0;)t&1&&(o=o.mul(n)),t>1&&(n=n.mul(n)),t>>=1;return o}inv(){return new dr(this.internalInv())}e(){return new dr(this.orbits.map(t=>er.e(t.perm.length,t.orimod)))}},Gn=class extends gs{constructor(t){super(t)}mul(t){return new Gn(this.internalMul(t))}},us=class{constructor(t){this.n=t;this.heads=new Array(t);for(let r=0;r<t;r++)this.heads[r]=r}find(t){let r=this.heads[t];return this.heads[r]===r||(r=this.find(this.heads[r]),this.heads[t]=r),r}union(t,r){let n=this.find(t),o=this.find(r);n<o?this.heads[o]=n:n>o&&(this.heads[n]=o)}}});var oi,xf=y(()=>{oi={"2x2x2":"c f 0","3x3x3":"c f 0.333333333333333","4x4x4":"c f 0.5 f 0","5x5x5":"c f 0.6 f 0.2","6x6x6":"c f 0.666666666666667 f 0.333333333333333 f 0","7x7x7":"c f 0.714285714285714 f 0.428571428571429 f 0.142857142857143","8x8x8":"c f 0.75 f 0.5 f 0.25 f 0","9x9x9":"c f 0.777777777777778 f 0.555555555555556 f 0.333333333333333 f 0.111111111111111","10x10x10":"c f 0.8 f 0.6 f 0.4 f 0.2 f 0","11x11x11":"c f 0.818181818181818 f 0.636363636363636 f 0.454545454545455 f 0.272727272727273 f 0.0909090909090909","12x12x12":"c f 0.833333333333333 f 0.666666666666667 f 0.5 f 0.333333333333333 f 0.166666666666667 f 0","13x13x13":"c f 0.846153846153846 f 0.692307692307692 f 0.538461538461538 f 0.384615384615385 f 0.230769230769231 f 0.0769230769230769","20x20x20":"c f 0 f .1 f .2 f .3 f .4 f .5 f .6 f .7 f .8 f .9","30x30x30":"c f 0 f .066667 f .133333 f .2 f .266667 f .333333 f .4 f .466667 f .533333 f .6 f .666667 f .733333 f .8 f .866667 f .933333","40x40x40":"c f 0 f .05 f .1 f .15 f .2 f .25 f .3 f .35 f .4 f .45 f .5 f .55 f .6 f .65 f .7 f .75 f .8 f .85 f .9 f .95",skewb:"c v 0","master skewb":"c v 0.275","professor skewb":"c v 0 v 0.38","compy cube":"c v 0.915641442663986",helicopter:"c e 0.707106781186547","curvy copter":"c e 0.83",dino:"c v 0.577350269189626","little chop":"c e 0",pyramorphix:"t e 0",mastermorphix:"t e 0.346184634065199",pyraminx:"t v 0.333333333333333 v 1.66666666666667",tetraminx:"t v 0.333333333333333","master pyraminx":"t v 0 v 1 v 2","master tetraminx":"t v 0 v 1","professor pyraminx":"t v -0.2 v 0.6 v 1.4 v 2.2","professor tetraminx":"t v -0.2 v 0.6 v 1.4","Jing pyraminx":"t f 0","master pyramorphix":"t e 0.866025403784437",megaminx:"d f 0.7",gigaminx:"d f 0.64 f 0.82",teraminx:"d f 0.64 f 0.76 f 0.88",petaminx:"d f 0.64 f 0.73 f 0.82 f 0.91",examinx:"d f 0.64 f 0.712 f 0.784 f 0.856 f 0.928",zetaminx:"d f 0.64 f 0.7 f 0.76 f 0.82 f 0.88 f 0.94",yottaminx:"d f 0.64 f 0.6914 f 0.7429 f 0.7943 f 0.8457 f 0.8971 f 0.9486",pentultimate:"d f 0","master pentultimate":"d f 0.1","elite pentultimate":"d f 0 f 0.145905",starminx:"d v 0.937962370425399","starminx 2":"d f 0.23606797749979","pyraminx crystal":"d f 0.447213595499989",chopasaurus:"d v 0","big chop":"d e 0","skewb diamond":"o f 0",FTO:"o f 0.333333333333333","master FTO":"o f 0.5 f 0","Christopher's jewel":"o v 0.577350269189626",octastar:"o e 0","Trajber's octahedron":"o v 0.433012701892219","radio chop":"i f 0",icosamate:"i v 0","icosahedron 2":"i v 0.18759247376021","icosahedron 3":"i v 0.18759247376021 e 0","icosahedron static faces":"i v 0.84","icosahedron moving faces":"i v 0.73","Eitan's star":"i f 0.61803398874989","2x2x2 + dino":"c f 0 v 0.577350269189626","2x2x2 + little chop":"c f 0 e 0","dino + little chop":"c v 0.577350269189626 e 0","2x2x2 + dino + little chop":"c f 0 v 0.577350269189626 e 0","megaminx + chopasaurus":"d f 0.61803398875 v 0","starminx combo":"d f 0.23606797749979 v 0.937962370425399"}});function li(e){let t=new W(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function Sf(e,t,r,n){let o=n[e].intersect3(n[t],n[r]);if(!o)return o;for(let l=0;l<n.length;l++)if(l!==e&&l!==t&&l!==r){let i=n[l].b*o.b+n[l].c*o.c+n[l].d*o.d;if(n[l].a>0&&i>n[l].a||n[l].a<0&&i<n[l].a)return!1}return o}var W,ii=y(()=>{W=class{constructor(t,r,n,o){this.a=t;this.b=r;this.c=n;this.d=o}mul(t){return new W(this.a*t.a-this.b*t.b-this.c*t.c-this.d*t.d,this.a*t.b+this.b*t.a+this.c*t.d-this.d*t.c,this.a*t.c-this.b*t.d+this.c*t.a+this.d*t.b,this.a*t.d+this.b*t.c-this.c*t.b+this.d*t.a)}toString(){return\`Q[\${this.a},\${this.b},\${this.c},\${this.d}]\`}dist(t){return Math.hypot(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}len(){return Math.hypot(this.a,this.b,this.c,this.d)}cross(t){return new W(0,this.c*t.d-this.d*t.c,this.d*t.b-this.b*t.d,this.b*t.c-this.c*t.b)}dot(t){return this.b*t.b+this.c*t.c+this.d*t.d}normalize(){let t=Math.sqrt(this.dot(this));return new W(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new W(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new W(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new W(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new W(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new W(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}angle(){return 2*Math.acos(this.a)}invrot(){return new W(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,o,l,i,a,s,f){return t*(l*f-i*s)+r*(i*a-o*f)+n*(o*s-l*a)}rotateplane(t){let r=t.mul(new W(0,this.b,this.c,this.d)).mul(t.invrot());return r.a=this.a,r}orthogonal(){let t=Math.abs(this.b),r=Math.abs(this.c),n=Math.abs(this.d);return t<r&&t<n?this.cross(new W(0,1,0,0)).normalize():r<t&&r<n?this.cross(new W(0,0,1,0)).normalize():this.cross(new W(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<1e-9)return new W(1,0,0,0);let n=r.sum(t);n.len()<1e-9?n=n.orthogonal():n=n.normalize();let o=r.cross(n);return o.a=r.dot(n),o}unproject(t){return this.sum(t.smul(-this.dot(t)/(this.len()*t.len())))}rotatepoint(t){return t.mul(this).mul(t.invrot())}rotateface(t){return t.map(r=>r.rotatepoint(this))}intersect3(t,r){let n=this.det3x3(this.b,this.c,this.d,t.b,t.c,t.d,r.b,r.c,r.d);return Math.abs(n)<1e-9?!1:new W(0,this.det3x3(this.a,this.c,this.d,t.a,t.c,t.d,r.a,r.c,r.d)/n,this.det3x3(this.b,this.a,this.d,t.b,t.a,t.d,r.b,r.a,r.d)/n,this.det3x3(this.b,this.c,this.a,t.b,t.c,t.a,r.b,r.c,r.a)/n)}side(t){return t>1e-9?1:t<-1e-9?-1:0}cutface(t){let r=this.a,n=0,o=null;for(let l=0;l<t.length;l++)n|=1<<this.side(t[l].dot(this)-r)+1;if((n&5)===5){o=[];let l=t.map(i=>this.side(i.dot(this)-r));for(let i=-1;i<=1;i+=2){let a=[];for(let s=0;s<t.length;s++){(l[s]===i||l[s]===0)&&a.push(t[s]);let f=(s+1)%t.length;if(l[s]+l[f]===0&&l[s]!==0){let u=t[s].dot(this)-r,g=t[f].dot(this)-r,p=u/(u-g),c=t[s].smul(1-p).sum(t[f].smul(p));a.push(c)}}o.push(a)}}return o}cutfaces(t){let r=[];for(let n=0;n<t.length;n++){let o=t[n],l=this.cutface(o);l?(r.push(l[0]),r.push(l[1])):r.push(o)}return r}faceside(t){let r=this.a;for(let n=0;n<t.length;n++){let o=this.side(t[n].dot(this)-r);if(o!==0)return o}throw new Error("Could not determine side of plane in faceside")}sameplane(t){let r=this.normalize(),n=t.normalize();return r.dist(n)<1e-9||r.dist(n.smul(-1))<1e-9}makecut(t){return new W(t,this.b,this.c,this.d)}}});function wf(){let e=Math.sqrt(.5);return[new W(e,e,0,0),new W(e,0,e,0)]}function vf(){return[new W(.5,.5,.5,.5),new W(.5,.5,.5,-.5)]}function Ef(){let e=2*Math.PI/10,t=.5+.3*Math.sqrt(5),r=.5+.1*Math.sqrt(5),n=Math.sqrt(t*t+r*r);return t/=n,r/=n,[new W(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new W(.5,.5,.5,.5)]}function _f(){let e=.16666666666666666+Math.sqrt(5)/6,t=2/3+Math.sqrt(5)/3,r=Math.sqrt(e*e+t*t);e/=r,t/=r;let n=2*Math.PI/6;return[new W(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new W(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function kf(){let e=Math.sqrt(.5);return[new W(.5,.5,.5,.5),new W(e,0,0,e)]}function zf(e){let t=[new W(1,0,0,0)];for(let r=0;r<t.length;r++)for(let n=0;n<e.length;n++){let o=e[n].mul(t[r]),l=o.smul(-1),i=!1;for(let a=0;a<t.length;a++)if(o.dist(t[a])<ai||l.dist(t[a])<ai){i=!0;break}i||t.push(o)}return t}function ps(e,t){let r=[],n=[];for(let o=0;o<t.length;o++){let l=e.rotateplane(t[o]),i=!1;for(let a=0;a<r.length;a++)if(l.dist(r[a])<ai){i=!0;break}i||(r.push(l),n.push(t[o]))}return n}function cs(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let o=Sf(0,r,n,e);if(o){let l=!1;for(let i=0;i<t.length;i++)if(o.dist(t[i])<ai){l=!0;break}l||t.push(o)}}for(;;){let r=!1;for(let n=0;n<t.length;n++){let o=(n+1)%t.length;if(e[0].dot(t[n].cross(t[o]))<0){let l=t[n];t[n]=t[o],t[o]=l,r=!0}}if(!r)break}return t}var ai,Cf=y(()=>{ii();ai=1e-9});function si(e,t){let r=e[0].p.length,n=Af(r),o=[],l=[],i=[],a=[],s=[];function f(c){for(let L=c.p.length-1;L>=0;L--){let m=c.p[L];if(m!==L){if(!o[L][m])return!1;c=c.mul(l[L][m])}}return!0}function u(c,L,m){a[c].push(L),s[c].push(m);for(let R=0;R<o[c].length;R++)o[c][R]&&g(c,o[c][R].mul(L),m+i[c][R])}function g(c,L,m){let R=L.p[c];if(!o[c][R]){o[c][R]=L,l[c][R]=L.inv(),i[c][R]=m;for(let A=0;A<a[c].length;A++)g(c,L.mul(a[c][A]),m+s[c][A]);return}let F=L.mul(l[c][R]);f(F)||u(c-1,F,m+i[c][R])}function p(){o=[],l=[],a=[],i=[],s=[];for(let m=0;m<r;m++)o.push([]),l.push([]),i.push([]),a.push([]),s.push([]),o[m][m]=n,l[m][m]=n,i[m][m]=0;let c=0,L=1n;for(let m=0;m<e.length;m++){u(r-1,e[m],1),L=1n;let R=0,F=0,A=[],U=new Pf;for(let x=0;x<r;x++){let S=0,M=0;for(let C=0;C<r;C++)o[x][C]&&(S++,M+=i[x][C],x!==C&&c++);R+=a[x].length,L*=BigInt(S),S>1&&U.multiply(S);let J=M/S;A.push(J),F+=J}t(\`\${m}: sz \${L} T \${R} sol \${F} none \${c} mults \${U.toString()}\`)}return L}return p()}var Pf,ms=y(()=>{ri();Pf=class{constructor(){this.mult=[]}multiply(t){for(let r=2;r*r<=t;r++)for(;t%r===0;)this.mult[r]!==void 0?this.mult[r]++:this.mult[r]=1,t/=r;t>1&&(this.mult[t]!==void 0?this.mult[t]++:this.mult[t]=1)}toString(){let t="";for(let r=0;r<this.mult.length;r++)this.mult[r]!==void 0&&(t!==""&&(t+="*"),t+=r,this.mult[r]>1&&(t+=\`^\${this.mult[r]}\`));return t}}});function fL(e,t){let r=[];for(let n of e)for(let o of t)r.push(o.rotate(n));return r}function pL(){return{4:[["F","D","L","R"]],6:[["F","D","L","U","R"],["R","F","","B",""]],8:[["F","D","L","R"],["D","F","BR",""],["BR","D","","BB"],["BB","BR","U","BL"]],12:[["U","F","","","",""],["F","U","R","C","A","L"],["R","F","","","E",""],["E","R","","BF","",""],["BF","E","BR","BL","I","D"]],20:[["R","C","F","E"],["F","R","L","U"],["L","F","A",""],["E","R","G","I"],["I","E","S","H"],["S","I","J","B"],["B","S","K","D"],["K","B","M","O"],["O","K","P","N"],["P","O","Q",""]]}}function cL(){return{4:{F:"#00ff00",D:"#ffff00",L:"#ff0000",R:"#0000ff"},6:{U:"#ffffff",F:"#00ff00",R:"#ff0000",D:"#ffff00",B:"#0000ff",L:"#ff8000"},8:{U:"#ffffff",F:"#ff0000",R:"#00bb00",D:"#ffff00",BB:"#1122ff",L:"#9524c5",BL:"#ff8800",BR:"#aaaaaa"},12:{U:"#ffffff",F:"#006633",R:"#ff0000",C:"#ffffd0",A:"#3399ff",L:"#660099",E:"#ff66cc",BF:"#99ff00",BR:"#0000ff",BL:"#ffff00",I:"#ff6633",D:"#999999"},20:{R:"#db69f0",C:"#178fde",F:"#23238b",E:"#9cc726",L:"#2c212d",U:"#177fa7",A:"#e0de7f",G:"#2b57c0",I:"#41126b",S:"#4b8c28",H:"#7c098d",J:"#7fe7b4",B:"#85fb74",K:"#3f4bc3",D:"#0ff555",M:"#f1c2c8",O:"#58d340",P:"#c514f2",N:"#14494e",Q:"#8b1be1"}}}function LL(){return{4:[["FLR",[0,1,0]],["F",[0,0,1]]],6:[["U",[0,1,0]],["F",[0,0,1]]],8:[["U",[0,1,0]],["F",[0,0,1]]],12:[["U",[0,1,0]],["F",[0,0,1]]],20:[["GUQMJ",[0,1,0]],["F",[0,0,1]]]}}function fi(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<Se)return r;throw new Error("Element not found")}function Mf(){return oi}function Nf(e){return oi[e]}function qo(e){let t=e.split(/ /).filter(Boolean);if(t.length%2===0)return null;let r=t[0];if(r!=="o"&&r!=="c"&&r!=="i"&&r!=="d"&&r!=="t")return null;let n=[];for(let o=1;o<t.length;o+=2){if(t[o]!=="f"&&t[o]!=="v"&&t[o]!=="e")return null;n.push({cutType:t[o],distance:parseFloat(t[o+1])})}return{shape:r,cuts:n}}function Bs(e,t={}){let r=qo(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new gi(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function On(e,t){return Bs(oi[e],t)}function BL(e,t,r){let n=!1;r-t[1]<t[0]&&(e=[e[2],e[3],e[0],e[1]],t=[r-t[1],r-t[0]],n=!0);let o=e[0],l="";if(t[0]===0&&t[1]===r)o=o+"v";else if(t[0]===t[1])t[1]>0&&(l=String(t[1]+1));else if(t[0]===0)o=o.toLowerCase(),t[1]>1&&(l=String(t[1]+1));else throw new Error(\`We only support slice and outer block moves right now. \${t}\`);return[l+o,n]}function RL(e,t){let r=[],n=0;for(;n<e.length;){n>0&&n<e.length&&e[n]==="_"&&n++;let o="";for(let l of t)e.substr(n).startsWith(l[1])&&l[1].length>o.length&&(o=l[1]);if(o!=="")r.push(o),n+=o.length;else throw new Error("Could not split "+e+" into face names.")}return r}function ui(e,t){return[e.b/t,-e.c/t,e.d/t]}function Ls(e,t){let r=[],n=e.length;for(let o=0;o<n;o++){let l=ui(e.get(n-o-1),t);r[3*o]=l[0],r[3*o+1]=l[1],r[3*o+2]=l[2]}return r}var Xr,Zo,Se,uL,gL,mL,Tf,Gf,gi,$r,Vo=y(()=>{Be();lf();os();is();ri();bf();xf();Cf();ii();ms();Xr=class{constructor(t){this.coords=new Array(t.length*3);for(let r=0;r<t.length;r++)this.coords[3*r]=t[r].b,this.coords[3*r+1]=t[r].c,this.coords[3*r+2]=t[r].d;this.length=t.length}get(t){return new W(0,this.coords[3*t],this.coords[3*t+1],this.coords[3*t+2])}centermass(){let t=0,r=0,n=0;for(let o=0;o<this.length;o++)t+=this.coords[3*o],r+=this.coords[3*o+1],n+=this.coords[3*o+2];return new W(0,t/this.length,r/this.length,n/this.length)}rotate(t){let r=[];for(let n=0;n<this.length;n++)r.push(this.get(n).rotatepoint(t));return new Xr(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new Xr(t)}},Zo=class{constructor(t,r,n){this.face=t;this.left=r;this.right=n}split(t){let r=t.cutface(this.face);return r!==null&&(this.left===void 0?(this.left=new Zo(r[0]),this.right=new Zo(r[1])):(this.left=this.left?.split(t),this.right=this.right?.split(t))),this}collect(t,r){return this.left===void 0?t.push(new Xr(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};Se=1e-9,uL="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",gL=!1;mL={4:{v:["DFR","DLF","DRL","FLR"],e:["FR","LF","DF","DL","RD","RL"],c:["DF","FD","RL","LR"]},6:{v:["URF","UBR","ULB","UFL","DFR","DRB","DBL","DLF"],e:["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],c:["UB","LU","FU","RU","BU","DF"]},8:{v:["UBBBRR","URFL","ULBLBB","DBRBBBL","DBLLF","DFRBR"],e:["UL","UBB","UR","BRD","BLD","FD","BRR","FR","FL","BLL","BLBB","BRBB"],c:["BBU","LU","RU","BRD","FD","BLD","DF","UBB"]},12:{v:["URF","UFL","ULBL","UBLBR","UBRR","DEBF","DBFI","DIA","DAC","DCE","LAI","ALF","FCA","CFR","REC","ERBR","BRBFE","BFBRBL","BLIBF","IBLL"],e:["UF","UR","UBR","UBL","UL","ER","EBR","EBF","ED","EC","IBF","IBL","IL","IA","ID","AC","CF","FA","BFBR","BRBL","BLBF","CD","AD","AL","FL","FR","CR","BFD","BRR","BLL"],c:["UF","FU","DBF","BFD","AD","CD","BRU","BLU","LA","RA","EBR","IBL"]},20:{v:["FLPQU","FUGER","FRCAL","HCREI","ISBDH","JSIEG","BSJMK","MQPOK","ONDBK","NOPLA","UQMJG","DNACH"],e:["FU","FL","FR","EG","ER","EI","SJ","SI","SB","KM","KB","KO","PQ","PO","PL","UG","JG","MQ","UQ","HC","HD","ND","NA","JM","CA","AL","CR","HI","DB","NO"],c:["FU","UF","GE","EG","JS","SJ","MK","KM","QP","PQ","LA","AL","RC","CR","IH","HI","BD","DB","ON","NO"]}};Tf=["c","t","o","d","i"],Gf=["f","v","e"];gi=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.notationMapper=new Nn;this.addNotationMapper="";this.setReidOrder=!1;let n="genperms";this.options=new ls(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let o=null;switch(r){case"c":o=wf();break;case"o":o=kf();break;case"i":o=_f();break;case"t":o=vf();break;case"d":o=Ef();break;default:throw new Error("Bad shape argument: "+r)}this.rotations=zf(o),this.options.verbosity&&console.log("# Rotations: "+this.rotations.length);let l=o[0];this.baseplanerot=ps(l,this.rotations);let i=this.baseplanerot.map(D=>l.rotateplane(D));this.baseplanes=i,this.baseFaceCount=i.length;let a=pL()[i.length];this.net=a,this.colors=cL()[i.length],this.options.verbosity>0&&console.log("# Base planes: "+i.length);let s=cs(i),f=new W(0,0,0,0);this.options.verbosity>0&&console.log("# Face vertices: "+s.length);let u=i[0].makenormal(),g=s[0].sum(s[1]).makenormal(),p=s[0].makenormal(),c=new W(1,u.b,u.c,u.d);this.options.verbosity>0&&console.log("# Boundary is "+c);let m=ps(c,this.rotations).map(D=>c.rotateplane(D)),R=cs(m);this.edgedistance=R[0].sum(R[1]).smul(.5).dist(f),this.vertexdistance=R[0].dist(f);let F=[],A=[],U=!1,x=!1,S=!1;for(let D of n){let _=null,O=0;switch(D.cutType){case"f":_=u,O=1,U=!0;break;case"v":_=p,O=this.vertexdistance,S=!0;break;case"e":_=g,O=this.edgedistance,x=!0;break;default:throw new Error("Bad cut argument: "+D.cutType)}F.push(_.makecut(D.distance)),A.push(D.distance<O)}this.options.addRotations&&(U||F.push(u.makecut(10)),S||F.push(p.makecut(10)),x||F.push(g.makecut(10))),this.basefaces=[];for(let D of this.baseplanerot){let _=D.rotateface(R);this.basefaces.push(new Xr(_))}let M=[],J=[],C=[],Q=[],b=R.length;function k(D,_,O){for(let T of D)if(T[0].dist(_)<Se){T.push(O);return}D.push([_,O])}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R);for(let O=0;O<_.length;O++){let T=(O+1)%_.length,$=_[O].sum(_[T]).smul(.5);k(Q,$,D)}}let P=[];for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),O=[];for(let T=0;T<_.length;T++){let $=(T+1)%_.length,ae=_[T].sum(_[$]).smul(.5),Me=Q[fi(Q,ae)];if(D===Me[1])O.push(Me[2]);else if(D===Me[2])O.push(Me[1]);else throw new Error("Could not find edge")}P.push(O)}let w={},v=[];v.push(a[0][0]),w[a[0][0]]=0,v[P[0][0]]=a[0][1],w[a[0][1]]=P[0][0];for(let D of a){let _=D[0],O=w[_];if(O===void 0)throw new Error("Bad edge description; first edge not connected");let T=-1;for(let $=0;$<P[O].length;$++){let ae=v[P[O][$]];if(ae!==void 0&&ae===D[1]){T=$;break}}if(T<0)throw new Error("First element of a net not known");for(let $=2;$<D.length;$++){if(D[$]==="")continue;let ae=P[O][($+T-1)%b],Me=v[ae];if(Me!==void 0&&Me!==D[$])throw new Error("Face mismatch in net");v[ae]=D[$],w[D[$]]=ae}}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),O=c.rotateplane(this.baseplanerot[D]),T=v[D];M.push([_,T]),J.push([O,T])}for(let D=0;D<this.baseplanerot.length;D++){let _=this.baseplanerot[D].rotateface(R),O=v[D];for(let T=0;T<_.length;T++){let $=(T+1)%_.length,ae=_[T].sum(_[$]).smul(.5),Me=(T+2)%_.length,cm=_[$].sum(_[Me]).smul(.5),mm=fi(Q,ae),Lm=fi(Q,cm);k(C,_[$],[O,Lm,mm])}}this.swizzler=new Ko(M.map(D=>D[1]));let N=this.swizzler.prefixFree?"":"_",j=mL[this.baseFaceCount],q=[];for(let D=0;D<this.baseFaceCount;D++)q[1<<D]=D;{let D=j.v;for(let _ of D){let O=this.swizzler.splitByFaceNames(_),T=0;for(let $ of O)T|=1<<$;q[T]=O[0]}}{let D=j.e;for(let _ of D){let O=this.swizzler.splitByFaceNames(_),T=0;for(let $ of O)T|=1<<$;q[T]=O[0]}}{let D=j.c;for(let _ of D){let O=this.swizzler.splitByFaceNames(_),T=1<<O[0]|1<<this.baseFaceCount;q[T]=O[1]}}for(let D=0;D<Q.length;D++){if(Q[D].length!==3)throw new Error("Bad length in edge names "+Q[D]);let _=Q[D][1],O=Q[D][2],T=v[_],$=v[O],ae=1<<_|1<<O;q[ae]==_?T=T+N+$:T=$+N+T,Q[D]=[Q[D][0],T]}for(let D=0;D<C.length;D++){let _=0;if(C[D].length<4)throw new Error("Bad length in vertex names");for(let ae=1;ae<C[D].length;ae++)_|=1<<w[C[D][ae][0]];let O=q[_],T=-1;for(let ae=1;ae<C[D].length;ae++)O===w[C[D][ae][0]]&&(T=ae);if(T<0)throw new Error("Internal error; couldn't find face name when fixing corners");let $="";for(let ae=1;ae<C[D].length;ae++){ae===1?$=C[D][T][0]:$=$+N+C[D][T][0];for(let Me=1;Me<C[D].length;Me++)if(C[D][T][1]===C[D][Me][2]){T=Me;break}}C[D]=[C[D][0],$]}this.markedface=q,this.options.verbosity>1&&(console.log("# Face names: "+M.map(D=>D[1]).join(" ")),console.log("# Edge names: "+Q.map(D=>D[1]).join(" ")),console.log("# Vertex names: "+C.map(D=>D[1]).join(" ")));let ie=[];for(let D of J)ie.push([D[0].makenormal(),D[1],"f"]);for(let D of Q)ie.push([D[0].makenormal(),D[1],"e"]);for(let D of C)ie.push([D[0].makenormal(),D[1],"v"]);this.facenames=M,this.faceplanes=J,this.edgenames=Q,this.vertexnames=C,this.geonormals=ie;let de=ie.map(D=>D[1]);this.swizzler.setGripNames(de),this.options.verbosity>0&&console.log("# Distances: face "+1+" edge "+this.edgedistance+" vertex "+this.vertexdistance);for(let D=0;D<F.length;D++)for(let _ of this.rotations){let O=F[D].rotateplane(_),T=!1;for(let $ of this.moveplanes)if(O.sameplane($)){T=!0;break}T||(this.moveplanes.push(O),A[D]&&this.moveplanes2.push(O))}let be=new Zo(R),Ye=this.moveplanes2.slice(),bt=31;for(let D=0;D<Ye.length;D++){let _=D+Math.floor((Ye.length-D)*(bt/65536));be=be.split(Ye[_]),Ye[_]=Ye[D],bt=(bt*1657+101)%65536}let Le=be.collect([],!0);this.faces=Le,this.options.verbosity>0&&console.log("# Faces is now "+Le.length),this.stickersperface=Le.length;let Lt=[],lt=li(R);for(let D of this.rotations){let _=D.rotateface(R);lt.dist(li(_))<Se&&Lt.push(D)}let ct=new Array(Le.length),ze=[];for(let D=0;D<Le.length;D++){let _=Le[D].centermass();ze.push([lt.dist(_),_,D])}ze.sort((D,_)=>D[0]-_[0]);for(let D=0;D<Le.length;D++){let _=ze[D][2];if(!ct[_]){ct[_]=!0;for(let O of Lt){let T=Le[_].rotate(O),$=T.centermass();for(let ae=D+1;ae<Le.length&&!(ze[ae][0]-ze[D][0]>Se);ae++){let Me=ze[ae][2];if(!ct[Me]&&$.dist(ze[ae][1])<Se){ct[Me]=!0,Le[Me]=T;break}}}}}this.shortedge=1e99;for(let D of Le)for(let _=0;_<D.length;_++){let O=(_+1)%D.length,T=D.get(_).dist(D.get(O));T<this.shortedge&&(this.shortedge=T)}this.options.verbosity>0&&console.log("# Short edge is "+this.shortedge),r==="c"&&U&&!x&&!S&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&S&&!U&&!x&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(S||U)&&!x&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&U&&(this.notationMapper=new Qo(this.swizzler,new Ko(["F","D","L","BL","R","U","BR","B"])),!x&&!S&&(this.addNotationMapper="FTOMapper")),r==="d"&&U&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new Qo(this.swizzler,new Ko(["U","F","L","BL","BR","R","FR","FL","DL","B","DR","D"])))}keyface(t){return this.keyface2(t.centermass())}keyface2(t){let r="",n=String.fromCharCode;for(let o of this.moveplanesets)if(o.length>0){let l=t.dot(o[0]),i=0,a=1;for(;a*2<=o.length;)a*=2;for(;a>0;a>>=1)i+a<=o.length&&l>o[i+a-1].a&&(i+=a);if(i<47)r=r+n(33+i);else if(i<47+47*47)r=r+n(33+47+Math.floor(i/47)-1)+n(33+i%47);else if(i<47+47*47+47*47*47)r=r+n(33+47+Math.floor((i-47)/(47*47)-1))+n(33+47+Math.floor((i-47)/47)%47)+n(33+i%47);else throw Error("Too many slices for cubie encoding")}return r}keyface3(t){let r=t.centermass(),n=[];for(let o of this.moveplanesets)if(o.length>0){let l=r.dot(o[0]),i=0,a=1;for(;a*2<=o.length;)a*=2;for(;a>0;a>>=1)i+a<=o.length&&l>o[i+a-1].a&&(i+=a);n.push(i)}return n}findface(t){let r=this.keyface2(t),n=this.facelisthash.get(r);if(n.length===1)return n[0];for(let o=0;o+1<n.length;o++){let l=this.facelisthash.get(r)[o];if(Math.abs(t.dist(this.facecentermass[l]))<Se)return l}return n[n.length-1]}project2d(t,r,n){let o=this.facenames[t][0],l=(r+1)%o.length,i=this.baseplanes[t],a=o[l].sub(o[r]),s=a.len();a=a.normalize();let f=a.cross(i).normalize(),u=n[1].sub(n[0]),g=u.len()/s;u=u.normalize();let p=u.b,c=u.c,L=a.smul(p).sub(f.smul(c)).smul(g),m=f.smul(p).sum(a.smul(c)).smul(g),R=new W(0,n[0].b-L.dot(o[r]),n[0].c-m.dot(o[r]),0);return[L,m,R]}allstickers(){let t="allstickers";this.faces=fL(this.baseplanerot,this.faces),this.options.verbosity>0&&console.log("# Total stickers is now "+this.faces.length),this.facecentermass=new Array(this.faces.length);for(let b=0;b<this.faces.length;b++)this.facecentermass[b]=this.faces[b].centermass();let r=[],n=[];for(let b of this.moveplanes){let k=b.makenormal(),P=!1;for(let w of n)k.sameplane(w.makenormal())&&(P=!0);P||(n.push(k),r.push([]))}for(let b of this.moveplanes2){let k=b.makenormal();for(let P=0;P<n.length;P++)if(k.sameplane(n[P])){r[P].push(b);break}}for(let b=0;b<r.length;b++){let k=r[b].map(w=>w.normalizeplane()),P=n[b];for(let w=0;w<k.length;w++)k[w].makenormal().dist(P)>Se&&(k[w]=k[w].smul(-1));k.sort((w,v)=>w.a-v.a),r[b]=k}this.moveplanesets=r,this.moveplanenormals=n;let o=r.map(b=>b.length);this.options.verbosity>0&&console.log("# Move plane sets: "+o);let l=[];for(let b=0;b<r.length;b++)l.push([]);for(let b of this.rotations){if(Math.abs(Math.abs(b.a)-1)<Se)continue;let k=b.makenormal();for(let P=0;P<r.length;P++)if(k.sameplane(n[P])){l[P].push(b);break}}this.moverotations=l;for(let b=0;b<l.length;b++){let k=l[b],P=k[0].makenormal();for(let w=0;w<k.length;w++)P.dist(k[w].makenormal())>Se&&(k[w]=k[w].smul(-1));k.sort((w,v)=>w.angle()-v.angle()),l[b][0].dot(n[b])<0&&k.reverse()}let i=l.map(b=>1+b.length);this.movesetorders=i;let a=[],s="?";for(let b=0;b<r.length;b++){let k=n[b],P=null,w=null;for(let v of this.geonormals){let N=k.dot(v[0]);Math.abs(N-1)<Se?(w=[v[1],v[2]],s=v[2]):Math.abs(N+1)<Se&&(P=[v[1],v[2]],s=v[2])}if(w===null||P===null)throw new Error("Saw positive or negative sides as null");a.push([w[0],w[1],P[0],P[1],1+r[b].length]),this.addNotationMapper==="NxNxNCubeMapper"&&s==="f"&&(this.notationMapper=new $l(1+r[b].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new ti(this.swizzler),this.addNotationMapper=""),this.addNotationMapper==="PyraminxOrTetraminxMapper"&&(r[0].length===2&&r[0][0].a===.333333333333333&&r[0][1].a===1.66666666666667?(this.notationMapper=new jo(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new ei(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&s==="f"&&(1+r[b].length===3&&(this.notationMapper=new Xl(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&s==="f"&&(1+r[b].length===3&&(this.notationMapper=new Yl(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=a;let f=new Map,u=this.faces;for(let b=0;b<u.length;b++){let k=u[b],P=this.keyface(k);if(!f.get(P))f.set(P,[b]);else{let w=f.get(P);if(w.push(b),w.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let v=0;v<w.length;v++){let N=P+" "+v;f.set(N,[w[v]])}}}}this.facelisthash=f,this.options.verbosity>0&&console.log("# Cubies: "+f.size);let g=[],p=[],c=[];for(let b of f.values())if(b.length!==this.baseFaceCount){if(b.length>1){let k=b.map(j=>u[j].centermass()),P=li(k);for(let j=0;b.length>2;j++){let q=!1;for(let ie=0;ie<b.length;ie++){let de=(ie+1)%b.length;if(P.dot(k[ie].cross(k[de]))<0){let be=k[ie];k[ie]=k[de],k[de]=be;let Ye=b[ie];b[ie]=b[de],b[de]=Ye,q=!0}}if(!q)break;if(j>1e3)throw new Error("Bad epsilon math; too close to border")}let w=0;for(let j of b)w|=1<<Math.floor(j/this.stickersperface);let v=this.markedface[w],N=-1;for(let j=0;j<b.length;j++)Math.floor(b[j]/this.stickersperface)===v&&(N=j);if(N<0)throw new Error("Could not find marked face in list");if(N!==0){let j=b.slice();for(let q=0;q<b.length;q++)b[q]=j[(N+q)%b.length]}}for(let k=0;k<b.length;k++){let P=b[k];p[P]=g.length,c[P]=k}g.push(b)}this.cubies=g,this.facetocubie=p,this.facetoord=c;let L=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],m=[],R=[0,0,0,0,0,0],F=[],A=[],U=0,x=[],S=[],M=[],J=[],C=b=>g[b].map(k=>this.getfaceindex(k)).join(" "),Q=[];for(let b=0;b<g.length;b++){let k=g[b];if(k.length===0||A[b])continue;let P={},w=0;M.push(0),Q.push([]);let v=k.length,N=R[v]++,j=L[v];(j===void 0||v===this.baseFaceCount)&&(j="CORE"),j=j+(N===0?"":N+1),m[U]=j,F[U]=v;let q=[b],ie=0;for(A[b]=!0;ie<q.length;){let de=q[ie++],be=C(de);if((k.length>1||P[be]===void 0)&&(P[be]=w++),J[de]=P[be],x[de]=U,Q[U].push(de),S[de]=M[U]++,q.length<this.rotations.length){let Ye=this.facecentermass[g[de][0]];for(let bt of l){let Le=this.facetocubie[this.findface(Ye.rotatepoint(bt[0]))];A[Le]||(q.push(Le),A[Le]=!0)}}}U++}if(this.setReidOrder&&4<=this.stickersperface&&this.stickersperface<=9){let b=[["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],["UFR","URB","UBL","ULF","DRF","DFL","DLB","DBR"],["U","L","F","R","B","D"]],k={};for(let P of b)for(let w=0;w<P.length;w++){let v=0;for(let N=0;N<P[w].length;N++)v|=1<<P[w].charCodeAt(N)-65;k[v]=w}for(let P of Q)for(let w of P){let v=0;for(let N of g[w])v|=1<<this.facenames[this.getfaceindex(N)][1].charCodeAt(0)-65;S[w]=k[v]}}if(this.cubiesetnums=x,this.cubieordnums=S,this.cubiesetnames=m,this.cubieords=M,this.orbitoris=F,this.cubievaluemap=J,this.cubiesetcubies=Q,this.options.fixedPieceType!==null){for(let b=0;b<g.length;b++)if(this.options.fixedPieceType==="v"&&g[b].length>2||this.options.fixedPieceType==="e"&&g[b].length===2||this.options.fixedPieceType==="f"&&g[b].length===1){this.fixedCubie=b;break}if(this.fixedCubie<0)throw new Error("Could not find a cubie of type "+this.options.fixedPieceType+" to fix.")}this.options.verbosity>0&&console.log("# Cubie orbit sizes "+M)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?null:r.modified({family:this.swizzler.unswizzle(r.family)})}stringToBlockMove(t){let r=RegExp("^(([0-9]+)-)?([0-9]+)?([^0-9]+)([0-9]+'?)?$"),n=t.match(r);if(n===null)throw new Error("Bad move passed "+t);let o=n[4],l,i;if(n[2]!==void 0){if(n[3]===void 0)throw new Error("Missing second number in range");l=parseInt(n[2],10)}n[3]!==void 0&&(i=parseInt(n[3],10));let a="1",s=1;return n[5]!==void 0&&(a=n[5],a[0]==="'"&&(a="-"+a.substring(1)),s=parseInt(a,10)),new B(new z(o,i,l),s)}parseMove(t){let r=this.notationMapper.notationToInternal(t);if(r===null)throw new Error("Bad move "+t.family);t=r;let n=t.family,o=!1;if(n.endsWith("v")&&n[0]<="Z"){if(t.innerLayer!==void 0||t.outerLayer!==void 0)throw new Error("Cannot use a prefix with full cube rotations");n=n.slice(0,-1),o=!0}n.endsWith("w")&&n[0]<="Z"&&(n=n.slice(0,-1).toLowerCase());let l,i=-1,a=this.swizzler.unswizzle(n),s=!1;for(let g=0;g<this.movesetgeos.length;g++){let p=this.movesetgeos[g];a===p[0]&&(s=!0,l=p,i=g),a===p[2]&&(s=!1,l=p,i=g)}let f=1,u=1;if(n.toUpperCase()!==n&&(u=2),l===void 0)throw new Error("Bad grip in move "+t.family);if(t.outerLayer!==void 0&&(f=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(u=t.innerLayer,n<="Z"?f=u:f=1):u=t.innerLayer),f--,u--,o&&(f=0,u=this.moveplanesets[i].length),f<0||f>this.moveplanesets[i].length||u<0||u>this.moveplanesets[i].length)throw new Error("Bad slice spec "+f+" "+u+" vs "+this.moveplanesets[i].length);if(!gL&&f===0&&u===this.moveplanesets[i].length&&!o)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,f,u,s,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t="genperms";if(this.cmovesbyslice.length>0)return;let r=[];if(this.options.orientCenters){for(let n=0;n<this.cubies.length;n++)if(this.cubies[n].length===1){let o=this.cubies[n][0],l=this.getfaceindex(o),i=this.basefaces[l].centermass();if(i.dist(this.facecentermass[o])<Se){let a=1<<l|1<<this.baseFaceCount,s=this.markedface[a],f=this.baseplanes[s].makenormal(),u=-1,g=-1;for(let L=0;L<this.faces[o].length;L++){let m=this.faces[o].get(L),R=f.dot(m.sub(i));R>u&&(u=R,g=L)}let p=(g+1)%this.faces[o].length;if(Math.abs(f.dot(this.faces[o].get(p).sub(i))-u)<Se&&(g=p),g!=0){let L=[];for(let m=0;m<this.faces[o].length;m++)L.push(this.faces[o].get((m+g)%this.faces[o].length));this.faces[o]=new Xr(L)}let c=this.basefaces[l].length;for(let L=1;L<c;L++)this.cubies[n].push(this.cubies[n][L-1]);this.duplicatedFaces[o]=c,this.duplicatedCubies[n]=c,this.orbitoris[this.cubiesetnums[n]]=c}}}for(let n=0;n<this.moveplanesets.length;n++){let o=this.moveplanesets[n],l=[],i=[o.length+1,0],a=1;for(;a*2<=o.length;)a*=2;for(let u=0;u<this.faces.length;u++){let g=0;if(o.length>0){let p=this.facecentermass[u].dot(o[0]);for(let c=a;c>0;c>>=1)g+c<=o.length&&p>o[g+c-1].a&&(g+=c);g=o.length-g}for(l.push(g);i.length<=g;)i.push(0);i[g]++}let s=new Array(i.length);for(let u=0;u<i.length;u++)s[u]=[];let f=[];for(let u=0;u<this.faces.length;u++){if(l[u]<0)continue;let g=[this.facetocubie[u],this.facetoord[u]],p=this.facecentermass[u],c=p,L=u,m=l[L];for(;;){l[L]=-1;let R=p.rotatepoint(this.moverotations[n][0]);if(R.dist(c)<Se)break;L=this.findface(R),g.push(this.facetocubie[L],this.facetoord[L]),p=R}if(g.length>2&&this.options.orientCenters&&(this.cubies[g[0]].length===1||this.duplicatedCubies[g[0]]>1)&&this.facecentermass[u].dist(this.basefaces[this.getfaceindex(u)].centermass())<Se){let R=this.faces[this.cubies[g[0]][0]];for(let F=0;F<g.length;F+=2){let A=this.faces[this.cubies[g[F]][0]],U=-1;for(let x=0;x<R.length;x++)if(A.get(x).dist(R.get(0))<Se){U=x;break}if(U<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");g[F+1]=U,R=R.rotate(this.moverotations[n][0])}}if(g.length===2&&this.options.orientCenters)for(let R=1;R<this.movesetorders[n];R++)m===0?g.push(g[0],R):g.push(g[0],(this.movesetorders[n]-R)%this.movesetorders[n]);if(g.length>2&&!f[g[0]]){if(g.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let R of g)s[m].push(R)}for(let R=0;R<g.length;R+=2)f[g[R]]=!0}for(let u=0;u<s.length;u++)s[u]=s[u].slice();r.push(s)}if(this.cmovesbyslice=r,this.options.moveList){let n=[];for(let o of this.options.moveList)n.push(this.parsemove(o));this.parsedmovelist=n}this.facelisthash.clear(),this.facecentermass=[]}getboundarygeometry(){return{baseplanes:this.baseplanes,facenames:this.facenames,faceplanes:this.faceplanes,vertexnames:this.vertexnames,edgenames:this.edgenames,geonormals:this.geonormals}}getmovesets(t){let r=this.moveplanesets[t].length,n=[];if(this.parsedmovelist!==void 0)for(let o of this.parsedmovelist)o[1]===t&&(o[4]?n.push([o[2],o[3]]):n.push([r-o[3],r-o[2]]),n.push(o[5]));else if(this.options.vertexMoves&&!this.options.allMoves){let o=this.movesetgeos[t];if(o[1]!==o[3])for(let l=0;l<r;l++)o[1]!=="v"?(this.options.outerBlockMoves?n.push([l+1,r]):n.push([l+1]),n.push(1)):(this.options.outerBlockMoves?n.push([0,l]):n.push([l,l]),n.push(1))}else for(let o=0;o<=r;o++)!this.options.allMoves&&o+o===r||(this.options.outerBlockMoves?o+o>r?n.push([o,r]):n.push([0,o]):n.push([o,o]),n.push(1));if(this.fixedCubie>=0){let o=this.keyface3(this.faces[this.cubies[this.fixedCubie][0]])[t],l=[];for(let i=0;i<n.length;i+=2){let a=n[i];if(o>=a[0]&&o<=a[1])if(a[0]===0)a=[a[1]+1,r];else if(r===a[1])a=[0,a[0]-1];else throw Error("fixed cubie option would disconnect move");let s=!1;for(let f=0;f<l.length;f+=2)if(l[f][0]===a[0]&&l[f][1]===a[1]&&l[f+1]===n[i+1]){s=!0;break}s||(l.push(a),l.push(n[i+1]))}n=l}return n}graybyori(t){let r=this.cubies[t].length;return this.duplicatedCubies[t]&&(r=1),r===1&&(this.options.grayCenters||!this.options.includeCenterOrbits)||r===2&&(this.options.grayEdges||!this.options.includeEdgeOrbits)||r>2&&(this.options.grayCorners||!this.options.includeCornerOrbits)}skipbyori(t){let r=this.cubies[t].length;return this.duplicatedCubies[t]&&(r=1),r===1&&!this.options.includeCenterOrbits||r===2&&!this.options.includeEdgeOrbits||r>2&&!this.options.includeCornerOrbits}skipcubie(t){return this.skipbyori(t)}header(t){return t+uL+\`
9
9
  \`+t+\`
10
- \`}writegap(){let t=this.getOrbitsDef(!1),r=[],n=[];for(let l=0;l<t.moveops.length;l++){let i="M_"+$l(this.notationMapper,t.movenames[l]),s=!1;i[i.length-1]==="'"&&(i=i.substring(0,i.length-1),s=!0),n.push(i),s?r.push(i+":="+t.moveops[l].toPerm().inv().toGap()+";"):r.push(i+":="+t.moveops[l].toPerm().toGap()+";")}r.push("Gen:=["),r.push(n.join(",")),r.push("];");let o=t.solved.identicalPieces();return r.push("ip:=["+o.map(l=>"["+l.map(i=>i+1).join(",")+"]").join(",")+"];"),r.push("# Size(Group(Gen));"),r.push("# Size(Stabilizer(Group(Gen), ip, OnTuplesSets));"),r.push(""),this.header("# ")+r.join(\`
10
+ \`}writegap(){let t=this.getOrbitsDef(!1),r=[],n=[];for(let l=0;l<t.moveops.length;l++){let i="M_"+ni(this.notationMapper,t.movenames[l]),a=!1;i[i.length-1]==="'"&&(i=i.substring(0,i.length-1),a=!0),n.push(i),a?r.push(i+":="+t.moveops[l].toPerm().inv().toGap()+";"):r.push(i+":="+t.moveops[l].toPerm().toGap()+";")}r.push("Gen:=["),r.push(n.join(",")),r.push("];");let o=t.solved.identicalPieces();return r.push("ip:=["+o.map(l=>"["+l.map(i=>i+1).join(",")+"]").join(",")+"];"),r.push("# Size(Group(Gen));"),r.push("# Size(Stabilizer(Group(Gen), ip, OnTuplesSets));"),r.push(""),this.header("# ")+r.join(\`
11
11
  \`)}writeksolve(t="PuzzleGeometryPuzzle"){let r=this.getOrbitsDef(!1);return this.header("# ")+r.toKsolve(t,this.notationMapper).join(\`
12
- \`)}getKPuzzleDefinition(t=!0,r=!0){let o=this.getOrbitsDef(t,r).toKPuzzleDefinition(r);if(o.experimentalPuzzleDescription=this.puzzleDescription,!o)throw new Error("Missing definition!");return o}getMoveFromBits(t,r,n,o,l,i){let s=[],a=[],f=[];for(let p of this.cubieords)a.push(It(p)),f.push(dr(p));for(let p=t[0];p<=t[1];p++){let c=o[p];for(let L=0;L<c.length;L+=2*i){let m=c.slice(L,L+2*i),R=this.cubiesetnums[m[0]];for(let U=0;U<m.length;U+=2)m[U]=this.cubieordnums[m[U]];let F=2,A=3;n&&(F=m.length-2,A=m.length-1),a[R]===It(this.cubieords[R])&&(a[R]=a[R].slice(),this.orbitoris[R]>1&&!this.options.fixedOrientation&&(f[R]=f[R].slice()));for(let U=0;U<m.length;U+=2)a[R][m[(U+F)%m.length]]=m[U],this.orbitoris[R]>1&&!this.options.fixedOrientation&&(f[R][m[U]]=(m[(U+A)%m.length]-m[(U+1)%m.length]+2*this.orbitoris[R])%this.orbitoris[R])}}let u=new er(It(24),dr(24),1);for(let p=0;p<this.cubiesetnames.length;p++)if(!(l&&!l[p]))if(this.orbitoris[p]===1||this.options.fixedOrientation)a[p]===It(u.perm.length)?(a[p]!==u.perm&&(u=new er(a[p],f[p],1)),s.push(u)):s.push(new er(a[p],f[p],1));else{let c=new Array(f[p].length);for(let L=0;L<a[p].length;L++)c[L]=f[p][a[p][L]];s.push(new er(a[p],c,this.orbitoris[p]))}let g=new hr(s);return r!==1&&(g=g.mulScalar(r)),g}omitSet(t){for(let r of this.options.excludeOrbits)if(r===t)return!0;return!1}diffmvsets(t,r,n,o){for(let l=0;l<t.length;l+=2){let i=!1;for(let s=0;!i&&s<r.length;s+=2)o?t[l][0]+r[s][1]===n&&t[l][1]+r[s][0]===n&&t[l+1]===r[s+1]&&(i=!0):t[l][0]===r[s][0]&&t[l][1]===r[s][1]&&t[l+1]===r[s+1]&&(i=!0);if(!i)return!0}return!1}getOrbitsDef(t,r=!0){let n=[];if(t)for(let m=0;m<this.cubiesetnames.length;m++)n.push(1);let o=[],l=[],i=[],s=[];for(let m=0;m<this.moveplanesets.length;m++){let R=this.getmovesets(m);i.push(R),this.options.addRotations?s.push(1):s.push(0)}let a=[];for(let m=0;m<this.moveplanesets.length;m++){let R=this.moveplanesets[m].length,F=!1,A=i[m];for(let U=0;U<A.length;U+=2)A[U][0]===0&&A[U][1]===R&&(F=!0);a[m]=F}if(this.options.moveList&&this.options.addRotations){for(let m=0;m<this.moverotations.length;m++)s[m]=0;for(let m=0;m<this.moveplanesets.length;m++){if(a[m]){s[m]=3;continue}for(let R=0;R<this.moverotations.length;R++){let F=this.moveplanenormals[m];for(let A=1;A*2<=this.movesetorders[R];A++){if(F=F.rotatepoint(this.moverotations[R][0]),s[R]&A)continue;let U=-1,b=!1;for(let M=0;M<this.moveplanenormals.length;M++)if(F.dist(this.moveplanenormals[M])<Se){U=M;break}else if(F.dist(this.moveplanenormals[M].smul(-1))<Se){U=M,b=!0;break}if(U<0)throw new Error("Could not find rotation");let S=i[U];(S.length!==i[m].length||this.moveplanesets[m].length!==this.moveplanesets[U].length||this.diffmvsets(S,i[m],this.moveplanesets[U].length,b))&&(s[R]|=A)}}}for(let m=0;m<this.moverotations.length;m++)if(s[m]===0)s[m]=1;else if(s[m]===1)this.movesetorders[m]>3?s[m]=2:s[m]=0;else if(s[m]===3)s[m]=0;else throw new Error("Impossible addrot val")}for(let m=0;m<this.moveplanesets.length;m++)s[m]!==0&&!a[m]&&(i[m].push([0,this.moveplanesets[m].length]),i[m].push(s[m]));for(let m=0;m<this.moveplanesets.length;m++){let R=i[m],F=this.movesetorders[m];for(let b=0;b<R.length;b+=2)for(let S=0;S<b;S+=2)if(R[b][0]===R[S][0]&&R[b][1]===R[S][1])throw new Error("Redundant moves in moveset.");let A=[];for(let b=0;b<R.length;b+=2)for(let S=R[b][0];S<=R[b][1];S++)A[S]=1;let U=this.cmovesbyslice[m];for(let b=0;b<U.length;b++){if(A[b]!==1)continue;let S=U[b];for(let M=0;M<S.length;M+=2*F){if(this.skipcubie(S[M]))continue;let J=this.cubiesetnums[S[M]];n[J]=1}}}for(let m=0;m<this.cubiesetnames.length;m++)if(!!n[m]){if(this.omitSet(this.cubiesetnames[m])){n[m]=0;continue}o.push(this.cubiesetnames[m]),l.push(new jo(this.cubieords[m],this.options.fixedOrientation?1:this.orbitoris[m]))}let f=[];for(let m=0;m<this.cubiesetnames.length;m++){if(!n[m]||this.omitSet(this.cubiesetnames[m]))continue;let R=[],F=[];for(let A=0;A<this.cubieords[m];A++){if(t)R.push(A);else{let U=this.cubiesetcubies[m][A];R.push(this.cubievaluemap[U])}F.push(0)}f.push(new er(R,F,this.options.fixedOrientation?1:this.orbitoris[m]))}let u=[],g=[],p=[],c=[];if(r)for(let m=0;m<this.moveplanesets.length;m++){let F=this.moveplanesets[m].length,A=i[m],U=this.movesetgeos[m];for(let b=0;b<A.length;b+=2){let S=A[b],M,J=!1;if(this.parsedmovelist!==void 0)for(let Q of this.parsedmovelist){if(Q[1]!==m)continue;let x=[];Q[4]?x=[Q[2],Q[3]]:x=[F-Q[3],F-Q[2]],x[0]===S[0]&&x[1]===S[1]&&(M=Q[0],J=!Q[4])}if(M)u.push(M),g.push(!0);else{let Q=uL(U,S,F);J=Q[1];let x=Q[0];A[b+1]===1?u.push(x):u.push(x+A[b+1]),g.push(!1)}c.push(S[0]===0&&S[1]===F);let C=this.getMoveFromBits(S,A[b+1],J,this.cmovesbyslice[m],n,this.movesetorders[m]);p.push(C)}}let L=new Tn(o,l,new On(f),u,p,c,g);return this.options.optimizeOrbits&&(L=L.optimize()),this.options.scrambleAmount!==0&&L.scramble(this.options.scrambleAmount),L}getScramble(t=0){let r=this.getOrbitsDef(!1);return r.transformToKTransformationData(r.getScrambleTransformation(t))}getMovesAsPerms(){return this.getOrbitsDef(!1).moveops.map(t=>t.toPerm())}showcanon(t){df(this.getOrbitsDef(!1),t)}getsolved(){let t=[];for(let r=0;r<this.baseFaceCount;r++)for(let n=0;n<this.stickersperface;n++)t.push(r);return new dt(t)}getOrientationRotation(t){let[r,[n,o,l]]=t[0],i=new W(0,n,-o,l),[s,[a,f,u]]=t[1],g=new W(0,a,-f,u),p=null,c=null,L=this.swizzler.unswizzle(r),m=this.swizzler.unswizzle(s);for(let U of this.geonormals)L===U[1]&&(p=U[0]),m===U[1]&&(c=U[0]);if(!p)throw new Error("Could not find feature "+r);if(!c)throw new Error("Could not find feature "+s);let R=p.pointrotation(i);return c.rotatepoint(R).unproject(i).pointrotation(g.unproject(i)).mul(R)}getInitial3DRotation(){let t=this.baseFaceCount,r=null;if(this.options.puzzleOrientation?r=this.options.puzzleOrientation:this.options.puzzleOrientations&&(r=this.options.puzzleOrientations[t]),r||(r=fL()[t]),!r)throw new Error("No default orientation?");return this.getOrientationRotation(r)}generate2dmapping(t=800,r=500,n=10,o=!1,l=.92){t-=2*n,r-=2*n;function i(w,v){let N=w[1][0]-w[0][0],j=w[1][1]-w[0][1],q=2*Math.PI/v,ie=Math.cos(q),de=Math.sin(q);for(let xe=2;xe<v;xe++){let Ze=N*ie+j*de;j=j*ie-N*de,N=Ze,w.push([w[xe-1][0]+N,w[xe-1][1]+j])}}this.genperms();let f=this.getboundarygeometry().facenames[0][0].length,u=this.net;if(u===null)throw new Error("No net?");let g={},p=0,c=0,L=1,m=0;g[u[0][0]]=[[1,0],[0,0]],i(g[u[0][0]],f);for(let w of u){let v=w[0];if(!g[v])throw new Error("Bad edge description; first edge not connected.");for(let N=1;N<w.length;N++){let j=w[N];j===""||g[j]||(g[j]=[g[v][N%f],g[v][(N+f-1)%f]],i(g[j],f))}}for(let w in g){let v=g[w];for(let N of v)p=Math.min(p,N[0]),L=Math.max(L,N[0]),c=Math.min(c,N[1]),m=Math.max(m,N[1])}let R=Math.min(t/(L-p),r/(m-c)),F=.5*(t-R*(L+p)),A=.5*(r-R*(m+c)),U={},b=this.getboundarygeometry(),S={},M=[[R+F,A],[F,A]];S[u[0][0]]=M,i(S[u[0][0]],f),U[this.facenames[0][1]]=this.project2d(0,0,[new W(0,M[0][0],M[0][1],0),new W(0,M[1][0],M[1][1],0)]);let J=[];J[0]=0;for(let w of u){let v=w[0];if(!S[v])throw new Error("Bad edge description; first edge not connected.");let N=-1;for(let q=0;q<b.facenames.length;q++)if(v===b.facenames[q][1]){N=q;break}if(N<0)throw new Error("Could not find first face name "+v);let j=b.facenames[N][0];for(let q=1;q<w.length;q++){let ie=w[q];if(ie===""||S[ie])continue;S[ie]=[S[v][q%f],S[v][(q+f-1)%f]],i(S[ie],f);let de=J[N],xe=j[(de+q)%f].sum(j[(de+q+f-1)%f]).smul(.5),Ze=li(b.edgenames,xe),xt=b.edgenames[Ze][1],Le=gL(xt,this.facenames),Lt=Le[v===Le[0]?1:0],ot=-1;for(let ze=0;ze<b.facenames.length;ze++)if(Lt===b.facenames[ze][1]){ot=ze;break}if(ot<0)throw new Error("Could not find second face name");let pt=b.facenames[ot][0];for(let ze=0;ze<pt.length;ze++)if(pt[ze].sum(pt[(ze+1)%f]).smul(.5).dist(xe)<=Se){let _=S[v][(q+f-1)%f],G=S[v][q%f];J[ot]=ze,U[Lt]=this.project2d(ot,ze,[new W(0,G[0],G[1],0),new W(0,_[0],_[1],0)]);break}}}let C=0,Q=0,x=this.getInitial3DRotation();for(let w of this.faces){o&&(w=w.rotate(x));for(let v=0;v<w.length;v++)C=Math.max(C,Math.abs(w.get(v).b)),Q=Math.max(Q,Math.abs(w.get(v).c))}let k=Math.min(r/Q/2,(t-n)/C/4);return(w,v)=>{if(o){v=v.rotatepoint(x);let N=.5*n+.25*t,j=this.baseplanes[w].rotateplane(x).d<0?1:-1;return[n+t*.5+j*(N-v.b*k),n+r*.5+v.c*k]}else{let N=U[this.facenames[w][1]];return[n+l*v.dot(N[0])+N[2].b,n+r-l*v.dot(N[1])-N[2].c]}}}generatesvg(t=800,r=500,n=10,o=!1){let l=this.generate2dmapping(t,r,n,o);function i(p,c,L){return'<polygon id="'+p+'" class="sticker" style="fill: '+L+'" points="'+c.map(m=>m[0]+" "+m[1]).join(" ")+\`"/>
13
- \`}let s=this.getsolved(),a=[],f=[];for(let p=0;p<this.baseFaceCount;p++)a[p]=this.colors[this.facenames[p][1]];for(let p=0;p<this.faces.length;p++){let c=this.faces[p],L=Math.floor(p/this.stickersperface),m=[];for(let R=0;R<c.length;R++)m.push(l(L,c.get(R)));f.push(m)}let u=[];for(let p=0;p<this.baseFaceCount;p++){u.push("<g>"),u.push("<title>"+this.facenames[p][1]+\`</title>
14
- \`);for(let c=0;c<this.stickersperface;c++){let L=p*this.stickersperface+c,m=this.facetocubie[L],R=this.facetoord[L],F=this.cubiesetnums[m],A=this.cubieordnums[m],U=this.graybyori(m)?"#808080":a[s.p[L]],b=this.cubiesetnames[F]+"-l"+A+"-o"+R;if(u.push(i(b,f[L],U)),this.duplicatedFaces[L])for(let S=1;S<this.duplicatedFaces[L];S++)b=this.cubiesetnames[F]+"-l"+A+"-o"+S,u.push(i(b,f[L],U))}u.push("</g>")}return\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
12
+ \`)}getKPuzzleDefinition(t=!0,r=!0){let o=this.getOrbitsDef(t,r).toKPuzzleDefinition(r);if(o.experimentalPuzzleDescription=this.puzzleDescription,!o)throw new Error("Missing definition!");return o}getMoveFromBits(t,r,n,o,l,i){let a=[],s=[],f=[];for(let p of this.cubieords)s.push(It(p)),f.push(Rr(p));for(let p=t[0];p<=t[1];p++){let c=o[p];for(let L=0;L<c.length;L+=2*i){let m=c.slice(L,L+2*i),R=this.cubiesetnums[m[0]];for(let U=0;U<m.length;U+=2)m[U]=this.cubieordnums[m[U]];let F=2,A=3;n&&(F=m.length-2,A=m.length-1),s[R]===It(this.cubieords[R])&&(s[R]=s[R].slice(),this.orbitoris[R]>1&&!this.options.fixedOrientation&&(f[R]=f[R].slice()));for(let U=0;U<m.length;U+=2)s[R][m[(U+F)%m.length]]=m[U],this.orbitoris[R]>1&&!this.options.fixedOrientation&&(f[R][m[U]]=(m[(U+A)%m.length]-m[(U+1)%m.length]+2*this.orbitoris[R])%this.orbitoris[R])}}let u=new er(It(24),Rr(24),1);for(let p=0;p<this.cubiesetnames.length;p++)if(!(l&&!l[p]))if(this.orbitoris[p]===1||this.options.fixedOrientation)s[p]===It(u.perm.length)?(s[p]!==u.perm&&(u=new er(s[p],f[p],1)),a.push(u)):a.push(new er(s[p],f[p],1));else{let c=new Array(f[p].length);for(let L=0;L<s[p].length;L++)c[L]=f[p][s[p][L]];a.push(new er(s[p],c,this.orbitoris[p]))}let g=new dr(a);return r!==1&&(g=g.mulScalar(r)),g}omitSet(t){for(let r of this.options.excludeOrbits)if(r===t)return!0;return!1}diffmvsets(t,r,n,o){for(let l=0;l<t.length;l+=2){let i=!1;for(let a=0;!i&&a<r.length;a+=2)o?t[l][0]+r[a][1]===n&&t[l][1]+r[a][0]===n&&t[l+1]===r[a+1]&&(i=!0):t[l][0]===r[a][0]&&t[l][1]===r[a][1]&&t[l+1]===r[a+1]&&(i=!0);if(!i)return!0}return!1}getOrbitsDef(t,r=!0){let n=[];if(t)for(let m=0;m<this.cubiesetnames.length;m++)n.push(1);let o=[],l=[],i=[],a=[];for(let m=0;m<this.moveplanesets.length;m++){let R=this.getmovesets(m);i.push(R),this.options.addRotations?a.push(1):a.push(0)}let s=[];for(let m=0;m<this.moveplanesets.length;m++){let R=this.moveplanesets[m].length,F=!1,A=i[m];for(let U=0;U<A.length;U+=2)A[U][0]===0&&A[U][1]===R&&(F=!0);s[m]=F}if(this.options.moveList&&this.options.addRotations){for(let m=0;m<this.moverotations.length;m++)a[m]=0;for(let m=0;m<this.moveplanesets.length;m++){if(s[m]){a[m]=3;continue}for(let R=0;R<this.moverotations.length;R++){let F=this.moveplanenormals[m];for(let A=1;A*2<=this.movesetorders[R];A++){if(F=F.rotatepoint(this.moverotations[R][0]),a[R]&A)continue;let U=-1,x=!1;for(let M=0;M<this.moveplanenormals.length;M++)if(F.dist(this.moveplanenormals[M])<Se){U=M;break}else if(F.dist(this.moveplanenormals[M].smul(-1))<Se){U=M,x=!0;break}if(U<0)throw new Error("Could not find rotation");let S=i[U];(S.length!==i[m].length||this.moveplanesets[m].length!==this.moveplanesets[U].length||this.diffmvsets(S,i[m],this.moveplanesets[U].length,x))&&(a[R]|=A)}}}for(let m=0;m<this.moverotations.length;m++)if(a[m]===0)a[m]=1;else if(a[m]===1)this.movesetorders[m]>3?a[m]=2:a[m]=0;else if(a[m]===3)a[m]=0;else throw new Error("Impossible addrot val")}for(let m=0;m<this.moveplanesets.length;m++)a[m]!==0&&!s[m]&&(i[m].push([0,this.moveplanesets[m].length]),i[m].push(a[m]));for(let m=0;m<this.moveplanesets.length;m++){let R=i[m],F=this.movesetorders[m];for(let x=0;x<R.length;x+=2)for(let S=0;S<x;S+=2)if(R[x][0]===R[S][0]&&R[x][1]===R[S][1])throw new Error("Redundant moves in moveset.");let A=[];for(let x=0;x<R.length;x+=2)for(let S=R[x][0];S<=R[x][1];S++)A[S]=1;let U=this.cmovesbyslice[m];for(let x=0;x<U.length;x++){if(A[x]!==1)continue;let S=U[x];for(let M=0;M<S.length;M+=2*F){if(this.skipcubie(S[M]))continue;let J=this.cubiesetnums[S[M]];n[J]=1}}}for(let m=0;m<this.cubiesetnames.length;m++)if(!!n[m]){if(this.omitSet(this.cubiesetnames[m])){n[m]=0;continue}o.push(this.cubiesetnames[m]),l.push(new Ho(this.cubieords[m],this.options.fixedOrientation?1:this.orbitoris[m]))}let f=[];for(let m=0;m<this.cubiesetnames.length;m++){if(!n[m]||this.omitSet(this.cubiesetnames[m]))continue;let R=[],F=[];for(let A=0;A<this.cubieords[m];A++){if(t)R.push(A);else{let U=this.cubiesetcubies[m][A];R.push(this.cubievaluemap[U])}F.push(0)}f.push(new er(R,F,this.options.fixedOrientation?1:this.orbitoris[m]))}let u=[],g=[],p=[],c=[];if(r)for(let m=0;m<this.moveplanesets.length;m++){let F=this.moveplanesets[m].length,A=i[m],U=this.movesetgeos[m];for(let x=0;x<A.length;x+=2){let S=A[x],M,J=!1;if(this.parsedmovelist!==void 0)for(let Q of this.parsedmovelist){if(Q[1]!==m)continue;let b=[];Q[4]?b=[Q[2],Q[3]]:b=[F-Q[3],F-Q[2]],b[0]===S[0]&&b[1]===S[1]&&(M=Q[0],J=!Q[4])}if(M)u.push(M),g.push(!0);else{let Q=BL(U,S,F);J=Q[1];let b=Q[0];A[x+1]===1?u.push(b):u.push(b+A[x+1]),g.push(!1)}c.push(S[0]===0&&S[1]===F);let C=this.getMoveFromBits(S,A[x+1],J,this.cmovesbyslice[m],n,this.movesetorders[m]);p.push(C)}}let L=new Tn(o,l,new Gn(f),u,p,c,g);return this.options.optimizeOrbits&&(L=L.optimize()),this.options.scrambleAmount!==0&&L.scramble(this.options.scrambleAmount),L}getScramble(t=0){let r=this.getOrbitsDef(!1);return r.transformToKTransformationData(r.getScrambleTransformation(t))}getMovesAsPerms(){return this.getOrbitsDef(!1).moveops.map(t=>t.toPerm())}showcanon(t){Uf(this.getOrbitsDef(!1),t)}getsolved(){let t=[];for(let r=0;r<this.baseFaceCount;r++)for(let n=0;n<this.stickersperface;n++)t.push(r);return new dt(t)}getOrientationRotation(t){let[r,[n,o,l]]=t[0],i=new W(0,n,-o,l),[a,[s,f,u]]=t[1],g=new W(0,s,-f,u),p=null,c=null,L=this.swizzler.unswizzle(r),m=this.swizzler.unswizzle(a);for(let U of this.geonormals)L===U[1]&&(p=U[0]),m===U[1]&&(c=U[0]);if(!p)throw new Error("Could not find feature "+r);if(!c)throw new Error("Could not find feature "+a);let R=p.pointrotation(i);return c.rotatepoint(R).unproject(i).pointrotation(g.unproject(i)).mul(R)}getInitial3DRotation(){let t=this.baseFaceCount,r=null;if(this.options.puzzleOrientation?r=this.options.puzzleOrientation:this.options.puzzleOrientations&&(r=this.options.puzzleOrientations[t]),r||(r=LL()[t]),!r)throw new Error("No default orientation?");return this.getOrientationRotation(r)}generate2dmapping(t=800,r=500,n=10,o=!1,l=.92){t-=2*n,r-=2*n;function i(w,v){let N=w[1][0]-w[0][0],j=w[1][1]-w[0][1],q=2*Math.PI/v,ie=Math.cos(q),de=Math.sin(q);for(let be=2;be<v;be++){let Ye=N*ie+j*de;j=j*ie-N*de,N=Ye,w.push([w[be-1][0]+N,w[be-1][1]+j])}}this.genperms();let f=this.getboundarygeometry().facenames[0][0].length,u=this.net;if(u===null)throw new Error("No net?");let g={},p=0,c=0,L=1,m=0;g[u[0][0]]=[[1,0],[0,0]],i(g[u[0][0]],f);for(let w of u){let v=w[0];if(!g[v])throw new Error("Bad edge description; first edge not connected.");for(let N=1;N<w.length;N++){let j=w[N];j===""||g[j]||(g[j]=[g[v][N%f],g[v][(N+f-1)%f]],i(g[j],f))}}for(let w in g){let v=g[w];for(let N of v)p=Math.min(p,N[0]),L=Math.max(L,N[0]),c=Math.min(c,N[1]),m=Math.max(m,N[1])}let R=Math.min(t/(L-p),r/(m-c)),F=.5*(t-R*(L+p)),A=.5*(r-R*(m+c)),U={},x=this.getboundarygeometry(),S={},M=[[R+F,A],[F,A]];S[u[0][0]]=M,i(S[u[0][0]],f),U[this.facenames[0][1]]=this.project2d(0,0,[new W(0,M[0][0],M[0][1],0),new W(0,M[1][0],M[1][1],0)]);let J=[];J[0]=0;for(let w of u){let v=w[0];if(!S[v])throw new Error("Bad edge description; first edge not connected.");let N=-1;for(let q=0;q<x.facenames.length;q++)if(v===x.facenames[q][1]){N=q;break}if(N<0)throw new Error("Could not find first face name "+v);let j=x.facenames[N][0];for(let q=1;q<w.length;q++){let ie=w[q];if(ie===""||S[ie])continue;S[ie]=[S[v][q%f],S[v][(q+f-1)%f]],i(S[ie],f);let de=J[N],be=j[(de+q)%f].sum(j[(de+q+f-1)%f]).smul(.5),Ye=fi(x.edgenames,be),bt=x.edgenames[Ye][1],Le=RL(bt,this.facenames),Lt=Le[v===Le[0]?1:0],lt=-1;for(let ze=0;ze<x.facenames.length;ze++)if(Lt===x.facenames[ze][1]){lt=ze;break}if(lt<0)throw new Error("Could not find second face name");let ct=x.facenames[lt][0];for(let ze=0;ze<ct.length;ze++)if(ct[ze].sum(ct[(ze+1)%f]).smul(.5).dist(be)<=Se){let _=S[v][(q+f-1)%f],O=S[v][q%f];J[lt]=ze,U[Lt]=this.project2d(lt,ze,[new W(0,O[0],O[1],0),new W(0,_[0],_[1],0)]);break}}}let C=0,Q=0,b=this.getInitial3DRotation();for(let w of this.faces){o&&(w=w.rotate(b));for(let v=0;v<w.length;v++)C=Math.max(C,Math.abs(w.get(v).b)),Q=Math.max(Q,Math.abs(w.get(v).c))}let k=Math.min(r/Q/2,(t-n)/C/4);return(w,v)=>{if(o){v=v.rotatepoint(b);let N=.5*n+.25*t,j=this.baseplanes[w].rotateplane(b).d<0?1:-1;return[n+t*.5+j*(N-v.b*k),n+r*.5+v.c*k]}else{let N=U[this.facenames[w][1]];return[n+l*v.dot(N[0])+N[2].b,n+r-l*v.dot(N[1])-N[2].c]}}}generatesvg(t=800,r=500,n=10,o=!1){let l=this.generate2dmapping(t,r,n,o);function i(p,c,L){return'<polygon id="'+p+'" class="sticker" style="fill: '+L+'" points="'+c.map(m=>m[0]+" "+m[1]).join(" ")+\`"/>
13
+ \`}let a=this.getsolved(),s=[],f=[];for(let p=0;p<this.baseFaceCount;p++)s[p]=this.colors[this.facenames[p][1]];for(let p=0;p<this.faces.length;p++){let c=this.faces[p],L=Math.floor(p/this.stickersperface),m=[];for(let R=0;R<c.length;R++)m.push(l(L,c.get(R)));f.push(m)}let u=[];for(let p=0;p<this.baseFaceCount;p++){u.push("<g>"),u.push("<title>"+this.facenames[p][1]+\`</title>
14
+ \`);for(let c=0;c<this.stickersperface;c++){let L=p*this.stickersperface+c,m=this.facetocubie[L],R=this.facetoord[L],F=this.cubiesetnums[m],A=this.cubieordnums[m],U=this.graybyori(m)?"#808080":s[a.p[L]],x=this.cubiesetnames[F]+"-l"+A+"-o"+R;if(u.push(i(x,f[L],U)),this.duplicatedFaces[L])for(let S=1;S<this.duplicatedFaces[L];S++)x=this.cubiesetnames[F]+"-l"+A+"-o"+S,u.push(i(x,f[L],U))}u.push("</g>")}return\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
15
15
  <style type="text/css"><![CDATA[.sticker { stroke: #000000; stroke-width: 1px; }]]></style>
16
- \`+u.join("")+"</svg>"}get3d(t){let r=[],n=this.getInitial3DRotation(),o=[],l=.52*this.basefaces[0].get(0).len();for(let f=0;f<this.basefaces.length;f++){let u=this.basefaces[f].rotate(n),g=this.facenames[f][1];o.push({coords:gs(u,l),name:g})}for(let f=0;f<this.faces.length;f++){let u=Math.floor(f/this.stickersperface),g=this.facetocubie[f],p=this.facetoord[f],c=this.cubiesetnums[g],L=this.cubieordnums[g],m=this.graybyori(g)?"#808080":this.colors[this.facenames[u][1]];t?.stickerColors&&(m=t.stickerColors[f]);let R=this.faces[f].rotate(n);r.push({coords:gs(R,l),color:m,orbit:this.cubiesetnames[c],ord:L,ori:p,face:u});let F=R;if(this.duplicatedFaces[f]){let A=F.length/this.duplicatedFaces[f];for(let U=1;U<this.duplicatedFaces[f];U++){for(let b=0;b<A;b++)F=F.rotateforward();r.push({coords:gs(F,l),color:m,orbit:this.cubiesetnames[c],ord:L,ori:U,face:u,isDup:!0})}}}let i=[];for(let f=0;f<this.movesetgeos.length;f++){let u=this.movesetgeos[f],g=this.movesetorders[f];for(let p of this.geonormals)u[0]===p[1]&&u[1]===p[2]&&(i.push({coordinates:ii(p[0].rotatepoint(n),1),quantumMove:new B(u[0]),order:g}),i.push({coordinates:ii(p[0].rotatepoint(n).smul(-1),1),quantumMove:new B(u[2]),order:g}))}let s=this.generate2dmapping(2880,2160,0,!1,1),a=function(){let f=n.invrot();return function(u,g){let p=new W(0,g[0]*l,-g[1]*l,g[2]*l);p=p.rotatepoint(f);let c=s(u,p);return c[0]/=2880,c[1]=1-c[1]/2160,c}}().bind(this);return{stickers:r,faces:o,axis:i,unswizzle:this.unswizzle.bind(this),notationMapper:this.notationMapper,textureMapper:{getuv:a}}}getGeoNormal(t){let r=this.getInitial3DRotation(),n=this.swizzler.unswizzle(t);for(let o of this.geonormals)if(n===o[1]){let l=ii(o[0].rotatepoint(r),1);return Math.abs(l[0])<Se&&Math.abs(l[2])<Se&&(l[0]=0,l[2]=1e-6),l}}getfaceindex(t){let r=this.stickersperface;return Math.floor(t/r)}textForTwizzleExplorer(){return\`Faces \${this.baseplanerot.length}
16
+ \`+u.join("")+"</svg>"}get3d(t){let r=[],n=this.getInitial3DRotation(),o=[],l=.52*this.basefaces[0].get(0).len();for(let f=0;f<this.basefaces.length;f++){let u=this.basefaces[f].rotate(n),g=this.facenames[f][1];o.push({coords:Ls(u,l),name:g})}for(let f=0;f<this.faces.length;f++){let u=Math.floor(f/this.stickersperface),g=this.facetocubie[f],p=this.facetoord[f],c=this.cubiesetnums[g],L=this.cubieordnums[g],m=this.graybyori(g)?"#808080":this.colors[this.facenames[u][1]];t?.stickerColors&&(m=t.stickerColors[f]);let R=this.faces[f].rotate(n);r.push({coords:Ls(R,l),color:m,orbit:this.cubiesetnames[c],ord:L,ori:p,face:u});let F=R;if(this.duplicatedFaces[f]){let A=F.length/this.duplicatedFaces[f];for(let U=1;U<this.duplicatedFaces[f];U++){for(let x=0;x<A;x++)F=F.rotateforward();r.push({coords:Ls(F,l),color:m,orbit:this.cubiesetnames[c],ord:L,ori:U,face:u,isDup:!0})}}}let i=[];for(let f=0;f<this.movesetgeos.length;f++){let u=this.movesetgeos[f],g=this.movesetorders[f];for(let p of this.geonormals)u[0]===p[1]&&u[1]===p[2]&&(i.push({coordinates:ui(p[0].rotatepoint(n),1),quantumMove:new B(u[0]),order:g}),i.push({coordinates:ui(p[0].rotatepoint(n).smul(-1),1),quantumMove:new B(u[2]),order:g}))}let a=this.generate2dmapping(2880,2160,0,!1,1),s=function(){let f=n.invrot();return function(u,g){let p=new W(0,g[0]*l,-g[1]*l,g[2]*l);p=p.rotatepoint(f);let c=a(u,p);return c[0]/=2880,c[1]=1-c[1]/2160,c}}().bind(this);return{stickers:r,faces:o,axis:i,unswizzle:this.unswizzle.bind(this),notationMapper:this.notationMapper,textureMapper:{getuv:s}}}getGeoNormal(t){let r=this.getInitial3DRotation(),n=this.swizzler.unswizzle(t);for(let o of this.geonormals)if(n===o[1]){let l=ui(o[0].rotatepoint(r),1);return Math.abs(l[0])<Se&&Math.abs(l[2])<Se&&(l[0]=0,l[2]=1e-6),l}}getfaceindex(t){let r=this.stickersperface;return Math.floor(t/r)}textForTwizzleExplorer(){return\`Faces \${this.baseplanerot.length}
17
17
  Stickers per face \${this.stickersperface}
18
18
  Short edge \${this.shortedge}
19
19
  Cubies \${this.cubies.length}
20
20
  Edge distance \${this.edgedistance}
21
- Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrbitsDef(!1).reassemblySize();t(\`Reassembly size is \${n}\`);let o=oi(this.getMovesAsPerms(),t),l=n/o;t(\`Ratio is \${l}\`)}},$r=class{constructor(t,r){this.pg=t;this.orbitNames=r.orbitnames}lookupMove(t){let r=this.pg.parseMove(t);if(this.pg.parsedmovelist){let i=!1;for(let s of this.pg.parsedmovelist)s[1]===r[1]&&s[2]===r[2]&&s[3]===r[3]&&s[4]===r[4]&&(i=!0);if(!i)return null}let n=[r[2],r[3]];if(!r[4]){let i=this.pg.moveplanesets[r[1]].length;n=[i-r[3],i-r[2]]}let o=this.pg.getMoveFromBits(n,r[5],!r[4],this.pg.cmovesbyslice[r[1]],void 0,this.pg.movesetorders[r[1]]);return Tn.transformToKTransformationData(this.orbitNames,o)}}});var ai={};Bt(ai,{EXPERIMENTAL_PUZZLE_BASE_SHAPES:()=>kf,EXPERIMENTAL_PUZZLE_CUT_TYPES:()=>zf,ExperimentalPGNotation:()=>$r,PuzzleGeometry:()=>si,Quat:()=>W,getPG3DNamedPuzzles:()=>Ef,getPuzzleDescriptionString:()=>_f,getPuzzleGeometryByDesc:()=>ps,getPuzzleGeometryByName:()=>Gn,parseOptions:()=>Lf,parsePuzzleDescription:()=>Ko,schreierSims:()=>oi});var In=y(()=>{Qo();rs();ri();us();Qo();Qo()});async function en(e){return(await Promise.resolve().then(()=>(In(),ai))).getPuzzleGeometryByName(e,{allMoves:!0,orientCenters:!0,addRotations:!0})}async function pL(e,t){let r=await e,n=r.getKPuzzleDefinition(!0);n.name=t;let o=await Promise.resolve().then(()=>(In(),ai)),l=new o.ExperimentalPGNotation(r,r.getOrbitsDef(!0));return new be(n,{experimentalPGNotation:l})}var fi,ui,gi,ht,tn,Fr=y(()=>{qe();Oo();Gt();ht=class{constructor(t){oe(this,fi,void 0);oe(this,ui,void 0);oe(this,gi,void 0);this.pgId=t.pgID,this.id=t.id,this.fullName=t.fullName,this.inventedBy=t.inventedBy,this.inventionYear=t.inventionYear}pg(){return d(this,fi)??V(this,fi,en(this.pgId??this.id))}kpuzzle(){return d(this,ui)??V(this,ui,pL(this.pg(),this.id))}svg(){return d(this,gi)??V(this,gi,(async()=>(await this.pg()).generatesvg())())}};fi=new WeakMap,ui=new WeakMap,gi=new WeakMap;tn=class extends ht{constructor(){super(...arguments);this.stickerings=Mn}appearance(t){return $t(this,t)}}});var _t,Cf=y(()=>{_t={name:"2x2x2",orbits:{CORNERS:{numPieces:8,numOrientations:3}},startStateData:{CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{U:{CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},y:{CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}},x:{CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},L:{CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]}},F:{CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]}},R:{CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]}},B:{CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]}},D:{CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}},z:{CORNERS:{permutation:[3,2,6,5,0,4,7,1],orientation:[1,2,1,2,2,1,2,1]}}}};_t.moves.Rv=_t.moves.x;_t.moves.Uv=_t.moves.y;_t.moves.Fv=_t.moves.z;_t.moves.Lv={CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]}};_t.moves.Dv={CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}};_t.moves.Bv={CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]}}});var Pf,Mf=y(()=>{Pf=\`<?xml version="1.0" encoding="UTF-8"?>
21
+ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrbitsDef(!1).reassemblySize();t(\`Reassembly size is \${n}\`);let o=si(this.getMovesAsPerms(),t),l=n/o;t(\`Ratio is \${l}\`)}},$r=class{constructor(t,r){this.pg=t;this.orbitNames=r.orbitnames}lookupMove(t){let r=this.pg.parseMove(t);if(this.pg.parsedmovelist){let i=!1;for(let a of this.pg.parsedmovelist)a[1]===r[1]&&a[2]===r[2]&&a[3]===r[3]&&a[4]===r[4]&&(i=!0);if(!i)return null}let n=[r[2],r[3]];if(!r[4]){let i=this.pg.moveplanesets[r[1]].length;n=[i-r[3],i-r[2]]}let o=this.pg.getMoveFromBits(n,r[5],!r[4],this.pg.cmovesbyslice[r[1]],void 0,this.pg.movesetorders[r[1]]);return Tn.transformToKTransformationData(this.orbitNames,o)}}});var pi={};Bt(pi,{EXPERIMENTAL_PUZZLE_BASE_SHAPES:()=>Tf,EXPERIMENTAL_PUZZLE_CUT_TYPES:()=>Gf,ExperimentalPGNotation:()=>$r,PuzzleGeometry:()=>gi,Quat:()=>W,getPG3DNamedPuzzles:()=>Mf,getPuzzleDescriptionString:()=>Nf,getPuzzleGeometryByDesc:()=>Bs,getPuzzleGeometryByName:()=>On,parseOptions:()=>Df,parsePuzzleDescription:()=>qo,schreierSims:()=>si});var In=y(()=>{Vo();is();ii();ms();Vo();Vo()});async function en(e){return(await Promise.resolve().then(()=>(In(),pi))).getPuzzleGeometryByName(e,{allMoves:!0,orientCenters:!0,addRotations:!0})}async function dL(e,t){let r=await e,n=r.getKPuzzleDefinition(!0);n.name=t;let o=await Promise.resolve().then(()=>(In(),pi)),l=new o.ExperimentalPGNotation(r,r.getOrbitsDef(!0));return new xe(n,{experimentalPGNotation:l})}var ci,mi,Li,ht,tn,hr=y(()=>{He();Wo();Ot();ht=class{constructor(t){ee(this,ci,void 0);ee(this,mi,void 0);ee(this,Li,void 0);this.pgId=t.pgID,this.id=t.id,this.fullName=t.fullName,this.inventedBy=t.inventedBy,this.inventionYear=t.inventionYear}pg(){return d(this,ci)??V(this,ci,en(this.pgId??this.id))}kpuzzle(){return d(this,mi)??V(this,mi,dL(this.pg(),this.id))}svg(){return d(this,Li)??V(this,Li,(async()=>(await this.pg()).generatesvg())())}};ci=new WeakMap,mi=new WeakMap,Li=new WeakMap;tn=class extends ht{constructor(){super(...arguments);this.stickerings=Mn}appearance(t){return $t(this,t)}}});var Et,Of=y(()=>{Et={name:"2x2x2",orbits:{CORNERS:{numPieces:8,numOrientations:3}},startStateData:{CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{U:{CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},y:{CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}},x:{CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},L:{CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]}},F:{CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]}},R:{CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]}},B:{CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]}},D:{CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}},z:{CORNERS:{permutation:[3,2,6,5,0,4,7,1],orientation:[1,2,1,2,2,1,2,1]}}}};Et.moves.Rv=Et.moves.x;Et.moves.Uv=Et.moves.y;Et.moves.Fv=Et.moves.z;Et.moves.Lv={CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]}};Et.moves.Dv={CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}};Et.moves.Bv={CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]}}});var If,Wf=y(()=>{If=\`<?xml version="1.0" encoding="UTF-8"?>
22
22
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
23
23
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
24
24
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 520 394" preserveAspectRatio="xMidYMid meet">
@@ -62,7 +62,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
62
62
  <use id="CORNERS-l7-o2" xlink:href="#sticker" transform="translate(6.6, 3.2)" style="fill: #26f"/>
63
63
  </g>
64
64
 
65
- </svg>\`});var Nf,Tf=y(()=>{Nf={name:"Clock",orbits:{DIALS:{numPieces:18,numOrientations:12},FACES:{numPieces:18,numOrientations:1},FRAME:{numPieces:1,numOrientations:2}},startStateData:{DIALS:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{pieces:[0],orientation:[0]}},moves:{UR_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,1,1,0,1,1,0,0,0,-1,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DR_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,-1,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},UL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,0,1,1,0,0,0,0,0,0,-1,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},U_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,1,1,1,1,0,0,0,-1,0,-1,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},R_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,1,1,0,1,1,0,1,1,-1,0,0,0,0,0,-1,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},D_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,-1,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},L_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,0,1,1,0,1,1,0,0,0,-1,0,0,0,0,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},ALL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,1,1,1,1,1,1,1,-1,0,-1,0,0,0,-1,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},y2:{DIALS:{permutation:[9,10,11,12,13,14,15,16,17,0,1,2,3,4,5,6,7,8],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[9,10,11,12,13,14,15,16,17,0,1,2,3,4,5,6,7,8],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[1]}},UL:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},UR:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DL:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DR:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}}}}});var Of,Gf=y(()=>{Of=\`<?xml version="1.0" encoding="UTF-8"?>
65
+ </svg>\`});var Kf,Qf=y(()=>{Kf={name:"Clock",orbits:{DIALS:{numPieces:18,numOrientations:12},FACES:{numPieces:18,numOrientations:1},FRAME:{numPieces:1,numOrientations:2}},startStateData:{DIALS:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{pieces:[0],orientation:[0]}},moves:{UR_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,1,1,0,1,1,0,0,0,-1,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DR_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,-1,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},UL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,0,1,1,0,0,0,0,0,0,-1,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},U_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,1,1,1,1,0,0,0,-1,0,-1,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},R_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,1,1,0,1,1,0,1,1,-1,0,0,0,0,0,-1,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},D_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,-1,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},L_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,0,1,1,0,1,1,0,0,0,-1,0,0,0,0,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},ALL_PLUS_:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[1,1,1,1,1,1,1,1,1,-1,0,-1,0,0,0,-1,0,-1]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},y2:{DIALS:{permutation:[9,10,11,12,13,14,15,16,17,0,1,2,3,4,5,6,7,8],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[9,10,11,12,13,14,15,16,17,0,1,2,3,4,5,6,7,8],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[1]}},UL:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},UR:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DL:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}},DR:{DIALS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FACES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},FRAME:{permutation:[0],orientation:[0]}}}}});var jf,qf=y(()=>{jf=\`<?xml version="1.0" encoding="UTF-8"?>
66
66
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 480 240" preserveAspectRatio="xMidYMid meet">
67
67
  <title>clock</title>
68
68
  <defs>
@@ -430,7 +430,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
430
430
  </g>
431
431
  </g>
432
432
  </g>
433
- </svg>\`});var If,Wf=y(()=>{If=\`<?xml version="1.0" encoding="UTF-8"?>
433
+ </svg>\`});var Vf,Hf=y(()=>{Vf=\`<?xml version="1.0" encoding="UTF-8"?>
434
434
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
435
435
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
436
436
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-20 -20 546 480" preserveAspectRatio="xMidYMid meet">
@@ -517,7 +517,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
517
517
  <use id="EDGES-l4-o1" xlink:href="#stickerV" transform="translate(1, 1)" style="fill: red"/>
518
518
  </g>
519
519
 
520
- </svg>\`});var Kf,Qf=y(()=>{Kf={name:"Square-1",orbits:{WEDGES:{numPieces:24,numOrientations:9},EQUATOR:{numPieces:2,numOrientations:6}},startStateData:{WEDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{pieces:[0,1],orientation:[0,0]}},moves:{U_SQ_:{WEDGES:{permutation:[11,0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,0]}},D_SQ_:{WEDGES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,23,12,13,14,15,16,17,18,19,20,21,22],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,0]}},_SLASH_:{WEDGES:{permutation:[0,1,2,3,4,5,12,13,14,15,16,17,6,7,8,9,10,11,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,3]}}}}});var jf,qf=y(()=>{jf=\`<?xml version="1.0" encoding="UTF-8"?>
520
+ </svg>\`});var Zf,Jf=y(()=>{Zf={name:"Square-1",orbits:{WEDGES:{numPieces:24,numOrientations:9},EQUATOR:{numPieces:2,numOrientations:6}},startStateData:{WEDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{pieces:[0,1],orientation:[0,0]}},moves:{U_SQ_:{WEDGES:{permutation:[11,0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,0]}},D_SQ_:{WEDGES:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,23,12,13,14,15,16,17,18,19,20,21,22],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,0]}},_SLASH_:{WEDGES:{permutation:[0,1,2,3,4,5,12,13,14,15,16,17,6,7,8,9,10,11,18,19,20,21,22,23],orientation:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},EQUATOR:{permutation:[0,1],orientation:[0,3]}}}}});var Yf,Xf=y(()=>{Yf=\`<?xml version="1.0" encoding="UTF-8"?>
521
521
  <svg width="360px" height="552px" viewBox="0 0 360 552" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
522
522
  <!-- Generator: Sketch 59.1 (86144) - https://sketch.com -->
523
523
  <title>sq1-fancy</title>
@@ -811,7 +811,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
811
811
  <line x1="0.15767665" y1="262.276878" x2="70.4345542" y2="2.27488928e-16" id="TOP"></line>
812
812
  </g>
813
813
  </g>
814
- </svg>\`});var Dr={};Bt(Dr,{clockJSON:()=>Nf,clockSVG:()=>Of,cube2x2x2JSON:()=>_t,cube2x2x2SVG:()=>Pf,pyraminxSVG:()=>If,sq1HyperOrbitJSON:()=>Kf,sq1HyperOrbitSVG:()=>jf});var Ar=y(()=>{Cf();Mf();Tf();Gf();Wf();Qf();qf()});var Vo,Vf=y(()=>{qe();Fr();Gt();Oo();Vo={id:"2x2x2",fullName:"2\\xD72\\xD72 Cube",kpuzzle:he(async()=>new be((await Promise.resolve().then(()=>(Ar(),Dr))).cube2x2x2JSON)),svg:async()=>(await Promise.resolve().then(()=>(Ar(),Dr))).cube2x2x2SVG,pg:he(async()=>en("2x2x2")),appearance:e=>$t(Vo,e),stickerings:Mn}});var Fe,Hf=y(()=>{Fe={name:"3x3x3",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3},CENTERS:{numPieces:6,numOrientations:4}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{pieces:[0,1,2,3,4,5],orientation:[0,0,0,0,0,0]}},moves:{U:{EDGES:{permutation:[1,2,3,0,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[1,0,0,0,0,0]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,2,3,4,1,5],orientation:[1,0,0,0,0,3]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]},CENTERS:{permutation:[2,1,5,3,0,4],orientation:[0,3,0,1,2,2]}},L:{EDGES:{permutation:[0,1,2,11,4,5,6,9,8,3,10,7],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,1,0,0,0,0]}},F:{EDGES:{permutation:[9,1,2,3,8,5,6,7,0,4,10,11],orientation:[1,0,0,0,1,0,0,0,1,1,0,0]},CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,1,0,0,0]}},R:{EDGES:{permutation:[0,8,2,3,4,10,6,7,5,9,1,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,1,0,0]}},B:{EDGES:{permutation:[0,1,10,3,4,5,11,7,8,9,6,2],orientation:[0,0,1,0,0,0,1,0,0,0,1,1]},CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,0,1,0]}},D:{EDGES:{permutation:[0,1,2,3,7,4,5,6,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,0,0,1]}},z:{EDGES:{permutation:[9,3,11,7,8,1,10,5,0,4,2,6],orientation:[1,1,1,1,1,1,1,1,1,1,1,1]},CORNERS:{permutation:[3,2,6,5,0,4,7,1],orientation:[1,2,1,2,2,1,2,1]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,1,1,3,1]}},M:{EDGES:{permutation:[2,1,6,3,0,5,4,7,8,9,10,11],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,0,0,0,2,0]}},E:{EDGES:{permutation:[0,1,2,3,4,5,6,7,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[0,0,0,0,0,0]}},S:{EDGES:{permutation:[0,3,2,7,4,1,6,5,8,9,10,11],orientation:[0,1,0,1,0,1,0,1,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,0,1,0,1]}},u:{EDGES:{permutation:[1,2,3,0,4,5,6,7,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,2,3,4,1,5],orientation:[1,0,0,0,0,0]}},l:{EDGES:{permutation:[2,1,6,11,0,5,4,9,8,3,10,7],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,1,0,0,2,0]}},f:{EDGES:{permutation:[9,3,2,7,8,1,6,5,0,4,10,11],orientation:[1,1,0,1,1,1,0,1,1,1,0,0]},CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,1,1,0,1]}},r:{EDGES:{permutation:[4,8,0,3,6,10,2,7,5,9,1,11],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]},CENTERS:{permutation:[2,1,5,3,0,4],orientation:[0,0,0,1,2,2]}},b:{EDGES:{permutation:[0,5,10,1,4,7,11,3,8,9,6,2],orientation:[0,1,1,1,0,1,1,1,0,0,1,1]},CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]},CENTERS:{permutation:[3,0,2,5,4,1],orientation:[3,3,0,3,1,3]}},d:{EDGES:{permutation:[0,1,2,3,7,4,5,6,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[0,0,0,0,0,1]}}}};Fe.moves.Uw=Fe.moves.u;Fe.moves.Lw=Fe.moves.l;Fe.moves.Fw=Fe.moves.f;Fe.moves.Rw=Fe.moves.r;Fe.moves.Bw=Fe.moves.b;Fe.moves.Dw=Fe.moves.d;Fe.moves.Rv=Fe.moves.x;Fe.moves.Uv=Fe.moves.y;Fe.moves.Fv=Fe.moves.z;Fe.moves.Lv={EDGES:{permutation:[2,10,6,11,0,8,4,9,1,3,5,7],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,1,0,3,2,0]}};Fe.moves.Dv={EDGES:{permutation:[3,0,1,2,7,4,5,6,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[3,0,0,0,0,1]}};Fe.moves.Bv={EDGES:{permutation:[8,5,10,1,9,7,11,3,4,0,6,2],orientation:[1,1,1,1,1,1,1,1,1,1,1,1]},CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]},CENTERS:{permutation:[3,0,2,5,4,1],orientation:[3,3,3,3,1,3]}}});function cs(e){let t=e.stateData.CENTERS.pieces[0],r=e.stateData.CENTERS.pieces[5],n=e.stateData.CENTERS.pieces[1],o=n;return t<n&&o--,r<n&&o--,[t,o]}function Jf(){if(!cL){let e=["","z","x","z'","x'","x2"].map(r=>E.fromString(r)),t=new E("y");for(let r of e){let n=pi.algToTransformation(r);for(let o=0;o<4;o++){n=n.applyAlg(t);let[l,i]=cs(n.toKState());Zf[l][i]=n.invert()}}}return Zf}function Yf(e){let[t,r]=cs(e),n=Jf()[t][r];return e.applyTransformation(n)}function ms(e,t){return t.ignorePuzzleOrientation&&(e=Yf(e)),t.ignoreCenterOrientation&&(e=new ce(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})),!!e.experimentalToTransformation()?.isIdentityTransformation()}var Zf,cL,Ls=y(()=>{Be();qe();Bs();Zf=new Array(6).fill(0).map(()=>new Array(6)),cL=!1});var Xf=y(()=>{qe()});var pi,Bs=y(()=>{qe();Hf();Ls();Ls();J0();Xf();ql();pi=new be(Fe);Fe.experimentalIsStateSolved=ms});var mL,$f=y(()=>{mL=\`<?xml version="1.0" encoding="UTF-8"?>
814
+ </svg>\`});var Fr={};Bt(Fr,{clockJSON:()=>Kf,clockSVG:()=>jf,cube2x2x2JSON:()=>Et,cube2x2x2SVG:()=>If,pyraminxSVG:()=>Vf,sq1HyperOrbitJSON:()=>Zf,sq1HyperOrbitSVG:()=>Yf});var Dr=y(()=>{Of();Wf();Qf();qf();Hf();Jf();Xf()});var Jo,$f=y(()=>{He();hr();Ot();Wo();Jo={id:"2x2x2",fullName:"2\\xD72\\xD72 Cube",kpuzzle:he(async()=>new xe((await Promise.resolve().then(()=>(Dr(),Fr))).cube2x2x2JSON)),svg:async()=>(await Promise.resolve().then(()=>(Dr(),Fr))).cube2x2x2SVG,pg:he(async()=>en("2x2x2")),appearance:e=>$t(Jo,e),stickerings:Mn}});var Fe,eu=y(()=>{Fe={name:"3x3x3",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3},CENTERS:{numPieces:6,numOrientations:4}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{pieces:[0,1,2,3,4,5],orientation:[0,0,0,0,0,0]}},moves:{U:{EDGES:{permutation:[1,2,3,0,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[1,0,0,0,0,0]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,2,3,4,1,5],orientation:[1,0,0,0,0,3]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]},CENTERS:{permutation:[2,1,5,3,0,4],orientation:[0,3,0,1,2,2]}},L:{EDGES:{permutation:[0,1,2,11,4,5,6,9,8,3,10,7],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,1,0,0,0,0]}},F:{EDGES:{permutation:[9,1,2,3,8,5,6,7,0,4,10,11],orientation:[1,0,0,0,1,0,0,0,1,1,0,0]},CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,1,0,0,0]}},R:{EDGES:{permutation:[0,8,2,3,4,10,6,7,5,9,1,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,1,0,0]}},B:{EDGES:{permutation:[0,1,10,3,4,5,11,7,8,9,6,2],orientation:[0,0,1,0,0,0,1,0,0,0,1,1]},CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,0,1,0]}},D:{EDGES:{permutation:[0,1,2,3,7,4,5,6,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,1,2,3,4,5],orientation:[0,0,0,0,0,1]}},z:{EDGES:{permutation:[9,3,11,7,8,1,10,5,0,4,2,6],orientation:[1,1,1,1,1,1,1,1,1,1,1,1]},CORNERS:{permutation:[3,2,6,5,0,4,7,1],orientation:[1,2,1,2,2,1,2,1]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,1,1,3,1]}},M:{EDGES:{permutation:[2,1,6,3,0,5,4,7,8,9,10,11],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,0,0,0,2,0]}},E:{EDGES:{permutation:[0,1,2,3,4,5,6,7,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[0,0,0,0,0,0]}},S:{EDGES:{permutation:[0,3,2,7,4,1,6,5,8,9,10,11],orientation:[0,1,0,1,0,1,0,1,0,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,0,1,0,1]}},u:{EDGES:{permutation:[1,2,3,0,4,5,6,7,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,2,3,4,1,5],orientation:[1,0,0,0,0,0]}},l:{EDGES:{permutation:[2,1,6,11,0,5,4,9,8,3,10,7],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[0,1,6,2,4,3,5,7],orientation:[0,0,2,1,0,2,1,0]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,1,0,0,2,0]}},f:{EDGES:{permutation:[9,3,2,7,8,1,6,5,0,4,10,11],orientation:[1,1,0,1,1,1,0,1,1,1,0,0]},CORNERS:{permutation:[3,1,2,5,0,4,6,7],orientation:[1,0,0,2,2,1,0,0]},CENTERS:{permutation:[1,5,2,0,4,3],orientation:[1,1,1,1,0,1]}},r:{EDGES:{permutation:[4,8,0,3,6,10,2,7,5,9,1,11],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,2,3,7,5,6,1],orientation:[2,1,0,0,1,0,0,2]},CENTERS:{permutation:[2,1,5,3,0,4],orientation:[0,0,0,1,2,2]}},b:{EDGES:{permutation:[0,5,10,1,4,7,11,3,8,9,6,2],orientation:[0,1,1,1,0,1,1,1,0,0,1,1]},CORNERS:{permutation:[0,7,1,3,4,5,2,6],orientation:[0,2,1,0,0,0,2,1]},CENTERS:{permutation:[3,0,2,5,4,1],orientation:[3,3,0,3,1,3]}},d:{EDGES:{permutation:[0,1,2,3,7,4,5,6,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[0,1,2,3,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[0,0,0,0,0,1]}}}};Fe.moves.Uw=Fe.moves.u;Fe.moves.Lw=Fe.moves.l;Fe.moves.Fw=Fe.moves.f;Fe.moves.Rw=Fe.moves.r;Fe.moves.Bw=Fe.moves.b;Fe.moves.Dw=Fe.moves.d;Fe.moves.Rv=Fe.moves.x;Fe.moves.Uv=Fe.moves.y;Fe.moves.Fv=Fe.moves.z;Fe.moves.Lv={EDGES:{permutation:[2,10,6,11,0,8,4,9,1,3,5,7],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]},CENTERS:{permutation:[4,1,0,3,5,2],orientation:[2,1,0,3,2,0]}};Fe.moves.Dv={EDGES:{permutation:[3,0,1,2,7,4,5,6,9,11,8,10],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]},CENTERS:{permutation:[0,4,1,2,3,5],orientation:[3,0,0,0,0,1]}};Fe.moves.Bv={EDGES:{permutation:[8,5,10,1,9,7,11,3,4,0,6,2],orientation:[1,1,1,1,1,1,1,1,1,1,1,1]},CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]},CENTERS:{permutation:[3,0,2,5,4,1],orientation:[3,3,3,3,1,3]}}});function Rs(e){let t=e.stateData.CENTERS.pieces[0],r=e.stateData.CENTERS.pieces[5],n=e.stateData.CENTERS.pieces[1],o=n;return t<n&&o--,r<n&&o--,[t,o]}function ru(){if(!hL){let e=["","z","x","z'","x'","x2"].map(r=>E.fromString(r)),t=new E("y");for(let r of e){let n=Bi.algToTransformation(r);for(let o=0;o<4;o++){n=n.applyAlg(t);let[l,i]=Rs(n.toKState());tu[l][i]=n.invert()}}}return tu}function nu(e){let[t,r]=Rs(e),n=ru()[t][r];return e.applyTransformation(n)}function ds(e,t){return t.ignorePuzzleOrientation&&(e=nu(e)),t.ignoreCenterOrientation&&(e=new ce(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})),!!e.experimentalToTransformation()?.isIdentityTransformation()}var tu,hL,hs=y(()=>{Be();He();Fs();tu=new Array(6).fill(0).map(()=>new Array(6)),hL=!1});var ou=y(()=>{He()});var Bi,Fs=y(()=>{He();eu();hs();hs();es();ou();Jl();Bi=new xe(Fe);Fe.experimentalIsStateSolved=ds});var FL,lu=y(()=>{FL=\`<?xml version="1.0" encoding="UTF-8"?>
815
815
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
816
816
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
817
817
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 518 392" preserveAspectRatio="xMidYMid meet">
@@ -938,7 +938,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
938
938
  <use id="CENTERS-l5-o3" xlink:href="#sticker" transform="translate(4.3,7.5)" style="fill: yellow"/>
939
939
  </g>
940
940
 
941
- </svg>\`});var LL,eu=y(()=>{LL=\`<?xml version="1.0" encoding="UTF-8"?>
941
+ </svg>\`});var DL,iu=y(()=>{DL=\`<?xml version="1.0" encoding="UTF-8"?>
942
942
  <svg width="288px" height="288px" viewBox="-16 -16 288 288" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
943
943
  <title>3x3x3 LL</title>
944
944
  <defs>
@@ -1045,7 +1045,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1045
1045
  <use id="CENTERS-l5-o2" xlink:href="#sticker" style="fill: yellow"/>
1046
1046
  <use id="CENTERS-l5-o3" xlink:href="#sticker" style="fill: yellow"/>
1047
1047
  </g>
1048
- </svg>\`});var Rs={};Bt(Rs,{cube3x3x3LLSVG:()=>LL,cube3x3x3SVG:()=>mL});var ds=y(()=>{$f();eu()});var hs,tu=y(()=>{Bs();Fr();Gt();Oo();hs={id:"3x3x3",fullName:"3\\xD73\\xD73 Cube",inventedBy:["Ern\\u0151 Rubik"],inventionYear:1974,kpuzzle:he(async()=>pi),svg:he(async()=>(await Promise.resolve().then(()=>(ds(),Rs))).cube3x3x3SVG),llSVG:he(async()=>(await Promise.resolve().then(()=>(ds(),Rs))).cube3x3x3LLSVG),pg:he(async()=>en("3x3x3")),appearance:e=>$t(hs,e),stickerings:Mn}});var ru,nu=y(()=>{qe();Gt();ru={id:"clock",fullName:"Clock",inventedBy:["Christopher C. Wiggs","Christopher J. Taylor"],inventionYear:1988,kpuzzle:he(async()=>new be((await Promise.resolve().then(()=>(Ar(),Dr))).clockJSON)),svg:he(async()=>(await Promise.resolve().then(()=>(Ar(),Dr))).clockSVG)}});async function ou(e,t){let r=await e.kpuzzle(),n=new No(r),o=new To(r),l=()=>o.and([o.move("U"),o.not(o.or(o.moves(["F","BL","BR"])))]),i=()=>o.and([o.move("U"),o.not(o.move("F"))]),s=()=>o.or([i(),o.and([o.move("F"),o.not(o.or(o.moves(["U","BL","BR"])))])]),a=()=>o.not(o.or([o.and([o.move("U"),o.move("F")]),o.and([o.move("F"),o.move("BL")]),o.and([o.move("F"),o.move("BR")]),o.and([o.move("BL"),o.move("BR")])])),f=()=>o.not(o.or([o.and([o.move("F"),o.move("BL")]),o.and([o.move("F"),o.move("BR")]),o.and([o.move("BL"),o.move("BR")])]));switch(t){case"full":break;case"experimental-fto-fc":n.set(o.not(l()),"Ignored");break;case"experimental-fto-f2t":n.set(o.not(i()),"Ignored"),n.set(l(),"Dim");break;case"experimental-fto-sc":n.set(o.not(s()),"Ignored"),n.set(i(),"Dim");break;case"experimental-fto-l2c":n.set(o.not(a()),"Ignored"),n.set(s(),"Dim");break;case"experimental-fto-lbt":n.set(o.not(f()),"Ignored"),n.set(a(),"Dim");break;case"experimental-fto-l3t":n.set(f(),"Dim");break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),"Dim")}return n.toAppearance()}async function lu(){return["full","experimental-fto-fc","experimental-fto-f2t","experimental-fto-sc","experimental-fto-l2c","experimental-fto-lbt","experimental-fto-l3t"]}var iu=y(()=>{ql()});var su,au=y(()=>{su=\`<?xml version="1.0" encoding="UTF-8"?>
1048
+ </svg>\`});var Ds={};Bt(Ds,{cube3x3x3LLSVG:()=>DL,cube3x3x3SVG:()=>FL});var As=y(()=>{lu();iu()});var ys,au=y(()=>{Fs();hr();Ot();Wo();ys={id:"3x3x3",fullName:"3\\xD73\\xD73 Cube",inventedBy:["Ern\\u0151 Rubik"],inventionYear:1974,kpuzzle:he(async()=>Bi),svg:he(async()=>(await Promise.resolve().then(()=>(As(),Ds))).cube3x3x3SVG),llSVG:he(async()=>(await Promise.resolve().then(()=>(As(),Ds))).cube3x3x3LLSVG),pg:he(async()=>en("3x3x3")),appearance:e=>$t(ys,e),stickerings:Mn}});var su,fu=y(()=>{He();Ot();su={id:"clock",fullName:"Clock",inventedBy:["Christopher C. Wiggs","Christopher J. Taylor"],inventionYear:1988,kpuzzle:he(async()=>new xe((await Promise.resolve().then(()=>(Dr(),Fr))).clockJSON)),svg:he(async()=>(await Promise.resolve().then(()=>(Dr(),Fr))).clockSVG)}});async function uu(e,t){let r=await e.kpuzzle(),n=new Oo(r),o=new Io(r),l=()=>o.and([o.move("U"),o.not(o.or(o.moves(["F","BL","BR"])))]),i=()=>o.and([o.move("U"),o.not(o.move("F"))]),a=()=>o.or([i(),o.and([o.move("F"),o.not(o.or(o.moves(["U","BL","BR"])))])]),s=()=>o.not(o.or([o.and([o.move("U"),o.move("F")]),o.and([o.move("F"),o.move("BL")]),o.and([o.move("F"),o.move("BR")]),o.and([o.move("BL"),o.move("BR")])])),f=()=>o.not(o.or([o.and([o.move("F"),o.move("BL")]),o.and([o.move("F"),o.move("BR")]),o.and([o.move("BL"),o.move("BR")])]));switch(t){case"full":break;case"experimental-fto-fc":n.set(o.not(l()),"Ignored");break;case"experimental-fto-f2t":n.set(o.not(i()),"Ignored"),n.set(l(),"Dim");break;case"experimental-fto-sc":n.set(o.not(a()),"Ignored"),n.set(i(),"Dim");break;case"experimental-fto-l2c":n.set(o.not(s()),"Ignored"),n.set(a(),"Dim");break;case"experimental-fto-lbt":n.set(o.not(f()),"Ignored"),n.set(s(),"Dim");break;case"experimental-fto-l3t":n.set(f(),"Dim");break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),"Dim")}return n.toAppearance()}async function gu(){return["full","experimental-fto-fc","experimental-fto-f2t","experimental-fto-sc","experimental-fto-l2c","experimental-fto-lbt","experimental-fto-l3t"]}var pu=y(()=>{Jl()});var cu,mu=y(()=>{cu=\`<?xml version="1.0" encoding="UTF-8"?>
1049
1049
  <svg width="2368px" height="1216px" viewBox="0 0 2368 1216" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1050
1050
  <title>fto</title>
1051
1051
  <g id="fto" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linejoin="round">
@@ -1139,7 +1139,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1139
1139
  </g>
1140
1140
  </g>
1141
1141
  </svg>
1142
- \`});var fu,uu=y(()=>{fu=\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
1142
+ \`});var Lu,Bu=y(()=>{Lu=\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
1143
1143
  <style type="text/css"><![CDATA[.sticker { stroke: #000000; stroke-width: 1px; }]]></style>
1144
1144
  <g><title>U</title>
1145
1145
  <polygon id="CORNERS-l0-o0" class="sticker" style="fill: #ffffff" points="247.941 89.861 283.500 115.696 269.918 157.499 212.382 138.805"/>
@@ -1214,7 +1214,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1214
1214
  <polygon id="CORNERS-l17-o0" class="sticker" style="fill: #999999" points="623.177 410.138 587.618 435.974 552.058 410.138 587.618 361.195"/>
1215
1215
  <polygon id="CORNERS-l14-o0" class="sticker" style="fill: #999999" points="645.154 342.500 658.736 384.303 623.177 410.138 587.618 361.195"/>
1216
1216
  </g></svg>
1217
- \`});var gu,pu=y(()=>{gu={name:"redi_cube",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{F:{EDGES:{permutation:[8,0,2,3,4,5,6,7,1,9,10,11],orientation:[0,1,0,0,0,0,0,0,1,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[1,0,0,0,0,0,0,0]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}}},experimentalDerivedMoves:{z:"[x: y]",UR:"[y: F]",U:"[y2: F]",UL:"[y': F]",D:"[x: F]",L:"[z2: F]",R:"[x2: F]",B:"[y2 x: F]"}}});var cu,mu=y(()=>{cu=\`<?xml version="1.0" encoding="UTF-8"?>
1217
+ \`});var Ru,du=y(()=>{Ru={name:"redi_cube",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{F:{EDGES:{permutation:[8,0,2,3,4,5,6,7,1,9,10,11],orientation:[0,1,0,0,0,0,0,0,1,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[1,0,0,0,0,0,0,0]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}}},experimentalDerivedMoves:{z:"[x: y]",UR:"[y: F]",U:"[y2: F]",UL:"[y': F]",D:"[x: F]",L:"[z2: F]",R:"[x2: F]",B:"[y2 x: F]"}}});var hu,Fu=y(()=>{hu=\`<?xml version="1.0" encoding="UTF-8"?>
1218
1218
  <svg width="546px" height="418px" viewBox="-20 -20 546 418" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1219
1219
  <title>redi-cube</title>
1220
1220
  <g istroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -1366,8 +1366,8 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1366
1366
  </g>
1367
1367
  </g>
1368
1368
  </svg>
1369
- \`});var Ho={};Bt(Ho,{ftoSVG:()=>su,kilominxSVG:()=>fu,rediCubeJSON:()=>gu,rediCubeSVG:()=>cu});var Zo=y(()=>{au();uu();pu();mu()});var Lu,Bu,Ru=y(()=>{Fr();Gt();iu();Lu=class extends ht{constructor(){super({pgID:"FTO",id:"fto",fullName:"Face-Turning Octahedron",inventedBy:["Karl Rohrbach","David Pitcher"],inventionYear:1983});this.stickerings=lu;this.svg=he(async()=>(await Promise.resolve().then(()=>(Zo(),Ho))).ftoSVG)}appearance(t){return ou(this,t)}},Bu=new Lu});async function du(e,t){switch(t){case"full":case"F2L":case"LL":case"OLL":case"PLL":case"ELS":case"CLS":return $t(e,t);default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`)}return $t(e,"full")}async function hu(){return["full","F2L","LL","OLL","PLL","ELS","CLS"]}var Fu=y(()=>{Oo()});var Du,Au,yu=y(()=>{Fr();Fu();Du=class extends ht{constructor(){super({id:"megaminx",fullName:"Megaminx",inventionYear:1981});this.stickerings=hu}appearance(t){return du(this,t)}},Au=new Du});var Uu,xu,bu=y(()=>{Fr();Gt();Uu=class extends ht{constructor(){super({id:"pyraminx",fullName:"Pyraminx",inventedBy:["Uwe Meffert"]});this.svg=he(async()=>(await Promise.resolve().then(()=>(Ar(),Dr))).pyraminxSVG)}},xu=new Uu});var Su,wu=y(()=>{qe();Gt();Su={id:"square1",fullName:"Square-1",inventedBy:["Karel Hr\\u0161el","Vojtech Kopsk\\xFD"],inventionYear:1990,kpuzzle:he(async()=>new be((await Promise.resolve().then(()=>(Ar(),Dr))).sq1HyperOrbitJSON)),svg:he(async()=>(await Promise.resolve().then(()=>(Ar(),Dr))).sq1HyperOrbitSVG)}});var vu,Eu=y(()=>{qe();Fr();Gt();vu={id:"kilominx",fullName:"Kilominx",kpuzzle:he(async()=>{let e=await en("megaminx + chopasaurus"),t=JSON.parse(JSON.stringify(e.getKPuzzleDefinition(!0)));delete t.orbits.CENTERS,delete t.orbits.CENTERS2,delete t.startStateData.CENTERS,delete t.startStateData.CENTERS2;for(let i of Object.values(t.moves))delete i.CENTERS,delete i.CENTERS2;t.name="kilominx",delete t.experimentalPuzzleDescription;let r=await Promise.resolve().then(()=>(In(),ai)),n=new r.ExperimentalPGNotation(e,e.getOrbitsDef(!0)),o=new be(t,{experimentalPGNotation:{lookupMove:i=>i.toString()==="x2"||i.toString()==="x2'"?l.transformationData:n.lookupMove(i)}}),l=o.algToTransformation("Rv2 Fv Uv'");return t.moves.x2=l,o}),svg:he(async()=>(await Promise.resolve().then(()=>(Zo(),Ho))).kilominxSVG)}});var _u,ku=y(()=>{qe();Gt();_u={id:"redi_cube",fullName:"Redi Cube",inventedBy:["Oskar van Deventer"],inventionYear:2009,kpuzzle:he(async()=>new be((await Promise.resolve().then(()=>(Zo(),Ho))).rediCubeJSON)),svg:async()=>(await Promise.resolve().then(()=>(Zo(),Ho))).rediCubeSVG}});var Ce,tr=y(()=>{X2();Fr();Vf();tu();nu();Ru();yu();bu();wu();Eu();ku();Ce={"3x3x3":hs,"2x2x2":Vo,"4x4x4":new tn({id:"4x4x4",fullName:"4\\xD74\\xD74 Cube"}),"5x5x5":new tn({id:"5x5x5",fullName:"5\\xD75\\xD75 Cube"}),"6x6x6":new tn({id:"6x6x6",fullName:"6\\xD76\\xD76 Cube"}),"7x7x7":new tn({id:"7x7x7",fullName:"7\\xD77\\xD77 Cube"}),"40x40x40":new tn({id:"40x40x40",fullName:"40\\xD740\\xD740 Cube"}),clock:ru,megaminx:Au,pyraminx:xu,skewb:new ht({id:"skewb",fullName:"Skewb",inventedBy:["Tony Durham"]}),square1:Su,fto:Bu,gigaminx:new ht({id:"gigaminx",fullName:"Gigaminx",inventedBy:["Tyler Fox"],inventionYear:2006}),master_tetraminx:new ht({pgID:"master tetraminx",id:"master_tetraminx",fullName:"Master Tetraminx",inventedBy:["Katsuhiko Okamoto"],inventionYear:2002}),kilominx:vu,redi_cube:_u}});function Cu(e){zu=e}function we(){if(!zu)throw new Error("Must be called from inside a worker, to avoid impact on page performance. Try importing from the top level of \`cubing/solve\`?")}var zu,Ft=y(()=>{zu=!1});async function Pu(){if(globalThis?.crypto?.getRandomValues)return crypto.getRandomValues.bind(crypto);{let e=(await(BL??(BL=import(dL())))).webcrypto;return e.getRandomValues.bind(e)}}var BL,RL,dL,Mu=y(()=>{BL=null,RL="cr-yp-to",dL=()=>RL.replace(/-/g,"")});function DL(e){let t=new Uint32Array(2);e(t);let r=t[0],n=t[1];return Math.floor(r*hL)+Math.floor(n/FL)}function AL(e){if(typeof e!="number"||e<0||Math.floor(e)!==e)throw new Error("randomInt.below() not called with a positive integer value.");if(e>Nu)throw new Error(\`Called randomInt.below() with max == \${e}, which is larger than JavaScript can handle with integer precision.\`)}async function ve(){let e=await Pu(),t=r=>{AL(r);let n=DL(e),o=Math.floor(Nu/r)*r;return n<o?n%r:t(r)};return t}var Nu,hL,FL,ci=y(()=>{Mu();Nu=9007199254740992,hL=2097152,FL=2048});async function rr(){let e=await ve();return t=>t[e(t.length)]}var Tu=y(()=>{ci()});async function Ou(e){for(let t=1;t<e.length;t++){let r=(await yL)(t);[e[t],e[r]]=[e[r],e[t]]}}var yL,Dt=y(()=>{Tu();ci();ci();yL=ve()});function Ne(e){return new Wn(t=>{t(e())})}var Wn,Kt=y(()=>{Wn=class extends Promise{constructor(t){super(r=>{r()});this._executor=t}static from(t){return new Wn(r=>{r(t())})}static resolve(t){return new Wn(r=>{r(t)})}static reject(t){return new Wn((r,n)=>{n(t)})}then(t,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(t,r)}catch(t){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(t)}}});function Qt(e,t){let r=[],n=[];for(let u of t.split(\`
1370
- \`)){let g=u.split(" ");if(!u.startsWith("SetOrder ")){if(u.startsWith("Alg ")){let p=E.fromString(u.substring(4));n.push({alg:p,transformation:e.algToTransformation(p)})}else if(u.startsWith("SubgroupSizes "))for(let p=1;p<g.length;p++)r.push(parseInt(g[p]))}}let o={ordering:new Array(r.length)},l=[],i=0;l.push(0);let s=E.fromString(""),a=e.identityTransformation();for(let u=0;u<r.length;u++)i+=r[u],l.push(i),n.splice(i-1,0,{alg:s,transformation:a});if(n.length!==i)throw Error(\`Bad sgs; expected \${i-r.length} algs but saw \${n.length-r.length}\`);let f={};for(let u in e.definition.orbits){let g=e.definition.orbits[u];f[u]=new Array(g.numPieces).fill(!1)}for(let u=r.length-1;u>=0;u--){let g=[];for(let c=l[u];c<l[u+1];c++){let L=n[c].transformation;for(let m in e.definition.orbits){let R=e.definition.orbits[m];for(let F=0;F<R.numPieces;F++)(L.transformationData[m].permutation[F]!==F||L.transformationData[m].orientation[F]!==0)&&(f[m][F]||(g.push({orbitName:m,permutationIdx:F}),f[m][F]=!0))}}let p={};for(let c=l[u];c<l[u+1];c++){let L=n[c].transformation.invert(),m="";for(let R=0;R<g.length;R++){let F=g[R];m=\`\${m} \${L.transformationData[F.orbitName].permutation[F.permutationIdx]} \${L.transformationData[F.orbitName].orientation[F.permutationIdx]}\`}p[m]=n[c],n[c].alg=n[c].alg.invert(),n[c].transformation=n[c].transformation.invert()}o.ordering[u]={pieceOrdering:g,lookup:p}}return o}var Kn=y(()=>{Be()});async function Qu(){return PL??(PL=ML())}async function ML(){return Qt(await Vo.kpuzzle(),\`SubgroupSizes 24 21 18 15 12 9 6
1369
+ \`});var Yo={};Bt(Yo,{ftoSVG:()=>cu,kilominxSVG:()=>Lu,rediCubeJSON:()=>Ru,rediCubeSVG:()=>hu});var Xo=y(()=>{mu();Bu();du();Fu()});var Du,Au,yu=y(()=>{hr();Ot();pu();Du=class extends ht{constructor(){super({pgID:"FTO",id:"fto",fullName:"Face-Turning Octahedron",inventedBy:["Karl Rohrbach","David Pitcher"],inventionYear:1983});this.stickerings=gu;this.svg=he(async()=>(await Promise.resolve().then(()=>(Xo(),Yo))).ftoSVG)}appearance(t){return uu(this,t)}},Au=new Du});async function Uu(e,t){switch(t){case"full":case"F2L":case"LL":case"OLL":case"PLL":case"ELS":case"CLS":return $t(e,t);default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`)}return $t(e,"full")}async function bu(){return["full","F2L","LL","OLL","PLL","ELS","CLS"]}var xu=y(()=>{Wo()});var Su,wu,vu=y(()=>{hr();xu();Su=class extends ht{constructor(){super({id:"megaminx",fullName:"Megaminx",inventionYear:1981});this.stickerings=bu}appearance(t){return Uu(this,t)}},wu=new Su});var Eu,_u,ku=y(()=>{hr();Ot();Eu=class extends ht{constructor(){super({id:"pyraminx",fullName:"Pyraminx",inventedBy:["Uwe Meffert"]});this.svg=he(async()=>(await Promise.resolve().then(()=>(Dr(),Fr))).pyraminxSVG)}},_u=new Eu});var zu,Cu=y(()=>{He();Ot();zu={id:"square1",fullName:"Square-1",inventedBy:["Karel Hr\\u0161el","Vojtech Kopsk\\xFD"],inventionYear:1990,kpuzzle:he(async()=>new xe((await Promise.resolve().then(()=>(Dr(),Fr))).sq1HyperOrbitJSON)),svg:he(async()=>(await Promise.resolve().then(()=>(Dr(),Fr))).sq1HyperOrbitSVG)}});var Pu,Mu=y(()=>{He();hr();Ot();Pu={id:"kilominx",fullName:"Kilominx",kpuzzle:he(async()=>{let e=await en("megaminx + chopasaurus"),t=JSON.parse(JSON.stringify(e.getKPuzzleDefinition(!0)));delete t.orbits.CENTERS,delete t.orbits.CENTERS2,delete t.startStateData.CENTERS,delete t.startStateData.CENTERS2;for(let i of Object.values(t.moves))delete i.CENTERS,delete i.CENTERS2;t.name="kilominx",delete t.experimentalPuzzleDescription;let r=await Promise.resolve().then(()=>(In(),pi)),n=new r.ExperimentalPGNotation(e,e.getOrbitsDef(!0)),o=new xe(t,{experimentalPGNotation:{lookupMove:i=>i.toString()==="x2"||i.toString()==="x2'"?l.transformationData:n.lookupMove(i)}}),l=o.algToTransformation("Rv2 Fv Uv'");return t.moves.x2=l,o}),svg:he(async()=>(await Promise.resolve().then(()=>(Xo(),Yo))).kilominxSVG)}});var Nu,Tu=y(()=>{He();Ot();Nu={id:"redi_cube",fullName:"Redi Cube",inventedBy:["Oskar van Deventer"],inventionYear:2009,kpuzzle:he(async()=>new xe((await Promise.resolve().then(()=>(Xo(),Yo))).rediCubeJSON)),svg:async()=>(await Promise.resolve().then(()=>(Xo(),Yo))).rediCubeSVG}});var Pe,tr=y(()=>{of();hr();$f();au();fu();yu();vu();ku();Cu();Mu();Tu();Pe={"3x3x3":ys,"2x2x2":Jo,"4x4x4":new tn({id:"4x4x4",fullName:"4\\xD74\\xD74 Cube"}),"5x5x5":new tn({id:"5x5x5",fullName:"5\\xD75\\xD75 Cube"}),"6x6x6":new tn({id:"6x6x6",fullName:"6\\xD76\\xD76 Cube"}),"7x7x7":new tn({id:"7x7x7",fullName:"7\\xD77\\xD77 Cube"}),"40x40x40":new tn({id:"40x40x40",fullName:"40\\xD740\\xD740 Cube"}),clock:su,megaminx:wu,pyraminx:_u,skewb:new ht({id:"skewb",fullName:"Skewb",inventedBy:["Tony Durham"]}),square1:zu,fto:Au,gigaminx:new ht({id:"gigaminx",fullName:"Gigaminx",inventedBy:["Tyler Fox"],inventionYear:2006}),master_tetraminx:new ht({pgID:"master tetraminx",id:"master_tetraminx",fullName:"Master Tetraminx",inventedBy:["Katsuhiko Okamoto"],inventionYear:2002}),kilominx:Pu,redi_cube:Nu}});function Ou(e){Gu=e}function we(){if(!Gu)throw new Error("Must be called from inside a worker, to avoid impact on page performance. Try importing from the top level of \`cubing/solve\`?")}var Gu,Ft=y(()=>{Gu=!1});async function Iu(){if(globalThis?.crypto?.getRandomValues)return crypto.getRandomValues.bind(crypto);{let e=(await(AL??(AL=import(UL())))).webcrypto;return e.getRandomValues.bind(e)}}var AL,yL,UL,Wu=y(()=>{AL=null,yL="cr-yp-to",UL=()=>yL.replace(/-/g,"")});function SL(e){let t=new Uint32Array(2);e(t);let r=t[0],n=t[1];return Math.floor(r*bL)+Math.floor(n/xL)}function wL(e){if(typeof e!="number"||e<0||Math.floor(e)!==e)throw new Error("randomInt.below() not called with a positive integer value.");if(e>Ku)throw new Error(\`Called randomInt.below() with max == \${e}, which is larger than JavaScript can handle with integer precision.\`)}async function ve(){let e=await Iu(),t=r=>{wL(r);let n=SL(e),o=Math.floor(Ku/r)*r;return n<o?n%r:t(r)};return t}var Ku,bL,xL,Ri=y(()=>{Wu();Ku=9007199254740992,bL=2097152,xL=2048});async function rr(){let e=await ve();return t=>t[e(t.length)]}var Qu=y(()=>{Ri()});async function ju(e){for(let t=1;t<e.length;t++){let r=(await vL)(t);[e[t],e[r]]=[e[r],e[t]]}}var vL,Dt=y(()=>{Qu();Ri();Ri();vL=ve()});function Te(e){return new Wn(t=>{t(e())})}var Wn,Kt=y(()=>{Wn=class extends Promise{constructor(t){super(r=>{r()});this._executor=t}static from(t){return new Wn(r=>{r(t())})}static resolve(t){return new Wn(r=>{r(t)})}static reject(t){return new Wn((r,n)=>{n(t)})}then(t,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(t,r)}catch(t){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(t)}}});function Qt(e,t){let r=[],n=[];for(let u of t.split(\`
1370
+ \`)){let g=u.split(" ");if(!u.startsWith("SetOrder ")){if(u.startsWith("Alg ")){let p=E.fromString(u.substring(4));n.push({alg:p,transformation:e.algToTransformation(p)})}else if(u.startsWith("SubgroupSizes "))for(let p=1;p<g.length;p++)r.push(parseInt(g[p]))}}let o={ordering:new Array(r.length)},l=[],i=0;l.push(0);let a=E.fromString(""),s=e.identityTransformation();for(let u=0;u<r.length;u++)i+=r[u],l.push(i),n.splice(i-1,0,{alg:a,transformation:s});if(n.length!==i)throw Error(\`Bad sgs; expected \${i-r.length} algs but saw \${n.length-r.length}\`);let f={};for(let u in e.definition.orbits){let g=e.definition.orbits[u];f[u]=new Array(g.numPieces).fill(!1)}for(let u=r.length-1;u>=0;u--){let g=[];for(let c=l[u];c<l[u+1];c++){let L=n[c].transformation;for(let m in e.definition.orbits){let R=e.definition.orbits[m];for(let F=0;F<R.numPieces;F++)(L.transformationData[m].permutation[F]!==F||L.transformationData[m].orientation[F]!==0)&&(f[m][F]||(g.push({orbitName:m,permutationIdx:F}),f[m][F]=!0))}}let p={};for(let c=l[u];c<l[u+1];c++){let L=n[c].transformation.invert(),m="";for(let R=0;R<g.length;R++){let F=g[R];m=\`\${m} \${L.transformationData[F.orbitName].permutation[F.permutationIdx]} \${L.transformationData[F.orbitName].orientation[F.permutationIdx]}\`}p[m]=n[c],n[c].alg=n[c].alg.invert(),n[c].transformation=n[c].transformation.invert()}o.ordering[u]={pieceOrdering:g,lookup:p}}return o}var Kn=y(()=>{Be()});async function Ju(){return IL??(IL=WL())}async function WL(){return Qt(await Jo.kpuzzle(),\`SubgroupSizes 24 21 18 15 12 9 6
1371
1371
 
1372
1372
  Alg F
1373
1373
  Alg F2
@@ -1466,7 +1466,7 @@ Alg F D' F L' D F R2 U2 F' U'
1466
1466
  Alg F D' L D' L F D2 L2 B' R'
1467
1467
  Alg F L' D F R2 D2 L D F' U2
1468
1468
  Alg F L' D F2 D' L F L2 F2 U
1469
- Alg F D F' D L2 F R' F' D' B2 U'\`)}var PL,ju=y(()=>{tr();Kn();PL=null});async function NL(){let e=Gn("megaminx",{allMoves:!0,addRotations:!0}),t=new be(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new $r(e,e.getOrbitsDef(!0))});return t.definition.name="megaminx",t}async function As(){return TL??(TL=NL())}async function qu(){return OL??(OL=GL())}async function GL(){return Qt(await As(),\`SubgroupSizes 12 5 60 58 60 56 54 57 52 50 54 48 46 51 44 42 48 40 45 38 36 42 34 32 39 30 36 28 26 33 24 30 22 20 27 18 24 16 14 21 12 18 10 15 8 6 2 12 9 3
1469
+ Alg F D F' D L2 F R' F' D' B2 U'\`)}var IL,Yu=y(()=>{tr();Kn();IL=null});async function KL(){let e=On("megaminx",{allMoves:!0,addRotations:!0}),t=new xe(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new $r(e,e.getOrbitsDef(!0))});return t.definition.name="megaminx",t}async function xs(){return QL??(QL=KL())}async function Xu(){return jL??(jL=qL())}async function qL(){return Qt(await xs(),\`SubgroupSizes 12 5 60 58 60 56 54 57 52 50 54 48 46 51 44 42 48 40 45 38 36 42 34 32 39 30 36 28 26 33 24 30 22 20 27 18 24 16 14 21 12 18 10 15 8 6 2 12 9 3
1470
1470
 
1471
1471
  Alg Rv
1472
1472
  Alg Rv2
@@ -2986,7 +2986,7 @@ Alg L' BL2 L2' F' L2 BL2' L2' F L2'
2986
2986
  Alg U BL2' U R U' BL2 U' L U2 R' U2' L'
2987
2987
  Alg U BR U' L2 F L' U BR' U' L F' L2'
2988
2988
  Alg U L' BL2 L' FL' L BL2' L U' L2' FL L2
2989
- Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var TL,OL,Vu=y(()=>{qe();In();Kn();TL=null;OL=null});async function ys(){return IL??(IL=WL())}async function Hu(){return{ordering:(await ys()).ordering.slice(2)}}async function WL(){return Qt(await Ce.pyraminx.kpuzzle(),\`SubgroupSizes 12 9 12 3 10 3 8 6 2 3 3 3 3
2989
+ Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var QL,jL,$u=y(()=>{He();In();Kn();QL=null;jL=null});async function Ss(){return VL??(VL=HL())}async function e1(){return{ordering:(await Ss()).ordering.slice(2)}}async function HL(){return Qt(await Pe.pyraminx.kpuzzle(),\`SubgroupSizes 12 9 12 3 10 3 8 6 2 3 3 3 3
2990
2990
 
2991
2991
  Alg B
2992
2992
  Alg B'
@@ -3063,7 +3063,7 @@ Alg r
3063
3063
  Alg r'
3064
3064
 
3065
3065
  Alg u
3066
- Alg u'\`)}var IL,Zu=y(()=>{tr();Kn();IL=null});async function KL(){let e=Gn("skewb",{allMoves:!0,addRotations:!0});return new be(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new $r(e,e.getOrbitsDef(!0))})}async function Us(){return QL??(QL=KL())}async function xs(){return jL??(jL=qL())}async function Ju(){return{ordering:(await xs()).ordering.slice(1)}}async function qL(){return Qt(await Us(),\`SubgroupSizes 24 6 5 12 9 3 4 9 3 3
3066
+ Alg u'\`)}var VL,t1=y(()=>{tr();Kn();VL=null});async function ZL(){let e=On("skewb",{allMoves:!0,addRotations:!0});return new xe(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new $r(e,e.getOrbitsDef(!0))})}async function ws(){return JL??(JL=ZL())}async function vs(){return YL??(YL=XL())}async function r1(){return{ordering:(await vs()).ordering.slice(1)}}async function XL(){return Qt(await ws(),\`SubgroupSizes 24 6 5 12 9 3 4 9 3 3
3067
3067
 
3068
3068
  Alg y
3069
3069
  Alg y2
@@ -3141,7 +3141,7 @@ Alg U L U' B' U L' U' B
3141
3141
  Alg U' B L U L B' U' L'
3142
3142
 
3143
3143
  Alg U R' U' L B R' B' R
3144
- Alg R' U' R U B' U' B L\`)}var QL,jL,Yu=y(()=>{qe();In();Kn();QL=null;jL=null});var Xu={};Bt(Xu,{cachedData222:()=>Qu,cachedMegaminxKPuzzleWithoutMO:()=>As,cachedSGSDataMegaminx:()=>qu,sgsDataPyraminx:()=>ys,sgsDataPyraminxFixedOrientation:()=>Hu,sgsDataSkewb:()=>xs,sgsDataSkewbFixedCorner:()=>Ju,skewbKPuzzleWithoutMOCached:()=>Us});var $u=y(()=>{ju();Vu();Zu();Yu()});async function Qn(e,t){let r=new Rt;r.experimentalPushAlg(e);for(let n of t){let o=(await rr())(n);o!==null&&r.push(B.fromString(o))}return r.toAlg()}var Bi=y(()=>{Be();Dt()});function c1(){}function YL(e){function t(){}return t.prototype=e||{},new t}function XL(e){return e instanceof Array?e[0]:null}function nl(e,t,r){var n=_i,o=$L,l=XL,i=n[e],s=l(i);i&&!s?H=i:(H=n[e]=t?o(t):{},H.castableTypeMap$=r,H.constructor=H,!t&&(H.typeMarker$=c1));for(var a=3;a<arguments.length;++a)arguments[a].prototype=H;s&&(H.___clazz$=s)}function $L(e){var t=_i;return YL(t[e])}function eB(){}function Di(e){return e<<24>>24}function Os(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function Gs(e,t){var r;return r=new Os,r.packageName=e,r.compoundName=t,r}function _r(e,t,r){var n;return n=Gs(e,t),nB(r,n),n}function tB(e,t){var r;return r=Gs(e,t),r.modifiers=2,r}function ki(e,t){var r;return r=Gs("",e),r.typeId=t,r.modifiers=1,r}function m1(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function rB(e){if(e.isPrimitive())return null;var t=e.typeId,r=_i[t];return r}function nB(e,t){if(!!e){t.typeId=e;var r=rB(t);if(!r){_i[e]=[t];return}r.___clazz$=t}}function ee(e,t){return m1(e,t)}function Y(e,t,r,n,o,l){var i;return i=B1(o,n),te(ee(e,l),t,r,o,i),i}function tt(e,t,r,n,o,l){return L1(e,t,r,n,o,0,l)}function L1(e,t,r,n,o,l,i){var s,a,f,u,g;if(u=o[l],f=l==i-1,s=f?n:0,g=B1(s,u),te(ee(e,i-l),t[l],r[l],s,g),!f)for(++l,a=0;a<u;++a)g[a]=L1(e,t,r,n,o,l,i);return g}function te(e,t,r,n,o){return o.___clazz$=e,o.castableTypeMap$=t,o.typeMarker$=c1,o.__elementTypeId$=r,o.__elementTypeCategory$=n,o}function B1(e,t){var r=new Array(t),n;switch(e){case 6:n={l:0,m:0,h:0};break;case 7:n=0;break;case 8:n=!1;break;default:return r}for(var o=0;o<t;++o)r[o]=n;return r}function o1(e){var t,r,n;return t=e&rt,r=e>>22&rt,n=e<0?br:0,oB(t,r,n)}function oB(e,t,r){return{l:e,m:t,h:r}}function lB(e,t){var r,n,o;return r=e.l+t.l,n=e.m+t.m+(r>>22),o=e.h+t.h+(n>>22),{l:r&rt,m:n&rt,h:o&br}}function jt(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function Is(e){var t,r;return e>-129&&e<128?(t=e+128,Ri==null&&(Ri=Y(NB,fe,293,256,0,1)),r=Ri[t],!r&&(r=Ri[t]=o1(e)),r):o1(e)}function R1(e,t){var r,n;return r=e.h>>19,n=t.h>>19,r==0?n!=0||e.h>t.h||e.h==t.h&&e.m>t.m||e.h==t.h&&e.m==t.m&&e.l>=t.l:!(n==0||e.h<t.h||e.h==t.h&&e.m<t.m||e.h==t.h&&e.m==t.m&&e.l<t.l)}function Ss(e,t){return e.l!=t.l||e.m!=t.m||e.h!=t.h}function Es(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function Ai(e,t){var r,n,o;return t&=63,t<22?(r=e.l<<t,n=e.m<<t|e.l>>22-t,o=e.h<<t|e.m>>22-t):t<44?(r=0,n=e.l<<t-22,o=e.m<<t-22|e.l>>44-t):(r=0,n=0,o=e.l<<t-44),{l:r&rt,m:n&rt,h:o&br}}function nn(e,t){var r,n,o,l,i;return t&=63,r=e.h,n=(r&JL)!=0,n&&(r|=-1048576),t<22?(i=r>>t,l=e.m>>t|r<<22-t,o=e.l>>t|e.m<<22-t):t<44?(i=n?br:0,l=r>>t-22,o=e.m>>t-22|r<<44-t):(i=n?br:0,l=n?rt:0,o=r>>t-44),{l:o&rt,m:l&rt,h:i&br}}function d1(e,t){var r,n,o;return r=e.l-t.l,n=e.m-t.m+(r>>22),o=e.h-t.h+(n>>22),{l:r&rt,m:n&rt,h:o&br}}function on(e){return e.l|e.m<<22}function iB(e){this.string=e}function Sr(e,t){return e>t?e:t}function Ws(e,t){return e<t?e:t}function sB(e,t){return e.indexOf(t)}function aB(e){return fB(e,0,e.length)}function fB(e,t,r){for(var n="",o=t;o<r;){var l=Math.min(o+1e4,r);n+=String.fromCharCode.apply(null,e.slice(o,l)),o=l}return n}function uB(e){return String.fromCharCode(e&He)}function l1(e){return e.string+=" ",e}function i1(e,t){return e.string+=t,e}function pB(){iB.call(this,"")}function yi(e,t){var r;if(e===t)return!0;if(e.length!=t.length)return!1;for(r=0;r<e.length;++r)if(e[r]!=t[r])return!1;return!0}function ln(){s1||(s1=!0,Ur=tt(ye,[fe,Ae],[11,0],7,[495,18],2),Yn=tt(ye,[fe,Ae],[11,0],7,[324,18],2),to=tt(ye,[fe,Ae],[11,0],7,[336,18],2),wr=tt(ye,[fe,Ae],[11,0],7,[495,8],2),Pi=Y(Oe,Te,0,20048,7,1),Ci=Y(Oe,Te,0,20791,7,1),Jn=Y(Oe,Te,0,82945,7,1),qn=tt(ye,[fe,Ae],[11,0],7,[2768,10],2),Hn=tt(ye,[fe,Ae],[11,0],7,[2768,10],2),Zn=tt(ye,[fe,Ae],[11,0],7,[24,10],2),ol=tt(ye,[fe,Ae],[11,0],7,[24,16],2),sn=tt(ye,[fe,Ae],[11,0],7,[140,16],2),zi=Y(Oe,Te,0,8305,7,1),Vn=Y(Oe,Te,0,48441,7,1))}function cB(e,t,r){return e.slice_0=Ur[t.slice_0][r],e.flip=to[t.flip][(X(),fn)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=Yn[t.twist][fn[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=Sr(Sr(ft(Pi,e.twist*495+wr[e.slice_0][e.tsym]),ft(Ci,e.flip*495+wr[e.slice_0][e.fsym])),ft(Jn,e.twist<<11|Er[e.flip<<3|e.fsym^e.tsym])),e.prun}function mB(e,t,r){return r=(X(),el)[3][r],e.flipc=to[t.flipc>>3][fn[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=Yn[t.twistc>>3][fn[r<<3|t.twistc&7]]^t.twistc&7,ft(Jn,e.twistc>>3<<11|Er[e.flipc^e.twistc&7])}function h1(e,t,r){var n;return e.twist=(X(),rl)[xi(t)],e.flip=an[Ui(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=ft(Jn,e.twist<<11|Er[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-$n(t.ea,8,!0),e.prun=Sr(e.prun,Sr(ft(Pi,e.twist*495+wr[e.slice_0][e.tsym]),ft(Ci,e.flip*495+wr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new pe,ll(t,1,n),il(t,1,n),e.twistc=rl[xi(n)],e.flipc=an[Ui(n)],e.prun=Sr(e.prun,ft(Jn,e.twistc>>3<<11|Er[e.flipc^e.twistc&7])),e.prun<=r)}function Xo(){ln()}function ft(e,t){return ln(),e[t>>3]>>(t<<2)&15}function F1(e){ln(),!(di==2||di==1&&!e)&&(di==0&&(SB(),LB(),RB(),hB(),BB(),X(),ks(2048,Vs,an,f1=Y(ye,Ae,0,336,7,1),0),ks(2187,Zs,rl,ws=Y(ye,Ae,0,324,7,1),1),dB(),FB(),DB()),Yo(zi,Zn,ol,qn,(X(),zs),584244,e),Yo(Vn,_s,sn,Hn,zs,514084,e),Yo(Pi,Ur,wr,Yn,ws,431619,e),Yo(Ci,Ur,wr,to,f1,431619,e),Yo(Jn,null,null,Yn,ws,103939,e),di=e?2:1)}function LB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<2768;r++)for(UB(e,(X(),jn)[r]),n=0;n<10;n++)vr(e,ge[(Je(),zt)[n]],t),qn[r][n]=Si(sr[gt(t.ca,8,!1)])&He}function BB(){var e,t,r,n,o;for(e=new pe,t=new pe,_s=tt(ye,[fe,Ae],[11,0],7,[140,10],2),r=0;r<140;r++){for(z1(e.ca,r%70,0,!1),o=0;o<10;o++)vr(e,(X(),ge)[(Je(),zt)[o]],t),_s[r][o]=$n(t.ca,0,!1)+70*(165>>o&1^~~(r/70))&He;for(n=0;n<16;n++)ll(e,(X(),ut)[0][n],t),sn[r][n]=$n(t.ca,0,!1)+70*~~(r/70)&He}}function RB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<2768;r++)for(y1(e,(X(),jn)[r]),n=0;n<10;n++)At(e,ge[(Je(),zt)[n]],t),Hn[r][n]=sr[gt(t.ea,8,!0)]}function dB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<336;r++)for(js(e,(X(),Vs)[r]),n=0;n<18;n++)At(e,ge[n],t),to[r][n]=an[Ui(t)]}function hB(){var e,t,r,n,o;for(e=new pe,t=new pe,r=0;r<24;r++){for(un(e.ea,r,12,!0),o=0;o<10;o++)At(e,(X(),ge)[(Je(),zt)[o]],t),Zn[r][o]=gt(t.ea,12,!0)%24&He;for(n=0;n<16;n++)il(e,(X(),ut)[0][n],t),ol[r][n]=gt(t.ea,12,!0)%24&He}}function Yo(e,t,r,n,o,l,i){var s,a,f,u,g,p,c,L,m,R,F,A,U,b,S,M,J,C,Q,x,k,P,w,v,N,j,q,ie,de,xe,Ze,xt,Le,Lt,ot,pt;if(U=l&15,F=(l>>4&1)==1?Ts:0,f=(l>>5&1)==1,s=l>>8&15,u=l>>12&15,g=l>>16&15,R=i?u:g,A=(1<<U)-1,a=t==null,L=a?2048:t.length,m=L*n.length,c=f?10:18,p=c==10?66:599186,S=(e[m>>3]>>(m<<2)&15)-1,S==-1){for(C=0;C<~~(m/8)+1;C++)e[C]=Jo;e[0]^=1,S=0}for(;S<R;){for(N=(S+1)*Jo^-1,Q=0;Q<e.length;Q++)ot=e[Q]^N,ot&=ot>>1,e[Q]+=ot&ot>>2&Jo;for(P=S>s,xe=P?S+2:S,de=xe*Jo,b=P?S:S+2,++S,pt=S^S+1,Lt=0,C=0;C<m;++C,Lt>>=4){if((C&7)==0&&(Lt=e[C>>3],((Lt^de)-Jo&~(Lt^de)&-2004318072)==0)){C+=7;continue}if((Lt&15)==xe)for(q=C%L,Ze=~~(C/L),M=0,J=0,a&&(M=(X(),an)[q],J=M&7,M>>=3),v=0;v<c;v++){if(Le=n[Ze][v],a?ie=(X(),Er)[to[M][fn[v<<3|J]]^J^Le&A]:ie=r[t[q][v]][Le&A],Le>>=U,x=Le*L+ie,j=e[x>>3]>>(x<<2)&15,j!=b){j<S-1&&(v+=p>>v&3);continue}if(P){e[C>>3]^=pt<<(C<<2);break}for(e[x>>3]^=pt<<(x<<2),w=1,xt=o[Le];(xt>>=1)!=0;w++)(xt&1)==1&&(k=Le*L,a?k+=(X(),Er)[an[ie]^w]:k+=r[ie][w^F>>(w<<1)&3],(e[k>>3]>>(k<<2)&15)==b&&(e[k>>3]^=pt<<(k<<2)))}}}}function FB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<324;r++)for(qs(e,(X(),Zs)[r]),n=0;n<18;n++)vr(e,ge[n],t),Yn[r][n]=rl[xi(t)]}function DB(){var e,t,r,n,o,l,i,s;for(e=new pe,t=new pe,n=0;n<495;n++){for(z1(e.ea,494-n,8,!0),l=0;l<18;l+=3)At(e,(X(),ge)[l],t),Ur[n][l]=494-$n(t.ea,8,!0)&He;for(o=0;o<16;o+=2)il(e,(X(),ut)[0][o],t),wr[n][o>>1]=494-$n(t.ea,8,!0)&He}for(r=0;r<495;r++)for(o=0;o<18;o+=3)for(s=Ur[r][o],i=1;i<3;i++)s=Ur[s][o],Ur[r][o+i]=s&He}function X(){a1||(a1=!0,lr=Y(tl,fe,7,16,0,1),ge=Y(tl,fe,7,18,0,1),Mi=Y(TB,fe,0,18,6,1),b1=Y(Oe,Te,0,48,7,1),ir=tt(Oe,[fe,Te],[17,0],7,[16,16],2),ut=tt(Oe,[fe,Te],[17,0],7,[16,16],2),el=tt(Oe,[fe,Te],[17,0],7,[16,18],2),fn=Y(Oe,Te,0,144,7,1),xr=tt(Oe,[fe,Te],[17,0],7,[16,18],2),Vs=Y(ye,Ae,0,336,7,1),Zs=Y(ye,Ae,0,324,7,1),jn=Y(ye,Ae,0,2768,7,1),Xn=Y(re,ae,0,2768,7,1),Hs=Y(ye,Ae,0,2768,7,1),wi=Y(re,ae,0,24,7,1),an=Y(ye,Ae,0,2048,7,1),rl=Y(ye,Ae,0,2187,7,1),sr=Y(ye,Ae,0,40320,7,1),Er=Y(ye,Ae,0,2688,7,1),Cs=new kt(2531,1373,67026819,1367),Ps=new kt(2089,1906,322752913,2040),vi=te(ee(re,2),fe,10,0,[te(ee(re,1),ae,0,7,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),te(ee(re,1),ae,0,7,[6,7,8,0,1,2,3,4,5,15,16,17,9,10,11,12,13,14]),te(ee(re,1),ae,0,7,[3,4,5,6,7,8,0,1,2,12,13,14,15,16,17,9,10,11]),te(ee(re,1),ae,0,7,[2,1,0,5,4,3,8,7,6,11,10,9,14,13,12,17,16,15]),te(ee(re,1),ae,0,7,[8,7,6,2,1,0,5,4,3,17,16,15,11,10,9,14,13,12]),te(ee(re,1),ae,0,7,[5,4,3,8,7,6,2,1,0,14,13,12,17,16,15,11,10,9])]),bB(),wB())}function Ks(e){e.ca=te(ee(re,1),ae,0,7,[0,1,2,3,4,5,6,7]),e.ea=te(ee(re,1),ae,0,7,[0,2,4,6,8,10,12,14,16,18,20,22])}function D1(e){!e.temps&&(e.temps=new pe),vr(Ps,e,e.temps),vr(e.temps,Cs,e),At(Ps,e,e.temps),At(e.temps,Cs,e)}function Qs(e,t){var r,n;for(n=0;n<8;n++)e.ca[n]=t.ca[n];for(r=0;r<12;r++)e.ea[r]=t.ea[r]}function AB(e){return Si(sr[gt(e.ca,8,!1)])}function yB(e){return sr[gt(e.ea,8,!0)]}function Ui(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function xi(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function bi(e){var t,r;for(!e.temps&&(e.temps=new pe),r=0;r<12;r++)e.temps.ea[e.ea[r]>>1]=(r<<1|e.ea[r]&1)<<24>>24;for(t=0;t<8;t++)e.temps.ca[e.ca[t]&7]=(t|32>>(e.ca[t]>>3)&24)<<24>>24;Qs(e,e.temps)}function A1(e){var t,r,n,o,l,i,s;for(t=new U1(e),o=new pe,r=Si(sr[gt(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},s=0;s<6;s++){if(n=Si(sr[gt(t.ca,8,!1)])>>4,r==n)for(l=0;l<16;l++)ll(t,ut[0][l],o),yi(o.ca,e.ca)&&(il(t,ut[0][l],o),yi(o.ea,e.ea)&&(i=Es(i,Ai({l:1,m:0,h:0},(s<<4|l)<48?s<<4|l:48))));D1(t),s%3==2&&bi(t)}return i}function UB(e,t){un(e.ca,t,8,!1)}function y1(e,t){un(e.ea,t,8,!0)}function js(e,t){var r,n,o;for(n=0,r=10;r>=0;--r,t>>=1)n^=o=t&1,e.ea[r]=(e.ea[r]&-2|o)<<24>>24;e.ea[11]=(e.ea[11]&-2|n)<<24>>24}function qs(e,t){var r,n,o;for(n=15,r=6;r>=0;--r,t=~~(t/3))n-=o=t%3,e.ca[r]=(e.ca[r]&7|o<<3)<<24>>24;e.ca[7]=(e.ca[7]&7|n%3<<3)<<24>>24}function xB(e){var t,r,n,o,l;for(l=0,o=0,n=0;n<12;n++)o|=1<<(e.ea[n]>>1),l^=e.ea[n]&1;if(o!=4095)return-2;if(l!=0)return-3;for(r=0,l=0,t=0;t<8;t++)r|=1<<(e.ca[t]&7),l+=e.ca[t]>>3;return r!=255?-4:l%3!=0?-5:(Ms(gt(e.ea,12,!0),12)^Ms(gt(e.ca,8,!1),8))!=0?-6:0}function ll(e,t,r){X();var n,o,l,i,s,a;for(a=lr[ut[0][t]],s=lr[t],n=0;n<8;n++)l=a.ca[e.ca[s.ca[n]&7]&7]>>3,i=e.ca[s.ca[n]&7]>>3,o=l<3?i:(3-i)%3,r.ca[n]=(a.ca[e.ca[s.ca[n]&7]&7]&7|o<<3)<<24>>24}function vr(e,t,r){X();var n,o,l;for(n=0;n<8;n++)o=e.ca[t.ca[n]&7]>>3,l=t.ca[n]>>3,r.ca[n]=(e.ca[t.ca[n]&7]&7|(o+l)%3<<3)<<24>>24}function Fi(e,t,r){var n,o,l,i;for(n=0;n<8;n++)l=e.ca[t.ca[n]&7]>>3,i=t.ca[n]>>3,o=l+(l<3?i:6-i),o=o%3+(l<3==i<3?0:3),r.ca[n]=(e.ca[t.ca[n]&7]&7|o<<3)<<24>>24}function pe(){X(),Ks(this)}function kt(e,t,r,n){Ks(this),un(this.ca,e,8,!1),qs(this,t),un(this.ea,r,12,!0),js(this,n)}function U1(e){Ks(this),Qs(this,e)}function Si(e){return X(),e^Ts>>((e&15)<<1)&3}function il(e,t,r){X();var n,o,l;for(l=lr[ut[0][t]],o=lr[t],n=0;n<12;n++)r.ea[n]=(l.ea[e.ea[o.ea[n]>>1]>>1]^e.ea[o.ea[n]>>1]&1^o.ea[n]&1)<<24>>24}function At(e,t,r){X();var n;for(n=0;n<12;n++)r.ea[n]=(e.ea[t.ea[n]>>1]^t.ea[n]&1)<<24>>24}function yr(e,t,r){X();var n;return n=Hs[e],r&&(n=n^Ts>>((n&15)<<1)&3),n&65520|ir[n&15][t]}function x1(){return X(),0}function bB(){var e,t;for(ge[0]=new kt(15120,0,119750400,0),ge[3]=new kt(21021,1494,323403417,0),ge[6]=new kt(8064,1236,29441808,550),ge[9]=new kt(9,0,5880,0),ge[12]=new kt(1230,412,2949660,0),ge[15]=new kt(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)ge[e+t+1]=new pe,At(ge[e+t],ge[e],ge[e+t+1]),vr(ge[e+t],ge[e],ge[e+t+1])}function SB(){X();var e,t,r;for(ks(40320,jn,sr,zs=Y(ye,Ae,0,2768,7,1),2),e=new pe,r=0;r<2768;r++)y1(e,jn[r]),Xn[r]=$n(e.ea,0,!0)+Ms(jn[r],8)*70<<24>>24,bi(e),Hs[r]=sr[gt(e.ea,8,!0)];for(t=0;t<24;t++)un(e.ea,t,12,!0),bi(e),wi[t]=gt(e.ea,12,!0)%24<<24>>24}function wB(){var e,t,r,n,o,l,i,s,a,f,u,g,p,c,L,m;for(e=new pe,t=new pe,r=new kt(28783,0,259268407,0),m=new kt(15138,0,119765538,7),g=new kt(5167,0,83473207,0),o=0;o<8;o++)g.ca[o]=Di(g.ca[o]|24);for(l=0;l<16;l++)lr[l]=new U1(e),Fi(e,m,t),At(e,m,t),L=t,t=e,e=L,l%4==3&&(Fi(L,g,t),At(L,g,t),L=t,t=e,e=L),l%8==7&&(Fi(L,r,t),At(L,r,t),L=t,t=e,e=L);for(i=0;i<16;i++)for(a=0;a<16;a++)for(Fi(lr[i],lr[a],e),u=0;u<16;u++)if(yi(lr[u].ca,e.ca)){ir[i][a]=u,ut[u][a]=i;break}for(f=0;f<18;f++)for(c=0;c<16;c++){for(ll(ge[f],ut[0][c],e),p=0;p<18;p++)if(yi(ge[p].ca,e.ca)){el[c][f]=p,xr[c][(Je(),eo)[f]]=eo[p];break}c%2==0&&(fn[f<<3|c>>1]=el[c][f])}for(n=0;n<18;n++)for(Mi[n]=A1(ge[n]),s=n,c=0;c<48;c++)el[c%16][s]<n&&(b1[c]|=1<<n),c%16==15&&(s=vi[2][s])}function ks(e,t,r,n,o){X();var l,i,s,a,f,u,g,p,c;for(l=new pe,s=new pe,i=0,f=0,c=o>=2?1:2,u=o!=1,a=0;a<e;a++)if(r[a]==0){switch(o){case 0:js(l,a);break;case 1:qs(l,a);break;case 2:un(l.ea,a,8,!0)}for(g=0;g<16;g+=c){switch(u?il(l,g,s):ll(l,g,s),o){case 0:f=Ui(s);break;case 1:f=xi(s);break;case 2:f=gt(s.ea,8,!0)}o==0&&(Er[i<<3|g>>1]=f&He),f==a&&(n[i]=(n[i]|1<<~~(g/c))&He),p=~~((i<<4|g)/c),r[f]=p&He}t[i++]=a&He}return i}function vB(e,t,r,n,o,l,i,s){var a,f,u,g,p;if(g=Sr(ft((ln(),Vn),(i>>4)*140+sn[(X(),Xn)[s>>4]&255][ut[i&15][s&15]]),Sr(ft(Vn,n*140+sn[Xn[t]&255][ut[o][r]]),ft(zi,t*24+ol[l][r]))),g>e.maxDep2)return g-e.maxDep2;for(a=e.maxDep2;a>=g&&(p=v1(e,n,o,t,r,l,a,e.depth1,10),!(p<0));a--){for(a-=p,e.solLen=0,e.solution=new C1,MB(e.solution,e.verbose,e.urfIdx,e.depth1),u=0;u<e.depth1+a;u++)g1(e.solution,e.move[u]);for(f=e.preMoveLen-1;f>=0;f--)g1(e.solution,e.preMoves[f]);e.solLen=e.solution.length_0}return a!=e.maxDep2?(e.maxDep2=Ws(_1,e.solLen-e.length1-1),R1(e.probe,e.probeMin)?0:1):1}function EB(e){var t,r,n,o,l,i,s,a,f,u,g,p,c,L,m;if(e.isRec=!1,R1(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=lB(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)vr(e.phase1Cubie[n],(X(),ge)[e.move[n]],e.phase1Cubie[n+1]),At(e.phase1Cubie[n],ge[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,s=AB(e.phase1Cubie[e.depth1]),a=s&15,s>>=4,f=yB(e.phase1Cubie[e.depth1]),u=f&15,f>>=4,g=gt(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=yr(f,u,!1),t=yr(s,a,!0),o=e.depth1==0?-1:e.move[e.depth1-1],l=e.preMoveLen==0?-1:e.preMoves[e.preMoveLen-1],m=0,L=(e.preMoveLen==0?1:2)*(e.depth1==0?1:2),p=0,c=(1<<L)-1;p<L;p++){if((c>>p&1)!=0){if(c&=~(1<<p),m=vB(e,s,a,f,u,g,r,t),m==0||m>2)break;m==2&&(c&=4<<p)}if(c==0)break;(p&1)==0&&e.depth1>0?(i=(Je(),eo)[~~(o/3)*3+1],e.move[e.depth1-1]=zt[i]*2-e.move[e.depth1-1],g=(ln(),Zn)[g][i],s=qn[s][(X(),xr)[a][i]],a=ir[s&15][a],s>>=4,f=Hn[f][xr[u][i]],u=ir[f&15][u],f>>=4,t=yr(s,a,!0),r=yr(f,u,!1)):e.preMoveLen>0&&(i=(Je(),eo)[~~(l/3)*3+1],e.preMoves[e.preMoveLen-1]=zt[i]*2-e.preMoves[e.preMoveLen-1],g=(X(),wi)[(ln(),Zn)[wi[g]][i]],s=qn[t>>4][xr[t&15][i]],t=s&-16|ir[s&15][t&15],s=yr(t>>4,t&15,!0),a=s&15,s>>=4,f=Hn[r>>4][xr[r&15][i]],r=f&-16|ir[f&15][r&15],f=yr(r>>4,r&15,!1),u=f&15,f>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=o),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=l),m==0?0:2}function _B(e){var t;for(e.conjMask=0,e.selfSym=A1(e.cc),e.conjMask|=Ss(jt(nn(e.selfSym,16),{l:He,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=Ss(jt(nn(e.selfSym,32),{l:He,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=Ss(jt(nn(e.selfSym,48),{l:He,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=jt(e.selfSym,{l:rt,m:rt,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)Qs(e.urfCubieCube[t],e.cc),h1(e.urfCoordCube[t],e.urfCubieCube[t],20),D1(e.cc),t%3==2&&bi(e.cc)}function S1(e,t,r,n,o){var l,i,s,a,f,u;if(t.prun==0&&n<5)return e.allowShorter||n==0?(e.depth1-=n,f=EB(e),e.depth1+=n,f):1;for(u=x1(Is(r)),l=0;l<18;l+=3)if(!(l==o||l==o-9)){for(s=0;s<3;s++)if(i=l+s,!(e.isRec&&i!=e.move[e.depth1-n]||u!=0&&(u&1<<i)!=0)){if(a=cB(e.nodeUD[n],t,i),a>n)break;if(a==n)continue;if(a=mB(e.nodeUD[n],t,i),a>n)break;if(a==n)continue;if(e.move[e.depth1-n]=i,e.valid1=Ws(e.valid1,e.depth1-n),f=S1(e,e.nodeUD[n],r&on((X(),Mi)[i]),n-1,l),f==0)return 0;if(f>=2)break}}return 1}function w1(e,t,r,n,o){var l,i,s;if(e.preMoveLen=e.maxPreMoves-t,(e.isRec?e.depth1==e.length1-e.preMoveLen:e.preMoveLen==0||(225207>>r&1)==0)&&(e.depth1=e.length1-e.preMoveLen,e.phase1Cubie[0]=n,e.allowShorter=e.depth1==vs&&e.preMoveLen!=0,h1(e.nodeUD[e.depth1+1],n,e.depth1)&&S1(e,e.nodeUD[e.depth1+1],o,e.depth1,-1)==0))return 0;if(t==0||e.preMoveLen+vs>=e.length1)return 1;for(s=x1(Is(o)),(t==1||e.preMoveLen+1+vs>=e.length1)&&(s|=225207),r=~~(r/3)*3,l=0;l<18;l++){if(l==r||l==r-9||l==r+9){l+=2;continue}if(!(e.isRec&&l!=e.preMoves[e.maxPreMoves-t]||(s&1<<l)!=0)&&(vr((X(),ge)[l],n,e.preMoveCubes[t]),At(ge[l],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=l,i=w1(e,t-1,l,e.preMoveCubes[t],o&on(Mi[l])),i==0))return 0}return 1}function v1(e,t,r,n,o,l,i,s,a){var f,u,g,p,c,L,m,R,F,A,U;if(t==0&&n==0&&l==0)return i;for(F=(Je(),$o)[a],m=0;m<10;m++){if((F>>m&1)!=0){m+=66>>m&3;continue}if(R=(ln(),Zn)[l][m],u=qn[n][(X(),xr)[o][m]],g=ir[u&15][o],u>>=4,c=Hn[t][xr[r][m]],L=ir[c&15][r],c>>=4,p=yr(c,L,!1),f=yr(u,g,!0),A=ft(Vn,(p>>4)*140+sn[Xn[f>>4]&255][ut[p&15][f&15]]),A>i+1)return i-A+1;if(A>=i){m+=66>>m&3&i-A;continue}if(A=Sr(ft(zi,u*24+ol[R][g]),ft(Vn,c*140+sn[Xn[u]&255][ut[L][g]])),A>=i){m+=66>>m&3&i-A;continue}if(U=v1(e,c,L,u,g,R,i-1,s+1,m),U>=0)return e.move[s]=zt[m],U;if(U<-2)break;U<-1&&(m+=66>>m&3)}return-1}function kB(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=Ws(_1,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)==0&&w1(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],on(jt(e.selfSym,{l:He,m:0,h:0})))==0)return e.solution?p1(e.solution):"Error 8";return e.solution?p1(e.solution):"Error 7"}function zB(e,t){var r;return r=CB(e,t),r!=0?"Error "+(r<0?-r:r):(e.solLen=22,e.probe={l:0,m:0,h:0},e.probeMax={l:3531008,m:23,h:0},e.probeMin={l:0,m:0,h:0},e.verbose=0,e.solution=null,e.isRec=!1,F1(!1),_B(e),kB(e))}function CB(e,t){var r,n,o,l;for(n=0,o=Y(re,ae,0,54,7,1),r=aB(te(ee(ye,1),Ae,0,7,[t.charCodeAt(4),t.charCodeAt(13),t.charCodeAt(22),t.charCodeAt(31),t.charCodeAt(40),t.charCodeAt(49)])),l=0;l<54;l++){if(o[l]=sB(r,uB(t.charCodeAt(l)))<<24>>24,o[l]==-1)return-1;n+=1<<(o[l]<<2)}return n!=10066329?-1:(PB(o,e.cc),xB(e.cc))}function E1(){var e,t,r;for(this.move=Y(Oe,Te,0,31,7,1),this.nodeUD=Y(hi,fe,31,21,0,1),this.nodeRL=Y(hi,fe,31,21,0,1),this.nodeFB=Y(hi,fe,31,21,0,1),this.cc=new pe,this.urfCubieCube=Y(tl,fe,7,6,0,1),this.urfCoordCube=Y(hi,fe,31,6,0,1),this.phase1Cubie=Y(tl,fe,7,21,0,1),this.preMoveCubes=Y(tl,fe,7,21,0,1),this.preMoves=Y(Oe,Te,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new Xo,this.nodeRL[t]=new Xo,this.nodeFB[t]=new Xo,this.phase1Cubie[t]=new pe;for(r=0;r<6;r++)this.urfCubieCube[r]=new pe,this.urfCoordCube[r]=new Xo;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new pe}function Je(){if(!u1){u1=!0;var e,t,r,n,o,l;for(rn=te(ee(re,2),fe,10,0,[te(ee(re,1),ae,0,7,[8,9,20]),te(ee(re,1),ae,0,7,[6,18,38]),te(ee(re,1),ae,0,7,[0,36,47]),te(ee(re,1),ae,0,7,[2,45,11]),te(ee(re,1),ae,0,7,[29,26,15]),te(ee(re,1),ae,0,7,[27,44,24]),te(ee(re,1),ae,0,7,[33,53,42]),te(ee(re,1),ae,0,7,[35,17,51])]),nr=te(ee(re,2),fe,10,0,[te(ee(re,1),ae,0,7,[5,10]),te(ee(re,1),ae,0,7,[7,19]),te(ee(re,1),ae,0,7,[3,37]),te(ee(re,1),ae,0,7,[1,46]),te(ee(re,1),ae,0,7,[32,16]),te(ee(re,1),ae,0,7,[28,25]),te(ee(re,1),ae,0,7,[30,43]),te(ee(re,1),ae,0,7,[34,52]),te(ee(re,1),ae,0,7,[23,12]),te(ee(re,1),ae,0,7,[21,41]),te(ee(re,1),ae,0,7,[50,39]),te(ee(re,1),ae,0,7,[48,14])]),or=tt(Oe,[fe,Te],[17,0],7,[13,13],2),Ns=te(ee(gB,1),fe,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),zt=te(ee(Oe,1),Te,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),eo=Y(Oe,Te,0,18,7,1),$o=Y(Oe,Te,0,11,7,1),t=0;t<18;t++)eo[zt[t]]=t;for(r=0;r<10;r++)for(n=~~(zt[r]/3),$o[r]=0,o=0;o<10;o++)l=~~(zt[o]/3),$o[r]|=(n==l||n%3==l%3&&n>=l?1:0)<<o;for($o[10]=0,e=0;e<13;e++)for(or[e][0]=or[e][e]=1,o=1;o<e;o++)or[e][o]=or[e-1][o-1]+or[e-1][o]}}function $n(e,t,r){Je();var n,o,l,i,s;for(n=e.length-1,l=0,s=4,o=n;o>=0;o--)i=k1(e[o],r),(i&12)==t&&(l+=or[o][s--]);return l}function Ms(e,t){Je();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function gt(e,t,r){Je();var n,o,l,i;for(o=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)l=k1(e[n],r)<<2,o=(t-n)*o+on(jt(nn(i,l),{l:15,m:0,h:0})),i=d1(i,Ai({l:1118480,m:279620,h:69905},l));return o}function k1(e,t){return t?e>>1:e&7}function z1(e,t,r,n){Je();var o,l,i,s;for(o=e.length-1,s=4,l=o,i=o;i>=0;i--)t>=or[i][s]?(t-=or[i][s--],e[i]=Ei(e[i],s|r,n)):((l&12)==r&&(l-=4),e[i]=Ei(e[i],l--,n))}function un(e,t,r,n){Je();var o,l,i,s,a,f;for(f={l:1323536,m:2777561,h:1043915},o={l:0,m:0,h:0},s=2;s<=r;s++)o=Es(Ai(o,4),Is(t%s)),t=~~(t/s);for(l=0;l<r-1;l++)a=(on(o)&15)<<2,o=nn(o,4),e[l]=Ei(e[l],on(jt(nn(f,a),{l:15,m:0,h:0})),n),i=d1(Ai({l:1,m:0,h:0},a),{l:1,m:0,h:0}),f=Es(jt(f,i),jt(nn(f,4),{l:~i.l&rt,m:~i.m&rt,h:~i.h&br}));e[r-1]=Ei(e[r-1],on(jt(f,{l:15,m:0,h:0})),n)}function Ei(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function PB(e,t){Je();var r,n,o,l,i,s,a,f;for(l=0;l<8;l++)t.ca[l]=0;for(i=0;i<12;i++)t.ea[i]=0;for(s=0;s<8;s++){for(f=0;f<3&&!(e[rn[s][f]]==0||e[rn[s][f]]==3);f++);for(r=e[rn[s][(f+1)%3]],n=e[rn[s][(f+2)%3]],a=0;a<8;a++)if(r==~~(rn[a][1]/9)&&n==~~(rn[a][2]/9)){t.ca[s]=Di(f%3<<3|a);break}}for(o=0;o<12;o++)for(a=0;a<12;a++){if(e[nr[o][0]]==~~(nr[a][0]/9)&&e[nr[o][1]]==~~(nr[a][1]/9)){t.ea[o]=Di(a<<1);break}if(e[nr[o][0]]==~~(nr[a][1]/9)&&e[nr[o][1]]==~~(nr[a][0]/9)){t.ea[o]=Di(a<<1|1);break}}}function g1(e,t){var r,n,o;if(e.length_0==0){e.moves[e.length_0++]=t;return}if(r=~~(t/3),n=~~(e.moves[e.length_0-1]/3),r==n){o=(t%3+e.moves[e.length_0-1]%3+1)%4,o==3?--e.length_0:e.moves[e.length_0-1]=r*3+o;return}if(e.length_0>1&&r%3==n%3&&r==~~(e.moves[e.length_0-2]/3)){o=(t%3+e.moves[e.length_0-2]%3+1)%4,o==3?(e.moves[e.length_0-2]=e.moves[e.length_0-1],--e.length_0):e.moves[e.length_0-2]=r*3+o;return}e.moves[e.length_0++]=t}function MB(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function p1(e){var t,r,n;if(r=new pB,n=(e.verbose&2)!=0?(e.urfIdx+3)%6:e.urfIdx,n<3)for(t=0;t<e.length_0;t++)(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". "),l1(i1(r,(Je(),Ns)[(X(),vi)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)l1(i1(r,(Je(),Ns)[(X(),vi)[n][e.moves[t]]])),(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". ");return r.string}function C1(){this.moves=Y(Oe,Te,0,31,7,1)}var fe,rt,br,JL,He,Ae,Te,Ts,Jo,ae,H,_i,Ri,gB,s1,sn,_s,qn,Vn,Hn,to,zi,ol,Zn,Jn,Yn,wr,Ci,Ur,Pi,di,hi,a1,lr,sr,jn,an,Vs,Er,wi,Xn,Hs,fn,el,xr,ir,ut,f1,zs,ws,rl,Zs,b1,ge,Mi,Cs,Ps,vi,tl,_1,vs,u1,or,$o,rn,nr,Ns,eo,zt,Oe,NB,re,TB,ye,OB,GB,P1=y(()=>{fe={3:1},rt=4194303,br=1048575,JL=524288,He=65535,Ae={11:1,3:1},Te={17:1,3:1},Ts=14540032,Jo=286331153,ae={10:1,3:1},_i={};nl(1,null,{},eB);nl(79,1,{},Os);H.createClassLiteralForArray=function(t){var r;return r=new Os,r.modifiers=4,t>1?r.componentType=m1(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!=0};gB=_r("java.lang","String",2);s1=!1;nl(31,1,{31:1},Xo);H.flip=0;H.flipc=0;H.fsym=0;H.prun=0;H.slice_0=0;H.tsym=0;H.twist=0;H.twistc=0;di=0,hi=_r("org.cubing.min2phase.client","CoordCube",31),a1=!1;tl=_r("org.cubing.min2phase.client","CubieCube",7);nl(72,1,{},E1);H.allowShorter=!1;H.conjMask=0;H.depth1=0;H.isRec=!1;H.length1=0;H.maxDep2=0;H.maxPreMoves=0;H.preMoveLen=0;H.probe={l:0,m:0,h:0};H.probeMax={l:0,m:0,h:0};H.probeMin={l:0,m:0,h:0};H.selfSym={l:0,m:0,h:0};H.solLen=0;H.urfIdx=0;H.valid1=0;H.verbose=0;_1=12,vs=7,u1=!1;nl(150,1,{},C1);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;Oe=ki("int","I");_r("com.google.gwt.lang","CollapsedPropertyHolder",252);_r("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);NB=_r("com.google.gwt.lang","LongLibBase/LongEmul",null);_r("com.google.gwt.lang","ModuleUtils",257);re=ki("byte","B"),TB=ki("long","J"),ye=ki("char","C");_r("com.google.gwt.user.client.rpc","XsrfToken",null),tB("java.util","Map/Entry");OB=function(){F1(!1)},GB=function(e){return zB(new E1,e)}});var M1={};Bt(M1,{initialize:()=>OB,solveState:()=>GB});var N1=y(()=>{P1()});var Js,T1=y(()=>{Kt();Js=Ne(()=>Promise.resolve().then(()=>(N1(),M1)))});function O1(e,t){return e.slice(t)+e.slice(0,t)}function jB(e){let t=[[],[]];for(let r=0;r<6;r++)if(e.stateData.CENTERS.pieces[r]!==r)throw new Error("non-oriented puzzles are not supported");for(let r=0;r<12;r++)t[0].push(O1(IB[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push(O1(WB[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(KB),t}function G1(e){let t=jB(e);return QB.map(([r,n,o])=>t[r][n][o]).join("")}var IB,WB,KB,QB,I1=y(()=>{IB="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),WB="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),KB="U L F R B D".split(" "),QB=[[1,2,0],[0,2,0],[1,1,0],[0,3,0],[2,0,0],[0,1,0],[1,3,0],[0,0,0],[1,0,0],[1,0,2],[0,1,1],[1,1,1],[0,8,1],[2,3,0],[0,10,1],[1,4,1],[0,5,1],[1,7,2],[1,3,2],[0,0,1],[1,0,1],[0,9,0],[2,2,0],[0,8,0],[1,5,1],[0,4,1],[1,4,2],[1,5,0],[0,4,0],[1,4,0],[0,7,0],[2,5,0],[0,5,0],[1,6,0],[0,6,0],[1,7,0],[1,2,2],[0,3,1],[1,3,1],[0,11,1],[2,1,0],[0,9,1],[1,6,1],[0,7,1],[1,5,2],[1,1,2],[0,2,1],[1,2,1],[0,10,0],[2,4,0],[0,11,0],[1,7,1],[0,6,1],[1,6,2]]});function W1(e,t){let r=new ce(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}}).experimentalToTransformation(),n=new ce(t.kpuzzle,{EDGES:t.stateData.EDGES,CORNERS:t.stateData.CORNERS,CENTERS:{pieces:t.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}}).experimentalToTransformation();return r.isIdentical(n)}function K1(e,t){if(W1(e.startState(),t))return!1;for(let r of"ULFRBD")for(let n=1;n<4;n++){let o=e.moveToTransformation(new B(r,n)).toKState();if(W1(o,t))return!1}return!0}var Q1=y(()=>{Be();qe()});var j1,q1=y(()=>{j1=[["R U'","R2 B","D2 B2","D' L B'","R' U'","B","D B2","R' B","L' U","L2 B'","B2","D L B'","L U","B'","U'","R B","D' B2","L B'","U2","U L' B'","","U' L' B'","U","L' B'"],["F2 L2","F' L'","R' F L2","D' L2","F L2","F2 L'","R' F' L'","R2 F L2","R2 F2 L'","L2","F L'","D' L","D2 L2","R2 F' L'","D L","","L2 F L'","L F' L2","L F L'","F' L2","L'","D L2","D F L'","L"],["R B U2 B'","R2 B U' B'","F2 B U B'","F B2 L' B2","B2 L B2","B U' B'","R2 B U2 B'","R' B U' B'","B2 L' B2","F B U B'","B2 U' B2","B' L B","L F' B D' B'","B' U' B2 D B'","B U2 B'","R B U' B'","B2 L2 B2","D' B' L B","B U B'","F' B2 L' B2","","B2 L' B' U' B'"],["U F2 L2 U'","F' U L' U'","F2 U L' U'","U F L2 U'","U2 B2 U2","R' U' B U","D2 U L U'","D U2 B' U2","U L2 U'","F U L' U'","D U L U'","U2 B' U2","","U2 B' U' L' U'","U2 L' U2","U' B U","U L U'","D' U2 B' U2","U L' U'","U2 B U2"],["R' D' F2","F'","F2","D R F'","R D' F2","R2 F'","D' F2","R F'","F2 R' D' F2","F","D2 F2","D' R F'","R2 D' F2","R' F'","D F2","D2 R F'","","F R' D' F2"],["R' D2 F' D F","R F2 R2 F2","R2 F' D2 F","F' R2 D2 F","L D' L'","D F' D2 F","F2 R2 F2","R F' D2 F","F' R2 D' F","F' R' D2 F","F2 R' F2","L D L'","F' R D' F","F2 R F2","F' D2 F","","L D2 R D' L'","F' D2 F' R F2","D2 R2 F2 R2 F2","D F' D' F","F' D F"],["U F2 U'","R U F' U'","D R U F2 U'","U F U'","R2 U F2 U'","R' U F' U'","R U F2 U'","R2 U F' U'","","U L D L' F U'","F2 D' R D F2","D2 U F U'","R' U F2 U'","U F' U'","F2 D2 R D2 F2","D U F U'"],["R2","R' B' D B","D R'","F' R2 F","","R B' D B","R'","B' D B","D' R'","D2 F' R2 F","R","R2 B' D B","D2 R'","B' D' B"],["R2 D' R2","F' R' F R","R D' R2 D R'","D2 R2 D2 R2","R' D' F' R F","U F D F' U'","","R2 D2 B R' B' R'","R' F D' F2 R F","R2 D R2","F2 U F U' F","R' D F' R F","D R2 D2 R2","U F D' F' U'","D R' D2 F' R F","R2 D2 R2","U F D2 F' U'","R' D2 F' R F"],["B R B'","F D F' B R2 B'","D B R2 B'","D2 B R' B'","B R2 B'","D B R' B'","D' B R2 B'","B R' B'","","B R2 B' D B R' B'","D2 B R2 B'","D' B R' B'"],["","R' D R F D2 F'","R' D R","D F D' F'","R F' R' F","F D' F'","R' D' R","F D2 F'","R' D2 R","F D F'"],["","F2 D2 R F' R' D2 F' D2 F'","F2 D2 F' D' F D' F' D2 F'","F2 D F2 D F2 D2 F2","D2 F L D2 L' D2 F'","D F D2 L D2 L' F'","R' D B' D2 B D' R","R' D2 B' D2 B R","F D2 F' D F D F'","F D' L D2 L' D F'","B D' F D B' D' F'","F D2 L D2 L' F'","F D' L D L' D F'","F L D2 L' D2 F'","R' B' D2 B D2 R"],["D'","F L D L' D' F'","D2","L B D B' D' L'","D","B' L' D' L D B","","D F L D L' D' F'"],["F' D2 F D F' D F","F' D' R' D R F","F' R' D' R D F","B D R D' R' B'","","D B' D' L' D L B"],["D F D F' D F D2 F'","F' U2 B' R' B U2 F' L F' L' F'","","D2 L D L2 F L F2 D F"],["L B' L' F L B L' F'","F2 U F' D2 F U' F' D2 F'","D' F' D B D' F D B'","F L2 F R2 F' L2 F R2 F2","D B D' F' D B' D' F","R F L F' R' F L' F'","","D2 B L' U2 L B' D2 B L' U2 L B'","D2 F R' U2 R F' D2 F R' U2 R F'","R F L' F' R' F L F'","D F D' B' D F' D' B","L2 F2 L' B2 L F2 L' B2 L'"],["L B R' B' L' B R B'","R' B R F' R' B' R F","L D2 L U L' D2 L U' L2","","D2 B' D2 F D' L2 F L2 F' D2 B D' F'","D2 F' R' F R2 B' D2 B D2 R' F D2 F'","L B L' F L B' L' F'","F' D2 F' U' F D2 F' U F2","D' B' D F D' B D F'"],["","D2 F' L U2 L' F D2 F' L U2 L' F","D2 B' R U2 R' B D2 B' R U2 R' B"]]});async function H1(){let e=await Ce["3x3x3"].kpuzzle(),t=e.startState();for(let r of j1)t=t.applyAlg(E.fromString((await rr())(r)));return K1(e,t)?t:H1()}async function Ys(e){return we(),E.fromString((await Js).solveState(G1(e)))}async function ro(){return Ys(await H1())}async function Z1(){(await Js).initialize()}async function J1(){return Qn(await ro(),qB)}async function Y1(){let e=new Rt,t=await ro();return e.experimentalPushAlg(V1),e.experimentalPushAlg(t),e.experimentalPushAlg(V1),e.toAlg()}var qB,V1,Xs=y(()=>{Be();tr();Dt();Ft();Bi();T1();I1();Q1();q1();qB=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];V1=new E("R' U' F")});function ue(e,...t){let r=t.length,n=e[t[r-1]];for(let o=r;o>0;o--)e[t[o]]=e[t[o-1]];return e[t[0]]=n,ue}function X1(e,t,r,n){r=(r||8)-1;let o=1985229328,l=0;n??(n=0),n<0&&(t<<=1);for(let i=0;i<r;++i){let s=$s[r-i],a=~~(t/s);l^=a,t%=s,a<<=2,e[i]=o>>a&7;let f=(1<<a)-1;o=(o&f)+(o>>4&~f)}return n<0&&(l&1)!==0?(e[r]=e[r-1],e[r-1]=o&7):e[r]=o&7,e}var Re,$s,$1=y(()=>{Re=[],$s=[1];for(let e=0;e<32;++e){Re[e]=[];for(let t=0;t<32;++t)Re[e][t]=0}for(let e=0;e<32;++e){Re[e][0]=Re[e][e]=1,$s[e+1]=$s[e]*(e+1);for(let t=1;t<e;++t)Re[e][t]=Re[e-1][t-1]+Re[e-1][t]}});function O(e,t){let r=new Array(e);if(t!==void 0)for(let n=0;n<e;n++)r[n]=new Array(t);return r}function $B(e){return new gl[e]}function mt(e,t,r,...n){let o=gl[e];o&&!o.___clazz$?Z=o.prototype:(!o&&(o=gl[e]=function(){}),Z=o.prototype=t<0?{}:$B(t),Z.castableTypeMap$=r);for(let l of n)l.prototype=Z;o.___clazz$&&(Z.___clazz$=o.___clazz$,o.___clazz$=null)}function Mr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function Ag(){}function eR(e,t){let r=yg(0,t);return Ug(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function yg(e,t){let r=new Array(t);if(e===3)for(let n=0;n<t;++n){let o={m:0,l:0,h:0};o.l=o.m=o.h=0,r[n]=o}else if(e>0){let n=[null,0,!1][e];for(let o=0;o<t;++o)r[o]=n}return r}function fa(e,t,r,n,o){let l=yg(o,n);return Ug(e,t,r,l),l}function Ug(e,t,r,n){return xg(),rR(n,ra,na),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function Qi(e,t,r){return e[t]=r}function xg(){eg||(eg=!0,ra=[],na=[],tR(new Ag,ra,na))}function tR(e,t,r){let n=0,o;for(let l in e)(o=e[l])&&(t[n]=l,r[n]=o,++n)}function rR(e,t,r){xg();for(let n=0,o=t.length;n<o;++n)e[t[n]]=r[n]}function nR(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function oR(e,t){return e!==null&&nR(e,t)}function lR(){if(tg)return!1;tg=!0,r0=O(15582,36),n0=O(15582),Nt=O(15582),ao=O(48,48),Pt=O(48,36),so=O(48),pa=O(48)}function ua(e){e.ct=O(24)}function rg(e,t){let r,n;if(oR(t,Fg)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function ji(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=Re[t][n--]);return r}function Ti(e){let t,r;if(po!==null)return po[ji(e)];for(r=0;r<48;++r){if(t=gR(ji(e)),t!==-1)return t*64+r;le(e,0),r%2===1&&le(e,1),r%8===7&&le(e,2),r%16===15&&le(e,3)}}function Ct(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.ct,16,17,18,19,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.ct,20,21,22,23,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break;case 7:h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break;case 10:h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function le(e,t){switch(t){case 0:Ct(e,19),Ct(e,28);break;case 1:Ct(e,21),Ct(e,32);break;case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.ct,16,19,21,22,1),h(e.ct,17,18,20,23,1);break;case 3:Ct(e,18),Ct(e,29),Ct(e,24),Ct(e,35)}}function ng(e,t){let r;for(r=0;r<t;++r)le(e,0),r%2===1&&le(e,1),r%8===7&&le(e,2),r%16===15&&le(e,3)}function ga(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=Re[r][n]&&(t-=Re[r][n--],e.ct[r]=1)}function Oi(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function pl(){let e;for(ua(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function Gi(e,t){let r;for(ua(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function al(e){let t;for(ua(this),t=0;t<24;++t)this.ct[t]=e[t]}function iR(){let e,t,r=new pl,n=new pl;for(e=0;e<15582;++e)for(ga(n,n0[e]),t=0;t<36;++t)Oi(r,n),Ct(r,t),r0[e][t]=Ti(r)}function sR(){let e,t,r,n,o,l,i,s;for(s0(Nt),Nt[0]=0,t=0,r=1;r!==15582;)for(l=t>4,s=l?-1:t,e=l?t:-1,++t,n=0;n<15582;++n)if(Nt[n]===s){for(i=0;i<27;++i)if(o=~~r0[n][i]>>>6,Nt[o]===e)if(++r,l){Nt[n]=t;break}else Nt[o]=t}}function aR(e){let t,r,n,o=new al(e.ct);for(n=0;n<48;++n){for(t=!0,r=0;r<24;++r)if(o.ct[r]!==~~(r/4)){t=!1;break}if(t)return n;le(o,0),n%2===1&&le(o,1),n%8===7&&le(o,2),n%16===15&&le(o,3)}return-1}function fR(){let e,t,r,n=new pl;for(e=0;e<24;++e)n.ct[e]=e;let o=new al(n.ct),l=new al(n.ct),i=new al(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)rg(n,o)&&(ao[e][t]=r,r===0&&(so[e]=t)),le(o,0),r%2===1&&le(o,1),r%8===7&&le(o,2),r%16===15&&le(o,3);le(n,0),t%2===1&&le(n,1),t%8===7&&le(n,2),t%16===15&&le(n,3)}le(n,0),e%2===1&&le(n,1),e%8===7&&le(n,2),e%16===15&&le(n,3)}for(e=0;e<48;++e)for(Oi(n,l),ng(n,so[e]),t=0;t<36;++t)for(Oi(o,n),Ct(o,t),ng(o,e),r=0;r<36;++r)if(Oi(i,l),Ct(i,r),rg(i,o)){Pt[e][t]=r;break}for(ga(n,0),e=0;e<48;++e)pa[so[e]]=ji(n),le(n,0),e%2===1&&le(n,1),e%8===7&&le(n,2),e%16===15&&le(n,3)}function uR(){let e,t,r,n,o=new pl,l=O(22984);for(t=0;t<22984;t++)l[t]=0;for(e=0,t=0;t<735471;++t)if((l[~~t>>>5]&1<<(t&31))===0){for(ga(o,t),n=0;n<48;++n)r=ji(o),l[~~r>>>5]|=1<<(r&31),po!==null&&(po[r]=e<<6|so[n]),le(o,0),n%2===1&&le(o,1),n%8===7&&le(o,2),n%16===15&&le(o,3);n0[e++]=t}}function gR(e){let t=XR(n0,e);return t>=0?t:-1}function pR(){og||(og=!0,Zi=O(70,28),Hi=O(6435,28),vg=O(70,16),Sg=O(6435,16),nt=O(450450),wg=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0])}function qi(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=Re[t][n--]);return r}function Vi(e){let t,r,n;for(r=0,n=4,t=6;t>=0;--t)e.rl[t]!==e.rl[7]&&(r+=Re[t][n--]);return r*2+e.parity}function io(e,t){e.parity^=wg[t];let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.rl,0,1,2,3,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.rl,4,5,6,7,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.rl,0,5,4,1,r),h(e.ct,8,9,12,13,r);break;case 7:h(e.rl,0,1,2,3,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.rl,0,3,6,5,r),h(e.ct,3,2,5,4,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.rl,3,2,7,6,r),h(e.ct,11,10,15,14,r);break;case 10:h(e.rl,4,5,6,7,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.rl,1,4,7,2,r),h(e.ct,1,0,7,6,r)}}function no(e,t){switch(t){case 0:io(e,19),io(e,28);break;case 1:io(e,21),io(e,32);break;case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.rl,0,3,5,6,1),h(e.rl,1,2,4,7,1)}}function bg(e,t,r){let n;for(n=0;n<16;++n)e.ct[n]=~~(t.ct[n]/2);for(n=0;n<8;++n)e.rl[n]=t.ct[n+16];e.parity=r}function lg(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.ct[r]=1):e.ct[r]=0}function ig(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.rl[r]=1):e.rl[r]=0}function ca(){this.rl=O(8),this.ct=O(16)}function cR(){let e,t,r,n,o,l,i,s,a,f,u=new ca;for(o=0;o<70;++o)for(s=0;s<28;++s)ig(u,o),io(u,pn[s]),Zi[o][s]=Vi(u);for(o=0;o<70;++o)for(ig(u,o),i=0;i<16;++i)vg[o][i]=Vi(u),no(u,0),i%2===1&&no(u,1),i%8===7&&no(u,2);for(o=0;o<6435;++o)for(lg(u,o),i=0;i<16;++i)Sg[o][i]=qi(u)&65535,no(u,0),i%2===1&&no(u,1),i%8===7&&no(u,2);for(o=0;o<6435;++o)for(s=0;s<28;++s)lg(u,o),io(u,pn[s]),Hi[o][s]=qi(u)&65535;for(s0(nt),nt[0]=nt[18]=nt[28]=nt[46]=nt[54]=nt[56]=0,r=0,n=6;n!==450450;){let g=r>6,p=g?-1:r,c=g?r:-1;for(++r,o=0;o<450450;++o)if(nt[o]===p){for(e=~~(o/70),a=o%70,s=0;s<23;++s)if(t=Hi[e][s],f=Zi[a][s],l=t*70+f,nt[l]===c)if(++n,g){nt[o]=r;break}else nt[l]=r}}}function mR(){sg||(sg=!0,fl=O(29400,20),_g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],zr=O(29400),Ba=[0,9,14,23,27,28,41,42,46,55,60,69],Ra=O(70))}function ma(e){let t,r,n,o;for(r=0,o=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=Re[t][o--]);for(r*=35,o=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=Re[t][o--]);r*=12;let l=e.fb[7]^e.ud[7];for(n=0,o=4,t=7;t>=0;--t)e.rl[t]!==l&&(n+=Re[t][o--]);return e.parity+2*(r+Ra[n])}function LR(e,t){switch(e.parity^=_g[t],t){case 0:case 1:case 2:h(e.ud,0,1,2,3,t%3);break;case 3:h(e.rl,0,1,2,3,1);break;case 4:case 5:case 6:h(e.fb,0,1,2,3,(t-1)%3);break;case 7:case 8:case 9:h(e.ud,4,5,6,7,(t-1)%3);break;case 10:h(e.rl,4,5,6,7,1);break;case 11:case 12:case 13:h(e.fb,4,5,6,7,(t+1)%3);break;case 14:h(e.ud,0,1,2,3,1),h(e.rl,0,5,4,1,1),h(e.fb,0,5,4,1,1);break;case 15:h(e.rl,0,1,2,3,1),h(e.fb,1,4,7,2,1),h(e.ud,1,6,5,2,1);break;case 16:h(e.fb,0,1,2,3,1),h(e.ud,3,2,5,4,1),h(e.rl,0,3,6,5,1);break;case 17:h(e.ud,4,5,6,7,1),h(e.rl,3,2,7,6,1),h(e.fb,3,2,7,6,1);break;case 18:h(e.rl,4,5,6,7,1),h(e.fb,0,3,6,5,1),h(e.ud,0,3,4,7,1);break;case 19:h(e.fb,4,5,6,7,1),h(e.ud,0,7,6,1,1),h(e.rl,1,4,7,2,1)}}function Eg(e,t,r){let n,o=(t.ct[0]>t.ct[8]?1:0)^(t.ct[8]>t.ct[16]?1:0)^(t.ct[0]>t.ct[16]?1:0)?1:0;for(n=0;n<8;++n)e.ud[n]=t.ct[n]&1^1,e.fb[n]=t.ct[n+8]&1^1,e.rl[n]=t.ct[n+16]&1^1^o;e.parity=o^r}function BR(e,t){let r,n,o,l;for(e.parity=t&1,t>>>=1,o=Ba[t%12],t=~~(t/12),l=4,r=7;r>=0;--r)e.rl[r]=0,o>=Re[r][l]&&(o-=Re[r][l--],e.rl[r]=1);for(n=t%35,t=~~(t/35),l=4,e.fb[7]=0,r=6;r>=0;--r)n>=Re[r][l]?(n-=Re[r][l--],e.fb[r]=1):e.fb[r]=0;for(l=4,e.ud[7]=0,r=6;r>=0;--r)t>=Re[r][l]?(t-=Re[r][l--],e.ud[r]=1):e.ud[r]=0}function La(){this.ud=O(8),this.rl=O(8),this.fb=O(8)}function RR(){let e,t,r,n;for(r=0;r<12;++r)Ra[Ba[r]]=r;let o=new La;for(r=0;r<29400;++r)for(n=0;n<20;++n)BR(o,r),LR(o,n),fl[r][n]=ma(o)&65535;for(s0(zr),zr[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(zr[r]===e)for(n=0;n<17;++n)zr[fl[r][n]]===-1&&(zr[fl[r][n]]=e+1,++t);++e}}function dR(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function hR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.ct,16,17,18,19,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.ct,20,21,22,23,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break;case 7:h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break;case 10:h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function da(){let e;for(this.ct=O(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function kg(e){let t,r,n;for(da.call(this),t=0;t<23;++t)n=t+e(24-t),this.ct[n]!==this.ct[t]&&(r=this.ct[t],this.ct[t]=this.ct[n],this.ct[n]=r)}function FR(){ag||(ag=!0,Ut=O(18),yR())}function zg(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function Cg(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function DR(e,t){!e.temps&&(e.temps=new o0),Pg(e,Ut[t],e.temps),Cg(e,e.temps)}function AR(e,t){let r,n;for(n=0,r=6;r>=0;--r)n+=e.co[r]=t%3,t=~~(t/3);e.co[7]=(15-n)%3}function Pg(e,t,r){let n,o,l,i;for(n=0;n<8;++n)r.cp[n]=e.cp[t.cp[n]],l=e.co[t.cp[n]],i=t.co[n],o=l,o=o+(l<3?i:6-i),o=o%3,(l>=3?1:0)^(i>=3?1:0)&&(o=o+3),r.co[n]=o}function o0(){zg(this)}function kr(e,t){zg(this),X1(this.cp,e),AR(this,t)}function Mg(e){kr.call(this,e(40320),e(2187))}function yR(){let e,t;for(Ut[0]=new kr(15120,0),Ut[3]=new kr(21021,1494),Ut[6]=new kr(8064,1236),Ut[9]=new kr(9,0),Ut[12]=new kr(1230,412),Ut[15]=new kr(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)Ut[e+t+1]=new o0,Pg(Ut[e+t],Ut[e],Ut[e+t+1])}function UR(){fg||(fg=!0,Mt=O(1937880),l0=O(1538),Xi=O(1538),Bo=O(11880),Ig=[0,1,6,3,4,5,2,7],Fa=O(160,12),Da=O(160,12),ha=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],oa=[0,2,4,6,1,3,7,5,8,9,10,11])}function oo(e,t,r,n,o){let l=e.edgeo[o];e.edgeo[o]=e.edge[n],e.edge[n]=e.edgeo[r],e.edgeo[r]=e.edge[t],e.edge[t]=l}function co(e,t){let r,n,o,l,i;for(e.isStd||Og(e),n=0,i=1985229328,l=47768,r=0;r<t;++r)o=e.edge[r]<<2,n*=12-r,o>=32?(n+=l>>o-32&15,l-=4368<<o-32):(n+=i>>o&15,l-=4369,i-=286331152<<o);return n}function Ng(e){let t,r=co(e,4);t=Bo[r];let n=t&7;t>>=3,Yi(e,n);let o=co(e,10)%20160;return t*20160+o}function Ji(e,t){switch(e.isStd=!1,t){case 0:ue(e.edge,0,4,1,5),ue(e.edgeo,0,4,1,5);break;case 1:De(e.edge,0,4,1,5),De(e.edgeo,0,4,1,5);break;case 2:ue(e.edge,0,5,1,4),ue(e.edgeo,0,5,1,4);break;case 3:De(e.edge,5,10,6,11),De(e.edgeo,5,10,6,11);break;case 4:ue(e.edge,0,11,3,8),ue(e.edgeo,0,11,3,8);break;case 5:De(e.edge,0,11,3,8),De(e.edgeo,0,11,3,8);break;case 6:ue(e.edge,0,8,3,11),ue(e.edgeo,0,8,3,11);break;case 7:ue(e.edge,2,7,3,6),ue(e.edgeo,2,7,3,6);break;case 8:De(e.edge,2,7,3,6),De(e.edgeo,2,7,3,6);break;case 9:ue(e.edge,2,6,3,7),ue(e.edgeo,2,6,3,7);break;case 10:De(e.edge,4,8,7,9),De(e.edgeo,4,8,7,9);break;case 11:ue(e.edge,1,9,2,10),ue(e.edgeo,1,9,2,10);break;case 12:De(e.edge,1,9,2,10),De(e.edgeo,1,9,2,10);break;case 13:ue(e.edge,1,10,2,9),ue(e.edgeo,1,10,2,9);break;case 14:De(e.edge,0,4,1,5),De(e.edgeo,0,4,1,5),ue(e.edge,9,11),ue(e.edgeo,8,10);break;case 15:De(e.edge,5,10,6,11),De(e.edgeo,5,10,6,11),ue(e.edge,1,3),ue(e.edgeo,0,2);break;case 16:De(e.edge,0,11,3,8),De(e.edgeo,0,11,3,8),ue(e.edge,5,7),ue(e.edgeo,4,6);break;case 17:De(e.edge,2,7,3,6),De(e.edgeo,2,7,3,6),ue(e.edge,8,10),ue(e.edgeo,9,11);break;case 18:De(e.edge,4,8,7,9),De(e.edgeo,4,8,7,9),ue(e.edge,0,2),ue(e.edgeo,1,3);break;case 19:De(e.edge,1,9,2,10),De(e.edgeo,1,9,2,10),ue(e.edge,4,6),ue(e.edgeo,5,7)}}function fo(e,t){switch(e.isStd=!1,t){case 0:Ji(e,14),Ji(e,17);break;case 1:oo(e,11,5,10,6),oo(e,5,10,6,11),oo(e,1,2,3,0),oo(e,4,9,7,8),oo(e,8,4,9,7),oo(e,0,1,2,3);break;case 2:yt(e,4,5),yt(e,5,4),yt(e,11,8),yt(e,8,11),yt(e,7,6),yt(e,6,7),yt(e,9,10),yt(e,10,9),yt(e,1,1),yt(e,0,0),yt(e,3,3),yt(e,2,2)}}function Yi(e,t){for(;t>=2;)t-=2,fo(e,1),fo(e,2);t!==0&&fo(e,0)}function Ll(e,t){let r,n,o,l,i,s;for(i=1985229328,s=47768,o=0,r=0;r<11;++r)if(n=ha[11-r],l=~~(t/n),t=t%n,o^=l,l<<=2,l>=32){l=l-32,e.edge[r]=s>>l&15;let a=(1<<l)-1;s=(s&a)+(s>>4&~a)}else{e.edge[r]=i>>l&15;let a=(1<<l)-1;i=(i&a)+(i>>>4&~a)+(s<<28),s=s>>4}for((o&1)===0?e.edge[11]=i:(e.edge[11]=e.edge[10],e.edge[10]=i),r=0;r<12;++r)e.edgeo[r]=r;e.isStd=!0}function ug(e,t){let r;for(r=0;r<12;++r)e.edge[r]=t.edge[r],e.edgeo[r]=t.edgeo[r];e.isStd=t.isStd}function Tg(e,t){let r,n,o,l;for(e.temp===null&&(e.temp=O(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[oa[r]+12]%12;for(n=1,r=0;r<12;++r)for(;e.edge[r]!==r;)l=e.edge[r],e.edge[r]=e.edge[l],e.edge[l]=l,o=e.temp[r],e.temp[r]=e.temp[l],e.temp[l]=o,n^=1;for(r=0;r<12;++r)e.edge[r]=e.temp[t.ep[oa[r]]%12];return n}function Og(e){let t;for(e.temp===null&&(e.temp=O(12)),t=0;t<12;++t)e.temp[e.edgeo[t]]=t;for(t=0;t<12;++t)e.edge[t]=e.temp[e.edge[t]],e.edgeo[t]=t;e.isStd=!0}function De(e,t,r,n,o){let l;l=e[t],e[t]=e[n],e[n]=l,l=e[r],e[r]=e[o],e[o]=l}function yt(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function ar(){this.edge=O(12),this.edgeo=O(12)}function xR(){let e,t,r,n,o,l,i,s,a,f,u,g,p,c,L,m,R,F,A,U,b,S,M=new ar,J=new ar,C=new ar;for(s0(Mt),s=0,Ni=1,ea(Mt,0,0);Ni!==31006080&&(L=s>9,i=s%3,l=(s+1)%3,f=L?3:i,e=L?i:3,!(s>=9));){for(g=0;g<31006080;g+=16)if(S=Mt[~~g>>4],!(!L&&S===-1)){for(u=g,a=g+16;u<a;++u,S>>=2)if((S&3)===f){for(A=~~(u/20160),t=l0[A],n=u%20160,Ll(M,t*20160+n),R=0;R<17;++R)if(r=mo(M.edge,R<<3,4),U=Bo[r],b=U&7,U>>=3,o=mo(M.edge,R<<3|b,10)%20160,p=U*20160+o,cl(Mt,p)===e){if(ea(Mt,L?u:p,l),++Ni,L)break;if(F=Xi[U],F!==1)for(ug(J,M),Ji(J,R),Yi(J,b),m=1;(F=~~F>>1&65535)!==0;++m)(F&1)===1&&(ug(C,J),Yi(C,m),c=U*20160+co(C,10)%20160,cl(Mt,c)===e&&(ea(Mt,c,l),++Ni))}}}++s}}function cl(e,t){return e[t>>4]>>((t&15)<<1)&3}function mo(e,t,r){let n,o,l,i,s,a=Da[t],f=Fa[t];for(o=0,s=1985229328,i=47768,n=0;n<r;++n)l=a[e[f[n]]]<<2,o*=12-n,l>=32?(o+=i>>l-32&15,i-=4368<<l-32):(o+=s>>l&15,i-=4369,s-=286331152<<l);return o}function Gg(e){let t,r,n,o,l,i,s,a,f,u,g,p=new ar;if(i=0,l=cl(Mt,e),l===3)return 10;for(;e!==0;)for(l===0?l=2:--l,f=~~(e/20160),t=l0[f],n=e%20160,Ll(p,t*20160+n),a=0;a<17;++a)if(r=mo(p.edge,a<<3,4),u=Bo[r],g=u&7,u>>=3,o=mo(p.edge,a<<3|g,10)%20160,s=u*20160+o,cl(Mt,s)===l){++i,e=s;break}return i}function bR(e,t){let r=cl(Mt,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function SR(){let e,t,r,n=new ar;for(t=0;t<20;++t)for(r=0;r<8;++r){for(Ll(n,0),Ji(n,t),Yi(n,r),e=0;e<12;++e)Fa[t<<3|r][e]=n.edge[e];for(Og(n),e=0;e<12;++e)Da[t<<3|r][e]=n.temp[e]}}function wR(){let e,t,r,n,o=new ar,l=O(1485);for(t=0;t<1485;t++)l[t]=0;for(e=0,t=0;t<11880;++t)if((l[~~t>>>3]&1<<(t&7))===0){for(Ll(o,t*ha[8]),n=0;n<8;++n)r=co(o,4),r===t&&(Xi[e]=(Xi[e]|1<<n)&65535),l[~~r>>3]=l[~~r>>3]|1<<(r&7),Bo[r]=e<<3|Ig[n],fo(o,0),n%2===1&&(fo(o,1),fo(o,2));l0[e++]=t}}function ea(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function vR(){gg||(gg=!0)}function ER(e){let t,r,n;for(t=0,n=!1,r=0;r<12;++r)t|=1<<e.ep[r],n=n!==e.ep[r]>=12;return t&=~~t>>12,t===0&&!n}function _R(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function kR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r);break;case 1:h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r);break;case 2:h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r);break;case 3:h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r);break;case 4:h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r);break;case 5:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r);break;case 6:h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r),h(e.ep,9,22,11,20,r);break;case 7:h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r),h(e.ep,2,16,6,12,r);break;case 8:h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r),h(e.ep,3,19,5,13,r);break;case 9:h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r),h(e.ep,8,23,10,21,r);break;case 10:h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r),h(e.ep,14,0,18,4,r);break;case 11:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r),h(e.ep,7,15,1,17,r)}}function Aa(){let e;for(this.ep=O(24),e=0;e<24;++e)this.ep[e]=e}function Wg(e){let t,r,n;for(Aa.call(this),t=0;t<23;++t)n=t+e(24-t),n!==t&&(r=this.ep[t],this.ep[t]=this.ep[n],this.ep[n]=r)}function zR(){pg||(pg=!0,la=[35,1,34,2,4,6,22,5,19])}function Kg(e){e.moveBuffer=O(60)}function CR(e,t){return e.value-t.value}function Lo(e,t){let r;for(_R(e.edge,t.edge),dR(e.center,t.center),Cg(e.corner,t.corner),e.value=t.value,e.add1=t.add1,e.length1=t.length1,e.length2=t.length2,e.length3=t.length3,e.sym=t.sym,r=0;r<60;++r)e.moveBuffer[r]=t.moveBuffer[r];e.moveLength=t.moveLength,e.edgeAvail=t.edgeAvail,e.centerAvail=t.centerAvail,e.cornerAvail=t.cornerAvail}function Cr(e){for(;e.centerAvail<e.moveLength;)hR(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function Qg(e){for(;e.cornerAvail<e.moveLength;)DR(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function ml(e){for(;e.edgeAvail<e.moveLength;)kR(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function PR(e){let t,r,n,o,l,i,s=new Array(e.moveLength-(e.add1?2:0));for(r=0,t=0;t<e.length1;++t)s[r++]=e.moveBuffer[t];for(i=e.sym,t=e.length1+(e.add1?2:0);t<e.moveLength;++t)Pt[i][e.moveBuffer[t]]>=27?(s[r++]=Pt[i][e.moveBuffer[t]]-9,o=la[Pt[i][e.moveBuffer[t]]-27],i=ao[i][o]):s[r++]=Pt[i][e.moveBuffer[t]];let a=ao[so[i]][aR(Cr(e))];for(l="",i=a,t=r-1;t>=0;--t)n=s[t],n=~~(n/3)*3+(2-n%3),Pt[i][n]>=27?(l=l+ia[Pt[i][n]-9]+" ",o=la[Pt[i][n]-27],i=ao[i][o]):l=l+ia[Pt[i][n]]+" ";return l}function gn(e,t){e.moveBuffer[e.moveLength++]=t}function $i(){Kg(this),this.edge=new Aa,this.center=new da,this.corner=new o0}function i0(e){$i.call(this),Lo(this,e)}function jg(e){Kg(this),this.edge=new Wg(e),this.center=new kg(e),this.corner=new Mg(e)}function MR(e,t){return t.value-e.value}function e0(e,t){return MR(e,t)}function qg(){}function NR(){if(cg)return;cg=!0;let e,t;for(ia=["U ","U2 ","U' ","R ","R2 ","R' ","F ","F2 ","F' ","D ","D2 ","D' ","L ","L2 ","L' ","B ","B2 ","B' ","Uw ","Uw2","Uw'","Rw ","Rw2","Rw'","Fw ","Fw2","Fw'","Dw ","Dw2","Dw'","Lw ","Lw2","Lw'","Bw ","Bw2","Bw'"],pn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,21,22,23,25,28,30,31,32,34,36],sl=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],mg=O(37),Lg=O(37),lo=O(37,36),Ii=O(29,28),Wi=O(21,20),ta=O(36),ul=O(28),uo=O(20),e=0;e<29;++e)mg[pn[e]]=e;for(e=0;e<21;++e)Lg[sl[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)lo[e][t]=~~(e/3)===~~(t/3)||~~(e/3)%3===~~(t/3)%3&&e>t;lo[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)Ii[e][t]=lo[pn[e]][pn[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)Wi[e][t]=lo[sl[e]][sl[t]];for(e=0;e<36;++e)for(ta[e]=36,t=e;t<36;++t)if(!lo[e][t]){ta[e]=t-1;break}for(e=0;e<28;++e)for(ul[e]=28,t=e;t<28;++t)if(!Ii[e][t]){ul[e]=t-1;break}for(e=0;e<20;++e)for(uo[e]=20,t=e;t<20;++t)if(!Wi[e][t]){uo[e]=t-1;break}}function TR(e){let t,r,n,o,l,i,s,a,f,u,g,p;e.solution="";let c=Ti(new Gi(Cr(e.c),0)),L=Ti(new Gi(Cr(e.c),1)),m=Ti(new Gi(Cr(e.c),2)),R=Nt[~~c>>6],F=Nt[~~L>>6],A=Nt[~~m>>6];for(e.p1SolsCnt=0,e.arr2idx=0,VR(e.p1sols.heap),e.length1=(R<F?R:F)<A?R<F?R:F:A;e.length1<100&&!(A<=e.length1&&Ki(e,~~m>>>6,m&63,e.length1,-1,0)||R<=e.length1&&Ki(e,~~c>>>6,c&63,e.length1,-1,0)||F<=e.length1&&Ki(e,~~L>>>6,L&63,e.length1,-1,0));++e.length1);let U=od(e.p1sols,fa(id,Mr([JB,sa,aa]),Dg,0,0));U.sort(function(M,J){return M.value-J.value}),t=9;do{e:for(a=U[0].value;a<100;++a)for(i=0;i<U.length&&!(U[i].value>a);++i)if(!(a-U[i].length1>t)&&(Lo(e.c1,U[i]),bg(e.ct2,Cr(e.c1),t0(ml(e.c1).ep)),g=qi(e.ct2),p=Vi(e.ct2),e.length1=U[i].length1,e.length2=a-U[i].length1,Vg(e,g,p,e.length2,28,0)))break e;++t}while(a===100);e.arr2.sort(function(M,J){return M.value-J.value}),s=0,r=13;do{e:for(f=e.arr2[0].value;f<100;++f)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>f);++i)if(!(f-e.arr2[i].length1-e.arr2[i].length2>r)&&(l=Tg(e.e12,ml(e.arr2[i])),Eg(e.ct3,Cr(e.arr2[i]),l^t0(Qg(e.arr2[i]).cp)),n=ma(e.ct3),o=co(e.e12,10),u=Gg(Ng(e.e12)),u<=f-e.arr2[i].length1-e.arr2[i].length2&&Hg(e,o,n,u,f-e.arr2[i].length1-e.arr2[i].length2,20,0))){s=i;break e}++r}while(f===100);let b=new i0(e.arr2[s]);e.length1=b.length1,e.length2=b.length2;let S=f-e.length1-e.length2;for(i=0;i<S;++i)gn(b,sl[e.move3[i]]);e.solution=PR(b)}function OR(e,t){let r,n;for(Lo(e.c1,e.c),r=0;r<e.length1;++r)gn(e.c1,e.move1[r]);switch(pa[t]){case 0:gn(e.c1,24),gn(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break;case 12869:gn(e.c1,18),gn(e.c1,29),e.move1[e.length1]=18,e.move1[e.length1+1]=29,e.add1=!0,t=34;break;case 735470:e.add1=!1,t=0}bg(e.ct2,Cr(e.c1),t0(ml(e.c1).ep));let o=qi(e.ct2),l=Vi(e.ct2),i=nt[o*70+l];return e.c1.value=i+e.length1,e.c1.length1=e.length1,e.c1.add1=e.add1,e.c1.sym=t,++e.p1SolsCnt,e.p1sols.heap.size<500?n=new i0(e.c1):(n=rd(e.p1sols),n.value>e.c1.value&&Lo(n,e.c1)),QR(e.p1sols,n),e.p1SolsCnt===1e4}function GR(e){let t;for(Lo(e.c2,e.c1),t=0;t<e.length2;++t)gn(e.c2,e.move2[t]);if(!ER(ml(e.c2)))return!1;let r=Tg(e.e12,ml(e.c2));Eg(e.ct3,Cr(e.c2),r^t0(Qg(e.c2).cp));let n=ma(e.ct3);co(e.e12,10);let o=Gg(Ng(e.e12));return e.arr2[e.arr2idx]?Lo(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new i0(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(o,zr[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function IR(e,t){return Jg(),e.c=new jg(t),TR(e),e.solution}function Ki(e,t,r,n,o,l){let i,s,a,f,u,g;if(t===0)return n===0&&OR(e,r);for(i=0;i<27;i+=3)if(!(i===o||i===o-9||i===o-18))for(f=0;f<3;++f){if(a=i+f,s=r0[t][Pt[r][a]],u=Nt[~~s>>>6],u>=n){if(u>n)break;continue}if(g=ao[r][s&63],s>>>=6,e.move1[l]=a,Ki(e,s,g,n-1,i,l+1))return!0}return!1}function Vg(e,t,r,n,o,l){let i,s,a,f;if(t===0&&nt[r]===0)return n===0&&GR(e);for(s=0;s<23;++s){if(Ii[o][s]){s=ul[s];continue}if(i=Hi[t][s],f=Zi[r][s],a=nt[i*70+f],a>=n){a>n&&(s=ul[s]);continue}if(e.move2[l]=pn[s],Vg(e,i,f,n-1,s,l+1))return!0}return!1}function Hg(e,t,r,n,o,l,i){let s,a,f,u,g,p,c,L,m;if(o===0)return t===0&&r===0;for(Ll(e.tempe[i],t),g=0;g<17;++g){if(Wi[l][g]){g=uo[g];continue}if(f=fl[r][g],p=zr[f],p>=o){p>o&&g<14&&(g=uo[g]);continue}if(u=mo(e.tempe[i].edge,g<<3,10),s=~~(u/20160),L=Bo[s],m=L&7,L>>=3,a=mo(e.tempe[i].edge,g<<3|m,10)%20160,c=bR(L*20160+a,n),c>=o){c>o&&g<14&&(g=uo[g]);continue}if(Hg(e,u,f,c,o-1,g,i+1))return e.move3[i]=g,!0}return!1}function Zg(){let e;for(this.p1sols=new rp(new qg),this.move1=O(15),this.move2=O(20),this.move3=O(20),this.c1=new $i,this.c2=new $i,this.ct2=new ca,this.ct3=new La,this.e12=new ar,this.tempe=O(20),this.arr2=O(100),e=0;e<20;++e)this.tempe[e]=new ar}function Jg(){Bg||(fR(),po=O(735471),uR(),iR(),po=null,sR(),cR(),RR(),SR(),wR(),xR(),Bg=!0)}function WR(){Rg||(Rg=!0)}function t0(e){let t,r,n,o;for(o=0,t=0,n=e.length;t<n;++t)for(r=t;r<n;++r)e[t]>e[r]&&(o^=1);return o}function h(e,t,r,n,o,l){let i;switch(l){case 0:i=e[o],e[o]=e[n],e[n]=e[r],e[r]=e[t],e[t]=i;return;case 1:i=e[t],e[t]=e[n],e[n]=i,i=e[r],e[r]=e[o],e[o]=i;return;case 2:i=e[t],e[t]=e[r],e[r]=e[n],e[n]=e[o],e[o]=i;return}}function Yg(){}function Xg(e,t,r,n){let o=new Yg;return o.typeName=e+t,ep(r!==0?-r:0)&&tp(r!==0?-r:0,o),o.modifiers=4,o.superclass=ya,o.componentType=n,o}function $g(e,t,r,n){let o=new Yg;return o.typeName=e+t,ep(r)&&tp(r,o),o.superclass=n,o}function KR(e){let t=gl[e.seedId];return e=null,t}function ep(e){return typeof e=="number"&&e>0}function tp(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=KR(t);if(n)r=n.prototype;else{n=gl[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function QR(e,t){if(td(e,t))return!0}function jR(e){e.array=fa(np,Mr([sa,aa]),hg,0,0)}function qR(e,t){return Qi(e.array,e.size++,t),!0}function VR(e){e.array=fa(np,Mr([sa,aa]),hg,0,0),e.size=0}function Pr(e,t){return e.array[t]}function HR(e,t){let r=e.array[t];return YR(e.array,t,1),--e.size,r}function go(e,t,r){let n=e.array[t];return Qi(e.array,t,r),n}function ZR(e,t){let r;for(t.length<e.size&&(t=eR(t,e.size)),r=0;r<e.size;++r)Qi(t,r,e.array[r]);return t.length>e.size&&Qi(t,e.size,null),t}function JR(){jR(this),this.array.length=500}function YR(e,t,r){e.splice(t,r)}function XR(e,t){let r,n,o,l;for(n=0,r=e.length-1;n<=r;)if(o=n+(~~(r-n)>>1),l=e[o],l<t)n=o+1;else if(l>t)r=o-1;else return o;return-n-1}function s0(e){$R(e,e.length)}function $R(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function ed(e,t){let r,n,o,l,i=e.heap.size,s=Pr(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,o=n+1,l=n,o<i&&e0(Pr(e.heap,o),Pr(e.heap,n))<0&&(l=o),l),!(e0(s,Pr(e.heap,r))<0));)go(e.heap,t,Pr(e.heap,r)),t=r;go(e.heap,t,s)}function td(e,t){let r,n;for(n=e.heap.size,qR(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),e0(Pr(e.heap,n),t)<=0)return go(e.heap,r,t),!0;go(e.heap,r,Pr(e.heap,n))}return go(e.heap,n,t),!0}function rd(e){if(e.heap.size===0)return null;let t=Pr(e.heap,0);return nd(e),t}function nd(e){let t=HR(e.heap,e.heap.size-1);0<e.heap.size&&(go(e.heap,0,t),ed(e,0))}function od(e,t){return ZR(e.heap,t)}function rp(e){this.heap=new JR,this.cmp=e}function lp(){dg||(dg=!0,NR(),WR(),lR(),pR(),mR(),UR(),FR(),vR(),zR(),op=new Zg)}function sd(){lp(),Jg()}async function ad(){we(),lp();let e=E.fromString(IR(op,await ve()));return(await ro()).concat(e)}var Z,gl,VB,hg,sa,Fg,HB,ZB,Dg,JB,YB,XB,aa,eg,ra,na,tg,Nt,r0,pa,po,n0,so,Pt,ao,og,Hi,nt,Sg,wg,Zi,vg,sg,fl,_g,zr,Ba,Ra,ag,Ut,fg,oa,Ni,Mt,ha,Fa,Da,Bo,l0,Ig,Xi,gg,pg,la,cg,lo,Ii,Wi,pn,ia,sl,ta,ul,uo,mg,Lg,Bg,Rg,ya,np,ld,id,op,dg,ip=y(()=>{Be();Xs();$1();Dt();Ft();gl={},VB={},hg=0,sa=30,Fg=21,HB=22,ZB=23,Dg=24,JB=25,YB=34,XB=26,aa=40;mt(1,-1,VB);Z.value=null;mt(73,1,{},Ag);Z.queryId$=0;eg=!1;tg=!1;mt(153,1,Mr([Fg]),pl,Gi,al);po=null,og=!1;mt(154,1,{},ca);Z.parity=0;sg=!1;mt(155,1,{},La);Z.parity=0;mt(156,1,{},da,kg);ag=!1;mt(157,1,Mr([HB]),o0,kr,Mg);Z.temps=null;fg=!1;mt(158,1,Mr([ZB]),ar);Z.isStd=!0;Z.temp=null;Ni=0,gg=!1;mt(159,1,{},Aa,Wg);pg=!1;mt(160,1,Mr([Dg,YB]),$i,i0,jg);Z.compareTo$=function(t){return CR(this,t)};Z.add1=!1;Z.center=null;Z.centerAvail=0;Z.corner=null;Z.cornerAvail=0;Z.edge=null;Z.edgeAvail=0;Z.length1=0;Z.length2=0;Z.length3=0;Z.moveLength=0;Z.sym=0;Z.value=0;mt(161,1,{},qg);Z.compare=function(t,r){return e0(t,r)};cg=!1;mt(163,1,Mr([XB]),Zg);Z.add1=!1;Z.arr2idx=0;Z.c=null;Z.length1=0;Z.length2=0;Z.p1SolsCnt=0;Z.solution="";Bg=!1,Rg=!1;Z.val$outerIter=null;Z.size=0;mt(239,1,{},rp);Z.cmp=null;Z.heap=null;ya=$g("java.lang.","Object",1,null),np=Xg("[Ljava.lang.","Object;",356,ya),ld=$g("cs.threephase.","FullCube",160,ya),id=Xg("[Lcs.threephase.","FullCube;",381,ld),dg=!1});var sp={};Bt(sp,{initialize:()=>sd,random444Scramble:()=>ad});var ap=y(()=>{ip()});function Rl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function a0(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function Fp(e,t,r,n,o=e-t-r-n){return a0(e,t+r)*a0(t+r,t)*a0(n+o,n)}function md(e){e=e.slice();let t=e.length,r=Rl(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Ld(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function Ca(e,t){let r=[],n=Rl(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function cn(e){return md(e)>>1}function _a(e,t){let r=[0];for(let n=1;n<e;n++){let o=t(n+1);r[n]=r[o],r[o]=n}return r}function cp(e,t){let r=_a(e,t);return Ld(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function Bd(e){return e|=0,31-Math.clz32(e^e-1)}function mp(e,t){e|=0,t|=0;let r=e+" "+t;if(ba[r])return ba[r];let n=a0(e,t),o=new Uint32Array(n),l=new Uint32Array(1<<e).fill(-1);for(let i=0,s=(1<<t)-1;i<n;i++){o[i]=s,l[s]=i;let a=s|s-1;s=a+1|(~a&-~a)-1>>Bd(s)+1}return ba[r]=[o,l]}function Rd(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function Lp(e){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,e}function dd(e,t){return Lp(e)|Lp(t)<<1}function Do(e,t,r,n,o){if(e|=0,t|=0,r|=0,n|=0,o|=0,e!==t+r+n+o)throw new Error("generate_comb4_lookup_tables: invalid parameters");let l=[e,t,r,n,o].join(" ");if(Sa[l])return Sa[l];let[i,s]=mp(e,r+o),[a,f]=mp(e,n+o),u=Fp(e,t,r,n,o),g=new Uint32Array(u),p=new Uint32Array(4**e).fill(-1);for(let c=0,L=0;c<a.length;c++){let m=a[c];for(let R=0;R<i.length;R++){let F=i[R];if(Rd(F&m)===o){let A=dd(F,m);g[L]=A,p[A]=L,L++}}}return Sa[l]=[g,p]}function Ye(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Ao(e,t,r){let n=[];for(let o=0;o<r.length;o++)n[o]=e[t[r[o]]];return n}function Pa(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n of e)for(let o=0;o<n.length;o++)r[n[o]]=n[(o+1)%n.length];return r}function mn(e,t){let r=e.length,n=Array(r).fill(0);for(let i=1;i<r;i++)n[i]=n[i-1]+t[i-1];let o=n[r-1]+t[r-1],l=Array(o);for(let i=0;i<r;i++)t[i]&&(l[n[i]]=n[e[i]]);return l}function Ma(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function hd(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function Fd(e,t){return e*t/hd(e,t)}function Dd(e){let t=1,r=e.length,n=Array(r).fill(!1),o=-1;for(;o=n.indexOf(!1,o+1),o!==-1;){let l=0,i=o;for(;!n[i];)n[i]=!0,i=e[i],l++;t=Fd(t,l)}return t}function vd(e,t){for(let r=0;r<6;r++){if(e===Tt[Nr[r][0]]&&t===Tt[Nr[r][2]])return[r,0];if(e===Tt[Nr[r][2]]&&t===Tt[Nr[r][0]])return[r,1]}throw new Error("unknown corner piece")}function Ed(e,t){for(let r=0;r<12;r++)if(e===Tt[Tr[r][0]]&&t===Tt[Tr[r][1]]||t===Tt[Tr[r][0]]&&e===Tt[Tr[r][1]])return r;throw new Error("unknown edge piece")}function Na(e,t){return vd(e[Nr[t][0]],e[Nr[t][2]])}function m0(e,t){return Ed(e[Tr[t][0]],e[Tr[t][1]])}function _d(e,t,r,n){let o=Nr[t],l=Nr[r].map(i=>Tt[i]);n%2!==0&&(l=[l[2],l[3],l[0],l[1]]);for(let i=0;i<4;i++)e[o[i]]=l[i]}function kd(e,t,r){let n=Tr[t],o=Tr[r].map(l=>Tt[l]);for(let l=0;l<2;l++)e[n[l]]=o[l]}function yp(e){let t=e.map(a=>Tt[a]),n=Array(6).fill().map((a,f)=>Na(t,f)).map(([a,f])=>a+6*f),o=n.concat(n.map(a=>(a+6)%12)),l=Array(12).fill().map((a,f)=>m0(t,f)),i=Array(12).fill().map((a,f)=>Ln.indexOf(e[Ln[f]])),s=Array(12).fill().map((a,f)=>Ro.indexOf(e[Ro[f]]));return{cp:o,ep:l,ap:i,bp:s}}function Cd(e){let t=Array(72),r=cp(5,e);r.push(5);let n=Array(4).fill().map(s=>e(2));n.push(n.reduce((s,a)=>s^a)),n.push(0);for(let s=0;s<6;s++)_d(t,s,r[s],n[s]);let o=cp(12,e);for(let s=0;s<12;s++)kd(t,s,o[s]);let l=_a(12,e).map(s=>s/3|0),i=_a(12,e).map(s=>4+(s/3|0));for(let s=0;s<12;s++)t[Ln[s]]=l[s],t[Ro[s]]=i[s];return t}function xp(e,t=!1){if(t){e=e.map(m=>m.slice());let c=[0,1,2,3,4,5,6,7],L=[[0,3,5,6,4,7,1,2],[7,1,0,6,3,5,4,2],[7,4,2,1,3,0,6,5],[2,4,5,3,6,0,1,7]];L=L.concat(L.map(m=>Ma(m)));for(let m=0;m<e.length;m++)if(e[m][0]<4)e[m][0]=c[e[m][0]];else{let R=c[e[m][0]],F=e[m][1];e[m][0]=R,c=Ye(F===1?L[R^4]:L[R],c)}}let r=t?"U L F R D BR B BL".split(" "):zd,n=["0","","'"];return e.map(([l,i])=>r[l]+n[i]).join(" ")}function Or(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=Ye(e,Up[r]);return e}function bp(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function g0(e,t=!1){if(e.length===0)return[];let r=[],n;for(let[o,l]of e)n&&n[0]===o?(n[1]+=l,n[1]%=3,n[1]===0&&(r.pop(),n=r.length===0?void 0:r[r.length-1])):r.length>=2&&(n[0]^o)===4&&r[r.length-2][0]===o?(r[r.length-2][1]+=l,r[r.length-2][1]%=3,r[r.length-2][1]===0&&r.splice(r.length-2,1)):(n=[o,l],r.push(n));return t&&""+e!=""+r&&console.log(\`simplified \${e} to \${r}\`),r}function Pd(e){return xp(bp(Td(Cd(e),!0)),!0)}function ho(e,t,r,n,o,l){let i=Fp(e,t,r,n,o),s=l.length,[a,f]=Do(e,t,r,n,o),u=Array(s).fill().map(()=>new Uint32Array(i));for(let g=0;g<i;g++){let p=a[g],c=Array(e);for(let L=0;L<e;L++)c[L]=p>>2*L&3;for(let L=0;L<s;L++){let R=Ye(c,l[L]).reduce((F,A,U)=>F|A<<2*U,0);u[L][g]=f[R]}}return u}function Sp(e){let t=e[0].length,r=e.length,n=Array(r).fill().map(()=>new Uint32Array(t));for(let o=0;o<t;o++)for(let l=0;l<r;l++)n[l][e[l][o]]=o;return n}function Rn(e,t){let r=e[0].length,n=t[0].length,o=e.length,l=Array(o).fill().map(()=>new Uint32Array(r*n));for(let i=0;i<n;i++)for(let s=0;s<r;s++){let a=s+r*i;for(let f=0;f<o;f++)l[f][a]=e[f][s]+r*t[f][i]}return l}function Md(e,t){let r=e.length,n=e[0].length,o=new Uint8Array(n);o[t]=1;let l=!1;for(;!l;){l=!0;for(let s=0;s<n;s++)if(!!o[s])for(let a=0;a<r;a++)o[e[a][s]]||(o[e[a][s]]=1,l=!1)}let i=new Int32Array(n).fill(-1);for(let s=0,a=0;s<n;s++)!o[s]||(i[s]=a,a++);return[e.map(s=>mn(s,o)),i]}function Nd(e,t){let r=e.length,n=e[0].length,o=new Int32Array(n).fill(-1);t.forEach(a=>{o[a]=0});let l=[t];for(let a=0;a<l.length;a++){let f=l[a];for(let u=0;u<r;u++){let g=e[u][f[0]];if(o[g]!==-1)continue;let p=f.map(L=>e[u][L]),c=l.length;l.push(p);for(let L of p){if(o[L]!==-1)throw new Error("quotienting failed");o[L]=c}}}let i=l.length,s=Array(r).fill().map(()=>new Int32Array(i));for(let a=0;a<r;a++)for(let f=0;f<i;f++)s[a][f]=o[e[a][l[f][0]]];return[s,o]}function wp(e,t,r){let n=e[0].length,o=e.length,l=new Int32Array(n).fill(-1);l[t]=r,l[r]=t;let i=!1;for(;!i;){i=!0;for(let s=0;s<n;s++){if(l[s]===-1)continue;let a=l[s];for(let f=0;f<o;f++){let u=f^1,g=e[f][s],p=e[u][e[u][a]];if(l[g]===-1)i=!1,l[g]=p,l[p]=g;else if(l[g]!==p)throw new Error("mirroring failed - is the initial map correct?")}}}return l}function vp(e,t){let r=e[0].length,n=e.length,o=new Int8Array(r).fill(-1);for(let s of t)o[s]=0;let l=0,i=!1;for(;!i;){i=!0;for(let s=0;s<r;s++)if(o[s]===l)for(let a=0;a<n;a++){let f=e[a][s];for(;f!==s;)o[f]===-1&&(i=!1,o[f]=l+1),f=e[a][f]}l++}return o}function Td(e,t=!1){let r=Kd(e).next().value,n=Or(e,r),o=(t?lh:oh)(n),l=g0(r.concat(o),!1);return Or(e,l).join("")!==dl.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(o),console.log(Or(e,l))),l}function Gd(e){let[t,r]=Do(12,6,0,3,3),n=Array(12).fill().map((s,a)=>m0(e,a)),o=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[l,i]=[Ln,Ro].map(s=>{let a=s.map(f=>Od[e[f]]);return r[a.reduce((f,u,g)=>f|u<<2*g,0)]});return[o,l,i]}function Ep(){if(K.phase1_edge)return K.phase1_edge;let e=Sp(Bn.map(n=>n.ep)),t=Rn(e,e),r=Rn(t,t);return K.phase1_edge=r}function Id(){return ur.phase1_edge?ur.phase1_edge:ur.phase1_edge=vp(Ep(),[8+12*9+12**2*10+12**3*11])}function Wd(){return K.phase1_centreA?K.phase1_centreA:K.phase1_centreA=ho(12,6,0,3,3,Bn.map(e=>e.ap))}function _p(){return K.phase1_centreB?K.phase1_centreB:K.phase1_centreB=ho(12,6,0,3,3,Bn.map(e=>e.bp))}function Bp(){if(ur.phase1_centre)return ur.phase1_centre;let[e,t]=Do(12,6,0,3,3),r=e.filter(n=>{let o=n>>12&3,l=n>>18&3;return o===2&&l===3}).map(n=>t[n]);return ur.phase1_centre=vp(_p(),r)}function*Kd(e){let t=[Ep(),Wd(),_p()],r=[Id(),Bp(),Bp()];yield*Qd(Gd(e),t,r,15)}function*Qd(e,t,r,n){let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;)yield*kp(e,t,r,l,-1),l++}function*kp(e,t,r,n,o){let l=3,i=8,s=Math.max(r[0][e[0]],r[1][e[1]],r[2][e[2]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===o||a===o-4)continue;let f=[];f[0]=t[0][a][e[0]],f[1]=t[1][a][e[1]],f[2]=t[2][a][e[2]];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=kp(f,t,r,n-1,a);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[a,u]].concat(p)}f[0]=t[0][a][f[0]],f[1]=t[1][a][f[1]],f[2]=t[2][a][f[2]],u++}}}}function Ta(e){let[t,r]=Do(10,5,3,2,0),n=Array(8).fill().map((p,c)=>m0(e,c)),o=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),l=Array(5).fill().map((p,c)=>Na(e,c)),i=Ma(l.map(([p,c])=>p+5*c).concat(l.map(([p,c])=>p+5*(c^1)))),s=i.slice(0,5).map(p=>p%5),a=i.slice(0,5).map(p=>p/5|0),f=cn(s)*8+(a[0]^a[2])+2*(a[0]^a[3])+4*a[4],[u,g]=[Ln,Ro].map(p=>{let c=Ye(p,qd).map(L=>jd[e[L]]);return r[c.reduce((L,m,R)=>L|m<<2*R,0)]});return Pp(),Tp(),[u,g,Np[f]+40*Cp[o]]}function*p0(e){yield*Yd(Ta(e),30)}function zp(){if(K.phase2_centre)return K.phase2_centre;let e=ho(10,5,3,2,0,Bn.slice(0,4).map(r=>mn(r.ap,Rp))),t=ho(10,5,3,2,0,Bn.slice(0,4).map(r=>mn(r.bp,Rp)));return K.phase2_centre=[e,t]}function Pp(){if(K.phase2_edge)return K.phase2_edge;let e=Sp(Bn.slice(0,4).map(n=>n.ep.slice(0,8))),t=Rn(e,Rn(e,e)),r;return[r,Cp]=Md(t,501),K.phase2_edge=r}function Mp(){if(K.phase2_corner)return K.phase2_corner;let t=Rl(5)/2*8,r=[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!1],n=Array(4).fill().map(()=>new Uint32Array(t)),o=Bn.slice(0,4).map(l=>Ma(mn(l.cp,r)));for(let l=0;l<t;l++){let i=Ca(l>>3,5),s=[0,0,l&1,l>>1&1,l>>2&1];s[1]=s[2]^s[3]^s[4];let a=Array(10);for(let f=0;f<5;f++)a[f]=i[f]+5*s[f],a[f+5]=i[f]+5*(s[f]^1);for(let f=0;f<4;f++){let u=Ye(o[f],a),g=u.slice(0,5).map(L=>L%5),p=u.slice(0,5).map(L=>L/5|0),c=(p[0]^p[2])+2*(p[0]^p[3])+4*p[4];n[f][l]=cn(g)*8+c}}return K.phase2_corner=n}function Tp(){return K.phase2_corner_compact||([K.phase2_corner_compact,Np]=Nd(Mp(),Zd())),K.phase2_corner_compact}function Oa(){if(K.phase2_ce)return K.phase2_ce;let e=Tp(),t=Pp();return K.phase2_ce=Rn(e,t)}function Vd(){if(wa)return wa;let e=Ta(dl)[2];return wa=wp(Oa(),e,e)}function Hd(){let[e,t]=Do(10,5,3,2,0);return e.filter(r=>(r>>10&63)===41).map(r=>t[r])}function Zd(){let e=Mp(),t=e[0].length,r=Array(t).fill(!1);r[0]=!0;let n=!1;for(;!n;){n=!0;for(let o=0;o<t;o++)r[o]&&(r[e[0][o]]||(n=!1,r[e[0][o]]=!0),r[e[1][o]]||(n=!1,r[e[1][o]]=!0))}return r.map((o,l)=>l).filter(o=>r[o])}function Jd(){if(ur.phase2_ace)return ur.phase2_ace;let[e,t]=zp(),r=Oa(),n=2520,o=40*336,l=n*o,i=Ta(dl)[2],s=9,a=new Int8Array(l).fill(s);for(let f of Hd())a[f+n*i]=0;for(let f=0;f<s-1;f++)for(let u=a.indexOf(f);u!==-1;u=a.indexOf(f,u+1)){let g=u%n,p=u/n|0;for(let c=0;c<4;c++){let L=e[c][g],m=r[c][p],R=L+n*m;a[R]===s&&(a[R]=f+1),L=e[c][L],m=r[c][m],R=L+n*m,a[R]===s&&(a[R]=f+1)}}return ur.phase2_ace=a}function*Yd(e,t){let[r,n]=zp(),o=Oa(),l=Jd(),i=Vd(),[s,a,f]=e,u=i[f],g=Math.max(l[s+2520*f],l[a+2520*u]);for(;g<=t;)yield*Op(s,a,f,r,n,o,l,i,g,-1),g++}function*Op(e,t,r,n,o,l,i,s,a,f){let u=Math.max(i[e+2520*r],i[t+2520*s[r]]);if(!(u>a)){if(a===0){yield[];return}else if(u===0)return;for(let g=0;g<4;g++){if(g===f)continue;let p=e,c=t,L=r;for(let m=1;m<=2;m++){p=n[g][p],c=o[g][c],L=l[g][L];let R=Op(p,c,L,n,o,l,i,s,a-1,g);for(;;){let{value:F,done:A}=R.next();if(A)break;yield[[g,m]].concat(F)}}}}}function L0(e){let[t,r]=Do(7,3,2,0,2),n=Array(5).fill().map((f,u)=>m0(e,u)),o=cn(n),l=Array(4).fill().map((f,u)=>Na(e,u)),i=cn(l.map(f=>f[0]))*2+l.find(f=>f[0]===0)[1],[s,a]=[Ln,Ro].map(f=>{let u=Ye(f,Xd).map(g=>e[g]%4);return r[u.reduce((g,p,c)=>g|p<<2*c,0)]});return[s+210*a,i+24*o]}function eh(){if(K.phase3_2gen_edge)return K.phase3_2gen_edge;let e=Rl(5)/2,t=Array(Fo).fill().map(()=>new Uint32Array(e)),r=c0.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let o=Ca(n,5);for(let l=0;l<Fo;l++)t[l][n]=cn(Ye(o,r[l]))}return K.phase3_2gen_edge=t}function th(){if(K.phase3_2gen_corner)return K.phase3_2gen_corner;let t=Rl(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(Fo).fill().map(()=>new Uint32Array(t)),o=c0.map(l=>mn(l.cp,r).slice(0,4));for(let l=0;l<t;l+=2){let i=Ca(l>>1,4),s=i.concat(i.map(a=>a+4));for(let a=0;a<Fo;a++){let f=Ye(s,o[a]),u=f.map(p=>p%4),g=f.find(p=>p%4===0)>>2;n[a][l]=cn(u)*2+g,n[a][l+1]=cn(u)*2+(g^1)}}return K.phase3_2gen_corner=n}function B0(){return K.phase3_2gen_corneredge?K.phase3_2gen_corneredge:K.phase3_2gen_corneredge=Rn(th(),eh())}function Ga(){if(K.phase3_2gen_centre)return K.phase3_2gen_centre;let e=ho(7,3,2,0,2,c0.map(r=>mn(r.ap,dp))),t=ho(7,3,2,0,2,c0.map(r=>mn(r.bp,dp)));return K.phase3_2gen_centreA=e,K.phase3_2gen_centreB=t,K.phase3_2gen_centre=Rn(e,t)}function Ip(){if(va)return va;let e=Ga(),t=K.phase3_2gen_centreA,r=B0(),n=t[0].length,o=r[0].length,l=n*o,i=25,s=gr.map(p=>p.length),a=new Int8Array(l).fill(i),f=L0(dl);a[f[0]%n+n*f[1]]=0;let u=0,g=!1;for(;!g&&u<i-1;){g=!0;let p=Array(Fo).fill().map((F,A)=>A).filter(F=>s[F]+u<i);p.sort((F,A)=>s[F]-s[A]);let c=Ye(s,p),L=Ye(t,p),m=Ye(r,p),R=p.length;for(let F=a.indexOf(u);F!==-1;F=a.indexOf(u,F+1)){let A=F%n,U=F/n|0;for(let b=0;b<R;b++){let S=c[b],M=L[b][A],J=m[b][U],C=M+n*J;a[C]>u+S&&(g=!1,a[C]=u+S)}}u++}return va=a}function Wp(){if(Ea)return Ea;let e=B0().slice(0,2),t=L0(dl);return Ea=wp(e,t[1],t[1])}function ka(e,t=L0(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=Ga(),s=K.phase3_2gen_centreA,a=K.phase3_2gen_centreB,f=B0(),u=Ip(),g=Wp(),p=0;for(;;){let c=Ia(o,l,n,s,a,f,u,g,p);for(let L of c)return L.map(m=>gr[m]).flat();p++}}function hp(e,t=L0(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=Ga(),s=K.phase3_2gen_centreA,a=K.phase3_2gen_centreB,f=B0(),u=Ip(),g=Wp(),p=ka(e).length,c=1/0,L;for(let m=p;m<=p+0;m++){let R=Ia(o,l,n,s,a,f,u,g,m);for(let F of R){let A=F.map(S=>gr[S]).flat(),U=g0(A),b=za(U);b<c&&(c=b,L=U)}}return L}function rh(e){return(e-1)*(e-2)/2}function za(e){let t=xp(e,!0).replace(/'/g,"").split(" ");return e.length+nh(t).map(rh).reduce((r,n)=>r+n,0)}function nh(e){if(e.length<3)return[];let t=e.length,r=[];for(let l=0;l<t-2;l++)r[l]=e[l]===e[l+2];r.push(!1);let n=-1,o=[];for(;n<t-2&&(n=r.indexOf(!0,n+1),n!==-1);){let l=r.indexOf(!1,n+1);o.push(l-n),n=l}return o}function*Ia(e,t,r,n,o,l,i,s,a,f=-1){let u=i[e+210*r],g=i[t+210*s[r]],p=Math.max(u,g);if(!(p>a)){if(a===0){yield[];return}if(p!==0)for(let c=0;c<Fo;c++){if(c===f&&$d[c]<=3)continue;let L=n[c][e],m=o[c][t],R=l[c][r],F=a-gr[c].length;if(F<0)continue;let A=Ia(L,m,R,n,o,l,i,s,F,c);for(;;){let{value:U,done:b}=A.next();if(b)break;yield[c].concat(U)}}}}function oh(e,t=200,r=24){let n=[],o=p0(e),l=Ye(e,qt).map(a=>a^1),i=p0(l),s=Array(1e3);for(let a=0;a<t;a++){{let{value:f,done:u}=o.next();if(!u){let g=Or(e,f),p=f.concat(ka(g));if(p.length<=r)return p;p.length<s.length&&(s=p)}}{let{value:f,done:u}=i.next();if(!u){let g=Or(l,f),p=f.concat(ka(g)).map(([c,L])=>[c^2,L]);if(p.length<=r)return p;p.length<s.length&&(s=p)}}}return s}function lh(e,t=20,r=30){let n=[],o=p0(e),l=Ye(e,qt).map(f=>f^1),i=p0(l),s,a=1/0;for(let f=0;f<t;f++){{let{value:u,done:g}=o.next();if(!g){let p=Or(e,u),c=g0(u.concat(hp(p))),L=za(c);if(L<=r)return c;L<a&&(s=c,a=L)}}{let{value:u,done:g}=i.next();if(!g){let p=Or(l,u),c=g0(u.concat(hp(p)));c=c.map(([m,R])=>[m^2,R]);let L=za(c);if(L<=r)return c;L<a&&(s=c,a=L)}}}return s}async function sh(){return Pd(await ih)}var X5,$5,ba,Sa,dl,Bl,Ad,qt,eU,f0,Dp,yd,Ud,xd,u0,bd,Ap,Sd,wd,Tt,Nr,Tr,Ln,Ro,Up,zd,Bn,K,ur,Od,jd,qd,Rp,Cp,Np,wa,Xd,dp,gr,Fo,Gp,c0,$d,va,Ea,ih,Kp=y(()=>{Dt();[X5,$5]=(()=>{let e=new Int8Array(2048),t=new Int8Array(256*8);for(let o=0;o<256;o++)for(let l=0,i=0;l<8;l++)(o>>>l&1)!==0&&(e[l<<8|o]=i,t[i<<8|o]=l,i++);function r(o){let l=255,i=2520,s=0;for(let a=0;a<6;a++){let f=o[a];s+=e[l|f<<8]*i,l&=~(1<<f),i/=7-a}return s}function n(o,l){let i=255,s=2520,a=0;for(let f=0;f<6;f++){let u=o/s|0;o-=u*s,a^=u&1;let g=t[i|u<<8];l[f]=g,i&=~(1<<g),s/=7-f}return l[6]=t[i|a<<8],l[7]=t[i|(a^1)<<8],l}return[r,n]})();ba={};Sa={};dl=Array(72).fill().map((e,t)=>t/9|0),Bl=Pa([[0,4,8],[1,6,3],[2,5,7],[9,22,35],[45,67,44],[47,68,43],[46,69,39],[50,70,38],[49,71,36]],72),Ad=Ye(Bl,Bl),qt=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),eU=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),f0=Array(72).fill().map((e,t)=>(t+36)%72),Dp=Ao(f0,Ad,f0),yd=Ao(qt,Bl,qt),Ud=Ao(qt,Dp,qt),xd=Pa([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),u0=Ye(Bl,xd),bd=Ye(u0,u0),Ap=Ao(f0,bd,f0),Sd=Ao(qt,u0,qt),wd=Ao(qt,Ap,qt),Tt=Array(72).fill().map((e,t)=>t/9|0),Nr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],Tr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],Ln=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),Ro=Ln.map(e=>e+36);Up=[Bl,Dp,yd,Ud,u0,Ap,Sd,wd],zd=["U","L","F","R","u","l","f","r"],Bn=Up.map(yp);K={},ur={},Od=[0,0,2,3,0,0,2,3];jd=[0,1,2,0,0,1,2,0],qd=[0,1,2,3,4,5,7,8,10,11],Rp=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];Xd=[0,1,2,3,4,10,11],dp=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],gr=[[[0,1]],[[1,1]],[[2,1],[0,1],[3,1],[0,2],[3,2],[2,2]],[[3,2],[1,2],[2,2],[1,1],[2,1],[3,1]],[[6,1],[0,1],[3,1],[0,2],[3,2],[6,2]],[[7,2],[1,2],[2,2],[1,1],[2,1],[7,1]],[[2,1],[0,1],[2,2],[0,1],[2,1],[0,1],[2,2]],[[3,2],[1,1],[3,1],[1,1],[3,2],[1,1],[3,1]],[[2,1],[3,1],[2,2],[1,2],[0,2],[2,1],[3,1],[2,2]],[[3,2],[2,2],[3,1],[0,1],[1,1],[3,2],[2,2],[3,1]],[[6,1],[0,1],[6,2],[0,2],[1,2],[6,1],[0,1],[6,2]],[[7,2],[1,2],[7,1],[1,1],[0,1],[7,2],[1,2],[7,1]],[[2,1],[3,2],[2,2],[3,1],[0,1],[2,2],[1,1],[2,1]],[[3,2],[2,1],[3,1],[2,2],[1,2],[3,1],[0,2],[3,2]],[[6,1],[0,2],[6,2],[7,1],[6,1],[1,2],[7,1],[6,1]],[[7,2],[1,1],[7,1],[6,2],[7,2],[0,1],[6,2],[7,2]],[[2,2],[1,2],[2,2],[3,2],[2,2],[3,2],[0,2],[3,2]],[[6,2],[7,2],[1,2],[0,2],[1,2],[0,2],[6,2],[7,2]]];gr=gr.concat(gr.map(e=>bp(e)));Fo=gr.length,Gp=gr.map(e=>Or(Pa([],72),e)),c0=Gp.map(yp),$d=Gp.map(Dd);ih=ve()});var Qp={};Bt(Qp,{randomFTOScrambleString:()=>sh});var jp=y(()=>{Kp()});async function Vp(){return ah??(ah=fh())}async function fh(){return Qt(await Ce.fto.kpuzzle(),\`SubgroupSizes 24 12 11 12 12 11 10 9 11 8 10 9 7 8 10 10 6 9 8 5 7 6 5 4 4 8 7 3 6 6 360
3144
+ Alg R' U' R U B' U' B L\`)}var JL,YL,n1=y(()=>{He();In();Kn();JL=null;YL=null});var o1={};Bt(o1,{cachedData222:()=>Ju,cachedMegaminxKPuzzleWithoutMO:()=>xs,cachedSGSDataMegaminx:()=>Xu,sgsDataPyraminx:()=>Ss,sgsDataPyraminxFixedOrientation:()=>e1,sgsDataSkewb:()=>vs,sgsDataSkewbFixedCorner:()=>r1,skewbKPuzzleWithoutMOCached:()=>ws});var l1=y(()=>{Yu();$u();t1();n1()});async function Qn(e,t){let r=new Rt;r.experimentalPushAlg(e);for(let n of t){let o=(await rr())(n);o!==null&&r.push(B.fromString(o))}return r.toAlg()}var Fi=y(()=>{Be();Dt()});function h1(){}function nB(e){function t(){}return t.prototype=e||{},new t}function oB(e){return e instanceof Array?e[0]:null}function il(e,t,r){var n=Pi,o=lB,l=oB,i=n[e],a=l(i);i&&!a?H=i:(H=n[e]=t?o(t):{},H.castableTypeMap$=r,H.constructor=H,!t&&(H.typeMarker$=h1));for(var s=3;s<arguments.length;++s)arguments[s].prototype=H;a&&(H.___clazz$=a)}function lB(e){var t=Pi;return nB(t[e])}function iB(){}function bi(e){return e<<24>>24}function Ks(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function Qs(e,t){var r;return r=new Ks,r.packageName=e,r.compoundName=t,r}function Er(e,t,r){var n;return n=Qs(e,t),fB(r,n),n}function aB(e,t){var r;return r=Qs(e,t),r.modifiers=2,r}function Mi(e,t){var r;return r=Qs("",e),r.typeId=t,r.modifiers=1,r}function F1(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function sB(e){if(e.isPrimitive())return null;var t=e.typeId,r=Pi[t];return r}function fB(e,t){if(!!e){t.typeId=e;var r=sB(t);if(!r){Pi[e]=[t];return}r.___clazz$=t}}function te(e,t){return F1(e,t)}function Y(e,t,r,n,o,l){var i;return i=A1(o,n),re(te(e,l),t,r,o,i),i}function rt(e,t,r,n,o,l){return D1(e,t,r,n,o,0,l)}function D1(e,t,r,n,o,l,i){var a,s,f,u,g;if(u=o[l],f=l==i-1,a=f?n:0,g=A1(a,u),re(te(e,i-l),t[l],r[l],a,g),!f)for(++l,s=0;s<u;++s)g[s]=D1(e,t,r,n,o,l,i);return g}function re(e,t,r,n,o){return o.___clazz$=e,o.castableTypeMap$=t,o.typeMarker$=h1,o.__elementTypeId$=r,o.__elementTypeCategory$=n,o}function A1(e,t){var r=new Array(t),n;switch(e){case 6:n={l:0,m:0,h:0};break;case 7:n=0;break;case 8:n=!1;break;default:return r}for(var o=0;o<t;++o)r[o]=n;return r}function u1(e){var t,r,n;return t=e&nt,r=e>>22&nt,n=e<0?br:0,uB(t,r,n)}function uB(e,t,r){return{l:e,m:t,h:r}}function gB(e,t){var r,n,o;return r=e.l+t.l,n=e.m+t.m+(r>>22),o=e.h+t.h+(n>>22),{l:r&nt,m:n&nt,h:o&br}}function jt(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function js(e){var t,r;return e>-129&&e<128?(t=e+128,Di==null&&(Di=Y(KB,fe,293,256,0,1)),r=Di[t],!r&&(r=Di[t]=u1(e)),r):u1(e)}function y1(e,t){var r,n;return r=e.h>>19,n=t.h>>19,r==0?n!=0||e.h>t.h||e.h==t.h&&e.m>t.m||e.h==t.h&&e.m==t.m&&e.l>=t.l:!(n==0||e.h<t.h||e.h==t.h&&e.m<t.m||e.h==t.h&&e.m==t.m&&e.l<t.l)}function _s(e,t){return e.l!=t.l||e.m!=t.m||e.h!=t.h}function Cs(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function xi(e,t){var r,n,o;return t&=63,t<22?(r=e.l<<t,n=e.m<<t|e.l>>22-t,o=e.h<<t|e.m>>22-t):t<44?(r=0,n=e.l<<t-22,o=e.m<<t-22|e.l>>44-t):(r=0,n=0,o=e.l<<t-44),{l:r&nt,m:n&nt,h:o&br}}function nn(e,t){var r,n,o,l,i;return t&=63,r=e.h,n=(r&rB)!=0,n&&(r|=-1048576),t<22?(i=r>>t,l=e.m>>t|r<<22-t,o=e.l>>t|e.m<<22-t):t<44?(i=n?br:0,l=r>>t-22,o=e.m>>t-22|r<<44-t):(i=n?br:0,l=n?nt:0,o=r>>t-44),{l:o&nt,m:l&nt,h:i&br}}function U1(e,t){var r,n,o;return r=e.l-t.l,n=e.m-t.m+(r>>22),o=e.h-t.h+(n>>22),{l:r&nt,m:n&nt,h:o&br}}function on(e){return e.l|e.m<<22}function pB(e){this.string=e}function xr(e,t){return e>t?e:t}function qs(e,t){return e<t?e:t}function cB(e,t){return e.indexOf(t)}function mB(e){return LB(e,0,e.length)}function LB(e,t,r){for(var n="",o=t;o<r;){var l=Math.min(o+1e4,r);n+=String.fromCharCode.apply(null,e.slice(o,l)),o=l}return n}function BB(e){return String.fromCharCode(e&Je)}function g1(e){return e.string+=" ",e}function p1(e,t){return e.string+=t,e}function dB(){pB.call(this,"")}function Si(e,t){var r;if(e===t)return!0;if(e.length!=t.length)return!1;for(r=0;r<e.length;++r)if(e[r]!=t[r])return!1;return!0}function ln(){c1||(c1=!0,yr=rt(ye,[fe,Ae],[11,0],7,[495,18],2),Yn=rt(ye,[fe,Ae],[11,0],7,[324,18],2),to=rt(ye,[fe,Ae],[11,0],7,[336,18],2),Sr=rt(ye,[fe,Ae],[11,0],7,[495,8],2),Gi=Y(Oe,Ge,0,20048,7,1),Ti=Y(Oe,Ge,0,20791,7,1),Jn=Y(Oe,Ge,0,82945,7,1),qn=rt(ye,[fe,Ae],[11,0],7,[2768,10],2),Hn=rt(ye,[fe,Ae],[11,0],7,[2768,10],2),Zn=rt(ye,[fe,Ae],[11,0],7,[24,10],2),al=rt(ye,[fe,Ae],[11,0],7,[24,16],2),an=rt(ye,[fe,Ae],[11,0],7,[140,16],2),Ni=Y(Oe,Ge,0,8305,7,1),Vn=Y(Oe,Ge,0,48441,7,1))}function hB(e,t,r){return e.slice_0=yr[t.slice_0][r],e.flip=to[t.flip][(X(),fn)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=Yn[t.twist][fn[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=xr(xr(ut(Gi,e.twist*495+Sr[e.slice_0][e.tsym]),ut(Ti,e.flip*495+Sr[e.slice_0][e.fsym])),ut(Jn,e.twist<<11|vr[e.flip<<3|e.fsym^e.tsym])),e.prun}function FB(e,t,r){return r=(X(),nl)[3][r],e.flipc=to[t.flipc>>3][fn[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=Yn[t.twistc>>3][fn[r<<3|t.twistc&7]]^t.twistc&7,ut(Jn,e.twistc>>3<<11|vr[e.flipc^e.twistc&7])}function b1(e,t,r){var n;return e.twist=(X(),ll)[vi(t)],e.flip=sn[wi(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=ut(Jn,e.twist<<11|vr[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-$n(t.ea,8,!0),e.prun=xr(e.prun,xr(ut(Gi,e.twist*495+Sr[e.slice_0][e.tsym]),ut(Ti,e.flip*495+Sr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new pe,sl(t,1,n),fl(t,1,n),e.twistc=ll[vi(n)],e.flipc=sn[wi(n)],e.prun=xr(e.prun,ut(Jn,e.twistc>>3<<11|vr[e.flipc^e.twistc&7])),e.prun<=r)}function tl(){ln()}function ut(e,t){return ln(),e[t>>3]>>(t<<2)&15}function x1(e){ln(),!(Ai==2||Ai==1&&!e)&&(Ai==0&&(zB(),DB(),yB(),bB(),AB(),X(),Ms(2048,Ys,sn,L1=Y(ye,Ae,0,336,7,1),0),Ms(2187,$s,ll,ks=Y(ye,Ae,0,324,7,1),1),UB(),xB(),SB()),el(Ni,Zn,al,qn,(X(),Ns),584244,e),el(Vn,Ps,an,Hn,Ns,514084,e),el(Gi,yr,Sr,Yn,ks,431619,e),el(Ti,yr,Sr,to,L1,431619,e),el(Jn,null,null,Yn,ks,103939,e),Ai=e?2:1)}function DB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<2768;r++)for(EB(e,(X(),jn)[r]),n=0;n<10;n++)wr(e,ge[(Xe(),kt)[n]],t),qn[r][n]=_i(ar[pt(t.ca,8,!1)])&Je}function AB(){var e,t,r,n,o;for(e=new pe,t=new pe,Ps=rt(ye,[fe,Ae],[11,0],7,[140,10],2),r=0;r<140;r++){for(G1(e.ca,r%70,0,!1),o=0;o<10;o++)wr(e,(X(),ge)[(Xe(),kt)[o]],t),Ps[r][o]=$n(t.ca,0,!1)+70*(165>>o&1^~~(r/70))&Je;for(n=0;n<16;n++)sl(e,(X(),gt)[0][n],t),an[r][n]=$n(t.ca,0,!1)+70*~~(r/70)&Je}}function yB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<2768;r++)for(v1(e,(X(),jn)[r]),n=0;n<10;n++)At(e,ge[(Xe(),kt)[n]],t),Hn[r][n]=ar[pt(t.ea,8,!0)]}function UB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<336;r++)for(Zs(e,(X(),Ys)[r]),n=0;n<18;n++)At(e,ge[n],t),to[r][n]=sn[wi(t)]}function bB(){var e,t,r,n,o;for(e=new pe,t=new pe,r=0;r<24;r++){for(un(e.ea,r,12,!0),o=0;o<10;o++)At(e,(X(),ge)[(Xe(),kt)[o]],t),Zn[r][o]=pt(t.ea,12,!0)%24&Je;for(n=0;n<16;n++)fl(e,(X(),gt)[0][n],t),al[r][n]=pt(t.ea,12,!0)%24&Je}}function el(e,t,r,n,o,l,i){var a,s,f,u,g,p,c,L,m,R,F,A,U,x,S,M,J,C,Q,b,k,P,w,v,N,j,q,ie,de,be,Ye,bt,Le,Lt,lt,ct;if(U=l&15,F=(l>>4&1)==1?Ws:0,f=(l>>5&1)==1,a=l>>8&15,u=l>>12&15,g=l>>16&15,R=i?u:g,A=(1<<U)-1,s=t==null,L=s?2048:t.length,m=L*n.length,c=f?10:18,p=c==10?66:599186,S=(e[m>>3]>>(m<<2)&15)-1,S==-1){for(C=0;C<~~(m/8)+1;C++)e[C]=$o;e[0]^=1,S=0}for(;S<R;){for(N=(S+1)*$o^-1,Q=0;Q<e.length;Q++)lt=e[Q]^N,lt&=lt>>1,e[Q]+=lt&lt>>2&$o;for(P=S>a,be=P?S+2:S,de=be*$o,x=P?S:S+2,++S,ct=S^S+1,Lt=0,C=0;C<m;++C,Lt>>=4){if((C&7)==0&&(Lt=e[C>>3],((Lt^de)-$o&~(Lt^de)&-2004318072)==0)){C+=7;continue}if((Lt&15)==be)for(q=C%L,Ye=~~(C/L),M=0,J=0,s&&(M=(X(),sn)[q],J=M&7,M>>=3),v=0;v<c;v++){if(Le=n[Ye][v],s?ie=(X(),vr)[to[M][fn[v<<3|J]]^J^Le&A]:ie=r[t[q][v]][Le&A],Le>>=U,b=Le*L+ie,j=e[b>>3]>>(b<<2)&15,j!=x){j<S-1&&(v+=p>>v&3);continue}if(P){e[C>>3]^=ct<<(C<<2);break}for(e[b>>3]^=ct<<(b<<2),w=1,bt=o[Le];(bt>>=1)!=0;w++)(bt&1)==1&&(k=Le*L,s?k+=(X(),vr)[sn[ie]^w]:k+=r[ie][w^F>>(w<<1)&3],(e[k>>3]>>(k<<2)&15)==x&&(e[k>>3]^=ct<<(k<<2)))}}}}function xB(){var e,t,r,n;for(e=new pe,t=new pe,r=0;r<324;r++)for(Js(e,(X(),$s)[r]),n=0;n<18;n++)wr(e,ge[n],t),Yn[r][n]=ll[vi(t)]}function SB(){var e,t,r,n,o,l,i,a;for(e=new pe,t=new pe,n=0;n<495;n++){for(G1(e.ea,494-n,8,!0),l=0;l<18;l+=3)At(e,(X(),ge)[l],t),yr[n][l]=494-$n(t.ea,8,!0)&Je;for(o=0;o<16;o+=2)fl(e,(X(),gt)[0][o],t),Sr[n][o>>1]=494-$n(t.ea,8,!0)&Je}for(r=0;r<495;r++)for(o=0;o<18;o+=3)for(a=yr[r][o],i=1;i<3;i++)a=yr[a][o],yr[r][o+i]=a&Je}function X(){m1||(m1=!0,lr=Y(ol,fe,7,16,0,1),ge=Y(ol,fe,7,18,0,1),Oi=Y(QB,fe,0,18,6,1),k1=Y(Oe,Ge,0,48,7,1),ir=rt(Oe,[fe,Ge],[17,0],7,[16,16],2),gt=rt(Oe,[fe,Ge],[17,0],7,[16,16],2),nl=rt(Oe,[fe,Ge],[17,0],7,[16,18],2),fn=Y(Oe,Ge,0,144,7,1),Ur=rt(Oe,[fe,Ge],[17,0],7,[16,18],2),Ys=Y(ye,Ae,0,336,7,1),$s=Y(ye,Ae,0,324,7,1),jn=Y(ye,Ae,0,2768,7,1),Xn=Y(ne,se,0,2768,7,1),Xs=Y(ye,Ae,0,2768,7,1),ki=Y(ne,se,0,24,7,1),sn=Y(ye,Ae,0,2048,7,1),ll=Y(ye,Ae,0,2187,7,1),ar=Y(ye,Ae,0,40320,7,1),vr=Y(ye,Ae,0,2688,7,1),Ts=new _t(2531,1373,67026819,1367),Gs=new _t(2089,1906,322752913,2040),zi=re(te(ne,2),fe,10,0,[re(te(ne,1),se,0,7,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),re(te(ne,1),se,0,7,[6,7,8,0,1,2,3,4,5,15,16,17,9,10,11,12,13,14]),re(te(ne,1),se,0,7,[3,4,5,6,7,8,0,1,2,12,13,14,15,16,17,9,10,11]),re(te(ne,1),se,0,7,[2,1,0,5,4,3,8,7,6,11,10,9,14,13,12,17,16,15]),re(te(ne,1),se,0,7,[8,7,6,2,1,0,5,4,3,17,16,15,11,10,9,14,13,12]),re(te(ne,1),se,0,7,[5,4,3,8,7,6,2,1,0,14,13,12,17,16,15,11,10,9])]),kB(),CB())}function Vs(e){e.ca=re(te(ne,1),se,0,7,[0,1,2,3,4,5,6,7]),e.ea=re(te(ne,1),se,0,7,[0,2,4,6,8,10,12,14,16,18,20,22])}function S1(e){!e.temps&&(e.temps=new pe),wr(Gs,e,e.temps),wr(e.temps,Ts,e),At(Gs,e,e.temps),At(e.temps,Ts,e)}function Hs(e,t){var r,n;for(n=0;n<8;n++)e.ca[n]=t.ca[n];for(r=0;r<12;r++)e.ea[r]=t.ea[r]}function wB(e){return _i(ar[pt(e.ca,8,!1)])}function vB(e){return ar[pt(e.ea,8,!0)]}function wi(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function vi(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function Ei(e){var t,r;for(!e.temps&&(e.temps=new pe),r=0;r<12;r++)e.temps.ea[e.ea[r]>>1]=(r<<1|e.ea[r]&1)<<24>>24;for(t=0;t<8;t++)e.temps.ca[e.ca[t]&7]=(t|32>>(e.ca[t]>>3)&24)<<24>>24;Hs(e,e.temps)}function w1(e){var t,r,n,o,l,i,a;for(t=new E1(e),o=new pe,r=_i(ar[pt(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},a=0;a<6;a++){if(n=_i(ar[pt(t.ca,8,!1)])>>4,r==n)for(l=0;l<16;l++)sl(t,gt[0][l],o),Si(o.ca,e.ca)&&(fl(t,gt[0][l],o),Si(o.ea,e.ea)&&(i=Cs(i,xi({l:1,m:0,h:0},(a<<4|l)<48?a<<4|l:48))));S1(t),a%3==2&&Ei(t)}return i}function EB(e,t){un(e.ca,t,8,!1)}function v1(e,t){un(e.ea,t,8,!0)}function Zs(e,t){var r,n,o;for(n=0,r=10;r>=0;--r,t>>=1)n^=o=t&1,e.ea[r]=(e.ea[r]&-2|o)<<24>>24;e.ea[11]=(e.ea[11]&-2|n)<<24>>24}function Js(e,t){var r,n,o;for(n=15,r=6;r>=0;--r,t=~~(t/3))n-=o=t%3,e.ca[r]=(e.ca[r]&7|o<<3)<<24>>24;e.ca[7]=(e.ca[7]&7|n%3<<3)<<24>>24}function _B(e){var t,r,n,o,l;for(l=0,o=0,n=0;n<12;n++)o|=1<<(e.ea[n]>>1),l^=e.ea[n]&1;if(o!=4095)return-2;if(l!=0)return-3;for(r=0,l=0,t=0;t<8;t++)r|=1<<(e.ca[t]&7),l+=e.ca[t]>>3;return r!=255?-4:l%3!=0?-5:(Os(pt(e.ea,12,!0),12)^Os(pt(e.ca,8,!1),8))!=0?-6:0}function sl(e,t,r){X();var n,o,l,i,a,s;for(s=lr[gt[0][t]],a=lr[t],n=0;n<8;n++)l=s.ca[e.ca[a.ca[n]&7]&7]>>3,i=e.ca[a.ca[n]&7]>>3,o=l<3?i:(3-i)%3,r.ca[n]=(s.ca[e.ca[a.ca[n]&7]&7]&7|o<<3)<<24>>24}function wr(e,t,r){X();var n,o,l;for(n=0;n<8;n++)o=e.ca[t.ca[n]&7]>>3,l=t.ca[n]>>3,r.ca[n]=(e.ca[t.ca[n]&7]&7|(o+l)%3<<3)<<24>>24}function Ui(e,t,r){var n,o,l,i;for(n=0;n<8;n++)l=e.ca[t.ca[n]&7]>>3,i=t.ca[n]>>3,o=l+(l<3?i:6-i),o=o%3+(l<3==i<3?0:3),r.ca[n]=(e.ca[t.ca[n]&7]&7|o<<3)<<24>>24}function pe(){X(),Vs(this)}function _t(e,t,r,n){Vs(this),un(this.ca,e,8,!1),Js(this,t),un(this.ea,r,12,!0),Zs(this,n)}function E1(e){Vs(this),Hs(this,e)}function _i(e){return X(),e^Ws>>((e&15)<<1)&3}function fl(e,t,r){X();var n,o,l;for(l=lr[gt[0][t]],o=lr[t],n=0;n<12;n++)r.ea[n]=(l.ea[e.ea[o.ea[n]>>1]>>1]^e.ea[o.ea[n]>>1]&1^o.ea[n]&1)<<24>>24}function At(e,t,r){X();var n;for(n=0;n<12;n++)r.ea[n]=(e.ea[t.ea[n]>>1]^t.ea[n]&1)<<24>>24}function Ar(e,t,r){X();var n;return n=Xs[e],r&&(n=n^Ws>>((n&15)<<1)&3),n&65520|ir[n&15][t]}function _1(){return X(),0}function kB(){var e,t;for(ge[0]=new _t(15120,0,119750400,0),ge[3]=new _t(21021,1494,323403417,0),ge[6]=new _t(8064,1236,29441808,550),ge[9]=new _t(9,0,5880,0),ge[12]=new _t(1230,412,2949660,0),ge[15]=new _t(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)ge[e+t+1]=new pe,At(ge[e+t],ge[e],ge[e+t+1]),wr(ge[e+t],ge[e],ge[e+t+1])}function zB(){X();var e,t,r;for(Ms(40320,jn,ar,Ns=Y(ye,Ae,0,2768,7,1),2),e=new pe,r=0;r<2768;r++)v1(e,jn[r]),Xn[r]=$n(e.ea,0,!0)+Os(jn[r],8)*70<<24>>24,Ei(e),Xs[r]=ar[pt(e.ea,8,!0)];for(t=0;t<24;t++)un(e.ea,t,12,!0),Ei(e),ki[t]=pt(e.ea,12,!0)%24<<24>>24}function CB(){var e,t,r,n,o,l,i,a,s,f,u,g,p,c,L,m;for(e=new pe,t=new pe,r=new _t(28783,0,259268407,0),m=new _t(15138,0,119765538,7),g=new _t(5167,0,83473207,0),o=0;o<8;o++)g.ca[o]=bi(g.ca[o]|24);for(l=0;l<16;l++)lr[l]=new E1(e),Ui(e,m,t),At(e,m,t),L=t,t=e,e=L,l%4==3&&(Ui(L,g,t),At(L,g,t),L=t,t=e,e=L),l%8==7&&(Ui(L,r,t),At(L,r,t),L=t,t=e,e=L);for(i=0;i<16;i++)for(s=0;s<16;s++)for(Ui(lr[i],lr[s],e),u=0;u<16;u++)if(Si(lr[u].ca,e.ca)){ir[i][s]=u,gt[u][s]=i;break}for(f=0;f<18;f++)for(c=0;c<16;c++){for(sl(ge[f],gt[0][c],e),p=0;p<18;p++)if(Si(ge[p].ca,e.ca)){nl[c][f]=p,Ur[c][(Xe(),eo)[f]]=eo[p];break}c%2==0&&(fn[f<<3|c>>1]=nl[c][f])}for(n=0;n<18;n++)for(Oi[n]=w1(ge[n]),a=n,c=0;c<48;c++)nl[c%16][a]<n&&(k1[c]|=1<<n),c%16==15&&(a=zi[2][a])}function Ms(e,t,r,n,o){X();var l,i,a,s,f,u,g,p,c;for(l=new pe,a=new pe,i=0,f=0,c=o>=2?1:2,u=o!=1,s=0;s<e;s++)if(r[s]==0){switch(o){case 0:Zs(l,s);break;case 1:Js(l,s);break;case 2:un(l.ea,s,8,!0)}for(g=0;g<16;g+=c){switch(u?fl(l,g,a):sl(l,g,a),o){case 0:f=wi(a);break;case 1:f=vi(a);break;case 2:f=pt(a.ea,8,!0)}o==0&&(vr[i<<3|g>>1]=f&Je),f==s&&(n[i]=(n[i]|1<<~~(g/c))&Je),p=~~((i<<4|g)/c),r[f]=p&Je}t[i++]=s&Je}return i}function PB(e,t,r,n,o,l,i,a){var s,f,u,g,p;if(g=xr(ut((ln(),Vn),(i>>4)*140+an[(X(),Xn)[a>>4]&255][gt[i&15][a&15]]),xr(ut(Vn,n*140+an[Xn[t]&255][gt[o][r]]),ut(Ni,t*24+al[l][r]))),g>e.maxDep2)return g-e.maxDep2;for(s=e.maxDep2;s>=g&&(p=P1(e,n,o,t,r,l,s,e.depth1,10),!(p<0));s--){for(s-=p,e.solLen=0,e.solution=new O1,WB(e.solution,e.verbose,e.urfIdx,e.depth1),u=0;u<e.depth1+s;u++)R1(e.solution,e.move[u]);for(f=e.preMoveLen-1;f>=0;f--)R1(e.solution,e.preMoves[f]);e.solLen=e.solution.length_0}return s!=e.maxDep2?(e.maxDep2=qs(N1,e.solLen-e.length1-1),y1(e.probe,e.probeMin)?0:1):1}function MB(e){var t,r,n,o,l,i,a,s,f,u,g,p,c,L,m;if(e.isRec=!1,y1(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=gB(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)wr(e.phase1Cubie[n],(X(),ge)[e.move[n]],e.phase1Cubie[n+1]),At(e.phase1Cubie[n],ge[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,a=wB(e.phase1Cubie[e.depth1]),s=a&15,a>>=4,f=vB(e.phase1Cubie[e.depth1]),u=f&15,f>>=4,g=pt(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=Ar(f,u,!1),t=Ar(a,s,!0),o=e.depth1==0?-1:e.move[e.depth1-1],l=e.preMoveLen==0?-1:e.preMoves[e.preMoveLen-1],m=0,L=(e.preMoveLen==0?1:2)*(e.depth1==0?1:2),p=0,c=(1<<L)-1;p<L;p++){if((c>>p&1)!=0){if(c&=~(1<<p),m=PB(e,a,s,f,u,g,r,t),m==0||m>2)break;m==2&&(c&=4<<p)}if(c==0)break;(p&1)==0&&e.depth1>0?(i=(Xe(),eo)[~~(o/3)*3+1],e.move[e.depth1-1]=kt[i]*2-e.move[e.depth1-1],g=(ln(),Zn)[g][i],a=qn[a][(X(),Ur)[s][i]],s=ir[a&15][s],a>>=4,f=Hn[f][Ur[u][i]],u=ir[f&15][u],f>>=4,t=Ar(a,s,!0),r=Ar(f,u,!1)):e.preMoveLen>0&&(i=(Xe(),eo)[~~(l/3)*3+1],e.preMoves[e.preMoveLen-1]=kt[i]*2-e.preMoves[e.preMoveLen-1],g=(X(),ki)[(ln(),Zn)[ki[g]][i]],a=qn[t>>4][Ur[t&15][i]],t=a&-16|ir[a&15][t&15],a=Ar(t>>4,t&15,!0),s=a&15,a>>=4,f=Hn[r>>4][Ur[r&15][i]],r=f&-16|ir[f&15][r&15],f=Ar(r>>4,r&15,!1),u=f&15,f>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=o),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=l),m==0?0:2}function NB(e){var t;for(e.conjMask=0,e.selfSym=w1(e.cc),e.conjMask|=_s(jt(nn(e.selfSym,16),{l:Je,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=_s(jt(nn(e.selfSym,32),{l:Je,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=_s(jt(nn(e.selfSym,48),{l:Je,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=jt(e.selfSym,{l:nt,m:nt,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)Hs(e.urfCubieCube[t],e.cc),b1(e.urfCoordCube[t],e.urfCubieCube[t],20),S1(e.cc),t%3==2&&Ei(e.cc)}function z1(e,t,r,n,o){var l,i,a,s,f,u;if(t.prun==0&&n<5)return e.allowShorter||n==0?(e.depth1-=n,f=MB(e),e.depth1+=n,f):1;for(u=_1(js(r)),l=0;l<18;l+=3)if(!(l==o||l==o-9)){for(a=0;a<3;a++)if(i=l+a,!(e.isRec&&i!=e.move[e.depth1-n]||u!=0&&(u&1<<i)!=0)){if(s=hB(e.nodeUD[n],t,i),s>n)break;if(s==n)continue;if(s=FB(e.nodeUD[n],t,i),s>n)break;if(s==n)continue;if(e.move[e.depth1-n]=i,e.valid1=qs(e.valid1,e.depth1-n),f=z1(e,e.nodeUD[n],r&on((X(),Oi)[i]),n-1,l),f==0)return 0;if(f>=2)break}}return 1}function C1(e,t,r,n,o){var l,i,a;if(e.preMoveLen=e.maxPreMoves-t,(e.isRec?e.depth1==e.length1-e.preMoveLen:e.preMoveLen==0||(225207>>r&1)==0)&&(e.depth1=e.length1-e.preMoveLen,e.phase1Cubie[0]=n,e.allowShorter=e.depth1==zs&&e.preMoveLen!=0,b1(e.nodeUD[e.depth1+1],n,e.depth1)&&z1(e,e.nodeUD[e.depth1+1],o,e.depth1,-1)==0))return 0;if(t==0||e.preMoveLen+zs>=e.length1)return 1;for(a=_1(js(o)),(t==1||e.preMoveLen+1+zs>=e.length1)&&(a|=225207),r=~~(r/3)*3,l=0;l<18;l++){if(l==r||l==r-9||l==r+9){l+=2;continue}if(!(e.isRec&&l!=e.preMoves[e.maxPreMoves-t]||(a&1<<l)!=0)&&(wr((X(),ge)[l],n,e.preMoveCubes[t]),At(ge[l],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=l,i=C1(e,t-1,l,e.preMoveCubes[t],o&on(Oi[l])),i==0))return 0}return 1}function P1(e,t,r,n,o,l,i,a,s){var f,u,g,p,c,L,m,R,F,A,U;if(t==0&&n==0&&l==0)return i;for(F=(Xe(),rl)[s],m=0;m<10;m++){if((F>>m&1)!=0){m+=66>>m&3;continue}if(R=(ln(),Zn)[l][m],u=qn[n][(X(),Ur)[o][m]],g=ir[u&15][o],u>>=4,c=Hn[t][Ur[r][m]],L=ir[c&15][r],c>>=4,p=Ar(c,L,!1),f=Ar(u,g,!0),A=ut(Vn,(p>>4)*140+an[Xn[f>>4]&255][gt[p&15][f&15]]),A>i+1)return i-A+1;if(A>=i){m+=66>>m&3&i-A;continue}if(A=xr(ut(Ni,u*24+al[R][g]),ut(Vn,c*140+an[Xn[u]&255][gt[L][g]])),A>=i){m+=66>>m&3&i-A;continue}if(U=P1(e,c,L,u,g,R,i-1,a+1,m),U>=0)return e.move[a]=kt[m],U;if(U<-2)break;U<-1&&(m+=66>>m&3)}return-1}function TB(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=qs(N1,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)==0&&C1(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],on(jt(e.selfSym,{l:Je,m:0,h:0})))==0)return e.solution?d1(e.solution):"Error 8";return e.solution?d1(e.solution):"Error 7"}function GB(e,t){var r;return r=OB(e,t),r!=0?"Error "+(r<0?-r:r):(e.solLen=22,e.probe={l:0,m:0,h:0},e.probeMax={l:3531008,m:23,h:0},e.probeMin={l:0,m:0,h:0},e.verbose=0,e.solution=null,e.isRec=!1,x1(!1),NB(e),TB(e))}function OB(e,t){var r,n,o,l;for(n=0,o=Y(ne,se,0,54,7,1),r=mB(re(te(ye,1),Ae,0,7,[t.charCodeAt(4),t.charCodeAt(13),t.charCodeAt(22),t.charCodeAt(31),t.charCodeAt(40),t.charCodeAt(49)])),l=0;l<54;l++){if(o[l]=cB(r,BB(t.charCodeAt(l)))<<24>>24,o[l]==-1)return-1;n+=1<<(o[l]<<2)}return n!=10066329?-1:(IB(o,e.cc),_B(e.cc))}function M1(){var e,t,r;for(this.move=Y(Oe,Ge,0,31,7,1),this.nodeUD=Y(yi,fe,31,21,0,1),this.nodeRL=Y(yi,fe,31,21,0,1),this.nodeFB=Y(yi,fe,31,21,0,1),this.cc=new pe,this.urfCubieCube=Y(ol,fe,7,6,0,1),this.urfCoordCube=Y(yi,fe,31,6,0,1),this.phase1Cubie=Y(ol,fe,7,21,0,1),this.preMoveCubes=Y(ol,fe,7,21,0,1),this.preMoves=Y(Oe,Ge,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new tl,this.nodeRL[t]=new tl,this.nodeFB[t]=new tl,this.phase1Cubie[t]=new pe;for(r=0;r<6;r++)this.urfCubieCube[r]=new pe,this.urfCoordCube[r]=new tl;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new pe}function Xe(){if(!B1){B1=!0;var e,t,r,n,o,l;for(rn=re(te(ne,2),fe,10,0,[re(te(ne,1),se,0,7,[8,9,20]),re(te(ne,1),se,0,7,[6,18,38]),re(te(ne,1),se,0,7,[0,36,47]),re(te(ne,1),se,0,7,[2,45,11]),re(te(ne,1),se,0,7,[29,26,15]),re(te(ne,1),se,0,7,[27,44,24]),re(te(ne,1),se,0,7,[33,53,42]),re(te(ne,1),se,0,7,[35,17,51])]),nr=re(te(ne,2),fe,10,0,[re(te(ne,1),se,0,7,[5,10]),re(te(ne,1),se,0,7,[7,19]),re(te(ne,1),se,0,7,[3,37]),re(te(ne,1),se,0,7,[1,46]),re(te(ne,1),se,0,7,[32,16]),re(te(ne,1),se,0,7,[28,25]),re(te(ne,1),se,0,7,[30,43]),re(te(ne,1),se,0,7,[34,52]),re(te(ne,1),se,0,7,[23,12]),re(te(ne,1),se,0,7,[21,41]),re(te(ne,1),se,0,7,[50,39]),re(te(ne,1),se,0,7,[48,14])]),or=rt(Oe,[fe,Ge],[17,0],7,[13,13],2),Is=re(te(RB,1),fe,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),kt=re(te(Oe,1),Ge,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),eo=Y(Oe,Ge,0,18,7,1),rl=Y(Oe,Ge,0,11,7,1),t=0;t<18;t++)eo[kt[t]]=t;for(r=0;r<10;r++)for(n=~~(kt[r]/3),rl[r]=0,o=0;o<10;o++)l=~~(kt[o]/3),rl[r]|=(n==l||n%3==l%3&&n>=l?1:0)<<o;for(rl[10]=0,e=0;e<13;e++)for(or[e][0]=or[e][e]=1,o=1;o<e;o++)or[e][o]=or[e-1][o-1]+or[e-1][o]}}function $n(e,t,r){Xe();var n,o,l,i,a;for(n=e.length-1,l=0,a=4,o=n;o>=0;o--)i=T1(e[o],r),(i&12)==t&&(l+=or[o][a--]);return l}function Os(e,t){Xe();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function pt(e,t,r){Xe();var n,o,l,i;for(o=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)l=T1(e[n],r)<<2,o=(t-n)*o+on(jt(nn(i,l),{l:15,m:0,h:0})),i=U1(i,xi({l:1118480,m:279620,h:69905},l));return o}function T1(e,t){return t?e>>1:e&7}function G1(e,t,r,n){Xe();var o,l,i,a;for(o=e.length-1,a=4,l=o,i=o;i>=0;i--)t>=or[i][a]?(t-=or[i][a--],e[i]=Ci(e[i],a|r,n)):((l&12)==r&&(l-=4),e[i]=Ci(e[i],l--,n))}function un(e,t,r,n){Xe();var o,l,i,a,s,f;for(f={l:1323536,m:2777561,h:1043915},o={l:0,m:0,h:0},a=2;a<=r;a++)o=Cs(xi(o,4),js(t%a)),t=~~(t/a);for(l=0;l<r-1;l++)s=(on(o)&15)<<2,o=nn(o,4),e[l]=Ci(e[l],on(jt(nn(f,s),{l:15,m:0,h:0})),n),i=U1(xi({l:1,m:0,h:0},s),{l:1,m:0,h:0}),f=Cs(jt(f,i),jt(nn(f,4),{l:~i.l&nt,m:~i.m&nt,h:~i.h&br}));e[r-1]=Ci(e[r-1],on(jt(f,{l:15,m:0,h:0})),n)}function Ci(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function IB(e,t){Xe();var r,n,o,l,i,a,s,f;for(l=0;l<8;l++)t.ca[l]=0;for(i=0;i<12;i++)t.ea[i]=0;for(a=0;a<8;a++){for(f=0;f<3&&!(e[rn[a][f]]==0||e[rn[a][f]]==3);f++);for(r=e[rn[a][(f+1)%3]],n=e[rn[a][(f+2)%3]],s=0;s<8;s++)if(r==~~(rn[s][1]/9)&&n==~~(rn[s][2]/9)){t.ca[a]=bi(f%3<<3|s);break}}for(o=0;o<12;o++)for(s=0;s<12;s++){if(e[nr[o][0]]==~~(nr[s][0]/9)&&e[nr[o][1]]==~~(nr[s][1]/9)){t.ea[o]=bi(s<<1);break}if(e[nr[o][0]]==~~(nr[s][1]/9)&&e[nr[o][1]]==~~(nr[s][0]/9)){t.ea[o]=bi(s<<1|1);break}}}function R1(e,t){var r,n,o;if(e.length_0==0){e.moves[e.length_0++]=t;return}if(r=~~(t/3),n=~~(e.moves[e.length_0-1]/3),r==n){o=(t%3+e.moves[e.length_0-1]%3+1)%4,o==3?--e.length_0:e.moves[e.length_0-1]=r*3+o;return}if(e.length_0>1&&r%3==n%3&&r==~~(e.moves[e.length_0-2]/3)){o=(t%3+e.moves[e.length_0-2]%3+1)%4,o==3?(e.moves[e.length_0-2]=e.moves[e.length_0-1],--e.length_0):e.moves[e.length_0-2]=r*3+o;return}e.moves[e.length_0++]=t}function WB(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function d1(e){var t,r,n;if(r=new dB,n=(e.verbose&2)!=0?(e.urfIdx+3)%6:e.urfIdx,n<3)for(t=0;t<e.length_0;t++)(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". "),g1(p1(r,(Xe(),Is)[(X(),zi)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)g1(p1(r,(Xe(),Is)[(X(),zi)[n][e.moves[t]]])),(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". ");return r.string}function O1(){this.moves=Y(Oe,Ge,0,31,7,1)}var fe,nt,br,rB,Je,Ae,Ge,Ws,$o,se,H,Pi,Di,RB,c1,an,Ps,qn,Vn,Hn,to,Ni,al,Zn,Jn,Yn,Sr,Ti,yr,Gi,Ai,yi,m1,lr,ar,jn,sn,Ys,vr,ki,Xn,Xs,fn,nl,Ur,ir,gt,L1,Ns,ks,ll,$s,k1,ge,Oi,Ts,Gs,zi,ol,N1,zs,B1,or,rl,rn,nr,Is,eo,kt,Oe,KB,ne,QB,ye,jB,qB,I1=y(()=>{fe={3:1},nt=4194303,br=1048575,rB=524288,Je=65535,Ae={11:1,3:1},Ge={17:1,3:1},Ws=14540032,$o=286331153,se={10:1,3:1},Pi={};il(1,null,{},iB);il(79,1,{},Ks);H.createClassLiteralForArray=function(t){var r;return r=new Ks,r.modifiers=4,t>1?r.componentType=F1(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!=0};RB=Er("java.lang","String",2);c1=!1;il(31,1,{31:1},tl);H.flip=0;H.flipc=0;H.fsym=0;H.prun=0;H.slice_0=0;H.tsym=0;H.twist=0;H.twistc=0;Ai=0,yi=Er("org.cubing.min2phase.client","CoordCube",31),m1=!1;ol=Er("org.cubing.min2phase.client","CubieCube",7);il(72,1,{},M1);H.allowShorter=!1;H.conjMask=0;H.depth1=0;H.isRec=!1;H.length1=0;H.maxDep2=0;H.maxPreMoves=0;H.preMoveLen=0;H.probe={l:0,m:0,h:0};H.probeMax={l:0,m:0,h:0};H.probeMin={l:0,m:0,h:0};H.selfSym={l:0,m:0,h:0};H.solLen=0;H.urfIdx=0;H.valid1=0;H.verbose=0;N1=12,zs=7,B1=!1;il(150,1,{},O1);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;Oe=Mi("int","I");Er("com.google.gwt.lang","CollapsedPropertyHolder",252);Er("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);KB=Er("com.google.gwt.lang","LongLibBase/LongEmul",null);Er("com.google.gwt.lang","ModuleUtils",257);ne=Mi("byte","B"),QB=Mi("long","J"),ye=Mi("char","C");Er("com.google.gwt.user.client.rpc","XsrfToken",null),aB("java.util","Map/Entry");jB=function(){x1(!1)},qB=function(e){return GB(new M1,e)}});var W1={};Bt(W1,{initialize:()=>jB,solveState:()=>qB});var K1=y(()=>{I1()});var e0,Q1=y(()=>{Kt();e0=Te(()=>Promise.resolve().then(()=>(K1(),W1)))});function j1(e,t){return e.slice(t)+e.slice(0,t)}function YB(e){let t=[[],[]];for(let r=0;r<6;r++)if(e.stateData.CENTERS.pieces[r]!==r)throw new Error("non-oriented puzzles are not supported");for(let r=0;r<12;r++)t[0].push(j1(VB[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push(j1(HB[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(ZB),t}function q1(e){let t=YB(e);return JB.map(([r,n,o])=>t[r][n][o]).join("")}var VB,HB,ZB,JB,V1=y(()=>{VB="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),HB="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),ZB="U L F R B D".split(" "),JB=[[1,2,0],[0,2,0],[1,1,0],[0,3,0],[2,0,0],[0,1,0],[1,3,0],[0,0,0],[1,0,0],[1,0,2],[0,1,1],[1,1,1],[0,8,1],[2,3,0],[0,10,1],[1,4,1],[0,5,1],[1,7,2],[1,3,2],[0,0,1],[1,0,1],[0,9,0],[2,2,0],[0,8,0],[1,5,1],[0,4,1],[1,4,2],[1,5,0],[0,4,0],[1,4,0],[0,7,0],[2,5,0],[0,5,0],[1,6,0],[0,6,0],[1,7,0],[1,2,2],[0,3,1],[1,3,1],[0,11,1],[2,1,0],[0,9,1],[1,6,1],[0,7,1],[1,5,2],[1,1,2],[0,2,1],[1,2,1],[0,10,0],[2,4,0],[0,11,0],[1,7,1],[0,6,1],[1,6,2]]});function H1(e,t){let r=new ce(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}}).experimentalToTransformation(),n=new ce(t.kpuzzle,{EDGES:t.stateData.EDGES,CORNERS:t.stateData.CORNERS,CENTERS:{pieces:t.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}}).experimentalToTransformation();return r.isIdentical(n)}function Z1(e,t){if(H1(e.startState(),t))return!1;for(let r of"ULFRBD")for(let n=1;n<4;n++){let o=e.moveToTransformation(new B(r,n)).toKState();if(H1(o,t))return!1}return!0}var J1=y(()=>{Be();He()});var Y1,X1=y(()=>{Y1=[["R U'","R2 B","D2 B2","D' L B'","R' U'","B","D B2","R' B","L' U","L2 B'","B2","D L B'","L U","B'","U'","R B","D' B2","L B'","U2","U L' B'","","U' L' B'","U","L' B'"],["F2 L2","F' L'","R' F L2","D' L2","F L2","F2 L'","R' F' L'","R2 F L2","R2 F2 L'","L2","F L'","D' L","D2 L2","R2 F' L'","D L","","L2 F L'","L F' L2","L F L'","F' L2","L'","D L2","D F L'","L"],["R B U2 B'","R2 B U' B'","F2 B U B'","F B2 L' B2","B2 L B2","B U' B'","R2 B U2 B'","R' B U' B'","B2 L' B2","F B U B'","B2 U' B2","B' L B","L F' B D' B'","B' U' B2 D B'","B U2 B'","R B U' B'","B2 L2 B2","D' B' L B","B U B'","F' B2 L' B2","","B2 L' B' U' B'"],["U F2 L2 U'","F' U L' U'","F2 U L' U'","U F L2 U'","U2 B2 U2","R' U' B U","D2 U L U'","D U2 B' U2","U L2 U'","F U L' U'","D U L U'","U2 B' U2","","U2 B' U' L' U'","U2 L' U2","U' B U","U L U'","D' U2 B' U2","U L' U'","U2 B U2"],["R' D' F2","F'","F2","D R F'","R D' F2","R2 F'","D' F2","R F'","F2 R' D' F2","F","D2 F2","D' R F'","R2 D' F2","R' F'","D F2","D2 R F'","","F R' D' F2"],["R' D2 F' D F","R F2 R2 F2","R2 F' D2 F","F' R2 D2 F","L D' L'","D F' D2 F","F2 R2 F2","R F' D2 F","F' R2 D' F","F' R' D2 F","F2 R' F2","L D L'","F' R D' F","F2 R F2","F' D2 F","","L D2 R D' L'","F' D2 F' R F2","D2 R2 F2 R2 F2","D F' D' F","F' D F"],["U F2 U'","R U F' U'","D R U F2 U'","U F U'","R2 U F2 U'","R' U F' U'","R U F2 U'","R2 U F' U'","","U L D L' F U'","F2 D' R D F2","D2 U F U'","R' U F2 U'","U F' U'","F2 D2 R D2 F2","D U F U'"],["R2","R' B' D B","D R'","F' R2 F","","R B' D B","R'","B' D B","D' R'","D2 F' R2 F","R","R2 B' D B","D2 R'","B' D' B"],["R2 D' R2","F' R' F R","R D' R2 D R'","D2 R2 D2 R2","R' D' F' R F","U F D F' U'","","R2 D2 B R' B' R'","R' F D' F2 R F","R2 D R2","F2 U F U' F","R' D F' R F","D R2 D2 R2","U F D' F' U'","D R' D2 F' R F","R2 D2 R2","U F D2 F' U'","R' D2 F' R F"],["B R B'","F D F' B R2 B'","D B R2 B'","D2 B R' B'","B R2 B'","D B R' B'","D' B R2 B'","B R' B'","","B R2 B' D B R' B'","D2 B R2 B'","D' B R' B'"],["","R' D R F D2 F'","R' D R","D F D' F'","R F' R' F","F D' F'","R' D' R","F D2 F'","R' D2 R","F D F'"],["","F2 D2 R F' R' D2 F' D2 F'","F2 D2 F' D' F D' F' D2 F'","F2 D F2 D F2 D2 F2","D2 F L D2 L' D2 F'","D F D2 L D2 L' F'","R' D B' D2 B D' R","R' D2 B' D2 B R","F D2 F' D F D F'","F D' L D2 L' D F'","B D' F D B' D' F'","F D2 L D2 L' F'","F D' L D L' D F'","F L D2 L' D2 F'","R' B' D2 B D2 R"],["D'","F L D L' D' F'","D2","L B D B' D' L'","D","B' L' D' L D B","","D F L D L' D' F'"],["F' D2 F D F' D F","F' D' R' D R F","F' R' D' R D F","B D R D' R' B'","","D B' D' L' D L B"],["D F D F' D F D2 F'","F' U2 B' R' B U2 F' L F' L' F'","","D2 L D L2 F L F2 D F"],["L B' L' F L B L' F'","F2 U F' D2 F U' F' D2 F'","D' F' D B D' F D B'","F L2 F R2 F' L2 F R2 F2","D B D' F' D B' D' F","R F L F' R' F L' F'","","D2 B L' U2 L B' D2 B L' U2 L B'","D2 F R' U2 R F' D2 F R' U2 R F'","R F L' F' R' F L F'","D F D' B' D F' D' B","L2 F2 L' B2 L F2 L' B2 L'"],["L B R' B' L' B R B'","R' B R F' R' B' R F","L D2 L U L' D2 L U' L2","","D2 B' D2 F D' L2 F L2 F' D2 B D' F'","D2 F' R' F R2 B' D2 B D2 R' F D2 F'","L B L' F L B' L' F'","F' D2 F' U' F D2 F' U F2","D' B' D F D' B D F'"],["","D2 F' L U2 L' F D2 F' L U2 L' F","D2 B' R U2 R' B D2 B' R U2 R' B"]]});async function eg(){let e=await Pe["3x3x3"].kpuzzle(),t=e.startState();for(let r of Y1)t=t.applyAlg(E.fromString((await rr())(r)));return Z1(e,t)?t:eg()}async function t0(e){return we(),E.fromString((await e0).solveState(q1(e)))}async function ro(){return t0(await eg())}async function tg(){(await e0).initialize()}async function rg(){return Qn(await ro(),XB)}async function ng(){let e=new Rt,t=await ro();return e.experimentalPushAlg($1),e.experimentalPushAlg(t),e.experimentalPushAlg($1),e.toAlg()}var XB,$1,r0=y(()=>{Be();tr();Dt();Ft();Fi();Q1();V1();J1();X1();XB=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];$1=new E("R' U' F")});function ue(e,...t){let r=t.length,n=e[t[r-1]];for(let o=r;o>0;o--)e[t[o]]=e[t[o-1]];return e[t[0]]=n,ue}function og(e,t,r,n){r=(r||8)-1;let o=1985229328,l=0;n??(n=0),n<0&&(t<<=1);for(let i=0;i<r;++i){let a=n0[r-i],s=~~(t/a);l^=s,t%=a,s<<=2,e[i]=o>>s&7;let f=(1<<s)-1;o=(o&f)+(o>>4&~f)}return n<0&&(l&1)!==0?(e[r]=e[r-1],e[r-1]=o&7):e[r]=o&7,e}var Re,n0,lg=y(()=>{Re=[],n0=[1];for(let e=0;e<32;++e){Re[e]=[];for(let t=0;t<32;++t)Re[e][t]=0}for(let e=0;e<32;++e){Re[e][0]=Re[e][e]=1,n0[e+1]=n0[e]*(e+1);for(let t=1;t<e;++t)Re[e][t]=Re[e-1][t-1]+Re[e-1][t]}});function G(e,t){let r=new Array(e);if(t!==void 0)for(let n=0;n<e;n++)r[n]=new Array(t);return r}function lR(e){return new ml[e]}function mt(e,t,r,...n){let o=ml[e];o&&!o.___clazz$?Z=o.prototype:(!o&&(o=ml[e]=function(){}),Z=o.prototype=t<0?{}:lR(t),Z.castableTypeMap$=r);for(let l of n)l.prototype=Z;o.___clazz$&&(Z.___clazz$=o.___clazz$,o.___clazz$=null)}function Pr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function wg(){}function iR(e,t){let r=vg(0,t);return Eg(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function vg(e,t){let r=new Array(t);if(e===3)for(let n=0;n<t;++n){let o={m:0,l:0,h:0};o.l=o.m=o.h=0,r[n]=o}else if(e>0){let n=[null,0,!1][e];for(let o=0;o<t;++o)r[o]=n}return r}function c0(e,t,r,n,o){let l=vg(o,n);return Eg(e,t,r,l),l}function Eg(e,t,r,n){return _g(),sR(n,i0,a0),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function Hi(e,t,r){return e[t]=r}function _g(){ig||(ig=!0,i0=[],a0=[],aR(new wg,i0,a0))}function aR(e,t,r){let n=0,o;for(let l in e)(o=e[l])&&(t[n]=l,r[n]=o,++n)}function sR(e,t,r){_g();for(let n=0,o=t.length;n<o;++n)e[t[n]]=r[n]}function fR(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function uR(e,t){return e!==null&&fR(e,t)}function gR(){if(ag)return!1;ag=!0,ia=G(15582,36),aa=G(15582),Mt=G(15582),so=G(48,48),Ct=G(48,36),ao=G(48),B0=G(48)}function m0(e){e.ct=G(24)}function sg(e,t){let r,n;if(uR(t,xg)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function Zi(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=Re[t][n--]);return r}function Wi(e){let t,r;if(po!==null)return po[Zi(e)];for(r=0;r<48;++r){if(t=RR(Zi(e)),t!==-1)return t*64+r;le(e,0),r%2===1&&le(e,1),r%8===7&&le(e,2),r%16===15&&le(e,3)}}function zt(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.ct,16,17,18,19,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.ct,20,21,22,23,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break;case 7:h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break;case 10:h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function le(e,t){switch(t){case 0:zt(e,19),zt(e,28);break;case 1:zt(e,21),zt(e,32);break;case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.ct,16,19,21,22,1),h(e.ct,17,18,20,23,1);break;case 3:zt(e,18),zt(e,29),zt(e,24),zt(e,35)}}function fg(e,t){let r;for(r=0;r<t;++r)le(e,0),r%2===1&&le(e,1),r%8===7&&le(e,2),r%16===15&&le(e,3)}function L0(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=Re[r][n]&&(t-=Re[r][n--],e.ct[r]=1)}function Ki(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function Ll(){let e;for(m0(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function Qi(e,t){let r;for(m0(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function gl(e){let t;for(m0(this),t=0;t<24;++t)this.ct[t]=e[t]}function pR(){let e,t,r=new Ll,n=new Ll;for(e=0;e<15582;++e)for(L0(n,aa[e]),t=0;t<36;++t)Ki(r,n),zt(r,t),ia[e][t]=Wi(r)}function cR(){let e,t,r,n,o,l,i,a;for(ga(Mt),Mt[0]=0,t=0,r=1;r!==15582;)for(l=t>4,a=l?-1:t,e=l?t:-1,++t,n=0;n<15582;++n)if(Mt[n]===a){for(i=0;i<27;++i)if(o=~~ia[n][i]>>>6,Mt[o]===e)if(++r,l){Mt[n]=t;break}else Mt[o]=t}}function mR(e){let t,r,n,o=new gl(e.ct);for(n=0;n<48;++n){for(t=!0,r=0;r<24;++r)if(o.ct[r]!==~~(r/4)){t=!1;break}if(t)return n;le(o,0),n%2===1&&le(o,1),n%8===7&&le(o,2),n%16===15&&le(o,3)}return-1}function LR(){let e,t,r,n=new Ll;for(e=0;e<24;++e)n.ct[e]=e;let o=new gl(n.ct),l=new gl(n.ct),i=new gl(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)sg(n,o)&&(so[e][t]=r,r===0&&(ao[e]=t)),le(o,0),r%2===1&&le(o,1),r%8===7&&le(o,2),r%16===15&&le(o,3);le(n,0),t%2===1&&le(n,1),t%8===7&&le(n,2),t%16===15&&le(n,3)}le(n,0),e%2===1&&le(n,1),e%8===7&&le(n,2),e%16===15&&le(n,3)}for(e=0;e<48;++e)for(Ki(n,l),fg(n,ao[e]),t=0;t<36;++t)for(Ki(o,n),zt(o,t),fg(o,e),r=0;r<36;++r)if(Ki(i,l),zt(i,r),sg(i,o)){Ct[e][t]=r;break}for(L0(n,0),e=0;e<48;++e)B0[ao[e]]=Zi(n),le(n,0),e%2===1&&le(n,1),e%8===7&&le(n,2),e%16===15&&le(n,3)}function BR(){let e,t,r,n,o=new Ll,l=G(22984);for(t=0;t<22984;t++)l[t]=0;for(e=0,t=0;t<735471;++t)if((l[~~t>>>5]&1<<(t&31))===0){for(L0(o,t),n=0;n<48;++n)r=Zi(o),l[~~r>>>5]|=1<<(r&31),po!==null&&(po[r]=e<<6|ao[n]),le(o,0),n%2===1&&le(o,1),n%8===7&&le(o,2),n%16===15&&le(o,3);aa[e++]=t}}function RR(e){let t=od(aa,e);return t>=0?t:-1}function dR(){ug||(ug=!0,$i=G(70,28),Xi=G(6435,28),Pg=G(70,16),zg=G(6435,16),ot=G(450450),Cg=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0])}function Ji(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=Re[t][n--]);return r}function Yi(e){let t,r,n;for(r=0,n=4,t=6;t>=0;--t)e.rl[t]!==e.rl[7]&&(r+=Re[t][n--]);return r*2+e.parity}function io(e,t){e.parity^=Cg[t];let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.rl,0,1,2,3,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.rl,4,5,6,7,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.rl,0,5,4,1,r),h(e.ct,8,9,12,13,r);break;case 7:h(e.rl,0,1,2,3,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.rl,0,3,6,5,r),h(e.ct,3,2,5,4,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.rl,3,2,7,6,r),h(e.ct,11,10,15,14,r);break;case 10:h(e.rl,4,5,6,7,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.rl,1,4,7,2,r),h(e.ct,1,0,7,6,r)}}function no(e,t){switch(t){case 0:io(e,19),io(e,28);break;case 1:io(e,21),io(e,32);break;case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.rl,0,3,5,6,1),h(e.rl,1,2,4,7,1)}}function kg(e,t,r){let n;for(n=0;n<16;++n)e.ct[n]=~~(t.ct[n]/2);for(n=0;n<8;++n)e.rl[n]=t.ct[n+16];e.parity=r}function gg(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.ct[r]=1):e.ct[r]=0}function pg(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.rl[r]=1):e.rl[r]=0}function R0(){this.rl=G(8),this.ct=G(16)}function hR(){let e,t,r,n,o,l,i,a,s,f,u=new R0;for(o=0;o<70;++o)for(a=0;a<28;++a)pg(u,o),io(u,pn[a]),$i[o][a]=Yi(u);for(o=0;o<70;++o)for(pg(u,o),i=0;i<16;++i)Pg[o][i]=Yi(u),no(u,0),i%2===1&&no(u,1),i%8===7&&no(u,2);for(o=0;o<6435;++o)for(gg(u,o),i=0;i<16;++i)zg[o][i]=Ji(u)&65535,no(u,0),i%2===1&&no(u,1),i%8===7&&no(u,2);for(o=0;o<6435;++o)for(a=0;a<28;++a)gg(u,o),io(u,pn[a]),Xi[o][a]=Ji(u)&65535;for(ga(ot),ot[0]=ot[18]=ot[28]=ot[46]=ot[54]=ot[56]=0,r=0,n=6;n!==450450;){let g=r>6,p=g?-1:r,c=g?r:-1;for(++r,o=0;o<450450;++o)if(ot[o]===p){for(e=~~(o/70),s=o%70,a=0;a<23;++a)if(t=Xi[e][a],f=$i[s][a],l=t*70+f,ot[l]===c)if(++n,g){ot[o]=r;break}else ot[l]=r}}}function FR(){cg||(cg=!0,pl=G(29400,20),Ng=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],kr=G(29400),F0=[0,9,14,23,27,28,41,42,46,55,60,69],D0=G(70))}function d0(e){let t,r,n,o;for(r=0,o=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=Re[t][o--]);for(r*=35,o=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=Re[t][o--]);r*=12;let l=e.fb[7]^e.ud[7];for(n=0,o=4,t=7;t>=0;--t)e.rl[t]!==l&&(n+=Re[t][o--]);return e.parity+2*(r+D0[n])}function DR(e,t){switch(e.parity^=Ng[t],t){case 0:case 1:case 2:h(e.ud,0,1,2,3,t%3);break;case 3:h(e.rl,0,1,2,3,1);break;case 4:case 5:case 6:h(e.fb,0,1,2,3,(t-1)%3);break;case 7:case 8:case 9:h(e.ud,4,5,6,7,(t-1)%3);break;case 10:h(e.rl,4,5,6,7,1);break;case 11:case 12:case 13:h(e.fb,4,5,6,7,(t+1)%3);break;case 14:h(e.ud,0,1,2,3,1),h(e.rl,0,5,4,1,1),h(e.fb,0,5,4,1,1);break;case 15:h(e.rl,0,1,2,3,1),h(e.fb,1,4,7,2,1),h(e.ud,1,6,5,2,1);break;case 16:h(e.fb,0,1,2,3,1),h(e.ud,3,2,5,4,1),h(e.rl,0,3,6,5,1);break;case 17:h(e.ud,4,5,6,7,1),h(e.rl,3,2,7,6,1),h(e.fb,3,2,7,6,1);break;case 18:h(e.rl,4,5,6,7,1),h(e.fb,0,3,6,5,1),h(e.ud,0,3,4,7,1);break;case 19:h(e.fb,4,5,6,7,1),h(e.ud,0,7,6,1,1),h(e.rl,1,4,7,2,1)}}function Mg(e,t,r){let n,o=(t.ct[0]>t.ct[8]?1:0)^(t.ct[8]>t.ct[16]?1:0)^(t.ct[0]>t.ct[16]?1:0)?1:0;for(n=0;n<8;++n)e.ud[n]=t.ct[n]&1^1,e.fb[n]=t.ct[n+8]&1^1,e.rl[n]=t.ct[n+16]&1^1^o;e.parity=o^r}function AR(e,t){let r,n,o,l;for(e.parity=t&1,t>>>=1,o=F0[t%12],t=~~(t/12),l=4,r=7;r>=0;--r)e.rl[r]=0,o>=Re[r][l]&&(o-=Re[r][l--],e.rl[r]=1);for(n=t%35,t=~~(t/35),l=4,e.fb[7]=0,r=6;r>=0;--r)n>=Re[r][l]?(n-=Re[r][l--],e.fb[r]=1):e.fb[r]=0;for(l=4,e.ud[7]=0,r=6;r>=0;--r)t>=Re[r][l]?(t-=Re[r][l--],e.ud[r]=1):e.ud[r]=0}function h0(){this.ud=G(8),this.rl=G(8),this.fb=G(8)}function yR(){let e,t,r,n;for(r=0;r<12;++r)D0[F0[r]]=r;let o=new h0;for(r=0;r<29400;++r)for(n=0;n<20;++n)AR(o,r),DR(o,n),pl[r][n]=d0(o)&65535;for(ga(kr),kr[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(kr[r]===e)for(n=0;n<17;++n)kr[pl[r][n]]===-1&&(kr[pl[r][n]]=e+1,++t);++e}}function UR(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function bR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ct,0,1,2,3,r);break;case 1:h(e.ct,16,17,18,19,r);break;case 2:h(e.ct,8,9,10,11,r);break;case 3:h(e.ct,4,5,6,7,r);break;case 4:h(e.ct,20,21,22,23,r);break;case 5:h(e.ct,12,13,14,15,r);break;case 6:h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break;case 7:h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break;case 8:h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break;case 9:h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break;case 10:h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break;case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function A0(){let e;for(this.ct=G(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function Tg(e){let t,r,n;for(A0.call(this),t=0;t<23;++t)n=t+e(24-t),this.ct[n]!==this.ct[t]&&(r=this.ct[t],this.ct[t]=this.ct[n],this.ct[n]=r)}function xR(){mg||(mg=!0,Ut=G(18),vR())}function Gg(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function Og(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function SR(e,t){!e.temps&&(e.temps=new sa),Ig(e,Ut[t],e.temps),Og(e,e.temps)}function wR(e,t){let r,n;for(n=0,r=6;r>=0;--r)n+=e.co[r]=t%3,t=~~(t/3);e.co[7]=(15-n)%3}function Ig(e,t,r){let n,o,l,i;for(n=0;n<8;++n)r.cp[n]=e.cp[t.cp[n]],l=e.co[t.cp[n]],i=t.co[n],o=l,o=o+(l<3?i:6-i),o=o%3,(l>=3?1:0)^(i>=3?1:0)&&(o=o+3),r.co[n]=o}function sa(){Gg(this)}function _r(e,t){Gg(this),og(this.cp,e),wR(this,t)}function Wg(e){_r.call(this,e(40320),e(2187))}function vR(){let e,t;for(Ut[0]=new _r(15120,0),Ut[3]=new _r(21021,1494),Ut[6]=new _r(8064,1236),Ut[9]=new _r(9,0),Ut[12]=new _r(1230,412),Ut[15]=new _r(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)Ut[e+t+1]=new sa,Ig(Ut[e+t],Ut[e],Ut[e+t+1])}function ER(){Lg||(Lg=!0,Pt=G(1937880),fa=G(1538),ra=G(1538),Bo=G(11880),Vg=[0,1,6,3,4,5,2,7],U0=G(160,12),b0=G(160,12),y0=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],s0=[0,2,4,6,1,3,7,5,8,9,10,11])}function oo(e,t,r,n,o){let l=e.edgeo[o];e.edgeo[o]=e.edge[n],e.edge[n]=e.edgeo[r],e.edgeo[r]=e.edge[t],e.edge[t]=l}function co(e,t){let r,n,o,l,i;for(e.isStd||jg(e),n=0,i=1985229328,l=47768,r=0;r<t;++r)o=e.edge[r]<<2,n*=12-r,o>=32?(n+=l>>o-32&15,l-=4368<<o-32):(n+=i>>o&15,l-=4369,i-=286331152<<o);return n}function Kg(e){let t,r=co(e,4);t=Bo[r];let n=t&7;t>>=3,ta(e,n);let o=co(e,10)%20160;return t*20160+o}function ea(e,t){switch(e.isStd=!1,t){case 0:ue(e.edge,0,4,1,5),ue(e.edgeo,0,4,1,5);break;case 1:De(e.edge,0,4,1,5),De(e.edgeo,0,4,1,5);break;case 2:ue(e.edge,0,5,1,4),ue(e.edgeo,0,5,1,4);break;case 3:De(e.edge,5,10,6,11),De(e.edgeo,5,10,6,11);break;case 4:ue(e.edge,0,11,3,8),ue(e.edgeo,0,11,3,8);break;case 5:De(e.edge,0,11,3,8),De(e.edgeo,0,11,3,8);break;case 6:ue(e.edge,0,8,3,11),ue(e.edgeo,0,8,3,11);break;case 7:ue(e.edge,2,7,3,6),ue(e.edgeo,2,7,3,6);break;case 8:De(e.edge,2,7,3,6),De(e.edgeo,2,7,3,6);break;case 9:ue(e.edge,2,6,3,7),ue(e.edgeo,2,6,3,7);break;case 10:De(e.edge,4,8,7,9),De(e.edgeo,4,8,7,9);break;case 11:ue(e.edge,1,9,2,10),ue(e.edgeo,1,9,2,10);break;case 12:De(e.edge,1,9,2,10),De(e.edgeo,1,9,2,10);break;case 13:ue(e.edge,1,10,2,9),ue(e.edgeo,1,10,2,9);break;case 14:De(e.edge,0,4,1,5),De(e.edgeo,0,4,1,5),ue(e.edge,9,11),ue(e.edgeo,8,10);break;case 15:De(e.edge,5,10,6,11),De(e.edgeo,5,10,6,11),ue(e.edge,1,3),ue(e.edgeo,0,2);break;case 16:De(e.edge,0,11,3,8),De(e.edgeo,0,11,3,8),ue(e.edge,5,7),ue(e.edgeo,4,6);break;case 17:De(e.edge,2,7,3,6),De(e.edgeo,2,7,3,6),ue(e.edge,8,10),ue(e.edgeo,9,11);break;case 18:De(e.edge,4,8,7,9),De(e.edgeo,4,8,7,9),ue(e.edge,0,2),ue(e.edgeo,1,3);break;case 19:De(e.edge,1,9,2,10),De(e.edgeo,1,9,2,10),ue(e.edge,4,6),ue(e.edgeo,5,7)}}function fo(e,t){switch(e.isStd=!1,t){case 0:ea(e,14),ea(e,17);break;case 1:oo(e,11,5,10,6),oo(e,5,10,6,11),oo(e,1,2,3,0),oo(e,4,9,7,8),oo(e,8,4,9,7),oo(e,0,1,2,3);break;case 2:yt(e,4,5),yt(e,5,4),yt(e,11,8),yt(e,8,11),yt(e,7,6),yt(e,6,7),yt(e,9,10),yt(e,10,9),yt(e,1,1),yt(e,0,0),yt(e,3,3),yt(e,2,2)}}function ta(e,t){for(;t>=2;)t-=2,fo(e,1),fo(e,2);t!==0&&fo(e,0)}function dl(e,t){let r,n,o,l,i,a;for(i=1985229328,a=47768,o=0,r=0;r<11;++r)if(n=y0[11-r],l=~~(t/n),t=t%n,o^=l,l<<=2,l>=32){l=l-32,e.edge[r]=a>>l&15;let s=(1<<l)-1;a=(a&s)+(a>>4&~s)}else{e.edge[r]=i>>l&15;let s=(1<<l)-1;i=(i&s)+(i>>>4&~s)+(a<<28),a=a>>4}for((o&1)===0?e.edge[11]=i:(e.edge[11]=e.edge[10],e.edge[10]=i),r=0;r<12;++r)e.edgeo[r]=r;e.isStd=!0}function Bg(e,t){let r;for(r=0;r<12;++r)e.edge[r]=t.edge[r],e.edgeo[r]=t.edgeo[r];e.isStd=t.isStd}function Qg(e,t){let r,n,o,l;for(e.temp===null&&(e.temp=G(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[s0[r]+12]%12;for(n=1,r=0;r<12;++r)for(;e.edge[r]!==r;)l=e.edge[r],e.edge[r]=e.edge[l],e.edge[l]=l,o=e.temp[r],e.temp[r]=e.temp[l],e.temp[l]=o,n^=1;for(r=0;r<12;++r)e.edge[r]=e.temp[t.ep[s0[r]]%12];return n}function jg(e){let t;for(e.temp===null&&(e.temp=G(12)),t=0;t<12;++t)e.temp[e.edgeo[t]]=t;for(t=0;t<12;++t)e.edge[t]=e.temp[e.edge[t]],e.edgeo[t]=t;e.isStd=!0}function De(e,t,r,n,o){let l;l=e[t],e[t]=e[n],e[n]=l,l=e[r],e[r]=e[o],e[o]=l}function yt(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function sr(){this.edge=G(12),this.edgeo=G(12)}function _R(){let e,t,r,n,o,l,i,a,s,f,u,g,p,c,L,m,R,F,A,U,x,S,M=new sr,J=new sr,C=new sr;for(ga(Pt),a=0,Ii=1,o0(Pt,0,0);Ii!==31006080&&(L=a>9,i=a%3,l=(a+1)%3,f=L?3:i,e=L?i:3,!(a>=9));){for(g=0;g<31006080;g+=16)if(S=Pt[~~g>>4],!(!L&&S===-1)){for(u=g,s=g+16;u<s;++u,S>>=2)if((S&3)===f){for(A=~~(u/20160),t=fa[A],n=u%20160,dl(M,t*20160+n),R=0;R<17;++R)if(r=mo(M.edge,R<<3,4),U=Bo[r],x=U&7,U>>=3,o=mo(M.edge,R<<3|x,10)%20160,p=U*20160+o,Bl(Pt,p)===e){if(o0(Pt,L?u:p,l),++Ii,L)break;if(F=ra[U],F!==1)for(Bg(J,M),ea(J,R),ta(J,x),m=1;(F=~~F>>1&65535)!==0;++m)(F&1)===1&&(Bg(C,J),ta(C,m),c=U*20160+co(C,10)%20160,Bl(Pt,c)===e&&(o0(Pt,c,l),++Ii))}}}++a}}function Bl(e,t){return e[t>>4]>>((t&15)<<1)&3}function mo(e,t,r){let n,o,l,i,a,s=b0[t],f=U0[t];for(o=0,a=1985229328,i=47768,n=0;n<r;++n)l=s[e[f[n]]]<<2,o*=12-n,l>=32?(o+=i>>l-32&15,i-=4368<<l-32):(o+=a>>l&15,i-=4369,a-=286331152<<l);return o}function qg(e){let t,r,n,o,l,i,a,s,f,u,g,p=new sr;if(i=0,l=Bl(Pt,e),l===3)return 10;for(;e!==0;)for(l===0?l=2:--l,f=~~(e/20160),t=fa[f],n=e%20160,dl(p,t*20160+n),s=0;s<17;++s)if(r=mo(p.edge,s<<3,4),u=Bo[r],g=u&7,u>>=3,o=mo(p.edge,s<<3|g,10)%20160,a=u*20160+o,Bl(Pt,a)===l){++i,e=a;break}return i}function kR(e,t){let r=Bl(Pt,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function zR(){let e,t,r,n=new sr;for(t=0;t<20;++t)for(r=0;r<8;++r){for(dl(n,0),ea(n,t),ta(n,r),e=0;e<12;++e)U0[t<<3|r][e]=n.edge[e];for(jg(n),e=0;e<12;++e)b0[t<<3|r][e]=n.temp[e]}}function CR(){let e,t,r,n,o=new sr,l=G(1485);for(t=0;t<1485;t++)l[t]=0;for(e=0,t=0;t<11880;++t)if((l[~~t>>>3]&1<<(t&7))===0){for(dl(o,t*y0[8]),n=0;n<8;++n)r=co(o,4),r===t&&(ra[e]=(ra[e]|1<<n)&65535),l[~~r>>3]=l[~~r>>3]|1<<(r&7),Bo[r]=e<<3|Vg[n],fo(o,0),n%2===1&&(fo(o,1),fo(o,2));fa[e++]=t}}function o0(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function PR(){Rg||(Rg=!0)}function MR(e){let t,r,n;for(t=0,n=!1,r=0;r<12;++r)t|=1<<e.ep[r],n=n!==e.ep[r]>=12;return t&=~~t>>12,t===0&&!n}function NR(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function TR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r);break;case 1:h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r);break;case 2:h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r);break;case 3:h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r);break;case 4:h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r);break;case 5:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r);break;case 6:h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r),h(e.ep,9,22,11,20,r);break;case 7:h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r),h(e.ep,2,16,6,12,r);break;case 8:h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r),h(e.ep,3,19,5,13,r);break;case 9:h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r),h(e.ep,8,23,10,21,r);break;case 10:h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r),h(e.ep,14,0,18,4,r);break;case 11:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r),h(e.ep,7,15,1,17,r)}}function x0(){let e;for(this.ep=G(24),e=0;e<24;++e)this.ep[e]=e}function Hg(e){let t,r,n;for(x0.call(this),t=0;t<23;++t)n=t+e(24-t),n!==t&&(r=this.ep[t],this.ep[t]=this.ep[n],this.ep[n]=r)}function GR(){dg||(dg=!0,f0=[35,1,34,2,4,6,22,5,19])}function Zg(e){e.moveBuffer=G(60)}function OR(e,t){return e.value-t.value}function Lo(e,t){let r;for(NR(e.edge,t.edge),UR(e.center,t.center),Og(e.corner,t.corner),e.value=t.value,e.add1=t.add1,e.length1=t.length1,e.length2=t.length2,e.length3=t.length3,e.sym=t.sym,r=0;r<60;++r)e.moveBuffer[r]=t.moveBuffer[r];e.moveLength=t.moveLength,e.edgeAvail=t.edgeAvail,e.centerAvail=t.centerAvail,e.cornerAvail=t.cornerAvail}function zr(e){for(;e.centerAvail<e.moveLength;)bR(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function Jg(e){for(;e.cornerAvail<e.moveLength;)SR(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function Rl(e){for(;e.edgeAvail<e.moveLength;)TR(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function IR(e){let t,r,n,o,l,i,a=new Array(e.moveLength-(e.add1?2:0));for(r=0,t=0;t<e.length1;++t)a[r++]=e.moveBuffer[t];for(i=e.sym,t=e.length1+(e.add1?2:0);t<e.moveLength;++t)Ct[i][e.moveBuffer[t]]>=27?(a[r++]=Ct[i][e.moveBuffer[t]]-9,o=f0[Ct[i][e.moveBuffer[t]]-27],i=so[i][o]):a[r++]=Ct[i][e.moveBuffer[t]];let s=so[ao[i]][mR(zr(e))];for(l="",i=s,t=r-1;t>=0;--t)n=a[t],n=~~(n/3)*3+(2-n%3),Ct[i][n]>=27?(l=l+u0[Ct[i][n]-9]+" ",o=f0[Ct[i][n]-27],i=so[i][o]):l=l+u0[Ct[i][n]]+" ";return l}function gn(e,t){e.moveBuffer[e.moveLength++]=t}function na(){Zg(this),this.edge=new x0,this.center=new A0,this.corner=new sa}function ua(e){na.call(this),Lo(this,e)}function Yg(e){Zg(this),this.edge=new Hg(e),this.center=new Tg(e),this.corner=new Wg(e)}function WR(e,t){return t.value-e.value}function oa(e,t){return WR(e,t)}function Xg(){}function KR(){if(hg)return;hg=!0;let e,t;for(u0=["U ","U2 ","U' ","R ","R2 ","R' ","F ","F2 ","F' ","D ","D2 ","D' ","L ","L2 ","L' ","B ","B2 ","B' ","Uw ","Uw2","Uw'","Rw ","Rw2","Rw'","Fw ","Fw2","Fw'","Dw ","Dw2","Dw'","Lw ","Lw2","Lw'","Bw ","Bw2","Bw'"],pn=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,21,22,23,25,28,30,31,32,34,36],ul=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],Fg=G(37),Dg=G(37),lo=G(37,36),ji=G(29,28),qi=G(21,20),l0=G(36),cl=G(28),uo=G(20),e=0;e<29;++e)Fg[pn[e]]=e;for(e=0;e<21;++e)Dg[ul[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)lo[e][t]=~~(e/3)===~~(t/3)||~~(e/3)%3===~~(t/3)%3&&e>t;lo[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)ji[e][t]=lo[pn[e]][pn[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)qi[e][t]=lo[ul[e]][ul[t]];for(e=0;e<36;++e)for(l0[e]=36,t=e;t<36;++t)if(!lo[e][t]){l0[e]=t-1;break}for(e=0;e<28;++e)for(cl[e]=28,t=e;t<28;++t)if(!ji[e][t]){cl[e]=t-1;break}for(e=0;e<20;++e)for(uo[e]=20,t=e;t<20;++t)if(!qi[e][t]){uo[e]=t-1;break}}function QR(e){let t,r,n,o,l,i,a,s,f,u,g,p;e.solution="";let c=Wi(new Qi(zr(e.c),0)),L=Wi(new Qi(zr(e.c),1)),m=Wi(new Qi(zr(e.c),2)),R=Mt[~~c>>6],F=Mt[~~L>>6],A=Mt[~~m>>6];for(e.p1SolsCnt=0,e.arr2idx=0,$R(e.p1sols.heap),e.length1=(R<F?R:F)<A?R<F?R:F:A;e.length1<100&&!(A<=e.length1&&Vi(e,~~m>>>6,m&63,e.length1,-1,0)||R<=e.length1&&Vi(e,~~c>>>6,c&63,e.length1,-1,0)||F<=e.length1&&Vi(e,~~L>>>6,L&63,e.length1,-1,0));++e.length1);let U=ud(e.p1sols,c0(pd,Pr([rR,g0,p0]),Sg,0,0));U.sort(function(M,J){return M.value-J.value}),t=9;do{e:for(s=U[0].value;s<100;++s)for(i=0;i<U.length&&!(U[i].value>s);++i)if(!(s-U[i].length1>t)&&(Lo(e.c1,U[i]),kg(e.ct2,zr(e.c1),la(Rl(e.c1).ep)),g=Ji(e.ct2),p=Yi(e.ct2),e.length1=U[i].length1,e.length2=s-U[i].length1,$g(e,g,p,e.length2,28,0)))break e;++t}while(s===100);e.arr2.sort(function(M,J){return M.value-J.value}),a=0,r=13;do{e:for(f=e.arr2[0].value;f<100;++f)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>f);++i)if(!(f-e.arr2[i].length1-e.arr2[i].length2>r)&&(l=Qg(e.e12,Rl(e.arr2[i])),Mg(e.ct3,zr(e.arr2[i]),l^la(Jg(e.arr2[i]).cp)),n=d0(e.ct3),o=co(e.e12,10),u=qg(Kg(e.e12)),u<=f-e.arr2[i].length1-e.arr2[i].length2&&ep(e,o,n,u,f-e.arr2[i].length1-e.arr2[i].length2,20,0))){a=i;break e}++r}while(f===100);let x=new ua(e.arr2[a]);e.length1=x.length1,e.length2=x.length2;let S=f-e.length1-e.length2;for(i=0;i<S;++i)gn(x,ul[e.move3[i]]);e.solution=IR(x)}function jR(e,t){let r,n;for(Lo(e.c1,e.c),r=0;r<e.length1;++r)gn(e.c1,e.move1[r]);switch(B0[t]){case 0:gn(e.c1,24),gn(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break;case 12869:gn(e.c1,18),gn(e.c1,29),e.move1[e.length1]=18,e.move1[e.length1+1]=29,e.add1=!0,t=34;break;case 735470:e.add1=!1,t=0}kg(e.ct2,zr(e.c1),la(Rl(e.c1).ep));let o=Ji(e.ct2),l=Yi(e.ct2),i=ot[o*70+l];return e.c1.value=i+e.length1,e.c1.length1=e.length1,e.c1.add1=e.add1,e.c1.sym=t,++e.p1SolsCnt,e.p1sols.heap.size<500?n=new ua(e.c1):(n=sd(e.p1sols),n.value>e.c1.value&&Lo(n,e.c1)),JR(e.p1sols,n),e.p1SolsCnt===1e4}function qR(e){let t;for(Lo(e.c2,e.c1),t=0;t<e.length2;++t)gn(e.c2,e.move2[t]);if(!MR(Rl(e.c2)))return!1;let r=Qg(e.e12,Rl(e.c2));Mg(e.ct3,zr(e.c2),r^la(Jg(e.c2).cp));let n=d0(e.ct3);co(e.e12,10);let o=qg(Kg(e.e12));return e.arr2[e.arr2idx]?Lo(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new ua(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(o,kr[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function VR(e,t){return rp(),e.c=new Yg(t),QR(e),e.solution}function Vi(e,t,r,n,o,l){let i,a,s,f,u,g;if(t===0)return n===0&&jR(e,r);for(i=0;i<27;i+=3)if(!(i===o||i===o-9||i===o-18))for(f=0;f<3;++f){if(s=i+f,a=ia[t][Ct[r][s]],u=Mt[~~a>>>6],u>=n){if(u>n)break;continue}if(g=so[r][a&63],a>>>=6,e.move1[l]=s,Vi(e,a,g,n-1,i,l+1))return!0}return!1}function $g(e,t,r,n,o,l){let i,a,s,f;if(t===0&&ot[r]===0)return n===0&&qR(e);for(a=0;a<23;++a){if(ji[o][a]){a=cl[a];continue}if(i=Xi[t][a],f=$i[r][a],s=ot[i*70+f],s>=n){s>n&&(a=cl[a]);continue}if(e.move2[l]=pn[a],$g(e,i,f,n-1,a,l+1))return!0}return!1}function ep(e,t,r,n,o,l,i){let a,s,f,u,g,p,c,L,m;if(o===0)return t===0&&r===0;for(dl(e.tempe[i],t),g=0;g<17;++g){if(qi[l][g]){g=uo[g];continue}if(f=pl[r][g],p=kr[f],p>=o){p>o&&g<14&&(g=uo[g]);continue}if(u=mo(e.tempe[i].edge,g<<3,10),a=~~(u/20160),L=Bo[a],m=L&7,L>>=3,s=mo(e.tempe[i].edge,g<<3|m,10)%20160,c=kR(L*20160+s,n),c>=o){c>o&&g<14&&(g=uo[g]);continue}if(ep(e,u,f,c,o-1,g,i+1))return e.move3[i]=g,!0}return!1}function tp(){let e;for(this.p1sols=new sp(new Xg),this.move1=G(15),this.move2=G(20),this.move3=G(20),this.c1=new na,this.c2=new na,this.ct2=new R0,this.ct3=new h0,this.e12=new sr,this.tempe=G(20),this.arr2=G(100),e=0;e<20;++e)this.tempe[e]=new sr}function rp(){Ag||(LR(),po=G(735471),BR(),pR(),po=null,cR(),hR(),yR(),zR(),CR(),_R(),Ag=!0)}function HR(){yg||(yg=!0)}function la(e){let t,r,n,o;for(o=0,t=0,n=e.length;t<n;++t)for(r=t;r<n;++r)e[t]>e[r]&&(o^=1);return o}function h(e,t,r,n,o,l){let i;switch(l){case 0:i=e[o],e[o]=e[n],e[n]=e[r],e[r]=e[t],e[t]=i;return;case 1:i=e[t],e[t]=e[n],e[n]=i,i=e[r],e[r]=e[o],e[o]=i;return;case 2:i=e[t],e[t]=e[r],e[r]=e[n],e[n]=e[o],e[o]=i;return}}function np(){}function op(e,t,r,n){let o=new np;return o.typeName=e+t,ip(r!==0?-r:0)&&ap(r!==0?-r:0,o),o.modifiers=4,o.superclass=S0,o.componentType=n,o}function lp(e,t,r,n){let o=new np;return o.typeName=e+t,ip(r)&&ap(r,o),o.superclass=n,o}function ZR(e){let t=ml[e.seedId];return e=null,t}function ip(e){return typeof e=="number"&&e>0}function ap(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=ZR(t);if(n)r=n.prototype;else{n=ml[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function JR(e,t){if(ad(e,t))return!0}function YR(e){e.array=c0(fp,Pr([g0,p0]),bg,0,0)}function XR(e,t){return Hi(e.array,e.size++,t),!0}function $R(e){e.array=c0(fp,Pr([g0,p0]),bg,0,0),e.size=0}function Cr(e,t){return e.array[t]}function ed(e,t){let r=e.array[t];return nd(e.array,t,1),--e.size,r}function go(e,t,r){let n=e.array[t];return Hi(e.array,t,r),n}function td(e,t){let r;for(t.length<e.size&&(t=iR(t,e.size)),r=0;r<e.size;++r)Hi(t,r,e.array[r]);return t.length>e.size&&Hi(t,e.size,null),t}function rd(){YR(this),this.array.length=500}function nd(e,t,r){e.splice(t,r)}function od(e,t){let r,n,o,l;for(n=0,r=e.length-1;n<=r;)if(o=n+(~~(r-n)>>1),l=e[o],l<t)n=o+1;else if(l>t)r=o-1;else return o;return-n-1}function ga(e){ld(e,e.length)}function ld(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function id(e,t){let r,n,o,l,i=e.heap.size,a=Cr(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,o=n+1,l=n,o<i&&oa(Cr(e.heap,o),Cr(e.heap,n))<0&&(l=o),l),!(oa(a,Cr(e.heap,r))<0));)go(e.heap,t,Cr(e.heap,r)),t=r;go(e.heap,t,a)}function ad(e,t){let r,n;for(n=e.heap.size,XR(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),oa(Cr(e.heap,n),t)<=0)return go(e.heap,r,t),!0;go(e.heap,r,Cr(e.heap,n))}return go(e.heap,n,t),!0}function sd(e){if(e.heap.size===0)return null;let t=Cr(e.heap,0);return fd(e),t}function fd(e){let t=ed(e.heap,e.heap.size-1);0<e.heap.size&&(go(e.heap,0,t),id(e,0))}function ud(e,t){return td(e.heap,t)}function sp(e){this.heap=new rd,this.cmp=e}function gp(){Ug||(Ug=!0,KR(),HR(),gR(),dR(),FR(),ER(),xR(),PR(),GR(),up=new tp)}function cd(){gp(),rp()}async function md(){we(),gp();let e=E.fromString(VR(up,await ve()));return(await ro()).concat(e)}var Z,ml,$B,bg,g0,xg,eR,tR,Sg,rR,nR,oR,p0,ig,i0,a0,ag,Mt,ia,B0,po,aa,ao,Ct,so,ug,Xi,ot,zg,Cg,$i,Pg,cg,pl,Ng,kr,F0,D0,mg,Ut,Lg,s0,Ii,Pt,y0,U0,b0,Bo,fa,Vg,ra,Rg,dg,f0,hg,lo,ji,qi,pn,u0,ul,l0,cl,uo,Fg,Dg,Ag,yg,S0,fp,gd,pd,up,Ug,pp=y(()=>{Be();r0();lg();Dt();Ft();ml={},$B={},bg=0,g0=30,xg=21,eR=22,tR=23,Sg=24,rR=25,nR=34,oR=26,p0=40;mt(1,-1,$B);Z.value=null;mt(73,1,{},wg);Z.queryId$=0;ig=!1;ag=!1;mt(153,1,Pr([xg]),Ll,Qi,gl);po=null,ug=!1;mt(154,1,{},R0);Z.parity=0;cg=!1;mt(155,1,{},h0);Z.parity=0;mt(156,1,{},A0,Tg);mg=!1;mt(157,1,Pr([eR]),sa,_r,Wg);Z.temps=null;Lg=!1;mt(158,1,Pr([tR]),sr);Z.isStd=!0;Z.temp=null;Ii=0,Rg=!1;mt(159,1,{},x0,Hg);dg=!1;mt(160,1,Pr([Sg,nR]),na,ua,Yg);Z.compareTo$=function(t){return OR(this,t)};Z.add1=!1;Z.center=null;Z.centerAvail=0;Z.corner=null;Z.cornerAvail=0;Z.edge=null;Z.edgeAvail=0;Z.length1=0;Z.length2=0;Z.length3=0;Z.moveLength=0;Z.sym=0;Z.value=0;mt(161,1,{},Xg);Z.compare=function(t,r){return oa(t,r)};hg=!1;mt(163,1,Pr([oR]),tp);Z.add1=!1;Z.arr2idx=0;Z.c=null;Z.length1=0;Z.length2=0;Z.p1SolsCnt=0;Z.solution="";Ag=!1,yg=!1;Z.val$outerIter=null;Z.size=0;mt(239,1,{},sp);Z.cmp=null;Z.heap=null;S0=lp("java.lang.","Object",1,null),fp=op("[Ljava.lang.","Object;",356,S0),gd=lp("cs.threephase.","FullCube",160,S0),pd=op("[Lcs.threephase.","FullCube;",381,gd),Ug=!1});var cp={};Bt(cp,{initialize:()=>cd,random444Scramble:()=>md});var mp=y(()=>{pp()});function Fl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function pa(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function xp(e,t,r,n,o=e-t-r-n){return pa(e,t+r)*pa(t+r,t)*pa(n+o,n)}function Fd(e){e=e.slice();let t=e.length,r=Fl(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Dd(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function T0(e,t){let r=[],n=Fl(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function cn(e){return Fd(e)>>1}function P0(e,t){let r=[0];for(let n=1;n<e;n++){let o=t(n+1);r[n]=r[o],r[o]=n}return r}function hp(e,t){let r=P0(e,t);return Dd(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function Ad(e){return e|=0,31-Math.clz32(e^e-1)}function Fp(e,t){e|=0,t|=0;let r=e+" "+t;if(E0[r])return E0[r];let n=pa(e,t),o=new Uint32Array(n),l=new Uint32Array(1<<e).fill(-1);for(let i=0,a=(1<<t)-1;i<n;i++){o[i]=a,l[a]=i;let s=a|a-1;a=s+1|(~s&-~s)-1>>Ad(a)+1}return E0[r]=[o,l]}function yd(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function Dp(e){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,e}function Ud(e,t){return Dp(e)|Dp(t)<<1}function Do(e,t,r,n,o){if(e|=0,t|=0,r|=0,n|=0,o|=0,e!==t+r+n+o)throw new Error("generate_comb4_lookup_tables: invalid parameters");let l=[e,t,r,n,o].join(" ");if(_0[l])return _0[l];let[i,a]=Fp(e,r+o),[s,f]=Fp(e,n+o),u=xp(e,t,r,n,o),g=new Uint32Array(u),p=new Uint32Array(4**e).fill(-1);for(let c=0,L=0;c<s.length;c++){let m=s[c];for(let R=0;R<i.length;R++){let F=i[R];if(yd(F&m)===o){let A=Ud(F,m);g[L]=A,p[A]=L,L++}}}return _0[l]=[g,p]}function $e(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Ao(e,t,r){let n=[];for(let o=0;o<r.length;o++)n[o]=e[t[r[o]]];return n}function G0(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n of e)for(let o=0;o<n.length;o++)r[n[o]]=n[(o+1)%n.length];return r}function mn(e,t){let r=e.length,n=Array(r).fill(0);for(let i=1;i<r;i++)n[i]=n[i-1]+t[i-1];let o=n[r-1]+t[r-1],l=Array(o);for(let i=0;i<r;i++)t[i]&&(l[n[i]]=n[e[i]]);return l}function O0(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function bd(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function xd(e,t){return e*t/bd(e,t)}function Sd(e){let t=1,r=e.length,n=Array(r).fill(!1),o=-1;for(;o=n.indexOf(!1,o+1),o!==-1;){let l=0,i=o;for(;!n[i];)n[i]=!0,i=e[i],l++;t=xd(t,l)}return t}function Pd(e,t){for(let r=0;r<6;r++){if(e===Nt[Mr[r][0]]&&t===Nt[Mr[r][2]])return[r,0];if(e===Nt[Mr[r][2]]&&t===Nt[Mr[r][0]])return[r,1]}throw new Error("unknown corner piece")}function Md(e,t){for(let r=0;r<12;r++)if(e===Nt[Nr[r][0]]&&t===Nt[Nr[r][1]]||t===Nt[Nr[r][0]]&&e===Nt[Nr[r][1]])return r;throw new Error("unknown edge piece")}function I0(e,t){return Pd(e[Mr[t][0]],e[Mr[t][2]])}function da(e,t){return Md(e[Nr[t][0]],e[Nr[t][1]])}function Nd(e,t,r,n){let o=Mr[t],l=Mr[r].map(i=>Nt[i]);n%2!==0&&(l=[l[2],l[3],l[0],l[1]]);for(let i=0;i<4;i++)e[o[i]]=l[i]}function Td(e,t,r){let n=Nr[t],o=Nr[r].map(l=>Nt[l]);for(let l=0;l<2;l++)e[n[l]]=o[l]}function vp(e){let t=e.map(s=>Nt[s]),n=Array(6).fill().map((s,f)=>I0(t,f)).map(([s,f])=>s+6*f),o=n.concat(n.map(s=>(s+6)%12)),l=Array(12).fill().map((s,f)=>da(t,f)),i=Array(12).fill().map((s,f)=>Ln.indexOf(e[Ln[f]])),a=Array(12).fill().map((s,f)=>Ro.indexOf(e[Ro[f]]));return{cp:o,ep:l,ap:i,bp:a}}function Od(e){let t=Array(72),r=hp(5,e);r.push(5);let n=Array(4).fill().map(a=>e(2));n.push(n.reduce((a,s)=>a^s)),n.push(0);for(let a=0;a<6;a++)Nd(t,a,r[a],n[a]);let o=hp(12,e);for(let a=0;a<12;a++)Td(t,a,o[a]);let l=P0(12,e).map(a=>a/3|0),i=P0(12,e).map(a=>4+(a/3|0));for(let a=0;a<12;a++)t[Ln[a]]=l[a],t[Ro[a]]=i[a];return t}function _p(e,t=!1){if(t){e=e.map(m=>m.slice());let c=[0,1,2,3,4,5,6,7],L=[[0,3,5,6,4,7,1,2],[7,1,0,6,3,5,4,2],[7,4,2,1,3,0,6,5],[2,4,5,3,6,0,1,7]];L=L.concat(L.map(m=>O0(m)));for(let m=0;m<e.length;m++)if(e[m][0]<4)e[m][0]=c[e[m][0]];else{let R=c[e[m][0]],F=e[m][1];e[m][0]=R,c=$e(F===1?L[R^4]:L[R],c)}}let r=t?"U L F R D BR B BL".split(" "):Gd,n=["0","","'"];return e.map(([l,i])=>r[l]+n[i]).join(" ")}function Tr(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=$e(e,Ep[r]);return e}function kp(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function La(e,t=!1){if(e.length===0)return[];let r=[],n;for(let[o,l]of e)n&&n[0]===o?(n[1]+=l,n[1]%=3,n[1]===0&&(r.pop(),n=r.length===0?void 0:r[r.length-1])):r.length>=2&&(n[0]^o)===4&&r[r.length-2][0]===o?(r[r.length-2][1]+=l,r[r.length-2][1]%=3,r[r.length-2][1]===0&&r.splice(r.length-2,1)):(n=[o,l],r.push(n));return t&&""+e!=""+r&&console.log(\`simplified \${e} to \${r}\`),r}function Id(e){return _p(kp(Qd(Od(e),!0)),!0)}function ho(e,t,r,n,o,l){let i=xp(e,t,r,n,o),a=l.length,[s,f]=Do(e,t,r,n,o),u=Array(a).fill().map(()=>new Uint32Array(i));for(let g=0;g<i;g++){let p=s[g],c=Array(e);for(let L=0;L<e;L++)c[L]=p>>2*L&3;for(let L=0;L<a;L++){let R=$e(c,l[L]).reduce((F,A,U)=>F|A<<2*U,0);u[L][g]=f[R]}}return u}function zp(e){let t=e[0].length,r=e.length,n=Array(r).fill().map(()=>new Uint32Array(t));for(let o=0;o<t;o++)for(let l=0;l<r;l++)n[l][e[l][o]]=o;return n}function Rn(e,t){let r=e[0].length,n=t[0].length,o=e.length,l=Array(o).fill().map(()=>new Uint32Array(r*n));for(let i=0;i<n;i++)for(let a=0;a<r;a++){let s=a+r*i;for(let f=0;f<o;f++)l[f][s]=e[f][a]+r*t[f][i]}return l}function Wd(e,t){let r=e.length,n=e[0].length,o=new Uint8Array(n);o[t]=1;let l=!1;for(;!l;){l=!0;for(let a=0;a<n;a++)if(!!o[a])for(let s=0;s<r;s++)o[e[s][a]]||(o[e[s][a]]=1,l=!1)}let i=new Int32Array(n).fill(-1);for(let a=0,s=0;a<n;a++)!o[a]||(i[a]=s,s++);return[e.map(a=>mn(a,o)),i]}function Kd(e,t){let r=e.length,n=e[0].length,o=new Int32Array(n).fill(-1);t.forEach(s=>{o[s]=0});let l=[t];for(let s=0;s<l.length;s++){let f=l[s];for(let u=0;u<r;u++){let g=e[u][f[0]];if(o[g]!==-1)continue;let p=f.map(L=>e[u][L]),c=l.length;l.push(p);for(let L of p){if(o[L]!==-1)throw new Error("quotienting failed");o[L]=c}}}let i=l.length,a=Array(r).fill().map(()=>new Int32Array(i));for(let s=0;s<r;s++)for(let f=0;f<i;f++)a[s][f]=o[e[s][l[f][0]]];return[a,o]}function Cp(e,t,r){let n=e[0].length,o=e.length,l=new Int32Array(n).fill(-1);l[t]=r,l[r]=t;let i=!1;for(;!i;){i=!0;for(let a=0;a<n;a++){if(l[a]===-1)continue;let s=l[a];for(let f=0;f<o;f++){let u=f^1,g=e[f][a],p=e[u][e[u][s]];if(l[g]===-1)i=!1,l[g]=p,l[p]=g;else if(l[g]!==p)throw new Error("mirroring failed - is the initial map correct?")}}}return l}function Pp(e,t){let r=e[0].length,n=e.length,o=new Int8Array(r).fill(-1);for(let a of t)o[a]=0;let l=0,i=!1;for(;!i;){i=!0;for(let a=0;a<r;a++)if(o[a]===l)for(let s=0;s<n;s++){let f=e[s][a];for(;f!==a;)o[f]===-1&&(i=!1,o[f]=l+1),f=e[s][f]}l++}return o}function Qd(e,t=!1){let r=Zd(e).next().value,n=Tr(e,r),o=(t?gh:uh)(n),l=La(r.concat(o),!1);return Tr(e,l).join("")!==Dl.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(o),console.log(Tr(e,l))),l}function qd(e){let[t,r]=Do(12,6,0,3,3),n=Array(12).fill().map((a,s)=>da(e,s)),o=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[l,i]=[Ln,Ro].map(a=>{let s=a.map(f=>jd[e[f]]);return r[s.reduce((f,u,g)=>f|u<<2*g,0)]});return[o,l,i]}function Mp(){if(K.phase1_edge)return K.phase1_edge;let e=zp(Bn.map(n=>n.ep)),t=Rn(e,e),r=Rn(t,t);return K.phase1_edge=r}function Vd(){return ur.phase1_edge?ur.phase1_edge:ur.phase1_edge=Pp(Mp(),[8+12*9+12**2*10+12**3*11])}function Hd(){return K.phase1_centreA?K.phase1_centreA:K.phase1_centreA=ho(12,6,0,3,3,Bn.map(e=>e.ap))}function Np(){return K.phase1_centreB?K.phase1_centreB:K.phase1_centreB=ho(12,6,0,3,3,Bn.map(e=>e.bp))}function Ap(){if(ur.phase1_centre)return ur.phase1_centre;let[e,t]=Do(12,6,0,3,3),r=e.filter(n=>{let o=n>>12&3,l=n>>18&3;return o===2&&l===3}).map(n=>t[n]);return ur.phase1_centre=Pp(Np(),r)}function*Zd(e){let t=[Mp(),Hd(),Np()],r=[Vd(),Ap(),Ap()];yield*Jd(qd(e),t,r,15)}function*Jd(e,t,r,n){let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;)yield*Tp(e,t,r,l,-1),l++}function*Tp(e,t,r,n,o){let l=3,i=8,a=Math.max(r[0][e[0]],r[1][e[1]],r[2][e[2]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===o||s===o-4)continue;let f=[];f[0]=t[0][s][e[0]],f[1]=t[1][s][e[1]],f[2]=t[2][s][e[2]];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=Tp(f,t,r,n-1,s);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[s,u]].concat(p)}f[0]=t[0][s][f[0]],f[1]=t[1][s][f[1]],f[2]=t[2][s][f[2]],u++}}}}function W0(e){let[t,r]=Do(10,5,3,2,0),n=Array(8).fill().map((p,c)=>da(e,c)),o=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),l=Array(5).fill().map((p,c)=>I0(e,c)),i=O0(l.map(([p,c])=>p+5*c).concat(l.map(([p,c])=>p+5*(c^1)))),a=i.slice(0,5).map(p=>p%5),s=i.slice(0,5).map(p=>p/5|0),f=cn(a)*8+(s[0]^s[2])+2*(s[0]^s[3])+4*s[4],[u,g]=[Ln,Ro].map(p=>{let c=$e(p,Xd).map(L=>Yd[e[L]]);return r[c.reduce((L,m,R)=>L|m<<2*R,0)]});return Ip(),Qp(),[u,g,Kp[f]+40*Op[o]]}function*Ba(e){yield*nh(W0(e),30)}function Gp(){if(K.phase2_centre)return K.phase2_centre;let e=ho(10,5,3,2,0,Bn.slice(0,4).map(r=>mn(r.ap,yp))),t=ho(10,5,3,2,0,Bn.slice(0,4).map(r=>mn(r.bp,yp)));return K.phase2_centre=[e,t]}function Ip(){if(K.phase2_edge)return K.phase2_edge;let e=zp(Bn.slice(0,4).map(n=>n.ep.slice(0,8))),t=Rn(e,Rn(e,e)),r;return[r,Op]=Wd(t,501),K.phase2_edge=r}function Wp(){if(K.phase2_corner)return K.phase2_corner;let t=Fl(5)/2*8,r=[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!1],n=Array(4).fill().map(()=>new Uint32Array(t)),o=Bn.slice(0,4).map(l=>O0(mn(l.cp,r)));for(let l=0;l<t;l++){let i=T0(l>>3,5),a=[0,0,l&1,l>>1&1,l>>2&1];a[1]=a[2]^a[3]^a[4];let s=Array(10);for(let f=0;f<5;f++)s[f]=i[f]+5*a[f],s[f+5]=i[f]+5*(a[f]^1);for(let f=0;f<4;f++){let u=$e(o[f],s),g=u.slice(0,5).map(L=>L%5),p=u.slice(0,5).map(L=>L/5|0),c=(p[0]^p[2])+2*(p[0]^p[3])+4*p[4];n[f][l]=cn(g)*8+c}}return K.phase2_corner=n}function Qp(){return K.phase2_corner_compact||([K.phase2_corner_compact,Kp]=Kd(Wp(),th())),K.phase2_corner_compact}function K0(){if(K.phase2_ce)return K.phase2_ce;let e=Qp(),t=Ip();return K.phase2_ce=Rn(e,t)}function $d(){if(k0)return k0;let e=W0(Dl)[2];return k0=Cp(K0(),e,e)}function eh(){let[e,t]=Do(10,5,3,2,0);return e.filter(r=>(r>>10&63)===41).map(r=>t[r])}function th(){let e=Wp(),t=e[0].length,r=Array(t).fill(!1);r[0]=!0;let n=!1;for(;!n;){n=!0;for(let o=0;o<t;o++)r[o]&&(r[e[0][o]]||(n=!1,r[e[0][o]]=!0),r[e[1][o]]||(n=!1,r[e[1][o]]=!0))}return r.map((o,l)=>l).filter(o=>r[o])}function rh(){if(ur.phase2_ace)return ur.phase2_ace;let[e,t]=Gp(),r=K0(),n=2520,o=40*336,l=n*o,i=W0(Dl)[2],a=9,s=new Int8Array(l).fill(a);for(let f of eh())s[f+n*i]=0;for(let f=0;f<a-1;f++)for(let u=s.indexOf(f);u!==-1;u=s.indexOf(f,u+1)){let g=u%n,p=u/n|0;for(let c=0;c<4;c++){let L=e[c][g],m=r[c][p],R=L+n*m;s[R]===a&&(s[R]=f+1),L=e[c][L],m=r[c][m],R=L+n*m,s[R]===a&&(s[R]=f+1)}}return ur.phase2_ace=s}function*nh(e,t){let[r,n]=Gp(),o=K0(),l=rh(),i=$d(),[a,s,f]=e,u=i[f],g=Math.max(l[a+2520*f],l[s+2520*u]);for(;g<=t;)yield*jp(a,s,f,r,n,o,l,i,g,-1),g++}function*jp(e,t,r,n,o,l,i,a,s,f){let u=Math.max(i[e+2520*r],i[t+2520*a[r]]);if(!(u>s)){if(s===0){yield[];return}else if(u===0)return;for(let g=0;g<4;g++){if(g===f)continue;let p=e,c=t,L=r;for(let m=1;m<=2;m++){p=n[g][p],c=o[g][c],L=l[g][L];let R=jp(p,c,L,n,o,l,i,a,s-1,g);for(;;){let{value:F,done:A}=R.next();if(A)break;yield[[g,m]].concat(F)}}}}}function ha(e){let[t,r]=Do(7,3,2,0,2),n=Array(5).fill().map((f,u)=>da(e,u)),o=cn(n),l=Array(4).fill().map((f,u)=>I0(e,u)),i=cn(l.map(f=>f[0]))*2+l.find(f=>f[0]===0)[1],[a,s]=[Ln,Ro].map(f=>{let u=$e(f,oh).map(g=>e[g]%4);return r[u.reduce((g,p,c)=>g|p<<2*c,0)]});return[a+210*s,i+24*o]}function ih(){if(K.phase3_2gen_edge)return K.phase3_2gen_edge;let e=Fl(5)/2,t=Array(Fo).fill().map(()=>new Uint32Array(e)),r=Ra.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let o=T0(n,5);for(let l=0;l<Fo;l++)t[l][n]=cn($e(o,r[l]))}return K.phase3_2gen_edge=t}function ah(){if(K.phase3_2gen_corner)return K.phase3_2gen_corner;let t=Fl(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(Fo).fill().map(()=>new Uint32Array(t)),o=Ra.map(l=>mn(l.cp,r).slice(0,4));for(let l=0;l<t;l+=2){let i=T0(l>>1,4),a=i.concat(i.map(s=>s+4));for(let s=0;s<Fo;s++){let f=$e(a,o[s]),u=f.map(p=>p%4),g=f.find(p=>p%4===0)>>2;n[s][l]=cn(u)*2+g,n[s][l+1]=cn(u)*2+(g^1)}}return K.phase3_2gen_corner=n}function Fa(){return K.phase3_2gen_corneredge?K.phase3_2gen_corneredge:K.phase3_2gen_corneredge=Rn(ah(),ih())}function Q0(){if(K.phase3_2gen_centre)return K.phase3_2gen_centre;let e=ho(7,3,2,0,2,Ra.map(r=>mn(r.ap,Up))),t=ho(7,3,2,0,2,Ra.map(r=>mn(r.bp,Up)));return K.phase3_2gen_centreA=e,K.phase3_2gen_centreB=t,K.phase3_2gen_centre=Rn(e,t)}function Vp(){if(z0)return z0;let e=Q0(),t=K.phase3_2gen_centreA,r=Fa(),n=t[0].length,o=r[0].length,l=n*o,i=25,a=gr.map(p=>p.length),s=new Int8Array(l).fill(i),f=ha(Dl);s[f[0]%n+n*f[1]]=0;let u=0,g=!1;for(;!g&&u<i-1;){g=!0;let p=Array(Fo).fill().map((F,A)=>A).filter(F=>a[F]+u<i);p.sort((F,A)=>a[F]-a[A]);let c=$e(a,p),L=$e(t,p),m=$e(r,p),R=p.length;for(let F=s.indexOf(u);F!==-1;F=s.indexOf(u,F+1)){let A=F%n,U=F/n|0;for(let x=0;x<R;x++){let S=c[x],M=L[x][A],J=m[x][U],C=M+n*J;s[C]>u+S&&(g=!1,s[C]=u+S)}}u++}return z0=s}function Hp(){if(C0)return C0;let e=Fa().slice(0,2),t=ha(Dl);return C0=Cp(e,t[1],t[1])}function M0(e,t=ha(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=Q0(),a=K.phase3_2gen_centreA,s=K.phase3_2gen_centreB,f=Fa(),u=Vp(),g=Hp(),p=0;for(;;){let c=j0(o,l,n,a,s,f,u,g,p);for(let L of c)return L.map(m=>gr[m]).flat();p++}}function bp(e,t=ha(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=Q0(),a=K.phase3_2gen_centreA,s=K.phase3_2gen_centreB,f=Fa(),u=Vp(),g=Hp(),p=M0(e).length,c=1/0,L;for(let m=p;m<=p+0;m++){let R=j0(o,l,n,a,s,f,u,g,m);for(let F of R){let A=F.map(S=>gr[S]).flat(),U=La(A),x=N0(U);x<c&&(c=x,L=U)}}return L}function sh(e){return(e-1)*(e-2)/2}function N0(e){let t=_p(e,!0).replace(/'/g,"").split(" ");return e.length+fh(t).map(sh).reduce((r,n)=>r+n,0)}function fh(e){if(e.length<3)return[];let t=e.length,r=[];for(let l=0;l<t-2;l++)r[l]=e[l]===e[l+2];r.push(!1);let n=-1,o=[];for(;n<t-2&&(n=r.indexOf(!0,n+1),n!==-1);){let l=r.indexOf(!1,n+1);o.push(l-n),n=l}return o}function*j0(e,t,r,n,o,l,i,a,s,f=-1){let u=i[e+210*r],g=i[t+210*a[r]],p=Math.max(u,g);if(!(p>s)){if(s===0){yield[];return}if(p!==0)for(let c=0;c<Fo;c++){if(c===f&&lh[c]<=3)continue;let L=n[c][e],m=o[c][t],R=l[c][r],F=s-gr[c].length;if(F<0)continue;let A=j0(L,m,R,n,o,l,i,a,F,c);for(;;){let{value:U,done:x}=A.next();if(x)break;yield[c].concat(U)}}}}function uh(e,t=200,r=24){let n=[],o=Ba(e),l=$e(e,qt).map(s=>s^1),i=Ba(l),a=Array(1e3);for(let s=0;s<t;s++){{let{value:f,done:u}=o.next();if(!u){let g=Tr(e,f),p=f.concat(M0(g));if(p.length<=r)return p;p.length<a.length&&(a=p)}}{let{value:f,done:u}=i.next();if(!u){let g=Tr(l,f),p=f.concat(M0(g)).map(([c,L])=>[c^2,L]);if(p.length<=r)return p;p.length<a.length&&(a=p)}}}return a}function gh(e,t=20,r=30){let n=[],o=Ba(e),l=$e(e,qt).map(f=>f^1),i=Ba(l),a,s=1/0;for(let f=0;f<t;f++){{let{value:u,done:g}=o.next();if(!g){let p=Tr(e,u),c=La(u.concat(bp(p))),L=N0(c);if(L<=r)return c;L<s&&(a=c,s=L)}}{let{value:u,done:g}=i.next();if(!g){let p=Tr(l,u),c=La(u.concat(bp(p)));c=c.map(([m,R])=>[m^2,R]);let L=N0(c);if(L<=r)return c;L<s&&(a=c,s=L)}}}return a}async function ch(){return Id(await ph)}var aU,sU,E0,_0,Dl,hl,wd,qt,fU,ca,Sp,vd,Ed,_d,ma,kd,wp,zd,Cd,Nt,Mr,Nr,Ln,Ro,Ep,Gd,Bn,K,ur,jd,Yd,Xd,yp,Op,Kp,k0,oh,Up,gr,Fo,qp,Ra,lh,z0,C0,ph,Zp=y(()=>{Dt();[aU,sU]=(()=>{let e=new Int8Array(2048),t=new Int8Array(256*8);for(let o=0;o<256;o++)for(let l=0,i=0;l<8;l++)(o>>>l&1)!==0&&(e[l<<8|o]=i,t[i<<8|o]=l,i++);function r(o){let l=255,i=2520,a=0;for(let s=0;s<6;s++){let f=o[s];a+=e[l|f<<8]*i,l&=~(1<<f),i/=7-s}return a}function n(o,l){let i=255,a=2520,s=0;for(let f=0;f<6;f++){let u=o/a|0;o-=u*a,s^=u&1;let g=t[i|u<<8];l[f]=g,i&=~(1<<g),a/=7-f}return l[6]=t[i|s<<8],l[7]=t[i|(s^1)<<8],l}return[r,n]})();E0={};_0={};Dl=Array(72).fill().map((e,t)=>t/9|0),hl=G0([[0,4,8],[1,6,3],[2,5,7],[9,22,35],[45,67,44],[47,68,43],[46,69,39],[50,70,38],[49,71,36]],72),wd=$e(hl,hl),qt=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),fU=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),ca=Array(72).fill().map((e,t)=>(t+36)%72),Sp=Ao(ca,wd,ca),vd=Ao(qt,hl,qt),Ed=Ao(qt,Sp,qt),_d=G0([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),ma=$e(hl,_d),kd=$e(ma,ma),wp=Ao(ca,kd,ca),zd=Ao(qt,ma,qt),Cd=Ao(qt,wp,qt),Nt=Array(72).fill().map((e,t)=>t/9|0),Mr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],Nr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],Ln=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),Ro=Ln.map(e=>e+36);Ep=[hl,Sp,vd,Ed,ma,wp,zd,Cd],Gd=["U","L","F","R","u","l","f","r"],Bn=Ep.map(vp);K={},ur={},jd=[0,0,2,3,0,0,2,3];Yd=[0,1,2,0,0,1,2,0],Xd=[0,1,2,3,4,5,7,8,10,11],yp=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];oh=[0,1,2,3,4,10,11],Up=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],gr=[[[0,1]],[[1,1]],[[2,1],[0,1],[3,1],[0,2],[3,2],[2,2]],[[3,2],[1,2],[2,2],[1,1],[2,1],[3,1]],[[6,1],[0,1],[3,1],[0,2],[3,2],[6,2]],[[7,2],[1,2],[2,2],[1,1],[2,1],[7,1]],[[2,1],[0,1],[2,2],[0,1],[2,1],[0,1],[2,2]],[[3,2],[1,1],[3,1],[1,1],[3,2],[1,1],[3,1]],[[2,1],[3,1],[2,2],[1,2],[0,2],[2,1],[3,1],[2,2]],[[3,2],[2,2],[3,1],[0,1],[1,1],[3,2],[2,2],[3,1]],[[6,1],[0,1],[6,2],[0,2],[1,2],[6,1],[0,1],[6,2]],[[7,2],[1,2],[7,1],[1,1],[0,1],[7,2],[1,2],[7,1]],[[2,1],[3,2],[2,2],[3,1],[0,1],[2,2],[1,1],[2,1]],[[3,2],[2,1],[3,1],[2,2],[1,2],[3,1],[0,2],[3,2]],[[6,1],[0,2],[6,2],[7,1],[6,1],[1,2],[7,1],[6,1]],[[7,2],[1,1],[7,1],[6,2],[7,2],[0,1],[6,2],[7,2]],[[2,2],[1,2],[2,2],[3,2],[2,2],[3,2],[0,2],[3,2]],[[6,2],[7,2],[1,2],[0,2],[1,2],[0,2],[6,2],[7,2]]];gr=gr.concat(gr.map(e=>kp(e)));Fo=gr.length,qp=gr.map(e=>Tr(G0([],72),e)),Ra=qp.map(vp),lh=qp.map(Sd);ph=ve()});var Jp={};Bt(Jp,{randomFTOScrambleString:()=>ch});var Yp=y(()=>{Zp()});async function $p(){return mh??(mh=Lh())}async function Lh(){return Qt(await Pe.fto.kpuzzle(),\`SubgroupSizes 24 12 11 12 12 11 10 9 11 8 10 9 7 8 10 10 6 9 8 5 7 6 5 4 4 8 7 3 6 6 360
3145
3145
 
3146
3146
  Alg T
3147
3147
  Alg B
@@ -3760,9 +3760,9 @@ Alg BR' B U BR' R BR R' U' BR B'
3760
3760
  Alg F' BL' BR R' BR BL BR' R BR' F
3761
3761
  Alg BR L' BL BR' BL' BR' L U BR U'
3762
3762
  Alg U BR' U' BR BL' BR BL BR'
3763
- \`)}var ah,Hp=y(()=>{tr();Kn();ah=null});function Fl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Wa(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function uh(e){e=e.slice();let t=e.length,r=Fl(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function gh(e,t){let r=[],n=Fl(t-1);for(let o=0;o<t;o++)r[o]=e/n|0,e%=n,n/=t-1-o;for(let o=t-2;o>=0;o--)for(let l=o+1;l<t;l++)r[l]+=+(r[l]>=r[o]);return r}function Zp(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function ph(e,t){let r=[],n=Fl(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function Jp(e){return uh(e)>>1}function Yp(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let o=Wa(t-1,r),l=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?o=o*--n/t:(l+=o,o=o*r--/t);return l}function ch(e,t,r){let n=r-t,o=Wa(r-1,t),l=[],i=r-1;for(let s=0;s<i;s++)r--,e<o?(l.push(0),o=o*--n/r):(l.push(1),e-=o,o=o*t--/r);return l.push(t),l}function R0(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Gr(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Ir(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function mh(e,t){let r=Array(8).fill(0);for(let n=0;n<8;n++)r[n]=(e[1][n]+t[1][n])%3;return[R0(e[0],t[0]),r]}function Uh(e){let t=["0","","'"];return e.map(([n,o])=>yh[n]+t[o]).join(" ")}function xh(e){let t=ph(Math.floor(e(Fl(12))/2),12),r=Array(8);for(let n=0;n<8;n++)r[n]=e(3);return[t,r]}function bh(e){return Sh(xh(e))}function Sh(e){let t=wh(e),r=[$p(),ec()],n=[Eh(),_h()],o=[tc(),kh()],l=[zh(),vh()],i=Ph(t,r,n),s,a=new Set,f=+new Date;for(let u=0;u<25;u++){let{value:g,done:p}=i.next(),c=e;for(let[U,b]of g)for(let S=0;S<b;S++)c=mh(c,hl[U]);if(a.has(c.toString()))continue;a.add(c.toString());let L=Jp(c[0].slice(0,8)),m=0;for(let U=0;U<4;U++)m+=c[1][U]*3**U;let R=[L,m],F=s?s.length-g.length-1:999999,A=Ch(R,o,l,F);if(A!==void 0&&((s===void 0||s.length>g.length+A.length)&&(s=g.concat(A)),new Date-f>300))break}return s}function wh(e){let t=0;for(let l=0;l<4;l++)t+=e[0].indexOf(l+8)*12**l;let r=0;for(let l=0;l<4;l++)r+=e[1][l+4]*3**l;let n=e[0].map(l=>Math.max(-1,l-8)),o=Yp(n.map(l=>+(l>=0)))*2+Zp(n.filter(l=>l>=0));return[t,r+81*o]}function Xp(){if(me.phase1cm)return me.phase1cm;let e=[];for(let t=0;t<81;t++){e[t]=Array(8);let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t][0]=e[t][1]=e[t][2]=e[t][3]=t;for(let n=0;n<4;n++)r[n]=(r[n]+2)%3,e[t][4+n]=r[0]+r[1]*3+r[2]*9+r[3]*27,r[n]=(r[n]+1)%3}return me.phase1cm=e}function vh(){if(me.phase1cp)return me.phase1cp;let e=Array(81);for(let t=0;t<81;t++){let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t]=(r[0]!==0)+(r[1]!==0)+(r[2]!==0)+(r[3]!==0)}return me.phase1cp=e}function $p(){if(me.phase1em)return me.phase1em;let e=[];for(let r=0;r<12;r++){e[r]=[];for(let n=0;n<8;n++)e[r][n]=hl[n][0].indexOf(r)}let t=Array(12**4);for(let r=0;r<12**4;r++){t[r]=Array(8);for(let n=0;n<8;n++){let o=0;for(let l=0;l<4;l++)o+=e[Math.floor(r/12**l)%12][n]*12**l;t[r][n]=o}}return me.phase1em=t}function Eh(){return me.phase1ep?me.phase1ep:me.phase1ep=Ka($p(),[8+12*(9+12*(10+12*11))])}function ec(){if(me.phase1sm)return me.phase1sm;let e=Wa(12,4),t=[];for(let o=0;o<e;o++){t[o]=[];let l=ch(o,4,12),i=[];for(let s=0,a=0;s<12;s++)l[s]===0?i[s]=-1:i[s]=a++;for(let s=0;s<8;s++){let a=R0(i,hl[s][0]),f=R0(l,hl[s][0]),u=Zp(a.filter(g=>g>=0));t[o][s]=Yp(f)*2+u}}let r=Xp(),n=[];for(let o=0;o<e;o++)for(let l=0;l<81;l++){let i=n[l+81*(2*o)]=[],s=n[l+81*(2*o+1)]=[];for(let a=0;a<8;a++)i[a]=r[l][a]+81*t[o][a],s[a]=r[l][a]+81*(t[o][a]^1)}return me.phase1sm=n}function _h(){return me.phase1sp?me.phase1sp:me.phase1sp=Ka(ec(),[0])}function kh(){if(me.phase2cm)return me.phase2cm;let e=Xp(),t=Array(81);for(let r=0;r<81;r++)t[r]=e[r].slice(4,8);return me.phase2cm=t}function tc(){if(me.phase2em)return me.phase2em;let e=8,t=Fl(e)/2,r=Array(t),n=[0,1,2,3,4,5,6,7];for(let o=0;o<t;o++){r[o]=Array(4);for(let i=0;i<4;i++){let s=R0(n,hl[i][0].slice(0,8));r[o][i]=Jp(s)}if(o===t-1)break;let l=0;do for(let i=e-2;i>=0;i--){if(n[i]>n[i+1])continue;let s=i+1;for(let a=s;a<e;a++)n[a]>n[i]&&(s=a);[n[i],n[s]]=[n[s],n[i]],l^=1;for(let a=0;i+1+a<e-1-a;a++,l^=1)[n[i+1+a],n[e-1-a]]=[n[e-1-a],n[i+1+a]];break}while(l!==0)}return me.phase2em=r}function zh(){return me.phase2ep?me.phase2ep:me.phase2ep=Ka(tc(),[0])}function Ka(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1),l=t.slice(),i=[],s=0;for(;l.length>0;){i.length=0;for(let a of l)if(o[a]===-1){o[a]=s;for(let f=0;f<n;f++){let u=e[a][f];for(;u!=a;)i.push(u),u=e[u][f]}}[l,i]=[i,l],s+=1}return o}function Ch(e,t,r,n){n=n||999999;let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;){let i=rc(e,t,r,l,-1);if(i!==void 0)return i;l++}}function rc(e,t,r,n,o){let l=e.length,i=t[0][0].length,s=0;for(let a=0;a<l;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0)return[];if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===o||a<o&&d0[a]==d0[o])continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=rc(f,t,r,n-1,a);if(g!==void 0)return[[a,u]].concat(g);for(let p=0;p<l;p++)f[p]=t[p][f[p]][a];u++}}}}function*Ph(e,t,r){let n=e.length,o=0;for(let l=0;l<n;l++)o=Math.max(o,r[l][e[l]]);for(;;)yield*nc(e,t,r,o,-1),o++}function*nc(e,t,r,n,o){let l=e.length,i=t[0][0].length,s=0;for(let a=0;a<l;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===o||a<o&&d0[a]==d0[o])continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=nc(f,t,r,n-1,a);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[a,u]].concat(p)}for(let p=0;p<l;p++)f[p]=t[p][f[p]][a];u++}}}}async function oc(){return new E(Uh(bh(await Mh)))}var Lh,Bh,Rh,dh,hh,Fh,Dh,Ah,gU,hl,yh,d0,me,Mh,lc=y(()=>{"use strict";Be();Dt();Lh=[Gr([0,1,4],12),Ir({0:2},8)],Bh=[Gr([1,2,5],12),Ir({1:2},8)],Rh=[Gr([2,3,6],12),Ir({2:2},8)],dh=[Gr([3,0,7],12),Ir({3:2},8)],hh=[Gr([9,8,4],12),Ir({4:2},8)],Fh=[Gr([10,9,5],12),Ir({5:2},8)],Dh=[Gr([11,10,6],12),Ir({6:2},8)],Ah=[Gr([8,11,7],12),Ir({7:2},8)],gU=[gh(0,12),Array(8).fill(0)],hl=[Lh,Bh,Rh,dh,hh,Fh,Dh,Ah],yh=["UL","U","UR","F","L","B","R","D"],d0=[0,1,0,1,1,0,1,0];me={};Mh=ve()});var Qa={};Bt(Qa,{getRandomRediCubeScramble:()=>oc,sgsDataFTO:()=>Vp});var ja=y(()=>{Hp();lc()});function sc(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function F0(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function Nh(e){e=e.slice();let t=e.length,r=sc(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Th(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function Oh(e){return Nh(e)>>1}function Ha(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let o=F0(t-1,r),l=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?o=o*--n/t:(l+=o,o=o*r--/t);return l}function Wh(e,t,r){let n=r-t,o=F0(r-1,t),l=[],i=r-1;for(let s=0;s<i;s++)r--,e<o?(l.push(0),o=o*--n/r):(l.push(1),e-=o,o=o*t--/r);return l.push(t),l}function Vt(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Za(e,t){let r=Vt(e[0],t[0]),n=[],o=t[0].length;for(let l=0;l<o;l++)n[l]=(e[1][t[0][l]]+t[1][l])%3;return[r,n]}function yo(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Wr(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function Hh(e){let t=[0];for(let n=1;n<20;n++){let o=e(n+1);t[n]=t[o],t[o]=n}Th(t)===1&&([t[0],t[1]]=[t[1],t[0]]);let r=Array(20).fill(0);for(let n=0;n<19;n++)r[n]=e(3),r[19]+=3-r[n];return r[19]%=3,[t,r]}function Zh(e){let t=["0","","2","2'","'"];return e.map(([n,o])=>qh[n]+t[o]).join(" ")}function Jh(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=Za(e,dn[r]);return e}function Yh(e){return iF(Hh(e))}function $h(e){let t=e[0];if(t.slice(15,20).every(l=>l<15))return[];if(t.slice(0,5).every(l=>l<15))return[[6,1]];let r=t.map(l=>l>=15),n=0,o;for(;o===void 0;)n++,o=gc(r,n,-1);return o.push([6,1]),o}function gc(e,t,r){if(t==0)return e.slice(0,5).some(n=>n)?void 0:[];for(let n=0;n<6;n++)if(n!==r)for(let o=1;o<5;o++){let l=Vt(e,h0[n][o][0]),i=gc(l,t-1,n);if(i!==void 0)return[[n,o]].concat(i)}}function eF(e){let t=e[0].slice(0,15),r=e[1],n=Ha(t.map(i=>+(i>=15))),o=243*n;for(let i=0,s=0;i<15;i++)t[i]<15||(o+=r[i]*Math.pow(3,s),s++);let l=0;for(let i=0;i<5;i++)l+=t.indexOf(15+i)*Math.pow(15,i);return[o,l]}function tF(e){let t=[D0(),A0()],r=[sF(),fF()];return pc(eF(e),t,r).concat([[6,1]])}function rF(e){let t=[5,6,7,8,14],r=e[0].slice(0,15),n=e[1],o=Ha(r.map(s=>+(t.indexOf(s)!==-1))),l=243*o;for(let s=0,a=0;s<15;s++)t.indexOf(r[s])!==-1&&(l+=n[s]*Math.pow(3,a),a++);let i=0;for(let s=0;s<5;s++)i+=r.indexOf(t[s])*Math.pow(15,s);return[l,i]}function nF(e){let t=[D0(),A0()],r=[aF(),uF()];return pc(rF(e),t,r)}function oF(e){let t=e[0].slice(0,14),r=e[1],n=0,o=[],l=0;for(let i of[0,1,2,3,4,9,10,11,12,13])i!==13&&(n+=r[i]*Math.pow(3,l)),o[l]=t[i]<5?t[i]:t[i]-4,l++;return[n,Oh(o)]}function lF(e){return LF(oF(e))}function iF(e){let t=[];for(let r of[$h,tF,nF,lF]){let n=r(e);e=Jh(e,n),t=t.concat(n)}return t}function D0(){if(ne.phase23om)return ne.phase23om;let e=F0(15,5),t=[1,3,9,27,81,243],r=Array(F0(15,5)*t[5]);ne.phase23om=r;for(let n=0;n<e;n++){let o=Wh(n,5,15).concat(Array(5).fill(0)),l=[];for(let i=0;i<6;i++){let s=Vt(o,dn[i][0]).slice(0,15);l[i]=Ha(s)}for(let i=0;i<t[5];i++){r[i+243*n]=[];let s=[];for(let a=0,f=0;a<20;a++)o[a]===1?(s[a]=(i/t[f]|0)%3,f++):s[a]=99;for(let a=0;a<6;a++){let f=dn[a],u=[];for(let c=0;c<15;c++)u[c]=s[f[0][c]]+f[1][c];let g=u.filter(c=>c<10),p=0;for(let c=0;c<5;c++)p+=g[c]%3*t[c];r[i+243*n][a]=p+243*l[a]}}}return r}function sF(){if(ne.phase2op)return ne.phase2op;let e=D0();return ne.phase2op=Uo(e,[243*3002])}function aF(){if(ne.phase3op)return ne.phase3op;let e=D0();return ne.phase3op=Uo(e,[243*246])}function A0(){if(ne.phase23pm)return ne.phase23pm;let e=[1,15,225,Math.pow(15,3),Math.pow(15,4),Math.pow(15,5)],t=Array(e[5]),r=Array(15);for(let o=0;o<15;o++){r[o]=Array(6);for(let l=0;l<6;l++)r[o][l]=dn[l][0].indexOf(o)}let n=[0,0,0,0,0];for(let o=0;o<e[5];o++){t[o]=Array(6);for(let l=0;l<6;l++){let i=0;for(let s=0;s<5;s++)i+=r[n[s]][l]*e[s];t[o][l]=i}n[0]++;for(let l=0;l<4;l++)n[l]===15&&(n[l]=0,n[l+1]++)}return ne.phase23pm=t}function fF(){if(ne.phase2pp)return ne.phase2pp;let e=A0();return ne.phase2pp=Uo(e,[213090])}function uF(){if(ne.phase3pp)return ne.phase3pp;let e=A0();return ne.phase3pp=Uo(e,[737420])}function Ja(){if(ne.phase4om)return ne.phase4om;let e=[1,3,9,27,81,243,729,2187,6561,19683,59049],t=Array(e[9]);for(let r=0;r<e[9];r++){let n=Array(14).fill(0);for(let o=0;o<9;o++){let l=o<5?o:o+4;n[l]=(r/e[o]|0)%3,n[13]-=n[l]}n[13]=(n[13]+999)%3,t[r]=[];for(let o=0;o<3;o++){let l=dn[o],i=[0,1,2,3,4,9,10,11,12,13].map(a=>n[l[0][a]]+l[1][a]),s=0;for(let a=0;a<9;a++)s+=i[a]%3*e[a];t[r][o]=s}}return ne.phase4om=t}function Ya(){if(ne.phase4pm)return ne.phase4pm;let e=sc(10)/2,t=10,r=[0,1,2,3,4,-1,-1,-1,-1,5,6,7,8,9],n=[0,1,2,3,4,9,10,11,12,13],o=[Vt(r,Vt(ac[0],n)),Vt(r,Vt(fc[0],n)),Vt(r,Vt(uc[0],n))],l=Array(e),i=Array(10);for(let s=0;s<e;s++){Ih(s,i),l[s]=[];for(let a=0;a<3;a++){let f=Vt(i,o[a]);l[s][a]=Gh(f)}}return ne.phase4pm=l}function gF(){if(ne.phase4op)return ne.phase4op;let e=Ja();return ne.phase4op=Uo(e,[0])}function pF(){if(ne.phase4pp)return ne.phase4pp;let e=Ya();return ne.phase4pp=Uo(e,[0])}function cF(e){if(ne.phase4np_list&&ne.phase4np_list.threshold===e)return ne.phase4np_list;let t=[Ja(),Ya()],r=Math.pow(3,9),n=[0];o(e,[0,0],-1);function o(s,a,f){if(n.push(a[0]+r*a[1]),s===0)return;let u=[];for(let g=0;g<3;g++)if(g!==f){u[0]=a[0],u[1]=a[1];for(let p=1;p<5;p++)u[0]=t[0][u[0]][g],u[1]=t[1][u[1]][g],o(s-1,u,g)}}n.sort((s,a)=>s-a);let l=[],i=-1;for(let s of n)s!==i&&l.push(i=s);return l.threshold=e,ne.phase4np_list=l}function mF(e,t){let r=0,n=e.length-1;for(;n-r>1;){let o=r+n>>1;t>e[o]?r=o+1:n=o}return t===e[r]||t===e[n]}function Uo(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1);for(let s of t)o[s]=0;let l=0,i=!1;for(;!i;){i=!0;for(let s=0;s<r;s++)if(o[s]===l)for(let a=0;a<n;a++){let f=e[s][a];for(;f!==s;)o[f]===-1&&(i=!1,o[f]=l+1),f=e[f][a]}l++}return o}function pc(e,t,r){let n=e.length,o=0;for(let l=0;l<n;l++)o=Math.max(o,r[l][e[l]]);for(;;){let l=cc(e,t,r,o,-1);if(l!==void 0)return l;o++}}function cc(e,t,r,n,o){let l=e.length,i=t[0][0].length,s=0;for(let a=0;a<l;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0||s===0)return[];for(let a=0;a<i;a++){if(a===o)continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=cc(f,t,r,n-1,a);if(g!==void 0)return[[a,u]].concat(g);for(let p=0;p<l;p++)f[p]=t[p][f[p]][a];u++}}}}function LF(e){let t=Ja(),r=Ya(),n=gF(),o=pF(),l=cF(qa),i=Math.max(n[e[0]],o[e[1]]);for(;;){let s=mc(e,i,-1,t,r,n,o,l);if(s!==void 0)return s;i++}}function mc(e,t,r,n,o,l,i,s){let a=Math.max(l[e[0]],i[e[1]]);if(!(a>t)&&(a<=qa&&!mF(s,e[0]+19683*e[1])&&(a=qa+1),!(a>t))){if(t===0||a===0)return[];for(let f=0;f<3;f++){if(f===r)continue;let u=e.slice();for(let g=1;g<5;g++){u[0]=n[u[0]][f],u[1]=o[u[1]][f];let p=mc(u,t-1,f,n,o,l,i,s);if(p!==void 0)return[[f,g]].concat(p)}}}}async function Lc(){return new E(Zh(Yh(await BF)))}var qa,Gh,Ih,ac,fc,uc,Kh,Qh,jh,Va,xU,dn,qh,Vh,h0,Xh,ne,BF,Bc=y(()=>{"use strict";Be();Dt();qa=7;[Gh,Ih]=(()=>{let e=new Int8Array(10240),t=new Int8Array(1024*10);for(let o=0;o<1024;o++)for(let l=0,i=0;l<10;l++)(o>>>l&1)!==0&&(e[l<<10|o]=i,t[i<<10|o]=l,i++);function r(o){let l=1023,i=181440,s=0;for(let a=0;a<8;a++){let f=o[a];s+=e[l|f<<10]*i,l&=~(1<<f),i/=9-a}return s}function n(o,l){let i=1023,s=181440,a=0;for(let f=0;f<8;f++){let u=o/s|0;o-=u*s,a^=u&1;let g=t[i|u<<10];l[f]=g,i&=~(1<<g),s/=9-f}return l[8]=t[i|a<<10],l[9]=t[i|(a^1)<<10],l}return[r,n]})();ac=[yo([0,1,2,3,4],20),Wr({},20)],fc=[yo([4,3,11,12,13],20),Wr({4:2,3:1,11:1,12:1,13:1},20)],uc=[yo([3,2,9,10,11],20),Wr({3:2,2:1,9:1,10:1,11:1},20)],Kh=[yo([2,1,7,8,9],20),Wr({2:2,1:1,7:1,8:1,9:1},20)],Qh=[yo([1,0,5,6,7],20),Wr({1:2,0:1,5:1,6:1,7:1},20)],jh=[yo([0,4,13,14,5],20),Wr({0:2,4:1,13:1,14:1,5:1},20)],Va=[[15,16,17,18,19,10,9,8,7,6,5,14,13,12,11,0,1,2,3,4],Wr({},20)],xU=[[1,2,3,4,0,7,8,9,10,11,12,13,14,5,6,19,15,16,17,18],Wr({},20)],dn=[ac,fc,uc,Kh,Qh,jh,Va],qh=["U","R","F","L","BL","BR","x2"],Vh=Za(Va,Va),h0=[];for(let e=0;e<dn.length;e++){h0[e]=[Vh];for(let t=1;t<5;t++)h0[e][t]=Za(h0[e][t-1],dn[e])}{let e=Math.sin(Math.PI/5),t=Math.cos(Math.PI/10),r=Math.cos(Math.PI/5),n=Math.sin(Math.PI/10);Xh={U:[0,0],L:[-e-t,r-n],F:[0,2*r],R:[e+t,r-n],BR:[t,-1-n],BL:[-t,-1-n],DBR:[2*e+2*t,0],DB:[3*e+3*t,-r-n],DBL:[4*e+4*t,0],DFL:[3*e+4*t,1+r],DFR:[3*e+2*t,1+r],D:[3*e+3*t,r-n]}}ne={};BF=ve();Lc().then(e=>e.log())});var Rc={};Bt(Rc,{getRandomKilominxScramble:()=>Lc});var dc=y(()=>{Bc()});function Dl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Fn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function RF(e){e=e.slice();let t=e.length,r=Dl(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function y0(e,t){let r=[],n=Dl(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function Ac(e){return RF(e)>>1}function hn(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function $a(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function Al(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Kr(e,t){return e.length===0?Fn(t):e.map(r=>Al(r,t)).reduce(hn)}function dF(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=hn(e.mp,t.mp),o=hn(e.wp,t.wp),l=hn(e.cp,t.cp);return{co:r,mp:n,wp:o,cp:l}}function yc(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)===4}function wF(e){let t=["0","","'"];return e.map(([n,o])=>SF[n]+t[o]).join(" ")}function vF(e){let t=Array(4);for(let l=0;l<4;l++)t[l]=e(3);let r=y0(e(Dl(6)/2),6);for(let l=0,i=0;l<6;l++){let s=l===5?i:e(2);i^=s,r[l]+=s*6,r[l+6]=(r[l]+6)%12}let n=y0(e(Dl(12)/2),12),o=y0(e(Dl(4)/2),4);return{co:t,mp:r,wp:n,cp:o}}function EF(e){return kF(vF(e))}function _F(e,t=!0,r=!1){let n=wF(EF(e));if(!t)return n;let o=["u","l","r","b"],l=["0","","'"];if(!r){for(let p=0;p<4;p++){let c=e(3);c!==0&&(n+=" "+o[p]+l[c])}return n.trim()}let i=[],s=[],a=[];for(let p=0;p<4;p++)i[p]=e(3),s[p]=e(3),a[p]=(i[p]-s[p]+3)%3;let f=p=>p.filter(c=>c!==0).length;for(;!(f(s)>=1&&f(a)>=1&&f(s)+f(a)>=4);)for(let p=0;p<4;p++)s[p]=e(3),a[p]=(i[p]-s[p]+3)%3;let u=s.map((p,c)=>p!==0?o[c]+l[p]+" ":"").join(""),g=a.map((p,c)=>p!==0?" "+o[c]+l[p]:"").join("");return u+n+g}function kF(e){let t=CF(e),r=[wc(),vc()],n=[GF(),IF()],o=NF(t),l,i=new Set,s=performance.now();for(let a=0;a<22;a++){let{value:f,done:u}=o.next(),g=e;for(let[R,F]of f)for(let A=0;A<F;A++)g=dF(g,xo[R]);let p=JSON.stringify(g);if(i.has(p))continue;i.add(p);let c=TF(g),L=l?l.length-f.length-1:999999,m=WF(c,r,n,L).next().value;if(m!==void 0&&((l===void 0||l.length>f.length+m.length)&&(l=f.concat(m)),performance.now()-s>300))break}return l}function zF(e){return e[3^e.indexOf(3)]}function CF(e){let t=hn($a(e.mp),e.wp),r=(e.co.reduce((n,o)=>n+o)-zF(e.cp)+3)%3;return[0,1,2,3,4,5].map(n=>n+6*t.indexOf(n)+72*t.indexOf(n+6)+864*r)}function*NF(e){let t=0,r=Sc(),n=OF();for(;;)yield*xc(...e,r,n,t,-1),t++}function*xc(e,t,r,n,o,l,i,s,a,f){let u=Dn,g=pr[e]+pr[t]+pr[r]+pr[n]+pr[o]+pr[l],p=Math.max(s[e%864+t*864],s[r%864+t*864],s[o%864+t*864],s[e%864+n*864],s[r%864+n*864],s[o%864+n*864],s[e%864+l*864],s[r%864+l*864],s[o%864+l*864],s[e%864+r*864],s[e%864+o*864],s[r%864+o*864],s[t%864+n*864],s[t%864+l*864],s[n%864+l*864],t2[g]);if(!(p>a)){if(a===0){yield[];return}if(!(p===0&&a===1))for(let c=0;c<u;c++){if(c===f||c<f&&yc(c,f))continue;let L=e,m=t,R=r,F=n,A=o,U=l;for(let b=1;b<=2;b++){L=i[L][c],m=i[m][c],R=i[R][c],F=i[F][c],A=i[A][c],U=i[U][c];let S=xc(L,m,R,F,A,U,i,s,a-1,c);for(;;){let{value:M,done:J}=S.next();if(J)break;yield[[c,b]].concat(M)}}}}}function TF(e){let t=e.mp,r=Ac(t.slice(0,6).map(i=>i%6)),n=t.slice(0,5).map((i,s)=>(i>=6)*2**s).reduce((i,s)=>i+s),o=e.co.map((i,s)=>i*3**s).reduce((i,s)=>i+s),l=e.cp.indexOf(0);return[r+360*l,n+32*o]}function bc(){if(Ee.phase1pm)return Ee.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(Dn).fill(-1));for(let t=0;t<6;t++)for(let r=0;r<12;r++)for(let n=0;n<12;n++){if(r===n)continue;let o=t+6*r+72*n;for(let l=0;l<Dn;l++){let i=Uc[l][t],s=e2[l][r],a=e2[l][n];i<6?e[o][l]=i+6*s+72*a:e[o][l]=i-6+6*a+72*s}}return Ee.phase1pm=e}function Sc(){if(Ee.phase1pcm)return Ee.phase1pcm;let e=bc(),t=Array(e.length*3).fill().map(()=>Array(Dn).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<Dn;n++){let o=e[r][n];t[r][n]=o+6*12*12*Xa[n],t[r+6*12*12][n]=o+6*12*12*((Xa[n]+1)%3),t[r+2*6*12*12][n]=o+6*12*12*((Xa[n]+2)%3)}return Ee.phase1pcm=t}function OF(){if(Ee.phase1p2cp)return Ee.phase1p2cp;let e=bc(),t=Sc(),r=new Int8Array((6*12*12)**2*3);r.fill(-1);let n=[0,1,2,3,4,5].map(l=>l+6*l+72*(l+6));for(let l=0;l<6;l++)for(let i=0;i<6;i++)l!==i&&(r[n[l]+864*n[i]]=0);let o=0;for(;;){let l=!1;for(let i=0;i<r.length;i++){if(r[i]!==o)continue;let s=i%864,a=Math.floor(i/864);for(let f=0;f<Dn;f++){let u=s,g=a;for(let p=1;p<=2;p++){u=e[u][f],g=t[g][f];let c=u+864*g;r[c]===-1&&(l=!0,r[c]=o+1)}}}if(!l)break;o++}return Ee.phase1p2cp=r}function wc(){if(Ee.phase2pm)return Ee.phase2pm;let e=Array(1440).fill().map(()=>Array(U0));for(let t=0;t<360;t++){let r=y0(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<U0;n++){let o=hn(r,xo[n].mp),l=Ac(o.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let s=xo[n].cp[i];e[t+360*s][n]=l+360*i}}}return Ee.phase2pm=e}function vc(){if(Ee.phase2om)return Ee.phase2om;let e=Array(32*81).fill().map(()=>Array(U0));for(let t=0;t<32;t++){let r=[0,1,2,3,4].map(o=>t>>o&1);r[5]=r.reduce((o,l)=>o^l);let n=[];for(let o=0;o<6;o++)n[o]=o+6*r[o],n[o+6]=o+6*(r[o]^1);for(let o=0;o<81;o++){let l=[0,1,2,3].map(i=>Math.floor(o/3**i)%3);for(let i=0;i<U0;i++){let a=hn(n,xo[i].mp).slice(0,5).map(p=>+(p>=6)),f=0;for(let p=0;p<5;p++)f+=a[p]<<p;let u=l.map((p,c)=>(p+xo[i].co[c])%3),g=0;for(let p=0;p<4;p++)g+=u[p]*3**p;e[t+32*o][i]=f+32*g}}}return Ee.phase2om=e}function GF(){return Ee.phase2pp?Ee.phase2pp:Ee.phase2pp=Ec(wc(),[0])}function IF(){return Ee.phase2op?Ee.phase2op:Ee.phase2op=Ec(vc(),[0])}function Ec(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1),l=t.slice(),i=[],s=0;for(;l.length>0;){i.length=0;for(let a of l)if(o[a]===-1){o[a]=s;for(let f=0;f<n;f++){let u=e[a][f];for(;u!=a;)i.push(u),u=e[u][f]}}[l,i]=[i,l],s+=1}return o}function*WF(e,t,r,n){let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;)yield*_c(e,t,r,l,-1),l++}function*_c(e,t,r,n,o){let l=e.length,i=t[0][0].length,s=0;for(let a=0;a<l;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===o||a<o&&yc(a,o))continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=_c(f,t,r,n-1,a);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[a,u]].concat(p)}for(let p=0;p<l;p++)f[p]=t[p][f[p]][a];u++}}}}async function QF(){return _F(await KF,!1)}var CU,PU,MU,hF,FF,DF,AF,yF,UF,xF,bF,xo,SF,Dn,U0,PF,Uc,MF,e2,Xa,Dc,t2,pr,Ee,KF,kc=y(()=>{"use strict";Dt();[CU,PU]=(()=>{let e=new Int8Array(49152),t=new Int8Array(4096*12);for(let o=0;o<4096;o++)for(let l=0,i=0;l<12;l++)(o>>>l&1)!==0&&(e[l<<12|o]=i,t[i<<12|o]=l,i++);function r(o){let l=4095,i=19958400,s=0;for(let a=0;a<10;a++){let f=o[a];s+=e[l|f<<12]*i,l&=~(1<<f),i/=11-a}return s}function n(o,l){let i=4095,s=19958400,a=0;for(let f=0;f<10;f++){let u=o/s|0;o-=u*s,a^=u&1;let g=t[i|u<<12];l[f]=g,i&=~(1<<g),s/=11-f}return l[10]=t[i|a<<12],l[11]=t[i|(a^1)<<12],l}return[r,n]})();MU={co:[0,0,0,0],mp:Fn(12),wp:Fn(12),cp:[0,1,2,3]},hF={co:[2,0,0,0],mp:Fn(12),wp:Al([1,9,11],12),cp:[0,1,2,3]},FF={co:[0,2,0,0],mp:Fn(12),wp:Al([0,7,2],12),cp:[0,1,2,3]},DF={co:[0,0,2,0],mp:Fn(12),wp:Al([3,6,10],12),cp:[0,1,2,3]},AF={co:[0,0,0,2],mp:Fn(12),wp:Al([4,8,5],12),cp:[0,1,2,3]},yF={co:[2,0,0,0],mp:Kr([[1,9,11],[7,3,5]],12),wp:Kr([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},UF={co:[0,2,0,0],mp:Kr([[0,7,2],[6,1,8]],12),wp:Kr([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},xF={co:[0,0,2,0],mp:Kr([[3,6,10],[9,0,4]],12),wp:Kr([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},bF={co:[0,0,0,2],mp:Kr([[4,8,5],[10,2,11]],12),wp:Kr([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},xo=[yF,UF,xF,bF,hF,FF,DF,AF],SF=["u","l","r","b","U","L","R","B"],Dn=8,U0=4;PF=[],Uc=[],MF=[],e2=[];for(let e=0;e<Dn;e++){let t=xo[e];PF[e]=t.mp,Uc[e]=$a(t.mp),MF[e]=t.wp,e2[e]=$a(t.wp)}Xa=[0,0,0,0,2,2,2,2],Dc=[[14,-1,-1,11,11,10,9,8,8,7,7,6,4,5,5,3,4,4,2,3,4,3,-1,-1,0],[13,-1,-1,11,10,10,9,8,8,7,7,6,4,5,5,3,4,4,2,3,3,1,-1,-1,6]],t2=new Int8Array(55);for(let e=0;e<25;e++)t2[e]=Dc[0][e],t2[e+30]=Dc[1][e];pr=new Int8Array(6*12*12*3);for(let e=0;e<6;e++)for(let t=0;t<12;t++)for(let r=0;r<12;r++){let n=e+6*t+72*r,o=2;t===e?o++:t===(e+6)%12&&o--,r===(e+6)%12?o++:r===e&&o--,pr[n]=o,pr[n+6*12*12]=pr[n+2*6*12*12]=o+5}Ee={};KF=ve()});var zc={};Bt(zc,{randomMasterTetraminxScrambleString:()=>QF});var Cc=y(()=>{kc()});function e3(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function jc(e,t){var r;t<<=2,t>24?(t=48-t,r=e.ul,e.ul=(~~e.ul>>t|e.ur<<24-t)&16777215,e.ur=(~~e.ur>>t|r<<24-t)&16777215):t>0?(r=e.ul,e.ul=(e.ul<<t|~~e.ur>>24-t)&16777215,e.ur=(e.ur<<t|~~r>>24-t)&16777215):t==0?(r=e.ur,e.ur=e.dl,e.dl=r,e.ml=1-e.ml):t>=-24?(t=-t,r=e.dl,e.dl=(e.dl<<t|~~e.dr>>24-t)&16777215,e.dr=(e.dr<<t|~~r>>24-t)&16777215):t<-24&&(t=48+t,r=e.dl,e.dl=(~~e.dl>>t|e.dr<<24-t)&16777215,e.dr=(~~e.dr>>t|r<<24-t)&16777215)}function t3(e){var t,r,n,o,l;for(n=0,e.arr[0]=Ht(e,0),o=1;o<24;++o)Ht(e,o)!=e.arr[n]&&(e.arr[++n]=Ht(e,o));for(l=0,t=0;t<16;++t)for(r=t+1;r<16;++r)e.arr[t]>e.arr[r]&&(l^=1);return l}function r3(e){var t,r,n,o;return o=e.ur&1118481,o|=~~o>>3,o|=~~o>>6,o=o&15|~~o>>12&48,n=e.ul&1118481,n|=~~n>>3,n|=~~n>>6,n=n&15|~~n>>12&48,r=e.dr&1118481,r|=~~r>>3,r|=~~r>>6,r=r&15|~~r>>12&48,t=e.dl&1118481,t|=~~t>>3,t|=~~t>>6,t=t&15|~~t>>12&48,yl(t3(e)<<24|n<<18|o<<12|t<<6|r)}function n3(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~Ht(e,r*3+1)>>1<<24)>>24;for(t.cornperm=Sl(e.prm),t.topEdgeFirst=Ht(e,0)==Ht(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~Ht(e,r)>>1<<24)>>24;for(t.botEdgeFirst=Ht(e,12)==Ht(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~Ht(e,r)>>1<<24)>>24;t.edgeperm=Sl(e.prm),t.ml=e.ml}function Ht(e,t){var r;return t<6?r=~~e.ul>>(5-t<<2):t<12?r=~~e.ur>>(11-t<<2):t<18?r=~~e.dl>>(17-t<<2):r=~~e.dr>>(23-t<<2),~~((r&15)<<24)>>24}function o2(e,t,r){t<6?(e.ul&=~(15<<(5-t<<2)),e.ul|=r<<(5-t<<2)):t<12?(e.ur&=~(15<<(11-t<<2)),e.ur|=r<<(11-t<<2)):t<18?(e.dl&=~(15<<(17-t<<2)),e.dl|=r<<(17-t<<2)):(e.dr&=~(15<<(23-t<<2)),e.dr|=r<<(23-t<<2))}function f2(){this.arr=[],this.prm=[]}async function o3(){let e=await ve();var t,r,n,o,l,i,s,a,f;for(t=new f2,n=bo[e(3678)],l=19088743<<1|286331153,o=19088743<<1,s=i=8,r=0;r<24;r++)(n>>r&1)==0?(a=e(i)<<2,o2(t,23-r,o>>a&15),f=(1<<a)-1,o=(o&f)+(o>>4&~f),--i):(a=e(s)<<2,o2(t,23-r,l>>a&15),o2(t,22-r,l>>a&15),f=(1<<a)-1,l=(l&f)+(l>>4&~f),--s,++r);return t.ml=e(2),t}function l3(){}function i3(e){var t,r,n,o,l,i;for(e3(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)jc(e.Search_d,e.Search_move[n]);for(n3(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,l=e.Search_sq.ml,i=Math.max(Ue[e.Search_sq.edgeperm<<1|l],Ue[e.Search_sq.cornperm<<1|l]),n=i;n<e.Search_maxlen2;++n)if(b0(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,l,n,e.Search_length1,0)){for(o=0;o<n;++o)jc(e.Search_d,e.Search_move[e.Search_length1+o]);return e.Search_sol_string=s3(e,n+e.Search_length1),!0}return!1}function s3(e,t){for(var r="",n=0,o=0,l=t-1;l>=0;l--){var i=e.Search_move[l];i>0?(i=12-i,n=i>6?i-12:i):i<0?(i=12+i,o=i>6?i-12:i):(n==0&&o==0?r+=" / ":r+="("+n+", "+o+") / ",n=o=0)}return(n!==0||o!==0)&&(r+="("+n+", "+o+")"),r}function x0(e,t,r,n,o,l){var i,s,a;if(r==0&&n<4)return n==0&&i3(e);if(l!=0&&(a=S0[t],s=Ge[a],s<n&&(e.Search_move[o]=0,x0(e,a,s,n-1,o+1,0))))return!0;if(a=t,l<=0){for(i=0;i+=bl[a],a=~~i>>4,i&=15,!(i>=12||(s=Ge[a],s>n));)if(s<n&&(e.Search_move[o]=i,x0(e,a,s,n-1,o+1,1)))return!0}if(a=t,l<=1){for(i=0;i+=xl[a],a=~~i>>4,i&=15,!(i>=6||(s=Ge[a],s>n));)if(s<n&&(e.Search_move[o]=-i,x0(e,a,s,n-1,o+1,2)))return!0}return!1}function b0(e,t,r,n,o,l,i,s,a){var f,u,g,p,c,L,m;if(i==0&&!n&&o||a!=0&&n==o&&(g=wl[t],u=wl[r],Ue[g<<1|1-l]<i&&Ue[u<<1|1-l]<i&&(e.Search_move[s]=0,b0(e,g,u,n,o,1-l,i-1,s+1,0))))return!0;if(a<=0)for(m=!n,g=m?Un[t]:t,u=m?r:Un[r],p=m?1:2,c=Ue[g<<1|l],L=Ue[u<<1|l];p<12&&c<=i&&c<=i;){if(c<i&&L<i&&(e.Search_move[s]=p,b0(e,g,u,m,o,l,i-1,s+1,1)))return!0;m=!m,m?(g=Un[g],c=Ue[g<<1|l],p+=1):(u=Un[u],L=Ue[u<<1|l],p+=2)}if(a<=1)for(f=!o,g=f?yn[t]:t,u=f?r:yn[r],p=f?1:2,c=Ue[g<<1|l],L=Ue[u<<1|l];p<(i>3?6:12)&&c<=i&&c<=i;){if(c<i&&L<i&&(e.Search_move[s]=-p,b0(e,g,u,n,f,l,i-1,s+1,2)))return!0;f=!f,f?(g=yn[g],c=Ue[g<<1|l],p+=1):(u=yn[u],L=Ue[u<<1|l],p+=2)}return!1}function a3(e,t){var r;for(e.Search_c=t,r=r3(t),e.Search_length1=Ge[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!x0(e,r,Ge[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function Hc(){this.Search_move=[],this.Search_d=new f2,this.Search_sq=new Jc}function f3(){}function u3(){qc||(qc=!0,Ul=[0,3,6,12,15,24,27,30,48,51,54,60,63],bo=[],Ge=[],bl=[],xl=[],S0=[],c3())}function g3(e){var t,r;t=0,r=0;do(e.bottom&2048)==0?(t+=1,e.bottom=e.bottom<<1):(t+=2,e.bottom=e.bottom<<2^12291),r=1-r;while((xn(e.bottom&63)&1)!=0);return(xn(e.bottom)&2)==0&&(e.Shape_parity^=r),t}function l2(e){var t;return t=Xc(bo,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function i2(e,t){e.Shape_parity=t&1,e.top=bo[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function p3(e){var t,r;t=0,r=0;do(e.top&2048)==0?(t+=1,e.top=e.top<<1):(t+=2,e.top=e.top<<2^12291),r=1-r;while((xn(e.top&63)&1)!=0);return(xn(e.top)&2)==0&&(e.Shape_parity^=r),t}function Zc(){}function yl(e){var t;return t=Xc(bo,e&16777215)<<1|~~e>>24,t}function c3(){var e,t,r,n,o,l,i,s,a,f,u,g,p,c,L,m;for(e=0,i=0;i<28561;++i)l=Ul[i%13],r=Ul[~~(i/13)%13],g=Ul[~~(~~(i/13)/13)%13],u=Ul[~~(~~(~~(i/13)/13)/13)],p=u<<18|g<<12|r<<6|l,xn(p)==16&&(bo[e++]=p);for(f=new Zc,i=0;i<7356;++i)i2(f,i),bl[i]=p3(f),bl[i]|=l2(f)<<4,i2(f,i),xl[i]=g3(f),xl[i]|=l2(f)<<4,i2(f,i),m=f.top&63,c=xn(m),L=xn(f.bottom&4032),f.Shape_parity^=1&~~(c&L)>>1,f.top=f.top&4032|~~f.bottom>>6&63,f.bottom=f.bottom&63|m<<6,S0[i]=l2(f);for(i=0;i<7536;++i)Ge[i]=-1;for(Ge[yl(14378715)]=0,Ge[yl(31157686)]=0,Ge[yl(23967451)]=0,Ge[yl(7191990)]=0,n=4,o=0,t=-1;n!=o;)for(o=n,++t,i=0;i<7536;++i)if(Ge[i]==t){a=0,s=i;do s=bl[s],a+=s&15,s>>=4,Ge[s]==-1&&(++n,Ge[s]=t+1);while(a!=12);a=0,s=i;do s=xl[s],a+=s&15,s>>=4,Ge[s]==-1&&(++n,Ge[s]=t+1);while(a!=12);s=S0[i],Ge[s]==-1&&(++n,Ge[s]=t+1)}}function m3(){}function L3(){if(!Vc){Vc=!0,Ue=[],wl=[],Un=[],yn=[],Yc=[1,1,2,6,24,120,720,5040],An=[];for(var e=0;e<12;++e)An[e]=[];B3()}}function Jc(){}function Sl(e){var t,r,n,o;for(r=0,o=1985229328,t=0;t<7;++t)n=e[t]<<2,r=(8-t)*r+(~~o>>n&7),o-=286331152<<n;return r&65535}function B3(){var e,t,r,n,o,l,i,s,a,f,u,g,p;for(o=0;o<12;++o)for(An[o][0]=1,An[o][o]=1,a=1;a<o;++a)An[o][a]=An[o-1][a-1]+An[o-1][a];for(g=[],o=0;o<40320;++o)s2(g,o),p=g[2],g[2]=g[4],g[4]=p,p=g[3],g[3]=g[5],g[5]=p,wl[o]=Sl(g),s2(g,o),p=g[0],g[0]=g[1],g[1]=g[2],g[2]=g[3],g[3]=p,Un[o]=Sl(g),s2(g,o),p=g[4],g[4]=g[5],g[5]=g[6],g[6]=g[7],g[7]=p,yn[o]=Sl(g);for(o=0;o<80640;++o)Ue[o]=-1;for(Ue[0]=0,t=0,r=1;r<80640;){s=t>=11,n=s?-1:t,e=s?t:-1,++t;e:for(o=0;o<80640;++o)if(Ue[o]==n){if(l=~~o>>1,u=o&1,i=wl[l]<<1|1-u,Ue[i]==e&&(++r,Ue[s?o:i]=~~(t<<24)>>24,s))continue e;for(i=l,f=0;f<4;++f)if(i=Un[i],Ue[i<<1|u]==e&&(++r,Ue[s?o:i<<1|u]=~~(t<<24)>>24,s))continue e;for(f=0;f<4;++f)if(i=yn[i],Ue[i<<1|u]==e&&(++r,Ue[s?o:i<<1|u]=~~(t<<24)>>24,s))continue e}}}function s2(e,t){var r,n,o,l,i;for(i=1985229328,r=0;r<7;++r)o=Yc[7-r],l=~~(t/o),t-=l*o,l<<=2,e[r]=~~((~~i>>l&7)<<24)>>24,n=(1<<l)-1,i=(i&n)+(~~i>>4&~n);e[7]=~~(i<<24)>>24}function R3(){}function xn(e){return e-=~~e>>1&1431655765,e=(~~e>>2&858993459)+(e&858993459),e=(~~e>>4)+e&252645135,e+=~~e>>8,e+=~~e>>16,e&63}function Xc(e,t){var r,n,o,l;for(n=0,r=e.length-1;n<=r;)if(o=n+(~~(r-n)>>1),l=e[o],l<t)n=o+1;else if(l>t)r=o-1;else return o;return-n-1}async function A3(){return(await D3()).scramble_string}var _e,qc,xl,bo,Ge,bl,S0,Ul,Vc,yn,An,Ue,Un,wl,Yc,a2,d3,h3,F3,D3,$c=y(()=>{Dt();_e=f2.prototype=l3.prototype;_e.dl=10062778;_e.dr=14536702;_e.ml=0;_e.ul=70195;_e.ur=4544119;_e=Hc.prototype=f3.prototype;_e.Search_c=null;_e.Search_length1=0;_e.Search_maxlen2=0;_e.Search_sol_string=null;qc=!1;_e=Zc.prototype=m3.prototype;_e.bottom=0;_e.Shape_parity=0;_e.top=0;Vc=!1;_e=Jc.prototype=R3.prototype;_e.botEdgeFirst=!1;_e.cornperm=0;_e.edgeperm=0;_e.ml=0;_e.topEdgeFirst=!1;a2=!1,d3=function(e,t,r){a2||(u3(),L3()),r&&r("Done initializing Square-1."),a2=!0,e!=null&&e()},h3=async function(){return a2||d3(),o3()},F3=function(e){var t=new Hc;return a3(t,e)},D3=async function(){var e=await h3(),t=F3(e);return{state:e,scramble_string:t}}});var em={};Bt(em,{getRandomSquare1ScrambleString:()=>A3});var tm=y(()=>{$c()});var B2=Symbol("Comlink.proxy"),gm=Symbol("Comlink.endpoint"),pm=Symbol("Comlink.releaseProxy"),E0=Symbol("Comlink.thrown"),R2=e=>typeof e=="object"&&e!==null||typeof e=="function",cm={canHandle:e=>R2(e)&&e[B2],serialize(e){let{port1:t,port2:r}=new MessageChannel;return So(e,t),[r,[r]]},deserialize(e){return e.start(),Bm(e)}},mm={canHandle:e=>R2(e)&&E0 in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},d2=new Map([["proxy",cm],["throw",mm]]);function So(e,t=self){t.addEventListener("message",function r(n){if(!n||!n.data)return;let{id:o,type:l,path:i}=Object.assign({path:[]},n.data),s=(n.data.argumentList||[]).map(Qr),a;try{let f=i.slice(0,-1).reduce((g,p)=>g[p],e),u=i.reduce((g,p)=>g[p],e);switch(l){case"GET":a=u;break;case"SET":f[i.slice(-1)[0]]=Qr(n.data.value),a=!0;break;case"APPLY":a=u.apply(f,s);break;case"CONSTRUCT":{let g=new u(...s);a=hm(g)}break;case"ENDPOINT":{let{port1:g,port2:p}=new MessageChannel;So(e,p),a=dm(g,[g])}break;case"RELEASE":a=void 0;break;default:return}}catch(f){a={value:f,[E0]:0}}Promise.resolve(a).catch(f=>({value:f,[E0]:0})).then(f=>{let[u,g]=k0(f);t.postMessage(Object.assign(Object.assign({},u),{id:o}),g),l==="RELEASE"&&(t.removeEventListener("message",r),h2(t))})}),t.start&&t.start()}function Lm(e){return e.constructor.name==="MessagePort"}function h2(e){Lm(e)&&e.close()}function Bm(e,t){return _0(e,[],t)}function vl(e){if(e)throw new Error("Proxy has been released and is not useable")}function _0(e,t=[],r=function(){}){let n=!1,o=new Proxy(r,{get(l,i){if(vl(n),i===pm)return()=>bn(e,{type:"RELEASE",path:t.map(s=>s.toString())}).then(()=>{h2(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>o};let s=bn(e,{type:"GET",path:t.map(a=>a.toString())}).then(Qr);return s.then.bind(s)}return _0(e,[...t,i])},set(l,i,s){vl(n);let[a,f]=k0(s);return bn(e,{type:"SET",path:[...t,i].map(u=>u.toString()),value:a},f).then(Qr)},apply(l,i,s){vl(n);let a=t[t.length-1];if(a===gm)return bn(e,{type:"ENDPOINT"}).then(Qr);if(a==="bind")return _0(e,t.slice(0,-1));let[f,u]=L2(s);return bn(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:f},u).then(Qr)},construct(l,i){vl(n);let[s,a]=L2(i);return bn(e,{type:"CONSTRUCT",path:t.map(f=>f.toString()),argumentList:s},a).then(Qr)}});return o}function Rm(e){return Array.prototype.concat.apply([],e)}function L2(e){let t=e.map(k0);return[t.map(r=>r[0]),Rm(t.map(r=>r[1]))]}var F2=new WeakMap;function dm(e,t){return F2.set(e,t),e}function hm(e){return Object.assign(e,{[B2]:!0})}function k0(e){for(let[t,r]of d2)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},o]}return[{type:"RAW",value:e},F2.get(e)||[]]}function Qr(e){switch(e.type){case"HANDLER":return d2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function bn(e,t,r){return new Promise(n=>{let o=Fm();e.addEventListener("message",function l(i){!i.data||!i.data.id||i.data.id!==o||(e.removeEventListener("message",l),n(i.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}function Fm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function Dm(e){let t=new WeakMap;return{postMessage:e.postMessage.bind(e),addEventListener:(r,n)=>{let o=l=>{"handleEvent"in n?n.handleEvent({data:l}):n({data:l})};e.on("message",o),t.set(n,o)},removeEventListener:(r,n)=>{let o=t.get(n);!o||(e.off("message",o),t.delete(n))},nodeWorker:e}}var D2=Dm;var Am=typeof globalThis.Worker>"u"&&typeof globalThis.WorkerNavigator>"u",ym="node:w-orker-_threa-ds",Um=()=>ym.replace(/-/g,"");async function xm(){let{parentPort:e}=await import(Um()).catch();return D2(e)}function A2(e){Am?(async()=>So(e,await xm()))():So(e)}qe();tr();Ft();qe();tr();Dt();Ft();Be();Be();var mi=class extends zn{constructor(t){super();this.metric=t}traverseAlg(t){let r=0;for(let n of t.units())r+=this.traverseUnit(n);return r}traverseGrouping(t){let r=t.alg;return this.traverseAlg(r)*Math.abs(t.amount)}traverseMove(t){return this.metric(t)}traverseCommutator(t){return 2*(this.traverseAlg(t.A)+this.traverseAlg(t.B))}traverseConjugate(t){return 2*this.traverseAlg(t.A)+this.traverseAlg(t.B)}traversePause(t){return 0}traverseNewline(t){return 0}traverseLineComment(t){return 0}};function Iu(e){return"A"<=e&&e<="Z"}function UL(e){let t=e.family;return Iu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function xL(e){return 1}function bL(e){let t=e.family;return Iu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var Fs=new mi(UL),Ds=Fs.traverseAlg.bind(Fs),SL=new mi(xL),wL=Fs.traverseAlg.bind(SL),Gu=new mi(bL),vL=Gu.traverseAlg.bind(Gu);Be();var Ku=class extends zn{traverseAlg(t){let r=0;for(let n of t.units())r+=this.traverseUnit(n);return r}traverseGrouping(t){return this.traverseAlg(t.alg)*Math.abs(t.amount)}traverseMove(t){return 1}traverseCommutator(t){return 2*(this.traverseAlg(t.A)+this.traverseAlg(t.B))}traverseConjugate(t){return 2*this.traverseAlg(t.A)+this.traverseAlg(t.B)}traversePause(t){return 1}traverseNewline(t){return 0}traverseLineComment(t){return 0}},Wu=new Ku,EL=Wu.traverseAlg.bind(Wu);Dt();var _L=2,kL=!0,zL=!1;function CL(e,t){let r=[];return t.forEach(function(n){let o=new B(n);if(o.amount!==1)throw new Error("SGS cannot handle def moves with an amount other than 1 yet.");let l=e.identityTransformation();for(let i=1;l=l.applyMove(o),!l.isIdentityTransformation();i++)r.push({move:o.modified({amount:i}),transformation:l})}),r}var Wt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=CL(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=_L,n){let o=t.experimentalToTransformation();if(!o)throw new Error("distinguishable pieces are not supported in tremble solver yt");let l=null,i=1e6,s=(a,f,u)=>{if(f===0){let g=this.sgsPhaseSolve(a,i);if(!g)return;let p=u.concat(g).simplify({collapseMoves:!0,quantumMoveOrder:n}),c=Ds(p);(l===null||c<i)&&(zL&&(console.log(\`New best (\${c} moves): \${p.toString()}\`),console.log(\`Tremble moves are: \${u.toString()}\`)),l=p,i=c);return}for(let g of this.searchMoves)s(a.applyTransformation(g.transformation),f-1,u.concat([g.move]))};for(let a=0;a<=r;a++)s(o,a,new E);if(l===null)throw new Error("SGS search failed.");return l}sgsPhaseSolve(t,r){let n=new Rt,o=t;for(let l of this.sgs.ordering){let i=l.pieceOrdering,s="",a=o.invert();for(let u=0;u<i.length;u++){let g=i[u],p=g.orbitName,c=g.permutationIdx;s+=\` \${a.transformationData[p].permutation[c]} \${a.transformationData[p].orientation[c]}\`}let f=l.lookup[s];if(!f)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(f.alg),n.experimentalNumUnits()>=r)return null;if(o=o.applyTransformation(f.transformation),kL)for(let u=0;u<i.length;u++){let g=i[u],p=g.orbitName,c=g.permutationIdx;if(o.transformationData[p].permutation[c]!==c||o.transformationData[p].orientation[c]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function Li(e,t){let r=await rr(),n=e.identityTransformation();for(let o of t.ordering){let l=r(Object.values(o.lookup));n=n.applyTransformation(l.transformation)}return n.toKState()}Kt();var at=Ne(()=>Promise.resolve().then(()=>($u(),Xu)));var VL=3,e1=null;async function t1(){return e1||(e1=(async()=>{let e=await(await at).cachedData222();return new Wt(await Ce["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function r1(){await t1()}async function bs(e){return we(),await(await t1()).solve(e,VL,()=>4)}async function HL(e,t,r,n){let o=await ve();await Ou(r.stateData[t].pieces);let l=e.definition.orbits[t],i=r.stateData[t].orientation,s=0;for(let a=0;a<l.numPieces;a++){let f=o(l.numOrientations);i[a]=f,s+=f}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-s)%l.numOrientations+l.numOrientations)%l.numOrientations)}async function ZL(){let e=await Ce["2x2x2"].kpuzzle(),t=new ce(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await HL(e,"CORNERS",t,{orientationSum:0}),t}async function n1(){return await bs(await ZL())}Xs();Bi();Kt();var Ua=Ne(()=>Promise.resolve().then(()=>(ap(),sp)));var fd=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]];async function fp(){return(await Ua).initialize()}async function xa(){return(await Ua).random444Scramble()}async function up(){return Qn(await xa(),fd)}Bi();Be();Dt();function ud(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var gd=[["U","D"],["L","R"],["F","B"]],gp=new Map;function pd(e){let t=gp.get(e);if(t)return t;let r=[];for(let n of gd){let o=[];r.push(o);for(let l of n){o.push(new z(l)),e>3&&o.push(new z(\`\${l}w\`));for(let i=3;i<=e/2;i++)o.push(new z(\`\${l}w\`,i))}}return gp.set(e,r),r}async function fr(e){let t=await ve(),r=await rr(),n=r,o=pd(e),l=ud(e),i=new Rt,s=0,a=new Set;for(;i.experimentalNumUnits()<l;){let f=t(3);f!==s&&a.clear(),s=f;let u=r(o[s]),g=u.toString();a.has(g)||(a.add(g),i.push(new B(u,n([1,2,-1]))))}return i.toAlg()}var cd=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function pp(){return Qn(await fr(5),cd)}Be();tr();Kt();Ft();Kt();var qp=Ne(()=>Promise.resolve().then(()=>(jp(),Qp)));var DU=Ne(()=>Promise.resolve().then(()=>(ja(),Qa)));async function ic(){return we(),new E(await(await qp).randomFTOScrambleString())}Ft();Kt();var hc=Ne(()=>Promise.resolve().then(()=>(dc(),Rc)));async function Fc(){return we(),(await hc).getRandomKilominxScramble()}Be();Ft();Kt();var Pc=Ne(()=>Promise.resolve().then(()=>(Cc(),zc)));async function Mc(){return we(),new E(await(await Pc).randomMasterTetraminxScrambleString())}qe();Ft();var jF=2,Nc=null;async function qF(){return Nc||(Nc=(async()=>{let e=await(await at).cachedSGSDataMegaminx();return new Wt(await(await at).cachedMegaminxKPuzzleWithoutMO(),e,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function Tc(e){we();let t=await qF(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new ce(await(await at).cachedMegaminxKPuzzleWithoutMO(),r);return await t.solve(n,jF,()=>5)}tr();Ft();var VF=3,Oc=null;async function HF(){return Oc||(Oc=(async()=>{let e=await(await at).sgsDataPyraminx();return new Wt(await Ce.pyraminx.kpuzzle(),e,"RLUB".split(""))})())}async function r2(e){return we(),await(await HF()).solve(e,VF,()=>3)}async function ZF(){return we(),Li(await Ce.pyraminx.kpuzzle(),await(await at).sgsDataPyraminxFixedOrientation())}async function Gc(){return r2(await ZF())}Ft();Kt();var Ic=Ne(()=>Promise.resolve().then(()=>(ja(),Qa)));async function Wc(){return we(),(await Ic).getRandomRediCubeScramble()}qe();Ft();var JF=3,Kc=null;async function YF(){return Kc||(Kc=(async()=>{let e=await(await at).sgsDataSkewb();return new Wt(await(await at).skewbKPuzzleWithoutMOCached(),e,"RLUB".split(""))})())}function XF(e){return new ce(e.kpuzzle,{CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})}async function n2(e){return we(),await(await YF()).solve(XF(e),JF,n=>n.family==="y"?4:3)}async function $F(){return Li(await(await at).skewbKPuzzleWithoutMOCached(),await(await at).sgsDataSkewbFixedCorner())}async function Qc(){return n2(await $F())}Be();Kt();var rm=Ne(()=>Promise.resolve().then(()=>(tm(),em)));async function nm(){return E.fromString(await(await rm).getRandomSquare1ScrambleString())}var y3=1e3;Cu(!0);var im=!0;function U3(e){im=e}function om(){return(typeof performance>"u"?Date:performance).now()}async function ke(e,t,r){if(!im)return t();let n=om(),o=t();o?.then&&await o;let l=om();return console.warn(\`\${e}\${r?.isPrefetch?" (prefetched)":""}: \${Math.round(l-n)}ms\`),o}var u2=new Map,g2=null;async function lm(e,t){switch(e){case"222":return ke("random222Scramble",n1,{isPrefetch:t?.isPrefetch});case"333":case"333oh":case"333ft":return ke("random333Scramble",ro,{isPrefetch:t?.isPrefetch});case"333fm":return ke("random333FewestMovesScramble",Y1);case"333bf":case"333mb":return ke("random333OrientedScramble",J1);case"444":return ke("random444Scramble",xa,{isPrefetch:t?.isPrefetch});case"444bf":return ke("random444OrientedScramble",up);case"555":return ke("bigCubeScramble(5)",fr.bind(fr,5));case"555bf":return ke("oriented555RandomMoves",pp);case"666":return ke("bigCubeScramble(6)",fr.bind(fr,6));case"777":return ke("bigCubeScramble(7)",fr.bind(fr,7));case"skewb":return ke("randomSkewbFixedCornerScramble",Qc);case"pyram":return ke("randomPyraminxScrambleFixedOrientation",Gc);case"sq1":return ke("getRandomSquare1Scramble",nm,{isPrefetch:t?.isPrefetch});case"fto":return ke("randomFTOScramble",ic,{isPrefetch:t?.isPrefetch});case"master_tetraminx":return ke("randomMasterTetraminxScramble",Mc);case"kilominx":return ke("randomKilominxScramble",Fc,{isPrefetch:t?.isPrefetch});case"redi_cube":return ke("randomRediCubeScramble",Wc,{isPrefetch:t?.isPrefetch});default:throw new Error(\`unsupported event: \${e}\`)}}var p2="auto",c2={initialize:async e=>{switch(e){case"222":return ke("preInitialize222",r1);case"333":case"333oh":case"333ft":return ke("initialize333",Z1);case"444":return ke("initialize444",fp);default:throw new Error(\`unsupported event: \${e}\`)}},setScramblePrefetchLevel(e){p2=e},randomScrambleForEvent:async e=>{let t=u2.get(e);return t?u2.delete(e):t=lm(e),p2!=="none"&&t.then(()=>{g2&&clearTimeout(g2),g2=setTimeout(()=>{u2.set(e,lm(e,{isPrefetch:!0}))},p2==="immediate"?0:y3)}),t},randomScrambleStringForEvent:async e=>(await c2.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new ce(await Ce["3x3x3"].kpuzzle(),e);return(await Ys(t)).toString()},solve222ToString:async e=>{let t=new ce(await Ce["2x2x2"].kpuzzle(),e);return(await bs(t)).toString()},solveSkewbToString:async e=>{let t=new ce(await Ce.skewb.kpuzzle(),e);return(await n2(t)).toString()},solvePyraminxToString:async e=>{let t=new ce(await Ce.pyraminx.kpuzzle(),e);return(await r2(t)).toString()},solveMegaminxToString:async e=>{let t=new ce(await Ce.megaminx.kpuzzle(),e);return(await Tc(t)).toString()},setDebugMeasurePerf:async e=>{U3(e)}};A2(c2);
3763
+ \`)}var mh,ec=y(()=>{tr();Kn();mh=null});function yl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function q0(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function Bh(e){e=e.slice();let t=e.length,r=yl(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Rh(e,t){let r=[],n=yl(t-1);for(let o=0;o<t;o++)r[o]=e/n|0,e%=n,n/=t-1-o;for(let o=t-2;o>=0;o--)for(let l=o+1;l<t;l++)r[l]+=+(r[l]>=r[o]);return r}function tc(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function dh(e,t){let r=[],n=yl(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function rc(e){return Bh(e)>>1}function nc(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let o=q0(t-1,r),l=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?o=o*--n/t:(l+=o,o=o*r--/t);return l}function hh(e,t,r){let n=r-t,o=q0(r-1,t),l=[],i=r-1;for(let a=0;a<i;a++)r--,e<o?(l.push(0),o=o*--n/r):(l.push(1),e-=o,o=o*t--/r);return l.push(t),l}function Da(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Gr(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Or(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function Fh(e,t){let r=Array(8).fill(0);for(let n=0;n<8;n++)r[n]=(e[1][n]+t[1][n])%3;return[Da(e[0],t[0]),r]}function Eh(e){let t=["0","","'"];return e.map(([n,o])=>vh[n]+t[o]).join(" ")}function _h(e){let t=dh(Math.floor(e(yl(12))/2),12),r=Array(8);for(let n=0;n<8;n++)r[n]=e(3);return[t,r]}function kh(e){return zh(_h(e))}function zh(e){let t=Ch(e),r=[lc(),ic()],n=[Mh(),Nh()],o=[ac(),Th()],l=[Gh(),Ph()],i=Ih(t,r,n),a,s=new Set,f=+new Date;for(let u=0;u<25;u++){let{value:g,done:p}=i.next(),c=e;for(let[U,x]of g)for(let S=0;S<x;S++)c=Fh(c,Al[U]);if(s.has(c.toString()))continue;s.add(c.toString());let L=rc(c[0].slice(0,8)),m=0;for(let U=0;U<4;U++)m+=c[1][U]*3**U;let R=[L,m],F=a?a.length-g.length-1:999999,A=Oh(R,o,l,F);if(A!==void 0&&((a===void 0||a.length>g.length+A.length)&&(a=g.concat(A)),new Date-f>300))break}return a}function Ch(e){let t=0;for(let l=0;l<4;l++)t+=e[0].indexOf(l+8)*12**l;let r=0;for(let l=0;l<4;l++)r+=e[1][l+4]*3**l;let n=e[0].map(l=>Math.max(-1,l-8)),o=nc(n.map(l=>+(l>=0)))*2+tc(n.filter(l=>l>=0));return[t,r+81*o]}function oc(){if(me.phase1cm)return me.phase1cm;let e=[];for(let t=0;t<81;t++){e[t]=Array(8);let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t][0]=e[t][1]=e[t][2]=e[t][3]=t;for(let n=0;n<4;n++)r[n]=(r[n]+2)%3,e[t][4+n]=r[0]+r[1]*3+r[2]*9+r[3]*27,r[n]=(r[n]+1)%3}return me.phase1cm=e}function Ph(){if(me.phase1cp)return me.phase1cp;let e=Array(81);for(let t=0;t<81;t++){let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t]=(r[0]!==0)+(r[1]!==0)+(r[2]!==0)+(r[3]!==0)}return me.phase1cp=e}function lc(){if(me.phase1em)return me.phase1em;let e=[];for(let r=0;r<12;r++){e[r]=[];for(let n=0;n<8;n++)e[r][n]=Al[n][0].indexOf(r)}let t=Array(12**4);for(let r=0;r<12**4;r++){t[r]=Array(8);for(let n=0;n<8;n++){let o=0;for(let l=0;l<4;l++)o+=e[Math.floor(r/12**l)%12][n]*12**l;t[r][n]=o}}return me.phase1em=t}function Mh(){return me.phase1ep?me.phase1ep:me.phase1ep=V0(lc(),[8+12*(9+12*(10+12*11))])}function ic(){if(me.phase1sm)return me.phase1sm;let e=q0(12,4),t=[];for(let o=0;o<e;o++){t[o]=[];let l=hh(o,4,12),i=[];for(let a=0,s=0;a<12;a++)l[a]===0?i[a]=-1:i[a]=s++;for(let a=0;a<8;a++){let s=Da(i,Al[a][0]),f=Da(l,Al[a][0]),u=tc(s.filter(g=>g>=0));t[o][a]=nc(f)*2+u}}let r=oc(),n=[];for(let o=0;o<e;o++)for(let l=0;l<81;l++){let i=n[l+81*(2*o)]=[],a=n[l+81*(2*o+1)]=[];for(let s=0;s<8;s++)i[s]=r[l][s]+81*t[o][s],a[s]=r[l][s]+81*(t[o][s]^1)}return me.phase1sm=n}function Nh(){return me.phase1sp?me.phase1sp:me.phase1sp=V0(ic(),[0])}function Th(){if(me.phase2cm)return me.phase2cm;let e=oc(),t=Array(81);for(let r=0;r<81;r++)t[r]=e[r].slice(4,8);return me.phase2cm=t}function ac(){if(me.phase2em)return me.phase2em;let e=8,t=yl(e)/2,r=Array(t),n=[0,1,2,3,4,5,6,7];for(let o=0;o<t;o++){r[o]=Array(4);for(let i=0;i<4;i++){let a=Da(n,Al[i][0].slice(0,8));r[o][i]=rc(a)}if(o===t-1)break;let l=0;do for(let i=e-2;i>=0;i--){if(n[i]>n[i+1])continue;let a=i+1;for(let s=a;s<e;s++)n[s]>n[i]&&(a=s);[n[i],n[a]]=[n[a],n[i]],l^=1;for(let s=0;i+1+s<e-1-s;s++,l^=1)[n[i+1+s],n[e-1-s]]=[n[e-1-s],n[i+1+s]];break}while(l!==0)}return me.phase2em=r}function Gh(){return me.phase2ep?me.phase2ep:me.phase2ep=V0(ac(),[0])}function V0(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1),l=t.slice(),i=[],a=0;for(;l.length>0;){i.length=0;for(let s of l)if(o[s]===-1){o[s]=a;for(let f=0;f<n;f++){let u=e[s][f];for(;u!=s;)i.push(u),u=e[u][f]}}[l,i]=[i,l],a+=1}return o}function Oh(e,t,r,n){n=n||999999;let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;){let i=sc(e,t,r,l,-1);if(i!==void 0)return i;l++}}function sc(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let s=0;s<l;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0)return[];if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===o||s<o&&Aa[s]==Aa[o])continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=sc(f,t,r,n-1,s);if(g!==void 0)return[[s,u]].concat(g);for(let p=0;p<l;p++)f[p]=t[p][f[p]][s];u++}}}}function*Ih(e,t,r){let n=e.length,o=0;for(let l=0;l<n;l++)o=Math.max(o,r[l][e[l]]);for(;;)yield*fc(e,t,r,o,-1),o++}function*fc(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let s=0;s<l;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===o||s<o&&Aa[s]==Aa[o])continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=fc(f,t,r,n-1,s);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[s,u]].concat(p)}for(let p=0;p<l;p++)f[p]=t[p][f[p]][s];u++}}}}async function uc(){return new E(Eh(kh(await Wh)))}var Dh,Ah,yh,Uh,bh,xh,Sh,wh,FU,Al,vh,Aa,me,Wh,gc=y(()=>{"use strict";Be();Dt();Dh=[Gr([0,1,4],12),Or({0:2},8)],Ah=[Gr([1,2,5],12),Or({1:2},8)],yh=[Gr([2,3,6],12),Or({2:2},8)],Uh=[Gr([3,0,7],12),Or({3:2},8)],bh=[Gr([9,8,4],12),Or({4:2},8)],xh=[Gr([10,9,5],12),Or({5:2},8)],Sh=[Gr([11,10,6],12),Or({6:2},8)],wh=[Gr([8,11,7],12),Or({7:2},8)],FU=[Rh(0,12),Array(8).fill(0)],Al=[Dh,Ah,yh,Uh,bh,xh,Sh,wh],vh=["UL","U","UR","F","L","B","R","D"],Aa=[0,1,0,1,1,0,1,0];me={};Wh=ve()});var H0={};Bt(H0,{getRandomRediCubeScramble:()=>uc,sgsDataFTO:()=>$p});var Z0=y(()=>{ec();gc()});function cc(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Ua(e,t){if(t<0||t>e)return 0;if(t===0||t===e)return 1;let r=1;for(let n=0;n<t;n++)r=r*(e-n)/(n+1)|0;return r}function Kh(e){e=e.slice();let t=e.length,r=cc(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Qh(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let o=n;o<t;o++)e[n]>e[o]&&(r^=1);return r}function jh(e){return Kh(e)>>1}function X0(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let o=Ua(t-1,r),l=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?o=o*--n/t:(l+=o,o=o*r--/t);return l}function Hh(e,t,r){let n=r-t,o=Ua(r-1,t),l=[],i=r-1;for(let a=0;a<i;a++)r--,e<o?(l.push(0),o=o*--n/r):(l.push(1),e-=o,o=o*t--/r);return l.push(t),l}function Vt(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function $0(e,t){let r=Vt(e[0],t[0]),n=[],o=t[0].length;for(let l=0;l<o;l++)n[l]=(e[1][t[0][l]]+t[1][l])%3;return[r,n]}function yo(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Ir(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function eF(e){let t=[0];for(let n=1;n<20;n++){let o=e(n+1);t[n]=t[o],t[o]=n}Qh(t)===1&&([t[0],t[1]]=[t[1],t[0]]);let r=Array(20).fill(0);for(let n=0;n<19;n++)r[n]=e(3),r[19]+=3-r[n];return r[19]%=3,[t,r]}function tF(e){let t=["0","","2","2'","'"];return e.map(([n,o])=>Xh[n]+t[o]).join(" ")}function rF(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=$0(e,dn[r]);return e}function nF(e){return pF(eF(e))}function lF(e){let t=e[0];if(t.slice(15,20).every(l=>l<15))return[];if(t.slice(0,5).every(l=>l<15))return[[6,1]];let r=t.map(l=>l>=15),n=0,o;for(;o===void 0;)n++,o=Rc(r,n,-1);return o.push([6,1]),o}function Rc(e,t,r){if(t==0)return e.slice(0,5).some(n=>n)?void 0:[];for(let n=0;n<6;n++)if(n!==r)for(let o=1;o<5;o++){let l=Vt(e,ya[n][o][0]),i=Rc(l,t-1,n);if(i!==void 0)return[[n,o]].concat(i)}}function iF(e){let t=e[0].slice(0,15),r=e[1],n=X0(t.map(i=>+(i>=15))),o=243*n;for(let i=0,a=0;i<15;i++)t[i]<15||(o+=r[i]*Math.pow(3,a),a++);let l=0;for(let i=0;i<5;i++)l+=t.indexOf(15+i)*Math.pow(15,i);return[o,l]}function aF(e){let t=[ba(),xa()],r=[cF(),LF()];return dc(iF(e),t,r).concat([[6,1]])}function sF(e){let t=[5,6,7,8,14],r=e[0].slice(0,15),n=e[1],o=X0(r.map(a=>+(t.indexOf(a)!==-1))),l=243*o;for(let a=0,s=0;a<15;a++)t.indexOf(r[a])!==-1&&(l+=n[a]*Math.pow(3,s),s++);let i=0;for(let a=0;a<5;a++)i+=r.indexOf(t[a])*Math.pow(15,a);return[l,i]}function fF(e){let t=[ba(),xa()],r=[mF(),BF()];return dc(sF(e),t,r)}function uF(e){let t=e[0].slice(0,14),r=e[1],n=0,o=[],l=0;for(let i of[0,1,2,3,4,9,10,11,12,13])i!==13&&(n+=r[i]*Math.pow(3,l)),o[l]=t[i]<5?t[i]:t[i]-4,l++;return[n,jh(o)]}function gF(e){return DF(uF(e))}function pF(e){let t=[];for(let r of[lF,aF,fF,gF]){let n=r(e);e=rF(e,n),t=t.concat(n)}return t}function ba(){if(oe.phase23om)return oe.phase23om;let e=Ua(15,5),t=[1,3,9,27,81,243],r=Array(Ua(15,5)*t[5]);oe.phase23om=r;for(let n=0;n<e;n++){let o=Hh(n,5,15).concat(Array(5).fill(0)),l=[];for(let i=0;i<6;i++){let a=Vt(o,dn[i][0]).slice(0,15);l[i]=X0(a)}for(let i=0;i<t[5];i++){r[i+243*n]=[];let a=[];for(let s=0,f=0;s<20;s++)o[s]===1?(a[s]=(i/t[f]|0)%3,f++):a[s]=99;for(let s=0;s<6;s++){let f=dn[s],u=[];for(let c=0;c<15;c++)u[c]=a[f[0][c]]+f[1][c];let g=u.filter(c=>c<10),p=0;for(let c=0;c<5;c++)p+=g[c]%3*t[c];r[i+243*n][s]=p+243*l[s]}}}return r}function cF(){if(oe.phase2op)return oe.phase2op;let e=ba();return oe.phase2op=Uo(e,[243*3002])}function mF(){if(oe.phase3op)return oe.phase3op;let e=ba();return oe.phase3op=Uo(e,[243*246])}function xa(){if(oe.phase23pm)return oe.phase23pm;let e=[1,15,225,Math.pow(15,3),Math.pow(15,4),Math.pow(15,5)],t=Array(e[5]),r=Array(15);for(let o=0;o<15;o++){r[o]=Array(6);for(let l=0;l<6;l++)r[o][l]=dn[l][0].indexOf(o)}let n=[0,0,0,0,0];for(let o=0;o<e[5];o++){t[o]=Array(6);for(let l=0;l<6;l++){let i=0;for(let a=0;a<5;a++)i+=r[n[a]][l]*e[a];t[o][l]=i}n[0]++;for(let l=0;l<4;l++)n[l]===15&&(n[l]=0,n[l+1]++)}return oe.phase23pm=t}function LF(){if(oe.phase2pp)return oe.phase2pp;let e=xa();return oe.phase2pp=Uo(e,[213090])}function BF(){if(oe.phase3pp)return oe.phase3pp;let e=xa();return oe.phase3pp=Uo(e,[737420])}function e2(){if(oe.phase4om)return oe.phase4om;let e=[1,3,9,27,81,243,729,2187,6561,19683,59049],t=Array(e[9]);for(let r=0;r<e[9];r++){let n=Array(14).fill(0);for(let o=0;o<9;o++){let l=o<5?o:o+4;n[l]=(r/e[o]|0)%3,n[13]-=n[l]}n[13]=(n[13]+999)%3,t[r]=[];for(let o=0;o<3;o++){let l=dn[o],i=[0,1,2,3,4,9,10,11,12,13].map(s=>n[l[0][s]]+l[1][s]),a=0;for(let s=0;s<9;s++)a+=i[s]%3*e[s];t[r][o]=a}}return oe.phase4om=t}function t2(){if(oe.phase4pm)return oe.phase4pm;let e=cc(10)/2,t=10,r=[0,1,2,3,4,-1,-1,-1,-1,5,6,7,8,9],n=[0,1,2,3,4,9,10,11,12,13],o=[Vt(r,Vt(mc[0],n)),Vt(r,Vt(Lc[0],n)),Vt(r,Vt(Bc[0],n))],l=Array(e),i=Array(10);for(let a=0;a<e;a++){Vh(a,i),l[a]=[];for(let s=0;s<3;s++){let f=Vt(i,o[s]);l[a][s]=qh(f)}}return oe.phase4pm=l}function RF(){if(oe.phase4op)return oe.phase4op;let e=e2();return oe.phase4op=Uo(e,[0])}function dF(){if(oe.phase4pp)return oe.phase4pp;let e=t2();return oe.phase4pp=Uo(e,[0])}function hF(e){if(oe.phase4np_list&&oe.phase4np_list.threshold===e)return oe.phase4np_list;let t=[e2(),t2()],r=Math.pow(3,9),n=[0];o(e,[0,0],-1);function o(a,s,f){if(n.push(s[0]+r*s[1]),a===0)return;let u=[];for(let g=0;g<3;g++)if(g!==f){u[0]=s[0],u[1]=s[1];for(let p=1;p<5;p++)u[0]=t[0][u[0]][g],u[1]=t[1][u[1]][g],o(a-1,u,g)}}n.sort((a,s)=>a-s);let l=[],i=-1;for(let a of n)a!==i&&l.push(i=a);return l.threshold=e,oe.phase4np_list=l}function FF(e,t){let r=0,n=e.length-1;for(;n-r>1;){let o=r+n>>1;t>e[o]?r=o+1:n=o}return t===e[r]||t===e[n]}function Uo(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1);for(let a of t)o[a]=0;let l=0,i=!1;for(;!i;){i=!0;for(let a=0;a<r;a++)if(o[a]===l)for(let s=0;s<n;s++){let f=e[a][s];for(;f!==a;)o[f]===-1&&(i=!1,o[f]=l+1),f=e[f][s]}l++}return o}function dc(e,t,r){let n=e.length,o=0;for(let l=0;l<n;l++)o=Math.max(o,r[l][e[l]]);for(;;){let l=hc(e,t,r,o,-1);if(l!==void 0)return l;o++}}function hc(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let s=0;s<l;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0||a===0)return[];for(let s=0;s<i;s++){if(s===o)continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=hc(f,t,r,n-1,s);if(g!==void 0)return[[s,u]].concat(g);for(let p=0;p<l;p++)f[p]=t[p][f[p]][s];u++}}}}function DF(e){let t=e2(),r=t2(),n=RF(),o=dF(),l=hF(J0),i=Math.max(n[e[0]],o[e[1]]);for(;;){let a=Fc(e,i,-1,t,r,n,o,l);if(a!==void 0)return a;i++}}function Fc(e,t,r,n,o,l,i,a){let s=Math.max(l[e[0]],i[e[1]]);if(!(s>t)&&(s<=J0&&!FF(a,e[0]+19683*e[1])&&(s=J0+1),!(s>t))){if(t===0||s===0)return[];for(let f=0;f<3;f++){if(f===r)continue;let u=e.slice();for(let g=1;g<5;g++){u[0]=n[u[0]][f],u[1]=o[u[1]][f];let p=Fc(u,t-1,f,n,o,l,i,a);if(p!==void 0)return[[f,g]].concat(p)}}}}async function Dc(){return new E(tF(nF(await AF)))}var J0,qh,Vh,mc,Lc,Bc,Zh,Jh,Yh,Y0,CU,dn,Xh,$h,ya,oF,oe,AF,Ac=y(()=>{"use strict";Be();Dt();J0=7;[qh,Vh]=(()=>{let e=new Int8Array(10240),t=new Int8Array(1024*10);for(let o=0;o<1024;o++)for(let l=0,i=0;l<10;l++)(o>>>l&1)!==0&&(e[l<<10|o]=i,t[i<<10|o]=l,i++);function r(o){let l=1023,i=181440,a=0;for(let s=0;s<8;s++){let f=o[s];a+=e[l|f<<10]*i,l&=~(1<<f),i/=9-s}return a}function n(o,l){let i=1023,a=181440,s=0;for(let f=0;f<8;f++){let u=o/a|0;o-=u*a,s^=u&1;let g=t[i|u<<10];l[f]=g,i&=~(1<<g),a/=9-f}return l[8]=t[i|s<<10],l[9]=t[i|(s^1)<<10],l}return[r,n]})();mc=[yo([0,1,2,3,4],20),Ir({},20)],Lc=[yo([4,3,11,12,13],20),Ir({4:2,3:1,11:1,12:1,13:1},20)],Bc=[yo([3,2,9,10,11],20),Ir({3:2,2:1,9:1,10:1,11:1},20)],Zh=[yo([2,1,7,8,9],20),Ir({2:2,1:1,7:1,8:1,9:1},20)],Jh=[yo([1,0,5,6,7],20),Ir({1:2,0:1,5:1,6:1,7:1},20)],Yh=[yo([0,4,13,14,5],20),Ir({0:2,4:1,13:1,14:1,5:1},20)],Y0=[[15,16,17,18,19,10,9,8,7,6,5,14,13,12,11,0,1,2,3,4],Ir({},20)],CU=[[1,2,3,4,0,7,8,9,10,11,12,13,14,5,6,19,15,16,17,18],Ir({},20)],dn=[mc,Lc,Bc,Zh,Jh,Yh,Y0],Xh=["U","R","F","L","BL","BR","x2"],$h=$0(Y0,Y0),ya=[];for(let e=0;e<dn.length;e++){ya[e]=[$h];for(let t=1;t<5;t++)ya[e][t]=$0(ya[e][t-1],dn[e])}{let e=Math.sin(Math.PI/5),t=Math.cos(Math.PI/10),r=Math.cos(Math.PI/5),n=Math.sin(Math.PI/10);oF={U:[0,0],L:[-e-t,r-n],F:[0,2*r],R:[e+t,r-n],BR:[t,-1-n],BL:[-t,-1-n],DBR:[2*e+2*t,0],DB:[3*e+3*t,-r-n],DBL:[4*e+4*t,0],DFL:[3*e+4*t,1+r],DFR:[3*e+2*t,1+r],D:[3*e+3*t,r-n]}}oe={};AF=ve();Dc().then(e=>e.log())});var yc={};Bt(yc,{getRandomKilominxScramble:()=>Dc});var Uc=y(()=>{Ac()});function Ul(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Fn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function yF(e){e=e.slice();let t=e.length,r=Ul(t-1),n=0;for(;t>1;){t--;let o=e[0];n+=o*r;for(let l=0;l<t;l++){let i=e[l+1];e[l]=i-(i>o)}r/=t}return n}function Sa(e,t){let r=[],n=Ul(t-1)/2,o=0;for(let l=0;l<t-1;l++)r[l]=e/n|0,e%=n,n/=t-1-l;r[t-1]=0;for(let l=t-2;l>=0;l--)for(let i=l+1;i<t;i++)r[i]>=r[l]?r[i]++:o^=1;return o===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function wc(e){return yF(e)>>1}function hn(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function n2(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function bl(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n=0;n<e.length;n++)r[e[n]]=e[(n+1)%e.length];return r}function Wr(e,t){return e.length===0?Fn(t):e.map(r=>bl(r,t)).reduce(hn)}function UF(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=hn(e.mp,t.mp),o=hn(e.wp,t.wp),l=hn(e.cp,t.cp);return{co:r,mp:n,wp:o,cp:l}}function vc(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)===4}function CF(e){let t=["0","","'"];return e.map(([n,o])=>zF[n]+t[o]).join(" ")}function PF(e){let t=Array(4);for(let l=0;l<4;l++)t[l]=e(3);let r=Sa(e(Ul(6)/2),6);for(let l=0,i=0;l<6;l++){let a=l===5?i:e(2);i^=a,r[l]+=a*6,r[l+6]=(r[l]+6)%12}let n=Sa(e(Ul(12)/2),12),o=Sa(e(Ul(4)/2),4);return{co:t,mp:r,wp:n,cp:o}}function MF(e){return TF(PF(e))}function NF(e,t=!0,r=!1){let n=CF(MF(e));if(!t)return n;let o=["u","l","r","b"],l=["0","","'"];if(!r){for(let p=0;p<4;p++){let c=e(3);c!==0&&(n+=" "+o[p]+l[c])}return n.trim()}let i=[],a=[],s=[];for(let p=0;p<4;p++)i[p]=e(3),a[p]=e(3),s[p]=(i[p]-a[p]+3)%3;let f=p=>p.filter(c=>c!==0).length;for(;!(f(a)>=1&&f(s)>=1&&f(a)+f(s)>=4);)for(let p=0;p<4;p++)a[p]=e(3),s[p]=(i[p]-a[p]+3)%3;let u=a.map((p,c)=>p!==0?o[c]+l[p]+" ":"").join(""),g=s.map((p,c)=>p!==0?" "+o[c]+l[p]:"").join("");return u+n+g}function TF(e){let t=OF(e),r=[Cc(),Pc()],n=[qF(),VF()],o=KF(t),l,i=new Set,a=performance.now();for(let s=0;s<22;s++){let{value:f,done:u}=o.next(),g=e;for(let[R,F]of f)for(let A=0;A<F;A++)g=UF(g,bo[R]);let p=JSON.stringify(g);if(i.has(p))continue;i.add(p);let c=QF(g),L=l?l.length-f.length-1:999999,m=HF(c,r,n,L).next().value;if(m!==void 0&&((l===void 0||l.length>f.length+m.length)&&(l=f.concat(m)),performance.now()-a>300))break}return l}function GF(e){return e[3^e.indexOf(3)]}function OF(e){let t=hn(n2(e.mp),e.wp),r=(e.co.reduce((n,o)=>n+o)-GF(e.cp)+3)%3;return[0,1,2,3,4,5].map(n=>n+6*t.indexOf(n)+72*t.indexOf(n+6)+864*r)}function*KF(e){let t=0,r=zc(),n=jF();for(;;)yield*_c(...e,r,n,t,-1),t++}function*_c(e,t,r,n,o,l,i,a,s,f){let u=Dn,g=pr[e]+pr[t]+pr[r]+pr[n]+pr[o]+pr[l],p=Math.max(a[e%864+t*864],a[r%864+t*864],a[o%864+t*864],a[e%864+n*864],a[r%864+n*864],a[o%864+n*864],a[e%864+l*864],a[r%864+l*864],a[o%864+l*864],a[e%864+r*864],a[e%864+o*864],a[r%864+o*864],a[t%864+n*864],a[t%864+l*864],a[n%864+l*864],l2[g]);if(!(p>s)){if(s===0){yield[];return}if(!(p===0&&s===1))for(let c=0;c<u;c++){if(c===f||c<f&&vc(c,f))continue;let L=e,m=t,R=r,F=n,A=o,U=l;for(let x=1;x<=2;x++){L=i[L][c],m=i[m][c],R=i[R][c],F=i[F][c],A=i[A][c],U=i[U][c];let S=_c(L,m,R,F,A,U,i,a,s-1,c);for(;;){let{value:M,done:J}=S.next();if(J)break;yield[[c,x]].concat(M)}}}}}function QF(e){let t=e.mp,r=wc(t.slice(0,6).map(i=>i%6)),n=t.slice(0,5).map((i,a)=>(i>=6)*2**a).reduce((i,a)=>i+a),o=e.co.map((i,a)=>i*3**a).reduce((i,a)=>i+a),l=e.cp.indexOf(0);return[r+360*l,n+32*o]}function kc(){if(Ee.phase1pm)return Ee.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(Dn).fill(-1));for(let t=0;t<6;t++)for(let r=0;r<12;r++)for(let n=0;n<12;n++){if(r===n)continue;let o=t+6*r+72*n;for(let l=0;l<Dn;l++){let i=Ec[l][t],a=o2[l][r],s=o2[l][n];i<6?e[o][l]=i+6*a+72*s:e[o][l]=i-6+6*s+72*a}}return Ee.phase1pm=e}function zc(){if(Ee.phase1pcm)return Ee.phase1pcm;let e=kc(),t=Array(e.length*3).fill().map(()=>Array(Dn).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<Dn;n++){let o=e[r][n];t[r][n]=o+6*12*12*r2[n],t[r+6*12*12][n]=o+6*12*12*((r2[n]+1)%3),t[r+2*6*12*12][n]=o+6*12*12*((r2[n]+2)%3)}return Ee.phase1pcm=t}function jF(){if(Ee.phase1p2cp)return Ee.phase1p2cp;let e=kc(),t=zc(),r=new Int8Array((6*12*12)**2*3);r.fill(-1);let n=[0,1,2,3,4,5].map(l=>l+6*l+72*(l+6));for(let l=0;l<6;l++)for(let i=0;i<6;i++)l!==i&&(r[n[l]+864*n[i]]=0);let o=0;for(;;){let l=!1;for(let i=0;i<r.length;i++){if(r[i]!==o)continue;let a=i%864,s=Math.floor(i/864);for(let f=0;f<Dn;f++){let u=a,g=s;for(let p=1;p<=2;p++){u=e[u][f],g=t[g][f];let c=u+864*g;r[c]===-1&&(l=!0,r[c]=o+1)}}}if(!l)break;o++}return Ee.phase1p2cp=r}function Cc(){if(Ee.phase2pm)return Ee.phase2pm;let e=Array(1440).fill().map(()=>Array(wa));for(let t=0;t<360;t++){let r=Sa(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<wa;n++){let o=hn(r,bo[n].mp),l=wc(o.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let a=bo[n].cp[i];e[t+360*a][n]=l+360*i}}}return Ee.phase2pm=e}function Pc(){if(Ee.phase2om)return Ee.phase2om;let e=Array(32*81).fill().map(()=>Array(wa));for(let t=0;t<32;t++){let r=[0,1,2,3,4].map(o=>t>>o&1);r[5]=r.reduce((o,l)=>o^l);let n=[];for(let o=0;o<6;o++)n[o]=o+6*r[o],n[o+6]=o+6*(r[o]^1);for(let o=0;o<81;o++){let l=[0,1,2,3].map(i=>Math.floor(o/3**i)%3);for(let i=0;i<wa;i++){let s=hn(n,bo[i].mp).slice(0,5).map(p=>+(p>=6)),f=0;for(let p=0;p<5;p++)f+=s[p]<<p;let u=l.map((p,c)=>(p+bo[i].co[c])%3),g=0;for(let p=0;p<4;p++)g+=u[p]*3**p;e[t+32*o][i]=f+32*g}}}return Ee.phase2om=e}function qF(){return Ee.phase2pp?Ee.phase2pp:Ee.phase2pp=Mc(Cc(),[0])}function VF(){return Ee.phase2op?Ee.phase2op:Ee.phase2op=Mc(Pc(),[0])}function Mc(e,t){let r=e.length,n=e[0].length,o=Array(r).fill(-1),l=t.slice(),i=[],a=0;for(;l.length>0;){i.length=0;for(let s of l)if(o[s]===-1){o[s]=a;for(let f=0;f<n;f++){let u=e[s][f];for(;u!=s;)i.push(u),u=e[u][f]}}[l,i]=[i,l],a+=1}return o}function*HF(e,t,r,n){let o=e.length,l=0;for(let i=0;i<o;i++)l=Math.max(l,r[i][e[i]]);for(;l<=n;)yield*Nc(e,t,r,l,-1),l++}function*Nc(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let s=0;s<l;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===o||s<o&&vc(s,o))continue;let f=e.slice();for(let g=0;g<l;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,p)=>e[p]!=f[p]);){let g=Nc(f,t,r,n-1,s);for(;;){let{value:p,done:c}=g.next();if(c)break;yield[[s,u]].concat(p)}for(let p=0;p<l;p++)f[p]=t[p][f[p]][s];u++}}}}async function JF(){return NF(await ZF,!1)}var KU,QU,jU,bF,xF,SF,wF,vF,EF,_F,kF,bo,zF,Dn,wa,IF,Ec,WF,o2,r2,Sc,l2,pr,Ee,ZF,Tc=y(()=>{"use strict";Dt();[KU,QU]=(()=>{let e=new Int8Array(49152),t=new Int8Array(4096*12);for(let o=0;o<4096;o++)for(let l=0,i=0;l<12;l++)(o>>>l&1)!==0&&(e[l<<12|o]=i,t[i<<12|o]=l,i++);function r(o){let l=4095,i=19958400,a=0;for(let s=0;s<10;s++){let f=o[s];a+=e[l|f<<12]*i,l&=~(1<<f),i/=11-s}return a}function n(o,l){let i=4095,a=19958400,s=0;for(let f=0;f<10;f++){let u=o/a|0;o-=u*a,s^=u&1;let g=t[i|u<<12];l[f]=g,i&=~(1<<g),a/=11-f}return l[10]=t[i|s<<12],l[11]=t[i|(s^1)<<12],l}return[r,n]})();jU={co:[0,0,0,0],mp:Fn(12),wp:Fn(12),cp:[0,1,2,3]},bF={co:[2,0,0,0],mp:Fn(12),wp:bl([1,9,11],12),cp:[0,1,2,3]},xF={co:[0,2,0,0],mp:Fn(12),wp:bl([0,7,2],12),cp:[0,1,2,3]},SF={co:[0,0,2,0],mp:Fn(12),wp:bl([3,6,10],12),cp:[0,1,2,3]},wF={co:[0,0,0,2],mp:Fn(12),wp:bl([4,8,5],12),cp:[0,1,2,3]},vF={co:[2,0,0,0],mp:Wr([[1,9,11],[7,3,5]],12),wp:Wr([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},EF={co:[0,2,0,0],mp:Wr([[0,7,2],[6,1,8]],12),wp:Wr([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},_F={co:[0,0,2,0],mp:Wr([[3,6,10],[9,0,4]],12),wp:Wr([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},kF={co:[0,0,0,2],mp:Wr([[4,8,5],[10,2,11]],12),wp:Wr([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},bo=[vF,EF,_F,kF,bF,xF,SF,wF],zF=["u","l","r","b","U","L","R","B"],Dn=8,wa=4;IF=[],Ec=[],WF=[],o2=[];for(let e=0;e<Dn;e++){let t=bo[e];IF[e]=t.mp,Ec[e]=n2(t.mp),WF[e]=t.wp,o2[e]=n2(t.wp)}r2=[0,0,0,0,2,2,2,2],Sc=[[14,-1,-1,11,11,10,9,8,8,7,7,6,4,5,5,3,4,4,2,3,4,3,-1,-1,0],[13,-1,-1,11,10,10,9,8,8,7,7,6,4,5,5,3,4,4,2,3,3,1,-1,-1,6]],l2=new Int8Array(55);for(let e=0;e<25;e++)l2[e]=Sc[0][e],l2[e+30]=Sc[1][e];pr=new Int8Array(6*12*12*3);for(let e=0;e<6;e++)for(let t=0;t<12;t++)for(let r=0;r<12;r++){let n=e+6*t+72*r,o=2;t===e?o++:t===(e+6)%12&&o--,r===(e+6)%12?o++:r===e&&o--,pr[n]=o,pr[n+6*12*12]=pr[n+2*6*12*12]=o+5}Ee={};ZF=ve()});var Gc={};Bt(Gc,{randomMasterTetraminxScrambleString:()=>JF});var Oc=y(()=>{Tc()});function i3(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function Yc(e,t){var r;t<<=2,t>24?(t=48-t,r=e.ul,e.ul=(~~e.ul>>t|e.ur<<24-t)&16777215,e.ur=(~~e.ur>>t|r<<24-t)&16777215):t>0?(r=e.ul,e.ul=(e.ul<<t|~~e.ur>>24-t)&16777215,e.ur=(e.ur<<t|~~r>>24-t)&16777215):t==0?(r=e.ur,e.ur=e.dl,e.dl=r,e.ml=1-e.ml):t>=-24?(t=-t,r=e.dl,e.dl=(e.dl<<t|~~e.dr>>24-t)&16777215,e.dr=(e.dr<<t|~~r>>24-t)&16777215):t<-24&&(t=48+t,r=e.dl,e.dl=(~~e.dl>>t|e.dr<<24-t)&16777215,e.dr=(~~e.dr>>t|r<<24-t)&16777215)}function a3(e){var t,r,n,o,l;for(n=0,e.arr[0]=Ht(e,0),o=1;o<24;++o)Ht(e,o)!=e.arr[n]&&(e.arr[++n]=Ht(e,o));for(l=0,t=0;t<16;++t)for(r=t+1;r<16;++r)e.arr[t]>e.arr[r]&&(l^=1);return l}function s3(e){var t,r,n,o;return o=e.ur&1118481,o|=~~o>>3,o|=~~o>>6,o=o&15|~~o>>12&48,n=e.ul&1118481,n|=~~n>>3,n|=~~n>>6,n=n&15|~~n>>12&48,r=e.dr&1118481,r|=~~r>>3,r|=~~r>>6,r=r&15|~~r>>12&48,t=e.dl&1118481,t|=~~t>>3,t|=~~t>>6,t=t&15|~~t>>12&48,xl(a3(e)<<24|n<<18|o<<12|t<<6|r)}function f3(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~Ht(e,r*3+1)>>1<<24)>>24;for(t.cornperm=El(e.prm),t.topEdgeFirst=Ht(e,0)==Ht(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~Ht(e,r)>>1<<24)>>24;for(t.botEdgeFirst=Ht(e,12)==Ht(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~Ht(e,r)>>1<<24)>>24;t.edgeperm=El(e.prm),t.ml=e.ml}function Ht(e,t){var r;return t<6?r=~~e.ul>>(5-t<<2):t<12?r=~~e.ur>>(11-t<<2):t<18?r=~~e.dl>>(17-t<<2):r=~~e.dr>>(23-t<<2),~~((r&15)<<24)>>24}function s2(e,t,r){t<6?(e.ul&=~(15<<(5-t<<2)),e.ul|=r<<(5-t<<2)):t<12?(e.ur&=~(15<<(11-t<<2)),e.ur|=r<<(11-t<<2)):t<18?(e.dl&=~(15<<(17-t<<2)),e.dl|=r<<(17-t<<2)):(e.dr&=~(15<<(23-t<<2)),e.dr|=r<<(23-t<<2))}function c2(){this.arr=[],this.prm=[]}async function u3(){let e=await ve();var t,r,n,o,l,i,a,s,f;for(t=new c2,n=xo[e(3678)],l=19088743<<1|286331153,o=19088743<<1,a=i=8,r=0;r<24;r++)(n>>r&1)==0?(s=e(i)<<2,s2(t,23-r,o>>s&15),f=(1<<s)-1,o=(o&f)+(o>>4&~f),--i):(s=e(a)<<2,s2(t,23-r,l>>s&15),s2(t,22-r,l>>s&15),f=(1<<s)-1,l=(l&f)+(l>>4&~f),--a,++r);return t.ml=e(2),t}function g3(){}function p3(e){var t,r,n,o,l,i;for(i3(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)Yc(e.Search_d,e.Search_move[n]);for(f3(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,l=e.Search_sq.ml,i=Math.max(Ue[e.Search_sq.edgeperm<<1|l],Ue[e.Search_sq.cornperm<<1|l]),n=i;n<e.Search_maxlen2;++n)if(Ea(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,l,n,e.Search_length1,0)){for(o=0;o<n;++o)Yc(e.Search_d,e.Search_move[e.Search_length1+o]);return e.Search_sol_string=c3(e,n+e.Search_length1),!0}return!1}function c3(e,t){for(var r="",n=0,o=0,l=t-1;l>=0;l--){var i=e.Search_move[l];i>0?(i=12-i,n=i>6?i-12:i):i<0?(i=12+i,o=i>6?i-12:i):(n==0&&o==0?r+=" / ":r+="("+n+", "+o+") / ",n=o=0)}return(n!==0||o!==0)&&(r+="("+n+", "+o+")"),r}function va(e,t,r,n,o,l){var i,a,s;if(r==0&&n<4)return n==0&&p3(e);if(l!=0&&(s=_a[t],a=Ie[s],a<n&&(e.Search_move[o]=0,va(e,s,a,n-1,o+1,0))))return!0;if(s=t,l<=0){for(i=0;i+=vl[s],s=~~i>>4,i&=15,!(i>=12||(a=Ie[s],a>n));)if(a<n&&(e.Search_move[o]=i,va(e,s,a,n-1,o+1,1)))return!0}if(s=t,l<=1){for(i=0;i+=wl[s],s=~~i>>4,i&=15,!(i>=6||(a=Ie[s],a>n));)if(a<n&&(e.Search_move[o]=-i,va(e,s,a,n-1,o+1,2)))return!0}return!1}function Ea(e,t,r,n,o,l,i,a,s){var f,u,g,p,c,L,m;if(i==0&&!n&&o||s!=0&&n==o&&(g=_l[t],u=_l[r],Ue[g<<1|1-l]<i&&Ue[u<<1|1-l]<i&&(e.Search_move[a]=0,Ea(e,g,u,n,o,1-l,i-1,a+1,0))))return!0;if(s<=0)for(m=!n,g=m?Un[t]:t,u=m?r:Un[r],p=m?1:2,c=Ue[g<<1|l],L=Ue[u<<1|l];p<12&&c<=i&&c<=i;){if(c<i&&L<i&&(e.Search_move[a]=p,Ea(e,g,u,m,o,l,i-1,a+1,1)))return!0;m=!m,m?(g=Un[g],c=Ue[g<<1|l],p+=1):(u=Un[u],L=Ue[u<<1|l],p+=2)}if(s<=1)for(f=!o,g=f?yn[t]:t,u=f?r:yn[r],p=f?1:2,c=Ue[g<<1|l],L=Ue[u<<1|l];p<(i>3?6:12)&&c<=i&&c<=i;){if(c<i&&L<i&&(e.Search_move[a]=-p,Ea(e,g,u,n,f,l,i-1,a+1,2)))return!0;f=!f,f?(g=yn[g],c=Ue[g<<1|l],p+=1):(u=yn[u],L=Ue[u<<1|l],p+=2)}return!1}function m3(e,t){var r;for(e.Search_c=t,r=s3(t),e.Search_length1=Ie[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!va(e,r,Ie[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function em(){this.Search_move=[],this.Search_d=new c2,this.Search_sq=new rm}function L3(){}function B3(){Xc||(Xc=!0,Sl=[0,3,6,12,15,24,27,30,48,51,54,60,63],xo=[],Ie=[],vl=[],wl=[],_a=[],h3())}function R3(e){var t,r;t=0,r=0;do(e.bottom&2048)==0?(t+=1,e.bottom=e.bottom<<1):(t+=2,e.bottom=e.bottom<<2^12291),r=1-r;while((bn(e.bottom&63)&1)!=0);return(bn(e.bottom)&2)==0&&(e.Shape_parity^=r),t}function f2(e){var t;return t=om(xo,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function u2(e,t){e.Shape_parity=t&1,e.top=xo[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function d3(e){var t,r;t=0,r=0;do(e.top&2048)==0?(t+=1,e.top=e.top<<1):(t+=2,e.top=e.top<<2^12291),r=1-r;while((bn(e.top&63)&1)!=0);return(bn(e.top)&2)==0&&(e.Shape_parity^=r),t}function tm(){}function xl(e){var t;return t=om(xo,e&16777215)<<1|~~e>>24,t}function h3(){var e,t,r,n,o,l,i,a,s,f,u,g,p,c,L,m;for(e=0,i=0;i<28561;++i)l=Sl[i%13],r=Sl[~~(i/13)%13],g=Sl[~~(~~(i/13)/13)%13],u=Sl[~~(~~(~~(i/13)/13)/13)],p=u<<18|g<<12|r<<6|l,bn(p)==16&&(xo[e++]=p);for(f=new tm,i=0;i<7356;++i)u2(f,i),vl[i]=d3(f),vl[i]|=f2(f)<<4,u2(f,i),wl[i]=R3(f),wl[i]|=f2(f)<<4,u2(f,i),m=f.top&63,c=bn(m),L=bn(f.bottom&4032),f.Shape_parity^=1&~~(c&L)>>1,f.top=f.top&4032|~~f.bottom>>6&63,f.bottom=f.bottom&63|m<<6,_a[i]=f2(f);for(i=0;i<7536;++i)Ie[i]=-1;for(Ie[xl(14378715)]=0,Ie[xl(31157686)]=0,Ie[xl(23967451)]=0,Ie[xl(7191990)]=0,n=4,o=0,t=-1;n!=o;)for(o=n,++t,i=0;i<7536;++i)if(Ie[i]==t){s=0,a=i;do a=vl[a],s+=a&15,a>>=4,Ie[a]==-1&&(++n,Ie[a]=t+1);while(s!=12);s=0,a=i;do a=wl[a],s+=a&15,a>>=4,Ie[a]==-1&&(++n,Ie[a]=t+1);while(s!=12);a=_a[i],Ie[a]==-1&&(++n,Ie[a]=t+1)}}function F3(){}function D3(){if(!$c){$c=!0,Ue=[],_l=[],Un=[],yn=[],nm=[1,1,2,6,24,120,720,5040],An=[];for(var e=0;e<12;++e)An[e]=[];A3()}}function rm(){}function El(e){var t,r,n,o;for(r=0,o=1985229328,t=0;t<7;++t)n=e[t]<<2,r=(8-t)*r+(~~o>>n&7),o-=286331152<<n;return r&65535}function A3(){var e,t,r,n,o,l,i,a,s,f,u,g,p;for(o=0;o<12;++o)for(An[o][0]=1,An[o][o]=1,s=1;s<o;++s)An[o][s]=An[o-1][s-1]+An[o-1][s];for(g=[],o=0;o<40320;++o)g2(g,o),p=g[2],g[2]=g[4],g[4]=p,p=g[3],g[3]=g[5],g[5]=p,_l[o]=El(g),g2(g,o),p=g[0],g[0]=g[1],g[1]=g[2],g[2]=g[3],g[3]=p,Un[o]=El(g),g2(g,o),p=g[4],g[4]=g[5],g[5]=g[6],g[6]=g[7],g[7]=p,yn[o]=El(g);for(o=0;o<80640;++o)Ue[o]=-1;for(Ue[0]=0,t=0,r=1;r<80640;){a=t>=11,n=a?-1:t,e=a?t:-1,++t;e:for(o=0;o<80640;++o)if(Ue[o]==n){if(l=~~o>>1,u=o&1,i=_l[l]<<1|1-u,Ue[i]==e&&(++r,Ue[a?o:i]=~~(t<<24)>>24,a))continue e;for(i=l,f=0;f<4;++f)if(i=Un[i],Ue[i<<1|u]==e&&(++r,Ue[a?o:i<<1|u]=~~(t<<24)>>24,a))continue e;for(f=0;f<4;++f)if(i=yn[i],Ue[i<<1|u]==e&&(++r,Ue[a?o:i<<1|u]=~~(t<<24)>>24,a))continue e}}}function g2(e,t){var r,n,o,l,i;for(i=1985229328,r=0;r<7;++r)o=nm[7-r],l=~~(t/o),t-=l*o,l<<=2,e[r]=~~((~~i>>l&7)<<24)>>24,n=(1<<l)-1,i=(i&n)+(~~i>>4&~n);e[7]=~~(i<<24)>>24}function y3(){}function bn(e){return e-=~~e>>1&1431655765,e=(~~e>>2&858993459)+(e&858993459),e=(~~e>>4)+e&252645135,e+=~~e>>8,e+=~~e>>16,e&63}function om(e,t){var r,n,o,l;for(n=0,r=e.length-1;n<=r;)if(o=n+(~~(r-n)>>1),l=e[o],l<t)n=o+1;else if(l>t)r=o-1;else return o;return-n-1}async function w3(){return(await S3()).scramble_string}var _e,Xc,wl,xo,Ie,vl,_a,Sl,$c,yn,An,Ue,Un,_l,nm,p2,U3,b3,x3,S3,lm=y(()=>{Dt();_e=c2.prototype=g3.prototype;_e.dl=10062778;_e.dr=14536702;_e.ml=0;_e.ul=70195;_e.ur=4544119;_e=em.prototype=L3.prototype;_e.Search_c=null;_e.Search_length1=0;_e.Search_maxlen2=0;_e.Search_sol_string=null;Xc=!1;_e=tm.prototype=F3.prototype;_e.bottom=0;_e.Shape_parity=0;_e.top=0;$c=!1;_e=rm.prototype=y3.prototype;_e.botEdgeFirst=!1;_e.cornperm=0;_e.edgeperm=0;_e.ml=0;_e.topEdgeFirst=!1;p2=!1,U3=function(e,t,r){p2||(B3(),D3()),r&&r("Done initializing Square-1."),p2=!0,e!=null&&e()},b3=async function(){return p2||U3(),u3()},x3=function(e){var t=new em;return m3(t,e)},S3=async function(){var e=await b3(),t=x3(e);return{state:e,scramble_string:t}}});var im={};Bt(im,{getRandomSquare1ScrambleString:()=>w3});var am=y(()=>{lm()});var h2=Symbol("Comlink.proxy"),Rm=Symbol("Comlink.endpoint"),dm=Symbol("Comlink.releaseProxy"),Ca=Symbol("Comlink.thrown"),F2=e=>typeof e=="object"&&e!==null||typeof e=="function",hm={canHandle:e=>F2(e)&&e[h2],serialize(e){let{port1:t,port2:r}=new MessageChannel;return So(e,t),[r,[r]]},deserialize(e){return e.start(),Am(e)}},Fm={canHandle:e=>F2(e)&&Ca in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},D2=new Map([["proxy",hm],["throw",Fm]]);function So(e,t=self){t.addEventListener("message",function r(n){if(!n||!n.data)return;let{id:o,type:l,path:i}=Object.assign({path:[]},n.data),a=(n.data.argumentList||[]).map(Kr),s;try{let f=i.slice(0,-1).reduce((g,p)=>g[p],e),u=i.reduce((g,p)=>g[p],e);switch(l){case"GET":s=u;break;case"SET":f[i.slice(-1)[0]]=Kr(n.data.value),s=!0;break;case"APPLY":s=u.apply(f,a);break;case"CONSTRUCT":{let g=new u(...a);s=bm(g)}break;case"ENDPOINT":{let{port1:g,port2:p}=new MessageChannel;So(e,p),s=Um(g,[g])}break;case"RELEASE":s=void 0;break;default:return}}catch(f){s={value:f,[Ca]:0}}Promise.resolve(s).catch(f=>({value:f,[Ca]:0})).then(f=>{let[u,g]=Ma(f);t.postMessage(Object.assign(Object.assign({},u),{id:o}),g),l==="RELEASE"&&(t.removeEventListener("message",r),A2(t))})}),t.start&&t.start()}function Dm(e){return e.constructor.name==="MessagePort"}function A2(e){Dm(e)&&e.close()}function Am(e,t){return Pa(e,[],t)}function zl(e){if(e)throw new Error("Proxy has been released and is not useable")}function Pa(e,t=[],r=function(){}){let n=!1,o=new Proxy(r,{get(l,i){if(zl(n),i===dm)return()=>xn(e,{type:"RELEASE",path:t.map(a=>a.toString())}).then(()=>{A2(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>o};let a=xn(e,{type:"GET",path:t.map(s=>s.toString())}).then(Kr);return a.then.bind(a)}return Pa(e,[...t,i])},set(l,i,a){zl(n);let[s,f]=Ma(a);return xn(e,{type:"SET",path:[...t,i].map(u=>u.toString()),value:s},f).then(Kr)},apply(l,i,a){zl(n);let s=t[t.length-1];if(s===Rm)return xn(e,{type:"ENDPOINT"}).then(Kr);if(s==="bind")return Pa(e,t.slice(0,-1));let[f,u]=d2(a);return xn(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:f},u).then(Kr)},construct(l,i){zl(n);let[a,s]=d2(i);return xn(e,{type:"CONSTRUCT",path:t.map(f=>f.toString()),argumentList:a},s).then(Kr)}});return o}function ym(e){return Array.prototype.concat.apply([],e)}function d2(e){let t=e.map(Ma);return[t.map(r=>r[0]),ym(t.map(r=>r[1]))]}var y2=new WeakMap;function Um(e,t){return y2.set(e,t),e}function bm(e){return Object.assign(e,{[h2]:!0})}function Ma(e){for(let[t,r]of D2)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},o]}return[{type:"RAW",value:e},y2.get(e)||[]]}function Kr(e){switch(e.type){case"HANDLER":return D2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function xn(e,t,r){return new Promise(n=>{let o=xm();e.addEventListener("message",function l(i){!i.data||!i.data.id||i.data.id!==o||(e.removeEventListener("message",l),n(i.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}function xm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function Sm(e){let t=new WeakMap;return{postMessage:e.postMessage.bind(e),addEventListener:(r,n)=>{let o=l=>{"handleEvent"in n?n.handleEvent({data:l}):n({data:l})};e.on("message",o),t.set(n,o)},removeEventListener:(r,n)=>{let o=t.get(n);!o||(e.off("message",o),t.delete(n))},nodeWorker:e}}var U2=Sm;var wm=typeof globalThis.Worker>"u"&&typeof globalThis.WorkerNavigator>"u",vm="node:w-orker-_threa-ds",Em=()=>vm.replace(/-/g,"");async function _m(){let{parentPort:e}=await import(Em()).catch();return U2(e)}function b2(e){wm?(async()=>So(e,await _m()))():So(e)}He();tr();Ft();He();tr();Dt();Ft();Be();Be();var di=class extends zn{constructor(t){super();this.metric=t}traverseAlg(t){let r=0;for(let n of t.units())r+=this.traverseUnit(n);return r}traverseGrouping(t){let r=t.alg;return this.traverseAlg(r)*Math.abs(t.amount)}traverseMove(t){return this.metric(t)}traverseCommutator(t){return 2*(this.traverseAlg(t.A)+this.traverseAlg(t.B))}traverseConjugate(t){return 2*this.traverseAlg(t.A)+this.traverseAlg(t.B)}traversePause(t){return 0}traverseNewline(t){return 0}traverseLineComment(t){return 0}};function Vu(e){return"A"<=e&&e<="Z"}function EL(e){let t=e.family;return Vu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function _L(e){return 1}function kL(e){let t=e.family;return Vu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var Us=new di(EL),bs=Us.traverseAlg.bind(Us),zL=new di(_L),CL=Us.traverseAlg.bind(zL),qu=new di(kL),PL=qu.traverseAlg.bind(qu);Be();var Zu=class extends zn{traverseAlg(t){let r=0;for(let n of t.units())r+=this.traverseUnit(n);return r}traverseGrouping(t){return this.traverseAlg(t.alg)*Math.abs(t.amount)}traverseMove(t){return 1}traverseCommutator(t){return 2*(this.traverseAlg(t.A)+this.traverseAlg(t.B))}traverseConjugate(t){return 2*this.traverseAlg(t.A)+this.traverseAlg(t.B)}traversePause(t){return 1}traverseNewline(t){return 0}traverseLineComment(t){return 0}},Hu=new Zu,ML=Hu.traverseAlg.bind(Hu);Dt();var NL=2,TL=!0,GL=!1;function OL(e,t){let r=[];return t.forEach(function(n){let o=new B(n);if(o.amount!==1)throw new Error("SGS cannot handle def moves with an amount other than 1 yet.");let l=e.identityTransformation();for(let i=1;l=l.applyMove(o),!l.isIdentityTransformation();i++)r.push({move:o.modified({amount:i}),transformation:l})}),r}var Wt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=OL(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=NL,n){let o=t.experimentalToTransformation();if(!o)throw new Error("distinguishable pieces are not supported in tremble solver yt");let l=null,i=1e6,a=(s,f,u)=>{if(f===0){let g=this.sgsPhaseSolve(s,i);if(!g)return;let p=u.concat(g).simplify({collapseMoves:!0,quantumMoveOrder:n}),c=bs(p);(l===null||c<i)&&(GL&&(console.log(\`New best (\${c} moves): \${p.toString()}\`),console.log(\`Tremble moves are: \${u.toString()}\`)),l=p,i=c);return}for(let g of this.searchMoves)a(s.applyTransformation(g.transformation),f-1,u.concat([g.move]))};for(let s=0;s<=r;s++)a(o,s,new E);if(l===null)throw new Error("SGS search failed.");return l}sgsPhaseSolve(t,r){let n=new Rt,o=t;for(let l of this.sgs.ordering){let i=l.pieceOrdering,a="",s=o.invert();for(let u=0;u<i.length;u++){let g=i[u],p=g.orbitName,c=g.permutationIdx;a+=\` \${s.transformationData[p].permutation[c]} \${s.transformationData[p].orientation[c]}\`}let f=l.lookup[a];if(!f)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(f.alg),n.experimentalNumUnits()>=r)return null;if(o=o.applyTransformation(f.transformation),TL)for(let u=0;u<i.length;u++){let g=i[u],p=g.orbitName,c=g.permutationIdx;if(o.transformationData[p].permutation[c]!==c||o.transformationData[p].orientation[c]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function hi(e,t){let r=await rr(),n=e.identityTransformation();for(let o of t.ordering){let l=r(Object.values(o.lookup));n=n.applyTransformation(l.transformation)}return n.toKState()}Kt();var ft=Te(()=>Promise.resolve().then(()=>(l1(),o1)));var $L=3,i1=null;async function a1(){return i1||(i1=(async()=>{let e=await(await ft).cachedData222();return new Wt(await Pe["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function s1(){await a1()}async function Es(e){return we(),await(await a1()).solve(e,$L,()=>4)}async function eB(e,t,r,n){let o=await ve();await ju(r.stateData[t].pieces);let l=e.definition.orbits[t],i=r.stateData[t].orientation,a=0;for(let s=0;s<l.numPieces;s++){let f=o(l.numOrientations);i[s]=f,a+=f}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-a)%l.numOrientations+l.numOrientations)%l.numOrientations)}async function tB(){let e=await Pe["2x2x2"].kpuzzle(),t=new ce(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await eB(e,"CORNERS",t,{orientationSum:0}),t}async function f1(){return await Es(await tB())}r0();Fi();Kt();var w0=Te(()=>Promise.resolve().then(()=>(mp(),cp)));var Ld=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]];async function Lp(){return(await w0).initialize()}async function v0(){return(await w0).random444Scramble()}async function Bp(){return Qn(await v0(),Ld)}Fi();Be();Dt();function Bd(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var Rd=[["U","D"],["L","R"],["F","B"]],Rp=new Map;function dd(e){let t=Rp.get(e);if(t)return t;let r=[];for(let n of Rd){let o=[];r.push(o);for(let l of n){o.push(new z(l)),e>3&&o.push(new z(\`\${l}w\`));for(let i=3;i<=e/2;i++)o.push(new z(\`\${l}w\`,i))}}return Rp.set(e,r),r}async function fr(e){let t=await ve(),r=await rr(),n=r,o=dd(e),l=Bd(e),i=new Rt,a=0,s=new Set;for(;i.experimentalNumUnits()<l;){let f=t(3);f!==a&&s.clear(),a=f;let u=r(o[a]),g=u.toString();s.has(g)||(s.add(g),i.push(new B(u,n([1,2,-1]))))}return i.toAlg()}var hd=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function dp(){return Qn(await fr(5),hd)}Be();tr();Kt();Ft();Kt();var Xp=Te(()=>Promise.resolve().then(()=>(Yp(),Jp)));var EU=Te(()=>Promise.resolve().then(()=>(Z0(),H0)));async function pc(){return we(),new E(await(await Xp).randomFTOScrambleString())}Ft();Kt();var bc=Te(()=>Promise.resolve().then(()=>(Uc(),yc)));async function xc(){return we(),(await bc).getRandomKilominxScramble()}Be();Ft();Kt();var Ic=Te(()=>Promise.resolve().then(()=>(Oc(),Gc)));async function Wc(){return we(),new E(await(await Ic).randomMasterTetraminxScrambleString())}He();Ft();var YF=2,Kc=null;async function XF(){return Kc||(Kc=(async()=>{let e=await(await ft).cachedSGSDataMegaminx();return new Wt(await(await ft).cachedMegaminxKPuzzleWithoutMO(),e,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function Qc(e){we();let t=await XF(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new ce(await(await ft).cachedMegaminxKPuzzleWithoutMO(),r);return await t.solve(n,YF,()=>5)}tr();Ft();var $F=3,jc=null;async function e3(){return jc||(jc=(async()=>{let e=await(await ft).sgsDataPyraminx();return new Wt(await Pe.pyraminx.kpuzzle(),e,"RLUB".split(""))})())}async function i2(e){return we(),await(await e3()).solve(e,$F,()=>3)}async function t3(){return we(),hi(await Pe.pyraminx.kpuzzle(),await(await ft).sgsDataPyraminxFixedOrientation())}async function qc(){return i2(await t3())}Ft();Kt();var Vc=Te(()=>Promise.resolve().then(()=>(Z0(),H0)));async function Hc(){return we(),(await Vc).getRandomRediCubeScramble()}He();Ft();var r3=3,Zc=null;async function n3(){return Zc||(Zc=(async()=>{let e=await(await ft).sgsDataSkewb();return new Wt(await(await ft).skewbKPuzzleWithoutMOCached(),e,"RLUB".split(""))})())}function o3(e){return new ce(e.kpuzzle,{CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})}async function a2(e){return we(),await(await n3()).solve(o3(e),r3,n=>n.family==="y"?4:3)}async function l3(){return hi(await(await ft).skewbKPuzzleWithoutMOCached(),await(await ft).sgsDataSkewbFixedCorner())}async function Jc(){return a2(await l3())}Be();Kt();var sm=Te(()=>Promise.resolve().then(()=>(am(),im)));async function fm(){return E.fromString(await(await sm).getRandomSquare1ScrambleString())}var v3=1e3;Ou(!0);var pm=!0;function E3(e){pm=e}function um(){return(typeof performance>"u"?Date:performance).now()}async function ke(e,t,r){if(!pm)return t();let n=um(),o=t();o?.then&&await o;let l=um();return console.warn(\`\${e}\${r?.isPrefetch?" (prefetched)":""}: \${Math.round(l-n)}ms\`),o}var m2=new Map,L2=null;async function gm(e,t){switch(e){case"222":return ke("random222Scramble",f1,{isPrefetch:t?.isPrefetch});case"333":case"333oh":case"333ft":return ke("random333Scramble",ro,{isPrefetch:t?.isPrefetch});case"333fm":return ke("random333FewestMovesScramble",ng);case"333bf":case"333mb":return ke("random333OrientedScramble",rg);case"444":return ke("random444Scramble",v0,{isPrefetch:t?.isPrefetch});case"444bf":return ke("random444OrientedScramble",Bp);case"555":return ke("bigCubeScramble(5)",fr.bind(fr,5));case"555bf":return ke("oriented555RandomMoves",dp);case"666":return ke("bigCubeScramble(6)",fr.bind(fr,6));case"777":return ke("bigCubeScramble(7)",fr.bind(fr,7));case"skewb":return ke("randomSkewbFixedCornerScramble",Jc);case"pyram":return ke("randomPyraminxScrambleFixedOrientation",qc);case"sq1":return ke("getRandomSquare1Scramble",fm,{isPrefetch:t?.isPrefetch});case"fto":return ke("randomFTOScramble",pc,{isPrefetch:t?.isPrefetch});case"master_tetraminx":return ke("randomMasterTetraminxScramble",Wc);case"kilominx":return ke("randomKilominxScramble",xc,{isPrefetch:t?.isPrefetch});case"redi_cube":return ke("randomRediCubeScramble",Hc,{isPrefetch:t?.isPrefetch});default:throw new Error(\`unsupported event: \${e}\`)}}var B2="auto",R2={initialize:async e=>{switch(e){case"222":return ke("preInitialize222",s1);case"333":case"333oh":case"333ft":return ke("initialize333",tg);case"444":return ke("initialize444",Lp);default:throw new Error(\`unsupported event: \${e}\`)}},setScramblePrefetchLevel(e){B2=e},randomScrambleForEvent:async e=>{let t=m2.get(e);return t?m2.delete(e):t=gm(e),B2!=="none"&&t.then(()=>{L2&&clearTimeout(L2),L2=setTimeout(()=>{m2.set(e,gm(e,{isPrefetch:!0}))},B2==="immediate"?0:v3)}),t},randomScrambleStringForEvent:async e=>(await R2.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new ce(await Pe["3x3x3"].kpuzzle(),e);return(await t0(t)).toString()},solve222ToString:async e=>{let t=new ce(await Pe["2x2x2"].kpuzzle(),e);return(await Es(t)).toString()},solveSkewbToString:async e=>{let t=new ce(await Pe.skewb.kpuzzle(),e);return(await a2(t)).toString()},solvePyraminxToString:async e=>{let t=new ce(await Pe.pyraminx.kpuzzle(),e);return(await i2(t)).toString()},solveMegaminxToString:async e=>{let t=new ce(await Pe.megaminx.kpuzzle(),e);return(await Qc(t)).toString()},setDebugMeasurePerf:async e=>{E3(e)}};b2(R2);
3764
3764
  `;
3765
3765
  export {
3766
3766
  workerSource
3767
3767
  };
3768
- //# sourceMappingURL=search-worker-inside-generated-string-GNBQVERX.js.map
3768
+ //# sourceMappingURL=search-worker-inside-generated-string-KTF5N656.js.map