cubing 0.31.5 → 0.31.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/esm/.DS_Store +0 -0
  2. package/dist/esm/alg/index.js +1 -1
  3. package/dist/esm/bluetooth/index.js +5 -5
  4. package/dist/esm/bluetooth/index.js.map +2 -2
  5. package/dist/esm/{chunk-7PTPIHOA.js → chunk-2EYZN4E3.js} +7 -7
  6. package/dist/esm/{chunk-7PTPIHOA.js.map → chunk-2EYZN4E3.js.map} +0 -0
  7. package/dist/esm/{chunk-XR7RUCD4.js → chunk-ASTDBI25.js} +3 -5
  8. package/dist/esm/chunk-ASTDBI25.js.map +7 -0
  9. package/dist/esm/{chunk-LGJ4AXVG.js → chunk-AUF56UEH.js} +2 -2
  10. package/dist/esm/{chunk-LGJ4AXVG.js.map → chunk-AUF56UEH.js.map} +0 -0
  11. package/dist/esm/{chunk-YM4RYQQM.js → chunk-CQII4VKQ.js} +3 -3
  12. package/dist/esm/{chunk-YM4RYQQM.js.map → chunk-CQII4VKQ.js.map} +0 -0
  13. package/dist/esm/{chunk-IQHA2XPR.js → chunk-H5Q6ZTRP.js} +42 -21
  14. package/dist/esm/chunk-H5Q6ZTRP.js.map +7 -0
  15. package/dist/esm/{chunk-23PDUZN6.js → chunk-IJP4IAGZ.js} +1 -1
  16. package/dist/esm/chunk-IJP4IAGZ.js.map +7 -0
  17. package/dist/esm/{chunk-Z4UAFYMU.js → chunk-NOAOLQ25.js} +2 -2
  18. package/dist/esm/{chunk-Z4UAFYMU.js.map → chunk-NOAOLQ25.js.map} +0 -0
  19. package/dist/esm/{chunk-KSPS7U45.js → chunk-OGXWZ6ER.js} +2 -2
  20. package/dist/esm/{chunk-KSPS7U45.js.map → chunk-OGXWZ6ER.js.map} +0 -0
  21. package/dist/esm/{chunk-7PRJUZ3X.js → chunk-SPJL6GKQ.js} +11 -355
  22. package/dist/esm/chunk-SPJL6GKQ.js.map +7 -0
  23. package/dist/esm/{chunk-TUETQPSZ.js → chunk-W6D5GKZQ.js} +478 -56
  24. package/dist/esm/chunk-W6D5GKZQ.js.map +7 -0
  25. package/dist/esm/kpuzzle/index.js +2 -2
  26. package/dist/esm/notation/index.js +2 -2
  27. package/dist/esm/protocol/index.js +4 -4
  28. package/dist/esm/puzzle-geometry/index.js +1 -1
  29. package/dist/esm/puzzle-geometry/index.js.map +2 -2
  30. package/dist/esm/puzzles/index.js +4 -4
  31. package/dist/esm/scramble/index.js +2 -2
  32. package/dist/esm/search/index.js +6 -7
  33. package/dist/esm/{search-dynamic-sgs-side-events-IPDRARQ7.js → search-dynamic-sgs-side-events-LDZZKKJE.js} +6 -6
  34. package/dist/esm/{search-dynamic-sgs-side-events-IPDRARQ7.js.map → search-dynamic-sgs-side-events-LDZZKKJE.js.map} +0 -0
  35. package/dist/esm/{search-dynamic-sgs-unofficial-6SKTFE7H.js → search-dynamic-sgs-unofficial-LB26IV7B.js} +6 -6
  36. package/dist/esm/{search-dynamic-sgs-unofficial-6SKTFE7H.js.map → search-dynamic-sgs-unofficial-LB26IV7B.js.map} +0 -0
  37. package/dist/esm/{search-dynamic-solve-4x4x4-3VMGTIWH.js → search-dynamic-solve-4x4x4-IIOB4BKQ.js} +6 -7
  38. package/dist/esm/{search-dynamic-solve-4x4x4-3VMGTIWH.js.map → search-dynamic-solve-4x4x4-IIOB4BKQ.js.map} +1 -1
  39. package/dist/esm/{search-dynamic-solve-kilominx-NGTYP5YN.js → search-dynamic-solve-kilominx-KOBSWYM6.js} +2 -2
  40. package/dist/esm/{search-dynamic-solve-kilominx-NGTYP5YN.js.map → search-dynamic-solve-kilominx-KOBSWYM6.js.map} +0 -0
  41. package/dist/esm/{search-worker-inside-generated-string-EUP7QHNR.js → search-worker-inside-generated-string-5LNQXZJU.js} +29 -29
  42. package/dist/esm/search-worker-inside-generated-string-5LNQXZJU.js.map +7 -0
  43. package/dist/esm/{search-worker-js-entry-IP42AGKD.js → search-worker-js-entry-5CNMPBYP.js} +14 -15
  44. package/dist/esm/{search-worker-js-entry-IP42AGKD.js.map → search-worker-js-entry-5CNMPBYP.js.map} +2 -2
  45. package/dist/esm/{search-worker-ts-entry-KAXTHWLK.js → search-worker-ts-entry-WM7R5RWW.js} +2 -2
  46. package/dist/esm/{search-worker-ts-entry-KAXTHWLK.js.map → search-worker-ts-entry-WM7R5RWW.js.map} +0 -0
  47. package/dist/esm/stream/index.js +1 -1
  48. package/dist/esm/twisty/index.js +67 -16
  49. package/dist/esm/twisty/index.js.map +3 -3
  50. package/dist/esm/{twisty-dynamic-3d-WCFUDIZT.js → twisty-dynamic-3d-Q54GMZJG.js} +43 -31
  51. package/dist/esm/twisty-dynamic-3d-Q54GMZJG.js.map +7 -0
  52. package/dist/types/{TwizzleLink-e60109a8.d.ts → TwizzleLink-b28e5d4f.d.ts} +45 -23
  53. package/dist/types/{outside-8652594e.d.ts → outside-58bc5f1a.d.ts} +8 -6
  54. package/dist/types/puzzles/index.d.ts +2 -2
  55. package/dist/types/scramble/index.d.ts +1 -1
  56. package/dist/types/search/index.d.ts +1 -1
  57. package/dist/types/twisty/index.d.ts +2 -3
  58. package/package.json +1 -2
  59. package/dist/esm/chunk-23PDUZN6.js.map +0 -7
  60. package/dist/esm/chunk-7PRJUZ3X.js.map +0 -7
  61. package/dist/esm/chunk-IQHA2XPR.js.map +0 -7
  62. package/dist/esm/chunk-QHWK5RXN.js +0 -42
  63. package/dist/esm/chunk-QHWK5RXN.js.map +0 -7
  64. package/dist/esm/chunk-TUETQPSZ.js.map +0 -7
  65. package/dist/esm/chunk-XR7RUCD4.js.map +0 -7
  66. package/dist/esm/search-worker-inside-generated-string-EUP7QHNR.js.map +0 -7
  67. package/dist/esm/twisty-dynamic-3d-WCFUDIZT.js.map +0 -7
@@ -1,22 +1,22 @@
1
1
  // src/cubing/search/search-worker-inside-generated-string.js
2
- var workerSource = `"use strict";var Qm=Object.defineProperty;var A=(e,t)=>()=>(e&&(t=e(e=0)),t);var Lt=(e,t)=>{for(var r in t)Qm(e,r,{get:t[r],enumerable:!0})};var Wa=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var R=(e,t,r)=>(Wa(e,t,"read from private field"),r?r.call(e):t.get(e)),Z=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},V=(e,t,r,n)=>(Wa(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ka=(e,t,r,n)=>({set _(l){V(e,t,l,r)},get _(){return R(e,t,n)}}),rr=(e,t,r)=>(Wa(e,t,"access private method"),r);var iL,Kl,Te,nr=A(()=>{"use strict";iL=!1,Kl=class{is(t){return this instanceof t}as(t){return this instanceof t?this:null}},Te=class extends Kl{constructor(){super(),iL&&Object.defineProperty(this,"_debugStr",{get:()=>this.toString()})}get log(){return console.log.bind(console,this,this.toString())}}});function V2(e,t=!0){if(!t)return e;switch(e){case 1:return-1;case-1:return 1}}function H2(e,t){return t===-1?Array.from(e).reverse():e}function X2(e){return Array.from(e).reverse()}var Wt=A(()=>{"use strict"});var Ql,Va=A(()=>{"use strict";Ql="2^31 - 1"});var Zr,Bt,Ha=A(()=>{"use strict";Kt();Bt=class{constructor(){Z(this,Zr,[])}push(t){R(this,Zr).push(t)}experimentalPushAlg(t){for(let r of t.childAlgNodes())this.push(r)}experimentalNumAlgNodes(){return R(this,Zr).length}toAlg(){return new E(R(this,Zr))}reset(){V(this,Zr,[])}};Zr=new WeakMap});var J2,Xa=A(()=>{"use strict";J2={caratNISSNotationEnabled:!1}});var Yr,$r,Yo,Ne,On=A(()=>{"use strict";Kt();nr();Wt();Yo=class extends Te{constructor(r,n){super();Z(this,Yr,void 0);Z(this,$r,void 0);V(this,Yr,yr(r)),V(this,$r,yr(n))}get A(){return R(this,Yr)}get B(){return R(this,$r)}isIdentical(r){let n=r.as(Yo);return!!(n?.A.isIdentical(this.A)&&n?.B.isIdentical(this.B))}invert(){return new Yo(R(this,$r),R(this,Yr))}*experimentalExpand(r=1,n){n??(n=1/0),n===0?yield r===1?this:this.invert():r===1?(yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(1,n-1),yield*this.A.experimentalExpand(-1,n-1),yield*this.B.experimentalExpand(-1,n-1)):(yield*this.B.experimentalExpand(1,n-1),yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(-1,n-1),yield*this.A.experimentalExpand(-1,n-1))}toString(){return\`[\${R(this,Yr).toString()}, \${R(this,$r).toString()}]\`}},Ne=Yo;Yr=new WeakMap,$r=new WeakMap});var In,Tn,$o,Pe,Gn=A(()=>{"use strict";Kt();nr();Wt();$o=class extends Te{constructor(r,n){super();Z(this,In,void 0);Z(this,Tn,void 0);V(this,In,yr(r)),V(this,Tn,yr(n))}get A(){return R(this,In)}get B(){return R(this,Tn)}isIdentical(r){let n=r.as($o);return!!(n?.A.isIdentical(this.A)&&n?.B.isIdentical(this.B))}invert(){return new $o(R(this,In),R(this,Tn).invert())}*experimentalExpand(r,n){n??(n=1/0),n===0?yield r===1?this:this.invert():(yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(r,n-1),yield*this.A.experimentalExpand(-1,n-1))}toString(){return\`[\${this.A}: \${this.B}]\`}},Pe=$o;In=new WeakMap,Tn=new WeakMap});var Ar,Ja,Ft,jl=A(()=>{"use strict";nr();Wt();Ja=class extends Te{constructor(r){super();Z(this,Ar,void 0);if(r.includes(\`
3
- \`)||r.includes("\\r"))throw new Error("LineComment cannot contain newline");V(this,Ar,r)}get text(){return R(this,Ar)}isIdentical(r){let n=r;return r.is(Ja)&&R(this,Ar)===R(n,Ar)}invert(){return this}*experimentalExpand(r=1,n=1/0){yield this}toString(){return\`//\${R(this,Ar)}\`}},Ft=Ja;Ar=new WeakMap});var $e,ql=A(()=>{"use strict";nr();Wt();$e=class extends Te{toString(){return\`
4
- \`}isIdentical(t){return t.is($e)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});var ye,Wn=A(()=>{"use strict";nr();Wt();ye=class extends Te{toString(){return"."}isIdentical(r){return r.is(ye)}invert(){return this}*experimentalExpand(r=1,n=1/0){yield this}}});function ei(e,t){return e?parseInt(e):t}function Za(e){return new Vl().parseAlg(e)}function Y2(e){return new Vl().parseMove(e)}function $2(e){return new Vl().parseQuantumMove(e)}function et(e,t,r){let n=e;return n.startCharIndex=t,n.endCharIndex=r,n}function ef(e,t){return"startCharIndex"in e&&(t.startCharIndex=e.startCharIndex),"endCharIndex"in e&&(t.endCharIndex=e.endCharIndex),t}var Z2,aL,sL,fL,uL,gL,at,G,Kn,Vl,Ya=A(()=>{"use strict";Kt();Ha();Xa();On();Gn();Hl();jl();Qt();ql();Wn();Z2=/^(\\d+)?('?)/,aL=/^[_\\dA-Za-z]/,sL=/^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)?/,fL=/^[^\\n]*/,uL=/^(-?\\d+), ?/,gL=/^(-?\\d+)\\)/;Vl=class{constructor(){Z(this,at,"");Z(this,G,0);Z(this,Kn,[])}parseAlg(t){V(this,at,t),V(this,G,0);let r=this.parseAlgWithStopping([]);this.mustBeAtEndOfInput();let n=Array.from(r.childAlgNodes());if(R(this,Kn).length>0)for(let a of R(this,Kn).reverse())n.push(a);let l=new E(n),{startCharIndex:o,endCharIndex:i}=r;return et(l,o,i),l}parseMove(t){V(this,at,t),V(this,G,0);let r=this.parseMoveImpl();return this.mustBeAtEndOfInput(),r}parseQuantumMove(t){V(this,at,t),V(this,G,0);let r=this.parseQuantumMoveImpl();return this.mustBeAtEndOfInput(),r}mustBeAtEndOfInput(){if(R(this,G)!==R(this,at).length)throw new Error("parsing unexpectedly ended early")}parseAlgWithStopping(t){let r=R(this,G),n=R(this,G),l=new Bt,o=!1,i=a=>{if(o)throw new Error(\`Unexpected character at index \${a}. Are you missing a space?\`)};e:for(;R(this,G)<R(this,at).length;){let a=R(this,G);if(t.includes(R(this,at)[R(this,G)]))return et(l.toAlg(),r,n);if(this.tryConsumeNext(" ")){o=!1,l.experimentalNumAlgNodes()===0&&(r=R(this,G));continue e}else if(aL.test(R(this,at)[R(this,G)])){i(a);let s=this.parseMoveImpl();l.push(s),o=!0,n=R(this,G);continue e}else if(this.tryConsumeNext("(")){i(a);let s=this.tryRegex(uL);if(s){let f=s[1],u=R(this,G),g=this.parseRegex(gL),c=et(new B(new _("U_SQ_"),parseInt(f)),a+1,a+1+f.length),p=et(new B(new _("D_SQ_"),parseInt(g[1])),u,R(this,G)-1),L=et(new E([c,p]),a+1,R(this,G)-1);l.push(et(new Me(L),a,R(this,G))),o=!0,n=R(this,G);continue e}else{let f=this.parseAlgWithStopping([")"]);this.mustConsumeNext(")");let u=this.parseAmount();l.push(et(new Me(f,u),a,R(this,G))),o=!0,n=R(this,G);continue e}}else if(this.tryConsumeNext("^")){if(!J2.caratNISSNotationEnabled)throw new Error("Alg contained a carat but carat NISS notation is not enabled.");this.mustConsumeNext("(");let s=this.parseAlgWithStopping([")"]);this.popNext();let f=new Me(s,-1),u=new ye;f.experimentalNISSPlaceholder=u,u.experimentalNISSGrouping=f,R(this,Kn).push(f),l.push(u)}else if(this.tryConsumeNext("[")){i(a);let s=this.parseAlgWithStopping([",",":"]),f=this.popNext(),u=this.parseAlgWithStopping(["]"]);switch(this.mustConsumeNext("]"),f){case":":{l.push(et(new Pe(s,u),a,R(this,G))),o=!0,n=R(this,G);continue e}case",":{l.push(et(new Ne(s,u),a,R(this,G))),o=!0,n=R(this,G);continue e}default:throw new Error("unexpected parsing error")}}else if(this.tryConsumeNext(\`
5
- \`)){l.push(et(new $e,a,R(this,G))),o=!1,n=R(this,G);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(a);let[s]=this.parseRegex(fL);l.push(et(new Ft(s),a,R(this,G))),o=!1,n=R(this,G);continue e}else{l.push(et(new B("_SLASH_"),a,R(this,G))),o=!0,n=R(this,G);continue e}else if(this.tryConsumeNext(".")){i(a),l.push(et(new ye,a,R(this,G))),o=!0,n=R(this,G);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(R(this,G)!==R(this,at).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return et(l.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(sL);return new _(n,ei(r,void 0),ei(t,void 0))}parseMoveImpl(){let t=R(this,G);if(this.tryConsumeNext("/"))return et(new B("_SLASH_"),t,R(this,G));let r=this.parseQuantumMoveImpl(),[n,l]=this.parseAmountAndTrackEmptyAbsAmount(),o=this.parseMoveSuffix();if(o){if(n<0)throw new Error("uh-oh");if((o==="++"||o==="--")&&n!==1)throw new Error("Pochmann ++ or -- moves cannot have an amount other than 1.");if((o==="++"||o==="--")&&!l)throw new Error("Pochmann ++ or -- moves cannot have an amount written as a number.");if((o==="+"||o==="-")&&l)throw new Error("Clock dial moves must have an amount written as a natural number followed by + or -.");o.startsWith("+")&&(r=r.modified({family:\`\${r.family}_\${o==="+"?"PLUS":"PLUSPLUS"}_\`})),o.startsWith("-")&&(r=r.modified({family:\`\${r.family}_\${o==="-"?"PLUS":"PLUSPLUS"}_\`}),n*=-1)}return et(new B(r,n),t,R(this,G))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=R(this,G),[,r,n]=this.parseRegex(Z2);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[ei(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=R(this,G),[,r,n]=this.parseRegex(Z2);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 ei(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return V(this,G,R(this,G)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(V(this,G,R(this,G)+r[0].length),r)}remaining(){return R(this,at).slice(R(this,G))}popNext(){let t=R(this,at)[R(this,G)];return Ka(this,G)._++,t}tryConsumeNext(t){return R(this,at)[R(this,G)]===t?(Ka(this,G)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};at=new WeakMap,G=new WeakMap,Kn=new WeakMap});function ti(e){tf.has(e)||(console.warn(e),tf.add(e))}var tf,$a=A(()=>{"use strict";tf=new Set});var tn,es=A(()=>{"use strict";Wt();Va();tn=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<-2147483648||this.amount>2147483647)throw new Error(\`AlgNode amount absolute value must be a non-negative integer below \${Ql}.\`)}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),l=V2(t,this.amount<0);for(let o=0;o<n;o++)yield*this.quantum.experimentalExpand(l,r)}}});var lr,He,Xe,ni,_,Ge,Qn,B,Qt=A(()=>{"use strict";nr();Wt();Va();Ya();$a();es();ni=class extends Kl{constructor(r,n,l){super();Z(this,lr,void 0);Z(this,He,void 0);Z(this,Xe,void 0);if(V(this,lr,r),V(this,He,n??null),V(this,Xe,l??null),Object.freeze(this),R(this,He)!==null&&(!Number.isInteger(R(this,He))||R(this,He)<1||R(this,He)>2147483647))throw new Error(\`QuantumMove inner layer must be a positive integer below \${Ql}.\`);if(R(this,Xe)!==null&&(!Number.isInteger(R(this,Xe))||R(this,Xe)<1||R(this,Xe)>2147483647))throw new Error(\`QuantumMove outer layer must be a positive integer below \${Ql}.\`);if(R(this,Xe)!==null&&R(this,He)!==null&&R(this,He)<=R(this,Xe))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(R(this,Xe)!==null&&R(this,He)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(r){return $2(r)}modified(r){return new ni(r.family??R(this,lr),r.innerLayer??R(this,He),r.outerLayer??R(this,Xe))}isIdentical(r){let n=r;return r.is(ni)&&R(this,lr)===R(n,lr)&&R(this,He)===R(n,He)&&R(this,Xe)===R(n,Xe)}get family(){return R(this,lr)}get outerLayer(){return R(this,Xe)}get innerLayer(){return R(this,He)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let r=R(this,lr);return R(this,He)!==null&&(r=String(R(this,He))+r,R(this,Xe)!==null&&(r=\`\${String(R(this,Xe))}-\${r}\`)),r}},_=ni;lr=new WeakMap,He=new WeakMap,Xe=new WeakMap;Qn=class extends Te{constructor(...r){super();Z(this,Ge,void 0);if(typeof r[0]=="string")if(r[1]??null){V(this,Ge,new tn(_.fromString(r[0]),r[1]));return}else return Qn.fromString(r[0]);V(this,Ge,new tn(r[0],r[1]))}isIdentical(r){let n=r.as(Qn);return!!n&&R(this,Ge).isIdentical(R(n,Ge))}invert(){return ef(this,new Qn(R(this,Ge).quantum,-this.amount))}*experimentalExpand(r=1){r===1?yield this:yield this.modified({amount:-this.amount})}get quantum(){return R(this,Ge).quantum}modified(r){return new Qn(R(this,Ge).quantum.modified(r),r.amount??this.amount)}static fromString(r){return Y2(r)}get amount(){return R(this,Ge).amount}get type(){return ti("deprecated: type"),"blockMove"}get family(){return R(this,Ge).quantum.family??void 0}get outerLayer(){return R(this,Ge).quantum.outerLayer??void 0}get innerLayer(){return R(this,Ge).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return R(this,Ge).quantum.toString().slice(0,-6)+Math.abs(this.amount)+(this.amount<0?"-":"+");if(this.family.endsWith("_PLUSPLUS_")){let r=Math.abs(this.amount);return R(this,Ge).quantum.toString().slice(0,-10)+(r===1?"":r)+(this.amount<0?"--":"++")}return R(this,Ge).quantum.toString()+R(this,Ge).suffix()}},B=Qn;Ge=new WeakMap});var ts,rf,st,li,Me,Hl=A(()=>{"use strict";Kt();nr();Wt();Qt();es();ts=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 _("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new _("D_SQ_"));let r=t.alg;if(r.experimentalNumChildAlgNodes()===2){let[n,l]=r.childAlgNodes();if(n.as(B)?.quantum.isIdentical(this.quantumU_SQ_)&&l.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,l]}}return null}},rf=new ts,li=class extends Te{constructor(r,n){super();Z(this,st,void 0);let l=yr(r);V(this,st,new tn(l,n))}isIdentical(r){let n=r;return r.is(li)&&R(this,st).isIdentical(R(n,st))}get alg(){return R(this,st).quantum}get amount(){return R(this,st).amount}get experimentalRepetitionSuffix(){return R(this,st).suffix()}invert(){return new li(R(this,st).quantum,-R(this,st).amount)}*experimentalExpand(r=1,n){n??(n=1/0),n===0?yield r===1?this:this.invert():yield*R(this,st).experimentalExpand(r,n-1)}static fromString(){throw new Error("unimplemented")}toString(){return rf.format(this)??\`(\${R(this,st).quantum.toString()})\${R(this,st).suffix()}\`}experimentalAsSquare1Tuple(){return rf.tuple(this)}},Me=li;st=new WeakMap});var jn=A(()=>{"use strict";Hl();jl();On();Gn();Qt();ql();Wn()});function wt(e,t){return e instanceof t}function nf(e){return wt(e,Me)||wt(e,Ft)||wt(e,Ne)||wt(e,Pe)||wt(e,B)||wt(e,$e)||wt(e,ye)}var rs=A(()=>{"use strict";jn()});function lf(e,t,r){if(t.is(Me))return e.traverseGrouping(t,r);if(t.is(B))return e.traverseMove(t,r);if(t.is(Ne))return e.traverseCommutator(t,r);if(t.is(Pe))return e.traverseConjugate(t,r);if(t.is(ye))return e.traversePause(t,r);if(t.is($e))return e.traverseNewline(t,r);if(t.is(Ft))return e.traverseLineComment(t,r);throw new Error("unknown AlgNode")}function of(e){if(e.is(Me)||e.is(B)||e.is(Ne)||e.is(Pe)||e.is(ye)||e.is($e)||e.is(Ft))return e;throw new Error("internal error: expected AlgNode")}function kt(e,t){let r=new e(...t??[]);return r.traverseAlg.bind(r)}var Sr,rn,ns=A(()=>{"use strict";On();Gn();Hl();jl();Qt();ql();Wn();Sr=class{traverseAlgNode(t,r){return lf(this,t,r)}traverseIntoAlgNode(t,r){return of(this.traverseAlgNode(t,r))}},rn=class extends Sr{traverseAlgNode(t){return lf(this,t,void 0)}traverseIntoAlgNode(t){return of(this.traverseAlgNode(t))}}});var pL,qn,ls=A(()=>{"use strict";pL="any-direction",qn=class{constructor(t={}){this.config=t}cancelQuantum(){let{cancel:t}=this.config;return t===!0?pL:t===!1?"none":t?.directional??"none"}cancelAny(){return this.config.cancel&&this.cancelQuantum()!=="none"}cancelPuzzleSpecificModWrap(){let{cancel:t}=this.config;return t===!0||t===!1?"canonical-centered":t?.puzzleSpecificModWrap?t?.puzzleSpecificModWrap:t?.directional==="same-direction"?"preserve-sign":"canonical-centered"}puzzleSpecificSimplifyOptions(){return this.config.puzzleLoader?.puzzleSpecificSimplifyOptions??this.config.puzzleSpecificSimplifyOptions}}});function mL(e,t){return e*Math.sign(t.amount)>=0}function LL(e,t,r){return((e-r)%t+t)%t+r}function os(e,t,r){let n=new qn(r),l=Array.from(e.childAlgNodes()),o=[t];function i(){return new E([...l,...o])}function a(s){if(n.cancelPuzzleSpecificModWrap()==="none")return s;let f=n.puzzleSpecificSimplifyOptions()?.quantumMoveOrder;if(!f)return s;let u=f(t.quantum),g;switch(n.cancelPuzzleSpecificModWrap()){case"gravity":{g=-Math.floor((u-(s.amount<0?0:1))/2);break}case"canonical-centered":{g=-Math.floor((u-1)/2);break}case"canonical-positive":{g=0;break}case"preserve-sign":{g=s.amount<0?1-u:0;break}default:throw new Error("Unknown mod wrap")}let c=LL(s.amount,u,g);return s.modified({amount:c})}if(n.cancelAny()){let s,f=n.puzzleSpecificSimplifyOptions()?.axis;if(f)s=L=>f.areQuantumMovesSameAxis(t.quantum,L.quantum);else{let L=t.quantum.toString();s=m=>m.quantum.toString()===L}let u=n.cancelQuantum()==="same-direction",g=new Map;g.set(t.quantum.toString(),Math.sign(t.amount));let c;for(c=l.length-1;c>=0;c--){let L=l[c].as(B);if(!L||!s(L))break;let m=L.quantum.toString();if(u){let d=g.get(m);if(d&&!mL(d,L))break;g.set(m,Math.sign(L.amount))}}let p=[...l.splice(c+1),t];if(f)o=f.simplifySameAxisMoves(p,n.cancelPuzzleSpecificModWrap()!=="none");else{let L=p.reduce((m,d)=>m+d.amount,0);if(g.size!==1)throw new Error("Internal error: multiple quantums when one was expected");o=[new B(t.quantum,L)]}}return o=o.map(s=>a(s)).filter(s=>s.amount!==0),i()}function is(e,t,r){let n=t.as(B);return n?os(e,n,r):new E([...e.childAlgNodes(),t])}var as=A(()=>{"use strict";Kt();Qt();ls()});var oi,Jl,fs,nn,Xl,Zl,us,ss,gs,af=A(()=>{"use strict";Kt();On();Gn();Hl();Qt();Wn();ns();as();ls();ss=class extends Sr{constructor(){super(...arguments);Z(this,Jl);Z(this,nn);Z(this,Zl);Z(this,oi,void 0)}*traverseAlg(r,n){if(n.depth===0){yield*r.childAlgNodes();return}let l=[],o=rr(this,nn,Xl).call(this,n);for(let i of r.childAlgNodes())for(let a of this.traverseAlgNode(i,o))l=Array.from(is(new E(l),a,o).childAlgNodes());for(let i of l)yield i}*traverseGrouping(r,n){if(n.depth===0){yield r;return}if(r.amount===0)return;let l=new Me(this.traverseAlg(r.alg,rr(this,nn,Xl).call(this,n)),r.amount);if(l.alg.experimentalIsEmpty())return;let o=rr(this,Jl,fs).call(this).get(r);o&&(l.experimentalNISSPlaceholder=o,o.experimentalNISSGrouping=l),yield l}*traverseMove(r,n){yield r}*traverseCommutator(r,n){if(n.depth===0){yield r;return}let l=rr(this,nn,Xl).call(this,n),o=new Ne(this.traverseAlg(r.A,l),this.traverseAlg(r.B,l));o.A.experimentalIsEmpty()||o.B.experimentalIsEmpty()||o.A.isIdentical(o.B)||o.A.isIdentical(o.B.invert())||rr(this,Zl,us).call(this,o.A,o.B,n)||(yield o)}*traverseConjugate(r,n){if(n.depth===0){yield r;return}let l=rr(this,nn,Xl).call(this,n),o=new Pe(this.traverseAlg(r.A,l),this.traverseAlg(r.B,l));if(!o.B.experimentalIsEmpty()){if(o.A.experimentalIsEmpty()||o.A.isIdentical(o.B)||o.A.isIdentical(o.B.invert())||rr(this,Zl,us).call(this,o.A,o.B,n)){yield*r.B.childAlgNodes();return}yield o}}*traversePause(r,n){if(r.experimentalNISSGrouping){let l=new ye;rr(this,Jl,fs).call(this).set(r.experimentalNISSGrouping,l),yield l}else yield r}*traverseNewline(r,n){yield r}*traverseLineComment(r,n){yield r}};oi=new WeakMap,Jl=new WeakSet,fs=function(){return R(this,oi)??V(this,oi,new Map)},nn=new WeakSet,Xl=function(r){return{...r,depth:r.depth?r.depth-1:null}},Zl=new WeakSet,us=function(r,n,l){if(r.experimentalNumChildAlgNodes()===1&&n.experimentalNumChildAlgNodes()===1){let o=Array.from(r.childAlgNodes())[0]?.as(B),i=Array.from(n.childAlgNodes())[0]?.as(B);if(!(o&&i))return!1;if(i.quantum.isIdentical(o.quantum)||new qn(l).puzzleSpecificSimplifyOptions()?.axis?.areQuantumMovesSameAxis(o.quantum,i.quantum))return!0}return!1};gs=kt(ss)});var cs=A(()=>{"use strict";af();as()});function sf(e){if(!e)return[];if(wt(e,E))return e.childAlgNodes();if(typeof e=="string")return Za(e).childAlgNodes();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw new Error("Invalid AlgNode")}function yr(e){return wt(e,E)?e:new E(e)}function BL(e,t){return e.is($e)||t.is($e)||t.as(Me)?.experimentalNISSPlaceholder?"":e.is(Ft)&&!t.is($e)?\`
6
- \`:" "}var ft,ln,E,Kt=A(()=>{"use strict";nr();rs();Wt();Ya();cs();jn();jl();Qt();ql();$a();ln=class extends Te{constructor(r){super();Z(this,ft,void 0);V(this,ft,Array.from(sf(r)));for(let n of R(this,ft))if(!nf(n))throw new Error("An alg can only contain alg nodes.")}isIdentical(r){let n=r;if(!r.is(ln))return!1;let l=Array.from(R(this,ft)),o=Array.from(R(n,ft));if(l.length!==o.length)return!1;for(let i=0;i<l.length;i++)if(!l[i].isIdentical(o[i]))return!1;return!0}invert(){return new ln(X2(Array.from(R(this,ft)).map(r=>r.invert())))}*experimentalExpand(r=1,n){n??(n=1/0);for(let l of H2(R(this,ft),r))yield*l.experimentalExpand(r,n)}expand(r){return new ln(this.experimentalExpand(1,r?.depth??1/0))}*experimentalLeafMoves(){for(let r of this.experimentalExpand())r.is(B)&&(yield r)}concat(r){return new ln(Array.from(R(this,ft)).concat(Array.from(sf(r))))}experimentalIsEmpty(){for(let r of R(this,ft))return!1;return!0}static fromString(r){return Za(r)}units(){return this.childAlgNodes()}*childAlgNodes(){for(let r of R(this,ft))yield r}experimentalNumUnits(){return this.experimentalNumChildAlgNodes()}experimentalNumChildAlgNodes(){return Array.from(R(this,ft)).length}get type(){return ti("deprecated: type"),"sequence"}toString(){let r="",n=null;for(let l of R(this,ft)){n&&(r+=BL(n,l));let o=l.as(ye)?.experimentalNISSGrouping;if(o){if(o.amount!==-1)throw new Error("Invalid NISS Grouping amount!");r+=\`^(\${o.alg.toString()})\`}else l.as(Me)?.experimentalNISSPlaceholder||(r+=l.toString());n=l}return r}experimentalSimplify(r){return new ln(gs(this,r??{}))}simplify(r){return this.experimentalSimplify(r)}},E=ln;ft=new WeakMap});var dL,ff=A(()=>{"use strict";Kt();jn();On();Gn();Qt();Wn();dL={Sune:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",1),new B("R",1),new B("U",-2),new B("R",-1)]),AntiSune:new E([new B("R",1),new B("U",2),new B("R",-1),new B("U",-1),new B("R",1),new B("U",-1),new B("R",-1)]),SuneCommutator:new E([new Ne(new E([new B("R",1),new B("U",1),new B("R",-2)]),new E([new Pe(new E([new B("R",1)]),new E([new B("U",1)]))]))]),Niklas:new E([new B("R",1),new B("U",-1),new B("L",-1),new B("U",1),new B("R",-1),new B("U",-1),new B("L",1),new B("U",1)]),EPerm:new E([new B("x",-1),new Ne(new E([new Pe(new E([new B("R",1)]),new E([new B("U",-1)]))]),new E([new B("D",1)])),new Ne(new E([new Pe(new E([new B("R",1)]),new E([new B("U",1)]))]),new E([new B("D",1)])),new B("x",1)]),FURURFCompact:new E([new Pe(new E([new B("F",1)]),new E([new Ne(new E([new B("U",1)]),new E([new B("R",1)]))]))]),APermCompact:new E([new Pe(new E([new B("R",2)]),new E([new Ne(new E([new B("F",2)]),new E([new B("R",-1),new B("B",-1),new B("R",1)]))]))]),FURURFMoves:new E([new B("F",1),new B("U",1),new B("R",1),new B("U",-1),new B("R",-1),new B("F",-1)]),TPerm:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",-1),new B("R",-1),new B("F",1),new B("R",2),new B("U",-1),new B("R",-1),new B("U",-1),new B("R",1),new B("U",1),new B("R",-1),new B("F",-1)]),HeadlightSwaps:new E([new Pe(new E([new B("F",1)]),new E([new Me(new E([new Ne(new E([new B("R",1)]),new E([new B("U",1)]))]),3)]))]),TriplePause:new E([new ye,new ye,new ye])}});var AA,uf=A(()=>{"use strict";jn();Qt();AA={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'"),192:new ye}});var gf=A(()=>{"use strict"});var fe=A(()=>{"use strict";Kt();Ha();ns();ff();uf();jn();gf();cs();rs();Xa()});function $l(e,t,r){let n={};for(let l in e.orbits){let o=e.orbits[l],i=t[l],a=r[l];if(Yl(o.numOrientations,a))n[l]=i;else if(Yl(o.numOrientations,i))n[l]=a;else{let s=new Array(o.numPieces);if(o.numOrientations===1){for(let f=0;f<o.numPieces;f++)s[f]=i.permutation[a.permutation[f]];n[l]={permutation:s,orientation:i.orientation}}else{let f=new Array(o.numPieces);for(let u=0;u<o.numPieces;u++)f[u]=(i.orientation[a.permutation[u]]+a.orientation[u])%o.numOrientations,s[u]=i.permutation[a.permutation[u]];n[l]={permutation:s,orientation:f}}}}return n}function ps(e,t,r){let n={};for(let l in e.orbits){let o=e.orbits[l],i=t[l],a=r[l];if(Yl(o.numOrientations,a))n[l]=i;else{let s=new Array(o.numPieces);if(o.numOrientations===1){for(let f=0;f<o.numPieces;f++)s[f]=i.pieces[a.permutation[f]];n[l]={pieces:s,orientation:i.orientation}}else{let f=new Array(o.numPieces);for(let u=0;u<o.numPieces;u++)f[u]=(i.orientation[a.permutation[u]]+a.orientation[u])%o.numOrientations,s[u]=i.pieces[a.permutation[u]];n[l]={pieces:s,orientation:f}}}}return n}var ii=A(()=>{"use strict";eo()});function RL(e){let t=cf.get(e);if(t)return t;let r=new Array(e),n=new Array(e);for(let o=0;o<e;o++)r[o]=o,n[o]=0;let l={permutation:r,orientation:n};return pf&&(Object.freeze(r),Object.freeze(n),Object.freeze(l)),cf.set(e,l),l}function mf(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=RL(n.numPieces);return pf&&Object.freeze(t),t}function Lf(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(!n){let i=e.definition.experimentalDerivedMoves?.[r];i&&(n=e.algToTransformation(i).transformationData)}if(n)return xr(e,n,t.amount);let l=e.definition.moves[t.toString()];if(l)return l;let o=e.definition.moves[t.invert().toString()];if(o)return xr(e,o,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var pf,cf,ms=A(()=>{"use strict";eo();pf=!1,cf=new Map});var pe,ai=A(()=>{"use strict";ii();to();pe=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),stateData:this.stateData}}static fromTransformation(t){let r=ps(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=ps(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 l={permutation:n.pieces,orientation:n.orientation};t[r]=l}return new yt(this.kpuzzle,t)}experimentalIsSolved(t){if(!this.kpuzzle.definition.experimentalIsStateSolved)throw new Error("\`KState.experimentalIsSolved()\` is not supported for this puzzle at the moment.");return this.kpuzzle.definition.experimentalIsStateSolved(this,t)}}});var on,vr,yt,to=A(()=>{"use strict";eo();ii();ms();ai();vr=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;Z(this,on,void 0)}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),transformationData:this.transformationData}}invert(){return new vr(this.kpuzzle,Ls(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return R(this,on)??V(this,on,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new vr(t,mf(t.definition));return V(r,on,!0),r}isIdentical(t){return Bf(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 R(this,on)?new vr(this.kpuzzle,t.transformationData):R(t,on)?new vr(this.kpuzzle,this.transformationData):new vr(this.kpuzzle,$l(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 df(this.kpuzzle.definition,this)}selfMultiply(t){return new vr(this.kpuzzle,xr(this.kpuzzle,this.transformationData,t))}},yt=vr;on=new WeakMap});function Yl(e,t){let{permutation:r}=t,n=r.length;for(let l=0;l<n;l++)if(r[l]!==l)return!1;if(e>1){let{orientation:l}=t;for(let o=0;o<n;o++)if(l[o]!==0)return!1}return!0}function hL(e,t,r,n={}){for(let l=0;l<e.numPieces;l++)if(!n?.ignoreOrientation&&t.orientation[l]!==r.orientation[l]||!n?.ignorePermutation&&t.permutation[l]!==r.permutation[l])return!1;return!0}function Bf(e,t,r){for(let[n,l]of Object.entries(e.definition.orbits))if(!hL(l,t[n],r[n]))return!1;return!0}function Ls(e,t){let r={};for(let n in e.definition.orbits){let l=e.definition.orbits[n],o=t[n];if(Yl(l.numOrientations,o))r[n]=o;else if(l.numOrientations===1){let i=new Array(l.numPieces);for(let a=0;a<l.numPieces;a++)i[o.permutation[a]]=a;r[n]={permutation:i,orientation:o.orientation}}else{let i=new Array(l.numPieces),a=new Array(l.numPieces);for(let s=0;s<l.numPieces;s++){let f=o.permutation[s];i[f]=s,a[f]=(l.numOrientations-o.orientation[s]+l.numOrientations)%l.numOrientations}r[n]={permutation:i,orientation:a}}}return r}function xr(e,t,r){if(r===1)return t;if(r<0)return xr(e,Ls(e,t),-r);if(r===0){let{transformationData:o}=e.identityTransformation();return o}let n=t;r!==2&&(n=xr(e,t,Math.floor(r/2)));let l=$l(e.definition,n,n);return r%2===0?l:$l(e.definition,t,l)}function ds(e,t){return t?ds(t,e%t):e}function df(e,t){let r=1;for(let n in e.orbits){let l=e.orbits[n],o=t.transformationData[n],i=new Array(l.numPieces);for(let a=0;a<l.numPieces;a++)if(!i[a]){let s=a,f=0,u=0;for(;i[s]=!0,f=f+o.orientation[s],u=u+1,s=o.permutation[s],s!==a;);f!==0&&(u=u*l.numOrientations/ds(l.numOrientations,Math.abs(f))),r=r*u/ds(r,u)}}return r}var Bs,Rf,eo=A(()=>{"use strict";fe();fe();ii();to();Bs=class extends Sr{traverseAlg(t,r){let n=null;for(let l of t.childAlgNodes())n?n=n.applyTransformation(this.traverseAlgNode(l,r)):n=this.traverseAlgNode(l,r);return n??r.identityTransformation()}traverseGrouping(t,r){let n=this.traverseAlg(t.alg,r);return new yt(r,xr(r,n.transformationData,t.amount))}traverseMove(t,r){return r.moveToTransformation(t)}traverseCommutator(t,r){let n=this.traverseAlg(t.A,r),l=this.traverseAlg(t.B,r);return n.applyTransformation(l).applyTransformation(n.invert()).applyTransformation(l.invert())}traverseConjugate(t,r){let n=this.traverseAlg(t.A,r),l=this.traverseAlg(t.B,r);return n.applyTransformation(l).applyTransformation(n.invert())}traversePause(t,r){return r.identityTransformation()}traverseNewline(t,r){return r.identityTransformation()}traverseLineComment(t,r){return r.identityTransformation()}},Rf=kt(Bs)});var Vn,si,De,hf=A(()=>{"use strict";fe();eo();ms();ai();to();De=class{constructor(t,r){this.definition=t;Z(this,Vn,new Map);Z(this,si,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return yt.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new B(t));let r=t.toString(),n=R(this,Vn).get(r);if(n)return new yt(this,n);if(this.experimentalPGNotation){let o=this.experimentalPGNotation.lookupMove(t);if(!o)throw new Error(\`could not map to internal move: \${t}\`);return R(this,Vn).set(r,o),new yt(this,o)}let l=Lf(this,t);return R(this,Vn).set(r,l),new yt(this,l)}algToTransformation(t){return typeof t=="string"&&(t=new E(t)),Rf(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(E)?this.algToTransformation(t):t?.is?.(B)?this.moveToTransformation(t):t}startState(){return new pe(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return R(this,si)??V(this,si,(()=>{for(let[t,r]of Object.entries(this.definition.orbits)){let n=new Array(r.numPieces).fill(!1);for(let l of this.definition.startStateData[t].pieces)n[l]=!0;for(let l of n)if(!l)return!1}return!0})())}};Vn=new WeakMap,si=new WeakMap});var We=A(()=>{"use strict";hf();ai();to()});var Df,DL,Ff=A(()=>{"use strict";Df={333:{puzzleID:"3x3x3",eventName:"3x3x3 Cube"},222:{puzzleID:"2x2x2",eventName:"2x2x2 Cube"},444:{puzzleID:"4x4x4",eventName:"4x4x4 Cube"},555:{puzzleID:"5x5x5",eventName:"5x5x5 Cube"},666:{puzzleID:"6x6x6",eventName:"6x6x6 Cube"},777:{puzzleID:"7x7x7",eventName:"7x7x7 Cube"},"333bf":{puzzleID:"3x3x3",eventName:"3x3x3 Blindfolded"},"333fm":{puzzleID:"3x3x3",eventName:"3x3x3 Fewest Moves"},"333oh":{puzzleID:"3x3x3",eventName:"3x3x3 One-Handed"},clock:{puzzleID:"clock",eventName:"Clock"},minx:{puzzleID:"megaminx",eventName:"Megaminx"},pyram:{puzzleID:"pyraminx",eventName:"Pyraminx"},skewb:{puzzleID:"skewb",eventName:"Skewb"},sq1:{puzzleID:"square1",eventName:"Square-1"},"444bf":{puzzleID:"4x4x4",eventName:"4x4x4 Blindfolded"},"555bf":{puzzleID:"5x5x5",eventName:"5x5x5 Blindfolded"},"333mb":{puzzleID:"3x3x3",eventName:"3x3x3 Multi-Blind"}},DL={...Df,fto:{puzzleID:"fto",eventName:"Face-Turning Octahedron"},master_tetraminx:{puzzleID:"master_tetraminx",eventName:"Master Tetraminx"},kilominx:{puzzleID:"kilominx",eventName:"Kilominx"},redi_cube:{puzzleID:"redi_cube",eventName:"Redi Cube"}}});function yf(e){return FL[e]}var or,jt,Je,Hn,fi,an,FL,Xn,Jn,ro=A(()=>{"use strict";or=class{constructor(t,r){this.stickerings=new Map;for(let[n,l]of Object.entries(t.definition.orbits))this.stickerings.set(n,new Array(l.numPieces).fill(r))}},jt="regular",Je="ignored",Hn="oriented",fi="invisible",an="dim",FL={["Regular"]:{facelets:[jt,jt,jt,jt,jt]},["Ignored"]:{facelets:[Je,Je,Je,Je,Je]},["OrientationStickers"]:{facelets:[Hn,Hn,Hn,Hn,Hn]},["IgnoreNonPrimary"]:{facelets:[jt,Je,Je,Je,Je]},["Invisible"]:{facelets:[fi,fi,fi,fi]},["PermuteNonPrimary"]:{facelets:[an,jt,jt,jt,jt]},["Dim"]:{facelets:[an,an,an,an,an]},["Ignoriented"]:{facelets:[an,Je,Je,Je,Je]},["OrientationWithoutPermutation"]:{facelets:[Hn,Je,Je,Je,Je]}};Xn=class extends or{constructor(t){super(t,"Regular")}set(t,r){for(let[n,l]of this.stickerings.entries())for(let o=0;o<l.length;o++)t.stickerings.get(n)[o]&&(l[o]=r);return this}toStickeringMask(){let t={orbits:{}};for(let[r,n]of this.stickerings.entries()){let l=[],o={pieces:l};t.orbits[r]=o;for(let i of n)l.push(yf(i))}return t}},Jn=class{constructor(t){this.kpuzzle=t}and(t){let r=new or(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let o=0;o<l.numPieces;o++){r.stickerings.get(n)[o]=!0;for(let i of t)if(!i.stickerings.get(n)[o]){r.stickerings.get(n)[o]=!1;continue e}}}return r}or(t){let r=new or(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let o=0;o<l.numPieces;o++){r.stickerings.get(n)[o]=!1;for(let i of t)if(i.stickerings.get(n)[o]){r.stickerings.get(n)[o]=!0;continue e}}}return r}not(t){let r=new or(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits))for(let o=0;o<l.numPieces;o++)r.stickerings.get(n)[o]=!t.stickerings.get(n)[o];return r}all(){return this.and(this.moves([]))}move(t){let r=this.kpuzzle.moveToTransformation(t),n=new or(this.kpuzzle,!1);for(let[l,o]of Object.entries(this.kpuzzle.definition.orbits))for(let i=0;i<o.numPieces;i++)(r.transformationData[l].permutation[i]!==i||r.transformationData[l].orientation[i]!==0)&&(n.stickerings.get(l)[i]=!0);return n}moves(t){return t.map(r=>this.move(r))}orbits(t){let r=new or(this.kpuzzle,!1);for(let n of t)r.stickerings.get(n).fill(!0);return r}orbitPrefix(t){let r=new or(this.kpuzzle,!1);for(let n in this.kpuzzle.definition.orbits)n.startsWith(t)&&r.stickerings.get(n).fill(!0);return r}}});var Rs,hs=A(()=>{"use strict";Rs={full:{groups:{"3x3x3":"Stickering"}},OLL:{groups:{"3x3x3":"Last Layer"}},PLL:{groups:{"3x3x3":"Last Layer"}},LL:{groups:{"3x3x3":"Last Layer"}},EOLL:{groups:{"3x3x3":"Last Layer"}},COLL:{groups:{"3x3x3":"Last Layer"}},OCLL:{groups:{"3x3x3":"Last Layer"}},CLL:{groups:{"3x3x3":"Last Layer"}},ELL:{groups:{"3x3x3":"Last Layer"}},ZBLL:{groups:{"3x3x3":"Last Layer"}},LS:{groups:{"3x3x3":"Last Slot"}},ELS:{groups:{"3x3x3":"Last Slot"}},CLS:{groups:{"3x3x3":"Last Slot"}},ZBLS:{groups:{"3x3x3":"Last Slot"}},VLS:{groups:{"3x3x3":"Last Slot"}},WVLS:{groups:{"3x3x3":"Last Slot"}},F2L:{groups:{"3x3x3":"CFOP (Fridrich)"}},Daisy:{groups:{"3x3x3":"CFOP (Fridrich)"}},Cross:{groups:{"3x3x3":"CFOP (Fridrich)"}},EO:{groups:{"3x3x3":"ZZ"}},EOline:{groups:{"3x3x3":"ZZ"}},EOcross:{groups:{"3x3x3":"ZZ"}},CMLL:{groups:{"3x3x3":"Roux"}},L10P:{groups:{"3x3x3":"Roux"}},L6E:{groups:{"3x3x3":"Roux"}},L6EO:{groups:{"3x3x3":"Roux"}},"2x2x2":{groups:{"3x3x3":"Petrus"}},"2x2x3":{groups:{"3x3x3":"Petrus"}},"Void Cube":{groups:{"3x3x3":"Miscellaneous"}},invisible:{groups:{"3x3x3":"Miscellaneous"}},picture:{groups:{"3x3x3":"Miscellaneous"}},"centers-only":{groups:{"3x3x3":"Miscellaneous"}},"experimental-centers-U":{},"experimental-centers-U-D":{},"experimental-centers-U-L-D":{},"experimental-centers-U-L-B-D":{},"experimental-centers":{},"experimental-fto-fc":{groups:{fto:"Bencisco"}},"experimental-fto-f2t":{groups:{fto:"Bencisco"}},"experimental-fto-sc":{groups:{fto:"Bencisco"}},"experimental-fto-l2c":{groups:{fto:"Bencisco"}},"experimental-fto-lbt":{groups:{fto:"Bencisco"}},"experimental-fto-l3t":{groups:{fto:"Bencisco"}}}});async function ir(e,t){let r=await e.kpuzzle(),n=new Xn(r),l=new Jn(r),o=()=>l.move("U"),i=()=>l.or(l.moves(["U","D"])),a=()=>l.or(l.moves(["L","R"])),s=()=>l.not(a()),f=()=>l.not(o()),u=()=>l.orbitPrefix("CENTER"),g=()=>l.orbitPrefix("EDGE"),c=()=>l.or([l.orbitPrefix("CORNER"),l.orbitPrefix("C4RNER"),l.orbitPrefix("C5RNER")]),p=()=>l.or([s(),l.and([o(),g()])]),L=()=>l.and([o(),u()]),m=()=>l.and([l.and(l.moves(["F","R"])),g()]),d=()=>l.and([l.and(l.moves(["F","R"])),c(),l.not(o())]),D=()=>l.or([d(),m()]);function F(){n.set(f(),"Dim")}function S(){n.set(o(),"PermuteNonPrimary"),n.set(L(),"Dim")}function v(){n.set(o(),"IgnoreNonPrimary"),n.set(L(),"Regular")}function U(){n.set(o(),"Ignoriented"),n.set(L(),"Dim")}switch(t){case"full":break;case"PLL":{F(),S();break}case"CLS":{F(),n.set(d(),"Regular"),n.set(o(),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"OLL":{F(),v();break}case"EOLL":{F(),v(),n.set(l.and([o(),c()]),"Ignored");break}case"COLL":{F(),n.set(l.and([o(),g()]),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"Regular");break}case"OCLL":{F(),U(),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"CLL":{F(),n.set(l.not(l.and([c(),o()])),"Dim");break}case"ELL":{F(),n.set(o(),"Dim"),n.set(l.and([o(),g()]),"Regular");break}case"ELS":{F(),v(),n.set(l.and([o(),c()]),"Ignored"),n.set(m(),"Regular"),n.set(d(),"Ignored");break}case"LL":{F();break}case"F2L":{n.set(o(),"Ignored");break}case"ZBLL":{F(),n.set(o(),"PermuteNonPrimary"),n.set(L(),"Dim"),n.set(l.and([o(),c()]),"Regular");break}case"ZBLS":{F(),n.set(D(),"Regular"),v(),n.set(l.and([o(),c()]),"Ignored");break}case"VLS":{F(),n.set(D(),"Regular"),v();break}case"WVLS":{F(),n.set(D(),"Regular"),n.set(l.and([o(),g()]),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"LS":{F(),n.set(D(),"Regular"),n.set(o(),"Ignored"),n.set(L(),"Dim");break}case"EO":{n.set(c(),"Ignored"),n.set(g(),"OrientationWithoutPermutation");break}case"EOline":{n.set(c(),"Ignored"),n.set(g(),"OrientationWithoutPermutation"),n.set(l.and(l.moves(["D","M"])),"Regular");break}case"EOcross":{n.set(g(),"OrientationWithoutPermutation"),n.set(l.move("D"),"Regular"),n.set(c(),"Ignored");break}case"CMLL":{n.set(f(),"Dim"),n.set(p(),"Ignored"),n.set(l.and([o(),c()]),"Regular");break}case"L10P":{n.set(l.not(p()),"Dim"),n.set(l.and([c(),o()]),"Regular");break}case"L6E":{n.set(l.not(p()),"Dim");break}case"L6EO":{n.set(l.not(p()),"Dim"),n.set(p(),"OrientationWithoutPermutation"),n.set(l.and([u(),i()]),"OrientationStickers");break}case"Daisy":{n.set(l.all(),"Ignored"),n.set(u(),"Dim"),n.set(l.and([l.move("D"),u()]),"Regular"),n.set(l.and([l.move("U"),g()]),"IgnoreNonPrimary");break}case"Cross":{n.set(l.all(),"Ignored"),n.set(u(),"Dim"),n.set(l.and([l.move("D"),u()]),"Regular"),n.set(l.and([l.move("D"),g()]),"Regular");break}case"2x2x2":{n.set(l.or(l.moves(["U","F","R"])),"Ignored"),n.set(l.and([l.or(l.moves(["U","F","R"])),u()]),"Dim");break}case"2x2x3":{n.set(l.all(),"Dim"),n.set(l.or(l.moves(["U","F","R"])),"Ignored"),n.set(l.and([l.or(l.moves(["U","F","R"])),u()]),"Dim"),n.set(l.and([l.move("F"),l.not(l.or(l.moves(["U","R"])))]),"Regular");break}case"Void Cube":{n.set(u(),"Invisible");break}case"picture":case"invisible":{n.set(l.all(),"Invisible");break}case"centers-only":{n.set(l.not(u()),"Ignored");break}default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(l.and(l.moves([])),"Dim")}return n.toStickeringMask()}async function Zn(){let e=[];for(let[t,r]of Object.entries(Rs))r.groups&&"3x3x3"in r.groups&&e.push(t);return e}var no=A(()=>{"use strict";ro();hs()});function ce(e){let t=null;return()=>t??(t=e())}var At=A(()=>{"use strict"});var Yn,Sf=A(()=>{"use strict";Yn=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 l=0;this.prefixFree&&l<t.length;l++)n!==l&&t[n].startsWith(t[l])&&(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 l=-1;for(let o=0;o<this.facenames.length;o++)t.substr(n).startsWith(this.facenames[o])&&(l<0||this.facenames[o].length>this.facenames[l].length)&&(l=o);if(l>=0)r.push(l),n+=this.facenames[l].length;else throw new Error(\`Could not split \${t} into face names.\`)}return r}joinByFaceIndices(t){let r="",n=[];for(let l=0;l<t.length;l++)n.push(r),n.push(this.facenames[t[l]]),this.prefixFree||(r="_");return n.join("")}spinmatch(t,r){if(t===r)return!0;try{let n=this.splitByFaceNames(t),l=this.splitByFaceNames(r);if(n.length!==l.length&&n.length<3)return!1;for(let o=0;o<n.length;o++){for(let a=0;a<o;a++)if(n[o]===n[a])return!1;let i=!1;for(let a=0;a<l.length;a++)if(n[o]===l[a]){i=!0;break}if(!i)return!1}return!0}catch{return!1}}spinmatchv(t,r){return t.endsWith("v")&&r.endsWith("v")?this.spinmatch(t.slice(0,t.length-1),r.slice(0,r.length-1)):this.spinmatch(t,r)}unswizzle(t){(t.endsWith("v")||t.endsWith("w"))&&t[0]<="Z"&&(t=t.slice(0,t.length-1));let r=t.toUpperCase();for(let n=0;n<this.gripnames.length;n++){let l=this.gripnames[n];if(this.spinmatch(r,l))return l}return t}}});var sn,xf=A(()=>{"use strict";sn=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var lo,vf=A(()=>{"use strict";fe();lo=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 _("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 _("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var $n,Uf=A(()=>{"use strict";fe();$n=class{constructor(t,r){this.internalNames=t;this.externalNames=r}convertString(t,r,n){let l="";(t.endsWith("v")||t.endsWith("v"))&&t<="_"&&(l=t.slice(t.length-1),t=t.slice(0,t.length-1));let o=t.toUpperCase(),i=!1;return t!==o&&(i=!0,t=o),t=n.joinByFaceIndices(r.splitByFaceNames(t)),i&&(t=t.toLowerCase()),t+l}convert(t,r,n){let l=t.family,o=this.convertString(l,r,n);return l===o?t:new B(new _(o,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 oo,bf=A(()=>{"use strict";fe();oo=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 _("L",3,2),-2*t.amount);if(t.family==="R--")return new B(new _("L",3,2),2*t.amount);if(t.family==="D++")return new B(new _("U",3,2),-2*t.amount);if(t.family==="D--")return new B(new _("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new B(new _("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new B(new _("U",3,2),-2*t.amount)}if(t.family==="y")return new B("Uv",t.amount);if(t.family==="x"&&Math.abs(t.amount)===2)return new B("ERv",t.amount/2)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="ERv"&&Math.abs(t.amount)===1?new B(new _("x",t.innerLayer,t.outerLayer),t.amount*2):t.family==="ILv"&&Math.abs(t.amount)===1?new B(new _("x",t.innerLayer,t.outerLayer),-t.amount*2):t.family==="Uv"?new B(new _("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new B("y",-t.amount):this.child.notationToExternal(t)}}});var io,Ef=A(()=>{"use strict";fe();io=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 _("D",(this.slices+1)/2),t.amount):r==="M"?t=new B(new _("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new B(new _("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new B(new _("D",this.slices-1,2),t.amount):r==="m"?t=new B(new _("L",this.slices-1,2),t.amount):r==="s"&&(t=new B(new _("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 yL,AL,wf,kf,_f,el,ao,Cf=A(()=>{"use strict";fe();yL={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"},AL={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"},wf={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},kf=new _("y"),_f=new _("Dv"),el=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=yL}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=wf[t.family];if(n)return new B(new _(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new B(new _(r,t.innerLayer,t.outerLayer),t.amount):kf.isIdentical(t.quantum)?new B(_f,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(wf))if(this.child.spinmatch(t.family,n))return new B(new _(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 _(r,t.innerLayer,t.outerLayer),t.amount);return _f.isIdentical(t.quantum)?new B(kf,-t.amount):null}},ao=class extends el{constructor(r){super(r);this.wcaHack=!0;this.map=AL}}});var zf,Ds,Nf,SL,Fs,Pf,xL,ys,Mf,vL,so,Of=A(()=>{"use strict";fe();zf={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"},Ds=new _("x"),Nf=new _("Rv"),SL=new _("Lv"),Fs=new _("y"),Pf=new _("Uv"),xL=new _("Dv"),ys=new _("z"),Mf=new _("Fv"),vL=new _("Bv"),so=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=zf[t.family];return r?new B(new _(r,t.outerLayer,t.innerLayer),t.amount):Ds.isIdentical(t.quantum)?new B(Nf,t.amount):Fs.isIdentical(t.quantum)?new B(Pf,t.amount):ys.isIdentical(t.quantum)?new B(Mf,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(zf))if(this.child.spinmatchv(t.family,n))return new B(new _(r,t.innerLayer,t.outerLayer),t.amount);return Nf.isIdentical(t.quantum)?new B(Ds,t.amount):SL.isIdentical(t.quantum)?new B(Ds,-t.amount):Pf.isIdentical(t.quantum)?new B(Fs,t.amount):xL.isIdentical(t.quantum)?new B(Fs,-t.amount):Mf.isIdentical(t.quantum)?new B(ys,t.amount):vL.isIdentical(t.quantum)?new B(ys,-t.amount):null}}});var As=A(()=>{"use strict";xf();vf();Uf();bf();Ef();Cf();Of()});function If(e){let t=0,r={};for(;t<e.length&&e[t][0]==="-";){let l=e[t++];if(l==="--rotations")r.addRotations=!0;else if(l==="--allmoves")r.allMoves=!0;else if(l==="--outerblockmoves")r.outerBlockMoves=!0;else if(l==="--vertexmoves")r.vertexMoves=!0;else if(l==="--nocorners")r.includeCornerOrbits=!1;else if(l==="--noedges")r.includeEdgeOrbits=!1;else if(l==="--noorientation")r.fixedOrientation=!0;else if(l==="--nocenters")r.includeCenterOrbits=!1;else if(l==="--omit")r.excludeOrbits=e[t].split(","),t++;else if(l==="--moves")r.moveList=e[t].split(","),t++;else if(l==="--optimize")r.optimizeOrbits=!0;else if(l==="--scramble")r.scrambleAmount=100;else if(l==="--fixcorner")r.fixedPieceType="v";else if(l==="--fixedge")r.fixedPieceType="e";else if(l==="--fixcenter")r.fixedPieceType="f";else if(l==="--orientcenters")r.orientCenters=!0;else if(l==="--puzzleorientation")r.puzzleOrientation=JSON.parse(e[t]),t++;else throw new Error(\`Bad option: \${l}\`)}return{puzzleDescription:fo(e.slice(t).join(" ")),options:r}}var ui,Ss=A(()=>{"use strict";uo();ui=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(!xs[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;xs[e]=t}return xs[e]}function qt(e){if(!vs[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;vs[e]=t}return vs[e]}function Tf(e){return new dt(qt(e))}function Gf(e){let t=BigInt(1);for(;e>1;)t*=BigInt(e),e--;return t}function UL(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 Us(e,t){return e/UL(e,t)*t}var xs,vs,dt,gi=A(()=>{"use strict";xs=[],vs=[];dt=class{constructor(t){this.n=t.length,this.p=t}toString(){return\`Perm[\${this.p.join(" ")}]\`}mul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=t.p[this.p[n]];return new dt(r)}rmul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=this.p[t.p[n]];return new dt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new dt(t)}compareTo(t){for(let r=0;r<this.n;r++)if(this.p[r]!==t.p[r])return this.p[r]-t.p[r];return 0}toGap(){let t=new Array,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let l=new Array;for(let o=n;!r[o];o=this.p[o])l.push(1+o),r[o]=!0;t.push(\`(\${l.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 l=0;for(let o=n;!r[o];o=this.p[o])l++,r[o]=!0;t=Us(t,l)}return t}}});function ci(e,t){let r=B.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function Wf(e,t){let r=e.moveops.length;if(r>30)throw new Error("Canon info too big for bitmask");let n=[],l=[];for(let i=0;i<r;i++){let a=e.moveops[i];n.push(a.order());let s=0;for(let f=0;f<r;f++){if(f===i)continue;let u=e.moveops[f];a.mul(u).equal(u.mul(a))&&(s|=1<<f)}l.push(s)}let o={};o[0]=1;for(let i=0;i<100;i++){let a=0,s={},f=0;for(let u in o){let g=+u,c=o[g];a+=c,f++;for(let p=0;p<n.length;p++)if((g>>p&1)===0&&(g&l[p]&(1<<p)-1)===0){let L=g&l[p]|1<<p;s[L]===void 0&&(s[L]=0),s[L]+=(n[p]-1)*c}}t(\`\${i}: canonseq \${a} states \${f}\`),o=s}}var tl,bL,fn,_t,Vt,pi,ar,un,mi,Kf=A(()=>{"use strict";fe();As();gi();tl=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return Gf(this.size)*BigInt(this.mod)**BigInt(this.size)}},bL=0;fn=class{constructor(t,r,n,l,o,i,a){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=l;this.moveops=o;this.isRotation=i;this.forcenames=a}transformToKTransformationData(t){let r={};for(let n=0;n<this.orbitnames.length;n++)r[this.orbitnames[n]]=t.orbits[n].toKPuzzle();return r}static transformToKTransformationData(t,r){let n={};for(let l=0;l<t.length;l++)n[t[l]]=r.orbits[l].toKPuzzle();return n}describeSet(t,r,n){let l=this.orbitdefs[t].size,o=new Array(l);for(let i=0;i<l;i++)o[i]=[];for(let i=0;i<this.movenames.length;i++){if(this.isRotation[i])continue;let a=this.movenames[i];this.forcenames[i]||(a=ci(n,a),a[a.length-1]==="'"&&(a=a.substring(0,a.length-1)));let s=this.moveops[i].orbits[t];for(let f=0;f<l;f++)(s.perm[f]!==f||s.ori[f]!==0)&&o[f].push(a)}for(let i=0;i<l;i++)r.push(\`# \${i+1} \${o[i].join(" ")}\`)}toKsolve(t,r=new sn){let n=[];n.push(\`Name \${t}\`),n.push("");for(let l=0;l<this.orbitnames.length;l++)n.push(\`Set \${this.orbitnames[l]} \${this.orbitdefs[l].size} \${this.orbitdefs[l].mod}\`),this.describeSet(l,n,r);n.push(""),n.push("Solved");for(let l=0;l<this.orbitnames.length;l++)this.solved.orbits[l].appendDefinition(n,this.orbitnames[l],!1,!1);n.push("End");for(let l=0;l<this.movenames.length;l++){n.push("");let o=this.movenames[l];this.forcenames[l]||(o=ci(r,this.movenames[l]));let i=!1;o[o.length-1]==="'"&&(i=!0,o=o.substring(0,o.length-1)),n.push(\`Move \${o}\`);for(let a=0;a<this.orbitnames.length;a++)i?this.moveops[l].orbits[a].inv().appendDefinition(n,this.orbitnames[a],!0):this.moveops[l].orbits[a].appendDefinition(n,this.orbitnames[a],!0);n.push("End")}return n}toKPuzzleDefinition(t){let r={},n={};for(let o=0;o<this.orbitnames.length;o++){r[this.orbitnames[o]]={numPieces:this.orbitdefs[o].size,numOrientations:this.orbitdefs[o].mod};let i=this.solved.orbits[o].toKPuzzle();n[this.orbitnames[o]]={pieces:i.permutation,orientation:i.orientation}}let l={};if(t)for(let o=0;o<this.movenames.length;o++)l[this.movenames[o]]=this.transformToKTransformationData(this.moveops[o]);return{name:\`PG3D #\${++bL}\`,orbits:r,startStateData:n,moves:l}}optimize(){let t=[],r=[],n=[],l=[];for(let o=0;o<this.moveops.length;o++)l.push([]);for(let o=0;o<this.orbitdefs.length;o++){let i=this.orbitdefs[o].mod,a=this.orbitdefs[o].size,s=new mi(a),f=new Array(this.orbitdefs[o].size);for(let p=0;p<a;p++)f[p]=!1;for(let p=0;p<this.moveops.length;p++)if(!this.isRotation[p])for(let L=0;L<a;L++)(this.moveops[p].orbits[o].perm[L]!==L||this.moveops[p].orbits[o].ori[L]!==0)&&(f[L]=!0,s.union(L,this.moveops[p].orbits[o].perm[L]));let u=!0;if(i>1){u=!1;let p=new mi(this.orbitdefs[o].size*i);for(let L=0;L<this.moveops.length;L++)for(let m=0;m<a;m++)if(this.moveops[L].orbits[o].perm[m]!==m||this.moveops[L].orbits[o].ori[m]!==0)for(let d=0;d<i;d++)p.union(m*i+d,this.moveops[L].orbits[o].perm[m]*i+(d+this.moveops[L].orbits[o].ori[m])%i);for(let L=0;!u&&L<a;L++)for(let m=1;m<i;m++)p.find(L*i)===p.find(L*i+m)&&(u=!0);for(let L=0;!u&&L<a;L++)for(let m=0;m<L;m++)this.solved.orbits[o].perm[L]===this.solved.orbits[o].perm[m]&&(u=!0)}let g=-1,c=!1;for(let p=0;p<this.orbitdefs[o].size;p++)if(f[p]){let L=s.find(p);g<0?g=L:g!==L&&(c=!0)}for(let p=0;p<this.orbitdefs[o].size;p++){if(!f[p]||s.find(p)!==p)continue;let m=[],d=[],D=0;for(let F=0;F<this.orbitdefs[o].size;F++)s.find(F)===p&&(m[D]=F,d[F]=D,D++);if(c?t.push(\`\${this.orbitnames[o]}_p\${p}\`):t.push(this.orbitnames[o]),u){r.push(new tl(D,this.orbitdefs[o].mod)),n.push(this.solved.orbits[o].remapVS(m,D));for(let F=0;F<this.moveops.length;F++)l[F].push(this.moveops[F].orbits[o].remap(m,d,D))}else{r.push(new tl(D,1)),n.push(this.solved.orbits[o].remapVS(m,D).killOri());for(let F=0;F<this.moveops.length;F++)l[F].push(this.moveops[F].orbits[o].remap(m,d,D).killOri())}}}return new fn(t,r,new un(n),this.movenames,l.map(o=>new ar(o)),this.isRotation,this.forcenames)}scramble(t){this.solved=this.solved.mul(this.getScrambleTransformation(t))}getScrambleTransformation(t){t<100&&(t=100);let r=[];for(let l=0;l<this.moveops.length;l++)r[l]=this.moveops[l];for(let l=0;l<r.length;l++){let o=Math.floor(Math.random()*r.length),i=r[l];r[l]=r[o],r[o]=i}t<r.length&&(t=r.length);for(let l=0;l<t;l++){let o=Math.floor(Math.random()*r.length),i=Math.floor(Math.random()*r.length),a=Math.floor(Math.random()*this.moveops.length);r[o]=r[o].mul(r[i]).mul(this.moveops[a]),Math.random()<.1&&(r[o]=r[o].mul(this.moveops[a]))}let n=r[0];for(let l=1;l<r.length;l++)n=n.mul(r[l]);return n}reassemblySize(){let t=BigInt(1);for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},_t=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new _t(qt(t),Ur(t),r)}mul(t){let r=this.perm.length,n=new Array(r);if(this.orimod===1){for(let l=0;l<r;l++)n[l]=this.perm[t.perm[l]];return new _t(n,this.ori,this.orimod)}else{let l=new Array(r);for(let o=0;o<r;o++)n[o]=this.perm[t.perm[o]],l[o]=(this.ori[t.perm[o]]+t.ori[o])%this.orimod;return new _t(n,l,this.orimod)}}inv(){let t=this.perm.length,r=new Array(t),n=new Array(t);for(let l=0;l<t;l++)r[this.perm[l]]=l,n[this.perm[l]]=(this.orimod-this.ori[l])%this.orimod;return new _t(r,n,this.orimod)}equal(t){let r=this.perm.length;for(let n=0;n<r;n++)if(this.perm[n]!==t.perm[n]||this.ori[n]!==t.ori[n])return!1;return!0}killOri(){let t=this.perm.length;for(let r=0;r<t;r++)this.ori[r]=0;return this.orimod=1,this}toPerm(){let t=this.orimod;if(t===1)return new dt(this.perm);let r=this.perm.length,n=new Array(r*t);for(let l=0;l<r;l++)for(let o=0;o<t;o++)n[l*t+o]=t*this.perm[l]+(this.ori[l]+o)%t;return new dt(n)}identicalPieces(){let t=[],r=this.perm.length,n=[];for(let l=0;l<r;l++){let o=this.perm[l];if(t[o]===void 0){let i=[l];t[o]=!0;for(let a=l+1;a<r;a++)this.perm[a]===o&&i.push(a);n.push(i)}}return n}order(){return this.toPerm().order()}isIdentity(){let t=this.perm.length;if(this.perm===qt(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 l=new Array(n),o=new Array(n);for(let i=0;i<n;i++)l[i]=r[this.perm[t[i]]],o[i]=this.ori[t[i]];return new _t(l,o,this.orimod)}remapVS(t,r){let n=new Array(r),l=new Array(r),o=0,i=[];for(let a=0;a<r;a++){let s=this.perm[t[a]];i[s]===void 0&&(i[s]=o++),n[a]=i[s],l[a]=this.ori[t[a]]}return new _t(n,l,this.orimod)}appendDefinition(t,r,n,l=!0){if(!(l&&this.isIdentity())&&(t.push(r),t.push(this.perm.map(o=>o+1).join(" ")),!this.zeroOris()))if(n){let o=new Array(this.ori.length);for(let i=0;i<o.length;i++)o[this.perm[i]]=this.ori[i];t.push(o.join(" "))}else t.push(this.ori.join(" "))}toKPuzzle(){let t=this.perm.length;return this.isIdentity()?(_t.kcache[t]||(_t.kcache[t]={permutation:qt(t),orientation:Ur(t)}),_t.kcache[t]):{permutation:this.perm,orientation:this.ori}}},Vt=_t;Vt.kcache=[];pi=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 l of this.orbits){let o=l.toPerm();t.push(o),r+=o.n}let n=new Array(r);r=0;for(let l of t){for(let o=0;o<l.n;o++)n[r+o]=r+l.p[o];r+=l.n}return new dt(n)}identicalPieces(){let t=[],r=0;for(let n of this.orbits){let l=n.orimod,o=n.identicalPieces();for(let i=0;i<o.length;i++)t.push(o[i].map(a=>a*l+r));r+=l*n.perm.length}return t}order(){let t=1;for(let r of this.orbits)t=Us(t,r.order());return t}},ar=class extends pi{constructor(t){super(t)}mul(t){return new ar(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,l=this.e();for(;t>0;)t&1&&(l=l.mul(n)),t>1&&(n=n.mul(n)),t>>=1;return l}inv(){return new ar(this.internalInv())}e(){return new ar(this.orbits.map(t=>Vt.e(t.perm.length,t.orimod)))}},un=class extends pi{constructor(t){super(t)}mul(t){return new un(this.internalMul(t))}},mi=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),l=this.find(r);n<l?this.heads[l]=n:n>l&&(this.heads[n]=l)}}});var Li,Qf=A(()=>{"use strict";Li={"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 Bi(e){let t=new W(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function jf(e,t,r,n){let l=n[e].intersect3(n[t],n[r]);if(!l)return l;for(let o=0;o<n.length;o++)if(o!==e&&o!==t&&o!==r){let i=n[o].b*l.b+n[o].c*l.c+n[o].d*l.d;if(n[o].a>0&&i>n[o].a||n[o].a<0&&i<n[o].a)return!1}return l}var W,di=A(()=>{"use strict";W=class{constructor(t,r,n,l){this.a=t;this.b=r;this.c=n;this.d=l}mul(t){return new W(this.a*t.a-this.b*t.b-this.c*t.c-this.d*t.d,this.a*t.b+this.b*t.a+this.c*t.d-this.d*t.c,this.a*t.c-this.b*t.d+this.c*t.a+this.d*t.b,this.a*t.d+this.b*t.c-this.c*t.b+this.d*t.a)}toString(){return\`Q[\${this.a},\${this.b},\${this.c},\${this.d}]\`}dist(t){return Math.hypot(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}len(){return Math.hypot(this.a,this.b,this.c,this.d)}cross(t){return new W(0,this.c*t.d-this.d*t.c,this.d*t.b-this.b*t.d,this.b*t.c-this.c*t.b)}dot(t){return this.b*t.b+this.c*t.c+this.d*t.d}normalize(){let t=Math.sqrt(this.dot(this));return new W(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new W(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new W(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new W(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new W(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new W(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}angle(){return 2*Math.acos(this.a)}invrot(){return new W(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,l,o,i,a,s,f){return t*(o*f-i*s)+r*(i*a-l*f)+n*(l*s-o*a)}rotateplane(t){let r=t.mul(new W(0,this.b,this.c,this.d)).mul(t.invrot());return r.a=this.a,r}orthogonal(){let t=Math.abs(this.b),r=Math.abs(this.c),n=Math.abs(this.d);return t<r&&t<n?this.cross(new W(0,1,0,0)).normalize():r<t&&r<n?this.cross(new W(0,0,1,0)).normalize():this.cross(new W(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<1e-9)return new W(1,0,0,0);let n=r.sum(t);n.len()<1e-9?n=n.orthogonal():n=n.normalize();let l=r.cross(n);return l.a=r.dot(n),l}unproject(t){return this.sum(t.smul(-this.dot(t)/(this.len()*t.len())))}rotatepoint(t){return t.mul(this).mul(t.invrot())}rotateface(t){return t.map(r=>r.rotatepoint(this))}intersect3(t,r){let n=this.det3x3(this.b,this.c,this.d,t.b,t.c,t.d,r.b,r.c,r.d);return Math.abs(n)<1e-9?!1:new W(0,this.det3x3(this.a,this.c,this.d,t.a,t.c,t.d,r.a,r.c,r.d)/n,this.det3x3(this.b,this.a,this.d,t.b,t.a,t.d,r.b,r.a,r.d)/n,this.det3x3(this.b,this.c,this.a,t.b,t.c,t.a,r.b,r.c,r.a)/n)}side(t){return t>1e-9?1:t<-1e-9?-1:0}cutface(t){let r=this.a,n=0,l=null;for(let o=0;o<t.length;o++)n|=1<<this.side(t[o].dot(this)-r)+1;if((n&5)===5){l=[];let o=t.map(i=>this.side(i.dot(this)-r));for(let i=-1;i<=1;i+=2){let a=[];for(let s=0;s<t.length;s++){(o[s]===i||o[s]===0)&&a.push(t[s]);let f=(s+1)%t.length;if(o[s]+o[f]===0&&o[s]!==0){let u=t[s].dot(this)-r,g=t[f].dot(this)-r,c=u/(u-g),p=t[s].smul(1-c).sum(t[f].smul(c));a.push(p)}}l.push(a)}}return l}cutfaces(t){let r=[];for(let n=0;n<t.length;n++){let l=t[n],o=this.cutface(l);o?(r.push(o[0]),r.push(o[1])):r.push(l)}return r}faceside(t){let r=this.a;for(let n=0;n<t.length;n++){let l=this.side(t[n].dot(this)-r);if(l!==0)return l}throw new Error("Could not determine side of plane in faceside")}sameplane(t){let r=this.normalize(),n=t.normalize();return r.dist(n)<1e-9||r.dist(n.smul(-1))<1e-9}makecut(t){return new W(t,this.b,this.c,this.d)}}});function qf(){let e=Math.sqrt(.5);return[new W(e,e,0,0),new W(e,0,e,0)]}function Vf(){return[new W(.5,.5,.5,.5),new W(.5,.5,.5,-.5)]}function Hf(){let e=2*Math.PI/10,t=.5+.3*Math.sqrt(5),r=.5+.1*Math.sqrt(5),n=Math.sqrt(t*t+r*r);return t/=n,r/=n,[new W(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new W(.5,.5,.5,.5)]}function Xf(){let e=.16666666666666666+Math.sqrt(5)/6,t=2/3+Math.sqrt(5)/3,r=Math.sqrt(e*e+t*t);e/=r,t/=r;let n=2*Math.PI/6;return[new W(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new W(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function Jf(){let e=Math.sqrt(.5);return[new W(.5,.5,.5,.5),new W(e,0,0,e)]}function Zf(e){let t=[new W(1,0,0,0)];for(let r=0;r<t.length;r++)for(let n=0;n<e.length;n++){let l=e[n].mul(t[r]),o=l.smul(-1),i=!1;for(let a=0;a<t.length;a++)if(l.dist(t[a])<Ri||o.dist(t[a])<Ri){i=!0;break}i||t.push(l)}return t}function bs(e,t){let r=[],n=[];for(let l=0;l<t.length;l++){let o=e.rotateplane(t[l]),i=!1;for(let a=0;a<r.length;a++)if(o.dist(r[a])<Ri){i=!0;break}i||(r.push(o),n.push(t[l]))}return n}function Es(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let l=jf(0,r,n,e);if(l){let o=!1;for(let i=0;i<t.length;i++)if(l.dist(t[i])<Ri){o=!0;break}o||t.push(l)}}for(;;){let r=!1;for(let n=0;n<t.length;n++){let l=(n+1)%t.length;if(e[0].dot(t[n].cross(t[l]))<0){let o=t[n];t[n]=t[l],t[l]=o,r=!0}}if(!r)break}return t}var Ri,Yf=A(()=>{"use strict";di();Ri=1e-9});function hi(e,t){let r=e[0].p.length,n=Tf(r),l=[],o=[],i=[],a=[],s=[];function f(p){for(let L=p.p.length-1;L>=0;L--){let m=p.p[L];if(m!==L){if(!l[L][m])return!1;p=p.mul(o[L][m])}}return!0}function u(p,L,m){a[p].push(L),s[p].push(m);for(let d=0;d<l[p].length;d++)l[p][d]&&g(p,l[p][d].mul(L),m+i[p][d])}function g(p,L,m){let d=L.p[p];if(!l[p][d]){l[p][d]=L,o[p][d]=L.inv(),i[p][d]=m;for(let F=0;F<a[p].length;F++)g(p,L.mul(a[p][F]),m+s[p][F]);return}let D=L.mul(o[p][d]);f(D)||u(p-1,D,m+i[p][d])}function c(){l=[],o=[],a=[],i=[],s=[];for(let m=0;m<r;m++)l.push([]),o.push([]),i.push([]),a.push([]),s.push([]),l[m][m]=n,o[m][m]=n,i[m][m]=0;let p=0,L=BigInt(1);for(let m=0;m<e.length;m++){u(r-1,e[m],1),L=BigInt(1);let d=0,D=0,F=[],S=new ws;for(let v=0;v<r;v++){let U=0,P=0;for(let z=0;z<r;z++)l[v][z]&&(U++,P+=i[v][z],v!==z&&p++);d+=a[v].length,L*=BigInt(U),U>1&&S.multiply(U);let J=P/U;F.push(J),D+=J}t(\`\${m}: sz \${L} T \${d} sol \${D} none \${p} mults \${S.toString()}\`)}return L}return c()}var ws,ks=A(()=>{"use strict";gi();ws=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 EL(e,t){let r=[];for(let n of e)for(let l of t)r.push(l.rotate(n));return r}function _L(){return{4:[["F","D","L","R"]],6:[["F","D","L","U","R"],["R","F","","B",""]],8:[["F","D","L","R"],["D","F","BR",""],["BR","D","","BB"],["BB","BR","U","BL"]],12:[["U","F","","","",""],["F","U","R","C","A","L"],["R","F","","","E",""],["E","R","","BF","",""],["BF","E","BR","BL","I","D"]],20:[["R","C","F","E"],["F","R","L","U"],["L","F","A",""],["E","R","G","I"],["I","E","S","H"],["S","I","J","B"],["B","S","K","D"],["K","B","M","O"],["O","K","P","N"],["P","O","Q",""]]}}function CL(){return{4:{F:"#00ff00",D:"#ffff00",L:"#ff0000",R:"#0000ff"},6:{U:"#ffffff",F:"#00ff00",R:"#ff0000",D:"#ffff00",B:"#0000ff",L:"#ff8000"},8:{U:"#ffffff",F:"#ff0000",R:"#00bb00",D:"#ffff00",BB:"#1122ff",L:"#9524c5",BL:"#ff8800",BR:"#aaaaaa"},12:{U:"#ffffff",F:"#006633",R:"#ff0000",C:"#ffffd0",A:"#3399ff",L:"#660099",E:"#ff66cc",BF:"#99ff00",BR:"#0000ff",BL:"#ffff00",I:"#ff6633",D:"#999999"},20:{R:"#db69f0",C:"#178fde",F:"#23238b",E:"#9cc726",L:"#2c212d",U:"#177fa7",A:"#e0de7f",G:"#2b57c0",I:"#41126b",S:"#4b8c28",H:"#7c098d",J:"#7fe7b4",B:"#85fb74",K:"#3f4bc3",D:"#0ff555",M:"#f1c2c8",O:"#58d340",P:"#c514f2",N:"#14494e",Q:"#8b1be1"}}}function NL(){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 Di(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<Ue)return r;throw new Error("Element not found")}function $f(){return Li}function e1(e){return Li[e]}function fo(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 l=1;l<t.length;l+=2){if(t[l]!=="f"&&t[l]!=="v"&&t[l]!=="e")return null;n.push({cutType:t[l],distance:parseFloat(t[l+1])})}return{shape:r,cuts:n}}function Cs(e,t={}){let r=fo(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new go(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function n1(e,t){return Cs(Li[e],t)}function PL(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 l=e[0],o="";if(t[0]===0&&t[1]===r)l=\`\${l}v\`;else if(t[0]===t[1])t[1]>0&&(o=String(t[1]+1));else if(t[0]===0)l=l.toLowerCase(),t[1]>1&&(o=String(t[1]+1));else throw new Error(\`We only support slice and outer block moves right now. \${t}\`);return[o+l,n]}function ML(e,t){let r=[],n=0;for(;n<e.length;){n>0&&n<e.length&&e[n]==="_"&&n++;let l="";for(let o of t)e.substr(n).startsWith(o[1])&&o[1].length>l.length&&(l=o[1]);if(l!=="")r.push(l),n+=l.length;else throw new Error(\`Could not split \${e} into face names.\`)}return r}function Fi(e,t){return[e.b/t,-e.c/t,e.d/t]}function _s(e,t){let r=[],n=e.length;for(let l=0;l<n;l++){let o=Fi(e.get(n-l-1),t);r[3*l]=o[0],r[3*l+1]=o[1],r[3*l+2]=o[2]}return r}var br,rl,Ue,wL,kL,zL,t1,r1,go,yi,uo=A(()=>{"use strict";fe();Sf();As();Ss();gi();Kf();Qf();Yf();di();ks();br=class{constructor(t){this.coords=new Array(t.length*3);for(let r=0;r<t.length;r++)this.coords[3*r]=t[r].b,this.coords[3*r+1]=t[r].c,this.coords[3*r+2]=t[r].d;this.length=t.length}get(t){return new W(0,this.coords[3*t],this.coords[3*t+1],this.coords[3*t+2])}centermass(){let t=0,r=0,n=0;for(let l=0;l<this.length;l++)t+=this.coords[3*l],r+=this.coords[3*l+1],n+=this.coords[3*l+2];return new W(0,t/this.length,r/this.length,n/this.length)}rotate(t){let r=[];for(let n=0;n<this.length;n++)r.push(this.get(n).rotatepoint(t));return new br(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new br(t)}},rl=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 rl(r[0]),this.right=new rl(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 br(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};Ue=1e-9,wL="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",kL=!1;zL={4:{v:["DFR","DLF","DRL","FLR"],e:["FR","LF","DF","DL","RD","RL"],c:["DF","FD","RL","LR"]},6:{v:["URF","UBR","ULB","UFL","DFR","DRB","DBL","DLF"],e:["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],c:["UB","LU","FU","RU","BU","DF"]},8:{v:["UBBBRR","URFL","ULBLBB","DBRBBBL","DBLLF","DFRBR"],e:["UL","UBB","UR","BRD","BLD","FD","BRR","FR","FL","BLL","BLBB","BRBB"],c:["BBU","LU","RU","BRD","FD","BLD","DF","UBB"]},12:{v:["URF","UFL","ULBL","UBLBR","UBRR","DEBF","DBFI","DIA","DAC","DCE","LAI","ALF","FCA","CFR","REC","ERBR","BRBFE","BFBRBL","BLIBF","IBLL"],e:["UF","UR","UBR","UBL","UL","ER","EBR","EBF","ED","EC","IBF","IBL","IL","IA","ID","AC","CF","FA","BFBR","BRBL","BLBF","CD","AD","AL","FL","FR","CR","BFD","BRR","BLL"],c:["UF","FU","DBF","BFD","AD","CD","BRU","BLU","LA","RA","EBR","IBL"]},20:{v:["FLPQU","FUGER","FRCAL","HCREI","ISBDH","JSIEG","BSJMK","MQPOK","ONDBK","NOPLA","UQMJG","DNACH"],e:["FU","FL","FR","EG","ER","EI","SJ","SI","SB","KM","KB","KO","PQ","PO","PL","UG","JG","MQ","UQ","HC","HD","ND","NA","JM","CA","AL","CR","HI","DB","NO"],c:["FU","UF","GE","EG","JS","SJ","MK","KM","QP","PQ","LA","AL","RC","CR","IH","HI","BD","DB","ON","NO"]}};t1=["c","t","o","d","i"],r1=["f","v","e"];go=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.notationMapper=new sn;this.addNotationMapper="";this.setReidOrder=!1;let n="genperms";this.options=new ui(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let l=null;switch(r){case"c":{l=qf();break}case"o":{l=Jf();break}case"i":{l=Xf();break}case"t":{l=Vf();break}case"d":{l=Hf();break}default:throw new Error(\`Bad shape argument: \${r}\`)}this.rotations=Zf(l),this.options.verbosity&&console.log(\`# Rotations: \${this.rotations.length}\`);let o=l[0];this.baseplanerot=bs(o,this.rotations);let i=this.baseplanerot.map(y=>o.rotateplane(y));this.baseplanes=i,this.baseFaceCount=i.length;let a=_L()[i.length];this.net=a,this.colors=CL()[i.length],this.options.verbosity>0&&console.log(\`# Base planes: \${i.length}\`);let s=Es(i),f=new W(0,0,0,0);this.options.verbosity>0&&console.log(\`# Face vertices: \${s.length}\`);let u=i[0].makenormal(),g=s[0].sum(s[1]).makenormal(),c=s[0].makenormal(),p=new W(1,u.b,u.c,u.d);this.options.verbosity>0&&console.log(\`# Boundary is \${p}\`);let m=bs(p,this.rotations).map(y=>p.rotateplane(y)),d=Es(m);this.edgedistance=d[0].sum(d[1]).smul(.5).dist(f),this.vertexdistance=d[0].dist(f);let D=[],F=[],S=!1,v=!1,U=!1;for(let y of n){let k=null,T=0;switch(y.cutType){case"f":{k=u,T=1,S=!0;break}case"v":{k=c,T=this.vertexdistance,U=!0;break}case"e":{k=g,T=this.edgedistance,v=!0;break}default:throw new Error(\`Bad cut argument: \${y.cutType}\`)}D.push(k.makecut(y.distance)),F.push(y.distance<T)}this.options.addRotations&&(S||D.push(u.makecut(10)),U||D.push(c.makecut(10)),v||D.push(g.makecut(10))),this.basefaces=[];for(let y of this.baseplanerot){let k=y.rotateface(d);this.basefaces.push(new br(k))}let P=[],J=[],z=[],Q=[],x=d.length;function C(y,k,T){for(let O of y)if(O[0].dist(k)<Ue){O.push(T);return}y.push([k,T])}for(let y=0;y<this.baseplanerot.length;y++){let k=this.baseplanerot[y].rotateface(d);for(let T=0;T<k.length;T++){let O=(T+1)%k.length,ee=k[T].sum(k[O]).smul(.5);C(Q,ee,y)}}let N=[];for(let y=0;y<this.baseplanerot.length;y++){let k=this.baseplanerot[y].rotateface(d),T=[];for(let O=0;O<k.length;O++){let ee=(O+1)%k.length,ae=k[O].sum(k[ee]).smul(.5),Ie=Q[Di(Q,ae)];if(y===Ie[1])T.push(Ie[2]);else if(y===Ie[2])T.push(Ie[1]);else throw new Error("Could not find edge")}N.push(T)}let b={},w=[];w.push(a[0][0]),b[a[0][0]]=0,w[N[0][0]]=a[0][1],b[a[0][1]]=N[0][0];for(let y of a){let k=y[0],T=b[k];if(T===void 0)throw new Error("Bad edge description; first edge not connected");let O=-1;for(let ee=0;ee<N[T].length;ee++){let ae=w[N[T][ee]];if(ae!==void 0&&ae===y[1]){O=ee;break}}if(O<0)throw new Error("First element of a net not known");for(let ee=2;ee<y.length;ee++){if(y[ee]==="")continue;let ae=N[T][(ee+O-1)%x],Ie=w[ae];if(Ie!==void 0&&Ie!==y[ee])throw new Error("Face mismatch in net");w[ae]=y[ee],b[y[ee]]=ae}}for(let y=0;y<this.baseplanerot.length;y++){let k=this.baseplanerot[y].rotateface(d),T=p.rotateplane(this.baseplanerot[y]),O=w[y];P.push([k,O]),J.push([T,O])}for(let y=0;y<this.baseplanerot.length;y++){let k=this.baseplanerot[y].rotateface(d),T=w[y];for(let O=0;O<k.length;O++){let ee=(O+1)%k.length,ae=k[O].sum(k[ee]).smul(.5),Ie=(O+2)%k.length,Gm=k[ee].sum(k[Ie]).smul(.5),Wm=Di(Q,ae),Km=Di(Q,Gm);C(z,k[ee],[T,Km,Wm])}}this.swizzler=new Yn(P.map(y=>y[1]));let M=this.swizzler.prefixFree?"":"_",j=zL[this.baseFaceCount],q=[];for(let y=0;y<this.baseFaceCount;y++)q[1<<y]=y;{let y=j.v;for(let k of y){let T=this.swizzler.splitByFaceNames(k),O=0;for(let ee of T)O|=1<<ee;q[O]=T[0]}}{let y=j.e;for(let k of y){let T=this.swizzler.splitByFaceNames(k),O=0;for(let ee of T)O|=1<<ee;q[O]=T[0]}}{let y=j.c;for(let k of y){let T=this.swizzler.splitByFaceNames(k),O=1<<T[0]|1<<this.baseFaceCount;q[O]=T[1]}}for(let y=0;y<Q.length;y++){if(Q[y].length!==3)throw new Error(\`Bad length in edge names \${Q[y]}\`);let k=Q[y][1],T=Q[y][2],O=w[k],ee=w[T],ae=1<<k|1<<T;q[ae]===k?O=O+M+ee:O=ee+M+O,Q[y]=[Q[y][0],O]}for(let y=0;y<z.length;y++){let k=0;if(z[y].length<4)throw new Error("Bad length in vertex names");for(let ae=1;ae<z[y].length;ae++)k|=1<<b[z[y][ae][0]];let T=q[k],O=-1;for(let ae=1;ae<z[y].length;ae++)T===b[z[y][ae][0]]&&(O=ae);if(O<0)throw new Error("Internal error; couldn't find face name when fixing corners");let ee="";for(let ae=1;ae<z[y].length;ae++){ae===1?ee=z[y][O][0]:ee=ee+M+z[y][O][0];for(let Ie=1;Ie<z[y].length;Ie++)if(z[y][O][1]===z[y][Ie][2]){O=Ie;break}}z[y]=[z[y][0],ee]}this.markedface=q,this.options.verbosity>1&&(console.log(\`# Face names: \${P.map(y=>y[1]).join(" ")}\`),console.log(\`# Edge names: \${Q.map(y=>y[1]).join(" ")}\`),console.log(\`# Vertex names: \${z.map(y=>y[1]).join(" ")}\`));let ie=[];for(let y of J)ie.push([y[0].makenormal(),y[1],"f"]);for(let y of Q)ie.push([y[0].makenormal(),y[1],"e"]);for(let y of z)ie.push([y[0].makenormal(),y[1],"v"]);this.facenames=P,this.faceplanes=J,this.edgenames=Q,this.vertexnames=z,this.geonormals=ie;let he=ie.map(y=>y[1]);this.swizzler.setGripNames(he),this.options.verbosity>0&&console.log(\`# Distances: face \${1} edge \${this.edgedistance} vertex \${this.vertexdistance}\`);for(let y=0;y<D.length;y++)for(let k of this.rotations){let T=D[y].rotateplane(k),O=!1;for(let ee of this.moveplanes)if(T.sameplane(ee)){O=!0;break}O||(this.moveplanes.push(T),F[y]&&this.moveplanes2.push(T))}let ve=new rl(d),Ye=this.moveplanes2.slice(),Et=31;for(let y=0;y<Ye.length;y++){let k=y+Math.floor((Ye.length-y)*(Et/65536));ve=ve.split(Ye[k]),Ye[k]=Ye[y],Et=(Et*1657+101)%65536}let de=ve.collect([],!0);this.faces=de,this.options.verbosity>0&&console.log(\`# Faces is now \${de.length}\`),this.stickersperface=de.length;let Dt=[],it=Bi(d);for(let y of this.rotations){let k=y.rotateface(d);it.dist(Bi(k))<Ue&&Dt.push(y)}let mt=new Array(de.length),ze=[];for(let y=0;y<de.length;y++){let k=de[y].centermass();ze.push([it.dist(k),k,y])}ze.sort((y,k)=>y[0]-k[0]);for(let y=0;y<de.length;y++){let k=ze[y][2];if(!mt[k]){mt[k]=!0;for(let T of Dt){let O=de[k].rotate(T),ee=O.centermass();for(let ae=y+1;ae<de.length&&!(ze[ae][0]-ze[y][0]>Ue);ae++){let Ie=ze[ae][2];if(!mt[Ie]&&ee.dist(ze[ae][1])<Ue){mt[Ie]=!0,de[Ie]=O;break}}}}}this.shortedge=1e99;for(let y of de)for(let k=0;k<y.length;k++){let T=(k+1)%y.length,O=y.get(k).dist(y.get(T));O<this.shortedge&&(this.shortedge=O)}this.options.verbosity>0&&console.log(\`# Short edge is \${this.shortedge}\`),r==="c"&&S&&!v&&!U&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&U&&!S&&!v&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(U||S)&&!v&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&S&&(this.notationMapper=new $n(this.swizzler,new Yn(["F","D","L","BL","R","U","BR","B"])),v||U||(this.addNotationMapper="FTOMapper")),r==="d"&&S&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new $n(this.swizzler,new Yn(["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 l of this.moveplanesets)if(l.length>0){let o=t.dot(l[0]),i=0,a=1;for(;a*2<=l.length;)a*=2;for(;a>0;a>>=1)i+a<=l.length&&o>l[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 l of this.moveplanesets)if(l.length>0){let o=r.dot(l[0]),i=0,a=1;for(;a*2<=l.length;)a*=2;for(;a>0;a>>=1)i+a<=l.length&&o>l[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 l=0;l+1<n.length;l++){let o=this.facelisthash.get(r)[l];if(Math.abs(t.dist(this.facecentermass[o]))<Ue)return o}return n[n.length-1]}project2d(t,r,n){let l=this.facenames[t][0],o=(r+1)%l.length,i=this.baseplanes[t],a=l[o].sub(l[r]),s=a.len();a=a.normalize();let f=a.cross(i).normalize(),u=n[1].sub(n[0]),g=u.len()/s;u=u.normalize();let c=u.b,p=u.c,L=a.smul(c).sub(f.smul(p)).smul(g),m=f.smul(c).sum(a.smul(p)).smul(g),d=new W(0,n[0].b-L.dot(l[r]),n[0].c-m.dot(l[r]),0);return[L,m,d]}allstickers(){let t="allstickers";this.faces=EL(this.baseplanerot,this.faces),this.options.verbosity>0&&console.log(\`# Total stickers is now \${this.faces.length}\`),this.facecentermass=new Array(this.faces.length);for(let x=0;x<this.faces.length;x++)this.facecentermass[x]=this.faces[x].centermass();let r=[],n=[];for(let x of this.moveplanes){let C=x.makenormal(),N=!1;for(let b of n)C.sameplane(b.makenormal())&&(N=!0);N||(n.push(C),r.push([]))}for(let x of this.moveplanes2){let C=x.makenormal();for(let N=0;N<n.length;N++)if(C.sameplane(n[N])){r[N].push(x);break}}for(let x=0;x<r.length;x++){let C=r[x].map(b=>b.normalizeplane()),N=n[x];for(let b=0;b<C.length;b++)C[b].makenormal().dist(N)>Ue&&(C[b]=C[b].smul(-1));C.sort((b,w)=>b.a-w.a),r[x]=C}this.moveplanesets=r,this.moveplanenormals=n;let l=r.map(x=>x.length);this.options.verbosity>0&&console.log(\`# Move plane sets: \${l}\`);let o=[];for(let x=0;x<r.length;x++)o.push([]);for(let x of this.rotations){if(Math.abs(Math.abs(x.a)-1)<Ue)continue;let C=x.makenormal();for(let N=0;N<r.length;N++)if(C.sameplane(n[N])){o[N].push(x);break}}this.moverotations=o;for(let x=0;x<o.length;x++){let C=o[x],N=C[0].makenormal();for(let b=0;b<C.length;b++)N.dist(C[b].makenormal())>Ue&&(C[b]=C[b].smul(-1));C.sort((b,w)=>b.angle()-w.angle()),o[x][0].dot(n[x])<0&&C.reverse()}let i=o.map(x=>1+x.length);this.movesetorders=i;let a=[],s="?";for(let x=0;x<r.length;x++){let C=n[x],N=null,b=null;for(let w of this.geonormals){let M=C.dot(w[0]);Math.abs(M-1)<Ue?(b=[w[1],w[2]],s=w[2]):Math.abs(M+1)<Ue&&(N=[w[1],w[2]],s=w[2])}if(b===null||N===null)throw new Error("Saw positive or negative sides as null");a.push([b[0],b[1],N[0],N[1],1+r[x].length]),this.addNotationMapper==="NxNxNCubeMapper"&&s==="f"&&(this.notationMapper=new io(1+r[x].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new so(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 el(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new ao(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&s==="f"&&(1+r[x].length===3&&(this.notationMapper=new oo(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&s==="f"&&(1+r[x].length===3&&(this.notationMapper=new lo(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=a;let f=new Map,u=this.faces;for(let x=0;x<u.length;x++){let C=u[x],N=this.keyface(C);if(!f.get(N))f.set(N,[x]);else{let b=f.get(N);if(b.push(x),b.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let w=0;w<b.length;w++){let M=\`\${N} \${w}\`;f.set(M,[b[w]])}}}}this.facelisthash=f,this.options.verbosity>0&&console.log(\`# Cubies: \${f.size}\`);let g=[],c=[],p=[];for(let x of f.values())if(x.length!==this.baseFaceCount){if(x.length>1){let C=x.map(j=>u[j].centermass()),N=Bi(C);for(let j=0;x.length>2;j++){let q=!1;for(let ie=0;ie<x.length;ie++){let he=(ie+1)%x.length;if(N.dot(C[ie].cross(C[he]))<0){let ve=C[ie];C[ie]=C[he],C[he]=ve;let Ye=x[ie];x[ie]=x[he],x[he]=Ye,q=!0}}if(!q)break;if(j>1e3)throw new Error("Bad epsilon math; too close to border")}let b=0;for(let j of x)b|=1<<Math.floor(j/this.stickersperface);let w=this.markedface[b],M=-1;for(let j=0;j<x.length;j++)Math.floor(x[j]/this.stickersperface)===w&&(M=j);if(M<0)throw new Error("Could not find marked face in list");if(M!==0){let j=x.slice();for(let q=0;q<x.length;q++)x[q]=j[(M+q)%x.length]}}for(let C=0;C<x.length;C++){let N=x[C];c[N]=g.length,p[N]=C}g.push(x)}this.cubies=g,this.facetocubie=c,this.facetoord=p;let L=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],m=[],d=[0,0,0,0,0,0],D=[],F=[],S=0,v=[],U=[],P=[],J=[],z=x=>g[x].map(C=>this.getfaceindex(C)).join(" "),Q=[];for(let x=0;x<g.length;x++){let C=g[x];if(C.length===0||F[x])continue;let N={},b=0;P.push(0),Q.push([]);let w=C.length,M=d[w]++,j=L[w];(j===void 0||w===this.baseFaceCount)&&(j="CORE"),j=j+(M===0?"":M+1),m[S]=j,D[S]=w;let q=[x],ie=0;for(F[x]=!0;ie<q.length;){let he=q[ie++],ve=z(he);if((C.length>1||N[ve]===void 0)&&(N[ve]=b++),J[he]=N[ve],v[he]=S,Q[S].push(he),U[he]=P[S]++,q.length<this.rotations.length){let Ye=this.facecentermass[g[he][0]];for(let Et of o){let de=this.facetocubie[this.findface(Ye.rotatepoint(Et[0]))];F[de]||(q.push(de),F[de]=!0)}}}S++}if(this.setReidOrder&&4<=this.stickersperface&&this.stickersperface<=9){let x=[["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],["UFR","URB","UBL","ULF","DRF","DFL","DLB","DBR"],["U","L","F","R","B","D"]],C={};for(let N of x)for(let b=0;b<N.length;b++){let w=0;for(let M=0;M<N[b].length;M++)w|=1<<N[b].charCodeAt(M)-65;C[w]=b}for(let N of Q)for(let b of N){let w=0;for(let M of g[b])w|=1<<this.facenames[this.getfaceindex(M)][1].charCodeAt(0)-65;U[b]=C[w]}}if(this.cubiesetnums=v,this.cubieordnums=U,this.cubiesetnames=m,this.cubieords=P,this.orbitoris=D,this.cubievaluemap=J,this.cubiesetcubies=Q,this.options.fixedPieceType!==null){for(let x=0;x<g.length;x++)if(this.options.fixedPieceType==="v"&&g[x].length>2||this.options.fixedPieceType==="e"&&g[x].length===2||this.options.fixedPieceType==="f"&&g[x].length===1){this.fixedCubie=x;break}if(this.fixedCubie<0)throw new Error(\`Could not find a cubie of type \${this.options.fixedPieceType} to fix.\`)}this.options.verbosity>0&&console.log(\`# Cubie orbit sizes \${P}\`)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?null:r.modified({family:this.swizzler.unswizzle(r.family)})}stringToBlockMove(t){let r=RegExp("^(([0-9]+)-)?([0-9]+)?([^0-9]+)([0-9]+'?)?$"),n=t.match(r);if(n===null)throw new Error(\`Bad move passed \${t}\`);let l=n[4],o,i;if(n[2]!==void 0){if(n[3]===void 0)throw new Error("Missing second number in range");o=parseInt(n[2],10)}n[3]!==void 0&&(i=parseInt(n[3],10));let a="1",s=1;return n[5]!==void 0&&(a=n[5],a[0]==="'"&&(a=\`-\${a.substring(1)}\`),s=parseInt(a,10)),new B(new _(l,i,o),s)}parseMove(t){let r=this.notationMapper.notationToInternal(t);if(r===null)throw new Error(\`Bad move \${t.family}\`);t=r;let n=t.family,l=!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),l=!0}n.endsWith("w")&&n[0]<="Z"&&(n=n.slice(0,-1).toLowerCase());let o,i=-1,a=this.swizzler.unswizzle(n),s=!1;for(let g=0;g<this.movesetgeos.length;g++){let c=this.movesetgeos[g];a===c[0]&&(s=!0,o=c,i=g),a===c[2]&&(s=!1,o=c,i=g)}let f=1,u=1;if(n.toUpperCase()!==n&&(u=2),o===void 0)throw new Error(\`Bad grip in move \${t.family}\`);if(t.outerLayer!==void 0&&(f=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(u=t.innerLayer,n<="Z"?f=u:f=1):u=t.innerLayer),f--,u--,l&&(f=0,u=this.moveplanesets[i].length),f<0||f>this.moveplanesets[i].length||u<0||u>this.moveplanesets[i].length)throw new Error(\`Bad slice spec \${f} \${u} vs \${this.moveplanesets[i].length}\`);if(!kL&&f===0&&u===this.moveplanesets[i].length&&!l)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,f,u,s,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t="genperms";if(this.cmovesbyslice.length>0)return;let r=[];if(this.options.orientCenters){for(let n=0;n<this.cubies.length;n++)if(this.cubies[n].length===1){let l=this.cubies[n][0],o=this.getfaceindex(l),i=this.basefaces[o].centermass();if(i.dist(this.facecentermass[l])<Ue){let a=1<<o|1<<this.baseFaceCount,s=this.markedface[a],f=this.baseplanes[s].makenormal(),u=-1,g=-1;for(let L=0;L<this.faces[l].length;L++){let m=this.faces[l].get(L),d=f.dot(m.sub(i));d>u&&(u=d,g=L)}let c=(g+1)%this.faces[l].length;if(Math.abs(f.dot(this.faces[l].get(c).sub(i))-u)<Ue&&(g=c),g!==0){let L=[];for(let m=0;m<this.faces[l].length;m++)L.push(this.faces[l].get((m+g)%this.faces[l].length));this.faces[l]=new br(L)}let p=this.basefaces[o].length;for(let L=1;L<p;L++)this.cubies[n].push(this.cubies[n][L-1]);this.duplicatedFaces[l]=p,this.duplicatedCubies[n]=p,this.orbitoris[this.cubiesetnums[n]]=p}}}for(let n=0;n<this.moveplanesets.length;n++){let l=this.moveplanesets[n],o=[],i=[l.length+1,0],a=1;for(;a*2<=l.length;)a*=2;for(let u=0;u<this.faces.length;u++){let g=0;if(l.length>0){let c=this.facecentermass[u].dot(l[0]);for(let p=a;p>0;p>>=1)g+p<=l.length&&c>l[g+p-1].a&&(g+=p);g=l.length-g}for(o.push(g);i.length<=g;)i.push(0);i[g]++}let s=new Array(i.length);for(let u=0;u<i.length;u++)s[u]=[];let f=[];for(let u=0;u<this.faces.length;u++){if(o[u]<0)continue;let g=[this.facetocubie[u],this.facetoord[u]],c=this.facecentermass[u],p=c,L=u,m=o[L];for(;;){o[L]=-1;let d=c.rotatepoint(this.moverotations[n][0]);if(d.dist(p)<Ue)break;L=this.findface(d),g.push(this.facetocubie[L],this.facetoord[L]),c=d}if(g.length>2&&this.options.orientCenters&&(this.cubies[g[0]].length===1||this.duplicatedCubies[g[0]]>1)&&this.facecentermass[u].dist(this.basefaces[this.getfaceindex(u)].centermass())<Ue){let d=this.faces[this.cubies[g[0]][0]];for(let D=0;D<g.length;D+=2){let F=this.faces[this.cubies[g[D]][0]],S=-1;for(let v=0;v<d.length;v++)if(F.get(v).dist(d.get(0))<Ue){S=v;break}if(S<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");g[D+1]=S,d=d.rotate(this.moverotations[n][0])}}if(g.length===2&&this.options.orientCenters)for(let d=1;d<this.movesetorders[n];d++)m===0?g.push(g[0],d):g.push(g[0],(this.movesetorders[n]-d)%this.movesetorders[n]);if(g.length>2&&!f[g[0]]){if(g.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let d of g)s[m].push(d)}for(let d=0;d<g.length;d+=2)f[g[d]]=!0}for(let u=0;u<s.length;u++)s[u]=s[u].slice();r.push(s)}if(this.cmovesbyslice=r,this.options.moveList){let n=[];for(let l of this.options.moveList)n.push(this.parsemove(l));this.parsedmovelist=n}this.facelisthash.clear(),this.facecentermass=[]}getboundarygeometry(){return{baseplanes:this.baseplanes,facenames:this.facenames,faceplanes:this.faceplanes,vertexnames:this.vertexnames,edgenames:this.edgenames,geonormals:this.geonormals}}getmovesets(t){let r=this.moveplanesets[t].length,n=[];if(this.parsedmovelist!==void 0)for(let l of this.parsedmovelist)l[1]===t&&(l[4]?n.push([l[2],l[3]]):n.push([r-l[3],r-l[2]]),n.push(l[5]));else if(this.options.vertexMoves&&!this.options.allMoves){let l=this.movesetgeos[t];if(l[1]!==l[3])for(let o=0;o<r;o++)l[1]!=="v"?(this.options.outerBlockMoves?n.push([o+1,r]):n.push([o+1]),n.push(1)):(this.options.outerBlockMoves?n.push([0,o]):n.push([o,o]),n.push(1))}else for(let l=0;l<=r;l++)!this.options.allMoves&&l+l===r||(this.options.outerBlockMoves?l+l>r?n.push([l,r]):n.push([0,l]):n.push([l,l]),n.push(1));if(this.fixedCubie>=0){let l=this.keyface3(this.faces[this.cubies[this.fixedCubie][0]])[t],o=[];for(let i=0;i<n.length;i+=2){let a=n[i];if(l>=a[0]&&l<=a[1])if(a[0]===0)a=[a[1]+1,r];else if(r===a[1])a=[0,a[0]-1];else throw Error("fixed cubie option would disconnect move");let s=!1;for(let f=0;f<o.length;f+=2)if(o[f][0]===a[0]&&o[f][1]===a[1]&&o[f+1]===n[i+1]){s=!0;break}s||(o.push(a),o.push(n[i+1]))}n=o}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+wL+\`
2
+ var workerSource = `"use strict";var qm=Object.defineProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var Lt=(e,t)=>{for(var r in t)qm(e,r,{get:t[r],enumerable:!0})};var Ws=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var R=(e,t,r)=>(Ws(e,t,"read from private field"),r?r.call(e):t.get(e)),Z=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},V=(e,t,r,n)=>(Ws(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ks=(e,t,r,n)=>({set _(l){V(e,t,l,r)},get _(){return R(e,t,n)}}),nr=(e,t,r)=>(Ws(e,t,"access private method"),r);var aL,Kl,Te,lr=F(()=>{"use strict";aL=!1,Kl=class{is(t){return this instanceof t}as(t){return this instanceof t?this:null}},Te=class extends Kl{constructor(){super(),aL&&Object.defineProperty(this,"_debugStr",{get:()=>this.toString()})}get log(){return console.log.bind(console,this,this.toString())}}});function V2(e,t=!0){if(!t)return e;switch(e){case 1:return-1;case-1:return 1}}function H2(e,t){return t===-1?Array.from(e).reverse():e}function X2(e){return Array.from(e).reverse()}var Kt=F(()=>{"use strict"});var Ql,Vs=F(()=>{"use strict";Ql="2^31 - 1"});var Yr,Bt,Hs=F(()=>{"use strict";Qt();Bt=class{constructor(){Z(this,Yr,[])}push(t){R(this,Yr).push(t)}experimentalPushAlg(t){for(let r of t.childAlgNodes())this.push(r)}experimentalNumAlgNodes(){return R(this,Yr).length}toAlg(){return new E(R(this,Yr))}reset(){V(this,Yr,[])}};Yr=new WeakMap});var J2,Xs=F(()=>{"use strict";J2={caratNISSNotationEnabled:!1}});var $r,en,Yo,Ne,On=F(()=>{"use strict";Qt();lr();Kt();Yo=class extends Te{constructor(r,n){super();Z(this,$r,void 0);Z(this,en,void 0);V(this,$r,Ar(r)),V(this,en,Ar(n))}get A(){return R(this,$r)}get B(){return R(this,en)}isIdentical(r){let n=r.as(Yo);return!!(n?.A.isIdentical(this.A)&&n?.B.isIdentical(this.B))}invert(){return new Yo(R(this,en),R(this,$r))}*experimentalExpand(r=1,n){n??(n=1/0),n===0?yield r===1?this:this.invert():r===1?(yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(1,n-1),yield*this.A.experimentalExpand(-1,n-1),yield*this.B.experimentalExpand(-1,n-1)):(yield*this.B.experimentalExpand(1,n-1),yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(-1,n-1),yield*this.A.experimentalExpand(-1,n-1))}toString(){return\`[\${R(this,$r).toString()}, \${R(this,en).toString()}]\`}},Ne=Yo;$r=new WeakMap,en=new WeakMap});var In,Tn,$o,Pe,Gn=F(()=>{"use strict";Qt();lr();Kt();$o=class extends Te{constructor(r,n){super();Z(this,In,void 0);Z(this,Tn,void 0);V(this,In,Ar(r)),V(this,Tn,Ar(n))}get A(){return R(this,In)}get B(){return R(this,Tn)}isIdentical(r){let n=r.as($o);return!!(n?.A.isIdentical(this.A)&&n?.B.isIdentical(this.B))}invert(){return new $o(R(this,In),R(this,Tn).invert())}*experimentalExpand(r,n){n??(n=1/0),n===0?yield r===1?this:this.invert():(yield*this.A.experimentalExpand(1,n-1),yield*this.B.experimentalExpand(r,n-1),yield*this.A.experimentalExpand(-1,n-1))}toString(){return\`[\${this.A}: \${this.B}]\`}},Pe=$o;In=new WeakMap,Tn=new WeakMap});var Sr,Js,Ft,jl=F(()=>{"use strict";lr();Kt();Js=class extends Te{constructor(r){super();Z(this,Sr,void 0);if(r.includes(\`
3
+ \`)||r.includes("\\r"))throw new Error("LineComment cannot contain newline");V(this,Sr,r)}get text(){return R(this,Sr)}isIdentical(r){let n=r;return r.is(Js)&&R(this,Sr)===R(n,Sr)}invert(){return this}*experimentalExpand(r=1,n=1/0){yield this}toString(){return\`//\${R(this,Sr)}\`}},Ft=Js;Sr=new WeakMap});var $e,ql=F(()=>{"use strict";lr();Kt();$e=class extends Te{toString(){return\`
4
+ \`}isIdentical(t){return t.is($e)}invert(){return this}*experimentalExpand(t=1,r=1/0){yield this}}});var ye,Wn=F(()=>{"use strict";lr();Kt();ye=class extends Te{toString(){return"."}isIdentical(r){return r.is(ye)}invert(){return this}*experimentalExpand(r=1,n=1/0){yield this}}});function ei(e,t){return e?parseInt(e):t}function Zs(e){return new Vl().parseAlg(e)}function Y2(e){return new Vl().parseMove(e)}function $2(e){return new Vl().parseQuantumMove(e)}function et(e,t,r){let n=e;return n.startCharIndex=t,n.endCharIndex=r,n}function ef(e,t){return"startCharIndex"in e&&(t.startCharIndex=e.startCharIndex),"endCharIndex"in e&&(t.endCharIndex=e.endCharIndex),t}var Z2,fL,uL,gL,cL,pL,st,G,Kn,Vl,Ys=F(()=>{"use strict";Qt();Hs();Xs();On();Gn();Hl();jl();jt();ql();Wn();Z2=/^(\\d+)?('?)/,fL=/^[_\\dA-Za-z]/,uL=/^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)?/,gL=/^[^\\n]*/,cL=/^(-?\\d+), ?/,pL=/^(-?\\d+)\\)/;Vl=class{constructor(){Z(this,st,"");Z(this,G,0);Z(this,Kn,[])}parseAlg(t){V(this,st,t),V(this,G,0);let r=this.parseAlgWithStopping([]);this.mustBeAtEndOfInput();let n=Array.from(r.childAlgNodes());if(R(this,Kn).length>0)for(let s of R(this,Kn).reverse())n.push(s);let l=new E(n),{startCharIndex:o,endCharIndex:i}=r;return et(l,o,i),l}parseMove(t){V(this,st,t),V(this,G,0);let r=this.parseMoveImpl();return this.mustBeAtEndOfInput(),r}parseQuantumMove(t){V(this,st,t),V(this,G,0);let r=this.parseQuantumMoveImpl();return this.mustBeAtEndOfInput(),r}mustBeAtEndOfInput(){if(R(this,G)!==R(this,st).length)throw new Error("parsing unexpectedly ended early")}parseAlgWithStopping(t){let r=R(this,G),n=R(this,G),l=new Bt,o=!1,i=s=>{if(o)throw new Error(\`Unexpected character at index \${s}. Are you missing a space?\`)};e:for(;R(this,G)<R(this,st).length;){let s=R(this,G);if(t.includes(R(this,st)[R(this,G)]))return et(l.toAlg(),r,n);if(this.tryConsumeNext(" ")){o=!1,l.experimentalNumAlgNodes()===0&&(r=R(this,G));continue e}else if(fL.test(R(this,st)[R(this,G)])){i(s);let a=this.parseMoveImpl();l.push(a),o=!0,n=R(this,G);continue e}else if(this.tryConsumeNext("(")){i(s);let a=this.tryRegex(cL);if(a){let f=a[1],u=R(this,G),g=this.parseRegex(pL),c=et(new B(new _("U_SQ_"),parseInt(f)),s+1,s+1+f.length),p=et(new B(new _("D_SQ_"),parseInt(g[1])),u,R(this,G)-1),L=et(new E([c,p]),s+1,R(this,G)-1);l.push(et(new Me(L),s,R(this,G))),o=!0,n=R(this,G);continue e}else{let f=this.parseAlgWithStopping([")"]);this.mustConsumeNext(")");let u=this.parseAmount();l.push(et(new Me(f,u),s,R(this,G))),o=!0,n=R(this,G);continue e}}else if(this.tryConsumeNext("^")){if(!J2.caratNISSNotationEnabled)throw new Error("Alg contained a carat but carat NISS notation is not enabled.");this.mustConsumeNext("(");let a=this.parseAlgWithStopping([")"]);this.popNext();let f=new Me(a,-1),u=new ye;f.experimentalNISSPlaceholder=u,u.experimentalNISSGrouping=f,R(this,Kn).push(f),l.push(u)}else if(this.tryConsumeNext("[")){i(s);let a=this.parseAlgWithStopping([",",":"]),f=this.popNext(),u=this.parseAlgWithStopping(["]"]);switch(this.mustConsumeNext("]"),f){case":":{l.push(et(new Pe(a,u),s,R(this,G))),o=!0,n=R(this,G);continue e}case",":{l.push(et(new Ne(a,u),s,R(this,G))),o=!0,n=R(this,G);continue e}default:throw new Error("unexpected parsing error")}}else if(this.tryConsumeNext(\`
5
+ \`)){l.push(et(new $e,s,R(this,G))),o=!1,n=R(this,G);continue e}else if(this.tryConsumeNext("/"))if(this.tryConsumeNext("/")){i(s);let[a]=this.parseRegex(gL);l.push(et(new Ft(a),s,R(this,G))),o=!1,n=R(this,G);continue e}else{l.push(et(new B("_SLASH_"),s,R(this,G))),o=!0,n=R(this,G);continue e}else if(this.tryConsumeNext(".")){i(s),l.push(et(new ye,s,R(this,G))),o=!0,n=R(this,G);continue e}else throw new Error(\`Unexpected character: \${this.popNext()}\`)}if(R(this,G)!==R(this,st).length)throw new Error("did not finish parsing?");if(t.length>0)throw new Error("expected stopping");return et(l.toAlg(),r,n)}parseQuantumMoveImpl(){let[,,,t,r,n]=this.parseRegex(uL);return new _(n,ei(r,void 0),ei(t,void 0))}parseMoveImpl(){let t=R(this,G);if(this.tryConsumeNext("/"))return et(new B("_SLASH_"),t,R(this,G));let r=this.parseQuantumMoveImpl(),[n,l]=this.parseAmountAndTrackEmptyAbsAmount(),o=this.parseMoveSuffix();if(o){if(n<0)throw new Error("uh-oh");if((o==="++"||o==="--")&&n!==1)throw new Error("Pochmann ++ or -- moves cannot have an amount other than 1.");if((o==="++"||o==="--")&&!l)throw new Error("Pochmann ++ or -- moves cannot have an amount written as a number.");if((o==="+"||o==="-")&&l)throw new Error("Clock dial moves must have an amount written as a natural number followed by + or -.");o.startsWith("+")&&(r=r.modified({family:\`\${r.family}_\${o==="+"?"PLUS":"PLUSPLUS"}_\`})),o.startsWith("-")&&(r=r.modified({family:\`\${r.family}_\${o==="-"?"PLUS":"PLUSPLUS"}_\`}),n*=-1)}return et(new B(r,n),t,R(this,G))}parseMoveSuffix(){return this.tryConsumeNext("+")?this.tryConsumeNext("+")?"++":"+":this.tryConsumeNext("-")?this.tryConsumeNext("-")?"--":"-":null}parseAmountAndTrackEmptyAbsAmount(){let t=R(this,G),[,r,n]=this.parseRegex(Z2);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[ei(r,1)*(n==="'"?-1:1),!r]}parseAmount(){let t=R(this,G),[,r,n]=this.parseRegex(Z2);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 ei(r,1)*(n==="'"?-1:1)}parseRegex(t){let r=t.exec(this.remaining());if(r===null)throw new Error("internal parsing error");return V(this,G,R(this,G)+r[0].length),r}tryRegex(t){let r=t.exec(this.remaining());return r===null?null:(V(this,G,R(this,G)+r[0].length),r)}remaining(){return R(this,st).slice(R(this,G))}popNext(){let t=R(this,st)[R(this,G)];return Ks(this,G)._++,t}tryConsumeNext(t){return R(this,st)[R(this,G)]===t?(Ks(this,G)._++,!0):!1}mustConsumeNext(t){let r=this.popNext();if(r!==t)throw new Error(\`expected \\\`\${t}\\\` while parsing, encountered \${r}\`);return r}};st=new WeakMap,G=new WeakMap,Kn=new WeakMap});function ti(e){tf.has(e)||(console.warn(e),tf.add(e))}var tf,$s=F(()=>{"use strict";tf=new Set});var rn,ea=F(()=>{"use strict";Kt();Vs();rn=class{constructor(t,r=1){if(this.quantum=t,this.amount=r,!Number.isInteger(this.amount)||this.amount<-2147483648||this.amount>2147483647)throw new Error(\`AlgNode amount absolute value must be a non-negative integer below \${Ql}.\`)}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),l=V2(t,this.amount<0);for(let o=0;o<n;o++)yield*this.quantum.experimentalExpand(l,r)}}});var or,He,Xe,ni,_,Ge,Qn,B,jt=F(()=>{"use strict";lr();Kt();Vs();Ys();$s();ea();ni=class extends Kl{constructor(r,n,l){super();Z(this,or,void 0);Z(this,He,void 0);Z(this,Xe,void 0);if(V(this,or,r),V(this,He,n??null),V(this,Xe,l??null),Object.freeze(this),R(this,He)!==null&&(!Number.isInteger(R(this,He))||R(this,He)<1||R(this,He)>2147483647))throw new Error(\`QuantumMove inner layer must be a positive integer below \${Ql}.\`);if(R(this,Xe)!==null&&(!Number.isInteger(R(this,Xe))||R(this,Xe)<1||R(this,Xe)>2147483647))throw new Error(\`QuantumMove outer layer must be a positive integer below \${Ql}.\`);if(R(this,Xe)!==null&&R(this,He)!==null&&R(this,He)<=R(this,Xe))throw new Error("QuantumMove outer layer must be smaller than inner layer.");if(R(this,Xe)!==null&&R(this,He)===null)throw new Error("QuantumMove with an outer layer must have an inner layer")}static fromString(r){return $2(r)}modified(r){return new ni(r.family??R(this,or),r.innerLayer??R(this,He),r.outerLayer??R(this,Xe))}isIdentical(r){let n=r;return r.is(ni)&&R(this,or)===R(n,or)&&R(this,He)===R(n,He)&&R(this,Xe)===R(n,Xe)}get family(){return R(this,or)}get outerLayer(){return R(this,Xe)}get innerLayer(){return R(this,He)}experimentalExpand(){throw new Error("experimentalExpand() cannot be called on a \`QuantumMove\` directly.")}toString(){let r=R(this,or);return R(this,He)!==null&&(r=String(R(this,He))+r,R(this,Xe)!==null&&(r=\`\${String(R(this,Xe))}-\${r}\`)),r}},_=ni;or=new WeakMap,He=new WeakMap,Xe=new WeakMap;Qn=class extends Te{constructor(...r){super();Z(this,Ge,void 0);if(typeof r[0]=="string")if(r[1]??null){V(this,Ge,new rn(_.fromString(r[0]),r[1]));return}else return Qn.fromString(r[0]);V(this,Ge,new rn(r[0],r[1]))}isIdentical(r){let n=r.as(Qn);return!!n&&R(this,Ge).isIdentical(R(n,Ge))}invert(){return ef(this,new Qn(R(this,Ge).quantum,-this.amount))}*experimentalExpand(r=1){r===1?yield this:yield this.modified({amount:-this.amount})}get quantum(){return R(this,Ge).quantum}modified(r){return new Qn(R(this,Ge).quantum.modified(r),r.amount??this.amount)}static fromString(r){return Y2(r)}get amount(){return R(this,Ge).amount}get type(){return ti("deprecated: type"),"blockMove"}get family(){return R(this,Ge).quantum.family??void 0}get outerLayer(){return R(this,Ge).quantum.outerLayer??void 0}get innerLayer(){return R(this,Ge).quantum.innerLayer??void 0}toString(){if(this.family==="_SLASH_")return"/";if(this.family.endsWith("_PLUS_"))return R(this,Ge).quantum.toString().slice(0,-6)+Math.abs(this.amount)+(this.amount<0?"-":"+");if(this.family.endsWith("_PLUSPLUS_")){let r=Math.abs(this.amount);return R(this,Ge).quantum.toString().slice(0,-10)+(r===1?"":r)+(this.amount<0?"--":"++")}return R(this,Ge).quantum.toString()+R(this,Ge).suffix()}},B=Qn;Ge=new WeakMap});var ta,rf,at,li,Me,Hl=F(()=>{"use strict";Qt();lr();Kt();jt();ea();ta=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 _("U_SQ_")),this.quantumD_SQ_||(this.quantumD_SQ_=new _("D_SQ_"));let r=t.alg;if(r.experimentalNumChildAlgNodes()===2){let[n,l]=r.childAlgNodes();if(n.as(B)?.quantum.isIdentical(this.quantumU_SQ_)&&l.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,l]}}return null}},rf=new ta,li=class extends Te{constructor(r,n){super();Z(this,at,void 0);let l=Ar(r);V(this,at,new rn(l,n))}isIdentical(r){let n=r;return r.is(li)&&R(this,at).isIdentical(R(n,at))}get alg(){return R(this,at).quantum}get amount(){return R(this,at).amount}get experimentalRepetitionSuffix(){return R(this,at).suffix()}invert(){return new li(R(this,at).quantum,-R(this,at).amount)}*experimentalExpand(r=1,n){n??(n=1/0),n===0?yield r===1?this:this.invert():yield*R(this,at).experimentalExpand(r,n-1)}static fromString(){throw new Error("unimplemented")}toString(){return rf.format(this)??\`(\${R(this,at).quantum.toString()})\${R(this,at).suffix()}\`}experimentalAsSquare1Tuple(){return rf.tuple(this)}},Me=li;at=new WeakMap});var jn=F(()=>{"use strict";Hl();jl();On();Gn();jt();ql();Wn()});function wt(e,t){return e instanceof t}function nf(e){return wt(e,Me)||wt(e,Ft)||wt(e,Ne)||wt(e,Pe)||wt(e,B)||wt(e,$e)||wt(e,ye)}var ra=F(()=>{"use strict";jn()});function lf(e,t,r){if(t.is(Me))return e.traverseGrouping(t,r);if(t.is(B))return e.traverseMove(t,r);if(t.is(Ne))return e.traverseCommutator(t,r);if(t.is(Pe))return e.traverseConjugate(t,r);if(t.is(ye))return e.traversePause(t,r);if(t.is($e))return e.traverseNewline(t,r);if(t.is(Ft))return e.traverseLineComment(t,r);throw new Error("unknown AlgNode")}function of(e){if(e.is(Me)||e.is(B)||e.is(Ne)||e.is(Pe)||e.is(ye)||e.is($e)||e.is(Ft))return e;throw new Error("internal error: expected AlgNode")}function kt(e,t){let r=new e(...t??[]);return r.traverseAlg.bind(r)}var xr,nn,na=F(()=>{"use strict";On();Gn();Hl();jl();jt();ql();Wn();xr=class{traverseAlgNode(t,r){return lf(this,t,r)}traverseIntoAlgNode(t,r){return of(this.traverseAlgNode(t,r))}},nn=class extends xr{traverseAlgNode(t){return lf(this,t,void 0)}traverseIntoAlgNode(t){return of(this.traverseAlgNode(t))}}});var LL,qn,la=F(()=>{"use strict";LL="any-direction",qn=class{constructor(t={}){this.config=t}cancelQuantum(){let{cancel:t}=this.config;return t===!0?LL:t===!1?"none":t?.directional??"none"}cancelAny(){return this.config.cancel&&this.cancelQuantum()!=="none"}cancelPuzzleSpecificModWrap(){let{cancel:t}=this.config;return t===!0||t===!1?"canonical-centered":t?.puzzleSpecificModWrap?t?.puzzleSpecificModWrap:t?.directional==="same-direction"?"preserve-sign":"canonical-centered"}puzzleSpecificSimplifyOptions(){return this.config.puzzleLoader?.puzzleSpecificSimplifyOptions??this.config.puzzleSpecificSimplifyOptions}}});function BL(e,t){return e*Math.sign(t.amount)>=0}function dL(e,t,r){return((e-r)%t+t)%t+r}function oa(e,t,r){let n=new qn(r),l=Array.from(e.childAlgNodes()),o=[t];function i(){return new E([...l,...o])}function s(a){if(n.cancelPuzzleSpecificModWrap()==="none")return a;let f=n.puzzleSpecificSimplifyOptions()?.quantumMoveOrder;if(!f)return a;let u=f(t.quantum),g;switch(n.cancelPuzzleSpecificModWrap()){case"gravity":{g=-Math.floor((u-(a.amount<0?0:1))/2);break}case"canonical-centered":{g=-Math.floor((u-1)/2);break}case"canonical-positive":{g=0;break}case"preserve-sign":{g=a.amount<0?1-u:0;break}default:throw new Error("Unknown mod wrap")}let c=dL(a.amount,u,g);return a.modified({amount:c})}if(n.cancelAny()){let a,f=n.puzzleSpecificSimplifyOptions()?.axis;if(f)a=L=>f.areQuantumMovesSameAxis(t.quantum,L.quantum);else{let L=t.quantum.toString();a=m=>m.quantum.toString()===L}let u=n.cancelQuantum()==="same-direction",g=new Map;g.set(t.quantum.toString(),Math.sign(t.amount));let c;for(c=l.length-1;c>=0;c--){let L=l[c].as(B);if(!L||!a(L))break;let m=L.quantum.toString();if(u){let d=g.get(m);if(d&&!BL(d,L))break;g.set(m,Math.sign(L.amount))}}let p=[...l.splice(c+1),t];if(f)o=f.simplifySameAxisMoves(p,n.cancelPuzzleSpecificModWrap()!=="none");else{let L=p.reduce((m,d)=>m+d.amount,0);if(g.size!==1)throw new Error("Internal error: multiple quantums when one was expected");o=[new B(t.quantum,L)]}}return o=o.map(a=>s(a)).filter(a=>a.amount!==0),i()}function ia(e,t,r){let n=t.as(B);return n?oa(e,n,r):new E([...e.childAlgNodes(),t])}var sa=F(()=>{"use strict";Qt();jt();la()});var oi,Jl,fa,ln,Xl,Zl,ua,aa,ga,sf=F(()=>{"use strict";Qt();On();Gn();Hl();jt();Wn();na();sa();la();aa=class extends xr{constructor(){super(...arguments);Z(this,Jl);Z(this,ln);Z(this,Zl);Z(this,oi,void 0)}*traverseAlg(r,n){if(n.depth===0){yield*r.childAlgNodes();return}let l=[],o=nr(this,ln,Xl).call(this,n);for(let i of r.childAlgNodes())for(let s of this.traverseAlgNode(i,o))l=Array.from(ia(new E(l),s,o).childAlgNodes());for(let i of l)yield i}*traverseGrouping(r,n){if(n.depth===0){yield r;return}if(r.amount===0)return;let l=new Me(this.traverseAlg(r.alg,nr(this,ln,Xl).call(this,n)),r.amount);if(l.alg.experimentalIsEmpty())return;let o=nr(this,Jl,fa).call(this).get(r);o&&(l.experimentalNISSPlaceholder=o,o.experimentalNISSGrouping=l),yield l}*traverseMove(r,n){yield r}*traverseCommutator(r,n){if(n.depth===0){yield r;return}let l=nr(this,ln,Xl).call(this,n),o=new Ne(this.traverseAlg(r.A,l),this.traverseAlg(r.B,l));o.A.experimentalIsEmpty()||o.B.experimentalIsEmpty()||o.A.isIdentical(o.B)||o.A.isIdentical(o.B.invert())||nr(this,Zl,ua).call(this,o.A,o.B,n)||(yield o)}*traverseConjugate(r,n){if(n.depth===0){yield r;return}let l=nr(this,ln,Xl).call(this,n),o=new Pe(this.traverseAlg(r.A,l),this.traverseAlg(r.B,l));if(!o.B.experimentalIsEmpty()){if(o.A.experimentalIsEmpty()||o.A.isIdentical(o.B)||o.A.isIdentical(o.B.invert())||nr(this,Zl,ua).call(this,o.A,o.B,n)){yield*r.B.childAlgNodes();return}yield o}}*traversePause(r,n){if(r.experimentalNISSGrouping){let l=new ye;nr(this,Jl,fa).call(this).set(r.experimentalNISSGrouping,l),yield l}else yield r}*traverseNewline(r,n){yield r}*traverseLineComment(r,n){yield r}};oi=new WeakMap,Jl=new WeakSet,fa=function(){return R(this,oi)??V(this,oi,new Map)},ln=new WeakSet,Xl=function(r){return{...r,depth:r.depth?r.depth-1:null}},Zl=new WeakSet,ua=function(r,n,l){if(r.experimentalNumChildAlgNodes()===1&&n.experimentalNumChildAlgNodes()===1){let o=Array.from(r.childAlgNodes())[0]?.as(B),i=Array.from(n.childAlgNodes())[0]?.as(B);if(!(o&&i))return!1;if(i.quantum.isIdentical(o.quantum)||new qn(l).puzzleSpecificSimplifyOptions()?.axis?.areQuantumMovesSameAxis(o.quantum,i.quantum))return!0}return!1};ga=kt(aa)});var ca=F(()=>{"use strict";sf();sa()});function af(e){if(!e)return[];if(wt(e,E))return e.childAlgNodes();if(typeof e=="string")return Zs(e).childAlgNodes();let t=e;if(typeof t[Symbol.iterator]=="function")return t;throw new Error("Invalid AlgNode")}function Ar(e){return wt(e,E)?e:new E(e)}function RL(e,t){return e.is($e)||t.is($e)||t.as(Me)?.experimentalNISSPlaceholder?"":e.is(Ft)&&!t.is($e)?\`
6
+ \`:" "}var ft,on,E,Qt=F(()=>{"use strict";lr();ra();Kt();Ys();ca();jn();jl();jt();ql();$s();on=class extends Te{constructor(r){super();Z(this,ft,void 0);V(this,ft,Array.from(af(r)));for(let n of R(this,ft))if(!nf(n))throw new Error("An alg can only contain alg nodes.")}isIdentical(r){let n=r;if(!r.is(on))return!1;let l=Array.from(R(this,ft)),o=Array.from(R(n,ft));if(l.length!==o.length)return!1;for(let i=0;i<l.length;i++)if(!l[i].isIdentical(o[i]))return!1;return!0}invert(){return new on(X2(Array.from(R(this,ft)).map(r=>r.invert())))}*experimentalExpand(r=1,n){n??(n=1/0);for(let l of H2(R(this,ft),r))yield*l.experimentalExpand(r,n)}expand(r){return new on(this.experimentalExpand(1,r?.depth??1/0))}*experimentalLeafMoves(){for(let r of this.experimentalExpand())r.is(B)&&(yield r)}concat(r){return new on(Array.from(R(this,ft)).concat(Array.from(af(r))))}experimentalIsEmpty(){for(let r of R(this,ft))return!1;return!0}static fromString(r){return Zs(r)}units(){return this.childAlgNodes()}*childAlgNodes(){for(let r of R(this,ft))yield r}experimentalNumUnits(){return this.experimentalNumChildAlgNodes()}experimentalNumChildAlgNodes(){return Array.from(R(this,ft)).length}get type(){return ti("deprecated: type"),"sequence"}toString(){let r="",n=null;for(let l of R(this,ft)){n&&(r+=RL(n,l));let o=l.as(ye)?.experimentalNISSGrouping;if(o){if(o.amount!==-1)throw new Error("Invalid NISS Grouping amount!");r+=\`^(\${o.alg.toString()})\`}else l.as(Me)?.experimentalNISSPlaceholder||(r+=l.toString());n=l}return r}experimentalSimplify(r){return new on(ga(this,r??{}))}simplify(r){return this.experimentalSimplify(r)}},E=on;ft=new WeakMap});var hL,ff=F(()=>{"use strict";Qt();jn();On();Gn();jt();Wn();hL={Sune:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",1),new B("R",1),new B("U",-2),new B("R",-1)]),AntiSune:new E([new B("R",1),new B("U",2),new B("R",-1),new B("U",-1),new B("R",1),new B("U",-1),new B("R",-1)]),SuneCommutator:new E([new Ne(new E([new B("R",1),new B("U",1),new B("R",-2)]),new E([new Pe(new E([new B("R",1)]),new E([new B("U",1)]))]))]),Niklas:new E([new B("R",1),new B("U",-1),new B("L",-1),new B("U",1),new B("R",-1),new B("U",-1),new B("L",1),new B("U",1)]),EPerm:new E([new B("x",-1),new Ne(new E([new Pe(new E([new B("R",1)]),new E([new B("U",-1)]))]),new E([new B("D",1)])),new Ne(new E([new Pe(new E([new B("R",1)]),new E([new B("U",1)]))]),new E([new B("D",1)])),new B("x",1)]),FURURFCompact:new E([new Pe(new E([new B("F",1)]),new E([new Ne(new E([new B("U",1)]),new E([new B("R",1)]))]))]),APermCompact:new E([new Pe(new E([new B("R",2)]),new E([new Ne(new E([new B("F",2)]),new E([new B("R",-1),new B("B",-1),new B("R",1)]))]))]),FURURFMoves:new E([new B("F",1),new B("U",1),new B("R",1),new B("U",-1),new B("R",-1),new B("F",-1)]),TPerm:new E([new B("R",1),new B("U",1),new B("R",-1),new B("U",-1),new B("R",-1),new B("F",1),new B("R",2),new B("U",-1),new B("R",-1),new B("U",-1),new B("R",1),new B("U",1),new B("R",-1),new B("F",-1)]),HeadlightSwaps:new E([new Pe(new E([new B("F",1)]),new E([new Me(new E([new Ne(new E([new B("R",1)]),new E([new B("U",1)]))]),3)]))]),TriplePause:new E([new ye,new ye,new ye])}});var xA,uf=F(()=>{"use strict";jn();jt();xA={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'"),192:new ye}});var gf=F(()=>{"use strict"});var ae=F(()=>{"use strict";Qt();Hs();na();ff();uf();jn();gf();ca();ra();Xs()});function $l(e,t,r){let n={};for(let l in e.orbits){let o=e.orbits[l],i=t[l],s=r[l];if(Yl(o.numOrientations,s))n[l]=i;else if(Yl(o.numOrientations,i))n[l]=s;else{let a=new Array(o.numPieces);if(o.numOrientations===1){for(let f=0;f<o.numPieces;f++)a[f]=i.permutation[s.permutation[f]];n[l]={permutation:a,orientation:i.orientation}}else{let f=new Array(o.numPieces);for(let u=0;u<o.numPieces;u++)f[u]=(i.orientation[s.permutation[u]]+s.orientation[u])%o.numOrientations,a[u]=i.permutation[s.permutation[u]];n[l]={permutation:a,orientation:f}}}}return n}function pa(e,t,r){let n={};for(let l in e.orbits){let o=e.orbits[l],i=t[l],s=r[l];if(Yl(o.numOrientations,s))n[l]=i;else{let a=new Array(o.numPieces);if(o.numOrientations===1){for(let f=0;f<o.numPieces;f++)a[f]=i.pieces[s.permutation[f]];n[l]={pieces:a,orientation:i.orientation}}else{let f=new Array(o.numPieces);for(let u=0;u<o.numPieces;u++)f[u]=(i.orientation[s.permutation[u]]+s.orientation[u])%o.numOrientations,a[u]=i.pieces[s.permutation[u]];n[l]={pieces:a,orientation:f}}}}return n}var ii=F(()=>{"use strict";eo()});function DL(e){let t=cf.get(e);if(t)return t;let r=new Array(e),n=new Array(e);for(let o=0;o<e;o++)r[o]=o,n[o]=0;let l={permutation:r,orientation:n};return pf&&(Object.freeze(r),Object.freeze(n),Object.freeze(l)),cf.set(e,l),l}function mf(e){let t={};for(let[r,n]of Object.entries(e.orbits))t[r]=DL(n.numPieces);return pf&&Object.freeze(t),t}function Lf(e,t){let r=t.quantum.toString(),n=e.definition.moves[r];if(!n){let i=e.definition.experimentalDerivedMoves?.[r];i&&(n=e.algToTransformation(i).transformationData)}if(n)return vr(e,n,t.amount);let l=e.definition.moves[t.toString()];if(l)return l;let o=e.definition.moves[t.invert().toString()];if(o)return vr(e,o,-1);throw new Error(\`Invalid move for KPuzzle (\${e.name()}): \${t}\`)}var pf,cf,ma=F(()=>{"use strict";eo();pf=!1,cf=new Map});var pe,si=F(()=>{"use strict";ii();to();pe=class{constructor(t,r){this.kpuzzle=t;this.stateData=r}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),stateData:this.stateData}}static fromTransformation(t){let r=pa(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=pa(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 l={permutation:n.pieces,orientation:n.orientation};t[r]=l}return new yt(this.kpuzzle,t)}experimentalIsSolved(t){if(!this.kpuzzle.definition.experimentalIsStateSolved)throw new Error("\`KState.experimentalIsSolved()\` is not supported for this puzzle at the moment.");return this.kpuzzle.definition.experimentalIsStateSolved(this,t)}}});var sn,Ur,yt,to=F(()=>{"use strict";eo();ii();ma();si();Ur=class{constructor(t,r){this.kpuzzle=t;this.transformationData=r;Z(this,sn,void 0)}toJSON(){return{experimentalPuzzleName:this.kpuzzle.name(),transformationData:this.transformationData}}invert(){return new Ur(this.kpuzzle,La(this.kpuzzle,this.transformationData))}isIdentityTransformation(){return R(this,sn)??V(this,sn,this.isIdentical(this.kpuzzle.identityTransformation()))}static experimentalConstructIdentity(t){let r=new Ur(t,mf(t.definition));return V(r,sn,!0),r}isIdentical(t){return Bf(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 R(this,sn)?new Ur(this.kpuzzle,t.transformationData):R(t,sn)?new Ur(this.kpuzzle,this.transformationData):new Ur(this.kpuzzle,$l(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 df(this.kpuzzle.definition,this)}selfMultiply(t){return new Ur(this.kpuzzle,vr(this.kpuzzle,this.transformationData,t))}},yt=Ur;sn=new WeakMap});function Yl(e,t){let{permutation:r}=t,n=r.length;for(let l=0;l<n;l++)if(r[l]!==l)return!1;if(e>1){let{orientation:l}=t;for(let o=0;o<n;o++)if(l[o]!==0)return!1}return!0}function FL(e,t,r,n={}){for(let l=0;l<e.numPieces;l++)if(!n?.ignoreOrientation&&t.orientation[l]!==r.orientation[l]||!n?.ignorePermutation&&t.permutation[l]!==r.permutation[l])return!1;return!0}function Bf(e,t,r){for(let[n,l]of Object.entries(e.definition.orbits))if(!FL(l,t[n],r[n]))return!1;return!0}function La(e,t){let r={};for(let n in e.definition.orbits){let l=e.definition.orbits[n],o=t[n];if(Yl(l.numOrientations,o))r[n]=o;else if(l.numOrientations===1){let i=new Array(l.numPieces);for(let s=0;s<l.numPieces;s++)i[o.permutation[s]]=s;r[n]={permutation:i,orientation:o.orientation}}else{let i=new Array(l.numPieces),s=new Array(l.numPieces);for(let a=0;a<l.numPieces;a++){let f=o.permutation[a];i[f]=a,s[f]=(l.numOrientations-o.orientation[a]+l.numOrientations)%l.numOrientations}r[n]={permutation:i,orientation:s}}}return r}function vr(e,t,r){if(r===1)return t;if(r<0)return vr(e,La(e,t),-r);if(r===0){let{transformationData:o}=e.identityTransformation();return o}let n=t;r!==2&&(n=vr(e,t,Math.floor(r/2)));let l=$l(e.definition,n,n);return r%2===0?l:$l(e.definition,t,l)}function da(e,t){return t?da(t,e%t):e}function df(e,t){let r=1;for(let n in e.orbits){let l=e.orbits[n],o=t.transformationData[n],i=new Array(l.numPieces);for(let s=0;s<l.numPieces;s++)if(!i[s]){let a=s,f=0,u=0;for(;i[a]=!0,f=f+o.orientation[a],u=u+1,a=o.permutation[a],a!==s;);f!==0&&(u=u*l.numOrientations/da(l.numOrientations,Math.abs(f))),r=r*u/da(r,u)}}return r}var Ba,Rf,eo=F(()=>{"use strict";ae();ae();ii();to();Ba=class extends xr{traverseAlg(t,r){let n=null;for(let l of t.childAlgNodes())n?n=n.applyTransformation(this.traverseAlgNode(l,r)):n=this.traverseAlgNode(l,r);return n??r.identityTransformation()}traverseGrouping(t,r){let n=this.traverseAlg(t.alg,r);return new yt(r,vr(r,n.transformationData,t.amount))}traverseMove(t,r){return r.moveToTransformation(t)}traverseCommutator(t,r){let n=this.traverseAlg(t.A,r),l=this.traverseAlg(t.B,r);return n.applyTransformation(l).applyTransformation(n.invert()).applyTransformation(l.invert())}traverseConjugate(t,r){let n=this.traverseAlg(t.A,r),l=this.traverseAlg(t.B,r);return n.applyTransformation(l).applyTransformation(n.invert())}traversePause(t,r){return r.identityTransformation()}traverseNewline(t,r){return r.identityTransformation()}traverseLineComment(t,r){return r.identityTransformation()}},Rf=kt(Ba)});var Vn,ai,De,hf=F(()=>{"use strict";ae();eo();ma();si();to();De=class{constructor(t,r){this.definition=t;Z(this,Vn,new Map);Z(this,ai,void 0);this.experimentalPGNotation=r?.experimentalPGNotation}name(){return this.definition.name}identityTransformation(){return yt.experimentalConstructIdentity(this)}moveToTransformation(t){typeof t=="string"&&(t=new B(t));let r=t.toString(),n=R(this,Vn).get(r);if(n)return new yt(this,n);if(this.experimentalPGNotation){let o=this.experimentalPGNotation.lookupMove(t);if(!o)throw new Error(\`could not map to internal move: \${t}\`);return R(this,Vn).set(r,o),new yt(this,o)}let l=Lf(this,t);return R(this,Vn).set(r,l),new yt(this,l)}algToTransformation(t){return typeof t=="string"&&(t=new E(t)),Rf(t,this)}toTransformation(t){return typeof t=="string"?this.algToTransformation(t):t?.is?.(E)?this.algToTransformation(t):t?.is?.(B)?this.moveToTransformation(t):t}startState(){return new pe(this,this.definition.startStateData)}canConvertStateToUniqueTransformation(){return R(this,ai)??V(this,ai,(()=>{for(let[t,r]of Object.entries(this.definition.orbits)){let n=new Array(r.numPieces).fill(!1);for(let l of this.definition.startStateData[t].pieces)n[l]=!0;for(let l of n)if(!l)return!1}return!0})())}};Vn=new WeakMap,ai=new WeakMap});var We=F(()=>{"use strict";hf();si();to()});var Df,yL,Ff=F(()=>{"use strict";Df={333:{puzzleID:"3x3x3",eventName:"3x3x3 Cube"},222:{puzzleID:"2x2x2",eventName:"2x2x2 Cube"},444:{puzzleID:"4x4x4",eventName:"4x4x4 Cube"},555:{puzzleID:"5x5x5",eventName:"5x5x5 Cube"},666:{puzzleID:"6x6x6",eventName:"6x6x6 Cube"},777:{puzzleID:"7x7x7",eventName:"7x7x7 Cube"},"333bf":{puzzleID:"3x3x3",eventName:"3x3x3 Blindfolded"},"333fm":{puzzleID:"3x3x3",eventName:"3x3x3 Fewest Moves"},"333oh":{puzzleID:"3x3x3",eventName:"3x3x3 One-Handed"},clock:{puzzleID:"clock",eventName:"Clock"},minx:{puzzleID:"megaminx",eventName:"Megaminx"},pyram:{puzzleID:"pyraminx",eventName:"Pyraminx"},skewb:{puzzleID:"skewb",eventName:"Skewb"},sq1:{puzzleID:"square1",eventName:"Square-1"},"444bf":{puzzleID:"4x4x4",eventName:"4x4x4 Blindfolded"},"555bf":{puzzleID:"5x5x5",eventName:"5x5x5 Blindfolded"},"333mb":{puzzleID:"3x3x3",eventName:"3x3x3 Multi-Blind"}},yL={...Df,fto:{puzzleID:"fto",eventName:"Face-Turning Octahedron"},master_tetraminx:{puzzleID:"master_tetraminx",eventName:"Master Tetraminx"},kilominx:{puzzleID:"kilominx",eventName:"Kilominx"},redi_cube:{puzzleID:"redi_cube",eventName:"Redi Cube"}}});function yf(e){return AL[e]}var ir,qt,Je,Hn,fi,an,AL,Xn,Jn,ro=F(()=>{"use strict";ir=class{constructor(t,r){this.stickerings=new Map;for(let[n,l]of Object.entries(t.definition.orbits))this.stickerings.set(n,new Array(l.numPieces).fill(r))}},qt="regular",Je="ignored",Hn="oriented",fi="invisible",an="dim",AL={["Regular"]:{facelets:[qt,qt,qt,qt,qt]},["Ignored"]:{facelets:[Je,Je,Je,Je,Je]},["OrientationStickers"]:{facelets:[Hn,Hn,Hn,Hn,Hn]},["IgnoreNonPrimary"]:{facelets:[qt,Je,Je,Je,Je]},["Invisible"]:{facelets:[fi,fi,fi,fi]},["PermuteNonPrimary"]:{facelets:[an,qt,qt,qt,qt]},["Dim"]:{facelets:[an,an,an,an,an]},["Ignoriented"]:{facelets:[an,Je,Je,Je,Je]},["OrientationWithoutPermutation"]:{facelets:[Hn,Je,Je,Je,Je]}};Xn=class extends ir{constructor(t){super(t,"Regular")}set(t,r){for(let[n,l]of this.stickerings.entries())for(let o=0;o<l.length;o++)t.stickerings.get(n)[o]&&(l[o]=r);return this}toStickeringMask(){let t={orbits:{}};for(let[r,n]of this.stickerings.entries()){let l=[],o={pieces:l};t.orbits[r]=o;for(let i of n)l.push(yf(i))}return t}},Jn=class{constructor(t){this.kpuzzle=t}and(t){let r=new ir(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let o=0;o<l.numPieces;o++){r.stickerings.get(n)[o]=!0;for(let i of t)if(!i.stickerings.get(n)[o]){r.stickerings.get(n)[o]=!1;continue e}}}return r}or(t){let r=new ir(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits)){e:for(let o=0;o<l.numPieces;o++){r.stickerings.get(n)[o]=!1;for(let i of t)if(i.stickerings.get(n)[o]){r.stickerings.get(n)[o]=!0;continue e}}}return r}not(t){let r=new ir(this.kpuzzle,!1);for(let[n,l]of Object.entries(this.kpuzzle.definition.orbits))for(let o=0;o<l.numPieces;o++)r.stickerings.get(n)[o]=!t.stickerings.get(n)[o];return r}all(){return this.and(this.moves([]))}move(t){let r=this.kpuzzle.moveToTransformation(t),n=new ir(this.kpuzzle,!1);for(let[l,o]of Object.entries(this.kpuzzle.definition.orbits))for(let i=0;i<o.numPieces;i++)(r.transformationData[l].permutation[i]!==i||r.transformationData[l].orientation[i]!==0)&&(n.stickerings.get(l)[i]=!0);return n}moves(t){return t.map(r=>this.move(r))}orbits(t){let r=new ir(this.kpuzzle,!1);for(let n of t)r.stickerings.get(n).fill(!0);return r}orbitPrefix(t){let r=new ir(this.kpuzzle,!1);for(let n in this.kpuzzle.definition.orbits)n.startsWith(t)&&r.stickerings.get(n).fill(!0);return r}}});var Ra,ha=F(()=>{"use strict";Ra={full:{groups:{"3x3x3":"Stickering"}},OLL:{groups:{"3x3x3":"Last Layer"}},PLL:{groups:{"3x3x3":"Last Layer"}},LL:{groups:{"3x3x3":"Last Layer"}},EOLL:{groups:{"3x3x3":"Last Layer"}},COLL:{groups:{"3x3x3":"Last Layer"}},OCLL:{groups:{"3x3x3":"Last Layer"}},CLL:{groups:{"3x3x3":"Last Layer"}},ELL:{groups:{"3x3x3":"Last Layer"}},ZBLL:{groups:{"3x3x3":"Last Layer"}},LS:{groups:{"3x3x3":"Last Slot"}},ELS:{groups:{"3x3x3":"Last Slot"}},CLS:{groups:{"3x3x3":"Last Slot"}},ZBLS:{groups:{"3x3x3":"Last Slot"}},VLS:{groups:{"3x3x3":"Last Slot"}},WVLS:{groups:{"3x3x3":"Last Slot"}},F2L:{groups:{"3x3x3":"CFOP (Fridrich)"}},Daisy:{groups:{"3x3x3":"CFOP (Fridrich)"}},Cross:{groups:{"3x3x3":"CFOP (Fridrich)"}},EO:{groups:{"3x3x3":"ZZ"}},EOline:{groups:{"3x3x3":"ZZ"}},EOcross:{groups:{"3x3x3":"ZZ"}},CMLL:{groups:{"3x3x3":"Roux"}},L10P:{groups:{"3x3x3":"Roux"}},L6E:{groups:{"3x3x3":"Roux"}},L6EO:{groups:{"3x3x3":"Roux"}},"2x2x2":{groups:{"3x3x3":"Petrus"}},"2x2x3":{groups:{"3x3x3":"Petrus"}},"Void Cube":{groups:{"3x3x3":"Miscellaneous"}},invisible:{groups:{"3x3x3":"Miscellaneous"}},picture:{groups:{"3x3x3":"Miscellaneous"}},"centers-only":{groups:{"3x3x3":"Miscellaneous"}},"experimental-centers-U":{},"experimental-centers-U-D":{},"experimental-centers-U-L-D":{},"experimental-centers-U-L-B-D":{},"experimental-centers":{},"experimental-fto-fc":{groups:{fto:"Bencisco"}},"experimental-fto-f2t":{groups:{fto:"Bencisco"}},"experimental-fto-sc":{groups:{fto:"Bencisco"}},"experimental-fto-l2c":{groups:{fto:"Bencisco"}},"experimental-fto-lbt":{groups:{fto:"Bencisco"}},"experimental-fto-l3t":{groups:{fto:"Bencisco"}}}});async function sr(e,t){let r=await e.kpuzzle(),n=new Xn(r),l=new Jn(r),o=()=>l.move("U"),i=()=>l.or(l.moves(["U","D"])),s=()=>l.or(l.moves(["L","R"])),a=()=>l.not(s()),f=()=>l.not(o()),u=()=>l.orbitPrefix("CENTER"),g=()=>l.orbitPrefix("EDGE"),c=()=>l.or([l.orbitPrefix("CORNER"),l.orbitPrefix("C4RNER"),l.orbitPrefix("C5RNER")]),p=()=>l.or([a(),l.and([o(),g()])]),L=()=>l.and([o(),u()]),m=()=>l.and([l.and(l.moves(["F","R"])),g()]),d=()=>l.and([l.and(l.moves(["F","R"])),c(),l.not(o())]),D=()=>l.or([d(),m()]);function y(){n.set(f(),"Dim")}function S(){n.set(o(),"PermuteNonPrimary"),n.set(L(),"Dim")}function v(){n.set(o(),"IgnoreNonPrimary"),n.set(L(),"Regular")}function U(){n.set(o(),"Ignoriented"),n.set(L(),"Dim")}switch(t){case"full":break;case"PLL":{y(),S();break}case"CLS":{y(),n.set(d(),"Regular"),n.set(o(),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"OLL":{y(),v();break}case"EOLL":{y(),v(),n.set(l.and([o(),c()]),"Ignored");break}case"COLL":{y(),n.set(l.and([o(),g()]),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"Regular");break}case"OCLL":{y(),U(),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"CLL":{y(),n.set(l.not(l.and([c(),o()])),"Dim");break}case"ELL":{y(),n.set(o(),"Dim"),n.set(l.and([o(),g()]),"Regular");break}case"ELS":{y(),v(),n.set(l.and([o(),c()]),"Ignored"),n.set(m(),"Regular"),n.set(d(),"Ignored");break}case"LL":{y();break}case"F2L":{n.set(o(),"Ignored");break}case"ZBLL":{y(),n.set(o(),"PermuteNonPrimary"),n.set(L(),"Dim"),n.set(l.and([o(),c()]),"Regular");break}case"ZBLS":{y(),n.set(D(),"Regular"),v(),n.set(l.and([o(),c()]),"Ignored");break}case"VLS":{y(),n.set(D(),"Regular"),v();break}case"WVLS":{y(),n.set(D(),"Regular"),n.set(l.and([o(),g()]),"Ignoriented"),n.set(l.and([o(),u()]),"Dim"),n.set(l.and([o(),c()]),"IgnoreNonPrimary");break}case"LS":{y(),n.set(D(),"Regular"),n.set(o(),"Ignored"),n.set(L(),"Dim");break}case"EO":{n.set(c(),"Ignored"),n.set(g(),"OrientationWithoutPermutation");break}case"EOline":{n.set(c(),"Ignored"),n.set(g(),"OrientationWithoutPermutation"),n.set(l.and(l.moves(["D","M"])),"Regular");break}case"EOcross":{n.set(g(),"OrientationWithoutPermutation"),n.set(l.move("D"),"Regular"),n.set(c(),"Ignored");break}case"CMLL":{n.set(f(),"Dim"),n.set(p(),"Ignored"),n.set(l.and([o(),c()]),"Regular");break}case"L10P":{n.set(l.not(p()),"Dim"),n.set(l.and([c(),o()]),"Regular");break}case"L6E":{n.set(l.not(p()),"Dim");break}case"L6EO":{n.set(l.not(p()),"Dim"),n.set(p(),"OrientationWithoutPermutation"),n.set(l.and([u(),i()]),"OrientationStickers");break}case"Daisy":{n.set(l.all(),"Ignored"),n.set(u(),"Dim"),n.set(l.and([l.move("D"),u()]),"Regular"),n.set(l.and([l.move("U"),g()]),"IgnoreNonPrimary");break}case"Cross":{n.set(l.all(),"Ignored"),n.set(u(),"Dim"),n.set(l.and([l.move("D"),u()]),"Regular"),n.set(l.and([l.move("D"),g()]),"Regular");break}case"2x2x2":{n.set(l.or(l.moves(["U","F","R"])),"Ignored"),n.set(l.and([l.or(l.moves(["U","F","R"])),u()]),"Dim");break}case"2x2x3":{n.set(l.all(),"Dim"),n.set(l.or(l.moves(["U","F","R"])),"Ignored"),n.set(l.and([l.or(l.moves(["U","F","R"])),u()]),"Dim"),n.set(l.and([l.move("F"),l.not(l.or(l.moves(["U","R"])))]),"Regular");break}case"Void Cube":{n.set(u(),"Invisible");break}case"picture":case"invisible":{n.set(l.all(),"Invisible");break}case"centers-only":{n.set(l.not(u()),"Ignored");break}default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(l.and(l.moves([])),"Dim")}return n.toStickeringMask()}async function Zn(){let e=[];for(let[t,r]of Object.entries(Ra))r.groups&&"3x3x3"in r.groups&&e.push(t);return e}var no=F(()=>{"use strict";ro();ha()});function ce(e){let t=null;return()=>t??(t=e())}var At=F(()=>{"use strict"});function Ke(e){return new ar(t=>{t(e())})}var ar,_t=F(()=>{"use strict";ar=class extends Promise{constructor(t){super(r=>{r()}),this._executor=t}static from(t){return new ar(r=>{r(t())})}static resolve(t){return new ar(r=>{r(t)})}static reject(t){return new ar((r,n)=>{n(t)})}then(t,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(t,r)}catch(t){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(t)}}});var Yn,Sf=F(()=>{"use strict";Yn=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 l=0;this.prefixFree&&l<t.length;l++)n!==l&&t[n].startsWith(t[l])&&(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 l=-1;for(let o=0;o<this.facenames.length;o++)t.substr(n).startsWith(this.facenames[o])&&(l<0||this.facenames[o].length>this.facenames[l].length)&&(l=o);if(l>=0)r.push(l),n+=this.facenames[l].length;else throw new Error(\`Could not split \${t} into face names.\`)}return r}joinByFaceIndices(t){let r="",n=[];for(let l=0;l<t.length;l++)n.push(r),n.push(this.facenames[t[l]]),this.prefixFree||(r="_");return n.join("")}spinmatch(t,r){if(t===r)return!0;try{let n=this.splitByFaceNames(t),l=this.splitByFaceNames(r);if(n.length!==l.length&&n.length<3)return!1;for(let o=0;o<n.length;o++){for(let s=0;s<o;s++)if(n[o]===n[s])return!1;let i=!1;for(let s=0;s<l.length;s++)if(n[o]===l[s]){i=!0;break}if(!i)return!1}return!0}catch{return!1}}spinmatchv(t,r){return t.endsWith("v")&&r.endsWith("v")?this.spinmatch(t.slice(0,t.length-1),r.slice(0,r.length-1)):this.spinmatch(t,r)}unswizzle(t){(t.endsWith("v")||t.endsWith("w"))&&t[0]<="Z"&&(t=t.slice(0,t.length-1));let r=t.toUpperCase();for(let n=0;n<this.gripnames.length;n++){let l=this.gripnames[n];if(this.spinmatch(r,l))return l}return t}}});var fn,xf=F(()=>{"use strict";fn=class{notationToInternal(t){return t}notationToExternal(t){return t}}});var lo,vf=F(()=>{"use strict";ae();lo=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 _("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 _("T",t.innerLayer,t.outerLayer),t.amount):this.child.notationToExternal(t)}}});var $n,Uf=F(()=>{"use strict";ae();$n=class{constructor(t,r){this.internalNames=t;this.externalNames=r}convertString(t,r,n){let l="";(t.endsWith("v")||t.endsWith("v"))&&t<="_"&&(l=t.slice(t.length-1),t=t.slice(0,t.length-1));let o=t.toUpperCase(),i=!1;return t!==o&&(i=!0,t=o),t=n.joinByFaceIndices(r.splitByFaceNames(t)),i&&(t=t.toLowerCase()),t+l}convert(t,r,n){let l=t.family,o=this.convertString(l,r,n);return l===o?t:new B(new _(o,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 oo,bf=F(()=>{"use strict";ae();oo=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 _("L",3,2),-2*t.amount);if(t.family==="R--")return new B(new _("L",3,2),2*t.amount);if(t.family==="D++")return new B(new _("U",3,2),-2*t.amount);if(t.family==="D--")return new B(new _("U",3,2),2*t.amount);if(t.family==="R_PLUSPLUS_")return new B(new _("L",3,2),-2*t.amount);if(t.family==="D_PLUSPLUS_")return new B(new _("U",3,2),-2*t.amount)}if(t.family==="y")return new B("Uv",t.amount);if(t.family==="x"&&Math.abs(t.amount)===2)return new B("ERv",t.amount/2)}return this.child.notationToInternal(t)}notationToExternal(t){return t.family==="ERv"&&Math.abs(t.amount)===1?new B(new _("x",t.innerLayer,t.outerLayer),t.amount*2):t.family==="ILv"&&Math.abs(t.amount)===1?new B(new _("x",t.innerLayer,t.outerLayer),-t.amount*2):t.family==="Uv"?new B(new _("y",t.innerLayer,t.outerLayer),t.amount):t.family==="Dv"?new B("y",-t.amount):this.child.notationToExternal(t)}}});var io,Ef=F(()=>{"use strict";ae();io=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 _("D",(this.slices+1)/2),t.amount):r==="M"?t=new B(new _("L",(this.slices+1)/2),t.amount):r==="S"&&(t=new B(new _("F",(this.slices+1)/2),t.amount))),this.slices>2&&(r==="e"?t=new B(new _("D",this.slices-1,2),t.amount):r==="m"?t=new B(new _("L",this.slices-1,2),t.amount):r==="s"&&(t=new B(new _("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 SL,xL,wf,kf,_f,el,so,Cf=F(()=>{"use strict";ae();SL={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"},xL={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"},wf={U:"FRL",L:"FLD",R:"FDR",B:"DLR"},kf=new _("y"),_f=new _("Dv"),el=class{constructor(t){this.child=t;this.wcaHack=!1;this.map=SL}notationToInternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){let n=wf[t.family];if(n)return new B(new _(n,t.innerLayer,t.outerLayer),t.amount)}let r=this.map[t.family];return r?new B(new _(r,t.innerLayer,t.outerLayer),t.amount):kf.isIdentical(t.quantum)?new B(_f,-t.amount):null}notationToExternal(t){if(this.wcaHack&&t.innerLayer===2&&t.outerLayer===null){for(let[r,n]of Object.entries(wf))if(this.child.spinmatch(t.family,n))return new B(new _(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 _(r,t.innerLayer,t.outerLayer),t.amount);return _f.isIdentical(t.quantum)?new B(kf,-t.amount):null}},so=class extends el{constructor(r){super(r);this.wcaHack=!0;this.map=xL}}});var zf,Da,Nf,vL,Fa,Pf,UL,ya,Mf,bL,ao,Of=F(()=>{"use strict";ae();zf={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"},Da=new _("x"),Nf=new _("Rv"),vL=new _("Lv"),Fa=new _("y"),Pf=new _("Uv"),UL=new _("Dv"),ya=new _("z"),Mf=new _("Fv"),bL=new _("Bv"),ao=class{constructor(t){this.child=t}notationToInternal(t){if(t.innerLayer||t.outerLayer)return null;let r=zf[t.family];return r?new B(new _(r,t.outerLayer,t.innerLayer),t.amount):Da.isIdentical(t.quantum)?new B(Nf,t.amount):Fa.isIdentical(t.quantum)?new B(Pf,t.amount):ya.isIdentical(t.quantum)?new B(Mf,t.amount):null}notationToExternal(t){for(let[r,n]of Object.entries(zf))if(this.child.spinmatchv(t.family,n))return new B(new _(r,t.innerLayer,t.outerLayer),t.amount);return Nf.isIdentical(t.quantum)?new B(Da,t.amount):vL.isIdentical(t.quantum)?new B(Da,-t.amount):Pf.isIdentical(t.quantum)?new B(Fa,t.amount):UL.isIdentical(t.quantum)?new B(Fa,-t.amount):Mf.isIdentical(t.quantum)?new B(ya,t.amount):bL.isIdentical(t.quantum)?new B(ya,-t.amount):null}}});var Aa=F(()=>{"use strict";xf();vf();Uf();bf();Ef();Cf();Of()});function If(e){let t=0,r={};for(;t<e.length&&e[t][0]==="-";){let l=e[t++];if(l==="--rotations")r.addRotations=!0;else if(l==="--allmoves")r.allMoves=!0;else if(l==="--outerblockmoves")r.outerBlockMoves=!0;else if(l==="--vertexmoves")r.vertexMoves=!0;else if(l==="--nocorners")r.includeCornerOrbits=!1;else if(l==="--noedges")r.includeEdgeOrbits=!1;else if(l==="--noorientation")r.fixedOrientation=!0;else if(l==="--nocenters")r.includeCenterOrbits=!1;else if(l==="--omit")r.excludeOrbits=e[t].split(","),t++;else if(l==="--moves")r.moveList=e[t].split(","),t++;else if(l==="--optimize")r.optimizeOrbits=!0;else if(l==="--scramble")r.scrambleAmount=100;else if(l==="--fixcorner")r.fixedPieceType="v";else if(l==="--fixedge")r.fixedPieceType="e";else if(l==="--fixcenter")r.fixedPieceType="f";else if(l==="--orientcenters")r.orientCenters=!0;else if(l==="--puzzleorientation")r.puzzleOrientation=JSON.parse(e[t]),t++;else throw new Error(\`Bad option: \${l}\`)}return{puzzleDescription:fo(e.slice(t).join(" ")),options:r}}var ui,Sa=F(()=>{"use strict";uo();ui=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 br(e){if(!xa[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=0;xa[e]=t}return xa[e]}function Vt(e){if(!va[e]){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;va[e]=t}return va[e]}function Tf(e){return new dt(Vt(e))}function Gf(e){let t=BigInt(1);for(;e>1;)t*=BigInt(e),e--;return t}function EL(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 Ua(e,t){return e/EL(e,t)*t}var xa,va,dt,gi=F(()=>{"use strict";xa=[],va=[];dt=class{constructor(t){this.n=t.length,this.p=t}toString(){return\`Perm[\${this.p.join(" ")}]\`}mul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=t.p[this.p[n]];return new dt(r)}rmul(t){let r=Array(this.n);for(let n=0;n<this.n;n++)r[n]=this.p[t.p[n]];return new dt(r)}inv(){let t=Array(this.n);for(let r=0;r<this.n;r++)t[this.p[r]]=r;return new dt(t)}compareTo(t){for(let r=0;r<this.n;r++)if(this.p[r]!==t.p[r])return this.p[r]-t.p[r];return 0}toGap(){let t=new Array,r=new Array(this.n);for(let n=0;n<this.p.length;n++){if(r[n]||this.p[n]===n)continue;let l=new Array;for(let o=n;!r[o];o=this.p[o])l.push(1+o),r[o]=!0;t.push(\`(\${l.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 l=0;for(let o=n;!r[o];o=this.p[o])l++,r[o]=!0;t=Ua(t,l)}return t}}});function ci(e,t){let r=B.fromString(t),n=e.notationToExternal(r);return n===null||r===n?t:n.toString()}function Wf(e,t){let r=e.moveops.length;if(r>30)throw new Error("Canon info too big for bitmask");let n=[],l=[];for(let i=0;i<r;i++){let s=e.moveops[i];n.push(s.order());let a=0;for(let f=0;f<r;f++){if(f===i)continue;let u=e.moveops[f];s.mul(u).equal(u.mul(s))&&(a|=1<<f)}l.push(a)}let o={};o[0]=1;for(let i=0;i<100;i++){let s=0,a={},f=0;for(let u in o){let g=+u,c=o[g];s+=c,f++;for(let p=0;p<n.length;p++)if((g>>p&1)===0&&(g&l[p]&(1<<p)-1)===0){let L=g&l[p]|1<<p;a[L]===void 0&&(a[L]=0),a[L]+=(n[p]-1)*c}}t(\`\${i}: canonseq \${s} states \${f}\`),o=a}}var tl,wL,un,Ct,Ht,pi,fr,gn,mi,Kf=F(()=>{"use strict";ae();Aa();gi();tl=class{constructor(t,r){this.size=t;this.mod=r}reassemblySize(){return Gf(this.size)*BigInt(this.mod)**BigInt(this.size)}},wL=0;un=class{constructor(t,r,n,l,o,i,s){this.orbitnames=t;this.orbitdefs=r;this.solved=n;this.movenames=l;this.moveops=o;this.isRotation=i;this.forcenames=s}transformToKTransformationData(t){let r={};for(let n=0;n<this.orbitnames.length;n++)r[this.orbitnames[n]]=t.orbits[n].toKPuzzle();return r}static transformToKTransformationData(t,r){let n={};for(let l=0;l<t.length;l++)n[t[l]]=r.orbits[l].toKPuzzle();return n}describeSet(t,r,n){let l=this.orbitdefs[t].size,o=new Array(l);for(let i=0;i<l;i++)o[i]=[];for(let i=0;i<this.movenames.length;i++){if(this.isRotation[i])continue;let s=this.movenames[i];this.forcenames[i]||(s=ci(n,s),s[s.length-1]==="'"&&(s=s.substring(0,s.length-1)));let a=this.moveops[i].orbits[t];for(let f=0;f<l;f++)(a.perm[f]!==f||a.ori[f]!==0)&&o[f].push(s)}for(let i=0;i<l;i++)r.push(\`# \${i+1} \${o[i].join(" ")}\`)}toKsolve(t,r=new fn){let n=[];n.push(\`Name \${t}\`),n.push("");for(let l=0;l<this.orbitnames.length;l++)n.push(\`Set \${this.orbitnames[l]} \${this.orbitdefs[l].size} \${this.orbitdefs[l].mod}\`),this.describeSet(l,n,r);n.push(""),n.push("Solved");for(let l=0;l<this.orbitnames.length;l++)this.solved.orbits[l].appendDefinition(n,this.orbitnames[l],!1,!1);n.push("End");for(let l=0;l<this.movenames.length;l++){n.push("");let o=this.movenames[l];this.forcenames[l]||(o=ci(r,this.movenames[l]));let i=!1;o[o.length-1]==="'"&&(i=!0,o=o.substring(0,o.length-1)),n.push(\`Move \${o}\`);for(let s=0;s<this.orbitnames.length;s++)i?this.moveops[l].orbits[s].inv().appendDefinition(n,this.orbitnames[s],!0):this.moveops[l].orbits[s].appendDefinition(n,this.orbitnames[s],!0);n.push("End")}return n}toKPuzzleDefinition(t){let r={},n={};for(let o=0;o<this.orbitnames.length;o++){r[this.orbitnames[o]]={numPieces:this.orbitdefs[o].size,numOrientations:this.orbitdefs[o].mod};let i=this.solved.orbits[o].toKPuzzle();n[this.orbitnames[o]]={pieces:i.permutation,orientation:i.orientation}}let l={};if(t)for(let o=0;o<this.movenames.length;o++)l[this.movenames[o]]=this.transformToKTransformationData(this.moveops[o]);return{name:\`PG3D #\${++wL}\`,orbits:r,startStateData:n,moves:l}}optimize(){let t=[],r=[],n=[],l=[];for(let o=0;o<this.moveops.length;o++)l.push([]);for(let o=0;o<this.orbitdefs.length;o++){let i=this.orbitdefs[o].mod,s=this.orbitdefs[o].size,a=new mi(s),f=new Array(this.orbitdefs[o].size);for(let p=0;p<s;p++)f[p]=!1;for(let p=0;p<this.moveops.length;p++)if(!this.isRotation[p])for(let L=0;L<s;L++)(this.moveops[p].orbits[o].perm[L]!==L||this.moveops[p].orbits[o].ori[L]!==0)&&(f[L]=!0,a.union(L,this.moveops[p].orbits[o].perm[L]));let u=!0;if(i>1){u=!1;let p=new mi(this.orbitdefs[o].size*i);for(let L=0;L<this.moveops.length;L++)for(let m=0;m<s;m++)if(this.moveops[L].orbits[o].perm[m]!==m||this.moveops[L].orbits[o].ori[m]!==0)for(let d=0;d<i;d++)p.union(m*i+d,this.moveops[L].orbits[o].perm[m]*i+(d+this.moveops[L].orbits[o].ori[m])%i);for(let L=0;!u&&L<s;L++)for(let m=1;m<i;m++)p.find(L*i)===p.find(L*i+m)&&(u=!0);for(let L=0;!u&&L<s;L++)for(let m=0;m<L;m++)this.solved.orbits[o].perm[L]===this.solved.orbits[o].perm[m]&&(u=!0)}let g=-1,c=!1;for(let p=0;p<this.orbitdefs[o].size;p++)if(f[p]){let L=a.find(p);g<0?g=L:g!==L&&(c=!0)}for(let p=0;p<this.orbitdefs[o].size;p++){if(!f[p]||a.find(p)!==p)continue;let m=[],d=[],D=0;for(let y=0;y<this.orbitdefs[o].size;y++)a.find(y)===p&&(m[D]=y,d[y]=D,D++);if(c?t.push(\`\${this.orbitnames[o]}_p\${p}\`):t.push(this.orbitnames[o]),u){r.push(new tl(D,this.orbitdefs[o].mod)),n.push(this.solved.orbits[o].remapVS(m,D));for(let y=0;y<this.moveops.length;y++)l[y].push(this.moveops[y].orbits[o].remap(m,d,D))}else{r.push(new tl(D,1)),n.push(this.solved.orbits[o].remapVS(m,D).killOri());for(let y=0;y<this.moveops.length;y++)l[y].push(this.moveops[y].orbits[o].remap(m,d,D).killOri())}}}return new un(t,r,new gn(n),this.movenames,l.map(o=>new fr(o)),this.isRotation,this.forcenames)}scramble(t){this.solved=this.solved.mul(this.getScrambleTransformation(t))}getScrambleTransformation(t){t<100&&(t=100);let r=[];for(let l=0;l<this.moveops.length;l++)r[l]=this.moveops[l];for(let l=0;l<r.length;l++){let o=Math.floor(Math.random()*r.length),i=r[l];r[l]=r[o],r[o]=i}t<r.length&&(t=r.length);for(let l=0;l<t;l++){let o=Math.floor(Math.random()*r.length),i=Math.floor(Math.random()*r.length),s=Math.floor(Math.random()*this.moveops.length);r[o]=r[o].mul(r[i]).mul(this.moveops[s]),Math.random()<.1&&(r[o]=r[o].mul(this.moveops[s]))}let n=r[0];for(let l=1;l<r.length;l++)n=n.mul(r[l]);return n}reassemblySize(){let t=BigInt(1);for(let r=0;r<this.orbitdefs.length;r++)t*=this.orbitdefs[r].reassemblySize();return t}},Ct=class{constructor(t,r,n){this.perm=t;this.ori=r;this.orimod=n}static e(t,r){return new Ct(Vt(t),br(t),r)}mul(t){let r=this.perm.length,n=new Array(r);if(this.orimod===1){for(let l=0;l<r;l++)n[l]=this.perm[t.perm[l]];return new Ct(n,this.ori,this.orimod)}else{let l=new Array(r);for(let o=0;o<r;o++)n[o]=this.perm[t.perm[o]],l[o]=(this.ori[t.perm[o]]+t.ori[o])%this.orimod;return new Ct(n,l,this.orimod)}}inv(){let t=this.perm.length,r=new Array(t),n=new Array(t);for(let l=0;l<t;l++)r[this.perm[l]]=l,n[this.perm[l]]=(this.orimod-this.ori[l])%this.orimod;return new Ct(r,n,this.orimod)}equal(t){let r=this.perm.length;for(let n=0;n<r;n++)if(this.perm[n]!==t.perm[n]||this.ori[n]!==t.ori[n])return!1;return!0}killOri(){let t=this.perm.length;for(let r=0;r<t;r++)this.ori[r]=0;return this.orimod=1,this}toPerm(){let t=this.orimod;if(t===1)return new dt(this.perm);let r=this.perm.length,n=new Array(r*t);for(let l=0;l<r;l++)for(let o=0;o<t;o++)n[l*t+o]=t*this.perm[l]+(this.ori[l]+o)%t;return new dt(n)}identicalPieces(){let t=[],r=this.perm.length,n=[];for(let l=0;l<r;l++){let o=this.perm[l];if(t[o]===void 0){let i=[l];t[o]=!0;for(let s=l+1;s<r;s++)this.perm[s]===o&&i.push(s);n.push(i)}}return n}order(){return this.toPerm().order()}isIdentity(){let t=this.perm.length;if(this.perm===Vt(t)&&this.ori===br(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===br(t))return!0;for(let r=0;r<t;r++)if(this.ori[r]!==0)return!1;return!0}remap(t,r,n){let l=new Array(n),o=new Array(n);for(let i=0;i<n;i++)l[i]=r[this.perm[t[i]]],o[i]=this.ori[t[i]];return new Ct(l,o,this.orimod)}remapVS(t,r){let n=new Array(r),l=new Array(r),o=0,i=[];for(let s=0;s<r;s++){let a=this.perm[t[s]];i[a]===void 0&&(i[a]=o++),n[s]=i[a],l[s]=this.ori[t[s]]}return new Ct(n,l,this.orimod)}appendDefinition(t,r,n,l=!0){if(!(l&&this.isIdentity())&&(t.push(r),t.push(this.perm.map(o=>o+1).join(" ")),!this.zeroOris()))if(n){let o=new Array(this.ori.length);for(let i=0;i<o.length;i++)o[this.perm[i]]=this.ori[i];t.push(o.join(" "))}else t.push(this.ori.join(" "))}toKPuzzle(){let t=this.perm.length;return this.isIdentity()?(Ct.kcache[t]||(Ct.kcache[t]={permutation:Vt(t),orientation:br(t)}),Ct.kcache[t]):{permutation:this.perm,orientation:this.ori}}},Ht=Ct;Ht.kcache=[];pi=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 l of this.orbits){let o=l.toPerm();t.push(o),r+=o.n}let n=new Array(r);r=0;for(let l of t){for(let o=0;o<l.n;o++)n[r+o]=r+l.p[o];r+=l.n}return new dt(n)}identicalPieces(){let t=[],r=0;for(let n of this.orbits){let l=n.orimod,o=n.identicalPieces();for(let i=0;i<o.length;i++)t.push(o[i].map(s=>s*l+r));r+=l*n.perm.length}return t}order(){let t=1;for(let r of this.orbits)t=Ua(t,r.order());return t}},fr=class extends pi{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,l=this.e();for(;t>0;)t&1&&(l=l.mul(n)),t>1&&(n=n.mul(n)),t>>=1;return l}inv(){return new fr(this.internalInv())}e(){return new fr(this.orbits.map(t=>Ht.e(t.perm.length,t.orimod)))}},gn=class extends pi{constructor(t){super(t)}mul(t){return new gn(this.internalMul(t))}},mi=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),l=this.find(r);n<l?this.heads[l]=n:n>l&&(this.heads[n]=l)}}});var Li,Qf=F(()=>{"use strict";Li={"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 Bi(e){let t=new W(0,0,0,0);for(let r=0;r<e.length;r++)t=t.sum(e[r]);return t.smul(1/e.length)}function jf(e,t,r,n){let l=n[e].intersect3(n[t],n[r]);if(!l)return l;for(let o=0;o<n.length;o++)if(o!==e&&o!==t&&o!==r){let i=n[o].b*l.b+n[o].c*l.c+n[o].d*l.d;if(n[o].a>0&&i>n[o].a||n[o].a<0&&i<n[o].a)return!1}return l}var W,di=F(()=>{"use strict";W=class{constructor(t,r,n,l){this.a=t;this.b=r;this.c=n;this.d=l}mul(t){return new W(this.a*t.a-this.b*t.b-this.c*t.c-this.d*t.d,this.a*t.b+this.b*t.a+this.c*t.d-this.d*t.c,this.a*t.c-this.b*t.d+this.c*t.a+this.d*t.b,this.a*t.d+this.b*t.c-this.c*t.b+this.d*t.a)}toString(){return\`Q[\${this.a},\${this.b},\${this.c},\${this.d}]\`}dist(t){return Math.hypot(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}len(){return Math.hypot(this.a,this.b,this.c,this.d)}cross(t){return new W(0,this.c*t.d-this.d*t.c,this.d*t.b-this.b*t.d,this.b*t.c-this.c*t.b)}dot(t){return this.b*t.b+this.c*t.c+this.d*t.d}normalize(){let t=Math.sqrt(this.dot(this));return new W(this.a/t,this.b/t,this.c/t,this.d/t)}makenormal(){return new W(0,this.b,this.c,this.d).normalize()}normalizeplane(){let t=Math.hypot(this.b,this.c,this.d);return new W(this.a/t,this.b/t,this.c/t,this.d/t)}smul(t){return new W(this.a*t,this.b*t,this.c*t,this.d*t)}sum(t){return new W(this.a+t.a,this.b+t.b,this.c+t.c,this.d+t.d)}sub(t){return new W(this.a-t.a,this.b-t.b,this.c-t.c,this.d-t.d)}angle(){return 2*Math.acos(this.a)}invrot(){return new W(this.a,-this.b,-this.c,-this.d)}det3x3(t,r,n,l,o,i,s,a,f){return t*(o*f-i*a)+r*(i*s-l*f)+n*(l*a-o*s)}rotateplane(t){let r=t.mul(new W(0,this.b,this.c,this.d)).mul(t.invrot());return r.a=this.a,r}orthogonal(){let t=Math.abs(this.b),r=Math.abs(this.c),n=Math.abs(this.d);return t<r&&t<n?this.cross(new W(0,1,0,0)).normalize():r<t&&r<n?this.cross(new W(0,0,1,0)).normalize():this.cross(new W(0,0,0,1)).normalize()}pointrotation(t){let r=this.normalize();if(t=t.normalize(),r.sub(t).len()<1e-9)return new W(1,0,0,0);let n=r.sum(t);n.len()<1e-9?n=n.orthogonal():n=n.normalize();let l=r.cross(n);return l.a=r.dot(n),l}unproject(t){return this.sum(t.smul(-this.dot(t)/(this.len()*t.len())))}rotatepoint(t){return t.mul(this).mul(t.invrot())}rotateface(t){return t.map(r=>r.rotatepoint(this))}intersect3(t,r){let n=this.det3x3(this.b,this.c,this.d,t.b,t.c,t.d,r.b,r.c,r.d);return Math.abs(n)<1e-9?!1:new W(0,this.det3x3(this.a,this.c,this.d,t.a,t.c,t.d,r.a,r.c,r.d)/n,this.det3x3(this.b,this.a,this.d,t.b,t.a,t.d,r.b,r.a,r.d)/n,this.det3x3(this.b,this.c,this.a,t.b,t.c,t.a,r.b,r.c,r.a)/n)}side(t){return t>1e-9?1:t<-1e-9?-1:0}cutface(t){let r=this.a,n=0,l=null;for(let o=0;o<t.length;o++)n|=1<<this.side(t[o].dot(this)-r)+1;if((n&5)===5){l=[];let o=t.map(i=>this.side(i.dot(this)-r));for(let i=-1;i<=1;i+=2){let s=[];for(let a=0;a<t.length;a++){(o[a]===i||o[a]===0)&&s.push(t[a]);let f=(a+1)%t.length;if(o[a]+o[f]===0&&o[a]!==0){let u=t[a].dot(this)-r,g=t[f].dot(this)-r,c=u/(u-g),p=t[a].smul(1-c).sum(t[f].smul(c));s.push(p)}}l.push(s)}}return l}cutfaces(t){let r=[];for(let n=0;n<t.length;n++){let l=t[n],o=this.cutface(l);o?(r.push(o[0]),r.push(o[1])):r.push(l)}return r}faceside(t){let r=this.a;for(let n=0;n<t.length;n++){let l=this.side(t[n].dot(this)-r);if(l!==0)return l}throw new Error("Could not determine side of plane in faceside")}sameplane(t){let r=this.normalize(),n=t.normalize();return r.dist(n)<1e-9||r.dist(n.smul(-1))<1e-9}makecut(t){return new W(t,this.b,this.c,this.d)}}});function qf(){let e=Math.sqrt(.5);return[new W(e,e,0,0),new W(e,0,e,0)]}function Vf(){return[new W(.5,.5,.5,.5),new W(.5,.5,.5,-.5)]}function Hf(){let e=2*Math.PI/10,t=.5+.3*Math.sqrt(5),r=.5+.1*Math.sqrt(5),n=Math.sqrt(t*t+r*r);return t/=n,r/=n,[new W(Math.cos(e),t*Math.sin(e),r*Math.sin(e),0),new W(.5,.5,.5,.5)]}function Xf(){let e=.16666666666666666+Math.sqrt(5)/6,t=2/3+Math.sqrt(5)/3,r=Math.sqrt(e*e+t*t);e/=r,t/=r;let n=2*Math.PI/6;return[new W(Math.cos(n),e*Math.sin(n),t*Math.sin(n),0),new W(Math.cos(n),-e*Math.sin(n),t*Math.sin(n),0)]}function Jf(){let e=Math.sqrt(.5);return[new W(.5,.5,.5,.5),new W(e,0,0,e)]}function Zf(e){let t=[new W(1,0,0,0)];for(let r=0;r<t.length;r++)for(let n=0;n<e.length;n++){let l=e[n].mul(t[r]),o=l.smul(-1),i=!1;for(let s=0;s<t.length;s++)if(l.dist(t[s])<Ri||o.dist(t[s])<Ri){i=!0;break}i||t.push(l)}return t}function ba(e,t){let r=[],n=[];for(let l=0;l<t.length;l++){let o=e.rotateplane(t[l]),i=!1;for(let s=0;s<r.length;s++)if(o.dist(r[s])<Ri){i=!0;break}i||(r.push(o),n.push(t[l]))}return n}function Ea(e){let t=[];for(let r=1;r<e.length;r++)for(let n=r+1;n<e.length;n++){let l=jf(0,r,n,e);if(l){let o=!1;for(let i=0;i<t.length;i++)if(l.dist(t[i])<Ri){o=!0;break}o||t.push(l)}}for(;;){let r=!1;for(let n=0;n<t.length;n++){let l=(n+1)%t.length;if(e[0].dot(t[n].cross(t[l]))<0){let o=t[n];t[n]=t[l],t[l]=o,r=!0}}if(!r)break}return t}var Ri,Yf=F(()=>{"use strict";di();Ri=1e-9});function hi(e,t){let r=e[0].p.length,n=Tf(r),l=[],o=[],i=[],s=[],a=[];function f(p){for(let L=p.p.length-1;L>=0;L--){let m=p.p[L];if(m!==L){if(!l[L][m])return!1;p=p.mul(o[L][m])}}return!0}function u(p,L,m){s[p].push(L),a[p].push(m);for(let d=0;d<l[p].length;d++)l[p][d]&&g(p,l[p][d].mul(L),m+i[p][d])}function g(p,L,m){let d=L.p[p];if(!l[p][d]){l[p][d]=L,o[p][d]=L.inv(),i[p][d]=m;for(let y=0;y<s[p].length;y++)g(p,L.mul(s[p][y]),m+a[p][y]);return}let D=L.mul(o[p][d]);f(D)||u(p-1,D,m+i[p][d])}function c(){l=[],o=[],s=[],i=[],a=[];for(let m=0;m<r;m++)l.push([]),o.push([]),i.push([]),s.push([]),a.push([]),l[m][m]=n,o[m][m]=n,i[m][m]=0;let p=0,L=BigInt(1);for(let m=0;m<e.length;m++){u(r-1,e[m],1),L=BigInt(1);let d=0,D=0,y=[],S=new wa;for(let v=0;v<r;v++){let U=0,P=0;for(let z=0;z<r;z++)l[v][z]&&(U++,P+=i[v][z],v!==z&&p++);d+=s[v].length,L*=BigInt(U),U>1&&S.multiply(U);let J=P/U;y.push(J),D+=J}t(\`\${m}: sz \${L} T \${d} sol \${D} none \${p} mults \${S.toString()}\`)}return L}return c()}var wa,ka=F(()=>{"use strict";gi();wa=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 kL(e,t){let r=[];for(let n of e)for(let l of t)r.push(l.rotate(n));return r}function zL(){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 NL(){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 ML(){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 Di(e,t){for(let r=0;r<e.length;r++)if(e[r][0].dist(t)<Ue)return r;throw new Error("Element not found")}function $f(){return Li}function e1(e){return Li[e]}function fo(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 l=1;l<t.length;l+=2){if(t[l]!=="f"&&t[l]!=="v"&&t[l]!=="e")return null;n.push({cutType:t[l],distance:parseFloat(t[l+1])})}return{shape:r,cuts:n}}function Ca(e,t={}){let r=fo(e);if(r===null)throw new Error("Could not parse the puzzle description");let n=new go(r,Object.assign({},{allMoves:!0},t));return n.allstickers(),n.genperms(),n}function n1(e,t){return Ca(Li[e],t)}function OL(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 l=e[0],o="";if(t[0]===0&&t[1]===r)l=\`\${l}v\`;else if(t[0]===t[1])t[1]>0&&(o=String(t[1]+1));else if(t[0]===0)l=l.toLowerCase(),t[1]>1&&(o=String(t[1]+1));else throw new Error(\`We only support slice and outer block moves right now. \${t}\`);return[o+l,n]}function IL(e,t){let r=[],n=0;for(;n<e.length;){n>0&&n<e.length&&e[n]==="_"&&n++;let l="";for(let o of t)e.substr(n).startsWith(o[1])&&o[1].length>l.length&&(l=o[1]);if(l!=="")r.push(l),n+=l.length;else throw new Error(\`Could not split \${e} into face names.\`)}return r}function Fi(e,t){return[e.b/t,-e.c/t,e.d/t]}function _a(e,t){let r=[],n=e.length;for(let l=0;l<n;l++){let o=Fi(e.get(n-l-1),t);r[3*l]=o[0],r[3*l+1]=o[1],r[3*l+2]=o[2]}return r}var Er,rl,Ue,_L,CL,PL,t1,r1,go,yi,uo=F(()=>{"use strict";ae();Sf();Aa();Sa();gi();Kf();Qf();Yf();di();ka();Er=class{constructor(t){this.coords=new Array(t.length*3);for(let r=0;r<t.length;r++)this.coords[3*r]=t[r].b,this.coords[3*r+1]=t[r].c,this.coords[3*r+2]=t[r].d;this.length=t.length}get(t){return new W(0,this.coords[3*t],this.coords[3*t+1],this.coords[3*t+2])}centermass(){let t=0,r=0,n=0;for(let l=0;l<this.length;l++)t+=this.coords[3*l],r+=this.coords[3*l+1],n+=this.coords[3*l+2];return new W(0,t/this.length,r/this.length,n/this.length)}rotate(t){let r=[];for(let n=0;n<this.length;n++)r.push(this.get(n).rotatepoint(t));return new Er(r)}rotateforward(){let t=[];for(let r=1;r<this.length;r++)t.push(this.get(r));return t.push(this.get(0)),new Er(t)}},rl=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 rl(r[0]),this.right=new rl(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 Er(this.face)):r?(this.left?.collect(t,!1),this.right?.collect(t,!0)):(this.right?.collect(t,!1),this.left?.collect(t,!0)),t}};Ue=1e-9,_L="PuzzleGeometry 0.1 Copyright 2018 Tomas Rokicki.",CL=!1;PL={4:{v:["DFR","DLF","DRL","FLR"],e:["FR","LF","DF","DL","RD","RL"],c:["DF","FD","RL","LR"]},6:{v:["URF","UBR","ULB","UFL","DFR","DRB","DBL","DLF"],e:["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],c:["UB","LU","FU","RU","BU","DF"]},8:{v:["UBBBRR","URFL","ULBLBB","DBRBBBL","DBLLF","DFRBR"],e:["UL","UBB","UR","BRD","BLD","FD","BRR","FR","FL","BLL","BLBB","BRBB"],c:["BBU","LU","RU","BRD","FD","BLD","DF","UBB"]},12:{v:["URF","UFL","ULBL","UBLBR","UBRR","DEBF","DBFI","DIA","DAC","DCE","LAI","ALF","FCA","CFR","REC","ERBR","BRBFE","BFBRBL","BLIBF","IBLL"],e:["UF","UR","UBR","UBL","UL","ER","EBR","EBF","ED","EC","IBF","IBL","IL","IA","ID","AC","CF","FA","BFBR","BRBL","BLBF","CD","AD","AL","FL","FR","CR","BFD","BRR","BLL"],c:["UF","FU","DBF","BFD","AD","CD","BRU","BLU","LA","RA","EBR","IBL"]},20:{v:["FLPQU","FUGER","FRCAL","HCREI","ISBDH","JSIEG","BSJMK","MQPOK","ONDBK","NOPLA","UQMJG","DNACH"],e:["FU","FL","FR","EG","ER","EI","SJ","SI","SB","KM","KB","KO","PQ","PO","PL","UG","JG","MQ","UQ","HC","HD","ND","NA","JM","CA","AL","CR","HI","DB","NO"],c:["FU","UF","GE","EG","JS","SJ","MK","KM","QP","PQ","LA","AL","RC","CR","IH","HI","BD","DB","ON","NO"]}};t1=["c","t","o","d","i"],r1=["f","v","e"];go=class{constructor(t,r){this.puzzleDescription=t;this.cmovesbyslice=[];this.duplicatedFaces=[];this.duplicatedCubies=[];this.fixedCubie=-1;this.net=[];this.colors=[];this.notationMapper=new fn;this.addNotationMapper="";this.setReidOrder=!1;let n="genperms";this.options=new ui(r),this.options.verbosity>0&&console.log(this.header("# ")),this.create(t)}create(t){let{shape:r,cuts:n}=t;this.moveplanes=[],this.moveplanes2=[],this.faces=[],this.cubies=[];let l=null;switch(r){case"c":{l=qf();break}case"o":{l=Jf();break}case"i":{l=Xf();break}case"t":{l=Vf();break}case"d":{l=Hf();break}default:throw new Error(\`Bad shape argument: \${r}\`)}this.rotations=Zf(l),this.options.verbosity&&console.log(\`# Rotations: \${this.rotations.length}\`);let o=l[0];this.baseplanerot=ba(o,this.rotations);let i=this.baseplanerot.map(A=>o.rotateplane(A));this.baseplanes=i,this.baseFaceCount=i.length;let s=zL()[i.length];this.net=s,this.colors=NL()[i.length],this.options.verbosity>0&&console.log(\`# Base planes: \${i.length}\`);let a=Ea(i),f=new W(0,0,0,0);this.options.verbosity>0&&console.log(\`# Face vertices: \${a.length}\`);let u=i[0].makenormal(),g=a[0].sum(a[1]).makenormal(),c=a[0].makenormal(),p=new W(1,u.b,u.c,u.d);this.options.verbosity>0&&console.log(\`# Boundary is \${p}\`);let m=ba(p,this.rotations).map(A=>p.rotateplane(A)),d=Ea(m);this.edgedistance=d[0].sum(d[1]).smul(.5).dist(f),this.vertexdistance=d[0].dist(f);let D=[],y=[],S=!1,v=!1,U=!1;for(let A of n){let k=null,T=0;switch(A.cutType){case"f":{k=u,T=1,S=!0;break}case"v":{k=c,T=this.vertexdistance,U=!0;break}case"e":{k=g,T=this.edgedistance,v=!0;break}default:throw new Error(\`Bad cut argument: \${A.cutType}\`)}D.push(k.makecut(A.distance)),y.push(A.distance<T)}this.options.addRotations&&(S||D.push(u.makecut(10)),U||D.push(c.makecut(10)),v||D.push(g.makecut(10))),this.basefaces=[];for(let A of this.baseplanerot){let k=A.rotateface(d);this.basefaces.push(new Er(k))}let P=[],J=[],z=[],Q=[],x=d.length;function C(A,k,T){for(let O of A)if(O[0].dist(k)<Ue){O.push(T);return}A.push([k,T])}for(let A=0;A<this.baseplanerot.length;A++){let k=this.baseplanerot[A].rotateface(d);for(let T=0;T<k.length;T++){let O=(T+1)%k.length,ee=k[T].sum(k[O]).smul(.5);C(Q,ee,A)}}let N=[];for(let A=0;A<this.baseplanerot.length;A++){let k=this.baseplanerot[A].rotateface(d),T=[];for(let O=0;O<k.length;O++){let ee=(O+1)%k.length,se=k[O].sum(k[ee]).smul(.5),Ie=Q[Di(Q,se)];if(A===Ie[1])T.push(Ie[2]);else if(A===Ie[2])T.push(Ie[1]);else throw new Error("Could not find edge")}N.push(T)}let b={},w=[];w.push(s[0][0]),b[s[0][0]]=0,w[N[0][0]]=s[0][1],b[s[0][1]]=N[0][0];for(let A of s){let k=A[0],T=b[k];if(T===void 0)throw new Error("Bad edge description; first edge not connected");let O=-1;for(let ee=0;ee<N[T].length;ee++){let se=w[N[T][ee]];if(se!==void 0&&se===A[1]){O=ee;break}}if(O<0)throw new Error("First element of a net not known");for(let ee=2;ee<A.length;ee++){if(A[ee]==="")continue;let se=N[T][(ee+O-1)%x],Ie=w[se];if(Ie!==void 0&&Ie!==A[ee])throw new Error("Face mismatch in net");w[se]=A[ee],b[A[ee]]=se}}for(let A=0;A<this.baseplanerot.length;A++){let k=this.baseplanerot[A].rotateface(d),T=p.rotateplane(this.baseplanerot[A]),O=w[A];P.push([k,O]),J.push([T,O])}for(let A=0;A<this.baseplanerot.length;A++){let k=this.baseplanerot[A].rotateface(d),T=w[A];for(let O=0;O<k.length;O++){let ee=(O+1)%k.length,se=k[O].sum(k[ee]).smul(.5),Ie=(O+2)%k.length,Km=k[ee].sum(k[Ie]).smul(.5),Qm=Di(Q,se),jm=Di(Q,Km);C(z,k[ee],[T,jm,Qm])}}this.swizzler=new Yn(P.map(A=>A[1]));let M=this.swizzler.prefixFree?"":"_",j=PL[this.baseFaceCount],q=[];for(let A=0;A<this.baseFaceCount;A++)q[1<<A]=A;{let A=j.v;for(let k of A){let T=this.swizzler.splitByFaceNames(k),O=0;for(let ee of T)O|=1<<ee;q[O]=T[0]}}{let A=j.e;for(let k of A){let T=this.swizzler.splitByFaceNames(k),O=0;for(let ee of T)O|=1<<ee;q[O]=T[0]}}{let A=j.c;for(let k of A){let T=this.swizzler.splitByFaceNames(k),O=1<<T[0]|1<<this.baseFaceCount;q[O]=T[1]}}for(let A=0;A<Q.length;A++){if(Q[A].length!==3)throw new Error(\`Bad length in edge names \${Q[A]}\`);let k=Q[A][1],T=Q[A][2],O=w[k],ee=w[T],se=1<<k|1<<T;q[se]===k?O=O+M+ee:O=ee+M+O,Q[A]=[Q[A][0],O]}for(let A=0;A<z.length;A++){let k=0;if(z[A].length<4)throw new Error("Bad length in vertex names");for(let se=1;se<z[A].length;se++)k|=1<<b[z[A][se][0]];let T=q[k],O=-1;for(let se=1;se<z[A].length;se++)T===b[z[A][se][0]]&&(O=se);if(O<0)throw new Error("Internal error; couldn't find face name when fixing corners");let ee="";for(let se=1;se<z[A].length;se++){se===1?ee=z[A][O][0]:ee=ee+M+z[A][O][0];for(let Ie=1;Ie<z[A].length;Ie++)if(z[A][O][1]===z[A][Ie][2]){O=Ie;break}}z[A]=[z[A][0],ee]}this.markedface=q,this.options.verbosity>1&&(console.log(\`# Face names: \${P.map(A=>A[1]).join(" ")}\`),console.log(\`# Edge names: \${Q.map(A=>A[1]).join(" ")}\`),console.log(\`# Vertex names: \${z.map(A=>A[1]).join(" ")}\`));let ie=[];for(let A of J)ie.push([A[0].makenormal(),A[1],"f"]);for(let A of Q)ie.push([A[0].makenormal(),A[1],"e"]);for(let A of z)ie.push([A[0].makenormal(),A[1],"v"]);this.facenames=P,this.faceplanes=J,this.edgenames=Q,this.vertexnames=z,this.geonormals=ie;let he=ie.map(A=>A[1]);this.swizzler.setGripNames(he),this.options.verbosity>0&&console.log(\`# Distances: face \${1} edge \${this.edgedistance} vertex \${this.vertexdistance}\`);for(let A=0;A<D.length;A++)for(let k of this.rotations){let T=D[A].rotateplane(k),O=!1;for(let ee of this.moveplanes)if(T.sameplane(ee)){O=!0;break}O||(this.moveplanes.push(T),y[A]&&this.moveplanes2.push(T))}let ve=new rl(d),Ye=this.moveplanes2.slice(),Et=31;for(let A=0;A<Ye.length;A++){let k=A+Math.floor((Ye.length-A)*(Et/65536));ve=ve.split(Ye[k]),Ye[k]=Ye[A],Et=(Et*1657+101)%65536}let de=ve.collect([],!0);this.faces=de,this.options.verbosity>0&&console.log(\`# Faces is now \${de.length}\`),this.stickersperface=de.length;let Dt=[],it=Bi(d);for(let A of this.rotations){let k=A.rotateface(d);it.dist(Bi(k))<Ue&&Dt.push(A)}let mt=new Array(de.length),ze=[];for(let A=0;A<de.length;A++){let k=de[A].centermass();ze.push([it.dist(k),k,A])}ze.sort((A,k)=>A[0]-k[0]);for(let A=0;A<de.length;A++){let k=ze[A][2];if(!mt[k]){mt[k]=!0;for(let T of Dt){let O=de[k].rotate(T),ee=O.centermass();for(let se=A+1;se<de.length&&!(ze[se][0]-ze[A][0]>Ue);se++){let Ie=ze[se][2];if(!mt[Ie]&&ee.dist(ze[se][1])<Ue){mt[Ie]=!0,de[Ie]=O;break}}}}}this.shortedge=1e99;for(let A of de)for(let k=0;k<A.length;k++){let T=(k+1)%A.length,O=A.get(k).dist(A.get(T));O<this.shortedge&&(this.shortedge=O)}this.options.verbosity>0&&console.log(\`# Short edge is \${this.shortedge}\`),r==="c"&&S&&!v&&!U&&(this.addNotationMapper="NxNxNCubeMapper",this.setReidOrder=!0),r==="c"&&U&&!S&&!v&&(this.addNotationMapper="SkewbMapper"),r==="t"&&(U||S)&&!v&&(this.addNotationMapper="PyraminxOrTetraminxMapper"),r==="o"&&S&&(this.notationMapper=new $n(this.swizzler,new Yn(["F","D","L","BL","R","U","BR","B"])),v||U||(this.addNotationMapper="FTOMapper")),r==="d"&&S&&(this.addNotationMapper="MegaminxMapper",this.notationMapper=new $n(this.swizzler,new Yn(["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 l of this.moveplanesets)if(l.length>0){let o=t.dot(l[0]),i=0,s=1;for(;s*2<=l.length;)s*=2;for(;s>0;s>>=1)i+s<=l.length&&o>l[i+s-1].a&&(i+=s);if(i<47)r=r+n(33+i);else if(i<47+47*47)r=r+n(33+47+Math.floor(i/47)-1)+n(33+i%47);else if(i<47+47*47+47*47*47)r=r+n(33+47+Math.floor((i-47)/(47*47)-1))+n(33+47+Math.floor((i-47)/47)%47)+n(33+i%47);else throw Error("Too many slices for cubie encoding")}return r}keyface3(t){let r=t.centermass(),n=[];for(let l of this.moveplanesets)if(l.length>0){let o=r.dot(l[0]),i=0,s=1;for(;s*2<=l.length;)s*=2;for(;s>0;s>>=1)i+s<=l.length&&o>l[i+s-1].a&&(i+=s);n.push(i)}return n}findface(t){let r=this.keyface2(t),n=this.facelisthash.get(r);if(n.length===1)return n[0];for(let l=0;l+1<n.length;l++){let o=this.facelisthash.get(r)[l];if(Math.abs(t.dist(this.facecentermass[o]))<Ue)return o}return n[n.length-1]}project2d(t,r,n){let l=this.facenames[t][0],o=(r+1)%l.length,i=this.baseplanes[t],s=l[o].sub(l[r]),a=s.len();s=s.normalize();let f=s.cross(i).normalize(),u=n[1].sub(n[0]),g=u.len()/a;u=u.normalize();let c=u.b,p=u.c,L=s.smul(c).sub(f.smul(p)).smul(g),m=f.smul(c).sum(s.smul(p)).smul(g),d=new W(0,n[0].b-L.dot(l[r]),n[0].c-m.dot(l[r]),0);return[L,m,d]}allstickers(){let t="allstickers";this.faces=kL(this.baseplanerot,this.faces),this.options.verbosity>0&&console.log(\`# Total stickers is now \${this.faces.length}\`),this.facecentermass=new Array(this.faces.length);for(let x=0;x<this.faces.length;x++)this.facecentermass[x]=this.faces[x].centermass();let r=[],n=[];for(let x of this.moveplanes){let C=x.makenormal(),N=!1;for(let b of n)C.sameplane(b.makenormal())&&(N=!0);N||(n.push(C),r.push([]))}for(let x of this.moveplanes2){let C=x.makenormal();for(let N=0;N<n.length;N++)if(C.sameplane(n[N])){r[N].push(x);break}}for(let x=0;x<r.length;x++){let C=r[x].map(b=>b.normalizeplane()),N=n[x];for(let b=0;b<C.length;b++)C[b].makenormal().dist(N)>Ue&&(C[b]=C[b].smul(-1));C.sort((b,w)=>b.a-w.a),r[x]=C}this.moveplanesets=r,this.moveplanenormals=n;let l=r.map(x=>x.length);this.options.verbosity>0&&console.log(\`# Move plane sets: \${l}\`);let o=[];for(let x=0;x<r.length;x++)o.push([]);for(let x of this.rotations){if(Math.abs(Math.abs(x.a)-1)<Ue)continue;let C=x.makenormal();for(let N=0;N<r.length;N++)if(C.sameplane(n[N])){o[N].push(x);break}}this.moverotations=o;for(let x=0;x<o.length;x++){let C=o[x],N=C[0].makenormal();for(let b=0;b<C.length;b++)N.dist(C[b].makenormal())>Ue&&(C[b]=C[b].smul(-1));C.sort((b,w)=>b.angle()-w.angle()),o[x][0].dot(n[x])<0&&C.reverse()}let i=o.map(x=>1+x.length);this.movesetorders=i;let s=[],a="?";for(let x=0;x<r.length;x++){let C=n[x],N=null,b=null;for(let w of this.geonormals){let M=C.dot(w[0]);Math.abs(M-1)<Ue?(b=[w[1],w[2]],a=w[2]):Math.abs(M+1)<Ue&&(N=[w[1],w[2]],a=w[2])}if(b===null||N===null)throw new Error("Saw positive or negative sides as null");s.push([b[0],b[1],N[0],N[1],1+r[x].length]),this.addNotationMapper==="NxNxNCubeMapper"&&a==="f"&&(this.notationMapper=new io(1+r[x].length),this.addNotationMapper=""),this.addNotationMapper==="SkewbMapper"&&r[0].length===1&&(this.notationMapper=new ao(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 el(this.swizzler),this.addNotationMapper=""):(this.notationMapper=new so(this.swizzler),this.addNotationMapper="")),this.addNotationMapper==="MegaminxMapper"&&a==="f"&&(1+r[x].length===3&&(this.notationMapper=new oo(this.notationMapper)),this.addNotationMapper=""),this.addNotationMapper==="FTOMapper"&&a==="f"&&(1+r[x].length===3&&(this.notationMapper=new lo(this.notationMapper,this.swizzler)),this.addNotationMapper="")}this.movesetgeos=s;let f=new Map,u=this.faces;for(let x=0;x<u.length;x++){let C=u[x],N=this.keyface(C);if(!f.get(N))f.set(N,[x]);else{let b=f.get(N);if(b.push(x),b.length===this.baseFaceCount){this.options.verbosity>0&&console.log("# Splitting core.");for(let w=0;w<b.length;w++){let M=\`\${N} \${w}\`;f.set(M,[b[w]])}}}}this.facelisthash=f,this.options.verbosity>0&&console.log(\`# Cubies: \${f.size}\`);let g=[],c=[],p=[];for(let x of f.values())if(x.length!==this.baseFaceCount){if(x.length>1){let C=x.map(j=>u[j].centermass()),N=Bi(C);for(let j=0;x.length>2;j++){let q=!1;for(let ie=0;ie<x.length;ie++){let he=(ie+1)%x.length;if(N.dot(C[ie].cross(C[he]))<0){let ve=C[ie];C[ie]=C[he],C[he]=ve;let Ye=x[ie];x[ie]=x[he],x[he]=Ye,q=!0}}if(!q)break;if(j>1e3)throw new Error("Bad epsilon math; too close to border")}let b=0;for(let j of x)b|=1<<Math.floor(j/this.stickersperface);let w=this.markedface[b],M=-1;for(let j=0;j<x.length;j++)Math.floor(x[j]/this.stickersperface)===w&&(M=j);if(M<0)throw new Error("Could not find marked face in list");if(M!==0){let j=x.slice();for(let q=0;q<x.length;q++)x[q]=j[(M+q)%x.length]}}for(let C=0;C<x.length;C++){let N=x[C];c[N]=g.length,p[N]=C}g.push(x)}this.cubies=g,this.facetocubie=c,this.facetoord=p;let L=["?","CENTERS","EDGES","CORNERS","C4RNER","C5RNER"],m=[],d=[0,0,0,0,0,0],D=[],y=[],S=0,v=[],U=[],P=[],J=[],z=x=>g[x].map(C=>this.getfaceindex(C)).join(" "),Q=[];for(let x=0;x<g.length;x++){let C=g[x];if(C.length===0||y[x])continue;let N={},b=0;P.push(0),Q.push([]);let w=C.length,M=d[w]++,j=L[w];(j===void 0||w===this.baseFaceCount)&&(j="CORE"),j=j+(M===0?"":M+1),m[S]=j,D[S]=w;let q=[x],ie=0;for(y[x]=!0;ie<q.length;){let he=q[ie++],ve=z(he);if((C.length>1||N[ve]===void 0)&&(N[ve]=b++),J[he]=N[ve],v[he]=S,Q[S].push(he),U[he]=P[S]++,q.length<this.rotations.length){let Ye=this.facecentermass[g[he][0]];for(let Et of o){let de=this.facetocubie[this.findface(Ye.rotatepoint(Et[0]))];y[de]||(q.push(de),y[de]=!0)}}}S++}if(this.setReidOrder&&4<=this.stickersperface&&this.stickersperface<=9){let x=[["UF","UR","UB","UL","DF","DR","DB","DL","FR","FL","BR","BL"],["UFR","URB","UBL","ULF","DRF","DFL","DLB","DBR"],["U","L","F","R","B","D"]],C={};for(let N of x)for(let b=0;b<N.length;b++){let w=0;for(let M=0;M<N[b].length;M++)w|=1<<N[b].charCodeAt(M)-65;C[w]=b}for(let N of Q)for(let b of N){let w=0;for(let M of g[b])w|=1<<this.facenames[this.getfaceindex(M)][1].charCodeAt(0)-65;U[b]=C[w]}}if(this.cubiesetnums=v,this.cubieordnums=U,this.cubiesetnames=m,this.cubieords=P,this.orbitoris=D,this.cubievaluemap=J,this.cubiesetcubies=Q,this.options.fixedPieceType!==null){for(let x=0;x<g.length;x++)if(this.options.fixedPieceType==="v"&&g[x].length>2||this.options.fixedPieceType==="e"&&g[x].length===2||this.options.fixedPieceType==="f"&&g[x].length===1){this.fixedCubie=x;break}if(this.fixedCubie<0)throw new Error(\`Could not find a cubie of type \${this.options.fixedPieceType} to fix.\`)}this.options.verbosity>0&&console.log(\`# Cubie orbit sizes \${P}\`)}unswizzle(t){let r=this.notationMapper.notationToInternal(t);return r===null?null:r.modified({family:this.swizzler.unswizzle(r.family)})}stringToBlockMove(t){let r=RegExp("^(([0-9]+)-)?([0-9]+)?([^0-9]+)([0-9]+'?)?$"),n=t.match(r);if(n===null)throw new Error(\`Bad move passed \${t}\`);let l=n[4],o,i;if(n[2]!==void 0){if(n[3]===void 0)throw new Error("Missing second number in range");o=parseInt(n[2],10)}n[3]!==void 0&&(i=parseInt(n[3],10));let s="1",a=1;return n[5]!==void 0&&(s=n[5],s[0]==="'"&&(s=\`-\${s.substring(1)}\`),a=parseInt(s,10)),new B(new _(l,i,o),a)}parseMove(t){let r=this.notationMapper.notationToInternal(t);if(r===null)throw new Error(\`Bad move \${t.family}\`);t=r;let n=t.family,l=!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),l=!0}n.endsWith("w")&&n[0]<="Z"&&(n=n.slice(0,-1).toLowerCase());let o,i=-1,s=this.swizzler.unswizzle(n),a=!1;for(let g=0;g<this.movesetgeos.length;g++){let c=this.movesetgeos[g];s===c[0]&&(a=!0,o=c,i=g),s===c[2]&&(a=!1,o=c,i=g)}let f=1,u=1;if(n.toUpperCase()!==n&&(u=2),o===void 0)throw new Error(\`Bad grip in move \${t.family}\`);if(t.outerLayer!==void 0&&(f=t.outerLayer),t.innerLayer!==void 0&&(t.outerLayer===void 0?(u=t.innerLayer,n<="Z"?f=u:f=1):u=t.innerLayer),f--,u--,l&&(f=0,u=this.moveplanesets[i].length),f<0||f>this.moveplanesets[i].length||u<0||u>this.moveplanesets[i].length)throw new Error(\`Bad slice spec \${f} \${u} vs \${this.moveplanesets[i].length}\`);if(!CL&&f===0&&u===this.moveplanesets[i].length&&!l)throw new Error("! full puzzle rotations must be specified with v suffix.");return[void 0,i,f,u,a,t.amount]}parsemove(t){let r=this.parseMove(this.stringToBlockMove(t));return r[0]=t,r}genperms(){let t="genperms";if(this.cmovesbyslice.length>0)return;let r=[];if(this.options.orientCenters){for(let n=0;n<this.cubies.length;n++)if(this.cubies[n].length===1){let l=this.cubies[n][0],o=this.getfaceindex(l),i=this.basefaces[o].centermass();if(i.dist(this.facecentermass[l])<Ue){let s=1<<o|1<<this.baseFaceCount,a=this.markedface[s],f=this.baseplanes[a].makenormal(),u=-1,g=-1;for(let L=0;L<this.faces[l].length;L++){let m=this.faces[l].get(L),d=f.dot(m.sub(i));d>u&&(u=d,g=L)}let c=(g+1)%this.faces[l].length;if(Math.abs(f.dot(this.faces[l].get(c).sub(i))-u)<Ue&&(g=c),g!==0){let L=[];for(let m=0;m<this.faces[l].length;m++)L.push(this.faces[l].get((m+g)%this.faces[l].length));this.faces[l]=new Er(L)}let p=this.basefaces[o].length;for(let L=1;L<p;L++)this.cubies[n].push(this.cubies[n][L-1]);this.duplicatedFaces[l]=p,this.duplicatedCubies[n]=p,this.orbitoris[this.cubiesetnums[n]]=p}}}for(let n=0;n<this.moveplanesets.length;n++){let l=this.moveplanesets[n],o=[],i=[l.length+1,0],s=1;for(;s*2<=l.length;)s*=2;for(let u=0;u<this.faces.length;u++){let g=0;if(l.length>0){let c=this.facecentermass[u].dot(l[0]);for(let p=s;p>0;p>>=1)g+p<=l.length&&c>l[g+p-1].a&&(g+=p);g=l.length-g}for(o.push(g);i.length<=g;)i.push(0);i[g]++}let a=new Array(i.length);for(let u=0;u<i.length;u++)a[u]=[];let f=[];for(let u=0;u<this.faces.length;u++){if(o[u]<0)continue;let g=[this.facetocubie[u],this.facetoord[u]],c=this.facecentermass[u],p=c,L=u,m=o[L];for(;;){o[L]=-1;let d=c.rotatepoint(this.moverotations[n][0]);if(d.dist(p)<Ue)break;L=this.findface(d),g.push(this.facetocubie[L],this.facetoord[L]),c=d}if(g.length>2&&this.options.orientCenters&&(this.cubies[g[0]].length===1||this.duplicatedCubies[g[0]]>1)&&this.facecentermass[u].dist(this.basefaces[this.getfaceindex(u)].centermass())<Ue){let d=this.faces[this.cubies[g[0]][0]];for(let D=0;D<g.length;D+=2){let y=this.faces[this.cubies[g[D]][0]],S=-1;for(let v=0;v<d.length;v++)if(y.get(v).dist(d.get(0))<Ue){S=v;break}if(S<0)throw new Error("Couldn't find rotation of center faces; ignoring for now.");g[D+1]=S,d=d.rotate(this.moverotations[n][0])}}if(g.length===2&&this.options.orientCenters)for(let d=1;d<this.movesetorders[n];d++)m===0?g.push(g[0],d):g.push(g[0],(this.movesetorders[n]-d)%this.movesetorders[n]);if(g.length>2&&!f[g[0]]){if(g.length!==2*this.movesetorders[n])throw new Error("Bad length in perm gen");for(let d of g)a[m].push(d)}for(let d=0;d<g.length;d+=2)f[g[d]]=!0}for(let u=0;u<a.length;u++)a[u]=a[u].slice();r.push(a)}if(this.cmovesbyslice=r,this.options.moveList){let n=[];for(let l of this.options.moveList)n.push(this.parsemove(l));this.parsedmovelist=n}this.facelisthash.clear(),this.facecentermass=[]}getboundarygeometry(){return{baseplanes:this.baseplanes,facenames:this.facenames,faceplanes:this.faceplanes,vertexnames:this.vertexnames,edgenames:this.edgenames,geonormals:this.geonormals}}getmovesets(t){let r=this.moveplanesets[t].length,n=[];if(this.parsedmovelist!==void 0)for(let l of this.parsedmovelist)l[1]===t&&(l[4]?n.push([l[2],l[3]]):n.push([r-l[3],r-l[2]]),n.push(l[5]));else if(this.options.vertexMoves&&!this.options.allMoves){let l=this.movesetgeos[t];if(l[1]!==l[3])for(let o=0;o<r;o++)l[1]!=="v"?(this.options.outerBlockMoves?n.push([o+1,r]):n.push([o+1]),n.push(1)):(this.options.outerBlockMoves?n.push([0,o]):n.push([o,o]),n.push(1))}else for(let l=0;l<=r;l++)!this.options.allMoves&&l+l===r||(this.options.outerBlockMoves?l+l>r?n.push([l,r]):n.push([0,l]):n.push([l,l]),n.push(1));if(this.fixedCubie>=0){let l=this.keyface3(this.faces[this.cubies[this.fixedCubie][0]])[t],o=[];for(let i=0;i<n.length;i+=2){let s=n[i];if(l>=s[0]&&l<=s[1])if(s[0]===0)s=[s[1]+1,r];else if(r===s[1])s=[0,s[0]-1];else throw Error("fixed cubie option would disconnect move");let a=!1;for(let f=0;f<o.length;f+=2)if(o[f][0]===s[0]&&o[f][1]===s[1]&&o[f+1]===n[i+1]){a=!0;break}a||(o.push(s),o.push(n[i+1]))}n=o}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+_L+\`
7
7
  \`+t+\`
8
- \`}writegap(){let t=this.getOrbitsDef(!1),r=[],n=[];for(let o=0;o<t.moveops.length;o++){let i=\`M_\${ci(this.notationMapper,t.movenames[o])}\`,a=!1;i[i.length-1]==="'"&&(i=i.substring(0,i.length-1),a=!0),n.push(i),a?r.push(\`\${i}:=\${t.moveops[o].toPerm().inv().toGap()};\`):r.push(\`\${i}:=\${t.moveops[o].toPerm().toGap()};\`)}r.push("Gen:=["),r.push(n.join(",")),r.push("];");let l=t.solved.identicalPieces();return r.push(\`ip:=[\${l.map(o=>\`[\${o.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(\`
8
+ \`}writegap(){let t=this.getOrbitsDef(!1),r=[],n=[];for(let o=0;o<t.moveops.length;o++){let i=\`M_\${ci(this.notationMapper,t.movenames[o])}\`,s=!1;i[i.length-1]==="'"&&(i=i.substring(0,i.length-1),s=!0),n.push(i),s?r.push(\`\${i}:=\${t.moveops[o].toPerm().inv().toGap()};\`):r.push(\`\${i}:=\${t.moveops[o].toPerm().toGap()};\`)}r.push("Gen:=["),r.push(n.join(",")),r.push("];");let l=t.solved.identicalPieces();return r.push(\`ip:=[\${l.map(o=>\`[\${o.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(\`
9
9
  \`)}writeksolve(t="PuzzleGeometryPuzzle"){let r=this.getOrbitsDef(!1);return this.header("# ")+r.toKsolve(t,this.notationMapper).join(\`
10
- \`)}getKPuzzleDefinition(t=!0,r=!0){let l=this.getOrbitsDef(t,r).toKPuzzleDefinition(r);if(l.experimentalPuzzleDescription=this.puzzleDescription,!l)throw new Error("Missing definition!");return l}getMoveFromBits(t,r,n,l,o,i){let a=[],s=[],f=[];for(let c of this.cubieords)s.push(qt(c)),f.push(Ur(c));for(let c=t[0];c<=t[1];c++){let p=l[c];for(let L=0;L<p.length;L+=2*i){let m=p.slice(L,L+2*i),d=this.cubiesetnums[m[0]];for(let S=0;S<m.length;S+=2)m[S]=this.cubieordnums[m[S]];let D=2,F=3;n&&(D=m.length-2,F=m.length-1),s[d]===qt(this.cubieords[d])&&(s[d]=s[d].slice(),this.orbitoris[d]>1&&!this.options.fixedOrientation&&(f[d]=f[d].slice()));for(let S=0;S<m.length;S+=2)s[d][m[(S+D)%m.length]]=m[S],this.orbitoris[d]>1&&!this.options.fixedOrientation&&(f[d][m[S]]=(m[(S+F)%m.length]-m[(S+1)%m.length]+2*this.orbitoris[d])%this.orbitoris[d])}}let u=new Vt(qt(24),Ur(24),1);for(let c=0;c<this.cubiesetnames.length;c++)if(!(o&&!o[c]))if(this.orbitoris[c]===1||this.options.fixedOrientation)s[c]===qt(u.perm.length)?(s[c]!==u.perm&&(u=new Vt(s[c],f[c],1)),a.push(u)):a.push(new Vt(s[c],f[c],1));else{let p=new Array(f[c].length);for(let L=0;L<s[c].length;L++)p[L]=f[c][s[c][L]];a.push(new Vt(s[c],p,this.orbitoris[c]))}let g=new ar(a);return r!==1&&(g=g.mulScalar(r)),g}omitSet(t){for(let r of this.options.excludeOrbits)if(r===t)return!0;return!1}diffmvsets(t,r,n,l){for(let o=0;o<t.length;o+=2){let i=!1;for(let a=0;!i&&a<r.length;a+=2)l?t[o][0]+r[a][1]===n&&t[o][1]+r[a][0]===n&&t[o+1]===r[a+1]&&(i=!0):t[o][0]===r[a][0]&&t[o][1]===r[a][1]&&t[o+1]===r[a+1]&&(i=!0);if(!i)return!0}return!1}getOrbitsDef(t,r=!0){let n=[];if(t)for(let m=0;m<this.cubiesetnames.length;m++)n.push(1);let l=[],o=[],i=[],a=[];for(let m=0;m<this.moveplanesets.length;m++){let d=this.getmovesets(m);i.push(d),this.options.addRotations?a.push(1):a.push(0)}let s=[];for(let m=0;m<this.moveplanesets.length;m++){let d=this.moveplanesets[m].length,D=!1,F=i[m];for(let S=0;S<F.length;S+=2)F[S][0]===0&&F[S][1]===d&&(D=!0);s[m]=D}if(this.options.addRotations&&(this.options.moveList||this.options.fixedPieceType!==null)){for(let m=0;m<this.moverotations.length;m++)a[m]=0;for(let m=0;m<this.moveplanesets.length;m++){if(s[m]){a[m]=3;continue}for(let d=0;d<this.moverotations.length;d++){let D=this.moveplanenormals[m];for(let F=1;F*2<=this.movesetorders[d];F++){if(D=D.rotatepoint(this.moverotations[d][0]),a[d]&F)continue;let S=-1,v=!1;for(let P=0;P<this.moveplanenormals.length;P++)if(D.dist(this.moveplanenormals[P])<Ue){S=P;break}else if(D.dist(this.moveplanenormals[P].smul(-1))<Ue){S=P,v=!0;break}if(S<0)throw new Error("Could not find rotation");let U=i[S];(U.length!==i[m].length||this.moveplanesets[m].length!==this.moveplanesets[S].length||this.diffmvsets(U,i[m],this.moveplanesets[S].length,v))&&(a[d]|=F)}}}for(let m=0;m<this.moverotations.length;m++)if(a[m]===0)a[m]=1;else if(a[m]===1)this.movesetorders[m]>3?a[m]=2:a[m]=0;else if(a[m]===3)a[m]=0;else throw new Error("Impossible addrot val")}for(let m=0;m<this.moveplanesets.length;m++)a[m]!==0&&!s[m]&&(i[m].push([0,this.moveplanesets[m].length]),i[m].push(a[m]));for(let m=0;m<this.moveplanesets.length;m++){let d=i[m],D=this.movesetorders[m];for(let v=0;v<d.length;v+=2)for(let U=0;U<v;U+=2)if(d[v][0]===d[U][0]&&d[v][1]===d[U][1])throw new Error("Redundant moves in moveset.");let F=[];for(let v=0;v<d.length;v+=2)for(let U=d[v][0];U<=d[v][1];U++)F[U]=1;let S=this.cmovesbyslice[m];for(let v=0;v<S.length;v++){if(F[v]!==1)continue;let U=S[v];for(let P=0;P<U.length;P+=2*D){if(this.skipcubie(U[P]))continue;let J=this.cubiesetnums[U[P]];n[J]=1}}}for(let m=0;m<this.cubiesetnames.length;m++)if(!!n[m]){if(this.omitSet(this.cubiesetnames[m])){n[m]=0;continue}l.push(this.cubiesetnames[m]),o.push(new tl(this.cubieords[m],this.options.fixedOrientation?1:this.orbitoris[m]))}let f=[];for(let m=0;m<this.cubiesetnames.length;m++){if(!n[m]||this.omitSet(this.cubiesetnames[m]))continue;let d=[],D=[];for(let F=0;F<this.cubieords[m];F++){if(t)d.push(F);else{let S=this.cubiesetcubies[m][F];d.push(this.cubievaluemap[S])}D.push(0)}f.push(new Vt(d,D,this.options.fixedOrientation?1:this.orbitoris[m]))}let u=[],g=[],c=[],p=[];if(r)for(let m=0;m<this.moveplanesets.length;m++){let D=this.moveplanesets[m].length,F=i[m],S=this.movesetgeos[m];for(let v=0;v<F.length;v+=2){let U=F[v],P,J=!1;if(this.parsedmovelist!==void 0)for(let Q of this.parsedmovelist){if(Q[1]!==m)continue;let x=[];Q[4]?x=[Q[2],Q[3]]:x=[D-Q[3],D-Q[2]],x[0]===U[0]&&x[1]===U[1]&&(P=Q[0],J=!Q[4])}if(P)u.push(P),g.push(!0);else{let Q=PL(S,U,D);J=Q[1];let x=Q[0];F[v+1]===1?u.push(x):u.push(x+F[v+1]),g.push(!1)}p.push(U[0]===0&&U[1]===D);let z=this.getMoveFromBits(U,F[v+1],J,this.cmovesbyslice[m],n,this.movesetorders[m]);c.push(z)}}let L=new fn(l,o,new un(f),u,c,p,g);return this.options.optimizeOrbits&&(L=L.optimize()),this.options.scrambleAmount!==0&&L.scramble(this.options.scrambleAmount),L}getScramble(t=0){let r=this.getOrbitsDef(!1);return r.transformToKTransformationData(r.getScrambleTransformation(t))}getMovesAsPerms(){return this.getOrbitsDef(!1).moveops.map(t=>t.toPerm())}showcanon(t){Wf(this.getOrbitsDef(!1),t)}getsolved(){let t=[];for(let r=0;r<this.baseFaceCount;r++)for(let n=0;n<this.stickersperface;n++)t.push(r);return new dt(t)}getOrientationRotation(t){let[r,[n,l,o]]=t[0],i=new W(0,n,-l,o),[a,[s,f,u]]=t[1],g=new W(0,s,-f,u),c=null,p=null,L=this.swizzler.unswizzle(r),m=this.swizzler.unswizzle(a);for(let S of this.geonormals)L===S[1]&&(c=S[0]),m===S[1]&&(p=S[0]);if(!c)throw new Error(\`Could not find feature \${r}\`);if(!p)throw new Error(\`Could not find feature \${a}\`);let d=c.pointrotation(i);return p.rotatepoint(d).unproject(i).pointrotation(g.unproject(i)).mul(d)}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=NL()[t]),!r)throw new Error("No default orientation?");return this.getOrientationRotation(r)}generate2dmapping(t=800,r=500,n=10,l=!1,o=.92){t-=2*n,r-=2*n;function i(b,w){let M=b[1][0]-b[0][0],j=b[1][1]-b[0][1],q=2*Math.PI/w,ie=Math.cos(q),he=Math.sin(q);for(let ve=2;ve<w;ve++){let Ye=M*ie+j*he;j=j*ie-M*he,M=Ye,b.push([b[ve-1][0]+M,b[ve-1][1]+j])}}this.genperms();let f=this.getboundarygeometry().facenames[0][0].length,u=this.net;if(u===null)throw new Error("No net?");let g={},c=0,p=0,L=1,m=0;g[u[0][0]]=[[1,0],[0,0]],i(g[u[0][0]],f);for(let b of u){let w=b[0];if(!g[w])throw new Error("Bad edge description; first edge not connected.");for(let M=1;M<b.length;M++){let j=b[M];j===""||g[j]||(g[j]=[g[w][M%f],g[w][(M+f-1)%f]],i(g[j],f))}}for(let b in g){let w=g[b];for(let M of w)c=Math.min(c,M[0]),L=Math.max(L,M[0]),p=Math.min(p,M[1]),m=Math.max(m,M[1])}let d=Math.min(t/(L-c),r/(m-p)),D=.5*(t-d*(L+c)),F=.5*(r-d*(m+p)),S={},v=this.getboundarygeometry(),U={},P=[[d+D,F],[D,F]];U[u[0][0]]=P,i(U[u[0][0]],f),S[this.facenames[0][1]]=this.project2d(0,0,[new W(0,P[0][0],P[0][1],0),new W(0,P[1][0],P[1][1],0)]);let J=[];J[0]=0;for(let b of u){let w=b[0];if(!U[w])throw new Error("Bad edge description; first edge not connected.");let M=-1;for(let q=0;q<v.facenames.length;q++)if(w===v.facenames[q][1]){M=q;break}if(M<0)throw new Error(\`Could not find first face name \${w}\`);let j=v.facenames[M][0];for(let q=1;q<b.length;q++){let ie=b[q];if(ie===""||U[ie])continue;U[ie]=[U[w][q%f],U[w][(q+f-1)%f]],i(U[ie],f);let he=J[M],ve=j[(he+q)%f].sum(j[(he+q+f-1)%f]).smul(.5),Ye=Di(v.edgenames,ve),Et=v.edgenames[Ye][1],de=ML(Et,this.facenames),Dt=de[w===de[0]?1:0],it=-1;for(let ze=0;ze<v.facenames.length;ze++)if(Dt===v.facenames[ze][1]){it=ze;break}if(it<0)throw new Error("Could not find second face name");let mt=v.facenames[it][0];for(let ze=0;ze<mt.length;ze++)if(mt[ze].sum(mt[(ze+1)%f]).smul(.5).dist(ve)<=Ue){let k=U[w][(q+f-1)%f],T=U[w][q%f];J[it]=ze,S[Dt]=this.project2d(it,ze,[new W(0,T[0],T[1],0),new W(0,k[0],k[1],0)]);break}}}let z=0,Q=0,x=this.getInitial3DRotation();for(let b of this.faces){l&&(b=b.rotate(x));for(let w=0;w<b.length;w++)z=Math.max(z,Math.abs(b.get(w).b)),Q=Math.max(Q,Math.abs(b.get(w).c))}let C=Math.min(r/Q/2,(t-n)/z/4);return(b,w)=>{if(l){w=w.rotatepoint(x);let M=.5*n+.25*t,j=this.baseplanes[b].rotateplane(x).d<0?1:-1;return[n+t*.5+j*(M-w.b*C),n+r*.5+w.c*C]}else{let M=S[this.facenames[b][1]];return[n+o*w.dot(M[0])+M[2].b,n+r-o*w.dot(M[1])-M[2].c]}}}generatesvg(t=800,r=500,n=10,l=!1){let o=this.generate2dmapping(t,r,n,l);function i(c,p,L){return\`<polygon id="\${c}" class="sticker" style="fill: \${L}" points="\${p.map(m=>\`\${m[0]} \${m[1]}\`).join(" ")}"/>
11
- \`}let a=this.getsolved(),s=[],f=[];for(let c=0;c<this.baseFaceCount;c++)s[c]=this.colors[this.facenames[c][1]];for(let c=0;c<this.faces.length;c++){let p=this.faces[c],L=Math.floor(c/this.stickersperface),m=[];for(let d=0;d<p.length;d++)m.push(o(L,p.get(d)));f.push(m)}let u=[];for(let c=0;c<this.baseFaceCount;c++){u.push("<g>"),u.push(\`<title>\${this.facenames[c][1]}</title>
12
- \`);for(let p=0;p<this.stickersperface;p++){let L=c*this.stickersperface+p,m=this.facetocubie[L],d=this.facetoord[L],D=this.cubiesetnums[m],F=this.cubieordnums[m],S=this.graybyori(m)?"#808080":s[a.p[L]],v=\`\${this.cubiesetnames[D]}-l\${F}-o\${d}\`;if(u.push(i(v,f[L],S)),this.duplicatedFaces[L])for(let U=1;U<this.duplicatedFaces[L];U++)v=\`\${this.cubiesetnames[D]}-l\${F}-o\${U}\`,u.push(i(v,f[L],S))}u.push("</g>")}return\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
10
+ \`)}getKPuzzleDefinition(t=!0,r=!0){let l=this.getOrbitsDef(t,r).toKPuzzleDefinition(r);if(l.experimentalPuzzleDescription=this.puzzleDescription,!l)throw new Error("Missing definition!");return l}getMoveFromBits(t,r,n,l,o,i){let s=[],a=[],f=[];for(let c of this.cubieords)a.push(Vt(c)),f.push(br(c));for(let c=t[0];c<=t[1];c++){let p=l[c];for(let L=0;L<p.length;L+=2*i){let m=p.slice(L,L+2*i),d=this.cubiesetnums[m[0]];for(let S=0;S<m.length;S+=2)m[S]=this.cubieordnums[m[S]];let D=2,y=3;n&&(D=m.length-2,y=m.length-1),a[d]===Vt(this.cubieords[d])&&(a[d]=a[d].slice(),this.orbitoris[d]>1&&!this.options.fixedOrientation&&(f[d]=f[d].slice()));for(let S=0;S<m.length;S+=2)a[d][m[(S+D)%m.length]]=m[S],this.orbitoris[d]>1&&!this.options.fixedOrientation&&(f[d][m[S]]=(m[(S+y)%m.length]-m[(S+1)%m.length]+2*this.orbitoris[d])%this.orbitoris[d])}}let u=new Ht(Vt(24),br(24),1);for(let c=0;c<this.cubiesetnames.length;c++)if(!(o&&!o[c]))if(this.orbitoris[c]===1||this.options.fixedOrientation)a[c]===Vt(u.perm.length)?(a[c]!==u.perm&&(u=new Ht(a[c],f[c],1)),s.push(u)):s.push(new Ht(a[c],f[c],1));else{let p=new Array(f[c].length);for(let L=0;L<a[c].length;L++)p[L]=f[c][a[c][L]];s.push(new Ht(a[c],p,this.orbitoris[c]))}let g=new fr(s);return r!==1&&(g=g.mulScalar(r)),g}omitSet(t){for(let r of this.options.excludeOrbits)if(r===t)return!0;return!1}diffmvsets(t,r,n,l){for(let o=0;o<t.length;o+=2){let i=!1;for(let s=0;!i&&s<r.length;s+=2)l?t[o][0]+r[s][1]===n&&t[o][1]+r[s][0]===n&&t[o+1]===r[s+1]&&(i=!0):t[o][0]===r[s][0]&&t[o][1]===r[s][1]&&t[o+1]===r[s+1]&&(i=!0);if(!i)return!0}return!1}getOrbitsDef(t,r=!0){let n=[];if(t)for(let m=0;m<this.cubiesetnames.length;m++)n.push(1);let l=[],o=[],i=[],s=[];for(let m=0;m<this.moveplanesets.length;m++){let d=this.getmovesets(m);i.push(d),this.options.addRotations?s.push(1):s.push(0)}let a=[];for(let m=0;m<this.moveplanesets.length;m++){let d=this.moveplanesets[m].length,D=!1,y=i[m];for(let S=0;S<y.length;S+=2)y[S][0]===0&&y[S][1]===d&&(D=!0);a[m]=D}if(this.options.addRotations&&(this.options.moveList||this.options.fixedPieceType!==null)){for(let m=0;m<this.moverotations.length;m++)s[m]=0;for(let m=0;m<this.moveplanesets.length;m++){if(a[m]){s[m]=3;continue}for(let d=0;d<this.moverotations.length;d++){let D=this.moveplanenormals[m];for(let y=1;y*2<=this.movesetorders[d];y++){if(D=D.rotatepoint(this.moverotations[d][0]),s[d]&y)continue;let S=-1,v=!1;for(let P=0;P<this.moveplanenormals.length;P++)if(D.dist(this.moveplanenormals[P])<Ue){S=P;break}else if(D.dist(this.moveplanenormals[P].smul(-1))<Ue){S=P,v=!0;break}if(S<0)throw new Error("Could not find rotation");let U=i[S];(U.length!==i[m].length||this.moveplanesets[m].length!==this.moveplanesets[S].length||this.diffmvsets(U,i[m],this.moveplanesets[S].length,v))&&(s[d]|=y)}}}for(let m=0;m<this.moverotations.length;m++)if(s[m]===0)s[m]=1;else if(s[m]===1)this.movesetorders[m]>3?s[m]=2:s[m]=0;else if(s[m]===3)s[m]=0;else throw new Error("Impossible addrot val")}for(let m=0;m<this.moveplanesets.length;m++)s[m]!==0&&!a[m]&&(i[m].push([0,this.moveplanesets[m].length]),i[m].push(s[m]));for(let m=0;m<this.moveplanesets.length;m++){let d=i[m],D=this.movesetorders[m];for(let v=0;v<d.length;v+=2)for(let U=0;U<v;U+=2)if(d[v][0]===d[U][0]&&d[v][1]===d[U][1])throw new Error("Redundant moves in moveset.");let y=[];for(let v=0;v<d.length;v+=2)for(let U=d[v][0];U<=d[v][1];U++)y[U]=1;let S=this.cmovesbyslice[m];for(let v=0;v<S.length;v++){if(y[v]!==1)continue;let U=S[v];for(let P=0;P<U.length;P+=2*D){if(this.skipcubie(U[P]))continue;let J=this.cubiesetnums[U[P]];n[J]=1}}}for(let m=0;m<this.cubiesetnames.length;m++)if(!!n[m]){if(this.omitSet(this.cubiesetnames[m])){n[m]=0;continue}l.push(this.cubiesetnames[m]),o.push(new tl(this.cubieords[m],this.options.fixedOrientation?1:this.orbitoris[m]))}let f=[];for(let m=0;m<this.cubiesetnames.length;m++){if(!n[m]||this.omitSet(this.cubiesetnames[m]))continue;let d=[],D=[];for(let y=0;y<this.cubieords[m];y++){if(t)d.push(y);else{let S=this.cubiesetcubies[m][y];d.push(this.cubievaluemap[S])}D.push(0)}f.push(new Ht(d,D,this.options.fixedOrientation?1:this.orbitoris[m]))}let u=[],g=[],c=[],p=[];if(r)for(let m=0;m<this.moveplanesets.length;m++){let D=this.moveplanesets[m].length,y=i[m],S=this.movesetgeos[m];for(let v=0;v<y.length;v+=2){let U=y[v],P,J=!1;if(this.parsedmovelist!==void 0)for(let Q of this.parsedmovelist){if(Q[1]!==m)continue;let x=[];Q[4]?x=[Q[2],Q[3]]:x=[D-Q[3],D-Q[2]],x[0]===U[0]&&x[1]===U[1]&&(P=Q[0],J=!Q[4])}if(P)u.push(P),g.push(!0);else{let Q=OL(S,U,D);J=Q[1];let x=Q[0];y[v+1]===1?u.push(x):u.push(x+y[v+1]),g.push(!1)}p.push(U[0]===0&&U[1]===D);let z=this.getMoveFromBits(U,y[v+1],J,this.cmovesbyslice[m],n,this.movesetorders[m]);c.push(z)}}let L=new un(l,o,new gn(f),u,c,p,g);return this.options.optimizeOrbits&&(L=L.optimize()),this.options.scrambleAmount!==0&&L.scramble(this.options.scrambleAmount),L}getScramble(t=0){let r=this.getOrbitsDef(!1);return r.transformToKTransformationData(r.getScrambleTransformation(t))}getMovesAsPerms(){return this.getOrbitsDef(!1).moveops.map(t=>t.toPerm())}showcanon(t){Wf(this.getOrbitsDef(!1),t)}getsolved(){let t=[];for(let r=0;r<this.baseFaceCount;r++)for(let n=0;n<this.stickersperface;n++)t.push(r);return new dt(t)}getOrientationRotation(t){let[r,[n,l,o]]=t[0],i=new W(0,n,-l,o),[s,[a,f,u]]=t[1],g=new W(0,a,-f,u),c=null,p=null,L=this.swizzler.unswizzle(r),m=this.swizzler.unswizzle(s);for(let S of this.geonormals)L===S[1]&&(c=S[0]),m===S[1]&&(p=S[0]);if(!c)throw new Error(\`Could not find feature \${r}\`);if(!p)throw new Error(\`Could not find feature \${s}\`);let d=c.pointrotation(i);return p.rotatepoint(d).unproject(i).pointrotation(g.unproject(i)).mul(d)}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=ML()[t]),!r)throw new Error("No default orientation?");return this.getOrientationRotation(r)}generate2dmapping(t=800,r=500,n=10,l=!1,o=.92){t-=2*n,r-=2*n;function i(b,w){let M=b[1][0]-b[0][0],j=b[1][1]-b[0][1],q=2*Math.PI/w,ie=Math.cos(q),he=Math.sin(q);for(let ve=2;ve<w;ve++){let Ye=M*ie+j*he;j=j*ie-M*he,M=Ye,b.push([b[ve-1][0]+M,b[ve-1][1]+j])}}this.genperms();let f=this.getboundarygeometry().facenames[0][0].length,u=this.net;if(u===null)throw new Error("No net?");let g={},c=0,p=0,L=1,m=0;g[u[0][0]]=[[1,0],[0,0]],i(g[u[0][0]],f);for(let b of u){let w=b[0];if(!g[w])throw new Error("Bad edge description; first edge not connected.");for(let M=1;M<b.length;M++){let j=b[M];j===""||g[j]||(g[j]=[g[w][M%f],g[w][(M+f-1)%f]],i(g[j],f))}}for(let b in g){let w=g[b];for(let M of w)c=Math.min(c,M[0]),L=Math.max(L,M[0]),p=Math.min(p,M[1]),m=Math.max(m,M[1])}let d=Math.min(t/(L-c),r/(m-p)),D=.5*(t-d*(L+c)),y=.5*(r-d*(m+p)),S={},v=this.getboundarygeometry(),U={},P=[[d+D,y],[D,y]];U[u[0][0]]=P,i(U[u[0][0]],f),S[this.facenames[0][1]]=this.project2d(0,0,[new W(0,P[0][0],P[0][1],0),new W(0,P[1][0],P[1][1],0)]);let J=[];J[0]=0;for(let b of u){let w=b[0];if(!U[w])throw new Error("Bad edge description; first edge not connected.");let M=-1;for(let q=0;q<v.facenames.length;q++)if(w===v.facenames[q][1]){M=q;break}if(M<0)throw new Error(\`Could not find first face name \${w}\`);let j=v.facenames[M][0];for(let q=1;q<b.length;q++){let ie=b[q];if(ie===""||U[ie])continue;U[ie]=[U[w][q%f],U[w][(q+f-1)%f]],i(U[ie],f);let he=J[M],ve=j[(he+q)%f].sum(j[(he+q+f-1)%f]).smul(.5),Ye=Di(v.edgenames,ve),Et=v.edgenames[Ye][1],de=IL(Et,this.facenames),Dt=de[w===de[0]?1:0],it=-1;for(let ze=0;ze<v.facenames.length;ze++)if(Dt===v.facenames[ze][1]){it=ze;break}if(it<0)throw new Error("Could not find second face name");let mt=v.facenames[it][0];for(let ze=0;ze<mt.length;ze++)if(mt[ze].sum(mt[(ze+1)%f]).smul(.5).dist(ve)<=Ue){let k=U[w][(q+f-1)%f],T=U[w][q%f];J[it]=ze,S[Dt]=this.project2d(it,ze,[new W(0,T[0],T[1],0),new W(0,k[0],k[1],0)]);break}}}let z=0,Q=0,x=this.getInitial3DRotation();for(let b of this.faces){l&&(b=b.rotate(x));for(let w=0;w<b.length;w++)z=Math.max(z,Math.abs(b.get(w).b)),Q=Math.max(Q,Math.abs(b.get(w).c))}let C=Math.min(r/Q/2,(t-n)/z/4);return(b,w)=>{if(l){w=w.rotatepoint(x);let M=.5*n+.25*t,j=this.baseplanes[b].rotateplane(x).d<0?1:-1;return[n+t*.5+j*(M-w.b*C),n+r*.5+w.c*C]}else{let M=S[this.facenames[b][1]];return[n+o*w.dot(M[0])+M[2].b,n+r-o*w.dot(M[1])-M[2].c]}}}generatesvg(t=800,r=500,n=10,l=!1){let o=this.generate2dmapping(t,r,n,l);function i(c,p,L){return\`<polygon id="\${c}" class="sticker" style="fill: \${L}" points="\${p.map(m=>\`\${m[0]} \${m[1]}\`).join(" ")}"/>
11
+ \`}let s=this.getsolved(),a=[],f=[];for(let c=0;c<this.baseFaceCount;c++)a[c]=this.colors[this.facenames[c][1]];for(let c=0;c<this.faces.length;c++){let p=this.faces[c],L=Math.floor(c/this.stickersperface),m=[];for(let d=0;d<p.length;d++)m.push(o(L,p.get(d)));f.push(m)}let u=[];for(let c=0;c<this.baseFaceCount;c++){u.push("<g>"),u.push(\`<title>\${this.facenames[c][1]}</title>
12
+ \`);for(let p=0;p<this.stickersperface;p++){let L=c*this.stickersperface+p,m=this.facetocubie[L],d=this.facetoord[L],D=this.cubiesetnums[m],y=this.cubieordnums[m],S=this.graybyori(m)?"#808080":a[s.p[L]],v=\`\${this.cubiesetnames[D]}-l\${y}-o\${d}\`;if(u.push(i(v,f[L],S)),this.duplicatedFaces[L])for(let U=1;U<this.duplicatedFaces[L];U++)v=\`\${this.cubiesetnames[D]}-l\${y}-o\${U}\`,u.push(i(v,f[L],S))}u.push("</g>")}return\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
13
13
  <style type="text/css"><![CDATA[.sticker { stroke: #000000; stroke-width: 1px; }]]></style>
14
- \${u.join("")}</svg>\`}get3d(t){let r=[],n=this.getInitial3DRotation(),l=[],o=.52*this.basefaces[0].get(0).len();for(let f=0;f<this.basefaces.length;f++){let u=this.basefaces[f].rotate(n),g=this.facenames[f][1];l.push({coords:_s(u,o),name:g})}for(let f=0;f<this.faces.length;f++){let u=Math.floor(f/this.stickersperface),g=this.facetocubie[f],c=this.facetoord[f],p=this.cubiesetnums[g],L=this.cubieordnums[g],m=this.graybyori(g)?"#808080":this.colors[this.facenames[u][1]];t?.stickerColors&&(m=t.stickerColors[f]);let d=this.faces[f].rotate(n);r.push({coords:_s(d,o),color:m,orbit:this.cubiesetnames[p],ord:L,ori:c,face:u});let D=d;if(this.duplicatedFaces[f]){let F=D.length/this.duplicatedFaces[f];for(let S=1;S<this.duplicatedFaces[f];S++){for(let v=0;v<F;v++)D=D.rotateforward();r.push({coords:_s(D,o),color:m,orbit:this.cubiesetnames[p],ord:L,ori:S,face:u,isDup:!0})}}}let i=[];for(let f=0;f<this.movesetgeos.length;f++){let u=this.movesetgeos[f],g=this.movesetorders[f];for(let c of this.geonormals)u[0]===c[1]&&u[1]===c[2]&&(i.push({coordinates:Fi(c[0].rotatepoint(n),1),quantumMove:new B(u[0]),order:g}),i.push({coordinates:Fi(c[0].rotatepoint(n).smul(-1),1),quantumMove:new B(u[2]),order:g}))}let a=this.generate2dmapping(2880,2160,0,!1,1),s=function(){let f=n.invrot();return function(u,g){let c=new W(0,g[0]*o,-g[1]*o,g[2]*o);c=c.rotatepoint(f);let p=a(u,c);return p[0]/=2880,p[1]=1-p[1]/2160,p}}().bind(this);return{stickers:r,faces:l,axis:i,unswizzle:this.unswizzle.bind(this),notationMapper:this.notationMapper,textureMapper:{getuv:s}}}getGeoNormal(t){let r=this.getInitial3DRotation(),n=this.swizzler.unswizzle(t);for(let l of this.geonormals)if(n===l[1]){let o=Fi(l[0].rotatepoint(r),1);return Math.abs(o[0])<Ue&&Math.abs(o[2])<Ue&&(o[0]=0,o[2]=1e-6),o}}getfaceindex(t){let r=this.stickersperface;return Math.floor(t/r)}textForTwizzleExplorer(){return\`Faces \${this.baseplanerot.length}
14
+ \${u.join("")}</svg>\`}get3d(t){let r=[],n=this.getInitial3DRotation(),l=[],o=.52*this.basefaces[0].get(0).len();for(let f=0;f<this.basefaces.length;f++){let u=this.basefaces[f].rotate(n),g=this.facenames[f][1];l.push({coords:_a(u,o),name:g})}for(let f=0;f<this.faces.length;f++){let u=Math.floor(f/this.stickersperface),g=this.facetocubie[f],c=this.facetoord[f],p=this.cubiesetnums[g],L=this.cubieordnums[g],m=this.graybyori(g)?"#808080":this.colors[this.facenames[u][1]];t?.stickerColors&&(m=t.stickerColors[f]);let d=this.faces[f].rotate(n);r.push({coords:_a(d,o),color:m,orbit:this.cubiesetnames[p],ord:L,ori:c,face:u});let D=d;if(this.duplicatedFaces[f]){let y=D.length/this.duplicatedFaces[f];for(let S=1;S<this.duplicatedFaces[f];S++){for(let v=0;v<y;v++)D=D.rotateforward();r.push({coords:_a(D,o),color:m,orbit:this.cubiesetnames[p],ord:L,ori:S,face:u,isDup:!0})}}}let i=[];for(let f=0;f<this.movesetgeos.length;f++){let u=this.movesetgeos[f],g=this.movesetorders[f];for(let c of this.geonormals)u[0]===c[1]&&u[1]===c[2]&&(i.push({coordinates:Fi(c[0].rotatepoint(n),1),quantumMove:new B(u[0]),order:g}),i.push({coordinates:Fi(c[0].rotatepoint(n).smul(-1),1),quantumMove:new B(u[2]),order:g}))}let s=this.generate2dmapping(2880,2160,0,!1,1),a=function(){let f=n.invrot();return function(u,g){let c=new W(0,g[0]*o,-g[1]*o,g[2]*o);c=c.rotatepoint(f);let p=s(u,c);return p[0]/=2880,p[1]=1-p[1]/2160,p}}().bind(this);return{stickers:r,faces:l,axis:i,unswizzle:this.unswizzle.bind(this),notationMapper:this.notationMapper,textureMapper:{getuv:a}}}getGeoNormal(t){let r=this.getInitial3DRotation(),n=this.swizzler.unswizzle(t);for(let l of this.geonormals)if(n===l[1]){let o=Fi(l[0].rotatepoint(r),1);return Math.abs(o[0])<Ue&&Math.abs(o[2])<Ue&&(o[0]=0,o[2]=1e-6),o}}getfaceindex(t){let r=this.stickersperface;return Math.floor(t/r)}textForTwizzleExplorer(){return\`Faces \${this.baseplanerot.length}
15
15
  Stickers per face \${this.stickersperface}
16
16
  Short edge \${this.shortedge}
17
17
  Cubies \${this.cubies.length}
18
18
  Edge distance \${this.edgedistance}
19
- Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrbitsDef(!1).reassemblySize();t(\`Reassembly size is \${n}\`);let l=hi(this.getMovesAsPerms(),t),o=n/l;t(\`Ratio is \${o}\`)}},yi=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 l=this.pg.getMoveFromBits(n,r[5],!r[4],this.pg.cmovesbyslice[r[1]],void 0,this.pg.movesetorders[r[1]]);return fn.transformToKTransformationData(this.orbitNames,l)}}});var nl={};Lt(nl,{EXPERIMENTAL_PUZZLE_BASE_SHAPES:()=>t1,EXPERIMENTAL_PUZZLE_CUT_TYPES:()=>r1,ExperimentalPGNotation:()=>yi,PuzzleGeometry:()=>go,Quat:()=>W,getPG3DNamedPuzzles:()=>$f,getPuzzleDescriptionString:()=>e1,getPuzzleGeometryByDesc:()=>Cs,getPuzzleGeometryByName:()=>n1,parseOptions:()=>If,parsePuzzleDescription:()=>fo,schreierSims:()=>hi});var ll=A(()=>{"use strict";uo();Ss();di();ks();uo();uo()});async function gn(e){return(await Promise.resolve().then(()=>(ll(),nl))).getPuzzleGeometryByName(e,{allMoves:!0,orientCenters:!0,addRotations:!0})}async function OL(e,t){let r=await e,n=r.getKPuzzleDefinition(!0);n.name=t;let l=await Promise.resolve().then(()=>(ll(),nl)),o=new l.ExperimentalPGNotation(r,r.getOrbitsDef(!0));return new De(n,{experimentalPGNotation:o})}var Ai,Si,xi,Rt,sr,fr=A(()=>{"use strict";We();no();At();Rt=class{constructor(t){Z(this,Ai,void 0);Z(this,Si,void 0);Z(this,xi,void 0);this.pgId=t.pgID,this.id=t.id,this.fullName=t.fullName,this.inventedBy=t.inventedBy,this.inventionYear=t.inventionYear}pg(){return R(this,Ai)??V(this,Ai,gn(this.pgId??this.id))}kpuzzle(){return R(this,Si)??V(this,Si,OL(this.pg(),this.id))}svg(){return R(this,xi)??V(this,xi,(async()=>(await this.pg()).generatesvg())())}};Ai=new WeakMap,Si=new WeakMap,xi=new WeakMap;sr=class extends Rt{constructor(){super(...arguments);this.stickerings=Zn}stickeringMask(r){return ir(this,r)}}});var Ct,l1=A(()=>{"use strict";Ct={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]}}}};Ct.moves.Rv=Ct.moves.x;Ct.moves.Uv=Ct.moves.y;Ct.moves.Fv=Ct.moves.z;Ct.moves.Lv={CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]}};Ct.moves.Dv={CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}};Ct.moves.Bv={CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]}}});var o1,i1=A(()=>{"use strict";o1=\`<?xml version="1.0" encoding="UTF-8"?>
19
+ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrbitsDef(!1).reassemblySize();t(\`Reassembly size is \${n}\`);let l=hi(this.getMovesAsPerms(),t),o=n/l;t(\`Ratio is \${o}\`)}},yi=class{constructor(t,r){this.pg=t;this.orbitNames=r.orbitnames}lookupMove(t){let r=this.pg.parseMove(t);if(this.pg.parsedmovelist){let i=!1;for(let s of this.pg.parsedmovelist)s[1]===r[1]&&s[2]===r[2]&&s[3]===r[3]&&s[4]===r[4]&&(i=!0);if(!i)return null}let n=[r[2],r[3]];if(!r[4]){let i=this.pg.moveplanesets[r[1]].length;n=[i-r[3],i-r[2]]}let l=this.pg.getMoveFromBits(n,r[5],!r[4],this.pg.cmovesbyslice[r[1]],void 0,this.pg.movesetorders[r[1]]);return un.transformToKTransformationData(this.orbitNames,l)}}});var nl={};Lt(nl,{EXPERIMENTAL_PUZZLE_BASE_SHAPES:()=>t1,EXPERIMENTAL_PUZZLE_CUT_TYPES:()=>r1,ExperimentalPGNotation:()=>yi,PuzzleGeometry:()=>go,Quat:()=>W,getPG3DNamedPuzzles:()=>$f,getPuzzleDescriptionString:()=>e1,getPuzzleGeometryByDesc:()=>Ca,getPuzzleGeometryByName:()=>n1,parseOptions:()=>If,parsePuzzleDescription:()=>fo,schreierSims:()=>hi});var ll=F(()=>{"use strict";uo();Sa();di();ka();uo();uo()});async function cn(e){return(await Promise.resolve().then(()=>(ll(),nl))).getPuzzleGeometryByName(e,{allMoves:!0,orientCenters:!0,addRotations:!0})}async function TL(e,t){let r=await e,n=r.getKPuzzleDefinition(!0);n.name=t;let l=await Promise.resolve().then(()=>(ll(),nl)),o=new l.ExperimentalPGNotation(r,r.getOrbitsDef(!0));return new De(n,{experimentalPGNotation:o})}function l1(e){return new ar(async t=>{let r=await e();console.log(r),t({quantumMoveOrder:n=>r.moveToTransformation(new B(n)).repetitionOrder()})})}var Ai,Si,xi,Rt,ur,Xt=F(()=>{"use strict";We();no();At();ae();_t();Rt=class{constructor(t){Z(this,Ai,void 0);Z(this,Si,void 0);Z(this,xi,void 0);this.puzzleSpecificSimplifyOptionsPromise=l1(this.kpuzzle.bind(this));this.pgId=t.pgID,this.id=t.id,this.fullName=t.fullName,this.inventedBy=t.inventedBy,this.inventionYear=t.inventionYear}pg(){return R(this,Ai)??V(this,Ai,cn(this.pgId??this.id))}kpuzzle(){return R(this,Si)??V(this,Si,TL(this.pg(),this.id))}svg(){return R(this,xi)??V(this,xi,(async()=>(await this.pg()).generatesvg())())}};Ai=new WeakMap,Si=new WeakMap,xi=new WeakMap;ur=class extends Rt{constructor(){super(...arguments);this.stickerings=Zn}stickeringMask(r){return sr(this,r)}}});var zt,o1=F(()=>{"use strict";zt={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]}}}};zt.moves.Rv=zt.moves.x;zt.moves.Uv=zt.moves.y;zt.moves.Fv=zt.moves.z;zt.moves.Lv={CORNERS:{permutation:[1,7,6,2,0,3,5,4],orientation:[2,1,2,1,1,2,1,2]}};zt.moves.Dv={CORNERS:{permutation:[3,0,1,2,5,6,7,4],orientation:[0,0,0,0,0,0,0,0]}};zt.moves.Bv={CORNERS:{permutation:[4,7,1,0,5,3,2,6],orientation:[1,2,1,2,2,1,2,1]}}});var i1,s1=F(()=>{"use strict";i1=\`<?xml version="1.0" encoding="UTF-8"?>
20
20
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
21
21
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
22
22
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 530 394" preserveAspectRatio="xMidYMid meet">
@@ -60,7 +60,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
60
60
  <use id="CORNERS-l7-o2" xlink:href="#sticker" transform="translate(6.6, 3.2)" style="fill: #26f"/>
61
61
  </g>
62
62
 
63
- </svg>\`});var a1,s1=A(()=>{"use strict";a1={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 f1,u1=A(()=>{"use strict";f1=\`<?xml version="1.0" encoding="UTF-8"?>
63
+ </svg>\`});var a1,f1=F(()=>{"use strict";a1={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 u1,g1=F(()=>{"use strict";u1=\`<?xml version="1.0" encoding="UTF-8"?>
64
64
  <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">
65
65
  <title>clock</title>
66
66
  <defs>
@@ -428,7 +428,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
428
428
  </g>
429
429
  </g>
430
430
  </g>
431
- </svg>\`});var g1,c1=A(()=>{"use strict";g1=\`<?xml version="1.0" encoding="UTF-8"?>
431
+ </svg>\`});var c1,p1=F(()=>{"use strict";c1=\`<?xml version="1.0" encoding="UTF-8"?>
432
432
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
433
433
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
434
434
  <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">
@@ -515,7 +515,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
515
515
  <use id="EDGES-l4-o1" xlink:href="#stickerV" transform="translate(1, 1)" style="fill: red"/>
516
516
  </g>
517
517
 
518
- </svg>\`});var p1,m1=A(()=>{"use strict";p1={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 L1,B1=A(()=>{"use strict";L1=\`<?xml version="1.0" encoding="UTF-8"?>
518
+ </svg>\`});var m1,L1=F(()=>{"use strict";m1={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 B1,d1=F(()=>{"use strict";B1=\`<?xml version="1.0" encoding="UTF-8"?>
519
519
  <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">
520
520
  <!-- Generator: Sketch 59.1 (86144) - https://sketch.com -->
521
521
  <title>sq1-fancy</title>
@@ -809,7 +809,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
809
809
  <line x1="0.15767665" y1="262.276878" x2="70.4345542" y2="2.27488928e-16" id="TOP"></line>
810
810
  </g>
811
811
  </g>
812
- </svg>\`});var ke,IL,d1,R1=A(()=>{"use strict";ke=new Array(64).fill(0),IL=ke.map((e,t)=>t),d1={name:"Melinda's 2x2x2x2",orbits:{CORNERS:{numPieces:64,numOrientations:1}},startStateData:{CORNERS:{pieces:IL,orientation:ke}},moves:{Rx:{CORNERS:{permutation:[16,19,17,18,20,22,23,21,4,7,5,6,0,2,3,1,28,30,31,29,24,27,25,26,8,10,11,9,12,15,13,14,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Ry:{CORNERS:{permutation:[12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,28,29,30,31,16,17,18,19,20,21,22,23,24,25,26,27,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Rz:{CORNERS:{permutation:[4,6,7,5,20,23,21,22,24,26,27,25,8,11,9,10,0,3,1,2,16,18,19,17,28,31,29,30,12,14,15,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Lx:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,48,51,49,50,52,54,55,53,36,39,37,38,32,34,35,33,60,62,63,61,56,59,57,58,40,42,43,41,44,47,45,46],orientation:ke}},Ly:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,44,45,46,47,32,33,34,35,36,37,38,39,40,41,42,43,60,61,62,63,48,49,50,51,52,53,54,55,56,57,58,59],orientation:ke}},Lz:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,38,39,37,52,55,53,54,56,58,59,57,40,43,41,42,32,35,33,34,48,50,51,49,60,63,61,62,44,46,47,45],orientation:ke}},Mx:{CORNERS:{permutation:[0,1,2,3,20,22,23,21,4,7,5,6,12,13,14,15,16,17,18,19,24,27,25,26,8,10,11,9,28,29,30,31,48,51,49,50,36,37,38,39,40,41,42,43,32,34,35,33,60,62,63,61,52,53,54,55,56,57,58,59,44,47,45,46],orientation:ke}},My:{CORNERS:{permutation:[0,1,2,3,9,8,11,10,45,44,47,46,12,13,14,15,16,17,18,19,25,24,27,26,61,60,63,62,28,29,30,31,5,4,7,6,36,37,38,39,40,41,42,43,33,32,35,34,21,20,23,22,52,53,54,55,56,57,58,59,49,48,51,50],orientation:ke}},Mz:{CORNERS:{permutation:[0,1,2,3,34,33,35,32,47,45,44,46,12,13,14,15,16,17,18,19,7,5,4,6,10,9,11,8,28,29,30,31,51,49,48,50,36,37,38,39,40,41,42,43,62,61,63,60,22,21,23,20,52,53,54,55,56,57,58,59,27,25,24,26],orientation:ke}},Ox:{CORNERS:{permutation:[16,19,17,18,4,5,6,7,8,9,10,11,0,2,3,1,28,30,31,29,20,21,22,23,24,25,26,27,12,15,13,14,32,33,34,35,52,54,55,53,36,39,37,38,44,45,46,47,48,49,50,51,56,59,57,58,40,42,43,41,60,61,62,63],orientation:ke}},Oy:{CORNERS:{permutation:[37,36,39,38,4,5,6,7,8,9,10,11,1,0,3,2,53,52,55,54,20,21,22,23,24,25,26,27,17,16,19,18,32,33,34,35,41,40,43,42,13,12,15,14,44,45,46,47,48,49,50,51,57,56,59,58,29,28,31,30,60,61,62,63],orientation:ke}},Oz:{CORNERS:{permutation:[19,17,16,18,4,5,6,7,8,9,10,11,30,29,31,28,54,53,55,52,20,21,22,23,24,25,26,27,59,57,56,58,32,33,34,35,2,1,3,0,15,13,12,14,44,45,46,47,48,49,50,51,39,37,36,38,42,41,43,40,60,61,62,63],orientation:ke}},U2:{CORNERS:{permutation:[40,41,42,43,44,45,46,47,32,33,34,35,36,37,38,39,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},D2:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,56,57,58,59,60,61,62,63,48,49,50,51,52,53,54,55,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,24,25,26,27,28,29,30,31,16,17,18,19,20,21,22,23],orientation:ke}},F2:{CORNERS:{permutation:[52,53,54,55,48,49,50,51,8,9,10,11,12,13,14,15,36,37,38,39,32,33,34,35,24,25,26,27,28,29,30,31,20,21,22,23,16,17,18,19,40,41,42,43,44,45,46,47,4,5,6,7,0,1,2,3,56,57,58,59,60,61,62,63],orientation:ke}},B2:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,60,61,62,63,56,57,58,59,16,17,18,19,20,21,22,23,44,45,46,47,40,41,42,43,32,33,34,35,36,37,38,39,28,29,30,31,24,25,26,27,48,49,50,51,52,53,54,55,12,13,14,15,8,9,10,11],orientation:ke}},y2:{CORNERS:{permutation:[40,41,42,43,44,45,46,47,32,33,34,35,36,37,38,39,56,57,58,59,60,61,62,63,48,49,50,51,52,53,54,55,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31,16,17,18,19,20,21,22,23],orientation:ke}},z2:{CORNERS:{permutation:[52,53,54,55,48,49,50,51,60,61,62,63,56,57,58,59,36,37,38,39,32,33,34,35,44,45,46,47,40,41,42,43,20,21,22,23,16,17,18,19,28,29,30,31,24,25,26,27,4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11],orientation:ke}}},experimentalDerivedMoves:{x:"Lx Rx"}}});var h1,D1=A(()=>{"use strict";h1=\`<?xml version="1.0" encoding="UTF-8"?>
812
+ </svg>\`});var ke,GL,R1,h1=F(()=>{"use strict";ke=new Array(64).fill(0),GL=ke.map((e,t)=>t),R1={name:"Melinda's 2x2x2x2",orbits:{CORNERS:{numPieces:64,numOrientations:1}},startStateData:{CORNERS:{pieces:GL,orientation:ke}},moves:{Rx:{CORNERS:{permutation:[16,19,17,18,20,22,23,21,4,7,5,6,0,2,3,1,28,30,31,29,24,27,25,26,8,10,11,9,12,15,13,14,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Ry:{CORNERS:{permutation:[12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,28,29,30,31,16,17,18,19,20,21,22,23,24,25,26,27,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Rz:{CORNERS:{permutation:[4,6,7,5,20,23,21,22,24,26,27,25,8,11,9,10,0,3,1,2,16,18,19,17,28,31,29,30,12,14,15,13,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},Lx:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,48,51,49,50,52,54,55,53,36,39,37,38,32,34,35,33,60,62,63,61,56,59,57,58,40,42,43,41,44,47,45,46],orientation:ke}},Ly:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,44,45,46,47,32,33,34,35,36,37,38,39,40,41,42,43,60,61,62,63,48,49,50,51,52,53,54,55,56,57,58,59],orientation:ke}},Lz:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,38,39,37,52,55,53,54,56,58,59,57,40,43,41,42,32,35,33,34,48,50,51,49,60,63,61,62,44,46,47,45],orientation:ke}},Mx:{CORNERS:{permutation:[0,1,2,3,20,22,23,21,4,7,5,6,12,13,14,15,16,17,18,19,24,27,25,26,8,10,11,9,28,29,30,31,48,51,49,50,36,37,38,39,40,41,42,43,32,34,35,33,60,62,63,61,52,53,54,55,56,57,58,59,44,47,45,46],orientation:ke}},My:{CORNERS:{permutation:[0,1,2,3,9,8,11,10,45,44,47,46,12,13,14,15,16,17,18,19,25,24,27,26,61,60,63,62,28,29,30,31,5,4,7,6,36,37,38,39,40,41,42,43,33,32,35,34,21,20,23,22,52,53,54,55,56,57,58,59,49,48,51,50],orientation:ke}},Mz:{CORNERS:{permutation:[0,1,2,3,34,33,35,32,47,45,44,46,12,13,14,15,16,17,18,19,7,5,4,6,10,9,11,8,28,29,30,31,51,49,48,50,36,37,38,39,40,41,42,43,62,61,63,60,22,21,23,20,52,53,54,55,56,57,58,59,27,25,24,26],orientation:ke}},Ox:{CORNERS:{permutation:[16,19,17,18,4,5,6,7,8,9,10,11,0,2,3,1,28,30,31,29,20,21,22,23,24,25,26,27,12,15,13,14,32,33,34,35,52,54,55,53,36,39,37,38,44,45,46,47,48,49,50,51,56,59,57,58,40,42,43,41,60,61,62,63],orientation:ke}},Oy:{CORNERS:{permutation:[37,36,39,38,4,5,6,7,8,9,10,11,1,0,3,2,53,52,55,54,20,21,22,23,24,25,26,27,17,16,19,18,32,33,34,35,41,40,43,42,13,12,15,14,44,45,46,47,48,49,50,51,57,56,59,58,29,28,31,30,60,61,62,63],orientation:ke}},Oz:{CORNERS:{permutation:[19,17,16,18,4,5,6,7,8,9,10,11,30,29,31,28,54,53,55,52,20,21,22,23,24,25,26,27,59,57,56,58,32,33,34,35,2,1,3,0,15,13,12,14,44,45,46,47,48,49,50,51,39,37,36,38,42,41,43,40,60,61,62,63],orientation:ke}},U2:{CORNERS:{permutation:[40,41,42,43,44,45,46,47,32,33,34,35,36,37,38,39,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63],orientation:ke}},D2:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,56,57,58,59,60,61,62,63,48,49,50,51,52,53,54,55,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,24,25,26,27,28,29,30,31,16,17,18,19,20,21,22,23],orientation:ke}},F2:{CORNERS:{permutation:[52,53,54,55,48,49,50,51,8,9,10,11,12,13,14,15,36,37,38,39,32,33,34,35,24,25,26,27,28,29,30,31,20,21,22,23,16,17,18,19,40,41,42,43,44,45,46,47,4,5,6,7,0,1,2,3,56,57,58,59,60,61,62,63],orientation:ke}},B2:{CORNERS:{permutation:[0,1,2,3,4,5,6,7,60,61,62,63,56,57,58,59,16,17,18,19,20,21,22,23,44,45,46,47,40,41,42,43,32,33,34,35,36,37,38,39,28,29,30,31,24,25,26,27,48,49,50,51,52,53,54,55,12,13,14,15,8,9,10,11],orientation:ke}},y2:{CORNERS:{permutation:[40,41,42,43,44,45,46,47,32,33,34,35,36,37,38,39,56,57,58,59,60,61,62,63,48,49,50,51,52,53,54,55,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31,16,17,18,19,20,21,22,23],orientation:ke}},z2:{CORNERS:{permutation:[52,53,54,55,48,49,50,51,60,61,62,63,56,57,58,59,36,37,38,39,32,33,34,35,44,45,46,47,40,41,42,43,20,21,22,23,16,17,18,19,28,29,30,31,24,25,26,27,4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11],orientation:ke}}},experimentalDerivedMoves:{x:"Lx Rx"}}});var D1,F1=F(()=>{"use strict";D1=\`<?xml version="1.0" encoding="UTF-8"?>
813
813
  <svg viewBox="0 0 180 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
814
814
  <title>melindas2x2x2x2</title>
815
815
  <defs>
@@ -968,7 +968,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
968
968
  </g>
969
969
  </g>
970
970
  </g>
971
- </svg>\`});var Ht={};Lt(Ht,{clockJSON:()=>a1,clockSVG:()=>f1,cube2x2x2JSON:()=>Ct,cube2x2x2SVG:()=>o1,melindas2x2x2x2OrbitJSON:()=>d1,melindas2x2x2x2OrbitSVG:()=>h1,pyraminxSVG:()=>g1,sq1HyperOrbitJSON:()=>p1,sq1HyperOrbitSVG:()=>L1});var Xt=A(()=>{"use strict";l1();i1();s1();u1();c1();m1();B1();R1();D1()});var co,F1=A(()=>{"use strict";We();fr();At();no();co={id:"2x2x2",fullName:"2\\xD72\\xD72 Cube",kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Xt(),Ht))).cube2x2x2JSON)),svg:async()=>(await Promise.resolve().then(()=>(Xt(),Ht))).cube2x2x2SVG,pg:ce(async()=>gn("2x2x2")),stickeringMask:e=>ir(co,e),stickerings:Zn}});var vi,y1=A(()=>{"use strict";vi={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]}}}};vi.experimentalDerivedMoves={Uw:"u",Lw:"l",Fw:"f",Rw:"r",Bw:"b",Dw:"d",Uv:"y",Lv:"x'",Fv:"z",Rv:"x",Bv:"z'",Dv:"y'","2U":"u U'","2L":"l L'","2F":"f F'","2R":"r R'","2B":"b B'","2D":"d D'"}});function zs(e){let t=e.stateData.CENTERS.pieces[0],r=e.stateData.CENTERS.pieces[5],n=e.stateData.CENTERS.pieces[1],l=n;return t<n&&l--,r<n&&l--,[t,l]}function S1(){if(!TL){let e=["","z","x","z'","x'","x2"].map(r=>E.fromString(r)),t=new E("y");for(let r of e){let n=Ui.algToTransformation(r);for(let l=0;l<4;l++){n=n.applyAlg(t);let[o,i]=zs(n.toKState());A1[o][i]=n.invert()}}}return A1}function x1(e){let[t,r]=zs(e),n=S1()[t][r];return e.applyTransformation(n)}function Ns(e,t){return t.ignorePuzzleOrientation&&(e=x1(e)),t.ignoreCenterOrientation&&(e=new pe(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})),!!e.experimentalToTransformation()?.isIdentityTransformation()}var A1,TL,Ps=A(()=>{"use strict";fe();We();Ms();A1=new Array(6).fill(0).map(()=>new Array(6)),TL=!1});var v1=A(()=>{"use strict";We()});var Ui,Ms=A(()=>{"use strict";We();y1();Ps();Ps();hs();v1();ro();ro();Ui=new De(vi);vi.experimentalIsStateSolved=Ns});function Ke(e,t,r,n){let l=[];for(let o of e){let i=B.fromString(o),{family:a,amount:s}=i;if(![-1,1].includes(s))throw new Error("Invalid config move");l.push({family:a,direction:s,type:t,from:r,to:n})}return l}function U1(e,t){let r=E1[e][t]?.[0];if(!r)throw new Error(\`Could not find a reference move (axis: \${e}, move source type: \${t})\`);return r}function WL(e,t,r,n){if(t+1===r){let c=w1[e].get(t);if(c)return new B(new _(c.family),n*c.direction)}let l=cn[e],{sliceDiameter:o}=l;if(t===0&&r===o){let c=U1(e,5);return new B(new _(c.family),n*c.direction)}let i=t+r>o;i&&([t,r]=[o-r,o-t]);let a=t+1,s=r,f=a===s;f&&(s=null),a===1&&(a=null),f&&a===1&&(s=null),!f&&s===2&&(s=null);let g=U1(e,f?i?1:0:i?3:2);return new B(new _(g.family,s,a),n*g.direction)}function KL(e,t=!0){if(e.length===0)return[];let r=po[e[0].family].axis,n=cn[r],{sliceDiameter:l}=n,o=new Map,i=null;function a(c,p){let L=(o.get(c)??0)+p;t&&(L=L%4+5%4-1),L===0?o.delete(c):o.set(c,L)}let s=0;for(let c of Array.from(e).reverse()){s++;let{moveSourceInfo:p}=po[c.family],L=c.amount*p.direction;switch(p.type){case 0:{let m=(c.innerLayer??1)-1;a(m,L),a(m+1,-L);break}case 1:{let m=l-(c.innerLayer??1);a(m,L),a(m+1,-L);break}case 2:{a((c.outerLayer??1)-1,L),a(c.innerLayer??2,-L);break}case 3:{a(l-(c.innerLayer??2),L),a(l-((c.outerLayer??1)-1),-L);break}case 4:{a(p.from,L),a(p.to,-L);break}case 5:{a(0,L),a(l,-L);break}}[0,2].includes(o.size)&&(i={suffixLength:s,sliceDeltas:new Map(o)})}if(o.size===0)return[];if(!i)return e;let[f,u]=i.sliceDeltas.keys();f>u&&([f,u]=[u,f]);let g=i.sliceDeltas.get(f);return[...e.slice(0,-i.suffixLength),...g!==0?[WL(r,f,u,g)]:[]]}var cn,po,E1,b1,w1,GL,k1,_1=A(()=>{"use strict";fe();cn={["x axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Ke(["R"],0,0,3),...Ke(["L'"],1,0,3),...Ke(["r","Rw"],2,0,2),...Ke(["l'","Lw'"],3,0,2),...Ke(["M'"],4,1,2),...Ke(["x","Uv","Dv'"],5,0,3)]},["y axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Ke(["U"],0,0,3),...Ke(["D'"],1,0,3),...Ke(["u","Uw"],2,0,2),...Ke(["d'","Dw'"],3,0,2),...Ke(["E'"],4,1,2),...Ke(["y","Uv","Dv'"],5,0,3)]},["z axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Ke(["F"],0,0,3),...Ke(["B'"],1,0,3),...Ke(["f","Fw"],2,0,3),...Ke(["b'","Bw'"],3,0,3),...Ke(["S"],4,1,2),...Ke(["z","Fv","Bv'"],5,0,3)]}},po={};for(let[e,t]of Object.entries(cn))for(let r of t.moveSourceInfos)po[r.family]={axis:e,moveSourceInfo:r};E1={};for(let e of Object.keys(cn)){let t={};E1[e]=t;for(let r of cn[e].moveSourceInfos)(t[b1=r.type]??(t[b1]=[])).push(r)}w1={};for(let e of Object.keys(cn)){let t=new Map;w1[e]=t;for(let r of cn[e].moveSourceInfos)t.get(r.from)||t.set(r.from,r)}GL=(e,t)=>po[e.family].axis===po[t.family].axis;k1={quantumMoveOrder:()=>4,axis:{areQuantumMovesSameAxis:GL,simplifySameAxisMoves:KL}}});var QL,C1=A(()=>{"use strict";QL=\`<?xml version="1.0" encoding="UTF-8"?>
971
+ </svg>\`});var Jt={};Lt(Jt,{clockJSON:()=>a1,clockSVG:()=>u1,cube2x2x2JSON:()=>zt,cube2x2x2SVG:()=>i1,melindas2x2x2x2OrbitJSON:()=>R1,melindas2x2x2x2OrbitSVG:()=>D1,pyraminxSVG:()=>c1,sq1HyperOrbitJSON:()=>m1,sq1HyperOrbitSVG:()=>B1});var Zt=F(()=>{"use strict";o1();s1();f1();g1();p1();L1();d1();h1();F1()});var co,y1=F(()=>{"use strict";We();Xt();At();no();co={id:"2x2x2",fullName:"2\\xD72\\xD72 Cube",kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Zt(),Jt))).cube2x2x2JSON)),svg:async()=>(await Promise.resolve().then(()=>(Zt(),Jt))).cube2x2x2SVG,pg:ce(async()=>cn("2x2x2")),stickeringMask:e=>sr(co,e),stickerings:Zn}});var vi,A1=F(()=>{"use strict";vi={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]}}}};vi.experimentalDerivedMoves={Uw:"u",Lw:"l",Fw:"f",Rw:"r",Bw:"b",Dw:"d",Uv:"y",Lv:"x'",Fv:"z",Rv:"x",Bv:"z'",Dv:"y'","2U":"u U'","2L":"l L'","2F":"f F'","2R":"r R'","2B":"b B'","2D":"d D'"}});function za(e){let t=e.stateData.CENTERS.pieces[0],r=e.stateData.CENTERS.pieces[5],n=e.stateData.CENTERS.pieces[1],l=n;return t<n&&l--,r<n&&l--,[t,l]}function x1(){if(!WL){let e=["","z","x","z'","x'","x2"].map(r=>E.fromString(r)),t=new E("y");for(let r of e){let n=Ui.algToTransformation(r);for(let l=0;l<4;l++){n=n.applyAlg(t);let[o,i]=za(n.toKState());S1[o][i]=n.invert()}}}return S1}function v1(e){let[t,r]=za(e),n=x1()[t][r];return e.applyTransformation(n)}function Na(e,t){return t.ignorePuzzleOrientation&&(e=v1(e)),t.ignoreCenterOrientation&&(e=new pe(e.kpuzzle,{EDGES:e.stateData.EDGES,CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})),!!e.experimentalToTransformation()?.isIdentityTransformation()}var S1,WL,Pa=F(()=>{"use strict";ae();We();Ma();S1=new Array(6).fill(0).map(()=>new Array(6)),WL=!1});var U1=F(()=>{"use strict"});var b1=F(()=>{"use strict";We();Xt()});var Ui,Ma=F(()=>{"use strict";We();A1();Pa();U1();Pa();ha();b1();ro();ro();Ui=new De(vi);vi.experimentalIsStateSolved=Na});function Qe(e,t,r,n){let l=[];for(let o of e){let i=B.fromString(o),{family:s,amount:a}=i;if(![-1,1].includes(a))throw new Error("Invalid config move");l.push({family:s,direction:a,type:t,from:r,to:n})}return l}function E1(e,t){let r=k1[e][t]?.[0];if(!r)throw new Error(\`Could not find a reference move (axis: \${e}, move source type: \${t})\`);return r}function QL(e,t,r,n){if(t+1===r){let c=_1[e].get(t);if(c)return new B(new _(c.family),n*c.direction)}let l=pn[e],{sliceDiameter:o}=l;if(t===0&&r===o){let c=E1(e,5);return new B(new _(c.family),n*c.direction)}let i=t+r>o;i&&([t,r]=[o-r,o-t]);let s=t+1,a=r,f=s===a;f&&(a=null),s===1&&(s=null),f&&s===1&&(a=null),!f&&a===2&&(a=null);let g=E1(e,f?i?1:0:i?3:2);return new B(new _(g.family,a,s),n*g.direction)}function jL(e,t=!0){if(e.length===0)return[];let r=po[e[0].family].axis,n=pn[r],{sliceDiameter:l}=n,o=new Map,i=null;function s(c,p){let L=(o.get(c)??0)+p;t&&(L=L%4+5%4-1),L===0?o.delete(c):o.set(c,L)}let a=0;for(let c of Array.from(e).reverse()){a++;let{moveSourceInfo:p}=po[c.family],L=c.amount*p.direction;switch(p.type){case 0:{let m=(c.innerLayer??1)-1;s(m,L),s(m+1,-L);break}case 1:{let m=l-(c.innerLayer??1);s(m,L),s(m+1,-L);break}case 2:{s((c.outerLayer??1)-1,L),s(c.innerLayer??2,-L);break}case 3:{s(l-(c.innerLayer??2),L),s(l-((c.outerLayer??1)-1),-L);break}case 4:{s(p.from,L),s(p.to,-L);break}case 5:{s(0,L),s(l,-L);break}}[0,2].includes(o.size)&&(i={suffixLength:a,sliceDeltas:new Map(o)})}if(o.size===0)return[];if(!i)return e;let[f,u]=i.sliceDeltas.keys();f>u&&([f,u]=[u,f]);let g=i.sliceDeltas.get(f);return[...e.slice(0,-i.suffixLength),...g!==0?[QL(r,f,u,g)]:[]]}var pn,po,k1,w1,_1,KL,C1,z1=F(()=>{"use strict";ae();pn={["x axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Qe(["R"],0,0,3),...Qe(["L'"],1,0,3),...Qe(["r","Rw"],2,0,2),...Qe(["l'","Lw'"],3,0,2),...Qe(["M'"],4,1,2),...Qe(["x","Uv","Dv'"],5,0,3)]},["y axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Qe(["U"],0,0,3),...Qe(["D'"],1,0,3),...Qe(["u","Uw"],2,0,2),...Qe(["d'","Dw'"],3,0,2),...Qe(["E'"],4,1,2),...Qe(["y","Uv","Dv'"],5,0,3)]},["z axis"]:{sliceDiameter:3,extendsThroughEntirePuzzle:!0,moveSourceInfos:[...Qe(["F"],0,0,3),...Qe(["B'"],1,0,3),...Qe(["f","Fw"],2,0,3),...Qe(["b'","Bw'"],3,0,3),...Qe(["S"],4,1,2),...Qe(["z","Fv","Bv'"],5,0,3)]}},po={};for(let[e,t]of Object.entries(pn))for(let r of t.moveSourceInfos)po[r.family]={axis:e,moveSourceInfo:r};k1={};for(let e of Object.keys(pn)){let t={};k1[e]=t;for(let r of pn[e].moveSourceInfos)(t[w1=r.type]??(t[w1]=[])).push(r)}_1={};for(let e of Object.keys(pn)){let t=new Map;_1[e]=t;for(let r of pn[e].moveSourceInfos)t.get(r.from)||t.set(r.from,r)}KL=(e,t)=>po[e.family].axis===po[t.family].axis;C1={quantumMoveOrder:()=>4,axis:{areQuantumMovesSameAxis:KL,simplifySameAxisMoves:jL}}});var qL,N1=F(()=>{"use strict";qL=\`<?xml version="1.0" encoding="UTF-8"?>
972
972
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
973
973
  "http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg11.dtd">
974
974
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 518 440" preserveAspectRatio="xMidYMid meet">
@@ -1115,7 +1115,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1115
1115
  </g>
1116
1116
 
1117
1117
  </svg>
1118
- \`});var jL,z1=A(()=>{"use strict";jL=\`<?xml version="1.0" encoding="UTF-8"?>
1118
+ \`});var VL,P1=F(()=>{"use strict";VL=\`<?xml version="1.0" encoding="UTF-8"?>
1119
1119
  <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">
1120
1120
  <title>3x3x3 LL</title>
1121
1121
  <defs>
@@ -1222,7 +1222,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1222
1222
  <use id="CENTERS-l5-o2" xlink:href="#sticker" style="fill: yellow"/>
1223
1223
  <use id="CENTERS-l5-o3" xlink:href="#sticker" style="fill: yellow"/>
1224
1224
  </g>
1225
- </svg>\`});var Os={};Lt(Os,{cube3x3x3LLSVG:()=>jL,cube3x3x3SVG:()=>QL});var Is=A(()=>{"use strict";C1();z1()});var Ts,N1=A(()=>{"use strict";fr();At();Ms();no();_1();Ts={id:"3x3x3",fullName:"3\\xD73\\xD73 Cube",inventedBy:["Ern\\u0151 Rubik"],inventionYear:1974,kpuzzle:ce(async()=>Ui),svg:ce(async()=>(await Promise.resolve().then(()=>(Is(),Os))).cube3x3x3SVG),llSVG:ce(async()=>(await Promise.resolve().then(()=>(Is(),Os))).cube3x3x3LLSVG),pg:ce(async()=>gn("3x3x3")),stickeringMask:e=>ir(Ts,e),stickerings:Zn,puzzleSpecificSimplifyOptions:k1}});var P1,M1=A(()=>{"use strict";We();At();P1={id:"clock",fullName:"Clock",inventedBy:["Christopher C. Wiggs","Christopher J. Taylor"],inventionYear:1988,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Xt(),Ht))).clockJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Xt(),Ht))).clockSVG)}});async function O1(e,t){let r=await e.kpuzzle(),n=new Xn(r),l=new Jn(r),o=()=>l.and([l.move("U"),l.not(l.or(l.moves(["F","BL","BR"])))]),i=()=>l.and([l.move("U"),l.not(l.move("F"))]),a=()=>l.or([i(),l.and([l.move("F"),l.not(l.or(l.moves(["U","BL","BR"])))])]),s=()=>l.not(l.or([l.and([l.move("U"),l.move("F")]),l.and([l.move("F"),l.move("BL")]),l.and([l.move("F"),l.move("BR")]),l.and([l.move("BL"),l.move("BR")])])),f=()=>l.not(l.or([l.and([l.move("F"),l.move("BL")]),l.and([l.move("F"),l.move("BR")]),l.and([l.move("BL"),l.move("BR")])]));switch(t){case"full":break;case"experimental-fto-fc":{n.set(l.not(o()),"Ignored");break}case"experimental-fto-f2t":{n.set(l.not(i()),"Ignored"),n.set(o(),"Dim");break}case"experimental-fto-sc":{n.set(l.not(a()),"Ignored"),n.set(i(),"Dim");break}case"experimental-fto-l2c":{n.set(l.not(s()),"Ignored"),n.set(a(),"Dim");break}case"experimental-fto-lbt":{n.set(l.not(f()),"Ignored"),n.set(s(),"Dim");break}case"experimental-fto-l3t":{n.set(f(),"Dim");break}default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(l.and(l.moves([])),"Dim")}return n.toStickeringMask()}async function I1(){return["full","experimental-fto-fc","experimental-fto-f2t","experimental-fto-sc","experimental-fto-l2c","experimental-fto-lbt","experimental-fto-l3t"]}var T1=A(()=>{"use strict";ro()});var G1,W1=A(()=>{"use strict";G1=\`<?xml version="1.0" encoding="UTF-8"?>
1225
+ </svg>\`});var Oa={};Lt(Oa,{cube3x3x3LLSVG:()=>VL,cube3x3x3SVG:()=>qL});var Ia=F(()=>{"use strict";N1();P1()});var Ta,M1=F(()=>{"use strict";Xt();At();Ma();no();z1();Ta={id:"3x3x3",fullName:"3\\xD73\\xD73 Cube",inventedBy:["Ern\\u0151 Rubik"],inventionYear:1974,kpuzzle:ce(async()=>Ui),svg:ce(async()=>(await Promise.resolve().then(()=>(Ia(),Oa))).cube3x3x3SVG),llSVG:ce(async()=>(await Promise.resolve().then(()=>(Ia(),Oa))).cube3x3x3LLSVG),pg:ce(async()=>cn("3x3x3")),stickeringMask:e=>sr(Ta,e),stickerings:Zn,puzzleSpecificSimplifyOptions:C1}});var O1,I1=F(()=>{"use strict";We();At();O1={id:"clock",fullName:"Clock",inventedBy:["Christopher C. Wiggs","Christopher J. Taylor"],inventionYear:1988,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Zt(),Jt))).clockJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Zt(),Jt))).clockSVG)}});async function T1(e,t){let r=await e.kpuzzle(),n=new Xn(r),l=new Jn(r),o=()=>l.and([l.move("U"),l.not(l.or(l.moves(["F","BL","BR"])))]),i=()=>l.and([l.move("U"),l.not(l.move("F"))]),s=()=>l.or([i(),l.and([l.move("F"),l.not(l.or(l.moves(["U","BL","BR"])))])]),a=()=>l.not(l.or([l.and([l.move("U"),l.move("F")]),l.and([l.move("F"),l.move("BL")]),l.and([l.move("F"),l.move("BR")]),l.and([l.move("BL"),l.move("BR")])])),f=()=>l.not(l.or([l.and([l.move("F"),l.move("BL")]),l.and([l.move("F"),l.move("BR")]),l.and([l.move("BL"),l.move("BR")])]));switch(t){case"full":break;case"experimental-fto-fc":{n.set(l.not(o()),"Ignored");break}case"experimental-fto-f2t":{n.set(l.not(i()),"Ignored"),n.set(o(),"Dim");break}case"experimental-fto-sc":{n.set(l.not(s()),"Ignored"),n.set(i(),"Dim");break}case"experimental-fto-l2c":{n.set(l.not(a()),"Ignored"),n.set(s(),"Dim");break}case"experimental-fto-lbt":{n.set(l.not(f()),"Ignored"),n.set(a(),"Dim");break}case"experimental-fto-l3t":{n.set(f(),"Dim");break}default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`),n.set(l.and(l.moves([])),"Dim")}return n.toStickeringMask()}async function G1(){return["full","experimental-fto-fc","experimental-fto-f2t","experimental-fto-sc","experimental-fto-l2c","experimental-fto-lbt","experimental-fto-l3t"]}var W1=F(()=>{"use strict";ro()});var K1,Q1=F(()=>{"use strict";K1=\`<?xml version="1.0" encoding="UTF-8"?>
1226
1226
  <svg width="2368px" height="1216px" viewBox="0 0 2368 1216" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1227
1227
  <title>fto</title>
1228
1228
  <g id="fto" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linejoin="round">
@@ -1316,7 +1316,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1316
1316
  </g>
1317
1317
  </g>
1318
1318
  </svg>
1319
- \`});var K1,Q1=A(()=>{"use strict";K1=\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
1319
+ \`});var j1,q1=F(()=>{"use strict";j1=\`<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
1320
1320
  <style type="text/css"><![CDATA[.sticker { stroke: #000000; stroke-width: 1px; }]]></style>
1321
1321
  <g><title>U</title>
1322
1322
  <polygon id="CORNERS-l0-o0" class="sticker" style="fill: #ffffff" points="247.941 89.861 283.500 115.696 269.918 157.499 212.382 138.805"/>
@@ -1391,7 +1391,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1391
1391
  <polygon id="CORNERS-l17-o0" class="sticker" style="fill: #999999" points="623.177 410.138 587.618 435.974 552.058 410.138 587.618 361.195"/>
1392
1392
  <polygon id="CORNERS-l14-o0" class="sticker" style="fill: #999999" points="645.154 342.500 658.736 384.303 623.177 410.138 587.618 361.195"/>
1393
1393
  </g></svg>
1394
- \`});var j1,q1=A(()=>{"use strict";j1={name:"redi_cube",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{F:{EDGES:{permutation:[8,0,2,3,4,5,6,7,1,9,10,11],orientation:[0,1,0,0,0,0,0,0,1,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[1,0,0,0,0,0,0,0]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}}},experimentalDerivedMoves:{z:"[x: y]",UR:"[y: F]",U:"[y2: F]",UL:"[y': F]",D:"[x: F]",L:"[z2: F]",R:"[x2: F]",B:"[y2 x: F]"}}});var V1,H1=A(()=>{"use strict";V1=\`<?xml version="1.0" encoding="UTF-8"?>
1394
+ \`});var V1,H1=F(()=>{"use strict";V1={name:"redi_cube",orbits:{EDGES:{numPieces:12,numOrientations:2},CORNERS:{numPieces:8,numOrientations:3}},startStateData:{EDGES:{pieces:[0,1,2,3,4,5,6,7,8,9,10,11],orientation:[0,0,0,0,0,0,0,0,0,0,0,0]},CORNERS:{pieces:[0,1,2,3,4,5,6,7],orientation:[0,0,0,0,0,0,0,0]}},moves:{F:{EDGES:{permutation:[8,0,2,3,4,5,6,7,1,9,10,11],orientation:[0,1,0,0,0,0,0,0,1,0,0,0]},CORNERS:{permutation:[0,1,2,3,4,5,6,7],orientation:[1,0,0,0,0,0,0,0]}},x:{EDGES:{permutation:[4,8,0,9,6,10,2,11,5,7,1,3],orientation:[1,0,1,0,1,0,1,0,0,0,0,0]},CORNERS:{permutation:[4,0,3,5,7,6,2,1],orientation:[2,1,2,1,1,2,1,2]}},y:{EDGES:{permutation:[1,2,3,0,5,6,7,4,10,8,11,9],orientation:[0,0,0,0,0,0,0,0,1,1,1,1]},CORNERS:{permutation:[1,2,3,0,7,4,5,6],orientation:[0,0,0,0,0,0,0,0]}}},experimentalDerivedMoves:{z:"[x: y]",UR:"[y: F]",U:"[y2: F]",UL:"[y': F]",D:"[x: F]",L:"[z2: F]",R:"[x2: F]",B:"[y2 x: F]"}}});var X1,J1=F(()=>{"use strict";X1=\`<?xml version="1.0" encoding="UTF-8"?>
1395
1395
  <svg width="546px" height="418px" viewBox="-20 -20 546 418" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1396
1396
  <title>redi-cube</title>
1397
1397
  <g istroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -1543,7 +1543,7 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1543
1543
  </g>
1544
1544
  </g>
1545
1545
  </svg>
1546
- \`});var mo={};Lt(mo,{ftoSVG:()=>G1,kilominxSVG:()=>K1,rediCubeJSON:()=>j1,rediCubeSVG:()=>V1});var Lo=A(()=>{"use strict";W1();Q1();q1();H1()});var Gs,X1,J1=A(()=>{"use strict";fr();At();T1();Gs=class extends Rt{constructor(){super({pgID:"FTO",id:"fto",fullName:"Face-Turning Octahedron",inventedBy:["Karl Rohrbach","David Pitcher"],inventionYear:1983});this.stickerings=I1;this.svg=ce(async()=>(await Promise.resolve().then(()=>(Lo(),mo))).ftoSVG)}stickeringMask(r){return O1(this,r)}},X1=new Gs});async function Z1(e,t){switch(console.log(e,t),t){case"full":case"F2L":case"LL":case"OLL":case"EOLL":case"OCLL":case"PLL":case"ELS":case"CLS":return ir(e,t);default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`)}return ir(e,"full")}async function Y1(){return["full","F2L","LL","OLL","EOLL","OCLL","PLL","ELS","CLS"]}var $1=A(()=>{"use strict";no()});var Ws,eu,tu=A(()=>{"use strict";fr();$1();Ws=class extends Rt{constructor(){super({id:"megaminx",fullName:"Megaminx",inventionYear:1981});this.stickerings=Y1}stickeringMask(r){return Z1(this,r)}},eu=new Ws});var Ks,ru,nu=A(()=>{"use strict";fr();At();Ks=class extends Rt{constructor(){super({id:"pyraminx",fullName:"Pyraminx",inventedBy:["Uwe Meffert"]});this.svg=ce(async()=>(await Promise.resolve().then(()=>(Xt(),Ht))).pyraminxSVG)}},ru=new Ks});var lu,ou=A(()=>{"use strict";We();At();lu={id:"square1",fullName:"Square-1",inventedBy:["Karel Hr\\u0161el","Vojtech Kopsk\\xFD"],inventionYear:1990,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Xt(),Ht))).sq1HyperOrbitJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Xt(),Ht))).sq1HyperOrbitSVG)}});var iu,au=A(()=>{"use strict";We();fr();At();iu={id:"kilominx",fullName:"Kilominx",kpuzzle:ce(async()=>{let e=await gn("megaminx + chopasaurus"),t=JSON.parse(JSON.stringify(e.getKPuzzleDefinition(!0)));delete t.orbits.CENTERS,delete t.orbits.CENTERS2,delete t.startStateData.CENTERS,delete t.startStateData.CENTERS2;for(let i of Object.values(t.moves))delete i.CENTERS,delete i.CENTERS2;t.name="kilominx",delete t.experimentalPuzzleDescription;let r=await Promise.resolve().then(()=>(ll(),nl)),n=new r.ExperimentalPGNotation(e,e.getOrbitsDef(!0)),l=new De(t,{experimentalPGNotation:{lookupMove:i=>i.toString()==="x2"||i.toString()==="x2'"?o.transformationData:n.lookupMove(i)}}),o=l.algToTransformation("Rv2 Fv Uv'");return t.moves.x2=o,l}),svg:ce(async()=>(await Promise.resolve().then(()=>(Lo(),mo))).kilominxSVG)}});var su,fu=A(()=>{"use strict";We();At();su={id:"redi_cube",fullName:"Redi Cube",inventedBy:["Oskar van Deventer"],inventionYear:2009,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Lo(),mo))).rediCubeJSON)),svg:async()=>(await Promise.resolve().then(()=>(Lo(),mo))).rediCubeSVG}});var qL,uu=A(()=>{"use strict";qL=\`<svg
1546
+ \`});var mo={};Lt(mo,{ftoSVG:()=>K1,kilominxSVG:()=>j1,rediCubeJSON:()=>V1,rediCubeSVG:()=>X1});var Lo=F(()=>{"use strict";Q1();q1();H1();J1()});var Ga,Z1,Y1=F(()=>{"use strict";Xt();At();W1();Ga=class extends Rt{constructor(){super({pgID:"FTO",id:"fto",fullName:"Face-Turning Octahedron",inventedBy:["Karl Rohrbach","David Pitcher"],inventionYear:1983});this.stickerings=G1;this.svg=ce(async()=>(await Promise.resolve().then(()=>(Lo(),mo))).ftoSVG)}stickeringMask(r){return T1(this,r)}},Z1=new Ga});async function $1(e,t){switch(console.log(e,t),t){case"full":case"F2L":case"LL":case"OLL":case"EOLL":case"OCLL":case"PLL":case"ELS":case"CLS":return sr(e,t);default:console.warn(\`Unsupported stickering for \${e.id}: \${t}. Setting all pieces to dim.\`)}return sr(e,"full")}async function eu(){return["full","F2L","LL","OLL","EOLL","OCLL","PLL","ELS","CLS"]}var tu=F(()=>{"use strict";no()});var Wa,ru,nu=F(()=>{"use strict";Xt();tu();Wa=class extends Rt{constructor(){super({id:"megaminx",fullName:"Megaminx",inventionYear:1981});this.stickerings=eu}stickeringMask(r){return $1(this,r)}},ru=new Wa});var Ka,lu,ou=F(()=>{"use strict";Xt();At();Ka=class extends Rt{constructor(){super({id:"pyraminx",fullName:"Pyraminx",inventedBy:["Uwe Meffert"]});this.svg=ce(async()=>(await Promise.resolve().then(()=>(Zt(),Jt))).pyraminxSVG)}},lu=new Ka});var iu,su=F(()=>{"use strict";We();At();iu={id:"square1",fullName:"Square-1",inventedBy:["Karel Hr\\u0161el","Vojtech Kopsk\\xFD"],inventionYear:1990,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Zt(),Jt))).sq1HyperOrbitJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Zt(),Jt))).sq1HyperOrbitSVG)}});var au,fu=F(()=>{"use strict";We();Xt();At();au={id:"kilominx",fullName:"Kilominx",kpuzzle:ce(async()=>{let e=await cn("megaminx + chopasaurus"),t=JSON.parse(JSON.stringify(e.getKPuzzleDefinition(!0)));delete t.orbits.CENTERS,delete t.orbits.CENTERS2,delete t.startStateData.CENTERS,delete t.startStateData.CENTERS2;for(let i of Object.values(t.moves))delete i.CENTERS,delete i.CENTERS2;t.name="kilominx",delete t.experimentalPuzzleDescription;let r=await Promise.resolve().then(()=>(ll(),nl)),n=new r.ExperimentalPGNotation(e,e.getOrbitsDef(!0)),l=new De(t,{experimentalPGNotation:{lookupMove:i=>i.toString()==="x2"||i.toString()==="x2'"?o.transformationData:n.lookupMove(i)}}),o=l.algToTransformation("Rv2 Fv Uv'");return t.moves.x2=o,l}),svg:ce(async()=>(await Promise.resolve().then(()=>(Lo(),mo))).kilominxSVG)}});var uu,gu=F(()=>{"use strict";We();At();uu={id:"redi_cube",fullName:"Redi Cube",inventedBy:["Oskar van Deventer"],inventionYear:2009,kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Lo(),mo))).rediCubeJSON)),svg:async()=>(await Promise.resolve().then(()=>(Lo(),mo))).rediCubeSVG}});var HL,cu=F(()=>{"use strict";HL=\`<svg
1547
1547
  height="256"
1548
1548
  viewBox="0 0 256 256"
1549
1549
  width="256"
@@ -1661,8 +1661,8 @@ Vertex distance \${this.vertexdistance}\`}writeSchreierSims(t){let n=this.getOrb
1661
1661
  <path id="CORNERS-l5-o1" d="m18 3v1h-1v-1z" style="fill: red" />
1662
1662
  </g>
1663
1663
  </g>
1664
- </svg>\`});var gu={};Lt(gu,{cube4x4x4LLSVG:()=>qL});var cu=A(()=>{"use strict";uu()});var Qs,pu=A(()=>{"use strict";fr();At();Qs=new sr({id:"4x4x4",fullName:"4\\xD74\\xD74 Cube"});Qs.llSVG=ce(async()=>(await Promise.resolve().then(()=>(cu(),gu))).cube4x4x4LLSVG)});var mu,Lu=A(()=>{"use strict";We();At();mu={id:"melindas2x2x2x2",fullName:"Melinda's 2x2x2x2",inventedBy:["Melinda Green"],kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Xt(),Ht))).melindas2x2x2x2OrbitJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Xt(),Ht))).melindas2x2x2x2OrbitSVG)}});var Oe,ur=A(()=>{"use strict";Ff();fr();F1();N1();M1();J1();tu();nu();ou();au();fu();pu();Lu();Oe={"3x3x3":Ts,"2x2x2":co,"4x4x4":Qs,"5x5x5":new sr({id:"5x5x5",fullName:"5\\xD75\\xD75 Cube"}),"6x6x6":new sr({id:"6x6x6",fullName:"6\\xD76\\xD76 Cube"}),"7x7x7":new sr({id:"7x7x7",fullName:"7\\xD77\\xD77 Cube"}),"40x40x40":new sr({id:"40x40x40",fullName:"40\\xD740\\xD740 Cube"}),clock:P1,megaminx:eu,pyraminx:ru,skewb:new Rt({id:"skewb",fullName:"Skewb",inventedBy:["Tony Durham"]}),square1:lu,fto:X1,gigaminx:new Rt({id:"gigaminx",fullName:"Gigaminx",inventedBy:["Tyler Fox"],inventionYear:2006}),master_tetraminx:new Rt({pgID:"master tetraminx",id:"master_tetraminx",fullName:"Master Tetraminx",inventedBy:["Katsuhiko Okamoto"],inventionYear:2002}),kilominx:iu,redi_cube:su,melindas2x2x2x2:mu}});function du(e){Bu=e}function be(){if(!Bu)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 Bu,St=A(()=>{"use strict";Bu=!1});async function Ru(){if(globalThis?.crypto?.getRandomValues)return crypto.getRandomValues.bind(crypto);{let e=(await(VL??(VL=import(XL())))).webcrypto;return e.getRandomValues.bind(e)}}var VL,HL,XL,hu=A(()=>{"use strict";VL=null,HL="cr-yp-to",XL=()=>HL.replace(/-/g,"")});function YL(e){let t=new Uint32Array(2);e(t);let r=t[0],n=t[1];return Math.floor(r*JL)+Math.floor(n/ZL)}function $L(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>Du)throw new Error(\`Called randomInt.below() with max === \${e}, which is larger than JavaScript can handle with integer precision.\`)}async function Ee(){let e=await Ru(),t=r=>{$L(r);let n=YL(e),l=Math.floor(Du/r)*r;return n<l?n%r:t(r)};return t}var Du,JL,ZL,bi=A(()=>{"use strict";hu();Du=9007199254740992,JL=2097152,ZL=2048});async function gr(){let e=await Ee();return t=>t[e(t.length)]}var Fu=A(()=>{"use strict";bi()});async function yu(e){for(let t=1;t<e.length;t++){let r=(await eB)(t);[e[t],e[r]]=[e[r],e[t]]}}var eB,xt=A(()=>{"use strict";Fu();bi();bi();eB=Ee()});function Qe(e){return new pn(t=>{t(e())})}var pn,Jt=A(()=>{"use strict";pn=class extends Promise{constructor(t){super(r=>{r()}),this._executor=t}static from(t){return new pn(r=>{r(t())})}static resolve(t){return new pn(r=>{r(t)})}static reject(t){return new pn((r,n)=>{n(t)})}then(t,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(t,r)}catch(t){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(t)}}});function Zt(e,t){let r=[],n=[];for(let u of t.split(\`
1665
- \`)){let g=u.split(" ");if(!u.startsWith("SetOrder ")){if(u.startsWith("Alg ")){let c=E.fromString(u.substring(4));n.push({alg:c,transformation:e.algToTransformation(c)})}else if(u.startsWith("SubgroupSizes "))for(let c=1;c<g.length;c++)r.push(parseInt(g[c]))}}let l={ordering:new Array(r.length)},o=[],i=0;o.push(0);let a=E.fromString(""),s=e.identityTransformation();for(let u=0;u<r.length;u++)i+=r[u],o.push(i),n.splice(i-1,0,{alg:a,transformation:s});if(n.length!==i)throw Error(\`Bad sgs; expected \${i-r.length} algs but saw \${n.length-r.length}\`);let f={};for(let u in e.definition.orbits){let g=e.definition.orbits[u];f[u]=new Array(g.numPieces).fill(!1)}for(let u=r.length-1;u>=0;u--){let g=[];for(let p=o[u];p<o[u+1];p++){let L=n[p].transformation;for(let m in e.definition.orbits){let d=e.definition.orbits[m];for(let D=0;D<d.numPieces;D++)(L.transformationData[m].permutation[D]!==D||L.transformationData[m].orientation[D]!==0)&&(f[m][D]||(g.push({orbitName:m,permutationIdx:D}),f[m][D]=!0))}}let c={};for(let p=o[u];p<o[u+1];p++){let L=n[p].transformation.invert(),m="";for(let d=0;d<g.length;d++){let D=g[d];m=\`\${m} \${L.transformationData[D.orbitName].permutation[D.permutationIdx]} \${L.transformationData[D.orbitName].orientation[D.permutationIdx]}\`}c[m]=n[p],n[p].alg=n[p].alg.invert(),n[p].transformation=n[p].transformation.invert()}l.ordering[u]={pieceOrdering:g,lookup:c}}return l}var ol=A(()=>{"use strict";fe()});async function Su(){return gB??(gB=cB())}async function cB(){return Zt(await co.kpuzzle(),\`SubgroupSizes 24 21 18 15 12 9 6
1664
+ </svg>\`});var pu={};Lt(pu,{cube4x4x4LLSVG:()=>HL});var mu=F(()=>{"use strict";cu()});var Qa,Lu=F(()=>{"use strict";Xt();At();Qa=new ur({id:"4x4x4",fullName:"4\\xD74\\xD74 Cube"});Qa.llSVG=ce(async()=>(await Promise.resolve().then(()=>(mu(),pu))).cube4x4x4LLSVG)});var Bu,du=F(()=>{"use strict";We();At();Bu={id:"melindas2x2x2x2",fullName:"Melinda's 2\\xD72\\xD72\\xD72",inventedBy:["Melinda Green"],kpuzzle:ce(async()=>new De((await Promise.resolve().then(()=>(Zt(),Jt))).melindas2x2x2x2OrbitJSON)),svg:ce(async()=>(await Promise.resolve().then(()=>(Zt(),Jt))).melindas2x2x2x2OrbitSVG)}});var Oe,gr=F(()=>{"use strict";Ff();Xt();y1();M1();I1();Y1();nu();ou();su();fu();gu();Lu();du();Oe={"3x3x3":Ta,"2x2x2":co,"4x4x4":Qa,"5x5x5":new ur({id:"5x5x5",fullName:"5\\xD75\\xD75 Cube"}),"6x6x6":new ur({id:"6x6x6",fullName:"6\\xD76\\xD76 Cube"}),"7x7x7":new ur({id:"7x7x7",fullName:"7\\xD77\\xD77 Cube"}),"40x40x40":new ur({id:"40x40x40",fullName:"40\\xD740\\xD740 Cube"}),clock:O1,megaminx:ru,pyraminx:lu,skewb:new Rt({id:"skewb",fullName:"Skewb",inventedBy:["Tony Durham"]}),square1:iu,fto:Z1,gigaminx:new Rt({id:"gigaminx",fullName:"Gigaminx",inventedBy:["Tyler Fox"],inventionYear:2006}),master_tetraminx:new Rt({pgID:"master tetraminx",id:"master_tetraminx",fullName:"Master Tetraminx",inventedBy:["Katsuhiko Okamoto"],inventionYear:2002}),kilominx:au,redi_cube:uu,melindas2x2x2x2:Bu}});function hu(e){Ru=e}function be(){if(!Ru)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 Ru,St=F(()=>{"use strict";Ru=!1});async function Du(){if(globalThis?.crypto?.getRandomValues)return crypto.getRandomValues.bind(crypto);{let e=(await(XL??(XL=import(ZL())))).webcrypto;return e.getRandomValues.bind(e)}}var XL,JL,ZL,Fu=F(()=>{"use strict";XL=null,JL="cr-yp-to",ZL=()=>JL.replace(/-/g,"")});function eB(e){let t=new Uint32Array(2);e(t);let r=t[0],n=t[1];return Math.floor(r*YL)+Math.floor(n/$L)}function tB(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>yu)throw new Error(\`Called randomInt.below() with max === \${e}, which is larger than JavaScript can handle with integer precision.\`)}async function Ee(){let e=await Du(),t=r=>{tB(r);let n=eB(e),l=Math.floor(yu/r)*r;return n<l?n%r:t(r)};return t}var yu,YL,$L,bi=F(()=>{"use strict";Fu();yu=9007199254740992,YL=2097152,$L=2048});async function cr(){let e=await Ee();return t=>t[e(t.length)]}var Au=F(()=>{"use strict";bi()});async function Su(e){for(let t=1;t<e.length;t++){let r=(await rB)(t);[e[t],e[r]]=[e[r],e[t]]}}var rB,xt=F(()=>{"use strict";Au();bi();bi();rB=Ee()});function Yt(e,t){let r=[],n=[];for(let u of t.split(\`
1665
+ \`)){let g=u.split(" ");if(!u.startsWith("SetOrder ")){if(u.startsWith("Alg ")){let c=E.fromString(u.substring(4));n.push({alg:c,transformation:e.algToTransformation(c)})}else if(u.startsWith("SubgroupSizes "))for(let c=1;c<g.length;c++)r.push(parseInt(g[c]))}}let l={ordering:new Array(r.length)},o=[],i=0;o.push(0);let s=E.fromString(""),a=e.identityTransformation();for(let u=0;u<r.length;u++)i+=r[u],o.push(i),n.splice(i-1,0,{alg:s,transformation:a});if(n.length!==i)throw Error(\`Bad sgs; expected \${i-r.length} algs but saw \${n.length-r.length}\`);let f={};for(let u in e.definition.orbits){let g=e.definition.orbits[u];f[u]=new Array(g.numPieces).fill(!1)}for(let u=r.length-1;u>=0;u--){let g=[];for(let p=o[u];p<o[u+1];p++){let L=n[p].transformation;for(let m in e.definition.orbits){let d=e.definition.orbits[m];for(let D=0;D<d.numPieces;D++)(L.transformationData[m].permutation[D]!==D||L.transformationData[m].orientation[D]!==0)&&(f[m][D]||(g.push({orbitName:m,permutationIdx:D}),f[m][D]=!0))}}let c={};for(let p=o[u];p<o[u+1];p++){let L=n[p].transformation.invert(),m="";for(let d=0;d<g.length;d++){let D=g[d];m=\`\${m} \${L.transformationData[D.orbitName].permutation[D.permutationIdx]} \${L.transformationData[D.orbitName].orientation[D.permutationIdx]}\`}c[m]=n[p],n[p].alg=n[p].alg.invert(),n[p].transformation=n[p].transformation.invert()}l.ordering[u]={pieceOrdering:g,lookup:c}}return l}var ol=F(()=>{"use strict";ae()});async function vu(){return pB??(pB=mB())}async function mB(){return Yt(await co.kpuzzle(),\`SubgroupSizes 24 21 18 15 12 9 6
1666
1666
 
1667
1667
  Alg F
1668
1668
  Alg F2
@@ -1761,7 +1761,7 @@ Alg F D' F L' D F R2 U2 F' U'
1761
1761
  Alg F D' L D' L F D2 L2 B' R'
1762
1762
  Alg F L' D F R2 D2 L D F' U2
1763
1763
  Alg F L' D F2 D' L F L2 F2 U
1764
- Alg F D F' D L2 F R' F' D' B2 U'\`)}var gB,xu=A(()=>{"use strict";ur();ol();gB=null});async function pB(){let{getPuzzleGeometryByName:e,ExperimentalPGNotation:t}=await Promise.resolve().then(()=>(ll(),nl)),r=e("megaminx",{allMoves:!0,addRotations:!0}),n=new De(r.getKPuzzleDefinition(!0),{experimentalPGNotation:new t(r,r.getOrbitsDef(!0))});return n.definition.name="megaminx",n}async function Vs(){return mB??(mB=pB())}async function vu(){return LB??(LB=BB())}async function BB(){return Zt(await Vs(),\`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
1764
+ Alg F D F' D L2 F R' F' D' B2 U'\`)}var pB,Uu=F(()=>{"use strict";gr();ol();pB=null});async function LB(){let{getPuzzleGeometryByName:e,ExperimentalPGNotation:t}=await Promise.resolve().then(()=>(ll(),nl)),r=e("megaminx",{allMoves:!0,addRotations:!0}),n=new De(r.getKPuzzleDefinition(!0),{experimentalPGNotation:new t(r,r.getOrbitsDef(!0))});return n.definition.name="megaminx",n}async function Va(){return BB??(BB=LB())}async function bu(){return dB??(dB=RB())}async function RB(){return Yt(await Va(),\`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
1765
1765
 
1766
1766
  Alg Rv
1767
1767
  Alg Rv2
@@ -3281,7 +3281,7 @@ Alg L' BL2 L2' F' L2 BL2' L2' F L2'
3281
3281
  Alg U BL2' U R U' BL2 U' L U2 R' U2' L'
3282
3282
  Alg U BR U' L2 F L' U BR' U' L F' L2'
3283
3283
  Alg U L' BL2 L' FL' L BL2' L U' L2' FL L2
3284
- Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var mB,LB,Uu=A(()=>{"use strict";We();ol();mB=null;LB=null});async function Hs(){return dB??(dB=RB())}async function bu(){return{ordering:(await Hs()).ordering.slice(2)}}async function RB(){return Zt(await Oe.pyraminx.kpuzzle(),\`SubgroupSizes 12 9 12 3 10 3 8 6 2 3 3 3 3
3284
+ Alg U BR2' U R' U2' L U2 R U' BR2 U' L'\`)}var BB,dB,Eu=F(()=>{"use strict";We();ol();BB=null;dB=null});async function Ha(){return hB??(hB=DB())}async function wu(){return{ordering:(await Ha()).ordering.slice(2)}}async function DB(){return Yt(await Oe.pyraminx.kpuzzle(),\`SubgroupSizes 12 9 12 3 10 3 8 6 2 3 3 3 3
3285
3285
 
3286
3286
  Alg B
3287
3287
  Alg B'
@@ -3358,7 +3358,7 @@ Alg r
3358
3358
  Alg r'
3359
3359
 
3360
3360
  Alg u
3361
- Alg u'\`)}var dB,Eu=A(()=>{"use strict";ur();ol();dB=null});async function hB(){let{getPuzzleGeometryByName:e,ExperimentalPGNotation:t}=await Promise.resolve().then(()=>(ll(),nl)),r=e("skewb",{allMoves:!0,addRotations:!0});return new De(r.getKPuzzleDefinition(!0),{experimentalPGNotation:new t(r,r.getOrbitsDef(!0))})}async function Xs(){return DB??(DB=hB())}async function Js(){return FB??(FB=yB())}async function wu(){return{ordering:(await Js()).ordering.slice(1)}}async function yB(){return Zt(await Xs(),\`SubgroupSizes 24 6 5 12 9 3 4 9 3 3
3361
+ Alg u'\`)}var hB,ku=F(()=>{"use strict";gr();ol();hB=null});async function FB(){let{getPuzzleGeometryByName:e,ExperimentalPGNotation:t}=await Promise.resolve().then(()=>(ll(),nl)),r=e("skewb",{allMoves:!0,addRotations:!0});return new De(r.getKPuzzleDefinition(!0),{experimentalPGNotation:new t(r,r.getOrbitsDef(!0))})}async function Xa(){return yB??(yB=FB())}async function Ja(){return AB??(AB=SB())}async function _u(){return{ordering:(await Ja()).ordering.slice(1)}}async function SB(){return Yt(await Xa(),\`SubgroupSizes 24 6 5 12 9 3 4 9 3 3
3362
3362
 
3363
3363
  Alg y
3364
3364
  Alg y2
@@ -3436,7 +3436,7 @@ Alg U L U' B' U L' U' B
3436
3436
  Alg U' B L U L B' U' L'
3437
3437
 
3438
3438
  Alg U R' U' L B R' B' R
3439
- Alg R' U' R U B' U' B L\`)}var DB,FB,ku=A(()=>{"use strict";We();ol();DB=null;FB=null});var _u={};Lt(_u,{cachedData222:()=>Su,cachedMegaminxKPuzzleWithoutMO:()=>Vs,cachedSGSDataMegaminx:()=>vu,sgsDataPyraminx:()=>Hs,sgsDataPyraminxFixedOrientation:()=>bu,sgsDataSkewb:()=>Js,sgsDataSkewbFixedCorner:()=>wu,skewbKPuzzleWithoutMOCached:()=>Xs});var Cu=A(()=>{"use strict";xu();Uu();Eu();ku()});async function il(e,t){let r=new Bt;r.experimentalPushAlg(e);for(let n of t){let l=(await gr())(n);l!==null&&r.push(B.fromString(l))}return r.toAlg()}var wi=A(()=>{"use strict";fe();xt()});function Vu(){}function UB(e){function t(){}return t.prototype=e||{},new t}function bB(e){return e instanceof Array?e[0]:null}function xo(e,t,r){var n=ji,l=EB,o=bB,i=n[e],a=o(i);i&&!a?H=i:(H=n[e]=t?l(t):{},H.castableTypeMap$=r,H.constructor=H,!t&&(H.typeMarker$=Vu));for(var s=3;s<arguments.length;++s)arguments[s].prototype=H;a&&(H.___clazz$=a)}function EB(e){var t=ji;return UB(t[e])}function wB(){}function Ni(e){return e<<24>>24}function u0(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function g0(e,t){var r;return r=new u0,r.packageName=e,r.compoundName=t,r}function Mr(e,t,r){var n;return n=g0(e,t),CB(r,n),n}function kB(e,t){var r;return r=g0(e,t),r.modifiers=2,r}function qi(e,t){var r;return r=g0("",e),r.typeId=t,r.modifiers=1,r}function Hu(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function _B(e){if(e.isPrimitive())return null;var t=e.typeId,r=ji[t];return r}function CB(e,t){if(!!e){t.typeId=e;var r=_B(t);if(!r){ji[e]=[t];return}r.___clazz$=t}}function te(e,t){return Hu(e,t)}function Y(e,t,r,n,l,o){var i;return i=Ju(l,n),re(te(e,o),t,r,l,i),i}function nt(e,t,r,n,l,o){return Xu(e,t,r,n,l,0,o)}function Xu(e,t,r,n,l,o,i){var a,s,f,u,g;if(u=l[o],f=o===i-1,a=f?n:0,g=Ju(a,u),re(te(e,i-o),t[o],r[o],a,g),!f)for(++o,s=0;s<u;++s)g[s]=Xu(e,t,r,n,l,o,i);return g}function re(e,t,r,n,l){return l.___clazz$=e,l.castableTypeMap$=t,l.typeMarker$=Vu,l.__elementTypeId$=r,l.__elementTypeCategory$=n,l}function Ju(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 l=0;l<t;++l)r[l]=n;return r}function Ou(e){var t,r,n;return t=e&lt,r=e>>22&lt,n=e<0?_r:0,zB(t,r,n)}function zB(e,t,r){return{l:e,m:t,h:r}}function NB(e,t){var r,n,l;return r=e.l+t.l,n=e.m+t.m+(r>>22),l=e.h+t.h+(n>>22),{l:r&lt,m:n&lt,h:l&_r}}function Yt(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function c0(e){var t,r;return e>-129&&e<128?(t=e+128,ki==null&&(ki=Y(pd,ue,293,256,0,1)),r=ki[t],!r&&(r=ki[t]=Ou(e)),r):Ou(e)}function Zu(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 Ys(e,t){return e.l!==t.l||e.m!==t.m||e.h!==t.h}function t0(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function Pi(e,t){var r,n,l;return t&=63,t<22?(r=e.l<<t,n=e.m<<t|e.l>>22-t,l=e.h<<t|e.m>>22-t):t<44?(r=0,n=e.l<<t-22,l=e.m<<t-22|e.l>>44-t):(r=0,n=0,l=e.l<<t-44),{l:r&lt,m:n&lt,h:l&_r}}function Ln(e,t){var r,n,l,o,i;return t&=63,r=e.h,n=(r&vB)!==0,n&&(r|=-1048576),t<22?(i=r>>t,o=e.m>>t|r<<22-t,l=e.l>>t|e.m<<22-t):t<44?(i=n?_r:0,o=r>>t-22,l=e.m>>t-22|r<<44-t):(i=n?_r:0,o=n?lt:0,l=r>>t-44),{l:l&lt,m:o&lt,h:i&_r}}function Yu(e,t){var r,n,l;return r=e.l-t.l,n=e.m-t.m+(r>>22),l=e.h-t.h+(n>>22),{l:r&lt,m:n&lt,h:l&_r}}function Bn(e){return e.l|e.m<<22}function PB(e){this.string=e}function Cr(e,t){return e>t?e:t}function p0(e,t){return e<t?e:t}function MB(e,t){return e.indexOf(t)}function OB(e){return IB(e,0,e.length)}function IB(e,t,r){for(var n="",l=t;l<r;){var o=Math.min(l+1e4,r);n+=String.fromCharCode.apply(null,e.slice(l,o)),l=o}return n}function TB(e){return String.fromCharCode(e&Ze)}function Iu(e){return e.string+=" ",e}function Tu(e,t){return e.string+=t,e}function WB(){PB.call(this,"")}function Mi(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 dn(){Gu||(Gu=!0,wr=nt(Se,[ue,Ae],[11,0],7,[495,18],2),pl=nt(Se,[ue,Ae],[11,0],7,[324,18],2),dl=nt(Se,[ue,Ae],[11,0],7,[336,18],2),zr=nt(Se,[ue,Ae],[11,0],7,[495,8],2),Xi=Y(qe,je,0,20048,7,1),Hi=Y(qe,je,0,20791,7,1),cl=Y(qe,je,0,82945,7,1),sl=nt(Se,[ue,Ae],[11,0],7,[2768,10],2),ul=nt(Se,[ue,Ae],[11,0],7,[2768,10],2),gl=nt(Se,[ue,Ae],[11,0],7,[24,10],2),vo=nt(Se,[ue,Ae],[11,0],7,[24,16],2),Rn=nt(Se,[ue,Ae],[11,0],7,[140,16],2),Vi=Y(qe,je,0,8305,7,1),fl=Y(qe,je,0,48441,7,1))}function KB(e,t,r){return e.slice_0=wr[t.slice_0][r],e.flip=dl[t.flip][($(),Dn)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=pl[t.twist][Dn[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=Cr(Cr(gt(Xi,e.twist*495+zr[e.slice_0][e.tsym]),gt(Hi,e.flip*495+zr[e.slice_0][e.fsym])),gt(cl,e.twist<<11|Pr[e.flip<<3|e.fsym^e.tsym])),e.prun}function QB(e,t,r){return r=($(),yo)[3][r],e.flipc=dl[t.flipc>>3][Dn[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=pl[t.twistc>>3][Dn[r<<3|t.twistc&7]]^t.twistc&7,gt(cl,e.twistc>>3<<11|Pr[e.flipc^e.twistc&7])}function $u(e,t,r){var n;return e.twist=($(),So)[Ii(t)],e.flip=hn[Oi(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=gt(cl,e.twist<<11|Pr[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-Ll(t.ea,8,!0),e.prun=Cr(e.prun,Cr(gt(Xi,e.twist*495+zr[e.slice_0][e.tsym]),gt(Hi,e.flip*495+zr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new Le,Uo(t,1,n),bo(t,1,n),e.twistc=So[Ii(n)],e.flipc=hn[Oi(n)],e.prun=Cr(e.prun,gt(cl,e.twistc>>3<<11|Pr[e.flipc^e.twistc&7])),e.prun<=r)}function Do(){dn()}function gt(e,t){return dn(),e[t>>3]>>(t<<2)&15}function eg(e){dn(),!(_i===2||_i===1&&!e)&&(_i===0&&(nd(),jB(),VB(),XB(),qB(),$(),n0(2048,R0,hn,Ku=Y(Se,Ae,0,336,7,1),0),n0(2187,D0,So,$s=Y(Se,Ae,0,324,7,1),1),HB(),JB(),ZB()),ho(Vi,gl,vo,sl,($(),l0),584244,e),ho(fl,r0,Rn,ul,l0,514084,e),ho(Xi,wr,zr,pl,$s,431619,e),ho(Hi,wr,zr,dl,Ku,431619,e),ho(cl,null,null,pl,$s,103939,e),_i=e?2:1)}function jB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<2768;r++)for(ed(e,($(),al)[r]),n=0;n<10;n++)Nr(e,me[(tt(),Pt)[n]],t),sl[r][n]=Gi(Br[pt(t.ca,8,!1)])&Ze}function qB(){var e,t,r,n,l;for(e=new Le,t=new Le,r0=nt(Se,[ue,Ae],[11,0],7,[140,10],2),r=0;r<140;r++){for(pg(e.ca,r%70,0,!1),l=0;l<10;l++)Nr(e,($(),me)[(tt(),Pt)[l]],t),r0[r][l]=Ll(t.ca,0,!1)+70*(165>>l&1^~~(r/70))&Ze;for(n=0;n<16;n++)Uo(e,($(),ct)[0][n],t),Rn[r][n]=Ll(t.ca,0,!1)+70*~~(r/70)&Ze}}function VB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<2768;r++)for(ng(e,($(),al)[r]),n=0;n<10;n++)vt(e,me[(tt(),Pt)[n]],t),ul[r][n]=Br[pt(t.ea,8,!0)]}function HB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<336;r++)for(B0(e,($(),R0)[r]),n=0;n<18;n++)vt(e,me[n],t),dl[r][n]=hn[Oi(t)]}function XB(){var e,t,r,n,l;for(e=new Le,t=new Le,r=0;r<24;r++){for(Fn(e.ea,r,12,!0),l=0;l<10;l++)vt(e,($(),me)[(tt(),Pt)[l]],t),gl[r][l]=pt(t.ea,12,!0)%24&Ze;for(n=0;n<16;n++)bo(e,($(),ct)[0][n],t),vo[r][n]=pt(t.ea,12,!0)%24&Ze}}function ho(e,t,r,n,l,o,i){var a,s,f,u,g,c,p,L,m,d,D,F,S,v,U,P,J,z,Q,x,C,N,b,w,M,j,q,ie,he,ve,Ye,Et,de,Dt,it,mt;if(S=o&15,D=(o>>4&1)===1?f0:0,f=(o>>5&1)===1,a=o>>8&15,u=o>>12&15,g=o>>16&15,d=i?u:g,F=(1<<S)-1,s=t===null,L=s?2048:t.length,m=L*n.length,p=f?10:18,c=p===10?66:599186,U=(e[m>>3]>>(m<<2)&15)-1,U===-1){for(z=0;z<~~(m/8)+1;z++)e[z]=Ro;e[0]^=1,U=0}for(;U<d;){for(M=(U+1)*Ro^-1,Q=0;Q<e.length;Q++)it=e[Q]^M,it&=it>>1,e[Q]+=it&it>>2&Ro;for(N=U>a,ve=N?U+2:U,he=ve*Ro,v=N?U:U+2,++U,mt=U^U+1,Dt=0,z=0;z<m;++z,Dt>>=4){if((z&7)===0&&(Dt=e[z>>3],((Dt^he)-Ro&~(Dt^he)&-2004318072)===0)){z+=7;continue}if((Dt&15)===ve)for(q=z%L,Ye=~~(z/L),P=0,J=0,s&&(P=($(),hn)[q],J=P&7,P>>=3),w=0;w<p;w++){if(de=n[Ye][w],s?ie=($(),Pr)[dl[P][Dn[w<<3|J]]^J^de&F]:ie=r[t[q][w]][de&F],de>>=S,x=de*L+ie,j=e[x>>3]>>(x<<2)&15,j!==v){j<U-1&&(w+=c>>w&3);continue}if(N){e[z>>3]^=mt<<(z<<2);break}for(e[x>>3]^=mt<<(x<<2),b=1,Et=l[de];(Et>>=1)!==0;b++)(Et&1)===1&&(C=de*L,s?C+=($(),Pr)[hn[ie]^b]:C+=r[ie][b^D>>(b<<1)&3],(e[C>>3]>>(C<<2)&15)===v&&(e[C>>3]^=mt<<(C<<2)))}}}}function JB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<324;r++)for(d0(e,($(),D0)[r]),n=0;n<18;n++)Nr(e,me[n],t),pl[r][n]=So[Ii(t)]}function ZB(){var e,t,r,n,l,o,i,a;for(e=new Le,t=new Le,n=0;n<495;n++){for(pg(e.ea,494-n,8,!0),o=0;o<18;o+=3)vt(e,($(),me)[o],t),wr[n][o]=494-Ll(t.ea,8,!0)&Ze;for(l=0;l<16;l+=2)bo(e,($(),ct)[0][l],t),zr[n][l>>1]=494-Ll(t.ea,8,!0)&Ze}for(r=0;r<495;r++)for(l=0;l<18;l+=3)for(a=wr[r][l],i=1;i<3;i++)a=wr[a][l],wr[r][l+i]=a&Ze}function $(){Wu||(Wu=!0,mr=Y(Ao,ue,7,16,0,1),me=Y(Ao,ue,7,18,0,1),Ji=Y(md,ue,0,18,6,1),ig=Y(qe,je,0,48,7,1),Lr=nt(qe,[ue,je],[17,0],7,[16,16],2),ct=nt(qe,[ue,je],[17,0],7,[16,16],2),yo=nt(qe,[ue,je],[17,0],7,[16,18],2),Dn=Y(qe,je,0,144,7,1),kr=nt(qe,[ue,je],[17,0],7,[16,18],2),R0=Y(Se,Ae,0,336,7,1),D0=Y(Se,Ae,0,324,7,1),al=Y(Se,Ae,0,2768,7,1),ml=Y(ne,se,0,2768,7,1),h0=Y(Se,Ae,0,2768,7,1),Wi=Y(ne,se,0,24,7,1),hn=Y(Se,Ae,0,2048,7,1),So=Y(Se,Ae,0,2187,7,1),Br=Y(Se,Ae,0,40320,7,1),Pr=Y(Se,Ae,0,2688,7,1),o0=new Nt(2531,1373,67026819,1367),i0=new Nt(2089,1906,322752913,2040),Ki=re(te(ne,2),ue,10,0,[re(te(ne,1),se,0,7,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),re(te(ne,1),se,0,7,[6,7,8,0,1,2,3,4,5,15,16,17,9,10,11,12,13,14]),re(te(ne,1),se,0,7,[3,4,5,6,7,8,0,1,2,12,13,14,15,16,17,9,10,11]),re(te(ne,1),se,0,7,[2,1,0,5,4,3,8,7,6,11,10,9,14,13,12,17,16,15]),re(te(ne,1),se,0,7,[8,7,6,2,1,0,5,4,3,17,16,15,11,10,9,14,13,12]),re(te(ne,1),se,0,7,[5,4,3,8,7,6,2,1,0,14,13,12,17,16,15,11,10,9])]),rd(),ld())}function m0(e){e.ca=re(te(ne,1),se,0,7,[0,1,2,3,4,5,6,7]),e.ea=re(te(ne,1),se,0,7,[0,2,4,6,8,10,12,14,16,18,20,22])}function tg(e){!e.temps&&(e.temps=new Le),Nr(i0,e,e.temps),Nr(e.temps,o0,e),vt(i0,e,e.temps),vt(e.temps,o0,e)}function L0(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 YB(e){return Gi(Br[pt(e.ca,8,!1)])}function $B(e){return Br[pt(e.ea,8,!0)]}function Oi(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function Ii(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function Ti(e){var t,r;for(!e.temps&&(e.temps=new Le),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;L0(e,e.temps)}function rg(e){var t,r,n,l,o,i,a;for(t=new lg(e),l=new Le,r=Gi(Br[pt(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},a=0;a<6;a++){if(n=Gi(Br[pt(t.ca,8,!1)])>>4,r===n)for(o=0;o<16;o++)Uo(t,ct[0][o],l),Mi(l.ca,e.ca)&&(bo(t,ct[0][o],l),Mi(l.ea,e.ea)&&(i=t0(i,Pi({l:1,m:0,h:0},(a<<4|o)<48?a<<4|o:48))));tg(t),a%3===2&&Ti(t)}return i}function ed(e,t){Fn(e.ca,t,8,!1)}function ng(e,t){Fn(e.ea,t,8,!0)}function B0(e,t){var r,n,l;for(n=0,r=10;r>=0;--r,t>>=1)n^=l=t&1,e.ea[r]=(e.ea[r]&-2|l)<<24>>24;e.ea[11]=(e.ea[11]&-2|n)<<24>>24}function d0(e,t){var r,n,l;for(n=15,r=6;r>=0;--r,t=~~(t/3))n-=l=t%3,e.ca[r]=(e.ca[r]&7|l<<3)<<24>>24;e.ca[7]=(e.ca[7]&7|n%3<<3)<<24>>24}function td(e){var t,r,n,l,o;for(o=0,l=0,n=0;n<12;n++)l|=1<<(e.ea[n]>>1),o^=e.ea[n]&1;if(l!==4095)return-2;if(o!==0)return-3;for(r=0,o=0,t=0;t<8;t++)r|=1<<(e.ca[t]&7),o+=e.ca[t]>>3;return r!==255?-4:o%3!==0?-5:(a0(pt(e.ea,12,!0),12)^a0(pt(e.ca,8,!1),8))!==0?-6:0}function Uo(e,t,r){$();var n,l,o,i,a,s;for(s=mr[ct[0][t]],a=mr[t],n=0;n<8;n++)o=s.ca[e.ca[a.ca[n]&7]&7]>>3,i=e.ca[a.ca[n]&7]>>3,l=o<3?i:(3-i)%3,r.ca[n]=(s.ca[e.ca[a.ca[n]&7]&7]&7|l<<3)<<24>>24}function Nr(e,t,r){$();var n,l,o;for(n=0;n<8;n++)l=e.ca[t.ca[n]&7]>>3,o=t.ca[n]>>3,r.ca[n]=(e.ca[t.ca[n]&7]&7|(l+o)%3<<3)<<24>>24}function zi(e,t,r){var n,l,o,i;for(n=0;n<8;n++)o=e.ca[t.ca[n]&7]>>3,i=t.ca[n]>>3,l=o+(o<3?i:6-i),l=l%3+(o<3==i<3?0:3),r.ca[n]=(e.ca[t.ca[n]&7]&7|l<<3)<<24>>24}function Le(){$(),m0(this)}function Nt(e,t,r,n){m0(this),Fn(this.ca,e,8,!1),d0(this,t),Fn(this.ea,r,12,!0),B0(this,n)}function lg(e){m0(this),L0(this,e)}function Gi(e){return $(),e^f0>>((e&15)<<1)&3}function bo(e,t,r){$();var n,l,o;for(o=mr[ct[0][t]],l=mr[t],n=0;n<12;n++)r.ea[n]=(o.ea[e.ea[l.ea[n]>>1]>>1]^e.ea[l.ea[n]>>1]&1^l.ea[n]&1)<<24>>24}function vt(e,t,r){$();var n;for(n=0;n<12;n++)r.ea[n]=(e.ea[t.ea[n]>>1]^t.ea[n]&1)<<24>>24}function Er(e,t,r){$();var n;return n=h0[e],r&&(n=n^f0>>((n&15)<<1)&3),n&65520|Lr[n&15][t]}function og(){return $(),0}function rd(){var e,t;for(me[0]=new Nt(15120,0,119750400,0),me[3]=new Nt(21021,1494,323403417,0),me[6]=new Nt(8064,1236,29441808,550),me[9]=new Nt(9,0,5880,0),me[12]=new Nt(1230,412,2949660,0),me[15]=new Nt(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)me[e+t+1]=new Le,vt(me[e+t],me[e],me[e+t+1]),Nr(me[e+t],me[e],me[e+t+1])}function nd(){$();var e,t,r;for(n0(40320,al,Br,l0=Y(Se,Ae,0,2768,7,1),2),e=new Le,r=0;r<2768;r++)ng(e,al[r]),ml[r]=Ll(e.ea,0,!0)+a0(al[r],8)*70<<24>>24,Ti(e),h0[r]=Br[pt(e.ea,8,!0)];for(t=0;t<24;t++)Fn(e.ea,t,12,!0),Ti(e),Wi[t]=pt(e.ea,12,!0)%24<<24>>24}function ld(){var e,t,r,n,l,o,i,a,s,f,u,g,c,p,L,m;for(e=new Le,t=new Le,r=new Nt(28783,0,259268407,0),m=new Nt(15138,0,119765538,7),g=new Nt(5167,0,83473207,0),l=0;l<8;l++)g.ca[l]=Ni(g.ca[l]|24);for(o=0;o<16;o++)mr[o]=new lg(e),zi(e,m,t),vt(e,m,t),L=t,t=e,e=L,o%4===3&&(zi(L,g,t),vt(L,g,t),L=t,t=e,e=L),o%8===7&&(zi(L,r,t),vt(L,r,t),L=t,t=e,e=L);for(i=0;i<16;i++)for(s=0;s<16;s++)for(zi(mr[i],mr[s],e),u=0;u<16;u++)if(Mi(mr[u].ca,e.ca)){Lr[i][s]=u,ct[u][s]=i;break}for(f=0;f<18;f++)for(p=0;p<16;p++){for(Uo(me[f],ct[0][p],e),c=0;c<18;c++)if(Mi(me[c].ca,e.ca)){yo[p][f]=c,kr[p][(tt(),Bl)[f]]=Bl[c];break}p%2===0&&(Dn[f<<3|p>>1]=yo[p][f])}for(n=0;n<18;n++)for(Ji[n]=rg(me[n]),a=n,p=0;p<48;p++)yo[p%16][a]<n&&(ig[p]|=1<<n),p%16===15&&(a=Ki[2][a])}function n0(e,t,r,n,l){$();var o,i,a,s,f,u,g,c,p;for(o=new Le,a=new Le,i=0,f=0,p=l>=2?1:2,u=l!==1,s=0;s<e;s++)if(r[s]===0){switch(l){case 0:{B0(o,s);break}case 1:{d0(o,s);break}case 2:Fn(o.ea,s,8,!0)}for(g=0;g<16;g+=p){switch(u?bo(o,g,a):Uo(o,g,a),l){case 0:{f=Oi(a);break}case 1:{f=Ii(a);break}case 2:f=pt(a.ea,8,!0)}l===0&&(Pr[i<<3|g>>1]=f&Ze),f===s&&(n[i]=(n[i]|1<<~~(g/p))&Ze),c=~~((i<<4|g)/p),r[f]=c&Ze}t[i++]=s&Ze}return i}function od(e,t,r,n,l,o,i,a){var s,f,u,g,c;if(g=Cr(gt((dn(),fl),(i>>4)*140+Rn[($(),ml)[a>>4]&255][ct[i&15][a&15]]),Cr(gt(fl,n*140+Rn[ml[t]&255][ct[l][r]]),gt(Vi,t*24+vo[o][r]))),g>e.maxDep2)return g-e.maxDep2;for(s=e.maxDep2;s>=g&&(c=fg(e,n,l,t,r,o,s,e.depth1,10),!(c<0));s--){for(s-=c,e.solLen=0,e.solution=new mg,cd(e.solution,e.verbose,e.urfIdx,e.depth1),u=0;u<e.depth1+s;u++)ju(e.solution,e.move[u]);for(f=e.preMoveLen-1;f>=0;f--)ju(e.solution,e.preMoves[f]);e.solLen=e.solution.length_0}return s!==e.maxDep2?(e.maxDep2=p0(gg,e.solLen-e.length1-1),Zu(e.probe,e.probeMin)?0:1):1}function id(e){var t,r,n,l,o,i,a,s,f,u,g,c,p,L,m;if(e.isRec=!1,Zu(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=NB(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)Nr(e.phase1Cubie[n],($(),me)[e.move[n]],e.phase1Cubie[n+1]),vt(e.phase1Cubie[n],me[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,a=YB(e.phase1Cubie[e.depth1]),s=a&15,a>>=4,f=$B(e.phase1Cubie[e.depth1]),u=f&15,f>>=4,g=pt(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=Er(f,u,!1),t=Er(a,s,!0),l=e.depth1===0?-1:e.move[e.depth1-1],o=e.preMoveLen===0?-1:e.preMoves[e.preMoveLen-1],m=0,L=(e.preMoveLen===0?1:2)*(e.depth1===0?1:2),c=0,p=(1<<L)-1;c<L;c++){if((p>>c&1)!==0){if(p&=~(1<<c),m=od(e,a,s,f,u,g,r,t),m===0||m>2)break;m===2&&(p&=4<<c)}if(p===0)break;(c&1)===0&&e.depth1>0?(i=(tt(),Bl)[~~(l/3)*3+1],e.move[e.depth1-1]=Pt[i]*2-e.move[e.depth1-1],g=(dn(),gl)[g][i],a=sl[a][($(),kr)[s][i]],s=Lr[a&15][s],a>>=4,f=ul[f][kr[u][i]],u=Lr[f&15][u],f>>=4,t=Er(a,s,!0),r=Er(f,u,!1)):e.preMoveLen>0&&(i=(tt(),Bl)[~~(o/3)*3+1],e.preMoves[e.preMoveLen-1]=Pt[i]*2-e.preMoves[e.preMoveLen-1],g=($(),Wi)[(dn(),gl)[Wi[g]][i]],a=sl[t>>4][kr[t&15][i]],t=a&-16|Lr[a&15][t&15],a=Er(t>>4,t&15,!0),s=a&15,a>>=4,f=ul[r>>4][kr[r&15][i]],r=f&-16|Lr[f&15][r&15],f=Er(r>>4,r&15,!1),u=f&15,f>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=l),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=o),m===0?0:2}function ad(e){var t;for(e.conjMask=0,e.selfSym=rg(e.cc),e.conjMask|=Ys(Yt(Ln(e.selfSym,16),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=Ys(Yt(Ln(e.selfSym,32),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=Ys(Yt(Ln(e.selfSym,48),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=Yt(e.selfSym,{l:lt,m:lt,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)L0(e.urfCubieCube[t],e.cc),$u(e.urfCoordCube[t],e.urfCubieCube[t],20),tg(e.cc),t%3===2&&Ti(e.cc)}function ag(e,t,r,n,l){var o,i,a,s,f,u;if(t.prun===0&&n<5)return e.allowShorter||n===0?(e.depth1-=n,f=id(e),e.depth1+=n,f):1;for(u=og(c0(r)),o=0;o<18;o+=3)if(!(o===l||o===l-9)){for(a=0;a<3;a++)if(i=o+a,!(e.isRec&&i!==e.move[e.depth1-n]||u!==0&&(u&1<<i)!==0)){if(s=KB(e.nodeUD[n],t,i),s>n)break;if(s===n)continue;if(s=QB(e.nodeUD[n],t,i),s>n)break;if(s===n)continue;if(e.move[e.depth1-n]=i,e.valid1=p0(e.valid1,e.depth1-n),f=ag(e,e.nodeUD[n],r&Bn(($(),Ji)[i]),n-1,o),f===0)return 0;if(f>=2)break}}return 1}function sg(e,t,r,n,l){var o,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===e0&&e.preMoveLen!==0,$u(e.nodeUD[e.depth1+1],n,e.depth1)&&ag(e,e.nodeUD[e.depth1+1],l,e.depth1,-1)===0))return 0;if(t===0||e.preMoveLen+e0>=e.length1)return 1;for(a=og(c0(l)),(t===1||e.preMoveLen+1+e0>=e.length1)&&(a|=225207),r=~~(r/3)*3,o=0;o<18;o++){if(o===r||o===r-9||o===r+9){o+=2;continue}if(!(e.isRec&&o!==e.preMoves[e.maxPreMoves-t]||(a&1<<o)!==0)&&(Nr(($(),me)[o],n,e.preMoveCubes[t]),vt(me[o],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=o,i=sg(e,t-1,o,e.preMoveCubes[t],l&Bn(Ji[o])),i===0))return 0}return 1}function fg(e,t,r,n,l,o,i,a,s){var f,u,g,c,p,L,m,d,D,F,S;if(t===0&&n===0&&o===0)return i;for(D=(tt(),Fo)[s],m=0;m<10;m++){if((D>>m&1)!==0){m+=66>>m&3;continue}if(d=(dn(),gl)[o][m],u=sl[n][($(),kr)[l][m]],g=Lr[u&15][l],u>>=4,p=ul[t][kr[r][m]],L=Lr[p&15][r],p>>=4,c=Er(p,L,!1),f=Er(u,g,!0),F=gt(fl,(c>>4)*140+Rn[ml[f>>4]&255][ct[c&15][f&15]]),F>i+1)return i-F+1;if(F>=i){m+=66>>m&3&i-F;continue}if(F=Cr(gt(Vi,u*24+vo[d][g]),gt(fl,p*140+Rn[ml[u]&255][ct[L][g]])),F>=i){m+=66>>m&3&i-F;continue}if(S=fg(e,p,L,u,g,d,i-1,a+1,m),S>=0)return e.move[a]=Pt[m],S;if(S<-2)break;S<-1&&(m+=66>>m&3)}return-1}function sd(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=p0(gg,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)===0&&sg(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],Bn(Yt(e.selfSym,{l:Ze,m:0,h:0})))===0)return e.solution?qu(e.solution):"Error 8";return e.solution?qu(e.solution):"Error 7"}function fd(e,t){var r;return r=ud(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,eg(!1),ad(e),sd(e))}function ud(e,t){var r,n,l,o;for(n=0,l=Y(ne,se,0,54,7,1),r=OB(re(te(Se,1),Ae,0,7,[t.charCodeAt(4),t.charCodeAt(13),t.charCodeAt(22),t.charCodeAt(31),t.charCodeAt(40),t.charCodeAt(49)])),o=0;o<54;o++){if(l[o]=MB(r,TB(t.charCodeAt(o)))<<24>>24,l[o]===-1)return-1;n+=1<<(l[o]<<2)}return n!==10066329?-1:(gd(l,e.cc),td(e.cc))}function ug(){var e,t,r;for(this.move=Y(qe,je,0,31,7,1),this.nodeUD=Y(Ci,ue,31,21,0,1),this.nodeRL=Y(Ci,ue,31,21,0,1),this.nodeFB=Y(Ci,ue,31,21,0,1),this.cc=new Le,this.urfCubieCube=Y(Ao,ue,7,6,0,1),this.urfCoordCube=Y(Ci,ue,31,6,0,1),this.phase1Cubie=Y(Ao,ue,7,21,0,1),this.preMoveCubes=Y(Ao,ue,7,21,0,1),this.preMoves=Y(qe,je,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new Do,this.nodeRL[t]=new Do,this.nodeFB[t]=new Do,this.phase1Cubie[t]=new Le;for(r=0;r<6;r++)this.urfCubieCube[r]=new Le,this.urfCoordCube[r]=new Do;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new Le}function tt(){if(!Qu){Qu=!0;var e,t,r,n,l,o;for(mn=re(te(ne,2),ue,10,0,[re(te(ne,1),se,0,7,[8,9,20]),re(te(ne,1),se,0,7,[6,18,38]),re(te(ne,1),se,0,7,[0,36,47]),re(te(ne,1),se,0,7,[2,45,11]),re(te(ne,1),se,0,7,[29,26,15]),re(te(ne,1),se,0,7,[27,44,24]),re(te(ne,1),se,0,7,[33,53,42]),re(te(ne,1),se,0,7,[35,17,51])]),cr=re(te(ne,2),ue,10,0,[re(te(ne,1),se,0,7,[5,10]),re(te(ne,1),se,0,7,[7,19]),re(te(ne,1),se,0,7,[3,37]),re(te(ne,1),se,0,7,[1,46]),re(te(ne,1),se,0,7,[32,16]),re(te(ne,1),se,0,7,[28,25]),re(te(ne,1),se,0,7,[30,43]),re(te(ne,1),se,0,7,[34,52]),re(te(ne,1),se,0,7,[23,12]),re(te(ne,1),se,0,7,[21,41]),re(te(ne,1),se,0,7,[50,39]),re(te(ne,1),se,0,7,[48,14])]),pr=nt(qe,[ue,je],[17,0],7,[13,13],2),s0=re(te(GB,1),ue,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),Pt=re(te(qe,1),je,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),Bl=Y(qe,je,0,18,7,1),Fo=Y(qe,je,0,11,7,1),t=0;t<18;t++)Bl[Pt[t]]=t;for(r=0;r<10;r++)for(n=~~(Pt[r]/3),Fo[r]=0,l=0;l<10;l++)o=~~(Pt[l]/3),Fo[r]|=(n===o||n%3===o%3&&n>=o?1:0)<<l;for(Fo[10]=0,e=0;e<13;e++)for(pr[e][0]=pr[e][e]=1,l=1;l<e;l++)pr[e][l]=pr[e-1][l-1]+pr[e-1][l]}}function Ll(e,t,r){tt();var n,l,o,i,a;for(n=e.length-1,o=0,a=4,l=n;l>=0;l--)i=cg(e[l],r),(i&12)===t&&(o+=pr[l][a--]);return o}function a0(e,t){tt();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function pt(e,t,r){tt();var n,l,o,i;for(l=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)o=cg(e[n],r)<<2,l=(t-n)*l+Bn(Yt(Ln(i,o),{l:15,m:0,h:0})),i=Yu(i,Pi({l:1118480,m:279620,h:69905},o));return l}function cg(e,t){return t?e>>1:e&7}function pg(e,t,r,n){tt();var l,o,i,a;for(l=e.length-1,a=4,o=l,i=l;i>=0;i--)t>=pr[i][a]?(t-=pr[i][a--],e[i]=Qi(e[i],a|r,n)):((o&12)===r&&(o-=4),e[i]=Qi(e[i],o--,n))}function Fn(e,t,r,n){tt();var l,o,i,a,s,f;for(f={l:1323536,m:2777561,h:1043915},l={l:0,m:0,h:0},a=2;a<=r;a++)l=t0(Pi(l,4),c0(t%a)),t=~~(t/a);for(o=0;o<r-1;o++)s=(Bn(l)&15)<<2,l=Ln(l,4),e[o]=Qi(e[o],Bn(Yt(Ln(f,s),{l:15,m:0,h:0})),n),i=Yu(Pi({l:1,m:0,h:0},s),{l:1,m:0,h:0}),f=t0(Yt(f,i),Yt(Ln(f,4),{l:~i.l&lt,m:~i.m&lt,h:~i.h&_r}));e[r-1]=Qi(e[r-1],Bn(Yt(f,{l:15,m:0,h:0})),n)}function Qi(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function gd(e,t){tt();var r,n,l,o,i,a,s,f;for(o=0;o<8;o++)t.ca[o]=0;for(i=0;i<12;i++)t.ea[i]=0;for(a=0;a<8;a++){for(f=0;f<3&&!(e[mn[a][f]]===0||e[mn[a][f]]===3);f++);for(r=e[mn[a][(f+1)%3]],n=e[mn[a][(f+2)%3]],s=0;s<8;s++)if(r===~~(mn[s][1]/9)&&n===~~(mn[s][2]/9)){t.ca[a]=Ni(f%3<<3|s);break}}for(l=0;l<12;l++)for(s=0;s<12;s++){if(e[cr[l][0]]===~~(cr[s][0]/9)&&e[cr[l][1]]===~~(cr[s][1]/9)){t.ea[l]=Ni(s<<1);break}if(e[cr[l][0]]===~~(cr[s][1]/9)&&e[cr[l][1]]===~~(cr[s][0]/9)){t.ea[l]=Ni(s<<1|1);break}}}function ju(e,t){var r,n,l;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){l=(t%3+e.moves[e.length_0-1]%3+1)%4,l===3?--e.length_0:e.moves[e.length_0-1]=r*3+l;return}if(e.length_0>1&&r%3===n%3&&r===~~(e.moves[e.length_0-2]/3)){l=(t%3+e.moves[e.length_0-2]%3+1)%4,l===3?(e.moves[e.length_0-2]=e.moves[e.length_0-1],--e.length_0):e.moves[e.length_0-2]=r*3+l;return}e.moves[e.length_0++]=t}function cd(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function qu(e){var t,r,n;if(r=new WB,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+=". "),Iu(Tu(r,(tt(),s0)[($(),Ki)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)Iu(Tu(r,(tt(),s0)[($(),Ki)[n][e.moves[t]]])),(e.verbose&1)!==0&&t===e.depth1&&(r.string+=". ");return r.string}function mg(){this.moves=Y(qe,je,0,31,7,1)}var ue,lt,_r,vB,Ze,Ae,je,f0,Ro,se,H,ji,ki,GB,Gu,Rn,r0,sl,fl,ul,dl,Vi,vo,gl,cl,pl,zr,Hi,wr,Xi,_i,Ci,Wu,mr,Br,al,hn,R0,Pr,Wi,ml,h0,Dn,yo,kr,Lr,ct,Ku,l0,$s,So,D0,ig,me,Ji,o0,i0,Ki,Ao,gg,e0,Qu,pr,Fo,mn,cr,s0,Bl,Pt,qe,pd,ne,md,Se,Ld,Bd,Lg=A(()=>{"use strict";ue={3:1},lt=4194303,_r=1048575,vB=524288,Ze=65535,Ae={11:1,3:1},je={17:1,3:1},f0=14540032,Ro=286331153,se={10:1,3:1},ji={};xo(1,null,{},wB);xo(79,1,{},u0);H.createClassLiteralForArray=function(t){var r;return r=new u0,r.modifiers=4,t>1?r.componentType=Hu(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!==0};GB=Mr("java.lang","String",2);Gu=!1;xo(31,1,{31:1},Do);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;_i=0,Ci=Mr("org.cubing.min2phase.client","CoordCube",31),Wu=!1;Ao=Mr("org.cubing.min2phase.client","CubieCube",7);xo(72,1,{},ug);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;gg=12,e0=7,Qu=!1;xo(150,1,{},mg);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;qe=qi("int","I");Mr("com.google.gwt.lang","CollapsedPropertyHolder",252);Mr("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);pd=Mr("com.google.gwt.lang","LongLibBase/LongEmul",null);Mr("com.google.gwt.lang","ModuleUtils",257);ne=qi("byte","B"),md=qi("long","J"),Se=qi("char","C");Mr("com.google.gwt.user.client.rpc","XsrfToken",null),kB("java.util","Map/Entry");Ld=function(){eg(!1)},Bd=function(e){return fd(new ug,e)}});var Bg={};Lt(Bg,{initialize:()=>Ld,solveState:()=>Bd});var dg=A(()=>{"use strict";Lg()});var F0,Rg=A(()=>{"use strict";Jt();F0=Qe(()=>Promise.resolve().then(()=>(dg(),Bg)))});function hg(e,t){return e.slice(t)+e.slice(0,t)}function Fd(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(hg(dd[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push(hg(Rd[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(hd),t}function Dg(e){let t=Fd(e);return Dd.map(([r,n,l])=>t[r][n][l]).join("")}var dd,Rd,hd,Dd,Fg=A(()=>{"use strict";dd="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),Rd="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),hd="U L F R B D".split(" "),Dd=[[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 yg(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 Ag(e,t){if(yg(e.startState(),t))return!1;for(let r of"ULFRBD")for(let n=1;n<4;n++){let l=e.moveToTransformation(new B(r,n)).toKState();if(yg(l,t))return!1}return!0}var Sg=A(()=>{"use strict";fe();We()});var xg,vg=A(()=>{"use strict";xg=[["R U'","R2 B","D2 B2","D' L B'","R' U'","B","D B2","R' B","L' U","L2 B'","B2","D L B'","L U","B'","U'","R B","D' B2","L B'","U2","U L' B'","","U' L' B'","U","L' B'"],["F2 L2","F' L'","R' F L2","D' L2","F L2","F2 L'","R' F' L'","R2 F L2","R2 F2 L'","L2","F L'","D' L","D2 L2","R2 F' L'","D L","","L2 F L'","L F' L2","L F L'","F' L2","L'","D L2","D F L'","L"],["R B U2 B'","R2 B U' B'","F2 B U B'","F B2 L' B2","B2 L B2","B U' B'","R2 B U2 B'","R' B U' B'","B2 L' B2","F B U B'","B2 U' B2","B' L B","L F' B D' B'","B' U' B2 D B'","B U2 B'","R B U' B'","B2 L2 B2","D' B' L B","B U B'","F' B2 L' B2","","B2 L' B' U' B'"],["U F2 L2 U'","F' U L' U'","F2 U L' U'","U F L2 U'","U2 B2 U2","R' U' B U","D2 U L U'","D U2 B' U2","U L2 U'","F U L' U'","D U L U'","U2 B' U2","","U2 B' U' L' U'","U2 L' U2","U' B U","U L U'","D' U2 B' U2","U L' U'","U2 B U2"],["R' D' F2","F'","F2","D R F'","R D' F2","R2 F'","D' F2","R F'","F2 R' D' F2","F","D2 F2","D' R F'","R2 D' F2","R' F'","D F2","D2 R F'","","F R' D' F2"],["R' D2 F' D F","R F2 R2 F2","R2 F' D2 F","F' R2 D2 F","L D' L'","D F' D2 F","F2 R2 F2","R F' D2 F","F' R2 D' F","F' R' D2 F","F2 R' F2","L D L'","F' R D' F","F2 R F2","F' D2 F","","L D2 R D' L'","F' D2 F' R F2","D2 R2 F2 R2 F2","D F' D' F","F' D F"],["U F2 U'","R U F' U'","D R U F2 U'","U F U'","R2 U F2 U'","R' U F' U'","R U F2 U'","R2 U F' U'","","U L D L' F U'","F2 D' R D F2","D2 U F U'","R' U F2 U'","U F' U'","F2 D2 R D2 F2","D U F U'"],["R2","R' B' D B","D R'","F' R2 F","","R B' D B","R'","B' D B","D' R'","D2 F' R2 F","R","R2 B' D B","D2 R'","B' D' B"],["R2 D' R2","F' R' F R","R D' R2 D R'","D2 R2 D2 R2","R' D' F' R F","U F D F' U'","","R2 D2 B R' B' R'","R' F D' F2 R F","R2 D R2","F2 U F U' F","R' D F' R F","D R2 D2 R2","U F D' F' U'","D R' D2 F' R F","R2 D2 R2","U F D2 F' U'","R' D2 F' R F"],["B R B'","F D F' B R2 B'","D B R2 B'","D2 B R' B'","B R2 B'","D B R' B'","D' B R2 B'","B R' B'","","B R2 B' D B R' B'","D2 B R2 B'","D' B R' B'"],["","R' D R F D2 F'","R' D R","D F D' F'","R F' R' F","F D' F'","R' D' R","F D2 F'","R' D2 R","F D F'"],["","F2 D2 R F' R' D2 F' D2 F'","F2 D2 F' D' F D' F' D2 F'","F2 D F2 D F2 D2 F2","D2 F L D2 L' D2 F'","D F D2 L D2 L' F'","R' D B' D2 B D' R","R' D2 B' D2 B R","F D2 F' D F D F'","F D' L D2 L' D F'","B D' F D B' D' F'","F D2 L D2 L' F'","F D' L D L' D F'","F L D2 L' D2 F'","R' B' D2 B D2 R"],["D'","F L D L' D' F'","D2","L B D B' D' L'","D","B' L' D' L D B","","D F L D L' D' F'"],["F' D2 F D F' D F","F' D' R' D R F","F' R' D' R D F","B D R D' R' B'","","D B' D' L' D L B"],["D F D F' D F D2 F'","F' U2 B' R' B U2 F' L F' L' F'","","D2 L D L2 F L F2 D F"],["L B' L' F L B L' F'","F2 U F' D2 F U' F' D2 F'","D' F' D B D' F D B'","F L2 F R2 F' L2 F R2 F2","D B D' F' D B' D' F","R F L F' R' F L' F'","","D2 B L' U2 L B' D2 B L' U2 L B'","D2 F R' U2 R F' D2 F R' U2 R F'","R F L' F' R' F L F'","D F D' B' D F' D' B","L2 F2 L' B2 L F2 L' B2 L'"],["L B R' B' L' B R B'","R' B R F' R' B' R F","L D2 L U L' D2 L U' L2","","D2 B' D2 F D' L2 F L2 F' D2 B D' F'","D2 F' R' F R2 B' D2 B D2 R' F D2 F'","L B L' F L B' L' F'","F' D2 F' U' F D2 F' U F2","D' B' D F D' B D F'"],["","D2 F' L U2 L' F D2 F' L U2 L' F","D2 B' R U2 R' B D2 B' R U2 R' B"]]});async function bg(){let e=await Oe["3x3x3"].kpuzzle(),t=e.startState();for(let r of xg)t=t.applyAlg(E.fromString((await gr())(r)));return Ag(e,t)?t:bg()}async function y0(e){return be(),E.fromString((await F0).solveState(Dg(e)))}async function Rl(){return y0(await bg())}async function Eg(){(await F0).initialize()}async function wg(){return il(await Rl(),yd)}async function kg(){let e=new Bt,t=await Rl();return e.experimentalPushAlg(Ug),e.experimentalPushAlg(t),e.experimentalPushAlg(Ug),e.toAlg()}var yd,Ug,A0=A(()=>{"use strict";fe();ur();xt();St();wi();Rg();Fg();Sg();vg();yd=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];Ug=new E("R' U' F")});function ge(e,...t){let r=t.length,n=e[t[r-1]];for(let l=r;l>0;l--)e[t[l]]=e[t[l-1]];return e[t[0]]=n,ge}function _g(e,t,r,n){r=(r||8)-1;let l=1985229328,o=0;n??(n=0),n<0&&(t<<=1);for(let i=0;i<r;++i){let a=S0[r-i],s=~~(t/a);o^=s,t%=a,s<<=2,e[i]=l>>s&7;let f=(1<<s)-1;l=(l&f)+(l>>4&~f)}return n<0&&(o&1)!==0?(e[r]=e[r-1],e[r-1]=l&7):e[r]=l&7,e}var Re,S0,Cg=A(()=>{"use strict";Re=[],S0=[1];for(let e=0;e<32;++e){Re[e]=[];for(let t=0;t<32;++t)Re[e][t]=0}for(let e=0;e<32;++e){Re[e][0]=Re[e][e]=1,S0[e+1]=S0[e]*(e+1);for(let t=1;t<e;++t)Re[e][t]=Re[e-1][t-1]+Re[e-1][t]}});function I(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 Ed(e){return new Co[e]}function ht(e,t,r,...n){let l=Co[e];l&&!l.___clazz$?X=l.prototype:(!l&&(l=Co[e]=function(){}),X=l.prototype=t<0?{}:Ed(t),X.castableTypeMap$=r);for(let o of n)o.prototype=X;l.___clazz$&&(X.___clazz$=l.___clazz$,l.___clazz$=null)}function Wr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function rc(){}function wd(e,t){let r=nc(0,t);return lc(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function nc(e,t){let r=new Array(t);if(e===3)for(let n=0;n<t;++n){let l={m:0,l:0,h:0};l.l=l.m=l.h=0,r[n]=l}else if(e>0){let n=[null,0,!1][e];for(let l=0;l<t;++l)r[l]=n}return r}function z0(e,t,r,n,l){let o=nc(l,n);return lc(e,t,r,o),o}function lc(e,t,r,n){return oc(),_d(n,U0,b0),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function la(e,t,r){return e[t]=r}function oc(){zg||(zg=!0,U0=[],b0=[],kd(new rc,U0,b0))}function kd(e,t,r){let n=0,l;for(let o in e)(l=e[o])&&(t[n]=o,r[n]=l,++n)}function _d(e,t,r){oc();for(let n=0,l=t.length;n<l;++n)e[t[n]]=r[n]}function Cd(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function zd(e,t){return e!==null&&Cd(e,t)}function Nd(){if(Ng)return!1;Ng=!0,Ba=I(15582,36),da=I(15582),Tt=I(15582),Sl=I(48,48),Ot=I(48,36),Al=I(48),M0=I(48)}function N0(e){e.ct=I(24)}function Pg(e,t){let r,n;if(zd(t,ec)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function oa(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=Re[t][n--]);return r}function Yi(e){let t,r;if(bl!==null)return bl[oa(e)];for(r=0;r<48;++r){if(t=Gd(oa(e)),t!==-1)return t*64+r;oe(e,0),r%2===1&&oe(e,1),r%8===7&&oe(e,2),r%16===15&&oe(e,3)}}function Mt(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.ct,16,17,18,19,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.ct,20,21,22,23,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break}case 7:{h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break}case 10:{h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function oe(e,t){switch(t){case 0:{Mt(e,19),Mt(e,28);break}case 1:{Mt(e,21),Mt(e,32);break}case 2:{h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.ct,16,19,21,22,1),h(e.ct,17,18,20,23,1);break}case 3:Mt(e,18),Mt(e,29),Mt(e,24),Mt(e,35)}}function Mg(e,t){let r;for(r=0;r<t;++r)oe(e,0),r%2===1&&oe(e,1),r%8===7&&oe(e,2),r%16===15&&oe(e,3)}function P0(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=Re[r][n]&&(t-=Re[r][n--],e.ct[r]=1)}function $i(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function zo(){let e;for(N0(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function ea(e,t){let r;for(N0(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function wo(e){let t;for(N0(this),t=0;t<24;++t)this.ct[t]=e[t]}function Pd(){let e,t,r=new zo,n=new zo;for(e=0;e<15582;++e)for(P0(n,da[e]),t=0;t<36;++t)$i(r,n),Mt(r,t),Ba[e][t]=Yi(r)}function Md(){let e,t,r,n,l,o,i,a;for(Fa(Tt),Tt[0]=0,t=0,r=1;r!==15582;)for(o=t>4,a=o?-1:t,e=o?t:-1,++t,n=0;n<15582;++n)if(Tt[n]===a){for(i=0;i<27;++i)if(l=~~Ba[n][i]>>>6,Tt[l]===e)if(++r,o){Tt[n]=t;break}else Tt[l]=t}}function Od(e){let t,r,n,l=new wo(e.ct);for(n=0;n<48;++n){for(t=!0,r=0;r<24;++r)if(l.ct[r]!==~~(r/4)){t=!1;break}if(t)return n;oe(l,0),n%2===1&&oe(l,1),n%8===7&&oe(l,2),n%16===15&&oe(l,3)}return-1}function Id(){let e,t,r,n=new zo;for(e=0;e<24;++e)n.ct[e]=e;let l=new wo(n.ct),o=new wo(n.ct),i=new wo(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)Pg(n,l)&&(Sl[e][t]=r,r===0&&(Al[e]=t)),oe(l,0),r%2===1&&oe(l,1),r%8===7&&oe(l,2),r%16===15&&oe(l,3);oe(n,0),t%2===1&&oe(n,1),t%8===7&&oe(n,2),t%16===15&&oe(n,3)}oe(n,0),e%2===1&&oe(n,1),e%8===7&&oe(n,2),e%16===15&&oe(n,3)}for(e=0;e<48;++e)for($i(n,o),Mg(n,Al[e]),t=0;t<36;++t)for($i(l,n),Mt(l,t),Mg(l,e),r=0;r<36;++r)if($i(i,o),Mt(i,r),Pg(i,l)){Ot[e][t]=r;break}for(P0(n,0),e=0;e<48;++e)M0[Al[e]]=oa(n),oe(n,0),e%2===1&&oe(n,1),e%8===7&&oe(n,2),e%16===15&&oe(n,3)}function Td(){let e,t,r,n,l=new zo,o=I(22984);for(t=0;t<22984;t++)o[t]=0;for(e=0,t=0;t<735471;++t)if((o[~~t>>>5]&1<<(t&31))===0){for(P0(l,t),n=0;n<48;++n)r=oa(l),o[~~r>>>5]|=1<<(r&31),bl!==null&&(bl[r]=e<<6|Al[n]),oe(l,0),n%2===1&&oe(l,1),n%8===7&&oe(l,2),n%16===15&&oe(l,3);da[e++]=t}}function Gd(e){let t=bR(da,e);return t>=0?t:-1}function Wd(){Og||(Og=!0,fa=I(70,28),sa=I(6435,28),fc=I(70,16),ac=I(6435,16),ot=I(450450),sc=[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 ia(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=Re[t][n--]);return r}function aa(e){let t,r,n;for(r=0,n=4,t=6;t>=0;--t)e.rl[t]!==e.rl[7]&&(r+=Re[t][n--]);return r*2+e.parity}function yl(e,t){e.parity^=sc[t];let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.rl,0,1,2,3,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.rl,4,5,6,7,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.rl,0,5,4,1,r),h(e.ct,8,9,12,13,r);break}case 7:{h(e.rl,0,1,2,3,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.rl,0,3,6,5,r),h(e.ct,3,2,5,4,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.rl,3,2,7,6,r),h(e.ct,11,10,15,14,r);break}case 10:{h(e.rl,4,5,6,7,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.rl,1,4,7,2,r),h(e.ct,1,0,7,6,r)}}function hl(e,t){switch(t){case 0:{yl(e,19),yl(e,28);break}case 1:{yl(e,21),yl(e,32);break}case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.rl,0,3,5,6,1),h(e.rl,1,2,4,7,1)}}function ic(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 Ig(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.ct[r]=1):e.ct[r]=0}function Tg(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.rl[r]=1):e.rl[r]=0}function O0(){this.rl=I(8),this.ct=I(16)}function Kd(){let e,t,r,n,l,o,i,a,s,f,u=new O0;for(l=0;l<70;++l)for(a=0;a<28;++a)Tg(u,l),yl(u,An[a]),fa[l][a]=aa(u);for(l=0;l<70;++l)for(Tg(u,l),i=0;i<16;++i)fc[l][i]=aa(u),hl(u,0),i%2===1&&hl(u,1),i%8===7&&hl(u,2);for(l=0;l<6435;++l)for(Ig(u,l),i=0;i<16;++i)ac[l][i]=ia(u)&65535,hl(u,0),i%2===1&&hl(u,1),i%8===7&&hl(u,2);for(l=0;l<6435;++l)for(a=0;a<28;++a)Ig(u,l),yl(u,An[a]),sa[l][a]=ia(u)&65535;for(Fa(ot),ot[0]=ot[18]=ot[28]=ot[46]=ot[54]=ot[56]=0,r=0,n=6;n!==450450;){let g=r>6,c=g?-1:r,p=g?r:-1;for(++r,l=0;l<450450;++l)if(ot[l]===c){for(e=~~(l/70),s=l%70,a=0;a<23;++a)if(t=sa[e][a],f=fa[s][a],o=t*70+f,ot[o]===p)if(++n,g){ot[l]=r;break}else ot[o]=r}}}function Qd(){Gg||(Gg=!0,ko=I(29400,20),gc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],Ir=I(29400),G0=[0,9,14,23,27,28,41,42,46,55,60,69],W0=I(70))}function I0(e){let t,r,n,l;for(r=0,l=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=Re[t][l--]);for(r*=35,l=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=Re[t][l--]);r*=12;let o=e.fb[7]^e.ud[7];for(n=0,l=4,t=7;t>=0;--t)e.rl[t]!==o&&(n+=Re[t][l--]);return e.parity+2*(r+W0[n])}function jd(e,t){switch(e.parity^=gc[t],t){case 0:case 1:case 2:{h(e.ud,0,1,2,3,t%3);break}case 3:{h(e.rl,0,1,2,3,1);break}case 4:case 5:case 6:{h(e.fb,0,1,2,3,(t-1)%3);break}case 7:case 8:case 9:{h(e.ud,4,5,6,7,(t-1)%3);break}case 10:{h(e.rl,4,5,6,7,1);break}case 11:case 12:case 13:{h(e.fb,4,5,6,7,(t+1)%3);break}case 14:{h(e.ud,0,1,2,3,1),h(e.rl,0,5,4,1,1),h(e.fb,0,5,4,1,1);break}case 15:{h(e.rl,0,1,2,3,1),h(e.fb,1,4,7,2,1),h(e.ud,1,6,5,2,1);break}case 16:{h(e.fb,0,1,2,3,1),h(e.ud,3,2,5,4,1),h(e.rl,0,3,6,5,1);break}case 17:{h(e.ud,4,5,6,7,1),h(e.rl,3,2,7,6,1),h(e.fb,3,2,7,6,1);break}case 18:{h(e.rl,4,5,6,7,1),h(e.fb,0,3,6,5,1),h(e.ud,0,3,4,7,1);break}case 19:h(e.fb,4,5,6,7,1),h(e.ud,0,7,6,1,1),h(e.rl,1,4,7,2,1)}}function uc(e,t,r){let n,l=(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^l;e.parity=l^r}function qd(e,t){let r,n,l,o;for(e.parity=t&1,t>>>=1,l=G0[t%12],t=~~(t/12),o=4,r=7;r>=0;--r)e.rl[r]=0,l>=Re[r][o]&&(l-=Re[r][o--],e.rl[r]=1);for(n=t%35,t=~~(t/35),o=4,e.fb[7]=0,r=6;r>=0;--r)n>=Re[r][o]?(n-=Re[r][o--],e.fb[r]=1):e.fb[r]=0;for(o=4,e.ud[7]=0,r=6;r>=0;--r)t>=Re[r][o]?(t-=Re[r][o--],e.ud[r]=1):e.ud[r]=0}function T0(){this.ud=I(8),this.rl=I(8),this.fb=I(8)}function Vd(){let e,t,r,n;for(r=0;r<12;++r)W0[G0[r]]=r;let l=new T0;for(r=0;r<29400;++r)for(n=0;n<20;++n)qd(l,r),jd(l,n),ko[r][n]=I0(l)&65535;for(Fa(Ir),Ir[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(Ir[r]===e)for(n=0;n<17;++n)Ir[ko[r][n]]===-1&&(Ir[ko[r][n]]=e+1,++t);++e}}function Hd(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function Xd(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.ct,16,17,18,19,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.ct,20,21,22,23,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break}case 7:{h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break}case 10:{h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function K0(){let e;for(this.ct=I(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function cc(e){let t,r,n;for(K0.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 Jd(){Wg||(Wg=!0,bt=I(18),$d())}function pc(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function mc(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function Zd(e,t){!e.temps&&(e.temps=new Ra),Lc(e,bt[t],e.temps),mc(e,e.temps)}function Yd(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 Lc(e,t,r){let n,l,o,i;for(n=0;n<8;++n)r.cp[n]=e.cp[t.cp[n]],o=e.co[t.cp[n]],i=t.co[n],l=o,l=l+(o<3?i:6-i),l=l%3,(o>=3?1:0)^(i>=3?1:0)&&(l=l+3),r.co[n]=l}function Ra(){pc(this)}function Or(e,t){pc(this),_g(this.cp,e),Yd(this,t)}function Bc(e){Or.call(this,e(40320),e(2187))}function $d(){let e,t;for(bt[0]=new Or(15120,0),bt[3]=new Or(21021,1494),bt[6]=new Or(8064,1236),bt[9]=new Or(9,0),bt[12]=new Or(1230,412),bt[15]=new Or(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)bt[e+t+1]=new Ra,Lc(bt[e+t],bt[e],bt[e+t+1])}function eR(){Kg||(Kg=!0,It=I(1937880),ha=I(1538),ca=I(1538),_l=I(11880),Fc=[0,1,6,3,4,5,2,7],j0=I(160,12),q0=I(160,12),Q0=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],E0=[0,2,4,6,1,3,7,5,8,9,10,11])}function Dl(e,t,r,n,l){let o=e.edgeo[l];e.edgeo[l]=e.edge[n],e.edge[n]=e.edgeo[r],e.edgeo[r]=e.edge[t],e.edge[t]=o}function El(e,t){let r,n,l,o,i;for(e.isStd||hc(e),n=0,i=1985229328,o=47768,r=0;r<t;++r)l=e.edge[r]<<2,n*=12-r,l>=32?(n+=o>>l-32&15,o-=4368<<l-32):(n+=i>>l&15,o-=4369,i-=286331152<<l);return n}function dc(e){let t,r=El(e,4);t=_l[r];let n=t&7;t>>=3,ga(e,n);let l=El(e,10)%20160;return t*20160+l}function ua(e,t){switch(e.isStd=!1,t){case 0:{ge(e.edge,0,4,1,5),ge(e.edgeo,0,4,1,5);break}case 1:{Fe(e.edge,0,4,1,5),Fe(e.edgeo,0,4,1,5);break}case 2:{ge(e.edge,0,5,1,4),ge(e.edgeo,0,5,1,4);break}case 3:{Fe(e.edge,5,10,6,11),Fe(e.edgeo,5,10,6,11);break}case 4:{ge(e.edge,0,11,3,8),ge(e.edgeo,0,11,3,8);break}case 5:{Fe(e.edge,0,11,3,8),Fe(e.edgeo,0,11,3,8);break}case 6:{ge(e.edge,0,8,3,11),ge(e.edgeo,0,8,3,11);break}case 7:{ge(e.edge,2,7,3,6),ge(e.edgeo,2,7,3,6);break}case 8:{Fe(e.edge,2,7,3,6),Fe(e.edgeo,2,7,3,6);break}case 9:{ge(e.edge,2,6,3,7),ge(e.edgeo,2,6,3,7);break}case 10:{Fe(e.edge,4,8,7,9),Fe(e.edgeo,4,8,7,9);break}case 11:{ge(e.edge,1,9,2,10),ge(e.edgeo,1,9,2,10);break}case 12:{Fe(e.edge,1,9,2,10),Fe(e.edgeo,1,9,2,10);break}case 13:{ge(e.edge,1,10,2,9),ge(e.edgeo,1,10,2,9);break}case 14:{Fe(e.edge,0,4,1,5),Fe(e.edgeo,0,4,1,5),ge(e.edge,9,11),ge(e.edgeo,8,10);break}case 15:{Fe(e.edge,5,10,6,11),Fe(e.edgeo,5,10,6,11),ge(e.edge,1,3),ge(e.edgeo,0,2);break}case 16:{Fe(e.edge,0,11,3,8),Fe(e.edgeo,0,11,3,8),ge(e.edge,5,7),ge(e.edgeo,4,6);break}case 17:{Fe(e.edge,2,7,3,6),Fe(e.edgeo,2,7,3,6),ge(e.edge,8,10),ge(e.edgeo,9,11);break}case 18:{Fe(e.edge,4,8,7,9),Fe(e.edgeo,4,8,7,9),ge(e.edge,0,2),ge(e.edgeo,1,3);break}case 19:Fe(e.edge,1,9,2,10),Fe(e.edgeo,1,9,2,10),ge(e.edge,4,6),ge(e.edgeo,5,7)}}function xl(e,t){switch(e.isStd=!1,t){case 0:{ua(e,14),ua(e,17);break}case 1:{Dl(e,11,5,10,6),Dl(e,5,10,6,11),Dl(e,1,2,3,0),Dl(e,4,9,7,8),Dl(e,8,4,9,7),Dl(e,0,1,2,3);break}case 2:Ut(e,4,5),Ut(e,5,4),Ut(e,11,8),Ut(e,8,11),Ut(e,7,6),Ut(e,6,7),Ut(e,9,10),Ut(e,10,9),Ut(e,1,1),Ut(e,0,0),Ut(e,3,3),Ut(e,2,2)}}function ga(e,t){for(;t>=2;)t-=2,xl(e,1),xl(e,2);t!==0&&xl(e,0)}function Mo(e,t){let r,n,l,o,i,a;for(i=1985229328,a=47768,l=0,r=0;r<11;++r)if(n=Q0[11-r],o=~~(t/n),t=t%n,l^=o,o<<=2,o>=32){o=o-32,e.edge[r]=a>>o&15;let s=(1<<o)-1;a=(a&s)+(a>>4&~s)}else{e.edge[r]=i>>o&15;let s=(1<<o)-1;i=(i&s)+(i>>>4&~s)+(a<<28),a=a>>4}for((l&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 Qg(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 Rc(e,t){let r,n,l,o;for(e.temp===null&&(e.temp=I(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[E0[r]+12]%12;for(n=1,r=0;r<12;++r)for(;e.edge[r]!==r;)o=e.edge[r],e.edge[r]=e.edge[o],e.edge[o]=o,l=e.temp[r],e.temp[r]=e.temp[o],e.temp[o]=l,n^=1;for(r=0;r<12;++r)e.edge[r]=e.temp[t.ep[E0[r]]%12];return n}function hc(e){let t;for(e.temp===null&&(e.temp=I(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 Fe(e,t,r,n,l){let o;o=e[t],e[t]=e[n],e[n]=o,o=e[r],e[r]=e[l],e[l]=o}function Ut(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function dr(){this.edge=I(12),this.edgeo=I(12)}function tR(){let e,t,r,n,l,o,i,a,s,f,u,g,c,p,L,m,d,D,F,S,v,U,P=new dr,J=new dr,z=new dr;for(Fa(It),a=0,Zi=1,x0(It,0,0);Zi!==31006080&&(L=a>9,i=a%3,o=(a+1)%3,f=L?3:i,e=L?i:3,!(a>=9));){for(g=0;g<31006080;g+=16)if(U=It[~~g>>4],!(!L&&U===-1)){for(u=g,s=g+16;u<s;++u,U>>=2)if((U&3)===f){for(F=~~(u/20160),t=ha[F],n=u%20160,Mo(P,t*20160+n),d=0;d<17;++d)if(r=wl(P.edge,d<<3,4),S=_l[r],v=S&7,S>>=3,l=wl(P.edge,d<<3|v,10)%20160,c=S*20160+l,No(It,c)===e){if(x0(It,L?u:c,o),++Zi,L)break;if(D=ca[S],D!==1)for(Qg(J,P),ua(J,d),ga(J,v),m=1;(D=~~D>>1&65535)!==0;++m)(D&1)===1&&(Qg(z,J),ga(z,m),p=S*20160+El(z,10)%20160,No(It,p)===e&&(x0(It,p,o),++Zi))}}}++a}}function No(e,t){return e[t>>4]>>((t&15)<<1)&3}function wl(e,t,r){let n,l,o,i,a,s=q0[t],f=j0[t];for(l=0,a=1985229328,i=47768,n=0;n<r;++n)o=s[e[f[n]]]<<2,l*=12-n,o>=32?(l+=i>>o-32&15,i-=4368<<o-32):(l+=a>>o&15,i-=4369,a-=286331152<<o);return l}function Dc(e){let t,r,n,l,o,i,a,s,f,u,g,c=new dr;if(i=0,o=No(It,e),o===3)return 10;for(;e!==0;)for(o===0?o=2:--o,f=~~(e/20160),t=ha[f],n=e%20160,Mo(c,t*20160+n),s=0;s<17;++s)if(r=wl(c.edge,s<<3,4),u=_l[r],g=u&7,u>>=3,l=wl(c.edge,s<<3|g,10)%20160,a=u*20160+l,No(It,a)===o){++i,e=a;break}return i}function rR(e,t){let r=No(It,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function nR(){let e,t,r,n=new dr;for(t=0;t<20;++t)for(r=0;r<8;++r){for(Mo(n,0),ua(n,t),ga(n,r),e=0;e<12;++e)j0[t<<3|r][e]=n.edge[e];for(hc(n),e=0;e<12;++e)q0[t<<3|r][e]=n.temp[e]}}function lR(){let e,t,r,n,l=new dr,o=I(1485);for(t=0;t<1485;t++)o[t]=0;for(e=0,t=0;t<11880;++t)if((o[~~t>>>3]&1<<(t&7))===0){for(Mo(l,t*Q0[8]),n=0;n<8;++n)r=El(l,4),r===t&&(ca[e]=(ca[e]|1<<n)&65535),o[~~r>>3]=o[~~r>>3]|1<<(r&7),_l[r]=e<<3|Fc[n],xl(l,0),n%2===1&&(xl(l,1),xl(l,2));ha[e++]=t}}function x0(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function oR(){jg||(jg=!0)}function iR(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 aR(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function sR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r);break}case 1:{h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r);break}case 2:{h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r);break}case 3:{h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r);break}case 4:{h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r);break}case 5:{h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r);break}case 6:{h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r),h(e.ep,9,22,11,20,r);break}case 7:{h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r),h(e.ep,2,16,6,12,r);break}case 8:{h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r),h(e.ep,3,19,5,13,r);break}case 9:{h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r),h(e.ep,8,23,10,21,r);break}case 10:{h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r),h(e.ep,14,0,18,4,r);break}case 11:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r),h(e.ep,7,15,1,17,r)}}function V0(){let e;for(this.ep=I(24),e=0;e<24;++e)this.ep[e]=e}function yc(e){let t,r,n;for(V0.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 fR(){qg||(qg=!0,w0=[35,1,34,2,4,6,22,5,19])}function Ac(e){e.moveBuffer=I(60)}function uR(e,t){return e.value-t.value}function kl(e,t){let r;for(aR(e.edge,t.edge),Hd(e.center,t.center),mc(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 Tr(e){for(;e.centerAvail<e.moveLength;)Xd(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function Sc(e){for(;e.cornerAvail<e.moveLength;)Zd(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function Po(e){for(;e.edgeAvail<e.moveLength;)sR(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function gR(e){let t,r,n,l,o,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)Ot[i][e.moveBuffer[t]]>=27?(a[r++]=Ot[i][e.moveBuffer[t]]-9,l=w0[Ot[i][e.moveBuffer[t]]-27],i=Sl[i][l]):a[r++]=Ot[i][e.moveBuffer[t]];let s=Sl[Al[i]][Od(Tr(e))];for(o="",i=s,t=r-1;t>=0;--t)n=a[t],n=~~(n/3)*3+(2-n%3),Ot[i][n]>=27?(o=\`\${o}\${k0[Ot[i][n]-9]} \`,l=w0[Ot[i][n]-27],i=Sl[i][l]):o=\`\${o}\${k0[Ot[i][n]]} \`;return o}function yn(e,t){e.moveBuffer[e.moveLength++]=t}function pa(){Ac(this),this.edge=new V0,this.center=new K0,this.corner=new Ra}function Da(e){pa.call(this),kl(this,e)}function xc(e){Ac(this),this.edge=new yc(e),this.center=new cc(e),this.corner=new Bc(e)}function cR(e,t){return t.value-e.value}function ma(e,t){return cR(e,t)}function vc(){}function pR(){if(Vg)return;Vg=!0;let e,t;for(k0=["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'"],An=[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],Eo=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],Hg=I(37),Xg=I(37),Fl=I(37,36),ta=I(29,28),ra=I(21,20),v0=I(36),_o=I(28),vl=I(20),e=0;e<29;++e)Hg[An[e]]=e;for(e=0;e<21;++e)Xg[Eo[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)Fl[e][t]=~~(e/3)===~~(t/3)||~~(e/3)%3===~~(t/3)%3&&e>t;Fl[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)ta[e][t]=Fl[An[e]][An[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)ra[e][t]=Fl[Eo[e]][Eo[t]];for(e=0;e<36;++e)for(v0[e]=36,t=e;t<36;++t)if(!Fl[e][t]){v0[e]=t-1;break}for(e=0;e<28;++e)for(_o[e]=28,t=e;t<28;++t)if(!ta[e][t]){_o[e]=t-1;break}for(e=0;e<20;++e)for(vl[e]=20,t=e;t<20;++t)if(!ra[e][t]){vl[e]=t-1;break}}function mR(e){let t,r,n,l,o,i,a,s,f,u,g,c;e.solution="";let p=Yi(new ea(Tr(e.c),0)),L=Yi(new ea(Tr(e.c),1)),m=Yi(new ea(Tr(e.c),2)),d=Tt[~~p>>6],D=Tt[~~L>>6],F=Tt[~~m>>6];for(e.p1SolsCnt=0,e.arr2idx=0,AR(e.p1sols.heap),e.length1=(d<D?d:D)<F?d<D?d:D:F;e.length1<100&&!(F<=e.length1&&na(e,~~m>>>6,m&63,e.length1,-1,0)||d<=e.length1&&na(e,~~p>>>6,p&63,e.length1,-1,0)||D<=e.length1&&na(e,~~L>>>6,L&63,e.length1,-1,0));++e.length1);let S=zR(e.p1sols,z0(PR,Wr([vd,_0,C0]),tc,0,0));S.sort(function(P,J){return P.value-J.value}),t=9;do{e:for(s=S[0].value;s<100;++s)for(i=0;i<S.length&&!(S[i].value>s);++i)if(!(s-S[i].length1>t)&&(kl(e.c1,S[i]),ic(e.ct2,Tr(e.c1),La(Po(e.c1).ep)),g=ia(e.ct2),c=aa(e.ct2),e.length1=S[i].length1,e.length2=s-S[i].length1,Uc(e,g,c,e.length2,28,0)))break e;++t}while(s===100);e.arr2.sort(function(P,J){return P.value-J.value}),a=0,r=13;do{e:for(f=e.arr2[0].value;f<100;++f)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>f);++i)if(!(f-e.arr2[i].length1-e.arr2[i].length2>r)&&(o=Rc(e.e12,Po(e.arr2[i])),uc(e.ct3,Tr(e.arr2[i]),o^La(Sc(e.arr2[i]).cp)),n=I0(e.ct3),l=El(e.e12,10),u=Dc(dc(e.e12)),u<=f-e.arr2[i].length1-e.arr2[i].length2&&bc(e,l,n,u,f-e.arr2[i].length1-e.arr2[i].length2,20,0))){a=i;break e}++r}while(f===100);let v=new Da(e.arr2[a]);e.length1=v.length1,e.length2=v.length2;let U=f-e.length1-e.length2;for(i=0;i<U;++i)yn(v,Eo[e.move3[i]]);e.solution=gR(v)}function LR(e,t){let r,n;for(kl(e.c1,e.c),r=0;r<e.length1;++r)yn(e.c1,e.move1[r]);switch(M0[t]){case 0:{yn(e.c1,24),yn(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break}case 12869:{yn(e.c1,18),yn(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}ic(e.ct2,Tr(e.c1),La(Po(e.c1).ep));let l=ia(e.ct2),o=aa(e.ct2),i=ot[l*70+o];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 Da(e.c1):(n=_R(e.p1sols),n.value>e.c1.value&&kl(n,e.c1)),DR(e.p1sols,n),e.p1SolsCnt===1e4}function BR(e){let t;for(kl(e.c2,e.c1),t=0;t<e.length2;++t)yn(e.c2,e.move2[t]);if(!iR(Po(e.c2)))return!1;let r=Rc(e.e12,Po(e.c2));uc(e.ct3,Tr(e.c2),r^La(Sc(e.c2).cp));let n=I0(e.ct3);El(e.e12,10);let l=Dc(dc(e.e12));return e.arr2[e.arr2idx]?kl(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new Da(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(l,Ir[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function dR(e,t){return wc(),e.c=new xc(t),mR(e),e.solution}function na(e,t,r,n,l,o){let i,a,s,f,u,g;if(t===0)return n===0&&LR(e,r);for(i=0;i<27;i+=3)if(!(i===l||i===l-9||i===l-18))for(f=0;f<3;++f){if(s=i+f,a=Ba[t][Ot[r][s]],u=Tt[~~a>>>6],u>=n){if(u>n)break;continue}if(g=Sl[r][a&63],a>>>=6,e.move1[o]=s,na(e,a,g,n-1,i,o+1))return!0}return!1}function Uc(e,t,r,n,l,o){let i,a,s,f;if(t===0&&ot[r]===0)return n===0&&BR(e);for(a=0;a<23;++a){if(ta[l][a]){a=_o[a];continue}if(i=sa[t][a],f=fa[r][a],s=ot[i*70+f],s>=n){s>n&&(a=_o[a]);continue}if(e.move2[o]=An[a],Uc(e,i,f,n-1,a,o+1))return!0}return!1}function bc(e,t,r,n,l,o,i){let a,s,f,u,g,c,p,L,m;if(l===0)return t===0&&r===0;for(Mo(e.tempe[i],t),g=0;g<17;++g){if(ra[o][g]){g=vl[g];continue}if(f=ko[r][g],c=Ir[f],c>=l){c>l&&g<14&&(g=vl[g]);continue}if(u=wl(e.tempe[i].edge,g<<3,10),a=~~(u/20160),L=_l[a],m=L&7,L>>=3,s=wl(e.tempe[i].edge,g<<3|m,10)%20160,p=rR(L*20160+s,n),p>=l){p>l&&g<14&&(g=vl[g]);continue}if(bc(e,u,f,p,l-1,g,i+1))return e.move3[i]=g,!0}return!1}function Ec(){let e;for(this.p1sols=new Pc(new vc),this.move1=I(15),this.move2=I(20),this.move3=I(20),this.c1=new pa,this.c2=new pa,this.ct2=new O0,this.ct3=new T0,this.e12=new dr,this.tempe=I(20),this.arr2=I(100),e=0;e<20;++e)this.tempe[e]=new dr}function wc(){Jg||(Id(),bl=I(735471),Td(),Pd(),bl=null,Md(),Kd(),Vd(),nR(),lR(),tR(),Jg=!0)}function RR(){Zg||(Zg=!0)}function La(e){let t,r,n,l;for(l=0,t=0,n=e.length;t<n;++t)for(r=t;r<n;++r)e[t]>e[r]&&(l^=1);return l}function h(e,t,r,n,l,o){let i;switch(o){case 0:{i=e[l],e[l]=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[l],e[l]=i;return}case 2:{i=e[t],e[t]=e[r],e[r]=e[n],e[n]=e[l],e[l]=i;return}}}function kc(){}function _c(e,t,r,n){let l=new kc;return l.typeName=e+t,zc(r!==0?-r:0)&&Nc(r!==0?-r:0,l),l.modifiers=4,l.superclass=H0,l.componentType=n,l}function Cc(e,t,r,n){let l=new kc;return l.typeName=e+t,zc(r)&&Nc(r,l),l.superclass=n,l}function hR(e){let t=Co[e.seedId];return e=null,t}function zc(e){return typeof e=="number"&&e>0}function Nc(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=hR(t);if(n)r=n.prototype;else{n=Co[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function DR(e,t){if(kR(e,t))return!0}function FR(e){e.array=z0(Mc,Wr([_0,C0]),$g,0,0)}function yR(e,t){return la(e.array,e.size++,t),!0}function AR(e){e.array=z0(Mc,Wr([_0,C0]),$g,0,0),e.size=0}function Gr(e,t){return e.array[t]}function SR(e,t){let r=e.array[t];return UR(e.array,t,1),--e.size,r}function Ul(e,t,r){let n=e.array[t];return la(e.array,t,r),n}function xR(e,t){let r;for(t.length<e.size&&(t=wd(t,e.size)),r=0;r<e.size;++r)la(t,r,e.array[r]);return t.length>e.size&&la(t,e.size,null),t}function vR(){FR(this),this.array.length=500}function UR(e,t,r){e.splice(t,r)}function bR(e,t){let r,n,l,o;for(n=0,r=e.length-1;n<=r;)if(l=n+(~~(r-n)>>1),o=e[l],o<t)n=l+1;else if(o>t)r=l-1;else return l;return-n-1}function Fa(e){ER(e,e.length)}function ER(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function wR(e,t){let r,n,l,o,i=e.heap.size,a=Gr(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,l=n+1,o=n,l<i&&ma(Gr(e.heap,l),Gr(e.heap,n))<0&&(o=l),o),!(ma(a,Gr(e.heap,r))<0));)Ul(e.heap,t,Gr(e.heap,r)),t=r;Ul(e.heap,t,a)}function kR(e,t){let r,n;for(n=e.heap.size,yR(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),ma(Gr(e.heap,n),t)<=0)return Ul(e.heap,r,t),!0;Ul(e.heap,r,Gr(e.heap,n))}return Ul(e.heap,n,t),!0}function _R(e){if(e.heap.size===0)return null;let t=Gr(e.heap,0);return CR(e),t}function CR(e){let t=SR(e.heap,e.heap.size-1);0<e.heap.size&&(Ul(e.heap,0,t),wR(e,0))}function zR(e,t){return xR(e.heap,t)}function Pc(e){this.heap=new vR,this.cmp=e}function Ic(){Yg||(Yg=!0,pR(),RR(),Nd(),Wd(),Qd(),eR(),Jd(),oR(),fR(),Oc=new Ec)}function MR(){Ic(),wc()}async function OR(){be(),Ic();let e=E.fromString(dR(Oc,await Ee()));return(await Rl()).concat(e)}var X,Co,Ad,$g,_0,ec,Sd,xd,tc,vd,Ud,bd,C0,zg,U0,b0,Ng,Tt,Ba,M0,bl,da,Al,Ot,Sl,Og,sa,ot,ac,sc,fa,fc,Gg,ko,gc,Ir,G0,W0,Wg,bt,Kg,E0,Zi,It,Q0,j0,q0,_l,ha,Fc,ca,jg,qg,w0,Vg,Fl,ta,ra,An,k0,Eo,v0,_o,vl,Hg,Xg,Jg,Zg,H0,Mc,NR,PR,Oc,Yg,Tc=A(()=>{"use strict";fe();A0();Cg();xt();St();Co={},Ad={},$g=0,_0=30,ec=21,Sd=22,xd=23,tc=24,vd=25,Ud=34,bd=26,C0=40;ht(1,-1,Ad);X.value=null;ht(73,1,{},rc);X.queryId$=0;zg=!1;Ng=!1;ht(153,1,Wr([ec]),zo,ea,wo);bl=null,Og=!1;ht(154,1,{},O0);X.parity=0;Gg=!1;ht(155,1,{},T0);X.parity=0;ht(156,1,{},K0,cc);Wg=!1;ht(157,1,Wr([Sd]),Ra,Or,Bc);X.temps=null;Kg=!1;ht(158,1,Wr([xd]),dr);X.isStd=!0;X.temp=null;Zi=0,jg=!1;ht(159,1,{},V0,yc);qg=!1;ht(160,1,Wr([tc,Ud]),pa,Da,xc);X.compareTo$=function(t){return uR(this,t)};X.add1=!1;X.center=null;X.centerAvail=0;X.corner=null;X.cornerAvail=0;X.edge=null;X.edgeAvail=0;X.length1=0;X.length2=0;X.length3=0;X.moveLength=0;X.sym=0;X.value=0;ht(161,1,{},vc);X.compare=function(t,r){return ma(t,r)};Vg=!1;ht(163,1,Wr([bd]),Ec);X.add1=!1;X.arr2idx=0;X.c=null;X.length1=0;X.length2=0;X.p1SolsCnt=0;X.solution="";Jg=!1,Zg=!1;X.val$outerIter=null;X.size=0;ht(239,1,{},Pc);X.cmp=null;X.heap=null;H0=Cc("java.lang.","Object",1,null),Mc=_c("[Ljava.lang.","Object;",356,H0),NR=Cc("cs.threephase.","FullCube",160,H0),PR=_c("[Lcs.threephase.","FullCube;",381,NR),Yg=!1});var Gc={};Lt(Gc,{initialize:()=>MR,random444Scramble:()=>OR});var Wc=A(()=>{"use strict";Tc()});function Io(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function ya(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 ep(e,t,r,n,l=e-t-r-n){return ya(e,t+r)*ya(t+r,t)*ya(n+l,n)}function QR(e){e=e.slice();let t=e.length,r=Io(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function jR(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function o2(e,t){let r=[],n=Io(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function Sn(e){return QR(e)>>1}function r2(e,t){let r=[0];for(let n=1;n<e;n++){let l=t(n+1);r[n]=r[l],r[l]=n}return r}function Vc(e,t){let r=r2(e,t);return jR(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function qR(e){return e|=0,31-Math.clz32(e^e-1)}function Hc(e,t){e|=0,t|=0;let r=\`\${e} \${t}\`;if(Z0[r])return Z0[r];let n=ya(e,t),l=new Uint32Array(n),o=new Uint32Array(1<<e).fill(-1);for(let i=0,a=(1<<t)-1;i<n;i++){l[i]=a,o[a]=i;let s=a|a-1;a=s+1|(~s&-~s)-1>>qR(a)+1}return Z0[r]=[l,o]}function VR(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function Xc(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 HR(e,t){return Xc(e)|Xc(t)<<1}function Pl(e,t,r,n,l){if(e|=0,t|=0,r|=0,n|=0,l|=0,e!==t+r+n+l)throw new Error("generate_comb4_lookup_tables: invalid parameters");let o=[e,t,r,n,l].join(" ");if(Y0[o])return Y0[o];let[i,a]=Hc(e,r+l),[s,f]=Hc(e,n+l),u=ep(e,t,r,n,l),g=new Uint32Array(u),c=new Uint32Array(4**e).fill(-1);for(let p=0,L=0;p<s.length;p++){let m=s[p];for(let d=0;d<i.length;d++){let D=i[d];if(VR(D&m)===l){let F=HR(D,m);g[L]=F,c[F]=L,L++}}}return Y0[o]=[g,c]}function rt(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Ml(e,t,r){let n=[];for(let l=0;l<r.length;l++)n[l]=e[t[r[l]]];return n}function i2(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n of e)for(let l=0;l<n.length;l++)r[n[l]]=n[(l+1)%n.length];return r}function xn(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 l=n[r-1]+t[r-1],o=Array(l);for(let i=0;i<r;i++)t[i]&&(o[n[i]]=n[e[i]]);return o}function a2(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function XR(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function JR(e,t){return e*t/XR(e,t)}function ZR(e){let t=1,r=e.length,n=Array(r).fill(!1),l=-1;for(;l=n.indexOf(!1,l+1),l!==-1;){let o=0,i=l;for(;!n[i];)n[i]=!0,i=e[i],o++;t=JR(t,o)}return t}function oh(e,t){for(let r=0;r<6;r++){if(e===Gt[Kr[r][0]]&&t===Gt[Kr[r][2]])return[r,0];if(e===Gt[Kr[r][2]]&&t===Gt[Kr[r][0]])return[r,1]}throw new Error("unknown corner piece")}function ih(e,t){for(let r=0;r<12;r++)if(e===Gt[Qr[r][0]]&&t===Gt[Qr[r][1]]||t===Gt[Qr[r][0]]&&e===Gt[Qr[r][1]])return r;throw new Error("unknown edge piece")}function s2(e,t){return oh(e[Kr[t][0]],e[Kr[t][2]])}function ba(e,t){return ih(e[Qr[t][0]],e[Qr[t][1]])}function ah(e,t,r,n){let l=Kr[t],o=Kr[r].map(i=>Gt[i]);n%2!==0&&(o=[o[2],o[3],o[0],o[1]]);for(let i=0;i<4;i++)e[l[i]]=o[i]}function sh(e,t,r){let n=Qr[t],l=Qr[r].map(o=>Gt[o]);for(let o=0;o<2;o++)e[n[o]]=l[o]}function np(e){let t=e.map(s=>Gt[s]),n=Array(6).fill().map((s,f)=>s2(t,f)).map(([s,f])=>s+6*f),l=n.concat(n.map(s=>(s+6)%12)),o=Array(12).fill().map((s,f)=>ba(t,f)),i=Array(12).fill().map((s,f)=>vn.indexOf(e[vn[f]])),a=Array(12).fill().map((s,f)=>Cl.indexOf(e[Cl[f]]));return{cp:l,ep:o,ap:i,bp:a}}function uh(e){let t=Array(72),r=Vc(5,e);r.push(5);let n=Array(4).fill().map(a=>e(2));n.push(n.reduce((a,s)=>a^s)),n.push(0);for(let a=0;a<6;a++)ah(t,a,r[a],n[a]);let l=Vc(12,e);for(let a=0;a<12;a++)sh(t,a,l[a]);let o=r2(12,e).map(a=>a/3|0),i=r2(12,e).map(a=>4+(a/3|0));for(let a=0;a<12;a++)t[vn[a]]=o[a],t[Cl[a]]=i[a];return t}function op(e,t=!1){if(t){e=e.map(m=>m.slice());let p=[0,1,2,3,4,5,6,7],L=[[0,3,5,6,4,7,1,2],[7,1,0,6,3,5,4,2],[7,4,2,1,3,0,6,5],[2,4,5,3,6,0,1,7]];L=L.concat(L.map(m=>a2(m)));for(let m=0;m<e.length;m++)if(e[m][0]<4)e[m][0]=p[e[m][0]];else{let d=p[e[m][0]],D=e[m][1];e[m][0]=d,p=rt(D===1?L[d^4]:L[d],p)}}let r=t?"U L F R D BR B BL".split(" "):fh,n=["0","","'"];return e.map(([o,i])=>r[o]+n[i]).join(" ")}function jr(e,t){for(let[r,n]of t)for(let l=0;l<n;l++)e=rt(e,lp[r]);return e}function ip(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function xa(e,t=!1){if(e.length===0)return[];let r=[],n;for(let[l,o]of e)n&&n[0]===l?(n[1]+=o,n[1]%=3,n[1]===0&&(r.pop(),n=r.length===0?void 0:r[r.length-1])):r.length>=2&&(n[0]^l)===4&&r[r.length-2][0]===l?(r[r.length-2][1]+=o,r[r.length-2][1]%=3,r[r.length-2][1]===0&&r.splice(r.length-2,1)):(n=[l,o],r.push(n));return t&&\`\${e}\`!=\`\${r}\`&&console.log(\`simplified \${e} to \${r}\`),r}function gh(e){return op(ip(mh(uh(e),!0)),!0)}function zl(e,t,r,n,l,o){let i=ep(e,t,r,n,l),a=o.length,[s,f]=Pl(e,t,r,n,l),u=Array(a).fill().map(()=>new Uint32Array(i));for(let g=0;g<i;g++){let c=s[g],p=Array(e);for(let L=0;L<e;L++)p[L]=c>>2*L&3;for(let L=0;L<a;L++){let d=rt(p,o[L]).reduce((D,F,S)=>D|F<<2*S,0);u[L][g]=f[d]}}return u}function ap(e){let t=e[0].length,r=e.length,n=Array(r).fill().map(()=>new Uint32Array(t));for(let l=0;l<t;l++)for(let o=0;o<r;o++)n[o][e[o][l]]=l;return n}function bn(e,t){let r=e[0].length,n=t[0].length,l=e.length,o=Array(l).fill().map(()=>new Uint32Array(r*n));for(let i=0;i<n;i++)for(let a=0;a<r;a++){let s=a+r*i;for(let f=0;f<l;f++)o[f][s]=e[f][a]+r*t[f][i]}return o}function ch(e,t){let r=e.length,n=e[0].length,l=new Uint8Array(n);l[t]=1;let o=!1;for(;!o;){o=!0;for(let a=0;a<n;a++)if(!!l[a])for(let s=0;s<r;s++)l[e[s][a]]||(l[e[s][a]]=1,o=!1)}let i=new Int32Array(n).fill(-1);for(let a=0,s=0;a<n;a++)!l[a]||(i[a]=s,s++);return[e.map(a=>xn(a,l)),i]}function ph(e,t){let r=e.length,n=e[0].length,l=new Int32Array(n).fill(-1);t.forEach(s=>{l[s]=0});let o=[t];for(let s=0;s<o.length;s++){let f=o[s];for(let u=0;u<r;u++){let g=e[u][f[0]];if(l[g]!==-1)continue;let c=f.map(L=>e[u][L]),p=o.length;o.push(c);for(let L of c){if(l[L]!==-1)throw new Error("quotienting failed");l[L]=p}}}let i=o.length,a=Array(r).fill().map(()=>new Int32Array(i));for(let s=0;s<r;s++)for(let f=0;f<i;f++)a[s][f]=l[e[s][o[f][0]]];return[a,l]}function sp(e,t,r){let n=e[0].length,l=e.length,o=new Int32Array(n).fill(-1);o[t]=r,o[r]=t;let i=!1;for(;!i;){i=!0;for(let a=0;a<n;a++){if(o[a]===-1)continue;let s=o[a];for(let f=0;f<l;f++){let u=f^1,g=e[f][a],c=e[u][e[u][s]];if(o[g]===-1)i=!1,o[g]=c,o[c]=g;else if(o[g]!==c)throw new Error("mirroring failed - is the initial map correct?")}}}return o}function fp(e,t){let r=e[0].length,n=e.length,l=new Int8Array(r).fill(-1);for(let a of t)l[a]=0;let o=0,i=!1;for(;!i;){i=!0;for(let a=0;a<r;a++)if(l[a]===o)for(let s=0;s<n;s++){let f=e[s][a];for(;f!==a;)l[f]===-1&&(i=!1,l[f]=o+1),f=e[s][f]}o++}return l}function mh(e,t=!1){let r=hh(e).next().value,n=jr(e,r),l=(t?Nh:zh)(n),o=xa(r.concat(l),!1);return jr(e,o).join("")!==To.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(l),console.log(jr(e,o))),o}function Bh(e){let[t,r]=Pl(12,6,0,3,3),n=Array(12).fill().map((a,s)=>ba(e,s)),l=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[o,i]=[vn,Cl].map(a=>{let s=a.map(f=>Lh[e[f]]);return r[s.reduce((f,u,g)=>f|u<<2*g,0)]});return[l,o,i]}function up(){if(K.phase1_edge)return K.phase1_edge;let e=ap(Un.map(n=>n.ep)),t=bn(e,e),r=bn(t,t);return K.phase1_edge=r}function dh(){return hr.phase1_edge?hr.phase1_edge:hr.phase1_edge=fp(up(),[8+12*9+12**2*10+12**3*11])}function Rh(){return K.phase1_centreA?K.phase1_centreA:K.phase1_centreA=zl(12,6,0,3,3,Un.map(e=>e.ap))}function gp(){return K.phase1_centreB?K.phase1_centreB:K.phase1_centreB=zl(12,6,0,3,3,Un.map(e=>e.bp))}function Jc(){if(hr.phase1_centre)return hr.phase1_centre;let[e,t]=Pl(12,6,0,3,3),r=e.filter(n=>{let l=n>>12&3,o=n>>18&3;return l===2&&o===3}).map(n=>t[n]);return hr.phase1_centre=fp(gp(),r)}function*hh(e){let t=[up(),Rh(),gp()],r=[dh(),Jc(),Jc()];yield*Dh(Bh(e),t,r,15)}function*Dh(e,t,r,n){let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;)yield*cp(e,t,r,o,-1),o++}function*cp(e,t,r,n,l){let o=3,i=8,a=Math.max(r[0][e[0]],r[1][e[1]],r[2][e[2]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===l||s===l-4)continue;let f=[];f[0]=t[0][s][e[0]],f[1]=t[1][s][e[1]],f[2]=t[2][s][e[2]];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=cp(f,t,r,n-1,s);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[s,u]].concat(c)}f[0]=t[0][s][f[0]],f[1]=t[1][s][f[1]],f[2]=t[2][s][f[2]],u++}}}}function f2(e){let[t,r]=Pl(10,5,3,2,0),n=Array(8).fill().map((c,p)=>ba(e,p)),l=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),o=Array(5).fill().map((c,p)=>s2(e,p)),i=a2(o.map(([c,p])=>c+5*p).concat(o.map(([c,p])=>c+5*(p^1)))),a=i.slice(0,5).map(c=>c%5),s=i.slice(0,5).map(c=>c/5|0),f=Sn(a)*8+(s[0]^s[2])+2*(s[0]^s[3])+4*s[4],[u,g]=[vn,Cl].map(c=>{let p=rt(c,yh).map(L=>Fh[e[L]]);return r[p.reduce((L,m,d)=>L|m<<2*d,0)]});return Lp(),Rp(),[u,g,dp[f]+40*mp[l]]}function*va(e){yield*Uh(f2(e),30)}function pp(){if(K.phase2_centre)return K.phase2_centre;let e=zl(10,5,3,2,0,Un.slice(0,4).map(r=>xn(r.ap,Zc))),t=zl(10,5,3,2,0,Un.slice(0,4).map(r=>xn(r.bp,Zc)));return K.phase2_centre=[e,t]}function Lp(){if(K.phase2_edge)return K.phase2_edge;let e=ap(Un.slice(0,4).map(n=>n.ep.slice(0,8))),t=bn(e,bn(e,e)),r;return[r,mp]=ch(t,501),K.phase2_edge=r}function Bp(){if(K.phase2_corner)return K.phase2_corner;let t=Io(5)/2*8,r=[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!1],n=Array(4).fill().map(()=>new Uint32Array(t)),l=Un.slice(0,4).map(o=>a2(xn(o.cp,r)));for(let o=0;o<t;o++){let i=o2(o>>3,5),a=[0,0,o&1,o>>1&1,o>>2&1];a[1]=a[2]^a[3]^a[4];let s=Array(10);for(let f=0;f<5;f++)s[f]=i[f]+5*a[f],s[f+5]=i[f]+5*(a[f]^1);for(let f=0;f<4;f++){let u=rt(l[f],s),g=u.slice(0,5).map(L=>L%5),c=u.slice(0,5).map(L=>L/5|0),p=(c[0]^c[2])+2*(c[0]^c[3])+4*c[4];n[f][o]=Sn(g)*8+p}}return K.phase2_corner=n}function Rp(){return K.phase2_corner_compact||([K.phase2_corner_compact,dp]=ph(Bp(),xh())),K.phase2_corner_compact}function u2(){if(K.phase2_ce)return K.phase2_ce;let e=Rp(),t=Lp();return K.phase2_ce=bn(e,t)}function Ah(){if($0)return $0;let e=f2(To)[2];return $0=sp(u2(),e,e)}function Sh(){let[e,t]=Pl(10,5,3,2,0);return e.filter(r=>(r>>10&63)===41).map(r=>t[r])}function xh(){let e=Bp(),t=e[0].length,r=Array(t).fill(!1);r[0]=!0;let n=!1;for(;!n;){n=!0;for(let l=0;l<t;l++)r[l]&&(r[e[0][l]]||(n=!1,r[e[0][l]]=!0),r[e[1][l]]||(n=!1,r[e[1][l]]=!0))}return r.map((l,o)=>o).filter(l=>r[l])}function vh(){if(hr.phase2_ace)return hr.phase2_ace;let[e,t]=pp(),r=u2(),n=2520,l=40*336,o=n*l,i=f2(To)[2],a=9,s=new Int8Array(o).fill(a);for(let f of Sh())s[f+n*i]=0;for(let f=0;f<a-1;f++)for(let u=s.indexOf(f);u!==-1;u=s.indexOf(f,u+1)){let g=u%n,c=u/n|0;for(let p=0;p<4;p++){let L=e[p][g],m=r[p][c],d=L+n*m;s[d]===a&&(s[d]=f+1),L=e[p][L],m=r[p][m],d=L+n*m,s[d]===a&&(s[d]=f+1)}}return hr.phase2_ace=s}function*Uh(e,t){let[r,n]=pp(),l=u2(),o=vh(),i=Ah(),[a,s,f]=e,u=i[f],g=Math.max(o[a+2520*f],o[s+2520*u]);for(;g<=t;)yield*hp(a,s,f,r,n,l,o,i,g,-1),g++}function*hp(e,t,r,n,l,o,i,a,s,f){let u=Math.max(i[e+2520*r],i[t+2520*a[r]]);if(!(u>s)){if(s===0){yield[];return}else if(u===0)return;for(let g=0;g<4;g++){if(g===f)continue;let c=e,p=t,L=r;for(let m=1;m<=2;m++){c=n[g][c],p=l[g][p],L=o[g][L];let d=hp(c,p,L,n,l,o,i,a,s-1,g);for(;;){let{value:D,done:F}=d.next();if(F)break;yield[[g,m]].concat(D)}}}}}function Ea(e){let[t,r]=Pl(7,3,2,0,2),n=Array(5).fill().map((f,u)=>ba(e,u)),l=Sn(n),o=Array(4).fill().map((f,u)=>s2(e,u)),i=Sn(o.map(f=>f[0]))*2+o.find(f=>f[0]===0)[1],[a,s]=[vn,Cl].map(f=>{let u=rt(f,bh).map(g=>e[g]%4);return r[u.reduce((g,c,p)=>g|c<<2*p,0)]});return[a+210*s,i+24*l]}function wh(){if(K.phase3_2gen_edge)return K.phase3_2gen_edge;let e=Io(5)/2,t=Array(Nl).fill().map(()=>new Uint32Array(e)),r=Ua.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let l=o2(n,5);for(let o=0;o<Nl;o++)t[o][n]=Sn(rt(l,r[o]))}return K.phase3_2gen_edge=t}function kh(){if(K.phase3_2gen_corner)return K.phase3_2gen_corner;let t=Io(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(Nl).fill().map(()=>new Uint32Array(t)),l=Ua.map(o=>xn(o.cp,r).slice(0,4));for(let o=0;o<t;o+=2){let i=o2(o>>1,4),a=i.concat(i.map(s=>s+4));for(let s=0;s<Nl;s++){let f=rt(a,l[s]),u=f.map(c=>c%4),g=f.find(c=>c%4===0)>>2;n[s][o]=Sn(u)*2+g,n[s][o+1]=Sn(u)*2+(g^1)}}return K.phase3_2gen_corner=n}function wa(){return K.phase3_2gen_corneredge?K.phase3_2gen_corneredge:K.phase3_2gen_corneredge=bn(kh(),wh())}function g2(){if(K.phase3_2gen_centre)return K.phase3_2gen_centre;let e=zl(7,3,2,0,2,Ua.map(r=>xn(r.ap,Yc))),t=zl(7,3,2,0,2,Ua.map(r=>xn(r.bp,Yc)));return K.phase3_2gen_centreA=e,K.phase3_2gen_centreB=t,K.phase3_2gen_centre=bn(e,t)}function Fp(){if(e2)return e2;let e=g2(),t=K.phase3_2gen_centreA,r=wa(),n=t[0].length,l=r[0].length,o=n*l,i=25,a=Dr.map(c=>c.length),s=new Int8Array(o).fill(i),f=Ea(To);s[f[0]%n+n*f[1]]=0;let u=0,g=!1;for(;!g&&u<i-1;){g=!0;let c=Array(Nl).fill().map((D,F)=>F).filter(D=>a[D]+u<i);c.sort((D,F)=>a[D]-a[F]);let p=rt(a,c),L=rt(t,c),m=rt(r,c),d=c.length;for(let D=s.indexOf(u);D!==-1;D=s.indexOf(u,D+1)){let F=D%n,S=D/n|0;for(let v=0;v<d;v++){let U=p[v],P=L[v][F],J=m[v][S],z=P+n*J;s[z]>u+U&&(g=!1,s[z]=u+U)}}u++}return e2=s}function yp(){if(t2)return t2;let e=wa().slice(0,2),t=Ea(To);return t2=sp(e,t[1],t[1])}function n2(e,t=Ea(e)){let[r,n]=t,l=r%210,o=Math.floor(r/210),i=g2(),a=K.phase3_2gen_centreA,s=K.phase3_2gen_centreB,f=wa(),u=Fp(),g=yp(),c=0;for(;;){let p=c2(l,o,n,a,s,f,u,g,c);for(let L of p)return L.map(m=>Dr[m]).flat();c++}}function $c(e,t=Ea(e)){let[r,n]=t,l=r%210,o=Math.floor(r/210),i=g2(),a=K.phase3_2gen_centreA,s=K.phase3_2gen_centreB,f=wa(),u=Fp(),g=yp(),c=n2(e).length,p=1/0,L;for(let m=c;m<=c+0;m++){let d=c2(l,o,n,a,s,f,u,g,m);for(let D of d){let F=D.map(U=>Dr[U]).flat(),S=xa(F),v=l2(S);v<p&&(p=v,L=S)}}return L}function _h(e){return(e-1)*(e-2)/2}function l2(e){let t=op(e,!0).replace(/'/g,"").split(" ");return e.length+Ch(t).map(_h).reduce((r,n)=>r+n,0)}function Ch(e){if(e.length<3)return[];let t=e.length,r=[];for(let o=0;o<t-2;o++)r[o]=e[o]===e[o+2];r.push(!1);let n=-1,l=[];for(;n<t-2&&(n=r.indexOf(!0,n+1),n!==-1);){let o=r.indexOf(!1,n+1);l.push(o-n),n=o}return l}function*c2(e,t,r,n,l,o,i,a,s,f=-1){let u=i[e+210*r],g=i[t+210*a[r]],c=Math.max(u,g);if(!(c>s)){if(s===0){yield[];return}if(c!==0)for(let p=0;p<Nl;p++){if(p===f&&Eh[p]<=3)continue;let L=n[p][e],m=l[p][t],d=o[p][r],D=s-Dr[p].length;if(D<0)continue;let F=c2(L,m,d,n,l,o,i,a,D,p);for(;;){let{value:S,done:v}=F.next();if(v)break;yield[p].concat(S)}}}}function zh(e,t=200,r=24){let n=[],l=va(e),o=rt(e,$t).map(s=>s^1),i=va(o),a=Array(1e3);for(let s=0;s<t;s++){{let{value:f,done:u}=l.next();if(!u){let g=jr(e,f),c=f.concat(n2(g));if(c.length<=r)return c;c.length<a.length&&(a=c)}}{let{value:f,done:u}=i.next();if(!u){let g=jr(o,f),c=f.concat(n2(g)).map(([p,L])=>[p^2,L]);if(c.length<=r)return c;c.length<a.length&&(a=c)}}}return a}function Nh(e,t=20,r=30){let n=[],l=va(e),o=rt(e,$t).map(f=>f^1),i=va(o),a,s=1/0;for(let f=0;f<t;f++){{let{value:u,done:g}=l.next();if(!g){let c=jr(e,u),p=xa(u.concat($c(c))),L=l2(p);if(L<=r)return p;L<s&&(a=p,s=L)}}{let{value:u,done:g}=i.next();if(!g){let c=jr(o,u),p=xa(u.concat($c(c)));p=p.map(([m,d])=>[m^2,d]);let L=l2(p);if(L<=r)return p;L<s&&(a=p,s=L)}}}return a}async function Mh(){return gh(await Ph)}var ix,ax,Z0,Y0,To,Oo,YR,$t,sx,Aa,tp,$R,eh,th,Sa,rh,rp,nh,lh,Gt,Kr,Qr,vn,Cl,lp,fh,Un,K,hr,Lh,Fh,yh,Zc,mp,dp,$0,bh,Yc,Dr,Nl,Dp,Ua,Eh,e2,t2,Ph,Ap=A(()=>{"use strict";xt();[ix,ax]=(()=>{let e=new Int8Array(2048),t=new Int8Array(256*8);for(let l=0;l<256;l++)for(let o=0,i=0;o<8;o++)(l>>>o&1)!==0&&(e[o<<8|l]=i,t[i<<8|l]=o,i++);function r(l){let o=255,i=2520,a=0;for(let s=0;s<6;s++){let f=l[s];a+=e[o|f<<8]*i,o&=~(1<<f),i/=7-s}return a}function n(l,o){let i=255,a=2520,s=0;for(let f=0;f<6;f++){let u=l/a|0;l-=u*a,s^=u&1;let g=t[i|u<<8];o[f]=g,i&=~(1<<g),a/=7-f}return o[6]=t[i|s<<8],o[7]=t[i|(s^1)<<8],o}return[r,n]})();Z0={};Y0={};To=Array(72).fill().map((e,t)=>t/9|0),Oo=i2([[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),YR=rt(Oo,Oo),$t=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),sx=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),Aa=Array(72).fill().map((e,t)=>(t+36)%72),tp=Ml(Aa,YR,Aa),$R=Ml($t,Oo,$t),eh=Ml($t,tp,$t),th=i2([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),Sa=rt(Oo,th),rh=rt(Sa,Sa),rp=Ml(Aa,rh,Aa),nh=Ml($t,Sa,$t),lh=Ml($t,rp,$t),Gt=Array(72).fill().map((e,t)=>t/9|0),Kr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],Qr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],vn=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),Cl=vn.map(e=>e+36);lp=[Oo,tp,$R,eh,Sa,rp,nh,lh],fh=["U","L","F","R","u","l","f","r"],Un=lp.map(np);K={},hr={},Lh=[0,0,2,3,0,0,2,3];Fh=[0,1,2,0,0,1,2,0],yh=[0,1,2,3,4,5,7,8,10,11],Zc=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];bh=[0,1,2,3,4,10,11],Yc=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],Dr=[[[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]]];Dr=Dr.concat(Dr.map(e=>ip(e)));Nl=Dr.length,Dp=Dr.map(e=>jr(i2([],72),e)),Ua=Dp.map(np),Eh=Dp.map(ZR);Ph=Ee()});var Sp={};Lt(Sp,{randomFTOScrambleString:()=>Mh});var xp=A(()=>{"use strict";Ap()});async function Up(){return Oh??(Oh=Ih())}async function Ih(){return Zt(await Oe.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
3439
+ Alg R' U' R U B' U' B L\`)}var yB,AB,Cu=F(()=>{"use strict";We();ol();yB=null;AB=null});var zu={};Lt(zu,{cachedData222:()=>vu,cachedMegaminxKPuzzleWithoutMO:()=>Va,cachedSGSDataMegaminx:()=>bu,sgsDataPyraminx:()=>Ha,sgsDataPyraminxFixedOrientation:()=>wu,sgsDataSkewb:()=>Ja,sgsDataSkewbFixedCorner:()=>_u,skewbKPuzzleWithoutMOCached:()=>Xa});var Nu=F(()=>{"use strict";Uu();Eu();ku();Cu()});async function il(e,t){let r=new Bt;r.experimentalPushAlg(e);for(let n of t){let l=(await cr())(n);l!==null&&r.push(B.fromString(l))}return r.toAlg()}var wi=F(()=>{"use strict";ae();xt()});function Xu(){}function EB(e){function t(){}return t.prototype=e||{},new t}function wB(e){return e instanceof Array?e[0]:null}function xo(e,t,r){var n=ji,l=kB,o=wB,i=n[e],s=o(i);i&&!s?H=i:(H=n[e]=t?l(t):{},H.castableTypeMap$=r,H.constructor=H,!t&&(H.typeMarker$=Xu));for(var a=3;a<arguments.length;++a)arguments[a].prototype=H;s&&(H.___clazz$=s)}function kB(e){var t=ji;return EB(t[e])}function _B(){}function Ni(e){return e<<24>>24}function u0(){this.typeName=null,this.simpleName=null,this.packageName=null,this.compoundName=null,this.canonicalName=null,this.typeId=null,this.arrayLiterals=null}function g0(e,t){var r;return r=new u0,r.packageName=e,r.compoundName=t,r}function Or(e,t,r){var n;return n=g0(e,t),NB(r,n),n}function CB(e,t){var r;return r=g0(e,t),r.modifiers=2,r}function qi(e,t){var r;return r=g0("",e),r.typeId=t,r.modifiers=1,r}function Ju(e,t){var r=e.arrayLiterals=e.arrayLiterals||[];return r[t]||(r[t]=e.createClassLiteralForArray(t))}function zB(e){if(e.isPrimitive())return null;var t=e.typeId,r=ji[t];return r}function NB(e,t){if(!!e){t.typeId=e;var r=zB(t);if(!r){ji[e]=[t];return}r.___clazz$=t}}function te(e,t){return Ju(e,t)}function Y(e,t,r,n,l,o){var i;return i=Yu(l,n),re(te(e,o),t,r,l,i),i}function nt(e,t,r,n,l,o){return Zu(e,t,r,n,l,0,o)}function Zu(e,t,r,n,l,o,i){var s,a,f,u,g;if(u=l[o],f=o===i-1,s=f?n:0,g=Yu(s,u),re(te(e,i-o),t[o],r[o],s,g),!f)for(++o,a=0;a<u;++a)g[a]=Zu(e,t,r,n,l,o,i);return g}function re(e,t,r,n,l){return l.___clazz$=e,l.castableTypeMap$=t,l.typeMarker$=Xu,l.__elementTypeId$=r,l.__elementTypeCategory$=n,l}function Yu(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 l=0;l<t;++l)r[l]=n;return r}function Tu(e){var t,r,n;return t=e&lt,r=e>>22&lt,n=e<0?Cr:0,PB(t,r,n)}function PB(e,t,r){return{l:e,m:t,h:r}}function MB(e,t){var r,n,l;return r=e.l+t.l,n=e.m+t.m+(r>>22),l=e.h+t.h+(n>>22),{l:r&lt,m:n&lt,h:l&Cr}}function $t(e,t){return{l:e.l&t.l,m:e.m&t.m,h:e.h&t.h}}function c0(e){var t,r;return e>-129&&e<128?(t=e+128,ki==null&&(ki=Y(Ld,ue,293,256,0,1)),r=ki[t],!r&&(r=ki[t]=Tu(e)),r):Tu(e)}function $u(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 Ya(e,t){return e.l!==t.l||e.m!==t.m||e.h!==t.h}function t0(e,t){return{l:e.l|t.l,m:e.m|t.m,h:e.h|t.h}}function Pi(e,t){var r,n,l;return t&=63,t<22?(r=e.l<<t,n=e.m<<t|e.l>>22-t,l=e.h<<t|e.m>>22-t):t<44?(r=0,n=e.l<<t-22,l=e.m<<t-22|e.l>>44-t):(r=0,n=0,l=e.l<<t-44),{l:r&lt,m:n&lt,h:l&Cr}}function Ln(e,t){var r,n,l,o,i;return t&=63,r=e.h,n=(r&bB)!==0,n&&(r|=-1048576),t<22?(i=r>>t,o=e.m>>t|r<<22-t,l=e.l>>t|e.m<<22-t):t<44?(i=n?Cr:0,o=r>>t-22,l=e.m>>t-22|r<<44-t):(i=n?Cr:0,o=n?lt:0,l=r>>t-44),{l:l&lt,m:o&lt,h:i&Cr}}function eg(e,t){var r,n,l;return r=e.l-t.l,n=e.m-t.m+(r>>22),l=e.h-t.h+(n>>22),{l:r&lt,m:n&lt,h:l&Cr}}function Bn(e){return e.l|e.m<<22}function OB(e){this.string=e}function zr(e,t){return e>t?e:t}function p0(e,t){return e<t?e:t}function IB(e,t){return e.indexOf(t)}function TB(e){return GB(e,0,e.length)}function GB(e,t,r){for(var n="",l=t;l<r;){var o=Math.min(l+1e4,r);n+=String.fromCharCode.apply(null,e.slice(l,o)),l=o}return n}function WB(e){return String.fromCharCode(e&Ze)}function Gu(e){return e.string+=" ",e}function Wu(e,t){return e.string+=t,e}function QB(){OB.call(this,"")}function Mi(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 dn(){Ku||(Ku=!0,kr=nt(Se,[ue,Ae],[11,0],7,[495,18],2),pl=nt(Se,[ue,Ae],[11,0],7,[324,18],2),dl=nt(Se,[ue,Ae],[11,0],7,[336,18],2),Nr=nt(Se,[ue,Ae],[11,0],7,[495,8],2),Xi=Y(qe,je,0,20048,7,1),Hi=Y(qe,je,0,20791,7,1),cl=Y(qe,je,0,82945,7,1),al=nt(Se,[ue,Ae],[11,0],7,[2768,10],2),ul=nt(Se,[ue,Ae],[11,0],7,[2768,10],2),gl=nt(Se,[ue,Ae],[11,0],7,[24,10],2),vo=nt(Se,[ue,Ae],[11,0],7,[24,16],2),Rn=nt(Se,[ue,Ae],[11,0],7,[140,16],2),Vi=Y(qe,je,0,8305,7,1),fl=Y(qe,je,0,48441,7,1))}function jB(e,t,r){return e.slice_0=kr[t.slice_0][r],e.flip=dl[t.flip][($(),Dn)[r<<3|t.fsym]],e.fsym=e.flip&7^t.fsym,e.flip>>=3,e.twist=pl[t.twist][Dn[r<<3|t.tsym]],e.tsym=e.twist&7^t.tsym,e.twist>>=3,e.prun=zr(zr(gt(Xi,e.twist*495+Nr[e.slice_0][e.tsym]),gt(Hi,e.flip*495+Nr[e.slice_0][e.fsym])),gt(cl,e.twist<<11|Mr[e.flip<<3|e.fsym^e.tsym])),e.prun}function qB(e,t,r){return r=($(),yo)[3][r],e.flipc=dl[t.flipc>>3][Dn[r<<3|t.flipc&7]]^t.flipc&7,e.twistc=pl[t.twistc>>3][Dn[r<<3|t.twistc&7]]^t.twistc&7,gt(cl,e.twistc>>3<<11|Mr[e.flipc^e.twistc&7])}function tg(e,t,r){var n;return e.twist=($(),So)[Ii(t)],e.flip=hn[Oi(t)],e.tsym=e.twist&7,e.twist=e.twist>>3,e.prun=gt(cl,e.twist<<11|Mr[e.flip^e.tsym]),e.prun>r||(e.fsym=e.flip&7,e.flip=e.flip>>3,e.slice_0=494-Ll(t.ea,8,!0),e.prun=zr(e.prun,zr(gt(Xi,e.twist*495+Nr[e.slice_0][e.tsym]),gt(Hi,e.flip*495+Nr[e.slice_0][e.fsym]))),e.prun>r)?!1:(n=new Le,Uo(t,1,n),bo(t,1,n),e.twistc=So[Ii(n)],e.flipc=hn[Oi(n)],e.prun=zr(e.prun,gt(cl,e.twistc>>3<<11|Mr[e.flipc^e.twistc&7])),e.prun<=r)}function Do(){dn()}function gt(e,t){return dn(),e[t>>3]>>(t<<2)&15}function rg(e){dn(),!(_i===2||_i===1&&!e)&&(_i===0&&(od(),VB(),XB(),ZB(),HB(),$(),n0(2048,R0,hn,ju=Y(Se,Ae,0,336,7,1),0),n0(2187,D0,So,$a=Y(Se,Ae,0,324,7,1),1),JB(),YB(),$B()),ho(Vi,gl,vo,al,($(),l0),584244,e),ho(fl,r0,Rn,ul,l0,514084,e),ho(Xi,kr,Nr,pl,$a,431619,e),ho(Hi,kr,Nr,dl,ju,431619,e),ho(cl,null,null,pl,$a,103939,e),_i=e?2:1)}function VB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<2768;r++)for(rd(e,($(),sl)[r]),n=0;n<10;n++)Pr(e,me[(tt(),Mt)[n]],t),al[r][n]=Gi(dr[pt(t.ca,8,!1)])&Ze}function HB(){var e,t,r,n,l;for(e=new Le,t=new Le,r0=nt(Se,[ue,Ae],[11,0],7,[140,10],2),r=0;r<140;r++){for(Lg(e.ca,r%70,0,!1),l=0;l<10;l++)Pr(e,($(),me)[(tt(),Mt)[l]],t),r0[r][l]=Ll(t.ca,0,!1)+70*(165>>l&1^~~(r/70))&Ze;for(n=0;n<16;n++)Uo(e,($(),ct)[0][n],t),Rn[r][n]=Ll(t.ca,0,!1)+70*~~(r/70)&Ze}}function XB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<2768;r++)for(og(e,($(),sl)[r]),n=0;n<10;n++)vt(e,me[(tt(),Mt)[n]],t),ul[r][n]=dr[pt(t.ea,8,!0)]}function JB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<336;r++)for(B0(e,($(),R0)[r]),n=0;n<18;n++)vt(e,me[n],t),dl[r][n]=hn[Oi(t)]}function ZB(){var e,t,r,n,l;for(e=new Le,t=new Le,r=0;r<24;r++){for(Fn(e.ea,r,12,!0),l=0;l<10;l++)vt(e,($(),me)[(tt(),Mt)[l]],t),gl[r][l]=pt(t.ea,12,!0)%24&Ze;for(n=0;n<16;n++)bo(e,($(),ct)[0][n],t),vo[r][n]=pt(t.ea,12,!0)%24&Ze}}function ho(e,t,r,n,l,o,i){var s,a,f,u,g,c,p,L,m,d,D,y,S,v,U,P,J,z,Q,x,C,N,b,w,M,j,q,ie,he,ve,Ye,Et,de,Dt,it,mt;if(S=o&15,D=(o>>4&1)===1?f0:0,f=(o>>5&1)===1,s=o>>8&15,u=o>>12&15,g=o>>16&15,d=i?u:g,y=(1<<S)-1,a=t===null,L=a?2048:t.length,m=L*n.length,p=f?10:18,c=p===10?66:599186,U=(e[m>>3]>>(m<<2)&15)-1,U===-1){for(z=0;z<~~(m/8)+1;z++)e[z]=Ro;e[0]^=1,U=0}for(;U<d;){for(M=(U+1)*Ro^-1,Q=0;Q<e.length;Q++)it=e[Q]^M,it&=it>>1,e[Q]+=it&it>>2&Ro;for(N=U>s,ve=N?U+2:U,he=ve*Ro,v=N?U:U+2,++U,mt=U^U+1,Dt=0,z=0;z<m;++z,Dt>>=4){if((z&7)===0&&(Dt=e[z>>3],((Dt^he)-Ro&~(Dt^he)&-2004318072)===0)){z+=7;continue}if((Dt&15)===ve)for(q=z%L,Ye=~~(z/L),P=0,J=0,a&&(P=($(),hn)[q],J=P&7,P>>=3),w=0;w<p;w++){if(de=n[Ye][w],a?ie=($(),Mr)[dl[P][Dn[w<<3|J]]^J^de&y]:ie=r[t[q][w]][de&y],de>>=S,x=de*L+ie,j=e[x>>3]>>(x<<2)&15,j!==v){j<U-1&&(w+=c>>w&3);continue}if(N){e[z>>3]^=mt<<(z<<2);break}for(e[x>>3]^=mt<<(x<<2),b=1,Et=l[de];(Et>>=1)!==0;b++)(Et&1)===1&&(C=de*L,a?C+=($(),Mr)[hn[ie]^b]:C+=r[ie][b^D>>(b<<1)&3],(e[C>>3]>>(C<<2)&15)===v&&(e[C>>3]^=mt<<(C<<2)))}}}}function YB(){var e,t,r,n;for(e=new Le,t=new Le,r=0;r<324;r++)for(d0(e,($(),D0)[r]),n=0;n<18;n++)Pr(e,me[n],t),pl[r][n]=So[Ii(t)]}function $B(){var e,t,r,n,l,o,i,s;for(e=new Le,t=new Le,n=0;n<495;n++){for(Lg(e.ea,494-n,8,!0),o=0;o<18;o+=3)vt(e,($(),me)[o],t),kr[n][o]=494-Ll(t.ea,8,!0)&Ze;for(l=0;l<16;l+=2)bo(e,($(),ct)[0][l],t),Nr[n][l>>1]=494-Ll(t.ea,8,!0)&Ze}for(r=0;r<495;r++)for(l=0;l<18;l+=3)for(s=kr[r][l],i=1;i<3;i++)s=kr[s][l],kr[r][l+i]=s&Ze}function $(){Qu||(Qu=!0,Lr=Y(Ao,ue,7,16,0,1),me=Y(Ao,ue,7,18,0,1),Ji=Y(Bd,ue,0,18,6,1),ag=Y(qe,je,0,48,7,1),Br=nt(qe,[ue,je],[17,0],7,[16,16],2),ct=nt(qe,[ue,je],[17,0],7,[16,16],2),yo=nt(qe,[ue,je],[17,0],7,[16,18],2),Dn=Y(qe,je,0,144,7,1),_r=nt(qe,[ue,je],[17,0],7,[16,18],2),R0=Y(Se,Ae,0,336,7,1),D0=Y(Se,Ae,0,324,7,1),sl=Y(Se,Ae,0,2768,7,1),ml=Y(ne,fe,0,2768,7,1),h0=Y(Se,Ae,0,2768,7,1),Wi=Y(ne,fe,0,24,7,1),hn=Y(Se,Ae,0,2048,7,1),So=Y(Se,Ae,0,2187,7,1),dr=Y(Se,Ae,0,40320,7,1),Mr=Y(Se,Ae,0,2688,7,1),o0=new Pt(2531,1373,67026819,1367),i0=new Pt(2089,1906,322752913,2040),Ki=re(te(ne,2),ue,10,0,[re(te(ne,1),fe,0,7,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),re(te(ne,1),fe,0,7,[6,7,8,0,1,2,3,4,5,15,16,17,9,10,11,12,13,14]),re(te(ne,1),fe,0,7,[3,4,5,6,7,8,0,1,2,12,13,14,15,16,17,9,10,11]),re(te(ne,1),fe,0,7,[2,1,0,5,4,3,8,7,6,11,10,9,14,13,12,17,16,15]),re(te(ne,1),fe,0,7,[8,7,6,2,1,0,5,4,3,17,16,15,11,10,9,14,13,12]),re(te(ne,1),fe,0,7,[5,4,3,8,7,6,2,1,0,14,13,12,17,16,15,11,10,9])]),ld(),id())}function m0(e){e.ca=re(te(ne,1),fe,0,7,[0,1,2,3,4,5,6,7]),e.ea=re(te(ne,1),fe,0,7,[0,2,4,6,8,10,12,14,16,18,20,22])}function ng(e){!e.temps&&(e.temps=new Le),Pr(i0,e,e.temps),Pr(e.temps,o0,e),vt(i0,e,e.temps),vt(e.temps,o0,e)}function L0(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 ed(e){return Gi(dr[pt(e.ca,8,!1)])}function td(e){return dr[pt(e.ea,8,!0)]}function Oi(e){var t,r;for(r=0,t=0;t<11;t++)r=r<<1|e.ea[t]&1;return r}function Ii(e){var t,r;for(r=0,t=0;t<7;t++)r+=(r<<1)+(e.ca[t]>>3);return r}function Ti(e){var t,r;for(!e.temps&&(e.temps=new Le),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;L0(e,e.temps)}function lg(e){var t,r,n,l,o,i,s;for(t=new ig(e),l=new Le,r=Gi(dr[pt(t.ca,8,!1)])>>4,i={l:0,m:0,h:0},s=0;s<6;s++){if(n=Gi(dr[pt(t.ca,8,!1)])>>4,r===n)for(o=0;o<16;o++)Uo(t,ct[0][o],l),Mi(l.ca,e.ca)&&(bo(t,ct[0][o],l),Mi(l.ea,e.ea)&&(i=t0(i,Pi({l:1,m:0,h:0},(s<<4|o)<48?s<<4|o:48))));ng(t),s%3===2&&Ti(t)}return i}function rd(e,t){Fn(e.ca,t,8,!1)}function og(e,t){Fn(e.ea,t,8,!0)}function B0(e,t){var r,n,l;for(n=0,r=10;r>=0;--r,t>>=1)n^=l=t&1,e.ea[r]=(e.ea[r]&-2|l)<<24>>24;e.ea[11]=(e.ea[11]&-2|n)<<24>>24}function d0(e,t){var r,n,l;for(n=15,r=6;r>=0;--r,t=~~(t/3))n-=l=t%3,e.ca[r]=(e.ca[r]&7|l<<3)<<24>>24;e.ca[7]=(e.ca[7]&7|n%3<<3)<<24>>24}function nd(e){var t,r,n,l,o;for(o=0,l=0,n=0;n<12;n++)l|=1<<(e.ea[n]>>1),o^=e.ea[n]&1;if(l!==4095)return-2;if(o!==0)return-3;for(r=0,o=0,t=0;t<8;t++)r|=1<<(e.ca[t]&7),o+=e.ca[t]>>3;return r!==255?-4:o%3!==0?-5:(s0(pt(e.ea,12,!0),12)^s0(pt(e.ca,8,!1),8))!==0?-6:0}function Uo(e,t,r){$();var n,l,o,i,s,a;for(a=Lr[ct[0][t]],s=Lr[t],n=0;n<8;n++)o=a.ca[e.ca[s.ca[n]&7]&7]>>3,i=e.ca[s.ca[n]&7]>>3,l=o<3?i:(3-i)%3,r.ca[n]=(a.ca[e.ca[s.ca[n]&7]&7]&7|l<<3)<<24>>24}function Pr(e,t,r){$();var n,l,o;for(n=0;n<8;n++)l=e.ca[t.ca[n]&7]>>3,o=t.ca[n]>>3,r.ca[n]=(e.ca[t.ca[n]&7]&7|(l+o)%3<<3)<<24>>24}function zi(e,t,r){var n,l,o,i;for(n=0;n<8;n++)o=e.ca[t.ca[n]&7]>>3,i=t.ca[n]>>3,l=o+(o<3?i:6-i),l=l%3+(o<3==i<3?0:3),r.ca[n]=(e.ca[t.ca[n]&7]&7|l<<3)<<24>>24}function Le(){$(),m0(this)}function Pt(e,t,r,n){m0(this),Fn(this.ca,e,8,!1),d0(this,t),Fn(this.ea,r,12,!0),B0(this,n)}function ig(e){m0(this),L0(this,e)}function Gi(e){return $(),e^f0>>((e&15)<<1)&3}function bo(e,t,r){$();var n,l,o;for(o=Lr[ct[0][t]],l=Lr[t],n=0;n<12;n++)r.ea[n]=(o.ea[e.ea[l.ea[n]>>1]>>1]^e.ea[l.ea[n]>>1]&1^l.ea[n]&1)<<24>>24}function vt(e,t,r){$();var n;for(n=0;n<12;n++)r.ea[n]=(e.ea[t.ea[n]>>1]^t.ea[n]&1)<<24>>24}function wr(e,t,r){$();var n;return n=h0[e],r&&(n=n^f0>>((n&15)<<1)&3),n&65520|Br[n&15][t]}function sg(){return $(),0}function ld(){var e,t;for(me[0]=new Pt(15120,0,119750400,0),me[3]=new Pt(21021,1494,323403417,0),me[6]=new Pt(8064,1236,29441808,550),me[9]=new Pt(9,0,5880,0),me[12]=new Pt(1230,412,2949660,0),me[15]=new Pt(224,137,328552,137),e=0;e<18;e+=3)for(t=0;t<2;t++)me[e+t+1]=new Le,vt(me[e+t],me[e],me[e+t+1]),Pr(me[e+t],me[e],me[e+t+1])}function od(){$();var e,t,r;for(n0(40320,sl,dr,l0=Y(Se,Ae,0,2768,7,1),2),e=new Le,r=0;r<2768;r++)og(e,sl[r]),ml[r]=Ll(e.ea,0,!0)+s0(sl[r],8)*70<<24>>24,Ti(e),h0[r]=dr[pt(e.ea,8,!0)];for(t=0;t<24;t++)Fn(e.ea,t,12,!0),Ti(e),Wi[t]=pt(e.ea,12,!0)%24<<24>>24}function id(){var e,t,r,n,l,o,i,s,a,f,u,g,c,p,L,m;for(e=new Le,t=new Le,r=new Pt(28783,0,259268407,0),m=new Pt(15138,0,119765538,7),g=new Pt(5167,0,83473207,0),l=0;l<8;l++)g.ca[l]=Ni(g.ca[l]|24);for(o=0;o<16;o++)Lr[o]=new ig(e),zi(e,m,t),vt(e,m,t),L=t,t=e,e=L,o%4===3&&(zi(L,g,t),vt(L,g,t),L=t,t=e,e=L),o%8===7&&(zi(L,r,t),vt(L,r,t),L=t,t=e,e=L);for(i=0;i<16;i++)for(a=0;a<16;a++)for(zi(Lr[i],Lr[a],e),u=0;u<16;u++)if(Mi(Lr[u].ca,e.ca)){Br[i][a]=u,ct[u][a]=i;break}for(f=0;f<18;f++)for(p=0;p<16;p++){for(Uo(me[f],ct[0][p],e),c=0;c<18;c++)if(Mi(me[c].ca,e.ca)){yo[p][f]=c,_r[p][(tt(),Bl)[f]]=Bl[c];break}p%2===0&&(Dn[f<<3|p>>1]=yo[p][f])}for(n=0;n<18;n++)for(Ji[n]=lg(me[n]),s=n,p=0;p<48;p++)yo[p%16][s]<n&&(ag[p]|=1<<n),p%16===15&&(s=Ki[2][s])}function n0(e,t,r,n,l){$();var o,i,s,a,f,u,g,c,p;for(o=new Le,s=new Le,i=0,f=0,p=l>=2?1:2,u=l!==1,a=0;a<e;a++)if(r[a]===0){switch(l){case 0:{B0(o,a);break}case 1:{d0(o,a);break}case 2:Fn(o.ea,a,8,!0)}for(g=0;g<16;g+=p){switch(u?bo(o,g,s):Uo(o,g,s),l){case 0:{f=Oi(s);break}case 1:{f=Ii(s);break}case 2:f=pt(s.ea,8,!0)}l===0&&(Mr[i<<3|g>>1]=f&Ze),f===a&&(n[i]=(n[i]|1<<~~(g/p))&Ze),c=~~((i<<4|g)/p),r[f]=c&Ze}t[i++]=a&Ze}return i}function sd(e,t,r,n,l,o,i,s){var a,f,u,g,c;if(g=zr(gt((dn(),fl),(i>>4)*140+Rn[($(),ml)[s>>4]&255][ct[i&15][s&15]]),zr(gt(fl,n*140+Rn[ml[t]&255][ct[l][r]]),gt(Vi,t*24+vo[o][r]))),g>e.maxDep2)return g-e.maxDep2;for(a=e.maxDep2;a>=g&&(c=gg(e,n,l,t,r,o,a,e.depth1,10),!(c<0));a--){for(a-=c,e.solLen=0,e.solution=new Bg,md(e.solution,e.verbose,e.urfIdx,e.depth1),u=0;u<e.depth1+a;u++)Vu(e.solution,e.move[u]);for(f=e.preMoveLen-1;f>=0;f--)Vu(e.solution,e.preMoves[f]);e.solLen=e.solution.length_0}return a!==e.maxDep2?(e.maxDep2=p0(pg,e.solLen-e.length1-1),$u(e.probe,e.probeMin)?0:1):1}function ad(e){var t,r,n,l,o,i,s,a,f,u,g,c,p,L,m;if(e.isRec=!1,$u(e.probe,e.solution?e.probeMin:e.probeMax))return 0;for(e.probe=MB(e.probe,{l:1,m:0,h:0}),n=e.valid1;n<e.depth1;n++)Pr(e.phase1Cubie[n],($(),me)[e.move[n]],e.phase1Cubie[n+1]),vt(e.phase1Cubie[n],me[e.move[n]],e.phase1Cubie[n+1]);for(e.valid1=e.depth1,s=ed(e.phase1Cubie[e.depth1]),a=s&15,s>>=4,f=td(e.phase1Cubie[e.depth1]),u=f&15,f>>=4,g=pt(e.phase1Cubie[e.depth1].ea,12,!0)%24,r=wr(f,u,!1),t=wr(s,a,!0),l=e.depth1===0?-1:e.move[e.depth1-1],o=e.preMoveLen===0?-1:e.preMoves[e.preMoveLen-1],m=0,L=(e.preMoveLen===0?1:2)*(e.depth1===0?1:2),c=0,p=(1<<L)-1;c<L;c++){if((p>>c&1)!==0){if(p&=~(1<<c),m=sd(e,s,a,f,u,g,r,t),m===0||m>2)break;m===2&&(p&=4<<c)}if(p===0)break;(c&1)===0&&e.depth1>0?(i=(tt(),Bl)[~~(l/3)*3+1],e.move[e.depth1-1]=Mt[i]*2-e.move[e.depth1-1],g=(dn(),gl)[g][i],s=al[s][($(),_r)[a][i]],a=Br[s&15][a],s>>=4,f=ul[f][_r[u][i]],u=Br[f&15][u],f>>=4,t=wr(s,a,!0),r=wr(f,u,!1)):e.preMoveLen>0&&(i=(tt(),Bl)[~~(o/3)*3+1],e.preMoves[e.preMoveLen-1]=Mt[i]*2-e.preMoves[e.preMoveLen-1],g=($(),Wi)[(dn(),gl)[Wi[g]][i]],s=al[t>>4][_r[t&15][i]],t=s&-16|Br[s&15][t&15],s=wr(t>>4,t&15,!0),a=s&15,s>>=4,f=ul[r>>4][_r[r&15][i]],r=f&-16|Br[f&15][r&15],f=wr(r>>4,r&15,!1),u=f&15,f>>=4)}return e.depth1>0&&(e.move[e.depth1-1]=l),e.preMoveLen>0&&(e.preMoves[e.preMoveLen-1]=o),m===0?0:2}function fd(e){var t;for(e.conjMask=0,e.selfSym=lg(e.cc),e.conjMask|=Ya($t(Ln(e.selfSym,16),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?18:0,e.conjMask|=Ya($t(Ln(e.selfSym,32),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?36:0,e.conjMask|=Ya($t(Ln(e.selfSym,48),{l:Ze,m:0,h:0}),{l:0,m:0,h:0})?56:0,e.selfSym=$t(e.selfSym,{l:lt,m:lt,h:15}),e.maxPreMoves=e.conjMask>7?0:20,t=0;t<6;t++)L0(e.urfCubieCube[t],e.cc),tg(e.urfCoordCube[t],e.urfCubieCube[t],20),ng(e.cc),t%3===2&&Ti(e.cc)}function fg(e,t,r,n,l){var o,i,s,a,f,u;if(t.prun===0&&n<5)return e.allowShorter||n===0?(e.depth1-=n,f=ad(e),e.depth1+=n,f):1;for(u=sg(c0(r)),o=0;o<18;o+=3)if(!(o===l||o===l-9)){for(s=0;s<3;s++)if(i=o+s,!(e.isRec&&i!==e.move[e.depth1-n]||u!==0&&(u&1<<i)!==0)){if(a=jB(e.nodeUD[n],t,i),a>n)break;if(a===n)continue;if(a=qB(e.nodeUD[n],t,i),a>n)break;if(a===n)continue;if(e.move[e.depth1-n]=i,e.valid1=p0(e.valid1,e.depth1-n),f=fg(e,e.nodeUD[n],r&Bn(($(),Ji)[i]),n-1,o),f===0)return 0;if(f>=2)break}}return 1}function ug(e,t,r,n,l){var o,i,s;if(e.preMoveLen=e.maxPreMoves-t,(e.isRec?e.depth1===e.length1-e.preMoveLen:e.preMoveLen===0||(225207>>r&1)===0)&&(e.depth1=e.length1-e.preMoveLen,e.phase1Cubie[0]=n,e.allowShorter=e.depth1===e0&&e.preMoveLen!==0,tg(e.nodeUD[e.depth1+1],n,e.depth1)&&fg(e,e.nodeUD[e.depth1+1],l,e.depth1,-1)===0))return 0;if(t===0||e.preMoveLen+e0>=e.length1)return 1;for(s=sg(c0(l)),(t===1||e.preMoveLen+1+e0>=e.length1)&&(s|=225207),r=~~(r/3)*3,o=0;o<18;o++){if(o===r||o===r-9||o===r+9){o+=2;continue}if(!(e.isRec&&o!==e.preMoves[e.maxPreMoves-t]||(s&1<<o)!==0)&&(Pr(($(),me)[o],n,e.preMoveCubes[t]),vt(me[o],n,e.preMoveCubes[t]),e.preMoves[e.maxPreMoves-t]=o,i=ug(e,t-1,o,e.preMoveCubes[t],l&Bn(Ji[o])),i===0))return 0}return 1}function gg(e,t,r,n,l,o,i,s,a){var f,u,g,c,p,L,m,d,D,y,S;if(t===0&&n===0&&o===0)return i;for(D=(tt(),Fo)[a],m=0;m<10;m++){if((D>>m&1)!==0){m+=66>>m&3;continue}if(d=(dn(),gl)[o][m],u=al[n][($(),_r)[l][m]],g=Br[u&15][l],u>>=4,p=ul[t][_r[r][m]],L=Br[p&15][r],p>>=4,c=wr(p,L,!1),f=wr(u,g,!0),y=gt(fl,(c>>4)*140+Rn[ml[f>>4]&255][ct[c&15][f&15]]),y>i+1)return i-y+1;if(y>=i){m+=66>>m&3&i-y;continue}if(y=zr(gt(Vi,u*24+vo[d][g]),gt(fl,p*140+Rn[ml[u]&255][ct[L][g]])),y>=i){m+=66>>m&3&i-y;continue}if(S=gg(e,p,L,u,g,d,i-1,s+1,m),S>=0)return e.move[s]=Mt[m],S;if(S<-2)break;S<-1&&(m+=66>>m&3)}return-1}function ud(e){for(e.length1=e.isRec?e.length1:0;e.length1<e.solLen;e.length1++)for(e.maxDep2=p0(pg,e.solLen-e.length1-1),e.urfIdx=e.isRec?e.urfIdx:0;e.urfIdx<6;e.urfIdx++)if((e.conjMask&1<<e.urfIdx)===0&&ug(e,e.maxPreMoves,-30,e.urfCubieCube[e.urfIdx],Bn($t(e.selfSym,{l:Ze,m:0,h:0})))===0)return e.solution?Hu(e.solution):"Error 8";return e.solution?Hu(e.solution):"Error 7"}function gd(e,t){var r;return r=cd(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,rg(!1),fd(e),ud(e))}function cd(e,t){var r,n,l,o;for(n=0,l=Y(ne,fe,0,54,7,1),r=TB(re(te(Se,1),Ae,0,7,[t.charCodeAt(4),t.charCodeAt(13),t.charCodeAt(22),t.charCodeAt(31),t.charCodeAt(40),t.charCodeAt(49)])),o=0;o<54;o++){if(l[o]=IB(r,WB(t.charCodeAt(o)))<<24>>24,l[o]===-1)return-1;n+=1<<(l[o]<<2)}return n!==10066329?-1:(pd(l,e.cc),nd(e.cc))}function cg(){var e,t,r;for(this.move=Y(qe,je,0,31,7,1),this.nodeUD=Y(Ci,ue,31,21,0,1),this.nodeRL=Y(Ci,ue,31,21,0,1),this.nodeFB=Y(Ci,ue,31,21,0,1),this.cc=new Le,this.urfCubieCube=Y(Ao,ue,7,6,0,1),this.urfCoordCube=Y(Ci,ue,31,6,0,1),this.phase1Cubie=Y(Ao,ue,7,21,0,1),this.preMoveCubes=Y(Ao,ue,7,21,0,1),this.preMoves=Y(qe,je,0,20,7,1),t=0;t<21;t++)this.nodeUD[t]=new Do,this.nodeRL[t]=new Do,this.nodeFB[t]=new Do,this.phase1Cubie[t]=new Le;for(r=0;r<6;r++)this.urfCubieCube[r]=new Le,this.urfCoordCube[r]=new Do;for(e=0;e<20;e++)this.preMoveCubes[e+1]=new Le}function tt(){if(!qu){qu=!0;var e,t,r,n,l,o;for(mn=re(te(ne,2),ue,10,0,[re(te(ne,1),fe,0,7,[8,9,20]),re(te(ne,1),fe,0,7,[6,18,38]),re(te(ne,1),fe,0,7,[0,36,47]),re(te(ne,1),fe,0,7,[2,45,11]),re(te(ne,1),fe,0,7,[29,26,15]),re(te(ne,1),fe,0,7,[27,44,24]),re(te(ne,1),fe,0,7,[33,53,42]),re(te(ne,1),fe,0,7,[35,17,51])]),pr=re(te(ne,2),ue,10,0,[re(te(ne,1),fe,0,7,[5,10]),re(te(ne,1),fe,0,7,[7,19]),re(te(ne,1),fe,0,7,[3,37]),re(te(ne,1),fe,0,7,[1,46]),re(te(ne,1),fe,0,7,[32,16]),re(te(ne,1),fe,0,7,[28,25]),re(te(ne,1),fe,0,7,[30,43]),re(te(ne,1),fe,0,7,[34,52]),re(te(ne,1),fe,0,7,[23,12]),re(te(ne,1),fe,0,7,[21,41]),re(te(ne,1),fe,0,7,[50,39]),re(te(ne,1),fe,0,7,[48,14])]),mr=nt(qe,[ue,je],[17,0],7,[13,13],2),a0=re(te(KB,1),ue,2,4,["U ","U2","U'","R ","R2","R'","F ","F2","F'","D ","D2","D'","L ","L2","L'","B ","B2","B'"]),Mt=re(te(qe,1),je,0,7,[0,1,2,4,7,9,10,11,13,16,3,5,6,8,12,14,15,17]),Bl=Y(qe,je,0,18,7,1),Fo=Y(qe,je,0,11,7,1),t=0;t<18;t++)Bl[Mt[t]]=t;for(r=0;r<10;r++)for(n=~~(Mt[r]/3),Fo[r]=0,l=0;l<10;l++)o=~~(Mt[l]/3),Fo[r]|=(n===o||n%3===o%3&&n>=o?1:0)<<l;for(Fo[10]=0,e=0;e<13;e++)for(mr[e][0]=mr[e][e]=1,l=1;l<e;l++)mr[e][l]=mr[e-1][l-1]+mr[e-1][l]}}function Ll(e,t,r){tt();var n,l,o,i,s;for(n=e.length-1,o=0,s=4,l=n;l>=0;l--)i=mg(e[l],r),(i&12)===t&&(o+=mr[l][s--]);return o}function s0(e,t){tt();var r,n;for(n=0,r=t-2;r>=0;r--)n^=e%(t-r),e=~~(e/(t-r));return n&1}function pt(e,t,r){tt();var n,l,o,i;for(l=0,i={l:1323536,m:2777561,h:1043915},n=0;n<t-1;n++)o=mg(e[n],r)<<2,l=(t-n)*l+Bn($t(Ln(i,o),{l:15,m:0,h:0})),i=eg(i,Pi({l:1118480,m:279620,h:69905},o));return l}function mg(e,t){return t?e>>1:e&7}function Lg(e,t,r,n){tt();var l,o,i,s;for(l=e.length-1,s=4,o=l,i=l;i>=0;i--)t>=mr[i][s]?(t-=mr[i][s--],e[i]=Qi(e[i],s|r,n)):((o&12)===r&&(o-=4),e[i]=Qi(e[i],o--,n))}function Fn(e,t,r,n){tt();var l,o,i,s,a,f;for(f={l:1323536,m:2777561,h:1043915},l={l:0,m:0,h:0},s=2;s<=r;s++)l=t0(Pi(l,4),c0(t%s)),t=~~(t/s);for(o=0;o<r-1;o++)a=(Bn(l)&15)<<2,l=Ln(l,4),e[o]=Qi(e[o],Bn($t(Ln(f,a),{l:15,m:0,h:0})),n),i=eg(Pi({l:1,m:0,h:0},a),{l:1,m:0,h:0}),f=t0($t(f,i),$t(Ln(f,4),{l:~i.l&lt,m:~i.m&lt,h:~i.h&Cr}));e[r-1]=Qi(e[r-1],Bn($t(f,{l:15,m:0,h:0})),n)}function Qi(e,t,r){return(r?t<<1|e&1:t|e&-8)<<24>>24}function pd(e,t){tt();var r,n,l,o,i,s,a,f;for(o=0;o<8;o++)t.ca[o]=0;for(i=0;i<12;i++)t.ea[i]=0;for(s=0;s<8;s++){for(f=0;f<3&&!(e[mn[s][f]]===0||e[mn[s][f]]===3);f++);for(r=e[mn[s][(f+1)%3]],n=e[mn[s][(f+2)%3]],a=0;a<8;a++)if(r===~~(mn[a][1]/9)&&n===~~(mn[a][2]/9)){t.ca[s]=Ni(f%3<<3|a);break}}for(l=0;l<12;l++)for(a=0;a<12;a++){if(e[pr[l][0]]===~~(pr[a][0]/9)&&e[pr[l][1]]===~~(pr[a][1]/9)){t.ea[l]=Ni(a<<1);break}if(e[pr[l][0]]===~~(pr[a][1]/9)&&e[pr[l][1]]===~~(pr[a][0]/9)){t.ea[l]=Ni(a<<1|1);break}}}function Vu(e,t){var r,n,l;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){l=(t%3+e.moves[e.length_0-1]%3+1)%4,l===3?--e.length_0:e.moves[e.length_0-1]=r*3+l;return}if(e.length_0>1&&r%3===n%3&&r===~~(e.moves[e.length_0-2]/3)){l=(t%3+e.moves[e.length_0-2]%3+1)%4,l===3?(e.moves[e.length_0-2]=e.moves[e.length_0-1],--e.length_0):e.moves[e.length_0-2]=r*3+l;return}e.moves[e.length_0++]=t}function md(e,t,r,n){e.verbose=t,e.urfIdx=r,e.depth1=n}function Hu(e){var t,r,n;if(r=new QB,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+=". "),Gu(Wu(r,(tt(),a0)[($(),Ki)[n][e.moves[t]]]));else for(t=e.length_0-1;t>=0;t--)Gu(Wu(r,(tt(),a0)[($(),Ki)[n][e.moves[t]]])),(e.verbose&1)!==0&&t===e.depth1&&(r.string+=". ");return r.string}function Bg(){this.moves=Y(qe,je,0,31,7,1)}var ue,lt,Cr,bB,Ze,Ae,je,f0,Ro,fe,H,ji,ki,KB,Ku,Rn,r0,al,fl,ul,dl,Vi,vo,gl,cl,pl,Nr,Hi,kr,Xi,_i,Ci,Qu,Lr,dr,sl,hn,R0,Mr,Wi,ml,h0,Dn,yo,_r,Br,ct,ju,l0,$a,So,D0,ag,me,Ji,o0,i0,Ki,Ao,pg,e0,qu,mr,Fo,mn,pr,a0,Bl,Mt,qe,Ld,ne,Bd,Se,dd,Rd,dg=F(()=>{"use strict";ue={3:1},lt=4194303,Cr=1048575,bB=524288,Ze=65535,Ae={11:1,3:1},je={17:1,3:1},f0=14540032,Ro=286331153,fe={10:1,3:1},ji={};xo(1,null,{},_B);xo(79,1,{},u0);H.createClassLiteralForArray=function(t){var r;return r=new u0,r.modifiers=4,t>1?r.componentType=Ju(this,t-1):r.componentType=this,r};H.isPrimitive=function(){return(this.modifiers&1)!==0};KB=Or("java.lang","String",2);Ku=!1;xo(31,1,{31:1},Do);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;_i=0,Ci=Or("org.cubing.min2phase.client","CoordCube",31),Qu=!1;Ao=Or("org.cubing.min2phase.client","CubieCube",7);xo(72,1,{},cg);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;pg=12,e0=7,qu=!1;xo(150,1,{},Bg);H.depth1=0;H.length_0=0;H.urfIdx=0;H.verbose=0;qe=qi("int","I");Or("com.google.gwt.lang","CollapsedPropertyHolder",252);Or("com.google.gwt.lang","JavaClassHierarchySetupUtil",254);Ld=Or("com.google.gwt.lang","LongLibBase/LongEmul",null);Or("com.google.gwt.lang","ModuleUtils",257);ne=qi("byte","B"),Bd=qi("long","J"),Se=qi("char","C");Or("com.google.gwt.user.client.rpc","XsrfToken",null),CB("java.util","Map/Entry");dd=function(){rg(!1)},Rd=function(e){return gd(new cg,e)}});var Rg={};Lt(Rg,{initialize:()=>dd,solveState:()=>Rd});var hg=F(()=>{"use strict";dg()});var F0,Dg=F(()=>{"use strict";_t();F0=Ke(()=>Promise.resolve().then(()=>(hg(),Rg)))});function Fg(e,t){return e.slice(t)+e.slice(0,t)}function Ad(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(Fg(hd[e.stateData.EDGES.pieces[r]],e.stateData.EDGES.orientation[r]));for(let r=0;r<8;r++)t[1].push(Fg(Dd[e.stateData.CORNERS.pieces[r]],e.stateData.CORNERS.orientation[r]));return t.push(Fd),t}function yg(e){let t=Ad(e);return yd.map(([r,n,l])=>t[r][n][l]).join("")}var hd,Dd,Fd,yd,Ag=F(()=>{"use strict";hd="UF UR UB UL DF DR DB DL FR FL BR BL".split(" "),Dd="UFR URB UBL ULF DRF DFL DLB DBR".split(" "),Fd="U L F R B D".split(" "),yd=[[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 Sg(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 xg(e,t){if(Sg(e.startState(),t))return!1;for(let r of"ULFRBD")for(let n=1;n<4;n++){let l=e.moveToTransformation(new B(r,n)).toKState();if(Sg(l,t))return!1}return!0}var vg=F(()=>{"use strict";ae();We()});var Ug,bg=F(()=>{"use strict";Ug=[["R U'","R2 B","D2 B2","D' L B'","R' U'","B","D B2","R' B","L' U","L2 B'","B2","D L B'","L U","B'","U'","R B","D' B2","L B'","U2","U L' B'","","U' L' B'","U","L' B'"],["F2 L2","F' L'","R' F L2","D' L2","F L2","F2 L'","R' F' L'","R2 F L2","R2 F2 L'","L2","F L'","D' L","D2 L2","R2 F' L'","D L","","L2 F L'","L F' L2","L F L'","F' L2","L'","D L2","D F L'","L"],["R B U2 B'","R2 B U' B'","F2 B U B'","F B2 L' B2","B2 L B2","B U' B'","R2 B U2 B'","R' B U' B'","B2 L' B2","F B U B'","B2 U' B2","B' L B","L F' B D' B'","B' U' B2 D B'","B U2 B'","R B U' B'","B2 L2 B2","D' B' L B","B U B'","F' B2 L' B2","","B2 L' B' U' B'"],["U F2 L2 U'","F' U L' U'","F2 U L' U'","U F L2 U'","U2 B2 U2","R' U' B U","D2 U L U'","D U2 B' U2","U L2 U'","F U L' U'","D U L U'","U2 B' U2","","U2 B' U' L' U'","U2 L' U2","U' B U","U L U'","D' U2 B' U2","U L' U'","U2 B U2"],["R' D' F2","F'","F2","D R F'","R D' F2","R2 F'","D' F2","R F'","F2 R' D' F2","F","D2 F2","D' R F'","R2 D' F2","R' F'","D F2","D2 R F'","","F R' D' F2"],["R' D2 F' D F","R F2 R2 F2","R2 F' D2 F","F' R2 D2 F","L D' L'","D F' D2 F","F2 R2 F2","R F' D2 F","F' R2 D' F","F' R' D2 F","F2 R' F2","L D L'","F' R D' F","F2 R F2","F' D2 F","","L D2 R D' L'","F' D2 F' R F2","D2 R2 F2 R2 F2","D F' D' F","F' D F"],["U F2 U'","R U F' U'","D R U F2 U'","U F U'","R2 U F2 U'","R' U F' U'","R U F2 U'","R2 U F' U'","","U L D L' F U'","F2 D' R D F2","D2 U F U'","R' U F2 U'","U F' U'","F2 D2 R D2 F2","D U F U'"],["R2","R' B' D B","D R'","F' R2 F","","R B' D B","R'","B' D B","D' R'","D2 F' R2 F","R","R2 B' D B","D2 R'","B' D' B"],["R2 D' R2","F' R' F R","R D' R2 D R'","D2 R2 D2 R2","R' D' F' R F","U F D F' U'","","R2 D2 B R' B' R'","R' F D' F2 R F","R2 D R2","F2 U F U' F","R' D F' R F","D R2 D2 R2","U F D' F' U'","D R' D2 F' R F","R2 D2 R2","U F D2 F' U'","R' D2 F' R F"],["B R B'","F D F' B R2 B'","D B R2 B'","D2 B R' B'","B R2 B'","D B R' B'","D' B R2 B'","B R' B'","","B R2 B' D B R' B'","D2 B R2 B'","D' B R' B'"],["","R' D R F D2 F'","R' D R","D F D' F'","R F' R' F","F D' F'","R' D' R","F D2 F'","R' D2 R","F D F'"],["","F2 D2 R F' R' D2 F' D2 F'","F2 D2 F' D' F D' F' D2 F'","F2 D F2 D F2 D2 F2","D2 F L D2 L' D2 F'","D F D2 L D2 L' F'","R' D B' D2 B D' R","R' D2 B' D2 B R","F D2 F' D F D F'","F D' L D2 L' D F'","B D' F D B' D' F'","F D2 L D2 L' F'","F D' L D L' D F'","F L D2 L' D2 F'","R' B' D2 B D2 R"],["D'","F L D L' D' F'","D2","L B D B' D' L'","D","B' L' D' L D B","","D F L D L' D' F'"],["F' D2 F D F' D F","F' D' R' D R F","F' R' D' R D F","B D R D' R' B'","","D B' D' L' D L B"],["D F D F' D F D2 F'","F' U2 B' R' B U2 F' L F' L' F'","","D2 L D L2 F L F2 D F"],["L B' L' F L B L' F'","F2 U F' D2 F U' F' D2 F'","D' F' D B D' F D B'","F L2 F R2 F' L2 F R2 F2","D B D' F' D B' D' F","R F L F' R' F L' F'","","D2 B L' U2 L B' D2 B L' U2 L B'","D2 F R' U2 R F' D2 F R' U2 R F'","R F L' F' R' F L F'","D F D' B' D F' D' B","L2 F2 L' B2 L F2 L' B2 L'"],["L B R' B' L' B R B'","R' B R F' R' B' R F","L D2 L U L' D2 L U' L2","","D2 B' D2 F D' L2 F L2 F' D2 B D' F'","D2 F' R' F R2 B' D2 B D2 R' F D2 F'","L B L' F L B' L' F'","F' D2 F' U' F D2 F' U F2","D' B' D F D' B D F'"],["","D2 F' L U2 L' F D2 F' L U2 L' F","D2 B' R U2 R' B D2 B' R U2 R' B"]]});async function wg(){let e=await Oe["3x3x3"].kpuzzle(),t=e.startState();for(let r of Ug)t=t.applyAlg(E.fromString((await cr())(r)));return xg(e,t)?t:wg()}async function y0(e){return be(),E.fromString((await F0).solveState(yg(e)))}async function Rl(){return y0(await wg())}async function kg(){(await F0).initialize()}async function _g(){return il(await Rl(),Sd)}async function Cg(){let e=new Bt,t=await Rl();return e.experimentalPushAlg(Eg),e.experimentalPushAlg(t),e.experimentalPushAlg(Eg),e.toAlg()}var Sd,Eg,A0=F(()=>{"use strict";ae();gr();xt();St();wi();Dg();Ag();vg();bg();Sd=[[null,"Rw","Rw2","Rw'","Fw","Fw'"],[null,"Dw","Dw2","Dw'"]];Eg=new E("R' U' F")});function ge(e,...t){let r=t.length,n=e[t[r-1]];for(let l=r;l>0;l--)e[t[l]]=e[t[l-1]];return e[t[0]]=n,ge}function zg(e,t,r,n){r=(r||8)-1;let l=1985229328,o=0;n??(n=0),n<0&&(t<<=1);for(let i=0;i<r;++i){let s=S0[r-i],a=~~(t/s);o^=a,t%=s,a<<=2,e[i]=l>>a&7;let f=(1<<a)-1;l=(l&f)+(l>>4&~f)}return n<0&&(o&1)!==0?(e[r]=e[r-1],e[r-1]=l&7):e[r]=l&7,e}var Re,S0,Ng=F(()=>{"use strict";Re=[],S0=[1];for(let e=0;e<32;++e){Re[e]=[];for(let t=0;t<32;++t)Re[e][t]=0}for(let e=0;e<32;++e){Re[e][0]=Re[e][e]=1,S0[e+1]=S0[e]*(e+1);for(let t=1;t<e;++t)Re[e][t]=Re[e-1][t-1]+Re[e-1][t]}});function I(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 kd(e){return new Co[e]}function ht(e,t,r,...n){let l=Co[e];l&&!l.___clazz$?X=l.prototype:(!l&&(l=Co[e]=function(){}),X=l.prototype=t<0?{}:kd(t),X.castableTypeMap$=r);for(let o of n)o.prototype=X;l.___clazz$&&(X.___clazz$=l.___clazz$,l.___clazz$=null)}function Kr(e){let t={};for(let r=0,n=e.length;r<n;++r)t[e[r]]=1;return t}function lc(){}function _d(e,t){let r=oc(0,t);return ic(e.___clazz$,e.castableTypeMap$,e.queryId$,r),r}function oc(e,t){let r=new Array(t);if(e===3)for(let n=0;n<t;++n){let l={m:0,l:0,h:0};l.l=l.m=l.h=0,r[n]=l}else if(e>0){let n=[null,0,!1][e];for(let l=0;l<t;++l)r[l]=n}return r}function z0(e,t,r,n,l){let o=oc(l,n);return ic(e,t,r,o),o}function ic(e,t,r,n){return sc(),zd(n,U0,b0),n.___clazz$=e,n.castableTypeMap$=t,n.queryId$=r,n}function ls(e,t,r){return e[t]=r}function sc(){Pg||(Pg=!0,U0=[],b0=[],Cd(new lc,U0,b0))}function Cd(e,t,r){let n=0,l;for(let o in e)(l=e[o])&&(t[n]=o,r[n]=l,++n)}function zd(e,t,r){sc();for(let n=0,l=t.length;n<l;++n)e[t[n]]=r[n]}function Nd(e,t){return e.castableTypeMap$&&!!e.castableTypeMap$[t]}function Pd(e,t){return e!==null&&Nd(e,t)}function Md(){if(Mg)return!1;Mg=!0,Bs=I(15582,36),ds=I(15582),Gt=I(15582),Sl=I(48,48),It=I(48,36),Al=I(48),M0=I(48)}function N0(e){e.ct=I(24)}function Og(e,t){let r,n;if(Pd(t,rc)){for(r=t,n=0;n<24;++n)if(e.ct[n]!==r.ct[n])return!1;return!0}return!1}function os(e){let t,r,n;for(r=0,n=8,t=23;t>=0;--t)e.ct[t]===1&&(r+=Re[t][n--]);return r}function Yi(e){let t,r;if(bl!==null)return bl[os(e)];for(r=0;r<48;++r){if(t=Kd(os(e)),t!==-1)return t*64+r;oe(e,0),r%2===1&&oe(e,1),r%8===7&&oe(e,2),r%16===15&&oe(e,3)}}function Ot(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.ct,16,17,18,19,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.ct,20,21,22,23,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break}case 7:{h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break}case 10:{h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function oe(e,t){switch(t){case 0:{Ot(e,19),Ot(e,28);break}case 1:{Ot(e,21),Ot(e,32);break}case 2:{h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.ct,16,19,21,22,1),h(e.ct,17,18,20,23,1);break}case 3:Ot(e,18),Ot(e,29),Ot(e,24),Ot(e,35)}}function Ig(e,t){let r;for(r=0;r<t;++r)oe(e,0),r%2===1&&oe(e,1),r%8===7&&oe(e,2),r%16===15&&oe(e,3)}function P0(e,t){let r,n;for(n=8,r=23;r>=0;--r)e.ct[r]=0,t>=Re[r][n]&&(t-=Re[r][n--],e.ct[r]=1)}function $i(e,t){let r;for(r=0;r<24;++r)e.ct[r]=t.ct[r]}function zo(){let e;for(N0(this),e=0;e<8;++e)this.ct[e]=1;for(e=8;e<24;++e)this.ct[e]=0}function es(e,t){let r;for(N0(this),r=0;r<24;++r)this.ct[r]=~~(e.ct[r]/2)===t?1:0}function wo(e){let t;for(N0(this),t=0;t<24;++t)this.ct[t]=e[t]}function Od(){let e,t,r=new zo,n=new zo;for(e=0;e<15582;++e)for(P0(n,ds[e]),t=0;t<36;++t)$i(r,n),Ot(r,t),Bs[e][t]=Yi(r)}function Id(){let e,t,r,n,l,o,i,s;for(Fs(Gt),Gt[0]=0,t=0,r=1;r!==15582;)for(o=t>4,s=o?-1:t,e=o?t:-1,++t,n=0;n<15582;++n)if(Gt[n]===s){for(i=0;i<27;++i)if(l=~~Bs[n][i]>>>6,Gt[l]===e)if(++r,o){Gt[n]=t;break}else Gt[l]=t}}function Td(e){let t,r,n,l=new wo(e.ct);for(n=0;n<48;++n){for(t=!0,r=0;r<24;++r)if(l.ct[r]!==~~(r/4)){t=!1;break}if(t)return n;oe(l,0),n%2===1&&oe(l,1),n%8===7&&oe(l,2),n%16===15&&oe(l,3)}return-1}function Gd(){let e,t,r,n=new zo;for(e=0;e<24;++e)n.ct[e]=e;let l=new wo(n.ct),o=new wo(n.ct),i=new wo(n.ct);for(e=0;e<48;++e){for(t=0;t<48;++t){for(r=0;r<48;++r)Og(n,l)&&(Sl[e][t]=r,r===0&&(Al[e]=t)),oe(l,0),r%2===1&&oe(l,1),r%8===7&&oe(l,2),r%16===15&&oe(l,3);oe(n,0),t%2===1&&oe(n,1),t%8===7&&oe(n,2),t%16===15&&oe(n,3)}oe(n,0),e%2===1&&oe(n,1),e%8===7&&oe(n,2),e%16===15&&oe(n,3)}for(e=0;e<48;++e)for($i(n,o),Ig(n,Al[e]),t=0;t<36;++t)for($i(l,n),Ot(l,t),Ig(l,e),r=0;r<36;++r)if($i(i,o),Ot(i,r),Og(i,l)){It[e][t]=r;break}for(P0(n,0),e=0;e<48;++e)M0[Al[e]]=os(n),oe(n,0),e%2===1&&oe(n,1),e%8===7&&oe(n,2),e%16===15&&oe(n,3)}function Wd(){let e,t,r,n,l=new zo,o=I(22984);for(t=0;t<22984;t++)o[t]=0;for(e=0,t=0;t<735471;++t)if((o[~~t>>>5]&1<<(t&31))===0){for(P0(l,t),n=0;n<48;++n)r=os(l),o[~~r>>>5]|=1<<(r&31),bl!==null&&(bl[r]=e<<6|Al[n]),oe(l,0),n%2===1&&oe(l,1),n%8===7&&oe(l,2),n%16===15&&oe(l,3);ds[e++]=t}}function Kd(e){let t=wR(ds,e);return t>=0?t:-1}function Qd(){Tg||(Tg=!0,fs=I(70,28),as=I(6435,28),gc=I(70,16),fc=I(6435,16),ot=I(450450),uc=[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 is(e){let t,r,n;for(r=0,n=8,t=14;t>=0;--t)e.ct[t]!==e.ct[15]&&(r+=Re[t][n--]);return r}function ss(e){let t,r,n;for(r=0,n=4,t=6;t>=0;--t)e.rl[t]!==e.rl[7]&&(r+=Re[t][n--]);return r*2+e.parity}function yl(e,t){e.parity^=uc[t];let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.rl,0,1,2,3,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.rl,4,5,6,7,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.rl,0,5,4,1,r),h(e.ct,8,9,12,13,r);break}case 7:{h(e.rl,0,1,2,3,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.rl,0,3,6,5,r),h(e.ct,3,2,5,4,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.rl,3,2,7,6,r),h(e.ct,11,10,15,14,r);break}case 10:{h(e.rl,4,5,6,7,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.rl,1,4,7,2,r),h(e.ct,1,0,7,6,r)}}function hl(e,t){switch(t){case 0:{yl(e,19),yl(e,28);break}case 1:{yl(e,21),yl(e,32);break}case 2:h(e.ct,0,3,1,2,1),h(e.ct,8,11,9,10,1),h(e.ct,4,7,5,6,1),h(e.ct,12,15,13,14,1),h(e.rl,0,3,5,6,1),h(e.rl,1,2,4,7,1)}}function ac(e,t,r){let n;for(n=0;n<16;++n)e.ct[n]=~~(t.ct[n]/2);for(n=0;n<8;++n)e.rl[n]=t.ct[n+16];e.parity=r}function Gg(e,t){let r,n;for(n=8,e.ct[15]=0,r=14;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.ct[r]=1):e.ct[r]=0}function Wg(e,t){let r,n;for(e.parity=t&1,t>>>=1,n=4,e.rl[7]=0,r=6;r>=0;--r)t>=Re[r][n]?(t-=Re[r][n--],e.rl[r]=1):e.rl[r]=0}function O0(){this.rl=I(8),this.ct=I(16)}function jd(){let e,t,r,n,l,o,i,s,a,f,u=new O0;for(l=0;l<70;++l)for(s=0;s<28;++s)Wg(u,l),yl(u,An[s]),fs[l][s]=ss(u);for(l=0;l<70;++l)for(Wg(u,l),i=0;i<16;++i)gc[l][i]=ss(u),hl(u,0),i%2===1&&hl(u,1),i%8===7&&hl(u,2);for(l=0;l<6435;++l)for(Gg(u,l),i=0;i<16;++i)fc[l][i]=is(u)&65535,hl(u,0),i%2===1&&hl(u,1),i%8===7&&hl(u,2);for(l=0;l<6435;++l)for(s=0;s<28;++s)Gg(u,l),yl(u,An[s]),as[l][s]=is(u)&65535;for(Fs(ot),ot[0]=ot[18]=ot[28]=ot[46]=ot[54]=ot[56]=0,r=0,n=6;n!==450450;){let g=r>6,c=g?-1:r,p=g?r:-1;for(++r,l=0;l<450450;++l)if(ot[l]===c){for(e=~~(l/70),a=l%70,s=0;s<23;++s)if(t=as[e][s],f=fs[a][s],o=t*70+f,ot[o]===p)if(++n,g){ot[l]=r;break}else ot[o]=r}}}function qd(){Kg||(Kg=!0,ko=I(29400,20),pc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1],Tr=I(29400),G0=[0,9,14,23,27,28,41,42,46,55,60,69],W0=I(70))}function I0(e){let t,r,n,l;for(r=0,l=4,t=6;t>=0;--t)e.ud[t]!==e.ud[7]&&(r+=Re[t][l--]);for(r*=35,l=4,t=6;t>=0;--t)e.fb[t]!==e.fb[7]&&(r+=Re[t][l--]);r*=12;let o=e.fb[7]^e.ud[7];for(n=0,l=4,t=7;t>=0;--t)e.rl[t]!==o&&(n+=Re[t][l--]);return e.parity+2*(r+W0[n])}function Vd(e,t){switch(e.parity^=pc[t],t){case 0:case 1:case 2:{h(e.ud,0,1,2,3,t%3);break}case 3:{h(e.rl,0,1,2,3,1);break}case 4:case 5:case 6:{h(e.fb,0,1,2,3,(t-1)%3);break}case 7:case 8:case 9:{h(e.ud,4,5,6,7,(t-1)%3);break}case 10:{h(e.rl,4,5,6,7,1);break}case 11:case 12:case 13:{h(e.fb,4,5,6,7,(t+1)%3);break}case 14:{h(e.ud,0,1,2,3,1),h(e.rl,0,5,4,1,1),h(e.fb,0,5,4,1,1);break}case 15:{h(e.rl,0,1,2,3,1),h(e.fb,1,4,7,2,1),h(e.ud,1,6,5,2,1);break}case 16:{h(e.fb,0,1,2,3,1),h(e.ud,3,2,5,4,1),h(e.rl,0,3,6,5,1);break}case 17:{h(e.ud,4,5,6,7,1),h(e.rl,3,2,7,6,1),h(e.fb,3,2,7,6,1);break}case 18:{h(e.rl,4,5,6,7,1),h(e.fb,0,3,6,5,1),h(e.ud,0,3,4,7,1);break}case 19:h(e.fb,4,5,6,7,1),h(e.ud,0,7,6,1,1),h(e.rl,1,4,7,2,1)}}function cc(e,t,r){let n,l=(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^l;e.parity=l^r}function Hd(e,t){let r,n,l,o;for(e.parity=t&1,t>>>=1,l=G0[t%12],t=~~(t/12),o=4,r=7;r>=0;--r)e.rl[r]=0,l>=Re[r][o]&&(l-=Re[r][o--],e.rl[r]=1);for(n=t%35,t=~~(t/35),o=4,e.fb[7]=0,r=6;r>=0;--r)n>=Re[r][o]?(n-=Re[r][o--],e.fb[r]=1):e.fb[r]=0;for(o=4,e.ud[7]=0,r=6;r>=0;--r)t>=Re[r][o]?(t-=Re[r][o--],e.ud[r]=1):e.ud[r]=0}function T0(){this.ud=I(8),this.rl=I(8),this.fb=I(8)}function Xd(){let e,t,r,n;for(r=0;r<12;++r)W0[G0[r]]=r;let l=new T0;for(r=0;r<29400;++r)for(n=0;n<20;++n)Hd(l,r),Vd(l,n),ko[r][n]=I0(l)&65535;for(Fs(Tr),Tr[0]=0,e=0,t=1;t!==29400;){for(r=0;r<29400;++r)if(Tr[r]===e)for(n=0;n<17;++n)Tr[ko[r][n]]===-1&&(Tr[ko[r][n]]=e+1,++t);++e}}function Jd(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:{h(e.ct,0,1,2,3,r);break}case 1:{h(e.ct,16,17,18,19,r);break}case 2:{h(e.ct,8,9,10,11,r);break}case 3:{h(e.ct,4,5,6,7,r);break}case 4:{h(e.ct,20,21,22,23,r);break}case 5:{h(e.ct,12,13,14,15,r);break}case 6:{h(e.ct,0,1,2,3,r),h(e.ct,8,20,12,16,r),h(e.ct,9,21,13,17,r);break}case 7:{h(e.ct,16,17,18,19,r),h(e.ct,1,15,5,9,r),h(e.ct,2,12,6,10,r);break}case 8:{h(e.ct,8,9,10,11,r),h(e.ct,2,19,4,21,r),h(e.ct,3,16,5,22,r);break}case 9:{h(e.ct,4,5,6,7,r),h(e.ct,10,18,14,22,r),h(e.ct,11,19,15,23,r);break}case 10:{h(e.ct,20,21,22,23,r),h(e.ct,0,8,4,14,r),h(e.ct,3,11,7,13,r);break}case 11:h(e.ct,12,13,14,15,r),h(e.ct,1,20,7,18,r),h(e.ct,0,23,6,17,r)}}function K0(){let e;for(this.ct=I(24),e=0;e<24;++e)this.ct[e]=~~(e/4)}function mc(e){let t,r,n;for(K0.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 Yd(){Qg||(Qg=!0,bt=I(18),tR())}function Lc(e){e.cp=[0,1,2,3,4,5,6,7],e.co=[0,0,0,0,0,0,0,0]}function Bc(e,t){let r;for(r=0;r<8;++r)e.cp[r]=t.cp[r],e.co[r]=t.co[r]}function $d(e,t){!e.temps&&(e.temps=new Rs),dc(e,bt[t],e.temps),Bc(e,e.temps)}function eR(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 dc(e,t,r){let n,l,o,i;for(n=0;n<8;++n)r.cp[n]=e.cp[t.cp[n]],o=e.co[t.cp[n]],i=t.co[n],l=o,l=l+(o<3?i:6-i),l=l%3,(o>=3?1:0)^(i>=3?1:0)&&(l=l+3),r.co[n]=l}function Rs(){Lc(this)}function Ir(e,t){Lc(this),zg(this.cp,e),eR(this,t)}function Rc(e){Ir.call(this,e(40320),e(2187))}function tR(){let e,t;for(bt[0]=new Ir(15120,0),bt[3]=new Ir(21021,1494),bt[6]=new Ir(8064,1236),bt[9]=new Ir(9,0),bt[12]=new Ir(1230,412),bt[15]=new Ir(224,137),e=0;e<18;e+=3)for(t=0;t<2;++t)bt[e+t+1]=new Rs,dc(bt[e+t],bt[e],bt[e+t+1])}function rR(){jg||(jg=!0,Tt=I(1937880),hs=I(1538),cs=I(1538),_l=I(11880),Ac=[0,1,6,3,4,5,2,7],j0=I(160,12),q0=I(160,12),Q0=[1,1,1,3,12,60,360,2520,20160,181440,1814400,19958400,239500800],E0=[0,2,4,6,1,3,7,5,8,9,10,11])}function Dl(e,t,r,n,l){let o=e.edgeo[l];e.edgeo[l]=e.edge[n],e.edge[n]=e.edgeo[r],e.edgeo[r]=e.edge[t],e.edge[t]=o}function El(e,t){let r,n,l,o,i;for(e.isStd||Fc(e),n=0,i=1985229328,o=47768,r=0;r<t;++r)l=e.edge[r]<<2,n*=12-r,l>=32?(n+=o>>l-32&15,o-=4368<<l-32):(n+=i>>l&15,o-=4369,i-=286331152<<l);return n}function hc(e){let t,r=El(e,4);t=_l[r];let n=t&7;t>>=3,gs(e,n);let l=El(e,10)%20160;return t*20160+l}function us(e,t){switch(e.isStd=!1,t){case 0:{ge(e.edge,0,4,1,5),ge(e.edgeo,0,4,1,5);break}case 1:{Fe(e.edge,0,4,1,5),Fe(e.edgeo,0,4,1,5);break}case 2:{ge(e.edge,0,5,1,4),ge(e.edgeo,0,5,1,4);break}case 3:{Fe(e.edge,5,10,6,11),Fe(e.edgeo,5,10,6,11);break}case 4:{ge(e.edge,0,11,3,8),ge(e.edgeo,0,11,3,8);break}case 5:{Fe(e.edge,0,11,3,8),Fe(e.edgeo,0,11,3,8);break}case 6:{ge(e.edge,0,8,3,11),ge(e.edgeo,0,8,3,11);break}case 7:{ge(e.edge,2,7,3,6),ge(e.edgeo,2,7,3,6);break}case 8:{Fe(e.edge,2,7,3,6),Fe(e.edgeo,2,7,3,6);break}case 9:{ge(e.edge,2,6,3,7),ge(e.edgeo,2,6,3,7);break}case 10:{Fe(e.edge,4,8,7,9),Fe(e.edgeo,4,8,7,9);break}case 11:{ge(e.edge,1,9,2,10),ge(e.edgeo,1,9,2,10);break}case 12:{Fe(e.edge,1,9,2,10),Fe(e.edgeo,1,9,2,10);break}case 13:{ge(e.edge,1,10,2,9),ge(e.edgeo,1,10,2,9);break}case 14:{Fe(e.edge,0,4,1,5),Fe(e.edgeo,0,4,1,5),ge(e.edge,9,11),ge(e.edgeo,8,10);break}case 15:{Fe(e.edge,5,10,6,11),Fe(e.edgeo,5,10,6,11),ge(e.edge,1,3),ge(e.edgeo,0,2);break}case 16:{Fe(e.edge,0,11,3,8),Fe(e.edgeo,0,11,3,8),ge(e.edge,5,7),ge(e.edgeo,4,6);break}case 17:{Fe(e.edge,2,7,3,6),Fe(e.edgeo,2,7,3,6),ge(e.edge,8,10),ge(e.edgeo,9,11);break}case 18:{Fe(e.edge,4,8,7,9),Fe(e.edgeo,4,8,7,9),ge(e.edge,0,2),ge(e.edgeo,1,3);break}case 19:Fe(e.edge,1,9,2,10),Fe(e.edgeo,1,9,2,10),ge(e.edge,4,6),ge(e.edgeo,5,7)}}function xl(e,t){switch(e.isStd=!1,t){case 0:{us(e,14),us(e,17);break}case 1:{Dl(e,11,5,10,6),Dl(e,5,10,6,11),Dl(e,1,2,3,0),Dl(e,4,9,7,8),Dl(e,8,4,9,7),Dl(e,0,1,2,3);break}case 2:Ut(e,4,5),Ut(e,5,4),Ut(e,11,8),Ut(e,8,11),Ut(e,7,6),Ut(e,6,7),Ut(e,9,10),Ut(e,10,9),Ut(e,1,1),Ut(e,0,0),Ut(e,3,3),Ut(e,2,2)}}function gs(e,t){for(;t>=2;)t-=2,xl(e,1),xl(e,2);t!==0&&xl(e,0)}function Mo(e,t){let r,n,l,o,i,s;for(i=1985229328,s=47768,l=0,r=0;r<11;++r)if(n=Q0[11-r],o=~~(t/n),t=t%n,l^=o,o<<=2,o>=32){o=o-32,e.edge[r]=s>>o&15;let a=(1<<o)-1;s=(s&a)+(s>>4&~a)}else{e.edge[r]=i>>o&15;let a=(1<<o)-1;i=(i&a)+(i>>>4&~a)+(s<<28),s=s>>4}for((l&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 qg(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 Dc(e,t){let r,n,l,o;for(e.temp===null&&(e.temp=I(12)),r=0;r<12;++r)e.temp[r]=r,e.edge[r]=t.ep[E0[r]+12]%12;for(n=1,r=0;r<12;++r)for(;e.edge[r]!==r;)o=e.edge[r],e.edge[r]=e.edge[o],e.edge[o]=o,l=e.temp[r],e.temp[r]=e.temp[o],e.temp[o]=l,n^=1;for(r=0;r<12;++r)e.edge[r]=e.temp[t.ep[E0[r]]%12];return n}function Fc(e){let t;for(e.temp===null&&(e.temp=I(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 Fe(e,t,r,n,l){let o;o=e[t],e[t]=e[n],e[n]=o,o=e[r],e[r]=e[l],e[l]=o}function Ut(e,t,r){let n=e.edge[t];e.edge[t]=e.edgeo[r],e.edgeo[r]=n}function Rr(){this.edge=I(12),this.edgeo=I(12)}function nR(){let e,t,r,n,l,o,i,s,a,f,u,g,c,p,L,m,d,D,y,S,v,U,P=new Rr,J=new Rr,z=new Rr;for(Fs(Tt),s=0,Zi=1,x0(Tt,0,0);Zi!==31006080&&(L=s>9,i=s%3,o=(s+1)%3,f=L?3:i,e=L?i:3,!(s>=9));){for(g=0;g<31006080;g+=16)if(U=Tt[~~g>>4],!(!L&&U===-1)){for(u=g,a=g+16;u<a;++u,U>>=2)if((U&3)===f){for(y=~~(u/20160),t=hs[y],n=u%20160,Mo(P,t*20160+n),d=0;d<17;++d)if(r=wl(P.edge,d<<3,4),S=_l[r],v=S&7,S>>=3,l=wl(P.edge,d<<3|v,10)%20160,c=S*20160+l,No(Tt,c)===e){if(x0(Tt,L?u:c,o),++Zi,L)break;if(D=cs[S],D!==1)for(qg(J,P),us(J,d),gs(J,v),m=1;(D=~~D>>1&65535)!==0;++m)(D&1)===1&&(qg(z,J),gs(z,m),p=S*20160+El(z,10)%20160,No(Tt,p)===e&&(x0(Tt,p,o),++Zi))}}}++s}}function No(e,t){return e[t>>4]>>((t&15)<<1)&3}function wl(e,t,r){let n,l,o,i,s,a=q0[t],f=j0[t];for(l=0,s=1985229328,i=47768,n=0;n<r;++n)o=a[e[f[n]]]<<2,l*=12-n,o>=32?(l+=i>>o-32&15,i-=4368<<o-32):(l+=s>>o&15,i-=4369,s-=286331152<<o);return l}function yc(e){let t,r,n,l,o,i,s,a,f,u,g,c=new Rr;if(i=0,o=No(Tt,e),o===3)return 10;for(;e!==0;)for(o===0?o=2:--o,f=~~(e/20160),t=hs[f],n=e%20160,Mo(c,t*20160+n),a=0;a<17;++a)if(r=wl(c.edge,a<<3,4),u=_l[r],g=u&7,u>>=3,l=wl(c.edge,a<<3|g,10)%20160,s=u*20160+l,No(Tt,s)===o){++i,e=s;break}return i}function lR(e,t){let r=No(Tt,e);return r===3?10:(1227133513<<r>>t&3)+t-1}function oR(){let e,t,r,n=new Rr;for(t=0;t<20;++t)for(r=0;r<8;++r){for(Mo(n,0),us(n,t),gs(n,r),e=0;e<12;++e)j0[t<<3|r][e]=n.edge[e];for(Fc(n),e=0;e<12;++e)q0[t<<3|r][e]=n.temp[e]}}function iR(){let e,t,r,n,l=new Rr,o=I(1485);for(t=0;t<1485;t++)o[t]=0;for(e=0,t=0;t<11880;++t)if((o[~~t>>>3]&1<<(t&7))===0){for(Mo(l,t*Q0[8]),n=0;n<8;++n)r=El(l,4),r===t&&(cs[e]=(cs[e]|1<<n)&65535),o[~~r>>3]=o[~~r>>3]|1<<(r&7),_l[r]=e<<3|Ac[n],xl(l,0),n%2===1&&(xl(l,1),xl(l,2));hs[e++]=t}}function x0(e,t,r){e[t>>4]^=(3^r)<<((t&15)<<1)}function sR(){Vg||(Vg=!0)}function aR(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 fR(e,t){let r;for(r=0;r<24;++r)e.ep[r]=t.ep[r]}function uR(e,t){let r=t%3;switch(t=~~(t/3),t){case 0:{h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r);break}case 1:{h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r);break}case 2:{h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r);break}case 3:{h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r);break}case 4:{h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r);break}case 5:{h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r);break}case 6:{h(e.ep,0,1,2,3,r),h(e.ep,12,13,14,15,r),h(e.ep,9,22,11,20,r);break}case 7:{h(e.ep,11,15,10,19,r),h(e.ep,23,3,22,7,r),h(e.ep,2,16,6,12,r);break}case 8:{h(e.ep,0,11,6,8,r),h(e.ep,12,23,18,20,r),h(e.ep,3,19,5,13,r);break}case 9:{h(e.ep,4,5,6,7,r),h(e.ep,16,17,18,19,r),h(e.ep,8,23,10,21,r);break}case 10:{h(e.ep,1,20,5,21,r),h(e.ep,13,8,17,9,r),h(e.ep,14,0,18,4,r);break}case 11:h(e.ep,2,9,4,10,r),h(e.ep,14,21,16,22,r),h(e.ep,7,15,1,17,r)}}function V0(){let e;for(this.ep=I(24),e=0;e<24;++e)this.ep[e]=e}function Sc(e){let t,r,n;for(V0.call(this),t=0;t<23;++t)n=t+e(24-t),n!==t&&(r=this.ep[t],this.ep[t]=this.ep[n],this.ep[n]=r)}function gR(){Hg||(Hg=!0,w0=[35,1,34,2,4,6,22,5,19])}function xc(e){e.moveBuffer=I(60)}function cR(e,t){return e.value-t.value}function kl(e,t){let r;for(fR(e.edge,t.edge),Jd(e.center,t.center),Bc(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 Gr(e){for(;e.centerAvail<e.moveLength;)Zd(e.center,e.moveBuffer[e.centerAvail++]);return e.center}function vc(e){for(;e.cornerAvail<e.moveLength;)$d(e.corner,e.moveBuffer[e.cornerAvail++]%18);return e.corner}function Po(e){for(;e.edgeAvail<e.moveLength;)uR(e.edge,e.moveBuffer[e.edgeAvail++]);return e.edge}function pR(e){let t,r,n,l,o,i,s=new Array(e.moveLength-(e.add1?2:0));for(r=0,t=0;t<e.length1;++t)s[r++]=e.moveBuffer[t];for(i=e.sym,t=e.length1+(e.add1?2:0);t<e.moveLength;++t)It[i][e.moveBuffer[t]]>=27?(s[r++]=It[i][e.moveBuffer[t]]-9,l=w0[It[i][e.moveBuffer[t]]-27],i=Sl[i][l]):s[r++]=It[i][e.moveBuffer[t]];let a=Sl[Al[i]][Td(Gr(e))];for(o="",i=a,t=r-1;t>=0;--t)n=s[t],n=~~(n/3)*3+(2-n%3),It[i][n]>=27?(o=\`\${o}\${k0[It[i][n]-9]} \`,l=w0[It[i][n]-27],i=Sl[i][l]):o=\`\${o}\${k0[It[i][n]]} \`;return o}function yn(e,t){e.moveBuffer[e.moveLength++]=t}function ps(){xc(this),this.edge=new V0,this.center=new K0,this.corner=new Rs}function Ds(e){ps.call(this),kl(this,e)}function Uc(e){xc(this),this.edge=new Sc(e),this.center=new mc(e),this.corner=new Rc(e)}function mR(e,t){return t.value-e.value}function ms(e,t){return mR(e,t)}function bc(){}function LR(){if(Xg)return;Xg=!0;let e,t;for(k0=["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'"],An=[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],Eo=[0,1,2,4,6,7,8,9,10,11,13,15,16,17,19,22,25,28,31,34,36],Jg=I(37),Zg=I(37),Fl=I(37,36),ts=I(29,28),rs=I(21,20),v0=I(36),_o=I(28),vl=I(20),e=0;e<29;++e)Jg[An[e]]=e;for(e=0;e<21;++e)Zg[Eo[e]]=e;for(e=0;e<36;++e){for(t=0;t<36;++t)Fl[e][t]=~~(e/3)===~~(t/3)||~~(e/3)%3===~~(t/3)%3&&e>t;Fl[36][e]=!1}for(e=0;e<29;++e)for(t=0;t<28;++t)ts[e][t]=Fl[An[e]][An[t]];for(e=0;e<21;++e)for(t=0;t<20;++t)rs[e][t]=Fl[Eo[e]][Eo[t]];for(e=0;e<36;++e)for(v0[e]=36,t=e;t<36;++t)if(!Fl[e][t]){v0[e]=t-1;break}for(e=0;e<28;++e)for(_o[e]=28,t=e;t<28;++t)if(!ts[e][t]){_o[e]=t-1;break}for(e=0;e<20;++e)for(vl[e]=20,t=e;t<20;++t)if(!rs[e][t]){vl[e]=t-1;break}}function BR(e){let t,r,n,l,o,i,s,a,f,u,g,c;e.solution="";let p=Yi(new es(Gr(e.c),0)),L=Yi(new es(Gr(e.c),1)),m=Yi(new es(Gr(e.c),2)),d=Gt[~~p>>6],D=Gt[~~L>>6],y=Gt[~~m>>6];for(e.p1SolsCnt=0,e.arr2idx=0,xR(e.p1sols.heap),e.length1=(d<D?d:D)<y?d<D?d:D:y;e.length1<100&&!(y<=e.length1&&ns(e,~~m>>>6,m&63,e.length1,-1,0)||d<=e.length1&&ns(e,~~p>>>6,p&63,e.length1,-1,0)||D<=e.length1&&ns(e,~~L>>>6,L&63,e.length1,-1,0));++e.length1);let S=PR(e.p1sols,z0(OR,Kr([bd,_0,C0]),nc,0,0));S.sort(function(P,J){return P.value-J.value}),t=9;do{e:for(a=S[0].value;a<100;++a)for(i=0;i<S.length&&!(S[i].value>a);++i)if(!(a-S[i].length1>t)&&(kl(e.c1,S[i]),ac(e.ct2,Gr(e.c1),Ls(Po(e.c1).ep)),g=is(e.ct2),c=ss(e.ct2),e.length1=S[i].length1,e.length2=a-S[i].length1,Ec(e,g,c,e.length2,28,0)))break e;++t}while(a===100);e.arr2.sort(function(P,J){return P.value-J.value}),s=0,r=13;do{e:for(f=e.arr2[0].value;f<100;++f)for(i=0;i<Math.min(e.arr2idx,100)&&!(e.arr2[i].value>f);++i)if(!(f-e.arr2[i].length1-e.arr2[i].length2>r)&&(o=Dc(e.e12,Po(e.arr2[i])),cc(e.ct3,Gr(e.arr2[i]),o^Ls(vc(e.arr2[i]).cp)),n=I0(e.ct3),l=El(e.e12,10),u=yc(hc(e.e12)),u<=f-e.arr2[i].length1-e.arr2[i].length2&&wc(e,l,n,u,f-e.arr2[i].length1-e.arr2[i].length2,20,0))){s=i;break e}++r}while(f===100);let v=new Ds(e.arr2[s]);e.length1=v.length1,e.length2=v.length2;let U=f-e.length1-e.length2;for(i=0;i<U;++i)yn(v,Eo[e.move3[i]]);e.solution=pR(v)}function dR(e,t){let r,n;for(kl(e.c1,e.c),r=0;r<e.length1;++r)yn(e.c1,e.move1[r]);switch(M0[t]){case 0:{yn(e.c1,24),yn(e.c1,35),e.move1[e.length1]=24,e.move1[e.length1+1]=35,e.add1=!0,t=19;break}case 12869:{yn(e.c1,18),yn(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}ac(e.ct2,Gr(e.c1),Ls(Po(e.c1).ep));let l=is(e.ct2),o=ss(e.ct2),i=ot[l*70+o];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 Ds(e.c1):(n=zR(e.p1sols),n.value>e.c1.value&&kl(n,e.c1)),yR(e.p1sols,n),e.p1SolsCnt===1e4}function RR(e){let t;for(kl(e.c2,e.c1),t=0;t<e.length2;++t)yn(e.c2,e.move2[t]);if(!aR(Po(e.c2)))return!1;let r=Dc(e.e12,Po(e.c2));cc(e.ct3,Gr(e.c2),r^Ls(vc(e.c2).cp));let n=I0(e.ct3);El(e.e12,10);let l=yc(hc(e.e12));return e.arr2[e.arr2idx]?kl(e.arr2[e.arr2idx],e.c2):e.arr2[e.arr2idx]=new Ds(e.c2),e.arr2[e.arr2idx].value=e.length1+e.length2+Math.max(l,Tr[n]),e.arr2[e.arr2idx].length2=e.length2,++e.arr2idx,e.arr2idx===e.arr2.length}function hR(e,t){return _c(),e.c=new Uc(t),BR(e),e.solution}function ns(e,t,r,n,l,o){let i,s,a,f,u,g;if(t===0)return n===0&&dR(e,r);for(i=0;i<27;i+=3)if(!(i===l||i===l-9||i===l-18))for(f=0;f<3;++f){if(a=i+f,s=Bs[t][It[r][a]],u=Gt[~~s>>>6],u>=n){if(u>n)break;continue}if(g=Sl[r][s&63],s>>>=6,e.move1[o]=a,ns(e,s,g,n-1,i,o+1))return!0}return!1}function Ec(e,t,r,n,l,o){let i,s,a,f;if(t===0&&ot[r]===0)return n===0&&RR(e);for(s=0;s<23;++s){if(ts[l][s]){s=_o[s];continue}if(i=as[t][s],f=fs[r][s],a=ot[i*70+f],a>=n){a>n&&(s=_o[s]);continue}if(e.move2[o]=An[s],Ec(e,i,f,n-1,s,o+1))return!0}return!1}function wc(e,t,r,n,l,o,i){let s,a,f,u,g,c,p,L,m;if(l===0)return t===0&&r===0;for(Mo(e.tempe[i],t),g=0;g<17;++g){if(rs[o][g]){g=vl[g];continue}if(f=ko[r][g],c=Tr[f],c>=l){c>l&&g<14&&(g=vl[g]);continue}if(u=wl(e.tempe[i].edge,g<<3,10),s=~~(u/20160),L=_l[s],m=L&7,L>>=3,a=wl(e.tempe[i].edge,g<<3|m,10)%20160,p=lR(L*20160+a,n),p>=l){p>l&&g<14&&(g=vl[g]);continue}if(wc(e,u,f,p,l-1,g,i+1))return e.move3[i]=g,!0}return!1}function kc(){let e;for(this.p1sols=new Oc(new bc),this.move1=I(15),this.move2=I(20),this.move3=I(20),this.c1=new ps,this.c2=new ps,this.ct2=new O0,this.ct3=new T0,this.e12=new Rr,this.tempe=I(20),this.arr2=I(100),e=0;e<20;++e)this.tempe[e]=new Rr}function _c(){Yg||(Gd(),bl=I(735471),Wd(),Od(),bl=null,Id(),jd(),Xd(),oR(),iR(),nR(),Yg=!0)}function DR(){$g||($g=!0)}function Ls(e){let t,r,n,l;for(l=0,t=0,n=e.length;t<n;++t)for(r=t;r<n;++r)e[t]>e[r]&&(l^=1);return l}function h(e,t,r,n,l,o){let i;switch(o){case 0:{i=e[l],e[l]=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[l],e[l]=i;return}case 2:{i=e[t],e[t]=e[r],e[r]=e[n],e[n]=e[l],e[l]=i;return}}}function Cc(){}function zc(e,t,r,n){let l=new Cc;return l.typeName=e+t,Pc(r!==0?-r:0)&&Mc(r!==0?-r:0,l),l.modifiers=4,l.superclass=H0,l.componentType=n,l}function Nc(e,t,r,n){let l=new Cc;return l.typeName=e+t,Pc(r)&&Mc(r,l),l.superclass=n,l}function FR(e){let t=Co[e.seedId];return e=null,t}function Pc(e){return typeof e=="number"&&e>0}function Mc(e,t){let r;if(t.seedId=e,e===2)r=String.prototype;else if(e>0){let n=FR(t);if(n)r=n.prototype;else{n=Co[e]=function(){},n.___clazz$=t;return}}else return;r.___clazz$=t}function yR(e,t){if(CR(e,t))return!0}function AR(e){e.array=z0(Ic,Kr([_0,C0]),tc,0,0)}function SR(e,t){return ls(e.array,e.size++,t),!0}function xR(e){e.array=z0(Ic,Kr([_0,C0]),tc,0,0),e.size=0}function Wr(e,t){return e.array[t]}function vR(e,t){let r=e.array[t];return ER(e.array,t,1),--e.size,r}function Ul(e,t,r){let n=e.array[t];return ls(e.array,t,r),n}function UR(e,t){let r;for(t.length<e.size&&(t=_d(t,e.size)),r=0;r<e.size;++r)ls(t,r,e.array[r]);return t.length>e.size&&ls(t,e.size,null),t}function bR(){AR(this),this.array.length=500}function ER(e,t,r){e.splice(t,r)}function wR(e,t){let r,n,l,o;for(n=0,r=e.length-1;n<=r;)if(l=n+(~~(r-n)>>1),o=e[l],o<t)n=l+1;else if(o>t)r=l-1;else return l;return-n-1}function Fs(e){kR(e,e.length)}function kR(e,t){let r;for(r=0;r<t;++r)e[r]=-1}function _R(e,t){let r,n,l,o,i=e.heap.size,s=Wr(e.heap,t);for(;t*2+1<i&&(r=(n=2*t+1,l=n+1,o=n,l<i&&ms(Wr(e.heap,l),Wr(e.heap,n))<0&&(o=l),o),!(ms(s,Wr(e.heap,r))<0));)Ul(e.heap,t,Wr(e.heap,r)),t=r;Ul(e.heap,t,s)}function CR(e,t){let r,n;for(n=e.heap.size,SR(e.heap,t);n>0;){if(r=n,n=~~((n-1)/2),ms(Wr(e.heap,n),t)<=0)return Ul(e.heap,r,t),!0;Ul(e.heap,r,Wr(e.heap,n))}return Ul(e.heap,n,t),!0}function zR(e){if(e.heap.size===0)return null;let t=Wr(e.heap,0);return NR(e),t}function NR(e){let t=vR(e.heap,e.heap.size-1);0<e.heap.size&&(Ul(e.heap,0,t),_R(e,0))}function PR(e,t){return UR(e.heap,t)}function Oc(e){this.heap=new bR,this.cmp=e}function Gc(){ec||(ec=!0,LR(),DR(),Md(),Qd(),qd(),rR(),Yd(),sR(),gR(),Tc=new kc)}function IR(){Gc(),_c()}async function TR(){be(),Gc();let e=E.fromString(hR(Tc,await Ee()));return(await Rl()).concat(e)}var X,Co,xd,tc,_0,rc,vd,Ud,nc,bd,Ed,wd,C0,Pg,U0,b0,Mg,Gt,Bs,M0,bl,ds,Al,It,Sl,Tg,as,ot,fc,uc,fs,gc,Kg,ko,pc,Tr,G0,W0,Qg,bt,jg,E0,Zi,Tt,Q0,j0,q0,_l,hs,Ac,cs,Vg,Hg,w0,Xg,Fl,ts,rs,An,k0,Eo,v0,_o,vl,Jg,Zg,Yg,$g,H0,Ic,MR,OR,Tc,ec,Wc=F(()=>{"use strict";ae();A0();Ng();xt();St();Co={},xd={},tc=0,_0=30,rc=21,vd=22,Ud=23,nc=24,bd=25,Ed=34,wd=26,C0=40;ht(1,-1,xd);X.value=null;ht(73,1,{},lc);X.queryId$=0;Pg=!1;Mg=!1;ht(153,1,Kr([rc]),zo,es,wo);bl=null,Tg=!1;ht(154,1,{},O0);X.parity=0;Kg=!1;ht(155,1,{},T0);X.parity=0;ht(156,1,{},K0,mc);Qg=!1;ht(157,1,Kr([vd]),Rs,Ir,Rc);X.temps=null;jg=!1;ht(158,1,Kr([Ud]),Rr);X.isStd=!0;X.temp=null;Zi=0,Vg=!1;ht(159,1,{},V0,Sc);Hg=!1;ht(160,1,Kr([nc,Ed]),ps,Ds,Uc);X.compareTo$=function(t){return cR(this,t)};X.add1=!1;X.center=null;X.centerAvail=0;X.corner=null;X.cornerAvail=0;X.edge=null;X.edgeAvail=0;X.length1=0;X.length2=0;X.length3=0;X.moveLength=0;X.sym=0;X.value=0;ht(161,1,{},bc);X.compare=function(t,r){return ms(t,r)};Xg=!1;ht(163,1,Kr([wd]),kc);X.add1=!1;X.arr2idx=0;X.c=null;X.length1=0;X.length2=0;X.p1SolsCnt=0;X.solution="";Yg=!1,$g=!1;X.val$outerIter=null;X.size=0;ht(239,1,{},Oc);X.cmp=null;X.heap=null;H0=Nc("java.lang.","Object",1,null),Ic=zc("[Ljava.lang.","Object;",356,H0),MR=Nc("cs.threephase.","FullCube",160,H0),OR=zc("[Lcs.threephase.","FullCube;",381,MR),ec=!1});var Kc={};Lt(Kc,{initialize:()=>IR,random444Scramble:()=>TR});var Qc=F(()=>{"use strict";Wc()});function Io(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function ys(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 rp(e,t,r,n,l=e-t-r-n){return ys(e,t+r)*ys(t+r,t)*ys(n+l,n)}function qR(e){e=e.slice();let t=e.length,r=Io(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function VR(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function o2(e,t){let r=[],n=Io(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function Sn(e){return qR(e)>>1}function r2(e,t){let r=[0];for(let n=1;n<e;n++){let l=t(n+1);r[n]=r[l],r[l]=n}return r}function Xc(e,t){let r=r2(e,t);return VR(r)===1&&([r[0],r[1]]=[r[1],r[0]]),r}function HR(e){return e|=0,31-Math.clz32(e^e-1)}function Jc(e,t){e|=0,t|=0;let r=\`\${e} \${t}\`;if(Z0[r])return Z0[r];let n=ys(e,t),l=new Uint32Array(n),o=new Uint32Array(1<<e).fill(-1);for(let i=0,s=(1<<t)-1;i<n;i++){l[i]=s,o[s]=i;let a=s|s-1;s=a+1|(~a&-~a)-1>>HR(s)+1}return Z0[r]=[l,o]}function XR(e){e|=0;let t=0;for(;e!==0;)e&=e-1,t++;return t}function Zc(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 JR(e,t){return Zc(e)|Zc(t)<<1}function Pl(e,t,r,n,l){if(e|=0,t|=0,r|=0,n|=0,l|=0,e!==t+r+n+l)throw new Error("generate_comb4_lookup_tables: invalid parameters");let o=[e,t,r,n,l].join(" ");if(Y0[o])return Y0[o];let[i,s]=Jc(e,r+l),[a,f]=Jc(e,n+l),u=rp(e,t,r,n,l),g=new Uint32Array(u),c=new Uint32Array(4**e).fill(-1);for(let p=0,L=0;p<a.length;p++){let m=a[p];for(let d=0;d<i.length;d++){let D=i[d];if(XR(D&m)===l){let y=JR(D,m);g[L]=y,c[y]=L,L++}}}return Y0[o]=[g,c]}function rt(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Ml(e,t,r){let n=[];for(let l=0;l<r.length;l++)n[l]=e[t[r[l]]];return n}function i2(e,t){let r=[];for(let n=0;n<t;n++)r[n]=n;for(let n of e)for(let l=0;l<n.length;l++)r[n[l]]=n[(l+1)%n.length];return r}function xn(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 l=n[r-1]+t[r-1],o=Array(l);for(let i=0;i<r;i++)t[i]&&(o[n[i]]=n[e[i]]);return o}function s2(e){let t=e.length,r=Array(t);for(let n=0;n<t;n++)r[e[n]]=n;return r}function ZR(e,t){for(;e&&t;)[e,t]=[t%e,e];return Math.abs(e+t)}function YR(e,t){return e*t/ZR(e,t)}function $R(e){let t=1,r=e.length,n=Array(r).fill(!1),l=-1;for(;l=n.indexOf(!1,l+1),l!==-1;){let o=0,i=l;for(;!n[i];)n[i]=!0,i=e[i],o++;t=YR(t,o)}return t}function sh(e,t){for(let r=0;r<6;r++){if(e===Wt[Qr[r][0]]&&t===Wt[Qr[r][2]])return[r,0];if(e===Wt[Qr[r][2]]&&t===Wt[Qr[r][0]])return[r,1]}throw new Error("unknown corner piece")}function ah(e,t){for(let r=0;r<12;r++)if(e===Wt[jr[r][0]]&&t===Wt[jr[r][1]]||t===Wt[jr[r][0]]&&e===Wt[jr[r][1]])return r;throw new Error("unknown edge piece")}function a2(e,t){return sh(e[Qr[t][0]],e[Qr[t][2]])}function bs(e,t){return ah(e[jr[t][0]],e[jr[t][1]])}function fh(e,t,r,n){let l=Qr[t],o=Qr[r].map(i=>Wt[i]);n%2!==0&&(o=[o[2],o[3],o[0],o[1]]);for(let i=0;i<4;i++)e[l[i]]=o[i]}function uh(e,t,r){let n=jr[t],l=jr[r].map(o=>Wt[o]);for(let o=0;o<2;o++)e[n[o]]=l[o]}function op(e){let t=e.map(a=>Wt[a]),n=Array(6).fill().map((a,f)=>a2(t,f)).map(([a,f])=>a+6*f),l=n.concat(n.map(a=>(a+6)%12)),o=Array(12).fill().map((a,f)=>bs(t,f)),i=Array(12).fill().map((a,f)=>vn.indexOf(e[vn[f]])),s=Array(12).fill().map((a,f)=>Cl.indexOf(e[Cl[f]]));return{cp:l,ep:o,ap:i,bp:s}}function ch(e){let t=Array(72),r=Xc(5,e);r.push(5);let n=Array(4).fill().map(s=>e(2));n.push(n.reduce((s,a)=>s^a)),n.push(0);for(let s=0;s<6;s++)fh(t,s,r[s],n[s]);let l=Xc(12,e);for(let s=0;s<12;s++)uh(t,s,l[s]);let o=r2(12,e).map(s=>s/3|0),i=r2(12,e).map(s=>4+(s/3|0));for(let s=0;s<12;s++)t[vn[s]]=o[s],t[Cl[s]]=i[s];return t}function sp(e,t=!1){if(t){e=e.map(m=>m.slice());let p=[0,1,2,3,4,5,6,7],L=[[0,3,5,6,4,7,1,2],[7,1,0,6,3,5,4,2],[7,4,2,1,3,0,6,5],[2,4,5,3,6,0,1,7]];L=L.concat(L.map(m=>s2(m)));for(let m=0;m<e.length;m++)if(e[m][0]<4)e[m][0]=p[e[m][0]];else{let d=p[e[m][0]],D=e[m][1];e[m][0]=d,p=rt(D===1?L[d^4]:L[d],p)}}let r=t?"U L F R D BR B BL".split(" "):gh,n=["0","","'"];return e.map(([o,i])=>r[o]+n[i]).join(" ")}function qr(e,t){for(let[r,n]of t)for(let l=0;l<n;l++)e=rt(e,ip[r]);return e}function ap(e){return e.map(([t,r])=>[t,(3-r)%3]).reverse()}function xs(e,t=!1){if(e.length===0)return[];let r=[],n;for(let[l,o]of e)n&&n[0]===l?(n[1]+=o,n[1]%=3,n[1]===0&&(r.pop(),n=r.length===0?void 0:r[r.length-1])):r.length>=2&&(n[0]^l)===4&&r[r.length-2][0]===l?(r[r.length-2][1]+=o,r[r.length-2][1]%=3,r[r.length-2][1]===0&&r.splice(r.length-2,1)):(n=[l,o],r.push(n));return t&&\`\${e}\`!=\`\${r}\`&&console.log(\`simplified \${e} to \${r}\`),r}function ph(e){return sp(ap(Bh(ch(e),!0)),!0)}function zl(e,t,r,n,l,o){let i=rp(e,t,r,n,l),s=o.length,[a,f]=Pl(e,t,r,n,l),u=Array(s).fill().map(()=>new Uint32Array(i));for(let g=0;g<i;g++){let c=a[g],p=Array(e);for(let L=0;L<e;L++)p[L]=c>>2*L&3;for(let L=0;L<s;L++){let d=rt(p,o[L]).reduce((D,y,S)=>D|y<<2*S,0);u[L][g]=f[d]}}return u}function fp(e){let t=e[0].length,r=e.length,n=Array(r).fill().map(()=>new Uint32Array(t));for(let l=0;l<t;l++)for(let o=0;o<r;o++)n[o][e[o][l]]=l;return n}function bn(e,t){let r=e[0].length,n=t[0].length,l=e.length,o=Array(l).fill().map(()=>new Uint32Array(r*n));for(let i=0;i<n;i++)for(let s=0;s<r;s++){let a=s+r*i;for(let f=0;f<l;f++)o[f][a]=e[f][s]+r*t[f][i]}return o}function mh(e,t){let r=e.length,n=e[0].length,l=new Uint8Array(n);l[t]=1;let o=!1;for(;!o;){o=!0;for(let s=0;s<n;s++)if(!!l[s])for(let a=0;a<r;a++)l[e[a][s]]||(l[e[a][s]]=1,o=!1)}let i=new Int32Array(n).fill(-1);for(let s=0,a=0;s<n;s++)!l[s]||(i[s]=a,a++);return[e.map(s=>xn(s,l)),i]}function Lh(e,t){let r=e.length,n=e[0].length,l=new Int32Array(n).fill(-1);t.forEach(a=>{l[a]=0});let o=[t];for(let a=0;a<o.length;a++){let f=o[a];for(let u=0;u<r;u++){let g=e[u][f[0]];if(l[g]!==-1)continue;let c=f.map(L=>e[u][L]),p=o.length;o.push(c);for(let L of c){if(l[L]!==-1)throw new Error("quotienting failed");l[L]=p}}}let i=o.length,s=Array(r).fill().map(()=>new Int32Array(i));for(let a=0;a<r;a++)for(let f=0;f<i;f++)s[a][f]=l[e[a][o[f][0]]];return[s,l]}function up(e,t,r){let n=e[0].length,l=e.length,o=new Int32Array(n).fill(-1);o[t]=r,o[r]=t;let i=!1;for(;!i;){i=!0;for(let s=0;s<n;s++){if(o[s]===-1)continue;let a=o[s];for(let f=0;f<l;f++){let u=f^1,g=e[f][s],c=e[u][e[u][a]];if(o[g]===-1)i=!1,o[g]=c,o[c]=g;else if(o[g]!==c)throw new Error("mirroring failed - is the initial map correct?")}}}return o}function gp(e,t){let r=e[0].length,n=e.length,l=new Int8Array(r).fill(-1);for(let s of t)l[s]=0;let o=0,i=!1;for(;!i;){i=!0;for(let s=0;s<r;s++)if(l[s]===o)for(let a=0;a<n;a++){let f=e[a][s];for(;f!==s;)l[f]===-1&&(i=!1,l[f]=o+1),f=e[a][f]}o++}return l}function Bh(e,t=!1){let r=Fh(e).next().value,n=qr(e,r),l=(t?Mh:Ph)(n),o=xs(r.concat(l),!1);return qr(e,o).join("")!==To.join("")&&(console.log("solving failed!"),console.log(e),console.log(r),console.log(n),console.log(l),console.log(qr(e,o))),o}function Rh(e){let[t,r]=Pl(12,6,0,3,3),n=Array(12).fill().map((s,a)=>bs(e,a)),l=n.indexOf(8)+12*n.indexOf(9)+12**2*n.indexOf(10)+12**3*n.indexOf(11),[o,i]=[vn,Cl].map(s=>{let a=s.map(f=>dh[e[f]]);return r[a.reduce((f,u,g)=>f|u<<2*g,0)]});return[l,o,i]}function cp(){if(K.phase1_edge)return K.phase1_edge;let e=fp(Un.map(n=>n.ep)),t=bn(e,e),r=bn(t,t);return K.phase1_edge=r}function hh(){return Dr.phase1_edge?Dr.phase1_edge:Dr.phase1_edge=gp(cp(),[8+12*9+12**2*10+12**3*11])}function Dh(){return K.phase1_centreA?K.phase1_centreA:K.phase1_centreA=zl(12,6,0,3,3,Un.map(e=>e.ap))}function pp(){return K.phase1_centreB?K.phase1_centreB:K.phase1_centreB=zl(12,6,0,3,3,Un.map(e=>e.bp))}function Yc(){if(Dr.phase1_centre)return Dr.phase1_centre;let[e,t]=Pl(12,6,0,3,3),r=e.filter(n=>{let l=n>>12&3,o=n>>18&3;return l===2&&o===3}).map(n=>t[n]);return Dr.phase1_centre=gp(pp(),r)}function*Fh(e){let t=[cp(),Dh(),pp()],r=[hh(),Yc(),Yc()];yield*yh(Rh(e),t,r,15)}function*yh(e,t,r,n){let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;)yield*mp(e,t,r,o,-1),o++}function*mp(e,t,r,n,l){let o=3,i=8,s=Math.max(r[0][e[0]],r[1][e[1]],r[2][e[2]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===l||a===l-4)continue;let f=[];f[0]=t[0][a][e[0]],f[1]=t[1][a][e[1]],f[2]=t[2][a][e[2]];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=mp(f,t,r,n-1,a);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[a,u]].concat(c)}f[0]=t[0][a][f[0]],f[1]=t[1][a][f[1]],f[2]=t[2][a][f[2]],u++}}}}function f2(e){let[t,r]=Pl(10,5,3,2,0),n=Array(8).fill().map((c,p)=>bs(e,p)),l=n.indexOf(5)+8*n.indexOf(6)+8**2*n.indexOf(7),o=Array(5).fill().map((c,p)=>a2(e,p)),i=s2(o.map(([c,p])=>c+5*p).concat(o.map(([c,p])=>c+5*(p^1)))),s=i.slice(0,5).map(c=>c%5),a=i.slice(0,5).map(c=>c/5|0),f=Sn(s)*8+(a[0]^a[2])+2*(a[0]^a[3])+4*a[4],[u,g]=[vn,Cl].map(c=>{let p=rt(c,Sh).map(L=>Ah[e[L]]);return r[p.reduce((L,m,d)=>L|m<<2*d,0)]});return dp(),Dp(),[u,g,hp[f]+40*Bp[l]]}function*vs(e){yield*Eh(f2(e),30)}function Lp(){if(K.phase2_centre)return K.phase2_centre;let e=zl(10,5,3,2,0,Un.slice(0,4).map(r=>xn(r.ap,$c))),t=zl(10,5,3,2,0,Un.slice(0,4).map(r=>xn(r.bp,$c)));return K.phase2_centre=[e,t]}function dp(){if(K.phase2_edge)return K.phase2_edge;let e=fp(Un.slice(0,4).map(n=>n.ep.slice(0,8))),t=bn(e,bn(e,e)),r;return[r,Bp]=mh(t,501),K.phase2_edge=r}function Rp(){if(K.phase2_corner)return K.phase2_corner;let t=Io(5)/2*8,r=[!0,!0,!0,!0,!0,!1,!0,!0,!0,!0,!0,!1],n=Array(4).fill().map(()=>new Uint32Array(t)),l=Un.slice(0,4).map(o=>s2(xn(o.cp,r)));for(let o=0;o<t;o++){let i=o2(o>>3,5),s=[0,0,o&1,o>>1&1,o>>2&1];s[1]=s[2]^s[3]^s[4];let a=Array(10);for(let f=0;f<5;f++)a[f]=i[f]+5*s[f],a[f+5]=i[f]+5*(s[f]^1);for(let f=0;f<4;f++){let u=rt(l[f],a),g=u.slice(0,5).map(L=>L%5),c=u.slice(0,5).map(L=>L/5|0),p=(c[0]^c[2])+2*(c[0]^c[3])+4*c[4];n[f][o]=Sn(g)*8+p}}return K.phase2_corner=n}function Dp(){return K.phase2_corner_compact||([K.phase2_corner_compact,hp]=Lh(Rp(),Uh())),K.phase2_corner_compact}function u2(){if(K.phase2_ce)return K.phase2_ce;let e=Dp(),t=dp();return K.phase2_ce=bn(e,t)}function xh(){if($0)return $0;let e=f2(To)[2];return $0=up(u2(),e,e)}function vh(){let[e,t]=Pl(10,5,3,2,0);return e.filter(r=>(r>>10&63)===41).map(r=>t[r])}function Uh(){let e=Rp(),t=e[0].length,r=Array(t).fill(!1);r[0]=!0;let n=!1;for(;!n;){n=!0;for(let l=0;l<t;l++)r[l]&&(r[e[0][l]]||(n=!1,r[e[0][l]]=!0),r[e[1][l]]||(n=!1,r[e[1][l]]=!0))}return r.map((l,o)=>o).filter(l=>r[l])}function bh(){if(Dr.phase2_ace)return Dr.phase2_ace;let[e,t]=Lp(),r=u2(),n=2520,l=40*336,o=n*l,i=f2(To)[2],s=9,a=new Int8Array(o).fill(s);for(let f of vh())a[f+n*i]=0;for(let f=0;f<s-1;f++)for(let u=a.indexOf(f);u!==-1;u=a.indexOf(f,u+1)){let g=u%n,c=u/n|0;for(let p=0;p<4;p++){let L=e[p][g],m=r[p][c],d=L+n*m;a[d]===s&&(a[d]=f+1),L=e[p][L],m=r[p][m],d=L+n*m,a[d]===s&&(a[d]=f+1)}}return Dr.phase2_ace=a}function*Eh(e,t){let[r,n]=Lp(),l=u2(),o=bh(),i=xh(),[s,a,f]=e,u=i[f],g=Math.max(o[s+2520*f],o[a+2520*u]);for(;g<=t;)yield*Fp(s,a,f,r,n,l,o,i,g,-1),g++}function*Fp(e,t,r,n,l,o,i,s,a,f){let u=Math.max(i[e+2520*r],i[t+2520*s[r]]);if(!(u>a)){if(a===0){yield[];return}else if(u===0)return;for(let g=0;g<4;g++){if(g===f)continue;let c=e,p=t,L=r;for(let m=1;m<=2;m++){c=n[g][c],p=l[g][p],L=o[g][L];let d=Fp(c,p,L,n,l,o,i,s,a-1,g);for(;;){let{value:D,done:y}=d.next();if(y)break;yield[[g,m]].concat(D)}}}}}function Es(e){let[t,r]=Pl(7,3,2,0,2),n=Array(5).fill().map((f,u)=>bs(e,u)),l=Sn(n),o=Array(4).fill().map((f,u)=>a2(e,u)),i=Sn(o.map(f=>f[0]))*2+o.find(f=>f[0]===0)[1],[s,a]=[vn,Cl].map(f=>{let u=rt(f,wh).map(g=>e[g]%4);return r[u.reduce((g,c,p)=>g|c<<2*p,0)]});return[s+210*a,i+24*l]}function _h(){if(K.phase3_2gen_edge)return K.phase3_2gen_edge;let e=Io(5)/2,t=Array(Nl).fill().map(()=>new Uint32Array(e)),r=Us.map(n=>n.ep.slice(0,5));for(let n=0;n<e;n++){let l=o2(n,5);for(let o=0;o<Nl;o++)t[o][n]=Sn(rt(l,r[o]))}return K.phase3_2gen_edge=t}function Ch(){if(K.phase3_2gen_corner)return K.phase3_2gen_corner;let t=Io(4)/2*2,r=[!0,!0,!0,!0,!1,!1,!0,!0,!0,!0,!1,!1],n=Array(Nl).fill().map(()=>new Uint32Array(t)),l=Us.map(o=>xn(o.cp,r).slice(0,4));for(let o=0;o<t;o+=2){let i=o2(o>>1,4),s=i.concat(i.map(a=>a+4));for(let a=0;a<Nl;a++){let f=rt(s,l[a]),u=f.map(c=>c%4),g=f.find(c=>c%4===0)>>2;n[a][o]=Sn(u)*2+g,n[a][o+1]=Sn(u)*2+(g^1)}}return K.phase3_2gen_corner=n}function ws(){return K.phase3_2gen_corneredge?K.phase3_2gen_corneredge:K.phase3_2gen_corneredge=bn(Ch(),_h())}function g2(){if(K.phase3_2gen_centre)return K.phase3_2gen_centre;let e=zl(7,3,2,0,2,Us.map(r=>xn(r.ap,ep))),t=zl(7,3,2,0,2,Us.map(r=>xn(r.bp,ep)));return K.phase3_2gen_centreA=e,K.phase3_2gen_centreB=t,K.phase3_2gen_centre=bn(e,t)}function Ap(){if(e2)return e2;let e=g2(),t=K.phase3_2gen_centreA,r=ws(),n=t[0].length,l=r[0].length,o=n*l,i=25,s=Fr.map(c=>c.length),a=new Int8Array(o).fill(i),f=Es(To);a[f[0]%n+n*f[1]]=0;let u=0,g=!1;for(;!g&&u<i-1;){g=!0;let c=Array(Nl).fill().map((D,y)=>y).filter(D=>s[D]+u<i);c.sort((D,y)=>s[D]-s[y]);let p=rt(s,c),L=rt(t,c),m=rt(r,c),d=c.length;for(let D=a.indexOf(u);D!==-1;D=a.indexOf(u,D+1)){let y=D%n,S=D/n|0;for(let v=0;v<d;v++){let U=p[v],P=L[v][y],J=m[v][S],z=P+n*J;a[z]>u+U&&(g=!1,a[z]=u+U)}}u++}return e2=a}function Sp(){if(t2)return t2;let e=ws().slice(0,2),t=Es(To);return t2=up(e,t[1],t[1])}function n2(e,t=Es(e)){let[r,n]=t,l=r%210,o=Math.floor(r/210),i=g2(),s=K.phase3_2gen_centreA,a=K.phase3_2gen_centreB,f=ws(),u=Ap(),g=Sp(),c=0;for(;;){let p=c2(l,o,n,s,a,f,u,g,c);for(let L of p)return L.map(m=>Fr[m]).flat();c++}}function tp(e,t=Es(e)){let[r,n]=t,l=r%210,o=Math.floor(r/210),i=g2(),s=K.phase3_2gen_centreA,a=K.phase3_2gen_centreB,f=ws(),u=Ap(),g=Sp(),c=n2(e).length,p=1/0,L;for(let m=c;m<=c+0;m++){let d=c2(l,o,n,s,a,f,u,g,m);for(let D of d){let y=D.map(U=>Fr[U]).flat(),S=xs(y),v=l2(S);v<p&&(p=v,L=S)}}return L}function zh(e){return(e-1)*(e-2)/2}function l2(e){let t=sp(e,!0).replace(/'/g,"").split(" ");return e.length+Nh(t).map(zh).reduce((r,n)=>r+n,0)}function Nh(e){if(e.length<3)return[];let t=e.length,r=[];for(let o=0;o<t-2;o++)r[o]=e[o]===e[o+2];r.push(!1);let n=-1,l=[];for(;n<t-2&&(n=r.indexOf(!0,n+1),n!==-1);){let o=r.indexOf(!1,n+1);l.push(o-n),n=o}return l}function*c2(e,t,r,n,l,o,i,s,a,f=-1){let u=i[e+210*r],g=i[t+210*s[r]],c=Math.max(u,g);if(!(c>a)){if(a===0){yield[];return}if(c!==0)for(let p=0;p<Nl;p++){if(p===f&&kh[p]<=3)continue;let L=n[p][e],m=l[p][t],d=o[p][r],D=a-Fr[p].length;if(D<0)continue;let y=c2(L,m,d,n,l,o,i,s,D,p);for(;;){let{value:S,done:v}=y.next();if(v)break;yield[p].concat(S)}}}}function Ph(e,t=200,r=24){let n=[],l=vs(e),o=rt(e,er).map(a=>a^1),i=vs(o),s=Array(1e3);for(let a=0;a<t;a++){{let{value:f,done:u}=l.next();if(!u){let g=qr(e,f),c=f.concat(n2(g));if(c.length<=r)return c;c.length<s.length&&(s=c)}}{let{value:f,done:u}=i.next();if(!u){let g=qr(o,f),c=f.concat(n2(g)).map(([p,L])=>[p^2,L]);if(c.length<=r)return c;c.length<s.length&&(s=c)}}}return s}function Mh(e,t=20,r=30){let n=[],l=vs(e),o=rt(e,er).map(f=>f^1),i=vs(o),s,a=1/0;for(let f=0;f<t;f++){{let{value:u,done:g}=l.next();if(!g){let c=qr(e,u),p=xs(u.concat(tp(c))),L=l2(p);if(L<=r)return p;L<a&&(s=p,a=L)}}{let{value:u,done:g}=i.next();if(!g){let c=qr(o,u),p=xs(u.concat(tp(c)));p=p.map(([m,d])=>[m^2,d]);let L=l2(p);if(L<=r)return p;L<a&&(s=p,a=L)}}}return s}async function Ih(){return ph(await Oh)}var Bx,dx,Z0,Y0,To,Oo,eh,er,Rx,As,np,th,rh,nh,Ss,lh,lp,oh,ih,Wt,Qr,jr,vn,Cl,ip,gh,Un,K,Dr,dh,Ah,Sh,$c,Bp,hp,$0,wh,ep,Fr,Nl,yp,Us,kh,e2,t2,Oh,xp=F(()=>{"use strict";xt();[Bx,dx]=(()=>{let e=new Int8Array(2048),t=new Int8Array(256*8);for(let l=0;l<256;l++)for(let o=0,i=0;o<8;o++)(l>>>o&1)!==0&&(e[o<<8|l]=i,t[i<<8|l]=o,i++);function r(l){let o=255,i=2520,s=0;for(let a=0;a<6;a++){let f=l[a];s+=e[o|f<<8]*i,o&=~(1<<f),i/=7-a}return s}function n(l,o){let i=255,s=2520,a=0;for(let f=0;f<6;f++){let u=l/s|0;l-=u*s,a^=u&1;let g=t[i|u<<8];o[f]=g,i&=~(1<<g),s/=7-f}return o[6]=t[i|a<<8],o[7]=t[i|(a^1)<<8],o}return[r,n]})();Z0={};Y0={};To=Array(72).fill().map((e,t)=>t/9|0),Oo=i2([[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),eh=rt(Oo,Oo),er=Array(72).fill().map((e,t)=>(t/18|0)*18+(t+9)%18),Rx=Array(72).fill().map((e,t)=>(t/36|0)*36+(t+18)%36),As=Array(72).fill().map((e,t)=>(t+36)%72),np=Ml(As,eh,As),th=Ml(er,Oo,er),rh=Ml(er,np,er),nh=i2([[10,24,30],[11,23,34],[12,19,33],[42,48,64],[41,52,65],[37,51,66]],72),Ss=rt(Oo,nh),lh=rt(Ss,Ss),lp=Ml(As,lh,As),oh=Ml(er,Ss,er),ih=Ml(er,lp,er),Wt=Array(72).fill().map((e,t)=>t/9|0),Qr=[[0,45,9,36],[4,67,22,49],[8,44,35,71],[13,58,31,40],[17,53,26,62],[18,63,27,54]],jr=[[1,46],[3,39],[6,69],[10,37],[33,42],[12,48],[15,60],[24,51],[19,64],[28,55],[30,66],[21,57]],vn=Array(12).fill().map((e,t)=>(t/3|0)*9+[2,5,7][t%3]),Cl=vn.map(e=>e+36);ip=[Oo,np,th,rh,Ss,lp,oh,ih],gh=["U","L","F","R","u","l","f","r"],Un=ip.map(op);K={},Dr={},dh=[0,0,2,3,0,0,2,3];Ah=[0,1,2,0,0,1,2,0],Sh=[0,1,2,3,4,5,7,8,10,11],$c=[!0,!0,!0,!0,!0,!0,!1,!0,!0,!1,!0,!0];wh=[0,1,2,3,4,10,11],ep=[!0,!0,!0,!0,!0,!1,!1,!1,!1,!1,!0,!0],Fr=[[[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]]];Fr=Fr.concat(Fr.map(e=>ap(e)));Nl=Fr.length,yp=Fr.map(e=>qr(i2([],72),e)),Us=yp.map(op),kh=yp.map($R);Oh=Ee()});var vp={};Lt(vp,{randomFTOScrambleString:()=>Ih});var Up=F(()=>{"use strict";xp()});async function Ep(){return Th??(Th=Gh())}async function Gh(){return Yt(await Oe.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
3440
3440
 
3441
3441
  Alg T
3442
3442
  Alg B
@@ -4055,9 +4055,9 @@ Alg BR' B U BR' R BR R' U' BR B'
4055
4055
  Alg F' BL' BR R' BR BL BR' R BR' F
4056
4056
  Alg BR L' BL BR' BL' BR' L U BR U'
4057
4057
  Alg U BR' U' BR BL' BR BL BR'
4058
- \`)}var Oh,bp=A(()=>{"use strict";ur();ol();Oh=null});function Wo(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function p2(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 Th(e){e=e.slice();let t=e.length,r=Wo(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function Gh(e,t){let r=[],n=Wo(t-1);for(let l=0;l<t;l++)r[l]=e/n|0,e%=n,n/=t-1-l;for(let l=t-2;l>=0;l--)for(let o=l+1;o<t;o++)r[o]+=+(r[o]>=r[l]);return r}function Ep(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function Wh(e,t){let r=[],n=Wo(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function wp(e){return Th(e)>>1}function kp(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let l=p2(t-1,r),o=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?l=l*--n/t:(o+=l,l=l*r--/t);return o}function Kh(e,t,r){let n=r-t,l=p2(r-1,t),o=[],i=r-1;for(let a=0;a<i;a++)r--,e<l?(o.push(0),l=l*--n/r):(o.push(1),e-=l,l=l*t--/r);return o.push(t),o}function ka(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function qr(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){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function Qh(e,t){let r=Array(8).fill(0);for(let n=0;n<8;n++)r[n]=(e[1][n]+t[1][n])%3;return[ka(e[0],t[0]),r]}function e3(e){let t=["0","","'"];return e.map(([n,l])=>$h[n]+t[l]).join(" ")}function t3(e){let t=Wh(Math.floor(e(Wo(12))/2),12),r=Array(8);for(let n=0;n<8;n++)r[n]=e(3);return[t,r]}function r3(e){return n3(t3(e))}function n3(e){let t=l3(e),r=[Cp(),zp()],n=[i3(),a3()],l=[Np(),s3()],o=[f3(),o3()],i=g3(t,r,n),a,s=new Set,f=+new Date;for(let u=0;u<25;u++){let{value:g,done:c}=i.next(),p=e;for(let[S,v]of g)for(let U=0;U<v;U++)p=Qh(p,Go[S]);if(s.has(p.toString()))continue;s.add(p.toString());let L=wp(p[0].slice(0,8)),m=0;for(let S=0;S<4;S++)m+=p[1][S]*3**S;let d=[L,m],D=a?a.length-g.length-1:999999,F=u3(d,l,o,D);if(F!==void 0&&((a===void 0||a.length>g.length+F.length)&&(a=g.concat(F)),new Date-f>300))break}return a}function l3(e){let t=0;for(let o=0;o<4;o++)t+=e[0].indexOf(o+8)*12**o;let r=0;for(let o=0;o<4;o++)r+=e[1][o+4]*3**o;let n=e[0].map(o=>Math.max(-1,o-8)),l=kp(n.map(o=>+(o>=0)))*2+Ep(n.filter(o=>o>=0));return[t,r+81*l]}function _p(){if(Be.phase1cm)return Be.phase1cm;let e=[];for(let t=0;t<81;t++){e[t]=Array(8);let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t][0]=e[t][1]=e[t][2]=e[t][3]=t;for(let n=0;n<4;n++)r[n]=(r[n]+2)%3,e[t][4+n]=r[0]+r[1]*3+r[2]*9+r[3]*27,r[n]=(r[n]+1)%3}return Be.phase1cm=e}function o3(){if(Be.phase1cp)return Be.phase1cp;let e=Array(81);for(let t=0;t<81;t++){let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t]=(r[0]!==0)+(r[1]!==0)+(r[2]!==0)+(r[3]!==0)}return Be.phase1cp=e}function Cp(){if(Be.phase1em)return Be.phase1em;let e=[];for(let r=0;r<12;r++){e[r]=[];for(let n=0;n<8;n++)e[r][n]=Go[n][0].indexOf(r)}let t=Array(12**4);for(let r=0;r<12**4;r++){t[r]=Array(8);for(let n=0;n<8;n++){let l=0;for(let o=0;o<4;o++)l+=e[Math.floor(r/12**o)%12][n]*12**o;t[r][n]=l}}return Be.phase1em=t}function i3(){return Be.phase1ep?Be.phase1ep:Be.phase1ep=m2(Cp(),[8+12*(9+12*(10+12*11))])}function zp(){if(Be.phase1sm)return Be.phase1sm;let e=p2(12,4),t=[];for(let l=0;l<e;l++){t[l]=[];let o=Kh(l,4,12),i=[];for(let a=0,s=0;a<12;a++)o[a]===0?i[a]=-1:i[a]=s++;for(let a=0;a<8;a++){let s=ka(i,Go[a][0]),f=ka(o,Go[a][0]),u=Ep(s.filter(g=>g>=0));t[l][a]=kp(f)*2+u}}let r=_p(),n=[];for(let l=0;l<e;l++)for(let o=0;o<81;o++){let i=n[o+81*(2*l)]=[],a=n[o+81*(2*l+1)]=[];for(let s=0;s<8;s++)i[s]=r[o][s]+81*t[l][s],a[s]=r[o][s]+81*(t[l][s]^1)}return Be.phase1sm=n}function a3(){return Be.phase1sp?Be.phase1sp:Be.phase1sp=m2(zp(),[0])}function s3(){if(Be.phase2cm)return Be.phase2cm;let e=_p(),t=Array(81);for(let r=0;r<81;r++)t[r]=e[r].slice(4,8);return Be.phase2cm=t}function Np(){if(Be.phase2em)return Be.phase2em;let e=8,t=Wo(e)/2,r=Array(t),n=[0,1,2,3,4,5,6,7];for(let l=0;l<t;l++){r[l]=Array(4);for(let i=0;i<4;i++){let a=ka(n,Go[i][0].slice(0,8));r[l][i]=wp(a)}if(l===t-1)break;let o=0;do for(let i=e-2;i>=0;i--){if(n[i]>n[i+1])continue;let a=i+1;for(let s=a;s<e;s++)n[s]>n[i]&&(a=s);[n[i],n[a]]=[n[a],n[i]],o^=1;for(let s=0;i+1+s<e-1-s;s++,o^=1)[n[i+1+s],n[e-1-s]]=[n[e-1-s],n[i+1+s]];break}while(o!==0)}return Be.phase2em=r}function f3(){return Be.phase2ep?Be.phase2ep:Be.phase2ep=m2(Np(),[0])}function m2(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1),o=t.slice(),i=[],a=0;for(;o.length>0;){i.length=0;for(let s of o)if(l[s]===-1){l[s]=a;for(let f=0;f<n;f++){let u=e[s][f];for(;u!==s;)i.push(u),u=e[u][f]}}[o,i]=[i,o],a+=1}return l}function u3(e,t,r,n){n=n||999999;let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;){let i=Pp(e,t,r,o,-1);if(i!==void 0)return i;o++}}function Pp(e,t,r,n,l){let o=e.length,i=t[0][0].length,a=0;for(let s=0;s<o;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0)return[];if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===l||s<l&&_a[s]===_a[l])continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Pp(f,t,r,n-1,s);if(g!==void 0)return[[s,u]].concat(g);for(let c=0;c<o;c++)f[c]=t[c][f[c]][s];u++}}}}function*g3(e,t,r){let n=e.length,l=0;for(let o=0;o<n;o++)l=Math.max(l,r[o][e[o]]);for(;;)yield*Mp(e,t,r,l,-1),l++}function*Mp(e,t,r,n,l){let o=e.length,i=t[0][0].length,a=0;for(let s=0;s<o;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===l||s<l&&_a[s]===_a[l])continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Mp(f,t,r,n-1,s);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[s,u]].concat(c)}for(let c=0;c<o;c++)f[c]=t[c][f[c]][s];u++}}}}async function Op(){return new E(e3(r3(await c3)))}var jh,qh,Vh,Hh,Xh,Jh,Zh,Yh,hx,Go,$h,_a,Be,c3,Ip=A(()=>{"use strict";fe();xt();jh=[qr([0,1,4],12),Vr({0:2},8)],qh=[qr([1,2,5],12),Vr({1:2},8)],Vh=[qr([2,3,6],12),Vr({2:2},8)],Hh=[qr([3,0,7],12),Vr({3:2},8)],Xh=[qr([9,8,4],12),Vr({4:2},8)],Jh=[qr([10,9,5],12),Vr({5:2},8)],Zh=[qr([11,10,6],12),Vr({6:2},8)],Yh=[qr([8,11,7],12),Vr({7:2},8)],hx=[Gh(0,12),Array(8).fill(0)],Go=[jh,qh,Vh,Hh,Xh,Jh,Zh,Yh],$h=["UL","U","UR","F","L","B","R","D"],_a=[0,1,0,1,1,0,1,0];Be={};c3=Ee()});var L2={};Lt(L2,{getRandomRediCubeScramble:()=>Op,sgsDataFTO:()=>Up});var B2=A(()=>{"use strict";bp();Ip()});function Gp(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function za(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 p3(e){e=e.slice();let t=e.length,r=Gp(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function m3(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function L3(e){return p3(e)>>1}function h2(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let l=za(t-1,r),o=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?l=l*--n/t:(o+=l,l=l*r--/t);return o}function R3(e,t,r){let n=r-t,l=za(r-1,t),o=[],i=r-1;for(let a=0;a<i;a++)r--,e<l?(o.push(0),l=l*--n/r):(o.push(1),e-=l,l=l*t--/r);return o.push(t),o}function er(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function D2(e,t){let r=er(e[0],t[0]),n=[],l=t[0].length;for(let o=0;o<l;o++)n[o]=(e[1][t[0][o]]+t[1][o])%3;return[r,n]}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 Hr(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function S3(e){let t=[0];for(let n=1;n<20;n++){let l=e(n+1);t[n]=t[l],t[l]=n}m3(t)===1&&([t[0],t[1]]=[t[1],t[0]]);let r=Array(20).fill(0);for(let n=0;n<19;n++)r[n]=e(3),r[19]+=3-r[n];return r[19]%=3,[t,r]}function x3(e){let t=["0","","2","2'","'"];return e.map(([n,l])=>y3[n]+t[l]).join(" ")}function v3(e,t){for(let[r,n]of t)for(let l=0;l<n;l++)e=D2(e,En[r]);return e}function U3(e){return P3(S3(e))}function E3(e){let t=e[0];if(t.slice(15,20).every(o=>o<15))return[];if(t.slice(0,5).every(o=>o<15))return[[6,1]];let r=t.map(o=>o>=15),n=0,l;for(;l===void 0;)n++,l=jp(r,n,-1);return l.push([6,1]),l}function jp(e,t,r){if(t===0)return e.slice(0,5).some(n=>n)?void 0:[];for(let n=0;n<6;n++)if(n!==r)for(let l=1;l<5;l++){let o=er(e,Ca[n][l][0]),i=jp(o,t-1,n);if(i!==void 0)return[[n,l]].concat(i)}}function w3(e){let t=e[0].slice(0,15),r=e[1],n=h2(t.map(i=>+(i>=15))),l=243*n;for(let i=0,a=0;i<15;i++)t[i]<15||(l+=r[i]*Math.pow(3,a),a++);let o=0;for(let i=0;i<5;i++)o+=t.indexOf(15+i)*Math.pow(15,i);return[l,o]}function k3(e){let t=[Na(),Pa()],r=[M3(),I3()];return qp(w3(e),t,r).concat([[6,1]])}function _3(e){let t=[5,6,7,8,14],r=e[0].slice(0,15),n=e[1],l=h2(r.map(a=>+(t.indexOf(a)!==-1))),o=243*l;for(let a=0,s=0;a<15;a++)t.indexOf(r[a])!==-1&&(o+=n[a]*Math.pow(3,s),s++);let i=0;for(let a=0;a<5;a++)i+=r.indexOf(t[a])*Math.pow(15,a);return[o,i]}function C3(e){let t=[Na(),Pa()],r=[O3(),T3()];return qp(_3(e),t,r)}function z3(e){let t=e[0].slice(0,14),r=e[1],n=0,l=[],o=0;for(let i of[0,1,2,3,4,9,10,11,12,13])i!==13&&(n+=r[i]*Math.pow(3,o)),l[o]=t[i]<5?t[i]:t[i]-4,o++;return[n,L3(l)]}function N3(e){return j3(z3(e))}function P3(e){let t=[];for(let r of[E3,k3,C3,N3]){let n=r(e);e=v3(e,n),t=t.concat(n)}return t}function Na(){if(le.phase23om)return le.phase23om;let e=za(15,5),t=[1,3,9,27,81,243],r=Array(za(15,5)*t[5]);le.phase23om=r;for(let n=0;n<e;n++){let l=R3(n,5,15).concat(Array(5).fill(0)),o=[];for(let i=0;i<6;i++){let a=er(l,En[i][0]).slice(0,15);o[i]=h2(a)}for(let i=0;i<t[5];i++){r[i+243*n]=[];let a=[];for(let s=0,f=0;s<20;s++)l[s]===1?(a[s]=(i/t[f]|0)%3,f++):a[s]=99;for(let s=0;s<6;s++){let f=En[s],u=[];for(let p=0;p<15;p++)u[p]=a[f[0][p]]+f[1][p];let g=u.filter(p=>p<10),c=0;for(let p=0;p<5;p++)c+=g[p]%3*t[p];r[i+243*n][s]=c+243*o[s]}}}return r}function M3(){if(le.phase2op)return le.phase2op;let e=Na();return le.phase2op=Il(e,[243*3002])}function O3(){if(le.phase3op)return le.phase3op;let e=Na();return le.phase3op=Il(e,[243*246])}function Pa(){if(le.phase23pm)return le.phase23pm;let e=[1,15,225,Math.pow(15,3),Math.pow(15,4),Math.pow(15,5)],t=Array(e[5]),r=Array(15);for(let l=0;l<15;l++){r[l]=Array(6);for(let o=0;o<6;o++)r[l][o]=En[o][0].indexOf(l)}let n=[0,0,0,0,0];for(let l=0;l<e[5];l++){t[l]=Array(6);for(let o=0;o<6;o++){let i=0;for(let a=0;a<5;a++)i+=r[n[a]][o]*e[a];t[l][o]=i}n[0]++;for(let o=0;o<4;o++)n[o]===15&&(n[o]=0,n[o+1]++)}return le.phase23pm=t}function I3(){if(le.phase2pp)return le.phase2pp;let e=Pa();return le.phase2pp=Il(e,[213090])}function T3(){if(le.phase3pp)return le.phase3pp;let e=Pa();return le.phase3pp=Il(e,[737420])}function F2(){if(le.phase4om)return le.phase4om;let e=[1,3,9,27,81,243,729,2187,6561,19683,59049],t=Array(e[9]);for(let r=0;r<e[9];r++){let n=Array(14).fill(0);for(let l=0;l<9;l++){let o=l<5?l:l+4;n[o]=(r/e[l]|0)%3,n[13]-=n[o]}n[13]=(n[13]+999)%3,t[r]=[];for(let l=0;l<3;l++){let o=En[l],i=[0,1,2,3,4,9,10,11,12,13].map(s=>n[o[0][s]]+o[1][s]),a=0;for(let s=0;s<9;s++)a+=i[s]%3*e[s];t[r][l]=a}}return le.phase4om=t}function y2(){if(le.phase4pm)return le.phase4pm;let e=Gp(10)/2,t=10,r=[0,1,2,3,4,-1,-1,-1,-1,5,6,7,8,9],n=[0,1,2,3,4,9,10,11,12,13],l=[er(r,er(Wp[0],n)),er(r,er(Kp[0],n)),er(r,er(Qp[0],n))],o=Array(e),i=Array(10);for(let a=0;a<e;a++){d3(a,i),o[a]=[];for(let s=0;s<3;s++){let f=er(i,l[s]);o[a][s]=B3(f)}}return le.phase4pm=o}function G3(){if(le.phase4op)return le.phase4op;let e=F2();return le.phase4op=Il(e,[0])}function W3(){if(le.phase4pp)return le.phase4pp;let e=y2();return le.phase4pp=Il(e,[0])}function K3(e){if(le.phase4np_list&&le.phase4np_list.threshold===e)return le.phase4np_list;let t=[F2(),y2()],r=Math.pow(3,9),n=[0];l(e,[0,0],-1);function l(a,s,f){if(n.push(s[0]+r*s[1]),a===0)return;let u=[];for(let g=0;g<3;g++)if(g!==f){u[0]=s[0],u[1]=s[1];for(let c=1;c<5;c++)u[0]=t[0][u[0]][g],u[1]=t[1][u[1]][g],l(a-1,u,g)}}n.sort((a,s)=>a-s);let o=[],i=-1;for(let a of n)a!==i&&o.push(i=a);return o.threshold=e,le.phase4np_list=o}function Q3(e,t){let r=0,n=e.length-1;for(;n-r>1;){let l=r+n>>1;t>e[l]?r=l+1:n=l}return t===e[r]||t===e[n]}function Il(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1);for(let a of t)l[a]=0;let o=0,i=!1;for(;!i;){i=!0;for(let a=0;a<r;a++)if(l[a]===o)for(let s=0;s<n;s++){let f=e[a][s];for(;f!==a;)l[f]===-1&&(i=!1,l[f]=o+1),f=e[f][s]}o++}return l}function qp(e,t,r){let n=e.length,l=0;for(let o=0;o<n;o++)l=Math.max(l,r[o][e[o]]);for(;;){let o=Vp(e,t,r,l,-1);if(o!==void 0)return o;l++}}function Vp(e,t,r,n,l){let o=e.length,i=t[0][0].length,a=0;for(let s=0;s<o;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0||a===0)return[];for(let s=0;s<i;s++){if(s===l)continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Vp(f,t,r,n-1,s);if(g!==void 0)return[[s,u]].concat(g);for(let c=0;c<o;c++)f[c]=t[c][f[c]][s];u++}}}}function j3(e){let t=F2(),r=y2(),n=G3(),l=W3(),o=K3(d2),i=Math.max(n[e[0]],l[e[1]]);for(;;){let a=Hp(e,i,-1,t,r,n,l,o);if(a!==void 0)return a;i++}}function Hp(e,t,r,n,l,o,i,a){let s=Math.max(o[e[0]],i[e[1]]);if(!(s>t)&&(s<=d2&&!Q3(a,e[0]+19683*e[1])&&(s=d2+1),!(s>t))){if(t===0||s===0)return[];for(let f=0;f<3;f++){if(f===r)continue;let u=e.slice();for(let g=1;g<5;g++){u[0]=n[u[0]][f],u[1]=l[u[1]][f];let c=Hp(u,t-1,f,n,l,o,i,a);if(c!==void 0)return[[f,g]].concat(c)}}}}async function Xp(){return new E(x3(U3(await q3)))}var d2,B3,d3,Wp,Kp,Qp,h3,D3,F3,R2,Cx,En,y3,A3,Ca,b3,le,q3,Jp=A(()=>{"use strict";fe();xt();d2=7;[B3,d3]=(()=>{let e=new Int8Array(10240),t=new Int8Array(1024*10);for(let l=0;l<1024;l++)for(let o=0,i=0;o<10;o++)(l>>>o&1)!==0&&(e[o<<10|l]=i,t[i<<10|l]=o,i++);function r(l){let o=1023,i=181440,a=0;for(let s=0;s<8;s++){let f=l[s];a+=e[o|f<<10]*i,o&=~(1<<f),i/=9-s}return a}function n(l,o){let i=1023,a=181440,s=0;for(let f=0;f<8;f++){let u=l/a|0;l-=u*a,s^=u&1;let g=t[i|u<<10];o[f]=g,i&=~(1<<g),a/=9-f}return o[8]=t[i|s<<10],o[9]=t[i|(s^1)<<10],o}return[r,n]})();Wp=[Ol([0,1,2,3,4],20),Hr({},20)],Kp=[Ol([4,3,11,12,13],20),Hr({4:2,3:1,11:1,12:1,13:1},20)],Qp=[Ol([3,2,9,10,11],20),Hr({3:2,2:1,9:1,10:1,11:1},20)],h3=[Ol([2,1,7,8,9],20),Hr({2:2,1:1,7:1,8:1,9:1},20)],D3=[Ol([1,0,5,6,7],20),Hr({1:2,0:1,5:1,6:1,7:1},20)],F3=[Ol([0,4,13,14,5],20),Hr({0:2,4:1,13:1,14:1,5:1},20)],R2=[[15,16,17,18,19,10,9,8,7,6,5,14,13,12,11,0,1,2,3,4],Hr({},20)],Cx=[[1,2,3,4,0,7,8,9,10,11,12,13,14,5,6,19,15,16,17,18],Hr({},20)],En=[Wp,Kp,Qp,h3,D3,F3,R2],y3=["U","R","F","L","BL","BR","x2"],A3=D2(R2,R2),Ca=[];for(let e=0;e<En.length;e++){Ca[e]=[A3];for(let t=1;t<5;t++)Ca[e][t]=D2(Ca[e][t-1],En[e])}{let e=Math.sin(Math.PI/5),t=Math.cos(Math.PI/10),r=Math.cos(Math.PI/5),n=Math.sin(Math.PI/10);b3={U:[0,0],L:[-e-t,r-n],F:[0,2*r],R:[e+t,r-n],BR:[t,-1-n],BL:[-t,-1-n],DBR:[2*e+2*t,0],DB:[3*e+3*t,-r-n],DBL:[4*e+4*t,0],DFL:[3*e+4*t,1+r],DFR:[3*e+2*t,1+r],D:[3*e+3*t,r-n]}}le={};q3=Ee();Xp().then(e=>e.log())});var Zp={};Lt(Zp,{getRandomKilominxScramble:()=>Xp});var Yp=A(()=>{"use strict";Jp()});function Ko(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function kn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function V3(e){e=e.slice();let t=e.length,r=Ko(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function Ma(e,t){let r=[],n=Ko(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function rm(e){return V3(e)>>1}function wn(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function S2(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function Qo(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 Xr(e,t){return e.length===0?kn(t):e.map(r=>Qo(r,t)).reduce(wn)}function H3(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=wn(e.mp,t.mp),l=wn(e.wp,t.wp),o=wn(e.cp,t.cp);return{co:r,mp:n,wp:l,cp:o}}function nm(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)===4}function lD(e){let t=["0","","'"];return e.map(([n,l])=>nD[n]+t[l]).join(" ")}function oD(e){let t=Array(4);for(let o=0;o<4;o++)t[o]=e(3);let r=Ma(e(Ko(6)/2),6);for(let o=0,i=0;o<6;o++){let a=o===5?i:e(2);i^=a,r[o]+=a*6,r[o+6]=(r[o]+6)%12}let n=Ma(e(Ko(12)/2),12),l=Ma(e(Ko(4)/2),4);return{co:t,mp:r,wp:n,cp:l}}function iD(e){return sD(oD(e))}function aD(e,t=!0,r=!1){let n=lD(iD(e));if(!t)return n;let l=["u","l","r","b"],o=["0","","'"];if(!r){for(let c=0;c<4;c++){let p=e(3);p!==0&&(n+=\` \${l[c]}\${o[p]}\`)}return n.trim()}let i=[],a=[],s=[];for(let c=0;c<4;c++)i[c]=e(3),a[c]=e(3),s[c]=(i[c]-a[c]+3)%3;let f=c=>c.filter(p=>p!==0).length;for(;!(f(a)>=1&&f(s)>=1&&f(a)+f(s)>=4);)for(let c=0;c<4;c++)a[c]=e(3),s[c]=(i[c]-a[c]+3)%3;let u=a.map((c,p)=>c!==0?\`\${l[p]}\${o[c]} \`:"").join(""),g=s.map((c,p)=>c!==0?\` \${l[p]}\${o[c]}\`:"").join("");return u+n+g}function sD(e){let t=uD(e),r=[sm(),fm()],n=[BD(),dD()],l=pD(t),o,i=new Set,a=performance.now();for(let s=0;s<22;s++){let{value:f,done:u}=l.next(),g=e;for(let[d,D]of f)for(let F=0;F<D;F++)g=H3(g,Tl[d]);let c=JSON.stringify(g);if(i.has(c))continue;i.add(c);let p=mD(g),L=o?o.length-f.length-1:999999,m=RD(p,r,n,L).next().value;if(m!==void 0&&((o===void 0||o.length>f.length+m.length)&&(o=f.concat(m)),performance.now()-a>300))break}return o}function fD(e){return e[3^e.indexOf(3)]}function uD(e){let t=wn(S2(e.mp),e.wp),r=(e.co.reduce((n,l)=>n+l)-fD(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*pD(e){let t=0,r=am(),n=LD();for(;;)yield*om(...e,r,n,t,-1),t++}function*om(e,t,r,n,l,o,i,a,s,f){let u=_n,g=Fr[e]+Fr[t]+Fr[r]+Fr[n]+Fr[l]+Fr[o],c=Math.max(a[e%864+t*864],a[r%864+t*864],a[l%864+t*864],a[e%864+n*864],a[r%864+n*864],a[l%864+n*864],a[e%864+o*864],a[r%864+o*864],a[l%864+o*864],a[e%864+r*864],a[e%864+l*864],a[r%864+l*864],a[t%864+n*864],a[t%864+o*864],a[n%864+o*864],v2[g]);if(!(c>s)){if(s===0){yield[];return}if(!(c===0&&s===1))for(let p=0;p<u;p++){if(p===f||p<f&&nm(p,f))continue;let L=e,m=t,d=r,D=n,F=l,S=o;for(let v=1;v<=2;v++){L=i[L][p],m=i[m][p],d=i[d][p],D=i[D][p],F=i[F][p],S=i[S][p];let U=om(L,m,d,D,F,S,i,a,s-1,p);for(;;){let{value:P,done:J}=U.next();if(J)break;yield[[p,v]].concat(P)}}}}}function mD(e){let t=e.mp,r=rm(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),l=e.co.map((i,a)=>i*3**a).reduce((i,a)=>i+a),o=e.cp.indexOf(0);return[r+360*o,n+32*l]}function im(){if(we.phase1pm)return we.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(_n).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 l=t+6*r+72*n;for(let o=0;o<_n;o++){let i=lm[o][t],a=x2[o][r],s=x2[o][n];i<6?e[l][o]=i+6*a+72*s:e[l][o]=i-6+6*s+72*a}}return we.phase1pm=e}function am(){if(we.phase1pcm)return we.phase1pcm;let e=im(),t=Array(e.length*3).fill().map(()=>Array(_n).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<_n;n++){let l=e[r][n];t[r][n]=l+6*12*12*A2[n],t[r+6*12*12][n]=l+6*12*12*((A2[n]+1)%3),t[r+2*6*12*12][n]=l+6*12*12*((A2[n]+2)%3)}return we.phase1pcm=t}function LD(){if(we.phase1p2cp)return we.phase1p2cp;let e=im(),t=am(),r=new Int8Array((6*12*12)**2*3);r.fill(-1);let n=[0,1,2,3,4,5].map(o=>o+6*o+72*(o+6));for(let o=0;o<6;o++)for(let i=0;i<6;i++)o!==i&&(r[n[o]+864*n[i]]=0);let l=0;for(;;){let o=!1;for(let i=0;i<r.length;i++){if(r[i]!==l)continue;let a=i%864,s=Math.floor(i/864);for(let f=0;f<_n;f++){let u=a,g=s;for(let c=1;c<=2;c++){u=e[u][f],g=t[g][f];let p=u+864*g;r[p]===-1&&(o=!0,r[p]=l+1)}}}if(!o)break;l++}return we.phase1p2cp=r}function sm(){if(we.phase2pm)return we.phase2pm;let e=Array(1440).fill().map(()=>Array(Oa));for(let t=0;t<360;t++){let r=Ma(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<Oa;n++){let l=wn(r,Tl[n].mp),o=rm(l.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let a=Tl[n].cp[i];e[t+360*a][n]=o+360*i}}}return we.phase2pm=e}function fm(){if(we.phase2om)return we.phase2om;let e=Array(32*81).fill().map(()=>Array(Oa));for(let t=0;t<32;t++){let r=[0,1,2,3,4].map(l=>t>>l&1);r[5]=r.reduce((l,o)=>l^o);let n=[];for(let l=0;l<6;l++)n[l]=l+6*r[l],n[l+6]=l+6*(r[l]^1);for(let l=0;l<81;l++){let o=[0,1,2,3].map(i=>Math.floor(l/3**i)%3);for(let i=0;i<Oa;i++){let s=wn(n,Tl[i].mp).slice(0,5).map(c=>+(c>=6)),f=0;for(let c=0;c<5;c++)f+=s[c]<<c;let u=o.map((c,p)=>(c+Tl[i].co[p])%3),g=0;for(let c=0;c<4;c++)g+=u[c]*3**c;e[t+32*l][i]=f+32*g}}}return we.phase2om=e}function BD(){return we.phase2pp?we.phase2pp:we.phase2pp=um(sm(),[0])}function dD(){return we.phase2op?we.phase2op:we.phase2op=um(fm(),[0])}function um(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1),o=t.slice(),i=[],a=0;for(;o.length>0;){i.length=0;for(let s of o)if(l[s]===-1){l[s]=a;for(let f=0;f<n;f++){let u=e[s][f];for(;u!==s;)i.push(u),u=e[u][f]}}[o,i]=[i,o],a+=1}return l}function*RD(e,t,r,n){let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;)yield*gm(e,t,r,o,-1),o++}function*gm(e,t,r,n,l){let o=e.length,i=t[0][0].length,a=0;for(let s=0;s<o;s++)a=Math.max(a,r[s][e[s]]);if(!(a>n)){if(n===0){yield[];return}if(!(a===0&&n===1))for(let s=0;s<i;s++){if(s===l||s<l&&nm(s,l))continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][s];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=gm(f,t,r,n-1,s);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[s,u]].concat(c)}for(let c=0;c<o;c++)f[c]=t[c][f[c]][s];u++}}}}async function DD(){return aD(await hD,!1)}var Wx,Kx,Qx,X3,J3,Z3,Y3,$3,eD,tD,rD,Tl,nD,_n,Oa,gD,lm,cD,x2,A2,tm,v2,Fr,we,hD,cm=A(()=>{"use strict";xt();[Wx,Kx]=(()=>{let e=new Int8Array(49152),t=new Int8Array(4096*12);for(let l=0;l<4096;l++)for(let o=0,i=0;o<12;o++)(l>>>o&1)!==0&&(e[o<<12|l]=i,t[i<<12|l]=o,i++);function r(l){let o=4095,i=19958400,a=0;for(let s=0;s<10;s++){let f=l[s];a+=e[o|f<<12]*i,o&=~(1<<f),i/=11-s}return a}function n(l,o){let i=4095,a=19958400,s=0;for(let f=0;f<10;f++){let u=l/a|0;l-=u*a,s^=u&1;let g=t[i|u<<12];o[f]=g,i&=~(1<<g),a/=11-f}return o[10]=t[i|s<<12],o[11]=t[i|(s^1)<<12],o}return[r,n]})();Qx={co:[0,0,0,0],mp:kn(12),wp:kn(12),cp:[0,1,2,3]},X3={co:[2,0,0,0],mp:kn(12),wp:Qo([1,9,11],12),cp:[0,1,2,3]},J3={co:[0,2,0,0],mp:kn(12),wp:Qo([0,7,2],12),cp:[0,1,2,3]},Z3={co:[0,0,2,0],mp:kn(12),wp:Qo([3,6,10],12),cp:[0,1,2,3]},Y3={co:[0,0,0,2],mp:kn(12),wp:Qo([4,8,5],12),cp:[0,1,2,3]},$3={co:[2,0,0,0],mp:Xr([[1,9,11],[7,3,5]],12),wp:Xr([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},eD={co:[0,2,0,0],mp:Xr([[0,7,2],[6,1,8]],12),wp:Xr([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},tD={co:[0,0,2,0],mp:Xr([[3,6,10],[9,0,4]],12),wp:Xr([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},rD={co:[0,0,0,2],mp:Xr([[4,8,5],[10,2,11]],12),wp:Xr([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},Tl=[$3,eD,tD,rD,X3,J3,Z3,Y3],nD=["u","l","r","b","U","L","R","B"],_n=8,Oa=4;gD=[],lm=[],cD=[],x2=[];for(let e=0;e<_n;e++){let t=Tl[e];gD[e]=t.mp,lm[e]=S2(t.mp),cD[e]=t.wp,x2[e]=S2(t.wp)}A2=[0,0,0,0,2,2,2,2],tm=[[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]],v2=new Int8Array(55);for(let e=0;e<25;e++)v2[e]=tm[0][e],v2[e+30]=tm[1][e];Fr=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,l=2;t===e?l++:t===(e+6)%12&&l--,r===(e+6)%12?l++:r===e&&l--,Fr[n]=l,Fr[n+6*12*12]=Fr[n+2*6*12*12]=l+5}we={};hD=Ee()});var pm={};Lt(pm,{randomMasterTetraminxScrambleString:()=>DD});var mm=A(()=>{"use strict";cm()});function wD(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function xm(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 kD(e){var t,r,n,l,o;for(n=0,e.arr[0]=tr(e,0),l=1;l<24;++l)tr(e,l)!==e.arr[n]&&(e.arr[++n]=tr(e,l));for(o=0,t=0;t<16;++t)for(r=t+1;r<16;++r)e.arr[t]>e.arr[r]&&(o^=1);return o}function _D(e){var t,r,n,l;return l=e.ur&1118481,l|=~~l>>3,l|=~~l>>6,l=l&15|~~l>>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,jo(kD(e)<<24|n<<18|l<<12|t<<6|r)}function CD(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~tr(e,r*3+1)>>1<<24)>>24;for(t.cornperm=Xo(e.prm),t.topEdgeFirst=tr(e,0)===tr(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~tr(e,r)>>1<<24)>>24;for(t.botEdgeFirst=tr(e,12)===tr(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~tr(e,r)>>1<<24)>>24;t.edgeperm=Xo(e.prm),t.ml=e.ml}function tr(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 E2(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 z2(){this.arr=[],this.prm=[]}async function zD(){let e=await Ee();var t,r,n,l,o,i,a,s,f;for(t=new z2,n=Gl[e(3678)],o=19088743<<1|286331153,l=19088743<<1,a=i=8,r=0;r<24;r++)(n>>r&1)===0?(s=e(i)<<2,E2(t,23-r,l>>s&15),f=(1<<s)-1,l=(l&f)+(l>>4&~f),--i):(s=e(a)<<2,E2(t,23-r,o>>s&15),E2(t,22-r,o>>s&15),f=(1<<s)-1,o=(o&f)+(o>>4&~f),--a,++r);return t.ml=e(2),t}function ND(){}function PD(e){var t,r,n,l,o,i;for(wD(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)xm(e.Search_d,e.Search_move[n]);for(CD(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,o=e.Search_sq.ml,i=Math.max(xe[e.Search_sq.edgeperm<<1|o],xe[e.Search_sq.cornperm<<1|o]),n=i;n<e.Search_maxlen2;++n)if(Ta(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,o,n,e.Search_length1,0)){for(l=0;l<n;++l)xm(e.Search_d,e.Search_move[e.Search_length1+l]);return e.Search_sol_string=MD(e,n+e.Search_length1),!0}return!1}function MD(e,t){for(var r="",n=0,l=0,o=t-1;o>=0;o--){var i=e.Search_move[o];i>0?(i=12-i,n=i>6?i-12:i):i<0?(i=12+i,l=i>6?i-12:i):(n===0&&l===0?r+=" / ":r+=\`(\${n}, \${l}) / \`,n=l=0)}return(n!==0||l!==0)&&(r+=\`(\${n}, \${l})\`),r}function Ia(e,t,r,n,l,o){var i,a,s;if(r===0&&n<4)return n===0&&PD(e);if(o!==0&&(s=Ga[t],a=Ve[s],a<n&&(e.Search_move[l]=0,Ia(e,s,a,n-1,l+1,0))))return!0;if(s=t,o<=0){for(i=0;i+=Ho[s],s=~~i>>4,i&=15,!(i>=12||(a=Ve[s],a>n));)if(a<n&&(e.Search_move[l]=i,Ia(e,s,a,n-1,l+1,1)))return!0}if(s=t,o<=1){for(i=0;i+=Vo[s],s=~~i>>4,i&=15,!(i>=6||(a=Ve[s],a>n));)if(a<n&&(e.Search_move[l]=-i,Ia(e,s,a,n-1,l+1,2)))return!0}return!1}function Ta(e,t,r,n,l,o,i,a,s){var f,u,g,c,p,L,m;if(i===0&&!n&&l||s!==0&&n===l&&(g=Jo[t],u=Jo[r],xe[g<<1|1-o]<i&&xe[u<<1|1-o]<i&&(e.Search_move[a]=0,Ta(e,g,u,n,l,1-o,i-1,a+1,0))))return!0;if(s<=0)for(m=!n,g=m?Nn[t]:t,u=m?r:Nn[r],c=m?1:2,p=xe[g<<1|o],L=xe[u<<1|o];c<12&&p<=i&&p<=i;){if(p<i&&L<i&&(e.Search_move[a]=c,Ta(e,g,u,m,l,o,i-1,a+1,1)))return!0;m=!m,m?(g=Nn[g],p=xe[g<<1|o],c+=1):(u=Nn[u],L=xe[u<<1|o],c+=2)}if(s<=1)for(f=!l,g=f?zn[t]:t,u=f?r:zn[r],c=f?1:2,p=xe[g<<1|o],L=xe[u<<1|o];c<(i>3?6:12)&&p<=i&&p<=i;){if(p<i&&L<i&&(e.Search_move[a]=-c,Ta(e,g,u,n,f,o,i-1,a+1,2)))return!0;f=!f,f?(g=zn[g],p=xe[g<<1|o],c+=1):(u=zn[u],L=xe[u<<1|o],c+=2)}return!1}function OD(e,t){var r;for(e.Search_c=t,r=_D(t),e.Search_length1=Ve[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!Ia(e,r,Ve[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function bm(){this.Search_move=[],this.Search_d=new z2,this.Search_sq=new wm}function ID(){}function TD(){vm||(vm=!0,qo=[0,3,6,12,15,24,27,30,48,51,54,60,63],Gl=[],Ve=[],Ho=[],Vo=[],Ga=[],KD())}function GD(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((Pn(e.bottom&63)&1)!==0);return(Pn(e.bottom)&2)===0&&(e.Shape_parity^=r),t}function w2(e){var t;return t=_m(Gl,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function k2(e,t){e.Shape_parity=t&1,e.top=Gl[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function WD(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((Pn(e.top&63)&1)!==0);return(Pn(e.top)&2)===0&&(e.Shape_parity^=r),t}function Em(){}function jo(e){var t;return t=_m(Gl,e&16777215)<<1|~~e>>24,t}function KD(){var e,t,r,n,l,o,i,a,s,f,u,g,c,p,L,m;for(e=0,i=0;i<28561;++i)o=qo[i%13],r=qo[~~(i/13)%13],g=qo[~~(~~(i/13)/13)%13],u=qo[~~(~~(~~(i/13)/13)/13)],c=u<<18|g<<12|r<<6|o,Pn(c)===16&&(Gl[e++]=c);for(f=new Em,i=0;i<7356;++i)k2(f,i),Ho[i]=WD(f),Ho[i]|=w2(f)<<4,k2(f,i),Vo[i]=GD(f),Vo[i]|=w2(f)<<4,k2(f,i),m=f.top&63,p=Pn(m),L=Pn(f.bottom&4032),f.Shape_parity^=1&~~(p&L)>>1,f.top=f.top&4032|~~f.bottom>>6&63,f.bottom=f.bottom&63|m<<6,Ga[i]=w2(f);for(i=0;i<7536;++i)Ve[i]=-1;for(Ve[jo(14378715)]=0,Ve[jo(31157686)]=0,Ve[jo(23967451)]=0,Ve[jo(7191990)]=0,n=4,l=0,t=-1;n!==l;)for(l=n,++t,i=0;i<7536;++i)if(Ve[i]===t){s=0,a=i;do a=Ho[a],s+=a&15,a>>=4,Ve[a]===-1&&(++n,Ve[a]=t+1);while(s!==12);s=0,a=i;do a=Vo[a],s+=a&15,a>>=4,Ve[a]===-1&&(++n,Ve[a]=t+1);while(s!==12);a=Ga[i],Ve[a]===-1&&(++n,Ve[a]=t+1)}}function QD(){}function jD(){if(!Um){Um=!0,xe=[],Jo=[],Nn=[],zn=[],km=[1,1,2,6,24,120,720,5040],Cn=[];for(var e=0;e<12;++e)Cn[e]=[];qD()}}function wm(){}function Xo(e){var t,r,n,l;for(r=0,l=1985229328,t=0;t<7;++t)n=e[t]<<2,r=(8-t)*r+(~~l>>n&7),l-=286331152<<n;return r&65535}function qD(){var e,t,r,n,l,o,i,a,s,f,u,g,c;for(l=0;l<12;++l)for(Cn[l][0]=1,Cn[l][l]=1,s=1;s<l;++s)Cn[l][s]=Cn[l-1][s-1]+Cn[l-1][s];for(g=[],l=0;l<40320;++l)_2(g,l),c=g[2],g[2]=g[4],g[4]=c,c=g[3],g[3]=g[5],g[5]=c,Jo[l]=Xo(g),_2(g,l),c=g[0],g[0]=g[1],g[1]=g[2],g[2]=g[3],g[3]=c,Nn[l]=Xo(g),_2(g,l),c=g[4],g[4]=g[5],g[5]=g[6],g[6]=g[7],g[7]=c,zn[l]=Xo(g);for(l=0;l<80640;++l)xe[l]=-1;for(xe[0]=0,t=0,r=1;r<80640;){a=t>=11,n=a?-1:t,e=a?t:-1,++t;e:for(l=0;l<80640;++l)if(xe[l]===n){if(o=~~l>>1,u=l&1,i=Jo[o]<<1|1-u,xe[i]===e&&(++r,xe[a?l:i]=~~(t<<24)>>24,a))continue e;for(i=o,f=0;f<4;++f)if(i=Nn[i],xe[i<<1|u]===e&&(++r,xe[a?l:i<<1|u]=~~(t<<24)>>24,a))continue e;for(f=0;f<4;++f)if(i=zn[i],xe[i<<1|u]===e&&(++r,xe[a?l:i<<1|u]=~~(t<<24)>>24,a))continue e}}}function _2(e,t){var r,n,l,o,i;for(i=1985229328,r=0;r<7;++r)l=km[7-r],o=~~(t/l),t-=o*l,o<<=2,e[r]=~~((~~i>>o&7)<<24)>>24,n=(1<<o)-1,i=(i&n)+(~~i>>4&~n);e[7]=~~(i<<24)>>24}function VD(){}function Pn(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 _m(e,t){var r,n,l,o;for(n=0,r=e.length-1;n<=r;)if(l=n+(~~(r-n)>>1),o=e[l],o<t)n=l+1;else if(o>t)r=l-1;else return l;return-n-1}async function YD(){return(await ZD()).scramble_string}var _e,vm,Vo,Gl,Ve,Ho,Ga,qo,Um,zn,Cn,xe,Nn,Jo,km,C2,HD,XD,JD,ZD,Cm=A(()=>{"use strict";xt();_e=z2.prototype=ND.prototype;_e.dl=10062778;_e.dr=14536702;_e.ml=0;_e.ul=70195;_e.ur=4544119;_e=bm.prototype=ID.prototype;_e.Search_c=null;_e.Search_length1=0;_e.Search_maxlen2=0;_e.Search_sol_string=null;vm=!1;_e=Em.prototype=QD.prototype;_e.bottom=0;_e.Shape_parity=0;_e.top=0;Um=!1;_e=wm.prototype=VD.prototype;_e.botEdgeFirst=!1;_e.cornperm=0;_e.edgeperm=0;_e.ml=0;_e.topEdgeFirst=!1;C2=!1,HD=function(e,t,r){C2||(TD(),jD()),r&&r("Done initializing Square-1."),C2=!0,e?.()},XD=async function(){return C2||HD(),zD()},JD=function(e){var t=new bm;return OD(t,e)},ZD=async function(){var e=await XD(),t=JD(e);return{state:e,scramble_string:t}}});var zm={};Lt(zm,{getRandomSquare1ScrambleString:()=>YD});var Nm=A(()=>{"use strict";Cm()});var T2=Symbol("Comlink.proxy"),jm=Symbol("Comlink.endpoint"),qm=Symbol("Comlink.releaseProxy"),Qa=Symbol("Comlink.thrown"),G2=e=>typeof e=="object"&&e!==null||typeof e=="function",Vm={canHandle:e=>G2(e)&&e[T2],serialize(e){let{port1:t,port2:r}=new MessageChannel;return Wl(e,t),[r,[r]]},deserialize(e){return e.start(),Jm(e)}},Hm={canHandle:e=>G2(e)&&Qa 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}},W2=new Map([["proxy",Vm],["throw",Hm]]);function Wl(e,t=self){t.addEventListener("message",function r(n){if(!n||!n.data)return;let{id:l,type:o,path:i}=Object.assign({path:[]},n.data),a=(n.data.argumentList||[]).map(Jr),s;try{let f=i.slice(0,-1).reduce((g,c)=>g[c],e),u=i.reduce((g,c)=>g[c],e);switch(o){case"GET":s=u;break;case"SET":f[i.slice(-1)[0]]=Jr(n.data.value),s=!0;break;case"APPLY":s=u.apply(f,a);break;case"CONSTRUCT":{let g=new u(...a);s=$m(g)}break;case"ENDPOINT":{let{port1:g,port2:c}=new MessageChannel;Wl(e,c),s=Ym(g,[g])}break;case"RELEASE":s=void 0;break;default:return}}catch(f){s={value:f,[Qa]:0}}Promise.resolve(s).catch(f=>({value:f,[Qa]:0})).then(f=>{let[u,g]=qa(f);t.postMessage(Object.assign(Object.assign({},u),{id:l}),g),o==="RELEASE"&&(t.removeEventListener("message",r),K2(t))})}),t.start&&t.start()}function Xm(e){return e.constructor.name==="MessagePort"}function K2(e){Xm(e)&&e.close()}function Jm(e,t){return ja(e,[],t)}function Zo(e){if(e)throw new Error("Proxy has been released and is not useable")}function ja(e,t=[],r=function(){}){let n=!1,l=new Proxy(r,{get(o,i){if(Zo(n),i===qm)return()=>Mn(e,{type:"RELEASE",path:t.map(a=>a.toString())}).then(()=>{K2(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>l};let a=Mn(e,{type:"GET",path:t.map(s=>s.toString())}).then(Jr);return a.then.bind(a)}return ja(e,[...t,i])},set(o,i,a){Zo(n);let[s,f]=qa(a);return Mn(e,{type:"SET",path:[...t,i].map(u=>u.toString()),value:s},f).then(Jr)},apply(o,i,a){Zo(n);let s=t[t.length-1];if(s===jm)return Mn(e,{type:"ENDPOINT"}).then(Jr);if(s==="bind")return ja(e,t.slice(0,-1));let[f,u]=I2(a);return Mn(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:f},u).then(Jr)},construct(o,i){Zo(n);let[a,s]=I2(i);return Mn(e,{type:"CONSTRUCT",path:t.map(f=>f.toString()),argumentList:a},s).then(Jr)}});return l}function Zm(e){return Array.prototype.concat.apply([],e)}function I2(e){let t=e.map(qa);return[t.map(r=>r[0]),Zm(t.map(r=>r[1]))]}var Q2=new WeakMap;function Ym(e,t){return Q2.set(e,t),e}function $m(e){return Object.assign(e,{[T2]:!0})}function qa(e){for(let[t,r]of W2)if(r.canHandle(e)){let[n,l]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},l]}return[{type:"RAW",value:e},Q2.get(e)||[]]}function Jr(e){switch(e.type){case"HANDLER":return W2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Mn(e,t,r){return new Promise(n=>{let l=eL();e.addEventListener("message",function o(i){!i.data||!i.data.id||i.data.id!==l||(e.removeEventListener("message",o),n(i.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:l},t),r)})}function eL(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function tL(e){let t=new WeakMap;return{postMessage:e.postMessage.bind(e),addEventListener:(r,n)=>{let l=o=>{"handleEvent"in n?n.handleEvent({data:o}):n({data:o})};e.on("message",l),t.set(n,l)},removeEventListener:(r,n)=>{let l=t.get(n);!l||(e.off("message",l),t.delete(n))},nodeWorker:e}}var j2=tL;var rL=typeof globalThis.Worker>"u"&&typeof globalThis.WorkerNavigator>"u",nL="node:w-orker-_threa-ds",lL=()=>nL.replace(/-/g,"");async function oL(){let{parentPort:e}=await import(lL()).catch();return j2(e)}function q2(e){rL?(async()=>Wl(e,await oL()))():Wl(e)}We();ur();St();We();ur();xt();St();fe();fe();fe();var Bo=class extends rn{constructor(r){super();this.metric=r}traverseAlg(r){let n=0;for(let l of r.childAlgNodes())n+=this.traverseAlgNode(l);return n}traverseGrouping(r){let n=r.alg;return this.traverseAlg(n)*Math.abs(r.amount)}traverseMove(r){return this.metric(r)}traverseCommutator(r){return 2*(this.traverseAlg(r.A)+this.traverseAlg(r.B))}traverseConjugate(r){return 2*this.traverseAlg(r.A)+this.traverseAlg(r.B)}traversePause(r){return 0}traverseNewline(r){return 0}traverseLineComment(r){return 0}};function Au(e){return"A"<=e&&e<="Z"}function tB(e){let t=e.family;return Au(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function rB(e){return 1}function nB(e){let t=e.family;return Au(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var js=kt(Bo,[tB]),lB=kt(Bo,[rB]),oB=kt(Bo,[nB]);fe();fe();var qs=class extends rn{traverseAlg(t){let r=0;for(let n of t.childAlgNodes())r+=this.traverseAlgNode(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}},iB=kt(qs);xt();var aB=2,sB=!0,fB=!1;function uB(e,t){let r=[];return t.forEach(function(n){let l=new B(n);if(l.amount!==1)throw new Error("SGS cannot handle def moves with an amount other than 1 yet.");let o=e.identityTransformation();for(let i=1;o=o.applyMove(l),!o.isIdentityTransformation();i++)r.push({move:l.modified({amount:i}),transformation:o})}),r}var zt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=uB(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=aB,n){let l=t.experimentalToTransformation();if(!l)throw new Error("distinguishable pieces are not supported in tremble solver yt");let o=null,i=1e6,a=(s,f,u)=>{if(f===0){let g=this.sgsPhaseSolve(s,i);if(!g)return;let c=u.concat(g).experimentalSimplify({cancel:{puzzleSpecificModWrap:"canonical-centered"},puzzleSpecificSimplifyOptions:{quantumMoveOrder:n}}),p=js(c);(o===null||p<i)&&(fB&&(console.log(\`New best (\${p} moves): \${c.toString()}\`),console.log(\`Tremble moves are: \${u.toString()}\`)),o=c,i=p);return}for(let g of this.searchMoves)a(s.applyTransformation(g.transformation),f-1,u.concat([g.move]))};for(let s=0;s<=r;s++)a(l,s,new E);if(o===null)throw new Error("SGS search failed.");return o}sgsPhaseSolve(t,r){let n=new Bt,l=t;for(let o of this.sgs.ordering){let i=o.pieceOrdering,a="",s=l.invert();for(let u=0;u<i.length;u++){let g=i[u],c=g.orbitName,p=g.permutationIdx;a+=\` \${s.transformationData[c].permutation[p]} \${s.transformationData[c].orientation[p]}\`}let f=o.lookup[a];if(!f)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(f.alg),n.experimentalNumAlgNodes()>=r)return null;if(l=l.applyTransformation(f.transformation),sB)for(let u=0;u<i.length;u++){let g=i[u],c=g.orbitName,p=g.permutationIdx;if(l.transformationData[c].permutation[p]!==p||l.transformationData[c].orientation[p]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function Ei(e,t){let r=await gr(),n=e.identityTransformation();for(let l of t.ordering){let o=r(Object.values(l.lookup));n=n.applyTransformation(o.transformation)}return n.toKState()}Jt();var ut=Qe(()=>Promise.resolve().then(()=>(Cu(),_u)));var AB=3,zu=null;async function Nu(){return zu||(zu=(async()=>{let e=await(await ut).cachedData222();return new zt(await Oe["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function Pu(){await Nu()}async function Zs(e){return be(),await(await Nu()).solve(e,AB,()=>4)}async function SB(e,t,r,n){let l=await Ee();await yu(r.stateData[t].pieces);let o=e.definition.orbits[t],i=r.stateData[t].orientation,a=0;for(let s=0;s<o.numPieces;s++){let f=l(o.numOrientations);i[s]=f,a+=f}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-a)%o.numOrientations+o.numOrientations)%o.numOrientations)}async function xB(){let e=await Oe["2x2x2"].kpuzzle(),t=new pe(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await SB(e,"CORNERS",t,{orientationSum:0}),t}async function Mu(){return await Zs(await xB())}A0();wi();Jt();var X0=Qe(()=>Promise.resolve().then(()=>(Wc(),Gc)));var IR=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]];async function Kc(){return(await X0).initialize()}async function J0(){return(await X0).random444Scramble()}async function Qc(){return il(await J0(),IR)}wi();fe();xt();function TR(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var GR=[["U","D"],["L","R"],["F","B"]],jc=new Map;function WR(e){let t=jc.get(e);if(t)return t;let r=[];for(let n of GR){let l=[];r.push(l);for(let o of n){l.push(new _(o)),e>3&&l.push(new _(\`\${o}w\`));for(let i=3;i<=e/2;i++)l.push(new _(\`\${o}w\`,i))}}return jc.set(e,r),r}async function Rr(e){let t=await Ee(),r=await gr(),n=r,l=WR(e),o=TR(e),i=new Bt,a=0,s=new Set;for(;i.experimentalNumAlgNodes()<o;){let f=t(3);f!==a&&s.clear(),a=f;let u=r(l[a]),g=u.toString();s.has(g)||(s.add(g),i.push(new B(u,n([1,2,-1]))))}return i.toAlg()}var KR=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function qc(){return il(await Rr(5),KR)}fe();ur();Jt();St();Jt();var vp=Qe(()=>Promise.resolve().then(()=>(xp(),Sp)));var Ex=Qe(()=>Promise.resolve().then(()=>(B2(),L2)));async function Tp(){return be(),new E(await(await vp).randomFTOScrambleString())}St();Jt();var $p=Qe(()=>Promise.resolve().then(()=>(Yp(),Zp)));async function em(){return be(),(await $p).getRandomKilominxScramble()}fe();St();Jt();var Lm=Qe(()=>Promise.resolve().then(()=>(mm(),pm)));async function Bm(){return be(),new E(await(await Lm).randomMasterTetraminxScrambleString())}We();St();var FD=2,dm=null;async function yD(){return dm||(dm=(async()=>{let e=await(await ut).cachedSGSDataMegaminx();return new zt(await(await ut).cachedMegaminxKPuzzleWithoutMO(),e,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function Rm(e){be();let t=await yD(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new pe(await(await ut).cachedMegaminxKPuzzleWithoutMO(),r);return await t.solve(n,FD,()=>5)}ur();St();var AD=3,hm=null;async function SD(){return hm||(hm=(async()=>{let e=await(await ut).sgsDataPyraminx();return new zt(await Oe.pyraminx.kpuzzle(),e,"RLUB".split(""))})())}async function U2(e){return be(),await(await SD()).solve(e,AD,()=>3)}async function xD(){return be(),Ei(await Oe.pyraminx.kpuzzle(),await(await ut).sgsDataPyraminxFixedOrientation())}async function Dm(){return U2(await xD())}St();Jt();var Fm=Qe(()=>Promise.resolve().then(()=>(B2(),L2)));async function ym(){return be(),(await Fm).getRandomRediCubeScramble()}We();St();var vD=3,Am=null;async function UD(){return Am||(Am=(async()=>{let e=await(await ut).sgsDataSkewb();return new zt(await(await ut).skewbKPuzzleWithoutMOCached(),e,"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 b2(e){return be(),await(await UD()).solve(bD(e),vD,n=>n.family==="y"?4:3)}async function ED(){return Ei(await(await ut).skewbKPuzzleWithoutMOCached(),await(await ut).sgsDataSkewbFixedCorner())}async function Sm(){return b2(await ED())}fe();Jt();var Pm=Qe(()=>Promise.resolve().then(()=>(Nm(),zm)));async function Mm(){return E.fromString(await(await Pm).getRandomSquare1ScrambleString())}var $D=1e3;du(!0);var Tm=!0;function eF(e){Tm=e}function Om(){return(typeof performance>"u"?Date:performance).now()}async function Ce(e,t,r){if(!Tm)return t();let n=Om(),l=t();l?.then&&await l;let o=Om();return console.warn(\`\${e}\${r?.isPrefetch?" (prefetched)":""}: \${Math.round(o-n)}ms\`),l}var N2=new Map,P2=null;async function Im(e,t){switch(e){case"222":return Ce("random222Scramble",Mu,{isPrefetch:t?.isPrefetch});case"333":case"333oh":case"333ft":return Ce("random333Scramble",Rl,{isPrefetch:t?.isPrefetch});case"333fm":return Ce("random333FewestMovesScramble",kg);case"333bf":case"333mb":return Ce("random333OrientedScramble",wg);case"444":return Ce("random444Scramble",J0,{isPrefetch:t?.isPrefetch});case"444bf":return Ce("random444OrientedScramble",Qc);case"555":return Ce("bigCubeScramble(5)",Rr.bind(Rr,5));case"555bf":return Ce("oriented555RandomMoves",qc);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",Sm);case"pyram":return Ce("randomPyraminxScrambleFixedOrientation",Dm);case"sq1":return Ce("getRandomSquare1Scramble",Mm,{isPrefetch:t?.isPrefetch});case"fto":return Ce("randomFTOScramble",Tp,{isPrefetch:t?.isPrefetch});case"master_tetraminx":return Ce("randomMasterTetraminxScramble",Bm);case"kilominx":return Ce("randomKilominxScramble",em,{isPrefetch:t?.isPrefetch});case"redi_cube":return Ce("randomRediCubeScramble",ym,{isPrefetch:t?.isPrefetch});default:throw new Error(\`unsupported event: \${e}\`)}}var M2="auto",O2={initialize:async e=>{switch(e){case"222":return Ce("preInitialize222",Pu);case"333":case"333oh":case"333ft":return Ce("initialize333",Eg);case"444":return Ce("initialize444",Kc);default:throw new Error(\`unsupported event: \${e}\`)}},setScramblePrefetchLevel(e){M2=e},randomScrambleForEvent:async e=>{let t=N2.get(e);return t?N2.delete(e):t=Im(e),M2!=="none"&&t.then(()=>{P2&&clearTimeout(P2),P2=setTimeout(()=>{N2.set(e,Im(e,{isPrefetch:!0}))},M2==="immediate"?0:$D)}),t},randomScrambleStringForEvent:async e=>(await O2.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new pe(await Oe["3x3x3"].kpuzzle(),e);return(await y0(t)).toString()},solve222ToString:async e=>{let t=new pe(await Oe["2x2x2"].kpuzzle(),e);return(await Zs(t)).toString()},solveSkewbToString:async e=>{let t=new pe(await Oe.skewb.kpuzzle(),e);return(await b2(t)).toString()},solvePyraminxToString:async e=>{let t=new pe(await Oe.pyraminx.kpuzzle(),e);return(await U2(t)).toString()},solveMegaminxToString:async e=>{let t=new pe(await Oe.megaminx.kpuzzle(),e);return(await Rm(t)).toString()},setDebugMeasurePerf:async e=>{eF(e)}};q2(O2);
4058
+ \`)}var Th,wp=F(()=>{"use strict";gr();ol();Th=null});function Wo(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function p2(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 Wh(e){e=e.slice();let t=e.length,r=Wo(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function Kh(e,t){let r=[],n=Wo(t-1);for(let l=0;l<t;l++)r[l]=e/n|0,e%=n,n/=t-1-l;for(let l=t-2;l>=0;l--)for(let o=l+1;o<t;o++)r[o]+=+(r[o]>=r[l]);return r}function kp(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function Qh(e,t){let r=[],n=Wo(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function _p(e){return Wh(e)>>1}function Cp(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let l=p2(t-1,r),o=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?l=l*--n/t:(o+=l,l=l*r--/t);return o}function jh(e,t,r){let n=r-t,l=p2(r-1,t),o=[],i=r-1;for(let s=0;s<i;s++)r--,e<l?(o.push(0),l=l*--n/r):(o.push(1),e-=l,l=l*t--/r);return o.push(t),o}function ks(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function Vr(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 Hr(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function qh(e,t){let r=Array(8).fill(0);for(let n=0;n<8;n++)r[n]=(e[1][n]+t[1][n])%3;return[ks(e[0],t[0]),r]}function r3(e){let t=["0","","'"];return e.map(([n,l])=>t3[n]+t[l]).join(" ")}function n3(e){let t=Qh(Math.floor(e(Wo(12))/2),12),r=Array(8);for(let n=0;n<8;n++)r[n]=e(3);return[t,r]}function l3(e){return o3(n3(e))}function o3(e){let t=i3(e),r=[Np(),Pp()],n=[a3(),f3()],l=[Mp(),u3()],o=[g3(),s3()],i=p3(t,r,n),s,a=new Set,f=+new Date;for(let u=0;u<25;u++){let{value:g,done:c}=i.next(),p=e;for(let[S,v]of g)for(let U=0;U<v;U++)p=qh(p,Go[S]);if(a.has(p.toString()))continue;a.add(p.toString());let L=_p(p[0].slice(0,8)),m=0;for(let S=0;S<4;S++)m+=p[1][S]*3**S;let d=[L,m],D=s?s.length-g.length-1:999999,y=c3(d,l,o,D);if(y!==void 0&&((s===void 0||s.length>g.length+y.length)&&(s=g.concat(y)),new Date-f>300))break}return s}function i3(e){let t=0;for(let o=0;o<4;o++)t+=e[0].indexOf(o+8)*12**o;let r=0;for(let o=0;o<4;o++)r+=e[1][o+4]*3**o;let n=e[0].map(o=>Math.max(-1,o-8)),l=Cp(n.map(o=>+(o>=0)))*2+kp(n.filter(o=>o>=0));return[t,r+81*l]}function zp(){if(Be.phase1cm)return Be.phase1cm;let e=[];for(let t=0;t<81;t++){e[t]=Array(8);let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t][0]=e[t][1]=e[t][2]=e[t][3]=t;for(let n=0;n<4;n++)r[n]=(r[n]+2)%3,e[t][4+n]=r[0]+r[1]*3+r[2]*9+r[3]*27,r[n]=(r[n]+1)%3}return Be.phase1cm=e}function s3(){if(Be.phase1cp)return Be.phase1cp;let e=Array(81);for(let t=0;t<81;t++){let r=[t%3,Math.floor(t/3)%3,Math.floor(t/9)%3,Math.floor(t/27)];e[t]=(r[0]!==0)+(r[1]!==0)+(r[2]!==0)+(r[3]!==0)}return Be.phase1cp=e}function Np(){if(Be.phase1em)return Be.phase1em;let e=[];for(let r=0;r<12;r++){e[r]=[];for(let n=0;n<8;n++)e[r][n]=Go[n][0].indexOf(r)}let t=Array(12**4);for(let r=0;r<12**4;r++){t[r]=Array(8);for(let n=0;n<8;n++){let l=0;for(let o=0;o<4;o++)l+=e[Math.floor(r/12**o)%12][n]*12**o;t[r][n]=l}}return Be.phase1em=t}function a3(){return Be.phase1ep?Be.phase1ep:Be.phase1ep=m2(Np(),[8+12*(9+12*(10+12*11))])}function Pp(){if(Be.phase1sm)return Be.phase1sm;let e=p2(12,4),t=[];for(let l=0;l<e;l++){t[l]=[];let o=jh(l,4,12),i=[];for(let s=0,a=0;s<12;s++)o[s]===0?i[s]=-1:i[s]=a++;for(let s=0;s<8;s++){let a=ks(i,Go[s][0]),f=ks(o,Go[s][0]),u=kp(a.filter(g=>g>=0));t[l][s]=Cp(f)*2+u}}let r=zp(),n=[];for(let l=0;l<e;l++)for(let o=0;o<81;o++){let i=n[o+81*(2*l)]=[],s=n[o+81*(2*l+1)]=[];for(let a=0;a<8;a++)i[a]=r[o][a]+81*t[l][a],s[a]=r[o][a]+81*(t[l][a]^1)}return Be.phase1sm=n}function f3(){return Be.phase1sp?Be.phase1sp:Be.phase1sp=m2(Pp(),[0])}function u3(){if(Be.phase2cm)return Be.phase2cm;let e=zp(),t=Array(81);for(let r=0;r<81;r++)t[r]=e[r].slice(4,8);return Be.phase2cm=t}function Mp(){if(Be.phase2em)return Be.phase2em;let e=8,t=Wo(e)/2,r=Array(t),n=[0,1,2,3,4,5,6,7];for(let l=0;l<t;l++){r[l]=Array(4);for(let i=0;i<4;i++){let s=ks(n,Go[i][0].slice(0,8));r[l][i]=_p(s)}if(l===t-1)break;let o=0;do for(let i=e-2;i>=0;i--){if(n[i]>n[i+1])continue;let s=i+1;for(let a=s;a<e;a++)n[a]>n[i]&&(s=a);[n[i],n[s]]=[n[s],n[i]],o^=1;for(let a=0;i+1+a<e-1-a;a++,o^=1)[n[i+1+a],n[e-1-a]]=[n[e-1-a],n[i+1+a]];break}while(o!==0)}return Be.phase2em=r}function g3(){return Be.phase2ep?Be.phase2ep:Be.phase2ep=m2(Mp(),[0])}function m2(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1),o=t.slice(),i=[],s=0;for(;o.length>0;){i.length=0;for(let a of o)if(l[a]===-1){l[a]=s;for(let f=0;f<n;f++){let u=e[a][f];for(;u!==a;)i.push(u),u=e[u][f]}}[o,i]=[i,o],s+=1}return l}function c3(e,t,r,n){n=n||999999;let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;){let i=Op(e,t,r,o,-1);if(i!==void 0)return i;o++}}function Op(e,t,r,n,l){let o=e.length,i=t[0][0].length,s=0;for(let a=0;a<o;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0)return[];if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===l||a<l&&_s[a]===_s[l])continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Op(f,t,r,n-1,a);if(g!==void 0)return[[a,u]].concat(g);for(let c=0;c<o;c++)f[c]=t[c][f[c]][a];u++}}}}function*p3(e,t,r){let n=e.length,l=0;for(let o=0;o<n;o++)l=Math.max(l,r[o][e[o]]);for(;;)yield*Ip(e,t,r,l,-1),l++}function*Ip(e,t,r,n,l){let o=e.length,i=t[0][0].length,s=0;for(let a=0;a<o;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===l||a<l&&_s[a]===_s[l])continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Ip(f,t,r,n-1,a);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[a,u]].concat(c)}for(let c=0;c<o;c++)f[c]=t[c][f[c]][a];u++}}}}async function Tp(){return new E(r3(l3(await m3)))}var Vh,Hh,Xh,Jh,Zh,Yh,$h,e3,Ex,Go,t3,_s,Be,m3,Gp=F(()=>{"use strict";ae();xt();Vh=[Vr([0,1,4],12),Hr({0:2},8)],Hh=[Vr([1,2,5],12),Hr({1:2},8)],Xh=[Vr([2,3,6],12),Hr({2:2},8)],Jh=[Vr([3,0,7],12),Hr({3:2},8)],Zh=[Vr([9,8,4],12),Hr({4:2},8)],Yh=[Vr([10,9,5],12),Hr({5:2},8)],$h=[Vr([11,10,6],12),Hr({6:2},8)],e3=[Vr([8,11,7],12),Hr({7:2},8)],Ex=[Kh(0,12),Array(8).fill(0)],Go=[Vh,Hh,Xh,Jh,Zh,Yh,$h,e3],t3=["UL","U","UR","F","L","B","R","D"],_s=[0,1,0,1,1,0,1,0];Be={};m3=Ee()});var L2={};Lt(L2,{getRandomRediCubeScramble:()=>Tp,sgsDataFTO:()=>Ep});var B2=F(()=>{"use strict";wp();Gp()});function Kp(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function zs(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 L3(e){e=e.slice();let t=e.length,r=Kp(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function B3(e){let t=e.length,r=0;for(let n=0;n<t-1;n++)for(let l=n;l<t;l++)e[n]>e[l]&&(r^=1);return r}function d3(e){return L3(e)>>1}function h2(e){let t=e.length,r=0;for(let i=0;i<t;i++)r+=+(e[i]===1);let n=t-r;if(n===0||r===0||t===1)return 0;let l=zs(t-1,r),o=0;for(let i=0;n>0&&r>0&&t>1;i++)t--,e[i]===0?l=l*--n/t:(o+=l,l=l*r--/t);return o}function D3(e,t,r){let n=r-t,l=zs(r-1,t),o=[],i=r-1;for(let s=0;s<i;s++)r--,e<l?(o.push(0),l=l*--n/r):(o.push(1),e-=l,l=l*t--/r);return o.push(t),o}function tr(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function D2(e,t){let r=tr(e[0],t[0]),n=[],l=t[0].length;for(let o=0;o<l;o++)n[o]=(e[1][t[0][o]]+t[1][o])%3;return[r,n]}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 Xr(e,t){let r=Array(t).fill(0);for(let n in e)r[n]=e[n];return r}function v3(e){let t=[0];for(let n=1;n<20;n++){let l=e(n+1);t[n]=t[l],t[l]=n}B3(t)===1&&([t[0],t[1]]=[t[1],t[0]]);let r=Array(20).fill(0);for(let n=0;n<19;n++)r[n]=e(3),r[19]+=3-r[n];return r[19]%=3,[t,r]}function U3(e){let t=["0","","2","2'","'"];return e.map(([n,l])=>S3[n]+t[l]).join(" ")}function b3(e,t){for(let[r,n]of t)for(let l=0;l<n;l++)e=D2(e,En[r]);return e}function E3(e){return O3(v3(e))}function k3(e){let t=e[0];if(t.slice(15,20).every(o=>o<15))return[];if(t.slice(0,5).every(o=>o<15))return[[6,1]];let r=t.map(o=>o>=15),n=0,l;for(;l===void 0;)n++,l=Vp(r,n,-1);return l.push([6,1]),l}function Vp(e,t,r){if(t===0)return e.slice(0,5).some(n=>n)?void 0:[];for(let n=0;n<6;n++)if(n!==r)for(let l=1;l<5;l++){let o=tr(e,Cs[n][l][0]),i=Vp(o,t-1,n);if(i!==void 0)return[[n,l]].concat(i)}}function _3(e){let t=e[0].slice(0,15),r=e[1],n=h2(t.map(i=>+(i>=15))),l=243*n;for(let i=0,s=0;i<15;i++)t[i]<15||(l+=r[i]*Math.pow(3,s),s++);let o=0;for(let i=0;i<5;i++)o+=t.indexOf(15+i)*Math.pow(15,i);return[l,o]}function C3(e){let t=[Ns(),Ps()],r=[I3(),G3()];return Hp(_3(e),t,r).concat([[6,1]])}function z3(e){let t=[5,6,7,8,14],r=e[0].slice(0,15),n=e[1],l=h2(r.map(s=>+(t.indexOf(s)!==-1))),o=243*l;for(let s=0,a=0;s<15;s++)t.indexOf(r[s])!==-1&&(o+=n[s]*Math.pow(3,a),a++);let i=0;for(let s=0;s<5;s++)i+=r.indexOf(t[s])*Math.pow(15,s);return[o,i]}function N3(e){let t=[Ns(),Ps()],r=[T3(),W3()];return Hp(z3(e),t,r)}function P3(e){let t=e[0].slice(0,14),r=e[1],n=0,l=[],o=0;for(let i of[0,1,2,3,4,9,10,11,12,13])i!==13&&(n+=r[i]*Math.pow(3,o)),l[o]=t[i]<5?t[i]:t[i]-4,o++;return[n,d3(l)]}function M3(e){return V3(P3(e))}function O3(e){let t=[];for(let r of[k3,C3,N3,M3]){let n=r(e);e=b3(e,n),t=t.concat(n)}return t}function Ns(){if(le.phase23om)return le.phase23om;let e=zs(15,5),t=[1,3,9,27,81,243],r=Array(zs(15,5)*t[5]);le.phase23om=r;for(let n=0;n<e;n++){let l=D3(n,5,15).concat(Array(5).fill(0)),o=[];for(let i=0;i<6;i++){let s=tr(l,En[i][0]).slice(0,15);o[i]=h2(s)}for(let i=0;i<t[5];i++){r[i+243*n]=[];let s=[];for(let a=0,f=0;a<20;a++)l[a]===1?(s[a]=(i/t[f]|0)%3,f++):s[a]=99;for(let a=0;a<6;a++){let f=En[a],u=[];for(let p=0;p<15;p++)u[p]=s[f[0][p]]+f[1][p];let g=u.filter(p=>p<10),c=0;for(let p=0;p<5;p++)c+=g[p]%3*t[p];r[i+243*n][a]=c+243*o[a]}}}return r}function I3(){if(le.phase2op)return le.phase2op;let e=Ns();return le.phase2op=Il(e,[243*3002])}function T3(){if(le.phase3op)return le.phase3op;let e=Ns();return le.phase3op=Il(e,[243*246])}function Ps(){if(le.phase23pm)return le.phase23pm;let e=[1,15,225,Math.pow(15,3),Math.pow(15,4),Math.pow(15,5)],t=Array(e[5]),r=Array(15);for(let l=0;l<15;l++){r[l]=Array(6);for(let o=0;o<6;o++)r[l][o]=En[o][0].indexOf(l)}let n=[0,0,0,0,0];for(let l=0;l<e[5];l++){t[l]=Array(6);for(let o=0;o<6;o++){let i=0;for(let s=0;s<5;s++)i+=r[n[s]][o]*e[s];t[l][o]=i}n[0]++;for(let o=0;o<4;o++)n[o]===15&&(n[o]=0,n[o+1]++)}return le.phase23pm=t}function G3(){if(le.phase2pp)return le.phase2pp;let e=Ps();return le.phase2pp=Il(e,[213090])}function W3(){if(le.phase3pp)return le.phase3pp;let e=Ps();return le.phase3pp=Il(e,[737420])}function F2(){if(le.phase4om)return le.phase4om;let e=[1,3,9,27,81,243,729,2187,6561,19683,59049],t=Array(e[9]);for(let r=0;r<e[9];r++){let n=Array(14).fill(0);for(let l=0;l<9;l++){let o=l<5?l:l+4;n[o]=(r/e[l]|0)%3,n[13]-=n[o]}n[13]=(n[13]+999)%3,t[r]=[];for(let l=0;l<3;l++){let o=En[l],i=[0,1,2,3,4,9,10,11,12,13].map(a=>n[o[0][a]]+o[1][a]),s=0;for(let a=0;a<9;a++)s+=i[a]%3*e[a];t[r][l]=s}}return le.phase4om=t}function y2(){if(le.phase4pm)return le.phase4pm;let e=Kp(10)/2,t=10,r=[0,1,2,3,4,-1,-1,-1,-1,5,6,7,8,9],n=[0,1,2,3,4,9,10,11,12,13],l=[tr(r,tr(Qp[0],n)),tr(r,tr(jp[0],n)),tr(r,tr(qp[0],n))],o=Array(e),i=Array(10);for(let s=0;s<e;s++){h3(s,i),o[s]=[];for(let a=0;a<3;a++){let f=tr(i,l[a]);o[s][a]=R3(f)}}return le.phase4pm=o}function K3(){if(le.phase4op)return le.phase4op;let e=F2();return le.phase4op=Il(e,[0])}function Q3(){if(le.phase4pp)return le.phase4pp;let e=y2();return le.phase4pp=Il(e,[0])}function j3(e){if(le.phase4np_list&&le.phase4np_list.threshold===e)return le.phase4np_list;let t=[F2(),y2()],r=Math.pow(3,9),n=[0];l(e,[0,0],-1);function l(s,a,f){if(n.push(a[0]+r*a[1]),s===0)return;let u=[];for(let g=0;g<3;g++)if(g!==f){u[0]=a[0],u[1]=a[1];for(let c=1;c<5;c++)u[0]=t[0][u[0]][g],u[1]=t[1][u[1]][g],l(s-1,u,g)}}n.sort((s,a)=>s-a);let o=[],i=-1;for(let s of n)s!==i&&o.push(i=s);return o.threshold=e,le.phase4np_list=o}function q3(e,t){let r=0,n=e.length-1;for(;n-r>1;){let l=r+n>>1;t>e[l]?r=l+1:n=l}return t===e[r]||t===e[n]}function Il(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1);for(let s of t)l[s]=0;let o=0,i=!1;for(;!i;){i=!0;for(let s=0;s<r;s++)if(l[s]===o)for(let a=0;a<n;a++){let f=e[s][a];for(;f!==s;)l[f]===-1&&(i=!1,l[f]=o+1),f=e[f][a]}o++}return l}function Hp(e,t,r){let n=e.length,l=0;for(let o=0;o<n;o++)l=Math.max(l,r[o][e[o]]);for(;;){let o=Xp(e,t,r,l,-1);if(o!==void 0)return o;l++}}function Xp(e,t,r,n,l){let o=e.length,i=t[0][0].length,s=0;for(let a=0;a<o;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0||s===0)return[];for(let a=0;a<i;a++){if(a===l)continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=Xp(f,t,r,n-1,a);if(g!==void 0)return[[a,u]].concat(g);for(let c=0;c<o;c++)f[c]=t[c][f[c]][a];u++}}}}function V3(e){let t=F2(),r=y2(),n=K3(),l=Q3(),o=j3(d2),i=Math.max(n[e[0]],l[e[1]]);for(;;){let s=Jp(e,i,-1,t,r,n,l,o);if(s!==void 0)return s;i++}}function Jp(e,t,r,n,l,o,i,s){let a=Math.max(o[e[0]],i[e[1]]);if(!(a>t)&&(a<=d2&&!q3(s,e[0]+19683*e[1])&&(a=d2+1),!(a>t))){if(t===0||a===0)return[];for(let f=0;f<3;f++){if(f===r)continue;let u=e.slice();for(let g=1;g<5;g++){u[0]=n[u[0]][f],u[1]=l[u[1]][f];let c=Jp(u,t-1,f,n,l,o,i,s);if(c!==void 0)return[[f,g]].concat(c)}}}}async function Zp(){return new E(U3(E3(await H3)))}var d2,R3,h3,Qp,jp,qp,F3,y3,A3,R2,Kx,En,S3,x3,Cs,w3,le,H3,Yp=F(()=>{"use strict";ae();xt();d2=7;[R3,h3]=(()=>{let e=new Int8Array(10240),t=new Int8Array(1024*10);for(let l=0;l<1024;l++)for(let o=0,i=0;o<10;o++)(l>>>o&1)!==0&&(e[o<<10|l]=i,t[i<<10|l]=o,i++);function r(l){let o=1023,i=181440,s=0;for(let a=0;a<8;a++){let f=l[a];s+=e[o|f<<10]*i,o&=~(1<<f),i/=9-a}return s}function n(l,o){let i=1023,s=181440,a=0;for(let f=0;f<8;f++){let u=l/s|0;l-=u*s,a^=u&1;let g=t[i|u<<10];o[f]=g,i&=~(1<<g),s/=9-f}return o[8]=t[i|a<<10],o[9]=t[i|(a^1)<<10],o}return[r,n]})();Qp=[Ol([0,1,2,3,4],20),Xr({},20)],jp=[Ol([4,3,11,12,13],20),Xr({4:2,3:1,11:1,12:1,13:1},20)],qp=[Ol([3,2,9,10,11],20),Xr({3:2,2:1,9:1,10:1,11:1},20)],F3=[Ol([2,1,7,8,9],20),Xr({2:2,1:1,7:1,8:1,9:1},20)],y3=[Ol([1,0,5,6,7],20),Xr({1:2,0:1,5:1,6:1,7:1},20)],A3=[Ol([0,4,13,14,5],20),Xr({0:2,4:1,13:1,14:1,5:1},20)],R2=[[15,16,17,18,19,10,9,8,7,6,5,14,13,12,11,0,1,2,3,4],Xr({},20)],Kx=[[1,2,3,4,0,7,8,9,10,11,12,13,14,5,6,19,15,16,17,18],Xr({},20)],En=[Qp,jp,qp,F3,y3,A3,R2],S3=["U","R","F","L","BL","BR","x2"],x3=D2(R2,R2),Cs=[];for(let e=0;e<En.length;e++){Cs[e]=[x3];for(let t=1;t<5;t++)Cs[e][t]=D2(Cs[e][t-1],En[e])}{let e=Math.sin(Math.PI/5),t=Math.cos(Math.PI/10),r=Math.cos(Math.PI/5),n=Math.sin(Math.PI/10);w3={U:[0,0],L:[-e-t,r-n],F:[0,2*r],R:[e+t,r-n],BR:[t,-1-n],BL:[-t,-1-n],DBR:[2*e+2*t,0],DB:[3*e+3*t,-r-n],DBL:[4*e+4*t,0],DFL:[3*e+4*t,1+r],DFR:[3*e+2*t,1+r],D:[3*e+3*t,r-n]}}le={};H3=Ee();Zp().then(e=>e.log())});var $p={};Lt($p,{getRandomKilominxScramble:()=>Zp});var em=F(()=>{"use strict";Yp()});function Ko(e){if(e<2)return e;let t=1;for(let r=2;r<=e;r++)t*=r;return t}function kn(e){let t=Array(e);for(let r=0;r<e;r++)t[r]=r;return t}function X3(e){e=e.slice();let t=e.length,r=Ko(t-1),n=0;for(;t>1;){t--;let l=e[0];n+=l*r;for(let o=0;o<t;o++){let i=e[o+1];e[o]=i-(i>l)}r/=t}return n}function Ms(e,t){let r=[],n=Ko(t-1)/2,l=0;for(let o=0;o<t-1;o++)r[o]=e/n|0,e%=n,n/=t-1-o;r[t-1]=0;for(let o=t-2;o>=0;o--)for(let i=o+1;i<t;i++)r[i]>=r[o]?r[i]++:l^=1;return l===1&&([r[t-2],r[t-1]]=[r[t-1],r[t-2]]),r}function lm(e){return X3(e)>>1}function wn(e,t){let r=[];for(let n=0;n<t.length;n++)r[n]=e[t[n]];return r}function S2(e){let t=[];for(let r=0;r<e.length;r++)t[e[r]]=r;return t}function Qo(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 Jr(e,t){return e.length===0?kn(t):e.map(r=>Qo(r,t)).reduce(wn)}function J3(e,t){let r=Array(4);for(let i=0;i<4;i++)r[i]=(e.co[i]+t.co[i])%3;let n=wn(e.mp,t.mp),l=wn(e.wp,t.wp),o=wn(e.cp,t.cp);return{co:r,mp:n,wp:l,cp:o}}function om(e,t){return e>=4&&t>=4?!0:e<4&&t<4?e===t:(e^t)===4}function iD(e){let t=["0","","'"];return e.map(([n,l])=>oD[n]+t[l]).join(" ")}function sD(e){let t=Array(4);for(let o=0;o<4;o++)t[o]=e(3);let r=Ms(e(Ko(6)/2),6);for(let o=0,i=0;o<6;o++){let s=o===5?i:e(2);i^=s,r[o]+=s*6,r[o+6]=(r[o]+6)%12}let n=Ms(e(Ko(12)/2),12),l=Ms(e(Ko(4)/2),4);return{co:t,mp:r,wp:n,cp:l}}function aD(e){return uD(sD(e))}function fD(e,t=!0,r=!1){let n=iD(aD(e));if(!t)return n;let l=["u","l","r","b"],o=["0","","'"];if(!r){for(let c=0;c<4;c++){let p=e(3);p!==0&&(n+=\` \${l[c]}\${o[p]}\`)}return n.trim()}let i=[],s=[],a=[];for(let c=0;c<4;c++)i[c]=e(3),s[c]=e(3),a[c]=(i[c]-s[c]+3)%3;let f=c=>c.filter(p=>p!==0).length;for(;!(f(s)>=1&&f(a)>=1&&f(s)+f(a)>=4);)for(let c=0;c<4;c++)s[c]=e(3),a[c]=(i[c]-s[c]+3)%3;let u=s.map((c,p)=>c!==0?\`\${l[p]}\${o[c]} \`:"").join(""),g=a.map((c,p)=>c!==0?\` \${l[p]}\${o[c]}\`:"").join("");return u+n+g}function uD(e){let t=cD(e),r=[um(),gm()],n=[RD(),hD()],l=LD(t),o,i=new Set,s=performance.now();for(let a=0;a<22;a++){let{value:f,done:u}=l.next(),g=e;for(let[d,D]of f)for(let y=0;y<D;y++)g=J3(g,Tl[d]);let c=JSON.stringify(g);if(i.has(c))continue;i.add(c);let p=BD(g),L=o?o.length-f.length-1:999999,m=DD(p,r,n,L).next().value;if(m!==void 0&&((o===void 0||o.length>f.length+m.length)&&(o=f.concat(m)),performance.now()-s>300))break}return o}function gD(e){return e[3^e.indexOf(3)]}function cD(e){let t=wn(S2(e.mp),e.wp),r=(e.co.reduce((n,l)=>n+l)-gD(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*LD(e){let t=0,r=fm(),n=dD();for(;;)yield*sm(...e,r,n,t,-1),t++}function*sm(e,t,r,n,l,o,i,s,a,f){let u=_n,g=yr[e]+yr[t]+yr[r]+yr[n]+yr[l]+yr[o],c=Math.max(s[e%864+t*864],s[r%864+t*864],s[l%864+t*864],s[e%864+n*864],s[r%864+n*864],s[l%864+n*864],s[e%864+o*864],s[r%864+o*864],s[l%864+o*864],s[e%864+r*864],s[e%864+l*864],s[r%864+l*864],s[t%864+n*864],s[t%864+o*864],s[n%864+o*864],v2[g]);if(!(c>a)){if(a===0){yield[];return}if(!(c===0&&a===1))for(let p=0;p<u;p++){if(p===f||p<f&&om(p,f))continue;let L=e,m=t,d=r,D=n,y=l,S=o;for(let v=1;v<=2;v++){L=i[L][p],m=i[m][p],d=i[d][p],D=i[D][p],y=i[y][p],S=i[S][p];let U=sm(L,m,d,D,y,S,i,s,a-1,p);for(;;){let{value:P,done:J}=U.next();if(J)break;yield[[p,v]].concat(P)}}}}}function BD(e){let t=e.mp,r=lm(t.slice(0,6).map(i=>i%6)),n=t.slice(0,5).map((i,s)=>(i>=6)*2**s).reduce((i,s)=>i+s),l=e.co.map((i,s)=>i*3**s).reduce((i,s)=>i+s),o=e.cp.indexOf(0);return[r+360*o,n+32*l]}function am(){if(we.phase1pm)return we.phase1pm;let e=Array(6*12*12).fill().map(()=>Array(_n).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 l=t+6*r+72*n;for(let o=0;o<_n;o++){let i=im[o][t],s=x2[o][r],a=x2[o][n];i<6?e[l][o]=i+6*s+72*a:e[l][o]=i-6+6*a+72*s}}return we.phase1pm=e}function fm(){if(we.phase1pcm)return we.phase1pcm;let e=am(),t=Array(e.length*3).fill().map(()=>Array(_n).fill(-1));for(let r=0;r<e.length;r++)for(let n=0;n<_n;n++){let l=e[r][n];t[r][n]=l+6*12*12*A2[n],t[r+6*12*12][n]=l+6*12*12*((A2[n]+1)%3),t[r+2*6*12*12][n]=l+6*12*12*((A2[n]+2)%3)}return we.phase1pcm=t}function dD(){if(we.phase1p2cp)return we.phase1p2cp;let e=am(),t=fm(),r=new Int8Array((6*12*12)**2*3);r.fill(-1);let n=[0,1,2,3,4,5].map(o=>o+6*o+72*(o+6));for(let o=0;o<6;o++)for(let i=0;i<6;i++)o!==i&&(r[n[o]+864*n[i]]=0);let l=0;for(;;){let o=!1;for(let i=0;i<r.length;i++){if(r[i]!==l)continue;let s=i%864,a=Math.floor(i/864);for(let f=0;f<_n;f++){let u=s,g=a;for(let c=1;c<=2;c++){u=e[u][f],g=t[g][f];let p=u+864*g;r[p]===-1&&(o=!0,r[p]=l+1)}}}if(!o)break;l++}return we.phase1p2cp=r}function um(){if(we.phase2pm)return we.phase2pm;let e=Array(1440).fill().map(()=>Array(Os));for(let t=0;t<360;t++){let r=Ms(t,6);for(let n=0;n<6;n++)r[n+6]=r[n]+6;for(let n=0;n<Os;n++){let l=wn(r,Tl[n].mp),o=lm(l.slice(0,6).map(i=>i%6));for(let i=0;i<4;i++){let s=Tl[n].cp[i];e[t+360*s][n]=o+360*i}}}return we.phase2pm=e}function gm(){if(we.phase2om)return we.phase2om;let e=Array(32*81).fill().map(()=>Array(Os));for(let t=0;t<32;t++){let r=[0,1,2,3,4].map(l=>t>>l&1);r[5]=r.reduce((l,o)=>l^o);let n=[];for(let l=0;l<6;l++)n[l]=l+6*r[l],n[l+6]=l+6*(r[l]^1);for(let l=0;l<81;l++){let o=[0,1,2,3].map(i=>Math.floor(l/3**i)%3);for(let i=0;i<Os;i++){let a=wn(n,Tl[i].mp).slice(0,5).map(c=>+(c>=6)),f=0;for(let c=0;c<5;c++)f+=a[c]<<c;let u=o.map((c,p)=>(c+Tl[i].co[p])%3),g=0;for(let c=0;c<4;c++)g+=u[c]*3**c;e[t+32*l][i]=f+32*g}}}return we.phase2om=e}function RD(){return we.phase2pp?we.phase2pp:we.phase2pp=cm(um(),[0])}function hD(){return we.phase2op?we.phase2op:we.phase2op=cm(gm(),[0])}function cm(e,t){let r=e.length,n=e[0].length,l=Array(r).fill(-1),o=t.slice(),i=[],s=0;for(;o.length>0;){i.length=0;for(let a of o)if(l[a]===-1){l[a]=s;for(let f=0;f<n;f++){let u=e[a][f];for(;u!==a;)i.push(u),u=e[u][f]}}[o,i]=[i,o],s+=1}return l}function*DD(e,t,r,n){let l=e.length,o=0;for(let i=0;i<l;i++)o=Math.max(o,r[i][e[i]]);for(;o<=n;)yield*pm(e,t,r,o,-1),o++}function*pm(e,t,r,n,l){let o=e.length,i=t[0][0].length,s=0;for(let a=0;a<o;a++)s=Math.max(s,r[a][e[a]]);if(!(s>n)){if(n===0){yield[];return}if(!(s===0&&n===1))for(let a=0;a<i;a++){if(a===l||a<l&&om(a,l))continue;let f=e.slice();for(let g=0;g<o;g++)f[g]=t[g][e[g]][a];let u=1;for(;e.some((g,c)=>e[c]!==f[c]);){let g=pm(f,t,r,n-1,a);for(;;){let{value:c,done:p}=g.next();if(p)break;yield[[a,u]].concat(c)}for(let c=0;c<o;c++)f[c]=t[c][f[c]][a];u++}}}}async function yD(){return fD(await FD,!1)}var Yx,$x,ev,Z3,Y3,$3,eD,tD,rD,nD,lD,Tl,oD,_n,Os,pD,im,mD,x2,A2,nm,v2,yr,we,FD,mm=F(()=>{"use strict";xt();[Yx,$x]=(()=>{let e=new Int8Array(49152),t=new Int8Array(4096*12);for(let l=0;l<4096;l++)for(let o=0,i=0;o<12;o++)(l>>>o&1)!==0&&(e[o<<12|l]=i,t[i<<12|l]=o,i++);function r(l){let o=4095,i=19958400,s=0;for(let a=0;a<10;a++){let f=l[a];s+=e[o|f<<12]*i,o&=~(1<<f),i/=11-a}return s}function n(l,o){let i=4095,s=19958400,a=0;for(let f=0;f<10;f++){let u=l/s|0;l-=u*s,a^=u&1;let g=t[i|u<<12];o[f]=g,i&=~(1<<g),s/=11-f}return o[10]=t[i|a<<12],o[11]=t[i|(a^1)<<12],o}return[r,n]})();ev={co:[0,0,0,0],mp:kn(12),wp:kn(12),cp:[0,1,2,3]},Z3={co:[2,0,0,0],mp:kn(12),wp:Qo([1,9,11],12),cp:[0,1,2,3]},Y3={co:[0,2,0,0],mp:kn(12),wp:Qo([0,7,2],12),cp:[0,1,2,3]},$3={co:[0,0,2,0],mp:kn(12),wp:Qo([3,6,10],12),cp:[0,1,2,3]},eD={co:[0,0,0,2],mp:kn(12),wp:Qo([4,8,5],12),cp:[0,1,2,3]},tD={co:[2,0,0,0],mp:Jr([[1,9,11],[7,3,5]],12),wp:Jr([[1,9,11],[7,3,5]],12),cp:[0,2,3,1]},rD={co:[0,2,0,0],mp:Jr([[0,7,2],[6,1,8]],12),wp:Jr([[0,7,2],[6,1,8]],12),cp:[3,1,0,2]},nD={co:[0,0,2,0],mp:Jr([[3,6,10],[9,0,4]],12),wp:Jr([[3,6,10],[9,0,4]],12),cp:[1,3,2,0]},lD={co:[0,0,0,2],mp:Jr([[4,8,5],[10,2,11]],12),wp:Jr([[4,8,5],[10,2,11]],12),cp:[2,0,1,3]},Tl=[tD,rD,nD,lD,Z3,Y3,$3,eD],oD=["u","l","r","b","U","L","R","B"],_n=8,Os=4;pD=[],im=[],mD=[],x2=[];for(let e=0;e<_n;e++){let t=Tl[e];pD[e]=t.mp,im[e]=S2(t.mp),mD[e]=t.wp,x2[e]=S2(t.wp)}A2=[0,0,0,0,2,2,2,2],nm=[[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]],v2=new Int8Array(55);for(let e=0;e<25;e++)v2[e]=nm[0][e],v2[e+30]=nm[1][e];yr=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,l=2;t===e?l++:t===(e+6)%12&&l--,r===(e+6)%12?l++:r===e&&l--,yr[n]=l,yr[n+6*12*12]=yr[n+2*6*12*12]=l+5}we={};FD=Ee()});var Lm={};Lt(Lm,{randomMasterTetraminxScrambleString:()=>yD});var Bm=F(()=>{"use strict";mm()});function _D(e,t){e.ul=t.ul,e.ur=t.ur,e.dl=t.dl,e.dr=t.dr,e.ml=t.ml}function Um(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 CD(e){var t,r,n,l,o;for(n=0,e.arr[0]=rr(e,0),l=1;l<24;++l)rr(e,l)!==e.arr[n]&&(e.arr[++n]=rr(e,l));for(o=0,t=0;t<16;++t)for(r=t+1;r<16;++r)e.arr[t]>e.arr[r]&&(o^=1);return o}function zD(e){var t,r,n,l;return l=e.ur&1118481,l|=~~l>>3,l|=~~l>>6,l=l&15|~~l>>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,jo(CD(e)<<24|n<<18|l<<12|t<<6|r)}function ND(e,t){var r,n;for(r=0;r<8;++r)e.prm[r]=~~(~~rr(e,r*3+1)>>1<<24)>>24;for(t.cornperm=Xo(e.prm),t.topEdgeFirst=rr(e,0)===rr(e,1),r=t.topEdgeFirst?2:0,n=0;n<4;r+=3,++n)e.prm[n]=~~(~~rr(e,r)>>1<<24)>>24;for(t.botEdgeFirst=rr(e,12)===rr(e,13),r=t.botEdgeFirst?14:12;n<8;r+=3,++n)e.prm[n]=~~(~~rr(e,r)>>1<<24)>>24;t.edgeperm=Xo(e.prm),t.ml=e.ml}function rr(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 E2(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 z2(){this.arr=[],this.prm=[]}async function PD(){let e=await Ee();var t,r,n,l,o,i,s,a,f;for(t=new z2,n=Gl[e(3678)],o=19088743<<1|286331153,l=19088743<<1,s=i=8,r=0;r<24;r++)(n>>r&1)===0?(a=e(i)<<2,E2(t,23-r,l>>a&15),f=(1<<a)-1,l=(l&f)+(l>>4&~f),--i):(a=e(s)<<2,E2(t,23-r,o>>a&15),E2(t,22-r,o>>a&15),f=(1<<a)-1,o=(o&f)+(o>>4&~f),--s,++r);return t.ml=e(2),t}function MD(){}function OD(e){var t,r,n,l,o,i;for(_D(e.Search_d,e.Search_c),n=0;n<e.Search_length1;++n)Um(e.Search_d,e.Search_move[n]);for(ND(e.Search_d,e.Search_sq),r=e.Search_sq.edgeperm,t=e.Search_sq.cornperm,o=e.Search_sq.ml,i=Math.max(xe[e.Search_sq.edgeperm<<1|o],xe[e.Search_sq.cornperm<<1|o]),n=i;n<e.Search_maxlen2;++n)if(Ts(e,r,t,e.Search_sq.topEdgeFirst,e.Search_sq.botEdgeFirst,o,n,e.Search_length1,0)){for(l=0;l<n;++l)Um(e.Search_d,e.Search_move[e.Search_length1+l]);return e.Search_sol_string=ID(e,n+e.Search_length1),!0}return!1}function ID(e,t){for(var r="",n=0,l=0,o=t-1;o>=0;o--){var i=e.Search_move[o];i>0?(i=12-i,n=i>6?i-12:i):i<0?(i=12+i,l=i>6?i-12:i):(n===0&&l===0?r+=" / ":r+=\`(\${n}, \${l}) / \`,n=l=0)}return(n!==0||l!==0)&&(r+=\`(\${n}, \${l})\`),r}function Is(e,t,r,n,l,o){var i,s,a;if(r===0&&n<4)return n===0&&OD(e);if(o!==0&&(a=Gs[t],s=Ve[a],s<n&&(e.Search_move[l]=0,Is(e,a,s,n-1,l+1,0))))return!0;if(a=t,o<=0){for(i=0;i+=Ho[a],a=~~i>>4,i&=15,!(i>=12||(s=Ve[a],s>n));)if(s<n&&(e.Search_move[l]=i,Is(e,a,s,n-1,l+1,1)))return!0}if(a=t,o<=1){for(i=0;i+=Vo[a],a=~~i>>4,i&=15,!(i>=6||(s=Ve[a],s>n));)if(s<n&&(e.Search_move[l]=-i,Is(e,a,s,n-1,l+1,2)))return!0}return!1}function Ts(e,t,r,n,l,o,i,s,a){var f,u,g,c,p,L,m;if(i===0&&!n&&l||a!==0&&n===l&&(g=Jo[t],u=Jo[r],xe[g<<1|1-o]<i&&xe[u<<1|1-o]<i&&(e.Search_move[s]=0,Ts(e,g,u,n,l,1-o,i-1,s+1,0))))return!0;if(a<=0)for(m=!n,g=m?Nn[t]:t,u=m?r:Nn[r],c=m?1:2,p=xe[g<<1|o],L=xe[u<<1|o];c<12&&p<=i&&p<=i;){if(p<i&&L<i&&(e.Search_move[s]=c,Ts(e,g,u,m,l,o,i-1,s+1,1)))return!0;m=!m,m?(g=Nn[g],p=xe[g<<1|o],c+=1):(u=Nn[u],L=xe[u<<1|o],c+=2)}if(a<=1)for(f=!l,g=f?zn[t]:t,u=f?r:zn[r],c=f?1:2,p=xe[g<<1|o],L=xe[u<<1|o];c<(i>3?6:12)&&p<=i&&p<=i;){if(p<i&&L<i&&(e.Search_move[s]=-c,Ts(e,g,u,n,f,o,i-1,s+1,2)))return!0;f=!f,f?(g=zn[g],p=xe[g<<1|o],c+=1):(u=zn[u],L=xe[u<<1|o],c+=2)}return!1}function TD(e,t){var r;for(e.Search_c=t,r=zD(t),e.Search_length1=Ve[r];e.Search_length1<100&&(e.Search_maxlen2=Math.min(31-e.Search_length1,17),!Is(e,r,Ve[r],e.Search_length1,0,-1));++e.Search_length1);return e.Search_sol_string}function wm(){this.Search_move=[],this.Search_d=new z2,this.Search_sq=new _m}function GD(){}function WD(){bm||(bm=!0,qo=[0,3,6,12,15,24,27,30,48,51,54,60,63],Gl=[],Ve=[],Ho=[],Vo=[],Gs=[],jD())}function KD(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((Pn(e.bottom&63)&1)!==0);return(Pn(e.bottom)&2)===0&&(e.Shape_parity^=r),t}function w2(e){var t;return t=zm(Gl,e.top<<12|e.bottom)<<1|e.Shape_parity,t}function k2(e,t){e.Shape_parity=t&1,e.top=Gl[~~t>>1],e.bottom=e.top&4095,e.top>>=12}function QD(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((Pn(e.top&63)&1)!==0);return(Pn(e.top)&2)===0&&(e.Shape_parity^=r),t}function km(){}function jo(e){var t;return t=zm(Gl,e&16777215)<<1|~~e>>24,t}function jD(){var e,t,r,n,l,o,i,s,a,f,u,g,c,p,L,m;for(e=0,i=0;i<28561;++i)o=qo[i%13],r=qo[~~(i/13)%13],g=qo[~~(~~(i/13)/13)%13],u=qo[~~(~~(~~(i/13)/13)/13)],c=u<<18|g<<12|r<<6|o,Pn(c)===16&&(Gl[e++]=c);for(f=new km,i=0;i<7356;++i)k2(f,i),Ho[i]=QD(f),Ho[i]|=w2(f)<<4,k2(f,i),Vo[i]=KD(f),Vo[i]|=w2(f)<<4,k2(f,i),m=f.top&63,p=Pn(m),L=Pn(f.bottom&4032),f.Shape_parity^=1&~~(p&L)>>1,f.top=f.top&4032|~~f.bottom>>6&63,f.bottom=f.bottom&63|m<<6,Gs[i]=w2(f);for(i=0;i<7536;++i)Ve[i]=-1;for(Ve[jo(14378715)]=0,Ve[jo(31157686)]=0,Ve[jo(23967451)]=0,Ve[jo(7191990)]=0,n=4,l=0,t=-1;n!==l;)for(l=n,++t,i=0;i<7536;++i)if(Ve[i]===t){a=0,s=i;do s=Ho[s],a+=s&15,s>>=4,Ve[s]===-1&&(++n,Ve[s]=t+1);while(a!==12);a=0,s=i;do s=Vo[s],a+=s&15,s>>=4,Ve[s]===-1&&(++n,Ve[s]=t+1);while(a!==12);s=Gs[i],Ve[s]===-1&&(++n,Ve[s]=t+1)}}function qD(){}function VD(){if(!Em){Em=!0,xe=[],Jo=[],Nn=[],zn=[],Cm=[1,1,2,6,24,120,720,5040],Cn=[];for(var e=0;e<12;++e)Cn[e]=[];HD()}}function _m(){}function Xo(e){var t,r,n,l;for(r=0,l=1985229328,t=0;t<7;++t)n=e[t]<<2,r=(8-t)*r+(~~l>>n&7),l-=286331152<<n;return r&65535}function HD(){var e,t,r,n,l,o,i,s,a,f,u,g,c;for(l=0;l<12;++l)for(Cn[l][0]=1,Cn[l][l]=1,a=1;a<l;++a)Cn[l][a]=Cn[l-1][a-1]+Cn[l-1][a];for(g=[],l=0;l<40320;++l)_2(g,l),c=g[2],g[2]=g[4],g[4]=c,c=g[3],g[3]=g[5],g[5]=c,Jo[l]=Xo(g),_2(g,l),c=g[0],g[0]=g[1],g[1]=g[2],g[2]=g[3],g[3]=c,Nn[l]=Xo(g),_2(g,l),c=g[4],g[4]=g[5],g[5]=g[6],g[6]=g[7],g[7]=c,zn[l]=Xo(g);for(l=0;l<80640;++l)xe[l]=-1;for(xe[0]=0,t=0,r=1;r<80640;){s=t>=11,n=s?-1:t,e=s?t:-1,++t;e:for(l=0;l<80640;++l)if(xe[l]===n){if(o=~~l>>1,u=l&1,i=Jo[o]<<1|1-u,xe[i]===e&&(++r,xe[s?l:i]=~~(t<<24)>>24,s))continue e;for(i=o,f=0;f<4;++f)if(i=Nn[i],xe[i<<1|u]===e&&(++r,xe[s?l:i<<1|u]=~~(t<<24)>>24,s))continue e;for(f=0;f<4;++f)if(i=zn[i],xe[i<<1|u]===e&&(++r,xe[s?l:i<<1|u]=~~(t<<24)>>24,s))continue e}}}function _2(e,t){var r,n,l,o,i;for(i=1985229328,r=0;r<7;++r)l=Cm[7-r],o=~~(t/l),t-=o*l,o<<=2,e[r]=~~((~~i>>o&7)<<24)>>24,n=(1<<o)-1,i=(i&n)+(~~i>>4&~n);e[7]=~~(i<<24)>>24}function XD(){}function Pn(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 zm(e,t){var r,n,l,o;for(n=0,r=e.length-1;n<=r;)if(l=n+(~~(r-n)>>1),o=e[l],o<t)n=l+1;else if(o>t)r=l-1;else return l;return-n-1}async function eF(){return(await $D()).scramble_string}var _e,bm,Vo,Gl,Ve,Ho,Gs,qo,Em,zn,Cn,xe,Nn,Jo,Cm,C2,JD,ZD,YD,$D,Nm=F(()=>{"use strict";xt();_e=z2.prototype=MD.prototype;_e.dl=10062778;_e.dr=14536702;_e.ml=0;_e.ul=70195;_e.ur=4544119;_e=wm.prototype=GD.prototype;_e.Search_c=null;_e.Search_length1=0;_e.Search_maxlen2=0;_e.Search_sol_string=null;bm=!1;_e=km.prototype=qD.prototype;_e.bottom=0;_e.Shape_parity=0;_e.top=0;Em=!1;_e=_m.prototype=XD.prototype;_e.botEdgeFirst=!1;_e.cornperm=0;_e.edgeperm=0;_e.ml=0;_e.topEdgeFirst=!1;C2=!1,JD=function(e,t,r){C2||(WD(),VD()),r&&r("Done initializing Square-1."),C2=!0,e?.()},ZD=async function(){return C2||JD(),PD()},YD=function(e){var t=new wm;return TD(t,e)},$D=async function(){var e=await ZD(),t=YD(e);return{state:e,scramble_string:t}}});var Pm={};Lt(Pm,{getRandomSquare1ScrambleString:()=>eF});var Mm=F(()=>{"use strict";Nm()});var T2=Symbol("Comlink.proxy"),Vm=Symbol("Comlink.endpoint"),Hm=Symbol("Comlink.releaseProxy"),Qs=Symbol("Comlink.thrown"),G2=e=>typeof e=="object"&&e!==null||typeof e=="function",Xm={canHandle:e=>G2(e)&&e[T2],serialize(e){let{port1:t,port2:r}=new MessageChannel;return Wl(e,t),[r,[r]]},deserialize(e){return e.start(),Ym(e)}},Jm={canHandle:e=>G2(e)&&Qs 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}},W2=new Map([["proxy",Xm],["throw",Jm]]);function Wl(e,t=self){t.addEventListener("message",function r(n){if(!n||!n.data)return;let{id:l,type:o,path:i}=Object.assign({path:[]},n.data),s=(n.data.argumentList||[]).map(Zr),a;try{let f=i.slice(0,-1).reduce((g,c)=>g[c],e),u=i.reduce((g,c)=>g[c],e);switch(o){case"GET":a=u;break;case"SET":f[i.slice(-1)[0]]=Zr(n.data.value),a=!0;break;case"APPLY":a=u.apply(f,s);break;case"CONSTRUCT":{let g=new u(...s);a=tL(g)}break;case"ENDPOINT":{let{port1:g,port2:c}=new MessageChannel;Wl(e,c),a=eL(g,[g])}break;case"RELEASE":a=void 0;break;default:return}}catch(f){a={value:f,[Qs]:0}}Promise.resolve(a).catch(f=>({value:f,[Qs]:0})).then(f=>{let[u,g]=qs(f);t.postMessage(Object.assign(Object.assign({},u),{id:l}),g),o==="RELEASE"&&(t.removeEventListener("message",r),K2(t))})}),t.start&&t.start()}function Zm(e){return e.constructor.name==="MessagePort"}function K2(e){Zm(e)&&e.close()}function Ym(e,t){return js(e,[],t)}function Zo(e){if(e)throw new Error("Proxy has been released and is not useable")}function js(e,t=[],r=function(){}){let n=!1,l=new Proxy(r,{get(o,i){if(Zo(n),i===Hm)return()=>Mn(e,{type:"RELEASE",path:t.map(s=>s.toString())}).then(()=>{K2(e),n=!0});if(i==="then"){if(t.length===0)return{then:()=>l};let s=Mn(e,{type:"GET",path:t.map(a=>a.toString())}).then(Zr);return s.then.bind(s)}return js(e,[...t,i])},set(o,i,s){Zo(n);let[a,f]=qs(s);return Mn(e,{type:"SET",path:[...t,i].map(u=>u.toString()),value:a},f).then(Zr)},apply(o,i,s){Zo(n);let a=t[t.length-1];if(a===Vm)return Mn(e,{type:"ENDPOINT"}).then(Zr);if(a==="bind")return js(e,t.slice(0,-1));let[f,u]=I2(s);return Mn(e,{type:"APPLY",path:t.map(g=>g.toString()),argumentList:f},u).then(Zr)},construct(o,i){Zo(n);let[s,a]=I2(i);return Mn(e,{type:"CONSTRUCT",path:t.map(f=>f.toString()),argumentList:s},a).then(Zr)}});return l}function $m(e){return Array.prototype.concat.apply([],e)}function I2(e){let t=e.map(qs);return[t.map(r=>r[0]),$m(t.map(r=>r[1]))]}var Q2=new WeakMap;function eL(e,t){return Q2.set(e,t),e}function tL(e){return Object.assign(e,{[T2]:!0})}function qs(e){for(let[t,r]of W2)if(r.canHandle(e)){let[n,l]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},l]}return[{type:"RAW",value:e},Q2.get(e)||[]]}function Zr(e){switch(e.type){case"HANDLER":return W2.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Mn(e,t,r){return new Promise(n=>{let l=rL();e.addEventListener("message",function o(i){!i.data||!i.data.id||i.data.id!==l||(e.removeEventListener("message",o),n(i.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:l},t),r)})}function rL(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function nL(e){let t=new WeakMap;return{postMessage:e.postMessage.bind(e),addEventListener:(r,n)=>{let l=o=>{"handleEvent"in n?n.handleEvent({data:o}):n({data:o})};e.on("message",l),t.set(n,l)},removeEventListener:(r,n)=>{let l=t.get(n);!l||(e.off("message",l),t.delete(n))},nodeWorker:e}}var j2=nL;var lL=typeof globalThis.Worker>"u"&&typeof globalThis.WorkerNavigator>"u",oL="node:w-orker-_threa-ds",iL=()=>oL.replace(/-/g,"");async function sL(){let{parentPort:e}=await import(iL()).catch();return j2(e)}function q2(e){lL?(async()=>Wl(e,await sL()))():Wl(e)}We();gr();St();We();gr();xt();St();ae();ae();ae();var Bo=class extends nn{constructor(r){super();this.metric=r}traverseAlg(r){let n=0;for(let l of r.childAlgNodes())n+=this.traverseAlgNode(l);return n}traverseGrouping(r){let n=r.alg;return this.traverseAlg(n)*Math.abs(r.amount)}traverseMove(r){return this.metric(r)}traverseCommutator(r){return 2*(this.traverseAlg(r.A)+this.traverseAlg(r.B))}traverseConjugate(r){return 2*this.traverseAlg(r.A)+this.traverseAlg(r.B)}traversePause(r){return 0}traverseNewline(r){return 0}traverseLineComment(r){return 0}};function xu(e){return"A"<=e&&e<="Z"}function nB(e){let t=e.family;return xu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:1}function lB(e){return 1}function oB(e){let t=e.family;return xu(t[0])&&t[t.length-1]==="v"||t==="x"||t==="y"||t==="z"||t==="T"?0:Math.abs(e.amount)}var ja=kt(Bo,[nB]),iB=kt(Bo,[lB]),sB=kt(Bo,[oB]);ae();ae();var qa=class extends nn{traverseAlg(t){let r=0;for(let n of t.childAlgNodes())r+=this.traverseAlgNode(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}},aB=kt(qa);xt();var fB=2,uB=!0,gB=!1;function cB(e,t){let r=[];return t.forEach(function(n){let l=new B(n);if(l.amount!==1)throw new Error("SGS cannot handle def moves with an amount other than 1 yet.");let o=e.identityTransformation();for(let i=1;o=o.applyMove(l),!o.isIdentityTransformation();i++)r.push({move:l.modified({amount:i}),transformation:o})}),r}var Nt=class{constructor(t,r,n){this.kpuzzle=t;this.sgs=r;this.searchMoves=cB(this.kpuzzle,n??Object.keys(this.kpuzzle.definition.moves))}async solve(t,r=fB,n){let l=t.experimentalToTransformation();if(!l)throw new Error("distinguishable pieces are not supported in tremble solver yt");let o=null,i=1e6,s=(a,f,u)=>{if(f===0){let g=this.sgsPhaseSolve(a,i);if(!g)return;let c=u.concat(g).experimentalSimplify({cancel:{puzzleSpecificModWrap:"canonical-centered"},puzzleSpecificSimplifyOptions:{quantumMoveOrder:n}}),p=ja(c);(o===null||p<i)&&(gB&&(console.log(\`New best (\${p} moves): \${c.toString()}\`),console.log(\`Tremble moves are: \${u.toString()}\`)),o=c,i=p);return}for(let g of this.searchMoves)s(a.applyTransformation(g.transformation),f-1,u.concat([g.move]))};for(let a=0;a<=r;a++)s(l,a,new E);if(o===null)throw new Error("SGS search failed.");return o}sgsPhaseSolve(t,r){let n=new Bt,l=t;for(let o of this.sgs.ordering){let i=o.pieceOrdering,s="",a=l.invert();for(let u=0;u<i.length;u++){let g=i[u],c=g.orbitName,p=g.permutationIdx;s+=\` \${a.transformationData[c].permutation[p]} \${a.transformationData[c].orientation[p]}\`}let f=o.lookup[s];if(!f)throw new Error("Missing algorithm in sgs or esgs?");if(n.experimentalPushAlg(f.alg),n.experimentalNumAlgNodes()>=r)return null;if(l=l.applyTransformation(f.transformation),uB)for(let u=0;u<i.length;u++){let g=i[u],c=g.orbitName,p=g.permutationIdx;if(l.transformationData[c].permutation[p]!==p||l.transformationData[c].orientation[p]!==0)throw new Error("bad SGS :-(")}}return n.toAlg()}};async function Ei(e,t){let r=await cr(),n=e.identityTransformation();for(let l of t.ordering){let o=r(Object.values(l.lookup));n=n.applyTransformation(o.transformation)}return n.toKState()}_t();var ut=Ke(()=>Promise.resolve().then(()=>(Nu(),zu)));var xB=3,Pu=null;async function Mu(){return Pu||(Pu=(async()=>{let e=await(await ut).cachedData222();return new Nt(await Oe["2x2x2"].kpuzzle(),e,"URFLBD".split(""))})())}async function Ou(){await Mu()}async function Za(e){return be(),await(await Mu()).solve(e,xB,()=>4)}async function vB(e,t,r,n){let l=await Ee();await Su(r.stateData[t].pieces);let o=e.definition.orbits[t],i=r.stateData[t].orientation,s=0;for(let a=0;a<o.numPieces;a++){let f=l(o.numOrientations);i[a]=f,s+=f}n&&"orientationSum"in n&&(i[0]=((i[0]+n.orientationSum-s)%o.numOrientations+o.numOrientations)%o.numOrientations)}async function UB(){let e=await Oe["2x2x2"].kpuzzle(),t=new pe(e,JSON.parse(JSON.stringify(e.startState().stateData)));return await vB(e,"CORNERS",t,{orientationSum:0}),t}async function Iu(){return await Za(await UB())}A0();wi();_t();var X0=Ke(()=>Promise.resolve().then(()=>(Qc(),Kc)));var GR=[[null,"x","x2","x'","z","z'"],[null,"y","y2","y'"]];async function jc(){return(await X0).initialize()}async function J0(){return(await X0).random444Scramble()}async function qc(){return il(await J0(),GR)}wi();ae();xt();function WR(e){switch(e){case 5:return 60;case 6:return 80;default:return 100}}var KR=[["U","D"],["L","R"],["F","B"]],Vc=new Map;function QR(e){let t=Vc.get(e);if(t)return t;let r=[];for(let n of KR){let l=[];r.push(l);for(let o of n){l.push(new _(o)),e>3&&l.push(new _(\`\${o}w\`));for(let i=3;i<=e/2;i++)l.push(new _(\`\${o}w\`,i))}}return Vc.set(e,r),r}async function hr(e){let t=await Ee(),r=await cr(),n=r,l=QR(e),o=WR(e),i=new Bt,s=0,a=new Set;for(;i.experimentalNumAlgNodes()<o;){let f=t(3);f!==s&&a.clear(),s=f;let u=r(l[s]),g=u.toString();a.has(g)||(a.add(g),i.push(new B(u,n([1,2,-1]))))}return i.toAlg()}var jR=[[null,"3Rw","3Rw2","3Rw'","3Fw","3Fw'"],[null,"3Dw","3Dw2","3Dw'"]];async function Hc(){return il(await hr(5),jR)}ae();gr();_t();St();_t();var bp=Ke(()=>Promise.resolve().then(()=>(Up(),vp)));var Ix=Ke(()=>Promise.resolve().then(()=>(B2(),L2)));async function Wp(){return be(),new E(await(await bp).randomFTOScrambleString())}St();_t();var tm=Ke(()=>Promise.resolve().then(()=>(em(),$p)));async function rm(){return be(),(await tm).getRandomKilominxScramble()}ae();St();_t();var dm=Ke(()=>Promise.resolve().then(()=>(Bm(),Lm)));async function Rm(){return be(),new E(await(await dm).randomMasterTetraminxScrambleString())}We();St();var AD=2,hm=null;async function SD(){return hm||(hm=(async()=>{let e=await(await ut).cachedSGSDataMegaminx();return new Nt(await(await ut).cachedMegaminxKPuzzleWithoutMO(),e,["U","R","F","L","BR","BL","FR","FL","DR","DL","B","D"])})())}async function Dm(e){be();let t=await SD(),r=JSON.parse(JSON.stringify(e.stateData));r.CENTERS.orientation=new Array(12).fill(0);let n=new pe(await(await ut).cachedMegaminxKPuzzleWithoutMO(),r);return await t.solve(n,AD,()=>5)}gr();St();var xD=3,Fm=null;async function vD(){return Fm||(Fm=(async()=>{let e=await(await ut).sgsDataPyraminx();return new Nt(await Oe.pyraminx.kpuzzle(),e,"RLUB".split(""))})())}async function U2(e){return be(),await(await vD()).solve(e,xD,()=>3)}async function UD(){return be(),Ei(await Oe.pyraminx.kpuzzle(),await(await ut).sgsDataPyraminxFixedOrientation())}async function ym(){return U2(await UD())}St();_t();var Am=Ke(()=>Promise.resolve().then(()=>(B2(),L2)));async function Sm(){return be(),(await Am).getRandomRediCubeScramble()}We();St();var bD=3,xm=null;async function ED(){return xm||(xm=(async()=>{let e=await(await ut).sgsDataSkewb();return new Nt(await(await ut).skewbKPuzzleWithoutMOCached(),e,"RLUB".split(""))})())}function wD(e){return new pe(e.kpuzzle,{CORNERS:e.stateData.CORNERS,CENTERS:{pieces:e.stateData.CENTERS.pieces,orientation:new Array(6).fill(0)}})}async function b2(e){return be(),await(await ED()).solve(wD(e),bD,n=>n.family==="y"?4:3)}async function kD(){return Ei(await(await ut).skewbKPuzzleWithoutMOCached(),await(await ut).sgsDataSkewbFixedCorner())}async function vm(){return b2(await kD())}ae();_t();var Om=Ke(()=>Promise.resolve().then(()=>(Mm(),Pm)));async function Im(){return E.fromString(await(await Om).getRandomSquare1ScrambleString())}var tF=1e3;hu(!0);var Wm=!0;function rF(e){Wm=e}function Tm(){return(typeof performance>"u"?Date:performance).now()}async function Ce(e,t,r){if(!Wm)return t();let n=Tm(),l=t();l?.then&&await l;let o=Tm();return console.warn(\`\${e}\${r?.isPrefetch?" (prefetched)":""}: \${Math.round(o-n)}ms\`),l}var N2=new Map,P2=null;async function Gm(e,t){switch(e){case"222":return Ce("random222Scramble",Iu,{isPrefetch:t?.isPrefetch});case"333":case"333oh":case"333ft":return Ce("random333Scramble",Rl,{isPrefetch:t?.isPrefetch});case"333fm":return Ce("random333FewestMovesScramble",Cg);case"333bf":case"333mb":return Ce("random333OrientedScramble",_g);case"444":return Ce("random444Scramble",J0,{isPrefetch:t?.isPrefetch});case"444bf":return Ce("random444OrientedScramble",qc);case"555":return Ce("bigCubeScramble(5)",hr.bind(hr,5));case"555bf":return Ce("oriented555RandomMoves",Hc);case"666":return Ce("bigCubeScramble(6)",hr.bind(hr,6));case"777":return Ce("bigCubeScramble(7)",hr.bind(hr,7));case"skewb":return Ce("randomSkewbFixedCornerScramble",vm);case"pyram":return Ce("randomPyraminxScrambleFixedOrientation",ym);case"sq1":return Ce("getRandomSquare1Scramble",Im,{isPrefetch:t?.isPrefetch});case"fto":return Ce("randomFTOScramble",Wp,{isPrefetch:t?.isPrefetch});case"master_tetraminx":return Ce("randomMasterTetraminxScramble",Rm);case"kilominx":return Ce("randomKilominxScramble",rm,{isPrefetch:t?.isPrefetch});case"redi_cube":return Ce("randomRediCubeScramble",Sm,{isPrefetch:t?.isPrefetch});default:throw new Error(\`unsupported event: \${e}\`)}}var M2="auto",O2={initialize:async e=>{switch(e){case"222":return Ce("preInitialize222",Ou);case"333":case"333oh":case"333ft":return Ce("initialize333",kg);case"444":return Ce("initialize444",jc);default:throw new Error(\`unsupported event: \${e}\`)}},setScramblePrefetchLevel(e){M2=e},randomScrambleForEvent:async e=>{let t=N2.get(e);return t?N2.delete(e):t=Gm(e),M2!=="none"&&t.then(()=>{P2&&clearTimeout(P2),P2=setTimeout(()=>{N2.set(e,Gm(e,{isPrefetch:!0}))},M2==="immediate"?0:tF)}),t},randomScrambleStringForEvent:async e=>(await O2.randomScrambleForEvent(e)).toString(),solve333ToString:async e=>{let t=new pe(await Oe["3x3x3"].kpuzzle(),e);return(await y0(t)).toString()},solve222ToString:async e=>{let t=new pe(await Oe["2x2x2"].kpuzzle(),e);return(await Za(t)).toString()},solveSkewbToString:async e=>{let t=new pe(await Oe.skewb.kpuzzle(),e);return(await b2(t)).toString()},solvePyraminxToString:async e=>{let t=new pe(await Oe.pyraminx.kpuzzle(),e);return(await U2(t)).toString()},solveMegaminxToString:async e=>{let t=new pe(await Oe.megaminx.kpuzzle(),e);return(await Dm(t)).toString()},setDebugMeasurePerf:async e=>{rF(e)}};q2(O2);
4059
4059
  `;
4060
4060
  export {
4061
4061
  workerSource
4062
4062
  };
4063
- //# sourceMappingURL=search-worker-inside-generated-string-EUP7QHNR.js.map
4063
+ //# sourceMappingURL=search-worker-inside-generated-string-5LNQXZJU.js.map