@overlayed/app 0.7.2 → 0.8.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/index.d.ts +44 -12
- package/dist/index.js +533 -444
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (s, e, t) =>
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var at = (s, e, t) => e in s ? it(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var l = (s, e, t) => at(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { type as L } from "arktype";
|
|
5
|
-
import
|
|
6
|
-
import y, { join as
|
|
7
|
-
import { createRequire as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { createHash as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import _, { mkdirSync as ge, existsSync as fe, writeFileSync as pe, createWriteStream as Oe, readdirSync as Re, unlinkSync as xe, readFileSync as Te, copyFileSync as ot } from "node:fs";
|
|
6
|
+
import y, { join as A, resolve as lt } from "node:path";
|
|
7
|
+
import { createRequire as te } from "node:module";
|
|
8
|
+
import E from "node:fs/promises";
|
|
9
|
+
import Ge from "jszip";
|
|
10
|
+
import { createHash as ct } from "node:crypto";
|
|
11
|
+
import ht from "node:events";
|
|
12
|
+
import ut, { app as Ne } from "electron";
|
|
13
|
+
var dt = Object.defineProperty, gt = (s, e, t) => e in s ? dt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, b = (s, e, t) => gt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
14
|
+
function ft(s) {
|
|
14
15
|
return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
15
16
|
var r = s.get(e);
|
|
16
17
|
r ? r.push(t) : s.set(e, [t]);
|
|
@@ -26,9 +27,9 @@ function ht(s) {
|
|
|
26
27
|
});
|
|
27
28
|
} };
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
class ye {
|
|
30
31
|
constructor() {
|
|
31
|
-
b(this, "emitter"), this.emitter =
|
|
32
|
+
b(this, "emitter"), this.emitter = ft();
|
|
32
33
|
}
|
|
33
34
|
on(e, t) {
|
|
34
35
|
this.emitter.on(e, t);
|
|
@@ -42,8 +43,8 @@ let de = class {
|
|
|
42
43
|
removeAllListeners() {
|
|
43
44
|
this.emitter.all.clear();
|
|
44
45
|
}
|
|
45
|
-
}
|
|
46
|
-
function
|
|
46
|
+
}
|
|
47
|
+
function me(s, ...e) {
|
|
47
48
|
var t;
|
|
48
49
|
return t = class extends s {
|
|
49
50
|
/**
|
|
@@ -60,7 +61,7 @@ function ge(s, ...e) {
|
|
|
60
61
|
}
|
|
61
62
|
}, b(t, "_instance"), t;
|
|
62
63
|
}
|
|
63
|
-
let
|
|
64
|
+
let pt = class extends ye {
|
|
64
65
|
destroy() {
|
|
65
66
|
this.removeAllListeners();
|
|
66
67
|
}
|
|
@@ -89,13 +90,13 @@ let ut = class extends de {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
};
|
|
92
|
-
|
|
93
|
-
let
|
|
94
|
-
constructor(e, t
|
|
93
|
+
me(pt);
|
|
94
|
+
let yt = class Be extends ye {
|
|
95
|
+
constructor(e, t) {
|
|
95
96
|
super(), b(this, "stream"), b(this, "logPath"), b(this, "baseFileName"), b(this, "currentDate"), b(this, "rotationCheckInterval"), b(this, "isRotating", !1), this.logPath = e, this.baseFileName = t.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
|
|
96
97
|
}
|
|
97
|
-
static scope(e, t
|
|
98
|
-
return new
|
|
98
|
+
static scope(e, t) {
|
|
99
|
+
return new Be(e, t);
|
|
99
100
|
}
|
|
100
101
|
log(...e) {
|
|
101
102
|
this.write("log", ...e);
|
|
@@ -125,16 +126,16 @@ let dt = class Te extends de {
|
|
|
125
126
|
}
|
|
126
127
|
ensureLogDirectory() {
|
|
127
128
|
try {
|
|
128
|
-
|
|
129
|
+
ge(this.logPath, { recursive: !0 });
|
|
129
130
|
} catch (e) {
|
|
130
131
|
throw console.error(`Failed to create log directory ${this.logPath}:`, e), e;
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
ensureLogFile() {
|
|
134
|
-
const e =
|
|
135
|
-
if (!
|
|
135
|
+
const e = A(this.logPath, this.getFileName(this.currentDate));
|
|
136
|
+
if (!fe(e))
|
|
136
137
|
try {
|
|
137
|
-
|
|
138
|
+
pe(e, "", "utf8");
|
|
138
139
|
} catch (t) {
|
|
139
140
|
throw console.error(`Failed to create log file ${e}:`, t), t;
|
|
140
141
|
}
|
|
@@ -143,8 +144,8 @@ let dt = class Te extends de {
|
|
|
143
144
|
return e.toISOString().split("T")[0];
|
|
144
145
|
}
|
|
145
146
|
createStream() {
|
|
146
|
-
const e =
|
|
147
|
-
return
|
|
147
|
+
const e = A(this.logPath, this.getFileName(this.currentDate));
|
|
148
|
+
return Oe(e, {
|
|
148
149
|
flags: "a",
|
|
149
150
|
encoding: "utf8"
|
|
150
151
|
});
|
|
@@ -163,28 +164,28 @@ let dt = class Te extends de {
|
|
|
163
164
|
return setInterval(() => this.rotateLogs(), 6e4);
|
|
164
165
|
}
|
|
165
166
|
cleanupOldLogs() {
|
|
166
|
-
const e =
|
|
167
|
+
const e = Re(this.logPath), t = /* @__PURE__ */ new Date();
|
|
167
168
|
t.setDate(t.getDate() - 3), e.filter((r) => r.startsWith(this.baseFileName) && r.endsWith(".log")).filter((r) => {
|
|
168
169
|
const n = r.replace(`${this.baseFileName}-`, "").replace(".log", "");
|
|
169
170
|
return new Date(n) < t;
|
|
170
171
|
}).forEach((r) => {
|
|
171
172
|
try {
|
|
172
|
-
|
|
173
|
+
xe(A(this.logPath, r));
|
|
173
174
|
} catch (n) {
|
|
174
175
|
console.error(`Failed to delete old log file ${r}:`, n);
|
|
175
176
|
}
|
|
176
177
|
});
|
|
177
178
|
}
|
|
178
179
|
write(e, ...t) {
|
|
179
|
-
const r = /* @__PURE__ */ new Date(), n = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`,
|
|
180
|
+
const r = /* @__PURE__ */ new Date(), n = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`, a = t.map((i) => typeof i == "object" ? JSON.stringify(i, void 0, 2) : String(i)).join(" "), o = `[${n}] [${e}] ${a}
|
|
180
181
|
`;
|
|
181
|
-
this.stream.write(o, (
|
|
182
|
-
|
|
182
|
+
this.stream.write(o, (i) => {
|
|
183
|
+
i ? this.emit("error", i) : this.emit("write", o);
|
|
183
184
|
});
|
|
184
185
|
}
|
|
185
186
|
};
|
|
186
|
-
const
|
|
187
|
-
let
|
|
187
|
+
const mt = () => y.join(process.env.APPDATA ?? "", "overlayed"), bt = (s) => y.join(mt(), "apps", s), vt = (s) => y.join(bt(s), "logs");
|
|
188
|
+
let wt = class {
|
|
188
189
|
constructor() {
|
|
189
190
|
b(this, "data", []);
|
|
190
191
|
}
|
|
@@ -206,12 +207,12 @@ let yt = class {
|
|
|
206
207
|
e && (yield e);
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
|
-
},
|
|
210
|
+
}, Et = class {
|
|
210
211
|
constructor() {
|
|
211
|
-
b(this, "fileName", "app.log"), b(this, "fileLogger"), b(this, "path"), b(this, "appId"), b(this, "messageQueue", new
|
|
212
|
+
b(this, "fileName", "app.log"), b(this, "fileLogger"), b(this, "path"), b(this, "appId"), b(this, "messageQueue", new wt());
|
|
212
213
|
}
|
|
213
214
|
init(e) {
|
|
214
|
-
this.appId = e, this.path =
|
|
215
|
+
this.appId = e, this.path = vt(e), this.fileLogger = new yt(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
|
|
215
216
|
var r;
|
|
216
217
|
(r = this.fileLogger) == null || r[t.type](...t.args);
|
|
217
218
|
});
|
|
@@ -268,18 +269,18 @@ let yt = class {
|
|
|
268
269
|
console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
|
|
269
270
|
}
|
|
270
271
|
};
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
PipeEventServer:
|
|
274
|
-
PipeEventClient:
|
|
275
|
-
PipeEventBase:
|
|
276
|
-
ProcessMonitor:
|
|
277
|
-
Process:
|
|
278
|
-
InjectionMethod:
|
|
279
|
-
AccessLevel:
|
|
280
|
-
HardwareInterface:
|
|
281
|
-
} =
|
|
282
|
-
let
|
|
272
|
+
me(Et);
|
|
273
|
+
const It = te(import.meta.url), {
|
|
274
|
+
PipeEventServer: kt,
|
|
275
|
+
PipeEventClient: cs,
|
|
276
|
+
PipeEventBase: hs,
|
|
277
|
+
ProcessMonitor: us,
|
|
278
|
+
Process: ds,
|
|
279
|
+
InjectionMethod: gs,
|
|
280
|
+
AccessLevel: fs,
|
|
281
|
+
HardwareInterface: ps
|
|
282
|
+
} = It("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
|
|
283
|
+
let St = class extends ye {
|
|
283
284
|
constructor(e) {
|
|
284
285
|
super(), b(this, "server", null), b(this, "_hasConnection", !1), b(this, "pipeId"), this.pipeId = e, this.init();
|
|
285
286
|
}
|
|
@@ -293,7 +294,7 @@ let wt = class extends de {
|
|
|
293
294
|
// TODO make sure that new events and new event keys do not stop the app from working
|
|
294
295
|
// this is because we may have new events/event keys from a DLL but the types/validations might not be up to date
|
|
295
296
|
init() {
|
|
296
|
-
this.server = new
|
|
297
|
+
this.server = new kt(this.pipeId, { clientCount: 1, access: 1 }), this.server.on("event", (e) => {
|
|
297
298
|
try {
|
|
298
299
|
const t = JSON.parse(e);
|
|
299
300
|
this.emit("data", [t]);
|
|
@@ -307,8 +308,8 @@ let wt = class extends de {
|
|
|
307
308
|
});
|
|
308
309
|
}
|
|
309
310
|
};
|
|
310
|
-
const
|
|
311
|
-
function
|
|
311
|
+
const be = me(St, "stats-cc");
|
|
312
|
+
function _t(s) {
|
|
312
313
|
return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
|
|
313
314
|
var r = s.get(e);
|
|
314
315
|
r ? r.push(t) : s.set(e, [t]);
|
|
@@ -324,10 +325,10 @@ function It(s) {
|
|
|
324
325
|
});
|
|
325
326
|
} };
|
|
326
327
|
}
|
|
327
|
-
class
|
|
328
|
+
class ve {
|
|
328
329
|
constructor() {
|
|
329
330
|
l(this, "emitter");
|
|
330
|
-
this.emitter =
|
|
331
|
+
this.emitter = _t();
|
|
331
332
|
}
|
|
332
333
|
on(e, t) {
|
|
333
334
|
this.emitter.on(e, t);
|
|
@@ -342,7 +343,7 @@ class pe {
|
|
|
342
343
|
this.emitter.all.clear();
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
|
-
class
|
|
346
|
+
class Pt {
|
|
346
347
|
constructor() {
|
|
347
348
|
l(this, "listeners");
|
|
348
349
|
this.listeners = /* @__PURE__ */ new Map();
|
|
@@ -356,11 +357,11 @@ class Et {
|
|
|
356
357
|
r && r.delete(t);
|
|
357
358
|
}
|
|
358
359
|
async emit(e, ...t) {
|
|
359
|
-
const r = this.listeners.get(e) || /* @__PURE__ */ new Set(), n = this.listeners.get("*") || /* @__PURE__ */ new Set(),
|
|
360
|
-
return
|
|
361
|
-
|
|
360
|
+
const r = this.listeners.get(e) || /* @__PURE__ */ new Set(), n = this.listeners.get("*") || /* @__PURE__ */ new Set(), a = [...Array.from(r), ...Array.from(n)];
|
|
361
|
+
return a.length === 0 ? [] : await Promise.all(
|
|
362
|
+
a.map(async (i) => {
|
|
362
363
|
try {
|
|
363
|
-
const c =
|
|
364
|
+
const c = i(...t);
|
|
364
365
|
return c instanceof Promise ? await c : c;
|
|
365
366
|
} catch (c) {
|
|
366
367
|
console.error(`Error in event listener for ${String(e)}:`, c);
|
|
@@ -373,7 +374,7 @@ class Et {
|
|
|
373
374
|
this.listeners.clear();
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function k(s, ...e) {
|
|
377
378
|
var r;
|
|
378
379
|
return r = class extends s {
|
|
379
380
|
/**
|
|
@@ -390,7 +391,7 @@ function E(s, ...e) {
|
|
|
390
391
|
}
|
|
391
392
|
}, l(r, "_instance"), r;
|
|
392
393
|
}
|
|
393
|
-
class
|
|
394
|
+
class Ct extends ve {
|
|
394
395
|
destroy() {
|
|
395
396
|
this.removeAllListeners();
|
|
396
397
|
}
|
|
@@ -419,8 +420,8 @@ class _t extends pe {
|
|
|
419
420
|
});
|
|
420
421
|
}
|
|
421
422
|
}
|
|
422
|
-
const I =
|
|
423
|
-
class
|
|
423
|
+
const I = k(Ct);
|
|
424
|
+
class Lt {
|
|
424
425
|
constructor(e) {
|
|
425
426
|
l(this, "data");
|
|
426
427
|
l(this, "_schema");
|
|
@@ -448,7 +449,7 @@ class kt {
|
|
|
448
449
|
save(e) {
|
|
449
450
|
const t = this.onBeforeSave(e);
|
|
450
451
|
try {
|
|
451
|
-
|
|
452
|
+
_.writeFileSync(this.getFilePath(), JSON.stringify(t, void 0, 2));
|
|
452
453
|
} catch {
|
|
453
454
|
return;
|
|
454
455
|
}
|
|
@@ -461,7 +462,7 @@ class kt {
|
|
|
461
462
|
return this.data = e, e;
|
|
462
463
|
}
|
|
463
464
|
try {
|
|
464
|
-
const e =
|
|
465
|
+
const e = _.readFileSync(this.getFilePath(), "utf8"), t = this.onAfterLoad(this.parseStoredData(e));
|
|
465
466
|
return this.data = t, t;
|
|
466
467
|
} catch {
|
|
467
468
|
return this.data = this._defaultValue;
|
|
@@ -491,14 +492,14 @@ class kt {
|
|
|
491
492
|
}
|
|
492
493
|
canReadWriteFile(e) {
|
|
493
494
|
try {
|
|
494
|
-
return
|
|
495
|
+
return _.accessSync(e, _.constants.R_OK | _.constants.W_OK), !0;
|
|
495
496
|
} catch {
|
|
496
497
|
return !1;
|
|
497
498
|
}
|
|
498
499
|
}
|
|
499
500
|
fileExists(e) {
|
|
500
501
|
try {
|
|
501
|
-
return
|
|
502
|
+
return _.accessSync(e, _.constants.F_OK), !0;
|
|
502
503
|
} catch {
|
|
503
504
|
return !1;
|
|
504
505
|
}
|
|
@@ -517,8 +518,8 @@ class kt {
|
|
|
517
518
|
});
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
class
|
|
521
|
-
constructor(t, r
|
|
521
|
+
class we extends ve {
|
|
522
|
+
constructor(t, r) {
|
|
522
523
|
super();
|
|
523
524
|
l(this, "stream");
|
|
524
525
|
l(this, "logPath");
|
|
@@ -528,8 +529,8 @@ class ye extends pe {
|
|
|
528
529
|
l(this, "isRotating", !1);
|
|
529
530
|
this.logPath = t, this.baseFileName = r.replace(".log", ""), this.currentDate = this.getDateString(/* @__PURE__ */ new Date()), this.ensureLogDirectory(), this.ensureLogFile(), this.stream = this.createStream(), this.rotationCheckInterval = this.startRotationCheck(), this.cleanupOldLogs();
|
|
530
531
|
}
|
|
531
|
-
static scope(t, r
|
|
532
|
-
return new
|
|
532
|
+
static scope(t, r) {
|
|
533
|
+
return new we(t, r);
|
|
533
534
|
}
|
|
534
535
|
log(...t) {
|
|
535
536
|
this.write("log", ...t);
|
|
@@ -559,16 +560,16 @@ class ye extends pe {
|
|
|
559
560
|
}
|
|
560
561
|
ensureLogDirectory() {
|
|
561
562
|
try {
|
|
562
|
-
|
|
563
|
+
ge(this.logPath, { recursive: !0 });
|
|
563
564
|
} catch (t) {
|
|
564
565
|
throw console.error(`Failed to create log directory ${this.logPath}:`, t), t;
|
|
565
566
|
}
|
|
566
567
|
}
|
|
567
568
|
ensureLogFile() {
|
|
568
|
-
const t =
|
|
569
|
-
if (!
|
|
569
|
+
const t = A(this.logPath, this.getFileName(this.currentDate));
|
|
570
|
+
if (!fe(t))
|
|
570
571
|
try {
|
|
571
|
-
|
|
572
|
+
pe(t, "", "utf8");
|
|
572
573
|
} catch (r) {
|
|
573
574
|
throw console.error(`Failed to create log file ${t}:`, r), r;
|
|
574
575
|
}
|
|
@@ -577,8 +578,8 @@ class ye extends pe {
|
|
|
577
578
|
return t.toISOString().split("T")[0];
|
|
578
579
|
}
|
|
579
580
|
createStream() {
|
|
580
|
-
const t =
|
|
581
|
-
return
|
|
581
|
+
const t = A(this.logPath, this.getFileName(this.currentDate));
|
|
582
|
+
return Oe(t, {
|
|
582
583
|
flags: "a",
|
|
583
584
|
encoding: "utf8"
|
|
584
585
|
});
|
|
@@ -597,28 +598,28 @@ class ye extends pe {
|
|
|
597
598
|
return setInterval(() => this.rotateLogs(), 6e4);
|
|
598
599
|
}
|
|
599
600
|
cleanupOldLogs() {
|
|
600
|
-
const t =
|
|
601
|
+
const t = Re(this.logPath), r = /* @__PURE__ */ new Date();
|
|
601
602
|
r.setDate(r.getDate() - 3), t.filter((n) => n.startsWith(this.baseFileName) && n.endsWith(".log")).filter((n) => {
|
|
602
|
-
const
|
|
603
|
-
return new Date(
|
|
603
|
+
const a = n.replace(`${this.baseFileName}-`, "").replace(".log", "");
|
|
604
|
+
return new Date(a) < r;
|
|
604
605
|
}).forEach((n) => {
|
|
605
606
|
try {
|
|
606
|
-
|
|
607
|
-
} catch (
|
|
608
|
-
console.error(`Failed to delete old log file ${n}:`,
|
|
607
|
+
xe(A(this.logPath, n));
|
|
608
|
+
} catch (a) {
|
|
609
|
+
console.error(`Failed to delete old log file ${n}:`, a);
|
|
609
610
|
}
|
|
610
611
|
});
|
|
611
612
|
}
|
|
612
613
|
write(t, ...r) {
|
|
613
|
-
const n = /* @__PURE__ */ new Date(),
|
|
614
|
+
const n = /* @__PURE__ */ new Date(), a = n.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${n.getMilliseconds().toString().padStart(3, "0")}`, o = r.map((c) => typeof c == "object" ? JSON.stringify(c, void 0, 2) : String(c)).join(" "), i = `[${a}] [${t}] ${o}
|
|
614
615
|
`;
|
|
615
|
-
this.stream.write(
|
|
616
|
-
c ? this.emit("error", c) : this.emit("write",
|
|
616
|
+
this.stream.write(i, (c) => {
|
|
617
|
+
c ? this.emit("error", c) : this.emit("write", i);
|
|
617
618
|
});
|
|
618
619
|
}
|
|
619
620
|
}
|
|
620
|
-
const
|
|
621
|
-
class
|
|
621
|
+
const Ee = () => y.join(process.env.APPDATA ?? "", "overlayed"), je = (s) => y.join(Ee(), "apps", s), Kt = (s) => y.join(je(s), "logs");
|
|
622
|
+
class ze {
|
|
622
623
|
constructor() {
|
|
623
624
|
l(this, "data", []);
|
|
624
625
|
}
|
|
@@ -641,16 +642,16 @@ class Ne {
|
|
|
641
642
|
}
|
|
642
643
|
}
|
|
643
644
|
}
|
|
644
|
-
class
|
|
645
|
+
class Ft {
|
|
645
646
|
constructor() {
|
|
646
647
|
l(this, "fileName", "app.log");
|
|
647
648
|
l(this, "fileLogger");
|
|
648
649
|
l(this, "path");
|
|
649
650
|
l(this, "appId");
|
|
650
|
-
l(this, "messageQueue", new
|
|
651
|
+
l(this, "messageQueue", new ze());
|
|
651
652
|
}
|
|
652
653
|
init(e) {
|
|
653
|
-
this.appId = e, this.path =
|
|
654
|
+
this.appId = e, this.path = Kt(e), this.fileLogger = new we(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
|
|
654
655
|
var r;
|
|
655
656
|
(r = this.fileLogger) == null || r[t.type](...t.args);
|
|
656
657
|
});
|
|
@@ -707,12 +708,59 @@ class St {
|
|
|
707
708
|
console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
|
|
708
709
|
}
|
|
709
710
|
}
|
|
710
|
-
const
|
|
711
|
-
|
|
711
|
+
const re = k(Ft);
|
|
712
|
+
function Mt(s) {
|
|
713
|
+
return s;
|
|
714
|
+
}
|
|
715
|
+
function Dt(s) {
|
|
716
|
+
return Mt;
|
|
717
|
+
}
|
|
718
|
+
class $t extends ht {
|
|
719
|
+
constructor(t, r) {
|
|
720
|
+
super();
|
|
721
|
+
l(this, "blob");
|
|
722
|
+
l(this, "chunkSizeMb");
|
|
723
|
+
l(this, "maxConcurrent");
|
|
724
|
+
l(this, "shouldStop", !1);
|
|
725
|
+
this.blob = t, this.chunkSizeMb = r.chunkSizeMb, this.maxConcurrent = r.maxConcurrent ?? 3;
|
|
726
|
+
}
|
|
727
|
+
get totalChunks() {
|
|
728
|
+
return Math.ceil(this.blob.size / (this.chunkSizeMb * 1024 * 1024));
|
|
729
|
+
}
|
|
730
|
+
async chunk(t) {
|
|
731
|
+
const r = this.chunkSizeMb * 1024 * 1024, n = this.totalChunks;
|
|
732
|
+
if (n === 0) return;
|
|
733
|
+
const a = 5, o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), u = [];
|
|
734
|
+
for (let h = 0; h < n; h++)
|
|
735
|
+
u.push(h);
|
|
736
|
+
const d = async (h) => {
|
|
737
|
+
const f = h * r, w = Math.min(f + r, this.blob.size), F = this.blob.slice(f, w);
|
|
738
|
+
try {
|
|
739
|
+
await t(F, h), c.add(h), this.emit("chunkComplete", h), i.delete(h);
|
|
740
|
+
} catch (M) {
|
|
741
|
+
const D = o.get(h) || 0;
|
|
742
|
+
D < a ? (o.set(h, D + 1), await new Promise((v) => setTimeout(v, (D + 1) * 1e3)), u.push(h)) : (c.add(h), this.emit("error", M), this.shouldStop = !0, i.delete(h));
|
|
743
|
+
}
|
|
744
|
+
}, p = [], g = async () => {
|
|
745
|
+
for (; (u.length > 0 || i.size > 0) && !this.shouldStop; ) {
|
|
746
|
+
if (u.length === 0) {
|
|
747
|
+
await new Promise((f) => setTimeout(f, 10));
|
|
748
|
+
continue;
|
|
749
|
+
}
|
|
750
|
+
const h = u.shift();
|
|
751
|
+
c.has(h) || i.has(h) || (i.add(h), await d(h));
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
for (let h = 0; h < this.maxConcurrent; h++)
|
|
755
|
+
p.push(g());
|
|
756
|
+
return await Promise.all(p);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
class Ve {
|
|
712
760
|
constructor(e) {
|
|
713
761
|
l(this, "logger");
|
|
714
762
|
l(this, "initialized", !1);
|
|
715
|
-
this.logger =
|
|
763
|
+
this.logger = re.getInstance().scope(e);
|
|
716
764
|
}
|
|
717
765
|
init() {
|
|
718
766
|
this.logger.log("Initializing"), this.initialized = !0;
|
|
@@ -721,12 +769,12 @@ class Be {
|
|
|
721
769
|
this.logger.log("Destroying"), this.initialized = !1;
|
|
722
770
|
}
|
|
723
771
|
}
|
|
724
|
-
class
|
|
772
|
+
class se extends ve {
|
|
725
773
|
constructor(t) {
|
|
726
774
|
super();
|
|
727
775
|
l(this, "logger");
|
|
728
776
|
l(this, "initialized", !1);
|
|
729
|
-
this.logger =
|
|
777
|
+
this.logger = re.getInstance().scope(t);
|
|
730
778
|
}
|
|
731
779
|
init() {
|
|
732
780
|
this.logger.log("Initializing"), this.initialized = !0;
|
|
@@ -735,12 +783,12 @@ class te extends pe {
|
|
|
735
783
|
this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
|
|
736
784
|
}
|
|
737
785
|
}
|
|
738
|
-
class
|
|
786
|
+
class At extends Pt {
|
|
739
787
|
constructor(t) {
|
|
740
788
|
super();
|
|
741
789
|
l(this, "logger");
|
|
742
790
|
l(this, "initialized", !1);
|
|
743
|
-
this.logger =
|
|
791
|
+
this.logger = re.getInstance().scope(t);
|
|
744
792
|
}
|
|
745
793
|
init() {
|
|
746
794
|
this.logger.log("Initializing"), this.initialized = !0;
|
|
@@ -749,144 +797,144 @@ class Ct extends Et {
|
|
|
749
797
|
this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
|
|
750
798
|
}
|
|
751
799
|
}
|
|
752
|
-
var
|
|
753
|
-
function
|
|
800
|
+
var R = "object", Ue = "function", He = "prototype", ae = "text", Ie = "json", Le = "abort", oe = "paramsSerializer", Ke = "addEventListener", z = "status", S = "headers", ne = Object, K = void 0, X = null, le = ne[He], Y = ne.keys, G = Array.isArray, Fe = "method", We = "HEAD", ce = "GET", Qe = "OPTIONS", Ot = "POST", Rt = "PUT", xt = "PATCH", Tt = "DELETE";
|
|
801
|
+
function Gt(s, e) {
|
|
754
802
|
let t = new AbortController();
|
|
755
|
-
function r(
|
|
756
|
-
t.abort(
|
|
803
|
+
function r(i) {
|
|
804
|
+
t.abort(i), a();
|
|
757
805
|
}
|
|
758
806
|
let n = [];
|
|
759
|
-
for (let
|
|
760
|
-
if ((
|
|
761
|
-
r(
|
|
807
|
+
for (let i of s) {
|
|
808
|
+
if ((i == null ? void 0 : i.aborted) === !0) {
|
|
809
|
+
r(i.reason);
|
|
762
810
|
break;
|
|
763
811
|
}
|
|
764
|
-
if (
|
|
812
|
+
if (i != null && i[Ke]) {
|
|
765
813
|
let c = () => {
|
|
766
|
-
r(
|
|
814
|
+
r(i.reason);
|
|
767
815
|
};
|
|
768
816
|
n.push(() => {
|
|
769
817
|
var u;
|
|
770
|
-
(u =
|
|
771
|
-
}),
|
|
818
|
+
(u = i.removeEventListener) == null || u.call(i, Le, c);
|
|
819
|
+
}), i[Ke](Le, c);
|
|
772
820
|
}
|
|
773
821
|
}
|
|
774
|
-
function
|
|
775
|
-
n.forEach((
|
|
822
|
+
function a() {
|
|
823
|
+
n.forEach((i) => i()), e == null || e();
|
|
776
824
|
}
|
|
777
825
|
let o = t.signal;
|
|
778
|
-
return o.clear =
|
|
826
|
+
return o.clear = a, o;
|
|
779
827
|
}
|
|
780
|
-
var
|
|
781
|
-
if (s !==
|
|
782
|
-
if (typeof
|
|
783
|
-
let e =
|
|
784
|
-
return e ===
|
|
828
|
+
var Me = ne.getPrototypeOf, De = (s) => {
|
|
829
|
+
if (s !== X && typeof s === R) {
|
|
830
|
+
if (typeof Me === Ue) {
|
|
831
|
+
let e = Me(s);
|
|
832
|
+
return e === le || e === X;
|
|
785
833
|
}
|
|
786
|
-
return
|
|
834
|
+
return le.toString.call(s) === `[${R} Object]`;
|
|
787
835
|
}
|
|
788
836
|
return !1;
|
|
789
|
-
},
|
|
790
|
-
if (
|
|
791
|
-
return
|
|
792
|
-
["__proto__", "constructor",
|
|
837
|
+
}, ke = (...s) => s.reduce((e, t) => {
|
|
838
|
+
if (G(t)) throw new TypeError(`Arguments must be ${R}s, not arrays.`);
|
|
839
|
+
return Y(t).forEach((r) => {
|
|
840
|
+
["__proto__", "constructor", He].includes(r) || (G(e[r]) && G(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : De(e[r]) && De(t[r]) ? e[r] = ke(e[r], t[r]) : e[r] = t[r]);
|
|
793
841
|
}), e;
|
|
794
842
|
}, {});
|
|
795
|
-
function
|
|
796
|
-
if (s === K || s ===
|
|
797
|
-
let n = [],
|
|
798
|
-
if (c && !o) return `.${
|
|
843
|
+
function Se(s, e = !0, t = X, r) {
|
|
844
|
+
if (s === K || s === X) return "";
|
|
845
|
+
let n = [], a = e ? encodeURIComponent : (p) => p, o = G(s), { arrayFormat: i, allowDots: c, serializeDate: u } = r || {}, d = (p) => {
|
|
846
|
+
if (c && !o) return `.${p}`;
|
|
799
847
|
if (o) {
|
|
800
|
-
if (
|
|
801
|
-
if (
|
|
848
|
+
if (i === "brackets") return "[]";
|
|
849
|
+
if (i === "repeat") return "";
|
|
802
850
|
}
|
|
803
|
-
return `[${
|
|
851
|
+
return `[${p}]`;
|
|
804
852
|
};
|
|
805
|
-
for (let
|
|
806
|
-
let
|
|
807
|
-
if (
|
|
808
|
-
let
|
|
809
|
-
if (!isNaN(
|
|
810
|
-
let
|
|
811
|
-
|
|
812
|
-
} else n.push(`${
|
|
853
|
+
for (let p in s) if (le.hasOwnProperty.call(s, p)) {
|
|
854
|
+
let g = s[p];
|
|
855
|
+
if (g !== K) {
|
|
856
|
+
let h = t ? `${t}${d(p)}` : a(p);
|
|
857
|
+
if (!isNaN(g) && g instanceof Date && (g = u ? u(g) : g.toISOString()), typeof g === R) {
|
|
858
|
+
let f = Se(g, e, h, r);
|
|
859
|
+
f !== "" && n.push(f);
|
|
860
|
+
} else n.push(`${a(h)}=${a(g)}`);
|
|
813
861
|
}
|
|
814
862
|
}
|
|
815
863
|
return n.join("&");
|
|
816
864
|
}
|
|
817
|
-
function
|
|
818
|
-
return
|
|
865
|
+
function he(s) {
|
|
866
|
+
return G(s) ? s.map(he) : (s && typeof s === R && Y(s).forEach((e) => {
|
|
819
867
|
let t = s[e];
|
|
820
|
-
t === K ? delete s[e] :
|
|
868
|
+
t === K ? delete s[e] : he(t);
|
|
821
869
|
}), s);
|
|
822
870
|
}
|
|
823
|
-
function
|
|
871
|
+
function Nt(s) {
|
|
824
872
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
|
|
825
873
|
}
|
|
826
|
-
function
|
|
874
|
+
function Bt(s, e) {
|
|
827
875
|
return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
|
|
828
876
|
}
|
|
829
|
-
var
|
|
877
|
+
var jt = "XiorError", zt = "XiorTimeoutError", qe = class extends Error {
|
|
830
878
|
constructor(s, e, t) {
|
|
831
|
-
super(s), this.name =
|
|
879
|
+
super(s), this.name = jt, this.request = e, this.config = e, this.response = t;
|
|
832
880
|
}
|
|
833
|
-
},
|
|
881
|
+
}, Vt = class extends qe {
|
|
834
882
|
constructor(e, t, r) {
|
|
835
|
-
super(e, t, r), this.name =
|
|
883
|
+
super(e, t, r), this.name = zt;
|
|
836
884
|
}
|
|
837
|
-
},
|
|
838
|
-
for (var t in e || (e = {}))
|
|
839
|
-
if (
|
|
885
|
+
}, Ut = Object.defineProperty, Ht = Object.defineProperties, Wt = Object.getOwnPropertyDescriptors, Z = Object.getOwnPropertySymbols, Je = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable, $e = (s, e, t) => e in s ? Ut(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, N = (s, e) => {
|
|
886
|
+
for (var t in e || (e = {})) Je.call(e, t) && $e(s, t, e[t]);
|
|
887
|
+
if (Z) for (var t of Z(e)) Xe.call(e, t) && $e(s, t, e[t]);
|
|
840
888
|
return s;
|
|
841
|
-
},
|
|
889
|
+
}, Q = (s, e) => Ht(s, Wt(e)), Qt = (s, e) => {
|
|
842
890
|
var t = {};
|
|
843
|
-
for (var r in s)
|
|
844
|
-
if (s != null &&
|
|
891
|
+
for (var r in s) Je.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
|
|
892
|
+
if (s != null && Z) for (var r of Z(s)) e.indexOf(r) < 0 && Xe.call(s, r) && (t[r] = s[r]);
|
|
845
893
|
return t;
|
|
846
|
-
},
|
|
847
|
-
var
|
|
894
|
+
}, B = (s, e, t) => new Promise((r, n) => {
|
|
895
|
+
var a = (c) => {
|
|
848
896
|
try {
|
|
849
|
-
|
|
897
|
+
i(t.next(c));
|
|
850
898
|
} catch (u) {
|
|
851
899
|
n(u);
|
|
852
900
|
}
|
|
853
901
|
}, o = (c) => {
|
|
854
902
|
try {
|
|
855
|
-
|
|
903
|
+
i(t.throw(c));
|
|
856
904
|
} catch (u) {
|
|
857
905
|
n(u);
|
|
858
906
|
}
|
|
859
|
-
},
|
|
860
|
-
|
|
861
|
-
}),
|
|
862
|
-
function
|
|
863
|
-
return [
|
|
907
|
+
}, i = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(a, o);
|
|
908
|
+
i((t = t.apply(s, e)).next());
|
|
909
|
+
}), _e = "application/", Ye = `${_e}x-www-form-urlencoded`, Ze = RegExp, qt = new Ze(`^${Ye}`, "i"), Jt = `${_e}${Ie}`, Xt = new Ze(`^${_e}.*${Ie}.*`, "i");
|
|
910
|
+
function Yt(s = ce) {
|
|
911
|
+
return [We, ce, Qe].includes(s);
|
|
864
912
|
}
|
|
865
|
-
var
|
|
866
|
-
function
|
|
867
|
-
return
|
|
868
|
-
let e = s[
|
|
869
|
-
if (
|
|
870
|
-
let
|
|
871
|
-
if (s != null && s[
|
|
872
|
-
let
|
|
873
|
-
|
|
913
|
+
var Zt = typeof URLSearchParams != `${K}`;
|
|
914
|
+
function er(s) {
|
|
915
|
+
return B(this, null, function* () {
|
|
916
|
+
let e = s[oe] || Se, t = s.encodeURI !== !1, r = s[Fe] && s[Fe].toUpperCase(), n = s.url, a = n, o = Zt && s.data instanceof URLSearchParams, i = o ? ne.fromEntries(s.data.entries()) : s.data, c = i, u = s != null && s[S] ? N({}, s[S]) : {}, d = s.params, p = Yt(r);
|
|
917
|
+
if (i && typeof i.append !== Ue) {
|
|
918
|
+
let g = "", h = "content-type";
|
|
919
|
+
if (s != null && s[S]) {
|
|
920
|
+
let f = Y(s[S]).find((w) => w.toLowerCase() === h);
|
|
921
|
+
f && (h = f, g = s[S][f]);
|
|
874
922
|
}
|
|
875
|
-
(!
|
|
923
|
+
(!g || o) && (g = p || o ? Ye : Jt, u[h] = g), typeof i === R && (p && d && (d = ke(i, d)), Xt.test(g) ? c = JSON.stringify(he(i)) : !p && qt.test(g) && (c = e(i)));
|
|
876
924
|
}
|
|
877
|
-
if (d &&
|
|
878
|
-
let
|
|
879
|
-
n += n.includes("?") ? `&${
|
|
925
|
+
if (d && Y(d).length > 0) {
|
|
926
|
+
let g = e(d, t);
|
|
927
|
+
n += n.includes("?") ? `&${g}` : `?${g}`;
|
|
880
928
|
}
|
|
881
|
-
return
|
|
929
|
+
return Q(N({}, s), { _data: c, _url: n, data: i, url: a, method: r, [S]: u, isGet: p });
|
|
882
930
|
});
|
|
883
931
|
}
|
|
884
|
-
var
|
|
885
|
-
function
|
|
886
|
-
return
|
|
932
|
+
var tr = typeof AbortController != `${K}`;
|
|
933
|
+
function rr(s, e) {
|
|
934
|
+
return B(this, null, function* () {
|
|
887
935
|
let t;
|
|
888
|
-
if (!e || !s.ok || [
|
|
889
|
-
if (t = yield s[
|
|
936
|
+
if (!e || !s.ok || [ae, Ie].includes(e)) {
|
|
937
|
+
if (t = yield s[ae](), t && e !== ae) try {
|
|
890
938
|
t = JSON.parse(t);
|
|
891
939
|
} catch {
|
|
892
940
|
}
|
|
@@ -897,9 +945,9 @@ function Qt(s, e) {
|
|
|
897
945
|
return t;
|
|
898
946
|
});
|
|
899
947
|
}
|
|
900
|
-
var
|
|
948
|
+
var sr = (s) => new O(s), O = class {
|
|
901
949
|
constructor(e) {
|
|
902
|
-
this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [
|
|
950
|
+
this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [S]: {} };
|
|
903
951
|
}
|
|
904
952
|
get interceptors() {
|
|
905
953
|
return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
|
|
@@ -920,137 +968,161 @@ var Jt = (s) => new M(s), M = class {
|
|
|
920
968
|
} };
|
|
921
969
|
}
|
|
922
970
|
request(e) {
|
|
923
|
-
return
|
|
924
|
-
let t =
|
|
925
|
-
t.withCredentials && !t[r] && (t[r] = "include"), t[
|
|
971
|
+
return B(this, null, function* () {
|
|
972
|
+
let t = ke(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
|
|
973
|
+
t.withCredentials && !t[r] && (t[r] = "include"), t[oe] || (t[oe] = Se);
|
|
926
974
|
for (let o of this.REQI) t = yield o(t);
|
|
927
975
|
let n = this._.bind(this);
|
|
928
976
|
this.P.forEach((o) => {
|
|
929
977
|
n = o(n, this);
|
|
930
978
|
});
|
|
931
|
-
let
|
|
979
|
+
let a = n(t);
|
|
932
980
|
if (!t._did) {
|
|
933
|
-
let o = 0,
|
|
981
|
+
let o = 0, i = [];
|
|
934
982
|
for (this.RESI.forEach(function(c) {
|
|
935
|
-
|
|
936
|
-
});
|
|
983
|
+
i.push(c.fn, c.onRejected);
|
|
984
|
+
}); i.length > o; ) a = a.then(i[o++], i[o++]);
|
|
937
985
|
}
|
|
938
|
-
return
|
|
986
|
+
return a;
|
|
939
987
|
});
|
|
940
988
|
}
|
|
941
989
|
_(e) {
|
|
942
|
-
return
|
|
943
|
-
let t = yield
|
|
990
|
+
return B(this, null, function* () {
|
|
991
|
+
let t = yield er(e), { url: r, method: n, headers: a, timeout: o, signal: i, data: c, _data: u, _url: d, isGet: p, fetch: g } = t, h = Qt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
|
|
944
992
|
e._url = d;
|
|
945
|
-
let
|
|
946
|
-
if (o &&
|
|
993
|
+
let f, w = [], F = K;
|
|
994
|
+
if (o && tr) {
|
|
947
995
|
let v = new AbortController();
|
|
948
|
-
|
|
949
|
-
v.abort(new
|
|
950
|
-
}, o),
|
|
996
|
+
F = setTimeout(() => {
|
|
997
|
+
v.abort(new Vt(`timeout of ${o}ms exceeded`, e));
|
|
998
|
+
}, o), w.push(v.signal);
|
|
951
999
|
}
|
|
952
|
-
|
|
953
|
-
clearTimeout(
|
|
1000
|
+
i && w.push(i), f = w[0], w.length > 1 && (f = Gt(w, () => {
|
|
1001
|
+
clearTimeout(F);
|
|
954
1002
|
}));
|
|
955
|
-
let
|
|
956
|
-
return e[
|
|
957
|
-
let { responseType:
|
|
1003
|
+
let M = d || r, D = "baseURL";
|
|
1004
|
+
return e[D] && !Nt(M) && (M = Bt(e[D], M)), (g || fetch)(M, Q(N({ body: p ? K : u }, h), { signal: f, method: n, headers: a })).then((v) => B(this, null, function* () {
|
|
1005
|
+
let { responseType: st } = e, Ce = { data: yield rr(v, st), response: v, config: e, request: e, [z]: v[z], statusText: v.statusText, [S]: v[S] };
|
|
958
1006
|
if (!v.ok) {
|
|
959
|
-
let
|
|
960
|
-
return Promise.reject(
|
|
1007
|
+
let nt = new qe(v[z] ? `Request failed with status code ${v[z]}` : "Network error", e, Ce);
|
|
1008
|
+
return Promise.reject(nt);
|
|
961
1009
|
}
|
|
962
|
-
return
|
|
1010
|
+
return Ce;
|
|
963
1011
|
})).finally(() => {
|
|
964
1012
|
var v;
|
|
965
|
-
|
|
1013
|
+
F && clearTimeout(F), (v = f == null ? void 0 : f.clear) == null || v.call(f);
|
|
966
1014
|
});
|
|
967
1015
|
});
|
|
968
1016
|
}
|
|
969
1017
|
cG(e) {
|
|
970
|
-
return (t, r) => this.request(r ?
|
|
1018
|
+
return (t, r) => this.request(r ? Q(N({}, r), { method: e, url: t }) : { method: e, url: t });
|
|
971
1019
|
}
|
|
972
1020
|
cP(e) {
|
|
973
|
-
return (t, r, n) => this.request(n ?
|
|
1021
|
+
return (t, r, n) => this.request(n ? Q(N({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
|
|
974
1022
|
}
|
|
975
1023
|
get(e, t) {
|
|
976
|
-
return this.cG(
|
|
1024
|
+
return this.cG(ce)(e, t);
|
|
977
1025
|
}
|
|
978
1026
|
head(e, t) {
|
|
979
|
-
return this.cG(
|
|
1027
|
+
return this.cG(We)(e, t);
|
|
980
1028
|
}
|
|
981
1029
|
post(e, t, r) {
|
|
982
|
-
return this.cP(
|
|
1030
|
+
return this.cP(Ot)(e, t, r);
|
|
983
1031
|
}
|
|
984
1032
|
put(e, t, r) {
|
|
985
|
-
return this.cP(
|
|
1033
|
+
return this.cP(Rt)(e, t, r);
|
|
986
1034
|
}
|
|
987
1035
|
patch(e, t, r) {
|
|
988
|
-
return this.cP(
|
|
1036
|
+
return this.cP(xt)(e, t, r);
|
|
989
1037
|
}
|
|
990
1038
|
delete(e, t) {
|
|
991
|
-
return this.cG(
|
|
1039
|
+
return this.cG(Tt)(e, t);
|
|
992
1040
|
}
|
|
993
1041
|
options(e, t) {
|
|
994
|
-
return this.cG(
|
|
1042
|
+
return this.cG(Qe)(e, t);
|
|
995
1043
|
}
|
|
996
1044
|
};
|
|
997
|
-
|
|
998
|
-
var
|
|
999
|
-
const
|
|
1045
|
+
O.create = sr, O.VERSION = "0.7.7";
|
|
1046
|
+
var nr = Object.assign(O.create(), { create: O.create, VERSION: O.VERSION }), et = nr;
|
|
1047
|
+
const Pe = et.create({
|
|
1000
1048
|
baseURL: "https://updater.stats.cc",
|
|
1001
1049
|
headers: {
|
|
1002
1050
|
Accept: "application/json",
|
|
1003
1051
|
"Accept-Encoding": "gzip, deflate, br"
|
|
1004
1052
|
}
|
|
1005
|
-
})
|
|
1006
|
-
|
|
1053
|
+
});
|
|
1054
|
+
let ue;
|
|
1055
|
+
function vs(s) {
|
|
1056
|
+
ue = s;
|
|
1057
|
+
}
|
|
1058
|
+
const ie = et.create({
|
|
1059
|
+
baseURL: void 0,
|
|
1007
1060
|
headers: {
|
|
1008
1061
|
Accept: "application/json",
|
|
1009
1062
|
"Accept-Encoding": "gzip, deflate, br"
|
|
1010
1063
|
}
|
|
1011
1064
|
});
|
|
1012
|
-
|
|
1013
|
-
|
|
1065
|
+
Pe.interceptors.request.use((s) => {
|
|
1066
|
+
const e = ue == null ? void 0 : ue();
|
|
1067
|
+
return e && (s.headers ?? (s.headers = {}), s.headers.Authorization = e), s;
|
|
1068
|
+
});
|
|
1069
|
+
function ir(s, e) {
|
|
1070
|
+
return Pe.get(`/v1/native/${tt(s)}/version.txt`, {
|
|
1014
1071
|
params: { channel: e },
|
|
1015
1072
|
responseType: "text"
|
|
1016
1073
|
});
|
|
1017
1074
|
}
|
|
1018
|
-
function
|
|
1019
|
-
return
|
|
1075
|
+
function ar(s, e) {
|
|
1076
|
+
return Pe.get(`/v1/native/${tt(s)}/files`, {
|
|
1020
1077
|
params: { channel: e },
|
|
1021
1078
|
responseType: "arraybuffer"
|
|
1022
1079
|
});
|
|
1023
1080
|
}
|
|
1024
|
-
function
|
|
1025
|
-
return
|
|
1081
|
+
function tt(s) {
|
|
1082
|
+
return s === "01JXPFK6YQ3N00N2Y9JHFNG55D" ? "siege-game-module" : s;
|
|
1026
1083
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return
|
|
1084
|
+
function or() {
|
|
1085
|
+
return ie.get("/v1/public/raven/config");
|
|
1029
1086
|
}
|
|
1030
|
-
|
|
1087
|
+
const lr = Dt();
|
|
1088
|
+
function cr(s, e) {
|
|
1089
|
+
return ie.get(`/v1/public/raven/games/${s}/builds/${e}`);
|
|
1090
|
+
}
|
|
1091
|
+
function hr(s, e) {
|
|
1092
|
+
return ie.post(`/v1/public/raven/games/${s}/builds/upload`, null, {
|
|
1093
|
+
params: e
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function ur(s, e) {
|
|
1031
1097
|
const t = new FormData();
|
|
1032
|
-
return t.append("file", e),
|
|
1098
|
+
return t.append("file", e.chunk), ie.patch(`/v1/public/raven/games/${s}/builds/upload`, t, {
|
|
1099
|
+
params: e
|
|
1100
|
+
});
|
|
1033
1101
|
}
|
|
1034
|
-
function
|
|
1102
|
+
function dr(s) {
|
|
1035
1103
|
return s instanceof Error && (s.name === "XiorError" || s.name === "XiorTimeoutError");
|
|
1036
1104
|
}
|
|
1037
|
-
function
|
|
1105
|
+
function gr(s) {
|
|
1038
1106
|
return !!(s && "kind" in s.data && "message" in s.data);
|
|
1039
1107
|
}
|
|
1040
|
-
const
|
|
1108
|
+
const fr = {
|
|
1041
1109
|
buildChannel: "alpha"
|
|
1042
1110
|
};
|
|
1043
|
-
|
|
1111
|
+
let q;
|
|
1112
|
+
function ws(s) {
|
|
1113
|
+
q = s;
|
|
1114
|
+
}
|
|
1115
|
+
class pr extends se {
|
|
1044
1116
|
constructor() {
|
|
1045
|
-
super("
|
|
1117
|
+
super("NativeModuleManager");
|
|
1046
1118
|
l(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
|
|
1047
1119
|
// 5 minutes
|
|
1048
1120
|
l(this, "targetDir");
|
|
1049
1121
|
l(this, "updateInterval");
|
|
1050
|
-
this.targetDir = y.join(
|
|
1122
|
+
this.targetDir = y.join(Ee(), "resources"), this.logger.log("Target directory", this.targetDir);
|
|
1051
1123
|
}
|
|
1052
1124
|
async initWithDlls(t) {
|
|
1053
|
-
super.init(), await
|
|
1125
|
+
super.init(), await E.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
|
|
1054
1126
|
}
|
|
1055
1127
|
destroy() {
|
|
1056
1128
|
this.updateInterval && (clearInterval(this.updateInterval), this.updateInterval = void 0), super.destroy();
|
|
@@ -1058,7 +1130,7 @@ class ar extends te {
|
|
|
1058
1130
|
async getCurrentVersion(t) {
|
|
1059
1131
|
try {
|
|
1060
1132
|
const r = y.join(this.targetDir, t, "version.txt");
|
|
1061
|
-
return await
|
|
1133
|
+
return await E.readFile(r, "utf-8");
|
|
1062
1134
|
} catch {
|
|
1063
1135
|
return null;
|
|
1064
1136
|
}
|
|
@@ -1070,50 +1142,50 @@ class ar extends te {
|
|
|
1070
1142
|
return y.join(this.getTargetPath(t), r);
|
|
1071
1143
|
}
|
|
1072
1144
|
async checkForUpdates(t) {
|
|
1073
|
-
const r =
|
|
1074
|
-
this.logger.log("Checking for updates");
|
|
1145
|
+
const r = fr.buildChannel;
|
|
1146
|
+
this.logger.log("Checking for updates"), await (q == null ? void 0 : q());
|
|
1075
1147
|
for (const n of t)
|
|
1076
1148
|
try {
|
|
1077
|
-
const { data:
|
|
1078
|
-
this.logger.log(`${n} > Update Check. current: ${o}, latest: ${
|
|
1079
|
-
const
|
|
1080
|
-
this.logger.log(`${n} > Update found: ${o} -> ${
|
|
1081
|
-
} catch (
|
|
1082
|
-
this.logger.captureSentryException(`${n} > Error checking/updating`,
|
|
1149
|
+
const { data: a } = await ir(n, r), o = await this.getCurrentVersion(n);
|
|
1150
|
+
this.logger.log(`${n} > Update Check. current: ${o}, latest: ${a}`);
|
|
1151
|
+
const i = a !== o;
|
|
1152
|
+
this.logger.log(`${n} > Update found: ${o} -> ${a}`), await this.downloadAndExtractDll(n, a, r, i), this.logger.log(`${n} > Downloaded and extracted`), i && (this.logger.log(`${n} > Cleaning up versions older than ${a}`), await this.cleanupOldVersions(n, a)), this.emit("dllUpdated", { identifier: n, version: a });
|
|
1153
|
+
} catch (a) {
|
|
1154
|
+
this.logger.captureSentryException(`${n} > Error checking/updating`, a);
|
|
1083
1155
|
}
|
|
1084
1156
|
}
|
|
1085
|
-
async downloadAndExtractDll(t, r, n,
|
|
1086
|
-
const { data: o } = await
|
|
1087
|
-
await
|
|
1088
|
-
const u = new
|
|
1157
|
+
async downloadAndExtractDll(t, r, n, a) {
|
|
1158
|
+
const { data: o } = await ar(t, n), i = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
|
|
1159
|
+
await E.mkdir(c, { recursive: !0 });
|
|
1160
|
+
const u = new Ge();
|
|
1089
1161
|
await u.loadAsync(o);
|
|
1090
|
-
const d = Object.keys(u.files).map(async (
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1093
|
-
const
|
|
1094
|
-
if (!
|
|
1162
|
+
const d = Object.keys(u.files).map(async (g) => {
|
|
1163
|
+
const h = u.files[g];
|
|
1164
|
+
if (h && !h.dir) {
|
|
1165
|
+
const f = y.join(c, g);
|
|
1166
|
+
if (!a)
|
|
1095
1167
|
try {
|
|
1096
|
-
await
|
|
1168
|
+
await E.access(f, E.constants.F_OK);
|
|
1097
1169
|
return;
|
|
1098
1170
|
} catch {
|
|
1099
|
-
this.logger.warn(`${t} > File missing, re-downloading: ${
|
|
1171
|
+
this.logger.warn(`${t} > File missing, re-downloading: ${f}`);
|
|
1100
1172
|
}
|
|
1101
|
-
const
|
|
1102
|
-
await
|
|
1173
|
+
const w = await h.async("nodebuffer");
|
|
1174
|
+
await E.writeFile(f, w);
|
|
1103
1175
|
}
|
|
1104
1176
|
});
|
|
1105
1177
|
await Promise.all(d);
|
|
1106
|
-
const
|
|
1107
|
-
this.logger.log("Saving version file",
|
|
1178
|
+
const p = y.join(i, "version.txt");
|
|
1179
|
+
this.logger.log("Saving version file", p), await E.writeFile(p, r);
|
|
1108
1180
|
}
|
|
1109
1181
|
async cleanupOldVersions(t, r) {
|
|
1110
|
-
const n = y.join(this.targetDir, t),
|
|
1111
|
-
for (const o of
|
|
1112
|
-
o.isDirectory() && o.name !== r && await
|
|
1182
|
+
const n = y.join(this.targetDir, t), a = await E.readdir(n, { withFileTypes: !0 });
|
|
1183
|
+
for (const o of a)
|
|
1184
|
+
o.isDirectory() && o.name !== r && await E.rm(y.join(n, o.name), { recursive: !0, force: !0 });
|
|
1113
1185
|
}
|
|
1114
1186
|
}
|
|
1115
|
-
const
|
|
1116
|
-
class
|
|
1187
|
+
const ee = k(pr);
|
|
1188
|
+
class yr extends se {
|
|
1117
1189
|
constructor() {
|
|
1118
1190
|
super("RavenManager");
|
|
1119
1191
|
l(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
|
|
@@ -1139,32 +1211,31 @@ class or extends te {
|
|
|
1139
1211
|
return this._executableToGameMap;
|
|
1140
1212
|
}
|
|
1141
1213
|
destroy() {
|
|
1142
|
-
this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler),
|
|
1214
|
+
this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), ee.getInstance().destroy(), super.destroy();
|
|
1143
1215
|
}
|
|
1144
1216
|
async fetchRavenConfig() {
|
|
1145
1217
|
try {
|
|
1146
1218
|
const r = {
|
|
1147
1219
|
games: [
|
|
1148
|
-
...(await
|
|
1220
|
+
...(await or()).data.games,
|
|
1149
1221
|
{
|
|
1150
1222
|
name: "Valorant",
|
|
1151
|
-
identifier: "valorant",
|
|
1223
|
+
identifier: lr("valorant"),
|
|
1152
1224
|
executables: ["VALORANT-Win64-Shipping.exe"],
|
|
1153
|
-
|
|
1154
|
-
version_pattern: ""
|
|
1225
|
+
modules: []
|
|
1155
1226
|
}
|
|
1156
1227
|
]
|
|
1157
1228
|
};
|
|
1158
1229
|
this._ravenConfig = r, this.resetState();
|
|
1159
1230
|
const n = /* @__PURE__ */ new Set();
|
|
1160
|
-
for (const
|
|
1161
|
-
for (const o of
|
|
1162
|
-
const
|
|
1163
|
-
this._executableToGameMap.set(
|
|
1231
|
+
for (const a of this._ravenConfig.games) {
|
|
1232
|
+
for (const o of a.executables) {
|
|
1233
|
+
const i = o.toLowerCase();
|
|
1234
|
+
this._executableToGameMap.set(i, a), this._executablesArray.push(i);
|
|
1164
1235
|
}
|
|
1165
|
-
|
|
1236
|
+
a.modules.forEach((o) => n.add(o));
|
|
1166
1237
|
}
|
|
1167
|
-
await
|
|
1238
|
+
await ee.getInstance().initWithDlls(Array.from(n)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
|
|
1168
1239
|
} catch (t) {
|
|
1169
1240
|
this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
|
|
1170
1241
|
}
|
|
@@ -1173,23 +1244,23 @@ class or extends te {
|
|
|
1173
1244
|
this._executableToGameMap.clear(), this._executablesArray = [];
|
|
1174
1245
|
}
|
|
1175
1246
|
}
|
|
1176
|
-
const
|
|
1177
|
-
PipeEventServer:
|
|
1178
|
-
PipeEventClient:
|
|
1179
|
-
PipeEventBase:
|
|
1180
|
-
ProcessMonitor:
|
|
1247
|
+
const j = k(yr), mr = te(import.meta.url), {
|
|
1248
|
+
PipeEventServer: Es,
|
|
1249
|
+
PipeEventClient: Is,
|
|
1250
|
+
PipeEventBase: ks,
|
|
1251
|
+
ProcessMonitor: br,
|
|
1181
1252
|
Process: V,
|
|
1182
|
-
InjectionMethod:
|
|
1183
|
-
AccessLevel:
|
|
1184
|
-
HardwareInterface:
|
|
1185
|
-
} =
|
|
1186
|
-
class
|
|
1253
|
+
InjectionMethod: Ss,
|
|
1254
|
+
AccessLevel: _s,
|
|
1255
|
+
HardwareInterface: vr
|
|
1256
|
+
} = mr("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
|
|
1257
|
+
class wr extends se {
|
|
1187
1258
|
constructor() {
|
|
1188
1259
|
super("ProcessManager");
|
|
1189
1260
|
l(this, "_processMonitor");
|
|
1190
1261
|
l(this, "_processes", /* @__PURE__ */ new Map());
|
|
1191
1262
|
l(this, "boundOnRavenManagerExecutablesUpdated", this.onRavenManagerExecutablesUpdated.bind(this));
|
|
1192
|
-
this._processMonitor = new
|
|
1263
|
+
this._processMonitor = new br();
|
|
1193
1264
|
}
|
|
1194
1265
|
get hasAnyActiveProcesses() {
|
|
1195
1266
|
return this.activeProcesses.length > 0;
|
|
@@ -1198,14 +1269,14 @@ class ur extends te {
|
|
|
1198
1269
|
return Array.from(this._processes.values()).flat().filter((t) => !t.destroyedAt);
|
|
1199
1270
|
}
|
|
1200
1271
|
init() {
|
|
1201
|
-
super.init(),
|
|
1272
|
+
super.init(), j.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
|
|
1202
1273
|
this.logger.log("Process created", t), this.addProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("create", { process: t });
|
|
1203
1274
|
}), this._processMonitor.on("destroy", (t) => {
|
|
1204
1275
|
this.logger.log("Process destroyed", t), this.deleteProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("destroy", { process: t });
|
|
1205
1276
|
});
|
|
1206
1277
|
}
|
|
1207
1278
|
destroy() {
|
|
1208
|
-
|
|
1279
|
+
j.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
|
|
1209
1280
|
}
|
|
1210
1281
|
isProcessRunning(t) {
|
|
1211
1282
|
const r = this._processes.get(t);
|
|
@@ -1229,15 +1300,15 @@ class ur extends te {
|
|
|
1229
1300
|
deleteProcess(t) {
|
|
1230
1301
|
if (!t.name)
|
|
1231
1302
|
return;
|
|
1232
|
-
const r = this._processes.get(t.name), n = (r == null ? void 0 : r.filter((
|
|
1303
|
+
const r = this._processes.get(t.name), n = (r == null ? void 0 : r.filter((a) => a.id !== t.id)) ?? [];
|
|
1233
1304
|
n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
|
|
1234
1305
|
}
|
|
1235
1306
|
}
|
|
1236
|
-
const C =
|
|
1237
|
-
var
|
|
1238
|
-
let
|
|
1307
|
+
const C = k(wr), Er = te(import.meta.url), { RenderInterface: Ir, renderHookPath: Ps } = Er("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
|
|
1308
|
+
var kr = Object.defineProperty, Sr = (s, e, t) => e in s ? kr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, J = (s, e, t) => Sr(s, typeof e != "symbol" ? e + "" : e, t);
|
|
1309
|
+
let _r = class {
|
|
1239
1310
|
constructor(e) {
|
|
1240
|
-
|
|
1311
|
+
J(this, "_instance"), J(this, "_resolution"), J(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
|
|
1241
1312
|
}
|
|
1242
1313
|
destroy() {
|
|
1243
1314
|
this._instance.off("resolution", this.boundOnResolutionChanged);
|
|
@@ -1252,22 +1323,22 @@ let yr = class {
|
|
|
1252
1323
|
this._resolution = { width: e, height: t };
|
|
1253
1324
|
}
|
|
1254
1325
|
};
|
|
1255
|
-
class
|
|
1326
|
+
class Pr {
|
|
1256
1327
|
constructor() {
|
|
1257
|
-
|
|
1328
|
+
J(this, "interfaces", {});
|
|
1258
1329
|
}
|
|
1259
1330
|
createInterface(e) {
|
|
1260
|
-
return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new
|
|
1331
|
+
return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new _r(new Ir(e, { access: 1 })), this.interfaces[e]);
|
|
1261
1332
|
}
|
|
1262
1333
|
getInterface(e) {
|
|
1263
1334
|
return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
|
|
1264
1335
|
}
|
|
1265
1336
|
}
|
|
1266
|
-
const
|
|
1267
|
-
var
|
|
1268
|
-
class
|
|
1337
|
+
const x = k(Pr);
|
|
1338
|
+
var Cr = Object.defineProperty, Lr = (s, e, t) => e in s ? Cr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => Lr(s, typeof e != "symbol" ? e + "" : e, t);
|
|
1339
|
+
class Kr {
|
|
1269
1340
|
constructor(e) {
|
|
1270
|
-
|
|
1341
|
+
U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new ze(), this.setupFlushInterval();
|
|
1271
1342
|
}
|
|
1272
1343
|
set clientId(e) {
|
|
1273
1344
|
this._clientId = e;
|
|
@@ -1292,8 +1363,8 @@ class wr {
|
|
|
1292
1363
|
};
|
|
1293
1364
|
}
|
|
1294
1365
|
}
|
|
1295
|
-
const
|
|
1296
|
-
class
|
|
1366
|
+
const P = k(Kr), Fr = te(import.meta.url), Mr = Fr.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
|
|
1367
|
+
class Dr extends At {
|
|
1297
1368
|
constructor() {
|
|
1298
1369
|
super("GameLaunchManager");
|
|
1299
1370
|
l(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
|
|
@@ -1304,7 +1375,7 @@ class _r extends Ct {
|
|
|
1304
1375
|
this.subscribedGames = new Set(t);
|
|
1305
1376
|
}
|
|
1306
1377
|
init() {
|
|
1307
|
-
super.init(),
|
|
1378
|
+
super.init(), x.getInstance().createInterface("OGG_SIEGE"), C.getInstance().on("create", this.boundOnProcessCreate), C.getInstance().on("destroy", this.boundOnProcessDestroy);
|
|
1308
1379
|
}
|
|
1309
1380
|
destroy() {
|
|
1310
1381
|
C.getInstance().off("create", this.boundOnProcessCreate), C.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
|
|
@@ -1332,73 +1403,73 @@ class _r extends Ct {
|
|
|
1332
1403
|
});
|
|
1333
1404
|
return;
|
|
1334
1405
|
}
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1406
|
+
const a = this.copyDll(Mr);
|
|
1407
|
+
if (a)
|
|
1337
1408
|
try {
|
|
1338
|
-
await t.injectDll(
|
|
1339
|
-
} catch (
|
|
1340
|
-
this.logger.captureSentryException("Render Interface Injection Failed",
|
|
1341
|
-
renderInterfacePath:
|
|
1409
|
+
await t.injectDll(a), this.logger.log("Render Interface Injection Successful", a);
|
|
1410
|
+
} catch (i) {
|
|
1411
|
+
this.logger.captureSentryException("Render Interface Injection Failed", i), this.logger.sentryError("Render Interface Injection Failed", {
|
|
1412
|
+
renderInterfacePath: a
|
|
1342
1413
|
});
|
|
1343
1414
|
}
|
|
1344
|
-
const o = r == null ? void 0 : r.
|
|
1345
|
-
const c = await
|
|
1415
|
+
const o = r == null ? void 0 : r.modules.map(async (i) => {
|
|
1416
|
+
const c = await ee.getInstance().getCurrentVersion(i);
|
|
1346
1417
|
if (!c)
|
|
1347
|
-
return this.logger.sentryError("No version found for DLL", { identifier:
|
|
1348
|
-
const u =
|
|
1418
|
+
return this.logger.sentryError("No version found for DLL", { identifier: i }), Promise.resolve();
|
|
1419
|
+
const u = ee.getInstance().getTargetVersionPath(i, c);
|
|
1349
1420
|
this.logger.log("DLL Path", u);
|
|
1350
1421
|
const d = await this.getDllFiles(u);
|
|
1351
1422
|
return this.logger.log("DLL Files", d), Promise.all(
|
|
1352
|
-
d.map(async (
|
|
1353
|
-
const
|
|
1354
|
-
if (!
|
|
1423
|
+
d.map(async (p) => {
|
|
1424
|
+
const g = y.basename(p), h = y.join(u, g);
|
|
1425
|
+
if (!h)
|
|
1355
1426
|
return Promise.resolve();
|
|
1356
|
-
this.logger.log("Injecting: ",
|
|
1427
|
+
this.logger.log("Injecting: ", h);
|
|
1357
1428
|
try {
|
|
1358
|
-
return t.injectDll(
|
|
1359
|
-
this.logger.log("Injection Successful",
|
|
1360
|
-
}).catch((
|
|
1361
|
-
this.logger.sentryError("Injection Failed [1]", { targetPath:
|
|
1429
|
+
return t.injectDll(h).then(() => {
|
|
1430
|
+
this.logger.log("Injection Successful", h);
|
|
1431
|
+
}).catch((f) => {
|
|
1432
|
+
this.logger.sentryError("Injection Failed [1]", { targetPath: h }, f);
|
|
1362
1433
|
});
|
|
1363
|
-
} catch (
|
|
1364
|
-
return this.logger.sentryError("Injection Failed [2]", { targetPath:
|
|
1434
|
+
} catch (f) {
|
|
1435
|
+
return this.logger.sentryError("Injection Failed [2]", { targetPath: h }, f), Promise.reject(f);
|
|
1365
1436
|
}
|
|
1366
1437
|
})
|
|
1367
1438
|
);
|
|
1368
1439
|
});
|
|
1369
|
-
await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }),
|
|
1440
|
+
await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), P.getInstance().track("game_launch", {
|
|
1370
1441
|
game: r.identifier
|
|
1371
1442
|
});
|
|
1372
1443
|
}
|
|
1373
1444
|
copyDll(t) {
|
|
1374
|
-
const r = y.basename(t), n =
|
|
1445
|
+
const r = y.basename(t), n = lt(t), a = y.join(Ee(), "resources"), o = y.join(a, r);
|
|
1375
1446
|
this.logger.debug("Copying", n, "to", o);
|
|
1376
1447
|
try {
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
|
|
1380
|
-
} catch (
|
|
1381
|
-
return
|
|
1448
|
+
fe(a) || ge(a, { recursive: !0 });
|
|
1449
|
+
const i = Te(n);
|
|
1450
|
+
pe(o, i), ot(n, o);
|
|
1451
|
+
} catch (i) {
|
|
1452
|
+
return i.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", i), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: o }), !1);
|
|
1382
1453
|
}
|
|
1383
1454
|
return o;
|
|
1384
1455
|
}
|
|
1385
1456
|
async getDllFiles(t) {
|
|
1386
1457
|
try {
|
|
1387
|
-
return (await
|
|
1458
|
+
return (await E.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => y.join(t, n));
|
|
1388
1459
|
} catch (r) {
|
|
1389
1460
|
return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
|
|
1390
1461
|
}
|
|
1391
1462
|
}
|
|
1392
1463
|
onProcessDestroy({ process: t }) {
|
|
1393
1464
|
const r = this.getRavenGame(t);
|
|
1394
|
-
r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }),
|
|
1465
|
+
r && (this.emit("gameCloseInternal", { ravenGame: r, process: t }), this.emit("gameClose", { game: r.identifier }), P.getInstance().track("game_close", {
|
|
1395
1466
|
game: r.identifier
|
|
1396
1467
|
}));
|
|
1397
1468
|
}
|
|
1398
1469
|
getRavenGame(t) {
|
|
1399
1470
|
if (!t.name)
|
|
1400
1471
|
return;
|
|
1401
|
-
const r =
|
|
1472
|
+
const r = j.getInstance().getExecutableData(t.name);
|
|
1402
1473
|
if (!r) {
|
|
1403
1474
|
this.logger.sentryError("No raven game found for process", { process: t });
|
|
1404
1475
|
return;
|
|
@@ -1406,20 +1477,20 @@ class _r extends Ct {
|
|
|
1406
1477
|
return r;
|
|
1407
1478
|
}
|
|
1408
1479
|
}
|
|
1409
|
-
const
|
|
1410
|
-
class
|
|
1480
|
+
const T = k(Dr);
|
|
1481
|
+
class $r extends Ve {
|
|
1411
1482
|
constructor() {
|
|
1412
1483
|
super("GameBuildManager");
|
|
1413
1484
|
l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
|
|
1414
1485
|
}
|
|
1415
1486
|
init() {
|
|
1416
|
-
super.init(),
|
|
1487
|
+
super.init(), T.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
|
|
1417
1488
|
}
|
|
1418
1489
|
destroy() {
|
|
1419
|
-
|
|
1490
|
+
T.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
|
|
1420
1491
|
}
|
|
1421
|
-
async onGameLaunch(t) {
|
|
1422
|
-
const { ravenGame: r, process: n } = t;
|
|
1492
|
+
async onGameLaunch(...t) {
|
|
1493
|
+
const [{ ravenGame: r, process: n }] = t;
|
|
1423
1494
|
if (!n.path || !n.name) {
|
|
1424
1495
|
this.logger.sentryError(
|
|
1425
1496
|
"Process path or name not found, could not check for build hash",
|
|
@@ -1428,38 +1499,54 @@ class kr extends Be {
|
|
|
1428
1499
|
);
|
|
1429
1500
|
return;
|
|
1430
1501
|
}
|
|
1431
|
-
const
|
|
1502
|
+
const a = Te(n.path), o = ct("sha256").update(a).digest("hex");
|
|
1432
1503
|
this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
|
|
1433
|
-
let
|
|
1504
|
+
let i = !1;
|
|
1434
1505
|
try {
|
|
1435
|
-
|
|
1506
|
+
i = (await cr(r.identifier, o)).data.upload;
|
|
1436
1507
|
} catch (d) {
|
|
1437
1508
|
this.logger.captureSentryException("Error checking game build hash", d);
|
|
1438
1509
|
return;
|
|
1439
1510
|
}
|
|
1440
|
-
if (!
|
|
1511
|
+
if (!i) {
|
|
1441
1512
|
this.logger.log("Build hash already exists, skipping upload");
|
|
1442
1513
|
return;
|
|
1443
1514
|
}
|
|
1444
|
-
const c = new
|
|
1445
|
-
c.file(n.name,
|
|
1515
|
+
const c = new Ge();
|
|
1516
|
+
c.file(n.name, a);
|
|
1446
1517
|
const u = await c.generateAsync({ type: "blob" });
|
|
1447
1518
|
try {
|
|
1448
|
-
this.logger.log("Uploading build (size: ", u.size, " bytes)")
|
|
1519
|
+
this.logger.log("Uploading build (size: ", u.size, " bytes)");
|
|
1520
|
+
const d = new $t(u, {
|
|
1521
|
+
chunkSizeMb: 25,
|
|
1522
|
+
maxConcurrent: 1
|
|
1523
|
+
}), p = await hr(r.identifier, {
|
|
1524
|
+
build_hash: o,
|
|
1525
|
+
chunk_count: d.totalChunks,
|
|
1526
|
+
file_size_bytes: u.size
|
|
1527
|
+
});
|
|
1528
|
+
await d.chunk(async (g, h) => {
|
|
1529
|
+
this.logger.log("Uploading chunk", h), await ur(r.identifier, {
|
|
1530
|
+
chunk: g,
|
|
1531
|
+
build_hash: o,
|
|
1532
|
+
chunk_index: h,
|
|
1533
|
+
upload_token: p.data.upload_token
|
|
1534
|
+
});
|
|
1535
|
+
}), this.logger.log("Build uploaded successfully");
|
|
1449
1536
|
} catch (d) {
|
|
1450
|
-
|
|
1537
|
+
dr(d) ? gr(d.response) ? this.logger.captureSentryException("Error uploading build hash, api error", d) : this.logger.captureSentryException("Error uploading build hash, request error", d) : this.logger.captureSentryException("Error uploading build hash, unknown error", d);
|
|
1451
1538
|
}
|
|
1452
1539
|
}
|
|
1453
1540
|
}
|
|
1454
|
-
const
|
|
1455
|
-
function
|
|
1456
|
-
return y.normalize(y.join(
|
|
1541
|
+
const rt = k($r);
|
|
1542
|
+
function Ar(s = []) {
|
|
1543
|
+
return y.normalize(y.join(je(global.OVERLAYED.APP_NAME), ...s));
|
|
1457
1544
|
}
|
|
1458
|
-
const
|
|
1545
|
+
const Or = L({
|
|
1459
1546
|
game: "string",
|
|
1460
1547
|
type: "string",
|
|
1461
1548
|
creation_time: "number"
|
|
1462
|
-
}),
|
|
1549
|
+
}), de = /* @__PURE__ */ new Map([
|
|
1463
1550
|
[1, "LeftButton"],
|
|
1464
1551
|
[2, "RightButton"],
|
|
1465
1552
|
[3, "Cancel"],
|
|
@@ -1652,13 +1739,13 @@ const Sr = L({
|
|
|
1652
1739
|
[252, "Noname"],
|
|
1653
1740
|
[253, "PA1"],
|
|
1654
1741
|
[254, "OEM_Clear"]
|
|
1655
|
-
]),
|
|
1742
|
+
]), Ae = new Map(de.entries().map(([s, e]) => [e, s])), Rr = L({
|
|
1656
1743
|
"[string]": {
|
|
1657
1744
|
keys: "string[]",
|
|
1658
1745
|
mode: L("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
|
|
1659
1746
|
}
|
|
1660
1747
|
});
|
|
1661
|
-
class
|
|
1748
|
+
class xr extends se {
|
|
1662
1749
|
constructor(t) {
|
|
1663
1750
|
super("KeybindManager");
|
|
1664
1751
|
l(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
|
|
@@ -1671,15 +1758,15 @@ class Lr extends te {
|
|
|
1671
1758
|
l(this, "keybindsFile");
|
|
1672
1759
|
// TODO try to figure out a better way to handle this
|
|
1673
1760
|
l(this, "keybindListeningPaused", !1);
|
|
1674
|
-
this.keybindsFile = new
|
|
1675
|
-
path:
|
|
1676
|
-
schema:
|
|
1761
|
+
this.keybindsFile = new Lt({
|
|
1762
|
+
path: Ar(["keybinds.json"]),
|
|
1763
|
+
schema: Rr,
|
|
1677
1764
|
default: t
|
|
1678
1765
|
});
|
|
1679
1766
|
}
|
|
1680
1767
|
init() {
|
|
1681
1768
|
super.init();
|
|
1682
|
-
const t =
|
|
1769
|
+
const t = x.getInstance().getInterface("OGG_SIEGE");
|
|
1683
1770
|
t.instance.on("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.on("keyDown", this.boundHandleKeyDown), t.instance.on("keyUp", this.boundHandleKeyUp);
|
|
1684
1771
|
}
|
|
1685
1772
|
// TODO support multiple callbacks
|
|
@@ -1702,7 +1789,7 @@ class Lr extends te {
|
|
|
1702
1789
|
}
|
|
1703
1790
|
async updateKeybinds(t) {
|
|
1704
1791
|
const r = Object.fromEntries(
|
|
1705
|
-
Object.entries(t).filter(([n,
|
|
1792
|
+
Object.entries(t).filter(([n, a]) => a !== void 0)
|
|
1706
1793
|
);
|
|
1707
1794
|
this.keybindsFile.set({
|
|
1708
1795
|
...this.keybindsFile.get(),
|
|
@@ -1713,13 +1800,13 @@ class Lr extends te {
|
|
|
1713
1800
|
return this.keybindsFile.get();
|
|
1714
1801
|
}
|
|
1715
1802
|
destroy() {
|
|
1716
|
-
const t =
|
|
1803
|
+
const t = x.getInstance().getInterface("OGG_SIEGE");
|
|
1717
1804
|
t.instance.off("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.off("keyDown", this.boundHandleKeyDown), t.instance.off("keyUp", this.boundHandleKeyUp), super.destroy();
|
|
1718
1805
|
}
|
|
1719
1806
|
handleKeyDown(t) {
|
|
1720
1807
|
if (this.keybindListeningPaused)
|
|
1721
1808
|
return;
|
|
1722
|
-
const r =
|
|
1809
|
+
const r = de.get(t.key);
|
|
1723
1810
|
if (!r) {
|
|
1724
1811
|
this.logger.error("Unknown key down", t);
|
|
1725
1812
|
return;
|
|
@@ -1732,47 +1819,47 @@ class Lr extends te {
|
|
|
1732
1819
|
async handleKeyUp(t) {
|
|
1733
1820
|
if (this.keybindListeningPaused)
|
|
1734
1821
|
return;
|
|
1735
|
-
const r =
|
|
1822
|
+
const r = de.get(t.key);
|
|
1736
1823
|
if (!r)
|
|
1737
1824
|
return;
|
|
1738
1825
|
this.pressedKeys.delete(r);
|
|
1739
1826
|
const n = this.keybindsFile.get();
|
|
1740
|
-
for (const [
|
|
1741
|
-
n[
|
|
1827
|
+
for (const [a] of this.preferencesKeybindToCallbacks.entries())
|
|
1828
|
+
n[a].keys.includes(r) && this.triggeredToggleKeybinds.delete(a);
|
|
1742
1829
|
this.checkKeybindUps();
|
|
1743
1830
|
}
|
|
1744
1831
|
async checkKeybindUps() {
|
|
1745
1832
|
const t = this.keybindsFile.get();
|
|
1746
1833
|
for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1747
1834
|
if (!n.up) continue;
|
|
1748
|
-
const
|
|
1749
|
-
this.activeKeybinds.has(r) &&
|
|
1835
|
+
const a = t[r];
|
|
1836
|
+
this.activeKeybinds.has(r) && a.keys.some((o) => !this.pressedKeys.has(o)) && (this.activeKeybinds.delete(r), n.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(a)));
|
|
1750
1837
|
}
|
|
1751
1838
|
}
|
|
1752
1839
|
async checkKeybindings() {
|
|
1753
1840
|
const t = this.keybindsFile.get();
|
|
1754
1841
|
for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1755
|
-
const
|
|
1756
|
-
if (
|
|
1757
|
-
this.triggerKeybind(
|
|
1842
|
+
const a = t[r];
|
|
1843
|
+
if (a.keys.length === this.pressedKeys.size && a.keys.every((i) => Ae.has(i) ? this.pressedKeys.has(i) : !1)) {
|
|
1844
|
+
this.triggerKeybind(a, n, r);
|
|
1758
1845
|
return;
|
|
1759
1846
|
}
|
|
1760
1847
|
}
|
|
1761
1848
|
for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
|
|
1762
|
-
const
|
|
1763
|
-
|
|
1849
|
+
const a = t[r];
|
|
1850
|
+
a.keys.every((i) => Ae.has(i) ? this.pressedKeys.has(i) : (this.logger.error("Unknown key", i, a), !1)) && this.triggerKeybind(a, n, r);
|
|
1764
1851
|
}
|
|
1765
1852
|
}
|
|
1766
1853
|
triggerKeybind(t, r, n) {
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1854
|
+
const a = t.mode;
|
|
1855
|
+
if (a === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(n)) {
|
|
1769
1856
|
const o = r.toggle();
|
|
1770
1857
|
this.triggeredToggleKeybinds.add(n), this.logger.log(
|
|
1771
1858
|
o ? `Keybind pressed rejected: ${o}` : "Keybind pressed accepted",
|
|
1772
1859
|
this.getKeybindToString(t)
|
|
1773
1860
|
);
|
|
1774
1861
|
}
|
|
1775
|
-
if (
|
|
1862
|
+
if (a === "hold" && r.down && !this.activeKeybinds.has(n)) {
|
|
1776
1863
|
const o = r.down();
|
|
1777
1864
|
o ? this.logger.log(`Keybind down rejected: ${o}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(n), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
|
|
1778
1865
|
}
|
|
@@ -1781,7 +1868,7 @@ class Lr extends te {
|
|
|
1781
1868
|
return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
|
|
1782
1869
|
}
|
|
1783
1870
|
}
|
|
1784
|
-
class
|
|
1871
|
+
class Tr extends Ve {
|
|
1785
1872
|
constructor(t) {
|
|
1786
1873
|
super("OverridesManager");
|
|
1787
1874
|
l(this, "renderInterface");
|
|
@@ -1789,7 +1876,7 @@ class Kr extends Be {
|
|
|
1789
1876
|
l(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
|
|
1790
1877
|
l(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
|
|
1791
1878
|
l(this, "keyInputBlocks", {});
|
|
1792
|
-
this.renderInterface =
|
|
1879
|
+
this.renderInterface = x.getInstance().getInterface(t);
|
|
1793
1880
|
}
|
|
1794
1881
|
scope(t) {
|
|
1795
1882
|
return {
|
|
@@ -1812,27 +1899,27 @@ class Kr extends Be {
|
|
|
1812
1899
|
this.keyInputBlocks[r] || (this.keyInputBlocks[r] = /* @__PURE__ */ new Set()), n ? this.keyInputBlocks[r].add(t) : this.keyInputBlocks[r].delete(t), n && this.keyInputBlocks[r].size === 1 ? this.renderInterface.instance.setKeyInputBlock(r, !0) : !n && this.keyInputBlocks[r].size === 0 && this.renderInterface.instance.setKeyInputBlock(r, !1);
|
|
1813
1900
|
}
|
|
1814
1901
|
}
|
|
1815
|
-
const
|
|
1816
|
-
let H = !1,
|
|
1817
|
-
function
|
|
1902
|
+
const Gr = k(Tr, "OGG_SIEGE");
|
|
1903
|
+
let H = !1, W;
|
|
1904
|
+
function Ls(s) {
|
|
1818
1905
|
const { init: e = !0 } = s;
|
|
1819
|
-
if (
|
|
1820
|
-
return
|
|
1906
|
+
if (Nr(s), re.getInstance().init(s.appName), H)
|
|
1907
|
+
return W;
|
|
1821
1908
|
function t() {
|
|
1822
|
-
|
|
1823
|
-
const r = /* @__PURE__ */ new Map(), n =
|
|
1824
|
-
|
|
1909
|
+
qr(s);
|
|
1910
|
+
const r = /* @__PURE__ */ new Map(), n = zr(s.modules, r), a = Vr(), o = Hr(s.keybinds), i = Wr(), c = Qr();
|
|
1911
|
+
Br(s), Ur(s, r), H = !0, W = {
|
|
1825
1912
|
...n,
|
|
1826
|
-
...
|
|
1913
|
+
...a,
|
|
1827
1914
|
keybinds: o,
|
|
1828
|
-
windows:
|
|
1915
|
+
windows: i,
|
|
1829
1916
|
input: c,
|
|
1830
1917
|
hasAnyActiveProcesses: () => C.getInstance().hasAnyActiveProcesses,
|
|
1831
1918
|
init: t,
|
|
1832
1919
|
initialized: H
|
|
1833
1920
|
};
|
|
1834
1921
|
}
|
|
1835
|
-
return e ? (t(),
|
|
1922
|
+
return e ? (t(), W) : new Proxy(
|
|
1836
1923
|
{
|
|
1837
1924
|
init: t
|
|
1838
1925
|
},
|
|
@@ -1840,7 +1927,7 @@ function ms(s) {
|
|
|
1840
1927
|
get: (r, n) => {
|
|
1841
1928
|
if (n !== "init" && !H)
|
|
1842
1929
|
throw new Error(`overlayed was called before initialized: ${n}`);
|
|
1843
|
-
return n === "init" ? r[n] :
|
|
1930
|
+
return n === "init" ? r[n] : W[n];
|
|
1844
1931
|
}
|
|
1845
1932
|
}
|
|
1846
1933
|
);
|
|
@@ -1850,48 +1937,48 @@ global.OVERLAYED = new Proxy({}, {
|
|
|
1850
1937
|
throw new Error("function overlayed was not called");
|
|
1851
1938
|
}
|
|
1852
1939
|
});
|
|
1853
|
-
function
|
|
1940
|
+
function Nr(s) {
|
|
1854
1941
|
global.OVERLAYED = {
|
|
1855
1942
|
APP_NAME: s.appName
|
|
1856
1943
|
};
|
|
1857
1944
|
}
|
|
1858
|
-
function
|
|
1945
|
+
function Br(s) {
|
|
1859
1946
|
const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
|
|
1860
|
-
|
|
1861
|
-
|
|
1947
|
+
T.getInstance().setSubscribedGames(e), rt.getInstance().init(), T.getInstance().init(), C.getInstance().init(), j.getInstance().init(), Ne.on("quit", () => {
|
|
1948
|
+
jr();
|
|
1862
1949
|
});
|
|
1863
1950
|
}
|
|
1864
|
-
function
|
|
1865
|
-
|
|
1951
|
+
function jr() {
|
|
1952
|
+
j.getInstance().destroy(), T.getInstance().destroy(), rt.getInstance().destroy(), C.getInstance().destroy(), x.getInstance().getInterface("OGG_SIEGE").destroy(), be.getInstance().destroy(), I.getInstance().destroy();
|
|
1866
1953
|
}
|
|
1867
|
-
function
|
|
1954
|
+
function zr(s, e) {
|
|
1868
1955
|
return s.reduce((t, r) => {
|
|
1869
1956
|
const n = r.key;
|
|
1870
1957
|
return t[n] = {
|
|
1871
1958
|
// prettier-ignore
|
|
1872
|
-
on(
|
|
1873
|
-
const
|
|
1874
|
-
c.add(o), e.set(
|
|
1959
|
+
on(a, o) {
|
|
1960
|
+
const i = $(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
|
|
1961
|
+
c.add(o), e.set(i, c);
|
|
1875
1962
|
},
|
|
1876
|
-
onAny(
|
|
1877
|
-
const o =
|
|
1878
|
-
|
|
1963
|
+
onAny(a) {
|
|
1964
|
+
const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
1965
|
+
i.add(a), e.set(o, i);
|
|
1879
1966
|
},
|
|
1880
1967
|
// prettier-ignore
|
|
1881
|
-
off(
|
|
1882
|
-
const
|
|
1883
|
-
c.delete(o), e.set(
|
|
1968
|
+
off(a, o) {
|
|
1969
|
+
const i = $(n, a), c = e.get(i) ?? /* @__PURE__ */ new Set();
|
|
1970
|
+
c.delete(o), e.set(i, c);
|
|
1884
1971
|
},
|
|
1885
1972
|
// prettier-ignore
|
|
1886
|
-
offAny(
|
|
1887
|
-
const o =
|
|
1888
|
-
|
|
1973
|
+
offAny(a) {
|
|
1974
|
+
const o = $(n, "*"), i = e.get(o) ?? /* @__PURE__ */ new Set();
|
|
1975
|
+
i.delete(a), e.set(o, i);
|
|
1889
1976
|
}
|
|
1890
1977
|
}, t;
|
|
1891
1978
|
}, {});
|
|
1892
1979
|
}
|
|
1893
|
-
function
|
|
1894
|
-
const s = I.getInstance(), e =
|
|
1980
|
+
function Vr() {
|
|
1981
|
+
const s = I.getInstance(), e = T.getInstance();
|
|
1895
1982
|
return {
|
|
1896
1983
|
on: (t, r) => {
|
|
1897
1984
|
switch (t) {
|
|
@@ -1943,32 +2030,32 @@ function Rr() {
|
|
|
1943
2030
|
}
|
|
1944
2031
|
};
|
|
1945
2032
|
}
|
|
1946
|
-
function
|
|
2033
|
+
function $(s, e) {
|
|
1947
2034
|
return `${s}:${e}`;
|
|
1948
2035
|
}
|
|
1949
|
-
function
|
|
1950
|
-
const t =
|
|
2036
|
+
function Ur(s, e) {
|
|
2037
|
+
const t = be.getInstance();
|
|
1951
2038
|
function r(n) {
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
2039
|
+
const a = Or(n);
|
|
2040
|
+
if (a instanceof L.errors) {
|
|
1954
2041
|
I.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
1955
|
-
summary:
|
|
2042
|
+
summary: a.summary
|
|
1956
2043
|
});
|
|
1957
2044
|
return;
|
|
1958
2045
|
}
|
|
1959
|
-
const o = s.modules.find((
|
|
1960
|
-
if (!
|
|
2046
|
+
const o = s.modules.find((f) => f.key === a.game), i = o == null ? void 0 : o.events.event;
|
|
2047
|
+
if (!i)
|
|
1961
2048
|
return;
|
|
1962
|
-
const c =
|
|
2049
|
+
const c = i(n);
|
|
1963
2050
|
if (c instanceof L.errors) {
|
|
1964
2051
|
I.getInstance().warn("Invalid event", "INVALID_EVENT", {
|
|
1965
2052
|
summary: c.summary
|
|
1966
2053
|
});
|
|
1967
2054
|
return;
|
|
1968
2055
|
}
|
|
1969
|
-
const u =
|
|
1970
|
-
|
|
1971
|
-
|
|
2056
|
+
const u = $(o.key, c.type), d = $(o.key, "*"), p = e.get(u), g = e.get(d), h = [...Array.from(p ?? []), ...Array.from(g ?? [])];
|
|
2057
|
+
h.length !== 0 && h.forEach((f) => {
|
|
2058
|
+
f(c);
|
|
1972
2059
|
});
|
|
1973
2060
|
}
|
|
1974
2061
|
return t.on("data", (n) => n.forEach(r)), t.on("error", (n) => {
|
|
@@ -1977,12 +2064,12 @@ function $r(s, e) {
|
|
|
1977
2064
|
});
|
|
1978
2065
|
}), t;
|
|
1979
2066
|
}
|
|
1980
|
-
function
|
|
1981
|
-
const e = new
|
|
2067
|
+
function Hr(s) {
|
|
2068
|
+
const e = new xr(s), t = {};
|
|
1982
2069
|
for (const n in s)
|
|
1983
2070
|
t[n] = {
|
|
1984
|
-
on: (
|
|
1985
|
-
switch (
|
|
2071
|
+
on: (a, o) => {
|
|
2072
|
+
switch (a) {
|
|
1986
2073
|
case "down":
|
|
1987
2074
|
e.onKeybindDown(n, o);
|
|
1988
2075
|
break;
|
|
@@ -1993,7 +2080,7 @@ function xr(s) {
|
|
|
1993
2080
|
e.onKeybindToggled(n, o);
|
|
1994
2081
|
break;
|
|
1995
2082
|
default:
|
|
1996
|
-
throw new Error(`Event type not implemented ${
|
|
2083
|
+
throw new Error(`Event type not implemented ${a}`, { cause: [a, o] });
|
|
1997
2084
|
}
|
|
1998
2085
|
}
|
|
1999
2086
|
};
|
|
@@ -2006,20 +2093,20 @@ function xr(s) {
|
|
|
2006
2093
|
resumeKeybindListening: () => {
|
|
2007
2094
|
e.keybindListeningPaused = !1;
|
|
2008
2095
|
},
|
|
2009
|
-
updateKeybind: (n,
|
|
2010
|
-
e.updateKeybind(n,
|
|
2096
|
+
updateKeybind: (n, a) => {
|
|
2097
|
+
e.updateKeybind(n, a);
|
|
2011
2098
|
},
|
|
2012
2099
|
updateKeybinds: (n) => {
|
|
2013
2100
|
e.updateKeybinds(n);
|
|
2014
2101
|
}
|
|
2015
2102
|
};
|
|
2016
|
-
return e.init(),
|
|
2103
|
+
return e.init(), Ne.on("quit", () => {
|
|
2017
2104
|
e.destroy();
|
|
2018
2105
|
}), r;
|
|
2019
2106
|
}
|
|
2020
|
-
function
|
|
2107
|
+
function Wr() {
|
|
2021
2108
|
return {
|
|
2022
|
-
createWindow: (s) => m().instance.newWindowInternal(
|
|
2109
|
+
createWindow: (s) => m().instance.newWindowInternal(ut.BrowserWindow, s),
|
|
2023
2110
|
on: (s, e) => m().instance.on(s, e),
|
|
2024
2111
|
off: (s, e) => m().instance.off(s, e),
|
|
2025
2112
|
once: (s, e) => m().instance.once(s, e),
|
|
@@ -2029,7 +2116,7 @@ function Tr() {
|
|
|
2029
2116
|
prependListener: (s, e) => m().instance.prependListener(s, e),
|
|
2030
2117
|
prependOnceListener: (s, e) => m().instance.prependOnceListener(s, e),
|
|
2031
2118
|
getActiveGameInfo: () => {
|
|
2032
|
-
const s = m(), e =
|
|
2119
|
+
const s = m(), e = be.getInstance();
|
|
2033
2120
|
return {
|
|
2034
2121
|
resolution: s.resolution,
|
|
2035
2122
|
isConnected: e.hasConnection
|
|
@@ -2037,9 +2124,9 @@ function Tr() {
|
|
|
2037
2124
|
}
|
|
2038
2125
|
};
|
|
2039
2126
|
}
|
|
2040
|
-
function
|
|
2127
|
+
function Qr() {
|
|
2041
2128
|
return {
|
|
2042
|
-
scope: (s) =>
|
|
2129
|
+
scope: (s) => Gr.getInstance().scope(s),
|
|
2043
2130
|
raw: {
|
|
2044
2131
|
setGlobalMouseBlock: (s) => m().instance.setGlobalMouseBlock(s),
|
|
2045
2132
|
setGlobalKeyboardBlock: (s) => m().instance.setGlobalKeyboardBlock(s),
|
|
@@ -2052,21 +2139,21 @@ function Gr() {
|
|
|
2052
2139
|
}
|
|
2053
2140
|
};
|
|
2054
2141
|
}
|
|
2055
|
-
function
|
|
2056
|
-
|
|
2057
|
-
|
|
2142
|
+
function qr(s) {
|
|
2143
|
+
P.getInstance().clientId = s.appName, P.getInstance().userId = vr.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
|
|
2144
|
+
P.getInstance().track("fatal", {
|
|
2058
2145
|
message: e.message,
|
|
2059
2146
|
code: e.code,
|
|
2060
2147
|
data: e.data
|
|
2061
2148
|
});
|
|
2062
2149
|
}), I.getInstance().on("error", (e) => {
|
|
2063
|
-
|
|
2150
|
+
P.getInstance().track("error", {
|
|
2064
2151
|
message: e.message,
|
|
2065
2152
|
code: e.code,
|
|
2066
2153
|
data: e.data
|
|
2067
2154
|
});
|
|
2068
2155
|
}), I.getInstance().on("warning", (e) => {
|
|
2069
|
-
|
|
2156
|
+
P.getInstance().track("warning", {
|
|
2070
2157
|
message: e.message,
|
|
2071
2158
|
code: e.code,
|
|
2072
2159
|
data: e.data
|
|
@@ -2074,8 +2161,10 @@ function Nr(s) {
|
|
|
2074
2161
|
});
|
|
2075
2162
|
}
|
|
2076
2163
|
function m() {
|
|
2077
|
-
return
|
|
2164
|
+
return x.getInstance().getInterface("OGG_SIEGE");
|
|
2078
2165
|
}
|
|
2079
2166
|
export {
|
|
2080
|
-
|
|
2167
|
+
Ls as overlayed,
|
|
2168
|
+
ws as setFetchLatestTokenCallback,
|
|
2169
|
+
vs as setUpdaterTokenResolver
|
|
2081
2170
|
};
|