diff --git a/dist/assets/Cube.worker-BFklK0dH.js b/dist/assets/Cube.worker-BFklK0dH.js deleted file mode 100644 index 041eeb2..0000000 --- a/dist/assets/Cube.worker-BFklK0dH.js +++ /dev/null @@ -1 +0,0 @@ -var Wt=Object.defineProperty;var dt=F=>{throw TypeError(F)};var Jt=(F,h,p)=>h in F?Wt(F,h,{enumerable:!0,configurable:!0,writable:!0,value:p}):F[h]=p;var C=(F,h,p)=>Jt(F,typeof h!="symbol"?h+"":h,p),ot=(F,h,p)=>h.has(F)||dt("Cannot "+p);var l=(F,h,p)=>(ot(F,h,"read from private field"),p?p.call(F):h.get(F)),I=(F,h,p)=>h.has(F)?dt("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(F):h.set(F,p),it=(F,h,p,P)=>(ot(F,h,"write to private field"),P?P.call(F,p):h.set(F,p),p),ct=(F,h,p)=>(ot(F,h,"access private method"),p);(function(){"use strict";var Q,ut,_,ft,M,O,k,E,N;const F={R:["DRF","ULF","ULB","URF","DRB","DLF","DLB","URB"],L:["URF","ULB","DLB","URB","DRF","ULF","DLF","DRB"],U:["URB","URF","ULF","ULB","DRF","DLF","DLB","DRB"],D:["URF","ULF","ULB","URB","DLF","DLB","DRB","DRF"],F:["ULF","DLF","ULB","URB","URF","DRF","DLB","DRB"],B:["URF","ULF","URB","DRB","DRF","DLF","ULB","DLB"]},h={R:[2,0,0,1,1,0,0,2],L:[0,1,2,0,0,2,1,0],U:[0,0,0,0,0,0,0,0],D:[0,0,0,0,0,0,0,0],F:[1,2,0,0,2,1,0,0],B:[0,0,1,2,0,0,2,1]},p={URF:{URF:{0:[],1:["R","U"],2:["F'","U'"]},ULF:{0:["U"],1:["R","U2"],2:["F'"]},ULB:{0:["U2"],1:["R","U'"],2:["F'","U"]},URB:{0:["U'"],1:["R"],2:["F'","U2"]},DRF:{0:["R2","D'"],1:["R'"],2:["F"]},DLF:{0:["F2"],1:["R'","D'"],2:["F","D'"]},DLB:{0:["R2","D"],1:["R'","D2"],2:["F","D2"]},DRB:{0:["R2"],1:["R'","D"],2:["F","D"]}},ULF:{URF:{0:["U'"],1:["F"],2:["L'","U2"]},ULF:{0:[],1:["F","U"],2:["L'","U'"]},ULB:{0:["U"],1:["F","U2"],2:["L'"]},URB:{0:["U2"],1:["F","U'"],2:["L'","U"]},DRF:{0:["F2"],1:["F'","D"],2:["L","D"]},DLF:{0:["L2","D"],1:["F'"],2:["L"]},DLB:{0:["L2"],1:["F'","D'"],2:["L","D'"]},DRB:{0:["L2","D'"],1:["F'","D2"],2:["L","D2"]}},ULB:{URF:{0:["U2"],1:["L","U'"],2:["B'","U"]},ULF:{0:["U'"],1:["L"],2:["B'","U2"]},ULB:{0:[],1:["L","U"],2:["B'","U'"]},URB:{0:["U"],1:["L","U2"],2:["B'"]},DRF:{0:["L2","D"],1:["L'","D2"],2:["B","D2"]},DLF:{0:["L2"],1:["L'","D"],2:["B","D"]},DLB:{0:["L2","D"],1:["L'"],2:["B"]},DRB:{0:["B2"],1:["L'","D'"],2:["B","D'"]}},URB:{URF:{0:["U"],1:["B","U2"],2:["R'"]},ULF:{0:["U2"],1:["B","U'"],2:["R'","U"]},ULB:{0:["U'"],1:["B"],2:["R'","U2"]},URB:{0:[],1:["B","U"],2:["R'","U'"]},DRF:{0:["R2"],1:["B'","D'"],2:["R","D'"]},DLF:{0:["R2","D'"],1:["B'","D2"],2:["R","D2"]},DLB:{0:["B2"],1:["B'","D"],2:["R","D"]},DRB:{0:["R2","D"],1:["B'"],2:["R"]}},DRF:{URF:{0:["R2","U"],1:["F'"],2:["R"]},ULF:{0:["F2"],1:["F'","U"],2:["R","U"]},ULB:{0:["R2","U'"],1:["F'","U2"],2:["R","U2"]},URB:{0:["R2"],1:["F'","U'"],2:["R","U'"]},DRF:{0:[],1:["F","D"],2:["R'","D'"]},DLF:{0:["D'"],1:["F"],2:["R'","D2"]},DLB:{0:["D2"],1:["F","D'"],2:["R'","D"]},DRB:{0:["D"],1:["F","D2"],2:["R'"]}},DLF:{URF:{0:["F2"],1:["L'","U'"],2:["F","U'"]},ULF:{0:["L2","U'"],1:["L'"],2:["F"]},ULB:{0:["L2"],1:["L'","U"],2:["F","U"]},URB:{0:["L2","U"],1:["L'","U2"],2:["F","U2"]},DRF:{0:["D"],1:["L","D2"],2:["F'"]},DLF:{0:[],1:["L","D"],2:["F'","D'"]},DLB:{0:["D'"],1:["L"],2:["F'","D2"]},DRB:{0:["D2"],1:["L","D'"],2:["F'","D"]}},DLB:{URF:{0:["L2","U'"],1:["B'","U2"],2:["L","U2"]},ULF:{0:["L2"],1:["B'","U'"],2:["L","U'"]},ULB:{0:["L2","U"],1:["B'"],2:["L"]},URB:{0:["B2"],1:["B'","U"],2:["L","U"]},DRF:{0:["D2"],1:["B","D'"],2:["L'","D"]},DLF:{0:["D"],1:["B","D2"],2:["L'"]},DLB:{0:[],1:["B","D"],2:["L'","D'"]},DRB:{0:["D'"],1:["B"],2:["L'","D2"]}},DRB:{URF:{0:["R2"],1:["R'","U"],2:["B","U"]},ULF:{0:["R2","U"],1:["R'","U2"],2:["B","U2"]},ULB:{0:["B2"],1:["R'","U'"],2:["B","U'"]},URB:{0:["R2","U'"],1:["R'"],2:["B"]},DRF:{0:["D'"],1:["R"],2:["B'","D2"]},DLF:{0:["D2"],1:["R","D'"],2:["B'","D"]},DLB:{0:["D"],1:["R","D2"],2:["B'"]},DRB:{0:[],1:["R","D"],2:["B'","D'"]}}},P=[6,8,26,24,0,2,20,18],S=class S{constructor(){I(this,Q);C(this,"permutation",[...S.order]);C(this,"orientation",[0,0,0,0,0,0,0,0])}applyTurn(t){const e=F[t],r=h[t],s=[...this.permutation],o=[...this.orientation];for(let i=0;i<8;i++){const a=e[i],R=S.order.indexOf(a);this.permutation[i]=s[R];const L=(r[i]+o[R])%3;this.orientation[i]=L}}applyState(t,e){for(let r=0;r<8;r++){const s=ct(this,Q,ut).call(this,r),o=P[S.order.indexOf(this.permutation[r])];let i=Ft(o,t);i=ht(o,i,s);const a=P[r];Lt(a,e,i)}}reset(){this.permutation=[...S.order],this.orientation=[0,0,0,0,0,0,0,0]}encode(){let t=0;for(const r of this.permutation)t=t<<3,t+=S.order.indexOf(r);let e=0;for(const r of this.orientation)e=e<<2,e+=r;return[t>>0&255,t>>8&255,t>>16&255,e>>0&255,e>>8&255]}decode(t){let e=t[0]+(t[1]<<8)+(t[2]<<16),r=t[3]+(t[4]<<8);for(let s=7;s>=0;s--){const o=e&7;if(o>=8)return!1;this.permutation[s]=S.order[o],e=e>>3;const i=r&3;if(i>2)return!1;this.orientation[s]=i,r=r>>2}return!0}};Q=new WeakSet,ut=function(t){const e=S.order[t],r=this.permutation[t],s=this.orientation[t];return p[r][e][s]},C(S,"order",["URF","ULF","ULB","URB","DRF","DLF","DLB","DRB"]);let et=S;const pt={R:["UF","UL","UB","FR","DR","FL","BL","UR","DF","DL","DB","BR"],L:["UF","BL","UB","UR","FR","UL","DL","BR","DF","FL","DB","DR"],U:["UR","UF","UL","UB","FR","FL","BL","BR","DF","DL","DB","DR"],D:["UF","UL","UB","UR","FR","FL","BL","BR","DL","DB","DR","DF"],F:["FL","UL","UB","UR","UF","DF","BL","BR","FR","DL","DB","DR"],B:["UF","UL","BR","UR","FR","FL","UB","DB","DF","DL","BL","DR"]},wt={R:[0,0,0,0,0,0,0,0,0,0,0,0],L:[0,0,0,0,0,0,0,0,0,0,0,0],U:[0,0,0,0,0,0,0,0,0,0,0,0],D:[0,0,0,0,0,0,0,0,0,0,0,0],F:[1,0,0,0,1,1,0,0,1,0,0,0],B:[0,0,1,0,0,0,1,1,0,0,1,0]},yt={UF:{UF:{0:[],1:["F","R","U"]},UL:{0:["U"],1:["F'","L'"]},UB:{0:["U2"],1:["F","R","U'"]},UR:{0:["U'"],1:["F","R"]},FR:{0:["U'","R'"],1:["F"]},FL:{0:["U","L"],1:["F'"]},BL:{0:["U","L'"],1:["U2","B"]},BR:{0:["U'","R"],1:["U2","B'"]},DF:{0:["F2"],1:["F","R'","D'"]},DL:{0:["F2","D'"],1:["F'","L"]},DB:{0:["F2","D2"],1:["F","R'","D"]},DR:{0:["F2","D"],1:["F","R'"]}},UL:{UF:{0:["U'"],1:["L","F"]},UL:{0:[],1:["L","F","U"]},UB:{0:["U"],1:["L'","B'"]},UR:{0:["U2"],1:["L","F","U'"]},FR:{0:["U2","R'"],1:["U'","F"]},FL:{0:["L"],1:["U'","F'"]},BL:{0:["L'"],1:["U","B"]},BR:{0:["U2","R"],1:["U","B'"]},DF:{0:["L2","D"],1:["L","F'"]},DL:{0:["L2"],1:["L","F'","D'"]},DB:{0:["L2","D'"],1:["L'","B"]},DR:{0:["L2","D2"],1:["L","F'","D"]}},UB:{UF:{0:["U2"],1:["B'","R'","U"]},UL:{0:["U'"],1:["B","L"]},UB:{0:[],1:["B'","R'","U'"]},UR:{0:["U"],1:["B'","R'"]},FR:{0:["U","R'"],1:["B'","R2"]},FL:{0:["U'","L"],1:["B","L2"]},BL:{0:["U'","L'"],1:["B"]},BR:{0:["U","R"],1:["B'"]},DF:{0:["B2","D2"],1:["B'","R","D'"]},DL:{0:["B2","D"],1:["B","L'"]},DB:{0:["B2"],1:["B'","R","D"]},DR:{0:["B2","D'"],1:["B'","R"]}},UR:{UF:{0:["U"],1:["R'","F'"]},UL:{0:["U2"],1:["R'","F'","U"]},UB:{0:["U'"],1:["R","B"]},UR:{0:[],1:["R'","F'","U'"]},FR:{0:["R'"],1:["U","F"]},FL:{0:["U2","L"],1:["U","F'"]},BL:{0:["U2","L'"],1:["U'","B"]},BR:{0:["R"],1:["U'","B'"]},DF:{0:["R2","D'"],1:["R'","F"]},DL:{0:["R2","D2"],1:["R'","F","D'"]},DB:{0:["R2","D"],1:["R","B'"]},DR:{0:["R2"],1:["R'","F","D"]}},FR:{UF:{0:["R","U"],1:["F'"]},UL:{0:["R","U2"],1:["F'","U"]},UB:{0:["R","U'"],1:["F'","U2"]},UR:{0:["R"],1:["F'","U'"]},FR:{0:[],1:["F'","U'","R'"]},FL:{0:["F2"],1:["F'","U","L"]},BL:{0:["F2","L2"],1:["F'","U","L'"]},BR:{0:["R2"],1:["F'","U'","R"]},DF:{0:["R'","D'"],1:["F"]},DL:{0:["R'","D2"],1:["F","D'"]},DB:{0:["R'","D"],1:["F","D2"]},DR:{0:["R'"],1:["F","D"]}},FL:{UF:{0:["L'","U'"],1:["F"]},UL:{0:["L'"],1:["F","U"]},UB:{0:["L'","U"],1:["F","U2"]},UR:{0:["L'","U2"],1:["F","U'"]},FR:{0:["F2"],1:["F","U'","R'"]},FL:{0:[],1:["F","U","L"]},BL:{0:["L2"],1:["F","U","L'"]},BR:{0:["F2","R2"],1:["F","U'","R"]},DF:{0:["L","D"],1:["F'"]},DL:{0:["L"],1:["F'","D'"]},DB:{0:["L","D'"],1:["F'","D2"]},DR:{0:["L","D2"],1:["F'","D"]}},BL:{UF:{0:["L","U'"],1:["B'","U2"]},UL:{0:["L"],1:["B'","U'"]},UB:{0:["L","U"],1:["B'"]},UR:{0:["L","U2"],1:["B'","U"]},FR:{0:["B2","R2"],1:["B'","U","R'"]},FL:{0:["L2"],1:["B'","U'","L"]},BL:{0:[],1:["B'","U'","L'"]},BR:{0:["B2"],1:["B'","U","R"]},DF:{0:["L'","D"],1:["B","D2"]},DL:{0:["L'"],1:["B","D"]},DB:{0:["L'","D'"],1:["B"]},DR:{0:["L'","D2"],1:["B","D'"]}},BR:{UF:{0:["R'","U"],1:["B","U2"]},UL:{0:["R'","U2"],1:["B","U'"]},UB:{0:["R'","U'"],1:["B"]},UR:{0:["R'"],1:["B","U"]},FR:{0:["R2"],1:["B","U","R'"]},FL:{0:["B2","L2"],1:["B","U'","L"]},BL:{0:["B2"],1:["B","U'","L'"]},BR:{0:[],1:["B","U","R"]},DF:{0:["R","D'"],1:["B'","D2"]},DL:{0:["R","D2"],1:["B'","D"]},DB:{0:["R","D"],1:["B'"]},DR:{0:["R"],1:["B'","D'"]}},DF:{UF:{0:["F2"],1:["F'","R","U"]},UL:{0:["F2","U"],1:["F","L'"]},UB:{0:["F2","U2"],1:["F'","R","U'"]},UR:{0:["F2","U'"],1:["F'","R"]},FR:{0:["D","R"],1:["F'"]},FL:{0:["D'","L'"],1:["F"]},BL:{0:["D'","L"],1:["D2","B'"]},BR:{0:["D","R'"],1:["D2","B"]},DF:{0:[],1:["F'","R'","D'"]},DL:{0:["D'"],1:["F","L"]},DB:{0:["D2"],1:["F'","R'","D"]},DR:{0:["D"],1:["F'","R'"]}},DL:{UF:{0:["L2","U'"],1:["L'","F"]},UL:{0:["L2"],1:["L'","F","U"]},UB:{0:["L2","U"],1:["L","B'"]},UR:{0:["L2","U2"],1:["L'","F","U'"]},FR:{0:["D2","R"],1:["D","F'"]},FL:{0:["L'"],1:["D","F"]},BL:{0:["L"],1:["D'","B'"]},BR:{0:["D2","R'"],1:["D'","B"]},DF:{0:["D"],1:["L'","F'"]},DL:{0:[],1:["L'","F'","D'"]},DB:{0:["D'"],1:["L","B"]},DR:{0:["D2"],1:["L'","F'","D"]}},DB:{UF:{0:["B2","U2"],1:["B","R'","U"]},UL:{0:["B2","U'"],1:["B'","L"]},UB:{0:["B2"],1:["B","R'","U'"]},UR:{0:["B2","U"],1:["B","R'"]},FR:{0:["D'","R"],1:["D2","F'"]},FL:{0:["D","L'"],1:["D2","F"]},BL:{0:["D","L"],1:["B'"]},BR:{0:["D'","R'"],1:["B"]},DF:{0:["D2"],1:["B","R","D'"]},DL:{0:["D"],1:["B'","L'"]},DB:{0:[],1:["B","R","D"]},DR:{0:["D'"],1:["B","R"]}},DR:{UF:{0:["R2","U"],1:["R","F'"]},UL:{0:["R2","U2"],1:["R","F'","U"]},UB:{0:["R2","U'"],1:["R'","B"]},UR:{0:["R2"],1:["R","F'","U'"]},FR:{0:["R"],1:["D'","F'"]},FL:{0:["D2","L'"],1:["D'","F"]},BL:{0:["D2","L"],1:["D","B'"]},BR:{0:["R'"],1:["D","B"]},DF:{0:["D'"],1:["R","F"]},DL:{0:["D2"],1:["R","F","D'"]},DB:{0:["D"],1:["R'","B'"]},DR:{0:[],1:["R","F","D"]}}},at=[7,17,25,15,3,5,23,21,1,11,19,9],A=class A{constructor(){I(this,_);C(this,"permutation",[...A.order]);C(this,"orientation",[0,0,0,0,0,0,0,0,0,0,0,0])}applyTurn(t){const e=pt[t],r=wt[t],s=[...this.permutation],o=[...this.orientation];for(let i=0;i<12;i++){const a=e[i],R=A.order.indexOf(a);this.permutation[i]=s[R];const L=(r[i]+o[R])%2;this.orientation[i]=L}}applyState(t,e){for(let r=0;r<12;r++){const s=ct(this,_,ft).call(this,r),o=at[A.order.indexOf(this.permutation[r])];let i=Ft(o,t);i=ht(o,i,s);const a=at[r];Lt(a,e,i)}}reset(){this.permutation=[...A.order],this.orientation=[0,0,0,0,0,0,0,0,0,0,0,0]}encode(){let t=[];for(let r=0;r<6;r++){const s=A.order.indexOf(this.permutation[r*2]),o=A.order.indexOf(this.permutation[r*2+1]);t.push((o<<4)+s)}let e=0;for(const r of this.orientation)e=e<<1,e+=r;return[...t,e>>0&255,e>>8&255]}decode(t){for(let r=0;r<6;r++){const s=t[r]&15,o=t[r]>>4&15;if(s>=12||o>=12)return!1;this.permutation[r*2]=A.order[s],this.permutation[r*2+1]=A.order[o]}let e=t[6]+(t[7]<<8);for(let r=11;r>=0;r--)this.orientation[r]=e&1,e=e>>1;return!0}};_=new WeakSet,ft=function(t){const e=A.order[t],r=this.permutation[t],s=this.orientation[t];return yt[r][e][s]},C(A,"order",["UF","UL","UB","UR","FR","FL","BL","BR","DF","DL","DB","DR"]);let rt=A;const V=(n,t)=>(n%t+t)%t,gt=[12,14,10,16,4,22],tt=class tt{constructor(){C(this,"orientation",[0,0,0,0,0,0])}applyTurn(t){const e=tt.order.indexOf(t);this.orientation[e]=V(this.orientation[e]+1,4)}applyState(t,e){for(let r=0;r<6;r++){const s=t[r][4],o=this.orientation[r]*2,i=gt[r],a=e.cubies[i].getFaceletOfSide(r);a.uvs=[];for(let R=0;R<8;R++)a.uvs[R]=s[V(o+R,8)]}}reset(){this.orientation=[0,0,0,0,0,0]}encode(){let t=0;for(const e of this.orientation)t=t<<2,t+=e;return[t>>0&255,t>>8&255]}decode(t){let e=t[0]+(t[1]<<8);for(let r=5;r>=0;r--)this.orientation[r]=e&3,e=e>>2}};C(tt,"order",["R","L","D","U","F","B"]);let st=tt;const mt={R:[0,0,!1],L:[0,2,!1],D:[1,0,!0],U:[1,2,!0],F:[2,0,!1],B:[2,2,!1]},xt=n=>{const t=n[0],[e,r,s]=mt[t];if(n.endsWith("2"))return{axis:e,index:r,angle:2};let o=n.endsWith("'");s&&(o=!o);let i=3;return(r===0&&!o||r===2&&o)&&(i=1),{axis:e,index:r,angle:i}},bt=n=>{const t=n[0];return n.endsWith("2")?[t,t]:n.endsWith("'")?[t,t,t]:[t]},d={identity:n=>[...n],flipH:n=>[n[6],n[7],n[4],n[5],n[2],n[3],n[0],n[1]],flipV:n=>[n[2],n[3],n[0],n[1],n[6],n[7],n[4],n[5]],rotateCC:n=>[n[6],n[7],n[0],n[1],n[2],n[3],n[4],n[5]],rotateC:n=>[n[2],n[3],n[4],n[5],n[6],n[7],n[0],n[1]],rotate2:n=>[n[4],n[5],n[6],n[7],n[0],n[1],n[2],n[3]],rotateCFlipH:n=>[n[0],n[1],n[6],n[7],n[4],n[5],n[2],n[3]]},w={flipV12:{1:d.flipV,2:d.flipV,3:d.identity},flipV23:{1:d.identity,2:d.flipV,3:d.flipV},flipH12:{1:d.flipH,2:d.flipH,3:d.identity},flipH23:{1:d.identity,2:d.flipH,3:d.flipH},rcFvRcfh:{1:d.rotateC,2:d.flipV,3:d.rotateCFlipH},rcfhFhRcc:{1:d.rotateCFlipH,2:d.flipH,3:d.rotateCC},rcR2Rcc:{1:d.rotateC,2:d.rotate2,3:d.rotateCC}},Ut={0:{0:[0,3,6,15,24,21,18,9],2:[2,5,8,17,26,23,20,11]},1:{0:[0,1,2,11,20,19,18,9],2:[6,7,8,17,26,25,24,15]},2:{0:[0,1,2,5,8,7,6,3],2:[18,19,20,23,26,25,24,21]}},Rt=[[2,5,3,4],[0,5,1,4],[0,3,1,2]];class nt{scale(t){throw new Error("must be implemented in subclass")}add(t){throw new Error("must be implemented in subclass")}sub(t){throw new Error("must be implemented in subclass")}mult(t){throw new Error("must be implemented in subclass")}dot(t){throw new Error("must be implemented in subclass")}toArray(){throw new Error("must be implemented in subclass")}get squareMag(){const t=this;return this.dot(t)}get mag(){return Math.sqrt(this.squareMag)}get normalized(){return this.scale(1/this.mag)}get negate(){return this.scale(-1)}}class H extends nt{constructor(t,e){super(),this.x=t,this.y=e}scale(t){return new H(t*this.x,t*this.y)}add({x:t,y:e}){return new H(this.x+t,this.y+e)}sub({x:t,y:e}){return new H(this.x-t,this.y-e)}mult({x:t,y:e}){return new H(this.x*t,this.y*e)}dot({x:t,y:e}){return this.x*t+this.y*e}toArray(){return[this.x,this.y]}setUniform(t,e){t.uniform2f(e,this.x,this.y)}static get zero(){return new H(0,0)}}class D extends nt{constructor(t,e,r){super(),this.x=t,this.y=e,this.z=r}scale(t){return new D(t*this.x,t*this.y,t*this.z)}add({x:t,y:e,z:r}){return new D(this.x+t,this.y+e,this.z+r)}sub({x:t,y:e,z:r}){return new D(this.x-t,this.y-e,this.z-r)}mult({x:t,y:e,z:r}){return new D(this.x*t,this.y*e,this.z*r)}cross({x:t,y:e,z:r}){return new D(this.y*r-this.z*e,this.z*t-this.x*r,this.x*e-this.y*t)}dot({x:t,y:e,z:r}){return this.x*t+this.y*e+this.z*r}toArray(){return[this.x,this.y,this.z]}setUniform(t,e){t.uniform3f(e,this.x,this.y,this.z)}toV2(){return new H(this.x,this.y)}static get zero(){return new D(0,0,0)}static get one(){return new D(1,1,1)}static get up(){return new D(0,1,0)}static get down(){return new D(0,-1,0)}static get left(){return new D(1,0,0)}static get right(){return new D(-1,0,0)}static get forward(){return new D(0,0,1)}static get back(){return new D(0,0,-1)}static lerp(t,e,r){return t.add(e.sub(t).scale(r))}static angle(t,e){return Math.acos(t.dot(e)/Math.sqrt(t.squareMag*e.squareMag))}static getRotationAxis(t){return t===0?D.right:t===1?D.down:D.back}}class U extends nt{constructor(t,e,r,s){super(),this.x=t,this.y=e,this.z=r,this.w=s}scale(t){return new U(t*this.x,t*this.y,t*this.z,t*this.w)}add({x:t,y:e,z:r,w:s}){return new U(this.x+t,this.y+e,this.z+r,this.w+s)}sub({x:t,y:e,z:r,w:s}){return new U(this.x-t,this.y-e,this.z-r,this.w-s)}mult({x:t,y:e,z:r,w:s}){return new U(this.x*t,this.y*e,this.z*r,this.w*s)}dot({x:t,y:e,z:r,w:s}){return this.x*t+this.y*e+this.z*r+this.w*s}toV3(){return new D(this.x,this.y,this.z)}toArray(){return[this.x,this.y,this.z,this.w]}setUniform(t,e){t.uniform4f(e,this.x,this.y,this.z,this.w)}}class T{constructor(t,e,r,s){this.r1=t,this.r2=e,this.r3=r,this.r4=s}scale(t){return new T(this.r1.scale(t),this.r2.scale(t),this.r3.scale(t),this.r4.scale(t))}add({r1:t,r2:e,r3:r,r4:s}){return new T(this.r1.add(t),this.r2.add(e),this.r3.add(r),this.r4.add(s))}sub({r1:t,r2:e,r3:r,r4:s}){return new T(this.r1.sub(t),this.r2.sub(e),this.r3.sub(r),this.r4.sub(s))}mult(t){return"x"in t?new U(this.r1.dot(t),this.r2.dot(t),this.r3.dot(t),this.r4.dot(t)):new T(new U(this.r1.dot(t.c1),this.r1.dot(t.c2),this.r1.dot(t.c3),this.r1.dot(t.c4)),new U(this.r2.dot(t.c1),this.r2.dot(t.c2),this.r2.dot(t.c3),this.r2.dot(t.c4)),new U(this.r3.dot(t.c1),this.r3.dot(t.c2),this.r3.dot(t.c3),this.r3.dot(t.c4)),new U(this.r4.dot(t.c1),this.r4.dot(t.c2),this.r4.dot(t.c3),this.r4.dot(t.c4)))}toArray(){return[...this.r1.toArray(),...this.r2.toArray(),...this.r3.toArray(),...this.r4.toArray()]}static get identity(){return new T(new U(1,0,0,0),new U(0,1,0,0),new U(0,0,1,0),new U(0,0,0,1))}get c1(){return new U(this.r1.x,this.r2.x,this.r3.x,this.r4.x)}get c2(){return new U(this.r1.y,this.r2.y,this.r3.y,this.r4.y)}get c3(){return new U(this.r1.z,this.r2.z,this.r3.z,this.r4.z)}get c4(){return new U(this.r1.w,this.r2.w,this.r3.w,this.r4.w)}setUniform(t,e){const r=new Float32Array(this.toArray());t.uniformMatrix4fv(e,!0,r)}get transpose(){return new T(this.c1,this.c2,this.c3,this.c4)}get inverse(){const[t,e,r,s]=this.r1.toArray(),[o,i,a,R]=this.r2.toArray(),[L,u,y,c]=this.r3.toArray(),[B,g,f,b]=this.r4.toArray(),z=t*i-o*e,x=t*a-o*r,$=t*R-o*s,q=e*a-i*r,W=e*R-i*s,J=r*R-a*s,j=y*b-f*c,G=u*b-g*c,Y=u*f-g*y,K=L*b-B*c,X=L*f-B*y,Z=L*g-B*u,qt=1/(z*j-x*G+$*Y+q*K-W*X+J*Z);return new T(new U(i*j-a*G+R*Y,-e*j+r*G-s*Y,g*J-f*W+b*q,-u*J+y*W-c*q),new U(-o*j+a*K-R*X,t*j-r*K+s*X,-B*J+f*$-b*x,L*J-y*$+c*x),new U(o*G-i*K+R*Z,-t*G+e*K-s*Z,B*W-g*$+b*z,-L*W+u*$-c*z),new U(-o*Y+i*X-a*Z,t*Y-e*X+r*Z,-B*q+g*x-f*z,L*q-u*x+y*z)).scale(qt)}static perspective(t,e,r,s){const o=Math.tan(t/2),i=1/(e*o),a=1/o,R=s+r,L=s-r,u=.5/r,y=.5/s,c=-R/L,B=1/(y-u);return new T(new U(i,0,0,0),new U(0,a,0,0),new U(0,0,c,B),new U(0,0,-1,0))}static lookAt(t,e,r){const s=e.sub(t).normalized,o=s.cross(r).normalized,i=o.cross(s),a=-o.dot(t),R=-i.dot(t),L=s.dot(t);return new T(new U(o.x,o.y,o.z,a),new U(i.x,i.y,i.z,R),new U(-s.x,-s.y,-s.z,L),new U(0,0,0,1))}}class m{constructor(t,e){this.real=t,this.im=e}static fromAngle(t,e,r=!0){r&&(e*=Math.PI/180);const s=e/2,o=Math.cos(s),i=t.normalized.scale(Math.sin(s));return new m(o,i)}get matrix(){const{x:t,y:e,z:r}=this.im,s=this.real,o=t*t,i=e*e,a=r*r,R=t*e,L=t*r,u=t*s,y=e*r,c=e*s,B=r*s;return new T(new U(1-2*(i+a),2*(R-B),2*(L+c),0),new U(2*(R+B),1-2*(o+a),2*(y-u),0),new U(2*(L-c),2*(y+u),1-2*(o+i),0),new U(0,0,0,1))}mult({real:t,im:e}){return new m(this.real*t-this.im.dot(e),this.im.cross(e).add(e.scale(this.real)).add(this.im.scale(t)))}rotate(t){return new m(this.real,this.im.negate).mult(new m(0,t)).mult(this).im}get conjugate(){return new m(this.real,this.im.negate)}get mag(){return Math.sqrt(this.real*this.real+this.im.squareMag)}power(t){const{mag:e}=this,r=Math.acos(this.real/e),s=this.im.normalized,o=Math.pow(e,t);return new m(o*Math.cos(r*t),s.scale(o*Math.sin(r*t)))}static get identity(){return new m(1,D.zero)}static slerp(t,e,r){return t.mult(t.conjugate.mult(e).power(r))}}[D.right,D.left,D.down,D.up,D.back,D.forward].map(n=>n.scale(.5)),m.identity,m.identity,m.fromAngle(D.back,90),m.fromAngle(D.back,90),m.fromAngle(D.back,90).mult(m.fromAngle(D.down,90)),m.fromAngle(D.back,90).mult(m.fromAngle(D.down,90));const zt=(n,t)=>{const e=Math.floor(n/2),r=n%2,s=Math.floor(t/Math.pow(3,e))%3;return s===1||s===0&&r===1||s===2&&r===0},At=n=>{const t=Math.floor(n/1)%3,e=Math.floor(n/3)%3,r=Math.floor(n/9)%3;return[t,e,r]},Tt=(n,t,e)=>{const r=Math.floor(t/2),s=[];for(let i=0;i<3;i++)i!==r&&s.push(n[i]);const o=s[0]+s[1]*3;return e[t][o]};class Dt{constructor(t){I(this,M,new et);I(this,O,new rt);I(this,k,new st);I(this,E);C(this,"stateInfo",new St(this));it(this,E,t)}applyTurn(t){const e=bt(t);for(const r of e)l(this,M).applyTurn(r),l(this,O).applyTurn(r),l(this,E)&&l(this,k).applyTurn(r)}applyState(t,e){l(this,M).applyState(t,e),l(this,O).applyState(t,e),l(this,E)&&l(this,k).applyState(t,e)}encode(){const t=[];t.push(...l(this,M).encode()),t.push(...l(this,O).encode()),l(this,E)&&t.push(...l(this,k).encode());const e=new Uint8Array(t);return btoa(String.fromCharCode(...e))}decode(t){const e=atob(t);if(e.length!==(l(this,E)?15:13))return!1;const r=[];for(let u=0;u{const e=At(n),r={};for(let s=0;s<6;s++)zt(s,n)||(r[s]=Tt(e,s,t));return r},ht=(n,t,e)=>{for(const r of e){let{axis:s,index:o,angle:i}=xt(r);const a=s*2+Math.sign(o),R={};for(const[u,y]of Object.entries(t)){const c=parseInt(u),B=Ct[s][c][i];if(c===a){R[a]=B(y);continue}const g=Rt[s].indexOf(c),f=Rt[s][V(g-i,4)];R[f]=B(y)}const L=Ut[s][o].indexOf(n);n=Ut[s][o][V(L+i*2,8)],t=R}return t},Lt=(n,t,e)=>{const r=t.cubies[n];for(const s of r.facelets)s.uvs=e[s.side]},Et=["URF","ULF","ULB","URB","DRF","DLF","DLB","DRB"],Bt=["UF","UL","UB","UR","FR","FL","BL","BR","DF","DL","DB","DR"],Mt=[{id:"URF",x:1,y:1,z:1},{id:"ULF",x:-1,y:1,z:1},{id:"ULB",x:-1,y:1,z:-1},{id:"URB",x:1,y:1,z:-1},{id:"DRF",x:1,y:-1,z:1},{id:"DLF",x:-1,y:-1,z:1},{id:"DLB",x:-1,y:-1,z:-1},{id:"DRB",x:1,y:-1,z:-1}],Ot=[{id:"UF",x:0,y:1,z:1},{id:"UL",x:-1,y:1,z:0},{id:"UB",x:0,y:1,z:-1},{id:"UR",x:1,y:1,z:0},{id:"FR",x:1,y:0,z:1},{id:"FL",x:-1,y:0,z:1},{id:"BL",x:-1,y:0,z:-1},{id:"BR",x:1,y:0,z:-1},{id:"DF",x:0,y:-1,z:1},{id:"DL",x:-1,y:-1,z:0},{id:"DB",x:0,y:-1,z:-1},{id:"DR",x:1,y:-1,z:0}],kt=[{id:"c0",x:0,y:1,z:0,faces:{up:"white"}},{id:"c1",x:0,y:-1,z:0,faces:{down:"yellow"}},{id:"c2",x:0,y:0,z:1,faces:{front:"green"}},{id:"c3",x:0,y:0,z:-1,faces:{back:"blue"}},{id:"c4",x:-1,y:0,z:0,faces:{left:"orange"}},{id:"c5",x:1,y:0,z:0,faces:{right:"red"}},{id:"core",x:0,y:0,z:0,faces:{}}],It={URF:["up","right","front"],ULF:["up","front","left"],ULB:["up","left","back"],URB:["up","back","right"],DRF:["down","right","front"],DLF:["down","left","front"],DLB:["down","back","left"],DRB:["down","right","back"]},Ht={UF:["up","front"],UL:["up","left"],UB:["up","back"],UR:["up","right"],FR:["front","right"],FL:["front","left"],BL:["back","left"],BR:["back","right"],DF:["down","front"],DL:["down","left"],DB:["down","back"],DR:["down","right"]},Pt=n=>({URF:["white","red","green"],ULF:["white","green","orange"],ULB:["white","orange","blue"],URB:["white","blue","red"],DRF:["yellow","red","green"],DLF:["yellow","orange","green"],DLB:["yellow","blue","orange"],DRB:["yellow","red","blue"]})[n],Nt=n=>({UF:["white","green"],UL:["white","orange"],UB:["white","blue"],UR:["white","red"],FR:["green","red"],FL:["green","orange"],BL:["blue","orange"],BR:["blue","red"],DF:["yellow","green"],DL:["yellow","orange"],DB:["yellow","blue"],DR:["yellow","red"]})[n];class $t{constructor(){this.state=new Dt(!1)}reset(){this.state=new Dt(!1)}rotateLayer(t,e,r){let s="";if(t==="y"?e===1?s=r===1?"U'":"U":e===-1&&(s=r===1?"D'":"D"):t==="x"?e===1?s=r===1?"R'":"R":e===-1&&(s=r===1?"L'":"L"):t==="z"&&(e===1?s=r===1?"F'":"F":e===-1&&(s=r===1?"B'":"B")),s){console.log("[RubiksJSModel] Applying move:",s);try{this.state.applyTurn(s),console.log("[RubiksJSModel] Move applied successfully")}catch(o){console.error("[RubiksJSModel] Failed to apply move:",s,o)}}}toCubies(){const t=this.state.encode(),e=atob(t),r=new Uint8Array(e.length);for(let c=0;c=0;c--){const B=s&7;i[c]=Et[B],s=s>>3;const g=o&3;a[c]=g,o=o>>2}const R=[],L=[];for(let c=0;c<6;c++){const B=r[5+c],g=B&15,f=B>>4&15;R[c*2]=Bt[g],R[c*2+1]=Bt[f]}let u=r[11]+(r[12]<<8);for(let c=11;c>=0;c--)L[c]=u&1,u=u>>1;const y=[...kt];for(let c=0;c<8;c++){const B=i[c],g=a[c],f=Mt[c],b=Pt(B),z=It[f.id],x={};x[z[0]]=b[(0+g)%3],x[z[1]]=b[(1+g)%3],x[z[2]]=b[(2+g)%3],y.push({id:`corn${c}`,x:f.x,y:f.y,z:f.z,faces:x})}for(let c=0;c<12;c++){const B=R[c],g=L[c],f=Ot[c],b=Nt(B),z=Ht[f.id],x={};g===0?(x[z[0]]=b[0],x[z[1]]=b[1]):(x[z[0]]=b[1],x[z[1]]=b[0]),y.push({id:`edge${c}`,x:f.x,y:f.y,z:f.z,faces:x})}return y}validate(){return{valid:!0,errors:[]}}}const v=new $t,lt=()=>{try{const n=v.toCubies();postMessage({type:"STATE_UPDATE",payload:{cubies:n}})}catch(n){console.error("[Worker] Error generating cubies:",n),postMessage({type:"ERROR",payload:n.message})}};self.onmessage=n=>{const{type:t,payload:e}=n.data;switch(t){case"INIT":case"RESET":v.reset(),lt();break;case"ROTATE_LAYER":const{axis:r,index:s,direction:o}=e;v.rotateLayer(r,s,o),lt();break;case"VALIDATE":const i=v.validate();postMessage({type:"VALIDATION_RESULT",payload:{valid:i.valid,errors:i.errors}});break}}})(); diff --git a/dist/assets/index-D2BDE6sW.js b/dist/assets/index-D2BDE6sW.js deleted file mode 100644 index 8f6f5b1..0000000 --- a/dist/assets/index-D2BDE6sW.js +++ /dev/null @@ -1,72 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();/** -* @vue/shared v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function js(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const G={},ht=[],Fe=()=>{},Yr=()=>!1,ss=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Us=e=>e.startsWith("onUpdate:"),ue=Object.assign,Bs=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},qr=Object.prototype.hasOwnProperty,U=(e,t)=>qr.call(e,t),R=Array.isArray,pt=e=>ns(e)==="[object Map]",Un=e=>ns(e)==="[object Set]",F=e=>typeof e=="function",te=e=>typeof e=="string",qe=e=>typeof e=="symbol",X=e=>e!==null&&typeof e=="object",Bn=e=>(X(e)||F(e))&&F(e.then)&&F(e.catch),zn=Object.prototype.toString,ns=e=>zn.call(e),Gr=e=>ns(e).slice(8,-1),Kn=e=>ns(e)==="[object Object]",zs=e=>te(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Tt=js(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),rs=e=>{const t=Object.create(null);return s=>t[s]||(t[s]=e(s))},kr=/-(\w)/g,Ye=rs(e=>e.replace(kr,(t,s)=>s?s.toUpperCase():"")),Jr=/\B([A-Z])/g,it=rs(e=>e.replace(Jr,"-$1").toLowerCase()),Wn=rs(e=>e.charAt(0).toUpperCase()+e.slice(1)),ps=rs(e=>e?`on${Wn(e)}`:""),Ve=(e,t)=>!Object.is(e,t),gs=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Xr=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ln;const is=()=>ln||(ln=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(e){if(R(e)){const t={};for(let s=0;s{if(s){const n=s.split(Qr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function os(e){let t="";if(te(e))t=e;else if(R(e))for(let s=0;s!!(e&&e.__v_isRef===!0),Cs=e=>te(e)?e:e==null?"":R(e)||X(e)&&(e.toString===zn||!F(e.toString))?qn(e)?Cs(e.value):JSON.stringify(e,Gn,2):String(e),Gn=(e,t)=>qn(t)?Gn(e,t.value):pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,r],i)=>(s[ms(n,i)+" =>"]=r,s),{})}:Un(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>ms(s))}:qe(t)?ms(t):X(t)&&!R(t)&&!Kn(t)?String(t):t,ms=(e,t="")=>{var s;return qe(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/** -* @vue/reactivity v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let ge;class ri{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ge,!t&&ge&&(this.index=(ge.scopes||(ge.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t0)return;if(At){let t=At;for(At=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Ct;){let t=Ct;for(Ct=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Zn(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Qn(e){let t,s=e.depsTail,n=s;for(;n;){const r=n.prevDep;n.version===-1?(n===s&&(s=r),Vs(n),oi(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}e.deps=t,e.depsTail=s}function As(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(er(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function er(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ft))return;e.globalVersion=Ft;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!As(e)){e.flags&=-3;return}const s=q,n=we;q=e,we=!0;try{Zn(e);const r=e.fn(e._value);(t.version===0||Ve(r,e._value))&&(e._value=r,t.version++)}catch(r){throw t.version++,r}finally{q=s,we=n,Qn(e),e.flags&=-3}}function Vs(e,t=!1){const{dep:s,prevSub:n,nextSub:r}=e;if(n&&(n.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)Vs(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function oi(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let we=!0;const tr=[];function Ge(){tr.push(we),we=!1}function ke(){const e=tr.pop();we=e===void 0?!0:e}function cn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=q;q=void 0;try{t()}finally{q=s}}}let Ft=0;class li{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ys{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!q||!we||q===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==q)s=this.activeLink=new li(q,this),q.deps?(s.prevDep=q.depsTail,q.depsTail.nextDep=s,q.depsTail=s):q.deps=q.depsTail=s,sr(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=q.depsTail,s.nextDep=void 0,q.depsTail.nextDep=s,q.depsTail=s,q.deps===s&&(q.deps=n)}return s}trigger(t){this.version++,Ft++,this.notify(t)}notify(t){Ks();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Ws()}}}function sr(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)sr(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Ps=new WeakMap,nt=Symbol(""),Ms=Symbol(""),Lt=Symbol("");function ne(e,t,s){if(we&&q){let n=Ps.get(e);n||Ps.set(e,n=new Map);let r=n.get(s);r||(n.set(s,r=new Ys),r.map=n,r.key=s),r.track()}}function Ne(e,t,s,n,r,i){const o=Ps.get(e);if(!o){Ft++;return}const l=f=>{f&&f.trigger()};if(Ks(),t==="clear")o.forEach(l);else{const f=R(e),h=f&&zs(s);if(f&&s==="length"){const a=Number(n);o.forEach((p,E)=>{(E==="length"||E===Lt||!qe(E)&&E>=a)&&l(p)})}else switch((s!==void 0||o.has(void 0))&&l(o.get(s)),h&&l(o.get(Lt)),t){case"add":f?h&&l(o.get("length")):(l(o.get(nt)),pt(e)&&l(o.get(Ms)));break;case"delete":f||(l(o.get(nt)),pt(e)&&l(o.get(Ms)));break;case"set":pt(e)&&l(o.get(nt));break}}Ws()}function at(e){const t=j(e);return t===e?t:(ne(t,"iterate",Lt),ve(e)?t:t.map(re))}function ls(e){return ne(e=j(e),"iterate",Lt),e}const ci={__proto__:null,[Symbol.iterator](){return ys(this,Symbol.iterator,re)},concat(...e){return at(this).concat(...e.map(t=>R(t)?at(t):t))},entries(){return ys(this,"entries",e=>(e[1]=re(e[1]),e))},every(e,t){return De(this,"every",e,t,void 0,arguments)},filter(e,t){return De(this,"filter",e,t,s=>s.map(re),arguments)},find(e,t){return De(this,"find",e,t,re,arguments)},findIndex(e,t){return De(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return De(this,"findLast",e,t,re,arguments)},findLastIndex(e,t){return De(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return De(this,"forEach",e,t,void 0,arguments)},includes(...e){return bs(this,"includes",e)},indexOf(...e){return bs(this,"indexOf",e)},join(e){return at(this).join(e)},lastIndexOf(...e){return bs(this,"lastIndexOf",e)},map(e,t){return De(this,"map",e,t,void 0,arguments)},pop(){return xt(this,"pop")},push(...e){return xt(this,"push",e)},reduce(e,...t){return fn(this,"reduce",e,t)},reduceRight(e,...t){return fn(this,"reduceRight",e,t)},shift(){return xt(this,"shift")},some(e,t){return De(this,"some",e,t,void 0,arguments)},splice(...e){return xt(this,"splice",e)},toReversed(){return at(this).toReversed()},toSorted(e){return at(this).toSorted(e)},toSpliced(...e){return at(this).toSpliced(...e)},unshift(...e){return xt(this,"unshift",e)},values(){return ys(this,"values",re)}};function ys(e,t,s){const n=ls(e),r=n[t]();return n!==e&&!ve(e)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.value&&(i.value=s(i.value)),i}),r}const fi=Array.prototype;function De(e,t,s,n,r,i){const o=ls(e),l=o!==e&&!ve(e),f=o[t];if(f!==fi[t]){const p=f.apply(e,i);return l?re(p):p}let h=s;o!==e&&(l?h=function(p,E){return s.call(this,re(p),E,e)}:s.length>2&&(h=function(p,E){return s.call(this,p,E,e)}));const a=f.call(o,h,n);return l&&r?r(a):a}function fn(e,t,s,n){const r=ls(e);let i=s;return r!==e&&(ve(e)?s.length>3&&(i=function(o,l,f){return s.call(this,o,l,f,e)}):i=function(o,l,f){return s.call(this,o,re(l),f,e)}),r[t](i,...n)}function bs(e,t,s){const n=j(e);ne(n,"iterate",Lt);const r=n[t](...s);return(r===-1||r===!1)&&Js(s[0])?(s[0]=j(s[0]),n[t](...s)):r}function xt(e,t,s=[]){Ge(),Ks();const n=j(e)[t].apply(e,s);return Ws(),ke(),n}const ui=js("__proto__,__v_isRef,__isVue"),nr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qe));function ai(e){qe(e)||(e=String(e));const t=j(this);return ne(t,"has",e),t.hasOwnProperty(e)}class rr{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,i=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return i;if(s==="__v_raw")return n===(r?i?xi:cr:i?lr:or).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=R(t);if(!r){let f;if(o&&(f=ci[s]))return f;if(s==="hasOwnProperty")return ai}const l=Reflect.get(t,s,ie(t)?t:n);return(qe(s)?nr.has(s):ui(s))||(r||ne(t,"get",s),i)?l:ie(l)?o&&zs(s)?l:l.value:X(l)?r?fr(l):Gs(l):l}}class ir extends rr{constructor(t=!1){super(!1,t)}set(t,s,n,r){let i=t[s];if(!this._isShallow){const f=rt(i);if(!ve(n)&&!rt(n)&&(i=j(i),n=j(n)),!R(t)&&ie(i)&&!ie(n))return f?!1:(i.value=n,!0)}const o=R(t)&&zs(s)?Number(s)e,zt=e=>Reflect.getPrototypeOf(e);function mi(e,t,s){return function(...n){const r=this.__v_raw,i=j(r),o=pt(i),l=e==="entries"||e===Symbol.iterator&&o,f=e==="keys"&&o,h=r[e](...n),a=s?Os:t?Rs:re;return!t&&ne(i,"iterate",f?Ms:nt),{next(){const{value:p,done:E}=h.next();return E?{value:p,done:E}:{value:l?[a(p[0]),a(p[1])]:a(p),done:E}},[Symbol.iterator](){return this}}}}function Kt(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _i(e,t){const s={get(r){const i=this.__v_raw,o=j(i),l=j(r);e||(Ve(r,l)&&ne(o,"get",r),ne(o,"get",l));const{has:f}=zt(o),h=t?Os:e?Rs:re;if(f.call(o,r))return h(i.get(r));if(f.call(o,l))return h(i.get(l));i!==o&&i.get(r)},get size(){const r=this.__v_raw;return!e&&ne(j(r),"iterate",nt),Reflect.get(r,"size",r)},has(r){const i=this.__v_raw,o=j(i),l=j(r);return e||(Ve(r,l)&&ne(o,"has",r),ne(o,"has",l)),r===l?i.has(r):i.has(r)||i.has(l)},forEach(r,i){const o=this,l=o.__v_raw,f=j(l),h=t?Os:e?Rs:re;return!e&&ne(f,"iterate",nt),l.forEach((a,p)=>r.call(i,h(a),h(p),o))}};return ue(s,e?{add:Kt("add"),set:Kt("set"),delete:Kt("delete"),clear:Kt("clear")}:{add(r){!t&&!ve(r)&&!rt(r)&&(r=j(r));const i=j(this);return zt(i).has.call(i,r)||(i.add(r),Ne(i,"add",r,r)),this},set(r,i){!t&&!ve(i)&&!rt(i)&&(i=j(i));const o=j(this),{has:l,get:f}=zt(o);let h=l.call(o,r);h||(r=j(r),h=l.call(o,r));const a=f.call(o,r);return o.set(r,i),h?Ve(i,a)&&Ne(o,"set",r,i):Ne(o,"add",r,i),this},delete(r){const i=j(this),{has:o,get:l}=zt(i);let f=o.call(i,r);f||(r=j(r),f=o.call(i,r)),l&&l.call(i,r);const h=i.delete(r);return f&&Ne(i,"delete",r,void 0),h},clear(){const r=j(this),i=r.size!==0,o=r.clear();return i&&Ne(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=mi(r,e,t)}),s}function qs(e,t){const s=_i(e,t);return(n,r,i)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?n:Reflect.get(U(s,r)&&r in n?s:n,r,i)}const yi={get:qs(!1,!1)},bi={get:qs(!1,!0)},vi={get:qs(!0,!1)};const or=new WeakMap,lr=new WeakMap,cr=new WeakMap,xi=new WeakMap;function wi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ei(e){return e.__v_skip||!Object.isExtensible(e)?0:wi(Gr(e))}function Gs(e){return rt(e)?e:ks(e,!1,hi,yi,or)}function Si(e){return ks(e,!1,gi,bi,lr)}function fr(e){return ks(e,!0,pi,vi,cr)}function ks(e,t,s,n,r){if(!X(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=Ei(e);if(o===0)return e;const l=new Proxy(e,o===2?n:s);return r.set(e,l),l}function gt(e){return rt(e)?gt(e.__v_raw):!!(e&&e.__v_isReactive)}function rt(e){return!!(e&&e.__v_isReadonly)}function ve(e){return!!(e&&e.__v_isShallow)}function Js(e){return e?!!e.__v_raw:!1}function j(e){const t=e&&e.__v_raw;return t?j(t):e}function Ti(e){return!U(e,"__v_skip")&&Object.isExtensible(e)&&Vn(e,"__v_skip",!0),e}const re=e=>X(e)?Gs(e):e,Rs=e=>X(e)?fr(e):e;function ie(e){return e?e.__v_isRef===!0:!1}function se(e){return Ci(e,!1)}function Ci(e,t){return ie(e)?e:new Ai(e,t)}class Ai{constructor(t,s){this.dep=new Ys,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:j(t),this._value=s?t:re(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||ve(t)||rt(t);t=n?t:j(t),Ve(t,s)&&(this._rawValue=t,this._value=n?t:re(t),this.dep.trigger())}}function yt(e){return ie(e)?e.value:e}const Pi={get:(e,t,s)=>t==="__v_raw"?e:yt(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const r=e[t];return ie(r)&&!ie(s)?(r.value=s,!0):Reflect.set(e,t,s,n)}};function ur(e){return gt(e)?e:new Proxy(e,Pi)}class Mi{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Ys(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ft-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&q!==this)return Xn(this,!0),!0}get value(){const t=this.dep.track();return er(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Oi(e,t,s=!1){let n,r;return F(e)?n=e:(n=e.get,r=e.set),new Mi(n,r,s)}const Wt={},kt=new WeakMap;let st;function Ri(e,t=!1,s=st){if(s){let n=kt.get(s);n||kt.set(s,n=[]),n.push(e)}}function Ii(e,t,s=G){const{immediate:n,deep:r,once:i,scheduler:o,augmentJob:l,call:f}=s,h=M=>r?M:ve(M)||r===!1||r===0?Ke(M,1):Ke(M);let a,p,E,S,L=!1,$=!1;if(ie(e)?(p=()=>e.value,L=ve(e)):gt(e)?(p=()=>h(e),L=!0):R(e)?($=!0,L=e.some(M=>gt(M)||ve(M)),p=()=>e.map(M=>{if(ie(M))return M.value;if(gt(M))return h(M);if(F(M))return f?f(M,2):M()})):F(e)?t?p=f?()=>f(e,2):e:p=()=>{if(E){Ge();try{E()}finally{ke()}}const M=st;st=a;try{return f?f(e,3,[S]):e(S)}finally{st=M}}:p=Fe,t&&r){const M=p,Q=r===!0?1/0:r;p=()=>Ke(M(),Q)}const z=ii(),N=()=>{a.stop(),z&&z.active&&Bs(z.effects,a)};if(i&&t){const M=t;t=(...Q)=>{M(...Q),N()}}let k=$?new Array(e.length).fill(Wt):Wt;const J=M=>{if(!(!(a.flags&1)||!a.dirty&&!M))if(t){const Q=a.run();if(r||L||($?Q.some((Ee,_e)=>Ve(Ee,k[_e])):Ve(Q,k))){E&&E();const Ee=st;st=a;try{const _e=[Q,k===Wt?void 0:$&&k[0]===Wt?[]:k,S];f?f(t,3,_e):t(..._e),k=Q}finally{st=Ee}}}else a.run()};return l&&l(J),a=new kn(p),a.scheduler=o?()=>o(J,!1):J,S=M=>Ri(M,!1,a),E=a.onStop=()=>{const M=kt.get(a);if(M){if(f)f(M,4);else for(const Q of M)Q();kt.delete(a)}},t?n?J(!0):k=a.run():o?o(J.bind(null,!0),!0):a.run(),N.pause=a.pause.bind(a),N.resume=a.resume.bind(a),N.stop=N,N}function Ke(e,t=1/0,s){if(t<=0||!X(e)||e.__v_skip||(s=s||new Set,s.has(e)))return e;if(s.add(e),t--,ie(e))Ke(e.value,t,s);else if(R(e))for(let n=0;n{Ke(n,t,s)});else if(Kn(e)){for(const n in e)Ke(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Ke(e[n],t,s)}return e}/** -* @vue/runtime-core v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function jt(e,t,s,n){try{return n?e(...n):e()}catch(r){cs(r,t,s)}}function Le(e,t,s,n){if(F(e)){const r=jt(e,t,s,n);return r&&Bn(r)&&r.catch(i=>{cs(i,t,s)}),r}if(R(e)){const r=[];for(let i=0;i>>1,r=le[n],i=Dt(r);i=Dt(s)?le.push(e):le.splice(Di(t),0,e),e.flags|=1,dr()}}function dr(){Jt||(Jt=ar.then(pr))}function $i(e){R(e)?mt.push(...e):Be&&e.id===-1?Be.splice(dt+1,0,e):e.flags&1||(mt.push(e),e.flags|=1),dr()}function un(e,t,s=Me+1){for(;sDt(s)-Dt(n));if(mt.length=0,Be){Be.push(...t);return}for(Be=t,dt=0;dte.id==null?e.flags&2?-1:1/0:e.id;function pr(e){try{for(Me=0;Me{n._d&&vn(-1);const i=Xt(t);let o;try{o=e(...r)}finally{Xt(i),n._d&&vn(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function et(e,t,s,n){const r=e.dirs,i=t&&t.dirs;for(let o=0;oe.__isTeleport;function Zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Zs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function mr(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Zt(e,t,s,n,r=!1){if(R(e)){e.forEach((L,$)=>Zt(L,t&&(R(t)?t[$]:t),s,n,r));return}if(Pt(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Zt(e,t,s,n.component.subTree);return}const i=n.shapeFlag&4?nn(n.component):n.el,o=r?null:i,{i:l,r:f}=e,h=t&&t.r,a=l.refs===G?l.refs={}:l.refs,p=l.setupState,E=j(p),S=p===G?()=>!1:L=>U(E,L);if(h!=null&&h!==f&&(te(h)?(a[h]=null,S(h)&&(p[h]=null)):ie(h)&&(h.value=null)),F(f))jt(f,l,12,[o,a]);else{const L=te(f),$=ie(f);if(L||$){const z=()=>{if(e.f){const N=L?S(f)?p[f]:a[f]:f.value;r?R(N)&&Bs(N,i):R(N)?N.includes(i)||N.push(i):L?(a[f]=[i],S(f)&&(p[f]=a[f])):(f.value=[i],e.k&&(a[e.k]=f.value))}else L?(a[f]=o,S(f)&&(p[f]=o)):$&&(f.value=o,e.k&&(a[e.k]=o))};o?(z.id=-1,pe(z,s)):z()}}}is().requestIdleCallback;is().cancelIdleCallback;const Pt=e=>!!e.type.__asyncLoader,_r=e=>e.type.__isKeepAlive;function Ui(e,t){yr(e,"a",t)}function Bi(e,t){yr(e,"da",t)}function yr(e,t,s=ce){const n=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(fs(t,n,s),s){let r=s.parent;for(;r&&r.parent;)_r(r.parent.vnode)&&zi(n,t,s,r),r=r.parent}}function zi(e,t,s,n){const r=fs(t,e,n,!0);en(()=>{Bs(n[t],r)},s)}function fs(e,t,s=ce,n=!1){if(s){const r=s[e]||(s[e]=[]),i=t.__weh||(t.__weh=(...o)=>{Ge();const l=Ut(s),f=Le(t,s,e,o);return l(),ke(),f});return n?r.unshift(i):r.push(i),i}}const He=e=>(t,s=ce)=>{(!Ht||e==="sp")&&fs(e,(...n)=>t(...n),s)},Ki=He("bm"),Qs=He("m"),Wi=He("bu"),Vi=He("u"),Yi=He("bum"),en=He("um"),qi=He("sp"),Gi=He("rtg"),ki=He("rtc");function Ji(e,t=ce){fs("ec",e,t)}const Xi=Symbol.for("v-ndc");function an(e,t,s,n){let r;const i=s,o=R(e);if(o||te(e)){const l=o&>(e);let f=!1;l&&(f=!ve(e),e=ls(e)),r=new Array(e.length);for(let h=0,a=e.length;ht(l,f,void 0,i));else{const l=Object.keys(e);r=new Array(l.length);for(let f=0,h=l.length;fe?jr(e)?nn(e):Is(e.parent):null,Mt=ue(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Is(e.parent),$root:e=>Is(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>vr(e),$forceUpdate:e=>e.f||(e.f=()=>{Xs(e.update)}),$nextTick:e=>e.n||(e.n=Li.bind(e.proxy)),$watch:e=>vo.bind(e)}),vs=(e,t)=>e!==G&&!e.__isScriptSetup&&U(e,t),Zi={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:r,props:i,accessCache:o,type:l,appContext:f}=e;let h;if(t[0]!=="$"){const S=o[t];if(S!==void 0)switch(S){case 1:return n[t];case 2:return r[t];case 4:return s[t];case 3:return i[t]}else{if(vs(n,t))return o[t]=1,n[t];if(r!==G&&U(r,t))return o[t]=2,r[t];if((h=e.propsOptions[0])&&U(h,t))return o[t]=3,i[t];if(s!==G&&U(s,t))return o[t]=4,s[t];Fs&&(o[t]=0)}}const a=Mt[t];let p,E;if(a)return t==="$attrs"&&ne(e.attrs,"get",""),a(e);if((p=l.__cssModules)&&(p=p[t]))return p;if(s!==G&&U(s,t))return o[t]=4,s[t];if(E=f.config.globalProperties,U(E,t))return E[t]},set({_:e},t,s){const{data:n,setupState:r,ctx:i}=e;return vs(r,t)?(r[t]=s,!0):n!==G&&U(n,t)?(n[t]=s,!0):U(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:r,propsOptions:i}},o){let l;return!!s[o]||e!==G&&U(e,o)||vs(t,o)||(l=i[0])&&U(l,o)||U(n,o)||U(Mt,o)||U(r.config.globalProperties,o)},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:U(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function dn(e){return R(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let Fs=!0;function Qi(e){const t=vr(e),s=e.proxy,n=e.ctx;Fs=!1,t.beforeCreate&&hn(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:l,provide:f,inject:h,created:a,beforeMount:p,mounted:E,beforeUpdate:S,updated:L,activated:$,deactivated:z,beforeDestroy:N,beforeUnmount:k,destroyed:J,unmounted:M,render:Q,renderTracked:Ee,renderTriggered:_e,errorCaptured:xe,serverPrefetch:ot,expose:Se,inheritAttrs:Je,components:lt,directives:ct,filters:A}=t;if(h&&eo(h,n,null),o)for(const I in o){const C=o[I];F(C)&&(n[I]=C.bind(s))}if(r){const I=r.call(s,s);X(I)&&(e.data=Gs(I))}if(Fs=!0,i)for(const I in i){const C=i[I],W=F(C)?C.bind(s,s):F(C.get)?C.get.bind(s,s):Fe,Z=!F(C)&&F(C.set)?C.set.bind(s):Fe,ee=qt({get:W,set:Z});Object.defineProperty(n,I,{enumerable:!0,configurable:!0,get:()=>ee.value,set:V=>ee.value=V})}if(l)for(const I in l)br(l[I],n,s,I);if(f){const I=F(f)?f.call(s):f;Reflect.ownKeys(I).forEach(C=>{oo(C,I[C])})}a&&hn(a,e,"c");function D(I,C){R(C)?C.forEach(W=>I(W.bind(s))):C&&I(C.bind(s))}if(D(Ki,p),D(Qs,E),D(Wi,S),D(Vi,L),D(Ui,$),D(Bi,z),D(Ji,xe),D(ki,Ee),D(Gi,_e),D(Yi,k),D(en,M),D(qi,ot),R(Se))if(Se.length){const I=e.exposed||(e.exposed={});Se.forEach(C=>{Object.defineProperty(I,C,{get:()=>s[C],set:W=>s[C]=W})})}else e.exposed||(e.exposed={});Q&&e.render===Fe&&(e.render=Q),Je!=null&&(e.inheritAttrs=Je),lt&&(e.components=lt),ct&&(e.directives=ct),ot&&mr(e)}function eo(e,t,s=Fe){R(e)&&(e=Ls(e));for(const n in e){const r=e[n];let i;X(r)?"default"in r?i=Vt(r.from||n,r.default,!0):i=Vt(r.from||n):i=Vt(r),ie(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):t[n]=i}}function hn(e,t,s){Le(R(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function br(e,t,s,n){let r=n.includes(".")?Lr(s,n):()=>s[n];if(te(e)){const i=t[e];F(i)&&ws(r,i)}else if(F(e))ws(r,e.bind(s));else if(X(e))if(R(e))e.forEach(i=>br(i,t,s,n));else{const i=F(e.handler)?e.handler.bind(s):t[e.handler];F(i)&&ws(r,i,e)}}function vr(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,l=i.get(t);let f;return l?f=l:!r.length&&!s&&!n?f=t:(f={},r.length&&r.forEach(h=>Qt(f,h,o,!0)),Qt(f,t,o)),X(t)&&i.set(t,f),f}function Qt(e,t,s,n=!1){const{mixins:r,extends:i}=t;i&&Qt(e,i,s,!0),r&&r.forEach(o=>Qt(e,o,s,!0));for(const o in t)if(!(n&&o==="expose")){const l=to[o]||s&&s[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const to={data:pn,props:gn,emits:gn,methods:St,computed:St,beforeCreate:oe,created:oe,beforeMount:oe,mounted:oe,beforeUpdate:oe,updated:oe,beforeDestroy:oe,beforeUnmount:oe,destroyed:oe,unmounted:oe,activated:oe,deactivated:oe,errorCaptured:oe,serverPrefetch:oe,components:St,directives:St,watch:no,provide:pn,inject:so};function pn(e,t){return t?e?function(){return ue(F(e)?e.call(this,this):e,F(t)?t.call(this,this):t)}:t:e}function so(e,t){return St(Ls(e),Ls(t))}function Ls(e){if(R(e)){const t={};for(let s=0;s1)return s&&F(t)?t.call(n&&n.proxy):t}}const wr={},Er=()=>Object.create(wr),Sr=e=>Object.getPrototypeOf(e)===wr;function lo(e,t,s,n=!1){const r={},i=Er();e.propsDefaults=Object.create(null),Tr(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);s?e.props=n?r:Si(r):e.type.props?e.props=r:e.props=i,e.attrs=i}function co(e,t,s,n){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,l=j(r),[f]=e.propsOptions;let h=!1;if((n||o>0)&&!(o&16)){if(o&8){const a=e.vnode.dynamicProps;for(let p=0;p{f=!0;const[E,S]=Cr(p,t,!0);ue(o,E),S&&l.push(...S)};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!i&&!f)return X(e)&&n.set(e,ht),ht;if(R(i))for(let a=0;ae[0]==="_"||e==="$stable",tn=e=>R(e)?e.map(Oe):[Oe(e)],uo=(e,t,s)=>{if(t._n)return t;const n=Ni((...r)=>tn(t(...r)),s);return n._c=!1,n},Pr=(e,t,s)=>{const n=e._ctx;for(const r in e){if(Ar(r))continue;const i=e[r];if(F(i))t[r]=uo(r,i,n);else if(i!=null){const o=tn(i);t[r]=()=>o}}},Mr=(e,t)=>{const s=tn(t);e.slots.default=()=>s},Or=(e,t,s)=>{for(const n in t)(s||n!=="_")&&(e[n]=t[n])},ao=(e,t,s)=>{const n=e.slots=Er();if(e.vnode.shapeFlag&32){const r=t._;r?(Or(n,t,s),s&&Vn(n,"_",r,!0)):Pr(t,n)}else t&&Mr(e,t)},ho=(e,t,s)=>{const{vnode:n,slots:r}=e;let i=!0,o=G;if(n.shapeFlag&32){const l=t._;l?s&&l===1?i=!1:Or(r,t,s):(i=!t.$stable,Pr(t,r)),o=t}else t&&(Mr(e,t),o={default:1});if(i)for(const l in r)!Ar(l)&&o[l]==null&&delete r[l]},pe=Ao;function po(e){return go(e)}function go(e,t){const s=is();s.__VUE__=!0;const{insert:n,remove:r,patchProp:i,createElement:o,createText:l,createComment:f,setText:h,setElementText:a,parentNode:p,nextSibling:E,setScopeId:S=Fe,insertStaticContent:L}=e,$=(c,u,d,_=null,g=null,m=null,x=void 0,v=null,b=!!u.dynamicChildren)=>{if(c===u)return;c&&!wt(c,u)&&(_=Ze(c),V(c,g,m,!0),c=null),u.patchFlag===-2&&(b=!1,u.dynamicChildren=null);const{type:y,ref:P,shapeFlag:w}=u;switch(y){case as:z(c,u,d,_);break;case $t:N(c,u,d,_);break;case Es:c==null&&k(u,d,_,x);break;case ye:lt(c,u,d,_,g,m,x,v,b);break;default:w&1?Q(c,u,d,_,g,m,x,v,b):w&6?ct(c,u,d,_,g,m,x,v,b):(w&64||w&128)&&y.process(c,u,d,_,g,m,x,v,b,Qe)}P!=null&&g&&Zt(P,c&&c.ref,m,u||c,!u)},z=(c,u,d,_)=>{if(c==null)n(u.el=l(u.children),d,_);else{const g=u.el=c.el;u.children!==c.children&&h(g,u.children)}},N=(c,u,d,_)=>{c==null?n(u.el=f(u.children||""),d,_):u.el=c.el},k=(c,u,d,_)=>{[c.el,c.anchor]=L(c.children,u,d,_,c.el,c.anchor)},J=({el:c,anchor:u},d,_)=>{let g;for(;c&&c!==u;)g=E(c),n(c,d,_),c=g;n(u,d,_)},M=({el:c,anchor:u})=>{let d;for(;c&&c!==u;)d=E(c),r(c),c=d;r(u)},Q=(c,u,d,_,g,m,x,v,b)=>{u.type==="svg"?x="svg":u.type==="math"&&(x="mathml"),c==null?Ee(u,d,_,g,m,x,v,b):ot(c,u,g,m,x,v,b)},Ee=(c,u,d,_,g,m,x,v)=>{let b,y;const{props:P,shapeFlag:w,transition:T,dirs:O}=c;if(b=c.el=o(c.type,m,P&&P.is,P),w&8?a(b,c.children):w&16&&xe(c.children,b,null,_,g,xs(c,m),x,v),O&&et(c,null,_,"created"),_e(b,c,c.scopeId,x,_),P){for(const Y in P)Y!=="value"&&!Tt(Y)&&i(b,Y,null,P[Y],m,_);"value"in P&&i(b,"value",null,P.value,m),(y=P.onVnodeBeforeMount)&&Pe(y,_,c)}O&&et(c,null,_,"beforeMount");const H=mo(g,T);H&&T.beforeEnter(b),n(b,u,d),((y=P&&P.onVnodeMounted)||H||O)&&pe(()=>{y&&Pe(y,_,c),H&&T.enter(b),O&&et(c,null,_,"mounted")},g)},_e=(c,u,d,_,g)=>{if(d&&S(c,d),_)for(let m=0;m<_.length;m++)S(c,_[m]);if(g){let m=g.subTree;if(u===m||$r(m.type)&&(m.ssContent===u||m.ssFallback===u)){const x=g.vnode;_e(c,x,x.scopeId,x.slotScopeIds,g.parent)}}},xe=(c,u,d,_,g,m,x,v,b=0)=>{for(let y=b;y{const v=u.el=c.el;let{patchFlag:b,dynamicChildren:y,dirs:P}=u;b|=c.patchFlag&16;const w=c.props||G,T=u.props||G;let O;if(d&&tt(d,!1),(O=T.onVnodeBeforeUpdate)&&Pe(O,d,u,c),P&&et(u,c,d,"beforeUpdate"),d&&tt(d,!0),(w.innerHTML&&T.innerHTML==null||w.textContent&&T.textContent==null)&&a(v,""),y?Se(c.dynamicChildren,y,v,d,_,xs(u,g),m):x||C(c,u,v,null,d,_,xs(u,g),m,!1),b>0){if(b&16)Je(v,w,T,d,g);else if(b&2&&w.class!==T.class&&i(v,"class",null,T.class,g),b&4&&i(v,"style",w.style,T.style,g),b&8){const H=u.dynamicProps;for(let Y=0;Y{O&&Pe(O,d,u,c),P&&et(u,c,d,"updated")},_)},Se=(c,u,d,_,g,m,x)=>{for(let v=0;v{if(u!==d){if(u!==G)for(const m in u)!Tt(m)&&!(m in d)&&i(c,m,u[m],null,g,_);for(const m in d){if(Tt(m))continue;const x=d[m],v=u[m];x!==v&&m!=="value"&&i(c,m,v,x,g,_)}"value"in d&&i(c,"value",u.value,d.value,g)}},lt=(c,u,d,_,g,m,x,v,b)=>{const y=u.el=c?c.el:l(""),P=u.anchor=c?c.anchor:l("");let{patchFlag:w,dynamicChildren:T,slotScopeIds:O}=u;O&&(v=v?v.concat(O):O),c==null?(n(y,d,_),n(P,d,_),xe(u.children||[],d,P,g,m,x,v,b)):w>0&&w&64&&T&&c.dynamicChildren?(Se(c.dynamicChildren,T,d,g,m,x,v),(u.key!=null||g&&u===g.subTree)&&Rr(c,u,!0)):C(c,u,d,P,g,m,x,v,b)},ct=(c,u,d,_,g,m,x,v,b)=>{u.slotScopeIds=v,c==null?u.shapeFlag&512?g.ctx.activate(u,d,_,x,b):A(u,d,_,g,m,x,b):K(c,u,b)},A=(c,u,d,_,g,m,x)=>{const v=c.component=Do(c,_,g);if(_r(c)&&(v.ctx.renderer=Qe),$o(v,!1,x),v.asyncDep){if(g&&g.registerDep(v,D,x),!c.el){const b=v.subTree=fe($t);N(null,b,u,d)}}else D(v,c,u,d,g,m,x)},K=(c,u,d)=>{const _=u.component=c.component;if(To(c,u,d))if(_.asyncDep&&!_.asyncResolved){I(_,u,d);return}else _.next=u,_.update();else u.el=c.el,_.vnode=u},D=(c,u,d,_,g,m,x)=>{const v=()=>{if(c.isMounted){let{next:w,bu:T,u:O,parent:H,vnode:Y}=c;{const Ce=Ir(c);if(Ce){w&&(w.el=Y.el,I(c,w,x)),Ce.asyncDep.then(()=>{c.isUnmounted||v()});return}}let B=w,de;tt(c,!1),w?(w.el=Y.el,I(c,w,x)):w=Y,T&&gs(T),(de=w.props&&w.props.onVnodeBeforeUpdate)&&Pe(de,H,w,Y),tt(c,!0);const ae=yn(c),Te=c.subTree;c.subTree=ae,$(Te,ae,p(Te.el),Ze(Te),c,g,m),w.el=ae.el,B===null&&Co(c,ae.el),O&&pe(O,g),(de=w.props&&w.props.onVnodeUpdated)&&pe(()=>Pe(de,H,w,Y),g)}else{let w;const{el:T,props:O}=u,{bm:H,m:Y,parent:B,root:de,type:ae}=c,Te=Pt(u);tt(c,!1),H&&gs(H),!Te&&(w=O&&O.onVnodeBeforeMount)&&Pe(w,B,u),tt(c,!0);{de.ce&&de.ce._injectChildStyle(ae);const Ce=c.subTree=yn(c);$(null,Ce,d,_,c,g,m),u.el=Ce.el}if(Y&&pe(Y,g),!Te&&(w=O&&O.onVnodeMounted)){const Ce=u;pe(()=>Pe(w,B,Ce),g)}(u.shapeFlag&256||B&&Pt(B.vnode)&&B.vnode.shapeFlag&256)&&c.a&&pe(c.a,g),c.isMounted=!0,u=d=_=null}};c.scope.on();const b=c.effect=new kn(v);c.scope.off();const y=c.update=b.run.bind(b),P=c.job=b.runIfDirty.bind(b);P.i=c,P.id=c.uid,b.scheduler=()=>Xs(P),tt(c,!0),y()},I=(c,u,d)=>{u.component=c;const _=c.vnode.props;c.vnode=u,c.next=null,co(c,u.props,_,d),ho(c,u.children,d),Ge(),un(c),ke()},C=(c,u,d,_,g,m,x,v,b=!1)=>{const y=c&&c.children,P=c?c.shapeFlag:0,w=u.children,{patchFlag:T,shapeFlag:O}=u;if(T>0){if(T&128){Z(y,w,d,_,g,m,x,v,b);return}else if(T&256){W(y,w,d,_,g,m,x,v,b);return}}O&8?(P&16&&Ue(y,g,m),w!==y&&a(d,w)):P&16?O&16?Z(y,w,d,_,g,m,x,v,b):Ue(y,g,m,!0):(P&8&&a(d,""),O&16&&xe(w,d,_,g,m,x,v,b))},W=(c,u,d,_,g,m,x,v,b)=>{c=c||ht,u=u||ht;const y=c.length,P=u.length,w=Math.min(y,P);let T;for(T=0;TP?Ue(c,g,m,!0,!1,w):xe(u,d,_,g,m,x,v,b,w)},Z=(c,u,d,_,g,m,x,v,b)=>{let y=0;const P=u.length;let w=c.length-1,T=P-1;for(;y<=w&&y<=T;){const O=c[y],H=u[y]=b?ze(u[y]):Oe(u[y]);if(wt(O,H))$(O,H,d,null,g,m,x,v,b);else break;y++}for(;y<=w&&y<=T;){const O=c[w],H=u[T]=b?ze(u[T]):Oe(u[T]);if(wt(O,H))$(O,H,d,null,g,m,x,v,b);else break;w--,T--}if(y>w){if(y<=T){const O=T+1,H=OT)for(;y<=w;)V(c[y],g,m,!0),y++;else{const O=y,H=y,Y=new Map;for(y=H;y<=T;y++){const he=u[y]=b?ze(u[y]):Oe(u[y]);he.key!=null&&Y.set(he.key,y)}let B,de=0;const ae=T-H+1;let Te=!1,Ce=0;const vt=new Array(ae);for(y=0;y=ae){V(he,g,m,!0);continue}let Ae;if(he.key!=null)Ae=Y.get(he.key);else for(B=H;B<=T;B++)if(vt[B-H]===0&&wt(he,u[B])){Ae=B;break}Ae===void 0?V(he,g,m,!0):(vt[Ae-H]=y+1,Ae>=Ce?Ce=Ae:Te=!0,$(he,u[Ae],d,null,g,m,x,v,b),de++)}const rn=Te?_o(vt):ht;for(B=rn.length-1,y=ae-1;y>=0;y--){const he=H+y,Ae=u[he],on=he+1{const{el:m,type:x,transition:v,children:b,shapeFlag:y}=c;if(y&6){ee(c.component.subTree,u,d,_);return}if(y&128){c.suspense.move(u,d,_);return}if(y&64){x.move(c,u,d,Qe);return}if(x===ye){n(m,u,d);for(let w=0;wv.enter(m),g);else{const{leave:w,delayLeave:T,afterLeave:O}=v,H=()=>n(m,u,d),Y=()=>{w(m,()=>{H(),O&&O()})};T?T(m,H,Y):Y()}else n(m,u,d)},V=(c,u,d,_=!1,g=!1)=>{const{type:m,props:x,ref:v,children:b,dynamicChildren:y,shapeFlag:P,patchFlag:w,dirs:T,cacheIndex:O}=c;if(w===-2&&(g=!1),v!=null&&Zt(v,null,d,c,!0),O!=null&&(u.renderCache[O]=void 0),P&256){u.ctx.deactivate(c);return}const H=P&1&&T,Y=!Pt(c);let B;if(Y&&(B=x&&x.onVnodeBeforeUnmount)&&Pe(B,u,c),P&6)Xe(c.component,d,_);else{if(P&128){c.suspense.unmount(d,_);return}H&&et(c,null,u,"beforeUnmount"),P&64?c.type.remove(c,u,d,Qe,_):y&&!y.hasOnce&&(m!==ye||w>0&&w&64)?Ue(y,u,d,!1,!0):(m===ye&&w&384||!g&&P&16)&&Ue(b,u,d),_&&ft(c)}(Y&&(B=x&&x.onVnodeUnmounted)||H)&&pe(()=>{B&&Pe(B,u,c),H&&et(c,null,u,"unmounted")},d)},ft=c=>{const{type:u,el:d,anchor:_,transition:g}=c;if(u===ye){je(d,_);return}if(u===Es){M(c);return}const m=()=>{r(d),g&&!g.persisted&&g.afterLeave&&g.afterLeave()};if(c.shapeFlag&1&&g&&!g.persisted){const{leave:x,delayLeave:v}=g,b=()=>x(d,m);v?v(c.el,m,b):b()}else m()},je=(c,u)=>{let d;for(;c!==u;)d=E(c),r(c),c=d;r(u)},Xe=(c,u,d)=>{const{bum:_,scope:g,job:m,subTree:x,um:v,m:b,a:y}=c;_n(b),_n(y),_&&gs(_),g.stop(),m&&(m.flags|=8,V(x,c,u,d)),v&&pe(v,u),pe(()=>{c.isUnmounted=!0},u),u&&u.pendingBranch&&!u.isUnmounted&&c.asyncDep&&!c.asyncResolved&&c.suspenseId===u.pendingId&&(u.deps--,u.deps===0&&u.resolve())},Ue=(c,u,d,_=!1,g=!1,m=0)=>{for(let x=m;x{if(c.shapeFlag&6)return Ze(c.component.subTree);if(c.shapeFlag&128)return c.suspense.next();const u=E(c.anchor||c.el),d=u&&u[Hi];return d?E(d):u};let ut=!1;const Bt=(c,u,d)=>{c==null?u._vnode&&V(u._vnode,null,null,!0):$(u._vnode||null,c,u,null,null,null,d),u._vnode=c,ut||(ut=!0,un(),hr(),ut=!1)},Qe={p:$,um:V,m:ee,r:ft,mt:A,mc:xe,pc:C,pbc:Se,n:Ze,o:e};return{render:Bt,hydrate:void 0,createApp:io(Bt)}}function xs({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function tt({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function mo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Rr(e,t,s=!1){const n=e.children,r=t.children;if(R(n)&&R(r))for(let i=0;i>1,e[s[l]]0&&(t[n]=s[i-1]),s[i]=n)}}for(i=s.length,o=s[i-1];i-- >0;)s[i]=o,o=t[o];return s}function Ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ir(t)}function _n(e){if(e)for(let t=0;tVt(yo);function ws(e,t,s){return Fr(e,t,s)}function Fr(e,t,s=G){const{immediate:n,deep:r,flush:i,once:o}=s,l=ue({},s),f=t&&n||!t&&i!=="post";let h;if(Ht){if(i==="sync"){const S=bo();h=S.__watcherHandles||(S.__watcherHandles=[])}else if(!f){const S=()=>{};return S.stop=Fe,S.resume=Fe,S.pause=Fe,S}}const a=ce;l.call=(S,L,$)=>Le(S,a,L,$);let p=!1;i==="post"?l.scheduler=S=>{pe(S,a&&a.suspense)}:i!=="sync"&&(p=!0,l.scheduler=(S,L)=>{L?S():Xs(S)}),l.augmentJob=S=>{t&&(S.flags|=4),p&&(S.flags|=2,a&&(S.id=a.uid,S.i=a))};const E=Ii(e,t,l);return Ht&&(h?h.push(E):f&&E()),E}function vo(e,t,s){const n=this.proxy,r=te(e)?e.includes(".")?Lr(n,e):()=>n[e]:e.bind(n,n);let i;F(t)?i=t:(i=t.handler,s=t);const o=Ut(this),l=Fr(r,i.bind(n),s);return o(),l}function Lr(e,t){const s=t.split(".");return()=>{let n=e;for(let r=0;rt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ye(t)}Modifiers`]||e[`${it(t)}Modifiers`];function wo(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||G;let r=s;const i=t.startsWith("update:"),o=i&&xo(n,t.slice(7));o&&(o.trim&&(r=s.map(a=>te(a)?a.trim():a)),o.number&&(r=s.map(Xr)));let l,f=n[l=ps(t)]||n[l=ps(Ye(t))];!f&&i&&(f=n[l=ps(it(t))]),f&&Le(f,e,6,r);const h=n[l+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Le(h,e,6,r)}}function Dr(e,t,s=!1){const n=t.emitsCache,r=n.get(e);if(r!==void 0)return r;const i=e.emits;let o={},l=!1;if(!F(e)){const f=h=>{const a=Dr(h,t,!0);a&&(l=!0,ue(o,a))};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!i&&!l?(X(e)&&n.set(e,null),null):(R(i)?i.forEach(f=>o[f]=null):ue(o,i),X(e)&&n.set(e,o),o)}function us(e,t){return!e||!ss(t)?!1:(t=t.slice(2).replace(/Once$/,""),U(e,t[0].toLowerCase()+t.slice(1))||U(e,it(t))||U(e,t))}function yn(e){const{type:t,vnode:s,proxy:n,withProxy:r,propsOptions:[i],slots:o,attrs:l,emit:f,render:h,renderCache:a,props:p,data:E,setupState:S,ctx:L,inheritAttrs:$}=e,z=Xt(e);let N,k;try{if(s.shapeFlag&4){const M=r||n,Q=M;N=Oe(h.call(Q,M,a,p,S,E,L)),k=l}else{const M=t;N=Oe(M.length>1?M(p,{attrs:l,slots:o,emit:f}):M(p,null)),k=t.props?l:Eo(l)}}catch(M){Ot.length=0,cs(M,e,1),N=fe($t)}let J=N;if(k&&$!==!1){const M=Object.keys(k),{shapeFlag:Q}=J;M.length&&Q&7&&(i&&M.some(Us)&&(k=So(k,i)),J=bt(J,k,!1,!0))}return s.dirs&&(J=bt(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(s.dirs):s.dirs),s.transition&&Zs(J,s.transition),N=J,Xt(z),N}const Eo=e=>{let t;for(const s in e)(s==="class"||s==="style"||ss(s))&&((t||(t={}))[s]=e[s]);return t},So=(e,t)=>{const s={};for(const n in e)(!Us(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function To(e,t,s){const{props:n,children:r,component:i}=e,{props:o,children:l,patchFlag:f}=t,h=i.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&f>=0){if(f&1024)return!0;if(f&16)return n?bn(n,o,h):!!o;if(f&8){const a=t.dynamicProps;for(let p=0;pe.__isSuspense;function Ao(e,t){t&&t.pendingBranch?R(e)?t.effects.push(...e):t.effects.push(e):$i(e)}const ye=Symbol.for("v-fgt"),as=Symbol.for("v-txt"),$t=Symbol.for("v-cmt"),Es=Symbol.for("v-stc"),Ot=[];let me=null;function Re(e=!1){Ot.push(me=e?null:[])}function Po(){Ot.pop(),me=Ot[Ot.length-1]||null}let Nt=1;function vn(e,t=!1){Nt+=e,e<0&&me&&t&&(me.hasOnce=!0)}function Nr(e){return e.dynamicChildren=Nt>0?me||ht:null,Po(),Nt>0&&me&&me.push(e),e}function We(e,t,s,n,r,i){return Nr(be(e,t,s,n,r,i,!0))}function xn(e,t,s,n,r){return Nr(fe(e,t,s,n,r,!0))}function es(e){return e?e.__v_isVNode===!0:!1}function wt(e,t){return e.type===t.type&&e.key===t.key}const Hr=({key:e})=>e??null,Yt=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?te(e)||ie(e)||F(e)?{i:Ie,r:e,k:t,f:!!s}:e:null);function be(e,t=null,s=null,n=0,r=null,i=e===ye?0:1,o=!1,l=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Hr(t),ref:t&&Yt(t),scopeId:gr,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ie};return l?(sn(f,s),i&128&&e.normalize(f)):s&&(f.shapeFlag|=te(s)?8:16),Nt>0&&!o&&me&&(f.patchFlag>0||i&6)&&f.patchFlag!==32&&me.push(f),f}const fe=Mo;function Mo(e,t=null,s=null,n=0,r=null,i=!1){if((!e||e===Xi)&&(e=$t),es(e)){const l=bt(e,t,!0);return s&&sn(l,s),Nt>0&&!i&&me&&(l.shapeFlag&6?me[me.indexOf(e)]=l:me.push(l)),l.patchFlag=-2,l}if(Uo(e)&&(e=e.__vccOpts),t){t=Oo(t);let{class:l,style:f}=t;l&&!te(l)&&(t.class=os(l)),X(f)&&(Js(f)&&!R(f)&&(f=ue({},f)),t.style=It(f))}const o=te(e)?1:$r(e)?128:ji(e)?64:X(e)?4:F(e)?2:0;return be(e,t,s,n,r,o,i,!0)}function Oo(e){return e?Js(e)||Sr(e)?ue({},e):e:null}function bt(e,t,s=!1,n=!1){const{props:r,ref:i,patchFlag:o,children:l,transition:f}=e,h=t?Io(r||{},t):r,a={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Hr(h),ref:t&&t.ref?s&&i?R(i)?i.concat(Yt(t)):[i,Yt(t)]:Yt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ye?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bt(e.ssContent),ssFallback:e.ssFallback&&bt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return f&&n&&Zs(a,f.clone(a)),a}function Ro(e=" ",t=0){return fe(as,null,e,t)}function Oe(e){return e==null||typeof e=="boolean"?fe($t):R(e)?fe(ye,null,e.slice()):es(e)?ze(e):fe(as,null,String(e))}function ze(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bt(e)}function sn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(R(t))s=16;else if(typeof t=="object")if(n&65){const r=t.default;r&&(r._c&&(r._d=!1),sn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!Sr(t)?t._ctx=Ie:r===3&&Ie&&(Ie.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else F(t)?(t={default:t,_ctx:Ie},s=32):(t=String(t),n&64?(s=16,t=[Ro(t)]):s=8);e.children=t,e.shapeFlag|=s}function Io(...e){const t={};for(let s=0;s{let r;return(r=e[s])||(r=e[s]=[]),r.push(n),i=>{r.length>1?r.forEach(o=>o(i)):r[0](i)}};ts=t("__VUE_INSTANCE_SETTERS__",s=>ce=s),$s=t("__VUE_SSR_SETTERS__",s=>Ht=s)}const Ut=e=>{const t=ce;return ts(e),e.scope.on(),()=>{e.scope.off(),ts(t)}},wn=()=>{ce&&ce.scope.off(),ts(null)};function jr(e){return e.vnode.shapeFlag&4}let Ht=!1;function $o(e,t=!1,s=!1){t&&$s(t);const{props:n,children:r}=e.vnode,i=jr(e);lo(e,n,i,t),ao(e,r,s);const o=i?No(e,t):void 0;return t&&$s(!1),o}function No(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Zi);const{setup:n}=s;if(n){Ge();const r=e.setupContext=n.length>1?jo(e):null,i=Ut(e),o=jt(n,e,0,[e.props,r]),l=Bn(o);if(ke(),i(),(l||e.sp)&&!Pt(e)&&mr(e),l){if(o.then(wn,wn),t)return o.then(f=>{En(e,f)}).catch(f=>{cs(f,e,0)});e.asyncDep=o}else En(e,o)}else Ur(e)}function En(e,t,s){F(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:X(t)&&(e.setupState=ur(t)),Ur(e)}function Ur(e,t,s){const n=e.type;e.render||(e.render=n.render||Fe);{const r=Ut(e);Ge();try{Qi(e)}finally{ke(),r()}}}const Ho={get(e,t){return ne(e,"get",""),e[t]}};function jo(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Ho),slots:e.slots,emit:e.emit,expose:t}}function nn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ur(Ti(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Mt)return Mt[s](e)},has(t,s){return s in t||s in Mt}})):e.proxy}function Uo(e){return F(e)&&"__vccOpts"in e}const qt=(e,t)=>Oi(e,t,Ht);function Ns(e,t,s){const n=arguments.length;return n===2?X(t)&&!R(t)?es(t)?fe(e,null,[t]):fe(e,t):fe(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&es(s)&&(s=[s]),fe(e,t,s))}const Bo="3.5.13";/** -* @vue/runtime-dom v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Hs;const Sn=typeof window<"u"&&window.trustedTypes;if(Sn)try{Hs=Sn.createPolicy("vue",{createHTML:e=>e})}catch{}const Br=Hs?e=>Hs.createHTML(e):e=>e,zo="http://www.w3.org/2000/svg",Ko="http://www.w3.org/1998/Math/MathML",$e=typeof document<"u"?document:null,Tn=$e&&$e.createElement("template"),Wo={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const r=t==="svg"?$e.createElementNS(zo,e):t==="mathml"?$e.createElementNS(Ko,e):s?$e.createElement(e,{is:s}):$e.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>$e.createTextNode(e),createComment:e=>$e.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>$e.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,i){const o=s?s.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===i||!(r=r.nextSibling)););else{Tn.innerHTML=Br(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const l=Tn.content;if(n==="svg"||n==="mathml"){const f=l.firstChild;for(;f.firstChild;)l.appendChild(f.firstChild);l.removeChild(f)}t.insertBefore(l,s)}return[o?o.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Vo=Symbol("_vtc");function Yo(e,t,s){const n=e[Vo];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Cn=Symbol("_vod"),qo=Symbol("_vsh"),Go=Symbol(""),ko=/(^|;)\s*display\s*:/;function Jo(e,t,s){const n=e.style,r=te(s);let i=!1;if(s&&!r){if(t)if(te(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();s[l]==null&&Gt(n,l,"")}else for(const o in t)s[o]==null&&Gt(n,o,"");for(const o in s)o==="display"&&(i=!0),Gt(n,o,s[o])}else if(r){if(t!==s){const o=n[Go];o&&(s+=";"+o),n.cssText=s,i=ko.test(s)}}else t&&e.removeAttribute("style");Cn in e&&(e[Cn]=i?n.display:"",e[qo]&&(n.display="none"))}const An=/\s*!important$/;function Gt(e,t,s){if(R(s))s.forEach(n=>Gt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Xo(e,t);An.test(s)?e.setProperty(it(n),s.replace(An,""),"important"):e[n]=s}}const Pn=["Webkit","Moz","ms"],Ss={};function Xo(e,t){const s=Ss[t];if(s)return s;let n=Ye(t);if(n!=="filter"&&n in e)return Ss[t]=n;n=Wn(n);for(let r=0;rTs||(sl.then(()=>Ts=0),Ts=Date.now());function rl(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;Le(il(n,s.value),t,5,[n])};return s.value=e,s.attached=nl(),s}function il(e,t){if(R(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const Ln=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ol=(e,t,s,n,r,i)=>{const o=r==="svg";t==="class"?Yo(e,n,o):t==="style"?Jo(e,s,n):ss(t)?Us(t)||el(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ll(e,t,n,o))?(Rn(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&On(e,t,n,o,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!te(n))?Rn(e,Ye(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),On(e,t,n,o))};function ll(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ln(t)&&F(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Ln(t)&&te(s)?!1:t in e}const cl=ue({patchProp:ol},Wo);let Dn;function fl(){return Dn||(Dn=po(cl))}const ul=(...e)=>{const t=fl().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=dl(n);if(!r)return;const i=t._component;!F(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=s(r,!1,al(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t};function al(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function dl(e){return te(e)?document.querySelector(e):e}const hl={WHITE:"white",YELLOW:"yellow",ORANGE:"orange",RED:"red",GREEN:"green",BLUE:"blue",BLACK:"black"},pl={UP:"up",DOWN:"down",LEFT:"left",RIGHT:"right",FRONT:"front",BACK:"back"},Rt=new Worker(new URL("/assets/Cube.worker-BFklK0dH.js",import.meta.url),{type:"module"}),zr=se([]),Kr=se(!1),Wr=se(null);Rt.onmessage=e=>{const{type:t,payload:s}=e.data;t==="STATE_UPDATE"?(zr.value=s.cubies,Kr.value=!0):t==="VALIDATION_RESULT"?Wr.value=s:t==="ERROR"&&console.error("Worker Error:",s)};Rt.postMessage({type:"INIT"});function gl(){const e=()=>{Rt.postMessage({type:"RESET"})},t=(n,r,i)=>{Rt.postMessage({type:"ROTATE_LAYER",payload:{axis:n,index:r,direction:i}})},s=()=>{Rt.postMessage({type:"VALIDATE"})};return{cubies:qt(()=>zr.value),isReady:qt(()=>Kr.value),validationResult:qt(()=>Wr.value),initCube:e,rotateLayer:t,validate:s,COLORS:hl,FACES:pl}}const ds=(e,t)=>{const s=e.__vccOpts||e;for(const[n,r]of t)s[n]=r;return s},ml={class:"smart-cube-container"},_l={class:"cube"},yl=["data-cubie-id"],bl=["data-id","data-face"],$n=100,Nn=0,vl={__name:"SmartCube",setup(e){const{cubies:t,initCube:s,rotateLayer:n,FACES:r}=gl(),i=se(-25),o=se(45),l=se(0),f=se(!1),h=se("view"),a=se(0),p=se(0),E=se(0),S=se(0);se(0);const L=se(null),$=se(null),z=se(null),N=se(0),k=se(!1),J=A=>({[r.FRONT]:{x:0,y:0,z:1},[r.BACK]:{x:0,y:0,z:-1},[r.RIGHT]:{x:1,y:0,z:0},[r.LEFT]:{x:-1,y:0,z:0},[r.UP]:{x:0,y:1,z:0},[r.DOWN]:{x:0,y:-1,z:0}})[A]||{x:0,y:0,z:1},M=A=>{switch(A){case r.FRONT:case r.BACK:return["x","y"];case r.RIGHT:case r.LEFT:return["z","y"];case r.UP:case r.DOWN:return["x","z"]}return[]},Q=A=>A==="x"?{x:1,y:0,z:0}:A==="y"?{x:0,y:1,z:0}:A==="z"?{x:0,y:0,z:1}:{x:0,y:0,z:0},Ee=(A,K)=>({x:A.y*K.z-A.z*K.y,y:A.z*K.x-A.x*K.z,z:A.x*K.y-A.y*K.x}),_e=A=>{const K=i.value*Math.PI/180,D=o.value*Math.PI/180,I=l.value*Math.PI/180;let C=A.x*Math.cos(I)-A.y*Math.sin(I),W=A.x*Math.sin(I)+A.y*Math.cos(I),Z=A.z,ee=C*Math.cos(D)+Z*Math.sin(D),V=W,ft=-C*Math.sin(D)+Z*Math.cos(D),je=ee,Xe=V*Math.cos(K)-ft*Math.sin(K);return{x:je,y:Xe}},xe=A=>{if(!f.value)return;const K=A.clientX-E.value,D=A.clientY-S.value;if(h.value==="view")o.value+=K*.5,i.value+=D*.5;else if(h.value==="layer"&&L.value){const I=A.clientX-a.value,C=A.clientY-p.value;ot(I,C,K,D)}E.value=A.clientX,S.value=A.clientY},ot=(A,K,D,I)=>{if(!z.value){if(Math.sqrt(A**2+K**2)<5)return;const C=J($.value),W=M($.value);let Z=null,ee=0;if(W.forEach(V=>{const ft=Ee(Q(V),C),je=_e(ft),Xe=Math.sqrt(je.x**2+je.y**2);if(Xe>.1){const Ue=je.x/Xe,Ze=je.y/Xe,ut=Math.sqrt(A**2+K**2),Bt=A/ut,Qe=K/ut,hs=Math.abs(Bt*Ue+Qe*Ze);hs>ee&&(ee=hs,Z={axis:V,tangent:{x:Ue,y:Ze}})}}),Z&&ee>.5){let V=0;Z.axis==="x"&&(V=L.value.x),Z.axis==="y"&&(V=L.value.y),Z.axis==="z"&&(V=L.value.z),z.value={axis:Z.axis,index:V,tangent:Z.tangent}}}if(z.value){const{x:C,y:W}=z.value.tangent,Z=D*C+I*W;N.value+=Z*.6}},Se=()=>{f.value=!1,z.value&&Je()},Je=()=>{k.value=!0;const A=Math.round(N.value/90)*90,K=Math.round(N.value/90),D=N.value,I=performance.now(),C=200,W=Z=>{const ee=Math.min((Z-I)/C,1),V=1-Math.pow(1-ee,3);N.value=D+(A-D)*V,ee<1?requestAnimationFrame(W):lt(K)};requestAnimationFrame(W)},lt=A=>{if(A!==0&&z.value){const{axis:K,index:D}=z.value,I=Math.abs(A),C=A>0?1:-1;for(let W=0;W{const K=A.x*($n+Nn),D=A.y*-100,I=A.z*($n+Nn);let C=`translate3d(${K}px, ${D}px, ${I}px)`;if(z.value){const{axis:W,index:Z}=z.value;let ee=!1;if(W==="x"&&A.x===Z&&(ee=!0),W==="y"&&A.y===Z&&(ee=!0),W==="z"&&A.z===Z&&(ee=!0),ee){let V=N.value;W==="x"&&(C=`rotateX(${-V}deg) `+C),W==="y"&&(C=`rotateY(${-V}deg) `+C),W==="z"&&(C=`rotateZ(${V}deg) `+C)}}return{transform:C}};return Qs(()=>{s(),window.addEventListener("mousemove",xe),window.addEventListener("mouseup",Se)}),en(()=>{window.removeEventListener("mousemove",xe),window.removeEventListener("mouseup",Se)}),(A,K)=>(Re(),We("div",ml,[be("div",{class:"scene",style:It({transform:`rotateX(${i.value}deg) rotateY(${o.value}deg)`})},[be("div",_l,[(Re(!0),We(ye,null,an(yt(t),D=>(Re(),We("div",{key:D.id,class:"cubie",style:It(ct(D)),"data-cubie-id":D.id},[(Re(!0),We(ye,null,an(D.faces,(I,C)=>(Re(),We("div",{key:C,class:os(["sticker",[C,I]]),"data-id":D.id,"data-face":C},null,10,bl))),128))],12,yl))),128))])],4)]))}},xl=ds(vl,[["__scopeId","data-v-dec8c361"]]);/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wl=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hn=e=>e==="";/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const El=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim();/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase());/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tl=e=>{const t=Sl(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Et={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cl=({name:e,iconNode:t,absoluteStrokeWidth:s,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":i,size:o=Et.width,color:l=Et.stroke,...f},{slots:h})=>Ns("svg",{...Et,...f,width:o,height:o,stroke:l,"stroke-width":Hn(s)||Hn(n)||s===!0||n===!0?Number(r||i||Et["stroke-width"])*24/Number(o):r||i||Et["stroke-width"],class:El("lucide",f.class,...e?[`lucide-${jn(Tl(e))}-icon`,`lucide-${jn(e)}`]:["lucide-icon"]),...!h.default&&!wl(f)&&{"aria-hidden":"true"}},[...t.map(a=>Ns(...a)),...h.default?[h.default()]:[]]);/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vr=(e,t)=>(s,{slots:n,attrs:r})=>Ns(Cl,{...r,...s,iconNode:t,name:e},n);/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Al=Vr("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/** - * @license lucide-vue-next v0.564.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pl=Vr("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Ml={class:"navbar"},Ol={class:"nav-container"},Rl=["title"],Il={__name:"NavBar",setup(e){const t=se(!0),s=r=>{t.value=r;const i=r?"dark":"light";document.documentElement.dataset.theme=i,r?(document.documentElement.style.setProperty("--bg-gradient","radial-gradient(circle at center, #2b2b2b 0%, #000000 100%)"),document.documentElement.style.setProperty("--text-color","#ffffff"),document.documentElement.style.setProperty("--text-strong","#ffffff"),document.documentElement.style.setProperty("--text-muted","rgba(255, 255, 255, 0.7)"),document.documentElement.style.setProperty("--glass-bg","rgba(255, 255, 255, 0.05)"),document.documentElement.style.setProperty("--glass-border","rgba(255, 255, 255, 0.1)"),document.documentElement.style.setProperty("--panel-bg","rgba(255, 255, 255, 0.05)"),document.documentElement.style.setProperty("--panel-border","rgba(255, 255, 255, 0.1)"),document.documentElement.style.setProperty("--cube-edge-color","#333333"),document.documentElement.style.setProperty("--title-gradient","linear-gradient(45deg, #00f2fe, #4facfe)")):(document.documentElement.style.setProperty("--bg-gradient","radial-gradient(circle at center, #ffffff 0%, #e0e0e0 100%)"),document.documentElement.style.setProperty("--text-color","#0f172a"),document.documentElement.style.setProperty("--text-strong","#0f172a"),document.documentElement.style.setProperty("--text-muted","rgba(15, 23, 42, 0.6)"),document.documentElement.style.setProperty("--glass-bg","rgba(255, 255, 255, 0.75)"),document.documentElement.style.setProperty("--glass-border","rgba(15, 23, 42, 0.12)"),document.documentElement.style.setProperty("--panel-bg","rgba(255, 255, 255, 0.7)"),document.documentElement.style.setProperty("--panel-border","rgba(15, 23, 42, 0.12)"),document.documentElement.style.setProperty("--cube-edge-color","#000000"),document.documentElement.style.setProperty("--title-gradient","linear-gradient(45deg, #0ea5e9, #6366f1)"))},n=()=>{s(!t.value)};return Qs(()=>{s(!0)}),(r,i)=>(Re(),We("nav",Ml,[i[0]||(i[0]=be("div",{class:"logo-container"},[be("span",{class:"logo-text"},"Rubic Cube")],-1)),be("div",Ol,[be("button",{class:"btn-neon nav-btn icon-only",onClick:n,title:t.value?"Przełącz na jasny":"Przełącz na ciemny"},[t.value?(Re(),xn(yt(Pl),{key:0,size:20})):(Re(),xn(yt(Al),{key:1,size:20}))],8,Rl)])]))}},Fl=ds(Il,[["__scopeId","data-v-bc85c255"]]),Ll={class:"app-footer"},Dl={class:"footer-content"},$l={__name:"Footer",setup(e){const t=new Date().getFullYear(),s="0.0.26";return(n,r)=>(Re(),We("footer",Ll,[be("div",Dl,[be("p",null,"© "+Cs(yt(t))+" Rubic Cube. Wersja "+Cs(yt(s)),1),r[0]||(r[0]=be("div",{class:"social-links"},null,-1))])]))}},Nl=ds($l,[["__scopeId","data-v-651f6ae4"]]),Hl={class:"app-content"},jl={__name:"App",setup(e){return(t,s)=>(Re(),We(ye,null,[fe(Fl),be("div",Hl,[fe(xl)]),fe(Nl)],64))}},Ul=ds(jl,[["__scopeId","data-v-c7d7a511"]]);ul(Ul).mount("#app"); diff --git a/dist/assets/index-GD5U86y_.css b/dist/assets/index-GD5U86y_.css deleted file mode 100644 index 2407dcc..0000000 --- a/dist/assets/index-GD5U86y_.css +++ /dev/null @@ -1 +0,0 @@ -:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--bg-gradient: radial-gradient(circle at center, #2b2b2b 0%, #000000 100%);--glass-bg: rgba(255, 255, 255, .05);--glass-border: rgba(255, 255, 255, .1);--glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, .37);--text-color: #ffffff;--text-strong: #ffffff;--text-secondary: rgba(255, 255, 255, .85);--text-muted: rgba(255, 255, 255, .7);--accent-cyan: #00f2fe;--accent-purple: #4facfe;--primary-accent: #00f2fe;--title-glow: rgba(0, 255, 255, .2);--toggle-btn-border: rgba(255, 255, 255, .2);--panel-bg: rgba(255, 255, 255, .05);--panel-border: rgba(255, 255, 255, .1);--panel-shadow: 0 4px 15px rgba(0, 0, 0, .2)}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;min-width:320px;height:100vh;flex-direction:column;background:var(--bg-gradient);background-attachment:fixed;color:var(--text-color);overflow:hidden}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}.card{padding:2em}#app{width:100%;height:100vh;display:flex;flex-direction:column;align-items:center}.glass-panel{background:var(--glass-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.smart-cube-container[data-v-dec8c361]{width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;overflow:hidden;background:transparent;perspective:1000px}.scene[data-v-dec8c361]{position:relative;width:0;height:0;transform-style:preserve-3d}.cube[data-v-dec8c361]{position:relative;transform-style:preserve-3d}.cubie[data-v-dec8c361]{position:absolute;width:100px;height:100px;margin-left:-50px;margin-top:-50px;transform-style:preserve-3d}.sticker[data-v-dec8c361]{position:absolute;width:98px;height:98px;top:1px;left:1px;border-radius:8px;box-shadow:inset 0 0 10px #00000080;border:1px solid rgba(0,0,0,.2);backface-visibility:hidden}.sticker.up[data-v-dec8c361]{transform:rotateX(90deg) translateZ(50px)}.sticker.down[data-v-dec8c361]{transform:rotateX(-90deg) translateZ(50px)}.sticker.front[data-v-dec8c361]{transform:translateZ(50px)}.sticker.back[data-v-dec8c361]{transform:rotateY(180deg) translateZ(50px)}.sticker.left[data-v-dec8c361]{transform:rotateY(-90deg) translateZ(50px)}.sticker.right[data-v-dec8c361]{transform:rotateY(90deg) translateZ(50px)}.white[data-v-dec8c361]{background:#e0e0e0}.yellow[data-v-dec8c361]{background:#ffd500}.green[data-v-dec8c361]{background:#009e60}.blue[data-v-dec8c361]{background:#0051ba}.orange[data-v-dec8c361]{background:#ff5800}.red[data-v-dec8c361]{background:#c41e3a}.black[data-v-dec8c361]{background:#111;display:none}.navbar[data-v-bc85c255]{display:flex;justify-content:space-between;align-items:center;padding:0 20px;height:50px;width:100%;box-sizing:border-box;position:absolute;top:0;left:0;z-index:100;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border-bottom:none}.logo-container[data-v-bc85c255]{display:flex;align-items:center;gap:10px}.logo-text[data-v-bc85c255]{font-size:1.2rem;font-weight:700;color:#fff;text-shadow:0 0 10px rgba(0,242,254,.5)}.nav-container[data-v-bc85c255]{display:flex;gap:15px;align-items:center}.nav-btn[data-v-bc85c255]{background:transparent;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;padding:8px;border-radius:50%;transition:all .3s ease}.nav-btn[data-v-bc85c255]:hover{background:#fff3}.app-footer[data-v-651f6ae4]{width:100%;padding:0 20px;height:40px;display:flex;align-items:center;justify-content:center;position:absolute;bottom:0;left:0;z-index:10;background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;border-top:none;box-shadow:none;color:var(--text-muted);box-sizing:border-box}.footer-content[data-v-651f6ae4]{display:flex;align-items:center;gap:10px}p[data-v-651f6ae4]{font-size:.8rem;letter-spacing:.5px;margin:0}.app-content[data-v-c7d7a511]{flex:1;display:flex;justify-content:center;align-items:center;width:100%;padding:0;position:relative;z-index:1;user-select:none;-webkit-user-select:none} diff --git a/dist/assets/rubic-cube-6wQ3YEkf.svg b/dist/assets/rubic-cube-6wQ3YEkf.svg deleted file mode 100644 index b632328..0000000 --- a/dist/assets/rubic-cube-6wQ3YEkf.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/index.html b/dist/index.html deleted file mode 100644 index 4e85b7e..0000000 --- a/dist/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Rubic Cube - - - - -
- - diff --git a/package-lock.json b/package-lock.json index 1fab5fd..790cc2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,7 @@ "name": "rubic-cube", "version": "0.0.27", "dependencies": { - "@gkucmierz/utils": "^1.28.3", "lucide-vue-next": "^0.564.0", - "matrix-js": "^1.8.0", "rubiks-js": "^1.0.0", "vue": "^3.5.13" }, @@ -490,12 +488,6 @@ "node": ">=18" } }, - "node_modules/@gkucmierz/utils": { - "version": "1.28.3", - "resolved": "https://registry.npmjs.org/@gkucmierz/utils/-/utils-1.28.3.tgz", - "integrity": "sha512-4qbEGTrHnj0pdeY72MHbuOzM9hugZiyhTMfy7ZijkBQN+fMGVc7OJ7CM02t1KBQDFl2bQNb7AF9KZCm3wn09YQ==", - "license": "MIT" - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -987,11 +979,6 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, - "node_modules/matrix-js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/matrix-js/-/matrix-js-1.8.0.tgz", - "integrity": "sha512-2PHn6veiSf7aS/VBhdgrUVYCjVBkaAwFtIuXUnrHduKbSNpFHYzkdPYPgKI95idqFMKKEieYoMglimo2YGIapQ==" - }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", diff --git a/package.json b/package.json index 5b27be9..e664512 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@gkucmierz/utils": "^1.28.3", "lucide-vue-next": "^0.564.0", - "matrix-js": "^1.8.0", "rubiks-js": "^1.0.0", "vue": "^3.5.13" }, diff --git a/scripts/verify_integrity.js b/scripts/verify_integrity.js deleted file mode 100644 index 34d33a4..0000000 --- a/scripts/verify_integrity.js +++ /dev/null @@ -1,39 +0,0 @@ -import { DeepCube } from '../src/utils/DeepCube.js'; - -console.log('🔥 Starting DeepCube Integrity Verification (1,000,000 Moves) 🔥'); - -const cube = new DeepCube(); -const MOVES = ["U", "D", "L", "R", "F", "B", "U'", "D'", "L'", "R'", "F'", "B'", "U2", "D2", "L2", "R2", "F2", "B2"]; -const ITERATIONS = 1000000; -const CHECK_INTERVAL = 100000; - -const startTime = performance.now(); - -for (let i = 0; i < ITERATIONS; i++) { - const move = MOVES[Math.floor(Math.random() * MOVES.length)]; - cube.move(move); - - // Check integrity - const result = cube.validate(); - if (!result.valid) { - console.error(`❌ CRITICAL FAILURE at iteration ${i} after move ${move}`); - console.error(result.errors); - console.error('State Dump:', { - cp: cube.cp, - co: cube.co, - ep: cube.ep, - eo: cube.eo - }); - process.exit(1); - } - - if ((i + 1) % CHECK_INTERVAL === 0) { - const elapsed = ((performance.now() - startTime) / 1000).toFixed(2); - console.log(`✅ ${i + 1} moves verified... (Time: ${elapsed}s)`); - } -} - -const totalTime = ((performance.now() - startTime) / 1000).toFixed(2); -console.log(`\n🎉 SUCCESS! Verified 1,000,000 moves without logical corruption.`); -console.log(`Total Time: ${totalTime}s`); -console.log(`Moves per second: ${Math.round(ITERATIONS / totalTime)}`); diff --git a/src/components/DebugPanel.vue b/src/components/DebugPanel.vue deleted file mode 100644 index a9f60d7..0000000 --- a/src/components/DebugPanel.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 6f9a75c..a1166e7 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -7,9 +7,6 @@ const version = __APP_VERSION__;
diff --git a/src/components/InteractionReplay.vue b/src/components/InteractionReplay.vue deleted file mode 100644 index c48b3a1..0000000 --- a/src/components/InteractionReplay.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - diff --git a/src/components/Main.vue b/src/components/Main.vue deleted file mode 100644 index 48b1c87..0000000 --- a/src/components/Main.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/components/renderers/CubeCSS.vue b/src/components/renderers/CubeCSS.vue deleted file mode 100644 index 318a8c7..0000000 --- a/src/components/renderers/CubeCSS.vue +++ /dev/null @@ -1,1162 +0,0 @@ - - - - - diff --git a/src/utils/DeepCube.js b/src/utils/DeepCube.js deleted file mode 100644 index 75d937e..0000000 --- a/src/utils/DeepCube.js +++ /dev/null @@ -1,561 +0,0 @@ -/** - * Deep Mechanical Rubik's Cube Model (Group Theory Approach) - * - * State Representation: - * - Corners (0-7): Permutation (p) and Orientation (o: 0..2) - * - Edges (0-11): Permutation (p) and Orientation (o: 0..1) - * - * Indexes: - * Corners: - * 0: URF, 1: UFL, 2: ULB, 3: UBR - * 4: DFR, 5: DLF, 6: DBL, 7: DRB - * - * Edges: - * 0: UR, 1: UF, 2: UL, 3: UB - * 4: DR, 5: DF, 6: DL, 7: DB - * 8: FR, 9: FL, 10: BL, 11: BR - */ - -export const MOVES = { - // Definitions of basic moves: { corners: [indices], edges: [indices], co: [deltas], eo: [deltas] } - // Only defining Permutation Cycles and Orientation Changes. - // Permutation: p[i] moves to p[move[i]]? Or position i takes piece from move[i]? - // Let's use: "Piece at position i moves to position move[i]". (Isomorphism to S_n) - - // Actually, standard array rep: state.p[i] is "which piece is at position i". - // Move M maps position i to M[i]. - // So new_state.p[M[i]] = old_state.p[i]. - // Or new_state.p[i] = old_state.p[M_inv[i]]. - - // Let's stick to: "Move U moves pieces currently at indices ... to indices ..." - // Corners: URF(0) -> UBR(3) -> ULB(2) -> UFL(1) -> URF(0) ? - // Move U (Clockwise): - // 0 (URF) -> 3 (UBR) ? No. U move pushes URF to position UFL? - // Let's visualize Top Face (U): - // B - // 2 3 - // L 1 0 R - // F - // U (CW) turns: 0->1, 1->2, 2->3, 3->0? No. - // U (CW) turns: Right to Front. - // URF(0) is Front-Right. UFL(1) is Front-Left. - // U moves Right face stuff to Front face? NO. - // U moves Front face stuff to Left face. - // So 0 (URF) -> 1 (UFL)? No. - // URF is at corner of U, R, F faces. - // After U CW, it goes to corner of U, F, L faces. (UFL). - // So 0 -> 1. - // 1 (UFL) -> 2 (ULB). - // 2 (ULB) -> 3 (UBR). - // 3 (UBR) -> 0 (URF). - // So cycle is (0 1 2 3). - // Permutation Table P: P[0]=1, P[1]=2, P[2]=3, P[3]=0. - // Applied to state: "Piece at 0 goes to 1". - - // Orientations CO: - // U moves do not change Corner Orientation (relative to U/D). - // So co delta is 0 for all. - - // Edges U: - // 0(UR), 1(UF), 2(UL), 3(UB). - // U moves UR to UF? No. - // UR is Right. UF is Front. - // U CW moves Right to Front? No. - // U CW moves Front to Left. - // So UF(1) -> UL(2). - // UL(2) -> UB(3). - // UB(3) -> UR(0). - // UR(0) -> UF(1). - // Cycle: (0 1 2 3). - // P[0]=1, etc. - - // Moves Definitions (Target Positions) - U: { - cp: [1, 2, 3, 0, 4, 5, 6, 7], - co: [0, 0, 0, 0, 0, 0, 0, 0], - ep: [1, 2, 3, 0, 4, 5, 6, 7, 8, 9, 10, 11], - eo: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - }, - D: { - // D (CW) looking from bottom. - // DFR(4), DLF(5), DBL(6), DRB(7). - // D CW moves Front to Right. - // DFR(4) -> DRB(7). - // DRB(7) -> DBL(6). - // DBL(6) -> DLF(5). - // DLF(5) -> DFR(4). - // Cycle: (4 7 6 5). (Wait: 4->7, 7->6, 6->5, 5->4). - // Indices: [0,1,2,3, 7,4,5,6] (Wait. 4->7 means P[4]=7? No. - // P array usually means: P[i] is the location where piece i goes? OR where piece at i comes from? - // Standard multiplication: (A * B)[i] = A[B[i]]. - // Let's define Move P as "Content of slot i comes from slot P[i]". - // If 0 goes to 1. Then New[1] = Old[0]. - // So P[1] = 0. - // In our U example: 0->1. So P[1]=0. - // Let's verify U array [1,2,3,0...] - // P[0]=1 (Content of 0 comes from 1?). No. - // The previous array was [1, 2, 3, 0]. - // If it meant "0 goes to 1", then New[1] = Old[0]. - // Let's stick to: "Piece i goes to Position Move[i]". - // Implementation: newP[Move[i]] = oldP[i]. - // U: 0->1, 1->2, 2->3, 3->0. - // Array: [1, 2, 3, 0]. - // This matches "i goes to Move[i]". - - // D: 4->7, 7->6, 6->5, 5->4. - // P[4]=7, P[5]=4, P[6]=5, P[7]=6. - cp: [0, 1, 2, 3, 7, 4, 5, 6], - co: [0, 0, 0, 0, 0, 0, 0, 0], - // Edges: DR(4), DF(5), DL(6), DB(7). - // D moves Front to Right. - // DF(5) -> DR(4). - // DR(4) -> DB(7). - // DB(7) -> DL(6). - // DL(6) -> DF(5). - // Cycle: 5->4, 4->7, 7->6, 6->5. - // P[4]=7, P[5]=4, P[6]=5, P[7]=6. - ep: [0, 1, 2, 3, 7, 4, 5, 6, 8, 9, 10, 11], - eo: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - }, - L: { - // L (CW) - // Corners: UFL(1), DLF(5), DBL(6), ULB(2). - // L moves Up to Front. - // UFL(1) -> DLF(5). - // DLF(5) -> DBL(6). - // DBL(6) -> ULB(2). - // ULB(2) -> UFL(1). - // Cycle: 1->5, 5->6, 6->2, 2->1. - // P[1]=5, P[2]=1, P[5]=6, P[6]=2. - cp: [0, 5, 1, 3, 4, 6, 2, 7], - // Twist: L/R moves twist corners. - // UFL(1) moves to DLF. (+1: CW). WHITE U face moves to F face (CW rotation relative to corner axis?). - // DLF(5) moves to DBL. (-1: CCW). - // DBL(6) moves to ULB. (+1). - // ULB(2) moves to UFL. (-1). - // Values: 1 -> +1, 5 -> -1, 6 -> +1, 2 -> -1. - co: [0, 1, 2, 0, 0, 2, 1, 0], // 2 is -1 mod 3. - - // Edges: UL(2), FL(9), DL(6), BL(10). - // U->F. - // UL(2) -> FL(9). - // FL(9) -> DL(6). - // DL(6) -> BL(10). - // BL(10) -> UL(2). - // P[2]=9, P[6]=10, P[9]=6, P[10]=2. - ep: [0, 1, 9, 3, 4, 5, 10, 7, 8, 6, 2, 11], - // Orientation: L/R do NOT flip edges in standard U/D rep. - eo: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - }, - R: { - // R (CW) - // Corners: URF(0), UBR(3), DRB(7), DFR(4). - // R moves Up to Back. - // URF(0) -> UBR(3). - // UBR(3) -> DRB(7). - // DRB(7) -> DFR(4). - // DFR(4) -> URF(0). - // Cycle: 0->3, 3->7, 7->4, 4->0. - // P[0]=3, P[3]=7, P[4]=0, P[7]=4. - cp: [3, 1, 2, 7, 0, 5, 6, 4], - // Twist: - // URF(0) -> UBR. (-1). - // UBR(3) -> DRB. (+1). - // DRB(7) -> DFR. (-1). - // DFR(4) -> URF. (+1). - // 0:2, 3:1, 7:2, 4:1. - co: [2, 0, 0, 1, 1, 0, 0, 2], - - // Edges: UR(0), BR(11), DR(4), FR(8). - // U->B. - // UR(0) -> BR(11). - // BR(11) -> DR(4). - // DR(4) -> FR(8). - // FR(8) -> UR(0). - // P[0]=11, P[4]=8, P[8]=0, P[11]=4. - ep: [11, 1, 2, 3, 8, 5, 6, 7, 0, 9, 10, 4], - eo: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - }, - F: { - // F (CW) - // Corners: URF(0), UFL(1), DLF(5), DFR(4). - // F moves U to R. - // URF(0) -> DFR(4). (Wait. URF is Top-Right. F turns Top to Right. So URF -> DFR (Bottom-Right)). - // UFL(1) -> URF(0). - // DLF(5) -> UFL(1). - // DFR(4) -> DLF(5). - // Cycle: 0->4, 4->5, 5->1, 1->0. - // P[0]=4, P[1]=0, P[4]=5, P[5]=1. - cp: [4, 0, 2, 3, 5, 1, 6, 7], - // Twist: - // UFL(1) -> URF. (+1). - // URF(0) -> DFR. (-1). - // DFR(4) -> DLF. (+1). - // DLF(5) -> UFL. (-1). - // 0:2, 1:1, 4:1, 5:2. - co: [2, 1, 0, 0, 1, 2, 0, 0], - - // Edges: UF(1), FR(8), DF(5), FL(9). - // U->R. - // UF(1) -> FR(8). - // FR(8) -> DF(5). - // DF(5) -> FL(9). - // FL(9) -> UF(1). - // P[1]=8, P[5]=9, P[8]=5, P[9]=1. - ep: [0, 8, 2, 3, 4, 9, 6, 7, 5, 1, 10, 11], - // FLIP: F and B moves flip edges. - // 1 -> 1, 5 -> 1, 8 -> 1, 9 -> 1. - eo: [0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0] - }, - B: { - // B (CW) - // Corners: UBR(3), ULB(2), DBL(6), DRB(7). - // B moves U to L. - // UBR(3) -> ULB(2). - // ULB(2) -> DBL(6). - // DBL(6) -> DRB(7). - // DRB(7) -> UBR(3). - // Cycle: 3->2, 2->6, 6->7, 7->3. - // P[2]=6, P[3]=2, P[6]=7, P[7]=3. - cp: [0, 1, 6, 2, 4, 5, 7, 3], - // Twist: - // UBR(3) -> ULB. (-1). - // ULB(2) -> DBL. (+1). - // DBL(6) -> DRB. (-1). - // DRB(7) -> UBR. (+1). - // 2:1, 3:2, 6:2, 7:1. - co: [0, 0, 1, 2, 0, 0, 2, 1], - - // Edges: UB(3), BL(10), DB(7), BR(11). - // U->L. - // UB(3) -> BL(10). - // BL(10) -> DB(7). - // DB(7) -> BR(11). - // BR(11) -> UB(3). - // P[3]=10, P[7]=11, P[10]=7, P[11]=3. - ep: [0, 1, 2, 10, 4, 5, 6, 11, 8, 9, 7, 3], - // FLIP - eo: [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1] - } -} - -export class DeepCube { - constructor() { - this.reset() - } - - reset() { - // Identity State - this.cp = [0, 1, 2, 3, 4, 5, 6, 7] - this.co = [0, 0, 0, 0, 0, 0, 0, 0] - this.ep = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] - this.eo = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - } - - move(moveStr) { - const base = moveStr[0] - const def = MOVES[base] - if (!def) return - - let count = 1 - if (moveStr.endsWith('2')) count = 2 - if (moveStr.endsWith("'")) count = 3 // 3 CW = 1 CCW - - for (let k = 0; k < count; k++) { - this.applyPrimitive(def) - } - } - - applyPrimitive(def) { - // Permutation: p[i] moves to def.p[i]. - // New[def.p[i]] = Old[p[i]]. - // We want to track where the pieces ARE. - - // Correct application: - // next_cp[i] = cp[def.cp[i]] ? - // No. def.cp[i] says "Position i comes from position P[i]" ? No. - // I defined def.cp[i] as "Piece at i goes to def.cp[i]". - - // Let's verify: - // U: 0->1. - // Standard Math: (P * S)[x] = P[S[x]]. (S applied first??) - // Here we are applying Move P to State S. - // New State S' = P * S. - // This usually implies: Piece at pos i in new state is... - // Let's trace one piece. - // Piece X is at pos 0. - // Move U: 0->1. - // New state: Piece X should be at pos 1. - // So new_cp[1] = Piece X. - // new_cp[def.cp[i]] = cp[i]. - - const new_cp = [...this.cp] - const new_co = [...this.co] - const new_ep = [...this.ep] - const new_eo = [...this.eo] - - // Update Corners - for (let i = 0; i < 8; i++) { - const dest = def.cp[i] - new_cp[dest] = this.cp[i] - // Orientation follows the piece - // Twist adds to existing twist - new_co[dest] = (this.co[i] + def.co[i]) % 3 - } - - // Update Edges - for (let i = 0; i < 12; i++) { - const dest = def.ep[i] - new_ep[dest] = this.ep[i] - // Orientation - new_eo[dest] = (this.eo[i] + def.eo[i]) % 2 - } - - this.cp = new_cp - this.co = new_co - this.ep = new_ep - this.eo = new_eo - } - - validate() { - const errors = []; - - // Check exact set of pieces (Permutation Validity) - const cSet = new Set(this.cp); - if (cSet.size !== 8) errors.push('Invalid Corner Permutation (duplicates/missing)'); - const eSet = new Set(this.ep); - if (eSet.size !== 12) errors.push('Invalid Edge Permutation (duplicates/missing)'); - - // Sum of Twists (Corners) % 3 == 0 - const twistSum = this.co.reduce((a, b) => a + b, 0); - if (twistSum % 3 !== 0) errors.push(`Twist Sum Error: ${twistSum}`); - - // Sum of Flips (Edges) % 2 == 0 - const flipSum = this.eo.reduce((a, b) => a + b, 0); - if (flipSum % 2 !== 0) errors.push(`Flip Sum Error: ${flipSum}`); - - // Parity Check (Corner Parity must equal Edge Parity) - const cParity = this.getPermutationParity(this.cp); - const eParity = this.getPermutationParity(this.ep); - if (cParity !== eParity) errors.push(`Parity Mismatch: Corner=${cParity}, Edge=${eParity}`); - - return { valid: errors.length === 0, errors }; - } - - getPermutationParity(p) { - const n = p.length; - const visited = new Array(n).fill(false); - let swaps = 0; - for (let i = 0; i < n; i++) { - if (!visited[i]) { - let curr = i; - let cycleLen = 0; - while (!visited[curr]) { - visited[curr] = true; - curr = p[curr]; - cycleLen++; - } - swaps += (cycleLen - 1); - } - } - return swaps % 2; - } - - - /** - * Converts abstract state to physical cubies for rendering. - * Maps Slot Positions (Where it is) -> Piece Colors (What it is) with Orientation. - */ - toCubies() { - // Definitions must align with indexes - // Corners: 0:URF, 1:UFL, 2:ULB, 3:UBR, 4:DFR, 5:DLF, 6:DBL, 7:DRB - const cornerSlots = [ - { x: 1, y: 1, z: 1 }, // 0 URF - { x: -1, y: 1, z: 1 }, // 1 UFL - { x: -1, y: 1, z: -1 }, // 2 ULB - { x: 1, y: 1, z: -1 }, // 3 UBR - { x: 1, y: -1, z: 1 }, // 4 DFR - { x: -1, y: -1, z: 1 }, // 5 DLF - { x: -1, y: -1, z: -1 },// 6 DBL - { x: 1, y: -1, z: -1 } // 7 DRB - ]; - - // Edges: 0:UR, 1:UF, 2:UL, 3:UB, 4:DR, 5:DF, 6:DL, 7:DB, 8:FR, 9:FL, 10:BL, 11:BR - const edgeSlots = [ - { x: 1, y: 1, z: 0 }, // 0 UR - { x: 0, y: 1, z: 1 }, // 1 UF - { x: -1, y: 1, z: 0 }, // 2 UL - { x: 0, y: 1, z: -1 }, // 3 UB - { x: 1, y: -1, z: 0 }, // 4 DR - { x: 0, y: -1, z: 1 }, // 5 DF - { x: -1, y: -1, z: 0 }, // 6 DL - { x: 0, y: -1, z: -1 }, // 7 DB - { x: 1, y: 0, z: 1 }, // 8 FR - { x: -1, y: 0, z: 1 }, // 9 FL - { x: -1, y: 0, z: -1 }, // 10 BL - { x: 1, y: 0, z: -1 } // 11 BR - ]; - - // Centers (Fixed) - const centers = [ - { id: 'c0', x: 0, y: 1, z: 0, faces: { up: 'white' } }, - { id: 'c1', x: 0, y: -1, z: 0, faces: { down: 'yellow' } }, - { id: 'c2', x: 0, y: 0, z: 1, faces: { front: 'green' } }, - { id: 'c3', x: 0, y: 0, z: -1, faces: { back: 'blue' } }, - { id: 'c4', x: -1, y: 0, z: 0, faces: { left: 'orange' } }, - { id: 'c5', x: 1, y: 0, z: 0, faces: { right: 'red' } }, - { id: 'core', x: 0, y: 0, z: 0, faces: {} } - ]; - - const cubies = [...centers]; - - // Piece Definition (Solved State Colors) - const getCornerColors = (id) => { - const map = [ - { up: 'white', right: 'red', front: 'green' }, // 0 - { up: 'white', front: 'green', left: 'orange' }, // 1 - { up: 'white', left: 'orange', back: 'blue' }, // 2 - { up: 'white', back: 'blue', right: 'red' }, // 3 - { down: 'yellow', right: 'red', front: 'green' }, // 4 - { down: 'yellow', front: 'green', left: 'orange' }, // 5 - { down: 'yellow', left: 'orange', back: 'blue' }, // 6 - { down: 'yellow', back: 'blue', right: 'red' } // 7 - ]; - return map[id]; - }; - - const getEdgeColors = (id) => { - const map = [ - { up: 'white', right: 'red' }, // 0 - { up: 'white', front: 'green' }, // 1 - { up: 'white', left: 'orange' }, // 2 - { up: 'white', back: 'blue' }, // 3 - { down: 'yellow', right: 'red' }, // 4 - { down: 'yellow', front: 'green' }, // 5 - { down: 'yellow', left: 'orange' }, // 6 - { down: 'yellow', back: 'blue' }, // 7 - { front: 'green', right: 'red' }, // 8 - { front: 'green', left: 'orange' }, // 9 - { back: 'blue', left: 'orange' }, // 10 - { back: 'blue', right: 'red' } // 11 - ]; - return map[id]; - }; - - // CORNERS - const pKeys = [ - ['up', 'right', 'front'], // 0 - ['up', 'front', 'left'], // 1 - ['up', 'left', 'back'], // 2 - ['up', 'back', 'right'], // 3 - ['down', 'right', 'front'], // 4 - ['down', 'front', 'left'], // 5 - ['down', 'left', 'back'], // 6 - ['down', 'back', 'right'] // 7 - ]; - - for (let i = 0; i < 8; i++) { - const pieceId = this.cp[i]; // Which physical piece is here - const orientation = this.co[i]; // Twist: 0, 1 (CW), 2 (CCW) - const slot = cornerSlots[i]; - - const baseColors = getCornerColors(pieceId); - const slotKeys = pKeys[i]; // Keys of the SLOT - // Primary colors of the PIECE - const pieceKeys = pKeys[pieceId]; // Keys of the PIECE - const colors = [baseColors[pieceKeys[0]], baseColors[pieceKeys[1]], baseColors[pieceKeys[2]]]; - - const faces = {}; - // Apply twist - // Shift 0: S[0]=C[0], S[1]=C[1], S[2]=C[2] - // Shift 1: S[0]=C[2], S[1]=C[0], S[2]=C[1] (CW Twist: Colors rotate CW relative to keys) - // Shift 2: S[0]=C[1], S[1]=C[2], S[2]=C[0] - - // Formula: index k gets color (k - o + 3) % 3 - faces[slotKeys[0]] = colors[(0 - orientation + 3) % 3]; - faces[slotKeys[1]] = colors[(1 - orientation + 3) % 3]; - faces[slotKeys[2]] = colors[(2 - orientation + 3) % 3]; - - cubies.push({ id: `corn${pieceId}`, x: slot.x, y: slot.y, z: slot.z, faces }); - } - - // EDGES - const eKeys = [ - ['up', 'right'], // 0 UR - ['up', 'front'], // 1 UF - ['up', 'left'], // 2 UL - ['up', 'back'], // 3 UB - ['down', 'right'], // 4 DR - ['down', 'front'], // 5 DF - ['down', 'left'], // 6 DL - ['down', 'back'], // 7 DB - ['front', 'right'], // 8 FR - ['front', 'left'], // 9 FL - ['back', 'left'], // 10 BL - ['back', 'right'] // 11 BR - ]; - - for (let i = 0; i < 12; i++) { - const pieceId = this.ep[i]; - const flip = this.eo[i]; - const slot = edgeSlots[i]; - const baseColors = getEdgeColors(pieceId); - - const pieceKeys = eKeys[pieceId]; - const colors = [baseColors[pieceKeys[0]], baseColors[pieceKeys[1]]]; - - const slotKeys = eKeys[i]; - - const faces = {}; - if (flip === 0) { - faces[slotKeys[0]] = colors[0]; - faces[slotKeys[1]] = colors[1]; - } else { - faces[slotKeys[0]] = colors[1]; - faces[slotKeys[1]] = colors[0]; - } - cubies.push({ id: `edge${pieceId}`, x: slot.x, y: slot.y, z: slot.z, faces }); - } - - return cubies; - } - - rotateLayer(axis, index, dir) { - // axis: 'x', 'y', 'z' - // index: -1, 0, 1 - // dir: 1 (Visual CCW / Logic U'), -1 (Visual CW / Logic U) - - let move = ''; - - if (axis === 'y') { - if (index === 1) { // Up Layer - move = dir === 1 ? "U'" : "U"; - } else if (index === -1) { // Down Layer - // D move is Bottom CW (+Y rotation) -> Visual CCW (dir=1). - move = dir === 1 ? "D" : "D'"; - } - } - else if (axis === 'x') { - if (index === 1) { // Right Layer - // R is -X rotation -> Visual CW (dir=-1). - move = dir === 1 ? "R'" : "R"; - } else if (index === -1) { // Left Layer - // L is +X rotation -> Visual CCW (dir=1). - move = dir === 1 ? "L" : "L'"; - } - } - else if (axis === 'z') { - if (index === 1) { // Front Layer - // F is -Z rotation -> Visual CW (dir=-1). - move = dir === 1 ? "F'" : "F"; - } else if (index === -1) { // Back Layer - // B is +Z rotation -> Visual CCW (dir=1). - move = dir === 1 ? "B" : "B'"; - } - } - - if (move) { - this.move(move); - } - } -} diff --git a/src/utils/Matrix4.js b/src/utils/Matrix4.js deleted file mode 100644 index a40a9a5..0000000 --- a/src/utils/Matrix4.js +++ /dev/null @@ -1,112 +0,0 @@ -export class Matrix4 { - constructor() { - this.elements = [ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]; - } - - static identity() { - return new Matrix4(); - } - - multiply(other) { - const a = this.elements; - const b = other.elements; - const result = new Matrix4(); - const r = result.elements; - - // a is row-major? No, CSS matrix3d is column-major. - // Let's stick to column-major as per WebGL/CSS standard. - // r[0] = a[0]*b[0] + a[4]*b[1] + a[8]*b[2] + a[12]*b[3] ... - - for (let i = 0; i < 4; i++) { // Column of B - for (let j = 0; j < 4; j++) { // Row of A - let sum = 0; - for (let k = 0; k < 4; k++) { - sum += a[j + k * 4] * b[i * 4 + k]; // Correct for column-major storage - } - r[j + i * 4] = sum; - } - } - return result; - } - - // Multiply this * other - multiplySelf(other) { - this.elements = this.multiply(other).elements; - return this; - } - - // Multiply other * this (pre-multiply) - premultiply(other) { - this.elements = other.multiply(this).elements; - return this; - } - - static translation(x, y, z) { - const m = new Matrix4(); - m.elements[12] = x; - m.elements[13] = y; - m.elements[14] = z; - return m; - } - - static rotationX(angleRad) { - const m = new Matrix4(); - const c = Math.cos(angleRad); - const s = Math.sin(angleRad); - m.elements[5] = c; - m.elements[6] = s; - m.elements[9] = -s; - m.elements[10] = c; - return m; - } - - static rotationY(angleRad) { - const m = new Matrix4(); - const c = Math.cos(angleRad); - const s = Math.sin(angleRad); - m.elements[0] = c; - m.elements[2] = -s; - m.elements[8] = s; - m.elements[10] = c; - return m; - } - - static rotationZ(angleRad) { - const m = new Matrix4(); - const c = Math.cos(angleRad); - const s = Math.sin(angleRad); - m.elements[0] = c; - m.elements[1] = s; - m.elements[4] = -s; - m.elements[5] = c; - return m; - } - - translate(x, y, z) { - return this.multiplySelf(Matrix4.translation(x, y, z)); - } - - rotateX(deg) { - return this.multiplySelf(Matrix4.rotationX(deg * Math.PI / 180)); - } - - rotateY(deg) { - return this.multiplySelf(Matrix4.rotationY(deg * Math.PI / 180)); - } - - rotateZ(deg) { - return this.multiplySelf(Matrix4.rotationZ(deg * Math.PI / 180)); - } - - toCSS() { - // CSS matrix3d takes comma-separated values - // Round to avoid scientific notation like 1e-15 which CSS hates - const rounded = this.elements.map(v => Math.abs(v) < 1e-10 ? 0 : v); - return `matrix3d(${rounded.join(',')})`; - } -}