Refactor: Implement SmartCube renderer, improve UI styling, and fix gaps

This commit is contained in:
2026-02-22 04:35:59 +00:00
parent 57abfd6b80
commit b5ddc21662
4168 changed files with 763782 additions and 1008 deletions

627
node_modules/.vite/deps/@gkucmierz_utils.js generated vendored Normal file
View File

@@ -0,0 +1,627 @@
import {
mod,
modBI
} from "./chunk-Y44FVENP.js";
import {
__privateAdd,
__privateGet
} from "./chunk-HPRLEMBT.js";
// node_modules/@gkucmierz/utils/src/SetCnt.mjs
var _map;
var SetCnt = class {
constructor(iter) {
__privateAdd(this, _map, /* @__PURE__ */ new Map());
for (const el of iter ?? []) {
this.add(el);
}
}
add(el) {
const cnt = this.cnt(el);
__privateGet(this, _map).set(el, cnt + 1);
return this;
}
has(el) {
return __privateGet(this, _map).has(el);
}
delete(el) {
if (!__privateGet(this, _map).has(el)) return false;
const cnt = this.cnt(el);
if (cnt === 1) return this.deleteAll(el);
__privateGet(this, _map).set(el, cnt - 1);
return true;
}
deleteAll(el) {
__privateGet(this, _map).delete(el);
return true;
}
cnt(el) {
return __privateGet(this, _map).get(el) ?? 0;
}
*[Symbol.iterator]() {
for (const el of __privateGet(this, _map)) {
yield el;
}
}
entries() {
return this;
}
*values() {
for (const [el, cnt] of __privateGet(this, _map)) {
yield el;
}
}
*keys() {
for (const [el, cnt] of __privateGet(this, _map)) {
yield cnt;
}
}
};
_map = new WeakMap();
// node_modules/@gkucmierz/utils/src/base64.mjs
var toBase64 = (string) => {
const codeUnits = new Uint16Array(string.length);
for (let i = 0; i < codeUnits.length; i++) {
codeUnits[i] = string.charCodeAt(i);
}
return btoa(String.fromCharCode(...new Uint8Array(codeUnits.buffer)));
};
var fromBase64 = (encoded) => {
const binary = atob(encoded);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < bytes.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
return String.fromCharCode(...new Uint16Array(bytes.buffer));
};
var toUrl = {
"+": "-",
"/": "_"
};
var toBase64Url = (string) => {
return toBase64(string).replace(/[\+\/]/g, (c) => toUrl[c]);
};
var fromUrl = {
"-": "+",
"_": "/"
};
var fromBase64Url = (encoded) => {
return fromBase64(encoded.replace(/[\-\_]/g, (c) => fromUrl[c]));
};
// node_modules/@gkucmierz/utils/src/bijective-numeration.mjs
var num2bijective = (num, alpha = "12") => {
const len = alpha.length;
let c = 0;
let x = 1;
while (num >= x) {
c++;
num -= x;
x *= len;
}
const res = [];
for (let i = 0; i < c; i++) {
const rem = num % len;
res.unshift(alpha.charAt(num % len));
num = (num - rem) / len;
}
return res.join("");
};
var bijective2num = (str, alpha = "12") => {
const map = new Map([...alpha].map((c, i) => [c, i]));
let res = 0;
const len = alpha.length;
return [...str].reduce((res2, c) => {
return res2 * len + map.get(c) + 1;
}, 0);
};
var num2bijectiveBI = (num, alpha = "12") => {
const len = BigInt(alpha.length);
let c = 0n;
let x = 1n;
while (num >= x) {
c++;
num -= x;
x *= len;
}
const res = [];
for (let i = 0n; i < c; i++) {
const rem = num % len;
res.unshift(alpha.charAt(Number(num % len)));
num = (num - rem) / len;
}
return res.join("");
};
var bijective2numBI = (str, alpha = "12") => {
const map = new Map([...alpha].map((c, i) => [c, BigInt(i)]));
let res = 0n;
const len = BigInt(alpha.length);
return [...str].reduce((res2, c) => {
return res2 * len + map.get(c) + 1n;
}, 0n);
};
// node_modules/@gkucmierz/utils/src/binary-search.mjs
var binarySearchArr = (arr, target) => {
let [a, b] = [0, arr.length];
let lm;
while (b - a > 0) {
const mid = (a + b) / 2 | 0;
const val = arr[mid];
if (target < val) {
b = mid;
} else if (val < target) {
a = mid;
} else {
return mid;
}
if (lm === mid) break;
lm = mid;
}
return -1;
};
var binarySearchLE = (arr, target) => {
let [a, b] = [0, arr.length];
let lm;
while (b - a > 0) {
const mid = (a + b) / 2 | 0;
const val = arr[mid];
if (target < val) {
b = mid;
} else if (val <= target) {
a = mid;
}
if (lm === mid) return mid;
lm = mid;
}
return -1;
};
var binarySearchGE = (arr, target) => {
let [a, b] = [0, arr.length];
let lm;
while (b - a > 0) {
const mid = (a + b) / 2 | 0;
const val = arr[mid];
if (target > val) {
a = mid;
} else if (val >= target) {
b = mid;
}
if (lm === mid) return mid + 1;
lm = mid;
}
return 0;
};
var binarySearchRangeIncl = (arr, target) => {
return [
binarySearchGE(arr, target),
binarySearchLE(arr, target)
];
};
// node_modules/@gkucmierz/utils/src/copy-case.mjs
var copyCase = (word, from) => {
const isLower = (w) => w.toLowerCase() === w;
const isUpper = (w) => w.toUpperCase() === w;
if (isLower(from)) return word.toLowerCase();
if (isUpper(from)) return word.toUpperCase();
if (isUpper(from[0]) && isLower(from.slice(1))) {
return word[0].toUpperCase() + word.slice(1).toLowerCase();
}
return word;
};
// node_modules/@gkucmierz/utils/src/egcd.mjs
var egcd = (a, b) => {
let [x, y] = [0, 1];
let [u, v] = [1, 0];
while (a !== 0) {
const [q, r] = [b / a | 0, b % a];
const [m, n] = [x - u * q, y - v * q];
[b, a, x, y, u, v] = [a, r, u, v, m, n];
}
return [b, x, y];
};
// node_modules/@gkucmierz/utils/src/factors.mjs
var factors = (n) => {
if (n < 2) return [];
const res = [];
let max = Math.floor(Math.sqrt(n));
for (let i = 2; i <= max; ++i) {
if (n % i === 0) {
res.push(i);
n /= i;
max = Math.floor(Math.sqrt(n));
i = (Math.min(...res) || 2) - 1;
}
}
res.push(n);
return res;
};
var factorsBI = (n) => {
if (n < 2n) return [];
const res = [];
for (let i = 2n; i * i <= n; ++i) {
if (n % i === 0n) {
res.push(i);
n /= i;
i = 1n;
}
}
res.push(n);
return res;
};
// node_modules/@gkucmierz/utils/src/gcd.mjs
var getGCD = (ZERO) => {
return (a, b) => {
if (a < ZERO) a = -a;
if (b < ZERO) b = -b;
if (b > a) {
[a, b] = [b, a];
}
while (true) {
if (b === ZERO) return a;
a %= b;
if (a === ZERO) return b;
b %= a;
}
};
};
var gcd = getGCD(0);
var gcdBI = getGCD(0n);
// node_modules/@gkucmierz/utils/src/get-type.mjs
var getType = (val) => {
const str = Object.prototype.toString.call(val);
return str.slice(8, -1).toLowerCase();
};
// node_modules/@gkucmierz/utils/src/gpn.mjs
var getGpn = (zero, one, two, three) => {
const gk = (k) => k * (three * k - one) / two;
return (n) => {
const m = (n + one) / two | zero;
return n % two === zero ? gk(-m) : gk(m);
};
};
var gpn = getGpn(0, 1, 2, 3);
var gpnBI = getGpn(0n, 1n, 2n, 3n);
// node_modules/@gkucmierz/utils/src/heap.mjs
var Heap = (valFn = (n) => n) => {
const arr = [-1];
const up = (idx) => {
while (idx > 1) {
const ni = idx / 2 | 0;
if (valFn(arr[idx]) < valFn(arr[ni])) {
[arr[idx], arr[ni]] = [arr[ni], arr[idx]];
}
idx = ni;
}
return idx;
};
return {
add: (el) => up(arr.push(el) - 1),
take: () => {
const len = arr.length;
if (len <= 1) return [][0];
let idx = 1;
const res = arr[idx];
while (idx < len) {
const ia = idx * 2;
const ib = idx * 2 + 1;
if (ia >= len) break;
if (ib >= len || valFn(arr[ia]) < valFn(arr[ib])) {
arr[idx] = arr[ia];
idx = ia;
} else {
arr[idx] = arr[ib];
idx = ib;
}
}
if (idx === arr.length - 1) {
arr.pop();
} else {
arr[idx] = arr.pop();
up(idx);
}
return res;
},
size: () => arr.length - 1,
data: () => arr.slice(1)
};
};
// node_modules/@gkucmierz/utils/src/square-root.mjs
var squareRoot = (n) => n ** 0.5;
var squareRootBI = (n) => {
if (n === 0n) return 0n;
if (n < 4n) return 1n;
if (n < 9n) return 2n;
if (n < 16n) return 3n;
let res = BigInt(n.toString().substr(0, n.toString().length / 2));
let last;
while (true) {
last = res;
res = (res + n / res) / 2n;
const p = res * res;
if (p === n) return res;
if (last === res) return res;
const next = p + res * 2n - 1n;
if (n > next) return res;
}
return res;
};
// node_modules/@gkucmierz/utils/src/herons-formula.mjs
var getHeronsFormula = (four, sq) => (a, b, c) => {
return sq((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c)) / four;
};
var heronsFormula = getHeronsFormula(4, (n) => n ** 0.5);
var heronsFormulaBI = getHeronsFormula(4n, squareRootBI);
// node_modules/@gkucmierz/utils/src/lcm.mjs
var getLcm = (gcd2) => {
return (a, b) => a * b / gcd2(a, b);
};
var lcm = getLcm(gcd);
var lcmBI = getLcm(gcdBI);
// node_modules/@gkucmierz/utils/src/list-node.mjs
var ListNode = class _ListNode {
constructor(val = 0, next = null) {
this.val = val;
this.next = next;
}
toArr() {
const ret = [];
let node = this;
const set = /* @__PURE__ */ new Set();
while (node) {
if (set.has(node)) throw Error("Cyclic reference detected");
set.add(node);
ret.push(node.val);
node = node.next;
}
return ret;
}
static fromArr(iter) {
const head = new _ListNode();
let node = head;
for (let val of iter) {
node.next = new _ListNode(val);
node = node.next;
}
return head.next;
}
};
// node_modules/@gkucmierz/utils/src/matrix.mjs
var matrixAsArray = (matrix) => {
const [h, w] = [matrix.length, matrix[0].length];
return new Proxy([], {
get(target, prop, receiver) {
if (prop === "length") return h * w;
const idx = +prop;
const col = idx % w;
const row = (idx - col) / w;
return matrix[row][col];
}
});
};
// node_modules/@gkucmierz/utils/src/memoize.mjs
var memoize = (fn) => {
const maps = [];
const getLeafMap = (args) => {
if (!maps[args.length]) maps[args.length] = /* @__PURE__ */ new Map();
const map = maps[args.length];
const leaf = args.reduce((map2, arg) => {
if (map2.has(arg)) return map2.get(arg);
const tmp = /* @__PURE__ */ new Map();
map2.set(arg, tmp);
return tmp;
}, map);
return leaf;
};
const zero = {
called: false,
ret: null
};
return function() {
const args = [...arguments];
if (args.length === 0) {
if (zero.called) return zero.ret;
zero.called = true;
return zero.ret = fn();
}
const [firstArg, ...restArgs] = args;
const map = getLeafMap(restArgs);
if (map.has(firstArg)) return map.get(firstArg);
const ret = fn(...args);
map.set(firstArg, ret);
return ret;
};
};
// node_modules/@gkucmierz/utils/src/phi.mjs
var getPhiEuler = (factors2) => {
return (n) => {
return [...new Set(factors2(n))].reduce((res, f) => res - res / f, n);
};
};
var phi = getPhiEuler(factors);
var phiBI = getPhiEuler(factorsBI);
// node_modules/@gkucmierz/utils/src/pow-mod.mjs
var getPowMod = (ZERO, ONE, TWO, floor) => {
return (base, exponent, modulus = null) => {
if (modulus === null) return base ** exponent;
if (modulus === ONE) return ZERO;
let result = ONE;
base = base % modulus;
while (exponent > ZERO) {
if (exponent % TWO === ONE) {
result = result * base % modulus;
}
exponent = floor(exponent / TWO);
base = base * base % modulus;
}
return result;
};
};
var powMod = getPowMod(0, 1, 2, (n) => Math.floor(n));
var powModBI = getPowMod(0n, 1n, 2n, (n) => n);
// node_modules/@gkucmierz/utils/src/range-array.mjs
var range2array = (ranges) => {
return ranges.reduce((arr, range) => {
const min = range[0];
const max = range[1] ?? min;
return arr.push(
...new Array(max - min + 1).fill(0).map((n, i) => min + i)
), arr;
}, []);
};
var array2range = (arr) => {
const ranges = [];
let last = arr[0];
let begin = last;
for (let i = 1; i <= arr.length; ++i) {
const n = arr[i];
if (n !== last + 1) {
ranges.push([begin, last]);
begin = n;
}
last = n;
}
return ranges;
};
// node_modules/@gkucmierz/utils/src/tonelli-shanks.mjs
var tonelliShanksBI = (n, p) => {
let s = 0n;
let q = p - 1n;
while ((q & 1n) === 0n) {
q /= 2n;
++s;
}
if (s === 1n) {
const r2 = powModBI(n, (p + 1n) / 4n, p);
if (r2 * r2 % p === n) return r2;
return 0n;
}
let z = 1n;
while (powModBI(++z, (p - 1n) / 2n, p) !== p - 1n) ;
let c = powModBI(z, q, p);
let r = powModBI(n, (q + 1n) / 2n, p);
let t = powModBI(n, q, p);
let m = s;
while (t !== 1n) {
let tt = t;
let i = 0n;
while (tt !== 1n) {
tt = tt * tt % p;
++i;
if (i === m) return 0n;
}
let b = powModBI(c, powModBI(2n, m - i - 1n, p - 1n), p);
let b2 = b * b % p;
r = r * b % p;
t = t * b2 % p;
c = b2;
m = i;
}
if (r * r % p === n) return r;
return 0n;
};
// node_modules/@gkucmierz/utils/main.mjs
var main_default = [
SetCnt,
fromBase64,
fromBase64Url,
toBase64,
toBase64Url,
bijective2num,
bijective2numBI,
num2bijective,
num2bijectiveBI,
binarySearchArr,
copyCase,
egcd,
factors,
factorsBI,
gcd,
gcdBI,
getType,
gpn,
gpnBI,
Heap,
heronsFormula,
heronsFormulaBI,
lcm,
lcmBI,
ListNode,
matrixAsArray,
memoize,
mod,
modBI,
phi,
phiBI,
powMod,
powModBI,
array2range,
range2array,
squareRoot,
squareRootBI,
tonelliShanksBI
];
export {
Heap,
ListNode,
SetCnt,
array2range,
bijective2num,
bijective2numBI,
binarySearchArr,
binarySearchGE,
binarySearchLE,
binarySearchRangeIncl,
copyCase,
main_default as default,
egcd,
factors,
factorsBI,
fromBase64,
fromBase64Url,
gcd,
gcdBI,
getType,
gpn,
gpnBI,
heronsFormula,
heronsFormulaBI,
lcm,
lcmBI,
matrixAsArray,
memoize,
mod,
modBI,
num2bijective,
num2bijectiveBI,
phi,
phiBI,
powMod,
powModBI,
range2array,
squareRoot,
squareRootBI,
toBase64,
toBase64Url,
tonelliShanksBI
};
//# sourceMappingURL=@gkucmierz_utils.js.map

