cubing 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/esm/{2x2x2.sgs.json-QKP2WRPT.js → 2x2x2.sgs.json-NUOQFJWU.js} +2 -2
- package/dist/esm/{2x2x2.sgs.json-QKP2WRPT.js.map → 2x2x2.sgs.json-NUOQFJWU.js.map} +0 -0
- package/dist/esm/{3d-dynamic-inside-GKERM3IG.js → 3d-dynamic-AKACURPM.js} +13 -13
- package/dist/esm/3d-dynamic-AKACURPM.js.map +7 -0
- package/dist/esm/{gwt-B7CBESZR.js → 3x3x3-min2phase-FPRJ5PCJ.js} +2 -2
- package/dist/esm/{gwt-B7CBESZR.js.map → 3x3x3-min2phase-FPRJ5PCJ.js.map} +1 -1
- package/dist/esm/{scramble_444-FXLLIDCW.js → 444-solver-GNQ5BHCL.js} +4 -4
- package/dist/esm/{scramble_444-FXLLIDCW.js.map → 444-solver-GNQ5BHCL.js.map} +1 -1
- package/dist/esm/bluetooth/index.js +1 -1
- package/dist/esm/chunk-5O24MNND.js +25 -0
- package/dist/esm/chunk-5O24MNND.js.map +7 -0
- package/dist/esm/{chunk-HCNUMBT5.js → chunk-ASJ2DADD.js} +3 -3
- package/dist/esm/{chunk-HCNUMBT5.js.map → chunk-ASJ2DADD.js.map} +2 -2
- package/dist/esm/{chunk-QUTXXRPT.js → chunk-CYKV7QC5.js} +2 -2
- package/dist/esm/{chunk-QUTXXRPT.js.map → chunk-CYKV7QC5.js.map} +0 -0
- package/dist/esm/{chunk-Z5INA5XR.js → chunk-FZJDXPAH.js} +52 -21
- package/dist/esm/chunk-FZJDXPAH.js.map +7 -0
- package/dist/esm/{chunk-GXV3K7MX.js → chunk-L3PZ4XAT.js} +2 -2
- package/dist/esm/{chunk-GXV3K7MX.js.map → chunk-L3PZ4XAT.js.map} +2 -2
- package/dist/esm/{chunk-37NJ765B.js → chunk-SNWS6JXI.js} +1 -1
- package/dist/esm/{chunk-37NJ765B.js.map → chunk-SNWS6JXI.js.map} +0 -0
- package/dist/esm/{entry-RSZSKW5X.js → entry-2KUJYJBJ.js} +12 -12
- package/dist/esm/{entry-RSZSKW5X.js.map → entry-2KUJYJBJ.js.map} +2 -2
- package/dist/esm/{ftosolver-smaller-phase3-table-UTQRO776.js → fto-solver-HI6NIV74.js} +2 -2
- package/dist/esm/{ftosolver-smaller-phase3-table-UTQRO776.js.map → fto-solver-HI6NIV74.js.map} +1 -1
- package/dist/esm/{fto.sgs.json-T5WY2HR7.js → fto.dynamic-A3AASYQ6.js} +8 -3
- package/dist/esm/fto.dynamic-A3AASYQ6.js.map +7 -0
- package/dist/esm/{masterpyra-QOJCNGZM.js → master_tetraminx-solver-KBQJGW4A.js} +2 -5
- package/dist/esm/{masterpyra-QOJCNGZM.js.map → master_tetraminx-solver-KBQJGW4A.js.map} +3 -3
- package/dist/esm/puzzles/index.js +1 -1
- package/dist/esm/{pyraminx.sgs.json-5HPDQAOM.js → pyraminx.sgs.json-X37XL7MA.js} +3 -3
- package/dist/esm/{pyraminx.sgs.json-5HPDQAOM.js.map → pyraminx.sgs.json-X37XL7MA.js.map} +0 -0
- package/dist/esm/scramble/index.js +3 -3
- package/dist/esm/search/index.js +3 -3
- package/dist/esm/{module-entry-UDFTQHXX.js → search-worker-entry-ZJAXYGSH.js} +7 -7
- package/dist/esm/search-worker-entry-ZJAXYGSH.js.map +7 -0
- package/dist/esm/{scramble_sq1-OZR6K4WV.js → sq1-solver-P3IWWET7.js} +2 -2
- package/dist/esm/{scramble_sq1-OZR6K4WV.js.map → sq1-solver-P3IWWET7.js.map} +1 -1
- package/dist/esm/twisty/index.js +54 -12
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/{worker-inside-generated-string-WGUQ4QSO.js → worker-inside-generated-string-OBSDMXAS.js} +641 -22
- package/dist/esm/worker-inside-generated-string-OBSDMXAS.js.map +7 -0
- package/dist/types/search/inside/{module-entry-path-getter.d.ts → search-worker-entry-path-getter.d.ts} +0 -0
- package/dist/types/search/inside/{module-entry.d.ts → search-worker-entry.d.ts} +0 -0
- package/dist/types/search/inside/solve/puzzles/{fto.sgs.json.d.ts → fto.dynamic.d.ts} +1 -0
- package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
- package/dist/types/twisty/heavy-code-imports/3d.d.ts +1 -1
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/{3d-dynamic-inside.d.ts → 3d-dynamic.d.ts} +0 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +4 -0
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +1 -2
- package/dist/types/twisty/model/props/general/ArbitraryStringProp.d.ts +4 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts +6 -0
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +6 -0
- package/dist/types/twisty/views/twizzle/TwizzleLink.d.ts +1 -1
- package/dist/types/vendor/comlink-everywhere/inside/index.d.ts +2 -1
- package/dist/types/vendor/comlink-everywhere/node-adapter.d.ts +6 -0
- package/dist/types/vendor/comlink-everywhere/outside/index.d.ts +4 -2
- package/dist/types/vendor/cstimer/src/js/scramble/{scramble_444.d.ts → 444-solver.d.ts} +0 -0
- package/dist/types/vendor/min2phase/{gwt.d.ts → 3x3x3-min2phase.d.ts} +0 -0
- package/dist/types/vendor/sq12phase/{scramble_sq1.d.ts → sq1-solver.d.ts} +0 -0
- package/dist/types/vendor/xyzzy/{ftosolver.d.ts → fto-solver-original.d.ts} +0 -0
- package/dist/types/vendor/xyzzy/{ftosolver-smaller-phase3-table.d.ts → fto-solver.d.ts} +0 -0
- package/dist/types/vendor/xyzzy/{masterpyra.d.ts → master_tetraminx-solver.d.ts} +0 -0
- package/package.json +2 -2
- package/dist/esm/3d-dynamic-inside-GKERM3IG.js.map +0 -7
- package/dist/esm/chunk-L7W7Q42Q.js +0 -18
- package/dist/esm/chunk-L7W7Q42Q.js.map +0 -7
- package/dist/esm/chunk-Z5INA5XR.js.map +0 -7
- package/dist/esm/esm-test-worker.js +0 -15
- package/dist/esm/esm-test-worker.js.map +0 -7
- package/dist/esm/fto.sgs.json-T5WY2HR7.js.map +0 -7
- package/dist/esm/module-entry-UDFTQHXX.js.map +0 -7
- package/dist/esm/node-KTVORTZB.js +0 -41
- package/dist/esm/node-KTVORTZB.js.map +0 -7
- package/dist/esm/node-LMAS5PGZ.js +0 -14
- package/dist/esm/node-LMAS5PGZ.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-WGUQ4QSO.js.map +0 -7
- package/dist/types/esm-test-worker.d.ts +0 -1
- package/dist/types/vendor/comlink-everywhere/inside/node.d.ts +0 -1
- package/dist/types/vendor/comlink-everywhere/outside/node.d.ts +0 -2
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import "./chunk-WO2AXYFE.js";
|
|
2
2
|
|
|
3
3
|
// src/cubing/search/worker-inside-generated-string.js
|
|
4
|
-
var workerSource = `var
|
|
5
|
-
\`)||t.includes("\\r"))throw new Error("LineComment cannot contain newline");q(this,
|
|
6
|
-
\`}isIdentical(t){return t.is(Ye)}invert(){return this}*experimentalExpand(t=V.Forwards,r=1/0){yield this}}});var Ze,
|
|
7
|
-
\`)){o.push(Xe(new Ye,a,A(this,N))),l=!1,n=A(this,N);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(a);let[f]=this.parseRegex(Xm);o.push(Xe(new yt(f),a,A(this,N))),l=!1,n=A(this,N);continue e}else{o.push(Xe(new h("_SLASH_"),a,A(this,N))),l=!0,n=A(this,N);continue e}else if(this.tryConsumeNext(".")){i(a),o.push(Xe(new Ze,a,A(this,N))),l=!0,n=A(this,N);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(A(this,N)!==A(this,nt).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return Xe(o.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(Zm);return new P(n,hl(r,void 0),hl(t,void 0))}parseMoveImpl(){let t=A(this,N);if(this.tryConsumeNext("/"))return Xe(new h("_SLASH_"),t,A(this,N));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 Xe(new h(r,n),t,A(this,N))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=A(this,N),[,r,n]=this.parseRegex(O0);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[hl(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=A(this,N),[,r,n]=this.parseRegex(O0);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 hl(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return q(this,N,A(this,N)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(q(this,N,A(this,N)+r[0].length),r)}remaining(){return A(this,nt).slice(A(this,N))}popNext(){let t=A(this,nt)[A(this,N)];return ra(this,N)._++,t}tryConsumeNext(t){return A(this,nt)[A(this,N)]===t?(ra(this,N)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};nt=new WeakMap,N=new WeakMap});function Dl(e){j0.has(e)||(console.warn(e),j0.add(e))}var j0,ma=w(()=>{j0=new Set});var dn,pa=w(()=>{Dt();aa();dn=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<N0||this.amount>uo)throw new Error(\`Unit amount absolute value must be a non-negative integer from \${mn} to \${mn}.\`)}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=T0(t,this.amount<0);for(let l=0;l<n;l++)yield*this.quantum.experimentalExpand(o,r)}}});var Qt,Te,Ie,yl,P,Ue,hn,h,Kt=w(()=>{Ot();Dt();aa();ca();ma();pa();yl=class extends pl{constructor(t,r,n){super();ne(this,Qt,void 0);ne(this,Te,void 0);ne(this,Ie,void 0);if(q(this,Qt,t),q(this,Te,r??null),q(this,Ie,n??null),Object.freeze(this),A(this,Te)!==null&&(!Number.isInteger(A(this,Te))||A(this,Te)<1||A(this,Te)>uo))throw new Error(\`QuantumMove inner layer must be a positive integer below \${mn}.\`);if(A(this,Ie)!==null&&(!Number.isInteger(A(this,Ie))||A(this,Ie)<1||A(this,Ie)>uo))throw new Error(\`QuantumMove outer layer must be a positive integer below \${mn}.\`);if(A(this,Ie)!==null&&A(this,Te)!==null&&A(this,Te)<=A(this,Ie))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(A(this,Ie)!==null&&A(this,Te)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(t){return K0(t)}modified(t){return new yl(t.family??A(this,Qt),t.innerLayer??A(this,Te),t.outerLayer??A(this,Ie))}isIdentical(t){let r=t;return t.is(yl)&&A(this,Qt)===A(r,Qt)&&A(this,Te)===A(r,Te)&&A(this,Ie)===A(r,Ie)}get family(){return A(this,Qt)}get outerLayer(){return A(this,Ie)}get innerLayer(){return A(this,Te)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let t=A(this,Qt);return A(this,Te)!==null&&(t=String(A(this,Te))+t,A(this,Ie)!==null&&(t=String(A(this,Ie))+"-"+t)),t}},P=yl;Qt=new WeakMap,Te=new WeakMap,Ie=new WeakMap;hn=class extends Pe{constructor(...t){super();ne(this,Ue,void 0);if(typeof t[0]=="string")if(t[1]??null){q(this,Ue,new dn(P.fromString(t[0]),t[1]));return}else return hn.fromString(t[0]);q(this,Ue,new dn(t[0],t[1]))}isIdentical(t){let r=t.as(hn);return!!r&&A(this,Ue).isIdentical(A(r,Ue))}invert(){return Q0(this,new hn(A(this,Ue).quantum,-this.amount))}*experimentalExpand(t=V.Forwards){t===V.Forwards?yield this:yield this.modified({amount:-this.amount})}get quantum(){return A(this,Ue).quantum}modified(t){return new hn(A(this,Ue).quantum.modified(t),t.amount??this.amount)}static fromString(t){return W0(t)}get amount(){return A(this,Ue).amount}get type(){return Dl("deprecated: type"),"blockMove"}get family(){return A(this,Ue).quantum.family??void 0}get outerLayer(){return A(this,Ue).quantum.outerLayer??void 0}get innerLayer(){return A(this,Ue).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return A(this,Ue).quantum.toString().slice(0,-6)+Math.abs(this.amount)+(this.amount<0?"-":"+");if(this.family.endsWith("_PLUSPLUS_")){let t=Math.abs(this.amount);return A(this,Ue).quantum.toString().slice(0,-10)+(t===1?"":t)+(this.amount<0?"--":"++")}return A(this,Ue).quantum.toString()+A(this,Ue).suffix()}},h=hn;Ue=new WeakMap});var q0,V0,ot,Rl,ut,Al=w(()=>{Wt();Ot();Dt();Kt();pa();q0=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 P("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new P("D_SQ_"));let r=t.alg;if(r.experimentalNumUnits()===2){let[n,o]=r.units();if(n.as(h)?.quantum.isIdentical(this.quantumU_SQ_)&&o.as(h)?.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}},V0=new q0,Rl=class extends Pe{constructor(t,r){super();ne(this,ot,void 0);let n=or(t);q(this,ot,new dn(n,r))}isIdentical(t){let r=t;return t.is(Rl)&&A(this,ot).isIdentical(A(r,ot))}get alg(){return A(this,ot).quantum}get amount(){return A(this,ot).amount}get experimentalRepetitionSuffix(){return A(this,ot).suffix()}invert(){return new Rl(A(this,ot).quantum,-A(this,ot).amount)}*experimentalExpand(t=V.Forwards,r){r??(r=1/0),r===0?yield t===V.Forwards?this:this.invert():yield*A(this,ot).experimentalExpand(t,r-1)}static fromString(){throw new Error("unimplemented")}toString(){return V0.format(this)??\`(\${A(this,ot).quantum.toString()})\${A(this,ot).suffix()}\`}experimentalAsSquare1Tuple(){return V0.tuple(this)}},ut=Rl;ot=new WeakMap});var Fl=w(()=>{Al();po();co();mo();Kt();go();ho()});function Rt(e,t){return e instanceof t}function H0(e){return Rt(e,ut)||Rt(e,yt)||Rt(e,Me)||Rt(e,Ge)||Rt(e,h)||Rt(e,Ye)||Rt(e,Ze)}var ga=w(()=>{Fl()});function Y0(e,t,r){if(t.is(ut))return e.traverseGrouping(t,r);if(t.is(h))return e.traverseMove(t,r);if(t.is(Me))return e.traverseCommutator(t,r);if(t.is(Ge))return e.traverseConjugate(t,r);if(t.is(Ze))return e.traversePause(t,r);if(t.is(Ye))return e.traverseNewline(t,r);if(t.is(yt))return e.traverseLineComment(t,r);throw new Error("unknown unit")}function Z0(e){if(e.is(ut)||e.is(h)||e.is(Me)||e.is(Ge)||e.is(Ze)||e.is(Ye)||e.is(yt))return e;throw"internal error: expected unit"}var Ln,An,Bl,ep,ha,da,X0,J0,La=w(()=>{Al();co();Kt();go();ho();mo();po();Ln=class{traverseUnit(t,r){return Y0(this,t,r)}traverseIntoUnit(t,r){return Z0(this.traverseUnit(t,r))}},An=class extends Ln{traverseUnit(t){return Y0(this,t,void 0)}traverseIntoUnit(t){return Z0(this.traverseUnit(t))}},ha=class extends Ln{*traverseAlg(t,r){if(r.depth===0){yield*t.units();return}let n=[],o=null,l=r?.collapseMoves??!0;function i(s,c){var p;let m=x0(p=ha,Bl,ep).call(p,s,c,r);if(m===0)return!1;let u=new h(s.quantum,m);return n.push(u),o=u,!0}function a(s){l&&o?.is(h)&&s.is(h)&&o.quantum.isIdentical(s.quantum)?(n.pop(),i(o,s.amount)||(o=n.slice(-1)[0])):s.is(h)?i(s,0):(n.push(s),o=s)}let f={depth:r.depth?r.depth-1:null};for(let s of t.units())for(let c of this.traverseUnit(s,f))a(c);for(let s of n)yield s}*traverseGrouping(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new ut(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 Me(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 Ge(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}},da=ha;Bl=new WeakSet,ep=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},ne(da,Bl);X0=new da,J0=X0.traverseAlg.bind(X0)});function $0(e){if(!e)return[];if(Rt(e,z))return e.units();if(typeof e=="string")return ua(e).units();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw"Invalid unit"}function or(e){return Rt(e,z)?e:new z(e)}function tp(e,t){return e.is(Ye)||t.is(Ye)?"":e.is(yt)&&!t.is(Ye)?\`
|
|
8
|
-
\`:" "}var lt,Cr,z,Wt=w(()=>{Ot();ga();Dt();ca();La();po();Kt();go();ma();Cr=class extends Pe{constructor(t){super();ne(this,lt,void 0);q(this,lt,Array.from($0(t)));for(let r of A(this,lt))if(!H0(r))throw new Error("An alg can only contain units.")}isIdentical(t){let r=t;if(!t.is(Cr))return!1;let n=Array.from(A(this,lt)),o=Array.from(A(r,lt));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 Cr(I0(Array.from(A(this,lt)).map(t=>t.invert())))}*experimentalExpand(t=V.Forwards,r){r??(r=1/0);for(let n of ia(A(this,lt),t))yield*n.experimentalExpand(t,r)}expand(t){return new Cr(this.experimentalExpand(V.Forwards,t?.depth??1/0))}*experimentalLeafMoves(){for(let t of this.experimentalExpand())t.is(h)&&(yield t)}concat(t){return new Cr(Array.from(A(this,lt)).concat(Array.from($0(t))))}experimentalIsEmpty(){for(let t of A(this,lt))return!1;return!0}static fromString(t){return ua(t)}*units(){for(let t of A(this,lt))yield t}experimentalNumUnits(){return Array.from(A(this,lt)).length}get type(){return Dl("deprecated: type"),"sequence"}toString(){let t="",r=null;for(let n of A(this,lt))r&&(t+=tp(r,n)),t+=n.toString(),r=n;return t}simplify(t){return new Cr(J0(this,t??{}))}},z=Cr;lt=new WeakMap});var rp,e2=w(()=>{Wt();Fl();co();mo();Kt();ho();rp={Sune:new z([new h("R",1),new h("U",1),new h("R",-1),new h("U",1),new h("R",1),new h("U",-2),new h("R",-1)]),AntiSune:new z([new h("R",1),new h("U",2),new h("R",-1),new h("U",-1),new h("R",1),new h("U",-1),new h("R",-1)]),SuneCommutator:new z([new Me(new z([new h("R",1),new h("U",1),new h("R",-2)]),new z([new Ge(new z([new h("R",1)]),new z([new h("U",1)]))]))]),Niklas:new z([new h("R",1),new h("U",-1),new h("L",-1),new h("U",1),new h("R",-1),new h("U",-1),new h("L",1),new h("U",1)]),EPerm:new z([new h("x",-1),new Me(new z([new Ge(new z([new h("R",1)]),new z([new h("U",-1)]))]),new z([new h("D",1)])),new Me(new z([new Ge(new z([new h("R",1)]),new z([new h("U",1)]))]),new z([new h("D",1)])),new h("x",1)]),FURURFCompact:new z([new Ge(new z([new h("F",1)]),new z([new Me(new z([new h("U",1)]),new z([new h("R",1)]))]))]),APermCompact:new z([new Ge(new z([new h("R",2)]),new z([new Me(new z([new h("F",2)]),new z([new h("R",-1),new h("B",-1),new h("R",1)]))]))]),FURURFMoves:new z([new h("F",1),new h("U",1),new h("R",1),new h("U",-1),new h("R",-1),new h("F",-1)]),TPerm:new z([new h("R",1),new h("U",1),new h("R",-1),new h("U",-1),new h("R",-1),new h("F",1),new h("R",2),new h("U",-1),new h("R",-1),new h("U",-1),new h("R",1),new h("U",1),new h("R",-1),new h("F",-1)]),HeadlightSwaps:new z([new Ge(new z([new h("F",1)]),new z([new ut(new z([new Me(new z([new h("R",1)]),new z([new h("U",1)]))]),3)]))]),TriplePause:new z([new Ze,new Ze,new Ze])}});var GD,t2=w(()=>{Kt();GD={73:new h("R"),75:new h("R'"),87:new h("B"),79:new h("B'"),83:new h("D"),76:new h("D'"),68:new h("L"),69:new h("L'"),74:new h("U"),70:new h("U'"),72:new h("F"),71:new h("F'"),78:new h("x'"),67:new h("l"),82:new h("l'"),85:new h("r"),77:new h("r'"),88:new h("d"),188:new h("d'"),84:new h("x"),89:new h("x"),66:new h("x'"),186:new h("y"),59:new h("y"),65:new h("y'"),80:new h("z"),81:new h("z'"),90:new h("M'"),190:new h("M'")}});var r2=w(()=>{});var n2=w(()=>{Wt()});var Le=w(()=>{Wt();sa();La();e2();t2();Fl();Kt();r2();n2();ga();Dt()});function Lo(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Ao(l.numOrientations,a))n[o]=i;else if(Ao(l.numOrientations,i))n[o]=a;else{let f=new Array(l.numPieces);if(l.numOrientations===1){for(let s=0;s<l.numPieces;s++)f[s]=i.permutation[a.permutation[s]];n[o]={permutation:f,orientation:i.orientation}}else{let s=new Array(l.numPieces);for(let c=0;c<l.numPieces;c++)s[c]=(i.orientation[a.permutation[c]]+a.orientation[c])%l.numOrientations,f[c]=i.permutation[a.permutation[c]];n[o]={permutation:f,orientation:s}}}}return n}function Aa(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Ao(l.numOrientations,a))n[o]=i;else{let f=new Array(l.numPieces);if(l.numOrientations===1){for(let s=0;s<l.numPieces;s++)f[s]=i.pieces[a.permutation[s]];n[o]={pieces:f,orientation:i.orientation}}else{let s=new Array(l.numPieces);for(let c=0;c<l.numPieces;c++)s[c]=(i.orientation[a.permutation[c]]+a.orientation[c])%l.numOrientations,f[c]=i.pieces[a.permutation[c]];n[o]={pieces:f,orientation:s}}}}return n}var bl=w(()=>{Do()});function np(e){let t=l2.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 o2&&(Object.freeze(r),Object.freeze(n),Object.freeze(o)),l2.set(e,o),o}function i2(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=np(n.numPieces);return o2&&Object.freeze(t),t}function a2(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(n)return ir(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 ir(e,l,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var o2,l2,Da=w(()=>{Do();o2=!1,l2=new Map});var ge,wl=w(()=>{bl();yo();ge=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}static fromTransformation(t){let r=Aa(t.kpuzzle.definition,t.kpuzzle.definition.startStateData,t.transformationData);return new ge(t.kpuzzle,r)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(t.isIdentityTransformation())return new ge(this.kpuzzle,this.stateData);let r=Aa(this.kpuzzle.definition,this.stateData,t.transformationData);return new ge(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 Ft(this.kpuzzle,t)}}});var Pr,ar,Ft,yo=w(()=>{Do();bl();Da();wl();ar=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;ne(this,Pr,void 0)}invert(){return new ar(this.kpuzzle,ya(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return A(this,Pr)??q(this,Pr,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new ar(t,i2(t.definition));return q(r,Pr,!0),r}isIdentical(t){return s2(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 A(this,Pr)?new ar(this.kpuzzle,t.transformationData):A(t,Pr)?new ar(this.kpuzzle,this.transformationData):new ar(this.kpuzzle,Lo(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 ge.fromTransformation(this)}repetitionOrder(){return f2(this.kpuzzle.definition,this)}selfMultiply(t){return new ar(this.kpuzzle,ir(this.kpuzzle,this.transformationData,t))}},Ft=ar;Pr=new WeakMap});function Ao(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 op(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 s2(e,t,r){for(let[n,o]of Object.entries(e.definition.orbits))if(!op(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(Ao(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 f=0;f<o.numPieces;f++){let s=l.permutation[f];i[s]=f,a[s]=(o.numOrientations-l.orientation[f]+o.numOrientations)%o.numOrientations}r[n]={permutation:i,orientation:a}}}return r}function ir(e,t,r){if(r===1)return t;if(r<0)return ir(e,ya(e,t),-r);if(r===0){let{transformationData:l}=e.identityTransformation();return l}let n=t;r!==2&&(n=ir(e,t,Math.floor(r/2)));let o=Lo(e.definition,n,n);return r%2==0?o:Lo(e.definition,t,o)}function Ra(e,t){return t?Ra(t,e%t):e}function f2(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 f=a,s=0,c=0;for(;i[f]=!0,s=s+l.orientation[f],c=c+1,f=l.permutation[f],f!==a;);s!==0&&(c=c*o.numOrientations/Ra(o.numOrientations,s)),r=r*c/Ra(r,c)}}return r}var u2,c2,m2,Do=w(()=>{Le();bl();yo();u2=class extends Ln{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 Ft(r,ir(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()}},c2=new u2,m2=c2.traverseAlg.bind(c2)});var Dn,xl,Ne,Fa=w(()=>{Le();Do();Da();wl();yo();Ne=class{constructor(t,r){this.definition=t;ne(this,Dn,new Map);ne(this,xl,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return Ft.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new h(t));let r=t.toString(),n=A(this,Dn).get(r);if(n)return new Ft(this,n);if(this.experimentalPGNotation){let l=this.experimentalPGNotation.lookupMove(t);if(!l)throw new Error(\`could not map to internal move: \${t}\`);return A(this,Dn).set(r,l),new Ft(this,l)}let o=a2(this,t);return A(this,Dn).set(r,o),new Ft(this,o)}algToTransformation(t){return typeof t=="string"&&(t=new z(t)),m2(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(z)?this.algToTransformation(t):t?.is?.(h)?this.moveToTransformation(t):t}startState(){return new ge(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return A(this,xl)??q(this,xl,(()=>{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.")}};Dn=new WeakMap,xl=new WeakMap});var Ae,p2=w(()=>{Ae={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]}}}};Ae.moves.Uw=Ae.moves.u;Ae.moves.Lw=Ae.moves.l;Ae.moves.Fw=Ae.moves.f;Ae.moves.Rw=Ae.moves.r;Ae.moves.Bw=Ae.moves.b;Ae.moves.Dw=Ae.moves.d;Ae.moves.Rv=Ae.moves.x;Ae.moves.Uv=Ae.moves.y;Ae.moves.Fv=Ae.moves.z;Ae.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]}};Ae.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]}};Ae.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]}}});var Ba,Je=w(()=>{Fa();wl();yo();p2();Fa();Ba=new Ne(Ae)});var g2=w(()=>{Je()});function gp(e){switch(e){case x.Regular:return lp;case x.Dim:return cp;case x.Ignored:return ip;case x.OrientationStickers:return ap;case x.Invisible:return sp;case x.IgnoreNonPrimary:return fp;case x.PermuteNonPrimary:return up;case x.Ignoriented:return mp;case x.OrientationWithoutPermutation:return pp}}var x,yn,zt,Oe,Rn,Sl,Mr,lp,ip,ap,sp,fp,up,cp,mp,pp,Ro,Fo,Bo=w(()=>{(function(s){s.Regular="Regular",s.Dim="Dim",s.Ignored="Ignored",s.OrientationStickers="OrientationStickers",s.Invisible="Invisible",s.Ignoriented="Ignoriented",s.IgnoreNonPrimary="IgnoreNonPrimary",s.PermuteNonPrimary="PermuteNonPrimary",s.OrientationWithoutPermutation="OrientationWithoutPermutation"})(x||(x={}));yn=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))}},zt="regular",Oe="ignored",Rn="oriented",Sl="invisible",Mr="dim",lp={facelets:[zt,zt,zt,zt,zt]},ip={facelets:[Oe,Oe,Oe,Oe,Oe]},ap={facelets:[Rn,Rn,Rn,Rn,Rn]},sp={facelets:[Sl,Sl,Sl,Sl]},fp={facelets:[zt,Oe,Oe,Oe,Oe]},up={facelets:[Mr,zt,zt,zt,zt]},cp={facelets:[Mr,Mr,Mr,Mr,Mr]},mp={facelets:[Mr,Oe,Oe,Oe,Oe]},pp={facelets:[Rn,Oe,Oe,Oe,Oe]};Ro=class extends yn{constructor(t){super(t,x.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(gp(i))}return t}},Fo=class{constructor(t){this.kpuzzle=t}and(t){let r=new yn(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 yn(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 yn(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 yn(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))}}});function dp(e){(async()=>{d2=e;let t=Array.from(document.body.querySelectorAll("twisty-player"));console.log(\`Setting the custom stickering for \${t.length} players!\`);let r=[];for(let n of t)r.push((async()=>{let o=await n.experimentalModel.stickering.get();n.experimentalStickering=o==="experimental-global-custom-1"?"experimental-global-custom-2":"experimental-global-custom-1"})());await Promise.all(r),console.log("Success!")})()}function h2(e,t){d2(e,t)}var d2,L2=w(()=>{Bo();d2=()=>{};globalThis.location&&new URL(location.href).searchParams.get("global-custom-stickerer")==="true"&&(window.setGlobalCustomStickerer=dp,window.PieceStickering=x,console.log("Global custom stickerer enabled! (using: global-custom-stickerer=true)"),console.log("Look here for inspiration:","https://github.com/cubing/cubing.js/blob/81b5cab3e27d8defb39dd1e0a10bc9e8ba894d26/src/cubing/puzzles/stickerings/cube-stickerings.ts#L67"))});async function _t(e,t){let r=await e.kpuzzle(),n=new Ro(r),o=new Fo(r),l=()=>o.move("U"),i=()=>o.or(o.moves(["U","D"])),a=()=>o.not(i()),f=()=>o.or(o.moves(["L","R"])),s=()=>o.not(f()),c=()=>o.or(o.moves(["F","B"])),m=()=>o.not(c()),u=()=>o.not(l()),p=()=>o.and([l(),s(),m()]),g=()=>o.and([o.and(o.moves(["F","R"])),o.not(i())]),d=()=>o.and(o.moves(["D","R","F"])),L=()=>o.or([d(),g()]),D=()=>o.or([o.and([s(),a()]),o.and([s(),m()]),o.and([a(),m()])]),F=()=>o.or([o.and([s(),i(),c()]),o.and([a(),f(),c()]),o.and([m(),i(),f()])]),B=()=>o.not(o.or([D(),F()])),k=()=>o.or([s(),o.and([l(),F()])]);function E(){n.set(u(),x.Dim)}function Q(){n.set(l(),x.PermuteNonPrimary),n.set(p(),x.Dim)}function $(){n.set(l(),x.IgnoreNonPrimary),n.set(p(),x.Regular)}function G(){n.set(l(),x.Ignoriented),n.set(p(),x.Dim)}switch(t){case"full":break;case"PLL":E(),Q();break;case"CLS":E(),n.set(o.and(o.moves(["D","R","F"])),x.Regular),n.set(l(),x.Ignoriented),n.set(o.and([l(),s(),m()]),x.Dim),n.set(o.and([l(),B()]),x.IgnoreNonPrimary);break;case"OLL":E(),$();break;case"COLL":E(),Q(),n.set(o.and([l(),B()]),x.Regular);break;case"OCLL":E(),G(),n.set(o.and([l(),B()]),x.IgnoreNonPrimary);break;case"CLL":E(),n.set(o.not(o.and([B(),l()])),x.Dim);break;case"ELL":E(),n.set(l(),x.Dim),n.set(o.and([l(),F()]),x.Regular);break;case"ELS":E(),$(),n.set(o.and([l(),B()]),x.Ignored),n.set(g(),x.Regular),n.set(d(),x.Ignored);break;case"LL":E();break;case"F2L":n.set(l(),x.Ignored);break;case"ZBLL":E(),n.set(l(),x.PermuteNonPrimary),n.set(p(),x.Dim),n.set(o.and([l(),B()]),x.Regular);break;case"ZBLS":E(),n.set(L(),x.Regular),$(),n.set(o.and([l(),B()]),x.Ignored);break;case"WVLS":case"VLS":E(),n.set(L(),x.Regular),$();break;case"LS":E(),n.set(L(),x.Regular),n.set(l(),x.Ignored),n.set(p(),x.Dim);break;case"EO":n.set(B(),x.Ignored),n.set(F(),x.OrientationWithoutPermutation);break;case"EOline":n.set(B(),x.Ignored),n.set(F(),x.OrientationWithoutPermutation),n.set(o.and(o.moves(["D","M"])),x.Regular);break;case"EOcross":n.set(F(),x.OrientationWithoutPermutation),n.set(o.move("D"),x.Regular),n.set(B(),x.Ignored);break;case"CMLL":n.set(u(),x.Dim),n.set(k(),x.Ignored),n.set(o.and([l(),B()]),x.Regular);break;case"L6E":n.set(o.not(k()),x.Dim);break;case"L6EO":n.set(o.not(k()),x.Dim),n.set(k(),x.OrientationWithoutPermutation),n.set(o.and([D(),i()]),x.OrientationStickers);break;case"Daisy":n.set(o.all(),x.Ignored),n.set(D(),x.Dim),n.set(o.and([o.move("D"),D()]),x.Regular),n.set(o.and([o.move("U"),F()]),x.IgnoreNonPrimary);break;case"Cross":n.set(o.all(),x.Ignored),n.set(D(),x.Dim),n.set(o.and([o.move("D"),D()]),x.Regular),n.set(o.and([o.move("D"),F()]),x.Regular);break;case"2x2x2":n.set(o.or(o.moves(["U","F","R"])),x.Ignored),n.set(o.and([o.or(o.moves(["U","F","R"])),D()]),x.Dim);break;case"2x2x3":n.set(o.all(),x.Dim),n.set(o.or(o.moves(["U","F","R"])),x.Ignored),n.set(o.and([o.or(o.moves(["U","F","R"])),D()]),x.Dim),n.set(o.and([o.move("F"),o.not(o.or(o.moves(["U","R"])))]),x.Regular);break;case"Void Cube":n.set(D(),x.Invisible);break;case"picture":case"invisible":n.set(o.all(),x.Invisible);break;case"centers-only":n.set(o.not(D()),x.Ignored);break;case"experimental-global-custom-1":case"experimental-global-custom-2":h2(n,o);break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),x.Dim)}return n.toAppearance()}async function Fn(){return["full","PLL","CLS","OLL","COLL","OCLL","ELL","ELS","LL","F2L","ZBLL","ZBLS","WVLS","VLS","LS","EO","EOline","EOcross","CMLL","L6E","L6EO","Daisy","Cross","2x2x2","2x2x3","Void Cube","picture","invisible","centers-only"]}var Bn=w(()=>{Bo();L2()});function We(e){let t=null;return()=>t??(t=e())}var Gr=w(()=>{});var bo,A2=w(()=>{bo=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(n){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 bn,D2=w(()=>{bn=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var vl,y2=w(()=>{Le();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 h(new P("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 h(new P("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var wo,R2=w(()=>{Le();wo=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 h(new P(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 Ul,F2=w(()=>{Le();Ul=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 h(new P("L",3,2),-2*t.amount);if(t.family==="R--")return new h(new P("L",3,2),2*t.amount);if(t.family==="D++")return new h(new P("U",3,2),-2*t.amount);if(t.family==="D--")return new h(new P("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new h(new P("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new h(new P("U",3,2),-2*t.amount)}if(t.family==="y")return new h("Uv",t.amount)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="Uv"?new h(new P("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new h("y",-t.amount):this.child.notationToExternal(t)}}});var El,B2=w(()=>{Le();El=class{constructor(t){this.slices=t}notationToInternal(t){let r=t.family;return!t.innerLayer&&!t.outerLayer&&(r==="x"?t=new h("Rv",t.amount):r==="y"?t=new h("Uv",t.amount):r==="z"&&(t=new h("Fv",t.amount)),(this.slices&1)==1&&(r==="E"?t=new h(new P("D",(this.slices+1)/2),t.amount):r==="M"?t=new h(new P("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new h(new P("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new h(new P("D",this.slices-1,2),t.amount):r==="m"?t=new h(new P("L",this.slices-1,2),t.amount):r==="s"&&(t=new h(new P("F",this.slices-1,2),t.amount)))),t}notationToExternal(t){let r=t.family;if(!t.innerLayer&&!t.outerLayer){if(r==="Rv")return new h("x",t.amount);if(r==="Uv")return new h("y",t.amount);if(r==="Fv")return new h("z",t.amount);if(r==="Lv")return new h("x",-t.amount);if(r==="Dv")return new h("y",-t.amount);if(r==="Bv")return new h("z",-t.amount)}return t}}});var hp,Lp,b2,w2,x2,xo,kl,S2=w(()=>{Le();hp={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"},Lp={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"},b2={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},w2=new P("y"),x2=new P("Dv"),xo=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=hp}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=b2[t.family];if(n)return new h(new P(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new h(new P(r,t.innerLayer,t.outerLayer),t.amount):w2.isIdentical(t.quantum)?new h(x2,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(b2))if(this.child.spinmatch(t.family,n))return new h(new P(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 h(new P(r,t.innerLayer,t.outerLayer),t.amount);return x2.isIdentical(t.quantum)?new h(w2,-t.amount):null}},kl=class extends xo{constructor(t){super(t);this.map=Lp}}});var v2,ba,U2,Ap,wa,E2,Dp,xa,k2,yp,zl,z2=w(()=>{Le();v2={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"},ba=new P("x"),U2=new P("Rv"),Ap=new P("Lv"),wa=new P("y"),E2=new P("Uv"),Dp=new P("Dv"),xa=new P("z"),k2=new P("Fv"),yp=new P("Bv"),zl=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=v2[t.family];return r?new h(new P(r,t.outerLayer,t.innerLayer),t.amount):ba.isIdentical(t.quantum)?new h(U2,t.amount):wa.isIdentical(t.quantum)?new h(E2,t.amount):xa.isIdentical(t.quantum)?new h(k2,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(v2))if(this.child.spinmatchv(t.family,n))return new h(new P(r,t.innerLayer,t.outerLayer),t.amount);return U2.isIdentical(t.quantum)?new h(ba,t.amount):Ap.isIdentical(t.quantum)?new h(ba,-t.amount):E2.isIdentical(t.quantum)?new h(wa,t.amount):Dp.isIdentical(t.quantum)?new h(wa,-t.amount):k2.isIdentical(t.quantum)?new h(xa,t.amount):yp.isIdentical(t.quantum)?new h(xa,-t.amount):null}}});var Sa=w(()=>{D2();y2();R2();F2();B2();S2();z2()});function _2(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:So(e.slice(t).join(" ")),options:r}}var va,Ua=w(()=>{_l();va=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 sr(e){if(!Ea[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;Ea[e]=t}return Ea[e]}function Ct(e){if(!ka[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;ka[e]=t}return ka[e]}function C2(e){return new gt(Ct(e))}function P2(e){let t=1;for(;e>1;)t*=e,e--;return t}function Rp(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 za(e,t){return e/Rp(e,t)*t}var Ea,ka,gt,Cl=w(()=>{Ea=[],ka=[];gt=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 gt(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 gt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new gt(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=za(t,o)}return t}}});function _a(e,t){let r=h.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function M2(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 f=0;for(let s=0;s<r;s++){if(s===i)continue;let c=e.moveops[s];a.mul(c).equal(c.mul(a))&&(f|=1<<s)}o.push(f)}let l={};l[0]=1;for(let i=0;i<100;i++){let a=0,f={},s=0;for(let c in l){let m=+c,u=l[m];a+=u,s++;for(let p=0;p<n.length;p++)if((m>>p&1)==0&&(m&o[p]&(1<<p)-1)==0){let g=m&o[p]|1<<p;f[g]===void 0&&(f[g]=0),f[g]+=(n[p]-1)*u}}t(\`\${i}: canonseq \${a} states \${s}\`),l=f}}var vo,Fp,wn,Bt,jt,Ca,fr,xn,Pa,G2=w(()=>{Le();Sa();Cl();vo=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return P2(this.size)*Math.pow(this.mod,this.size)}},Fp=0;wn=class{constructor(t,r,n,o,l){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=o;this.moveops=l}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}toKsolve(t,r=new bn){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}\`);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=_a(r,this.movenames[o]),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 #\${++Fp}\`,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,f=new Pa(a),s=new Array(this.orbitdefs[l].size);for(let p=0;p<a;p++)s[p]=!1;for(let p=0;p<this.moveops.length;p++)for(let g=0;g<a;g++)(this.moveops[p].orbits[l].perm[g]!==g||this.moveops[p].orbits[l].ori[g]!==0)&&(s[g]=!0,f.union(g,this.moveops[p].orbits[l].perm[g]));let c=!0;if(i>1){c=!1;let p=new Pa(this.orbitdefs[l].size*i);for(let g=0;g<this.moveops.length;g++)for(let d=0;d<a;d++)if(this.moveops[g].orbits[l].perm[d]!==d||this.moveops[g].orbits[l].ori[d]!==0)for(let L=0;L<i;L++)p.union(d*i+L,this.moveops[g].orbits[l].perm[d]*i+(L+this.moveops[g].orbits[l].ori[d])%i);for(let g=0;!c&&g<a;g++)for(let d=1;d<i;d++)p.find(g*i)===p.find(g*i+d)&&(c=!0);for(let g=0;!c&&g<a;g++)for(let d=0;d<g;d++)this.solved.orbits[l].perm[g]===this.solved.orbits[l].perm[d]&&(c=!0)}let m=-1,u=!1;for(let p=0;p<this.orbitdefs[l].size;p++)if(s[p]){let g=f.find(p);m<0?m=g:m!==g&&(u=!0)}for(let p=0;p<this.orbitdefs[l].size;p++){if(!s[p]||f.find(p)!==p)continue;let d=[],L=[],D=0;for(let F=0;F<this.orbitdefs[l].size;F++)f.find(F)===p&&(d[D]=F,L[F]=D,D++);if(u?t.push(\`\${this.orbitnames[l]}_p\${p}\`):t.push(this.orbitnames[l]),c){r.push(new vo(D,this.orbitdefs[l].mod)),n.push(this.solved.orbits[l].remapVS(d,D));for(let F=0;F<this.moveops.length;F++)o[F].push(this.moveops[F].orbits[l].remap(d,L,D))}else{r.push(new vo(D,1)),n.push(this.solved.orbits[l].remapVS(d,D).killOri());for(let F=0;F<this.moveops.length;F++)o[F].push(this.moveops[F].orbits[l].remap(d,L,D).killOri())}}}return new wn(t,r,new xn(n),this.movenames,o.map(l=>new fr(l)))}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=1;for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},Bt=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new Bt(Ct(t),sr(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 Bt(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 Bt(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 Bt(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 gt(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 gt(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===Ct(t)&&this.ori===sr(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===sr(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 Bt(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 f=this.perm[t[a]];i[f]===void 0&&(i[f]=l++),n[a]=i[f],o[a]=this.ori[t[a]]}return new Bt(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()?(Bt.kcache[t]||(Bt.kcache[t]={permutation:Ct(t),orientation:sr(t)}),Bt.kcache[t]):{permutation:this.perm,orientation:this.ori}}},jt=Bt;jt.kcache=[];Ca=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 gt(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=za(t,r.order());return t}},fr=class extends Ca{constructor(t){super(t)}mul(t){return new fr(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 fr(this.internalInv())}e(){return new fr(this.orbits.map(t=>jt.e(t.perm.length,t.orimod)))}},xn=class extends Ca{constructor(t){super(t)}mul(t){return new xn(this.internalMul(t))}},Pa=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 Pl,T2=w(()=>{Pl={"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 Ml(e){let t=new O(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function I2(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 Tr,O,Gl=w(()=>{Tr=1e-9;O=class{constructor(t,r,n,o){this.a=t;this.b=r;this.c=n;this.d=o}mul(t){return new O(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 O(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 O(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new O(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new O(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new O(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new O(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new O(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 O(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,o,l,i,a,f,s){return t*(l*s-i*f)+r*(i*a-o*s)+n*(o*f-l*a)}rotateplane(t){let r=t.mul(new O(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 O(0,1,0,0)).normalize():r<t&&r<n?this.cross(new O(0,0,1,0)).normalize():this.cross(new O(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<Tr)return new O(1,0,0,0);let n=r.sum(t);n.len()<Tr?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)<Tr?!1:new O(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>Tr?1:t<-Tr?-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 f=0;f<t.length;f++){(l[f]===i||l[f]===0)&&a.push(t[f]);let s=(f+1)%t.length;if(l[f]+l[s]===0&&l[f]!==0){let c=t[f].dot(this)-r,m=t[s].dot(this)-r,u=c/(c-m),p=t[f].smul(1-u).sum(t[s].smul(u));a.push(p)}}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)<Tr||r.dist(n.smul(-1))<Tr}makecut(t){return new O(t,this.b,this.c,this.d)}}});function N2(){let e=Math.sqrt(.5);return[new O(e,e,0,0),new O(e,0,e,0)]}function O2(){return[new O(.5,.5,.5,.5),new O(.5,.5,.5,-.5)]}function W2(){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 O(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new O(.5,.5,.5,.5)]}function K2(){let e=1/6+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 O(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new O(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function Q2(){let e=Math.sqrt(.5);return[new O(.5,.5,.5,.5),new O(e,0,0,e)]}function j2(e){let t=[new O(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])<Tl||l.dist(t[a])<Tl){i=!0;break}i||t.push(o)}return t}function Ma(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])<Tl){i=!0;break}i||(r.push(l),n.push(t[o]))}return n}function Ga(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let o=I2(0,r,n,e);if(o){let l=!1;for(let i=0;i<t.length;i++)if(o.dist(t[i])<Tl){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 Tl,q2=w(()=>{Gl();Tl=1e-9});function Il(e,t){let r=e[0].p.length,n=C2(r),o=[],l=[],i=[],a=[],f=[];function s(p){for(let g=p.p.length-1;g>=0;g--){let d=p.p[g];if(d!==g){if(!o[g][d])return!1;p=p.mul(l[g][d])}}return!0}function c(p,g,d){a[p].push(g),f[p].push(d);for(let L=0;L<o[p].length;L++)o[p][L]&&m(p,o[p][L].mul(g),d+i[p][L])}function m(p,g,d){let L=g.p[p];if(!o[p][L]){o[p][L]=g,l[p][L]=g.inv(),i[p][L]=d;for(let F=0;F<a[p].length;F++)m(p,g.mul(a[p][F]),d+f[p][F]);return}let D=g.mul(l[p][L]);s(D)||c(p-1,D,d+i[p][L])}function u(){o=[],l=[],a=[],i=[],f=[];for(let d=0;d<r;d++)o.push([]),l.push([]),i.push([]),a.push([]),f.push([]),o[d][d]=n,l[d][d]=n,i[d][d]=0;let p=0,g=1;for(let d=0;d<e.length;d++){c(r-1,e[d],1),g=1;let L=0,D=0,F=[],B=new V2;for(let k=0;k<r;k++){let E=0,Q=0;for(let G=0;G<r;G++)o[k][G]&&(E++,Q+=i[k][G],k!==G&&p++);L+=a[k].length,g*=E,E>1&&B.multiply(E);let $=Q/E;F.push($),D+=$}t(\`\${d}: sz \${g} T \${L} sol \${D} none \${p} mults \${B.toString()}\`)}return g}return u()}var V2,Ta=w(()=>{Cl();V2=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 Ia(e){return e}function Na(e){}function Bp(e,t){let r=[];for(let n of e)for(let o of t)r.push(o.rotate(n));return r}function xp(){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 Sp(){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 vp(){return{4:["F","D","L","R"],6:["U","D","F","B","L","R"],8:["F","BB","D","U","BR","L","R","BL"],12:["L","E","F","BF","R","I","U","D","BR","A","BL","C"],20:["L","S","E","O","F","B","I","P","R","K","U","D","J","A","Q","H","G","N","M","C"]}}function Up(){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 Nl(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<xe)return r;throw new Error("Element not found")}function H2(){return Pl}function Y2(e){return Pl[e]}function So(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 Oa(e,t={}){let r=So(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new Wl(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function vn(e,t){return Oa(Pl[e],t)}function Ep(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\`We only support slice and outer block moves right now. \${t}\`;return[l+o,n]}function kp(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 Ol(e,t){return[e.b/t,-e.c/t,e.d/t]}function Wa(e,t){let r=[],n=e.length;for(let o=0;o<n;o++){let l=Ol(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 Sn,Uo,xe,bp,wp,Wl,Ir,_l=w(()=>{Le();A2();Sa();Ua();Cl();G2();T2();q2();Gl();Ta();Sn=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 O(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 O(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 Sn(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new Sn(t)}},Uo=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 Uo(r[0]),this.right=new Uo(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 Sn(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};xe=1e-9,bp="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",wp=!1;Wl=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.faceorder=[];this.faceprecedence=[];this.notationMapper=new bn;this.addNotationMapper="";this.setReidOrder=!1;let n=Ia("genperms");this.options=new va(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t),Na(n)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let o=null;switch(r){case"c":o=N2();break;case"o":o=Q2();break;case"i":o=K2();break;case"t":o=O2();break;case"d":o=W2();break;default:throw new Error("Bad shape argument: "+r)}this.rotations=j2(o),this.options.verbosity&&console.log("# Rotations: "+this.rotations.length);let l=o[0];this.baseplanerot=Ma(l,this.rotations);let i=this.baseplanerot.map(R=>l.rotateplane(R));this.baseplanes=i,this.baseFaceCount=i.length;let a=xp()[i.length];this.net=a,this.colors=Sp()[i.length],this.faceorder=vp()[i.length],this.options.verbosity>0&&console.log("# Base planes: "+i.length);let f=Ga(i),s=new O(0,0,0,0);this.options.verbosity>0&&console.log("# Face vertices: "+f.length);let c=i[0].makenormal(),m=f[0].sum(f[1]).makenormal(),u=f[0].makenormal(),p=new O(1,c.b,c.c,c.d);this.options.verbosity>0&&console.log("# Boundary is "+p);let d=Ma(p,this.rotations).map(R=>p.rotateplane(R)),L=Ga(d);this.edgedistance=L[0].sum(L[1]).smul(.5).dist(s),this.vertexdistance=L[0].dist(s);let D=[],F=[],B=!1,k=!1,E=!1;for(let R of n){let U=null,I=0;switch(R.cutType){case"f":U=c,I=1,B=!0;break;case"v":U=u,I=this.vertexdistance,E=!0;break;case"e":U=m,I=this.edgedistance,k=!0;break;default:throw new Error("Bad cut argument: "+R.cutType)}D.push(U.makecut(R.distance)),F.push(R.distance<I)}this.options.addRotations&&(B||D.push(c.makecut(10)),E||D.push(u.makecut(10)),k||D.push(m.makecut(10))),this.basefaces=[];for(let R of this.baseplanerot){let U=R.rotateface(L);this.basefaces.push(new Sn(U))}let Q=[],$=[],G=[],oe=[],b=L.length;function _(R,U,I){for(let K of R)if(K[0].dist(U)<xe){K.push(I);return}R.push([U,I])}for(let R=0;R<this.baseplanerot.length;R++){let U=this.baseplanerot[R].rotateface(L);for(let I=0;I<U.length;I++){let K=(I+1)%U.length,le=U[I].sum(U[K]).smul(.5);_(oe,le,R)}}let M=[];for(let R=0;R<this.baseplanerot.length;R++){let U=this.baseplanerot[R].rotateface(L),I=[];for(let K=0;K<U.length;K++){let le=(K+1)%U.length,qe=U[K].sum(U[le]).smul(.5),ft=oe[Nl(oe,qe)];if(R===ft[1])I.push(ft[2]);else if(R===ft[2])I.push(ft[1]);else throw new Error("Could not find edge")}M.push(I)}let S={},v=[];v.push(a[0][0]),S[a[0][0]]=0,v[M[0][0]]=a[0][1],S[a[0][1]]=M[0][0];for(let R of a){let U=R[0],I=S[U];if(I===void 0)throw new Error("Bad edge description; first edge not connected");let K=-1;for(let le=0;le<M[I].length;le++){let qe=v[M[I][le]];if(qe!==void 0&&qe===R[1]){K=le;break}}if(K<0)throw new Error("First element of a net not known");for(let le=2;le<R.length;le++){if(R[le]==="")continue;let qe=M[I][(le+K-1)%b],ft=v[qe];if(ft!==void 0&&ft!==R[le])throw new Error("Face mismatch in net");v[qe]=R[le],S[R[le]]=qe}}for(let R=0;R<v.length;R++){let U=!1;for(let I=0;I<this.faceorder.length;I++)if(v[R]===this.faceorder[I]){this.faceprecedence[R]=I,U=!0;break}if(!U)throw new Error("Could not find face "+v[R]+" in face order list "+this.faceorder)}for(let R=0;R<this.baseplanerot.length;R++){let U=this.baseplanerot[R].rotateface(L),I=p.rotateplane(this.baseplanerot[R]),K=v[R];Q.push([U,K]),$.push([I,K])}for(let R=0;R<this.baseplanerot.length;R++){let U=this.baseplanerot[R].rotateface(L),I=v[R];for(let K=0;K<U.length;K++){let le=(K+1)%U.length,qe=U[K].sum(U[le]).smul(.5),ft=(K+2)%U.length,vm=U[le].sum(U[ft]).smul(.5),Um=Nl(oe,qe),Em=Nl(oe,vm);_(G,U[le],[I,Em,Um])}}this.swizzler=new bo(Q.map(R=>R[1]));let C=this.swizzler.prefixFree?"":"_";for(let R=0;R<oe.length;R++){if(oe[R].length!==3)throw new Error("Bad length in edge names "+oe[R]);let U=v[oe[R][1]],I=v[oe[R][2]];this.faceprecedence[oe[R][1]]<this.faceprecedence[oe[R][2]]?U=U+C+I:U=I+C+U,oe[R]=[oe[R][0],U]}for(let R=0;R<G.length;R++){if(G[R].length<4)throw new Error("Bad length in vertex names");let U=1;for(let K=2;K<G[R].length;K++)this.faceprecedence[S[G[R][K][0]]]<this.faceprecedence[S[G[R][U][0]]]&&(U=K);let I="";for(let K=1;K<G[R].length;K++){K===1?I=G[R][U][0]:I=I+C+G[R][U][0];for(let le=1;le<G[R].length;le++)if(G[R][U][1]===G[R][le][2]){U=le;break}}G[R]=[G[R][0],I]}this.options.verbosity>1&&(console.log("# Face precedence list: "+this.faceorder.join(" ")),console.log("# Face names: "+Q.map(R=>R[1]).join(" ")),console.log("# Edge names: "+oe.map(R=>R[1]).join(" ")),console.log("# Vertex names: "+G.map(R=>R[1]).join(" ")));let j=[];for(let R of $)j.push([R[0].makenormal(),R[1],"f"]);for(let R of oe)j.push([R[0].makenormal(),R[1],"e"]);for(let R of G)j.push([R[0].makenormal(),R[1],"v"]);this.facenames=Q,this.faceplanes=$,this.edgenames=oe,this.vertexnames=G,this.geonormals=j;let Z=j.map(R=>R[1]);this.swizzler.setGripNames(Z),this.options.verbosity>0&&console.log("# Distances: face "+1+" edge "+this.edgedistance+" vertex "+this.vertexdistance);for(let R=0;R<D.length;R++)for(let U of this.rotations){let I=D[R].rotateplane(U),K=!1;for(let le of this.moveplanes)if(I.sameplane(le)){K=!0;break}K||(this.moveplanes.push(I),F[R]&&this.moveplanes2.push(I))}let me=new Uo(L),de=this.moveplanes2.slice(),Fe=31;for(let R=0;R<de.length;R++){let U=R+Math.floor((de.length-R)*(Fe/65536));me=me.split(de[U]),de[U]=de[R],Fe=(Fe*1657+101)%65536}let we=me.collect([],!0);this.faces=we,this.options.verbosity>0&&console.log("# Faces is now "+we.length),this.stickersperface=we.length;let kt=[],Ce=Ml(L);for(let R of this.rotations){let U=R.rotateface(L);Ce.dist(Ml(U))<xe&&kt.push(R)}let rt=new Array(we.length),ve=[];for(let R=0;R<we.length;R++){let U=we[R].centermass();ve.push([Ce.dist(U),U,R])}ve.sort((R,U)=>R[0]-U[0]);for(let R=0;R<we.length;R++){let U=ve[R][2];if(!rt[U]){rt[U]=!0;for(let I of kt){let K=we[U].rotate(I),le=K.centermass();for(let qe=R+1;qe<we.length&&!(ve[qe][0]-ve[R][0]>xe);qe++){let ft=ve[qe][2];if(!rt[ft]&&le.dist(ve[qe][1])<xe){rt[ft]=!0,we[ft]=K;break}}}}}this.shortedge=1e99;for(let R of we)for(let U=0;U<R.length;U++){let I=(U+1)%R.length,K=R.get(U).dist(R.get(I));K<this.shortedge&&(this.shortedge=K)}this.options.verbosity>0&&console.log("# Short edge is "+this.shortedge),r==="c"&&B&&!k&&!E&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&E&&!B&&!k&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(E||B)&&!k&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&B&&(this.notationMapper=new wo(this.swizzler,new bo(["F","D","L","BL","R","U","BR","B"])),!k&&!E&&(this.addNotationMapper="FTOMapper")),r==="d"&&B&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new wo(this.swizzler,new bo(["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]))<xe)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]),f=a.len();a=a.normalize();let s=a.cross(i).normalize(),c=n[1].sub(n[0]),m=c.len()/f;c=c.normalize();let u=c.b,p=c.c,g=a.smul(u).sub(s.smul(p)).smul(m),d=s.smul(u).sum(a.smul(p)).smul(m),L=new O(0,n[0].b-g.dot(o[r]),n[0].c-d.dot(o[r]),0);return[g,d,L]}allstickers(){let t=Ia("allstickers");this.faces=Bp(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 _=b.makenormal(),M=!1;for(let S of n)_.sameplane(S.makenormal())&&(M=!0);M||(n.push(_),r.push([]))}for(let b of this.moveplanes2){let _=b.makenormal();for(let M=0;M<n.length;M++)if(_.sameplane(n[M])){r[M].push(b);break}}for(let b=0;b<r.length;b++){let _=r[b].map(S=>S.normalizeplane()),M=n[b];for(let S=0;S<_.length;S++)_[S].makenormal().dist(M)>xe&&(_[S]=_[S].smul(-1));_.sort((S,v)=>S.a-v.a),r[b]=_}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)<xe)continue;let _=b.makenormal();for(let M=0;M<r.length;M++)if(_.sameplane(n[M])){l[M].push(b);break}}this.moverotations=l;for(let b=0;b<l.length;b++){let _=l[b],M=_[0].makenormal();for(let S=0;S<_.length;S++)M.dist(_[S].makenormal())>xe&&(_[S]=_[S].smul(-1));_.sort((S,v)=>S.angle()-v.angle()),l[b][0].dot(n[b])<0&&_.reverse()}let i=l.map(b=>1+b.length);this.movesetorders=i;let a=[],f="?";for(let b=0;b<r.length;b++){let _=n[b],M=null,S=null;for(let v of this.geonormals){let C=_.dot(v[0]);Math.abs(C-1)<xe?(S=[v[1],v[2]],f=v[2]):Math.abs(C+1)<xe&&(M=[v[1],v[2]],f=v[2])}if(S===null||M===null)throw new Error("Saw positive or negative sides as null");a.push([S[0],S[1],M[0],M[1],1+r[b].length]),this.addNotationMapper==="NxNxNCubeMapper"&&f==="f"&&(this.notationMapper=new El(1+r[b].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new zl(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 xo(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new kl(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&f==="f"&&(1+r[b].length===3&&(this.notationMapper=new Ul(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&f==="f"&&(1+r[b].length===3&&(this.notationMapper=new vl(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=a;let s=new Map,c=this.faces;for(let b=0;b<c.length;b++){let _=c[b],M=this.keyface(_);if(!s.get(M))s.set(M,[b]);else{let S=s.get(M);if(S.push(b),S.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let v=0;v<S.length;v++){let C=M+" "+v;s.set(C,[S[v]])}}}}this.facelisthash=s,this.options.verbosity>0&&console.log("# Cubies: "+s.size);let m=[],u=[],p=[];for(let b of s.values())if(b.length!==this.baseFaceCount){if(b.length>1){let _=b.map(C=>c[C].centermass()),M=Ml(_);for(let C=0;b.length>2;C++){let j=!1;for(let Z=0;Z<b.length;Z++){let me=(Z+1)%b.length;if(M.dot(_[Z].cross(_[me]))<0){let de=_[Z];_[Z]=_[me],_[me]=de;let Fe=b[Z];b[Z]=b[me],b[me]=Fe,j=!0}}if(!j)break;if(C>1e3)throw new Error("Bad epsilon math; too close to border")}let S=0,v=b[S];for(let C=1;C<b.length;C++){let j=b[C];this.faceprecedence[this.getfaceindex(j)]<this.faceprecedence[this.getfaceindex(v)]&&(S=C,v=j)}if(S!==0){let C=b.slice();for(let j=0;j<b.length;j++)b[j]=C[(S+j)%b.length]}}for(let _=0;_<b.length;_++){let M=b[_];u[M]=m.length,p[M]=_}m.push(b)}this.cubies=m,this.facetocubie=u,this.facetoord=p;let g=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],d=[],L=[0,0,0,0,0,0],D=[],F=[],B=0,k=[],E=[],Q=[],$=[],G=b=>m[b].map(_=>this.getfaceindex(_)).join(" "),oe=[];for(let b=0;b<m.length;b++){if(F[b])continue;let _=m[b];if(_.length===0)continue;let M={},S=0;Q.push(0),oe.push([]);let v=_.length,C=L[v]++,j=g[v];(j===void 0||v===this.baseFaceCount)&&(j="CORE"),j=j+(C===0?"":C+1),d[B]=j,D[B]=v;let Z=[b],me=0;for(F[b]=!0;me<Z.length;){let de=Z[me++],Fe=G(de);if((_.length>1||M[Fe]===void 0)&&(M[Fe]=S++),$[de]=M[Fe],k[de]=B,oe[B].push(de),E[de]=Q[B]++,Z.length<this.rotations.length){let we=this.facecentermass[m[de][0]];for(let kt of l){let Ce=this.facetocubie[this.findface(we.rotatepoint(kt[0]))];F[Ce]||(Z.push(Ce),F[Ce]=!0)}}}B++}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"]],_={};for(let M of b)for(let S=0;S<M.length;S++){let v=0;for(let C=0;C<M[S].length;C++)v|=1<<M[S].charCodeAt(C)-65;_[v]=S}for(let M of oe)for(let S of M){let v=0;for(let C of m[S])v|=1<<this.facenames[this.getfaceindex(C)][1].charCodeAt(0)-65;E[S]=_[v]}}if(this.cubiesetnums=k,this.cubieordnums=E,this.cubiesetnames=d,this.cubieords=Q,this.orbitoris=D,this.cubievaluemap=$,this.cubiesetcubies=oe,this.options.fixedPieceType!==null){for(let b=0;b<m.length;b++)if(this.options.fixedPieceType==="v"&&m[b].length>2||this.options.fixedPieceType==="e"&&m[b].length===2||this.options.fixedPieceType==="f"&&m[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 "+Q),Na(t)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?"":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",f=1;return n[5]!==void 0&&(a=n[5],a[0]==="'"&&(a="-"+a.substring(1)),f=parseInt(a,10)),new h(new P(o,i,l),f)}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),f=!1;for(let m=0;m<this.movesetgeos.length;m++){let u=this.movesetgeos[m];a===u[0]&&(f=!0,l=u,i=m),a===u[2]&&(f=!1,l=u,i=m)}let s=1,c=1;if(n.toUpperCase()!==n&&(c=2),l===void 0)throw new Error("Bad grip in move "+t.family);if(t.outerLayer!==void 0&&(s=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(c=t.innerLayer,n<="Z"?s=c:s=1):c=t.innerLayer),s--,c--,o&&(s=0,c=this.moveplanesets[i].length),s<0||s>this.moveplanesets[i].length||c<0||c>this.moveplanesets[i].length)throw new Error("Bad slice spec "+s+" "+c+" vs "+this.moveplanesets[i].length);if(!wp&&s===0&&c===this.moveplanesets[i].length&&!o)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,s,c,f,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t=Ia("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);if(this.basefaces[l].centermass().dist(this.facecentermass[o])<xe){let i=this.basefaces[l].length;for(let a=1;a<i;a++)this.cubies[n].push(this.cubies[n][a-1]);this.duplicatedFaces[o]=i,this.duplicatedCubies[n]=i,this.orbitoris[this.cubiesetnums[n]]=i}}}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 c=0;c<this.faces.length;c++){let m=0;if(o.length>0){let u=this.facecentermass[c].dot(o[0]);for(let p=a;p>0;p>>=1)m+p<=o.length&&u>o[m+p-1].a&&(m+=p);m=o.length-m}for(l.push(m);i.length<=m;)i.push(0);i[m]++}let f=new Array(i.length);for(let c=0;c<i.length;c++)f[c]=[];let s=[];for(let c=0;c<this.faces.length;c++){if(l[c]<0)continue;let m=[this.facetocubie[c],this.facetoord[c]],u=this.facecentermass[c],p=u,g=c,d=l[g];for(;;){l[g]=-1;let L=u.rotatepoint(this.moverotations[n][0]);if(L.dist(p)<xe)break;g=this.findface(L),m.push(this.facetocubie[g],this.facetoord[g]),u=L}if(m.length>2&&this.options.orientCenters&&(this.cubies[m[0]].length===1||this.duplicatedCubies[m[0]]>1)&&this.facecentermass[c].dist(this.basefaces[this.getfaceindex(c)].centermass())<xe){let L=this.faces[this.cubies[m[0]][0]];for(let D=0;D<m.length;D+=2){let F=this.faces[this.cubies[m[D]][0]],B=-1;for(let k=0;k<L.length;k++)if(F.get(k).dist(L.get(0))<xe){B=k;break}if(B<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");m[D+1]=B,L=L.rotate(this.moverotations[n][0])}}if(m.length===2&&this.options.orientCenters)for(let L=1;L<this.movesetorders[n];L++)d===0?m.push(m[0],L):m.push(m[0],(this.movesetorders[n]-L)%this.movesetorders[n]);if(m.length>2&&!s[m[0]]){if(m.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let L of m)f[d].push(L)}for(let L=0;L<m.length;L+=2)s[m[L]]=!0}for(let c=0;c<f.length;c++)f[c]=f[c].slice();r.push(f)}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=[],Na(t)}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 f=!1;for(let s=0;s<l.length;s+=2)if(l[s][0]===a[0]&&l[s][1]===a[1]&&l[s+1]===n[i+1]){f=!0;break}f||(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+bp+\`
|
|
4
|
+
var workerSource = `var b0=Object.defineProperty;var Ec=e=>b0(e,"__esModule",{value:!0});var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var ye=(e,t)=>{Ec(e);for(var r in t)b0(e,r,{get:t[r],enumerable:!0})};var ta=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var d=(e,t,r)=>(ta(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(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)},q=(e,t,r,n)=>(ta(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ra=(e,t,r,n)=>({set _(o){q(e,t,o,r)},get _(){return d(e,t,n)}}),w0=(e,t,r)=>(ta(e,t,"access private method"),r);var _0={};ye(_0,{default:()=>Wc});function Oc(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))},start:e.start&&e.start.bind(e)}}var Wc,C0=b(()=>{Wc=Oc});var Vc,ml,Me,Wt=b(()=>{Vc=!1,ml=class{is(t){return this instanceof t}as(t){return this instanceof t?this:null}},Me=class extends ml{constructor(){super();Vc&&Object.defineProperty(this,"_debugStr",{get:()=>this.toString()})}get log(){return console.log.bind(console,this,this.toString())}}});function M0(e,t=!0){if(!t)return e;switch(e){case 1:return-1;case-1:return 1}}function ia(e,t){return t===-1?Array.from(e).reverse():e}function G0(e){return Array.from(e).reverse()}var V,Dt=b(()=>{(function(r){r[r.Forwards=1]="Forwards",r[r.Backwards=-1]="Backwards"})(V||(V={}))});var go,cn,T0,aa=b(()=>{go=2147483647,cn="2^31 - 1",T0=-2147483648});var kr,mt,sa=b(()=>{Kt();mt=class{constructor(){ne(this,kr,[])}push(t){d(this,kr).push(t)}experimentalPushAlg(t){for(let r of t.units())this.push(r)}experimentalNumUnits(){return d(this,kr).length}toAlg(){return new z(d(this,kr))}reset(){q(this,kr,[])}};kr=new WeakMap});var zr,_r,pl,Ge,co=b(()=>{Kt();Wt();Dt();pl=class extends Me{constructor(t,r){super();ne(this,zr,void 0);ne(this,_r,void 0);q(this,zr,ir(t)),q(this,_r,ir(r))}get A(){return d(this,zr)}get B(){return d(this,_r)}isIdentical(t){let r=t.as(pl);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new pl(d(this,_r),d(this,zr))}*experimentalExpand(t=V.Forwards,r){r??(r=1/0),r===0?yield t===V.Forwards?this:this.invert():t===V.Forwards?(yield*this.A.experimentalExpand(V.Forwards,r-1),yield*this.B.experimentalExpand(V.Forwards,r-1),yield*this.A.experimentalExpand(V.Backwards,r-1),yield*this.B.experimentalExpand(V.Backwards,r-1)):(yield*this.B.experimentalExpand(V.Forwards,r-1),yield*this.A.experimentalExpand(V.Forwards,r-1),yield*this.B.experimentalExpand(V.Backwards,r-1),yield*this.A.experimentalExpand(V.Backwards,r-1))}toString(){return\`[\${d(this,zr).toString()}, \${d(this,_r).toString()}]\`}},Ge=pl;zr=new WeakMap,_r=new WeakMap});var mn,pn,Ll,Te,mo=b(()=>{Kt();Wt();Dt();Ll=class extends Me{constructor(t,r){super();ne(this,mn,void 0);ne(this,pn,void 0);q(this,mn,ir(t)),q(this,pn,ir(r))}get A(){return d(this,mn)}get B(){return d(this,pn)}isIdentical(t){let r=t.as(Ll);return!!(r?.A.isIdentical(this.A)&&r?.B.isIdentical(this.B))}invert(){return new Ll(d(this,mn),d(this,pn).invert())}*experimentalExpand(t,r){r??(r=1/0),r===0?yield t===V.Forwards?this:this.invert():(yield*this.A.experimentalExpand(V.Forwards,r-1),yield*this.B.experimentalExpand(t,r-1),yield*this.A.experimentalExpand(V.Backwards,r-1))}toString(){return\`[\${this.A}: \${this.B}]\`}},Te=Ll;mn=new WeakMap,pn=new WeakMap});var ar,fa,Ft,po=b(()=>{Wt();Dt();fa=class extends Me{constructor(t){super();ne(this,ar,void 0);if(t.includes(\`
|
|
5
|
+
\`)||t.includes("\\r"))throw new Error("LineComment cannot contain newline");q(this,ar,t)}get text(){return d(this,ar)}isIdentical(t){let r=t;return t.is(fa)&&d(this,ar)===d(r,ar)}invert(){return this}*experimentalExpand(t=V.Forwards,r=1/0){yield this}toString(){return\`//\${d(this,ar)}\`}},Ft=fa;ar=new WeakMap});var Ye,Lo=b(()=>{Wt();Dt();Ye=class extends Me{toString(){return\`
|
|
6
|
+
\`}isIdentical(t){return t.is(Ye)}invert(){return this}*experimentalExpand(t=V.Forwards,r=1/0){yield this}}});var Ze,Bo=b(()=>{Wt();Dt();Ze=class extends Me{toString(){return"."}isIdentical(t){return t.is(Ze)}invert(){return this}*experimentalExpand(t=V.Forwards,r=1/0){yield this}}});function Bl(e,t){return e?parseInt(e):t}function ua(e){return new Rl().parseAlg(e)}function N0(e){return new Rl().parseMove(e)}function O0(e){return new Rl().parseQuantumMove(e)}function Xe(e,t,r){let n=e;return n.startCharIndex=t,n.endCharIndex=r,n}function W0(e,t){return"startCharIndex"in e&&(t.startCharIndex=e.startCharIndex),"endCharIndex"in e&&(t.endCharIndex=e.endCharIndex),t}var I0,Hc,Yc,Zc,Xc,Jc,nt,N,Rl,ga=b(()=>{Kt();sa();co();mo();dl();po();Qt();Lo();Bo();I0=/^(\\d+)?('?)/,Hc=/^[_\\dA-Za-z]/,Yc=/^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)?/,Zc=/^[^\\n]*/,Xc=/^(-?\\d+), ?/,Jc=/^(-?\\d+)\\)/;Rl=class{constructor(){ne(this,nt,"");ne(this,N,0)}parseAlg(t){q(this,nt,t),q(this,N,0);let r=this.parseAlgWithStopping([]);return this.mustBeAtEndOfInput(),r}parseMove(t){q(this,nt,t),q(this,N,0);let r=this.parseMoveImpl();return this.mustBeAtEndOfInput(),r}parseQuantumMove(t){q(this,nt,t),q(this,N,0);let r=this.parseQuantumMoveImpl();return this.mustBeAtEndOfInput(),r}mustBeAtEndOfInput(){if(d(this,N)!==d(this,nt).length)throw new Error("parsing unexpectedly ended early")}parseAlgWithStopping(t){let r=d(this,N),n=d(this,N),o=new mt,l=!1,i=a=>{if(l)throw new Error(\`Unexpected character at index \${a}. Are you missing a space?\`)};e:for(;d(this,N)<d(this,nt).length;){let a=d(this,N);if(t.includes(d(this,nt)[d(this,N)]))return Xe(o.toAlg(),r,n);if(this.tryConsumeNext(" ")){l=!1,o.experimentalNumUnits()===0&&(r=d(this,N));continue e}else if(Hc.test(d(this,nt)[d(this,N)])){i(a);let f=this.parseMoveImpl();o.push(f),l=!0,n=d(this,N);continue e}else if(this.tryConsumeNext("(")){i(a);let f=this.tryRegex(Xc);if(f){let s=f[1],g=d(this,N),c=this.parseRegex(Jc),u=Xe(new B(new P("U_SQ_"),parseInt(s)),a+1,a+1+s.length),m=Xe(new B(new P("D_SQ_"),parseInt(c[1])),g,d(this,N)-1),p=Xe(new z([u,m]),a+1,d(this,N)-1);o.push(Xe(new ut(p),a,d(this,N))),l=!0,n=d(this,N);continue e}else{let s=this.parseAlgWithStopping([")"]);this.mustConsumeNext(")");let g=this.parseAmount();o.push(Xe(new ut(s,g),a,d(this,N))),l=!0,n=d(this,N);continue e}}else if(this.tryConsumeNext("[")){i(a);let f=this.parseAlgWithStopping([",",":"]),s=this.popNext(),g=this.parseAlgWithStopping(["]"]);switch(this.mustConsumeNext("]"),s){case":":o.push(Xe(new Te(f,g),a,d(this,N))),l=!0,n=d(this,N);continue e;case",":o.push(Xe(new Ge(f,g),a,d(this,N))),l=!0,n=d(this,N);continue e;default:throw"unexpected parsing error"}}else if(this.tryConsumeNext(\`
|
|
7
|
+
\`)){o.push(Xe(new Ye,a,d(this,N))),l=!1,n=d(this,N);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(a);let[f]=this.parseRegex(Zc);o.push(Xe(new Ft(f),a,d(this,N))),l=!1,n=d(this,N);continue e}else{o.push(Xe(new B("_SLASH_"),a,d(this,N))),l=!0,n=d(this,N);continue e}else if(this.tryConsumeNext(".")){i(a),o.push(Xe(new Ze,a,d(this,N))),l=!0,n=d(this,N);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(d(this,N)!==d(this,nt).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return Xe(o.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(Yc);return new P(n,Bl(r,void 0),Bl(t,void 0))}parseMoveImpl(){let t=d(this,N);if(this.tryConsumeNext("/"))return Xe(new B("_SLASH_"),t,d(this,N));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 Xe(new B(r,n),t,d(this,N))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=d(this,N),[,r,n]=this.parseRegex(I0);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[Bl(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=d(this,N),[,r,n]=this.parseRegex(I0);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 Bl(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return q(this,N,d(this,N)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(q(this,N,d(this,N)+r[0].length),r)}remaining(){return d(this,nt).slice(d(this,N))}popNext(){let t=d(this,nt)[d(this,N)];return ra(this,N)._++,t}tryConsumeNext(t){return d(this,nt)[d(this,N)]===t?(ra(this,N)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};nt=new WeakMap,N=new WeakMap});function Dl(e){K0.has(e)||(console.warn(e),K0.add(e))}var K0,ca=b(()=>{K0=new Set});var Ln,ma=b(()=>{Dt();aa();Ln=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<T0||this.amount>go)throw new Error(\`Unit amount absolute value must be a non-negative integer from \${cn} to \${cn}.\`)}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=M0(t,this.amount<0);for(let l=0;l<n;l++)yield*this.quantum.experimentalExpand(o,r)}}});var jt,Ie,Ne,Fl,P,Ee,Bn,B,Qt=b(()=>{Wt();Dt();aa();ga();ca();ma();Fl=class extends ml{constructor(t,r,n){super();ne(this,jt,void 0);ne(this,Ie,void 0);ne(this,Ne,void 0);if(q(this,jt,t),q(this,Ie,r??null),q(this,Ne,n??null),Object.freeze(this),d(this,Ie)!==null&&(!Number.isInteger(d(this,Ie))||d(this,Ie)<1||d(this,Ie)>go))throw new Error(\`QuantumMove inner layer must be a positive integer below \${cn}.\`);if(d(this,Ne)!==null&&(!Number.isInteger(d(this,Ne))||d(this,Ne)<1||d(this,Ne)>go))throw new Error(\`QuantumMove outer layer must be a positive integer below \${cn}.\`);if(d(this,Ne)!==null&&d(this,Ie)!==null&&d(this,Ie)<=d(this,Ne))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(d(this,Ne)!==null&&d(this,Ie)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(t){return O0(t)}modified(t){return new Fl(t.family??d(this,jt),t.innerLayer??d(this,Ie),t.outerLayer??d(this,Ne))}isIdentical(t){let r=t;return t.is(Fl)&&d(this,jt)===d(r,jt)&&d(this,Ie)===d(r,Ie)&&d(this,Ne)===d(r,Ne)}get family(){return d(this,jt)}get outerLayer(){return d(this,Ne)}get innerLayer(){return d(this,Ie)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let t=d(this,jt);return d(this,Ie)!==null&&(t=String(d(this,Ie))+t,d(this,Ne)!==null&&(t=String(d(this,Ne))+"-"+t)),t}},P=Fl;jt=new WeakMap,Ie=new WeakMap,Ne=new WeakMap;Bn=class extends Me{constructor(...t){super();ne(this,Ee,void 0);if(typeof t[0]=="string")if(t[1]??null){q(this,Ee,new Ln(P.fromString(t[0]),t[1]));return}else return Bn.fromString(t[0]);q(this,Ee,new Ln(t[0],t[1]))}isIdentical(t){let r=t.as(Bn);return!!r&&d(this,Ee).isIdentical(d(r,Ee))}invert(){return W0(this,new Bn(d(this,Ee).quantum,-this.amount))}*experimentalExpand(t=V.Forwards){t===V.Forwards?yield this:yield this.modified({amount:-this.amount})}get quantum(){return d(this,Ee).quantum}modified(t){return new Bn(d(this,Ee).quantum.modified(t),t.amount??this.amount)}static fromString(t){return N0(t)}get amount(){return d(this,Ee).amount}get type(){return Dl("deprecated: type"),"blockMove"}get family(){return d(this,Ee).quantum.family??void 0}get outerLayer(){return d(this,Ee).quantum.outerLayer??void 0}get innerLayer(){return d(this,Ee).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return d(this,Ee).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,Ee).quantum.toString().slice(0,-10)+(t===1?"":t)+(this.amount<0?"--":"++")}return d(this,Ee).quantum.toString()+d(this,Ee).suffix()}},B=Bn;Ee=new WeakMap});var Q0,j0,ot,hl,ut,dl=b(()=>{Kt();Wt();Dt();Qt();ma();Q0=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 P("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new P("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}},j0=new Q0,hl=class extends Me{constructor(t,r){super();ne(this,ot,void 0);let n=ir(t);q(this,ot,new Ln(n,r))}isIdentical(t){let r=t;return t.is(hl)&&d(this,ot).isIdentical(d(r,ot))}get alg(){return d(this,ot).quantum}get amount(){return d(this,ot).amount}get experimentalRepetitionSuffix(){return d(this,ot).suffix()}invert(){return new hl(d(this,ot).quantum,-d(this,ot).amount)}*experimentalExpand(t=V.Forwards,r){r??(r=1/0),r===0?yield t===V.Forwards?this:this.invert():yield*d(this,ot).experimentalExpand(t,r-1)}static fromString(){throw new Error("unimplemented")}toString(){return j0.format(this)??\`(\${d(this,ot).quantum.toString()})\${d(this,ot).suffix()}\`}experimentalAsSquare1Tuple(){return j0.tuple(this)}},ut=hl;ot=new WeakMap});var Al=b(()=>{dl();po();co();mo();Qt();Lo();Bo()});function ht(e,t){return e instanceof t}function q0(e){return ht(e,ut)||ht(e,Ft)||ht(e,Ge)||ht(e,Te)||ht(e,B)||ht(e,Ye)||ht(e,Ze)}var pa=b(()=>{Al()});function V0(e,t,r){if(t.is(ut))return e.traverseGrouping(t,r);if(t.is(B))return e.traverseMove(t,r);if(t.is(Ge))return e.traverseCommutator(t,r);if(t.is(Te))return e.traverseConjugate(t,r);if(t.is(Ze))return e.traversePause(t,r);if(t.is(Ye))return e.traverseNewline(t,r);if(t.is(Ft))return e.traverseLineComment(t,r);throw new Error("unknown unit")}function H0(e){if(e.is(ut)||e.is(B)||e.is(Ge)||e.is(Te)||e.is(Ze)||e.is(Ye)||e.is(Ft))return e;throw"internal error: expected unit"}var Rn,dn,yl,$c,Ba,La,Y0,Z0,Ra=b(()=>{dl();co();Qt();Lo();Bo();mo();po();Rn=class{traverseUnit(t,r){return V0(this,t,r)}traverseIntoUnit(t,r){return H0(this.traverseUnit(t,r))}},dn=class extends Rn{traverseUnit(t){return V0(this,t,void 0)}traverseIntoUnit(t){return H0(this.traverseUnit(t))}},Ba=class extends Rn{*traverseAlg(t,r){if(r.depth===0){yield*t.units();return}let n=[],o=null,l=r?.collapseMoves??!0;function i(s,g){var m;let c=w0(m=Ba,yl,$c).call(m,s,g,r);if(c===0)return!1;let u=new B(s.quantum,c);return n.push(u),o=u,!0}function a(s){l&&o?.is(B)&&s.is(B)&&o.quantum.isIdentical(s.quantum)?(n.pop(),i(o,s.amount)||(o=n.slice(-1)[0])):s.is(B)?i(s,0):(n.push(s),o=s)}let f={depth:r.depth?r.depth-1:null};for(let s of t.units())for(let g of this.traverseUnit(s,f))a(g);for(let s of n)yield s}*traverseGrouping(t,r){if(r.depth===0){yield t;return}let n={depth:r.depth?r.depth-1:null};yield new ut(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 Ge(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 Te(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}},La=Ba;yl=new WeakSet,$c=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},ne(La,yl);Y0=new La,Z0=Y0.traverseAlg.bind(Y0)});function X0(e){if(!e)return[];if(ht(e,z))return e.units();if(typeof e=="string")return ua(e).units();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw"Invalid unit"}function ir(e){return ht(e,z)?e:new z(e)}function em(e,t){return e.is(Ye)||t.is(Ye)?"":e.is(Ft)&&!t.is(Ye)?\`
|
|
8
|
+
\`:" "}var lt,Cr,z,Kt=b(()=>{Wt();pa();Dt();ga();Ra();po();Qt();Lo();ca();Cr=class extends Me{constructor(t){super();ne(this,lt,void 0);q(this,lt,Array.from(X0(t)));for(let r of d(this,lt))if(!q0(r))throw new Error("An alg can only contain units.")}isIdentical(t){let r=t;if(!t.is(Cr))return!1;let n=Array.from(d(this,lt)),o=Array.from(d(r,lt));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 Cr(G0(Array.from(d(this,lt)).map(t=>t.invert())))}*experimentalExpand(t=V.Forwards,r){r??(r=1/0);for(let n of ia(d(this,lt),t))yield*n.experimentalExpand(t,r)}expand(t){return new Cr(this.experimentalExpand(V.Forwards,t?.depth??1/0))}*experimentalLeafMoves(){for(let t of this.experimentalExpand())t.is(B)&&(yield t)}concat(t){return new Cr(Array.from(d(this,lt)).concat(Array.from(X0(t))))}experimentalIsEmpty(){for(let t of d(this,lt))return!1;return!0}static fromString(t){return ua(t)}*units(){for(let t of d(this,lt))yield t}experimentalNumUnits(){return Array.from(d(this,lt)).length}get type(){return Dl("deprecated: type"),"sequence"}toString(){let t="",r=null;for(let n of d(this,lt))r&&(t+=em(r,n)),t+=n.toString(),r=n;return t}simplify(t){return new Cr(Z0(this,t??{}))}},z=Cr;lt=new WeakMap});var tm,J0=b(()=>{Kt();Al();co();mo();Qt();Bo();tm={Sune:new z([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 z([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 z([new Ge(new z([new B("R",1),new B("U",1),new B("R",-2)]),new z([new Te(new z([new B("R",1)]),new z([new B("U",1)]))]))]),Niklas:new z([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 z([new B("x",-1),new Ge(new z([new Te(new z([new B("R",1)]),new z([new B("U",-1)]))]),new z([new B("D",1)])),new Ge(new z([new Te(new z([new B("R",1)]),new z([new B("U",1)]))]),new z([new B("D",1)])),new B("x",1)]),FURURFCompact:new z([new Te(new z([new B("F",1)]),new z([new Ge(new z([new B("U",1)]),new z([new B("R",1)]))]))]),APermCompact:new z([new Te(new z([new B("R",2)]),new z([new Ge(new z([new B("F",2)]),new z([new B("R",-1),new B("B",-1),new B("R",1)]))]))]),FURURFMoves:new z([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 z([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 z([new Te(new z([new B("F",1)]),new z([new ut(new z([new Ge(new z([new B("R",1)]),new z([new B("U",1)]))]),3)]))]),TriplePause:new z([new Ze,new Ze,new Ze])}});var OF,$0=b(()=>{Qt();OF={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 e2=b(()=>{});var t2=b(()=>{Kt()});var Re=b(()=>{Kt();sa();Ra();J0();$0();Al();Qt();e2();t2();pa();Dt()});function Ro(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Do(l.numOrientations,a))n[o]=i;else if(Do(l.numOrientations,i))n[o]=a;else{let f=new Array(l.numPieces);if(l.numOrientations===1){for(let s=0;s<l.numPieces;s++)f[s]=i.permutation[a.permutation[s]];n[o]={permutation:f,orientation:i.orientation}}else{let s=new Array(l.numPieces);for(let g=0;g<l.numPieces;g++)s[g]=(i.orientation[a.permutation[g]]+a.orientation[g])%l.numOrientations,f[g]=i.permutation[a.permutation[g]];n[o]={permutation:f,orientation:s}}}}return n}function da(e,t,r){let n={};for(let o in e.orbits){let l=e.orbits[o],i=t[o],a=r[o];if(Do(l.numOrientations,a))n[o]=i;else{let f=new Array(l.numPieces);if(l.numOrientations===1){for(let s=0;s<l.numPieces;s++)f[s]=i.pieces[a.permutation[s]];n[o]={pieces:f,orientation:i.orientation}}else{let s=new Array(l.numPieces);for(let g=0;g<l.numPieces;g++)s[g]=(i.orientation[a.permutation[g]]+a.orientation[g])%l.numOrientations,f[g]=i.pieces[a.permutation[g]];n[o]={pieces:f,orientation:s}}}}return n}var Ul=b(()=>{Fo()});function rm(e){let t=n2.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 r2&&(Object.freeze(r),Object.freeze(n),Object.freeze(o)),n2.set(e,o),o}function o2(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=rm(n.numPieces);return r2&&Object.freeze(t),t}function l2(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(n)return sr(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 sr(e,l,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var r2,n2,Da=b(()=>{Fo();r2=!1,n2=new Map});var pe,bl=b(()=>{Ul();ho();pe=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}static fromTransformation(t){let r=da(t.kpuzzle.definition,t.kpuzzle.definition.startStateData,t.transformationData);return new pe(t.kpuzzle,r)}apply(t){return this.applyTransformation(this.kpuzzle.toTransformation(t))}applyTransformation(t){if(t.isIdentityTransformation())return new pe(this.kpuzzle,this.stateData);let r=da(this.kpuzzle.definition,this.stateData,t.transformationData);return new pe(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 At(this.kpuzzle,t)}}});var Pr,fr,At,ho=b(()=>{Fo();Ul();Da();bl();fr=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;ne(this,Pr,void 0)}invert(){return new fr(this.kpuzzle,Fa(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return d(this,Pr)??q(this,Pr,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new fr(t,o2(t.definition));return q(r,Pr,!0),r}isIdentical(t){return i2(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,Pr)?new fr(this.kpuzzle,t.transformationData):d(t,Pr)?new fr(this.kpuzzle,this.transformationData):new fr(this.kpuzzle,Ro(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 pe.fromTransformation(this)}repetitionOrder(){return a2(this.kpuzzle.definition,this)}selfMultiply(t){return new fr(this.kpuzzle,sr(this.kpuzzle,this.transformationData,t))}},At=fr;Pr=new WeakMap});function Do(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 i2(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 Fa(e,t){let r={};for(let n in e.definition.orbits){let o=e.definition.orbits[n],l=t[n];if(Do(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 f=0;f<o.numPieces;f++){let s=l.permutation[f];i[s]=f,a[s]=(o.numOrientations-l.orientation[f]+o.numOrientations)%o.numOrientations}r[n]={permutation:i,orientation:a}}}return r}function sr(e,t,r){if(r===1)return t;if(r<0)return sr(e,Fa(e,t),-r);if(r===0){let{transformationData:l}=e.identityTransformation();return l}let n=t;r!==2&&(n=sr(e,t,Math.floor(r/2)));let o=Ro(e.definition,n,n);return r%2==0?o:Ro(e.definition,t,o)}function ha(e,t){return t?ha(t,e%t):e}function a2(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 f=a,s=0,g=0;for(;i[f]=!0,s=s+l.orientation[f],g=g+1,f=l.permutation[f],f!==a;);s!==0&&(g=g*o.numOrientations/ha(o.numOrientations,s)),r=r*g/ha(r,g)}}return r}var s2,f2,u2,Fo=b(()=>{Re();Ul();ho();s2=class extends Rn{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 At(r,sr(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()}},f2=new s2,u2=f2.traverseAlg.bind(f2)});var Dn,wl,Oe,Aa=b(()=>{Re();Fo();Da();bl();ho();Oe=class{constructor(t,r){this.definition=t;ne(this,Dn,new Map);ne(this,wl,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return At.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new B(t));let r=t.toString(),n=d(this,Dn).get(r);if(n)return new At(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,Dn).set(r,l),new At(this,l)}let o=l2(this,t);return d(this,Dn).set(r,o),new At(this,o)}algToTransformation(t){return typeof t=="string"&&(t=new z(t)),u2(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(z)?this.algToTransformation(t):t?.is?.(B)?this.moveToTransformation(t):t}startState(){return new pe(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return d(this,wl)??q(this,wl,(()=>{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.")}};Dn=new WeakMap,wl=new WeakMap});var de,g2=b(()=>{de={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]}}}};de.moves.Uw=de.moves.u;de.moves.Lw=de.moves.l;de.moves.Fw=de.moves.f;de.moves.Rw=de.moves.r;de.moves.Bw=de.moves.b;de.moves.Dw=de.moves.d;de.moves.Rv=de.moves.x;de.moves.Uv=de.moves.y;de.moves.Fv=de.moves.z;de.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]}};de.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]}};de.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]}}});var ya,Je=b(()=>{Aa();bl();ho();g2();Aa();ya=new Oe(de)});var c2=b(()=>{Je()});function mm(e){switch(e){case w.Regular:return om;case w.Dim:return um;case w.Ignored:return lm;case w.OrientationStickers:return im;case w.Invisible:return am;case w.IgnoreNonPrimary:return sm;case w.PermuteNonPrimary:return fm;case w.Ignoriented:return gm;case w.OrientationWithoutPermutation:return cm}}var w,Fn,zt,We,hn,xl,Mr,om,lm,im,am,sm,fm,um,gm,cm,Ao,yo,Uo=b(()=>{(function(s){s.Regular="Regular",s.Dim="Dim",s.Ignored="Ignored",s.OrientationStickers="OrientationStickers",s.Invisible="Invisible",s.Ignoriented="Ignoriented",s.IgnoreNonPrimary="IgnoreNonPrimary",s.PermuteNonPrimary="PermuteNonPrimary",s.OrientationWithoutPermutation="OrientationWithoutPermutation"})(w||(w={}));Fn=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))}},zt="regular",We="ignored",hn="oriented",xl="invisible",Mr="dim",om={facelets:[zt,zt,zt,zt,zt]},lm={facelets:[We,We,We,We,We]},im={facelets:[hn,hn,hn,hn,hn]},am={facelets:[xl,xl,xl,xl]},sm={facelets:[zt,We,We,We,We]},fm={facelets:[Mr,zt,zt,zt,zt]},um={facelets:[Mr,Mr,Mr,Mr,Mr]},gm={facelets:[Mr,We,We,We,We]},cm={facelets:[hn,We,We,We,We]};Ao=class extends Fn{constructor(t){super(t,w.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(mm(i))}return t}},yo=class{constructor(t){this.kpuzzle=t}and(t){let r=new Fn(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 Fn(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 Fn(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 Fn(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))}}});function pm(e){(async()=>{m2=e;let t=Array.from(document.body.querySelectorAll("twisty-player"));console.log(\`Setting the custom stickering for \${t.length} players!\`);let r=[];for(let n of t)r.push((async()=>{let o=await n.experimentalModel.stickering.get();n.experimentalStickering=o==="experimental-global-custom-1"?"experimental-global-custom-2":"experimental-global-custom-1"})());await Promise.all(r),console.log("Success!")})()}function p2(e,t){m2(e,t)}var m2,L2=b(()=>{Uo();m2=()=>{};globalThis.location&&new URL(location.href).searchParams.get("global-custom-stickerer")==="true"&&(window.setGlobalCustomStickerer=pm,window.PieceStickering=w,console.log("Global custom stickerer enabled! (using: global-custom-stickerer=true)"),console.log("Look here for inspiration:","https://github.com/cubing/cubing.js/blob/81b5cab3e27d8defb39dd1e0a10bc9e8ba894d26/src/cubing/puzzles/stickerings/cube-stickerings.ts#L67"))});async function _t(e,t){let r=await e.kpuzzle(),n=new Ao(r),o=new yo(r),l=()=>o.move("U"),i=()=>o.or(o.moves(["U","D"])),a=()=>o.not(i()),f=()=>o.or(o.moves(["L","R"])),s=()=>o.not(f()),g=()=>o.or(o.moves(["F","B"])),c=()=>o.not(g()),u=()=>o.not(l()),m=()=>o.and([l(),s(),c()]),p=()=>o.and([o.and(o.moves(["F","R"])),o.not(i())]),L=()=>o.and(o.moves(["D","R","F"])),R=()=>o.or([L(),p()]),D=()=>o.or([o.and([s(),a()]),o.and([s(),c()]),o.and([a(),c()])]),A=()=>o.or([o.and([s(),i(),g()]),o.and([a(),f(),g()]),o.and([c(),i(),f()])]),y=()=>o.not(o.or([D(),A()])),k=()=>o.or([s(),o.and([l(),A()])]);function E(){n.set(u(),w.Dim)}function Q(){n.set(l(),w.PermuteNonPrimary),n.set(m(),w.Dim)}function $(){n.set(l(),w.IgnoreNonPrimary),n.set(m(),w.Regular)}function G(){n.set(l(),w.Ignoriented),n.set(m(),w.Dim)}switch(t){case"full":break;case"PLL":E(),Q();break;case"CLS":E(),n.set(o.and(o.moves(["D","R","F"])),w.Regular),n.set(l(),w.Ignoriented),n.set(o.and([l(),s(),c()]),w.Dim),n.set(o.and([l(),y()]),w.IgnoreNonPrimary);break;case"OLL":E(),$();break;case"COLL":E(),Q(),n.set(o.and([l(),y()]),w.Regular);break;case"OCLL":E(),G(),n.set(o.and([l(),y()]),w.IgnoreNonPrimary);break;case"CLL":E(),n.set(o.not(o.and([y(),l()])),w.Dim);break;case"ELL":E(),n.set(l(),w.Dim),n.set(o.and([l(),A()]),w.Regular);break;case"ELS":E(),$(),n.set(o.and([l(),y()]),w.Ignored),n.set(p(),w.Regular),n.set(L(),w.Ignored);break;case"LL":E();break;case"F2L":n.set(l(),w.Ignored);break;case"ZBLL":E(),n.set(l(),w.PermuteNonPrimary),n.set(m(),w.Dim),n.set(o.and([l(),y()]),w.Regular);break;case"ZBLS":E(),n.set(R(),w.Regular),$(),n.set(o.and([l(),y()]),w.Ignored);break;case"WVLS":case"VLS":E(),n.set(R(),w.Regular),$();break;case"LS":E(),n.set(R(),w.Regular),n.set(l(),w.Ignored),n.set(m(),w.Dim);break;case"EO":n.set(y(),w.Ignored),n.set(A(),w.OrientationWithoutPermutation);break;case"EOline":n.set(y(),w.Ignored),n.set(A(),w.OrientationWithoutPermutation),n.set(o.and(o.moves(["D","M"])),w.Regular);break;case"EOcross":n.set(A(),w.OrientationWithoutPermutation),n.set(o.move("D"),w.Regular),n.set(y(),w.Ignored);break;case"CMLL":n.set(u(),w.Dim),n.set(k(),w.Ignored),n.set(o.and([l(),y()]),w.Regular);break;case"L6E":n.set(o.not(k()),w.Dim);break;case"L6EO":n.set(o.not(k()),w.Dim),n.set(k(),w.OrientationWithoutPermutation),n.set(o.and([D(),i()]),w.OrientationStickers);break;case"Daisy":n.set(o.all(),w.Ignored),n.set(D(),w.Dim),n.set(o.and([o.move("D"),D()]),w.Regular),n.set(o.and([o.move("U"),A()]),w.IgnoreNonPrimary);break;case"Cross":n.set(o.all(),w.Ignored),n.set(D(),w.Dim),n.set(o.and([o.move("D"),D()]),w.Regular),n.set(o.and([o.move("D"),A()]),w.Regular);break;case"2x2x2":n.set(o.or(o.moves(["U","F","R"])),w.Ignored),n.set(o.and([o.or(o.moves(["U","F","R"])),D()]),w.Dim);break;case"2x2x3":n.set(o.all(),w.Dim),n.set(o.or(o.moves(["U","F","R"])),w.Ignored),n.set(o.and([o.or(o.moves(["U","F","R"])),D()]),w.Dim),n.set(o.and([o.move("F"),o.not(o.or(o.moves(["U","R"])))]),w.Regular);break;case"Void Cube":n.set(D(),w.Invisible);break;case"picture":case"invisible":n.set(o.all(),w.Invisible);break;case"centers-only":n.set(o.not(D()),w.Ignored);break;case"experimental-global-custom-1":case"experimental-global-custom-2":p2(n,o);break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),w.Dim)}return n.toAppearance()}async function An(){return["full","PLL","CLS","OLL","COLL","OCLL","ELL","ELS","LL","F2L","ZBLL","ZBLS","WVLS","VLS","LS","EO","EOline","EOcross","CMLL","L6E","L6EO","Daisy","Cross","2x2x2","2x2x3","Void Cube","picture","invisible","centers-only"]}var yn=b(()=>{Uo();L2()});function Ke(e){let t=null;return()=>t??(t=e())}var Gr=b(()=>{});var bo,B2=b(()=>{bo=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(n){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 Un,R2=b(()=>{Un=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var Sl,d2=b(()=>{Re();Sl=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 P("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 P("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var wo,D2=b(()=>{Re();wo=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 P(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 vl,F2=b(()=>{Re();vl=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 P("L",3,2),-2*t.amount);if(t.family==="R--")return new B(new P("L",3,2),2*t.amount);if(t.family==="D++")return new B(new P("U",3,2),-2*t.amount);if(t.family==="D--")return new B(new P("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new B(new P("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new B(new P("U",3,2),-2*t.amount)}if(t.family==="y")return new B("Uv",t.amount)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="Uv"?new B(new P("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new B("y",-t.amount):this.child.notationToExternal(t)}}});var El,h2=b(()=>{Re();El=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 P("D",(this.slices+1)/2),t.amount):r==="M"?t=new B(new P("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new B(new P("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new B(new P("D",this.slices-1,2),t.amount):r==="m"?t=new B(new P("L",this.slices-1,2),t.amount):r==="s"&&(t=new B(new P("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 Lm,Bm,A2,y2,U2,xo,kl,b2=b(()=>{Re();Lm={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"},Bm={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"},A2={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},y2=new P("y"),U2=new P("Dv"),xo=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=Lm}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=A2[t.family];if(n)return new B(new P(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new B(new P(r,t.innerLayer,t.outerLayer),t.amount):y2.isIdentical(t.quantum)?new B(U2,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(A2))if(this.child.spinmatch(t.family,n))return new B(new P(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 P(r,t.innerLayer,t.outerLayer),t.amount);return U2.isIdentical(t.quantum)?new B(y2,-t.amount):null}},kl=class extends xo{constructor(t){super(t);this.map=Bm}}});var w2,Ua,x2,Rm,ba,S2,dm,wa,v2,Dm,zl,E2=b(()=>{Re();w2={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"},Ua=new P("x"),x2=new P("Rv"),Rm=new P("Lv"),ba=new P("y"),S2=new P("Uv"),dm=new P("Dv"),wa=new P("z"),v2=new P("Fv"),Dm=new P("Bv"),zl=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=w2[t.family];return r?new B(new P(r,t.outerLayer,t.innerLayer),t.amount):Ua.isIdentical(t.quantum)?new B(x2,t.amount):ba.isIdentical(t.quantum)?new B(S2,t.amount):wa.isIdentical(t.quantum)?new B(v2,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(w2))if(this.child.spinmatchv(t.family,n))return new B(new P(r,t.innerLayer,t.outerLayer),t.amount);return x2.isIdentical(t.quantum)?new B(Ua,t.amount):Rm.isIdentical(t.quantum)?new B(Ua,-t.amount):S2.isIdentical(t.quantum)?new B(ba,t.amount):dm.isIdentical(t.quantum)?new B(ba,-t.amount):v2.isIdentical(t.quantum)?new B(wa,t.amount):Dm.isIdentical(t.quantum)?new B(wa,-t.amount):null}}});var xa=b(()=>{R2();d2();D2();F2();h2();b2();E2()});function k2(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:So(e.slice(t).join(" ")),options:r}}var Sa,va=b(()=>{_l();Sa=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 ur(e){if(!Ea[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;Ea[e]=t}return Ea[e]}function Ct(e){if(!ka[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;ka[e]=t}return ka[e]}function z2(e){return new pt(Ct(e))}function _2(e){let t=1;for(;e>1;)t*=e,e--;return t}function Fm(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 za(e,t){return e/Fm(e,t)*t}var Ea,ka,pt,Cl=b(()=>{Ea=[],ka=[];pt=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 pt(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 pt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new pt(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=za(t,o)}return t}}});function _a(e,t){let r=B.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function C2(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 f=0;for(let s=0;s<r;s++){if(s===i)continue;let g=e.moveops[s];a.mul(g).equal(g.mul(a))&&(f|=1<<s)}o.push(f)}let l={};l[0]=1;for(let i=0;i<100;i++){let a=0,f={},s=0;for(let g in l){let c=+g,u=l[c];a+=u,s++;for(let m=0;m<n.length;m++)if((c>>m&1)==0&&(c&o[m]&(1<<m)-1)==0){let p=c&o[m]|1<<m;f[p]===void 0&&(f[p]=0),f[p]+=(n[m]-1)*u}}t(\`\${i}: canonseq \${a} states \${s}\`),l=f}}var vo,hm,bn,yt,qt,Ca,gr,wn,Pa,P2=b(()=>{Re();xa();Cl();vo=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return _2(this.size)*Math.pow(this.mod,this.size)}},hm=0;bn=class{constructor(t,r,n,o,l){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=o;this.moveops=l}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}toKsolve(t,r=new Un){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}\`);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=_a(r,this.movenames[o]),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 #\${++hm}\`,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,f=new Pa(a),s=new Array(this.orbitdefs[l].size);for(let m=0;m<a;m++)s[m]=!1;for(let m=0;m<this.moveops.length;m++)for(let p=0;p<a;p++)(this.moveops[m].orbits[l].perm[p]!==p||this.moveops[m].orbits[l].ori[p]!==0)&&(s[p]=!0,f.union(p,this.moveops[m].orbits[l].perm[p]));let g=!0;if(i>1){g=!1;let m=new Pa(this.orbitdefs[l].size*i);for(let p=0;p<this.moveops.length;p++)for(let L=0;L<a;L++)if(this.moveops[p].orbits[l].perm[L]!==L||this.moveops[p].orbits[l].ori[L]!==0)for(let R=0;R<i;R++)m.union(L*i+R,this.moveops[p].orbits[l].perm[L]*i+(R+this.moveops[p].orbits[l].ori[L])%i);for(let p=0;!g&&p<a;p++)for(let L=1;L<i;L++)m.find(p*i)===m.find(p*i+L)&&(g=!0);for(let p=0;!g&&p<a;p++)for(let L=0;L<p;L++)this.solved.orbits[l].perm[p]===this.solved.orbits[l].perm[L]&&(g=!0)}let c=-1,u=!1;for(let m=0;m<this.orbitdefs[l].size;m++)if(s[m]){let p=f.find(m);c<0?c=p:c!==p&&(u=!0)}for(let m=0;m<this.orbitdefs[l].size;m++){if(!s[m]||f.find(m)!==m)continue;let L=[],R=[],D=0;for(let A=0;A<this.orbitdefs[l].size;A++)f.find(A)===m&&(L[D]=A,R[A]=D,D++);if(u?t.push(\`\${this.orbitnames[l]}_p\${m}\`):t.push(this.orbitnames[l]),g){r.push(new vo(D,this.orbitdefs[l].mod)),n.push(this.solved.orbits[l].remapVS(L,D));for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(L,R,D))}else{r.push(new vo(D,1)),n.push(this.solved.orbits[l].remapVS(L,D).killOri());for(let A=0;A<this.moveops.length;A++)o[A].push(this.moveops[A].orbits[l].remap(L,R,D).killOri())}}}return new bn(t,r,new wn(n),this.movenames,o.map(l=>new gr(l)))}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=1;for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},yt=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new yt(Ct(t),ur(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 yt(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 yt(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 yt(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 pt(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 pt(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===Ct(t)&&this.ori===ur(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===ur(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 yt(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 f=this.perm[t[a]];i[f]===void 0&&(i[f]=l++),n[a]=i[f],o[a]=this.ori[t[a]]}return new yt(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()?(yt.kcache[t]||(yt.kcache[t]={permutation:Ct(t),orientation:ur(t)}),yt.kcache[t]):{permutation:this.perm,orientation:this.ori}}},qt=yt;qt.kcache=[];Ca=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 pt(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=za(t,r.order());return t}},gr=class extends Ca{constructor(t){super(t)}mul(t){return new gr(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 gr(this.internalInv())}e(){return new gr(this.orbits.map(t=>qt.e(t.perm.length,t.orimod)))}},wn=class extends Ca{constructor(t){super(t)}mul(t){return new wn(this.internalMul(t))}},Pa=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 Pl,M2=b(()=>{Pl={"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 Ml(e){let t=new O(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function G2(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 Tr,O,Gl=b(()=>{Tr=1e-9;O=class{constructor(t,r,n,o){this.a=t;this.b=r;this.c=n;this.d=o}mul(t){return new O(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 O(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 O(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new O(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new O(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new O(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new O(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new O(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 O(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,o,l,i,a,f,s){return t*(l*s-i*f)+r*(i*a-o*s)+n*(o*f-l*a)}rotateplane(t){let r=t.mul(new O(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 O(0,1,0,0)).normalize():r<t&&r<n?this.cross(new O(0,0,1,0)).normalize():this.cross(new O(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<Tr)return new O(1,0,0,0);let n=r.sum(t);n.len()<Tr?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)<Tr?!1:new O(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>Tr?1:t<-Tr?-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 f=0;f<t.length;f++){(l[f]===i||l[f]===0)&&a.push(t[f]);let s=(f+1)%t.length;if(l[f]+l[s]===0&&l[f]!==0){let g=t[f].dot(this)-r,c=t[s].dot(this)-r,u=g/(g-c),m=t[f].smul(1-u).sum(t[s].smul(u));a.push(m)}}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)<Tr||r.dist(n.smul(-1))<Tr}makecut(t){return new O(t,this.b,this.c,this.d)}}});function T2(){let e=Math.sqrt(.5);return[new O(e,e,0,0),new O(e,0,e,0)]}function I2(){return[new O(.5,.5,.5,.5),new O(.5,.5,.5,-.5)]}function N2(){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 O(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new O(.5,.5,.5,.5)]}function O2(){let e=1/6+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 O(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new O(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function W2(){let e=Math.sqrt(.5);return[new O(.5,.5,.5,.5),new O(e,0,0,e)]}function K2(e){let t=[new O(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])<Tl||l.dist(t[a])<Tl){i=!0;break}i||t.push(o)}return t}function Ma(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])<Tl){i=!0;break}i||(r.push(l),n.push(t[o]))}return n}function Ga(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let o=G2(0,r,n,e);if(o){let l=!1;for(let i=0;i<t.length;i++)if(o.dist(t[i])<Tl){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 Tl,Q2=b(()=>{Gl();Tl=1e-9});function Il(e,t){let r=e[0].p.length,n=z2(r),o=[],l=[],i=[],a=[],f=[];function s(m){for(let p=m.p.length-1;p>=0;p--){let L=m.p[p];if(L!==p){if(!o[p][L])return!1;m=m.mul(l[p][L])}}return!0}function g(m,p,L){a[m].push(p),f[m].push(L);for(let R=0;R<o[m].length;R++)o[m][R]&&c(m,o[m][R].mul(p),L+i[m][R])}function c(m,p,L){let R=p.p[m];if(!o[m][R]){o[m][R]=p,l[m][R]=p.inv(),i[m][R]=L;for(let A=0;A<a[m].length;A++)c(m,p.mul(a[m][A]),L+f[m][A]);return}let D=p.mul(l[m][R]);s(D)||g(m-1,D,L+i[m][R])}function u(){o=[],l=[],a=[],i=[],f=[];for(let L=0;L<r;L++)o.push([]),l.push([]),i.push([]),a.push([]),f.push([]),o[L][L]=n,l[L][L]=n,i[L][L]=0;let m=0,p=1;for(let L=0;L<e.length;L++){g(r-1,e[L],1),p=1;let R=0,D=0,A=[],y=new j2;for(let k=0;k<r;k++){let E=0,Q=0;for(let G=0;G<r;G++)o[k][G]&&(E++,Q+=i[k][G],k!==G&&m++);R+=a[k].length,p*=E,E>1&&y.multiply(E);let $=Q/E;A.push($),D+=$}t(\`\${L}: sz \${p} T \${R} sol \${D} none \${m} mults \${y.toString()}\`)}return p}return u()}var j2,Ta=b(()=>{Cl();j2=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 Ia(e){return e}function Na(e){}function Am(e,t){let r=[];for(let n of e)for(let o of t)r.push(o.rotate(n));return r}function bm(){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 wm(){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 xm(){return{4:["F","D","L","R"],6:["U","D","F","B","L","R"],8:["F","BB","D","U","BR","L","R","BL"],12:["L","E","F","BF","R","I","U","D","BR","A","BL","C"],20:["L","S","E","O","F","B","I","P","R","K","U","D","J","A","Q","H","G","N","M","C"]}}function Sm(){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 Nl(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<we)return r;throw new Error("Element not found")}function q2(){return Pl}function V2(e){return Pl[e]}function So(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 Oa(e,t={}){let r=So(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new Wl(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function Sn(e,t){return Oa(Pl[e],t)}function vm(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\`We only support slice and outer block moves right now. \${t}\`;return[l+o,n]}function Em(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 Ol(e,t){return[e.b/t,-e.c/t,e.d/t]}function Wa(e,t){let r=[],n=e.length;for(let o=0;o<n;o++){let l=Ol(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 xn,Eo,we,ym,Um,Wl,Ir,_l=b(()=>{Re();B2();xa();va();Cl();P2();M2();Q2();Gl();Ta();xn=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 O(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 O(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 xn(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new xn(t)}},Eo=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 Eo(r[0]),this.right=new Eo(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 xn(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};we=1e-9,ym="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",Um=!1;Wl=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.faceorder=[];this.faceprecedence=[];this.notationMapper=new Un;this.addNotationMapper="";this.setReidOrder=!1;let n=Ia("genperms");this.options=new Sa(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t),Na(n)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let o=null;switch(r){case"c":o=T2();break;case"o":o=W2();break;case"i":o=O2();break;case"t":o=I2();break;case"d":o=N2();break;default:throw new Error("Bad shape argument: "+r)}this.rotations=K2(o),this.options.verbosity&&console.log("# Rotations: "+this.rotations.length);let l=o[0];this.baseplanerot=Ma(l,this.rotations);let i=this.baseplanerot.map(h=>l.rotateplane(h));this.baseplanes=i,this.baseFaceCount=i.length;let a=bm()[i.length];this.net=a,this.colors=wm()[i.length],this.faceorder=xm()[i.length],this.options.verbosity>0&&console.log("# Base planes: "+i.length);let f=Ga(i),s=new O(0,0,0,0);this.options.verbosity>0&&console.log("# Face vertices: "+f.length);let g=i[0].makenormal(),c=f[0].sum(f[1]).makenormal(),u=f[0].makenormal(),m=new O(1,g.b,g.c,g.d);this.options.verbosity>0&&console.log("# Boundary is "+m);let L=Ma(m,this.rotations).map(h=>m.rotateplane(h)),R=Ga(L);this.edgedistance=R[0].sum(R[1]).smul(.5).dist(s),this.vertexdistance=R[0].dist(s);let D=[],A=[],y=!1,k=!1,E=!1;for(let h of n){let v=null,I=0;switch(h.cutType){case"f":v=g,I=1,y=!0;break;case"v":v=u,I=this.vertexdistance,E=!0;break;case"e":v=c,I=this.edgedistance,k=!0;break;default:throw new Error("Bad cut argument: "+h.cutType)}D.push(v.makecut(h.distance)),A.push(h.distance<I)}this.options.addRotations&&(y||D.push(g.makecut(10)),E||D.push(u.makecut(10)),k||D.push(c.makecut(10))),this.basefaces=[];for(let h of this.baseplanerot){let v=h.rotateface(R);this.basefaces.push(new xn(v))}let Q=[],$=[],G=[],oe=[],U=R.length;function _(h,v,I){for(let K of h)if(K[0].dist(v)<we){K.push(I);return}h.push([v,I])}for(let h=0;h<this.baseplanerot.length;h++){let v=this.baseplanerot[h].rotateface(R);for(let I=0;I<v.length;I++){let K=(I+1)%v.length,le=v[I].sum(v[K]).smul(.5);_(oe,le,h)}}let M=[];for(let h=0;h<this.baseplanerot.length;h++){let v=this.baseplanerot[h].rotateface(R),I=[];for(let K=0;K<v.length;K++){let le=(K+1)%v.length,qe=v[K].sum(v[le]).smul(.5),ft=oe[Nl(oe,qe)];if(h===ft[1])I.push(ft[2]);else if(h===ft[2])I.push(ft[1]);else throw new Error("Could not find edge")}M.push(I)}let x={},S=[];S.push(a[0][0]),x[a[0][0]]=0,S[M[0][0]]=a[0][1],x[a[0][1]]=M[0][0];for(let h of a){let v=h[0],I=x[v];if(I===void 0)throw new Error("Bad edge description; first edge not connected");let K=-1;for(let le=0;le<M[I].length;le++){let qe=S[M[I][le]];if(qe!==void 0&&qe===h[1]){K=le;break}}if(K<0)throw new Error("First element of a net not known");for(let le=2;le<h.length;le++){if(h[le]==="")continue;let qe=M[I][(le+K-1)%U],ft=S[qe];if(ft!==void 0&&ft!==h[le])throw new Error("Face mismatch in net");S[qe]=h[le],x[h[le]]=qe}}for(let h=0;h<S.length;h++){let v=!1;for(let I=0;I<this.faceorder.length;I++)if(S[h]===this.faceorder[I]){this.faceprecedence[h]=I,v=!0;break}if(!v)throw new Error("Could not find face "+S[h]+" in face order list "+this.faceorder)}for(let h=0;h<this.baseplanerot.length;h++){let v=this.baseplanerot[h].rotateface(R),I=m.rotateplane(this.baseplanerot[h]),K=S[h];Q.push([v,K]),$.push([I,K])}for(let h=0;h<this.baseplanerot.length;h++){let v=this.baseplanerot[h].rotateface(R),I=S[h];for(let K=0;K<v.length;K++){let le=(K+1)%v.length,qe=v[K].sum(v[le]).smul(.5),ft=(K+2)%v.length,xc=v[le].sum(v[ft]).smul(.5),Sc=Nl(oe,qe),vc=Nl(oe,xc);_(G,v[le],[I,vc,Sc])}}this.swizzler=new bo(Q.map(h=>h[1]));let C=this.swizzler.prefixFree?"":"_";for(let h=0;h<oe.length;h++){if(oe[h].length!==3)throw new Error("Bad length in edge names "+oe[h]);let v=S[oe[h][1]],I=S[oe[h][2]];this.faceprecedence[oe[h][1]]<this.faceprecedence[oe[h][2]]?v=v+C+I:v=I+C+v,oe[h]=[oe[h][0],v]}for(let h=0;h<G.length;h++){if(G[h].length<4)throw new Error("Bad length in vertex names");let v=1;for(let K=2;K<G[h].length;K++)this.faceprecedence[x[G[h][K][0]]]<this.faceprecedence[x[G[h][v][0]]]&&(v=K);let I="";for(let K=1;K<G[h].length;K++){K===1?I=G[h][v][0]:I=I+C+G[h][v][0];for(let le=1;le<G[h].length;le++)if(G[h][v][1]===G[h][le][2]){v=le;break}}G[h]=[G[h][0],I]}this.options.verbosity>1&&(console.log("# Face precedence list: "+this.faceorder.join(" ")),console.log("# Face names: "+Q.map(h=>h[1]).join(" ")),console.log("# Edge names: "+oe.map(h=>h[1]).join(" ")),console.log("# Vertex names: "+G.map(h=>h[1]).join(" ")));let j=[];for(let h of $)j.push([h[0].makenormal(),h[1],"f"]);for(let h of oe)j.push([h[0].makenormal(),h[1],"e"]);for(let h of G)j.push([h[0].makenormal(),h[1],"v"]);this.facenames=Q,this.faceplanes=$,this.edgenames=oe,this.vertexnames=G,this.geonormals=j;let Z=j.map(h=>h[1]);this.swizzler.setGripNames(Z),this.options.verbosity>0&&console.log("# Distances: face "+1+" edge "+this.edgedistance+" vertex "+this.vertexdistance);for(let h=0;h<D.length;h++)for(let v of this.rotations){let I=D[h].rotateplane(v),K=!1;for(let le of this.moveplanes)if(I.sameplane(le)){K=!0;break}K||(this.moveplanes.push(I),A[h]&&this.moveplanes2.push(I))}let ce=new Eo(R),Le=this.moveplanes2.slice(),Ae=31;for(let h=0;h<Le.length;h++){let v=h+Math.floor((Le.length-h)*(Ae/65536));ce=ce.split(Le[v]),Le[v]=Le[h],Ae=(Ae*1657+101)%65536}let be=ce.collect([],!0);this.faces=be,this.options.verbosity>0&&console.log("# Faces is now "+be.length),this.stickersperface=be.length;let kt=[],Pe=Ml(R);for(let h of this.rotations){let v=h.rotateface(R);Pe.dist(Ml(v))<we&&kt.push(h)}let rt=new Array(be.length),Se=[];for(let h=0;h<be.length;h++){let v=be[h].centermass();Se.push([Pe.dist(v),v,h])}Se.sort((h,v)=>h[0]-v[0]);for(let h=0;h<be.length;h++){let v=Se[h][2];if(!rt[v]){rt[v]=!0;for(let I of kt){let K=be[v].rotate(I),le=K.centermass();for(let qe=h+1;qe<be.length&&!(Se[qe][0]-Se[h][0]>we);qe++){let ft=Se[qe][2];if(!rt[ft]&&le.dist(Se[qe][1])<we){rt[ft]=!0,be[ft]=K;break}}}}}this.shortedge=1e99;for(let h of be)for(let v=0;v<h.length;v++){let I=(v+1)%h.length,K=h.get(v).dist(h.get(I));K<this.shortedge&&(this.shortedge=K)}this.options.verbosity>0&&console.log("# Short edge is "+this.shortedge),r==="c"&&y&&!k&&!E&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&E&&!y&&!k&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(E||y)&&!k&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&y&&(this.notationMapper=new wo(this.swizzler,new bo(["F","D","L","BL","R","U","BR","B"])),!k&&!E&&(this.addNotationMapper="FTOMapper")),r==="d"&&y&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new wo(this.swizzler,new bo(["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]))<we)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]),f=a.len();a=a.normalize();let s=a.cross(i).normalize(),g=n[1].sub(n[0]),c=g.len()/f;g=g.normalize();let u=g.b,m=g.c,p=a.smul(u).sub(s.smul(m)).smul(c),L=s.smul(u).sum(a.smul(m)).smul(c),R=new O(0,n[0].b-p.dot(o[r]),n[0].c-L.dot(o[r]),0);return[p,L,R]}allstickers(){let t=Ia("allstickers");this.faces=Am(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 U=0;U<this.faces.length;U++)this.facecentermass[U]=this.faces[U].centermass();let r=[],n=[];for(let U of this.moveplanes){let _=U.makenormal(),M=!1;for(let x of n)_.sameplane(x.makenormal())&&(M=!0);M||(n.push(_),r.push([]))}for(let U of this.moveplanes2){let _=U.makenormal();for(let M=0;M<n.length;M++)if(_.sameplane(n[M])){r[M].push(U);break}}for(let U=0;U<r.length;U++){let _=r[U].map(x=>x.normalizeplane()),M=n[U];for(let x=0;x<_.length;x++)_[x].makenormal().dist(M)>we&&(_[x]=_[x].smul(-1));_.sort((x,S)=>x.a-S.a),r[U]=_}this.moveplanesets=r,this.moveplanenormals=n;let o=r.map(U=>U.length);this.options.verbosity>0&&console.log("# Move plane sets: "+o);let l=[];for(let U=0;U<r.length;U++)l.push([]);for(let U of this.rotations){if(Math.abs(Math.abs(U.a)-1)<we)continue;let _=U.makenormal();for(let M=0;M<r.length;M++)if(_.sameplane(n[M])){l[M].push(U);break}}this.moverotations=l;for(let U=0;U<l.length;U++){let _=l[U],M=_[0].makenormal();for(let x=0;x<_.length;x++)M.dist(_[x].makenormal())>we&&(_[x]=_[x].smul(-1));_.sort((x,S)=>x.angle()-S.angle()),l[U][0].dot(n[U])<0&&_.reverse()}let i=l.map(U=>1+U.length);this.movesetorders=i;let a=[],f="?";for(let U=0;U<r.length;U++){let _=n[U],M=null,x=null;for(let S of this.geonormals){let C=_.dot(S[0]);Math.abs(C-1)<we?(x=[S[1],S[2]],f=S[2]):Math.abs(C+1)<we&&(M=[S[1],S[2]],f=S[2])}if(x===null||M===null)throw new Error("Saw positive or negative sides as null");a.push([x[0],x[1],M[0],M[1],1+r[U].length]),this.addNotationMapper==="NxNxNCubeMapper"&&f==="f"&&(this.notationMapper=new El(1+r[U].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new zl(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 xo(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new kl(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&f==="f"&&(1+r[U].length===3&&(this.notationMapper=new vl(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&f==="f"&&(1+r[U].length===3&&(this.notationMapper=new Sl(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=a;let s=new Map,g=this.faces;for(let U=0;U<g.length;U++){let _=g[U],M=this.keyface(_);if(!s.get(M))s.set(M,[U]);else{let x=s.get(M);if(x.push(U),x.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let S=0;S<x.length;S++){let C=M+" "+S;s.set(C,[x[S]])}}}}this.facelisthash=s,this.options.verbosity>0&&console.log("# Cubies: "+s.size);let c=[],u=[],m=[];for(let U of s.values())if(U.length!==this.baseFaceCount){if(U.length>1){let _=U.map(C=>g[C].centermass()),M=Ml(_);for(let C=0;U.length>2;C++){let j=!1;for(let Z=0;Z<U.length;Z++){let ce=(Z+1)%U.length;if(M.dot(_[Z].cross(_[ce]))<0){let Le=_[Z];_[Z]=_[ce],_[ce]=Le;let Ae=U[Z];U[Z]=U[ce],U[ce]=Ae,j=!0}}if(!j)break;if(C>1e3)throw new Error("Bad epsilon math; too close to border")}let x=0,S=U[x];for(let C=1;C<U.length;C++){let j=U[C];this.faceprecedence[this.getfaceindex(j)]<this.faceprecedence[this.getfaceindex(S)]&&(x=C,S=j)}if(x!==0){let C=U.slice();for(let j=0;j<U.length;j++)U[j]=C[(x+j)%U.length]}}for(let _=0;_<U.length;_++){let M=U[_];u[M]=c.length,m[M]=_}c.push(U)}this.cubies=c,this.facetocubie=u,this.facetoord=m;let p=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],L=[],R=[0,0,0,0,0,0],D=[],A=[],y=0,k=[],E=[],Q=[],$=[],G=U=>c[U].map(_=>this.getfaceindex(_)).join(" "),oe=[];for(let U=0;U<c.length;U++){if(A[U])continue;let _=c[U];if(_.length===0)continue;let M={},x=0;Q.push(0),oe.push([]);let S=_.length,C=R[S]++,j=p[S];(j===void 0||S===this.baseFaceCount)&&(j="CORE"),j=j+(C===0?"":C+1),L[y]=j,D[y]=S;let Z=[U],ce=0;for(A[U]=!0;ce<Z.length;){let Le=Z[ce++],Ae=G(Le);if((_.length>1||M[Ae]===void 0)&&(M[Ae]=x++),$[Le]=M[Ae],k[Le]=y,oe[y].push(Le),E[Le]=Q[y]++,Z.length<this.rotations.length){let be=this.facecentermass[c[Le][0]];for(let kt of l){let Pe=this.facetocubie[this.findface(be.rotatepoint(kt[0]))];A[Pe]||(Z.push(Pe),A[Pe]=!0)}}}y++}if(this.setReidOrder&&4<=this.stickersperface&&this.stickersperface<=9){let U=[["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"]],_={};for(let M of U)for(let x=0;x<M.length;x++){let S=0;for(let C=0;C<M[x].length;C++)S|=1<<M[x].charCodeAt(C)-65;_[S]=x}for(let M of oe)for(let x of M){let S=0;for(let C of c[x])S|=1<<this.facenames[this.getfaceindex(C)][1].charCodeAt(0)-65;E[x]=_[S]}}if(this.cubiesetnums=k,this.cubieordnums=E,this.cubiesetnames=L,this.cubieords=Q,this.orbitoris=D,this.cubievaluemap=$,this.cubiesetcubies=oe,this.options.fixedPieceType!==null){for(let U=0;U<c.length;U++)if(this.options.fixedPieceType==="v"&&c[U].length>2||this.options.fixedPieceType==="e"&&c[U].length===2||this.options.fixedPieceType==="f"&&c[U].length===1){this.fixedCubie=U;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 "+Q),Na(t)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?"":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",f=1;return n[5]!==void 0&&(a=n[5],a[0]==="'"&&(a="-"+a.substring(1)),f=parseInt(a,10)),new B(new P(o,i,l),f)}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),f=!1;for(let c=0;c<this.movesetgeos.length;c++){let u=this.movesetgeos[c];a===u[0]&&(f=!0,l=u,i=c),a===u[2]&&(f=!1,l=u,i=c)}let s=1,g=1;if(n.toUpperCase()!==n&&(g=2),l===void 0)throw new Error("Bad grip in move "+t.family);if(t.outerLayer!==void 0&&(s=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(g=t.innerLayer,n<="Z"?s=g:s=1):g=t.innerLayer),s--,g--,o&&(s=0,g=this.moveplanesets[i].length),s<0||s>this.moveplanesets[i].length||g<0||g>this.moveplanesets[i].length)throw new Error("Bad slice spec "+s+" "+g+" vs "+this.moveplanesets[i].length);if(!Um&&s===0&&g===this.moveplanesets[i].length&&!o)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,s,g,f,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t=Ia("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);if(this.basefaces[l].centermass().dist(this.facecentermass[o])<we){let i=this.basefaces[l].length;for(let a=1;a<i;a++)this.cubies[n].push(this.cubies[n][a-1]);this.duplicatedFaces[o]=i,this.duplicatedCubies[n]=i,this.orbitoris[this.cubiesetnums[n]]=i}}}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 g=0;g<this.faces.length;g++){let c=0;if(o.length>0){let u=this.facecentermass[g].dot(o[0]);for(let m=a;m>0;m>>=1)c+m<=o.length&&u>o[c+m-1].a&&(c+=m);c=o.length-c}for(l.push(c);i.length<=c;)i.push(0);i[c]++}let f=new Array(i.length);for(let g=0;g<i.length;g++)f[g]=[];let s=[];for(let g=0;g<this.faces.length;g++){if(l[g]<0)continue;let c=[this.facetocubie[g],this.facetoord[g]],u=this.facecentermass[g],m=u,p=g,L=l[p];for(;;){l[p]=-1;let R=u.rotatepoint(this.moverotations[n][0]);if(R.dist(m)<we)break;p=this.findface(R),c.push(this.facetocubie[p],this.facetoord[p]),u=R}if(c.length>2&&this.options.orientCenters&&(this.cubies[c[0]].length===1||this.duplicatedCubies[c[0]]>1)&&this.facecentermass[g].dist(this.basefaces[this.getfaceindex(g)].centermass())<we){let R=this.faces[this.cubies[c[0]][0]];for(let D=0;D<c.length;D+=2){let A=this.faces[this.cubies[c[D]][0]],y=-1;for(let k=0;k<R.length;k++)if(A.get(k).dist(R.get(0))<we){y=k;break}if(y<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");c[D+1]=y,R=R.rotate(this.moverotations[n][0])}}if(c.length===2&&this.options.orientCenters)for(let R=1;R<this.movesetorders[n];R++)L===0?c.push(c[0],R):c.push(c[0],(this.movesetorders[n]-R)%this.movesetorders[n]);if(c.length>2&&!s[c[0]]){if(c.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let R of c)f[L].push(R)}for(let R=0;R<c.length;R+=2)s[c[R]]=!0}for(let g=0;g<f.length;g++)f[g]=f[g].slice();r.push(f)}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=[],Na(t)}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 f=!1;for(let s=0;s<l.length;s+=2)if(l[s][0]===a[0]&&l[s][1]===a[1]&&l[s+1]===n[i+1]){f=!0;break}f||(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+ym+\`
|
|
9
9
|
\`+t+\`
|
|
10
10
|
\`}writegap(){let t=this.getOrbitsDef(!1),r=[],n=[];for(let l=0;l<t.moveops.length;l++){let i="M_"+_a(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.exprimentalPuzzleDescription=this.puzzleDescription,!o)throw new Error("Missing definition!");return o}getMoveFromBits(t,r,n,o,l,i){let a=[],f=[],s=[];for(let u of this.cubieords)f.push(Ct(u)),s.push(
|
|
13
|
-
\`}let a=this.getsolved(),f=[],s=[];for(let u=0;u<this.baseFaceCount;u++)f[u]=this.colors[this.facenames[u][1]];for(let u=0;u<this.faces.length;u++){let
|
|
14
|
-
\`);for(let
|
|
12
|
+
\`)}getKPuzzleDefinition(t=!0,r=!0){let o=this.getOrbitsDef(t,r).toKPuzzleDefinition(r);if(o.exprimentalPuzzleDescription=this.puzzleDescription,!o)throw new Error("Missing definition!");return o}getMoveFromBits(t,r,n,o,l,i){let a=[],f=[],s=[];for(let u of this.cubieords)f.push(Ct(u)),s.push(ur(u));for(let u=t[0];u<=t[1];u++){let m=o[u];for(let p=0;p<m.length;p+=2*i){let L=m.slice(p,p+2*i),R=this.cubiesetnums[L[0]];for(let y=0;y<L.length;y+=2)L[y]=this.cubieordnums[L[y]];let D=2,A=3;n&&(D=L.length-2,A=L.length-1),f[R]===Ct(this.cubieords[R])&&(f[R]=f[R].slice(),this.orbitoris[R]>1&&!this.options.fixedOrientation&&(s[R]=s[R].slice()));for(let y=0;y<L.length;y+=2)f[R][L[(y+D)%L.length]]=L[y],this.orbitoris[R]>1&&!this.options.fixedOrientation&&(s[R][L[y]]=(L[(y+A)%L.length]-L[(y+1)%L.length]+2*this.orbitoris[R])%this.orbitoris[R])}}let g=new qt(Ct(24),ur(24),1);for(let u=0;u<this.cubiesetnames.length;u++)if(!(l&&!l[u]))if(this.orbitoris[u]===1||this.options.fixedOrientation)f[u]===Ct(g.perm.length)?(f[u]!==g.perm&&(g=new qt(f[u],s[u],1)),a.push(g)):a.push(new qt(f[u],s[u],1));else{let m=new Array(s[u].length);for(let p=0;p<f[u].length;p++)m[p]=s[u][f[u][p]];a.push(new qt(f[u],m,this.orbitoris[u]))}let c=new gr(a);return r!==1&&(c=c.mulScalar(r)),c}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 u=0;u<this.cubiesetnames.length;u++)n.push(1);let o=[],l=[],i=[],a=[];for(let u=0;u<this.moveplanesets.length;u++){let m=this.getmovesets(u);i.push(m),this.options.addRotations?a.push(1):a.push(0)}if(this.options.moveList&&this.options.addRotations){for(let u=0;u<this.moverotations.length;u++)a[u]=0;for(let u=0;u<this.moveplanesets.length;u++)for(let m=0;m<this.moverotations.length;m++){let p=this.moveplanenormals[u];for(let L=1;L*2<=this.movesetorders[m];L++){if(p=p.rotatepoint(this.moverotations[m][0]),a[m]&L)continue;let R=-1,D=!1;for(let y=0;y<this.moveplanenormals.length;y++)if(p.dist(this.moveplanenormals[y])<we){R=y;break}else if(p.dist(this.moveplanenormals[y].smul(-1))<we){R=y,D=!0;break}if(R<0)throw new Error("Could not find rotation");let A=i[R];(A.length!==i[u].length||this.moveplanesets[u].length!==this.moveplanesets[R].length||this.diffmvsets(A,i[u],this.moveplanesets[R].length,D))&&(a[m]|=L)}}for(let u=0;u<this.moverotations.length;u++)if(a[u]===0)a[u]=1;else if(a[u]===1)this.movesetorders[u]>3?a[u]=2:a[u]=0;else if(a[u]===3)a[u]=0;else throw new Error("Impossible addrot val")}for(let u=0;u<this.moveplanesets.length;u++)a[u]!==0&&(i[u].push([0,this.moveplanesets[u].length]),i[u].push(a[u]));for(let u=0;u<this.moveplanesets.length;u++){let m=i[u],p=this.movesetorders[u];for(let D=0;D<m.length;D+=2)for(let A=0;A<D;A+=2)if(m[D]===m[A]&&m[D+1]===m[A+1])throw new Error("Redundant moves in moveset.");let L=[];for(let D=0;D<m.length;D+=2)for(let A=m[D][0];A<=m[D][1];A++)L[A]=1;let R=this.cmovesbyslice[u];for(let D=0;D<R.length;D++){if(L[D]!==1)continue;let A=R[D];for(let y=0;y<A.length;y+=2*p){if(this.skipcubie(A[y]))continue;let k=this.cubiesetnums[A[y]];n[k]=1}}}for(let u=0;u<this.cubiesetnames.length;u++)if(!!n[u]){if(this.omitSet(this.cubiesetnames[u])){n[u]=0;continue}o.push(this.cubiesetnames[u]),l.push(new vo(this.cubieords[u],this.options.fixedOrientation?1:this.orbitoris[u]))}let f=[];for(let u=0;u<this.cubiesetnames.length;u++){if(!n[u]||this.omitSet(this.cubiesetnames[u]))continue;let m=[],p=[];for(let L=0;L<this.cubieords[u];L++){if(t)m.push(L);else{let R=this.cubiesetcubies[u][L];m.push(this.cubievaluemap[R])}p.push(0)}f.push(new qt(m,p,this.options.fixedOrientation?1:this.orbitoris[u]))}let s=[],g=[];if(r)for(let u=0;u<this.moveplanesets.length;u++){let p=this.moveplanesets[u].length,L=i[u],R=this.movesetgeos[u];for(let D=0;D<L.length;D+=2){let A=L[D],y=vm(R,A,p),k=y[0],E=y[1];L[D+1]===1?s.push(k):s.push(k+L[D+1]);let Q=this.getMoveFromBits(A,L[D+1],E,this.cmovesbyslice[u],n,this.movesetorders[u]);g.push(Q)}}let c=new bn(o,l,new wn(f),s,g);return this.options.optimizeOrbits&&(c=c.optimize()),this.options.scrambleAmount!==0&&c.scramble(this.options.scrambleAmount),c}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){C2(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 pt(t)}getOrientationRotation(t){let[r,[n,o,l]]=t[0],i=new O(0,n,-o,l),[a,[f,s,g]]=t[1],c=new O(0,f,-s,g),u=null,m=null,p=this.swizzler.unswizzle(r),L=this.swizzler.unswizzle(a);for(let y of this.geonormals)p===y[1]&&(u=y[0]),L===y[1]&&(m=y[0]);if(!u)throw new Error("Could not find feature "+r);if(!m)throw new Error("Could not find feature "+a);let R=u.pointrotation(i);return m.rotatepoint(R).unproject(i).pointrotation(c.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=Sm()[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(x,S){let C=x[1][0]-x[0][0],j=x[1][1]-x[0][1],Z=2*Math.PI/S,ce=Math.cos(Z),Le=Math.sin(Z);for(let Ae=2;Ae<S;Ae++){let be=C*ce+j*Le;j=j*ce-C*Le,C=be,x.push([x[Ae-1][0]+C,x[Ae-1][1]+j])}}this.genperms();let s=this.getboundarygeometry().facenames[0][0].length,g=this.net;if(g===null)throw new Error("No net?");let c={},u=0,m=0,p=1,L=0;c[g[0][0]]=[[1,0],[0,0]],i(c[g[0][0]],s);for(let x of g){let S=x[0];if(!c[S])throw new Error("Bad edge description; first edge not connected.");for(let C=1;C<x.length;C++){let j=x[C];j===""||c[j]||(c[j]=[c[S][C%s],c[S][(C+s-1)%s]],i(c[j],s))}}for(let x in c){let S=c[x];for(let C of S)u=Math.min(u,C[0]),p=Math.max(p,C[0]),m=Math.min(m,C[1]),L=Math.max(L,C[1])}let R=Math.min(t/(p-u),r/(L-m)),D=.5*(t-R*(p+u)),A=.5*(r-R*(L+m)),y={},k=this.getboundarygeometry(),E={},Q=[[R+D,A],[D,A]];E[g[0][0]]=Q,i(E[g[0][0]],s),y[this.facenames[0][1]]=this.project2d(0,0,[new O(0,Q[0][0],Q[0][1],0),new O(0,Q[1][0],Q[1][1],0)]);let $=[];$[0]=0;for(let x of g){let S=x[0];if(!E[S])throw new Error("Bad edge description; first edge not connected.");let C=-1;for(let Z=0;Z<k.facenames.length;Z++)if(S===k.facenames[Z][1]){C=Z;break}if(C<0)throw new Error("Could not find first face name "+S);let j=k.facenames[C][0];for(let Z=1;Z<x.length;Z++){let ce=x[Z];if(ce===""||E[ce])continue;E[ce]=[E[S][Z%s],E[S][(Z+s-1)%s]],i(E[ce],s);let Le=$[C],Ae=j[(Le+Z)%s].sum(j[(Le+Z+s-1)%s]).smul(.5),be=Nl(k.edgenames,Ae),kt=k.edgenames[be][1],Pe=Em(kt,this.facenames),rt=Pe[S===Pe[0]?1:0],Se=-1;for(let v=0;v<k.facenames.length;v++)if(rt===k.facenames[v][1]){Se=v;break}if(Se<0)throw new Error("Could not find second face name");let h=k.facenames[Se][0];for(let v=0;v<h.length;v++)if(h[v].sum(h[(v+1)%s]).smul(.5).dist(Ae)<=we){let K=E[S][(Z+s-1)%s],le=E[S][Z%s];$[Se]=v,y[rt]=this.project2d(Se,v,[new O(0,le[0],le[1],0),new O(0,K[0],K[1],0)]);break}}}let G=0,oe=0,U=this.getInitial3DRotation();for(let x of this.faces){o&&(x=x.rotate(U));for(let S=0;S<x.length;S++)G=Math.max(G,Math.abs(x.get(S).b)),oe=Math.max(oe,Math.abs(x.get(S).c))}let _=Math.min(r/oe/2,(t-n)/G/4);return(x,S)=>{if(o){S=S.rotatepoint(U);let C=.5*n+.25*t,j=this.baseplanes[x].rotateplane(U).d<0?1:-1;return[n+t*.5+j*(C-S.b*_),n+r*.5+S.c*_]}else{let C=y[this.facenames[x][1]];return[n+l*S.dot(C[0])+C[2].b,n+r-l*S.dot(C[1])-C[2].c]}}}generatesvg(t=800,r=500,n=10,o=!1){let l=this.generate2dmapping(t,r,n,o);function i(u,m,p){return'<polygon id="'+u+'" class="sticker" style="fill: '+p+'" points="'+m.map(L=>L[0]+" "+L[1]).join(" ")+\`"/>
|
|
13
|
+
\`}let a=this.getsolved(),f=[],s=[];for(let u=0;u<this.baseFaceCount;u++)f[u]=this.colors[this.facenames[u][1]];for(let u=0;u<this.faces.length;u++){let m=this.faces[u],p=Math.floor(u/this.stickersperface),L=[];for(let R=0;R<m.length;R++)L.push(l(p,m.get(R)));s.push(L)}let g=[];for(let u=0;u<this.baseFaceCount;u++){g.push("<g>"),g.push("<title>"+this.facenames[u][1]+\`</title>
|
|
14
|
+
\`);for(let m=0;m<this.stickersperface;m++){let p=u*this.stickersperface+m,L=this.facetocubie[p],R=this.facetoord[p],D=this.cubiesetnums[L],A=this.cubieordnums[L],y=this.graybyori(L)?"#808080":f[a.p[p]],k=this.cubiesetnames[D]+"-l"+A+"-o"+R;if(g.push(i(k,s[p],y)),this.duplicatedFaces[p])for(let E=1;E<this.duplicatedFaces[p];E++)k=this.cubiesetnames[D]+"-l"+A+"-o"+E,g.push(i(k,s[p],y))}g.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
|
-
\`+
|
|
16
|
+
\`+g.join("")+"</svg>"}get3d(t){let r=[],n=this.getInitial3DRotation(),o=[],l=.52*this.basefaces[0].get(0).len();for(let s=0;s<this.basefaces.length;s++){let g=this.basefaces[s].rotate(n),c=this.facenames[s][1];o.push({coords:Wa(g,l),name:c})}for(let s=0;s<this.faces.length;s++){let g=Math.floor(s/this.stickersperface),c=this.facetocubie[s],u=this.facetoord[s],m=this.cubiesetnums[c],p=this.cubieordnums[c],L=this.graybyori(c)?"#808080":this.colors[this.facenames[g][1]];t?.stickerColors&&(L=t.stickerColors[s]);let R=this.faces[s].rotate(n);r.push({coords:Wa(R,l),color:L,orbit:this.cubiesetnames[m],ord:p,ori:u,face:g});let D=R;if(this.duplicatedFaces[s]){let A=D.length/this.duplicatedFaces[s];for(let y=1;y<this.duplicatedFaces[s];y++){for(let k=0;k<A;k++)D=D.rotateforward();r.push({coords:Wa(D,l),color:L,orbit:this.cubiesetnames[m],ord:p,ori:y,face:g,isDup:!0})}}}let i=[];for(let s=0;s<this.movesetgeos.length;s++){let g=this.movesetgeos[s],c=this.movesetorders[s];for(let u of this.geonormals)g[0]===u[1]&&g[1]===u[2]&&(i.push({coordinates:Ol(u[0].rotatepoint(n),1),quantumMove:new B(g[0]),order:c}),i.push({coordinates:Ol(u[0].rotatepoint(n).smul(-1),1),quantumMove:new B(g[2]),order:c}))}let a=this.generate2dmapping(2880,2160,0,!1,1),f=function(){let s=n.invrot();return function(g,c){let u=new O(0,c[0]*l,-c[1]*l,c[2]*l);u=u.rotatepoint(s);let m=a(g,u);return m[0]/=2880,m[1]=1-m[1]/2160,m}}().bind(this);return{stickers:r,faces:o,axis:i,unswizzle:this.unswizzle.bind(this),notationMapper:this.notationMapper,textureMapper:{getuv:f}}}getGeoNormal(t){let r=this.getInitial3DRotation(),n=this.swizzler.unswizzle(t);for(let o of this.geonormals)if(n===o[1]){let l=Ol(o[0].rotatepoint(r),1);return Math.abs(l[0])<we&&Math.abs(l[2])<we&&(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=Il(this.getMovesAsPerms(),t),l=n/o;t(\`Ratio is \${l}\`)}},Ir=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
|
|
21
|
+
Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrbitsDef(!1).reassemblySize();t(\`Reassembly size is \${n}\`);let o=Il(this.getMovesAsPerms(),t),l=n/o;t(\`Ratio is \${l}\`)}},Ir=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 bn.transformToKTransformationData(this.orbitNames,o)}}});var Ka={};ye(Ka,{ExperimentalPGNotation:()=>Ir,PuzzleGeometry:()=>Wl,Quat:()=>O,getPG3DNamedPuzzles:()=>q2,getPuzzleDescriptionString:()=>V2,getPuzzleGeometryByDesc:()=>Oa,getPuzzleGeometryByName:()=>Sn,parseOptions:()=>k2,parsePuzzleDescription:()=>So,schreierSims:()=>Il});var ko=b(()=>{_l();va();Gl();Ta();_l()});async function zo(e){return(await Promise.resolve().then(()=>(ko(),Ka))).getPuzzleGeometryByName(e,{allMoves:!0,orientCenters:!0,addRotations:!0})}async function km(e,t){let r=await e,n=r.getKPuzzleDefinition(!0);n.name=t;let o=await Promise.resolve().then(()=>(ko(),Ka)),l=new o.ExperimentalPGNotation(r,r.getOrbitsDef(!0));return new Oe(n,{experimentalPGNotation:l})}var Kl,Ql,jl,Lt,Nr,Or=b(()=>{Je();yn();Gr();Lt=class{constructor(t){ne(this,Kl,void 0);ne(this,Ql,void 0);ne(this,jl,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,Kl)??q(this,Kl,zo(this.pgId??this.id))}kpuzzle(){return d(this,Ql)??q(this,Ql,km(this.pg(),this.id))}svg(){return d(this,jl)??q(this,jl,(async()=>(await this.pg()).generatesvg())())}};Kl=new WeakMap,Ql=new WeakMap,jl=new WeakMap;Nr=class extends Lt{constructor(){super(...arguments);this.stickerings=An}appearance(t){return _t(this,t)}}});var H2={};ye(H2,{cube2x2x2KPuzzleDefinition:()=>Pt});var Pt,Y2=b(()=>{Pt={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]}}}};Pt.moves.Rv=Pt.moves.x;Pt.moves.Uv=Pt.moves.y;Pt.moves.Fv=Pt.moves.z;Pt.moves.Lv={CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]}};Pt.moves.Dv={CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}};Pt.moves.Bv={CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]}}});var Z2={};ye(Z2,{default:()=>zm});var zm,X2=b(()=>{zm=\`<?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
|
|
65
|
+
</svg>\`});var _o,J2=b(()=>{Je();Or();Gr();yn();_o={id:"2x2x2",fullName:"2\\xD72\\xD72 Cube",kpuzzle:Ke(async()=>new Oe((await Promise.resolve().then(()=>(Y2(),H2))).cube2x2x2KPuzzleDefinition)),svg:async()=>(await Promise.resolve().then(()=>(X2(),Z2))).default,pg:Ke(async()=>zo("2x2x2")),appearance:e=>_t(_o,e),stickerings:An}});var $2={};ye($2,{default:()=>_m});var _m,ef=b(()=>{_m=\`<?xml version="1.0" encoding="UTF-8"?>
|
|
66
66
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
|
|
67
67
|
"http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
|
|
68
68
|
<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">
|
|
@@ -189,7 +189,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
|
|
|
189
189
|
<use id="CENTERS-l5-o3" xlink:href="#sticker" transform="translate(4.3,7.5)" style="fill: yellow"/>
|
|
190
190
|
</g>
|
|
191
191
|
|
|
192
|
-
</svg>\`});var
|
|
192
|
+
</svg>\`});var tf={};ye(tf,{default:()=>Cm});var Cm,rf=b(()=>{Cm=\`<?xml version="1.0" encoding="UTF-8"?>
|
|
193
193
|
<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">
|
|
194
194
|
<title>3x3x3 LL</title>
|
|
195
195
|
<defs>
|
|
@@ -296,7 +296,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
|
|
|
296
296
|
<use id="CENTERS-l5-o2" xlink:href="#sticker" style="fill: yellow"/>
|
|
297
297
|
<use id="CENTERS-l5-o3" xlink:href="#sticker" style="fill: yellow"/>
|
|
298
298
|
</g>
|
|
299
|
-
</svg>\`});var Qa,
|
|
299
|
+
</svg>\`});var Qa,nf=b(()=>{Je();Or();Gr();yn();Qa={id:"3x3x3",fullName:"3\\xD73\\xD73 Cube",inventedBy:["Ern\\u0151 Rubik"],inventionYear:1974,kpuzzle:Ke(async()=>ya),svg:Ke(async()=>(await Promise.resolve().then(()=>(ef(),$2))).default),llSVG:Ke(async()=>(await Promise.resolve().then(()=>(rf(),tf))).default),pg:Ke(async()=>zo("3x3x3")),appearance:e=>_t(Qa,e),stickerings:An}});var of={};ye(of,{clockKPuzzleDefinition:()=>Pm});var Pm,lf=b(()=>{Pm={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 af={};ye(af,{default:()=>Mm});var Mm,sf=b(()=>{Mm=\`<?xml version="1.0" encoding="UTF-8"?>
|
|
300
300
|
<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">
|
|
301
301
|
<title>clock</title>
|
|
302
302
|
<defs>
|
|
@@ -664,7 +664,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
|
|
|
664
664
|
</g>
|
|
665
665
|
</g>
|
|
666
666
|
</g>
|
|
667
|
-
</svg>\`});var
|
|
667
|
+
</svg>\`});var ff,uf=b(()=>{Je();Gr();ff={id:"clock",fullName:"Clock",inventedBy:["Christopher C. Wiggs","Christopher J. Taylor"],inventionYear:1988,kpuzzle:Ke(async()=>new Oe((await Promise.resolve().then(()=>(lf(),of))).clockKPuzzleDefinition)),svg:Ke(async()=>(await Promise.resolve().then(()=>(sf(),af))).default)}});async function gf(e,t){let r=await e.kpuzzle(),n=new Ao(r),o=new yo(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"])))])]),f=()=>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")])])),s=()=>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()),w.Ignored);break;case"experimental-fto-f2t":n.set(o.not(i()),w.Ignored),n.set(l(),w.Dim);break;case"experimental-fto-sc":n.set(o.not(a()),w.Ignored),n.set(i(),w.Dim);break;case"experimental-fto-l2c":n.set(o.not(f()),w.Ignored),n.set(a(),w.Dim);break;case"experimental-fto-lbt":n.set(o.not(s()),w.Ignored),n.set(f(),w.Dim);break;case"experimental-fto-l3t":n.set(s(),w.Dim);break;default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(o.and(o.moves([])),w.Dim)}return n.toAppearance()}async function cf(){return["full","experimental-fto-fc","experimental-fto-f2t","experimental-fto-sc","experimental-fto-l2c","experimental-fto-lbt","experimental-fto-l3t"]}var mf=b(()=>{Uo()});var pf,Lf,Bf=b(()=>{Or();mf();pf=class extends Lt{constructor(){super({pgID:"FTO",id:"fto",fullName:"Face-Turning Octahedron",inventedBy:["Karl Rohrbach","David Pitcher"],inventionYear:1983});this.stickerings=cf}appearance(t){return gf(this,t)}},Lf=new pf});async function Rf(e,t){switch(t){case"full":case"F2L":case"LL":return _t(e,t);default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`)}return _t(e,"full")}async function df(){return["full","F2L","LL"]}var Df=b(()=>{yn()});var Ff,hf,Af=b(()=>{Or();Df();Ff=class extends Lt{constructor(){super({id:"megaminx",fullName:"Megaminx",inventionYear:1981});this.stickerings=df}appearance(t){return Rf(this,t)}},hf=new Ff});var yf={};ye(yf,{default:()=>Gm});var Gm,Uf=b(()=>{Gm=\`<?xml version="1.0" encoding="UTF-8"?>
|
|
668
668
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
|
|
669
669
|
"http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
|
|
670
670
|
<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">
|
|
@@ -751,7 +751,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
|
|
|
751
751
|
<use id="EDGES-l4-o1" xlink:href="#stickerV" transform="translate(1, 1)" style="fill: red"/>
|
|
752
752
|
</g>
|
|
753
753
|
|
|
754
|
-
</svg>\`});var
|
|
754
|
+
</svg>\`});var bf,wf,xf=b(()=>{Or();Gr();bf=class extends Lt{constructor(){super({id:"pyraminx",fullName:"Pyraminx",inventedBy:["Uwe Meffert"]});this.svg=Ke(async()=>(await Promise.resolve().then(()=>(Uf(),yf))).default)}},wf=new bf});var Sf={};ye(Sf,{sq1HyperOrbitKPuzzleDefinition:()=>Tm});var Tm,vf=b(()=>{Tm={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 Ef={};ye(Ef,{default:()=>Im});var Im,kf=b(()=>{Im=\`<?xml version="1.0" encoding="UTF-8"?>
|
|
755
755
|
<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">
|
|
756
756
|
<!-- Generator: Sketch 59.1 (86144) - https://sketch.com -->
|
|
757
757
|
<title>sq1-fancy</title>
|
|
@@ -1045,8 +1045,8 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
|
|
|
1045
1045
|
<line x1="0.15767665" y1="262.276878" x2="70.4345542" y2="2.27488928e-16" id="TOP"></line>
|
|
1046
1046
|
</g>
|
|
1047
1047
|
</g>
|
|
1048
|
-
</svg>\`});var
|
|
1049
|
-
\`)){let
|
|
1048
|
+
</svg>\`});var zf,_f=b(()=>{Je();Gr();zf={id:"square1",fullName:"Square-1",inventedBy:["Karel Hr\\u0161el","Vojtech Kopsk\\xFD"],inventionYear:1990,kpuzzle:Ke(async()=>new Oe((await Promise.resolve().then(()=>(vf(),Sf))).sq1HyperOrbitKPuzzleDefinition)),svg:Ke(async()=>(await Promise.resolve().then(()=>(kf(),Ef))).default)}});var ve,Vt=b(()=>{c2();Je();yn();Or();J2();nf();uf();Bf();Af();xf();_f();Uo();ve={"3x3x3":Qa,"2x2x2":_o,"4x4x4":new Nr({id:"4x4x4",fullName:"4\\xD74\\xD74 Cube"}),"5x5x5":new Nr({id:"5x5x5",fullName:"5\\xD75\\xD75 Cube"}),"6x6x6":new Nr({id:"6x6x6",fullName:"6\\xD76\\xD76 Cube"}),"7x7x7":new Nr({id:"7x7x7",fullName:"7\\xD77\\xD77 Cube"}),"40x40x40":new Nr({id:"40x40x40",fullName:"40\\xD740\\xD740 Cube"}),clock:ff,megaminx:hf,pyraminx:wf,skewb:new Lt({id:"skewb",fullName:"Skewb",inventedBy:["Tony Durham"]}),square1:zf,fto:Lf,gigaminx:new Lt({id:"gigaminx",fullName:"Gigaminx",inventedBy:["Tyler Fox"],inventionYear:2006}),master_tetraminx:new Lt({pgID:"master tetraminx",id:"master_tetraminx",fullName:"Master Tetraminx",inventedBy:["Katsuhiko Okamoto"],inventionYear:2002})}});function Pf(e){Cf=e}function gt(){if(!Cf)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 Cf,Ht=b(()=>{Cf=!1});async function Mf(){return globalThis?.crypto?.getRandomValues?crypto.getRandomValues.bind(crypto):(await(Nm??(Nm=import(Wm())))).webcrypto.getRandomValues}var Nm,Om,Wm,Gf=b(()=>{Nm=null,Om="cr-yp-to",Wm=()=>Om.replace(/-/g,"")});function jm(e){let t=new Uint32Array(2);e(t);let r=t[0],n=t[1];return Math.floor(r*Km)+Math.floor(n/Qm)}function qm(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>Tf)throw new Error(\`Called randomInt.below() with max == \${e}, which is larger than JavaScript can handle with integer precision.\`)}async function Qe(){let e=await Mf(),t=r=>{qm(r);let n=jm(e),o=Math.floor(Tf/r)*r;return n<o?n%r:t(r)};return t}var Tf,Km,Qm,ql=b(()=>{Gf();Tf=9007199254740992,Km=2097152,Qm=2048});async function Yt(){let e=await Qe();return t=>t[e(t.length)]}var If=b(()=>{ql()});async function Nf(e){for(let t=1;t<e.length;t++){let r=(await Vm)(t);[e[t],e[r]]=[e[r],e[t]]}}var Vm,Mt=b(()=>{If();ql();ql();Vm=Qe()});function Tt(e,t){let r=[],n=[];for(let g of t.split(\`
|
|
1049
|
+
\`)){let c=g.split(" ");if(!g.startsWith("SetOrder ")){if(g.startsWith("Alg ")){let u=z.fromString(g.substring(4));n.push({alg:u,transformation:e.algToTransformation(u)})}else if(g.startsWith("SubgroupSizes "))for(let u=1;u<c.length;u++)r.push(parseInt(c[u]))}}let o={ordering:new Array(r.length)},l=[],i=0;l.push(0);let a=z.fromString(""),f=e.identityTransformation();for(let g=0;g<r.length;g++)i+=r[g],l.push(i),n.splice(i-1,0,{alg:a,transformation:f});if(n.length!==i)throw Error(\`Bad sgs; expected \${i-r.length} algs but saw \${n.length-r.length}\`);let s={};for(let g in e.definition.orbits){let c=e.definition.orbits[g];s[g]=new Array(c.numPieces).fill(!1)}for(let g=r.length-1;g>=0;g--){let c=[];for(let m=l[g];m<l[g+1];m++){let p=n[m].transformation;for(let L in e.definition.orbits){let R=e.definition.orbits[L];for(let D=0;D<R.numPieces;D++)(p.transformationData[L].permutation[D]!==D||p.transformationData[L].orientation[D]!==0)&&(s[L][D]||(c.push({orbitName:L,permutationIdx:D}),s[L][D]=!0))}}let u={};for(let m=l[g];m<l[g+1];m++){let p=n[m].transformation.invert(),L="";for(let R=0;R<c.length;R++){let D=c[R];L=\`\${L} \${p.transformationData[D.orbitName].permutation[D.permutationIdx]} \${p.transformationData[D.orbitName].orientation[D.permutationIdx]}\`}u[L]=n[m],n[m].alg=n[m].alg.invert(),n[m].transformation=n[m].transformation.invert()}o.ordering[g]={pieceOrdering:c,lookup:u}}return o}var vn=b(()=>{Re()});var Vf={};ye(Vf,{cachedData222:()=>np,data222:()=>qf});async function np(){return rp??(rp=qf())}async function qf(){return Tt(await _o.kpuzzle(),\`SubgroupSizes 24 21 18 15 12 9 6
|
|
1050
1050
|
|
|
1051
1051
|
Alg F
|
|
1052
1052
|
Alg F2
|
|
@@ -1145,7 +1145,626 @@ Alg F D' F L' D F R2 U2 F' U'
|
|
|
1145
1145
|
Alg F D' L D' L F D2 L2 B' R'
|
|
1146
1146
|
Alg F L' D F R2 D2 L D F' U2
|
|
1147
1147
|
Alg F L' D F2 D' L F L2 F2 U
|
|
1148
|
-
Alg F D F' D L2 F R' F' D' B2 U'\`)}var ng,Zf=w(()=>{ur();_o();ng=null});async function Un(e,t){let r=new pt;r.experimentalPushAlg(e);for(let n of t){let o=(await Vt())(n);o!==null&&r.push(h.fromString(o))}return r.toAlg()}var Hl=w(()=>{Le();Mt()});function tu(e,t){return e.slice(t)+e.slice(0,t)}function mg(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(tu(sg[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push(tu(fg[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(ug),t}function ru(e){let t=mg(e);return cg.map(([r,n,o])=>t[r][n][o]).join("")}var sg,fg,ug,cg,nu=w(()=>{sg="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),fg="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),ug="U L F R B D".split(" "),cg=[[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 ou(e,t){let r=new ge(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 ge(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 lu(e,t){if(ou(e.startState(),t))return!1;for(let r of"ULFRBD")for(let n=1;n<4;n++){let o=e.moveToTransformation(new h(r,n)).toKState();if(ou(o,t))return!1}return!0}var iu=w(()=>{Le();Je()});var au,su=w(()=>{au=[["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"]]});var Nu={};Be(Nu,{initialize:()=>rd,solveState:()=>nd});function fu(){}function gg(e){function t(){}return t.prototype=e||{},new t}function dg(e){return e instanceof Array?e[0]:null}function Po(e,t,r){var n=Yl,o=hg,l=dg,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$=fu));for(var f=3;f<arguments.length;++f)arguments[f].prototype=H;a&&(H.___clazz$=a)}function hg(e){var t=Yl;return gg(t[e])}function Lg(){}function Zl(e){return e<<24>>24}function Ya(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function Za(e,t){var r;return r=new Ya,r.packageName=e,r.compoundName=t,r}function pr(e,t,r){var n;return n=Za(e,t),yg(r,n),n}function Ag(e,t){var r;return r=Za(e,t),r.modifiers=2,r}function Xl(e,t){var r;return r=Za("",e),r.typeId=t,r.modifiers=1,r}function uu(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function Dg(e){if(e.isPrimitive())return null;var t=e.typeId,r=Yl[t];return r}function yg(e,t){if(!!e){t.typeId=e;var r=Dg(t);if(!r){Yl[e]=[t];return}r.___clazz$=t}}function ee(e,t){return uu(e,t)}function X(e,t,r,n,o,l){var i;return i=mu(o,n),te(ee(e,l),t,r,o,i),i}function et(e,t,r,n,o,l){return cu(e,t,r,n,o,0,l)}function cu(e,t,r,n,o,l,i){var a,f,s,c,m;if(c=o[l],s=l==i-1,a=s?n:0,m=mu(a,c),te(ee(e,i-l),t[l],r[l],a,m),!s)for(++l,f=0;f<c;++f)m[f]=cu(e,t,r,n,o,l,i);return m}function te(e,t,r,n,o){return o.___clazz$=e,o.castableTypeMap$=t,o.typeMarker$=fu,o.__elementTypeId$=r,o.__elementTypeCategory$=n,o}function mu(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 pu(e){var t,r,n;return t=e&$e,r=e>>22&$e,n=e<0?mr:0,Rg(t,r,n)}function Rg(e,t,r){return{l:e,m:t,h:r}}function Fg(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&$e,m:n&$e,h:o&mr}}function Tt(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function Xa(e){var t,r;return e>-129&&e<128?(t=e+128,$l==null&&($l=X(ed,se,293,256,0,1)),r=$l[t],!r&&(r=$l[t]=pu(e)),r):pu(e)}function gu(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 Ja(e,t){return e.l!=t.l||e.m!=t.m||e.h!=t.h}function $a(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function Jl(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&$e,m:n&$e,h:o&mr}}function Wr(e,t){var r,n,o,l,i;return t&=63,r=e.h,n=(r&pg)!=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?mr:0,l=r>>t-22,o=e.m>>t-22|r<<44-t):(i=n?mr:0,l=n?$e:0,o=r>>t-44),{l:o&$e,m:l&$e,h:i&mr}}function du(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&$e,m:n&$e,h:o&mr}}function Kr(e){return e.l|e.m<<22}function Bg(e){this.string=e}function gr(e,t){return e>t?e:t}function es(e,t){return e<t?e:t}function bg(e,t){return e.indexOf(t)}function wg(e){return xg(e,0,e.length)}function xg(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 Sg(e){return String.fromCharCode(e&je)}function hu(e){return e.string+=" ",e}function Lu(e,t){return e.string+=t,e}function Ug(){Bg.call(this,"")}function ei(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 Qr(){Au||(Au=!0,hr=et(ye,[se,De],[11,0],7,[495,18],2),Mn=et(ye,[se,De],[11,0],7,[324,18],2),_n=et(ye,[se,De],[11,0],7,[336,18],2),dr=et(ye,[se,De],[11,0],7,[495,8],2),ni=X(ke,Ee,0,20048,7,1),ri=X(ke,Ee,0,20791,7,1),Pn=X(ke,Ee,0,82945,7,1),En=et(ye,[se,De],[11,0],7,[2768,10],2),zn=et(ye,[se,De],[11,0],7,[2768,10],2),Cn=et(ye,[se,De],[11,0],7,[24,10],2),To=et(ye,[se,De],[11,0],7,[24,16],2),jr=et(ye,[se,De],[11,0],7,[140,16],2),ti=X(ke,Ee,0,8305,7,1),kn=X(ke,Ee,0,48441,7,1))}function Eg(e,t,r){return e.slice_0=hr[t.slice_0][r],e.flip=_n[t.flip][(J(),Vr)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=Mn[t.twist][Vr[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=gr(gr(it(ni,e.twist*495+dr[e.slice_0][e.tsym]),it(ri,e.flip*495+dr[e.slice_0][e.fsym])),it(Pn,e.twist<<11|Dr[e.flip<<3|e.fsym^e.tsym])),e.prun}function kg(e,t,r){return r=(J(),Oo)[3][r],e.flipc=_n[t.flipc>>3][Vr[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=Mn[t.twistc>>3][Vr[r<<3|t.twistc&7]]^t.twistc&7,it(Pn,e.twistc>>3<<11|Dr[e.flipc^e.twistc&7])}function Du(e,t,r){var n;return e.twist=(J(),Wo)[ai(t)],e.flip=qr[ii(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=it(Pn,e.twist<<11|Dr[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-In(t.ea,8,!0),e.prun=gr(e.prun,gr(it(ni,e.twist*495+dr[e.slice_0][e.tsym]),it(ri,e.flip*495+dr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new ue,Io(t,1,n),No(t,1,n),e.twistc=Wo[ai(n)],e.flipc=qr[ii(n)],e.prun=gr(e.prun,it(Pn,e.twistc>>3<<11|Dr[e.flipc^e.twistc&7])),e.prun<=r)}function Mo(){Qr()}function it(e,t){return Qr(),e[t>>3]>>(t<<2)&15}function yu(e){Qr(),!(oi==2||oi==1&&!e)&&(oi==0&&(Qg(),zg(),Cg(),Mg(),_g(),J(),is(2048,as,qr,Su=X(ye,De,0,336,7,1),0),is(2187,cs,Wo,us=X(ye,De,0,324,7,1),1),Pg(),Gg(),Tg()),Go(ti,Cn,To,En,(J(),fs),584244,e),Go(kn,ts,jr,zn,fs,514084,e),Go(ni,hr,dr,Mn,us,431619,e),Go(ri,hr,dr,_n,Su,431619,e),Go(Pn,null,null,Mn,us,103939,e),oi=e?2:1)}function zg(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<2768;r++)for(Og(e,(J(),Gn)[r]),n=0;n<10;n++)Lr(e,ce[(Ve(),wt)[n]],t),En[r][n]=ui(Yt[st(t.ca,8,!1)])&je}function _g(){var e,t,r,n,o;for(e=new ue,t=new ue,ts=et(ye,[se,De],[11,0],7,[140,10],2),r=0;r<140;r++){for(Mu(e.ca,r%70,0,!1),o=0;o<10;o++)Lr(e,(J(),ce)[(Ve(),wt)[o]],t),ts[r][o]=In(t.ca,0,!1)+70*(165>>o&1^~~(r/70))&je;for(n=0;n<16;n++)Io(e,(J(),at)[0][n],t),jr[r][n]=In(t.ca,0,!1)+70*~~(r/70)&je}}function Cg(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<2768;r++)for(bu(e,(J(),Gn)[r]),n=0;n<10;n++)ht(e,ce[(Ve(),wt)[n]],t),zn[r][n]=Yt[st(t.ea,8,!0)]}function Pg(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<336;r++)for(os(e,(J(),as)[r]),n=0;n<18;n++)ht(e,ce[n],t),_n[r][n]=qr[ii(t)]}function Mg(){var e,t,r,n,o;for(e=new ue,t=new ue,r=0;r<24;r++){for(Hr(e.ea,r,12,!0),o=0;o<10;o++)ht(e,(J(),ce)[(Ve(),wt)[o]],t),Cn[r][o]=st(t.ea,12,!0)%24&je;for(n=0;n<16;n++)No(e,(J(),at)[0][n],t),To[r][n]=st(t.ea,12,!0)%24&je}}function Go(e,t,r,n,o,l,i){var a,f,s,c,m,u,p,g,d,L,D,F,B,k,E,Q,$,G,oe,b,_,M,S,v,C,j,Z,me,de,Fe,we,kt,Ce,rt,ve,R;if(B=l&15,D=(l>>4&1)==1?Ha:0,s=(l>>5&1)==1,a=l>>8&15,c=l>>12&15,m=l>>16&15,L=i?c:m,F=(1<<B)-1,f=t==null,g=f?2048:t.length,d=g*n.length,p=s?10:18,u=p==10?66:599186,E=(e[d>>3]>>(d<<2)&15)-1,E==-1){for(G=0;G<~~(d/8)+1;G++)e[G]=Co;e[0]^=1,E=0}for(;E<L;){for(C=(E+1)*Co^-1,oe=0;oe<e.length;oe++)ve=e[oe]^C,ve&=ve>>1,e[oe]+=ve&ve>>2&Co;for(M=E>a,Fe=M?E+2:E,de=Fe*Co,k=M?E:E+2,++E,R=E^E+1,rt=0,G=0;G<d;++G,rt>>=4){if((G&7)==0&&(rt=e[G>>3],((rt^de)-Co&~(rt^de)&-2004318072)==0)){G+=7;continue}if((rt&15)==Fe)for(Z=G%g,we=~~(G/g),Q=0,$=0,f&&(Q=(J(),qr)[Z],$=Q&7,Q>>=3),v=0;v<p;v++){if(Ce=n[we][v],f?me=(J(),Dr)[_n[Q][Vr[v<<3|$]]^$^Ce&F]:me=r[t[Z][v]][Ce&F],Ce>>=B,b=Ce*g+me,j=e[b>>3]>>(b<<2)&15,j!=k){j<E-1&&(v+=u>>v&3);continue}if(M){e[G>>3]^=R<<(G<<2);break}for(e[b>>3]^=R<<(b<<2),S=1,kt=o[Ce];(kt>>=1)!=0;S++)(kt&1)==1&&(_=Ce*g,f?_+=(J(),Dr)[qr[me]^S]:_+=r[me][S^D>>(S<<1)&3],(e[_>>3]>>(_<<2)&15)==k&&(e[_>>3]^=R<<(_<<2)))}}}}function Gg(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<324;r++)for(ls(e,(J(),cs)[r]),n=0;n<18;n++)Lr(e,ce[n],t),Mn[r][n]=Wo[ai(t)]}function Tg(){var e,t,r,n,o,l,i,a;for(e=new ue,t=new ue,n=0;n<495;n++){for(Mu(e.ea,494-n,8,!0),l=0;l<18;l+=3)ht(e,(J(),ce)[l],t),hr[n][l]=494-In(t.ea,8,!0)&je;for(o=0;o<16;o+=2)No(e,(J(),at)[0][o],t),dr[n][o>>1]=494-In(t.ea,8,!0)&je}for(r=0;r<495;r++)for(o=0;o<18;o+=3)for(a=hr[r][o],i=1;i<3;i++)a=hr[a][o],hr[r][o+i]=a&je}function J(){Ru||(Ru=!0,Ht=X(Ko,se,7,16,0,1),ce=X(Ko,se,7,18,0,1),mi=X(td,se,0,18,6,1),vu=X(ke,Ee,0,48,7,1),Zt=et(ke,[se,Ee],[17,0],7,[16,16],2),at=et(ke,[se,Ee],[17,0],7,[16,16],2),Oo=et(ke,[se,Ee],[17,0],7,[16,18],2),Vr=X(ke,Ee,0,144,7,1),yr=et(ke,[se,Ee],[17,0],7,[16,18],2),as=X(ye,De,0,336,7,1),cs=X(ye,De,0,324,7,1),Gn=X(ye,De,0,2768,7,1),Tn=X(re,ae,0,2768,7,1),ss=X(ye,De,0,2768,7,1),ci=X(re,ae,0,24,7,1),qr=X(ye,De,0,2048,7,1),Wo=X(ye,De,0,2187,7,1),Yt=X(ye,De,0,40320,7,1),Dr=X(ye,De,0,2688,7,1),ms=new bt(2531,1373,67026819,1367),ps=new bt(2089,1906,322752913,2040),pi=te(ee(re,2),se,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])]),Kg(),jg())}function rs(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 Fu(e){!e.temps&&(e.temps=new ue),Lr(ps,e,e.temps),Lr(e.temps,ms,e),ht(ps,e,e.temps),ht(e.temps,ms,e)}function ns(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 Ig(e){return ui(Yt[st(e.ca,8,!1)])}function Ng(e){return Yt[st(e.ea,8,!0)]}function ii(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function ai(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function si(e){var t,r;for(!e.temps&&(e.temps=new ue),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;ns(e,e.temps)}function Bu(e){var t,r,n,o,l,i,a;for(t=new wu(e),o=new ue,r=ui(Yt[st(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},a=0;a<6;a++){if(n=ui(Yt[st(t.ca,8,!1)])>>4,r==n)for(l=0;l<16;l++)Io(t,at[0][l],o),ei(o.ca,e.ca)&&(No(t,at[0][l],o),ei(o.ea,e.ea)&&(i=$a(i,Jl({l:1,m:0,h:0},(a<<4|l)<48?a<<4|l:48))));Fu(t),a%3==2&&si(t)}return i}function Og(e,t){Hr(e.ca,t,8,!1)}function bu(e,t){Hr(e.ea,t,8,!0)}function os(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 ls(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 Wg(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:(ds(st(e.ea,12,!0),12)^ds(st(e.ca,8,!1),8))!=0?-6:0}function Io(e,t,r){J();var n,o,l,i,a,f;for(f=Ht[at[0][t]],a=Ht[t],n=0;n<8;n++)l=f.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]=(f.ca[e.ca[a.ca[n]&7]&7]&7|o<<3)<<24>>24}function Lr(e,t,r){J();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 ue(){J(),rs(this)}function bt(e,t,r,n){rs(this),Hr(this.ca,e,8,!1),ls(this,t),Hr(this.ea,r,12,!0),os(this,n)}function wu(e){rs(this),ns(this,e)}function ui(e){return J(),e^Ha>>((e&15)<<1)&3}function No(e,t,r){J();var n,o,l;for(l=Ht[at[0][t]],o=Ht[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 ht(e,t,r){J();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){J();var n;return n=ss[e],r&&(n=n^Ha>>((n&15)<<1)&3),n&65520|Zt[n&15][t]}function xu(){return J(),0}function Kg(){var e,t;for(ce[0]=new bt(15120,0,119750400,0),ce[3]=new bt(21021,1494,323403417,0),ce[6]=new bt(8064,1236,29441808,550),ce[9]=new bt(9,0,5880,0),ce[12]=new bt(1230,412,2949660,0),ce[15]=new bt(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)ce[e+t+1]=new ue,ht(ce[e+t],ce[e],ce[e+t+1]),Lr(ce[e+t],ce[e],ce[e+t+1])}function Qg(){J();var e,t,r;for(is(40320,Gn,Yt,fs=X(ye,De,0,2768,7,1),2),e=new ue,r=0;r<2768;r++)bu(e,Gn[r]),Tn[r]=In(e.ea,0,!0)+ds(Gn[r],8)*70<<24>>24,si(e),ss[r]=Yt[st(e.ea,8,!0)];for(t=0;t<24;t++)Hr(e.ea,t,12,!0),si(e),ci[t]=st(e.ea,12,!0)%24<<24>>24}function jg(){var e,t,r,n,o,l,i,a,f,s,c,m,u,p,g,d;for(e=new ue,t=new ue,r=new bt(28783,0,259268407,0),d=new bt(15138,0,119765538,7),m=new bt(5167,0,83473207,0),o=0;o<8;o++)m.ca[o]=Zl(m.ca[o]|24);for(l=0;l<16;l++)Ht[l]=new wu(e),fi(e,d,t),ht(e,d,t),g=t,t=e,e=g,l%4==3&&(fi(g,m,t),ht(g,m,t),g=t,t=e,e=g),l%8==7&&(fi(g,r,t),ht(g,r,t),g=t,t=e,e=g);for(i=0;i<16;i++)for(f=0;f<16;f++)for(fi(Ht[i],Ht[f],e),c=0;c<16;c++)if(ei(Ht[c].ca,e.ca)){Zt[i][f]=c,at[c][f]=i;break}for(s=0;s<18;s++)for(p=0;p<16;p++){for(Io(ce[s],at[0][p],e),u=0;u<18;u++)if(ei(ce[u].ca,e.ca)){Oo[p][s]=u,yr[p][(Ve(),Nn)[s]]=Nn[u];break}p%2==0&&(Vr[s<<3|p>>1]=Oo[p][s])}for(n=0;n<18;n++)for(mi[n]=Bu(ce[n]),a=n,p=0;p<48;p++)Oo[p%16][a]<n&&(vu[p]|=1<<n),p%16==15&&(a=pi[2][a])}function is(e,t,r,n,o){J();var l,i,a,f,s,c,m,u,p;for(l=new ue,a=new ue,i=0,s=0,p=o>=2?1:2,c=o!=1,f=0;f<e;f++)if(r[f]==0){switch(o){case 0:os(l,f);break;case 1:ls(l,f);break;case 2:Hr(l.ea,f,8,!0)}for(m=0;m<16;m+=p){switch(c?No(l,m,a):Io(l,m,a),o){case 0:s=ii(a);break;case 1:s=ai(a);break;case 2:s=st(a.ea,8,!0)}o==0&&(Dr[i<<3|m>>1]=s&je),s==f&&(n[i]=(n[i]|1<<~~(m/p))&je),u=~~((i<<4|m)/p),r[s]=u&je}t[i++]=f&je}return i}function qg(e,t,r,n,o,l,i,a){var f,s,c,m,u;if(m=gr(it((Qr(),kn),(i>>4)*140+jr[(J(),Tn)[a>>4]&255][at[i&15][a&15]]),gr(it(kn,n*140+jr[Tn[t]&255][at[o][r]]),it(ti,t*24+To[l][r]))),m>e.maxDep2)return m-e.maxDep2;for(f=e.maxDep2;f>=m&&(u=ku(e,n,o,t,r,l,f,e.depth1,10),!(u<0));f--){for(f-=u,e.solLen=0,e.solution=new Iu,$g(e.solution,e.verbose,e.urfIdx,e.depth1),c=0;c<e.depth1+f;c++)Gu(e.solution,e.move[c]);for(s=e.preMoveLen-1;s>=0;s--)Gu(e.solution,e.preMoves[s]);e.solLen=e.solution.length_0}return f!=e.maxDep2?(e.maxDep2=es(_u,e.solLen-e.length1-1),gu(e.probe,e.probeMin)?0:1):1}function Vg(e){var t,r,n,o,l,i,a,f,s,c,m,u,p,g,d;if(e.isRec=!1,gu(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=Fg(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)Lr(e.phase1Cubie[n],(J(),ce)[e.move[n]],e.phase1Cubie[n+1]),ht(e.phase1Cubie[n],ce[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,a=Ig(e.phase1Cubie[e.depth1]),f=a&15,a>>=4,s=Ng(e.phase1Cubie[e.depth1]),c=s&15,s>>=4,m=st(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=Ar(s,c,!1),t=Ar(a,f,!0),o=e.depth1==0?-1:e.move[e.depth1-1],l=e.preMoveLen==0?-1:e.preMoves[e.preMoveLen-1],d=0,g=(e.preMoveLen==0?1:2)*(e.depth1==0?1:2),u=0,p=(1<<g)-1;u<g;u++){if((p>>u&1)!=0){if(p&=~(1<<u),d=qg(e,a,f,s,c,m,r,t),d==0||d>2)break;d==2&&(p&=4<<u)}if(p==0)break;(u&1)==0&&e.depth1>0?(i=(Ve(),Nn)[~~(o/3)*3+1],e.move[e.depth1-1]=wt[i]*2-e.move[e.depth1-1],m=(Qr(),Cn)[m][i],a=En[a][(J(),yr)[f][i]],f=Zt[a&15][f],a>>=4,s=zn[s][yr[c][i]],c=Zt[s&15][c],s>>=4,t=Ar(a,f,!0),r=Ar(s,c,!1)):e.preMoveLen>0&&(i=(Ve(),Nn)[~~(l/3)*3+1],e.preMoves[e.preMoveLen-1]=wt[i]*2-e.preMoves[e.preMoveLen-1],m=(J(),ci)[(Qr(),Cn)[ci[m]][i]],a=En[t>>4][yr[t&15][i]],t=a&-16|Zt[a&15][t&15],a=Ar(t>>4,t&15,!0),f=a&15,a>>=4,s=zn[r>>4][yr[r&15][i]],r=s&-16|Zt[s&15][r&15],s=Ar(r>>4,r&15,!1),c=s&15,s>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=o),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=l),d==0?0:2}function Hg(e){var t;for(e.conjMask=0,e.selfSym=Bu(e.cc),e.conjMask|=Ja(Tt(Wr(e.selfSym,16),{l:je,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=Ja(Tt(Wr(e.selfSym,32),{l:je,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=Ja(Tt(Wr(e.selfSym,48),{l:je,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=Tt(e.selfSym,{l:$e,m:$e,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)ns(e.urfCubieCube[t],e.cc),Du(e.urfCoordCube[t],e.urfCubieCube[t],20),Fu(e.cc),t%3==2&&si(e.cc)}function Uu(e,t,r,n,o){var l,i,a,f,s,c;if(t.prun==0&&n<5)return e.allowShorter||n==0?(e.depth1-=n,s=Vg(e),e.depth1+=n,s):1;for(c=xu(Xa(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]||c!=0&&(c&1<<i)!=0)){if(f=Eg(e.nodeUD[n],t,i),f>n)break;if(f==n)continue;if(f=kg(e.nodeUD[n],t,i),f>n)break;if(f==n)continue;if(e.move[e.depth1-n]=i,e.valid1=es(e.valid1,e.depth1-n),s=Uu(e,e.nodeUD[n],r&Kr((J(),mi)[i]),n-1,l),s==0)return 0;if(s>=2)break}}return 1}function Eu(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==gs&&e.preMoveLen!=0,Du(e.nodeUD[e.depth1+1],n,e.depth1)&&Uu(e,e.nodeUD[e.depth1+1],o,e.depth1,-1)==0))return 0;if(t==0||e.preMoveLen+gs>=e.length1)return 1;for(a=xu(Xa(o)),(t==1||e.preMoveLen+1+gs>=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)&&(Lr((J(),ce)[l],n,e.preMoveCubes[t]),ht(ce[l],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=l,i=Eu(e,t-1,l,e.preMoveCubes[t],o&Kr(mi[l])),i==0))return 0}return 1}function ku(e,t,r,n,o,l,i,a,f){var s,c,m,u,p,g,d,L,D,F,B;if(t==0&&n==0&&l==0)return i;for(D=(Ve(),Qo)[f],d=0;d<10;d++){if((D>>d&1)!=0){d+=66>>d&3;continue}if(L=(Qr(),Cn)[l][d],c=En[n][(J(),yr)[o][d]],m=Zt[c&15][o],c>>=4,p=zn[t][yr[r][d]],g=Zt[p&15][r],p>>=4,u=Ar(p,g,!1),s=Ar(c,m,!0),F=it(kn,(u>>4)*140+jr[Tn[s>>4]&255][at[u&15][s&15]]),F>i+1)return i-F+1;if(F>=i){d+=66>>d&3&i-F;continue}if(F=gr(it(ti,c*24+To[L][m]),it(kn,p*140+jr[Tn[c]&255][at[g][m]])),F>=i){d+=66>>d&3&i-F;continue}if(B=ku(e,p,g,c,m,L,i-1,a+1,d),B>=0)return e.move[a]=wt[d],B;if(B<-2)break;B<-1&&(d+=66>>d&3)}return-1}function Yg(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=es(_u,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)==0&&Eu(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],Kr(Tt(e.selfSym,{l:je,m:0,h:0})))==0)return e.solution?Tu(e.solution):"Error 8";return e.solution?Tu(e.solution):"Error 7"}function Zg(e,t){var r;return r=Xg(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,yu(!1),Hg(e),Yg(e))}function Xg(e,t){var r,n,o,l;for(n=0,o=X(re,ae,0,54,7,1),r=wg(te(ee(ye,1),De,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]=bg(r,Sg(t.charCodeAt(l)))<<24>>24,o[l]==-1)return-1;n+=1<<(o[l]<<2)}return n!=10066329?-1:(Jg(o,e.cc),Wg(e.cc))}function zu(){var e,t,r;for(this.move=X(ke,Ee,0,31,7,1),this.nodeUD=X(li,se,31,21,0,1),this.nodeRL=X(li,se,31,21,0,1),this.nodeFB=X(li,se,31,21,0,1),this.cc=new ue,this.urfCubieCube=X(Ko,se,7,6,0,1),this.urfCoordCube=X(li,se,31,6,0,1),this.phase1Cubie=X(Ko,se,7,21,0,1),this.preMoveCubes=X(Ko,se,7,21,0,1),this.preMoves=X(ke,Ee,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new Mo,this.nodeRL[t]=new Mo,this.nodeFB[t]=new Mo,this.phase1Cubie[t]=new ue;for(r=0;r<6;r++)this.urfCubieCube[r]=new ue,this.urfCoordCube[r]=new Mo;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new ue}function Ve(){if(!Cu){Cu=!0;var e,t,r,n,o,l;for(Yr=te(ee(re,2),se,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])]),Jt=te(ee(re,2),se,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])]),Xt=et(ke,[se,Ee],[17,0],7,[13,13],2),hs=te(ee(vg,1),se,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),wt=te(ee(ke,1),Ee,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),Nn=X(ke,Ee,0,18,7,1),Qo=X(ke,Ee,0,11,7,1),t=0;t<18;t++)Nn[wt[t]]=t;for(r=0;r<10;r++)for(n=~~(wt[r]/3),Qo[r]=0,o=0;o<10;o++)l=~~(wt[o]/3),Qo[r]|=(n==l||n%3==l%3&&n>=l?1:0)<<o;for(Qo[10]=0,e=0;e<13;e++)for(Xt[e][0]=Xt[e][e]=1,o=1;o<e;o++)Xt[e][o]=Xt[e-1][o-1]+Xt[e-1][o]}}function In(e,t,r){Ve();var n,o,l,i,a;for(n=e.length-1,l=0,a=4,o=n;o>=0;o--)i=Pu(e[o],r),(i&12)==t&&(l+=Xt[o][a--]);return l}function ds(e,t){Ve();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function st(e,t,r){Ve();var n,o,l,i;for(o=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)l=Pu(e[n],r)<<2,o=(t-n)*o+Kr(Tt(Wr(i,l),{l:15,m:0,h:0})),i=du(i,Jl({l:1118480,m:279620,h:69905},l));return o}function Pu(e,t){return t?e>>1:e&7}function Mu(e,t,r,n){Ve();var o,l,i,a;for(o=e.length-1,a=4,l=o,i=o;i>=0;i--)t>=Xt[i][a]?(t-=Xt[i][a--],e[i]=gi(e[i],a|r,n)):((l&12)==r&&(l-=4),e[i]=gi(e[i],l--,n))}function Hr(e,t,r,n){Ve();var o,l,i,a,f,s;for(s={l:1323536,m:2777561,h:1043915},o={l:0,m:0,h:0},a=2;a<=r;a++)o=$a(Jl(o,4),Xa(t%a)),t=~~(t/a);for(l=0;l<r-1;l++)f=(Kr(o)&15)<<2,o=Wr(o,4),e[l]=gi(e[l],Kr(Tt(Wr(s,f),{l:15,m:0,h:0})),n),i=du(Jl({l:1,m:0,h:0},f),{l:1,m:0,h:0}),s=$a(Tt(s,i),Tt(Wr(s,4),{l:~i.l&$e,m:~i.m&$e,h:~i.h&mr}));e[r-1]=gi(e[r-1],Kr(Tt(s,{l:15,m:0,h:0})),n)}function gi(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function Jg(e,t){Ve();var r,n,o,l,i,a,f,s;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(s=0;s<3&&!(e[Yr[a][s]]==0||e[Yr[a][s]]==3);s++);for(r=e[Yr[a][(s+1)%3]],n=e[Yr[a][(s+2)%3]],f=0;f<8;f++)if(r==~~(Yr[f][1]/9)&&n==~~(Yr[f][2]/9)){t.ca[a]=Zl(s%3<<3|f);break}}for(o=0;o<12;o++)for(f=0;f<12;f++){if(e[Jt[o][0]]==~~(Jt[f][0]/9)&&e[Jt[o][1]]==~~(Jt[f][1]/9)){t.ea[o]=Zl(f<<1);break}if(e[Jt[o][0]]==~~(Jt[f][1]/9)&&e[Jt[o][1]]==~~(Jt[f][0]/9)){t.ea[o]=Zl(f<<1|1);break}}}function Gu(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 $g(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function Tu(e){var t,r,n;if(r=new Ug,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+=". "),hu(Lu(r,(Ve(),hs)[(J(),pi)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)hu(Lu(r,(Ve(),hs)[(J(),pi)[n][e.moves[t]]])),(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". ");return r.string}function Iu(){this.moves=X(ke,Ee,0,31,7,1)}var se,$e,mr,pg,je,De,Ee,Ha,Co,ae,H,Yl,$l,vg,Au,jr,ts,En,kn,zn,_n,ti,To,Cn,Pn,Mn,dr,ri,hr,ni,oi,li,Ru,Ht,Yt,Gn,qr,as,Dr,ci,Tn,ss,Vr,Oo,yr,Zt,at,Su,fs,us,Wo,cs,vu,ce,mi,ms,ps,pi,Ko,_u,gs,Cu,Xt,Qo,Yr,Jt,hs,Nn,wt,ke,ed,re,td,ye,rd,nd,Ou=w(()=>{se={3:1},$e=4194303,mr=1048575,pg=524288,je=65535,De={11:1,3:1},Ee={17:1,3:1},Ha=14540032,Co=286331153,ae={10:1,3:1},Yl={};Po(1,null,{},Lg);Po(79,1,{},Ya);H.createClassLiteralForArray=function(t){var r;return r=new Ya,r.modifiers=4,t>1?r.componentType=uu(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!=0};vg=pr("java.lang","String",2);Au=!1;Po(31,1,{31:1},Mo);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;oi=0,li=pr("org.cubing.min2phase.client","CoordCube",31),Ru=!1;Ko=pr("org.cubing.min2phase.client","CubieCube",7);Po(72,1,{},zu);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;_u=12,gs=7,Cu=!1;Po(150,1,{},Iu);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;ke=Xl("int","I");pr("com.google.gwt.lang","CollapsedPropertyHolder",252);pr("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);ed=pr("com.google.gwt.lang","LongLibBase/LongEmul",null);pr("com.google.gwt.lang","ModuleUtils",257);re=Xl("byte","B"),td=Xl("long","J"),ye=Xl("char","C");pr("com.google.gwt.user.client.rpc","XsrfToken",null),Ag("java.util","Map/Entry");rd=function(){yu(!1)},nd=function(e){return Zg(new zu,e)}});async function Wu(){let e=await Ke["3x3x3"].kpuzzle(),t=e.startState();for(let r of au)t=t.applyAlg(z.fromString((await Vt())(r)));return lu(e,t)?t:Wu()}function Ku(){return od??(od=Promise.resolve().then(()=>(Ou(),Nu)))}async function Ls(e){return ct(),z.fromString((await Ku()).solveState(ru(e)))}async function On(){return Ls(await Wu())}async function Qu(){(await Ku()).initialize()}async function ju(){return Un(await On(),ld)}async function Vu(){let e=new pt,t=await On();return e.experimentalPushAlg(qu),e.experimentalPushAlg(t),e.experimentalPushAlg(qu),e.toAlg()}var od,ld,qu,As=w(()=>{Le();ur();Mt();qt();Hl();nu();iu();su();od=null;ld=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];qu=new z("R' U' F")});function fe(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,fe}function Hu(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=Ds[r-i],f=~~(t/a);l^=f,t%=a,f<<=2,e[i]=o>>f&7;let s=(1<<f)-1;o=(o&s)+(o>>4&~s)}return n<0&&(l&1)!=0?(e[r]=e[r-1],e[r-1]=o&7):e[r]=o&7,e}var pe,Ds,Yu=w(()=>{pe=[],Ds=[1];for(let e=0;e<32;++e){pe[e]=[];for(let t=0;t<32;++t)pe[e][t]=0}for(let e=0;e<32;++e){pe[e][0]=pe[e][e]=1,Ds[e+1]=Ds[e]*(e+1);for(let t=1;t<e;++t)pe[e][t]=pe[e-1][t-1]+pe[e-1][t]}});var rc={};Be(rc,{initialize:()=>yh,random444Scramble:()=>Rh});function T(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 md(e){return new jo[e]}function mt(e,t,r,...n){let o=jo[e];o&&!o.___clazz$?Y=o.prototype:(!o&&(o=jo[e]=function(){}),Y=o.prototype=t<0?{}:md(t),Y.castableTypeMap$=r);for(let l of n)l.prototype=Y;o.___clazz$&&(Y.___clazz$=o.___clazz$,o.___clazz$=null)}function Rr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function $u(){}function pd(e,t){let r=e1(0,t);return t1(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function e1(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 Fs(e,t,r,n,o){let l=e1(o,n);return t1(e,t,r,l),l}function t1(e,t,r,n){return n1(),dd(n,Bs,bs),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function di(e,t,r){return e[t]=r}function n1(){r1||(r1=!0,Bs=[],bs=[],gd(new $u,Bs,bs))}function gd(e,t,r){let n=0,o;for(let l in e)(o=e[l])&&(t[n]=l,r[n]=o,++n)}function dd(e,t,r){n1();for(let n=0,o=t.length;n<o;++n)e[t[n]]=r[n]}function hd(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function Ld(e,t){return e!==null&&hd(e,t)}function Ad(){if(o1)return!1;o1=!0,yi=T(15582,36),Ri=T(15582),St=T(15582),Qn=T(48,48),vt=T(48,36),Kn=T(48),Ss=T(48)}function ws(e){e.ct=T(24)}function l1(e,t){let r,n;if(Ld(t,Xu)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function hi(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=pe[t][n--]);return r}function Li(e){let t,r;if(Wn!==null)return Wn[hi(e)];for(r=0;r<48;++r){if(t=bd(hi(e)),t!==-1)return t*64+r;ie(e,0),r%2==1&&ie(e,1),r%8==7&&ie(e,2),r%16==15&&ie(e,3)}}function xt(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:y(e.ct,0,1,2,3,r);break;case 1:y(e.ct,16,17,18,19,r);break;case 2:y(e.ct,8,9,10,11,r);break;case 3:y(e.ct,4,5,6,7,r);break;case 4:y(e.ct,20,21,22,23,r);break;case 5:y(e.ct,12,13,14,15,r);break;case 6:y(e.ct,0,1,2,3,r),y(e.ct,8,20,12,16,r),y(e.ct,9,21,13,17,r);break;case 7:y(e.ct,16,17,18,19,r),y(e.ct,1,15,5,9,r),y(e.ct,2,12,6,10,r);break;case 8:y(e.ct,8,9,10,11,r),y(e.ct,2,19,4,21,r),y(e.ct,3,16,5,22,r);break;case 9:y(e.ct,4,5,6,7,r),y(e.ct,10,18,14,22,r),y(e.ct,11,19,15,23,r);break;case 10:y(e.ct,20,21,22,23,r),y(e.ct,0,8,4,14,r),y(e.ct,3,11,7,13,r);break;case 11:y(e.ct,12,13,14,15,r),y(e.ct,1,20,7,18,r),y(e.ct,0,23,6,17,r)}}function ie(e,t){switch(t){case 0:xt(e,19),xt(e,28);break;case 1:xt(e,21),xt(e,32);break;case 2:y(e.ct,0,3,1,2,1),y(e.ct,8,11,9,10,1),y(e.ct,4,7,5,6,1),y(e.ct,12,15,13,14,1),y(e.ct,16,19,21,22,1),y(e.ct,17,18,20,23,1);break;case 3:xt(e,18),xt(e,29),xt(e,24),xt(e,35)}}function i1(e,t){let r;for(r=0;r<t;++r)ie(e,0),r%2==1&&ie(e,1),r%8==7&&ie(e,2),r%16==15&&ie(e,3)}function xs(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=pe[r][n]&&(t-=pe[r][n--],e.ct[r]=1)}function Ai(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function qo(){let e;for(ws(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function Di(e,t){let r;for(ws(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function Vo(e){let t;for(ws(this),t=0;t<24;++t)this.ct[t]=e[t]}function Dd(){let e,t,r=new qo,n=new qo;for(e=0;e<15582;++e)for(xs(n,Ri[e]),t=0;t<36;++t)Ai(r,n),xt(r,t),yi[e][t]=Li(r)}function yd(){let e,t,r,n,o,l,i,a;for(Ii(St),St[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(St[n]===a){for(i=0;i<27;++i)if(o=~~yi[n][i]>>>6,St[o]===e)if(++r,l){St[n]=t;break}else St[o]=t}}function Rd(e){let t,r,n,o=new Vo(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;ie(o,0),n%2==1&&ie(o,1),n%8==7&&ie(o,2),n%16==15&&ie(o,3)}return-1}function Fd(){let e,t,r,n=new qo;for(e=0;e<24;++e)n.ct[e]=e;let o=new Vo(n.ct),l=new Vo(n.ct),i=new Vo(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)l1(n,o)&&(Qn[e][t]=r,r===0&&(Kn[e]=t)),ie(o,0),r%2==1&&ie(o,1),r%8==7&&ie(o,2),r%16==15&&ie(o,3);ie(n,0),t%2==1&&ie(n,1),t%8==7&&ie(n,2),t%16==15&&ie(n,3)}ie(n,0),e%2==1&&ie(n,1),e%8==7&&ie(n,2),e%16==15&&ie(n,3)}for(e=0;e<48;++e)for(Ai(n,l),i1(n,Kn[e]),t=0;t<36;++t)for(Ai(o,n),xt(o,t),i1(o,e),r=0;r<36;++r)if(Ai(i,l),xt(i,r),l1(i,o)){vt[e][t]=r;break}for(xs(n,0),e=0;e<48;++e)Ss[Kn[e]]=hi(n),ie(n,0),e%2==1&&ie(n,1),e%8==7&&ie(n,2),e%16==15&&ie(n,3)}function Bd(){let e,t,r,n,o=new qo,l=T(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(xs(o,t),n=0;n<48;++n)r=hi(o),l[~~r>>>5]|=1<<(r&31),Wn!==null&&(Wn[r]=e<<6|Kn[n]),ie(o,0),n%2==1&&ie(o,1),n%8==7&&ie(o,2),n%16==15&&ie(o,3);Ri[e++]=t}}function bd(e){let t=ch(Ri,e);return t>=0?t:-1}function wd(){a1||(a1=!0,wi=T(70,28),bi=T(6435,28),p1=T(70,16),c1=T(6435,16),tt=T(450450),m1=[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 Fi(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=pe[t][n--]);return r}function Bi(e){let t,r,n;for(r=0,n=4,t=6;t>=0;--t)e.rl[t]!==e.rl[7]&&(r+=pe[t][n--]);return r*2+e.parity}function jn(e,t){e.parity^=m1[t];let r=t%3;switch(t=~~(t/3),t){case 0:y(e.ct,0,1,2,3,r);break;case 1:y(e.rl,0,1,2,3,r);break;case 2:y(e.ct,8,9,10,11,r);break;case 3:y(e.ct,4,5,6,7,r);break;case 4:y(e.rl,4,5,6,7,r);break;case 5:y(e.ct,12,13,14,15,r);break;case 6:y(e.ct,0,1,2,3,r),y(e.rl,0,5,4,1,r),y(e.ct,8,9,12,13,r);break;case 7:y(e.rl,0,1,2,3,r),y(e.ct,1,15,5,9,r),y(e.ct,2,12,6,10,r);break;case 8:y(e.ct,8,9,10,11,r),y(e.rl,0,3,6,5,r),y(e.ct,3,2,5,4,r);break;case 9:y(e.ct,4,5,6,7,r),y(e.rl,3,2,7,6,r),y(e.ct,11,10,15,14,r);break;case 10:y(e.rl,4,5,6,7,r),y(e.ct,0,8,4,14,r),y(e.ct,3,11,7,13,r);break;case 11:y(e.ct,12,13,14,15,r),y(e.rl,1,4,7,2,r),y(e.ct,1,0,7,6,r)}}function qn(e,t){switch(t){case 0:jn(e,19),jn(e,28);break;case 1:jn(e,21),jn(e,32);break;case 2:y(e.ct,0,3,1,2,1),y(e.ct,8,11,9,10,1),y(e.ct,4,7,5,6,1),y(e.ct,12,15,13,14,1),y(e.rl,0,3,5,6,1),y(e.rl,1,2,4,7,1)}}function s1(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 f1(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=pe[r][n]?(t-=pe[r][n--],e.ct[r]=1):e.ct[r]=0}function u1(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=pe[r][n]?(t-=pe[r][n--],e.rl[r]=1):e.rl[r]=0}function vs(){this.rl=T(8),this.ct=T(16)}function xd(){let e,t,r,n,o,l,i,a,f,s,c=new vs;for(o=0;o<70;++o)for(a=0;a<28;++a)u1(c,o),jn(c,Xr[a]),wi[o][a]=Bi(c);for(o=0;o<70;++o)for(u1(c,o),i=0;i<16;++i)p1[o][i]=Bi(c),qn(c,0),i%2==1&&qn(c,1),i%8==7&&qn(c,2);for(o=0;o<6435;++o)for(f1(c,o),i=0;i<16;++i)c1[o][i]=Fi(c)&65535,qn(c,0),i%2==1&&qn(c,1),i%8==7&&qn(c,2);for(o=0;o<6435;++o)for(a=0;a<28;++a)f1(c,o),jn(c,Xr[a]),bi[o][a]=Fi(c)&65535;for(Ii(tt),tt[0]=tt[18]=tt[28]=tt[46]=tt[54]=tt[56]=0,r=0,n=6;n!==450450;){let m=r>6,u=m?-1:r,p=m?r:-1;for(++r,o=0;o<450450;++o)if(tt[o]===u){for(e=~~(o/70),f=o%70,a=0;a<23;++a)if(t=bi[e][a],s=wi[f][a],l=t*70+s,tt[l]===p)if(++n,m){tt[o]=r;break}else tt[l]=r}}}function Sd(){g1||(g1=!0,Ho=T(29400,20),h1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],Fr=T(29400),ks=[0,9,14,23,27,28,41,42,46,55,60,69],zs=T(70))}function Us(e){let t,r,n,o;for(r=0,o=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=pe[t][o--]);for(r*=35,o=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=pe[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+=pe[t][o--]);return e.parity+2*(r+zs[n])}function vd(e,t){switch(e.parity^=h1[t],t){case 0:case 1:case 2:y(e.ud,0,1,2,3,t%3);break;case 3:y(e.rl,0,1,2,3,1);break;case 4:case 5:case 6:y(e.fb,0,1,2,3,(t-1)%3);break;case 7:case 8:case 9:y(e.ud,4,5,6,7,(t-1)%3);break;case 10:y(e.rl,4,5,6,7,1);break;case 11:case 12:case 13:y(e.fb,4,5,6,7,(t+1)%3);break;case 14:y(e.ud,0,1,2,3,1),y(e.rl,0,5,4,1,1),y(e.fb,0,5,4,1,1);break;case 15:y(e.rl,0,1,2,3,1),y(e.fb,1,4,7,2,1),y(e.ud,1,6,5,2,1);break;case 16:y(e.fb,0,1,2,3,1),y(e.ud,3,2,5,4,1),y(e.rl,0,3,6,5,1);break;case 17:y(e.ud,4,5,6,7,1),y(e.rl,3,2,7,6,1),y(e.fb,3,2,7,6,1);break;case 18:y(e.rl,4,5,6,7,1),y(e.fb,0,3,6,5,1),y(e.ud,0,3,4,7,1);break;case 19:y(e.fb,4,5,6,7,1),y(e.ud,0,7,6,1,1),y(e.rl,1,4,7,2,1)}}function d1(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 Ud(e,t){let r,n,o,l;for(e.parity=t&1,t>>>=1,o=ks[t%12],t=~~(t/12),l=4,r=7;r>=0;--r)e.rl[r]=0,o>=pe[r][l]&&(o-=pe[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>=pe[r][l]?(n-=pe[r][l--],e.fb[r]=1):e.fb[r]=0;for(l=4,e.ud[7]=0,r=6;r>=0;--r)t>=pe[r][l]?(t-=pe[r][l--],e.ud[r]=1):e.ud[r]=0}function Es(){this.ud=T(8),this.rl=T(8),this.fb=T(8)}function Ed(){let e,t,r,n;for(r=0;r<12;++r)zs[ks[r]]=r;let o=new Es;for(r=0;r<29400;++r)for(n=0;n<20;++n)Ud(o,r),vd(o,n),Ho[r][n]=Us(o)&65535;for(Ii(Fr),Fr[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(Fr[r]===e)for(n=0;n<17;++n)Fr[Ho[r][n]]===-1&&(Fr[Ho[r][n]]=e+1,++t);++e}}function kd(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function zd(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:y(e.ct,0,1,2,3,r);break;case 1:y(e.ct,16,17,18,19,r);break;case 2:y(e.ct,8,9,10,11,r);break;case 3:y(e.ct,4,5,6,7,r);break;case 4:y(e.ct,20,21,22,23,r);break;case 5:y(e.ct,12,13,14,15,r);break;case 6:y(e.ct,0,1,2,3,r),y(e.ct,8,20,12,16,r),y(e.ct,9,21,13,17,r);break;case 7:y(e.ct,16,17,18,19,r),y(e.ct,1,15,5,9,r),y(e.ct,2,12,6,10,r);break;case 8:y(e.ct,8,9,10,11,r),y(e.ct,2,19,4,21,r),y(e.ct,3,16,5,22,r);break;case 9:y(e.ct,4,5,6,7,r),y(e.ct,10,18,14,22,r),y(e.ct,11,19,15,23,r);break;case 10:y(e.ct,20,21,22,23,r),y(e.ct,0,8,4,14,r),y(e.ct,3,11,7,13,r);break;case 11:y(e.ct,12,13,14,15,r),y(e.ct,1,20,7,18,r),y(e.ct,0,23,6,17,r)}}function _s(){let e;for(this.ct=T(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function L1(e){let t,r,n;for(_s.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 _d(){A1||(A1=!0,Lt=T(18),Md())}function D1(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function y1(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function Cd(e,t){!e.temps&&(e.temps=new xi),R1(e,Lt[t],e.temps),y1(e,e.temps)}function Pd(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 R1(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 xi(){D1(this)}function Br(e,t){D1(this),Hu(this.cp,e),Pd(this,t)}function F1(e){Br.call(this,e(40320),e(2187))}function Md(){let e,t;for(Lt[0]=new Br(15120,0),Lt[3]=new Br(21021,1494),Lt[6]=new Br(8064,1236),Lt[9]=new Br(9,0),Lt[12]=new Br(1230,412),Lt[15]=new Br(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)Lt[e+t+1]=new xi,R1(Lt[e+t],Lt[e],Lt[e+t+1])}function Gd(){B1||(B1=!0,Ut=T(1937880),Ei=T(1538),ki=T(1538),Xn=T(11880),U1=[0,1,6,3,4,5,2,7],Gs=T(160,12),Ts=T(160,12),Ms=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],Ps=[0,2,4,6,1,3,7,5,8,9,10,11])}function Vn(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 Hn(e,t){let r,n,o,l,i;for(e.isStd||S1(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 b1(e){let t,r=Hn(e,4);t=Xn[r];let n=t&7;t>>=3,vi(e,n);let o=Hn(e,10)%20160;return t*20160+o}function Si(e,t){switch(e.isStd=!1,t){case 0:fe(e.edge,0,4,1,5),fe(e.edgeo,0,4,1,5);break;case 1:he(e.edge,0,4,1,5),he(e.edgeo,0,4,1,5);break;case 2:fe(e.edge,0,5,1,4),fe(e.edgeo,0,5,1,4);break;case 3:he(e.edge,5,10,6,11),he(e.edgeo,5,10,6,11);break;case 4:fe(e.edge,0,11,3,8),fe(e.edgeo,0,11,3,8);break;case 5:he(e.edge,0,11,3,8),he(e.edgeo,0,11,3,8);break;case 6:fe(e.edge,0,8,3,11),fe(e.edgeo,0,8,3,11);break;case 7:fe(e.edge,2,7,3,6),fe(e.edgeo,2,7,3,6);break;case 8:he(e.edge,2,7,3,6),he(e.edgeo,2,7,3,6);break;case 9:fe(e.edge,2,6,3,7),fe(e.edgeo,2,6,3,7);break;case 10:he(e.edge,4,8,7,9),he(e.edgeo,4,8,7,9);break;case 11:fe(e.edge,1,9,2,10),fe(e.edgeo,1,9,2,10);break;case 12:he(e.edge,1,9,2,10),he(e.edgeo,1,9,2,10);break;case 13:fe(e.edge,1,10,2,9),fe(e.edgeo,1,10,2,9);break;case 14:he(e.edge,0,4,1,5),he(e.edgeo,0,4,1,5),fe(e.edge,9,11),fe(e.edgeo,8,10);break;case 15:he(e.edge,5,10,6,11),he(e.edgeo,5,10,6,11),fe(e.edge,1,3),fe(e.edgeo,0,2);break;case 16:he(e.edge,0,11,3,8),he(e.edgeo,0,11,3,8),fe(e.edge,5,7),fe(e.edgeo,4,6);break;case 17:he(e.edge,2,7,3,6),he(e.edgeo,2,7,3,6),fe(e.edge,8,10),fe(e.edgeo,9,11);break;case 18:he(e.edge,4,8,7,9),he(e.edgeo,4,8,7,9),fe(e.edge,0,2),fe(e.edgeo,1,3);break;case 19:he(e.edge,1,9,2,10),he(e.edgeo,1,9,2,10),fe(e.edge,4,6),fe(e.edgeo,5,7)}}function Yn(e,t){switch(e.isStd=!1,t){case 0:Si(e,14),Si(e,17);break;case 1:Vn(e,11,5,10,6),Vn(e,5,10,6,11),Vn(e,1,2,3,0),Vn(e,4,9,7,8),Vn(e,8,4,9,7),Vn(e,0,1,2,3);break;case 2:At(e,4,5),At(e,5,4),At(e,11,8),At(e,8,11),At(e,7,6),At(e,6,7),At(e,9,10),At(e,10,9),At(e,1,1),At(e,0,0),At(e,3,3),At(e,2,2)}}function vi(e,t){for(;t>=2;)t-=2,Yn(e,1),Yn(e,2);t!==0&&Yn(e,0)}function Yo(e,t){let r,n,o,l,i,a;for(i=1985229328,a=47768,o=0,r=0;r<11;++r)if(n=Ms[11-r],l=~~(t/n),t=t%n,o^=l,l<<=2,l>=32){l=l-32,e.edge[r]=a>>l&15;let f=(1<<l)-1;a=(a&f)+(a>>4&~f)}else{e.edge[r]=i>>l&15;let f=(1<<l)-1;i=(i&f)+(i>>>4&~f)+(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 w1(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 x1(e,t){let r,n,o,l;for(e.temp===null&&(e.temp=T(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[Ps[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[Ps[r]]%12];return n}function S1(e){let t;for(e.temp===null&&(e.temp=T(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 he(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 At(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function $t(){this.edge=T(12),this.edgeo=T(12)}function Td(){let e,t,r,n,o,l,i,a,f,s,c,m,u,p,g,d,L,D,F,B,k,E,Q=new $t,$=new $t,G=new $t;for(Ii(Ut),a=0,Ui=1,Cs(Ut,0,0);Ui!==31006080&&(g=a>9,i=a%3,l=(a+1)%3,s=g?3:i,e=g?i:3,!(a>=9));){for(m=0;m<31006080;m+=16)if(E=Ut[~~m>>4],!(!g&&E===-1)){for(c=m,f=m+16;c<f;++c,E>>=2)if((E&3)===s){for(F=~~(c/20160),t=Ei[F],n=c%20160,Yo(Q,t*20160+n),L=0;L<17;++L)if(r=Zn(Q.edge,L<<3,4),B=Xn[r],k=B&7,B>>=3,o=Zn(Q.edge,L<<3|k,10)%20160,u=B*20160+o,Zo(Ut,u)===e){if(Cs(Ut,g?c:u,l),++Ui,g)break;if(D=ki[B],D!==1)for(w1($,Q),Si($,L),vi($,k),d=1;(D=~~D>>1&65535)!=0;++d)(D&1)==1&&(w1(G,$),vi(G,d),p=B*20160+Hn(G,10)%20160,Zo(Ut,p)===e&&(Cs(Ut,p,l),++Ui))}}}++a}}function Zo(e,t){return e[t>>4]>>((t&15)<<1)&3}function Zn(e,t,r){let n,o,l,i,a,f=Ts[t],s=Gs[t];for(o=0,a=1985229328,i=47768,n=0;n<r;++n)l=f[e[s[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 v1(e){let t,r,n,o,l,i,a,f,s,c,m,u=new $t;if(i=0,l=Zo(Ut,e),l===3)return 10;for(;e!==0;)for(l===0?l=2:--l,s=~~(e/20160),t=Ei[s],n=e%20160,Yo(u,t*20160+n),f=0;f<17;++f)if(r=Zn(u.edge,f<<3,4),c=Xn[r],m=c&7,c>>=3,o=Zn(u.edge,f<<3|m,10)%20160,a=c*20160+o,Zo(Ut,a)===l){++i,e=a;break}return i}function Id(e,t){let r=Zo(Ut,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function Nd(){let e,t,r,n=new $t;for(t=0;t<20;++t)for(r=0;r<8;++r){for(Yo(n,0),Si(n,t),vi(n,r),e=0;e<12;++e)Gs[t<<3|r][e]=n.edge[e];for(S1(n),e=0;e<12;++e)Ts[t<<3|r][e]=n.temp[e]}}function Od(){let e,t,r,n,o=new $t,l=T(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(Yo(o,t*Ms[8]),n=0;n<8;++n)r=Hn(o,4),r===t&&(ki[e]=(ki[e]|1<<n)&65535),l[~~r>>3]=l[~~r>>3]|1<<(r&7),Xn[r]=e<<3|U1[n],Yn(o,0),n%2==1&&(Yn(o,1),Yn(o,2));Ei[e++]=t}}function Cs(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function Wd(){E1||(E1=!0)}function Kd(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 Qd(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function jd(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:y(e.ep,0,1,2,3,r),y(e.ep,12,13,14,15,r);break;case 1:y(e.ep,11,15,10,19,r),y(e.ep,23,3,22,7,r);break;case 2:y(e.ep,0,11,6,8,r),y(e.ep,12,23,18,20,r);break;case 3:y(e.ep,4,5,6,7,r),y(e.ep,16,17,18,19,r);break;case 4:y(e.ep,1,20,5,21,r),y(e.ep,13,8,17,9,r);break;case 5:y(e.ep,2,9,4,10,r),y(e.ep,14,21,16,22,r);break;case 6:y(e.ep,0,1,2,3,r),y(e.ep,12,13,14,15,r),y(e.ep,9,22,11,20,r);break;case 7:y(e.ep,11,15,10,19,r),y(e.ep,23,3,22,7,r),y(e.ep,2,16,6,12,r);break;case 8:y(e.ep,0,11,6,8,r),y(e.ep,12,23,18,20,r),y(e.ep,3,19,5,13,r);break;case 9:y(e.ep,4,5,6,7,r),y(e.ep,16,17,18,19,r),y(e.ep,8,23,10,21,r);break;case 10:y(e.ep,1,20,5,21,r),y(e.ep,13,8,17,9,r),y(e.ep,14,0,18,4,r);break;case 11:y(e.ep,2,9,4,10,r),y(e.ep,14,21,16,22,r),y(e.ep,7,15,1,17,r)}}function Is(){let e;for(this.ep=T(24),e=0;e<24;++e)this.ep[e]=e}function k1(e){let t,r,n;for(Is.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 qd(){z1||(z1=!0,Ns=[35,1,34,2,4,6,22,5,19])}function _1(e){e.moveBuffer=T(60)}function Vd(e,t){return e.value-t.value}function Jn(e,t){let r;for(Qd(e.edge,t.edge),kd(e.center,t.center),y1(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 br(e){for(;e.centerAvail<e.moveLength;)zd(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function C1(e){for(;e.cornerAvail<e.moveLength;)Cd(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function Xo(e){for(;e.edgeAvail<e.moveLength;)jd(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function Hd(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)vt[i][e.moveBuffer[t]]>=27?(a[r++]=vt[i][e.moveBuffer[t]]-9,o=Ns[vt[i][e.moveBuffer[t]]-27],i=Qn[i][o]):a[r++]=vt[i][e.moveBuffer[t]];let f=Qn[Kn[i]][Rd(br(e))];for(l="",i=f,t=r-1;t>=0;--t)n=a[t],n=~~(n/3)*3+(2-n%3),vt[i][n]>=27?(l=l+Os[vt[i][n]-9]+" ",o=Ns[vt[i][n]-27],i=Qn[i][o]):l=l+Os[vt[i][n]]+" ";return l}function Zr(e,t){e.moveBuffer[e.moveLength++]=t}function zi(){_1(this),this.edge=new Is,this.center=new _s,this.corner=new xi}function _i(e){zi.call(this),Jn(this,e)}function P1(e){_1(this),this.edge=new k1(e),this.center=new L1(e),this.corner=new F1(e)}function Yd(e,t){return t.value-e.value}function Ci(e,t){return Yd(e,t)}function M1(){}function Zd(){if(G1)return;G1=!0;let e,t;for(Os=["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'"],Xr=[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],Jo=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],T1=T(37),I1=T(37),$n=T(37,36),Pi=T(29,28),Mi=T(21,20),Ws=T(36),$o=T(28),eo=T(20),e=0;e<29;++e)T1[Xr[e]]=e;for(e=0;e<21;++e)I1[Jo[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)$n[e][t]=~~(e/3)==~~(t/3)||~~(e/3)%3==~~(t/3)%3&&e>t;$n[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)Pi[e][t]=$n[Xr[e]][Xr[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)Mi[e][t]=$n[Jo[e]][Jo[t]];for(e=0;e<36;++e)for(Ws[e]=36,t=e;t<36;++t)if(!$n[e][t]){Ws[e]=t-1;break}for(e=0;e<28;++e)for($o[e]=28,t=e;t<28;++t)if(!Pi[e][t]){$o[e]=t-1;break}for(e=0;e<20;++e)for(eo[e]=20,t=e;t<20;++t)if(!Mi[e][t]){eo[e]=t-1;break}}function Xd(e){let t,r,n,o,l,i,a,f,s,c,m,u;e.solution="";let p=Li(new Di(br(e.c),0)),g=Li(new Di(br(e.c),1)),d=Li(new Di(br(e.c),2)),L=St[~~p>>6],D=St[~~g>>6],F=St[~~d>>6];for(e.p1SolsCnt=0,e.arr2idx=0,ih(e.p1sols.heap),e.length1=(L<D?L:D)<F?L<D?L:D:F;e.length1<100&&!(F<=e.length1&&Gi(e,~~d>>>6,d&63,e.length1,-1,0)||L<=e.length1&&Gi(e,~~p>>>6,p&63,e.length1,-1,0)||D<=e.length1&&Gi(e,~~g>>>6,g&63,e.length1,-1,0));++e.length1);let B=Lh(e.p1sols,Fs(Dh,Rr([fd,ys,Rs]),Ju,0,0));B.sort(function(Q,$){return Q.value-$.value}),t=9;do{e:for(f=B[0].value;f<100;++f)for(i=0;i<B.length&&!(B[i].value>f);++i)if(!(f-B[i].length1>t)&&(Jn(e.c1,B[i]),s1(e.ct2,br(e.c1),Ti(Xo(e.c1).ep)),m=Fi(e.ct2),u=Bi(e.ct2),e.length1=B[i].length1,e.length2=f-B[i].length1,N1(e,m,u,e.length2,28,0)))break e;++t}while(f===100);e.arr2.sort(function(Q,$){return Q.value-$.value}),a=0,r=13;do{e:for(s=e.arr2[0].value;s<100;++s)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>s);++i)if(!(s-e.arr2[i].length1-e.arr2[i].length2>r)&&(l=x1(e.e12,Xo(e.arr2[i])),d1(e.ct3,br(e.arr2[i]),l^Ti(C1(e.arr2[i]).cp)),n=Us(e.ct3),o=Hn(e.e12,10),c=v1(b1(e.e12)),c<=s-e.arr2[i].length1-e.arr2[i].length2&&O1(e,o,n,c,s-e.arr2[i].length1-e.arr2[i].length2,20,0))){a=i;break e}++r}while(s===100);let k=new _i(e.arr2[a]);e.length1=k.length1,e.length2=k.length2;let E=s-e.length1-e.length2;for(i=0;i<E;++i)Zr(k,Jo[e.move3[i]]);e.solution=Hd(k)}function Jd(e,t){let r,n;for(Jn(e.c1,e.c),r=0;r<e.length1;++r)Zr(e.c1,e.move1[r]);switch(Ss[t]){case 0:Zr(e.c1,24),Zr(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break;case 12869:Zr(e.c1,18),Zr(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}s1(e.ct2,br(e.c1),Ti(Xo(e.c1).ep));let o=Fi(e.ct2),l=Bi(e.ct2),i=tt[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 _i(e.c1):(n=dh(e.p1sols),n.value>e.c1.value&&Jn(n,e.c1)),nh(e.p1sols,n),e.p1SolsCnt===1e4}function $d(e){let t;for(Jn(e.c2,e.c1),t=0;t<e.length2;++t)Zr(e.c2,e.move2[t]);if(!Kd(Xo(e.c2)))return!1;let r=x1(e.e12,Xo(e.c2));d1(e.ct3,br(e.c2),r^Ti(C1(e.c2).cp));let n=Us(e.ct3);Hn(e.e12,10);let o=v1(b1(e.e12));return e.arr2[e.arr2idx]?Jn(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new _i(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(o,Fr[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function eh(e,t){return K1(),e.c=new P1(t),Xd(e),e.solution}function Gi(e,t,r,n,o,l){let i,a,f,s,c,m;if(t===0)return n===0&&Jd(e,r);for(i=0;i<27;i+=3)if(!(i===o||i===o-9||i===o-18))for(s=0;s<3;++s){if(f=i+s,a=yi[t][vt[r][f]],c=St[~~a>>>6],c>=n){if(c>n)break;continue}if(m=Qn[r][a&63],a>>>=6,e.move1[l]=f,Gi(e,a,m,n-1,i,l+1))return!0}return!1}function N1(e,t,r,n,o,l){let i,a,f,s;if(t===0&&tt[r]===0)return n===0&&$d(e);for(a=0;a<23;++a){if(Pi[o][a]){a=$o[a];continue}if(i=bi[t][a],s=wi[r][a],f=tt[i*70+s],f>=n){f>n&&(a=$o[a]);continue}if(e.move2[l]=Xr[a],N1(e,i,s,n-1,a,l+1))return!0}return!1}function O1(e,t,r,n,o,l,i){let a,f,s,c,m,u,p,g,d;if(o===0)return t===0&&r===0;for(Yo(e.tempe[i],t),m=0;m<17;++m){if(Mi[l][m]){m=eo[m];continue}if(s=Ho[r][m],u=Fr[s],u>=o){u>o&&m<14&&(m=eo[m]);continue}if(c=Zn(e.tempe[i].edge,m<<3,10),a=~~(c/20160),g=Xn[a],d=g&7,g>>=3,f=Zn(e.tempe[i].edge,m<<3|d,10)%20160,p=Id(g*20160+f,n),p>=o){p>o&&m<14&&(m=eo[m]);continue}if(O1(e,c,s,p,o-1,m,i+1))return e.move3[i]=m,!0}return!1}function W1(){let e;for(this.p1sols=new X1(new M1),this.move1=T(15),this.move2=T(20),this.move3=T(20),this.c1=new zi,this.c2=new zi,this.ct2=new vs,this.ct3=new Es,this.e12=new $t,this.tempe=T(20),this.arr2=T(100),e=0;e<20;++e)this.tempe[e]=new $t}function K1(){Q1||(Fd(),Wn=T(735471),Bd(),Dd(),Wn=null,yd(),xd(),Ed(),Nd(),Od(),Td(),Q1=!0)}function th(){j1||(j1=!0)}function Ti(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 y(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 q1(){}function V1(e,t,r,n){let o=new q1;return o.typeName=e+t,Y1(r!==0?-r:0)&&Z1(r!==0?-r:0,o),o.modifiers=4,o.superclass=Ks,o.componentType=n,o}function H1(e,t,r,n){let o=new q1;return o.typeName=e+t,Y1(r)&&Z1(r,o),o.superclass=n,o}function rh(e){let t=jo[e.seedId];return e=null,t}function Y1(e){return typeof e=="number"&&e>0}function Z1(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=rh(t);if(n)r=n.prototype;else{n=jo[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function nh(e,t){if(gh(e,t))return!0}function oh(e){e.array=Fs(J1,Rr([ys,Rs]),Zu,0,0)}function lh(e,t){return di(e.array,e.size++,t),!0}function ih(e){e.array=Fs(J1,Rr([ys,Rs]),Zu,0,0),e.size=0}function wr(e,t){return e.array[t]}function ah(e,t){let r=e.array[t];return uh(e.array,t,1),--e.size,r}function to(e,t,r){let n=e.array[t];return di(e.array,t,r),n}function sh(e,t){let r;for(t.length<e.size&&(t=pd(t,e.size)),r=0;r<e.size;++r)di(t,r,e.array[r]);return t.length>e.size&&di(t,e.size,null),t}function fh(){oh(this),this.array.length=500}function uh(e,t,r){e.splice(t,r)}function ch(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 Ii(e){mh(e,e.length)}function mh(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function ph(e,t){let r,n,o,l,i=e.heap.size,a=wr(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,o=n+1,l=n,o<i&&Ci(wr(e.heap,o),wr(e.heap,n))<0&&(l=o),l),!(Ci(a,wr(e.heap,r))<0));)to(e.heap,t,wr(e.heap,r)),t=r;to(e.heap,t,a)}function gh(e,t){let r,n;for(n=e.heap.size,lh(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),Ci(wr(e.heap,n),t)<=0)return to(e.heap,r,t),!0;to(e.heap,r,wr(e.heap,n))}return to(e.heap,n,t),!0}function dh(e){if(e.heap.size===0)return null;let t=wr(e.heap,0);return hh(e),t}function hh(e){let t=ah(e.heap,e.heap.size-1);0<e.heap.size&&(to(e.heap,0,t),ph(e,0))}function Lh(e,t){return sh(e.heap,t)}function X1(e){this.heap=new fh,this.cmp=e}function tc(){ec||(ec=!0,Zd(),th(),Ad(),wd(),Sd(),Gd(),_d(),Wd(),qd(),$1=new W1)}function yh(){tc(),K1()}async function Rh(){ct(),tc();let e=z.fromString(eh($1,await Qe()));return(await On()).concat(e)}var Y,jo,id,Zu,ys,Xu,ad,sd,Ju,fd,ud,cd,Rs,r1,Bs,bs,o1,St,yi,Ss,Wn,Ri,Kn,vt,Qn,a1,bi,tt,c1,m1,wi,p1,g1,Ho,h1,Fr,ks,zs,A1,Lt,B1,Ps,Ui,Ut,Ms,Gs,Ts,Xn,Ei,U1,ki,E1,z1,Ns,G1,$n,Pi,Mi,Xr,Os,Jo,Ws,$o,eo,T1,I1,Q1,j1,Ks,J1,Ah,Dh,$1,ec,nc=w(()=>{Le();As();Yu();Mt();qt();jo={},id={},Zu=0,ys=30,Xu=21,ad=22,sd=23,Ju=24,fd=25,ud=34,cd=26,Rs=40;mt(1,-1,id);Y.value=null;mt(73,1,{},$u);Y.queryId$=0;r1=!1;o1=!1;mt(153,1,Rr([Xu]),qo,Di,Vo);Wn=null,a1=!1;mt(154,1,{},vs);Y.parity=0;g1=!1;mt(155,1,{},Es);Y.parity=0;mt(156,1,{},_s,L1);A1=!1;mt(157,1,Rr([ad]),xi,Br,F1);Y.temps=null;B1=!1;mt(158,1,Rr([sd]),$t);Y.isStd=!0;Y.temp=null;Ui=0,E1=!1;mt(159,1,{},Is,k1);z1=!1;mt(160,1,Rr([Ju,ud]),zi,_i,P1);Y.compareTo$=function(t){return Vd(this,t)};Y.add1=!1;Y.center=null;Y.centerAvail=0;Y.corner=null;Y.cornerAvail=0;Y.edge=null;Y.edgeAvail=0;Y.length1=0;Y.length2=0;Y.length3=0;Y.moveLength=0;Y.sym=0;Y.value=0;mt(161,1,{},M1);Y.compare=function(t,r){return Ci(t,r)};G1=!1;mt(163,1,Rr([cd]),W1);Y.add1=!1;Y.arr2idx=0;Y.c=null;Y.length1=0;Y.length2=0;Y.p1SolsCnt=0;Y.solution="";Q1=!1,j1=!1;Y.val$outerIter=null;Y.size=0;mt(239,1,{},X1);Y.cmp=null;Y.heap=null;Ks=H1("java.lang.","Object",1,null),J1=V1("[Ljava.lang.","Object;",356,Ks),Ah=H1("cs.threephase.","FullCube",160,Ks),Dh=V1("[Lcs.threephase.","FullCube;",381,Ah),ec=!1});var Ic={};Be(Ic,{randomFTOScrambleString:()=>RL});function el(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Ni(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 fc(e,t,r,n,o=e-t-r-n){return Ni(e,t+r)*Ni(t+r,t)*Ni(n+o,n)}function vh(e){e=e.slice();let t=e.length,r=el(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 Uh(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 js(e,t){let r=[],n=el(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 Jr(e){return vh(e)>>1}function qs(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 uc(e,t){let r=qs(e,t);return Uh(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function Eh(e){return e|=0,31-Math.clz32(e^e-1)}function cc(e,t){e|=0,t|=0;let r=e+" "+t;if(Vs[r])return Vs[r];let n=Ni(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 f=a|a-1;a=f+1|(~f&-~f)-1>>Eh(a)+1}return Vs[r]=[o,l]}function kh(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function mc(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 zh(e,t){return mc(e)|mc(t)<<1}function ro(e,t,r,n,o){if(e|=0,t|=0,r|=0,n|=0,o|=0,e!==t+r+n+o)throw"generate_comb4_lookup_tables: invalid parameters";let l=[e,t,r,n,o].join(" ");if(Hs[l])return Hs[l];let[i,a]=cc(e,r+o),[f,s]=cc(e,n+o),c=fc(e,t,r,n,o),m=new Uint32Array(c),u=new Uint32Array(4**e).fill(-1);for(let p=0,g=0;p<f.length;p++){let d=f[p];for(let L=0;L<i.length;L++){let D=i[L];if(kh(D&d)===o){let F=zh(D,d);m[g]=F,u[F]=g,g++}}}return Hs[l]=[m,u]}function He(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function no(e,t,r){let n=[];for(let o=0;o<r.length;o++)n[o]=e[t[r[o]]];return n}function Ys(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 $r(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 Zs(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function _h(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function Ch(e,t){return e*t/_h(e,t)}function Ph(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=Ch(t,l)}return t}function Kh(e,t){for(let r=0;r<6;r++){if(e===Et[xr[r][0]]&&t===Et[xr[r][2]])return[r,0];if(e===Et[xr[r][2]]&&t===Et[xr[r][0]])return[r,1]}throw"unknown corner piece"}function Qh(e,t){for(let r=0;r<12;r++)if(e===Et[Sr[r][0]]&&t===Et[Sr[r][1]]||t===Et[Sr[r][0]]&&e===Et[Sr[r][1]])return r;throw"unknown edge piece"}function Xs(e,t){return Kh(e[xr[t][0]],e[xr[t][2]])}function Ki(e,t){return Qh(e[Sr[t][0]],e[Sr[t][1]])}function jh(e,t,r,n){let o=xr[t],l=xr[r].map(i=>Et[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 qh(e,t,r){let n=Sr[t],o=Sr[r].map(l=>Et[l]);for(let l=0;l<2;l++)e[n[l]]=o[l]}function dc(e){let t=e.map(f=>Et[f]),n=Array(6).fill().map((f,s)=>Xs(t,s)).map(([f,s])=>f+6*s),o=n.concat(n.map(f=>(f+6)%12)),l=Array(12).fill().map((f,s)=>Ki(t,s)),i=Array(12).fill().map((f,s)=>en.indexOf(e[en[s]])),a=Array(12).fill().map((f,s)=>oo.indexOf(e[oo[s]]));return{cp:o,ep:l,ap:i,bp:a}}function Hh(e){let t=Array(72),r=uc(5,e);r.push(5);let n=Array(4).fill().map(a=>e(2));n.push(n.reduce((a,f)=>a^f)),n.push(0);for(let a=0;a<6;a++)jh(t,a,r[a],n[a]);let o=uc(12,e);for(let a=0;a<12;a++)qh(t,a,o[a]);let l=qs(12,e).map(a=>a/3|0),i=qs(12,e).map(a=>4+(a/3|0));for(let a=0;a<12;a++)t[en[a]]=l[a],t[oo[a]]=i[a];return t}function Lc(e,t=!1){if(t){let l=0,i=1,a=2,f=3,s=4,c=5,m=6,u=7;e=e.map(d=>d.slice());let p=[l,i,a,f,s,c,m,u],g=[[l,f,c,m,s,u,i,a],[u,i,l,m,f,c,s,a],[u,s,a,i,f,l,m,c],[a,s,c,f,m,l,i,u]];g=g.concat(g.map(d=>Zs(d)));for(let d=0;d<e.length;d++)if(e[d][0]<4)e[d][0]=p[e[d][0]];else{let L=p[e[d][0]],D=e[d][1];e[d][0]=L,p=He(D===1?g[L^4]:g[L],p)}}let r=t?"U L F R D BR B BL".split(" "):Vh,n=["0","","'"];return e.map(([l,i])=>r[l]+n[i]).join(" ")}function vr(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=He(e,hc[r]);return e}function Ac(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function Qi(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 Yh(e){return Lc(Ac(Jh(Hh(e),!0)),!0)}function lo(e,t,r,n,o,l){let i=fc(e,t,r,n,o),a=l.length,[f,s]=ro(e,t,r,n,o),c=Array(a).fill().map(()=>new Uint32Array(i));for(let m=0;m<i;m++){let u=f[m],p=Array(e);for(let g=0;g<e;g++)p[g]=u>>2*g&3;for(let g=0;g<a;g++){let L=He(p,l[g]).reduce((D,F,B)=>D|F<<2*B,0);c[g][m]=s[L]}}return c}function Dc(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 f=a+r*i;for(let s=0;s<o;s++)l[s][f]=e[s][a]+r*t[s][i]}return l}function Zh(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 f=0;f<r;f++)o[e[f][a]]||(o[e[f][a]]=1,l=!1)}let i=new Int32Array(n).fill(-1);for(let a=0,f=0;a<n;a++)!o[a]||(i[a]=f,f++);return[e.map(a=>$r(a,o)),i]}function Xh(e,t){let r=e.length,n=e[0].length,o=new Int32Array(n).fill(-1);t.forEach(f=>{o[f]=0});let l=[t];for(let f=0;f<l.length;f++){let s=l[f];for(let c=0;c<r;c++){let m=e[c][s[0]];if(o[m]!==-1)continue;let u=s.map(g=>e[c][g]),p=l.length;l.push(u);for(let g of u){if(o[g]!==-1)throw"quotienting failed";o[g]=p}}}let i=l.length,a=Array(r).fill().map(()=>new Int32Array(i));for(let f=0;f<r;f++)for(let s=0;s<i;s++)a[f][s]=o[e[f][l[s][0]]];return[a,o]}function yc(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 f=l[a];for(let s=0;s<o;s++){let c=s^1,m=e[s][a],u=e[c][e[c][f]];if(l[m]===-1)i=!1,l[m]=u,l[u]=m;else if(l[m]!==u)throw"mirroring failed - is the initial map correct?"}}}return l}function Rc(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 f=0;f<n;f++){let s=e[f][a];for(;s!==a;)o[s]===-1&&(i=!1,o[s]=l+1),s=e[f][s]}l++}return o}function Jh(e,t=!1){let r=nL(e).next().value,n=vr(e,r),o=(t?DL:AL)(n),l=Qi(r.concat(o),!1);return vr(e,l).join("")!==tl.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(o),console.log(vr(e,l))),l}function eL(e){let[t,r]=ro(12,6,0,3,3),n=Array(12).fill().map((a,f)=>Ki(e,f)),o=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[l,i]=[en,oo].map(a=>{let f=a.map(s=>$h[e[s]]);return r[f.reduce((s,c,m)=>s|c<<2*m,0)]});return[o,l,i]}function Fc(){if(W.phase1_edge)return W.phase1_edge;let e=Dc(tn.map(n=>n.ep)),t=rn(e,e),r=rn(t,t);return W.phase1_edge=r}function tL(){return tr.phase1_edge?tr.phase1_edge:tr.phase1_edge=Rc(Fc(),[8+12*9+12**2*10+12**3*11])}function rL(){return W.phase1_centreA?W.phase1_centreA:W.phase1_centreA=lo(12,6,0,3,3,tn.map(e=>e.ap))}function Bc(){return W.phase1_centreB?W.phase1_centreB:W.phase1_centreB=lo(12,6,0,3,3,tn.map(e=>e.bp))}function bc(){if(tr.phase1_centre)return tr.phase1_centre;let[e,t]=ro(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 tr.phase1_centre=Rc(Bc(),r)}function*nL(e){let t=[Fc(),rL(),Bc()],r=[tL(),bc(),bc()];yield*oL(eL(e),t,r,15)}function*oL(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*wc(e,t,r,l,-1),l++}function*wc(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 f=0;f<i;f++){if(f===o||f===o-4)continue;let s=[];s[0]=t[0][f][e[0]],s[1]=t[1][f][e[1]],s[2]=t[2][f][e[2]];let c=1;for(;e.some((m,u)=>e[u]!=s[u]);){let m=wc(s,t,r,n-1,f);for(;;){let{value:u,done:p}=m.next();if(p)break;yield[[f,c]].concat(u)}s[0]=t[0][f][s[0]],s[1]=t[1][f][s[1]],s[2]=t[2][f][s[2]],c++}}}}function Js(e){let[t,r]=ro(10,5,3,2,0),n=Array(8).fill().map((u,p)=>Ki(e,p)),o=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),l=Array(5).fill().map((u,p)=>Xs(e,p)),i=Zs(l.map(([u,p])=>u+5*p).concat(l.map(([u,p])=>u+5*(p^1)))),a=i.slice(0,5).map(u=>u%5),f=i.slice(0,5).map(u=>u/5|0),s=Jr(a)*8+(f[0]^f[2])+2*(f[0]^f[3])+4*f[4],[c,m]=[en,oo].map(u=>{let p=He(u,iL).map(g=>lL[e[g]]);return r[p.reduce((g,d,L)=>g|d<<2*L,0)]});return Uc(),zc(),[c,m,kc[s]+40*vc[o]]}function*ji(e){yield*cL(Js(e),30)}function Sc(){if(W.phase2_centre)return W.phase2_centre;let e=lo(10,5,3,2,0,tn.slice(0,4).map(r=>$r(r.ap,xc))),t=lo(10,5,3,2,0,tn.slice(0,4).map(r=>$r(r.bp,xc)));return W.phase2_centre=[e,t]}function Uc(){if(W.phase2_edge)return W.phase2_edge;let e=Dc(tn.slice(0,4).map(n=>n.ep.slice(0,8))),t=rn(e,rn(e,e)),r;return[r,vc]=Zh(t,501),W.phase2_edge=r}function Ec(){if(W.phase2_corner)return W.phase2_corner;let t=el(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=tn.slice(0,4).map(l=>Zs($r(l.cp,r)));for(let l=0;l<t;l++){let i=js(l>>3,5),a=[0,0,l&1,l>>1&1,l>>2&1];a[1]=a[2]^a[3]^a[4];let f=Array(10);for(let s=0;s<5;s++)f[s]=i[s]+5*a[s],f[s+5]=i[s]+5*(a[s]^1);for(let s=0;s<4;s++){let c=He(o[s],f),m=c.slice(0,5).map(g=>g%5),u=c.slice(0,5).map(g=>g/5|0),p=(u[0]^u[2])+2*(u[0]^u[3])+4*u[4];n[s][l]=Jr(m)*8+p}}return W.phase2_corner=n}function zc(){return W.phase2_corner_compact||([W.phase2_corner_compact,kc]=Xh(Ec(),fL())),W.phase2_corner_compact}function $s(){if(W.phase2_ce)return W.phase2_ce;let e=zc(),t=Uc();return W.phase2_ce=rn(e,t)}function aL(){if(e0)return e0;let e=Js(tl)[2];return e0=yc($s(),e,e)}function sL(){let[e,t]=ro(10,5,3,2,0);return e.filter(r=>(r>>10&63)==41).map(r=>t[r])}function fL(){let e=Ec(),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 uL(){if(tr.phase2_ace)return tr.phase2_ace;let[e,t]=Sc(),r=$s(),n=2520,o=40*336,l=n*o,i=Js(tl)[2],a=9,f=new Int8Array(l).fill(a);for(let s of sL())f[s+n*i]=0;for(let s=0;s<a-1;s++)for(let c=f.indexOf(s);c!==-1;c=f.indexOf(s,c+1)){let m=c%n,u=c/n|0;for(let p=0;p<4;p++){let g=e[p][m],d=r[p][u],L=g+n*d;f[L]===a&&(f[L]=s+1),g=e[p][g],d=r[p][d],L=g+n*d,f[L]===a&&(f[L]=s+1)}}return tr.phase2_ace=f}function*cL(e,t){let[r,n]=Sc(),o=$s(),l=uL(),i=aL(),[a,f,s]=e,c=i[s],m=Math.max(l[a+2520*s],l[f+2520*c]);for(;m<=t;)yield*_c(a,f,s,r,n,o,l,i,m,-1),m++}function*_c(e,t,r,n,o,l,i,a,f,s){let c=Math.max(i[e+2520*r],i[t+2520*a[r]]);if(!(c>f)){if(f===0){yield[];return}else if(c===0)return;for(let m=0;m<4;m++){if(m===s)continue;let u=e,p=t,g=r;for(let d=1;d<=2;d++){u=n[m][u],p=o[m][p],g=l[m][g];let L=_c(u,p,g,n,o,l,i,a,f-1,m);for(;;){let{value:D,done:F}=L.next();if(F)break;yield[[m,d]].concat(D)}}}}}function Vi(e){let[t,r]=ro(7,3,2,0,2),n=Array(5).fill().map((s,c)=>Ki(e,c)),o=Jr(n),l=Array(4).fill().map((s,c)=>Xs(e,c)),i=Jr(l.map(s=>s[0]))*2+l.find(s=>s[0]===0)[1],[a,f]=[en,oo].map(s=>{let c=He(s,mL).map(m=>e[m]%4);return r[c.reduce((m,u,p)=>m|u<<2*p,0)]});return[a+210*f,i+24*o]}function gL(){if(W.phase3_2gen_edge)return W.phase3_2gen_edge;let e=el(5)/2,t=Array(io).fill().map(()=>new Uint32Array(e)),r=qi.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let o=js(n,5);for(let l=0;l<io;l++)t[l][n]=Jr(He(o,r[l]))}return W.phase3_2gen_edge=t}function dL(){if(W.phase3_2gen_corner)return W.phase3_2gen_corner;let t=el(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(io).fill().map(()=>new Uint32Array(t)),o=qi.map(l=>$r(l.cp,r).slice(0,4));for(let l=0;l<t;l+=2){let i=js(l>>1,4),a=i.concat(i.map(f=>f+4));for(let f=0;f<io;f++){let s=He(a,o[f]),c=s.map(u=>u%4),m=s.find(u=>u%4==0)>>2;n[f][l]=Jr(c)*2+m,n[f][l+1]=Jr(c)*2+(m^1)}}return W.phase3_2gen_corner=n}function Hi(){return W.phase3_2gen_corneredge?W.phase3_2gen_corneredge:W.phase3_2gen_corneredge=rn(dL(),gL())}function t0(){if(W.phase3_2gen_centre)return W.phase3_2gen_centre;let e=lo(7,3,2,0,2,qi.map(r=>$r(r.ap,Cc))),t=lo(7,3,2,0,2,qi.map(r=>$r(r.bp,Cc)));return W.phase3_2gen_centreA=e,W.phase3_2gen_centreB=t,W.phase3_2gen_centre=rn(e,t)}function Mc(){if(r0)return r0;let e=t0(),t=W.phase3_2gen_centreA,r=Hi(),n=t[0].length,o=r[0].length,l=n*o,i=25,a=rr.map(u=>u.length),f=new Int8Array(l).fill(i),s=Vi(tl);f[s[0]%n+n*s[1]]=0;let c=0,m=!1;for(;!m&&c<i-1;){m=!0;let u=Array(io).fill().map((D,F)=>F).filter(D=>a[D]+c<i);u.sort((D,F)=>a[D]-a[F]);let p=He(a,u),g=He(t,u),d=He(r,u),L=u.length;for(let D=f.indexOf(c);D!==-1;D=f.indexOf(c,D+1)){let F=D%n,B=D/n|0;for(let k=0;k<L;k++){let E=p[k],Q=g[k][F],$=d[k][B],G=Q+n*$;f[G]>c+E&&(m=!1,f[G]=c+E)}}c++}return r0=f}function Gc(){if(n0)return n0;let e=Hi().slice(0,2),t=Vi(tl);return n0=yc(e,t[1],t[1])}function o0(e,t=Vi(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=t0(),a=W.phase3_2gen_centreA,f=W.phase3_2gen_centreB,s=Hi(),c=Mc(),m=Gc(),u=0;for(;;){let p=i0(o,l,n,a,f,s,c,m,u);for(let g of p)return g.map(d=>rr[d]).flat();u++}}function Tc(e,t=Vi(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=t0(),a=W.phase3_2gen_centreA,f=W.phase3_2gen_centreB,s=Hi(),c=Mc(),m=Gc(),u=o0(e).length,p=1/0,g;for(let d=u;d<=u+0;d++){let L=i0(o,l,n,a,f,s,c,m,d);for(let D of L){let F=D.map(E=>rr[E]).flat(),B=Qi(F),k=l0(B);k<p&&(p=k,g=B)}}return g}function hL(e){return(e-1)*(e-2)/2}function l0(e){let t=Lc(e,!0).replace(/'/g,"").split(" ");return e.length+LL(t).map(hL).reduce((r,n)=>r+n,0)}function LL(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*i0(e,t,r,n,o,l,i,a,f,s=-1){let c=i[e+210*r],m=i[t+210*a[r]],u=Math.max(c,m);if(!(u>f)){if(f===0){yield[];return}if(u!==0)for(let p=0;p<io;p++){if(p===s&&pL[p]<=3)continue;let g=n[p][e],d=o[p][t],L=l[p][r],D=f-rr[p].length;if(D<0)continue;let F=i0(g,d,L,n,o,l,i,a,D,p);for(;;){let{value:B,done:k}=F.next();if(k)break;yield[p].concat(B)}}}}function AL(e,t=200,r=24){let n=[],o=ji(e),l=He(e,It).map(f=>f^1),i=ji(l),a=Array(1e3);for(let f=0;f<t;f++){{let{value:s,done:c}=o.next();if(!c){let m=vr(e,s),u=s.concat(o0(m));if(u.length<=r)return u;u.length<a.length&&(a=u)}}{let{value:s,done:c}=i.next();if(!c){let m=vr(l,s),u=s.concat(o0(m)).map(([p,g])=>[p^2,g]);if(u.length<=r)return u;u.length<a.length&&(a=u)}}}return a}function DL(e,t=20,r=30){let n=[],o=ji(e),l=He(e,It).map(s=>s^1),i=ji(l),a,f=1/0;for(let s=0;s<t;s++){{let{value:c,done:m}=o.next();if(!m){let u=vr(e,c),p=Qi(c.concat(Tc(u))),g=l0(p);if(g<=r)return p;g<f&&(a=p,f=g)}}{let{value:c,done:m}=i.next();if(!m){let u=vr(l,c),p=Qi(c.concat(Tc(u)));p=p.map(([d,L])=>[d^2,L]);let g=l0(p);if(g<=r)return p;g<f&&(a=p,f=g)}}}return a}async function RL(){return Yh(await yL)}var P7,M7,Vs,Hs,tl,rl,Mh,It,G7,Oi,pc,Gh,Th,Ih,Wi,Nh,gc,Oh,Wh,Et,xr,Sr,en,oo,hc,Vh,tn,W,tr,$h,lL,iL,xc,vc,kc,e0,mL,Cc,rr,io,Pc,qi,pL,r0,n0,yL,Nc=w(()=>{Mt();[P7,M7]=(()=>{let e=new Int8Array(256*8),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 f=0;f<6;f++){let s=o[f];a+=e[l|s<<8]*i,l&=~(1<<s),i/=7-f}return a}function n(o,l){let i=255,a=2520,f=0;for(let s=0;s<6;s++){let c=o/a|0;o-=c*a,f^=c&1;let m=t[i|c<<8];l[s]=m,i&=~(1<<m),a/=7-s}return l[6]=t[i|f<<8],l[7]=t[i|(f^1)<<8],l}return[r,n]})();Vs={};Hs={};tl=Array(72).fill().map((e,t)=>t/9|0),rl=Ys([[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),Mh=He(rl,rl),It=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),G7=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),Oi=Array(72).fill().map((e,t)=>(t+36)%72),pc=no(Oi,Mh,Oi),Gh=no(It,rl,It),Th=no(It,pc,It),Ih=Ys([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),Wi=He(rl,Ih),Nh=He(Wi,Wi),gc=no(Oi,Nh,Oi),Oh=no(It,Wi,It),Wh=no(It,gc,It),Et=Array(72).fill().map((e,t)=>t/9|0),xr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],Sr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],en=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),oo=en.map(e=>e+36);hc=[rl,pc,Gh,Th,Wi,gc,Oh,Wh],Vh=["U","L","F","R","u","l","f","r"],tn=hc.map(dc);W={},tr={},$h=[0,0,2,3,0,0,2,3];lL=[0,1,2,0,0,1,2,0],iL=[0,1,2,3,4,5,7,8,10,11],xc=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];mL=[0,1,2,3,4,10,11],Cc=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],rr=[[[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]]];rr=rr.concat(rr.map(e=>Ac(e)));io=rr.length,Pc=rr.map(e=>vr(Ys([],72),e)),qi=Pc.map(dc),pL=Pc.map(Ph);yL=Qe()});var em={};Be(em,{randomMasterTetraminxScrambleString:()=>$c});function nl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function nn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function FL(e){e=e.slice();let t=e.length,r=nl(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 Yi(e,t){let r=[],n=nl(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 FL(e)>>1}function on(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function a0(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function ol(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 Ur(e,t){return e.length===0?nn(t):e.map(r=>ol(r,t)).reduce(on)}function BL(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=on(e.mp,t.mp),o=on(e.wp,t.wp),l=on(e.cp,t.cp);return{co:r,mp:n,wp:o,cp:l}}function Kc(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)==4}function _L(e){let t=["0","","'"];return e.map(([n,o])=>zL[n]+t[o]).join(" ")}function CL(e){let t=Array(4);for(let l=0;l<4;l++)t[l]=e(3);let r=Yi(e(nl(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=Yi(e(nl(12)/2),12),o=Yi(e(nl(4)/2),4);return{co:t,mp:r,wp:n,cp:o}}function PL(e){return GL(CL(e))}function ML(e,t=!0,r=!1){let n=_L(PL(e));if(!t)return n;let o=["u","l","r","b"],l=["0","","'"];if(!r){for(let u=0;u<4;u++){let p=e(3);p!==0&&(n+=" "+o[u]+l[p])}return n.trim()}let i=[],a=[],f=[];for(let u=0;u<4;u++)i[u]=e(3),a[u]=e(3),f[u]=(i[u]-a[u]+3)%3;let s=u=>u.filter(p=>p!==0).length;for(;!(s(a)>=1&&s(f)>=1&&s(a)+s(f)>=4);)for(let u=0;u<4;u++)a[u]=e(3),f[u]=(i[u]-a[u]+3)%3;let c=a.map((u,p)=>u!==0?o[p]+l[u]+" ":"").join(""),m=f.map((u,p)=>u!==0?" "+o[p]+l[u]:"").join("");return c+n+m}function GL(e){let t=IL(e),r=[Yc(),Zc()],n=[jL(),qL()],o=WL(t),l,i=new Set,a=performance.now();for(let f=0;f<22;f++){let{value:s,done:c}=o.next(),m=e;for(let[L,D]of s)for(let F=0;F<D;F++)m=BL(m,ao[L]);let u=JSON.stringify(m);if(i.has(u))continue;i.add(u);let p=KL(m),g=l?l.length-s.length-1:999999,d=VL(p,r,n,g).next().value;if(d!==void 0&&((l===void 0||l.length>s.length+d.length)&&(l=s.concat(d)),performance.now()-a>300))break}return l}function TL(e){return e[3^e.indexOf(3)]}function IL(e){let t=on(a0(e.mp),e.wp),r=(e.co.reduce((n,o)=>n+o)-TL(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*WL(e){let t=0,r=Hc(),n=QL();for(;;)yield*qc(...e,r,n,t,-1),t++}function*qc(e,t,r,n,o,l,i,a,f,s){let c=ln,m=nr[e]+nr[t]+nr[r]+nr[n]+nr[o]+nr[l],u=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],u0[m]);if(!(u>f)){if(f===0){yield[];return}if(!(u===0&&f===1))for(let p=0;p<c;p++){if(p===s||p<s&&Kc(p,s))continue;let g=e,d=t,L=r,D=n,F=o,B=l;for(let k=1;k<=2;k++){g=i[g][p],d=i[d][p],L=i[L][p],D=i[D][p],F=i[F][p],B=i[B][p];let E=qc(g,d,L,D,F,B,i,a,f-1,p);for(;;){let{value:Q,done:$}=E.next();if($)break;yield[[p,k]].concat(Q)}}}}}function KL(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 Vc(){if(be.phase1pm)return be.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(ln).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<ln;l++){let i=Qc[l][t],a=s0[l][r],f=s0[l][n];i<6?e[o][l]=i+6*a+72*f:e[o][l]=i-6+6*f+72*a}}return be.phase1pm=e}function Hc(){if(be.phase1pcm)return be.phase1pcm;let e=Vc(),t=Array(e.length*3).fill().map(()=>Array(ln).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<ln;n++){let o=e[r][n];t[r][n]=o+6*12*12*f0[n],t[r+6*12*12][n]=o+6*12*12*((f0[n]+1)%3),t[r+2*6*12*12][n]=o+6*12*12*((f0[n]+2)%3)}return be.phase1pcm=t}function QL(){if(be.phase1p2cp)return be.phase1p2cp;let e=Vc(),t=Hc(),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,f=Math.floor(i/864);for(let s=0;s<ln;s++){let c=a,m=f;for(let u=1;u<=2;u++){c=e[c][s],m=t[m][s];let p=c+864*m;r[p]===-1&&(l=!0,r[p]=o+1)}}}if(!l)break;o++}return be.phase1p2cp=r}function Yc(){if(be.phase2pm)return be.phase2pm;let e=Array(1440).fill().map(()=>Array(Zi));for(let t=0;t<360;t++){let r=Yi(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<Zi;n++){let o=on(r,ao[n].mp),l=Wc(o.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let a=ao[n].cp[i];e[t+360*a][n]=l+360*i}}}return be.phase2pm=e}function Zc(){if(be.phase2om)return be.phase2om;let e=Array(32*81).fill().map(()=>Array(Zi));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<Zi;i++){let f=on(n,ao[i].mp).slice(0,5).map(u=>+(u>=6)),s=0;for(let u=0;u<5;u++)s+=f[u]<<u;let c=l.map((u,p)=>(u+ao[i].co[p])%3),m=0;for(let u=0;u<4;u++)m+=c[u]*3**u;e[t+32*o][i]=s+32*m}}}return be.phase2om=e}function jL(){return be.phase2pp?be.phase2pp:be.phase2pp=Xc(Yc(),[0])}function qL(){return be.phase2op?be.phase2op:be.phase2op=Xc(Zc(),[0])}function Xc(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 f of l)if(o[f]===-1){o[f]=a;for(let s=0;s<n;s++){let c=e[f][s];for(;c!=f;)i.push(c),c=e[c][s]}}[l,i]=[i,l],a+=1}return o}function*VL(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*Jc(e,t,r,l,-1),l++}function*Jc(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let f=0;f<l;f++)a=Math.max(a,r[f][e[f]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let f=0;f<i;f++){if(f===o||f<o&&Kc(f,o))continue;let s=e.slice();for(let m=0;m<l;m++)s[m]=t[m][e[m]][f];let c=1;for(;e.some((m,u)=>e[u]!=s[u]);){let m=Jc(s,t,r,n-1,f);for(;;){let{value:u,done:p}=m.next();if(p)break;yield[[f,c]].concat(u)}for(let u=0;u<l;u++)s[u]=t[u][s[u]][f];c++}}}}async function $c(){return ML(await HL,!1)}var Q7,j7,q7,bL,wL,xL,SL,vL,UL,EL,kL,ao,zL,ln,Zi,NL,Qc,OL,s0,f0,jc,u0,nr,be,HL,tm=w(()=>{Mt();"use strict";[Q7,j7]=(()=>{let e=new Int8Array(4096*12),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 f=0;f<10;f++){let s=o[f];a+=e[l|s<<12]*i,l&=~(1<<s),i/=11-f}return a}function n(o,l){let i=4095,a=19958400,f=0;for(let s=0;s<10;s++){let c=o/a|0;o-=c*a,f^=c&1;let m=t[i|c<<12];l[s]=m,i&=~(1<<m),a/=11-s}return l[10]=t[i|f<<12],l[11]=t[i|(f^1)<<12],l}return[r,n]})();q7={co:[0,0,0,0],mp:nn(12),wp:nn(12),cp:[0,1,2,3]},bL={co:[2,0,0,0],mp:nn(12),wp:ol([1,9,11],12),cp:[0,1,2,3]},wL={co:[0,2,0,0],mp:nn(12),wp:ol([0,7,2],12),cp:[0,1,2,3]},xL={co:[0,0,2,0],mp:nn(12),wp:ol([3,6,10],12),cp:[0,1,2,3]},SL={co:[0,0,0,2],mp:nn(12),wp:ol([4,8,5],12),cp:[0,1,2,3]},vL={co:[2,0,0,0],mp:Ur([[1,9,11],[7,3,5]],12),wp:Ur([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},UL={co:[0,2,0,0],mp:Ur([[0,7,2],[6,1,8]],12),wp:Ur([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},EL={co:[0,0,2,0],mp:Ur([[3,6,10],[9,0,4]],12),wp:Ur([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},kL={co:[0,0,0,2],mp:Ur([[4,8,5],[10,2,11]],12),wp:Ur([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},ao=[vL,UL,EL,kL,bL,wL,xL,SL],zL=["u","l","r","b","U","L","R","B"],ln=8,Zi=4;NL=[],Qc=[],OL=[],s0=[];for(let e=0;e<ln;e++){let t=ao[e];NL[e]=t.mp,Qc[e]=a0(t.mp),OL[e]=t.wp,s0[e]=a0(t.wp)}f0=[0,0,0,0,2,2,2,2],jc=[[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]],u0=new Int8Array(55);for(let e=0;e<25;e++)u0[e]=jc[0][e],u0[e+30]=jc[1][e];nr=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--,nr[n]=o,nr[n+6*12*12]=nr[n+2*6*12*12]=o+5}be={};HL=Qe();(async()=>{console.log(await $c())})()});var om={};Be(om,{cachedMegaminxKPuzzleWithoutMO:()=>ll,cachedSGSDataMegaminx:()=>JL,sgsDataMegaminx:()=>nm});async function YL(){let e=vn("megaminx",{allMoves:!0,addRotations:!0}),t=new Ne(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new Ir(e,e.getOrbitsDef(!0))});return t.definition.name="megaminx",t}async function ll(){return ZL??(ZL=YL())}async function JL(){return XL??(XL=nm())}async function nm(){return cr(await ll(),\`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
|
|
1148
|
+
Alg F D F' D L2 F R' F' D' B2 U'\`)}var rp,Hf=b(()=>{Vt();vn();rp=null});async function En(e,t){let r=new mt;r.experimentalPushAlg(e);for(let n of t){let o=(await Yt())(n);o!==null&&r.push(B.fromString(o))}return r.toAlg()}var Hl=b(()=>{Re();Mt()});function $f(e,t){return e.slice(t)+e.slice(0,t)}function gp(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($f(ap[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push($f(sp[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(fp),t}function eu(e){let t=gp(e);return up.map(([r,n,o])=>t[r][n][o]).join("")}var ap,sp,fp,up,tu=b(()=>{ap="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),sp="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),fp="U L F R B D".split(" "),up=[[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 ru(e,t){let r=new pe(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 pe(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 nu(e,t){if(ru(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(ru(o,t))return!1}return!0}var ou=b(()=>{Re();Je()});var lu,iu=b(()=>{lu=[["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"]]});var Tu={};ye(Tu,{initialize:()=>tL,solveState:()=>rL});function au(){}function mp(e){function t(){}return t.prototype=e||{},new t}function pp(e){return e instanceof Array?e[0]:null}function Po(e,t,r){var n=Yl,o=Lp,l=pp,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$=au));for(var f=3;f<arguments.length;++f)arguments[f].prototype=H;a&&(H.___clazz$=a)}function Lp(e){var t=Yl;return mp(t[e])}function Bp(){}function Zl(e){return e<<24>>24}function Ya(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function Za(e,t){var r;return r=new Ya,r.packageName=e,r.compoundName=t,r}function mr(e,t,r){var n;return n=Za(e,t),Dp(r,n),n}function Rp(e,t){var r;return r=Za(e,t),r.modifiers=2,r}function Xl(e,t){var r;return r=Za("",e),r.typeId=t,r.modifiers=1,r}function su(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function dp(e){if(e.isPrimitive())return null;var t=e.typeId,r=Yl[t];return r}function Dp(e,t){if(!!e){t.typeId=e;var r=dp(t);if(!r){Yl[e]=[t];return}r.___clazz$=t}}function ee(e,t){return su(e,t)}function X(e,t,r,n,o,l){var i;return i=uu(o,n),te(ee(e,l),t,r,o,i),i}function et(e,t,r,n,o,l){return fu(e,t,r,n,o,0,l)}function fu(e,t,r,n,o,l,i){var a,f,s,g,c;if(g=o[l],s=l==i-1,a=s?n:0,c=uu(a,g),te(ee(e,i-l),t[l],r[l],a,c),!s)for(++l,f=0;f<g;++f)c[f]=fu(e,t,r,n,o,l,i);return c}function te(e,t,r,n,o){return o.___clazz$=e,o.castableTypeMap$=t,o.typeMarker$=au,o.__elementTypeId$=r,o.__elementTypeCategory$=n,o}function uu(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 gu(e){var t,r,n;return t=e&$e,r=e>>22&$e,n=e<0?cr:0,Fp(t,r,n)}function Fp(e,t,r){return{l:e,m:t,h:r}}function hp(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&$e,m:n&$e,h:o&cr}}function It(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function Xa(e){var t,r;return e>-129&&e<128?(t=e+128,$l==null&&($l=X($p,se,293,256,0,1)),r=$l[t],!r&&(r=$l[t]=gu(e)),r):gu(e)}function cu(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 Ja(e,t){return e.l!=t.l||e.m!=t.m||e.h!=t.h}function $a(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function Jl(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&$e,m:n&$e,h:o&cr}}function Wr(e,t){var r,n,o,l,i;return t&=63,r=e.h,n=(r&cp)!=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?cr:0,l=r>>t-22,o=e.m>>t-22|r<<44-t):(i=n?cr:0,l=n?$e:0,o=r>>t-44),{l:o&$e,m:l&$e,h:i&cr}}function mu(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&$e,m:n&$e,h:o&cr}}function Kr(e){return e.l|e.m<<22}function Ap(e){this.string=e}function pr(e,t){return e>t?e:t}function es(e,t){return e<t?e:t}function yp(e,t){return e.indexOf(t)}function Up(e){return bp(e,0,e.length)}function bp(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 wp(e){return String.fromCharCode(e&je)}function pu(e){return e.string+=" ",e}function Lu(e,t){return e.string+=t,e}function Sp(){Ap.call(this,"")}function ei(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 Qr(){Bu||(Bu=!0,Br=et(Fe,[se,De],[11,0],7,[495,18],2),Gn=et(Fe,[se,De],[11,0],7,[324,18],2),Cn=et(Fe,[se,De],[11,0],7,[336,18],2),Lr=et(Fe,[se,De],[11,0],7,[495,8],2),ni=X(ze,ke,0,20048,7,1),ri=X(ze,ke,0,20791,7,1),Mn=X(ze,ke,0,82945,7,1),kn=et(Fe,[se,De],[11,0],7,[2768,10],2),_n=et(Fe,[se,De],[11,0],7,[2768,10],2),Pn=et(Fe,[se,De],[11,0],7,[24,10],2),To=et(Fe,[se,De],[11,0],7,[24,16],2),jr=et(Fe,[se,De],[11,0],7,[140,16],2),ti=X(ze,ke,0,8305,7,1),zn=X(ze,ke,0,48441,7,1))}function vp(e,t,r){return e.slice_0=Br[t.slice_0][r],e.flip=Cn[t.flip][(J(),Vr)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=Gn[t.twist][Vr[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=pr(pr(it(ni,e.twist*495+Lr[e.slice_0][e.tsym]),it(ri,e.flip*495+Lr[e.slice_0][e.fsym])),it(Mn,e.twist<<11|Dr[e.flip<<3|e.fsym^e.tsym])),e.prun}function Ep(e,t,r){return r=(J(),Oo)[3][r],e.flipc=Cn[t.flipc>>3][Vr[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=Gn[t.twistc>>3][Vr[r<<3|t.twistc&7]]^t.twistc&7,it(Mn,e.twistc>>3<<11|Dr[e.flipc^e.twistc&7])}function Ru(e,t,r){var n;return e.twist=(J(),Wo)[ai(t)],e.flip=qr[ii(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=it(Mn,e.twist<<11|Dr[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-Nn(t.ea,8,!0),e.prun=pr(e.prun,pr(it(ni,e.twist*495+Lr[e.slice_0][e.tsym]),it(ri,e.flip*495+Lr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new ue,Io(t,1,n),No(t,1,n),e.twistc=Wo[ai(n)],e.flipc=qr[ii(n)],e.prun=pr(e.prun,it(Mn,e.twistc>>3<<11|Dr[e.flipc^e.twistc&7])),e.prun<=r)}function Mo(){Qr()}function it(e,t){return Qr(),e[t>>3]>>(t<<2)&15}function du(e){Qr(),!(oi==2||oi==1&&!e)&&(oi==0&&(Kp(),kp(),_p(),Pp(),zp(),J(),is(2048,as,qr,bu=X(Fe,De,0,336,7,1),0),is(2187,gs,Wo,us=X(Fe,De,0,324,7,1),1),Cp(),Mp(),Gp()),Go(ti,Pn,To,kn,(J(),fs),584244,e),Go(zn,ts,jr,_n,fs,514084,e),Go(ni,Br,Lr,Gn,us,431619,e),Go(ri,Br,Lr,Cn,bu,431619,e),Go(Mn,null,null,Gn,us,103939,e),oi=e?2:1)}function kp(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<2768;r++)for(Np(e,(J(),Tn)[r]),n=0;n<10;n++)Rr(e,ge[(Ve(),bt)[n]],t),kn[r][n]=ui(Xt[st(t.ca,8,!1)])&je}function zp(){var e,t,r,n,o;for(e=new ue,t=new ue,ts=et(Fe,[se,De],[11,0],7,[140,10],2),r=0;r<140;r++){for(Cu(e.ca,r%70,0,!1),o=0;o<10;o++)Rr(e,(J(),ge)[(Ve(),bt)[o]],t),ts[r][o]=Nn(t.ca,0,!1)+70*(165>>o&1^~~(r/70))&je;for(n=0;n<16;n++)Io(e,(J(),at)[0][n],t),jr[r][n]=Nn(t.ca,0,!1)+70*~~(r/70)&je}}function _p(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<2768;r++)for(Au(e,(J(),Tn)[r]),n=0;n<10;n++)Bt(e,ge[(Ve(),bt)[n]],t),_n[r][n]=Xt[st(t.ea,8,!0)]}function Cp(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<336;r++)for(os(e,(J(),as)[r]),n=0;n<18;n++)Bt(e,ge[n],t),Cn[r][n]=qr[ii(t)]}function Pp(){var e,t,r,n,o;for(e=new ue,t=new ue,r=0;r<24;r++){for(Hr(e.ea,r,12,!0),o=0;o<10;o++)Bt(e,(J(),ge)[(Ve(),bt)[o]],t),Pn[r][o]=st(t.ea,12,!0)%24&je;for(n=0;n<16;n++)No(e,(J(),at)[0][n],t),To[r][n]=st(t.ea,12,!0)%24&je}}function Go(e,t,r,n,o,l,i){var a,f,s,g,c,u,m,p,L,R,D,A,y,k,E,Q,$,G,oe,U,_,M,x,S,C,j,Z,ce,Le,Ae,be,kt,Pe,rt,Se,h;if(y=l&15,D=(l>>4&1)==1?Ha:0,s=(l>>5&1)==1,a=l>>8&15,g=l>>12&15,c=l>>16&15,R=i?g:c,A=(1<<y)-1,f=t==null,p=f?2048:t.length,L=p*n.length,m=s?10:18,u=m==10?66:599186,E=(e[L>>3]>>(L<<2)&15)-1,E==-1){for(G=0;G<~~(L/8)+1;G++)e[G]=Co;e[0]^=1,E=0}for(;E<R;){for(C=(E+1)*Co^-1,oe=0;oe<e.length;oe++)Se=e[oe]^C,Se&=Se>>1,e[oe]+=Se&Se>>2&Co;for(M=E>a,Ae=M?E+2:E,Le=Ae*Co,k=M?E:E+2,++E,h=E^E+1,rt=0,G=0;G<L;++G,rt>>=4){if((G&7)==0&&(rt=e[G>>3],((rt^Le)-Co&~(rt^Le)&-2004318072)==0)){G+=7;continue}if((rt&15)==Ae)for(Z=G%p,be=~~(G/p),Q=0,$=0,f&&(Q=(J(),qr)[Z],$=Q&7,Q>>=3),S=0;S<m;S++){if(Pe=n[be][S],f?ce=(J(),Dr)[Cn[Q][Vr[S<<3|$]]^$^Pe&A]:ce=r[t[Z][S]][Pe&A],Pe>>=y,U=Pe*p+ce,j=e[U>>3]>>(U<<2)&15,j!=k){j<E-1&&(S+=u>>S&3);continue}if(M){e[G>>3]^=h<<(G<<2);break}for(e[U>>3]^=h<<(U<<2),x=1,kt=o[Pe];(kt>>=1)!=0;x++)(kt&1)==1&&(_=Pe*p,f?_+=(J(),Dr)[qr[ce]^x]:_+=r[ce][x^D>>(x<<1)&3],(e[_>>3]>>(_<<2)&15)==k&&(e[_>>3]^=h<<(_<<2)))}}}}function Mp(){var e,t,r,n;for(e=new ue,t=new ue,r=0;r<324;r++)for(ls(e,(J(),gs)[r]),n=0;n<18;n++)Rr(e,ge[n],t),Gn[r][n]=Wo[ai(t)]}function Gp(){var e,t,r,n,o,l,i,a;for(e=new ue,t=new ue,n=0;n<495;n++){for(Cu(e.ea,494-n,8,!0),l=0;l<18;l+=3)Bt(e,(J(),ge)[l],t),Br[n][l]=494-Nn(t.ea,8,!0)&je;for(o=0;o<16;o+=2)No(e,(J(),at)[0][o],t),Lr[n][o>>1]=494-Nn(t.ea,8,!0)&je}for(r=0;r<495;r++)for(o=0;o<18;o+=3)for(a=Br[r][o],i=1;i<3;i++)a=Br[a][o],Br[r][o+i]=a&je}function J(){Du||(Du=!0,Zt=X(Ko,se,7,16,0,1),ge=X(Ko,se,7,18,0,1),ci=X(eL,se,0,18,6,1),wu=X(ze,ke,0,48,7,1),Jt=et(ze,[se,ke],[17,0],7,[16,16],2),at=et(ze,[se,ke],[17,0],7,[16,16],2),Oo=et(ze,[se,ke],[17,0],7,[16,18],2),Vr=X(ze,ke,0,144,7,1),Fr=et(ze,[se,ke],[17,0],7,[16,18],2),as=X(Fe,De,0,336,7,1),gs=X(Fe,De,0,324,7,1),Tn=X(Fe,De,0,2768,7,1),In=X(re,ae,0,2768,7,1),ss=X(Fe,De,0,2768,7,1),gi=X(re,ae,0,24,7,1),qr=X(Fe,De,0,2048,7,1),Wo=X(Fe,De,0,2187,7,1),Xt=X(Fe,De,0,40320,7,1),Dr=X(Fe,De,0,2688,7,1),cs=new Ut(2531,1373,67026819,1367),ms=new Ut(2089,1906,322752913,2040),mi=te(ee(re,2),se,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])]),Wp(),Qp())}function rs(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 Fu(e){!e.temps&&(e.temps=new ue),Rr(ms,e,e.temps),Rr(e.temps,cs,e),Bt(ms,e,e.temps),Bt(e.temps,cs,e)}function ns(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 Tp(e){return ui(Xt[st(e.ca,8,!1)])}function Ip(e){return Xt[st(e.ea,8,!0)]}function ii(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function ai(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function si(e){var t,r;for(!e.temps&&(e.temps=new ue),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;ns(e,e.temps)}function hu(e){var t,r,n,o,l,i,a;for(t=new yu(e),o=new ue,r=ui(Xt[st(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},a=0;a<6;a++){if(n=ui(Xt[st(t.ca,8,!1)])>>4,r==n)for(l=0;l<16;l++)Io(t,at[0][l],o),ei(o.ca,e.ca)&&(No(t,at[0][l],o),ei(o.ea,e.ea)&&(i=$a(i,Jl({l:1,m:0,h:0},(a<<4|l)<48?a<<4|l:48))));Fu(t),a%3==2&&si(t)}return i}function Np(e,t){Hr(e.ca,t,8,!1)}function Au(e,t){Hr(e.ea,t,8,!0)}function os(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 ls(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 Op(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:(Ls(st(e.ea,12,!0),12)^Ls(st(e.ca,8,!1),8))!=0?-6:0}function Io(e,t,r){J();var n,o,l,i,a,f;for(f=Zt[at[0][t]],a=Zt[t],n=0;n<8;n++)l=f.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]=(f.ca[e.ca[a.ca[n]&7]&7]&7|o<<3)<<24>>24}function Rr(e,t,r){J();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 ue(){J(),rs(this)}function Ut(e,t,r,n){rs(this),Hr(this.ca,e,8,!1),ls(this,t),Hr(this.ea,r,12,!0),os(this,n)}function yu(e){rs(this),ns(this,e)}function ui(e){return J(),e^Ha>>((e&15)<<1)&3}function No(e,t,r){J();var n,o,l;for(l=Zt[at[0][t]],o=Zt[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 Bt(e,t,r){J();var n;for(n=0;n<12;n++)r.ea[n]=(e.ea[t.ea[n]>>1]^t.ea[n]&1)<<24>>24}function dr(e,t,r){J();var n;return n=ss[e],r&&(n=n^Ha>>((n&15)<<1)&3),n&65520|Jt[n&15][t]}function Uu(){return J(),0}function Wp(){var e,t;for(ge[0]=new Ut(15120,0,119750400,0),ge[3]=new Ut(21021,1494,323403417,0),ge[6]=new Ut(8064,1236,29441808,550),ge[9]=new Ut(9,0,5880,0),ge[12]=new Ut(1230,412,2949660,0),ge[15]=new Ut(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)ge[e+t+1]=new ue,Bt(ge[e+t],ge[e],ge[e+t+1]),Rr(ge[e+t],ge[e],ge[e+t+1])}function Kp(){J();var e,t,r;for(is(40320,Tn,Xt,fs=X(Fe,De,0,2768,7,1),2),e=new ue,r=0;r<2768;r++)Au(e,Tn[r]),In[r]=Nn(e.ea,0,!0)+Ls(Tn[r],8)*70<<24>>24,si(e),ss[r]=Xt[st(e.ea,8,!0)];for(t=0;t<24;t++)Hr(e.ea,t,12,!0),si(e),gi[t]=st(e.ea,12,!0)%24<<24>>24}function Qp(){var e,t,r,n,o,l,i,a,f,s,g,c,u,m,p,L;for(e=new ue,t=new ue,r=new Ut(28783,0,259268407,0),L=new Ut(15138,0,119765538,7),c=new Ut(5167,0,83473207,0),o=0;o<8;o++)c.ca[o]=Zl(c.ca[o]|24);for(l=0;l<16;l++)Zt[l]=new yu(e),fi(e,L,t),Bt(e,L,t),p=t,t=e,e=p,l%4==3&&(fi(p,c,t),Bt(p,c,t),p=t,t=e,e=p),l%8==7&&(fi(p,r,t),Bt(p,r,t),p=t,t=e,e=p);for(i=0;i<16;i++)for(f=0;f<16;f++)for(fi(Zt[i],Zt[f],e),g=0;g<16;g++)if(ei(Zt[g].ca,e.ca)){Jt[i][f]=g,at[g][f]=i;break}for(s=0;s<18;s++)for(m=0;m<16;m++){for(Io(ge[s],at[0][m],e),u=0;u<18;u++)if(ei(ge[u].ca,e.ca)){Oo[m][s]=u,Fr[m][(Ve(),On)[s]]=On[u];break}m%2==0&&(Vr[s<<3|m>>1]=Oo[m][s])}for(n=0;n<18;n++)for(ci[n]=hu(ge[n]),a=n,m=0;m<48;m++)Oo[m%16][a]<n&&(wu[m]|=1<<n),m%16==15&&(a=mi[2][a])}function is(e,t,r,n,o){J();var l,i,a,f,s,g,c,u,m;for(l=new ue,a=new ue,i=0,s=0,m=o>=2?1:2,g=o!=1,f=0;f<e;f++)if(r[f]==0){switch(o){case 0:os(l,f);break;case 1:ls(l,f);break;case 2:Hr(l.ea,f,8,!0)}for(c=0;c<16;c+=m){switch(g?No(l,c,a):Io(l,c,a),o){case 0:s=ii(a);break;case 1:s=ai(a);break;case 2:s=st(a.ea,8,!0)}o==0&&(Dr[i<<3|c>>1]=s&je),s==f&&(n[i]=(n[i]|1<<~~(c/m))&je),u=~~((i<<4|c)/m),r[s]=u&je}t[i++]=f&je}return i}function jp(e,t,r,n,o,l,i,a){var f,s,g,c,u;if(c=pr(it((Qr(),zn),(i>>4)*140+jr[(J(),In)[a>>4]&255][at[i&15][a&15]]),pr(it(zn,n*140+jr[In[t]&255][at[o][r]]),it(ti,t*24+To[l][r]))),c>e.maxDep2)return c-e.maxDep2;for(f=e.maxDep2;f>=c&&(u=vu(e,n,o,t,r,l,f,e.depth1,10),!(u<0));f--){for(f-=u,e.solLen=0,e.solution=new Gu,Jp(e.solution,e.verbose,e.urfIdx,e.depth1),g=0;g<e.depth1+f;g++)Pu(e.solution,e.move[g]);for(s=e.preMoveLen-1;s>=0;s--)Pu(e.solution,e.preMoves[s]);e.solLen=e.solution.length_0}return f!=e.maxDep2?(e.maxDep2=es(ku,e.solLen-e.length1-1),cu(e.probe,e.probeMin)?0:1):1}function qp(e){var t,r,n,o,l,i,a,f,s,g,c,u,m,p,L;if(e.isRec=!1,cu(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=hp(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)Rr(e.phase1Cubie[n],(J(),ge)[e.move[n]],e.phase1Cubie[n+1]),Bt(e.phase1Cubie[n],ge[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,a=Tp(e.phase1Cubie[e.depth1]),f=a&15,a>>=4,s=Ip(e.phase1Cubie[e.depth1]),g=s&15,s>>=4,c=st(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=dr(s,g,!1),t=dr(a,f,!0),o=e.depth1==0?-1:e.move[e.depth1-1],l=e.preMoveLen==0?-1:e.preMoves[e.preMoveLen-1],L=0,p=(e.preMoveLen==0?1:2)*(e.depth1==0?1:2),u=0,m=(1<<p)-1;u<p;u++){if((m>>u&1)!=0){if(m&=~(1<<u),L=jp(e,a,f,s,g,c,r,t),L==0||L>2)break;L==2&&(m&=4<<u)}if(m==0)break;(u&1)==0&&e.depth1>0?(i=(Ve(),On)[~~(o/3)*3+1],e.move[e.depth1-1]=bt[i]*2-e.move[e.depth1-1],c=(Qr(),Pn)[c][i],a=kn[a][(J(),Fr)[f][i]],f=Jt[a&15][f],a>>=4,s=_n[s][Fr[g][i]],g=Jt[s&15][g],s>>=4,t=dr(a,f,!0),r=dr(s,g,!1)):e.preMoveLen>0&&(i=(Ve(),On)[~~(l/3)*3+1],e.preMoves[e.preMoveLen-1]=bt[i]*2-e.preMoves[e.preMoveLen-1],c=(J(),gi)[(Qr(),Pn)[gi[c]][i]],a=kn[t>>4][Fr[t&15][i]],t=a&-16|Jt[a&15][t&15],a=dr(t>>4,t&15,!0),f=a&15,a>>=4,s=_n[r>>4][Fr[r&15][i]],r=s&-16|Jt[s&15][r&15],s=dr(r>>4,r&15,!1),g=s&15,s>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=o),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=l),L==0?0:2}function Vp(e){var t;for(e.conjMask=0,e.selfSym=hu(e.cc),e.conjMask|=Ja(It(Wr(e.selfSym,16),{l:je,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=Ja(It(Wr(e.selfSym,32),{l:je,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=Ja(It(Wr(e.selfSym,48),{l:je,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=It(e.selfSym,{l:$e,m:$e,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)ns(e.urfCubieCube[t],e.cc),Ru(e.urfCoordCube[t],e.urfCubieCube[t],20),Fu(e.cc),t%3==2&&si(e.cc)}function xu(e,t,r,n,o){var l,i,a,f,s,g;if(t.prun==0&&n<5)return e.allowShorter||n==0?(e.depth1-=n,s=qp(e),e.depth1+=n,s):1;for(g=Uu(Xa(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]||g!=0&&(g&1<<i)!=0)){if(f=vp(e.nodeUD[n],t,i),f>n)break;if(f==n)continue;if(f=Ep(e.nodeUD[n],t,i),f>n)break;if(f==n)continue;if(e.move[e.depth1-n]=i,e.valid1=es(e.valid1,e.depth1-n),s=xu(e,e.nodeUD[n],r&Kr((J(),ci)[i]),n-1,l),s==0)return 0;if(s>=2)break}}return 1}function Su(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==ps&&e.preMoveLen!=0,Ru(e.nodeUD[e.depth1+1],n,e.depth1)&&xu(e,e.nodeUD[e.depth1+1],o,e.depth1,-1)==0))return 0;if(t==0||e.preMoveLen+ps>=e.length1)return 1;for(a=Uu(Xa(o)),(t==1||e.preMoveLen+1+ps>=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)&&(Rr((J(),ge)[l],n,e.preMoveCubes[t]),Bt(ge[l],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=l,i=Su(e,t-1,l,e.preMoveCubes[t],o&Kr(ci[l])),i==0))return 0}return 1}function vu(e,t,r,n,o,l,i,a,f){var s,g,c,u,m,p,L,R,D,A,y;if(t==0&&n==0&&l==0)return i;for(D=(Ve(),Qo)[f],L=0;L<10;L++){if((D>>L&1)!=0){L+=66>>L&3;continue}if(R=(Qr(),Pn)[l][L],g=kn[n][(J(),Fr)[o][L]],c=Jt[g&15][o],g>>=4,m=_n[t][Fr[r][L]],p=Jt[m&15][r],m>>=4,u=dr(m,p,!1),s=dr(g,c,!0),A=it(zn,(u>>4)*140+jr[In[s>>4]&255][at[u&15][s&15]]),A>i+1)return i-A+1;if(A>=i){L+=66>>L&3&i-A;continue}if(A=pr(it(ti,g*24+To[R][c]),it(zn,m*140+jr[In[g]&255][at[p][c]])),A>=i){L+=66>>L&3&i-A;continue}if(y=vu(e,m,p,g,c,R,i-1,a+1,L),y>=0)return e.move[a]=bt[L],y;if(y<-2)break;y<-1&&(L+=66>>L&3)}return-1}function Hp(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=es(ku,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)==0&&Su(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],Kr(It(e.selfSym,{l:je,m:0,h:0})))==0)return e.solution?Mu(e.solution):"Error 8";return e.solution?Mu(e.solution):"Error 7"}function Yp(e,t){var r;return r=Zp(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,du(!1),Vp(e),Hp(e))}function Zp(e,t){var r,n,o,l;for(n=0,o=X(re,ae,0,54,7,1),r=Up(te(ee(Fe,1),De,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]=yp(r,wp(t.charCodeAt(l)))<<24>>24,o[l]==-1)return-1;n+=1<<(o[l]<<2)}return n!=10066329?-1:(Xp(o,e.cc),Op(e.cc))}function Eu(){var e,t,r;for(this.move=X(ze,ke,0,31,7,1),this.nodeUD=X(li,se,31,21,0,1),this.nodeRL=X(li,se,31,21,0,1),this.nodeFB=X(li,se,31,21,0,1),this.cc=new ue,this.urfCubieCube=X(Ko,se,7,6,0,1),this.urfCoordCube=X(li,se,31,6,0,1),this.phase1Cubie=X(Ko,se,7,21,0,1),this.preMoveCubes=X(Ko,se,7,21,0,1),this.preMoves=X(ze,ke,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new Mo,this.nodeRL[t]=new Mo,this.nodeFB[t]=new Mo,this.phase1Cubie[t]=new ue;for(r=0;r<6;r++)this.urfCubieCube[r]=new ue,this.urfCoordCube[r]=new Mo;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new ue}function Ve(){if(!zu){zu=!0;var e,t,r,n,o,l;for(Yr=te(ee(re,2),se,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])]),er=te(ee(re,2),se,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])]),$t=et(ze,[se,ke],[17,0],7,[13,13],2),Bs=te(ee(xp,1),se,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),bt=te(ee(ze,1),ke,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),On=X(ze,ke,0,18,7,1),Qo=X(ze,ke,0,11,7,1),t=0;t<18;t++)On[bt[t]]=t;for(r=0;r<10;r++)for(n=~~(bt[r]/3),Qo[r]=0,o=0;o<10;o++)l=~~(bt[o]/3),Qo[r]|=(n==l||n%3==l%3&&n>=l?1:0)<<o;for(Qo[10]=0,e=0;e<13;e++)for($t[e][0]=$t[e][e]=1,o=1;o<e;o++)$t[e][o]=$t[e-1][o-1]+$t[e-1][o]}}function Nn(e,t,r){Ve();var n,o,l,i,a;for(n=e.length-1,l=0,a=4,o=n;o>=0;o--)i=_u(e[o],r),(i&12)==t&&(l+=$t[o][a--]);return l}function Ls(e,t){Ve();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function st(e,t,r){Ve();var n,o,l,i;for(o=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)l=_u(e[n],r)<<2,o=(t-n)*o+Kr(It(Wr(i,l),{l:15,m:0,h:0})),i=mu(i,Jl({l:1118480,m:279620,h:69905},l));return o}function _u(e,t){return t?e>>1:e&7}function Cu(e,t,r,n){Ve();var o,l,i,a;for(o=e.length-1,a=4,l=o,i=o;i>=0;i--)t>=$t[i][a]?(t-=$t[i][a--],e[i]=pi(e[i],a|r,n)):((l&12)==r&&(l-=4),e[i]=pi(e[i],l--,n))}function Hr(e,t,r,n){Ve();var o,l,i,a,f,s;for(s={l:1323536,m:2777561,h:1043915},o={l:0,m:0,h:0},a=2;a<=r;a++)o=$a(Jl(o,4),Xa(t%a)),t=~~(t/a);for(l=0;l<r-1;l++)f=(Kr(o)&15)<<2,o=Wr(o,4),e[l]=pi(e[l],Kr(It(Wr(s,f),{l:15,m:0,h:0})),n),i=mu(Jl({l:1,m:0,h:0},f),{l:1,m:0,h:0}),s=$a(It(s,i),It(Wr(s,4),{l:~i.l&$e,m:~i.m&$e,h:~i.h&cr}));e[r-1]=pi(e[r-1],Kr(It(s,{l:15,m:0,h:0})),n)}function pi(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function Xp(e,t){Ve();var r,n,o,l,i,a,f,s;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(s=0;s<3&&!(e[Yr[a][s]]==0||e[Yr[a][s]]==3);s++);for(r=e[Yr[a][(s+1)%3]],n=e[Yr[a][(s+2)%3]],f=0;f<8;f++)if(r==~~(Yr[f][1]/9)&&n==~~(Yr[f][2]/9)){t.ca[a]=Zl(s%3<<3|f);break}}for(o=0;o<12;o++)for(f=0;f<12;f++){if(e[er[o][0]]==~~(er[f][0]/9)&&e[er[o][1]]==~~(er[f][1]/9)){t.ea[o]=Zl(f<<1);break}if(e[er[o][0]]==~~(er[f][1]/9)&&e[er[o][1]]==~~(er[f][0]/9)){t.ea[o]=Zl(f<<1|1);break}}}function Pu(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 Jp(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function Mu(e){var t,r,n;if(r=new Sp,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+=". "),pu(Lu(r,(Ve(),Bs)[(J(),mi)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)pu(Lu(r,(Ve(),Bs)[(J(),mi)[n][e.moves[t]]])),(e.verbose&1)!=0&&t==e.depth1&&(r.string+=". ");return r.string}function Gu(){this.moves=X(ze,ke,0,31,7,1)}var se,$e,cr,cp,je,De,ke,Ha,Co,ae,H,Yl,$l,xp,Bu,jr,ts,kn,zn,_n,Cn,ti,To,Pn,Mn,Gn,Lr,ri,Br,ni,oi,li,Du,Zt,Xt,Tn,qr,as,Dr,gi,In,ss,Vr,Oo,Fr,Jt,at,bu,fs,us,Wo,gs,wu,ge,ci,cs,ms,mi,Ko,ku,ps,zu,$t,Qo,Yr,er,Bs,On,bt,ze,$p,re,eL,Fe,tL,rL,Iu=b(()=>{se={3:1},$e=4194303,cr=1048575,cp=524288,je=65535,De={11:1,3:1},ke={17:1,3:1},Ha=14540032,Co=286331153,ae={10:1,3:1},Yl={};Po(1,null,{},Bp);Po(79,1,{},Ya);H.createClassLiteralForArray=function(t){var r;return r=new Ya,r.modifiers=4,t>1?r.componentType=su(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!=0};xp=mr("java.lang","String",2);Bu=!1;Po(31,1,{31:1},Mo);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;oi=0,li=mr("org.cubing.min2phase.client","CoordCube",31),Du=!1;Ko=mr("org.cubing.min2phase.client","CubieCube",7);Po(72,1,{},Eu);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;ku=12,ps=7,zu=!1;Po(150,1,{},Gu);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;ze=Xl("int","I");mr("com.google.gwt.lang","CollapsedPropertyHolder",252);mr("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);$p=mr("com.google.gwt.lang","LongLibBase/LongEmul",null);mr("com.google.gwt.lang","ModuleUtils",257);re=Xl("byte","B"),eL=Xl("long","J"),Fe=Xl("char","C");mr("com.google.gwt.user.client.rpc","XsrfToken",null),Rp("java.util","Map/Entry");tL=function(){du(!1)},rL=function(e){return Yp(new Eu,e)}});async function Nu(){let e=await ve["3x3x3"].kpuzzle(),t=e.startState();for(let r of lu)t=t.applyAlg(z.fromString((await Yt())(r)));return nu(e,t)?t:Nu()}function Ou(){return nL??(nL=Promise.resolve().then(()=>(Iu(),Tu)))}async function Rs(e){return gt(),z.fromString((await Ou()).solveState(eu(e)))}async function Wn(){return Rs(await Nu())}async function Wu(){(await Ou()).initialize()}async function Ku(){return En(await Wn(),oL)}async function ju(){let e=new mt,t=await Wn();return e.experimentalPushAlg(Qu),e.experimentalPushAlg(t),e.experimentalPushAlg(Qu),e.toAlg()}var nL,oL,Qu,ds=b(()=>{Re();Vt();Mt();Ht();Hl();tu();ou();iu();nL=null;oL=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];Qu=new z("R' U' F")});function fe(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,fe}function qu(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=Ds[r-i],f=~~(t/a);l^=f,t%=a,f<<=2,e[i]=o>>f&7;let s=(1<<f)-1;o=(o&s)+(o>>4&~s)}return n<0&&(l&1)!=0?(e[r]=e[r-1],e[r-1]=o&7):e[r]=o&7,e}var me,Ds,Vu=b(()=>{me=[],Ds=[1];for(let e=0;e<32;++e){me[e]=[];for(let t=0;t<32;++t)me[e][t]=0}for(let e=0;e<32;++e){me[e][0]=me[e][e]=1,Ds[e+1]=Ds[e]*(e+1);for(let t=1;t<e;++t)me[e][t]=me[e-1][t-1]+me[e-1][t]}});var eg={};ye(eg,{initialize:()=>DB,random444Scramble:()=>FB});function T(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 gL(e){return new jo[e]}function ct(e,t,r,...n){let o=jo[e];o&&!o.___clazz$?Y=o.prototype:(!o&&(o=jo[e]=function(){}),Y=o.prototype=t<0?{}:gL(t),Y.castableTypeMap$=r);for(let l of n)l.prototype=Y;o.___clazz$&&(Y.___clazz$=o.___clazz$,o.___clazz$=null)}function hr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function Xu(){}function cL(e,t){let r=Ju(0,t);return $u(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function Ju(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 As(e,t,r,n,o){let l=Ju(o,n);return $u(e,t,r,l),l}function $u(e,t,r,n){return t1(),pL(n,ys,Us),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function Li(e,t,r){return e[t]=r}function t1(){e1||(e1=!0,ys=[],Us=[],mL(new Xu,ys,Us))}function mL(e,t,r){let n=0,o;for(let l in e)(o=e[l])&&(t[n]=l,r[n]=o,++n)}function pL(e,t,r){t1();for(let n=0,o=t.length;n<o;++n)e[t[n]]=r[n]}function LL(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function BL(e,t){return e!==null&&LL(e,t)}function RL(){if(r1)return!1;r1=!0,Fi=T(15582,36),hi=T(15582),xt=T(15582),jn=T(48,48),St=T(48,36),Qn=T(48),xs=T(48)}function bs(e){e.ct=T(24)}function n1(e,t){let r,n;if(BL(t,Yu)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function Bi(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=me[t][n--]);return r}function Ri(e){let t,r;if(Kn!==null)return Kn[Bi(e)];for(r=0;r<48;++r){if(t=yL(Bi(e)),t!==-1)return t*64+r;ie(e,0),r%2==1&&ie(e,1),r%8==7&&ie(e,2),r%16==15&&ie(e,3)}}function wt(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:F(e.ct,0,1,2,3,r);break;case 1:F(e.ct,16,17,18,19,r);break;case 2:F(e.ct,8,9,10,11,r);break;case 3:F(e.ct,4,5,6,7,r);break;case 4:F(e.ct,20,21,22,23,r);break;case 5:F(e.ct,12,13,14,15,r);break;case 6:F(e.ct,0,1,2,3,r),F(e.ct,8,20,12,16,r),F(e.ct,9,21,13,17,r);break;case 7:F(e.ct,16,17,18,19,r),F(e.ct,1,15,5,9,r),F(e.ct,2,12,6,10,r);break;case 8:F(e.ct,8,9,10,11,r),F(e.ct,2,19,4,21,r),F(e.ct,3,16,5,22,r);break;case 9:F(e.ct,4,5,6,7,r),F(e.ct,10,18,14,22,r),F(e.ct,11,19,15,23,r);break;case 10:F(e.ct,20,21,22,23,r),F(e.ct,0,8,4,14,r),F(e.ct,3,11,7,13,r);break;case 11:F(e.ct,12,13,14,15,r),F(e.ct,1,20,7,18,r),F(e.ct,0,23,6,17,r)}}function ie(e,t){switch(t){case 0:wt(e,19),wt(e,28);break;case 1:wt(e,21),wt(e,32);break;case 2:F(e.ct,0,3,1,2,1),F(e.ct,8,11,9,10,1),F(e.ct,4,7,5,6,1),F(e.ct,12,15,13,14,1),F(e.ct,16,19,21,22,1),F(e.ct,17,18,20,23,1);break;case 3:wt(e,18),wt(e,29),wt(e,24),wt(e,35)}}function o1(e,t){let r;for(r=0;r<t;++r)ie(e,0),r%2==1&&ie(e,1),r%8==7&&ie(e,2),r%16==15&&ie(e,3)}function ws(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=me[r][n]&&(t-=me[r][n--],e.ct[r]=1)}function di(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function qo(){let e;for(bs(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function Di(e,t){let r;for(bs(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function Vo(e){let t;for(bs(this),t=0;t<24;++t)this.ct[t]=e[t]}function dL(){let e,t,r=new qo,n=new qo;for(e=0;e<15582;++e)for(ws(n,hi[e]),t=0;t<36;++t)di(r,n),wt(r,t),Fi[e][t]=Ri(r)}function DL(){let e,t,r,n,o,l,i,a;for(Ii(xt),xt[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(xt[n]===a){for(i=0;i<27;++i)if(o=~~Fi[n][i]>>>6,xt[o]===e)if(++r,l){xt[n]=t;break}else xt[o]=t}}function FL(e){let t,r,n,o=new Vo(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;ie(o,0),n%2==1&&ie(o,1),n%8==7&&ie(o,2),n%16==15&&ie(o,3)}return-1}function hL(){let e,t,r,n=new qo;for(e=0;e<24;++e)n.ct[e]=e;let o=new Vo(n.ct),l=new Vo(n.ct),i=new Vo(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)n1(n,o)&&(jn[e][t]=r,r===0&&(Qn[e]=t)),ie(o,0),r%2==1&&ie(o,1),r%8==7&&ie(o,2),r%16==15&&ie(o,3);ie(n,0),t%2==1&&ie(n,1),t%8==7&&ie(n,2),t%16==15&&ie(n,3)}ie(n,0),e%2==1&&ie(n,1),e%8==7&&ie(n,2),e%16==15&&ie(n,3)}for(e=0;e<48;++e)for(di(n,l),o1(n,Qn[e]),t=0;t<36;++t)for(di(o,n),wt(o,t),o1(o,e),r=0;r<36;++r)if(di(i,l),wt(i,r),n1(i,o)){St[e][t]=r;break}for(ws(n,0),e=0;e<48;++e)xs[Qn[e]]=Bi(n),ie(n,0),e%2==1&&ie(n,1),e%8==7&&ie(n,2),e%16==15&&ie(n,3)}function AL(){let e,t,r,n,o=new qo,l=T(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(ws(o,t),n=0;n<48;++n)r=Bi(o),l[~~r>>>5]|=1<<(r&31),Kn!==null&&(Kn[r]=e<<6|Qn[n]),ie(o,0),n%2==1&&ie(o,1),n%8==7&&ie(o,2),n%16==15&&ie(o,3);hi[e++]=t}}function yL(e){let t=uB(hi,e);return t>=0?t:-1}function UL(){l1||(l1=!0,bi=T(70,28),Ui=T(6435,28),g1=T(70,16),f1=T(6435,16),tt=T(450450),u1=[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 Ai(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=me[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+=me[t][n--]);return r*2+e.parity}function qn(e,t){e.parity^=u1[t];let r=t%3;switch(t=~~(t/3),t){case 0:F(e.ct,0,1,2,3,r);break;case 1:F(e.rl,0,1,2,3,r);break;case 2:F(e.ct,8,9,10,11,r);break;case 3:F(e.ct,4,5,6,7,r);break;case 4:F(e.rl,4,5,6,7,r);break;case 5:F(e.ct,12,13,14,15,r);break;case 6:F(e.ct,0,1,2,3,r),F(e.rl,0,5,4,1,r),F(e.ct,8,9,12,13,r);break;case 7:F(e.rl,0,1,2,3,r),F(e.ct,1,15,5,9,r),F(e.ct,2,12,6,10,r);break;case 8:F(e.ct,8,9,10,11,r),F(e.rl,0,3,6,5,r),F(e.ct,3,2,5,4,r);break;case 9:F(e.ct,4,5,6,7,r),F(e.rl,3,2,7,6,r),F(e.ct,11,10,15,14,r);break;case 10:F(e.rl,4,5,6,7,r),F(e.ct,0,8,4,14,r),F(e.ct,3,11,7,13,r);break;case 11:F(e.ct,12,13,14,15,r),F(e.rl,1,4,7,2,r),F(e.ct,1,0,7,6,r)}}function Vn(e,t){switch(t){case 0:qn(e,19),qn(e,28);break;case 1:qn(e,21),qn(e,32);break;case 2:F(e.ct,0,3,1,2,1),F(e.ct,8,11,9,10,1),F(e.ct,4,7,5,6,1),F(e.ct,12,15,13,14,1),F(e.rl,0,3,5,6,1),F(e.rl,1,2,4,7,1)}}function i1(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 a1(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=me[r][n]?(t-=me[r][n--],e.ct[r]=1):e.ct[r]=0}function s1(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=me[r][n]?(t-=me[r][n--],e.rl[r]=1):e.rl[r]=0}function Ss(){this.rl=T(8),this.ct=T(16)}function bL(){let e,t,r,n,o,l,i,a,f,s,g=new Ss;for(o=0;o<70;++o)for(a=0;a<28;++a)s1(g,o),qn(g,Xr[a]),bi[o][a]=yi(g);for(o=0;o<70;++o)for(s1(g,o),i=0;i<16;++i)g1[o][i]=yi(g),Vn(g,0),i%2==1&&Vn(g,1),i%8==7&&Vn(g,2);for(o=0;o<6435;++o)for(a1(g,o),i=0;i<16;++i)f1[o][i]=Ai(g)&65535,Vn(g,0),i%2==1&&Vn(g,1),i%8==7&&Vn(g,2);for(o=0;o<6435;++o)for(a=0;a<28;++a)a1(g,o),qn(g,Xr[a]),Ui[o][a]=Ai(g)&65535;for(Ii(tt),tt[0]=tt[18]=tt[28]=tt[46]=tt[54]=tt[56]=0,r=0,n=6;n!==450450;){let c=r>6,u=c?-1:r,m=c?r:-1;for(++r,o=0;o<450450;++o)if(tt[o]===u){for(e=~~(o/70),f=o%70,a=0;a<23;++a)if(t=Ui[e][a],s=bi[f][a],l=t*70+s,tt[l]===m)if(++n,c){tt[o]=r;break}else tt[l]=r}}}function wL(){c1||(c1=!0,Ho=T(29400,20),p1=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],Ar=T(29400),ks=[0,9,14,23,27,28,41,42,46,55,60,69],zs=T(70))}function vs(e){let t,r,n,o;for(r=0,o=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=me[t][o--]);for(r*=35,o=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=me[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+=me[t][o--]);return e.parity+2*(r+zs[n])}function xL(e,t){switch(e.parity^=p1[t],t){case 0:case 1:case 2:F(e.ud,0,1,2,3,t%3);break;case 3:F(e.rl,0,1,2,3,1);break;case 4:case 5:case 6:F(e.fb,0,1,2,3,(t-1)%3);break;case 7:case 8:case 9:F(e.ud,4,5,6,7,(t-1)%3);break;case 10:F(e.rl,4,5,6,7,1);break;case 11:case 12:case 13:F(e.fb,4,5,6,7,(t+1)%3);break;case 14:F(e.ud,0,1,2,3,1),F(e.rl,0,5,4,1,1),F(e.fb,0,5,4,1,1);break;case 15:F(e.rl,0,1,2,3,1),F(e.fb,1,4,7,2,1),F(e.ud,1,6,5,2,1);break;case 16:F(e.fb,0,1,2,3,1),F(e.ud,3,2,5,4,1),F(e.rl,0,3,6,5,1);break;case 17:F(e.ud,4,5,6,7,1),F(e.rl,3,2,7,6,1),F(e.fb,3,2,7,6,1);break;case 18:F(e.rl,4,5,6,7,1),F(e.fb,0,3,6,5,1),F(e.ud,0,3,4,7,1);break;case 19:F(e.fb,4,5,6,7,1),F(e.ud,0,7,6,1,1),F(e.rl,1,4,7,2,1)}}function m1(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 SL(e,t){let r,n,o,l;for(e.parity=t&1,t>>>=1,o=ks[t%12],t=~~(t/12),l=4,r=7;r>=0;--r)e.rl[r]=0,o>=me[r][l]&&(o-=me[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>=me[r][l]?(n-=me[r][l--],e.fb[r]=1):e.fb[r]=0;for(l=4,e.ud[7]=0,r=6;r>=0;--r)t>=me[r][l]?(t-=me[r][l--],e.ud[r]=1):e.ud[r]=0}function Es(){this.ud=T(8),this.rl=T(8),this.fb=T(8)}function vL(){let e,t,r,n;for(r=0;r<12;++r)zs[ks[r]]=r;let o=new Es;for(r=0;r<29400;++r)for(n=0;n<20;++n)SL(o,r),xL(o,n),Ho[r][n]=vs(o)&65535;for(Ii(Ar),Ar[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(Ar[r]===e)for(n=0;n<17;++n)Ar[Ho[r][n]]===-1&&(Ar[Ho[r][n]]=e+1,++t);++e}}function EL(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function kL(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:F(e.ct,0,1,2,3,r);break;case 1:F(e.ct,16,17,18,19,r);break;case 2:F(e.ct,8,9,10,11,r);break;case 3:F(e.ct,4,5,6,7,r);break;case 4:F(e.ct,20,21,22,23,r);break;case 5:F(e.ct,12,13,14,15,r);break;case 6:F(e.ct,0,1,2,3,r),F(e.ct,8,20,12,16,r),F(e.ct,9,21,13,17,r);break;case 7:F(e.ct,16,17,18,19,r),F(e.ct,1,15,5,9,r),F(e.ct,2,12,6,10,r);break;case 8:F(e.ct,8,9,10,11,r),F(e.ct,2,19,4,21,r),F(e.ct,3,16,5,22,r);break;case 9:F(e.ct,4,5,6,7,r),F(e.ct,10,18,14,22,r),F(e.ct,11,19,15,23,r);break;case 10:F(e.ct,20,21,22,23,r),F(e.ct,0,8,4,14,r),F(e.ct,3,11,7,13,r);break;case 11:F(e.ct,12,13,14,15,r),F(e.ct,1,20,7,18,r),F(e.ct,0,23,6,17,r)}}function _s(){let e;for(this.ct=T(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function L1(e){let t,r,n;for(_s.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 zL(){B1||(B1=!0,Rt=T(18),PL())}function R1(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function d1(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function _L(e,t){!e.temps&&(e.temps=new wi),D1(e,Rt[t],e.temps),d1(e,e.temps)}function CL(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 D1(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 wi(){R1(this)}function yr(e,t){R1(this),qu(this.cp,e),CL(this,t)}function F1(e){yr.call(this,e(40320),e(2187))}function PL(){let e,t;for(Rt[0]=new yr(15120,0),Rt[3]=new yr(21021,1494),Rt[6]=new yr(8064,1236),Rt[9]=new yr(9,0),Rt[12]=new yr(1230,412),Rt[15]=new yr(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)Rt[e+t+1]=new wi,D1(Rt[e+t],Rt[e],Rt[e+t+1])}function ML(){h1||(h1=!0,vt=T(1937880),Ei=T(1538),ki=T(1538),Jn=T(11880),x1=[0,1,6,3,4,5,2,7],Gs=T(160,12),Ts=T(160,12),Ms=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],Ps=[0,2,4,6,1,3,7,5,8,9,10,11])}function Hn(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 Yn(e,t){let r,n,o,l,i;for(e.isStd||b1(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 A1(e){let t,r=Yn(e,4);t=Jn[r];let n=t&7;t>>=3,Si(e,n);let o=Yn(e,10)%20160;return t*20160+o}function xi(e,t){switch(e.isStd=!1,t){case 0:fe(e.edge,0,4,1,5),fe(e.edgeo,0,4,1,5);break;case 1:Be(e.edge,0,4,1,5),Be(e.edgeo,0,4,1,5);break;case 2:fe(e.edge,0,5,1,4),fe(e.edgeo,0,5,1,4);break;case 3:Be(e.edge,5,10,6,11),Be(e.edgeo,5,10,6,11);break;case 4:fe(e.edge,0,11,3,8),fe(e.edgeo,0,11,3,8);break;case 5:Be(e.edge,0,11,3,8),Be(e.edgeo,0,11,3,8);break;case 6:fe(e.edge,0,8,3,11),fe(e.edgeo,0,8,3,11);break;case 7:fe(e.edge,2,7,3,6),fe(e.edgeo,2,7,3,6);break;case 8:Be(e.edge,2,7,3,6),Be(e.edgeo,2,7,3,6);break;case 9:fe(e.edge,2,6,3,7),fe(e.edgeo,2,6,3,7);break;case 10:Be(e.edge,4,8,7,9),Be(e.edgeo,4,8,7,9);break;case 11:fe(e.edge,1,9,2,10),fe(e.edgeo,1,9,2,10);break;case 12:Be(e.edge,1,9,2,10),Be(e.edgeo,1,9,2,10);break;case 13:fe(e.edge,1,10,2,9),fe(e.edgeo,1,10,2,9);break;case 14:Be(e.edge,0,4,1,5),Be(e.edgeo,0,4,1,5),fe(e.edge,9,11),fe(e.edgeo,8,10);break;case 15:Be(e.edge,5,10,6,11),Be(e.edgeo,5,10,6,11),fe(e.edge,1,3),fe(e.edgeo,0,2);break;case 16:Be(e.edge,0,11,3,8),Be(e.edgeo,0,11,3,8),fe(e.edge,5,7),fe(e.edgeo,4,6);break;case 17:Be(e.edge,2,7,3,6),Be(e.edgeo,2,7,3,6),fe(e.edge,8,10),fe(e.edgeo,9,11);break;case 18:Be(e.edge,4,8,7,9),Be(e.edgeo,4,8,7,9),fe(e.edge,0,2),fe(e.edgeo,1,3);break;case 19:Be(e.edge,1,9,2,10),Be(e.edgeo,1,9,2,10),fe(e.edge,4,6),fe(e.edgeo,5,7)}}function Zn(e,t){switch(e.isStd=!1,t){case 0:xi(e,14),xi(e,17);break;case 1:Hn(e,11,5,10,6),Hn(e,5,10,6,11),Hn(e,1,2,3,0),Hn(e,4,9,7,8),Hn(e,8,4,9,7),Hn(e,0,1,2,3);break;case 2:dt(e,4,5),dt(e,5,4),dt(e,11,8),dt(e,8,11),dt(e,7,6),dt(e,6,7),dt(e,9,10),dt(e,10,9),dt(e,1,1),dt(e,0,0),dt(e,3,3),dt(e,2,2)}}function Si(e,t){for(;t>=2;)t-=2,Zn(e,1),Zn(e,2);t!==0&&Zn(e,0)}function Yo(e,t){let r,n,o,l,i,a;for(i=1985229328,a=47768,o=0,r=0;r<11;++r)if(n=Ms[11-r],l=~~(t/n),t=t%n,o^=l,l<<=2,l>=32){l=l-32,e.edge[r]=a>>l&15;let f=(1<<l)-1;a=(a&f)+(a>>4&~f)}else{e.edge[r]=i>>l&15;let f=(1<<l)-1;i=(i&f)+(i>>>4&~f)+(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 y1(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 U1(e,t){let r,n,o,l;for(e.temp===null&&(e.temp=T(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[Ps[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[Ps[r]]%12];return n}function b1(e){let t;for(e.temp===null&&(e.temp=T(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 Be(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 dt(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function tr(){this.edge=T(12),this.edgeo=T(12)}function GL(){let e,t,r,n,o,l,i,a,f,s,g,c,u,m,p,L,R,D,A,y,k,E,Q=new tr,$=new tr,G=new tr;for(Ii(vt),a=0,vi=1,Cs(vt,0,0);vi!==31006080&&(p=a>9,i=a%3,l=(a+1)%3,s=p?3:i,e=p?i:3,!(a>=9));){for(c=0;c<31006080;c+=16)if(E=vt[~~c>>4],!(!p&&E===-1)){for(g=c,f=c+16;g<f;++g,E>>=2)if((E&3)===s){for(A=~~(g/20160),t=Ei[A],n=g%20160,Yo(Q,t*20160+n),R=0;R<17;++R)if(r=Xn(Q.edge,R<<3,4),y=Jn[r],k=y&7,y>>=3,o=Xn(Q.edge,R<<3|k,10)%20160,u=y*20160+o,Zo(vt,u)===e){if(Cs(vt,p?g:u,l),++vi,p)break;if(D=ki[y],D!==1)for(y1($,Q),xi($,R),Si($,k),L=1;(D=~~D>>1&65535)!=0;++L)(D&1)==1&&(y1(G,$),Si(G,L),m=y*20160+Yn(G,10)%20160,Zo(vt,m)===e&&(Cs(vt,m,l),++vi))}}}++a}}function Zo(e,t){return e[t>>4]>>((t&15)<<1)&3}function Xn(e,t,r){let n,o,l,i,a,f=Ts[t],s=Gs[t];for(o=0,a=1985229328,i=47768,n=0;n<r;++n)l=f[e[s[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 w1(e){let t,r,n,o,l,i,a,f,s,g,c,u=new tr;if(i=0,l=Zo(vt,e),l===3)return 10;for(;e!==0;)for(l===0?l=2:--l,s=~~(e/20160),t=Ei[s],n=e%20160,Yo(u,t*20160+n),f=0;f<17;++f)if(r=Xn(u.edge,f<<3,4),g=Jn[r],c=g&7,g>>=3,o=Xn(u.edge,f<<3|c,10)%20160,a=g*20160+o,Zo(vt,a)===l){++i,e=a;break}return i}function TL(e,t){let r=Zo(vt,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function IL(){let e,t,r,n=new tr;for(t=0;t<20;++t)for(r=0;r<8;++r){for(Yo(n,0),xi(n,t),Si(n,r),e=0;e<12;++e)Gs[t<<3|r][e]=n.edge[e];for(b1(n),e=0;e<12;++e)Ts[t<<3|r][e]=n.temp[e]}}function NL(){let e,t,r,n,o=new tr,l=T(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(Yo(o,t*Ms[8]),n=0;n<8;++n)r=Yn(o,4),r===t&&(ki[e]=(ki[e]|1<<n)&65535),l[~~r>>3]=l[~~r>>3]|1<<(r&7),Jn[r]=e<<3|x1[n],Zn(o,0),n%2==1&&(Zn(o,1),Zn(o,2));Ei[e++]=t}}function Cs(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function OL(){S1||(S1=!0)}function WL(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 KL(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function QL(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:F(e.ep,0,1,2,3,r),F(e.ep,12,13,14,15,r);break;case 1:F(e.ep,11,15,10,19,r),F(e.ep,23,3,22,7,r);break;case 2:F(e.ep,0,11,6,8,r),F(e.ep,12,23,18,20,r);break;case 3:F(e.ep,4,5,6,7,r),F(e.ep,16,17,18,19,r);break;case 4:F(e.ep,1,20,5,21,r),F(e.ep,13,8,17,9,r);break;case 5:F(e.ep,2,9,4,10,r),F(e.ep,14,21,16,22,r);break;case 6:F(e.ep,0,1,2,3,r),F(e.ep,12,13,14,15,r),F(e.ep,9,22,11,20,r);break;case 7:F(e.ep,11,15,10,19,r),F(e.ep,23,3,22,7,r),F(e.ep,2,16,6,12,r);break;case 8:F(e.ep,0,11,6,8,r),F(e.ep,12,23,18,20,r),F(e.ep,3,19,5,13,r);break;case 9:F(e.ep,4,5,6,7,r),F(e.ep,16,17,18,19,r),F(e.ep,8,23,10,21,r);break;case 10:F(e.ep,1,20,5,21,r),F(e.ep,13,8,17,9,r),F(e.ep,14,0,18,4,r);break;case 11:F(e.ep,2,9,4,10,r),F(e.ep,14,21,16,22,r),F(e.ep,7,15,1,17,r)}}function Is(){let e;for(this.ep=T(24),e=0;e<24;++e)this.ep[e]=e}function v1(e){let t,r,n;for(Is.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 jL(){E1||(E1=!0,Ns=[35,1,34,2,4,6,22,5,19])}function k1(e){e.moveBuffer=T(60)}function qL(e,t){return e.value-t.value}function $n(e,t){let r;for(KL(e.edge,t.edge),EL(e.center,t.center),d1(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 Ur(e){for(;e.centerAvail<e.moveLength;)kL(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function z1(e){for(;e.cornerAvail<e.moveLength;)_L(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function Xo(e){for(;e.edgeAvail<e.moveLength;)QL(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function VL(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)St[i][e.moveBuffer[t]]>=27?(a[r++]=St[i][e.moveBuffer[t]]-9,o=Ns[St[i][e.moveBuffer[t]]-27],i=jn[i][o]):a[r++]=St[i][e.moveBuffer[t]];let f=jn[Qn[i]][FL(Ur(e))];for(l="",i=f,t=r-1;t>=0;--t)n=a[t],n=~~(n/3)*3+(2-n%3),St[i][n]>=27?(l=l+Os[St[i][n]-9]+" ",o=Ns[St[i][n]-27],i=jn[i][o]):l=l+Os[St[i][n]]+" ";return l}function Zr(e,t){e.moveBuffer[e.moveLength++]=t}function zi(){k1(this),this.edge=new Is,this.center=new _s,this.corner=new wi}function _i(e){zi.call(this),$n(this,e)}function _1(e){k1(this),this.edge=new v1(e),this.center=new L1(e),this.corner=new F1(e)}function HL(e,t){return t.value-e.value}function Ci(e,t){return HL(e,t)}function C1(){}function YL(){if(P1)return;P1=!0;let e,t;for(Os=["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'"],Xr=[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],Jo=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],M1=T(37),G1=T(37),eo=T(37,36),Pi=T(29,28),Mi=T(21,20),Ws=T(36),$o=T(28),to=T(20),e=0;e<29;++e)M1[Xr[e]]=e;for(e=0;e<21;++e)G1[Jo[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)eo[e][t]=~~(e/3)==~~(t/3)||~~(e/3)%3==~~(t/3)%3&&e>t;eo[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)Pi[e][t]=eo[Xr[e]][Xr[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)Mi[e][t]=eo[Jo[e]][Jo[t]];for(e=0;e<36;++e)for(Ws[e]=36,t=e;t<36;++t)if(!eo[e][t]){Ws[e]=t-1;break}for(e=0;e<28;++e)for($o[e]=28,t=e;t<28;++t)if(!Pi[e][t]){$o[e]=t-1;break}for(e=0;e<20;++e)for(to[e]=20,t=e;t<20;++t)if(!Mi[e][t]){to[e]=t-1;break}}function ZL(e){let t,r,n,o,l,i,a,f,s,g,c,u;e.solution="";let m=Ri(new Di(Ur(e.c),0)),p=Ri(new Di(Ur(e.c),1)),L=Ri(new Di(Ur(e.c),2)),R=xt[~~m>>6],D=xt[~~p>>6],A=xt[~~L>>6];for(e.p1SolsCnt=0,e.arr2idx=0,lB(e.p1sols.heap),e.length1=(R<D?R:D)<A?R<D?R:D:A;e.length1<100&&!(A<=e.length1&&Gi(e,~~L>>>6,L&63,e.length1,-1,0)||R<=e.length1&&Gi(e,~~m>>>6,m&63,e.length1,-1,0)||D<=e.length1&&Gi(e,~~p>>>6,p&63,e.length1,-1,0));++e.length1);let y=BB(e.p1sols,As(dB,hr([sL,Fs,hs]),Zu,0,0));y.sort(function(Q,$){return Q.value-$.value}),t=9;do{e:for(f=y[0].value;f<100;++f)for(i=0;i<y.length&&!(y[i].value>f);++i)if(!(f-y[i].length1>t)&&($n(e.c1,y[i]),i1(e.ct2,Ur(e.c1),Ti(Xo(e.c1).ep)),c=Ai(e.ct2),u=yi(e.ct2),e.length1=y[i].length1,e.length2=f-y[i].length1,T1(e,c,u,e.length2,28,0)))break e;++t}while(f===100);e.arr2.sort(function(Q,$){return Q.value-$.value}),a=0,r=13;do{e:for(s=e.arr2[0].value;s<100;++s)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>s);++i)if(!(s-e.arr2[i].length1-e.arr2[i].length2>r)&&(l=U1(e.e12,Xo(e.arr2[i])),m1(e.ct3,Ur(e.arr2[i]),l^Ti(z1(e.arr2[i]).cp)),n=vs(e.ct3),o=Yn(e.e12,10),g=w1(A1(e.e12)),g<=s-e.arr2[i].length1-e.arr2[i].length2&&I1(e,o,n,g,s-e.arr2[i].length1-e.arr2[i].length2,20,0))){a=i;break e}++r}while(s===100);let k=new _i(e.arr2[a]);e.length1=k.length1,e.length2=k.length2;let E=s-e.length1-e.length2;for(i=0;i<E;++i)Zr(k,Jo[e.move3[i]]);e.solution=VL(k)}function XL(e,t){let r,n;for($n(e.c1,e.c),r=0;r<e.length1;++r)Zr(e.c1,e.move1[r]);switch(xs[t]){case 0:Zr(e.c1,24),Zr(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break;case 12869:Zr(e.c1,18),Zr(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}i1(e.ct2,Ur(e.c1),Ti(Xo(e.c1).ep));let o=Ai(e.ct2),l=yi(e.ct2),i=tt[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 _i(e.c1):(n=pB(e.p1sols),n.value>e.c1.value&&$n(n,e.c1)),rB(e.p1sols,n),e.p1SolsCnt===1e4}function JL(e){let t;for($n(e.c2,e.c1),t=0;t<e.length2;++t)Zr(e.c2,e.move2[t]);if(!WL(Xo(e.c2)))return!1;let r=U1(e.e12,Xo(e.c2));m1(e.ct3,Ur(e.c2),r^Ti(z1(e.c2).cp));let n=vs(e.ct3);Yn(e.e12,10);let o=w1(A1(e.e12));return e.arr2[e.arr2idx]?$n(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new _i(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(o,Ar[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function $L(e,t){return O1(),e.c=new _1(t),ZL(e),e.solution}function Gi(e,t,r,n,o,l){let i,a,f,s,g,c;if(t===0)return n===0&&XL(e,r);for(i=0;i<27;i+=3)if(!(i===o||i===o-9||i===o-18))for(s=0;s<3;++s){if(f=i+s,a=Fi[t][St[r][f]],g=xt[~~a>>>6],g>=n){if(g>n)break;continue}if(c=jn[r][a&63],a>>>=6,e.move1[l]=f,Gi(e,a,c,n-1,i,l+1))return!0}return!1}function T1(e,t,r,n,o,l){let i,a,f,s;if(t===0&&tt[r]===0)return n===0&&JL(e);for(a=0;a<23;++a){if(Pi[o][a]){a=$o[a];continue}if(i=Ui[t][a],s=bi[r][a],f=tt[i*70+s],f>=n){f>n&&(a=$o[a]);continue}if(e.move2[l]=Xr[a],T1(e,i,s,n-1,a,l+1))return!0}return!1}function I1(e,t,r,n,o,l,i){let a,f,s,g,c,u,m,p,L;if(o===0)return t===0&&r===0;for(Yo(e.tempe[i],t),c=0;c<17;++c){if(Mi[l][c]){c=to[c];continue}if(s=Ho[r][c],u=Ar[s],u>=o){u>o&&c<14&&(c=to[c]);continue}if(g=Xn(e.tempe[i].edge,c<<3,10),a=~~(g/20160),p=Jn[a],L=p&7,p>>=3,f=Xn(e.tempe[i].edge,c<<3|L,10)%20160,m=TL(p*20160+f,n),m>=o){m>o&&c<14&&(c=to[c]);continue}if(I1(e,g,s,m,o-1,c,i+1))return e.move3[i]=c,!0}return!1}function N1(){let e;for(this.p1sols=new Y1(new C1),this.move1=T(15),this.move2=T(20),this.move3=T(20),this.c1=new zi,this.c2=new zi,this.ct2=new Ss,this.ct3=new Es,this.e12=new tr,this.tempe=T(20),this.arr2=T(100),e=0;e<20;++e)this.tempe[e]=new tr}function O1(){W1||(hL(),Kn=T(735471),AL(),dL(),Kn=null,DL(),bL(),vL(),IL(),NL(),GL(),W1=!0)}function eB(){K1||(K1=!0)}function Ti(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 F(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 Q1(){}function j1(e,t,r,n){let o=new Q1;return o.typeName=e+t,V1(r!==0?-r:0)&&H1(r!==0?-r:0,o),o.modifiers=4,o.superclass=Ks,o.componentType=n,o}function q1(e,t,r,n){let o=new Q1;return o.typeName=e+t,V1(r)&&H1(r,o),o.superclass=n,o}function tB(e){let t=jo[e.seedId];return e=null,t}function V1(e){return typeof e=="number"&&e>0}function H1(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=tB(t);if(n)r=n.prototype;else{n=jo[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function rB(e,t){if(mB(e,t))return!0}function nB(e){e.array=As(Z1,hr([Fs,hs]),Hu,0,0)}function oB(e,t){return Li(e.array,e.size++,t),!0}function lB(e){e.array=As(Z1,hr([Fs,hs]),Hu,0,0),e.size=0}function br(e,t){return e.array[t]}function iB(e,t){let r=e.array[t];return fB(e.array,t,1),--e.size,r}function ro(e,t,r){let n=e.array[t];return Li(e.array,t,r),n}function aB(e,t){let r;for(t.length<e.size&&(t=cL(t,e.size)),r=0;r<e.size;++r)Li(t,r,e.array[r]);return t.length>e.size&&Li(t,e.size,null),t}function sB(){nB(this),this.array.length=500}function fB(e,t,r){e.splice(t,r)}function uB(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 Ii(e){gB(e,e.length)}function gB(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function cB(e,t){let r,n,o,l,i=e.heap.size,a=br(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,o=n+1,l=n,o<i&&Ci(br(e.heap,o),br(e.heap,n))<0&&(l=o),l),!(Ci(a,br(e.heap,r))<0));)ro(e.heap,t,br(e.heap,r)),t=r;ro(e.heap,t,a)}function mB(e,t){let r,n;for(n=e.heap.size,oB(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),Ci(br(e.heap,n),t)<=0)return ro(e.heap,r,t),!0;ro(e.heap,r,br(e.heap,n))}return ro(e.heap,n,t),!0}function pB(e){if(e.heap.size===0)return null;let t=br(e.heap,0);return LB(e),t}function LB(e){let t=iB(e.heap,e.heap.size-1);0<e.heap.size&&(ro(e.heap,0,t),cB(e,0))}function BB(e,t){return aB(e.heap,t)}function Y1(e){this.heap=new sB,this.cmp=e}function $1(){J1||(J1=!0,YL(),eB(),RL(),UL(),wL(),ML(),zL(),OL(),jL(),X1=new N1)}function DB(){$1(),O1()}async function FB(){gt(),$1();let e=z.fromString($L(X1,await Qe()));return(await Wn()).concat(e)}var Y,jo,lL,Hu,Fs,Yu,iL,aL,Zu,sL,fL,uL,hs,e1,ys,Us,r1,xt,Fi,xs,Kn,hi,Qn,St,jn,l1,Ui,tt,f1,u1,bi,g1,c1,Ho,p1,Ar,ks,zs,B1,Rt,h1,Ps,vi,vt,Ms,Gs,Ts,Jn,Ei,x1,ki,S1,E1,Ns,P1,eo,Pi,Mi,Xr,Os,Jo,Ws,$o,to,M1,G1,W1,K1,Ks,Z1,RB,dB,X1,J1,tg=b(()=>{Re();ds();Vu();Mt();Ht();jo={},lL={},Hu=0,Fs=30,Yu=21,iL=22,aL=23,Zu=24,sL=25,fL=34,uL=26,hs=40;ct(1,-1,lL);Y.value=null;ct(73,1,{},Xu);Y.queryId$=0;e1=!1;r1=!1;ct(153,1,hr([Yu]),qo,Di,Vo);Kn=null,l1=!1;ct(154,1,{},Ss);Y.parity=0;c1=!1;ct(155,1,{},Es);Y.parity=0;ct(156,1,{},_s,L1);B1=!1;ct(157,1,hr([iL]),wi,yr,F1);Y.temps=null;h1=!1;ct(158,1,hr([aL]),tr);Y.isStd=!0;Y.temp=null;vi=0,S1=!1;ct(159,1,{},Is,v1);E1=!1;ct(160,1,hr([Zu,fL]),zi,_i,_1);Y.compareTo$=function(t){return qL(this,t)};Y.add1=!1;Y.center=null;Y.centerAvail=0;Y.corner=null;Y.cornerAvail=0;Y.edge=null;Y.edgeAvail=0;Y.length1=0;Y.length2=0;Y.length3=0;Y.moveLength=0;Y.sym=0;Y.value=0;ct(161,1,{},C1);Y.compare=function(t,r){return Ci(t,r)};P1=!1;ct(163,1,hr([uL]),N1);Y.add1=!1;Y.arr2idx=0;Y.c=null;Y.length1=0;Y.length2=0;Y.p1SolsCnt=0;Y.solution="";W1=!1,K1=!1;Y.val$outerIter=null;Y.size=0;ct(239,1,{},Y1);Y.cmp=null;Y.heap=null;Ks=q1("java.lang.","Object",1,null),Z1=j1("[Ljava.lang.","Object;",356,Ks),RB=q1("cs.threephase.","FullCube",160,Ks),dB=j1("[Lcs.threephase.","FullCube;",381,RB),J1=!1});var Gg={};ye(Gg,{randomFTOScrambleString:()=>FR});function el(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function Ni(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 ag(e,t,r,n,o=e-t-r-n){return Ni(e,t+r)*Ni(t+r,t)*Ni(n+o,n)}function xB(e){e=e.slice();let t=e.length,r=el(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 SB(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 js(e,t){let r=[],n=el(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 Jr(e){return xB(e)>>1}function qs(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 sg(e,t){let r=qs(e,t);return SB(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function vB(e){return e|=0,31-Math.clz32(e^e-1)}function fg(e,t){e|=0,t|=0;let r=e+" "+t;if(Vs[r])return Vs[r];let n=Ni(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 f=a|a-1;a=f+1|(~f&-~f)-1>>vB(a)+1}return Vs[r]=[o,l]}function EB(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function ug(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 kB(e,t){return ug(e)|ug(t)<<1}function no(e,t,r,n,o){if(e|=0,t|=0,r|=0,n|=0,o|=0,e!==t+r+n+o)throw"generate_comb4_lookup_tables: invalid parameters";let l=[e,t,r,n,o].join(" ");if(Hs[l])return Hs[l];let[i,a]=fg(e,r+o),[f,s]=fg(e,n+o),g=ag(e,t,r,n,o),c=new Uint32Array(g),u=new Uint32Array(4**e).fill(-1);for(let m=0,p=0;m<f.length;m++){let L=f[m];for(let R=0;R<i.length;R++){let D=i[R];if(EB(D&L)===o){let A=kB(D,L);c[p]=A,u[A]=p,p++}}}return Hs[l]=[c,u]}function He(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function oo(e,t,r){let n=[];for(let o=0;o<r.length;o++)n[o]=e[t[r[o]]];return n}function Ys(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 $r(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 Zs(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function zB(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function _B(e,t){return e*t/zB(e,t)}function CB(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=_B(t,l)}return t}function WB(e,t){for(let r=0;r<6;r++){if(e===Et[wr[r][0]]&&t===Et[wr[r][2]])return[r,0];if(e===Et[wr[r][2]]&&t===Et[wr[r][0]])return[r,1]}throw"unknown corner piece"}function KB(e,t){for(let r=0;r<12;r++)if(e===Et[xr[r][0]]&&t===Et[xr[r][1]]||t===Et[xr[r][0]]&&e===Et[xr[r][1]])return r;throw"unknown edge piece"}function Xs(e,t){return WB(e[wr[t][0]],e[wr[t][2]])}function Ki(e,t){return KB(e[xr[t][0]],e[xr[t][1]])}function QB(e,t,r,n){let o=wr[t],l=wr[r].map(i=>Et[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 jB(e,t,r){let n=xr[t],o=xr[r].map(l=>Et[l]);for(let l=0;l<2;l++)e[n[l]]=o[l]}function mg(e){let t=e.map(f=>Et[f]),n=Array(6).fill().map((f,s)=>Xs(t,s)).map(([f,s])=>f+6*s),o=n.concat(n.map(f=>(f+6)%12)),l=Array(12).fill().map((f,s)=>Ki(t,s)),i=Array(12).fill().map((f,s)=>en.indexOf(e[en[s]])),a=Array(12).fill().map((f,s)=>lo.indexOf(e[lo[s]]));return{cp:o,ep:l,ap:i,bp:a}}function VB(e){let t=Array(72),r=sg(5,e);r.push(5);let n=Array(4).fill().map(a=>e(2));n.push(n.reduce((a,f)=>a^f)),n.push(0);for(let a=0;a<6;a++)QB(t,a,r[a],n[a]);let o=sg(12,e);for(let a=0;a<12;a++)jB(t,a,o[a]);let l=qs(12,e).map(a=>a/3|0),i=qs(12,e).map(a=>4+(a/3|0));for(let a=0;a<12;a++)t[en[a]]=l[a],t[lo[a]]=i[a];return t}function Lg(e,t=!1){if(t){let l=0,i=1,a=2,f=3,s=4,g=5,c=6,u=7;e=e.map(L=>L.slice());let m=[l,i,a,f,s,g,c,u],p=[[l,f,g,c,s,u,i,a],[u,i,l,c,f,g,s,a],[u,s,a,i,f,l,c,g],[a,s,g,f,c,l,i,u]];p=p.concat(p.map(L=>Zs(L)));for(let L=0;L<e.length;L++)if(e[L][0]<4)e[L][0]=m[e[L][0]];else{let R=m[e[L][0]],D=e[L][1];e[L][0]=R,m=He(D===1?p[R^4]:p[R],m)}}let r=t?"U L F R D BR B BL".split(" "):qB,n=["0","","'"];return e.map(([l,i])=>r[l]+n[i]).join(" ")}function Sr(e,t){for(let[r,n]of t)for(let o=0;o<n;o++)e=He(e,pg[r]);return e}function Bg(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function Qi(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 HB(e){return Lg(Bg(XB(VB(e),!0)),!0)}function io(e,t,r,n,o,l){let i=ag(e,t,r,n,o),a=l.length,[f,s]=no(e,t,r,n,o),g=Array(a).fill().map(()=>new Uint32Array(i));for(let c=0;c<i;c++){let u=f[c],m=Array(e);for(let p=0;p<e;p++)m[p]=u>>2*p&3;for(let p=0;p<a;p++){let R=He(m,l[p]).reduce((D,A,y)=>D|A<<2*y,0);g[p][c]=s[R]}}return g}function Rg(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 f=a+r*i;for(let s=0;s<o;s++)l[s][f]=e[s][a]+r*t[s][i]}return l}function YB(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 f=0;f<r;f++)o[e[f][a]]||(o[e[f][a]]=1,l=!1)}let i=new Int32Array(n).fill(-1);for(let a=0,f=0;a<n;a++)!o[a]||(i[a]=f,f++);return[e.map(a=>$r(a,o)),i]}function ZB(e,t){let r=e.length,n=e[0].length,o=new Int32Array(n).fill(-1);t.forEach(f=>{o[f]=0});let l=[t];for(let f=0;f<l.length;f++){let s=l[f];for(let g=0;g<r;g++){let c=e[g][s[0]];if(o[c]!==-1)continue;let u=s.map(p=>e[g][p]),m=l.length;l.push(u);for(let p of u){if(o[p]!==-1)throw"quotienting failed";o[p]=m}}}let i=l.length,a=Array(r).fill().map(()=>new Int32Array(i));for(let f=0;f<r;f++)for(let s=0;s<i;s++)a[f][s]=o[e[f][l[s][0]]];return[a,o]}function dg(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 f=l[a];for(let s=0;s<o;s++){let g=s^1,c=e[s][a],u=e[g][e[g][f]];if(l[c]===-1)i=!1,l[c]=u,l[u]=c;else if(l[c]!==u)throw"mirroring failed - is the initial map correct?"}}}return l}function Dg(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 f=0;f<n;f++){let s=e[f][a];for(;s!==a;)o[s]===-1&&(i=!1,o[s]=l+1),s=e[f][s]}l++}return o}function XB(e,t=!1){let r=rR(e).next().value,n=Sr(e,r),o=(t?dR:RR)(n),l=Qi(r.concat(o),!1);return Sr(e,l).join("")!==tl.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(o),console.log(Sr(e,l))),l}function $B(e){let[t,r]=no(12,6,0,3,3),n=Array(12).fill().map((a,f)=>Ki(e,f)),o=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[l,i]=[en,lo].map(a=>{let f=a.map(s=>JB[e[s]]);return r[f.reduce((s,g,c)=>s|g<<2*c,0)]});return[o,l,i]}function Fg(){if(W.phase1_edge)return W.phase1_edge;let e=Rg(tn.map(n=>n.ep)),t=rn(e,e),r=rn(t,t);return W.phase1_edge=r}function eR(){return nr.phase1_edge?nr.phase1_edge:nr.phase1_edge=Dg(Fg(),[8+12*9+12**2*10+12**3*11])}function tR(){return W.phase1_centreA?W.phase1_centreA:W.phase1_centreA=io(12,6,0,3,3,tn.map(e=>e.ap))}function hg(){return W.phase1_centreB?W.phase1_centreB:W.phase1_centreB=io(12,6,0,3,3,tn.map(e=>e.bp))}function Ag(){if(nr.phase1_centre)return nr.phase1_centre;let[e,t]=no(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 nr.phase1_centre=Dg(hg(),r)}function*rR(e){let t=[Fg(),tR(),hg()],r=[eR(),Ag(),Ag()];yield*nR($B(e),t,r,15)}function*nR(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*yg(e,t,r,l,-1),l++}function*yg(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 f=0;f<i;f++){if(f===o||f===o-4)continue;let s=[];s[0]=t[0][f][e[0]],s[1]=t[1][f][e[1]],s[2]=t[2][f][e[2]];let g=1;for(;e.some((c,u)=>e[u]!=s[u]);){let c=yg(s,t,r,n-1,f);for(;;){let{value:u,done:m}=c.next();if(m)break;yield[[f,g]].concat(u)}s[0]=t[0][f][s[0]],s[1]=t[1][f][s[1]],s[2]=t[2][f][s[2]],g++}}}}function Js(e){let[t,r]=no(10,5,3,2,0),n=Array(8).fill().map((u,m)=>Ki(e,m)),o=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),l=Array(5).fill().map((u,m)=>Xs(e,m)),i=Zs(l.map(([u,m])=>u+5*m).concat(l.map(([u,m])=>u+5*(m^1)))),a=i.slice(0,5).map(u=>u%5),f=i.slice(0,5).map(u=>u/5|0),s=Jr(a)*8+(f[0]^f[2])+2*(f[0]^f[3])+4*f[4],[g,c]=[en,lo].map(u=>{let m=He(u,lR).map(p=>oR[e[p]]);return r[m.reduce((p,L,R)=>p|L<<2*R,0)]});return xg(),Eg(),[g,c,vg[s]+40*wg[o]]}function*ji(e){yield*uR(Js(e),30)}function bg(){if(W.phase2_centre)return W.phase2_centre;let e=io(10,5,3,2,0,tn.slice(0,4).map(r=>$r(r.ap,Ug))),t=io(10,5,3,2,0,tn.slice(0,4).map(r=>$r(r.bp,Ug)));return W.phase2_centre=[e,t]}function xg(){if(W.phase2_edge)return W.phase2_edge;let e=Rg(tn.slice(0,4).map(n=>n.ep.slice(0,8))),t=rn(e,rn(e,e)),r;return[r,wg]=YB(t,501),W.phase2_edge=r}function Sg(){if(W.phase2_corner)return W.phase2_corner;let t=el(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=tn.slice(0,4).map(l=>Zs($r(l.cp,r)));for(let l=0;l<t;l++){let i=js(l>>3,5),a=[0,0,l&1,l>>1&1,l>>2&1];a[1]=a[2]^a[3]^a[4];let f=Array(10);for(let s=0;s<5;s++)f[s]=i[s]+5*a[s],f[s+5]=i[s]+5*(a[s]^1);for(let s=0;s<4;s++){let g=He(o[s],f),c=g.slice(0,5).map(p=>p%5),u=g.slice(0,5).map(p=>p/5|0),m=(u[0]^u[2])+2*(u[0]^u[3])+4*u[4];n[s][l]=Jr(c)*8+m}}return W.phase2_corner=n}function Eg(){return W.phase2_corner_compact||([W.phase2_corner_compact,vg]=ZB(Sg(),sR())),W.phase2_corner_compact}function $s(){if(W.phase2_ce)return W.phase2_ce;let e=Eg(),t=xg();return W.phase2_ce=rn(e,t)}function iR(){if(e0)return e0;let e=Js(tl)[2];return e0=dg($s(),e,e)}function aR(){let[e,t]=no(10,5,3,2,0);return e.filter(r=>(r>>10&63)==41).map(r=>t[r])}function sR(){let e=Sg(),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 fR(){if(nr.phase2_ace)return nr.phase2_ace;let[e,t]=bg(),r=$s(),n=2520,o=40*336,l=n*o,i=Js(tl)[2],a=9,f=new Int8Array(l).fill(a);for(let s of aR())f[s+n*i]=0;for(let s=0;s<a-1;s++)for(let g=f.indexOf(s);g!==-1;g=f.indexOf(s,g+1)){let c=g%n,u=g/n|0;for(let m=0;m<4;m++){let p=e[m][c],L=r[m][u],R=p+n*L;f[R]===a&&(f[R]=s+1),p=e[m][p],L=r[m][L],R=p+n*L,f[R]===a&&(f[R]=s+1)}}return nr.phase2_ace=f}function*uR(e,t){let[r,n]=bg(),o=$s(),l=fR(),i=iR(),[a,f,s]=e,g=i[s],c=Math.max(l[a+2520*s],l[f+2520*g]);for(;c<=t;)yield*kg(a,f,s,r,n,o,l,i,c,-1),c++}function*kg(e,t,r,n,o,l,i,a,f,s){let g=Math.max(i[e+2520*r],i[t+2520*a[r]]);if(!(g>f)){if(f===0){yield[];return}else if(g===0)return;for(let c=0;c<4;c++){if(c===s)continue;let u=e,m=t,p=r;for(let L=1;L<=2;L++){u=n[c][u],m=o[c][m],p=l[c][p];let R=kg(u,m,p,n,o,l,i,a,f-1,c);for(;;){let{value:D,done:A}=R.next();if(A)break;yield[[c,L]].concat(D)}}}}}function Vi(e){let[t,r]=no(7,3,2,0,2),n=Array(5).fill().map((s,g)=>Ki(e,g)),o=Jr(n),l=Array(4).fill().map((s,g)=>Xs(e,g)),i=Jr(l.map(s=>s[0]))*2+l.find(s=>s[0]===0)[1],[a,f]=[en,lo].map(s=>{let g=He(s,gR).map(c=>e[c]%4);return r[g.reduce((c,u,m)=>c|u<<2*m,0)]});return[a+210*f,i+24*o]}function mR(){if(W.phase3_2gen_edge)return W.phase3_2gen_edge;let e=el(5)/2,t=Array(ao).fill().map(()=>new Uint32Array(e)),r=qi.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let o=js(n,5);for(let l=0;l<ao;l++)t[l][n]=Jr(He(o,r[l]))}return W.phase3_2gen_edge=t}function pR(){if(W.phase3_2gen_corner)return W.phase3_2gen_corner;let t=el(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(ao).fill().map(()=>new Uint32Array(t)),o=qi.map(l=>$r(l.cp,r).slice(0,4));for(let l=0;l<t;l+=2){let i=js(l>>1,4),a=i.concat(i.map(f=>f+4));for(let f=0;f<ao;f++){let s=He(a,o[f]),g=s.map(u=>u%4),c=s.find(u=>u%4==0)>>2;n[f][l]=Jr(g)*2+c,n[f][l+1]=Jr(g)*2+(c^1)}}return W.phase3_2gen_corner=n}function Hi(){return W.phase3_2gen_corneredge?W.phase3_2gen_corneredge:W.phase3_2gen_corneredge=rn(pR(),mR())}function t0(){if(W.phase3_2gen_centre)return W.phase3_2gen_centre;let e=io(7,3,2,0,2,qi.map(r=>$r(r.ap,zg))),t=io(7,3,2,0,2,qi.map(r=>$r(r.bp,zg)));return W.phase3_2gen_centreA=e,W.phase3_2gen_centreB=t,W.phase3_2gen_centre=rn(e,t)}function Cg(){if(r0)return r0;let e=t0(),t=W.phase3_2gen_centreA,r=Hi(),n=t[0].length,o=r[0].length,l=n*o,i=25,a=or.map(u=>u.length),f=new Int8Array(l).fill(i),s=Vi(tl);f[s[0]%n+n*s[1]]=0;let g=0,c=!1;for(;!c&&g<i-1;){c=!0;let u=Array(ao).fill().map((D,A)=>A).filter(D=>a[D]+g<i);u.sort((D,A)=>a[D]-a[A]);let m=He(a,u),p=He(t,u),L=He(r,u),R=u.length;for(let D=f.indexOf(g);D!==-1;D=f.indexOf(g,D+1)){let A=D%n,y=D/n|0;for(let k=0;k<R;k++){let E=m[k],Q=p[k][A],$=L[k][y],G=Q+n*$;f[G]>g+E&&(c=!1,f[G]=g+E)}}g++}return r0=f}function Pg(){if(n0)return n0;let e=Hi().slice(0,2),t=Vi(tl);return n0=dg(e,t[1],t[1])}function o0(e,t=Vi(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=t0(),a=W.phase3_2gen_centreA,f=W.phase3_2gen_centreB,s=Hi(),g=Cg(),c=Pg(),u=0;for(;;){let m=i0(o,l,n,a,f,s,g,c,u);for(let p of m)return p.map(L=>or[L]).flat();u++}}function Mg(e,t=Vi(e)){let[r,n]=t,o=r%210,l=Math.floor(r/210),i=t0(),a=W.phase3_2gen_centreA,f=W.phase3_2gen_centreB,s=Hi(),g=Cg(),c=Pg(),u=o0(e).length,m=1/0,p;for(let L=u;L<=u+0;L++){let R=i0(o,l,n,a,f,s,g,c,L);for(let D of R){let A=D.map(E=>or[E]).flat(),y=Qi(A),k=l0(y);k<m&&(m=k,p=y)}}return p}function LR(e){return(e-1)*(e-2)/2}function l0(e){let t=Lg(e,!0).replace(/'/g,"").split(" ");return e.length+BR(t).map(LR).reduce((r,n)=>r+n,0)}function BR(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*i0(e,t,r,n,o,l,i,a,f,s=-1){let g=i[e+210*r],c=i[t+210*a[r]],u=Math.max(g,c);if(!(u>f)){if(f===0){yield[];return}if(u!==0)for(let m=0;m<ao;m++){if(m===s&&cR[m]<=3)continue;let p=n[m][e],L=o[m][t],R=l[m][r],D=f-or[m].length;if(D<0)continue;let A=i0(p,L,R,n,o,l,i,a,D,m);for(;;){let{value:y,done:k}=A.next();if(k)break;yield[m].concat(y)}}}}function RR(e,t=200,r=24){let n=[],o=ji(e),l=He(e,Nt).map(f=>f^1),i=ji(l),a=Array(1e3);for(let f=0;f<t;f++){{let{value:s,done:g}=o.next();if(!g){let c=Sr(e,s),u=s.concat(o0(c));if(u.length<=r)return u;u.length<a.length&&(a=u)}}{let{value:s,done:g}=i.next();if(!g){let c=Sr(l,s),u=s.concat(o0(c)).map(([m,p])=>[m^2,p]);if(u.length<=r)return u;u.length<a.length&&(a=u)}}}return a}function dR(e,t=20,r=30){let n=[],o=ji(e),l=He(e,Nt).map(s=>s^1),i=ji(l),a,f=1/0;for(let s=0;s<t;s++){{let{value:g,done:c}=o.next();if(!c){let u=Sr(e,g),m=Qi(g.concat(Mg(u))),p=l0(m);if(p<=r)return m;p<f&&(a=m,f=p)}}{let{value:g,done:c}=i.next();if(!c){let u=Sr(l,g),m=Qi(g.concat(Mg(u)));m=m.map(([L,R])=>[L^2,R]);let p=l0(m);if(p<=r)return m;p<f&&(a=m,f=p)}}}return a}async function FR(){return HB(await DR)}var I8,N8,Vs,Hs,tl,rl,PB,Nt,O8,Oi,gg,MB,GB,TB,Wi,IB,cg,NB,OB,Et,wr,xr,en,lo,pg,qB,tn,W,nr,JB,oR,lR,Ug,wg,vg,e0,gR,zg,or,ao,_g,qi,cR,r0,n0,DR,Tg=b(()=>{Mt();[I8,N8]=(()=>{let e=new Int8Array(256*8),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 f=0;f<6;f++){let s=o[f];a+=e[l|s<<8]*i,l&=~(1<<s),i/=7-f}return a}function n(o,l){let i=255,a=2520,f=0;for(let s=0;s<6;s++){let g=o/a|0;o-=g*a,f^=g&1;let c=t[i|g<<8];l[s]=c,i&=~(1<<c),a/=7-s}return l[6]=t[i|f<<8],l[7]=t[i|(f^1)<<8],l}return[r,n]})();Vs={};Hs={};tl=Array(72).fill().map((e,t)=>t/9|0),rl=Ys([[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),PB=He(rl,rl),Nt=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),O8=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),Oi=Array(72).fill().map((e,t)=>(t+36)%72),gg=oo(Oi,PB,Oi),MB=oo(Nt,rl,Nt),GB=oo(Nt,gg,Nt),TB=Ys([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),Wi=He(rl,TB),IB=He(Wi,Wi),cg=oo(Oi,IB,Oi),NB=oo(Nt,Wi,Nt),OB=oo(Nt,cg,Nt),Et=Array(72).fill().map((e,t)=>t/9|0),wr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],xr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],en=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),lo=en.map(e=>e+36);pg=[rl,gg,MB,GB,Wi,cg,NB,OB],qB=["U","L","F","R","u","l","f","r"],tn=pg.map(mg);W={},nr={},JB=[0,0,2,3,0,0,2,3];oR=[0,1,2,0,0,1,2,0],lR=[0,1,2,3,4,5,7,8,10,11],Ug=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];gR=[0,1,2,3,4,10,11],zg=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],or=[[[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]]];or=or.concat(or.map(e=>Bg(e)));ao=or.length,_g=or.map(e=>Sr(Ys([],72),e)),qi=_g.map(mg),cR=_g.map(CB);DR=Qe()});var Ig={};ye(Ig,{randomFTOScrambleString:()=>hR,sgsDataFTO:()=>yR});async function hR(){let{randomFTOScrambleString:e}=await Promise.resolve().then(()=>(Tg(),Gg));return e()}async function yR(){return AR??(AR=UR())}async function UR(){return Tt(await ve.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
|
|
1149
|
+
|
|
1150
|
+
Alg T
|
|
1151
|
+
Alg B
|
|
1152
|
+
Alg B T
|
|
1153
|
+
Alg B'
|
|
1154
|
+
Alg B' T
|
|
1155
|
+
Alg U
|
|
1156
|
+
Alg U T
|
|
1157
|
+
Alg U'
|
|
1158
|
+
Alg U' T
|
|
1159
|
+
Alg B BL
|
|
1160
|
+
Alg B BL T
|
|
1161
|
+
Alg B BL'
|
|
1162
|
+
Alg B BL' T
|
|
1163
|
+
Alg B' BR
|
|
1164
|
+
Alg B' BR T
|
|
1165
|
+
Alg B' BR'
|
|
1166
|
+
Alg B' BR' T
|
|
1167
|
+
Alg U R'
|
|
1168
|
+
Alg U R' T
|
|
1169
|
+
Alg U' L
|
|
1170
|
+
Alg U' L T
|
|
1171
|
+
Alg B BL' D
|
|
1172
|
+
Alg B BL' D T
|
|
1173
|
+
|
|
1174
|
+
Alg R
|
|
1175
|
+
Alg R'
|
|
1176
|
+
Alg R D
|
|
1177
|
+
Alg R D'
|
|
1178
|
+
Alg R BR
|
|
1179
|
+
Alg R BR'
|
|
1180
|
+
Alg R' F
|
|
1181
|
+
Alg R' L
|
|
1182
|
+
Alg R' L'
|
|
1183
|
+
Alg B L B'
|
|
1184
|
+
Alg U L' U'
|
|
1185
|
+
|
|
1186
|
+
Alg B U B'
|
|
1187
|
+
Alg B U' B'
|
|
1188
|
+
Alg B R B'
|
|
1189
|
+
Alg B R' B'
|
|
1190
|
+
Alg B' U' B
|
|
1191
|
+
Alg B' U B L
|
|
1192
|
+
Alg B' U B L'
|
|
1193
|
+
Alg B' U' B BL'
|
|
1194
|
+
Alg B U' B' BR
|
|
1195
|
+
Alg B' R' B F
|
|
1196
|
+
|
|
1197
|
+
Alg BR
|
|
1198
|
+
Alg BR'
|
|
1199
|
+
Alg BR BL
|
|
1200
|
+
Alg BR BL'
|
|
1201
|
+
Alg BR' F
|
|
1202
|
+
Alg BR' F'
|
|
1203
|
+
Alg BR' D
|
|
1204
|
+
Alg B BR B'
|
|
1205
|
+
Alg U F U'
|
|
1206
|
+
Alg BR BL L
|
|
1207
|
+
Alg BR' D BR'
|
|
1208
|
+
|
|
1209
|
+
Alg B' BL B
|
|
1210
|
+
Alg B' BL' B
|
|
1211
|
+
Alg BR D' BR'
|
|
1212
|
+
Alg B' BL B D'
|
|
1213
|
+
Alg B' BL B BL
|
|
1214
|
+
Alg B' BL B BL'
|
|
1215
|
+
Alg B' BL L B
|
|
1216
|
+
Alg B' BL' B F'
|
|
1217
|
+
Alg B' BL' B L'
|
|
1218
|
+
Alg B' BL' B BL'
|
|
1219
|
+
Alg B' BL' L BL' B
|
|
1220
|
+
|
|
1221
|
+
Alg R' BR R
|
|
1222
|
+
Alg R' BR' R
|
|
1223
|
+
Alg BR BL' D BR
|
|
1224
|
+
Alg R' BR D R
|
|
1225
|
+
Alg R' BR D' R
|
|
1226
|
+
Alg R' BR R BL
|
|
1227
|
+
Alg B' D' BL D B
|
|
1228
|
+
Alg BR B D' B' BR'
|
|
1229
|
+
Alg BR BL' D BR L'
|
|
1230
|
+
Alg BR BL' D BL BR
|
|
1231
|
+
|
|
1232
|
+
Alg U BR U'
|
|
1233
|
+
Alg U BR' U'
|
|
1234
|
+
Alg U' R U
|
|
1235
|
+
Alg U' R' U
|
|
1236
|
+
Alg U BR B' U'
|
|
1237
|
+
Alg U BR' U' D
|
|
1238
|
+
Alg U BR' U' D'
|
|
1239
|
+
Alg U' R F' U
|
|
1240
|
+
Alg U' R' U L'
|
|
1241
|
+
|
|
1242
|
+
Alg U B U'
|
|
1243
|
+
Alg U B' U'
|
|
1244
|
+
Alg U B U' L
|
|
1245
|
+
Alg U B U' L'
|
|
1246
|
+
Alg U B' U' BL'
|
|
1247
|
+
Alg U B U' L F
|
|
1248
|
+
Alg U B U' L F'
|
|
1249
|
+
Alg U B' U' BL' D'
|
|
1250
|
+
|
|
1251
|
+
Alg B BL' L BL B'
|
|
1252
|
+
Alg B BL' L' BL B'
|
|
1253
|
+
Alg U B' D B U'
|
|
1254
|
+
Alg U B' D' B U'
|
|
1255
|
+
Alg U R D R' U'
|
|
1256
|
+
Alg U R D' R' U'
|
|
1257
|
+
Alg R' F L F' R
|
|
1258
|
+
Alg R' F L' F' R
|
|
1259
|
+
Alg B L' B F' D B
|
|
1260
|
+
Alg U B' D' B U' D
|
|
1261
|
+
|
|
1262
|
+
Alg F
|
|
1263
|
+
Alg F'
|
|
1264
|
+
Alg F D
|
|
1265
|
+
Alg F D'
|
|
1266
|
+
Alg F' L
|
|
1267
|
+
Alg F' L'
|
|
1268
|
+
Alg F D' BL
|
|
1269
|
+
|
|
1270
|
+
Alg F BL F'
|
|
1271
|
+
Alg F BL' F'
|
|
1272
|
+
Alg BR' BL BR
|
|
1273
|
+
Alg BR' BL' BR
|
|
1274
|
+
Alg F BR F' BR'
|
|
1275
|
+
Alg F BL F' BL'
|
|
1276
|
+
Alg F BL' F' L
|
|
1277
|
+
Alg F BL' L' F'
|
|
1278
|
+
Alg F BR' BL BR F'
|
|
1279
|
+
|
|
1280
|
+
Alg F' BL F
|
|
1281
|
+
Alg F' BL' F
|
|
1282
|
+
Alg U BL U'
|
|
1283
|
+
Alg U BL' U'
|
|
1284
|
+
Alg F U' F' U
|
|
1285
|
+
Alg F' BL F D'
|
|
1286
|
+
Alg F' BL F BL'
|
|
1287
|
+
Alg F' BL D F
|
|
1288
|
+
|
|
1289
|
+
Alg L
|
|
1290
|
+
Alg L'
|
|
1291
|
+
Alg L BL
|
|
1292
|
+
Alg L BL'
|
|
1293
|
+
Alg F' D F
|
|
1294
|
+
Alg L BL D
|
|
1295
|
+
|
|
1296
|
+
Alg L' BL L
|
|
1297
|
+
Alg L' BL' L
|
|
1298
|
+
Alg L' BL D L
|
|
1299
|
+
Alg L' BL D' L
|
|
1300
|
+
Alg L' BL L BL'
|
|
1301
|
+
Alg L' BL D' L BL
|
|
1302
|
+
Alg L' BL D' L BL'
|
|
1303
|
+
|
|
1304
|
+
Alg L D L'
|
|
1305
|
+
Alg L D' L'
|
|
1306
|
+
Alg R' D R
|
|
1307
|
+
Alg R' D' R
|
|
1308
|
+
Alg L D L' D'
|
|
1309
|
+
Alg L R L' R'
|
|
1310
|
+
Alg L' B' L B
|
|
1311
|
+
Alg R' D R BL
|
|
1312
|
+
Alg L BL' L' BL L'
|
|
1313
|
+
|
|
1314
|
+
Alg U L' D L U'
|
|
1315
|
+
Alg U B D B' U'
|
|
1316
|
+
Alg U L' D' L U'
|
|
1317
|
+
Alg U B D' B' U'
|
|
1318
|
+
Alg R' D' BL' D R
|
|
1319
|
+
Alg U B D' B' U' D
|
|
1320
|
+
Alg U B' L B L' U'
|
|
1321
|
+
Alg U B D B' U' BL'
|
|
1322
|
+
Alg U B D' B' L' D' L U'
|
|
1323
|
+
|
|
1324
|
+
Alg F L F'
|
|
1325
|
+
Alg F L' F'
|
|
1326
|
+
Alg F L F' D
|
|
1327
|
+
Alg F L F' D'
|
|
1328
|
+
Alg F L' F' BL'
|
|
1329
|
+
|
|
1330
|
+
Alg L BL' D BL L'
|
|
1331
|
+
Alg L BL' D' BL L'
|
|
1332
|
+
Alg F D L D' L' F'
|
|
1333
|
+
Alg F L D L' D' F'
|
|
1334
|
+
Alg F L' B' L B F'
|
|
1335
|
+
Alg F' D' R' D R F
|
|
1336
|
+
Alg F D L D' L' F' BL'
|
|
1337
|
+
Alg F' R' B' R' B R' F
|
|
1338
|
+
|
|
1339
|
+
Alg B D B'
|
|
1340
|
+
Alg B D' B'
|
|
1341
|
+
Alg L' D L
|
|
1342
|
+
Alg L' D' L
|
|
1343
|
+
Alg B D B' D'
|
|
1344
|
+
Alg B' L B L'
|
|
1345
|
+
Alg B D B' D' BL
|
|
1346
|
+
|
|
1347
|
+
Alg D
|
|
1348
|
+
Alg D'
|
|
1349
|
+
Alg D BL
|
|
1350
|
+
Alg D BL'
|
|
1351
|
+
|
|
1352
|
+
Alg D BL' D BL D'
|
|
1353
|
+
Alg D BL' D' BL D'
|
|
1354
|
+
Alg B D R D' R' B'
|
|
1355
|
+
Alg B R D R' D' B'
|
|
1356
|
+
Alg D BL' D BL D' BL
|
|
1357
|
+
Alg D BL' D BL D' BL'
|
|
1358
|
+
|
|
1359
|
+
Alg D BL D BL' D'
|
|
1360
|
+
Alg D BL D' BL' D'
|
|
1361
|
+
Alg B' BL' B BR D' BR'
|
|
1362
|
+
Alg D BL D BL' D' BL
|
|
1363
|
+
Alg D BL D BL' D' BL'
|
|
1364
|
+
|
|
1365
|
+
Alg D' BL D
|
|
1366
|
+
Alg D' BL' D
|
|
1367
|
+
Alg D' BL D BL
|
|
1368
|
+
Alg D' BL D BL'
|
|
1369
|
+
|
|
1370
|
+
Alg B D' B' BL B D B'
|
|
1371
|
+
Alg B D' B' BL' B D B'
|
|
1372
|
+
Alg D' BL' D BL D' BL D
|
|
1373
|
+
|
|
1374
|
+
Alg B R' B' BL B R B'
|
|
1375
|
+
Alg B R' B' BL' B R B'
|
|
1376
|
+
Alg L R L' BL' L R' L'
|
|
1377
|
+
|
|
1378
|
+
Alg F BL' B' BL F' BL' B
|
|
1379
|
+
Alg F' R' F BL F' R F
|
|
1380
|
+
Alg F' R' F BL' F' R F
|
|
1381
|
+
Alg BR R BR' BL' BR R' BR'
|
|
1382
|
+
Alg F L' BL U BL' U' L F'
|
|
1383
|
+
Alg F' U' F D F' U F D'
|
|
1384
|
+
Alg F BL F' D F BL' F' BL D'
|
|
1385
|
+
|
|
1386
|
+
Alg F D F U' F' U D' F'
|
|
1387
|
+
Alg F D F' BL F BL' D' F'
|
|
1388
|
+
Alg F U D BL' U' BL D' F'
|
|
1389
|
+
Alg F U' D F U F' D' F'
|
|
1390
|
+
Alg F' BR L F BR' F' L' F
|
|
1391
|
+
Alg U R BL' F BL F' R' U'
|
|
1392
|
+
|
|
1393
|
+
Alg BL
|
|
1394
|
+
Alg BL'
|
|
1395
|
+
|
|
1396
|
+
Alg F U BL U' BL' F'
|
|
1397
|
+
Alg F BL U BL' U' F'
|
|
1398
|
+
Alg U BL BR BL' BR' U'
|
|
1399
|
+
Alg BR F BL F' BL' BR'
|
|
1400
|
+
Alg F U' F' U BL' U BL U'
|
|
1401
|
+
|
|
1402
|
+
Alg F U' F' D F U F' D'
|
|
1403
|
+
Alg B' U' F U B U' F' U
|
|
1404
|
+
Alg D F U' F' D' F U F'
|
|
1405
|
+
Alg BR' U BR D' BR' U' BR D
|
|
1406
|
+
Alg D' BR BL' F BL' F' BL BR' BL D
|
|
1407
|
+
|
|
1408
|
+
Alg D BL D F' U' B L' BL' L R' BR' R L' BL L B' U F D
|
|
1409
|
+
Alg B D BR F' R' BR' R B' F D' BL D B BR' D' B'
|
|
1410
|
+
Alg L B' BR' L F BR L' B BR' L U F U' BR' F L BL BR'
|
|
1411
|
+
Alg L BL' D' BR' B R' U' R BR B' D BL' L'
|
|
1412
|
+
Alg B BR B' D' B D B F' R' B' R BR' B' BR F BR' BL
|
|
1413
|
+
Alg L' BL D L' D' L' D L' U' R' F' R U D'
|
|
1414
|
+
Alg U' L BL L U' D R' BL B' BL F' BL' B R BL' U D' L U
|
|
1415
|
+
Alg L BL BR' L U' D R' F' R BL' U BL D' BR L
|
|
1416
|
+
Alg D L' R F' R' L BL' BR BL' B' BL B BR' F BL' F' D'
|
|
1417
|
+
Alg B BL B BR' L R' U' R BR L' B
|
|
1418
|
+
Alg L B' R' BR B F BL D' BL' D BL' B' F' BR' R U B L'
|
|
1419
|
+
Alg D' L' BL F' D' BL' D B F' R' BR R B' F' BL' L D
|
|
1420
|
+
Alg B D' R D' R' BL BR' B BR' B' BL' D' BR B R' B' R B' BL' D'
|
|
1421
|
+
Alg U' L R' F U L' BL' L B BL' B' BL L U' L' F' R L' U
|
|
1422
|
+
Alg F' D BL' BR' BL' BR B' U' F L F' U B D F L U BL' U' L'
|
|
1423
|
+
Alg L' U BR' U D R' BL F R BL' U D' BR' L' BL' BR' L'
|
|
1424
|
+
Alg U' L' U' D R' BL B' BL F BL' B R BL' U D' L' BL' L' U
|
|
1425
|
+
Alg D F BL L' BL' B L' B' L' B L' B' L' BL L BL' F' D'
|
|
1426
|
+
Alg F' BR' B BL' BR BL B' F L' F' L B BR' B' BR L' F L BL'
|
|
1427
|
+
Alg F' L F' L U' D R' F R U D' L' BL' F L' F
|
|
1428
|
+
Alg F U' F' BR F' R' BR' U F' L' BL F' D' BL'
|
|
1429
|
+
Alg B BR' U R BR' R' BR U' B' BR
|
|
1430
|
+
Alg F' BR' B BR' R BR' BL' BR R' BR BL B' BR F
|
|
1431
|
+
Alg L' U BL B' U' BL U BL' B BR BL' BR' U' L
|
|
1432
|
+
Alg BR BL' BR' BL L' BL BR BL' BR' L
|
|
1433
|
+
Alg U BR' U' BR L' BL BR BL' BR' L
|
|
1434
|
+
Alg U' L F BL' F' BL F' BR F BR' L' U
|
|
1435
|
+
Alg F L F' BL D F' D' F BL' L'
|
|
1436
|
+
Alg U BR' U BR L BL BR BL' BR' L' U
|
|
1437
|
+
Alg F BR R BL' F' BL' F R' BL BR' BL F'
|
|
1438
|
+
Alg D BL D B U BR' D BR' L' U' BR' U BR L D' BR U' B' D
|
|
1439
|
+
Alg U BL' U' BL U BL D L' D BR D' L D BR U BR U D
|
|
1440
|
+
Alg B' U F U' B' U F' BR' U' B L B' U BR U' B L' B BL
|
|
1441
|
+
Alg B U' B BL U' BL L U' D R' F' R U' D' L' BL' U B
|
|
1442
|
+
Alg B L R F D' BR' D F' R' BL' U' L U L' U BL L' B'
|
|
1443
|
+
Alg D BL D F' BR' F BL' D R' BR' R F D' BL F' BR D
|
|
1444
|
+
Alg L' D F' R' U BR L BL B' BL B BL' BR' L' U' R D' L
|
|
1445
|
+
Alg F BL' U D L' U' BR R F' R' BR' U L D BL U' D BL F'
|
|
1446
|
+
Alg BR' BL' U' L' BL D F' L' F' L F L U L' D' BR L BL
|
|
1447
|
+
Alg B' L' BL U D R' F' R U D' L' BL L U BL' L B
|
|
1448
|
+
Alg B BL' L U B' L BL' L B' U' B' L' D L' U' B L' B' D'
|
|
1449
|
+
Alg B' R' L U L' R BR BL' B BR' B' BL B' BL' B'
|
|
1450
|
+
Alg F L R BL B' U' B R' BL' L' BL F' BL BR' BL L BL' BR L'
|
|
1451
|
+
Alg B' U' BL L U D R' F R U D' L' BL' U BL' B' U B'
|
|
1452
|
+
Alg U BR BL' BR' D' B D' F' D B' D' F BL' U' BL' F' BL' F D'
|
|
1453
|
+
Alg D' BL' D L BL L' D' BL D F' D F D' BL' D' BL D
|
|
1454
|
+
Alg B' BL' B' BL L' B' BL' F' D F L F' D' F BL' L BL' B L B
|
|
1455
|
+
Alg F BL' U D' BL' D' L' U' BR R F R' BR' U L U' D' BL F'
|
|
1456
|
+
Alg U' D' B D F' D' BR' D' BR D BR B' BL' D F BL U BL'
|
|
1457
|
+
Alg B BL BR D' BR L' R F R' BR' L D BL' BR' BL' B'
|
|
1458
|
+
Alg L' F L' U BR' U' BR L F' BR' L U BR U'
|
|
1459
|
+
Alg F' BL' D' BR' BL B' U' BL U B BL' BR D F
|
|
1460
|
+
Alg F' D' BR' U R' U BL U' R U' BL' BR D F
|
|
1461
|
+
Alg F U' BR F' U' BL' B U F BR' R F' U BL L
|
|
1462
|
+
Alg B' BL' U' BL U B BL' B BL BR BL' BR' B' BL
|
|
1463
|
+
Alg D' F' U BL U' L F U' F' U L' BL' F D
|
|
1464
|
+
Alg F' BL' D' BR' BL BR' F' BR U' B' BR' U R' BR' F'
|
|
1465
|
+
Alg B' U' B BL' B U' B BL' L U' L BL' L B
|
|
1466
|
+
Alg F' D' F U' F U F' BL F' BL' D F
|
|
1467
|
+
Alg F' D BR F' R F R' BR' F D'
|
|
1468
|
+
Alg D BL D B BR' D L' BL' L' BL' BR' BL L BL L D' BR B' D
|
|
1469
|
+
Alg B L BL L' BL' L' D F' R' BR R D' F L' BL' L' B'
|
|
1470
|
+
Alg B BL' F' BL BR D' BR' F D' B' D L F' BL' F L D L D' BL
|
|
1471
|
+
Alg B D' BR' D' BR' F D' BL' D' BL D BL F' D BR D' B'
|
|
1472
|
+
Alg B D' B U B' D B F' BR' F L' F BR F' L U' B BL
|
|
1473
|
+
Alg L BL' B' U BL L' BL L U L' BL' L BL' U' B BL' L'
|
|
1474
|
+
Alg U D F' D BR BL' BR' BL B D' F D B' D BR BL BR' U'
|
|
1475
|
+
Alg F' D BR L' U' R F' R' U BR' L D BR' BL BR D F
|
|
1476
|
+
Alg BR' L BL L' BL' BR BL' F BL' L R BL B' U B R' BL' L' F'
|
|
1477
|
+
Alg D BL BR D B F' R' U' BR' U R B' F D' BR' D'
|
|
1478
|
+
Alg D' B BR' D L' BL' L' BL' BR BL L BL L D' BR B' D' BL' D'
|
|
1479
|
+
Alg B U' R B' BL' B R' U' B BL' B' U' BL B' U' L U L'
|
|
1480
|
+
Alg B D' B' D' BR' BL BR D' B' L B BR' U B U' BL' BR BL L' BL'
|
|
1481
|
+
Alg B D BR' D' F BL' D' BL' D BL D F' BR D BR D B'
|
|
1482
|
+
Alg D' B D F' D' BR' D' BR D BR BL BR' BL' BR B' BL' D F
|
|
1483
|
+
Alg L BL B' U BL L' BL L U' L' BL' L BL' U' B BL L'
|
|
1484
|
+
Alg B' U B' D' B U' B' D BL' U BL' U' BL' B' U BL' U'
|
|
1485
|
+
Alg D' BR' B' L' U L' B' U B L U' L B BR D BL
|
|
1486
|
+
Alg L' D L' F U' F' L D' L' F U BR F' L F BR' F' L BL'
|
|
1487
|
+
Alg D BR D B F' R' U' BR U R B' F D' BR' BL' D'
|
|
1488
|
+
Alg BR BL D F BR' BL BR BL' BR F' BR' D' BL' BR'
|
|
1489
|
+
Alg BR' U' L' BL F' BL' F L BL' U BL BR
|
|
1490
|
+
Alg D' BR' B' U BR U' BL U' BL' U BR' B BR D
|
|
1491
|
+
Alg F U BR' U R U' BR B U' F' BL U' L' U BL' B'
|
|
1492
|
+
Alg B U' L F BR F' L F' BR' F L U B'
|
|
1493
|
+
Alg BR BL F BL' L F' BR' BL' F BL L' BL' F' BL
|
|
1494
|
+
Alg U' BR' L BL' BR L U' BR' U L' BL L' U' BR U'
|
|
1495
|
+
Alg L' F L' U BR' U' BR L F' L BL' BR BL BR'
|
|
1496
|
+
Alg F' D' BR' BL U R' U BL' U' R U' BR D F
|
|
1497
|
+
Alg F' BR' B F' U F BR U' BR' B' F BL BR BL'
|
|
1498
|
+
Alg L B' U' R' BR B F BL D' BL D BL' B' F' BR' R B L'
|
|
1499
|
+
Alg B F BL B L F BR' R' BL U' R BL' BR' F' L' F' BR' B
|
|
1500
|
+
Alg U BR F' D F BR' U' L' BL L' BL' L U L B' BL L' B U'
|
|
1501
|
+
Alg F' L B F BL B R U' R' B' BL' B' F' L BL L F
|
|
1502
|
+
Alg D BL D B BR' D BR' D' BR D BR BL BR' BL' D' B' D
|
|
1503
|
+
Alg D' BR' BL B BR B' BL' D BL D' B' BL B BR' BL' BR D
|
|
1504
|
+
Alg D F' U BR U' L U' BR' U L' D B D' F D B' D BL
|
|
1505
|
+
Alg L B BL' B L F R U' R' F' L' B' BL B' L' BL'
|
|
1506
|
+
Alg B D' B U B' D F' BR F L' F BR' F' L B U' B BL
|
|
1507
|
+
Alg B' BL L B' L' B' L B' BR' R' U' R BR L'
|
|
1508
|
+
Alg D' F' U' B L' BL' L R' BR R L' BL L B' U F D' BL' D'
|
|
1509
|
+
Alg B' F' BL' B' F U D' R BR R' BL U' BL' D B'
|
|
1510
|
+
Alg F' BL' D BL F BL' D' B' U' B D F' D' B' F U B
|
|
1511
|
+
Alg F' L' BL' L' B F BL B R U R' B' BL' B' F' L' F
|
|
1512
|
+
Alg L' BL U' D F D' BL' D BL F' BL' D' BL D F' U D' BL L
|
|
1513
|
+
Alg B' BR L R' U R BR F L' B' BL' B L F' BR L' B
|
|
1514
|
+
Alg B' L B' BR' B L' B' D F' U F D' F U' F' BR B' BL'
|
|
1515
|
+
Alg B' BR D' BL' BR' BL B L' R' L' R BR L D L BL BR' B BL
|
|
1516
|
+
Alg L' D F' L F L' F D' L' BL' L' D BL' BR' BL' BR BL' D'
|
|
1517
|
+
Alg B' F BR F BR L R' BL U R BL' BR L' B' BL' B' F
|
|
1518
|
+
Alg F L' F' BR' B BR' F' BR B' BR' F' L F' BR'
|
|
1519
|
+
Alg BR' B' BR BL' D' BR D BR' BL B
|
|
1520
|
+
Alg L' F L' U BR' U' L U' BR U F' L
|
|
1521
|
+
Alg F U' BR' R U' BR BL BR' U' BL' U' R' F' BR U
|
|
1522
|
+
Alg B' BR' R' U' BL D' BL U BL' D R BL' BR B
|
|
1523
|
+
Alg D BR' U' L BL' F' BL F L' BL U BL' BR D'
|
|
1524
|
+
Alg F' BL' D' F BR' BL BR BL' BR F' BR' D BL F
|
|
1525
|
+
Alg F' BR' BL' BR D' F' BR F BR' D BL F
|
|
1526
|
+
Alg F' BR R' BR BL' BR' R BR' BL F
|
|
1527
|
+
Alg B BR F' BR' B' F BL F BL' F'
|
|
1528
|
+
Alg B D' B U B' D BL' F R' F BL F' R B F' U' B BL
|
|
1529
|
+
Alg L BL' B' U L U L BL L B' BL B' U' BL' U' B' L' BL
|
|
1530
|
+
Alg L' BL' U' D F D' BL' D BL F BL' D' BL D F' U D' BL' L
|
|
1531
|
+
Alg F' L F' BL' D' BR' B R' U' R BR B' D BL' F L' F
|
|
1532
|
+
Alg U D' BR' D BR' U' L U BR L' D' BR D L U' L' BL
|
|
1533
|
+
Alg B' BR' B' BL B L F' BR' R' U' R BR F BR L' B
|
|
1534
|
+
Alg U' F' D BR' F' BR D L D L' U D' B D' B' F D' BL F
|
|
1535
|
+
Alg B F BL B F' L F BR' R' BL U' R BL' BR' F' BR' L' B
|
|
1536
|
+
Alg F' D' BL B BR' BL BR BL' BR' D' BR' D BR D F D' B' D
|
|
1537
|
+
Alg B' BR' B' BL B L F BR' R' U' R BR F' BR L' B
|
|
1538
|
+
Alg L' F BR L' R' BR BL' BR' R BR' BL B' L F' L' B L' BL'
|
|
1539
|
+
Alg B' U' BL' U D' BL' D F L' R U R' F' L U' BL U B
|
|
1540
|
+
Alg D' B D BL BR BL' BR' D' BR' D BR D' BR B' D' BL' D'
|
|
1541
|
+
Alg B' BR' L F' BR' R' U R BR F L' B' BL' B BR B
|
|
1542
|
+
Alg L U L' D' BR' D L U' L' U D' BR D BR BL BR' BL' U' BL'
|
|
1543
|
+
Alg F' L F' BL D' B BR' R' U R B' BR D BL F L' F
|
|
1544
|
+
Alg B' L B' BR' B L' F' R F' BL F R' F BL' B' BR B' BL'
|
|
1545
|
+
Alg F' L BL' BR' R' BL U R BR B L' B L B L' F BL' B
|
|
1546
|
+
Alg L' F D' BR U' BR' D BR' U BR L' B' L F' L' B L' BL'
|
|
1547
|
+
Alg B' BR' L F BR' R' U R BR F' L' B' BL' B BR B
|
|
1548
|
+
Alg L F' D' F BR' BL BR BL' BR F' BR' D F L'
|
|
1549
|
+
Alg F' BL' D F BL' F' BL D' BR' BL BR F
|
|
1550
|
+
Alg B' BR' R' BL D' BL U' BL' D BL' U R BR B
|
|
1551
|
+
Alg B' L BL' BR BL L' B' F BL F' BL' B BR' B
|
|
1552
|
+
Alg F U' BR' R BR F' U BL L U BL' B U'
|
|
1553
|
+
Alg B' BR B' BL F BL' B F' L BL' BR' BL L' B
|
|
1554
|
+
Alg U' L BL' U' R U' BL' U R' U BL' L' U
|
|
1555
|
+
Alg F U' BR' R' F' BR' F BL BR R BL' F' BR U
|
|
1556
|
+
Alg B U' L' F' BR F L' F BR' F' L' U B'
|
|
1557
|
+
Alg F' BR' B' F BR' BL' BR F BL B F' BL BR BL'
|
|
1558
|
+
Alg B BL' U' L U BL' B' BL' B' L' BL U B' U' BL L BL L
|
|
1559
|
+
Alg B R' U' B U R B' BR F D' B' D BL F' BL' BR' BL
|
|
1560
|
+
Alg U BL U' B BL U BL U' BL D' B U B' D B U' B
|
|
1561
|
+
Alg B BL B BL' B BR B' BL BR' R' L U' L' R B
|
|
1562
|
+
Alg U' L BL' B BL B' L' F U B' R U R' U F' U B BL
|
|
1563
|
+
Alg F' BL' D' BR' L' B' L B BL BR BL' B' L' B L D BL F BL
|
|
1564
|
+
Alg L B' L' F U B' R BR B BR' R' BR BL' BR' BL B U' F' BL
|
|
1565
|
+
Alg D' F BL B BR' B BR B' BL' D BL D' B' F' D
|
|
1566
|
+
Alg B' L' BL F U F' L' U B U' L F U' F' BL' L BL' B BL B
|
|
1567
|
+
Alg D BL D B U F' R' BR' R F U' B' D
|
|
1568
|
+
Alg B BR B' D' BL BR D BR D B' BL' B D BR' BL' D' BL' D'
|
|
1569
|
+
Alg B' R BR B' BR' R' B U' F' L B L' BL' F BL U BL'
|
|
1570
|
+
Alg U BR BL' BR' D' B D' F' D B' BL' BR BL BR' D' F U' D'
|
|
1571
|
+
Alg U' D' BR' U' BR' D' L' D BR' D' L D' BL' U' BL' U BL U'
|
|
1572
|
+
Alg L' F' BR F' R F' R' L F' BR' D L BL' L' BL D' F BL'
|
|
1573
|
+
Alg B D BL' D B U R BR R' U' B' D' BL D' B' BL
|
|
1574
|
+
Alg B' U L' U B BL L' F' BL F D' B' U B D B' L B L'
|
|
1575
|
+
Alg L BL' B' U L F R U' R' F' U L F' L B L' F
|
|
1576
|
+
Alg L' D R' U BR L BL B' BL' B BL' BR' L' U' R F D' L
|
|
1577
|
+
Alg D' B U F' R' BR R F U' B' D' BL' D'
|
|
1578
|
+
Alg B D BL' B' U' BL L' D L D' BL' U B BL B' D'
|
|
1579
|
+
Alg B U' BL' U' F U' B U B' F' U BL U' B U' B
|
|
1580
|
+
Alg U BR' U L BL' L U' BR U BR' L' BL BR L' U
|
|
1581
|
+
Alg F' D' BR' BL B' U' BL' U B BL' BR D BL F
|
|
1582
|
+
Alg B' L' B' F BL' F' BL F' BR F BR' B L B
|
|
1583
|
+
Alg F' BL' D' BR F' BR' F D BR' BL BR F
|
|
1584
|
+
Alg F D' F' U' F' D' BR D F' D' BR' D' F' U
|
|
1585
|
+
Alg BR' BL' U' BL L U' F U F' L' U BR
|
|
1586
|
+
Alg F BR R U' BR B U BR' F BR BL' BR D BL F
|
|
1587
|
+
Alg F' BR' F U' BL L' U BL' B' F' BL' BR D' BL F
|
|
1588
|
+
Alg B' U L' B' U L' D F L F' D' L U' B L U' L B L'
|
|
1589
|
+
Alg B BL B L F BR' R' U' R BR F' L' B
|
|
1590
|
+
Alg B D' B BR' R' U' B' U R BR U' D' F L' F' U L' D' L
|
|
1591
|
+
Alg L U' L' U B BL' U B BL B' U R B' BL B R' U B'
|
|
1592
|
+
Alg D F' D BL U' R U' BL' U R' U B D' F D B' D BL
|
|
1593
|
+
Alg B BL U B BR' L R' F' U' F R BR L' B' U' B'
|
|
1594
|
+
Alg B' U' B F' D F D' B' U B D BL F' BL' D' BL F
|
|
1595
|
+
Alg B D BR B F' U' R' BR' R U B' F BR' D' BL B'
|
|
1596
|
+
Alg L B' F R BL' U' R' BL B F' L U BR' U' BL L U BR U'
|
|
1597
|
+
Alg F' L F' BL L U' D R' F' R U D' L' F L' F
|
|
1598
|
+
Alg L U L' F' BL' F L B BL' U BL' U' BL B' BL L U' L
|
|
1599
|
+
Alg B' L F BR' R' U R BR F' L' B' BL' B'
|
|
1600
|
+
Alg U BR' U' L' U' BR' F' BR F BR D R' F R U D' L' BL' L'
|
|
1601
|
+
Alg B L BL L F' D R' BR' R F D' L BL L BL' L' B'
|
|
1602
|
+
Alg F' BL' D F' D' B D' B' U' D L D BR' L' F BR D' F U
|
|
1603
|
+
Alg B U B BR' L R' F' U F R BR L' B' U' BL' B'
|
|
1604
|
+
Alg U B' L BL' B L' U' L' BL L BL' L U BR F' D' F BR' U'
|
|
1605
|
+
Alg B BL' D BR B F' U' R' BR R U B' F BR' D' B'
|
|
1606
|
+
Alg B BR B F BR' U BL' L R BR' R' L' F' U BR U BL B BL'
|
|
1607
|
+
Alg B' BR' L R' U R BR L' B' BL' B'
|
|
1608
|
+
Alg B' U BR' R L F' BR' F L' R' BR U' B' BR B'
|
|
1609
|
+
Alg F' BL' F' BR R U' BR B F BR BL' D F U BL'
|
|
1610
|
+
Alg F' BR' B' U BR' F BR' F' BR U' BR B BR F
|
|
1611
|
+
Alg BR' BL' U' BL L' F' BL F BL' L U BR
|
|
1612
|
+
Alg U' L BL U' R U' BL U R' U BL L' U
|
|
1613
|
+
Alg F BR' F' U' L F BR U F' U' L' BL U BL'
|
|
1614
|
+
Alg L' F U' BR' U L' U BR U' L F' L
|
|
1615
|
+
Alg F' BR' B' U' BR' U F BR B U' BL U BR BL'
|
|
1616
|
+
Alg F' BR' U BR D' BR U' BR' D F
|
|
1617
|
+
Alg F BL' BR R BL' F' BL F R' BL BR' F'
|
|
1618
|
+
Alg L BL' B BL' U BL U' BL B' L' F' BL F L U' L U L
|
|
1619
|
+
Alg B F BL B F' L F' BR' R' BL U' R BL' BR' F BR' L' B
|
|
1620
|
+
Alg F BL B' F' BR B' BR' B L F BL B' BR B BL' BR' F' L' B
|
|
1621
|
+
Alg B F D' BL U R BL' BR' R' U' D B F' BL B
|
|
1622
|
+
Alg L B' U B' BR B BR U' BR' B L' F BL' B F' BR' B' BL'
|
|
1623
|
+
Alg U' L R' F L U L' BL' B BL B' L' BL L U' F' R L' U
|
|
1624
|
+
Alg BR BL F BL' F' L' F' BR' L B BR B' L' F L B BR' B' BL
|
|
1625
|
+
Alg B' BR' L F L' B' BL B L F' BR' R' U' R BR' L' B
|
|
1626
|
+
Alg D L U' BR U L U' R BL' F' R' F BL F' BR' U L D BL D
|
|
1627
|
+
Alg B F BL B F BR' L R' BL U' R BL' BR' L' F BR' B
|
|
1628
|
+
Alg L B' L' U L' B' U L' D F L' F' D' L U' B L U' B
|
|
1629
|
+
Alg B' BR L F' BR R' BL U R BL' BR F L' B' F BL' B' F'
|
|
1630
|
+
Alg B' BL L B L' B' BL' L' U BL' U R' L' R U' BL U' L B
|
|
1631
|
+
Alg B U' D' F D B BL' B' U D' R BR R' U' F' U D B'
|
|
1632
|
+
Alg D F L F' L' F R L' BL B L B' BL' L R' F' L D'
|
|
1633
|
+
Alg L BL D' B BR' R' U R B' BR D BL L'
|
|
1634
|
+
Alg D F D' B' U' B U' D F' D' F U B' U B F' BL'
|
|
1635
|
+
Alg D' BR' BL BR B' BL' B D BL' D' BL B BR' B' BL' BR D
|
|
1636
|
+
Alg U BR' U' L U R' L R BR L' B' L' B L U' L' BL'
|
|
1637
|
+
Alg BR' L R' U R BR B L' B L B L' BL' B
|
|
1638
|
+
Alg B BR' B U BR' R L F' BR F L' R' BR U' B
|
|
1639
|
+
Alg F' L B' BR' B L BL' L' B' BR B L BL L F
|
|
1640
|
+
Alg D F U' F' U D' BR U' D' F U F' D BR'
|
|
1641
|
+
Alg B' BL' BR D' BR' D BL BR' B BR
|
|
1642
|
+
Alg B BL U' BR' L U BR' F' BL D BL BR F BR
|
|
1643
|
+
Alg L' U BR BL BR' B' BL U' BL' U B BL' U' L
|
|
1644
|
+
Alg U B' BL U' L' BL' U' F BR' R' BR U F'
|
|
1645
|
+
Alg D BR' BL U' BL' L F' BL' F BL L' U BR D'
|
|
1646
|
+
Alg BR L' BL BR' BL' L BL' BR BL BR'
|
|
1647
|
+
Alg F BL F' BL' B F' BR F BR' B'
|
|
1648
|
+
Alg D BR L' U' R F' R' U BR L BL B' BL B BL' BR D'
|
|
1649
|
+
Alg D' BL' D BL D F' D' F D' BL' D L BL' L' D' BL D
|
|
1650
|
+
Alg B F D' F' U' BL' B U B' BL F D B U' B' U B' F' BL
|
|
1651
|
+
Alg B U F' D' R BR' R' U' D B BL B' U F U' B'
|
|
1652
|
+
Alg B BL B L B BR' F BR B' BR' R' U' R F' BR L' B
|
|
1653
|
+
Alg B BL B L F' U' F' U F BR' R' U' R BR' F BR' L' B
|
|
1654
|
+
Alg B' U' B F' D F D' B' U B U' D BL' F' BL D' F U BL
|
|
1655
|
+
Alg L F' BR B' F' R BL' U' R' BL B F' BR L BL BR L
|
|
1656
|
+
Alg D F' D' BL F' D' F R BL B' L U L' B R' F' BL' D F
|
|
1657
|
+
Alg B BL BR BL D' BR L' R F' R' BR' L D BR' BL' B'
|
|
1658
|
+
Alg B' L B' BR' B L' BL' U BL U' B' BR B' U BL' U'
|
|
1659
|
+
Alg D' B BR' F BL' F' D BR D' BL F' BR B' F D' BL' D'
|
|
1660
|
+
Alg B D F' L' R F D BR' D' F' R BR' L D B' BL' D' F D'
|
|
1661
|
+
Alg D L BL' F' R U R' B F' L BL' L' B' F' BL L' D'
|
|
1662
|
+
Alg B' BR' L F R' U R BR B BR' F' BR B' L' B' BL' B'
|
|
1663
|
+
Alg D L F BL F L BL' L D' BL' D' F' D' F' L BL D' BL'
|
|
1664
|
+
Alg D F BL F' BR B' BL' B BL BR' BL L' R F R' L D'
|
|
1665
|
+
Alg L BL' B' L B L B' L F R U R' B F'
|
|
1666
|
+
Alg F' D' BL F R B' L U' L' B R' BL' F' D F BL' D F D'
|
|
1667
|
+
Alg B' L' BL U' D' L' BL' L U' D R' F R U' BL' L B
|
|
1668
|
+
Alg L' F L' BL U' BL' U L F' L U' BL U BL'
|
|
1669
|
+
Alg D' F' BL L U' F U F' L' U BL' U' F D
|
|
1670
|
+
Alg B' U F D F' U F D' F U B U' F U
|
|
1671
|
+
Alg U B' BR' U R' U' R BR U' B
|
|
1672
|
+
Alg F' BL' D F BL F' BR F' BR' F BL' D' BL F
|
|
1673
|
+
Alg F' BR' BL' BR D BL' F BL F' D' BL F
|
|
1674
|
+
Alg U' F R F' BL' F R' F BL F U
|
|
1675
|
+
Alg F' BR F BR' L BL' BR' BL BR L'
|
|
1676
|
+
Alg F U' B F U' BR U BR' U F' U' B' U F'
|
|
1677
|
+
Alg D F' BR R F' R' F BR' D' F
|
|
1678
|
+
Alg B D' B U B' D B U' B BR BL BR' D BL BR BL BR' BL D'
|
|
1679
|
+
Alg B' U' L' D' F D' L' F' L D F' D L U B BL'
|
|
1680
|
+
Alg D L' F R L' BL B L' B' BL' L R' F' L F L' F' D'
|
|
1681
|
+
Alg D L' D' BL D F' D F D' BL' L BL D'
|
|
1682
|
+
Alg D' B R U' B' F' BL' L BL L' BL B F U R' BR' B' D
|
|
1683
|
+
Alg D L BL' F L BL L' B' F R U' R' B F BL L' D'
|
|
1684
|
+
Alg D F' BL F BL U BL F' D B D' F D B' D BR BL BR' U'
|
|
1685
|
+
Alg B F' BL B F' BR' F' L F R' U' R BL' BR BL F' L' B
|
|
1686
|
+
Alg L F BR B' D BL D' R U' R' D BL' D' B BR' F' L BL L
|
|
1687
|
+
Alg B F BL B F' BR' L R' U' R BL' BR BL L' B
|
|
1688
|
+
Alg D' B U BR' D BR' L' U' BR U BR L D' BR U' B' D' BL' D'
|
|
1689
|
+
Alg F' D' BR' BL' BR D' BR L' U' R F R' U BR' L D' F
|
|
1690
|
+
Alg D F U D' BL U' B D' F BR F' D' F' D BR' D B' BL
|
|
1691
|
+
Alg B U' D' F D BL' D' BR D' BR' D BL B' BL' B F' U D B'
|
|
1692
|
+
Alg L' BL' L' F BR B' D BL D' R U R' D BL' D' B BR' F' L'
|
|
1693
|
+
Alg B U F' U' B BL' B' U D' R BR R' D F U' B'
|
|
1694
|
+
Alg B L BL' U' L U' L' U R BL F D' BR D F' R' L' B'
|
|
1695
|
+
Alg B' L B' BR' B L' F' BL F BL' B' BR B' F U' F' U BL'
|
|
1696
|
+
Alg D' B BR R U' B' F' BL' L BL' L' BL B F U R' B' D
|
|
1697
|
+
Alg B BL' U' B BL' B D B D' B D B D' BL B' U BL B'
|
|
1698
|
+
Alg U BR' U' BR L' F BR' L' U BR U' L F' L
|
|
1699
|
+
Alg L' U BR BL BR' B U BR' U' BR B' BL' U' L
|
|
1700
|
+
Alg BR BL D BR' BL' L BL' BR BL L' BL D' BL' BR'
|
|
1701
|
+
Alg F' BL' D' BR' D BL BR' B U BR U' B' BR F
|
|
1702
|
+
Alg F U' F' D F' U' B' U F' U' B U' F' D'
|
|
1703
|
+
Alg B' U BR' R' U R U' BR B U'
|
|
1704
|
+
Alg L U BL U' BL' L' BL L' F' BL' F BL L BL'
|
|
1705
|
+
Alg U B' BL' BR' U F' BR' D' F BR' U BL' L' BL'
|
|
1706
|
+
Alg F BL' L' F' BL D' F' BR U' R' F' U F' BR'
|
|
1707
|
+
Alg U B U' BL L U' L' U BL' B'
|
|
1708
|
+
Alg U BL U' B BR' B U BL' U' BL L B' BR B L' B
|
|
1709
|
+
Alg B BL B L F' U' F U F BR' R' U' R BR' F' BR' L' B
|
|
1710
|
+
Alg B BR D L' D' F' D F D' F' D' F D' BR' L D' B D B
|
|
1711
|
+
Alg F' L B' L' F L' U' F R U R' F' L' U' B BL L'
|
|
1712
|
+
Alg B' L' F U F L' F R U' R' U L F R U R' U B F' BL
|
|
1713
|
+
Alg B U F' D' F' U R BR' R' U' F D B BL B' F U' B'
|
|
1714
|
+
Alg F BL U BL' U' F' BL L U' L D BR L' U L U' BR' U D' L
|
|
1715
|
+
Alg B U' D' B' F BL B BL' D' BR D BR' D BL D' F' U D B'
|
|
1716
|
+
Alg B BL' D' B' D B BL D BR' BL BR' R D R' BR BL' BR D' B'
|
|
1717
|
+
Alg B F U' F' D' F' U' R BL' BR' R' BL U' F D B BL B
|
|
1718
|
+
Alg D BR' BL B' BL' B BL' BR' L' U' R F R' U BR' L D'
|
|
1719
|
+
Alg B' F' U' F' BL' D' B BR' R' U R B' BR D F U B F
|
|
1720
|
+
Alg B' D' B' D BR L' D F' D F D F' D' F D L D' BR' B'
|
|
1721
|
+
Alg D' B F D BL' D' BL B BR' B' BR B' BL' F' D
|
|
1722
|
+
Alg B D B' F BL L' BL' F' L BL L' BL' BR L R L' R' BR' L' D'
|
|
1723
|
+
Alg B U B F' BL' B' D' F' U R BR R' U' F D F U' B'
|
|
1724
|
+
Alg BR BL' L' F' BR U F' U' BR L' B' BR' L F' BR L' B L'
|
|
1725
|
+
Alg D BL' L' BL D F' D' F D' BL' D L D'
|
|
1726
|
+
Alg F' BL' B F U' B U B' D' F' BL' B U' B' BL U F D B'
|
|
1727
|
+
Alg B' F' L BL' BR' R' BL U R BR L' B' F BL' B'
|
|
1728
|
+
Alg BR BL' BR' BL L' F L' BL' BR BL BR' L F' L
|
|
1729
|
+
Alg B BL BR' F U' L F U BR' F BL D BR' BL
|
|
1730
|
+
Alg B' BL' B' U BR' U' BR BL' BR BL BR' B BL B
|
|
1731
|
+
Alg BR' U' L F U' F' U L' BL' U BL BR
|
|
1732
|
+
Alg B U BR R' BR U' B' BR U' B' U BR' R' BR
|
|
1733
|
+
Alg B BR BL L BL BR' BL' L U' BL' U BL L BL' B'
|
|
1734
|
+
Alg F' BR' B BL' BR' R BR' BL BR R' BR B' BR F
|
|
1735
|
+
Alg F' BR' B U BR' U' B' BR BL' D' BR D BL F
|
|
1736
|
+
Alg D' F' BR U' R' F' U F' BR' F BL' L' F' BL
|
|
1737
|
+
Alg B BL U' L U L' BL' U B' U'
|
|
1738
|
+
Alg L' F' R B F' BR L' D' F' D BR' L B' F R' F BL L
|
|
1739
|
+
Alg D F BL L' BL' B L B' L B L B' L BL L BL' F' D'
|
|
1740
|
+
Alg B BL B BR' L R' U' R BR L' B U BR' U' BR BL' BR BL BR'
|
|
1741
|
+
Alg B' F R U' R' F' L' B L' B' L' B BL L'
|
|
1742
|
+
Alg B' L' F D R' F' L' U L F R' U D' L' B BL L F' L
|
|
1743
|
+
Alg D' L' BL F R' BR' R B' F D' BL D B F BL' L D
|
|
1744
|
+
Alg B' BR' R' U' BL' U' L R' F R F' L' R U' BL BR B BL
|
|
1745
|
+
Alg BR L BL BR L U' D R' BL F' R BL' U' D' BR U' L
|
|
1746
|
+
Alg BR L B' L F R F U F' U' R' L' B L F' BR' L BL
|
|
1747
|
+
Alg B F U D' R BL' BR' R' BL U' D B F' BL B
|
|
1748
|
+
Alg L' BL L' D B D' BL' B' D' L R' D R BL' U' L U BL'
|
|
1749
|
+
Alg L' D BL' U' R' BL F R U D' BR L' BL' BR' L'
|
|
1750
|
+
Alg U BR' U' L' BL' U BR U' L' B' F R BL' U R' BL B F' L'
|
|
1751
|
+
Alg BR L' BL' L' B' F R BL' U R' BL B F BR F BR L'
|
|
1752
|
+
Alg B' F' L F BR BL B' BR' B BL' F' L' B' BR B BR' B F BL'
|
|
1753
|
+
Alg B D BR B' D' BL' D B F' R' BR R F BR' D' B'
|
|
1754
|
+
Alg D BL' L' BL' L BL L' BL F' BL' L' F L BL F BL' L D'
|
|
1755
|
+
Alg U' D R' F R U L D' L D L D' BL' L
|
|
1756
|
+
Alg U D' BR D' L' D R F BR F' BR' R' BR' D' L U' D' BL'
|
|
1757
|
+
Alg B' F' BR' L R' BL U R BL' BR L' B' F BL' B'
|
|
1758
|
+
Alg L' F BL' F' BL F' BR F BR' L
|
|
1759
|
+
Alg L BL F' D F D' BL' F L' F'
|
|
1760
|
+
Alg F' D' BR U BR' D BR' U' BR F
|
|
1761
|
+
Alg BR' L BL' BR BL BR L' F' BR' F
|
|
1762
|
+
Alg B BR F BR' B' BR F' R' BR' BL' BR R BR' BL
|
|
1763
|
+
Alg BR' B U BR' R BR R' U' BR B'
|
|
1764
|
+
Alg F' BL' BR R' BR BL BR' R BR' F
|
|
1765
|
+
Alg BR L' BL BR' BL' BR' L U BR U'
|
|
1766
|
+
Alg U BR' U' BR BL' BR BL BR'
|
|
1767
|
+
\`)}var AR,Ng=b(()=>{Vt();vn();AR=null});var $g={};ye($g,{randomMasterTetraminxScrambleString:()=>JR});function nl(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function nn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function bR(e){e=e.slice();let t=e.length,r=nl(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 Yi(e,t){let r=[],n=nl(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 Wg(e){return bR(e)>>1}function on(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function a0(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function ol(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 vr(e,t){return e.length===0?nn(t):e.map(r=>ol(r,t)).reduce(on)}function wR(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=on(e.mp,t.mp),o=on(e.wp,t.wp),l=on(e.cp,t.cp);return{co:r,mp:n,wp:o,cp:l}}function Kg(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)==4}function MR(e){let t=["0","","'"];return e.map(([n,o])=>PR[n]+t[o]).join(" ")}function GR(e){let t=Array(4);for(let l=0;l<4;l++)t[l]=e(3);let r=Yi(e(nl(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=Yi(e(nl(12)/2),12),o=Yi(e(nl(4)/2),4);return{co:t,mp:r,wp:n,cp:o}}function TR(e){return NR(GR(e))}function IR(e,t=!0,r=!1){let n=MR(TR(e));if(!t)return n;let o=["u","l","r","b"],l=["0","","'"];if(!r){for(let u=0;u<4;u++){let m=e(3);m!==0&&(n+=" "+o[u]+l[m])}return n.trim()}let i=[],a=[],f=[];for(let u=0;u<4;u++)i[u]=e(3),a[u]=e(3),f[u]=(i[u]-a[u]+3)%3;let s=u=>u.filter(m=>m!==0).length;for(;!(s(a)>=1&&s(f)>=1&&s(a)+s(f)>=4);)for(let u=0;u<4;u++)a[u]=e(3),f[u]=(i[u]-a[u]+3)%3;let g=a.map((u,m)=>u!==0?o[m]+l[u]+" ":"").join(""),c=f.map((u,m)=>u!==0?" "+o[m]+l[u]:"").join("");return g+n+c}function NR(e){let t=WR(e),r=[Yg(),Zg()],n=[HR(),YR()],o=jR(t),l,i=new Set,a=performance.now();for(let f=0;f<22;f++){let{value:s,done:g}=o.next(),c=e;for(let[R,D]of s)for(let A=0;A<D;A++)c=wR(c,so[R]);let u=JSON.stringify(c);if(i.has(u))continue;i.add(u);let m=qR(c),p=l?l.length-s.length-1:999999,L=ZR(m,r,n,p).next().value;if(L!==void 0&&((l===void 0||l.length>s.length+L.length)&&(l=s.concat(L)),performance.now()-a>300))break}return l}function OR(e){return e[3^e.indexOf(3)]}function WR(e){let t=on(a0(e.mp),e.wp),r=(e.co.reduce((n,o)=>n+o)-OR(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*jR(e){let t=0,r=Hg(),n=VR();for(;;)yield*qg(...e,r,n,t,-1),t++}function*qg(e,t,r,n,o,l,i,a,f,s){let g=ln,c=lr[e]+lr[t]+lr[r]+lr[n]+lr[o]+lr[l],u=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],u0[c]);if(!(u>f)){if(f===0){yield[];return}if(!(u===0&&f===1))for(let m=0;m<g;m++){if(m===s||m<s&&Kg(m,s))continue;let p=e,L=t,R=r,D=n,A=o,y=l;for(let k=1;k<=2;k++){p=i[p][m],L=i[L][m],R=i[R][m],D=i[D][m],A=i[A][m],y=i[y][m];let E=qg(p,L,R,D,A,y,i,a,f-1,m);for(;;){let{value:Q,done:$}=E.next();if($)break;yield[[m,k]].concat(Q)}}}}}function qR(e){let t=e.mp,r=Wg(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 Vg(){if(Ue.phase1pm)return Ue.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(ln).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<ln;l++){let i=Qg[l][t],a=s0[l][r],f=s0[l][n];i<6?e[o][l]=i+6*a+72*f:e[o][l]=i-6+6*f+72*a}}return Ue.phase1pm=e}function Hg(){if(Ue.phase1pcm)return Ue.phase1pcm;let e=Vg(),t=Array(e.length*3).fill().map(()=>Array(ln).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<ln;n++){let o=e[r][n];t[r][n]=o+6*12*12*f0[n],t[r+6*12*12][n]=o+6*12*12*((f0[n]+1)%3),t[r+2*6*12*12][n]=o+6*12*12*((f0[n]+2)%3)}return Ue.phase1pcm=t}function VR(){if(Ue.phase1p2cp)return Ue.phase1p2cp;let e=Vg(),t=Hg(),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,f=Math.floor(i/864);for(let s=0;s<ln;s++){let g=a,c=f;for(let u=1;u<=2;u++){g=e[g][s],c=t[c][s];let m=g+864*c;r[m]===-1&&(l=!0,r[m]=o+1)}}}if(!l)break;o++}return Ue.phase1p2cp=r}function Yg(){if(Ue.phase2pm)return Ue.phase2pm;let e=Array(1440).fill().map(()=>Array(Zi));for(let t=0;t<360;t++){let r=Yi(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<Zi;n++){let o=on(r,so[n].mp),l=Wg(o.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let a=so[n].cp[i];e[t+360*a][n]=l+360*i}}}return Ue.phase2pm=e}function Zg(){if(Ue.phase2om)return Ue.phase2om;let e=Array(32*81).fill().map(()=>Array(Zi));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<Zi;i++){let f=on(n,so[i].mp).slice(0,5).map(u=>+(u>=6)),s=0;for(let u=0;u<5;u++)s+=f[u]<<u;let g=l.map((u,m)=>(u+so[i].co[m])%3),c=0;for(let u=0;u<4;u++)c+=g[u]*3**u;e[t+32*o][i]=s+32*c}}}return Ue.phase2om=e}function HR(){return Ue.phase2pp?Ue.phase2pp:Ue.phase2pp=Xg(Yg(),[0])}function YR(){return Ue.phase2op?Ue.phase2op:Ue.phase2op=Xg(Zg(),[0])}function Xg(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 f of l)if(o[f]===-1){o[f]=a;for(let s=0;s<n;s++){let g=e[f][s];for(;g!=f;)i.push(g),g=e[g][s]}}[l,i]=[i,l],a+=1}return o}function*ZR(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*Jg(e,t,r,l,-1),l++}function*Jg(e,t,r,n,o){let l=e.length,i=t[0][0].length,a=0;for(let f=0;f<l;f++)a=Math.max(a,r[f][e[f]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let f=0;f<i;f++){if(f===o||f<o&&Kg(f,o))continue;let s=e.slice();for(let c=0;c<l;c++)s[c]=t[c][e[c]][f];let g=1;for(;e.some((c,u)=>e[u]!=s[u]);){let c=Jg(s,t,r,n-1,f);for(;;){let{value:u,done:m}=c.next();if(m)break;yield[[f,g]].concat(u)}for(let u=0;u<l;u++)s[u]=t[u][s[u]][f];g++}}}}async function JR(){return IR(await XR,!1)}var X8,J8,$8,xR,SR,vR,ER,kR,zR,_R,CR,so,PR,ln,Zi,KR,Qg,QR,s0,f0,jg,u0,lr,Ue,XR,ec=b(()=>{Mt();"use strict";[X8,J8]=(()=>{let e=new Int8Array(4096*12),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 f=0;f<10;f++){let s=o[f];a+=e[l|s<<12]*i,l&=~(1<<s),i/=11-f}return a}function n(o,l){let i=4095,a=19958400,f=0;for(let s=0;s<10;s++){let g=o/a|0;o-=g*a,f^=g&1;let c=t[i|g<<12];l[s]=c,i&=~(1<<c),a/=11-s}return l[10]=t[i|f<<12],l[11]=t[i|(f^1)<<12],l}return[r,n]})();$8={co:[0,0,0,0],mp:nn(12),wp:nn(12),cp:[0,1,2,3]},xR={co:[2,0,0,0],mp:nn(12),wp:ol([1,9,11],12),cp:[0,1,2,3]},SR={co:[0,2,0,0],mp:nn(12),wp:ol([0,7,2],12),cp:[0,1,2,3]},vR={co:[0,0,2,0],mp:nn(12),wp:ol([3,6,10],12),cp:[0,1,2,3]},ER={co:[0,0,0,2],mp:nn(12),wp:ol([4,8,5],12),cp:[0,1,2,3]},kR={co:[2,0,0,0],mp:vr([[1,9,11],[7,3,5]],12),wp:vr([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},zR={co:[0,2,0,0],mp:vr([[0,7,2],[6,1,8]],12),wp:vr([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},_R={co:[0,0,2,0],mp:vr([[3,6,10],[9,0,4]],12),wp:vr([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},CR={co:[0,0,0,2],mp:vr([[4,8,5],[10,2,11]],12),wp:vr([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},so=[kR,zR,_R,CR,xR,SR,vR,ER],PR=["u","l","r","b","U","L","R","B"],ln=8,Zi=4;KR=[],Qg=[],QR=[],s0=[];for(let e=0;e<ln;e++){let t=so[e];KR[e]=t.mp,Qg[e]=a0(t.mp),QR[e]=t.wp,s0[e]=a0(t.wp)}f0=[0,0,0,0,2,2,2,2],jg=[[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]],u0=new Int8Array(55);for(let e=0;e<25;e++)u0[e]=jg[0][e],u0[e+30]=jg[1][e];lr=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--,lr[n]=o,lr[n+6*12*12]=lr[n+2*6*12*12]=o+5}Ue={};XR=Qe()});var nc={};ye(nc,{cachedMegaminxKPuzzleWithoutMO:()=>ll,cachedSGSDataMegaminx:()=>rd,sgsDataMegaminx:()=>rc});async function $R(){let e=Sn("megaminx",{allMoves:!0,addRotations:!0}),t=new Oe(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new Ir(e,e.getOrbitsDef(!0))});return t.definition.name="megaminx",t}async function ll(){return ed??(ed=$R())}async function rd(){return td??(td=rc())}async function rc(){return Tt(await ll(),\`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
|
|
1149
1768
|
|
|
1150
1769
|
Alg Rv
|
|
1151
1770
|
Alg Rv2
|
|
@@ -2665,7 +3284,7 @@ Alg L' BL2 L2' F' L2 BL2' L2' F L2'
|
|
|
2665
3284
|
Alg U BL2' U R U' BL2 U' L U2 R' U2' L'
|
|
2666
3285
|
Alg U BR U' L2 F L' U BR' U' L F' L2'
|
|
2667
3286
|
Alg U L' BL2 L' FL' L BL2' L U' L2' FL L2
|
|
2668
|
-
Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var
|
|
3287
|
+
Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var ed,td,g0=b(()=>{Je();ko();vn();ed=null;td=null});var ac={};ye(ac,{sgsDataPyraminx:()=>ic,sgsDataPyraminxFixedOrientation:()=>c0});async function ic(){return ld??(ld=id())}async function c0(){return{ordering:(await ic()).ordering.slice(2)}}async function id(){return Tt(await ve.pyraminx.kpuzzle(),\`SubgroupSizes 12 9 12 3 10 3 8 6 2 3 3 3 3
|
|
2669
3288
|
|
|
2670
3289
|
Alg B
|
|
2671
3290
|
Alg B'
|
|
@@ -2742,7 +3361,7 @@ Alg r
|
|
|
2742
3361
|
Alg r'
|
|
2743
3362
|
|
|
2744
3363
|
Alg u
|
|
2745
|
-
Alg u'\`)}var
|
|
3364
|
+
Alg u'\`)}var ld,m0=b(()=>{Vt();vn();ld=null});var gc={};ye(gc,{sgsDataSkewb:()=>uc,sgsDataSkewbFixedCorner:()=>L0,skewbKPuzzleWithoutMOCached:()=>Xi});async function ud(){let e=Sn("skewb",{allMoves:!0,addRotations:!0});return new Oe(e.getKPuzzleDefinition(!0),{experimentalPGNotation:new Ir(e,e.getOrbitsDef(!0))})}async function Xi(){return gd??(gd=ud())}async function uc(){return cd??(cd=md())}async function L0(){return{ordering:(await uc()).ordering.slice(1)}}async function md(){return Tt(await Xi(),\`SubgroupSizes 24 6 5 12 9 3 4 9 3 3
|
|
2746
3365
|
|
|
2747
3366
|
Alg y
|
|
2748
3367
|
Alg y2
|
|
@@ -2820,9 +3439,9 @@ Alg U L U' B' U L' U' B
|
|
|
2820
3439
|
Alg U' B L U L B' U' L'
|
|
2821
3440
|
|
|
2822
3441
|
Alg U R' U' L B R' B' R
|
|
2823
|
-
Alg R' U' R U B' U' B L\`)}var a3,s3,h0=w(()=>{Je();Eo();_o();a3=null;s3=null});var Bm={};Be(Bm,{getRandomSquare1ScrambleString:()=>M3});function g3(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function dm(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 d3(e){var t,r,n,o,l;for(n=0,e.arr[0]=Nt(e,0),o=1;o<24;++o)Nt(e,o)!=e.arr[n]&&(e.arr[++n]=Nt(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 h3(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,il(d3(e)<<24|n<<18|o<<12|t<<6|r)}function L3(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~Nt(e,r*3+1)>>1<<24)>>24;for(t.cornperm=ul(e.prm),t.topEdgeFirst=Nt(e,0)==Nt(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~Nt(e,r)>>1<<24)>>24;for(t.botEdgeFirst=Nt(e,12)==Nt(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~Nt(e,r)>>1<<24)>>24;t.edgeperm=ul(e.prm),t.ml=e.ml}function Nt(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 A0(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 D0(){this.arr=[],this.prm=[]}async function A3(){let e=await Qe();var t,r,n,o,l,i,a,f,s;for(t=new D0,n=so[e(3678)],l=19088743<<1|286331153,o=19088743<<1,a=i=8,r=0;r<24;r++)(n>>r&1)==0?(f=e(i)<<2,A0(t,23-r,o>>f&15),s=(1<<f)-1,o=(o&s)+(o>>4&~s),--i):(f=e(a)<<2,A0(t,23-r,l>>f&15),A0(t,22-r,l>>f&15),s=(1<<f)-1,l=(l&s)+(l>>4&~s),--a,++r);return t.ml=e(2),t}function D3(){}function y3(e){var t,r,n,o,l,i;for(g3(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)dm(e.Search_d,e.Search_move[n]);for(L3(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,l=e.Search_sq.ml,i=Math.max(Re[e.Search_sq.edgeperm<<1|l],Re[e.Search_sq.cornperm<<1|l]),n=i;n<e.Search_maxlen2;++n)if($i(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,l,n,e.Search_length1,0)){for(o=0;o<n;++o)dm(e.Search_d,e.Search_move[e.Search_length1+o]);return e.Search_sol_string=R3(e,n+e.Search_length1),!0}return!1}function R3(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 Ji(e,t,r,n,o,l){var i,a,f;if(r==0&&n<4)return n==0&&y3(e);if(l!=0&&(f=ea[t],a=ze[f],a<n&&(e.Search_move[o]=0,Ji(e,f,a,n-1,o+1,0))))return!0;if(f=t,l<=0){for(i=0;i+=sl[f],f=~~i>>4,i&=15,!(i>=12||(a=ze[f],a>n));)if(a<n&&(e.Search_move[o]=i,Ji(e,f,a,n-1,o+1,1)))return!0}if(f=t,l<=1){for(i=0;i+=al[f],f=~~i>>4,i&=15,!(i>=6||(a=ze[f],a>n));)if(a<n&&(e.Search_move[o]=-i,Ji(e,f,a,n-1,o+1,2)))return!0}return!1}function $i(e,t,r,n,o,l,i,a,f){var s,c,m,u,p,g,d;if(i==0&&!n&&o||f!=0&&n==o&&(m=cl[t],c=cl[r],Re[m<<1|1-l]<i&&Re[c<<1|1-l]<i&&(e.Search_move[a]=0,$i(e,m,c,n,o,1-l,i-1,a+1,0))))return!0;if(f<=0)for(d=!n,m=d?fn[t]:t,c=d?r:fn[r],u=d?1:2,p=Re[m<<1|l],g=Re[c<<1|l];u<12&&p<=i&&p<=i;){if(p<i&&g<i&&(e.Search_move[a]=u,$i(e,m,c,d,o,l,i-1,a+1,1)))return!0;d=!d,d?(m=fn[m],p=Re[m<<1|l],u+=1):(c=fn[c],g=Re[c<<1|l],u+=2)}if(f<=1)for(s=!o,m=s?an[t]:t,c=s?r:an[r],u=s?1:2,p=Re[m<<1|l],g=Re[c<<1|l];u<(i>3?6:12)&&p<=i&&p<=i;){if(p<i&&g<i&&(e.Search_move[a]=-u,$i(e,m,c,n,s,l,i-1,a+1,2)))return!0;s=!s,s?(m=an[m],p=Re[m<<1|l],u+=1):(c=an[c],g=Re[c<<1|l],u+=2)}return!1}function F3(e,t){var r;for(e.Search_c=t,r=h3(t),e.Search_length1=ze[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!Ji(e,r,ze[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function hm(){this.Search_move=[],this.Search_d=new D0,this.Search_sq=new ym}function B3(){}function b3(){Lm||(Lm=!0,fl=[0,3,6,12,15,24,27,30,48,51,54,60,63],so=[],ze=[],sl=[],al=[],ea=[],S3())}function w3(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((un(e.bottom&63)&1)!=0);return(un(e.bottom)&2)==0&&(e.Shape_parity^=r),t}function y0(e){var t;return t=Fm(so,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function R0(e,t){e.Shape_parity=t&1,e.top=so[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function x3(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((un(e.top&63)&1)!=0);return(un(e.top)&2)==0&&(e.Shape_parity^=r),t}function Am(){}function il(e){var t;return t=Fm(so,e&16777215)<<1|~~e>>24,t}function S3(){var e,t,r,n,o,l,i,a,f,s,c,m,u,p,g,d;for(e=0,i=0;i<28561;++i)l=fl[i%13],r=fl[~~(i/13)%13],m=fl[~~(~~(i/13)/13)%13],c=fl[~~(~~(~~(i/13)/13)/13)],u=c<<18|m<<12|r<<6|l,un(u)==16&&(so[e++]=u);for(s=new Am,i=0;i<7356;++i)R0(s,i),sl[i]=x3(s),sl[i]|=y0(s)<<4,R0(s,i),al[i]=w3(s),al[i]|=y0(s)<<4,R0(s,i),d=s.top&63,p=un(d),g=un(s.bottom&4032),s.Shape_parity^=1&~~(p&g)>>1,s.top=s.top&4032|~~s.bottom>>6&63,s.bottom=s.bottom&63|d<<6,ea[i]=y0(s);for(i=0;i<7536;++i)ze[i]=-1;for(ze[il(14378715)]=0,ze[il(31157686)]=0,ze[il(23967451)]=0,ze[il(7191990)]=0,n=4,o=0,t=-1;n!=o;)for(o=n,++t,i=0;i<7536;++i)if(ze[i]==t){f=0,a=i;do a=sl[a],f+=a&15,a>>=4,ze[a]==-1&&(++n,ze[a]=t+1);while(f!=12);f=0,a=i;do a=al[a],f+=a&15,a>>=4,ze[a]==-1&&(++n,ze[a]=t+1);while(f!=12);a=ea[i],ze[a]==-1&&(++n,ze[a]=t+1)}}function v3(){}function U3(){if(!Dm){Dm=!0,Re=[],cl=[],fn=[],an=[],Rm=[1,1,2,6,24,120,720,5040],sn=[];for(var e=0;e<12;++e)sn[e]=[];E3()}}function ym(){}function ul(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 E3(){var e,t,r,n,o,l,i,a,f,s,c,m,u;for(o=0;o<12;++o)for(sn[o][0]=1,sn[o][o]=1,f=1;f<o;++f)sn[o][f]=sn[o-1][f-1]+sn[o-1][f];for(m=[],o=0;o<40320;++o)F0(m,o),u=m[2],m[2]=m[4],m[4]=u,u=m[3],m[3]=m[5],m[5]=u,cl[o]=ul(m),F0(m,o),u=m[0],m[0]=m[1],m[1]=m[2],m[2]=m[3],m[3]=u,fn[o]=ul(m),F0(m,o),u=m[4],m[4]=m[5],m[5]=m[6],m[6]=m[7],m[7]=u,an[o]=ul(m);for(o=0;o<80640;++o)Re[o]=-1;for(Re[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(Re[o]==n){if(l=~~o>>1,c=o&1,i=cl[l]<<1|1-c,Re[i]==e&&(++r,Re[a?o:i]=~~(t<<24)>>24,a))continue e;for(i=l,s=0;s<4;++s)if(i=fn[i],Re[i<<1|c]==e&&(++r,Re[a?o:i<<1|c]=~~(t<<24)>>24,a))continue e;for(s=0;s<4;++s)if(i=an[i],Re[i<<1|c]==e&&(++r,Re[a?o:i<<1|c]=~~(t<<24)>>24,a))continue e}}}function F0(e,t){var r,n,o,l,i;for(i=1985229328,r=0;r<7;++r)o=Rm[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 k3(){}function un(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 Fm(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 M3(){return(await P3()).scramble_string}var Se,Lm,al,so,ze,sl,ea,fl,Dm,an,sn,Re,fn,cl,Rm,B0,z3,_3,C3,P3,bm=w(()=>{Mt();Se=D0.prototype=D3.prototype;Se.dl=10062778;Se.dr=14536702;Se.ml=0;Se.ul=70195;Se.ur=4544119;Se=hm.prototype=B3.prototype;Se.Search_c=null;Se.Search_length1=0;Se.Search_maxlen2=0;Se.Search_sol_string=null;Lm=!1;Se=Am.prototype=v3.prototype;Se.bottom=0;Se.Shape_parity=0;Se.top=0;Dm=!1;Se=ym.prototype=k3.prototype;Se.botEdgeFirst=!1;Se.cornperm=0;Se.edgeperm=0;Se.ml=0;Se.topEdgeFirst=!1;B0=!1,z3=function(e,t,r){B0||(b3(),U3()),r&&r("Done initializing Square-1."),B0=!0,e!=null&&e()},_3=async function(){return B0||z3(),A3()},C3=function(e){var t=new hm;return F3(t,e)},P3=async function(){var e=await _3(),t=C3(e);return{state:e,scramble_string:t}}});var S0=Symbol("Comlink.proxy"),zm=Symbol("Comlink.endpoint"),_m=Symbol("Comlink.releaseProxy"),na=Symbol("Comlink.thrown"),v0=e=>typeof e=="object"&&e!==null||typeof e=="function",Cm={canHandle:e=>v0(e)&&e[S0],serialize(e){let{port1:t,port2:r}=new MessageChannel;return fo(e,t),[r,[r]]},deserialize(e){return e.start(),Gm(e)}},Pm={canHandle:e=>v0(e)&&na 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}},U0=new Map([["proxy",Cm],["throw",Pm]]);function fo(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(Er),f;try{let s=i.slice(0,-1).reduce((m,u)=>m[u],e),c=i.reduce((m,u)=>m[u],e);switch(l){case"GET":f=c;break;case"SET":s[i.slice(-1)[0]]=Er(n.data.value),f=!0;break;case"APPLY":f=c.apply(s,a);break;case"CONSTRUCT":{let m=new c(...a);f=Nm(m)}break;case"ENDPOINT":{let{port1:m,port2:u}=new MessageChannel;fo(e,u),f=Im(m,[m])}break;case"RELEASE":f=void 0;break;default:return}}catch(s){f={value:s,[na]:0}}Promise.resolve(f).catch(s=>({value:s,[na]:0})).then(s=>{let[c,m]=la(s);t.postMessage(Object.assign(Object.assign({},c),{id:o}),m),l==="RELEASE"&&(t.removeEventListener("message",r),E0(t))})}),t.start&&t.start()}function Mm(e){return e.constructor.name==="MessagePort"}function E0(e){Mm(e)&&e.close()}function Gm(e,t){return oa(e,[],t)}function ml(e){if(e)throw new Error("Proxy has been released and is not useable")}function oa(e,t=[],r=function(){}){let n=!1,o=new Proxy(r,{get(l,i){if(ml(n),i===_m)return()=>cn(e,{type:"RELEASE",path:t.map(a=>a.toString())}).then(()=>{E0(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>o};let a=cn(e,{type:"GET",path:t.map(f=>f.toString())}).then(Er);return a.then.bind(a)}return oa(e,[...t,i])},set(l,i,a){ml(n);let[f,s]=la(a);return cn(e,{type:"SET",path:[...t,i].map(c=>c.toString()),value:f},s).then(Er)},apply(l,i,a){ml(n);let f=t[t.length-1];if(f===zm)return cn(e,{type:"ENDPOINT"}).then(Er);if(f==="bind")return oa(e,t.slice(0,-1));let[s,c]=k0(a);return cn(e,{type:"APPLY",path:t.map(m=>m.toString()),argumentList:s},c).then(Er)},construct(l,i){ml(n);let[a,f]=k0(i);return cn(e,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:a},f).then(Er)}});return o}function Tm(e){return Array.prototype.concat.apply([],e)}function k0(e){let t=e.map(la);return[t.map(r=>r[0]),Tm(t.map(r=>r[1]))]}var z0=new WeakMap;function Im(e,t){return z0.set(e,t),e}function Nm(e){return Object.assign(e,{[S0]:!0})}function la(e){for(let[t,r]of U0)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},o]}return[{type:"RAW",value:e},z0.get(e)||[]]}function Er(e){switch(e.type){case"HANDLER":return U0.get(e.name).deserialize(e.value);case"RAW":return e.value}}function cn(e,t,r){return new Promise(n=>{let o=Om();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 Om(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Vm=typeof globalThis.Worker=="undefined"&&typeof globalThis.WorkerNavigator=="undefined";function G0(e){Vm?(async()=>{let{port:t}=await Promise.resolve().then(()=>(M0(),P0));fo(e,await t())})():fo(e)}Je();ur();qt();Je();ur();Mt();qt();Le();Le();var ja=class extends An{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 Kf(e){return"A"<=e&&e<="Z"}function Yp(e){let t=e.family;return Kf(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function Zp(e){let t=e.family;return Kf(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var Qf=new ja(Yp),qa=Qf.traverseAlg.bind(Qf),jf=new ja(Zp),Xp=jf.traverseAlg.bind(jf);Le();var qf=class extends An{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}},Vf=new qf,Jp=Vf.traverseAlg.bind(Vf);Mt();var $p=2,eg=!0,tg=!1;function rg(e,t){let r=[];return t.forEach(function(n){let o=new h(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 Gt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=rg(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=$p,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=(f,s,c)=>{if(s===0){let m=this.sgsPhaseSolve(f,i);if(!m)return;let u=c.concat(m).simplify({collapseMoves:!0,quantumMoveOrder:n}),p=qa(u);(l===null||p<i)&&(tg&&(console.log(\`New best (\${p} moves): \${u.toString()}\`),console.log(\`Tremble moves are: \${c.toString()}\`)),l=u,i=p);return}for(let m of this.searchMoves)a(f.applyTransformation(m.transformation),s-1,c.concat([m.move]))};for(let f=0;f<=r;f++)a(o,f,new z);if(l===null)throw new Error("SGS search failed.");return l}sgsPhaseSolve(t,r){let n=new pt,o=t;for(let l of this.sgs.ordering){let i=l.pieceOrdering,a="",f=o.invert();for(let c=0;c<i.length;c++){let m=i[c],u=m.orbitName,p=m.permutationIdx;a+=\` \${f.transformationData[u].permutation[p]} \${f.transformationData[u].orientation[p]}\`}let s=l.lookup[a];if(!s)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(s.alg),n.experimentalNumUnits()>=r)return null;if(o=o.applyTransformation(s.transformation),eg)for(let c=0;c<i.length;c++){let m=i[c],u=m.orbitName,p=m.permutationIdx;if(o.transformationData[u].permutation[p]!==p||o.transformationData[u].orientation[p]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function Vl(e,t){let r=await Vt(),n=e.identityTransformation();for(let o of t.ordering){let l=r(Object.values(o.lookup));n=n.applyTransformation(l.transformation)}return n.toKState()}var lg=3,Xf=null;async function Jf(){return Xf||(Xf=(async()=>{let e=await(await Promise.resolve().then(()=>(Zf(),Yf))).cachedData222();return new Gt(await Ke["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function $f(){await Jf()}async function Va(e){return ct(),await(await Jf()).solve(e,lg,()=>4)}async function ig(e,t,r,n){let o=await Qe();await Wf(r.stateData[t].pieces);let l=e.definition.orbits[t],i=r.stateData[t].orientation,a=0;for(let f=0;f<l.numPieces;f++){let s=o(l.numOrientations);i[f]=s,a+=s}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-a)%l.numOrientations+l.numOrientations)%l.numOrientations)}async function ag(){let e=await Ke["2x2x2"].kpuzzle(),t=new ge(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await ig(e,"CORNERS",t,{orientationSum:0}),t}async function eu(){return await Va(await ag())}As();Hl();var Fh=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]],Bh=null;function oc(){return Bh??(Bh=Promise.resolve().then(()=>(nc(),rc)))}async function lc(){return(await oc()).initialize()}async function Qs(){return(await oc()).random444Scramble()}async function ic(){return Un(await Qs(),Fh)}Hl();Le();Mt();function bh(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var wh=[["U","D"],["L","R"],["F","B"]],ac=new Map;function xh(e){let t=ac.get(e);if(t)return t;let r=[];for(let n of wh){let o=[];r.push(o);for(let l of n){o.push(new P(l)),e>3&&o.push(new P(\`\${l}w\`));for(let i=3;i<=e/2;i++)o.push(new P(\`\${l}w\`,i))}}return ac.set(e,r),r}async function er(e){let t=await Qe(),r=await Vt(),n=r,o=xh(e),l=bh(e),i=new pt,a=0,f=new Set;for(;i.experimentalNumUnits()<l;){let s=t(3);s!==a&&f.clear(),a=s;let c=r(o[a]),m=c.toString();f.has(m)||(f.add(m),i.push(new h(c,n([1,2,-1]))))}return i.toAlg()}var Sh=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function sc(){return Un(await er(5),Sh)}Le();ur();qt();async function Oc(){let{randomFTOScrambleString:e}=await Promise.resolve().then(()=>(Nc(),Ic));return new z(await e())}Le();async function rm(){let{randomMasterTetraminxScrambleString:e}=await Promise.resolve().then(()=>(tm(),em));return new z(await e())}Je();qt();c0();var $L=2,lm=null;async function e3(){return lm||(lm=(async()=>{let t=await(await Promise.resolve().then(()=>(c0(),om))).cachedSGSDataMegaminx();return new Gt(await ll(),t,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function im(e){ct();let t=await e3(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new ge(await ll(),r);return await t.solve(n,$L,()=>5)}ur();qt();p0();var n3=3,fm=null;async function o3(){return fm||(fm=(async()=>{let t=await(await Promise.resolve().then(()=>(p0(),sm))).sgsDataPyraminx();return new Gt(await Ke.pyraminx.kpuzzle(),t,"RLUB".split(""))})())}async function g0(e){return ct(),await(await o3()).solve(e,n3,()=>3)}async function l3(){return Vl(await Ke.pyraminx.kpuzzle(),await m0())}async function um(){return g0(await l3())}Je();qt();h0();var u3=3,pm=null;async function c3(){return pm||(pm=(async()=>{let e=await Promise.resolve().then(()=>(h0(),mm)),t=await e.sgsDataSkewb();return new Gt(await e.skewbKPuzzleWithoutMOCached(),t,"RLUB".split(""))})())}function m3(e){return new ge(e.kpuzzle,{CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})}async function L0(e){return ct(),await(await c3()).solve(m3(e),u3,n=>n.family==="y"?4:3)}async function p3(){return Vl(await Xi(),await d0())}async function gm(){return L0(await p3())}Le();var G3=null;function T3(){return G3??(G3=Promise.resolve().then(()=>(bm(),Bm)))}async function wm(){return z.fromString(await(await T3()).getRandomSquare1ScrambleString())}Gf(!0);var xm=!0;function I3(e){xm=e}function Sm(){return(typeof performance=="undefined"?Date:performance).now()}async function _e(e,t){if(!xm)return t();let r=Sm(),n=t();n?.then&&await n;let o=Sm();return console.warn(\`\${e}: \${Math.round(o-r)}ms\`),n}var b0={initialize:async e=>{switch(e){case"222":return _e("preInitialize222",$f);case"333":case"333oh":case"333ft":return _e("initialize333",Qu);case"444":return _e("initialize444",lc);default:throw new Error(\`unsupported event: \${e}\`)}},randomScrambleForEvent:async e=>{switch(e){case"222":return _e("random222Scramble",eu);case"333":case"333oh":case"333ft":return _e("random333Scramble",On);case"333fm":return _e("random333FewestMovesScramble",Vu);case"333bf":case"333mb":return _e("random333OrientedScramble",ju);case"444":return _e("random444Scramble",Qs);case"444bf":return _e("random444OrientedScramble",ic);case"555":return _e("bigCubeScramble(5)",er.bind(er,5));case"555bf":return _e("oriented555RandomMoves",sc);case"666":return _e("bigCubeScramble(6)",er.bind(er,6));case"777":return _e("bigCubeScramble(7)",er.bind(er,7));case"skewb":return _e("randomSkewbFixedCornerScramble",gm);case"pyram":return _e("randomPyraminxScrambleFixedOrientation",um);case"sq1":return _e("getRandomSquare1Scramble",wm);case"fto":return _e("randomFTOScramble",Oc);case"master_tetraminx":return _e("randomMasterTetraminxScramble",rm);default:throw new Error(\`unsupported event: \${e}\`)}},randomScrambleStringForEvent:async e=>(await b0.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new ge(await Ke["3x3x3"].kpuzzle(),e);return(await Ls(t)).toString()},solve222ToString:async e=>{let t=new ge(await Ke["2x2x2"].kpuzzle(),e);return(await Va(t)).toString()},solveSkewbToString:async e=>{let t=new ge(await Ke.skewb.kpuzzle(),e);return(await L0(t)).toString()},solvePyraminxToString:async e=>{let t=new ge(await Ke.pyraminx.kpuzzle(),e);return(await g0(t)).toString()},solveMegaminxToString:async e=>{let t=new ge(await Ke.megaminx.kpuzzle(),e);return(await im(t)).toString()},setDebugMeasurePerf:async e=>{I3(e)}};G0(b0);
|
|
3442
|
+
Alg R' U' R U B' U' B L\`)}var gd,cd,B0=b(()=>{Je();ko();vn();gd=null;cd=null});var Ac={};ye(Ac,{getRandomSquare1ScrambleString:()=>Nd});function dd(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function pc(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 Dd(e){var t,r,n,o,l;for(n=0,e.arr[0]=Ot(e,0),o=1;o<24;++o)Ot(e,o)!=e.arr[n]&&(e.arr[++n]=Ot(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 Fd(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,il(Dd(e)<<24|n<<18|o<<12|t<<6|r)}function hd(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~Ot(e,r*3+1)>>1<<24)>>24;for(t.cornperm=ul(e.prm),t.topEdgeFirst=Ot(e,0)==Ot(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~Ot(e,r)>>1<<24)>>24;for(t.botEdgeFirst=Ot(e,12)==Ot(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~Ot(e,r)>>1<<24)>>24;t.edgeperm=ul(e.prm),t.ml=e.ml}function Ot(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 d0(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 D0(){this.arr=[],this.prm=[]}async function Ad(){let e=await Qe();var t,r,n,o,l,i,a,f,s;for(t=new D0,n=fo[e(3678)],l=19088743<<1|286331153,o=19088743<<1,a=i=8,r=0;r<24;r++)(n>>r&1)==0?(f=e(i)<<2,d0(t,23-r,o>>f&15),s=(1<<f)-1,o=(o&s)+(o>>4&~s),--i):(f=e(a)<<2,d0(t,23-r,l>>f&15),d0(t,22-r,l>>f&15),s=(1<<f)-1,l=(l&s)+(l>>4&~s),--a,++r);return t.ml=e(2),t}function yd(){}function Ud(e){var t,r,n,o,l,i;for(dd(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)pc(e.Search_d,e.Search_move[n]);for(hd(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,l=e.Search_sq.ml,i=Math.max(he[e.Search_sq.edgeperm<<1|l],he[e.Search_sq.cornperm<<1|l]),n=i;n<e.Search_maxlen2;++n)if($i(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,l,n,e.Search_length1,0)){for(o=0;o<n;++o)pc(e.Search_d,e.Search_move[e.Search_length1+o]);return e.Search_sol_string=bd(e,n+e.Search_length1),!0}return!1}function bd(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 Ji(e,t,r,n,o,l){var i,a,f;if(r==0&&n<4)return n==0&&Ud(e);if(l!=0&&(f=ea[t],a=_e[f],a<n&&(e.Search_move[o]=0,Ji(e,f,a,n-1,o+1,0))))return!0;if(f=t,l<=0){for(i=0;i+=sl[f],f=~~i>>4,i&=15,!(i>=12||(a=_e[f],a>n));)if(a<n&&(e.Search_move[o]=i,Ji(e,f,a,n-1,o+1,1)))return!0}if(f=t,l<=1){for(i=0;i+=al[f],f=~~i>>4,i&=15,!(i>=6||(a=_e[f],a>n));)if(a<n&&(e.Search_move[o]=-i,Ji(e,f,a,n-1,o+1,2)))return!0}return!1}function $i(e,t,r,n,o,l,i,a,f){var s,g,c,u,m,p,L;if(i==0&&!n&&o||f!=0&&n==o&&(c=gl[t],g=gl[r],he[c<<1|1-l]<i&&he[g<<1|1-l]<i&&(e.Search_move[a]=0,$i(e,c,g,n,o,1-l,i-1,a+1,0))))return!0;if(f<=0)for(L=!n,c=L?fn[t]:t,g=L?r:fn[r],u=L?1:2,m=he[c<<1|l],p=he[g<<1|l];u<12&&m<=i&&m<=i;){if(m<i&&p<i&&(e.Search_move[a]=u,$i(e,c,g,L,o,l,i-1,a+1,1)))return!0;L=!L,L?(c=fn[c],m=he[c<<1|l],u+=1):(g=fn[g],p=he[g<<1|l],u+=2)}if(f<=1)for(s=!o,c=s?an[t]:t,g=s?r:an[r],u=s?1:2,m=he[c<<1|l],p=he[g<<1|l];u<(i>3?6:12)&&m<=i&&m<=i;){if(m<i&&p<i&&(e.Search_move[a]=-u,$i(e,c,g,n,s,l,i-1,a+1,2)))return!0;s=!s,s?(c=an[c],m=he[c<<1|l],u+=1):(g=an[g],p=he[g<<1|l],u+=2)}return!1}function wd(e,t){var r;for(e.Search_c=t,r=Fd(t),e.Search_length1=_e[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!Ji(e,r,_e[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function Lc(){this.Search_move=[],this.Search_d=new D0,this.Search_sq=new Dc}function xd(){}function Sd(){Bc||(Bc=!0,fl=[0,3,6,12,15,24,27,30,48,51,54,60,63],fo=[],_e=[],sl=[],al=[],ea=[],kd())}function vd(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((un(e.bottom&63)&1)!=0);return(un(e.bottom)&2)==0&&(e.Shape_parity^=r),t}function F0(e){var t;return t=hc(fo,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function h0(e,t){e.Shape_parity=t&1,e.top=fo[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function Ed(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((un(e.top&63)&1)!=0);return(un(e.top)&2)==0&&(e.Shape_parity^=r),t}function Rc(){}function il(e){var t;return t=hc(fo,e&16777215)<<1|~~e>>24,t}function kd(){var e,t,r,n,o,l,i,a,f,s,g,c,u,m,p,L;for(e=0,i=0;i<28561;++i)l=fl[i%13],r=fl[~~(i/13)%13],c=fl[~~(~~(i/13)/13)%13],g=fl[~~(~~(~~(i/13)/13)/13)],u=g<<18|c<<12|r<<6|l,un(u)==16&&(fo[e++]=u);for(s=new Rc,i=0;i<7356;++i)h0(s,i),sl[i]=Ed(s),sl[i]|=F0(s)<<4,h0(s,i),al[i]=vd(s),al[i]|=F0(s)<<4,h0(s,i),L=s.top&63,m=un(L),p=un(s.bottom&4032),s.Shape_parity^=1&~~(m&p)>>1,s.top=s.top&4032|~~s.bottom>>6&63,s.bottom=s.bottom&63|L<<6,ea[i]=F0(s);for(i=0;i<7536;++i)_e[i]=-1;for(_e[il(14378715)]=0,_e[il(31157686)]=0,_e[il(23967451)]=0,_e[il(7191990)]=0,n=4,o=0,t=-1;n!=o;)for(o=n,++t,i=0;i<7536;++i)if(_e[i]==t){f=0,a=i;do a=sl[a],f+=a&15,a>>=4,_e[a]==-1&&(++n,_e[a]=t+1);while(f!=12);f=0,a=i;do a=al[a],f+=a&15,a>>=4,_e[a]==-1&&(++n,_e[a]=t+1);while(f!=12);a=ea[i],_e[a]==-1&&(++n,_e[a]=t+1)}}function zd(){}function _d(){if(!dc){dc=!0,he=[],gl=[],fn=[],an=[],Fc=[1,1,2,6,24,120,720,5040],sn=[];for(var e=0;e<12;++e)sn[e]=[];Cd()}}function Dc(){}function ul(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 Cd(){var e,t,r,n,o,l,i,a,f,s,g,c,u;for(o=0;o<12;++o)for(sn[o][0]=1,sn[o][o]=1,f=1;f<o;++f)sn[o][f]=sn[o-1][f-1]+sn[o-1][f];for(c=[],o=0;o<40320;++o)A0(c,o),u=c[2],c[2]=c[4],c[4]=u,u=c[3],c[3]=c[5],c[5]=u,gl[o]=ul(c),A0(c,o),u=c[0],c[0]=c[1],c[1]=c[2],c[2]=c[3],c[3]=u,fn[o]=ul(c),A0(c,o),u=c[4],c[4]=c[5],c[5]=c[6],c[6]=c[7],c[7]=u,an[o]=ul(c);for(o=0;o<80640;++o)he[o]=-1;for(he[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(he[o]==n){if(l=~~o>>1,g=o&1,i=gl[l]<<1|1-g,he[i]==e&&(++r,he[a?o:i]=~~(t<<24)>>24,a))continue e;for(i=l,s=0;s<4;++s)if(i=fn[i],he[i<<1|g]==e&&(++r,he[a?o:i<<1|g]=~~(t<<24)>>24,a))continue e;for(s=0;s<4;++s)if(i=an[i],he[i<<1|g]==e&&(++r,he[a?o:i<<1|g]=~~(t<<24)>>24,a))continue e}}}function A0(e,t){var r,n,o,l,i;for(i=1985229328,r=0;r<7;++r)o=Fc[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 Pd(){}function un(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 hc(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 Nd(){return(await Id()).scramble_string}var xe,Bc,al,fo,_e,sl,ea,fl,dc,an,sn,he,fn,gl,Fc,y0,Md,Gd,Td,Id,yc=b(()=>{Mt();xe=D0.prototype=yd.prototype;xe.dl=10062778;xe.dr=14536702;xe.ml=0;xe.ul=70195;xe.ur=4544119;xe=Lc.prototype=xd.prototype;xe.Search_c=null;xe.Search_length1=0;xe.Search_maxlen2=0;xe.Search_sol_string=null;Bc=!1;xe=Rc.prototype=zd.prototype;xe.bottom=0;xe.Shape_parity=0;xe.top=0;dc=!1;xe=Dc.prototype=Pd.prototype;xe.botEdgeFirst=!1;xe.cornperm=0;xe.edgeperm=0;xe.ml=0;xe.topEdgeFirst=!1;y0=!1,Md=function(e,t,r){y0||(Sd(),_d()),r&&r("Done initializing Square-1."),y0=!0,e!=null&&e()},Gd=async function(){return y0||Md(),Ad()},Td=function(e){var t=new Lc;return wd(t,e)},Id=async function(){var e=await Gd(),t=Td(e);return{state:e,scramble_string:t}}});var x0=Symbol("Comlink.proxy"),kc=Symbol("Comlink.endpoint"),zc=Symbol("Comlink.releaseProxy"),na=Symbol("Comlink.thrown"),S0=e=>typeof e=="object"&&e!==null||typeof e=="function",_c={canHandle:e=>S0(e)&&e[x0],serialize(e){let{port1:t,port2:r}=new MessageChannel;return uo(e,t),[r,[r]]},deserialize(e){return e.start(),Mc(e)}},Cc={canHandle:e=>S0(e)&&na 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}},v0=new Map([["proxy",_c],["throw",Cc]]);function uo(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(Er),f;try{let s=i.slice(0,-1).reduce((c,u)=>c[u],e),g=i.reduce((c,u)=>c[u],e);switch(l){case"GET":f=g;break;case"SET":s[i.slice(-1)[0]]=Er(n.data.value),f=!0;break;case"APPLY":f=g.apply(s,a);break;case"CONSTRUCT":{let c=new g(...a);f=Ic(c)}break;case"ENDPOINT":{let{port1:c,port2:u}=new MessageChannel;uo(e,u),f=Tc(c,[c])}break;case"RELEASE":f=void 0;break;default:return}}catch(s){f={value:s,[na]:0}}Promise.resolve(f).catch(s=>({value:s,[na]:0})).then(s=>{let[g,c]=la(s);t.postMessage(Object.assign(Object.assign({},g),{id:o}),c),l==="RELEASE"&&(t.removeEventListener("message",r),E0(t))})}),t.start&&t.start()}function Pc(e){return e.constructor.name==="MessagePort"}function E0(e){Pc(e)&&e.close()}function Mc(e,t){return oa(e,[],t)}function cl(e){if(e)throw new Error("Proxy has been released and is not useable")}function oa(e,t=[],r=function(){}){let n=!1,o=new Proxy(r,{get(l,i){if(cl(n),i===zc)return()=>gn(e,{type:"RELEASE",path:t.map(a=>a.toString())}).then(()=>{E0(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>o};let a=gn(e,{type:"GET",path:t.map(f=>f.toString())}).then(Er);return a.then.bind(a)}return oa(e,[...t,i])},set(l,i,a){cl(n);let[f,s]=la(a);return gn(e,{type:"SET",path:[...t,i].map(g=>g.toString()),value:f},s).then(Er)},apply(l,i,a){cl(n);let f=t[t.length-1];if(f===kc)return gn(e,{type:"ENDPOINT"}).then(Er);if(f==="bind")return oa(e,t.slice(0,-1));let[s,g]=k0(a);return gn(e,{type:"APPLY",path:t.map(c=>c.toString()),argumentList:s},g).then(Er)},construct(l,i){cl(n);let[a,f]=k0(i);return gn(e,{type:"CONSTRUCT",path:t.map(s=>s.toString()),argumentList:a},f).then(Er)}});return o}function Gc(e){return Array.prototype.concat.apply([],e)}function k0(e){let t=e.map(la);return[t.map(r=>r[0]),Gc(t.map(r=>r[1]))]}var z0=new WeakMap;function Tc(e,t){return z0.set(e,t),e}function Ic(e){return Object.assign(e,{[x0]:!0})}function la(e){for(let[t,r]of v0)if(r.canHandle(e)){let[n,o]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},o]}return[{type:"RAW",value:e},z0.get(e)||[]]}function Er(e){switch(e.type){case"HANDLER":return v0.get(e.name).deserialize(e.value);case"RAW":return e.value}}function gn(e,t,r){return new Promise(n=>{let o=Nc();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 Nc(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var Kc=typeof globalThis.Worker=="undefined"&&typeof globalThis.WorkerNavigator=="undefined",Qc="w-orker-_threa-ds",jc=()=>Qc.replace(/-/g,"");async function qc(){let{parentPort:e}=await import(jc()).catch();return(await Promise.resolve().then(()=>(C0(),_0))).default(e)}function P0(e){Kc?(async()=>{uo(e,await qc())})():uo(e)}Je();Vt();Ht();Je();Vt();Mt();Ht();Re();Re();var ja=class extends dn{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 Of(e){return"A"<=e&&e<="Z"}function Hm(e){let t=e.family;return Of(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function Ym(e){let t=e.family;return Of(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var Wf=new ja(Hm),qa=Wf.traverseAlg.bind(Wf),Kf=new ja(Ym),Zm=Kf.traverseAlg.bind(Kf);Re();var Qf=class extends dn{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}},jf=new Qf,Xm=jf.traverseAlg.bind(jf);Mt();var Jm=2,$m=!0,ep=!1;function tp(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 Gt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=tp(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=Jm,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=(f,s,g)=>{if(s===0){let c=this.sgsPhaseSolve(f,i);if(!c)return;let u=g.concat(c).simplify({collapseMoves:!0,quantumMoveOrder:n}),m=qa(u);(l===null||m<i)&&(ep&&(console.log(\`New best (\${m} moves): \${u.toString()}\`),console.log(\`Tremble moves are: \${g.toString()}\`)),l=u,i=m);return}for(let c of this.searchMoves)a(f.applyTransformation(c.transformation),s-1,g.concat([c.move]))};for(let f=0;f<=r;f++)a(o,f,new z);if(l===null)throw new Error("SGS search failed.");return l}sgsPhaseSolve(t,r){let n=new mt,o=t;for(let l of this.sgs.ordering){let i=l.pieceOrdering,a="",f=o.invert();for(let g=0;g<i.length;g++){let c=i[g],u=c.orbitName,m=c.permutationIdx;a+=\` \${f.transformationData[u].permutation[m]} \${f.transformationData[u].orientation[m]}\`}let s=l.lookup[a];if(!s)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(s.alg),n.experimentalNumUnits()>=r)return null;if(o=o.applyTransformation(s.transformation),$m)for(let g=0;g<i.length;g++){let c=i[g],u=c.orbitName,m=c.permutationIdx;if(o.transformationData[u].permutation[m]!==m||o.transformationData[u].orientation[m]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function Vl(e,t){let r=await Yt(),n=e.identityTransformation();for(let o of t.ordering){let l=r(Object.values(o.lookup));n=n.applyTransformation(l.transformation)}return n.toKState()}var op=3,Yf=null;async function Zf(){return Yf||(Yf=(async()=>{let e=await(await Promise.resolve().then(()=>(Hf(),Vf))).cachedData222();return new Gt(await ve["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function Xf(){await Zf()}async function Va(e){return gt(),await(await Zf()).solve(e,op,()=>4)}async function lp(e,t,r,n){let o=await Qe();await Nf(r.stateData[t].pieces);let l=e.definition.orbits[t],i=r.stateData[t].orientation,a=0;for(let f=0;f<l.numPieces;f++){let s=o(l.numOrientations);i[f]=s,a+=s}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-a)%l.numOrientations+l.numOrientations)%l.numOrientations)}async function ip(){let e=await ve["2x2x2"].kpuzzle(),t=new pe(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await lp(e,"CORNERS",t,{orientationSum:0}),t}async function Jf(){return await Va(await ip())}ds();Hl();var hB=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]],AB=null;function rg(){return AB??(AB=Promise.resolve().then(()=>(tg(),eg)))}async function ng(){return(await rg()).initialize()}async function Qs(){return(await rg()).random444Scramble()}async function og(){return En(await Qs(),hB)}Hl();Re();Mt();function yB(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var UB=[["U","D"],["L","R"],["F","B"]],lg=new Map;function bB(e){let t=lg.get(e);if(t)return t;let r=[];for(let n of UB){let o=[];r.push(o);for(let l of n){o.push(new P(l)),e>3&&o.push(new P(\`\${l}w\`));for(let i=3;i<=e/2;i++)o.push(new P(\`\${l}w\`,i))}}return lg.set(e,r),r}async function rr(e){let t=await Qe(),r=await Yt(),n=r,o=bB(e),l=yB(e),i=new mt,a=0,f=new Set;for(;i.experimentalNumUnits()<l;){let s=t(3);s!==a&&f.clear(),a=s;let g=r(o[a]),c=g.toString();f.has(c)||(f.add(c),i.push(new B(g,n([1,2,-1]))))}return i.toAlg()}var wB=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function ig(){return En(await rr(5),wB)}Re();Vt();Ht();async function Og(){let{randomFTOScrambleString:e}=await Promise.resolve().then(()=>(Ng(),Ig));return new z(await e())}Re();async function tc(){let{randomMasterTetraminxScrambleString:e}=await Promise.resolve().then(()=>(ec(),$g));return new z(await e())}Je();Ht();g0();var nd=2,oc=null;async function od(){return oc||(oc=(async()=>{let t=await(await Promise.resolve().then(()=>(g0(),nc))).cachedSGSDataMegaminx();return new Gt(await ll(),t,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function lc(e){gt();let t=await od(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new pe(await ll(),r);return await t.solve(n,nd,()=>5)}Vt();Ht();m0();var ad=3,sc=null;async function sd(){return sc||(sc=(async()=>{let t=await(await Promise.resolve().then(()=>(m0(),ac))).sgsDataPyraminx();return new Gt(await ve.pyraminx.kpuzzle(),t,"RLUB".split(""))})())}async function p0(e){return gt(),await(await sd()).solve(e,ad,()=>3)}async function fd(){return Vl(await ve.pyraminx.kpuzzle(),await c0())}async function fc(){return p0(await fd())}Je();Ht();B0();var pd=3,cc=null;async function Ld(){return cc||(cc=(async()=>{let e=await Promise.resolve().then(()=>(B0(),gc)),t=await e.sgsDataSkewb();return new Gt(await e.skewbKPuzzleWithoutMOCached(),t,"RLUB".split(""))})())}function Bd(e){return new pe(e.kpuzzle,{CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})}async function R0(e){return gt(),await(await Ld()).solve(Bd(e),pd,n=>n.family==="y"?4:3)}async function Rd(){return Vl(await Xi(),await L0())}async function mc(){return R0(await Rd())}Re();var Od=null;function Wd(){return Od??(Od=Promise.resolve().then(()=>(yc(),Ac)))}async function Uc(){return z.fromString(await(await Wd()).getRandomSquare1ScrambleString())}Pf(!0);var bc=!0;function Kd(e){bc=e}function wc(){return(typeof performance=="undefined"?Date:performance).now()}async function Ce(e,t){if(!bc)return t();let r=wc(),n=t();n?.then&&await n;let o=wc();return console.warn(\`\${e}: \${Math.round(o-r)}ms\`),n}var U0={initialize:async e=>{switch(e){case"222":return Ce("preInitialize222",Xf);case"333":case"333oh":case"333ft":return Ce("initialize333",Wu);case"444":return Ce("initialize444",ng);default:throw new Error(\`unsupported event: \${e}\`)}},randomScrambleForEvent:async e=>{switch(e){case"222":return Ce("random222Scramble",Jf);case"333":case"333oh":case"333ft":return Ce("random333Scramble",Wn);case"333fm":return Ce("random333FewestMovesScramble",ju);case"333bf":case"333mb":return Ce("random333OrientedScramble",Ku);case"444":return Ce("random444Scramble",Qs);case"444bf":return Ce("random444OrientedScramble",og);case"555":return Ce("bigCubeScramble(5)",rr.bind(rr,5));case"555bf":return Ce("oriented555RandomMoves",ig);case"666":return Ce("bigCubeScramble(6)",rr.bind(rr,6));case"777":return Ce("bigCubeScramble(7)",rr.bind(rr,7));case"skewb":return Ce("randomSkewbFixedCornerScramble",mc);case"pyram":return Ce("randomPyraminxScrambleFixedOrientation",fc);case"sq1":return Ce("getRandomSquare1Scramble",Uc);case"fto":return Ce("randomFTOScramble",Og);case"master_tetraminx":return Ce("randomMasterTetraminxScramble",tc);default:throw new Error(\`unsupported event: \${e}\`)}},randomScrambleStringForEvent:async e=>(await U0.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new pe(await ve["3x3x3"].kpuzzle(),e);return(await Rs(t)).toString()},solve222ToString:async e=>{let t=new pe(await ve["2x2x2"].kpuzzle(),e);return(await Va(t)).toString()},solveSkewbToString:async e=>{let t=new pe(await ve.skewb.kpuzzle(),e);return(await R0(t)).toString()},solvePyraminxToString:async e=>{let t=new pe(await ve.pyraminx.kpuzzle(),e);return(await p0(t)).toString()},solveMegaminxToString:async e=>{let t=new pe(await ve.megaminx.kpuzzle(),e);return(await lc(t)).toString()},setDebugMeasurePerf:async e=>{Kd(e)}};P0(U0);
|
|
2824
3443
|
`;
|
|
2825
3444
|
export {
|
|
2826
3445
|
workerSource
|
|
2827
3446
|
};
|
|
2828
|
-
//# sourceMappingURL=worker-inside-generated-string-
|
|
3447
|
+
//# sourceMappingURL=worker-inside-generated-string-OBSDMXAS.js.map
|