cubing 0.63.8 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/chunks/{chunk-EWR23OA4.js → chunk-DQNBCFR3.js} +2 -2
- package/dist/bin/chunks/{chunk-EWR23OA4.js.map → chunk-DQNBCFR3.js.map} +1 -1
- package/dist/bin/order.js +1 -1
- package/dist/bin/order.js.map +1 -1
- package/dist/bin/puzzle-geometry-bin.js +1 -1
- package/dist/bin/puzzle-geometry-bin.js.map +1 -1
- package/dist/bin/scramble.js +1 -1
- package/dist/bin/scramble.js.map +1 -1
- package/dist/bin/svg.js +1 -1
- package/dist/bin/svg.js.map +1 -1
- package/dist/lib/cubing/alg/index.d.ts +1 -1
- package/dist/lib/cubing/alg/index.js +1 -1
- package/dist/lib/cubing/bluetooth/index.d.ts +17 -17
- package/dist/lib/cubing/bluetooth/index.js +96 -96
- package/dist/lib/cubing/bluetooth/index.js.map +2 -2
- package/dist/lib/cubing/chunks/{big-puzzle-orientation-ADWIOX6S.js → big-puzzle-orientation-G75BXW2W.js} +2 -2
- package/dist/lib/cubing/chunks/big-puzzle-orientation-G75BXW2W.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-A7FK4XKU.js → chunk-5LBACZOM.js} +173 -144
- package/dist/lib/cubing/chunks/chunk-5LBACZOM.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-5KMTA6PX.js → chunk-7MYDNYZ3.js} +3 -3
- package/dist/lib/cubing/chunks/chunk-7MYDNYZ3.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-7LXHWXCO.js → chunk-ALR6ZQFC.js} +2 -2
- package/dist/lib/cubing/chunks/chunk-ALR6ZQFC.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-H5KMIDAF.js → chunk-DTYBGCI3.js} +5 -5
- package/dist/lib/cubing/chunks/chunk-DTYBGCI3.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-YR72E7KZ.js → chunk-GO2SL6SC.js} +38 -38
- package/dist/lib/cubing/chunks/chunk-GO2SL6SC.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-FUAADKXE.js → chunk-KHUP3BPA.js} +35 -34
- package/dist/lib/cubing/chunks/chunk-KHUP3BPA.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-MQSQDKWH.js → chunk-O2QJENHE.js} +3 -3
- package/dist/lib/cubing/chunks/chunk-O2QJENHE.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-5ONX3JVC.js → chunk-THRYJMRP.js} +8 -8
- package/dist/lib/cubing/chunks/chunk-THRYJMRP.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-UEUJSZTX.js → chunk-UWJ575HH.js} +58 -46
- package/dist/lib/cubing/chunks/chunk-UWJ575HH.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-N5FJ5YIA.js → chunk-YFNXHRNE.js} +37 -31
- package/dist/lib/cubing/chunks/chunk-YFNXHRNE.js.map +7 -0
- package/dist/lib/cubing/chunks/{inside-JAJOK2MI.js → inside-A7LIP56H.js} +14 -14
- package/dist/lib/cubing/chunks/inside-A7LIP56H.js.map +7 -0
- package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-IMYJ533P.js → puzzles-dynamic-side-events-653A7JCM.js} +1 -1
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-653A7JCM.js.map +7 -0
- package/dist/lib/cubing/chunks/{puzzles-dynamic-unofficial-P3TW433I.js → puzzles-dynamic-unofficial-2CY6GVZ4.js} +1 -1
- package/dist/lib/cubing/chunks/{puzzles-dynamic-unofficial-P3TW433I.js.map → puzzles-dynamic-unofficial-2CY6GVZ4.js.map} +1 -1
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-WORUZVF5.js → search-dynamic-sgs-side-events-YSB3MWLK.js} +6 -6
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-YSB3MWLK.js.map +7 -0
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-5JQKPNG2.js → search-dynamic-sgs-unofficial-OLK64DE6.js} +6 -6
- package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-5JQKPNG2.js.map → search-dynamic-sgs-unofficial-OLK64DE6.js.map} +1 -1
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-BGV4AJVT.js → search-dynamic-solve-4x4x4-WWFUMIDG.js} +7 -7
- package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-I5ID5LXD.js → search-dynamic-solve-fto-ZZKLTONP.js} +2 -2
- package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-Y2D3C74Y.js → search-dynamic-solve-kilominx-PUF4PRHS.js} +2 -2
- package/dist/lib/cubing/chunks/search-worker-entry.js +1 -1
- package/dist/lib/cubing/chunks/search-worker-entry.js.map +2 -2
- package/dist/lib/cubing/chunks/{twips-ZNMKGC5U.js → twips-LHO3IYJC.js} +2 -2
- package/dist/lib/cubing/chunks/{twisty-dynamic-3d-4BEQ76PB.js → twisty-dynamic-3d-A2G22YLA.js} +6 -6
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-A2G22YLA.js.map +7 -0
- package/dist/lib/cubing/{index-B2leUGbW.d.ts → index-C2x6Sc62.d.ts} +52 -47
- package/dist/lib/cubing/{index-BLw2OxXo.d.ts → index-Doa1gNE4.d.ts} +1 -1
- package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
- package/dist/lib/cubing/kpuzzle/index.js +2 -2
- package/dist/lib/cubing/notation/index.d.ts +17 -15
- package/dist/lib/cubing/notation/index.js +4 -4
- package/dist/lib/cubing/{outside-V6_PW1ZK.d.ts → outside-nf-4k7Tp.d.ts} +1 -1
- package/dist/lib/cubing/protocol/index.d.ts +1 -1
- package/dist/lib/cubing/protocol/index.js +4 -4
- package/dist/lib/cubing/puzzle-geometry/index.d.ts +1 -1
- package/dist/lib/cubing/puzzle-geometry/index.js +284 -184
- package/dist/lib/cubing/puzzle-geometry/index.js.map +2 -2
- package/dist/lib/cubing/puzzles/index.d.ts +1 -1
- package/dist/lib/cubing/puzzles/index.js +4 -4
- package/dist/lib/cubing/scramble/index.d.ts +1 -1
- package/dist/lib/cubing/scramble/index.js +6 -6
- package/dist/lib/cubing/search/index.d.ts +1 -1
- package/dist/lib/cubing/search/index.js +6 -6
- package/dist/lib/cubing/search/index.js.map +1 -1
- package/dist/lib/cubing/stream/index.d.ts +1 -1
- package/dist/lib/cubing/stream/index.js +1 -1
- package/dist/lib/cubing/stream/index.js.map +1 -1
- package/dist/lib/cubing/twisty/index.d.ts +1 -1
- package/dist/lib/cubing/twisty/index.js +189 -177
- package/dist/lib/cubing/twisty/index.js.map +2 -2
- package/package.json +2 -2
- package/dist/lib/cubing/chunks/big-puzzle-orientation-ADWIOX6S.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-5KMTA6PX.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-5ONX3JVC.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-7LXHWXCO.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-A7FK4XKU.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-FUAADKXE.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-H5KMIDAF.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-MQSQDKWH.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-N5FJ5YIA.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-UEUJSZTX.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-YR72E7KZ.js.map +0 -7
- package/dist/lib/cubing/chunks/inside-JAJOK2MI.js.map +0 -7
- package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-IMYJ533P.js.map +0 -7
- package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-WORUZVF5.js.map +0 -7
- package/dist/lib/cubing/chunks/twisty-dynamic-3d-4BEQ76PB.js.map +0 -7
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-BGV4AJVT.js.map → search-dynamic-solve-4x4x4-WWFUMIDG.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-I5ID5LXD.js.map → search-dynamic-solve-fto-ZZKLTONP.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-Y2D3C74Y.js.map → search-dynamic-solve-kilominx-PUF4PRHS.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{twips-ZNMKGC5U.js.map → twips-LHO3IYJC.js.map} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
binaryComponentsToReid3x3x3,
|
|
3
3
|
twizzleBinaryToBinaryComponents
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-O2QJENHE.js";
|
|
5
5
|
import {
|
|
6
6
|
puzzles
|
|
7
|
-
} from "../chunks/chunk-
|
|
7
|
+
} from "../chunks/chunk-KHUP3BPA.js";
|
|
8
8
|
import {
|
|
9
9
|
cube3x3x3,
|
|
10
10
|
experimental3x3x3KPuzzle
|
|
11
|
-
} from "../chunks/chunk-
|
|
11
|
+
} from "../chunks/chunk-5LBACZOM.js";
|
|
12
12
|
import {
|
|
13
13
|
KPattern
|
|
14
|
-
} from "../chunks/chunk-
|
|
14
|
+
} from "../chunks/chunk-THRYJMRP.js";
|
|
15
15
|
import {
|
|
16
16
|
Alg,
|
|
17
17
|
Move,
|
|
18
18
|
experimentalAppendMove,
|
|
19
19
|
keyToMove
|
|
20
|
-
} from "../chunks/chunk-
|
|
20
|
+
} from "../chunks/chunk-YFNXHRNE.js";
|
|
21
21
|
|
|
22
22
|
// src/cubing/bluetooth/debug.ts
|
|
23
23
|
var DEBUG_LOGGING_ENABLED = false;
|
|
@@ -132,7 +132,10 @@ var BluetoothPuzzle = class extends EventTarget {
|
|
|
132
132
|
|
|
133
133
|
// src/cubing/bluetooth/keyboard.ts
|
|
134
134
|
var KeyboardPuzzle = class extends BluetoothPuzzle {
|
|
135
|
+
keyMappingAndPatternPromise;
|
|
136
|
+
listener;
|
|
135
137
|
// (e: KeyboardEvent) => Promise<void>;
|
|
138
|
+
target;
|
|
136
139
|
// TODO: Decide on the right arguments.
|
|
137
140
|
// TODO: support tying the puzzle to a TwistyPlayer.
|
|
138
141
|
constructor(target, puzzle = "3x3x3") {
|
|
@@ -142,9 +145,6 @@ var KeyboardPuzzle = class extends BluetoothPuzzle {
|
|
|
142
145
|
target.addEventListener("keydown", this.listener);
|
|
143
146
|
this.keyMappingAndPatternPromise = this.setPuzzleInternal(puzzle);
|
|
144
147
|
}
|
|
145
|
-
target;
|
|
146
|
-
keyMappingAndPatternPromise;
|
|
147
|
-
listener;
|
|
148
148
|
name() {
|
|
149
149
|
return "Keyboard Input";
|
|
150
150
|
}
|
|
@@ -417,16 +417,6 @@ async function decryptPattern(data, aesKey) {
|
|
|
417
417
|
throw new Error("Invalid Gan cube pattern");
|
|
418
418
|
}
|
|
419
419
|
var PhysicalState = class _PhysicalState {
|
|
420
|
-
constructor(dataView, timeStamp) {
|
|
421
|
-
this.dataView = dataView;
|
|
422
|
-
this.timeStamp = timeStamp;
|
|
423
|
-
this.arr = new Uint8Array(dataView.buffer);
|
|
424
|
-
if (this.arr.length !== this.arrLen) {
|
|
425
|
-
throw new Error("Unexpected array length");
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
dataView;
|
|
429
|
-
timeStamp;
|
|
430
420
|
static async read(characteristic, aesKey) {
|
|
431
421
|
const value = await decryptPattern(
|
|
432
422
|
new Uint8Array((await characteristic.readValue()).buffer),
|
|
@@ -435,8 +425,18 @@ var PhysicalState = class _PhysicalState {
|
|
|
435
425
|
const timeStamp = Date.now();
|
|
436
426
|
return new _PhysicalState(new DataView(value.buffer), timeStamp);
|
|
437
427
|
}
|
|
428
|
+
dataView;
|
|
429
|
+
timeStamp;
|
|
438
430
|
arr;
|
|
439
431
|
arrLen = 19;
|
|
432
|
+
constructor(dataView, timeStamp) {
|
|
433
|
+
this.dataView = dataView;
|
|
434
|
+
this.timeStamp = timeStamp;
|
|
435
|
+
this.arr = new Uint8Array(dataView.buffer);
|
|
436
|
+
if (this.arr.length !== this.arrLen) {
|
|
437
|
+
throw new Error("Unexpected array length");
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
440
|
rotQuat() {
|
|
441
441
|
let x = this.dataView.getInt16(0, true) / 16384;
|
|
442
442
|
let y = this.dataView.getInt16(2, true) / 16384;
|
|
@@ -563,23 +563,6 @@ async function getKey(server) {
|
|
|
563
563
|
return importKey(key);
|
|
564
564
|
}
|
|
565
565
|
var GanCube = class _GanCube extends BluetoothPuzzle {
|
|
566
|
-
constructor(kpuzzle, service, server, physicalStateCharacteristic, lastMoveCounter, aesKey) {
|
|
567
|
-
super();
|
|
568
|
-
this.kpuzzle = kpuzzle;
|
|
569
|
-
this.service = service;
|
|
570
|
-
this.server = server;
|
|
571
|
-
this.physicalStateCharacteristic = physicalStateCharacteristic;
|
|
572
|
-
this.lastMoveCounter = lastMoveCounter;
|
|
573
|
-
this.aesKey = aesKey;
|
|
574
|
-
this.pattern = kpuzzle.defaultPattern();
|
|
575
|
-
this.startTrackingMoves();
|
|
576
|
-
}
|
|
577
|
-
kpuzzle;
|
|
578
|
-
service;
|
|
579
|
-
server;
|
|
580
|
-
physicalStateCharacteristic;
|
|
581
|
-
lastMoveCounter;
|
|
582
|
-
aesKey;
|
|
583
566
|
// We have to perform async operations before we call the constructor.
|
|
584
567
|
static async connect(server) {
|
|
585
568
|
const ganCubeService = await server.getPrimaryService(UUIDs.ganCubeService);
|
|
@@ -607,6 +590,23 @@ var GanCube = class _GanCube extends BluetoothPuzzle {
|
|
|
607
590
|
cachedFaceletStatus1Characteristic;
|
|
608
591
|
cachedFaceletStatus2Characteristic;
|
|
609
592
|
cachedActualAngleAndBatteryCharacteristic;
|
|
593
|
+
kpuzzle;
|
|
594
|
+
service;
|
|
595
|
+
server;
|
|
596
|
+
physicalStateCharacteristic;
|
|
597
|
+
lastMoveCounter;
|
|
598
|
+
aesKey;
|
|
599
|
+
constructor(kpuzzle, service, server, physicalStateCharacteristic, lastMoveCounter, aesKey) {
|
|
600
|
+
super();
|
|
601
|
+
this.kpuzzle = kpuzzle;
|
|
602
|
+
this.service = service;
|
|
603
|
+
this.server = server;
|
|
604
|
+
this.physicalStateCharacteristic = physicalStateCharacteristic;
|
|
605
|
+
this.lastMoveCounter = lastMoveCounter;
|
|
606
|
+
this.aesKey = aesKey;
|
|
607
|
+
this.pattern = kpuzzle.defaultPattern();
|
|
608
|
+
this.startTrackingMoves();
|
|
609
|
+
}
|
|
610
610
|
name() {
|
|
611
611
|
return this.server.device.name;
|
|
612
612
|
}
|
|
@@ -836,15 +836,6 @@ async function decodeState(data) {
|
|
|
836
836
|
return decryptState(data);
|
|
837
837
|
}
|
|
838
838
|
var GiiKERCube = class _GiiKERCube extends BluetoothPuzzle {
|
|
839
|
-
constructor(server, cubeCharacteristic, originalValue) {
|
|
840
|
-
super();
|
|
841
|
-
this.server = server;
|
|
842
|
-
this.cubeCharacteristic = cubeCharacteristic;
|
|
843
|
-
this.originalValue = originalValue;
|
|
844
|
-
}
|
|
845
|
-
server;
|
|
846
|
-
cubeCharacteristic;
|
|
847
|
-
originalValue;
|
|
848
839
|
static async connect(server) {
|
|
849
840
|
const cubeService = await server.getPrimaryService(UUIDs2.cubeService);
|
|
850
841
|
debugLog("Service:", cubeService);
|
|
@@ -864,6 +855,15 @@ var GiiKERCube = class _GiiKERCube extends BluetoothPuzzle {
|
|
|
864
855
|
);
|
|
865
856
|
return cube;
|
|
866
857
|
}
|
|
858
|
+
server;
|
|
859
|
+
cubeCharacteristic;
|
|
860
|
+
originalValue;
|
|
861
|
+
constructor(server, cubeCharacteristic, originalValue) {
|
|
862
|
+
super();
|
|
863
|
+
this.server = server;
|
|
864
|
+
this.cubeCharacteristic = cubeCharacteristic;
|
|
865
|
+
this.originalValue = originalValue;
|
|
866
|
+
}
|
|
867
867
|
name() {
|
|
868
868
|
return this.server.device.name;
|
|
869
869
|
}
|
|
@@ -1006,13 +1006,6 @@ var moveMap = [
|
|
|
1006
1006
|
new Move("L", -1)
|
|
1007
1007
|
];
|
|
1008
1008
|
var GoCube = class _GoCube extends BluetoothPuzzle {
|
|
1009
|
-
constructor(server, goCubeStateCharacteristic) {
|
|
1010
|
-
super();
|
|
1011
|
-
this.server = server;
|
|
1012
|
-
this.goCubeStateCharacteristic = goCubeStateCharacteristic;
|
|
1013
|
-
}
|
|
1014
|
-
server;
|
|
1015
|
-
goCubeStateCharacteristic;
|
|
1016
1009
|
// We have to perform async operations before we call the constructor.
|
|
1017
1010
|
static async connect(server) {
|
|
1018
1011
|
const service = await server.getPrimaryService(UUIDs3.goCubeService);
|
|
@@ -1043,6 +1036,13 @@ var GoCube = class _GoCube extends BluetoothPuzzle {
|
|
|
1043
1036
|
currentQuat = new Quaternion3(0, 0, 0, 1);
|
|
1044
1037
|
lastTarget = new Quaternion3(0, 0, 0, 1);
|
|
1045
1038
|
alg = new Alg();
|
|
1039
|
+
server;
|
|
1040
|
+
goCubeStateCharacteristic;
|
|
1041
|
+
constructor(server, goCubeStateCharacteristic) {
|
|
1042
|
+
super();
|
|
1043
|
+
this.server = server;
|
|
1044
|
+
this.goCubeStateCharacteristic = goCubeStateCharacteristic;
|
|
1045
|
+
}
|
|
1046
1046
|
disconnect() {
|
|
1047
1047
|
this.server.disconnect();
|
|
1048
1048
|
}
|
|
@@ -1122,19 +1122,6 @@ var UUIDs4 = {
|
|
|
1122
1122
|
batteryCharacteristic: "fd51b3ba-99c7-49c6-9f85-5644ff56a378"
|
|
1123
1123
|
};
|
|
1124
1124
|
var HeykubeCube = class _HeykubeCube extends BluetoothPuzzle {
|
|
1125
|
-
constructor(_kpuzzle, _service, device, server, stateCharacteristic) {
|
|
1126
|
-
super();
|
|
1127
|
-
this.server = server;
|
|
1128
|
-
this.stateCharacteristic = stateCharacteristic;
|
|
1129
|
-
device.addEventListener(
|
|
1130
|
-
"gattserverdisconnected",
|
|
1131
|
-
this.onDisconnect.bind(this)
|
|
1132
|
-
);
|
|
1133
|
-
this.stateCharacteristic.startNotifications();
|
|
1134
|
-
this.startTrackingMoves();
|
|
1135
|
-
}
|
|
1136
|
-
server;
|
|
1137
|
-
stateCharacteristic;
|
|
1138
1125
|
// We have to perform async operations before we call the constructor.
|
|
1139
1126
|
static async connect(server, device) {
|
|
1140
1127
|
const service = await server.getPrimaryService(UUIDs4.heykubeService);
|
|
@@ -1152,6 +1139,19 @@ var HeykubeCube = class _HeykubeCube extends BluetoothPuzzle {
|
|
|
1152
1139
|
);
|
|
1153
1140
|
return cube;
|
|
1154
1141
|
}
|
|
1142
|
+
server;
|
|
1143
|
+
stateCharacteristic;
|
|
1144
|
+
constructor(_kpuzzle, _service, device, server, stateCharacteristic) {
|
|
1145
|
+
super();
|
|
1146
|
+
this.server = server;
|
|
1147
|
+
this.stateCharacteristic = stateCharacteristic;
|
|
1148
|
+
device.addEventListener(
|
|
1149
|
+
"gattserverdisconnected",
|
|
1150
|
+
this.onDisconnect.bind(this)
|
|
1151
|
+
);
|
|
1152
|
+
this.stateCharacteristic.startNotifications();
|
|
1153
|
+
this.startTrackingMoves();
|
|
1154
|
+
}
|
|
1155
1155
|
name() {
|
|
1156
1156
|
return this.server.device.name;
|
|
1157
1157
|
}
|
|
@@ -1616,21 +1616,6 @@ var TIMESTAMP_SCALE = 1.6;
|
|
|
1616
1616
|
var CUBE_HELLO = 2;
|
|
1617
1617
|
var STATE_CHANGE = 3;
|
|
1618
1618
|
var QiyiCube = class _QiyiCube extends BluetoothPuzzle {
|
|
1619
|
-
constructor(kpuzzle, aesKey, server) {
|
|
1620
|
-
super();
|
|
1621
|
-
this.kpuzzle = kpuzzle;
|
|
1622
|
-
this.aesKey = aesKey;
|
|
1623
|
-
this.server = server;
|
|
1624
|
-
this.allTimeStamps = /* @__PURE__ */ new Set();
|
|
1625
|
-
this.allTimeStampsQueue = [];
|
|
1626
|
-
void (async () => {
|
|
1627
|
-
await this.startNotifications();
|
|
1628
|
-
void this.sendAppHello();
|
|
1629
|
-
})();
|
|
1630
|
-
}
|
|
1631
|
-
kpuzzle;
|
|
1632
|
-
aesKey;
|
|
1633
|
-
server;
|
|
1634
1619
|
latestTimestamp;
|
|
1635
1620
|
allTimeStamps;
|
|
1636
1621
|
// Without this set, moves are constantly duplicated
|
|
@@ -1715,6 +1700,21 @@ var QiyiCube = class _QiyiCube extends BluetoothPuzzle {
|
|
|
1715
1700
|
);
|
|
1716
1701
|
return new _QiyiCube(await puzzles["3x3x3"].kpuzzle(), aesKey, server);
|
|
1717
1702
|
}
|
|
1703
|
+
kpuzzle;
|
|
1704
|
+
aesKey;
|
|
1705
|
+
server;
|
|
1706
|
+
constructor(kpuzzle, aesKey, server) {
|
|
1707
|
+
super();
|
|
1708
|
+
this.kpuzzle = kpuzzle;
|
|
1709
|
+
this.aesKey = aesKey;
|
|
1710
|
+
this.server = server;
|
|
1711
|
+
this.allTimeStamps = /* @__PURE__ */ new Set();
|
|
1712
|
+
this.allTimeStampsQueue = [];
|
|
1713
|
+
void (async () => {
|
|
1714
|
+
await this.startNotifications();
|
|
1715
|
+
void this.sendAppHello();
|
|
1716
|
+
})();
|
|
1717
|
+
}
|
|
1718
1718
|
async sendAppHello() {
|
|
1719
1719
|
const mainService = await this.server.getPrimaryService(
|
|
1720
1720
|
UUIDs5.qiyiMainService
|
|
@@ -1955,19 +1955,6 @@ function sleep(ms) {
|
|
|
1955
1955
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1956
1956
|
}
|
|
1957
1957
|
var GanRobot = class _GanRobot extends EventTarget {
|
|
1958
|
-
constructor(_service, server, device, statusCharacteristic, moveCharacteristic) {
|
|
1959
|
-
super();
|
|
1960
|
-
this.server = server;
|
|
1961
|
-
this.statusCharacteristic = statusCharacteristic;
|
|
1962
|
-
this.moveCharacteristic = moveCharacteristic;
|
|
1963
|
-
device.addEventListener(
|
|
1964
|
-
"gattserverdisconnected",
|
|
1965
|
-
this.onDisconnect.bind(this)
|
|
1966
|
-
);
|
|
1967
|
-
}
|
|
1968
|
-
server;
|
|
1969
|
-
statusCharacteristic;
|
|
1970
|
-
moveCharacteristic;
|
|
1971
1958
|
experimentalDebugOnSend = null;
|
|
1972
1959
|
experimentalDebugLog = () => {
|
|
1973
1960
|
};
|
|
@@ -1978,6 +1965,19 @@ var GanRobot = class _GanRobot extends EventTarget {
|
|
|
1978
1965
|
bufferQueue: 0,
|
|
1979
1966
|
postSleep: 0
|
|
1980
1967
|
};
|
|
1968
|
+
server;
|
|
1969
|
+
statusCharacteristic;
|
|
1970
|
+
moveCharacteristic;
|
|
1971
|
+
constructor(_service, server, device, statusCharacteristic, moveCharacteristic) {
|
|
1972
|
+
super();
|
|
1973
|
+
this.server = server;
|
|
1974
|
+
this.statusCharacteristic = statusCharacteristic;
|
|
1975
|
+
this.moveCharacteristic = moveCharacteristic;
|
|
1976
|
+
device.addEventListener(
|
|
1977
|
+
"gattserverdisconnected",
|
|
1978
|
+
this.onDisconnect.bind(this)
|
|
1979
|
+
);
|
|
1980
|
+
}
|
|
1981
1981
|
// We have to perform async operations before we call the constructor.
|
|
1982
1982
|
static async connect(server, device) {
|
|
1983
1983
|
const ganTimerService = await server.getPrimaryService(
|
|
@@ -2156,6 +2156,10 @@ var UUIDs7 = {
|
|
|
2156
2156
|
timeCharacteristic: "0000fff2-0000-1000-8000-00805f9b34fb"
|
|
2157
2157
|
};
|
|
2158
2158
|
var GanTimer = class _GanTimer extends EventTarget {
|
|
2159
|
+
polling = false;
|
|
2160
|
+
previousDetail = null;
|
|
2161
|
+
server;
|
|
2162
|
+
timeCharacteristic;
|
|
2159
2163
|
constructor(_service, server, device, timeCharacteristic) {
|
|
2160
2164
|
super();
|
|
2161
2165
|
this.server = server;
|
|
@@ -2167,10 +2171,6 @@ var GanTimer = class _GanTimer extends EventTarget {
|
|
|
2167
2171
|
this.onDisconnect.bind(this)
|
|
2168
2172
|
);
|
|
2169
2173
|
}
|
|
2170
|
-
server;
|
|
2171
|
-
timeCharacteristic;
|
|
2172
|
-
polling = false;
|
|
2173
|
-
previousDetail = null;
|
|
2174
2174
|
// We have to perform async operations before we call the constructor.
|
|
2175
2175
|
static async connect(server, device) {
|
|
2176
2176
|
const ganTimerService = await server.getPrimaryService(
|