7
node_modules/.vite/deps/@gkucmierz_utils.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
import {
mod,
modBI
} from "./chunk-Y44FVENP.js";
import "./chunk-HPRLEMBT.js";
export {
mod,
modBI
};

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

73
node_modules/.vite/deps/_metadata.json generated vendored Normal file
View File

@@ -0,0 +1,73 @@
{
"hash": "0e64a169",
"configHash": "b404d51e",
"lockfileHash": "61dfa545",
"browserHash": "6a81128a",
"optimized": {
"vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "57763d4d",
"needsInterop": false
},
"lucide-vue-next": {
"src": "../../lucide-vue-next/dist/esm/lucide-vue-next.js",
"file": "lucide-vue-next.js",
"fileHash": "a749ef2a",
"needsInterop": false
},
"@gkucmierz/utils": {
"src": "../../@gkucmierz/utils/main.mjs",
"file": "@gkucmierz_utils.js",
"fileHash": "eb2e66b1",
"needsInterop": false
},
"@gkucmierz/utils/src/mod.mjs": {
"src": "../../@gkucmierz/utils/src/mod.mjs",
"file": "@gkucmierz_utils_src_mod__mjs.js",
"fileHash": "909cf74a",
"needsInterop": false
},
"matrix-js": {
"src": "../../matrix-js/lib/index.js",
"file": "matrix-js.js",
"fileHash": "34a2c640",
"needsInterop": true
},
"rubiks-js/src/state/index.js": {
"src": "../../rubiks-js/src/state/index.js",
"file": "rubiks-js_src_state_index__js.js",
"fileHash": "dfb6e813",
"needsInterop": false
},
"rubiks-js": {
"src": "../../rubiks-js/src/index.js",
"file": "rubiks-js.js",
"fileHash": "8b154ac9",
"needsInterop": false
},
"rubiks-js/src/ui/cubie.js": {
"src": "../../rubiks-js/src/ui/cubie.js",
"file": "rubiks-js_src_ui_cubie__js.js",
"fileHash": "fb652cb6",
"needsInterop": false
}
},
"chunks": {
"chunk-YIK32INT": {
"file": "chunk-YIK32INT.js"
},
"chunk-ROHLD3FA": {
"file": "chunk-ROHLD3FA.js"
},
"chunk-U3LI7FBV": {
"file": "chunk-U3LI7FBV.js"
},
"chunk-Y44FVENP": {
"file": "chunk-Y44FVENP.js"
},
"chunk-HPRLEMBT": {
"file": "chunk-HPRLEMBT.js"
}
}
}

29
node_modules/.vite/deps/chunk-HPRLEMBT.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
var __defProp = Object.defineProperty;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __typeError = (msg) => {
throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
export {
__commonJS,
__export,
__publicField,
__privateGet,
__privateAdd,
__privateSet,
__privateMethod
};

7
node_modules/.vite/deps/chunk-HPRLEMBT.js.map generated vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

881
node_modules/.vite/deps/chunk-ROHLD3FA.js generated vendored Normal file
View File

@@ -0,0 +1,881 @@
import {
__privateAdd,
__privateGet,
__privateMethod,
__privateSet,
__publicField
} from "./chunk-HPRLEMBT.js";
// node_modules/rubiks-js/src/math/abstractVector.js
var Vector = class {
/**
* @abstract
* @param {number} _a
*/
scale(_a) {
throw new Error("must be implemented in subclass");
}
/**
* @abstract
* @param {V} _v
* @returns {V}
*/
add(_v) {
throw new Error("must be implemented in subclass");
}
/**
* @abstract
* @param {V} _v
* @return {V}
*/
sub(_v) {
throw new Error("must be implemented in subclass");
}
/**
* @abstract
* @param {V} _v
* @return {V}
*/
mult(_v) {
throw new Error("must be implemented in subclass");
}
/**
* @abstract
* @param {V} _v
* @return {number}
*/
dot(_v) {
throw new Error("must be implemented in subclass");
}
/**
* @abstract
* @return {number[]}
*/
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);
}
};
// node_modules/rubiks-js/src/math/vector.js
var V2 = class _V2 extends Vector {
/**
* @param {number} x
* @param {number} y
*/
constructor(x, y) {
super();
this.x = x;
this.y = y;
}
/** @param {number} a */
scale(a) {
return new _V2(a * this.x, a * this.y);
}
/** @param {V2} v */
add({ x, y }) {
return new _V2(this.x + x, this.y + y);
}
/** @param {V2} v */
sub({ x, y }) {
return new _V2(this.x - x, this.y - y);
}
/** @param {V2} v */
mult({ x, y }) {
return new _V2(this.x * x, this.y * y);
}
/** @param {V2} v */
dot({ x, y }) {
return this.x * x + this.y * y;
}
toArray() {
return [this.x, this.y];
}
/**
* @param {WebGL2RenderingContext} gl
* @param {WebGLUniformLocation} location
*/
setUniform(gl, location) {
gl.uniform2f(location, this.x, this.y);
}
static get zero() {
return new _V2(0, 0);
}
};
var V3 = class _V3 extends Vector {
/**
* @param {number} x
* @param {number} y
* @param {number} z
*/
constructor(x, y, z) {
super();
this.x = x;
this.y = y;
this.z = z;
}
/** @param {number} a */
scale(a) {
return new _V3(a * this.x, a * this.y, a * this.z);
}
/** @param {V3} v */
add({ x, y, z }) {
return new _V3(this.x + x, this.y + y, this.z + z);
}
/** @param {V3} v */
sub({ x, y, z }) {
return new _V3(this.x - x, this.y - y, this.z - z);
}
/** @param {V3} v */
mult({ x, y, z }) {
return new _V3(this.x * x, this.y * y, this.z * z);
}
/** @param {V3} v */
cross({ x, y, z }) {
return new _V3(this.y * z - this.z * y, this.z * x - this.x * z, this.x * y - this.y * x);
}
/** @param {V3} v */
dot({ x, y, z }) {
return this.x * x + this.y * y + this.z * z;
}
toArray() {
return [this.x, this.y, this.z];
}
/**
* @param {WebGL2RenderingContext} gl
* @param {WebGLUniformLocation} location
*/
setUniform(gl, location) {
gl.uniform3f(location, this.x, this.y, this.z);
}
toV2() {
return new V2(this.x, this.y);
}
static get zero() {
return new _V3(0, 0, 0);
}
static get one() {
return new _V3(1, 1, 1);
}
static get up() {
return new _V3(0, 1, 0);
}
static get down() {
return new _V3(0, -1, 0);
}
static get left() {
return new _V3(1, 0, 0);
}
static get right() {
return new _V3(-1, 0, 0);
}
static get forward() {
return new _V3(0, 0, 1);
}
static get back() {
return new _V3(0, 0, -1);
}
/**
* @param {V3} v1
* @param {V3} v2
* @param {number} t
*/
static lerp(v1, v2, t) {
return v1.add(v2.sub(v1).scale(t));
}
/**
* @param {V3} v1
* @param {V3} v2
*/
static angle(v1, v2) {
return Math.acos(v1.dot(v2) / Math.sqrt(v1.squareMag * v2.squareMag));
}
/** @param {number} axis */
static getRotationAxis(axis) {
if (axis === 0)
return _V3.right;
if (axis === 1)
return _V3.down;
return _V3.back;
}
};
var V4 = class _V4 extends Vector {
/**
* @param {number} x
* @param {number} y
* @param {number} z
* @param {number} w
*/
constructor(x, y, z, w) {
super();
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}
/** @param {number} a */
scale(a) {
return new _V4(a * this.x, a * this.y, a * this.z, a * this.w);
}
/** @param {V4} v */
add({ x, y, z, w }) {
return new _V4(this.x + x, this.y + y, this.z + z, this.w + w);
}
/** @param {V4} v */
sub({ x, y, z, w }) {
return new _V4(this.x - x, this.y - y, this.z - z, this.w - w);
}
/** @param {V4} v */
mult({ x, y, z, w }) {
return new _V4(this.x * x, this.y * y, this.z * z, this.w * w);
}
/** @param {V4} v */
dot({ x, y, z, w }) {
return this.x * x + this.y * y + this.z * z + this.w * w;
}
toV3() {
return new V3(this.x, this.y, this.z);
}
toArray() {
return [this.x, this.y, this.z, this.w];
}
/**
* @param {WebGL2RenderingContext} gl
* @param {WebGLUniformLocation} location
*/
setUniform(gl, location) {
gl.uniform4f(location, this.x, this.y, this.z, this.w);
}
};
// node_modules/rubiks-js/src/math/matrix.js
var M44 = class _M44 {
/**
* @param {V4} r1
* @param {V4} r2
* @param {V4} r3
* @param {V4} r4
*/
constructor(r1, r2, r3, r4) {
this.r1 = r1;
this.r2 = r2;
this.r3 = r3;
this.r4 = r4;
}
/** @param {number} a */
scale(a) {
return new _M44(this.r1.scale(a), this.r2.scale(a), this.r3.scale(a), this.r4.scale(a));
}
/** @param {M44} m */
add({ r1, r2, r3, r4 }) {
return new _M44(this.r1.add(r1), this.r2.add(r2), this.r3.add(r3), this.r4.add(r4));
}
/** @param {M44} m */
sub({ r1, r2, r3, r4 }) {
return new _M44(this.r1.sub(r1), this.r2.sub(r2), this.r3.sub(r3), this.r4.sub(r4));
}
/**
* @overload
* @param {M44} m
* @return {M44}
*
* @overload
* @param {V4} m
* @return {V4}
*
* @param {M44 | V4} m
*/
mult(m) {
if ("x" in m) {
return new V4(
this.r1.dot(m),
this.r2.dot(m),
this.r3.dot(m),
this.r4.dot(m)
);
}
return new _M44(
new V4(this.r1.dot(m.c1), this.r1.dot(m.c2), this.r1.dot(m.c3), this.r1.dot(m.c4)),
new V4(this.r2.dot(m.c1), this.r2.dot(m.c2), this.r2.dot(m.c3), this.r2.dot(m.c4)),
new V4(this.r3.dot(m.c1), this.r3.dot(m.c2), this.r3.dot(m.c3), this.r3.dot(m.c4)),
new V4(this.r4.dot(m.c1), this.r4.dot(m.c2), this.r4.dot(m.c3), this.r4.dot(m.c4))
);
}
toArray() {
return [...this.r1.toArray(), ...this.r2.toArray(), ...this.r3.toArray(), ...this.r4.toArray()];
}
static get identity() {
return new _M44(
new V4(1, 0, 0, 0),
new V4(0, 1, 0, 0),
new V4(0, 0, 1, 0),
new V4(0, 0, 0, 1)
);
}
get c1() {
return new V4(this.r1.x, this.r2.x, this.r3.x, this.r4.x);
}
get c2() {
return new V4(this.r1.y, this.r2.y, this.r3.y, this.r4.y);
}
get c3() {
return new V4(this.r1.z, this.r2.z, this.r3.z, this.r4.z);
}
get c4() {
return new V4(this.r1.w, this.r2.w, this.r3.w, this.r4.w);
}
/**
* @param {WebGL2RenderingContext} gl
* @param {WebGLUniformLocation} location
*/
setUniform(gl, location) {
const data = new Float32Array(this.toArray());
gl.uniformMatrix4fv(location, true, data);
}
get transpose() {
return new _M44(this.c1, this.c2, this.c3, this.c4);
}
get inverse() {
const [i00, i01, i02, i03] = this.r1.toArray();
const [i10, i11, i12, i13] = this.r2.toArray();
const [i20, i21, i22, i23] = this.r3.toArray();
const [i30, i31, i32, i33] = this.r4.toArray();
const s0 = i00 * i11 - i10 * i01;
const s1 = i00 * i12 - i10 * i02;
const s2 = i00 * i13 - i10 * i03;
const s3 = i01 * i12 - i11 * i02;
const s4 = i01 * i13 - i11 * i03;
const s5 = i02 * i13 - i12 * i03;
const c5 = i22 * i33 - i32 * i23;
const c4 = i21 * i33 - i31 * i23;
const c3 = i21 * i32 - i31 * i22;
const c2 = i20 * i33 - i30 * i23;
const c1 = i20 * i32 - i30 * i22;
const c0 = i20 * i31 - i30 * i21;
const det = s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0;
const invDet = 1 / det;
return new _M44(
new V4(
i11 * c5 - i12 * c4 + i13 * c3,
-i01 * c5 + i02 * c4 - i03 * c3,
i31 * s5 - i32 * s4 + i33 * s3,
-i21 * s5 + i22 * s4 - i23 * s3
),
new V4(
-i10 * c5 + i12 * c2 - i13 * c1,
i00 * c5 - i02 * c2 + i03 * c1,
-i30 * s5 + i32 * s2 - i33 * s1,
i20 * s5 - i22 * s2 + i23 * s1
),
new V4(
i10 * c4 - i11 * c2 + i13 * c0,
-i00 * c4 + i01 * c2 - i03 * c0,
i30 * s4 - i31 * s2 + i33 * s0,
-i20 * s4 + i21 * s2 - i23 * s0
),
new V4(
-i10 * c3 + i11 * c1 - i12 * c0,
i00 * c3 - i01 * c1 + i02 * c0,
-i30 * s3 + i31 * s1 - i32 * s0,
i20 * s3 - i21 * s1 + i22 * s0
)
).scale(invDet);
}
/**
* @param {number} fovy
* @param {number} aspect
* @param {number} near
* @param {number} far
*/
static perspective(fovy, aspect, near, far) {
const tanHalfFovy = Math.tan(fovy / 2);
const x = 1 / (aspect * tanHalfFovy);
const y = 1 / tanHalfFovy;
const fpn = far + near;
const fmn = far - near;
const oon = 0.5 / near;
const oof = 0.5 / far;
const z = -fpn / fmn;
const w = 1 / (oof - oon);
return new _M44(
new V4(x, 0, 0, 0),
new V4(0, y, 0, 0),
new V4(0, 0, z, w),
new V4(0, 0, -1, 0)
);
}
/**
* @param {V3} eye
* @param {V3} center
* @param {V3} up
*/
static lookAt(eye, center, up) {
const za = center.sub(eye).normalized;
const xa = za.cross(up).normalized;
const ya = xa.cross(za);
const xd = -xa.dot(eye);
const yd = -ya.dot(eye);
const zd = za.dot(eye);
return new _M44(
new V4(xa.x, xa.y, xa.z, xd),
new V4(ya.x, ya.y, ya.z, yd),
new V4(-za.x, -za.y, -za.z, zd),
new V4(0, 0, 0, 1)
);
}
};
// node_modules/rubiks-js/src/math/quarternion.js
var Quaternion = class _Quaternion {
/**
* @param {number} real
* @param {V3} im
*/
constructor(real, im) {
this.real = real;
this.im = im;
}
/**
* @param {V3} axis
* @param {number} angle
* @param {boolean} [degree=true]
*/
static fromAngle(axis, angle, degree = true) {
if (degree) {
angle *= Math.PI / 180;
}
const half = angle / 2;
const real = Math.cos(half);
const im = axis.normalized.scale(Math.sin(half));
return new _Quaternion(real, im);
}
get matrix() {
const { x, y, z } = this.im;
const w = this.real;
const xx = x * x;
const yy = y * y;
const zz = z * z;
const xy = x * y;
const xz = x * z;
const xw = x * w;
const yz = y * z;
const yw = y * w;
const zw = z * w;
return new M44(
new V4(1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw), 0),
new V4(2 * (xy + zw), 1 - 2 * (xx + zz), 2 * (yz - xw), 0),
new V4(2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy), 0),
new V4(0, 0, 0, 1)
);
}
/** @param {Quaternion} q */
mult({ real, im }) {
return new _Quaternion(this.real * real - this.im.dot(im), this.im.cross(im).add(im.scale(this.real)).add(this.im.scale(real)));
}
/** @param {V3} v */
rotate(v) {
return new _Quaternion(this.real, this.im.negate).mult(new _Quaternion(0, v)).mult(this).im;
}
get conjugate() {
return new _Quaternion(this.real, this.im.negate);
}
get mag() {
return Math.sqrt(this.real * this.real + this.im.squareMag);
}
/** @param {number} n */
power(n) {
const { mag } = this;
const phi = Math.acos(this.real / mag);
const unit = this.im.normalized;
const scalar = Math.pow(mag, n);
return new _Quaternion(scalar * Math.cos(phi * n), unit.scale(scalar * Math.sin(phi * n)));
}
static get identity() {
return new _Quaternion(1, V3.zero);
}
/**
* @param {Quaternion} q1
* @param {Quaternion} q2
* @param {number} t
*/
static slerp(q1, q2, t) {
return q1.mult(q1.conjugate.mult(q2).power(t));
}
};
// node_modules/rubiks-js/src/ui/program.js
var _program, _uniformMap, _path, _gl, _Program_instances, createShader_fn;
var Program = class {
/**
* @param {string} path
* @param {string} vertexShaderSource
* @param {string} fragmentShaderSource
* @param {WebGL2RenderingContext} gl
*/
constructor(path, vertexShaderSource, fragmentShaderSource, gl) {
__privateAdd(this, _Program_instances);
/** @type {WebGLProgram} */
__privateAdd(this, _program);
/** @type {Map<string, WebGLUniformLocation>} */
__privateAdd(this, _uniformMap);
/** @type {string} */
__privateAdd(this, _path);
/** @type {WebGL2RenderingContext} */
__privateAdd(this, _gl);
__privateSet(this, _path, path);
__privateSet(this, _gl, gl);
const vertexShader = __privateMethod(this, _Program_instances, createShader_fn).call(this, vertexShaderSource, __privateGet(this, _gl).VERTEX_SHADER, "vertex");
const fragmentShader = __privateMethod(this, _Program_instances, createShader_fn).call(this, fragmentShaderSource, __privateGet(this, _gl).FRAGMENT_SHADER, "fragment");
const p = __privateGet(this, _gl).createProgram();
if (!p)
throw new Error("Fatal: webgl could not create program object!");
__privateSet(this, _program, p);
__privateGet(this, _gl).attachShader(__privateGet(this, _program), vertexShader);
__privateGet(this, _gl).attachShader(__privateGet(this, _program), fragmentShader);
__privateGet(this, _gl).linkProgram(__privateGet(this, _program));
const success = __privateGet(this, _gl).getProgramParameter(__privateGet(this, _program), __privateGet(this, _gl).LINK_STATUS);
if (!success) {
const info = __privateGet(this, _gl).getProgramInfoLog(__privateGet(this, _program));
__privateGet(this, _gl).deleteProgram(__privateGet(this, _program));
throw new Error(`Link Program: ${info}`);
}
const numUniforms = (
/** @type {number} */
__privateGet(this, _gl).getProgramParameter(__privateGet(this, _program), __privateGet(this, _gl).ACTIVE_UNIFORMS)
);
const uniformIndices = [...Array(numUniforms).keys()];
const uniformNames = uniformIndices.map((index) => {
const info = __privateGet(this, _gl).getActiveUniform(__privateGet(this, _program), index);
if (info == null) {
throw new Error("failed to get active uniform");
}
const location = __privateGet(this, _gl).getUniformLocation(__privateGet(this, _program), info.name);
if (location == null) {
throw new Error("failed to get uniform location");
}
return (
/** @type {[string, WebGLUniformLocation]} */
[info.name, location]
);
});
__privateSet(this, _uniformMap, new Map(uniformNames));
}
use() {
if (!__privateGet(this, _program)) {
throw new Error("Fatal: program does not exists!");
}
__privateGet(this, _gl).useProgram(__privateGet(this, _program));
}
/**
* @param {string} name
* @param {import('../types').Uniform} u
*/
uniform(name, u) {
const location = __privateGet(this, _uniformMap).get(name);
if (location == void 0) {
throw new Error(`Fatal: unkown name: ${name}`);
}
u.setUniform(__privateGet(this, _gl), location);
}
};
_program = new WeakMap();
_uniformMap = new WeakMap();
_path = new WeakMap();
_gl = new WeakMap();
_Program_instances = new WeakSet();
/**
* @param {string} source
* @param {number} type
* @param {string} typeStr
* @returns {WebGLShader}
*/
createShader_fn = function(source, type, typeStr) {
const shader = __privateGet(this, _gl).createShader(type);
if (!shader)
throw new Error("Fatal: webgl could not create shader object!");
__privateGet(this, _gl).shaderSource(shader, source);
__privateGet(this, _gl).compileShader(shader);
const success = (
/** @type {boolean} */
__privateGet(this, _gl).getShaderParameter(shader, __privateGet(this, _gl).COMPILE_STATUS)
);
if (success) {
return shader;
}
const info = __privateGet(this, _gl).getShaderInfoLog(shader);
__privateGet(this, _gl).deleteShader(shader);
throw new Error(`Compile '${__privateGet(this, _path)}': ${typeStr}: ${info}`);
};
// node_modules/rubiks-js/src/ui/transform.js
var Transform = class _Transform {
/**
* @param {V3} position
* @param {Quaternion} rotation
* @param {TParent} parent
*/
constructor(position, rotation, parent) {
/** @type {M44} */
__publicField(this, "localTransform");
/** @type {M44} */
__publicField(this, "globalTransform");
/** @type {TChild[]} */
__publicField(this, "children", []);
this._position = position;
this._rotation = rotation;
this.parent = parent;
this.setTransforms();
}
/** @protected */
setTransforms() {
const localTransform = _Transform.getLocalTransform(this._position, this._rotation);
this.localTransform = localTransform;
if (!this.parent) {
this.globalTransform = localTransform;
} else {
const parentTransform = this.parent.transform.globalTransform;
this.globalTransform = parentTransform.mult(localTransform);
}
this.children.forEach((child) => child.transform.setTransforms());
}
/** @param {V3} v */
apply({ x, y, z }) {
return this.globalTransform.mult(new V4(x, y, z, 1)).toV3();
}
/**
* @param {V3} axis
* @param {number} angle
*/
rotate(axis, angle) {
this.rotation = this._rotation.mult(Quaternion.fromAngle(this._rotation.rotate(axis), angle));
}
/** @param {V3} value */
set position(value) {
this._position = value;
this.setTransforms();
}
/** @param {Quaternion} value */
set rotation(value) {
this._rotation = value;
this.setTransforms();
}
get position() {
return this._position;
}
get rotation() {
return this._rotation;
}
/**
* @param {V3} position
* @param {Quaternion} rotation
* @returns {M44}
*/
static getLocalTransform({ x, y, z }, rotation) {
const transform = rotation.matrix;
transform.r1.w = x;
transform.r2.w = y;
transform.r3.w = z;
return transform;
}
};
// node_modules/rubiks-js/src/ui/facelet.js
var FaceletTransform = class extends Transform {
/**
* @param {V3} position
* @param {Quaternion} rotation
* @param {Cubie} parent
*/
constructor(position, rotation, parent) {
super(position, rotation, parent);
/** @type {V3} */
__publicField(this, "left");
/** @type {V3} */
__publicField(this, "top");
/** @type {V3} */
__publicField(this, "normal");
/** @type {V3} */
__publicField(this, "topLeft");
/** @type {V3} */
__publicField(this, "bottomRight");
this.setTransforms();
}
/** @protected */
setTransforms() {
super.setTransforms();
const rotationTransform = this.globalTransform.inverse.transpose;
this.left = rotationTransform.mult(new V4(0, 0, -1, 1)).toV3().normalized;
this.top = rotationTransform.mult(new V4(0, -1, 0, 1)).toV3().normalized;
this.normal = rotationTransform.mult(new V4(-1, 0, 0, 1)).toV3().normalized;
this.topLeft = this.globalTransform.mult(new V4(0, 0.5, 0.5, 1)).toV3();
this.bottomRight = this.topLeft.add(this.left).add(this.top);
}
};
var _hoveringMult;
var Facelet = class {
/**
* @param {FaceletTransform} transform
* @param {number} side
* @param {number[]} uvs
* @param {V3} hoveringMult
*/
constructor(transform, side, uvs, hoveringMult) {
__publicField(this, "hovering", false);
/** @type {V3} */
__privateAdd(this, _hoveringMult);
this.transform = transform;
this.side = side;
this.uvs = uvs;
__privateSet(this, _hoveringMult, hoveringMult);
}
/**
* @param {Program} program
* @param {WebGL2RenderingContext} gl
* @param {WebGLBuffer} uvsVbo
*/
render(program, gl, uvsVbo) {
gl.bindBuffer(gl.ARRAY_BUFFER, uvsVbo);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.uvs), gl.STATIC_DRAW);
gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 8, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
program.uniform("model", this.transform.globalTransform);
program.uniform("colorMult", this.hovering ? __privateGet(this, _hoveringMult) : V3.one);
gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
}
};
_hoveringMult = new WeakMap();
var InsideFacelet = class {
/** @param {Transform<any, Cubie>} transform */
constructor(transform) {
this.transform = transform;
}
/**
* @param {Program} program
* @param {WebGL2RenderingContext} gl
*/
render(program, gl) {
program.uniform("model", this.transform.globalTransform);
program.uniform("colorMult", V3.zero);
gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
}
};
// node_modules/rubiks-js/src/ui/cubie.js
var positionForSide = [
V3.right,
V3.left,
V3.down,
V3.up,
V3.back,
V3.forward
].map((v) => v.scale(0.5));
var rotationForSide = [
Quaternion.identity,
Quaternion.identity,
Quaternion.fromAngle(V3.back, 90),
Quaternion.fromAngle(V3.back, 90),
Quaternion.fromAngle(V3.back, 90).mult(Quaternion.fromAngle(V3.down, 90)),
Quaternion.fromAngle(V3.back, 90).mult(Quaternion.fromAngle(V3.down, 90))
];
var isInside = (side, index) => {
const axis = Math.floor(side / 2);
const invert = side % 2;
const coordinate = Math.floor(index / Math.pow(3, axis)) % 3;
return coordinate === 1 || coordinate === 0 && invert === 1 || coordinate === 2 && invert === 0;
};
var indexToPosition = (index) => {
const x = Math.floor(index / 1) % 3;
const y = Math.floor(index / 3) % 3;
const z = Math.floor(index / 9) % 3;
return [x, y, z];
};
var positionToUvs = (pos, side, uvs) => {
const axis = Math.floor(side / 2);
const uvCoords = [];
for (let i = 0; i < 3; i++) {
if (i !== axis) {
uvCoords.push(pos[i]);
}
}
const sideIndex = uvCoords[0] + uvCoords[1] * 3;
return uvs[side][sideIndex];
};
var Cubie = class {
/**
* @param {number} index
* @param {number[][][]} uvs
* @param {V3[]} hoveringColors
* @param {import('./rubiks').Rubiks} parent
*/
constructor(index, uvs, hoveringColors, parent) {
/** @type {Facelet[]} */
__publicField(this, "facelets", []);
/** @type {Transform<Facelet | InsideFacelet, import('./rubiks').Rubiks>} */
__publicField(this, "transform");
this.index = index;
const pos = indexToPosition(index);
const position = new V3(pos[0], pos[1], pos[2]).sub(V3.one);
this.transform = new Transform(position, Quaternion.identity, parent);
for (let side = 0; side < 6; side++) {
const inside = isInside(side, this.index);
const position2 = positionForSide[side];
const rotation = rotationForSide[side];
if (inside) {
const transform2 = new Transform(position2, rotation, this);
const facelet2 = new InsideFacelet(transform2);
this.transform.children.push(facelet2);
continue;
}
const uv = positionToUvs(pos, side, uvs);
const transform = new FaceletTransform(position2, rotation, this);
const facelet = new Facelet(transform, side, uv, hoveringColors[side]);
this.transform.children.push(facelet);
this.facelets.push(facelet);
}
}
/**
* @param {number} side
* @returns {Facelet}
*/
getFaceletOfSide(side) {
return (
/** @type {Facelet} */
this.facelets.find((facelet) => facelet.side === side)
);
}
/**
* @param {import('./program').Program} program
* @param {WebGL2RenderingContext} gl
* @param {WebGLBuffer} uvsVbo
*/
render(program, gl, uvsVbo) {
this.transform.children.forEach((child) => child.render.call(child, program, gl, uvsVbo));
}
};
export {
V2,
V3,
V4,
M44,
Quaternion,
Program,
Transform,
isInside,
indexToPosition,
positionToUvs,
Cubie
};
//# sourceMappingURL=chunk-ROHLD3FA.js.map

7
node_modules/.vite/deps/chunk-ROHLD3FA.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

12542
node_modules/.vite/deps/chunk-U3LI7FBV.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/.vite/deps/chunk-U3LI7FBV.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

18
node_modules/.vite/deps/chunk-Y44FVENP.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
// node_modules/@gkucmierz/utils/src/mod.mjs
var getMod = (ZERO) => {
return (dividend, divisor) => {
if (dividend < ZERO ^ divisor < ZERO) {
const res = -dividend % divisor;
return res === ZERO ? ZERO : divisor - res;
}
return dividend % divisor;
};
};
var mod = getMod(0);
var modBI = getMod(0n);
export {
mod,
modBI
};
//# sourceMappingURL=chunk-Y44FVENP.js.map

7
node_modules/.vite/deps/chunk-Y44FVENP.js.map generated vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../@gkucmierz/utils/src/mod.mjs"],
"sourcesContent": ["\nconst getMod = ZERO => {\n return (dividend, divisor) => {\n if ((dividend < ZERO) ^ (divisor < ZERO)) {\n const res = -dividend % divisor;\n return res === ZERO ? ZERO : divisor - res;\n }\n return dividend % divisor;\n };\n};\n\n/**\n * Python like modulo implementation.\n * It behaves different than JavaScript %\n * with negative values\n * @method\n * @param {Number} Dividend\n * @param {Number} Divisor\n * @return {Number} Modulus\n */\nexport const mod = getMod(0);\n\n/**\n * Python like modulo implementation.\n * It behaves different than JavaScript %\n * with negative values\n * @method\n * @param {BigInt} Dividend\n * @param {BigInt} Divisor\n * @return {BigInt} Modulus\n */\nexport const modBI = getMod(0n);\n"],
"mappings": ";AACA,IAAM,SAAS,UAAQ;AACrB,SAAO,CAAC,UAAU,YAAY;AAC5B,QAAK,WAAW,OAAS,UAAU,MAAO;AACxC,YAAM,MAAM,CAAC,WAAW;AACxB,aAAO,QAAQ,OAAO,OAAO,UAAU;AAAA,IACzC;AACA,WAAO,WAAW;AAAA,EACpB;AACF;AAWO,IAAM,MAAM,OAAO,CAAC;AAWpB,IAAM,QAAQ,OAAO,EAAE;",
"names": []
}

1625
node_modules/.vite/deps/chunk-YIK32INT.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/.vite/deps/chunk-YIK32INT.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

39241
node_modules/.vite/deps/lucide-vue-next.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/.vite/deps/lucide-vue-next.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

494
node_modules/.vite/deps/matrix-js.js generated vendored Normal file
View File

@@ -0,0 +1,494 @@
import {
__commonJS
} from "./chunk-HPRLEMBT.js";
// node_modules/matrix-js/lib/rational.js
var require_rational = __commonJS({
"node_modules/matrix-js/lib/rational.js"(exports, module) {
"use strict";
function rational(num, den) {
den = den || 1;
if (Math.sign(den) === -1) {
num = -num;
den = -den;
}
return {
num,
den,
add: (op) => rational(num * op.den + den * op.num, den * op.den),
sub: (op) => rational(num * op.den - den * op.num, den * op.den),
mul: (op) => multiply(op, num, den),
div: (op) => {
let _num = op.den;
let _den = op.num;
return multiply(rational(_num, _den), num, den);
}
};
}
module.exports = rational;
function multiply(op, num, den) {
let _num = Math.sign(num) * Math.sign(op.num);
let _den = Math.sign(den) * Math.sign(op.den);
if (Math.abs(num) === Math.abs(op.den) && Math.abs(den) === Math.abs(op.num)) {
_num = _num;
_den = _den;
} else if (Math.abs(den) === Math.abs(op.num)) {
_num = _num * Math.abs(num);
_den = _den * Math.abs(op.den);
} else if (Math.abs(num) === Math.abs(op.den)) {
_num = _num * Math.abs(op.num);
_den = _den * Math.abs(den);
} else {
_num = num * op.num;
_den = den * op.den;
}
return rational(_num, _den);
}
}
});
// node_modules/matrix-js/lib/merge.js
var require_merge = __commonJS({
"node_modules/matrix-js/lib/merge.js"(exports, module) {
"use strict";
function merge(base) {
return {
top: (mergeData) => top(base, mergeData),
bottom: (mergeData) => bottom(base, mergeData),
left: (mergeData) => left(base, mergeData),
right: (mergeData) => right(base, mergeData)
};
}
module.exports = merge;
function top(base, mergeData) {
let baseWidth = base[0].length || base.length;
let mergeDataWidth = mergeData[mergeData.length - 1].length || mergeData.length;
if (baseWidth !== mergeDataWidth) {
return base;
}
if (!Array.isArray(base[0])) {
base = [base];
}
if (!Array.isArray(mergeData[mergeData.length - 1])) {
mergeData = [mergeData];
}
for (let row = mergeData.length - 1; row >= 0; row--) {
base.unshift(mergeData[row].map((ele) => ele));
}
return base;
}
function bottom(base, mergeData) {
let baseWidth = base[base.length - 1].length || base.length;
let mergeDataWidth = mergeData[0].length || mergeData.length;
if (baseWidth !== mergeDataWidth) {
return base;
}
if (!Array.isArray(base[base.length - 1])) {
base = [base];
}
if (!Array.isArray(mergeData[0])) {
mergeData = [mergeData];
}
for (let row = 0; row < mergeData.length; row++) {
base.push(mergeData[row].map((ele) => ele));
}
return base;
}
function left(base, mergeData) {
let baseHeight = base.length;
let mergeDataHeight = mergeData.length;
if (!Array.isArray(base[0]) && !Array.isArray(mergeData[0])) {
base.unshift.apply(base, mergeData);
return base;
}
if (baseHeight !== mergeDataHeight) {
return base;
}
for (let row = 0; row < baseHeight; row++) {
base[row].unshift.apply(base[row], mergeData[row].map((ele) => ele));
}
return base;
}
function right(base, mergeData) {
let baseHeight = base.length;
let mergeDataHeight = mergeData.length;
if (!Array.isArray(base[0]) && !Array.isArray(mergeData[0])) {
base.push.apply(base, mergeData);
return base;
}
if (baseHeight !== mergeDataHeight) {
return base;
}
for (let row = 0; row < baseHeight; row++) {
base[row].push.apply(base[row], mergeData[row].map((ele) => ele));
}
return base;
}
}
});
// node_modules/matrix-js/lib/generate.js
var require_generate = __commonJS({
"node_modules/matrix-js/lib/generate.js"(exports, module) {
"use strict";
function generate(val) {
return {
size: (row, col) => size(val, row, col),
diag: (row, col) => diag(val, row, col)
};
}
function size(val, row, col) {
if (!col) {
col = row;
}
let rows = [];
for (let i = 0; i < row; i++) {
let cols = [];
for (let j = 0; j < col; j++) {
cols[j] = val || Math.random();
}
rows[i] = cols;
}
return rows;
}
function diag(val, row, col) {
if (!col) {
col = row;
}
let rows = [];
for (let i = 0; i < row; i++) {
let cols = [];
for (let j = 0; j < col; j++) {
cols[j] = 0;
}
rows[i] = cols;
if (i < col || row == col) {
rows[i][i] = val || Math.random();
}
}
return rows;
}
module.exports = generate;
}
});
// node_modules/matrix-js/lib/index.js
var require_lib = __commonJS({
"node_modules/matrix-js/lib/index.js"(exports, module) {
var rational = require_rational();
var merge = require_merge();
var generate = require_generate();
function matrix(mat) {
if (!Array.isArray(mat)) {
throw new Error("Input should be of type array");
}
let _matrix = function() {
let args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
return read(mat, args);
};
return Object.assign(_matrix, _mat(mat));
}
matrix.gen = generate;
function _mat(mat) {
return {
size: () => size(mat),
add: (operand) => operate(mat, operand, addition),
sub: (operand) => operate(mat, operand, subtraction),
mul: (operand) => operate(mat, operand, multiplication),
div: (operand) => operate(mat, operand, division),
prod: (operand) => prod(mat, operand),
trans: () => trans(mat),
set: function() {
let args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
return {
to: (val) => replace(mat, val, args)
};
},
det: () => determinant(mat),
inv: () => invert(mat),
merge: merge(mat),
map: (func) => map(mat, func),
equals: (operand) => equals(mat, operand)
};
}
module.exports = matrix;
function size(mat) {
let s = [];
while (Array.isArray(mat)) {
s.push(mat.length);
mat = mat[0];
}
return s;
}
function dimensions(mat) {
return size(mat).length;
}
function read(mat, args) {
if (args.length === 0) {
return mat;
} else {
return extract(mat, args);
}
}
function extract(mat, args) {
let dim = dimensions(mat);
for (let i = 0; i < dim; i++) {
let d = args[i];
if (d === void 0) {
break;
}
if (Array.isArray(d)) {
mat = extractRange(mat, d, i);
} else if (Number.isInteger(d)) {
if (dimensions(mat) > 1 && i > 0) {
mat = mat.map(function(elem) {
return [elem[d]];
});
} else {
mat = mat[d];
}
}
}
return mat;
}
function extractRange(mat, arg, ind) {
if (!arg.length) {
return mat;
} else if (arg.length === 2) {
let reverse = arg[0] > arg[1];
let first = !reverse ? arg[0] : arg[1];
let last = !reverse ? arg[1] : arg[0];
if (dimensions(mat) > 1 && ind > 0) {
return mat.map(function(elem) {
if (reverse) {
return elem.slice(first, last + 1).reverse();
}
return elem.slice(first, last + 1);
});
} else {
mat = mat.slice(first, last + 1);
return reverse && mat.reverse() || mat;
}
}
}
function replace(mat, value, args) {
let result = clone(mat);
let prev = args[0];
let start = prev[0] || 0;
let end = prev[1] && prev[1] + 1 || mat.length;
if (!Array.isArray(prev) && args.length === 1) {
result[prev].fill(value);
} else if (args.length === 1) {
for (let ind = start; ind < end; ind++) {
result[ind].fill(value);
}
}
for (let i = 1; i < args.length; i++) {
let first = Array.isArray(args[i]) ? args[i][0] || 0 : args[i];
let last = Array.isArray(args[i]) ? args[i][1] && args[i][1] + 1 || mat[0].length : args[i] + 1;
if (!Array.isArray(prev)) {
result[prev].fill(value, first, last);
} else {
for (let ind = start; ind < end; ind++) {
result[ind].fill(value, first, last);
}
}
}
return result;
}
function operate(mat, operand, operation) {
let result = [];
let op = operand();
for (let i = 0; i < mat.length; i++) {
let op1 = mat[i];
let op2 = op[i];
result.push(op1.map(function(elem, ind) {
return operation(elem, op2[ind]);
}));
}
return result;
}
function prod(mat, operand) {
let op1 = mat;
let op2 = operand();
let size1 = size(op1);
let size2 = size(op2);
let result = [];
if (size1[1] === size2[0]) {
for (let i = 0; i < size1[0]; i++) {
result[i] = [];
for (let j = 0; j < size2[1]; j++) {
for (let k = 0; k < size1[1]; k++) {
if (result[i][j] === void 0) {
result[i][j] = 0;
}
result[i][j] += multiplication(op1[i][k], op2[k][j]);
}
}
}
}
return result;
}
function trans(mat) {
let input = mat;
let s = size(mat);
let output = [];
for (let i = 0; i < s[0]; i++) {
for (let j = 0; j < s[1]; j++) {
if (Array.isArray(output[j])) {
output[j].push(input[i][j]);
} else {
output[j] = [input[i][j]];
}
}
}
return output;
}
function clone(mat) {
let result = [];
for (let i = 0; i < mat.length; i++) {
result.push(mat[i].slice(0));
}
return result;
}
function addition(op1, op2) {
return op1 + op2;
}
function subtraction(op1, op2) {
return op1 - op2;
}
function multiplication(op1, op2) {
return op1 * op2;
}
function division(op1, op2) {
return op1 / op2;
}
function determinant(mat) {
let rationalized = rationalize(mat);
let siz = size(mat);
let det = rational(1);
let sign = 1;
for (let i = 0; i < siz[0] - 1; i++) {
for (let j = i + 1; j < siz[0]; j++) {
if (rationalized[j][i].num === 0) {
continue;
}
if (rationalized[i][i].num === 0) {
interchange(rationalized, i, j);
sign = -sign;
continue;
}
let temp = rationalized[j][i].div(rationalized[i][i]);
temp = rational(Math.abs(temp.num), temp.den);
if (Math.sign(rationalized[j][i].num) === Math.sign(rationalized[i][i].num)) {
temp = rational(-temp.num, temp.den);
}
for (let k = 0; k < siz[1]; k++) {
rationalized[j][k] = temp.mul(rationalized[i][k]).add(rationalized[j][k]);
}
}
}
det = rationalized.reduce((prev, curr, index) => prev.mul(curr[index]), rational(1));
return sign * det.num / det.den;
}
function interchange(mat, ind1, ind2) {
let temp = mat[ind1];
mat[ind1] = mat[ind2];
mat[ind2] = temp;
}
function invert(mat) {
let rationalized = rationalize(mat);
let siz = size(mat);
let result = rationalize(generate(1).diag(siz[0]));
let i = 0;
let j = 0;
while (j < siz[0]) {
if (rationalized[i][j].num === 0) {
for (let k = i + 1; k < siz[0]; k++) {
if (rationalized[k][j].num !== 0) {
interchange(rationalized, i, k);
interchange(result, i, k);
}
}
}
if (rationalized[i][j].num !== 0) {
if (rationalized[i][j].num !== 1 || rationalized[i][j].den !== 1) {
let factor = rational(rationalized[i][j].num, rationalized[i][j].den);
for (let col = 0; col < siz[1]; col++) {
rationalized[i][col] = rationalized[i][col].div(factor);
result[i][col] = result[i][col].div(factor);
}
}
for (let k = i + 1; k < siz[0]; k++) {
let temp = rationalized[k][j];
for (let col = 0; col < siz[1]; col++) {
rationalized[k][col] = rationalized[k][col].sub(temp.mul(rationalized[i][col]));
result[k][col] = result[k][col].sub(temp.mul(result[i][col]));
}
}
}
i += 1;
j += 1;
}
let last = siz[0] - 1;
if (rationalized[last][last].num !== 1 || rationalized[last][last].den !== 1) {
let factor = rational(rationalized[last][last].num, rationalized[last][last].den);
for (let col = 0; col < siz[1]; col++) {
rationalized[last][col] = rationalized[last][col].div(factor);
result[last][col] = result[last][col].div(factor);
}
}
for (let i2 = siz[0] - 1; i2 > 0; i2--) {
for (let j2 = i2 - 1; j2 >= 0; j2--) {
let temp = rational(-rationalized[j2][i2].num, rationalized[j2][i2].den);
for (let k = 0; k < siz[1]; k++) {
rationalized[j2][k] = temp.mul(rationalized[i2][k]).add(rationalized[j2][k]);
result[j2][k] = temp.mul(result[i2][k]).add(result[j2][k]);
}
}
}
return derationalize(result);
}
function map(mat, func) {
const s = size(mat);
const result = [];
for (let i = 0; i < s[0]; i++) {
if (Array.isArray(mat[i])) {
result[i] = [];
for (let j = 0; j < s[1]; j++) {
result[i][j] = func(mat[i][j], [i, j], mat);
}
} else {
result[i] = func(mat[i], [i, 0], mat);
}
}
return result;
}
function rationalize(mat) {
let rationalized = [];
mat.forEach((row, ind) => {
rationalized.push(row.map((ele) => rational(ele)));
});
return rationalized;
}
function derationalize(mat) {
let derationalized = [];
mat.forEach((row, ind) => {
derationalized.push(row.map((ele) => ele.num / ele.den));
});
return derationalized;
}
function equals(mat, operand) {
let op1 = mat;
let op2 = operand();
let size1 = size(op1);
let size2 = size(op2);
if (!size1.every((val, ind) => val === size2[ind])) {
return false;
}
return op1.every((val, ind1) => val.every((ele, ind2) => Math.abs(ele - op2[ind1][ind2]) < 1e-10));
}
}
});
export default require_lib();
//# sourceMappingURL=matrix-js.js.map

7
node_modules/.vite/deps/matrix-js.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

3
node_modules/.vite/deps/package.json generated vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"type": "module"
}

1545
node_modules/.vite/deps/rubiks-js.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

7
node_modules/.vite/deps/rubiks-js.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,16 @@
import {
State,
StateInfo,
createSideToUvs,
setUvs,
transformSidetoUvs
} from "./chunk-YIK32INT.js";
import "./chunk-ROHLD3FA.js";
import "./chunk-HPRLEMBT.js";
export {
State,
StateInfo,
createSideToUvs,
setUvs,
transformSidetoUvs
};

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

13
node_modules/.vite/deps/rubiks-js_src_ui_cubie__js.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import {
Cubie,
indexToPosition,
isInside,
positionToUvs
} from "./chunk-ROHLD3FA.js";
import "./chunk-HPRLEMBT.js";
export {
Cubie,
indexToPosition,
isInside,
positionToUvs
};

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}

343
node_modules/.vite/deps/vue.js generated vendored Normal file
View File

@@ -0,0 +1,343 @@
import {
BaseTransition,
BaseTransitionPropsValidators,
Comment,
DeprecationTypes,
EffectScope,
ErrorCodes,
ErrorTypeStrings,
Fragment,
KeepAlive,
ReactiveEffect,
Static,
Suspense,
Teleport,
Text,
TrackOpTypes,
Transition,
TransitionGroup,
TriggerOpTypes,
VueElement,
assertNumber,
callWithAsyncErrorHandling,
callWithErrorHandling,
camelize,
capitalize,
cloneVNode,
compatUtils,
compile,
computed,
createApp,
createBaseVNode,
createBlock,
createCommentVNode,
createElementBlock,
createHydrationRenderer,
createPropsRestProxy,
createRenderer,
createSSRApp,
createSlots,
createStaticVNode,
createTextVNode,
createVNode,
customRef,
defineAsyncComponent,
defineComponent,
defineCustomElement,
defineEmits,
defineExpose,
defineModel,
defineOptions,
defineProps,
defineSSRCustomElement,
defineSlots,
devtools,
effect,
effectScope,
getCurrentInstance,
getCurrentScope,
getCurrentWatcher,
getTransitionRawChildren,
guardReactiveProps,
h,
handleError,
hasInjectionContext,
hydrate,
hydrateOnIdle,
hydrateOnInteraction,
hydrateOnMediaQuery,
hydrateOnVisible,
initCustomFormatter,
initDirectivesForSSR,
inject,
isMemoSame,
isProxy,
isReactive,
isReadonly,
isRef,
isRuntimeOnly,
isShallow,
isVNode,
markRaw,
mergeDefaults,
mergeModels,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onActivated,
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onDeactivated,
onErrorCaptured,
onMounted,
onRenderTracked,
onRenderTriggered,
onScopeDispose,
onServerPrefetch,
onUnmounted,
onUpdated,
onWatcherCleanup,
openBlock,
popScopeId,
provide,
proxyRefs,
pushScopeId,
queuePostFlushCb,
reactive,
readonly,
ref,
registerRuntimeCompiler,
render,
renderList,
renderSlot,
resolveComponent,
resolveDirective,
resolveDynamicComponent,
resolveFilter,
resolveTransitionHooks,
setBlockTracking,
setDevtoolsHook,
setTransitionHooks,
shallowReactive,
shallowReadonly,
shallowRef,
ssrContextKey,
ssrUtils,
stop,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toRef,
toRefs,
toValue,
transformVNodeArgs,
triggerRef,
unref,
useAttrs,
useCssModule,
useCssVars,
useHost,
useId,
useModel,
useSSRContext,
useShadowRoot,
useSlots,
useTemplateRef,
useTransitionState,
vModelCheckbox,
vModelDynamic,
vModelRadio,
vModelSelect,
vModelText,
vShow,
version,
warn,
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,
withAsyncContext,
withCtx,
withDefaults,
withDirectives,
withKeys,
withMemo,
withModifiers,
withScopeId
} from "./chunk-U3LI7FBV.js";
import "./chunk-HPRLEMBT.js";
export {
BaseTransition,
BaseTransitionPropsValidators,
Comment,
DeprecationTypes,
EffectScope,
ErrorCodes,
ErrorTypeStrings,
Fragment,
KeepAlive,
ReactiveEffect,
Static,
Suspense,
Teleport,
Text,
TrackOpTypes,
Transition,
TransitionGroup,
TriggerOpTypes,
VueElement,
assertNumber,
callWithAsyncErrorHandling,
callWithErrorHandling,
camelize,
capitalize,
cloneVNode,
compatUtils,
compile,
computed,
createApp,
createBlock,
createCommentVNode,
createElementBlock,
createBaseVNode as createElementVNode,
createHydrationRenderer,
createPropsRestProxy,
createRenderer,
createSSRApp,
createSlots,
createStaticVNode,
createTextVNode,
createVNode,
customRef,
defineAsyncComponent,
defineComponent,
defineCustomElement,
defineEmits,
defineExpose,
defineModel,
defineOptions,
defineProps,
defineSSRCustomElement,
defineSlots,
devtools,
effect,
effectScope,
getCurrentInstance,
getCurrentScope,
getCurrentWatcher,
getTransitionRawChildren,
guardReactiveProps,
h,
handleError,
hasInjectionContext,
hydrate,
hydrateOnIdle,
hydrateOnInteraction,
hydrateOnMediaQuery,
hydrateOnVisible,
initCustomFormatter,
initDirectivesForSSR,
inject,
isMemoSame,
isProxy,
isReactive,
isReadonly,
isRef,
isRuntimeOnly,
isShallow,
isVNode,
markRaw,
mergeDefaults,
mergeModels,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onActivated,
onBeforeMount,
onBeforeUnmount,
onBeforeUpdate,
onDeactivated,
onErrorCaptured,
onMounted,
onRenderTracked,
onRenderTriggered,
onScopeDispose,
onServerPrefetch,
onUnmounted,
onUpdated,
onWatcherCleanup,
openBlock,
popScopeId,
provide,
proxyRefs,
pushScopeId,
queuePostFlushCb,
reactive,
readonly,
ref,
registerRuntimeCompiler,
render,
renderList,
renderSlot,
resolveComponent,
resolveDirective,
resolveDynamicComponent,
resolveFilter,
resolveTransitionHooks,
setBlockTracking,
setDevtoolsHook,
setTransitionHooks,
shallowReactive,
shallowReadonly,
shallowRef,
ssrContextKey,
ssrUtils,
stop,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toRef,
toRefs,
toValue,
transformVNodeArgs,
triggerRef,
unref,
useAttrs,
useCssModule,
useCssVars,
useHost,
useId,
useModel,
useSSRContext,
useShadowRoot,
useSlots,
useTemplateRef,
useTransitionState,
vModelCheckbox,
vModelDynamic,
vModelRadio,
vModelSelect,
vModelText,
vShow,
version,
warn,
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,
withAsyncContext,
withCtx,
withDefaults,
withDirectives,
withKeys,
withMemo,
withModifiers,
withScopeId
};

7
node_modules/.vite/deps/vue.js.map generated vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": [],
"sourcesContent": [],
"mappings": "",
"names": []
}