@overlayed/app 0.6.0 → 0.7.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +30 -16
  2. package/dist/index.js +396 -333
  3. package/package.json +3 -4
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@ var rt = Object.defineProperty;
2
2
  var st = (s, e, t) => e in s ? rt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var l = (s, e, t) => st(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { type as L } from "arktype";
5
- import P, { mkdirSync as le, existsSync as ce, writeFileSync as he, createWriteStream as Oe, readdirSync as Me, unlinkSync as $e, readFileSync as Ae, copyFileSync as nt } from "node:fs";
6
- import f, { join as D, resolve as it } from "node:path";
7
- import { createRequire as ee } from "node:module";
5
+ import P, { mkdirSync as ce, existsSync as he, writeFileSync as ue, createWriteStream as Me, readdirSync as Oe, unlinkSync as Ae, readFileSync as $e, copyFileSync as nt } from "node:fs";
6
+ import y, { join as D, resolve as it } from "node:path";
7
+ import { createRequire as Z } from "node:module";
8
8
  import w from "node:fs/promises";
9
9
  import Re from "jszip";
10
10
  import { createHash as at } from "node:crypto";
@@ -26,7 +26,7 @@ function ht(s) {
26
26
  });
27
27
  } };
28
28
  }
29
- let ue = class {
29
+ let de = class {
30
30
  constructor() {
31
31
  b(this, "emitter"), this.emitter = ht();
32
32
  }
@@ -40,11 +40,10 @@ let ue = class {
40
40
  this.emitter.emit(e, t);
41
41
  }
42
42
  removeAllListeners() {
43
- this.emitter.off("*", () => {
44
- });
43
+ this.emitter.all.clear();
45
44
  }
46
45
  };
47
- function de(s, ...e) {
46
+ function ge(s, ...e) {
48
47
  var t;
49
48
  return t = class extends s {
50
49
  /**
@@ -61,7 +60,7 @@ function de(s, ...e) {
61
60
  }
62
61
  }, b(t, "_instance"), t;
63
62
  }
64
- let ut = class extends ue {
63
+ let ut = class extends de {
65
64
  destroy() {
66
65
  this.removeAllListeners();
67
66
  }
@@ -90,8 +89,8 @@ let ut = class extends ue {
90
89
  });
91
90
  }
92
91
  };
93
- de(ut);
94
- let dt = class Te extends ue {
92
+ ge(ut);
93
+ let dt = class Te extends de {
95
94
  constructor(e, t, r = "") {
96
95
  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();
97
96
  }
@@ -126,16 +125,16 @@ let dt = class Te extends ue {
126
125
  }
127
126
  ensureLogDirectory() {
128
127
  try {
129
- le(this.logPath, { recursive: !0 });
128
+ ce(this.logPath, { recursive: !0 });
130
129
  } catch (e) {
131
130
  throw console.error(`Failed to create log directory ${this.logPath}:`, e), e;
132
131
  }
133
132
  }
134
133
  ensureLogFile() {
135
134
  const e = D(this.logPath, this.getFileName(this.currentDate));
136
- if (!ce(e))
135
+ if (!he(e))
137
136
  try {
138
- he(e, "", "utf8");
137
+ ue(e, "", "utf8");
139
138
  } catch (t) {
140
139
  throw console.error(`Failed to create log file ${e}:`, t), t;
141
140
  }
@@ -145,7 +144,7 @@ let dt = class Te extends ue {
145
144
  }
146
145
  createStream() {
147
146
  const e = D(this.logPath, this.getFileName(this.currentDate));
148
- return Oe(e, {
147
+ return Me(e, {
149
148
  flags: "a",
150
149
  encoding: "utf8"
151
150
  });
@@ -164,27 +163,27 @@ let dt = class Te extends ue {
164
163
  return setInterval(() => this.rotateLogs(), 6e4);
165
164
  }
166
165
  cleanupOldLogs() {
167
- const e = Me(this.logPath), t = /* @__PURE__ */ new Date();
166
+ const e = Oe(this.logPath), t = /* @__PURE__ */ new Date();
168
167
  t.setDate(t.getDate() - 3), e.filter((r) => r.startsWith(this.baseFileName) && r.endsWith(".log")).filter((r) => {
169
168
  const n = r.replace(`${this.baseFileName}-`, "").replace(".log", "");
170
169
  return new Date(n) < t;
171
170
  }).forEach((r) => {
172
171
  try {
173
- $e(D(this.logPath, r));
172
+ Ae(D(this.logPath, r));
174
173
  } catch (n) {
175
174
  console.error(`Failed to delete old log file ${r}:`, n);
176
175
  }
177
176
  });
178
177
  }
179
178
  write(e, ...t) {
180
- const r = /* @__PURE__ */ new Date(), n = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`, i = t.map((o) => typeof o == "object" ? JSON.stringify(o, void 0, 2) : String(o)).join(" "), a = `[${n}] [${e}] ${i}
179
+ const r = /* @__PURE__ */ new Date(), n = r.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${r.getMilliseconds().toString().padStart(3, "0")}`, i = t.map((a) => typeof a == "object" ? JSON.stringify(a, void 0, 2) : String(a)).join(" "), o = `[${n}] [${e}] ${i}
181
180
  `;
182
- this.stream.write(a, (o) => {
183
- o ? this.emit("error", o) : this.emit("write", a);
181
+ this.stream.write(o, (a) => {
182
+ a ? this.emit("error", a) : this.emit("write", o);
184
183
  });
185
184
  }
186
185
  };
187
- const gt = () => f.join(process.env.APPDATA ?? "", "overlayed"), ft = (s) => f.join(gt(), "apps", s), pt = (s) => f.join(ft(s), "logs");
186
+ const gt = () => y.join(process.env.APPDATA ?? "", "overlayed"), ft = (s) => y.join(gt(), "apps", s), pt = (s) => y.join(ft(s), "logs");
188
187
  let yt = class {
189
188
  constructor() {
190
189
  b(this, "data", []);
@@ -269,18 +268,18 @@ let yt = class {
269
268
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
270
269
  }
271
270
  };
272
- de(mt);
273
- const bt = ee(import.meta.url), {
271
+ ge(mt);
272
+ const bt = Z(import.meta.url), {
274
273
  PipeEventServer: vt,
275
- PipeEventClient: Yr,
276
- PipeEventBase: Zr,
277
- ProcessMonitor: es,
278
- Process: ts,
279
- InjectionMethod: rs,
280
- AccessLevel: ss,
281
- HardwareInterface: ns
274
+ PipeEventClient: es,
275
+ PipeEventBase: ts,
276
+ ProcessMonitor: rs,
277
+ Process: ss,
278
+ InjectionMethod: ns,
279
+ AccessLevel: is,
280
+ HardwareInterface: as
282
281
  } = bt("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
283
- let wt = class extends ue {
282
+ let wt = class extends de {
284
283
  constructor(e) {
285
284
  super(), b(this, "server", null), b(this, "_hasConnection", !1), b(this, "pipeId"), this.pipeId = e, this.init();
286
285
  }
@@ -308,7 +307,7 @@ let wt = class extends ue {
308
307
  });
309
308
  }
310
309
  };
311
- const ge = de(wt, "stats-cc");
310
+ const fe = ge(wt, "stats-cc");
312
311
  function It(s) {
313
312
  return { all: s = s || /* @__PURE__ */ new Map(), on: function(e, t) {
314
313
  var r = s.get(e);
@@ -325,7 +324,7 @@ function It(s) {
325
324
  });
326
325
  } };
327
326
  }
328
- class fe {
327
+ class pe {
329
328
  constructor() {
330
329
  l(this, "emitter");
331
330
  this.emitter = It();
@@ -340,8 +339,38 @@ class fe {
340
339
  this.emitter.emit(e, t);
341
340
  }
342
341
  removeAllListeners() {
343
- this.emitter.off("*", () => {
344
- });
342
+ this.emitter.all.clear();
343
+ }
344
+ }
345
+ class Et {
346
+ constructor() {
347
+ l(this, "listeners");
348
+ this.listeners = /* @__PURE__ */ new Map();
349
+ }
350
+ on(e, t) {
351
+ const r = this.listeners.get(e) || /* @__PURE__ */ new Set();
352
+ r.add(t), this.listeners.set(e, r);
353
+ }
354
+ off(e, t) {
355
+ const r = this.listeners.get(e);
356
+ r && r.delete(t);
357
+ }
358
+ async emit(e, ...t) {
359
+ const r = this.listeners.get(e) || /* @__PURE__ */ new Set(), n = this.listeners.get("*") || /* @__PURE__ */ new Set(), i = [...Array.from(r), ...Array.from(n)];
360
+ return i.length === 0 ? [] : await Promise.all(
361
+ i.map(async (a) => {
362
+ try {
363
+ const c = a(...t);
364
+ return c instanceof Promise ? await c : c;
365
+ } catch (c) {
366
+ console.error(`Error in event listener for ${String(e)}:`, c);
367
+ return;
368
+ }
369
+ })
370
+ );
371
+ }
372
+ removeAllListeners() {
373
+ this.listeners.clear();
345
374
  }
346
375
  }
347
376
  function E(s, ...e) {
@@ -361,7 +390,7 @@ function E(s, ...e) {
361
390
  }
362
391
  }, l(r, "_instance"), r;
363
392
  }
364
- class Et extends fe {
393
+ class kt extends pe {
365
394
  destroy() {
366
395
  this.removeAllListeners();
367
396
  }
@@ -390,7 +419,7 @@ class Et extends fe {
390
419
  });
391
420
  }
392
421
  }
393
- const I = E(Et);
422
+ const I = E(kt);
394
423
  class _t {
395
424
  constructor(e) {
396
425
  l(this, "data");
@@ -488,7 +517,7 @@ class _t {
488
517
  });
489
518
  }
490
519
  }
491
- class pe extends fe {
520
+ class ye extends pe {
492
521
  constructor(t, r, n = "") {
493
522
  super();
494
523
  l(this, "stream");
@@ -500,7 +529,7 @@ class pe extends fe {
500
529
  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();
501
530
  }
502
531
  static scope(t, r, n) {
503
- return new pe(t, r, n);
532
+ return new ye(t, r, n);
504
533
  }
505
534
  log(...t) {
506
535
  this.write("log", ...t);
@@ -530,16 +559,16 @@ class pe extends fe {
530
559
  }
531
560
  ensureLogDirectory() {
532
561
  try {
533
- le(this.logPath, { recursive: !0 });
562
+ ce(this.logPath, { recursive: !0 });
534
563
  } catch (t) {
535
564
  throw console.error(`Failed to create log directory ${this.logPath}:`, t), t;
536
565
  }
537
566
  }
538
567
  ensureLogFile() {
539
568
  const t = D(this.logPath, this.getFileName(this.currentDate));
540
- if (!ce(t))
569
+ if (!he(t))
541
570
  try {
542
- he(t, "", "utf8");
571
+ ue(t, "", "utf8");
543
572
  } catch (r) {
544
573
  throw console.error(`Failed to create log file ${t}:`, r), r;
545
574
  }
@@ -549,7 +578,7 @@ class pe extends fe {
549
578
  }
550
579
  createStream() {
551
580
  const t = D(this.logPath, this.getFileName(this.currentDate));
552
- return Oe(t, {
581
+ return Me(t, {
553
582
  flags: "a",
554
583
  encoding: "utf8"
555
584
  });
@@ -568,27 +597,27 @@ class pe extends fe {
568
597
  return setInterval(() => this.rotateLogs(), 6e4);
569
598
  }
570
599
  cleanupOldLogs() {
571
- const t = Me(this.logPath), r = /* @__PURE__ */ new Date();
600
+ const t = Oe(this.logPath), r = /* @__PURE__ */ new Date();
572
601
  r.setDate(r.getDate() - 3), t.filter((n) => n.startsWith(this.baseFileName) && n.endsWith(".log")).filter((n) => {
573
602
  const i = n.replace(`${this.baseFileName}-`, "").replace(".log", "");
574
603
  return new Date(i) < r;
575
604
  }).forEach((n) => {
576
605
  try {
577
- $e(D(this.logPath, n));
606
+ Ae(D(this.logPath, n));
578
607
  } catch (i) {
579
608
  console.error(`Failed to delete old log file ${n}:`, i);
580
609
  }
581
610
  });
582
611
  }
583
612
  write(t, ...r) {
584
- const n = /* @__PURE__ */ new Date(), i = n.toISOString().replace("T", " ").replace(/\.\d+Z$/, "") + `.${n.getMilliseconds().toString().padStart(3, "0")}`, a = r.map((c) => typeof c == "object" ? JSON.stringify(c, void 0, 2) : String(c)).join(" "), o = `[${i}] [${t}] ${a}
613
+ const n = /* @__PURE__ */ new Date(), i = 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(" "), a = `[${i}] [${t}] ${o}
585
614
  `;
586
- this.stream.write(o, (c) => {
587
- c ? this.emit("error", c) : this.emit("write", o);
615
+ this.stream.write(a, (c) => {
616
+ c ? this.emit("error", c) : this.emit("write", a);
588
617
  });
589
618
  }
590
619
  }
591
- const ye = () => f.join(process.env.APPDATA ?? "", "overlayed"), Be = (s) => f.join(ye(), "apps", s), kt = (s) => f.join(Be(s), "logs");
620
+ const me = () => y.join(process.env.APPDATA ?? "", "overlayed"), Ge = (s) => y.join(me(), "apps", s), Pt = (s) => y.join(Ge(s), "logs");
592
621
  class Ne {
593
622
  constructor() {
594
623
  l(this, "data", []);
@@ -612,7 +641,7 @@ class Ne {
612
641
  }
613
642
  }
614
643
  }
615
- class Pt {
644
+ class St {
616
645
  constructor() {
617
646
  l(this, "fileName", "app.log");
618
647
  l(this, "fileLogger");
@@ -621,7 +650,7 @@ class Pt {
621
650
  l(this, "messageQueue", new Ne());
622
651
  }
623
652
  init(e) {
624
- this.appId = e, this.path = kt(e), this.fileLogger = new pe(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
653
+ this.appId = e, this.path = Pt(e), this.fileLogger = new ye(this.path, this.fileName), this.messageQueue.flush().forEach((t) => {
625
654
  var r;
626
655
  (r = this.fileLogger) == null || r[t.type](...t.args);
627
656
  });
@@ -678,20 +707,12 @@ class Pt {
678
707
  console[e](...t), ((r = this.fileLogger) == null ? void 0 : r[e](...t)) ?? this.messageQueue.add({ type: e, args: t });
679
708
  }
680
709
  }
681
- const me = E(Pt);
682
- function St(s = []) {
683
- return f.normalize(f.join(Be(global.OVERLAYED.APP_NAME), ...s));
684
- }
685
- const Ct = L({
686
- game: "string",
687
- type: "string",
688
- creation_time: "number"
689
- });
690
- class Ge {
710
+ const ee = E(St);
711
+ class Be {
691
712
  constructor(e) {
692
713
  l(this, "logger");
693
714
  l(this, "initialized", !1);
694
- this.logger = me.getInstance().scope(e);
715
+ this.logger = ee.getInstance().scope(e);
695
716
  }
696
717
  init() {
697
718
  this.logger.log("Initializing"), this.initialized = !0;
@@ -700,12 +721,12 @@ class Ge {
700
721
  this.logger.log("Destroying"), this.initialized = !1;
701
722
  }
702
723
  }
703
- class N extends fe {
724
+ class te extends pe {
704
725
  constructor(t) {
705
726
  super();
706
727
  l(this, "logger");
707
728
  l(this, "initialized", !1);
708
- this.logger = me.getInstance().scope(t);
729
+ this.logger = ee.getInstance().scope(t);
709
730
  }
710
731
  init() {
711
732
  this.logger.log("Initializing"), this.initialized = !0;
@@ -714,144 +735,158 @@ class N extends fe {
714
735
  this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
715
736
  }
716
737
  }
717
- var M = "object", je = "function", Ve = "prototype", re = "text", be = "json", Pe = "abort", se = "paramsSerializer", Se = "addEventListener", V = "status", k = "headers", te = Object, K = void 0, J = null, ne = te[Ve], X = te.keys, A = Array.isArray, Ce = "method", He = "HEAD", ie = "GET", Ue = "OPTIONS", Lt = "POST", Kt = "PUT", Ft = "PATCH", Dt = "DELETE";
718
- function Ot(s, e) {
738
+ class Ct extends Et {
739
+ constructor(t) {
740
+ super();
741
+ l(this, "logger");
742
+ l(this, "initialized", !1);
743
+ this.logger = ee.getInstance().scope(t);
744
+ }
745
+ init() {
746
+ this.logger.log("Initializing"), this.initialized = !0;
747
+ }
748
+ destroy() {
749
+ this.logger.log("Destroying"), this.initialized = !1, this.removeAllListeners();
750
+ }
751
+ }
752
+ var O = "object", je = "function", Ve = "prototype", se = "text", be = "json", Pe = "abort", ne = "paramsSerializer", Se = "addEventListener", j = "status", _ = "headers", re = Object, K = void 0, Q = null, ie = re[Ve], J = re.keys, R = Array.isArray, Ce = "method", ze = "HEAD", ae = "GET", He = "OPTIONS", Lt = "POST", Kt = "PUT", Ft = "PATCH", Dt = "DELETE";
753
+ function Mt(s, e) {
719
754
  let t = new AbortController();
720
- function r(o) {
721
- t.abort(o), i();
755
+ function r(a) {
756
+ t.abort(a), i();
722
757
  }
723
758
  let n = [];
724
- for (let o of s) {
725
- if ((o == null ? void 0 : o.aborted) === !0) {
726
- r(o.reason);
759
+ for (let a of s) {
760
+ if ((a == null ? void 0 : a.aborted) === !0) {
761
+ r(a.reason);
727
762
  break;
728
763
  }
729
- if (o != null && o[Se]) {
764
+ if (a != null && a[Se]) {
730
765
  let c = () => {
731
- r(o.reason);
766
+ r(a.reason);
732
767
  };
733
768
  n.push(() => {
734
769
  var u;
735
- (u = o.removeEventListener) == null || u.call(o, Pe, c);
736
- }), o[Se](Pe, c);
770
+ (u = a.removeEventListener) == null || u.call(a, Pe, c);
771
+ }), a[Se](Pe, c);
737
772
  }
738
773
  }
739
774
  function i() {
740
- n.forEach((o) => o()), e == null || e();
775
+ n.forEach((a) => a()), e == null || e();
741
776
  }
742
- let a = t.signal;
743
- return a.clear = i, a;
777
+ let o = t.signal;
778
+ return o.clear = i, o;
744
779
  }
745
- var Le = te.getPrototypeOf, Ke = (s) => {
746
- if (s !== J && typeof s === M) {
780
+ var Le = re.getPrototypeOf, Ke = (s) => {
781
+ if (s !== Q && typeof s === O) {
747
782
  if (typeof Le === je) {
748
783
  let e = Le(s);
749
- return e === ne || e === J;
784
+ return e === ie || e === Q;
750
785
  }
751
- return ne.toString.call(s) === `[${M} Object]`;
786
+ return ie.toString.call(s) === `[${O} Object]`;
752
787
  }
753
788
  return !1;
754
789
  }, ve = (...s) => s.reduce((e, t) => {
755
- if (A(t)) throw new TypeError(`Arguments must be ${M}s, not arrays.`);
756
- return X(t).forEach((r) => {
757
- ["__proto__", "constructor", Ve].includes(r) || (A(e[r]) && A(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ke(e[r]) && Ke(t[r]) ? e[r] = ve(e[r], t[r]) : e[r] = t[r]);
790
+ if (R(t)) throw new TypeError(`Arguments must be ${O}s, not arrays.`);
791
+ return J(t).forEach((r) => {
792
+ ["__proto__", "constructor", Ve].includes(r) || (R(e[r]) && R(t[r]) ? e[r] = Array.from(new Set(e[r].concat(t[r]))) : Ke(e[r]) && Ke(t[r]) ? e[r] = ve(e[r], t[r]) : e[r] = t[r]);
758
793
  }), e;
759
794
  }, {});
760
- function we(s, e = !0, t = J, r) {
761
- if (s === K || s === J) return "";
762
- let n = [], i = e ? encodeURIComponent : (g) => g, a = A(s), { arrayFormat: o, allowDots: c, serializeDate: u } = r || {}, d = (g) => {
763
- if (c && !a) return `.${g}`;
764
- if (a) {
765
- if (o === "brackets") return "[]";
766
- if (o === "repeat") return "";
795
+ function we(s, e = !0, t = Q, r) {
796
+ if (s === K || s === Q) return "";
797
+ let n = [], i = e ? encodeURIComponent : (f) => f, o = R(s), { arrayFormat: a, allowDots: c, serializeDate: u } = r || {}, d = (f) => {
798
+ if (c && !o) return `.${f}`;
799
+ if (o) {
800
+ if (a === "brackets") return "[]";
801
+ if (a === "repeat") return "";
767
802
  }
768
- return `[${g}]`;
803
+ return `[${f}]`;
769
804
  };
770
- for (let g in s) if (ne.hasOwnProperty.call(s, g)) {
771
- let h = s[g];
805
+ for (let f in s) if (ie.hasOwnProperty.call(s, f)) {
806
+ let h = s[f];
772
807
  if (h !== K) {
773
- let y = t ? `${t}${d(g)}` : i(g);
774
- if (!isNaN(h) && h instanceof Date && (h = u ? u(h) : h.toISOString()), typeof h === M) {
775
- let p = we(h, e, y, r);
776
- p !== "" && n.push(p);
777
- } else n.push(`${i(y)}=${i(h)}`);
808
+ let p = t ? `${t}${d(f)}` : i(f);
809
+ if (!isNaN(h) && h instanceof Date && (h = u ? u(h) : h.toISOString()), typeof h === O) {
810
+ let g = we(h, e, p, r);
811
+ g !== "" && n.push(g);
812
+ } else n.push(`${i(p)}=${i(h)}`);
778
813
  }
779
814
  }
780
815
  return n.join("&");
781
816
  }
782
- function ae(s) {
783
- return A(s) ? s.map(ae) : (s && typeof s === M && X(s).forEach((e) => {
817
+ function oe(s) {
818
+ return R(s) ? s.map(oe) : (s && typeof s === O && J(s).forEach((e) => {
784
819
  let t = s[e];
785
- t === K ? delete s[e] : ae(t);
820
+ t === K ? delete s[e] : oe(t);
786
821
  }), s);
787
822
  }
788
- function Mt(s) {
823
+ function Ot(s) {
789
824
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s);
790
825
  }
791
- function $t(s, e) {
826
+ function At(s, e) {
792
827
  return s ? e ? (s.endsWith("/") ? s : s + "/") + (e[0] === "/" ? e.slice(1) : e) : s : e || "";
793
828
  }
794
- var At = "XiorError", Rt = "XiorTimeoutError", ze = class extends Error {
829
+ var $t = "XiorError", Rt = "XiorTimeoutError", Ue = class extends Error {
795
830
  constructor(s, e, t) {
796
- super(s), this.name = At, this.request = e, this.config = e, this.response = t;
831
+ super(s), this.name = $t, this.request = e, this.config = e, this.response = t;
797
832
  }
798
- }, xt = class extends ze {
833
+ }, xt = class extends Ue {
799
834
  constructor(e, t, r) {
800
835
  super(e, t, r), this.name = Rt;
801
836
  }
802
- }, Tt = Object.defineProperty, Bt = Object.defineProperties, Nt = Object.getOwnPropertyDescriptors, Y = Object.getOwnPropertySymbols, We = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Fe = (s, e, t) => e in s ? Tt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, R = (s, e) => {
837
+ }, Tt = Object.defineProperty, Gt = Object.defineProperties, Nt = Object.getOwnPropertyDescriptors, X = Object.getOwnPropertySymbols, We = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Fe = (s, e, t) => e in s ? Tt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, x = (s, e) => {
803
838
  for (var t in e || (e = {})) We.call(e, t) && Fe(s, t, e[t]);
804
- if (Y) for (var t of Y(e)) qe.call(e, t) && Fe(s, t, e[t]);
839
+ if (X) for (var t of X(e)) qe.call(e, t) && Fe(s, t, e[t]);
805
840
  return s;
806
- }, q = (s, e) => Bt(s, Nt(e)), Gt = (s, e) => {
841
+ }, W = (s, e) => Gt(s, Nt(e)), Bt = (s, e) => {
807
842
  var t = {};
808
843
  for (var r in s) We.call(s, r) && e.indexOf(r) < 0 && (t[r] = s[r]);
809
- if (s != null && Y) for (var r of Y(s)) e.indexOf(r) < 0 && qe.call(s, r) && (t[r] = s[r]);
844
+ if (s != null && X) for (var r of X(s)) e.indexOf(r) < 0 && qe.call(s, r) && (t[r] = s[r]);
810
845
  return t;
811
- }, x = (s, e, t) => new Promise((r, n) => {
846
+ }, T = (s, e, t) => new Promise((r, n) => {
812
847
  var i = (c) => {
813
848
  try {
814
- o(t.next(c));
849
+ a(t.next(c));
815
850
  } catch (u) {
816
851
  n(u);
817
852
  }
818
- }, a = (c) => {
853
+ }, o = (c) => {
819
854
  try {
820
- o(t.throw(c));
855
+ a(t.throw(c));
821
856
  } catch (u) {
822
857
  n(u);
823
858
  }
824
- }, o = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, a);
825
- o((t = t.apply(s, e)).next());
826
- }), Ie = "application/", Qe = `${Ie}x-www-form-urlencoded`, Je = RegExp, jt = new Je(`^${Qe}`, "i"), Vt = `${Ie}${be}`, Ht = new Je(`^${Ie}.*${be}.*`, "i");
827
- function Ut(s = ie) {
828
- return [He, ie, Ue].includes(s);
859
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(i, o);
860
+ a((t = t.apply(s, e)).next());
861
+ }), Ie = "application/", Qe = `${Ie}x-www-form-urlencoded`, Je = RegExp, jt = new Je(`^${Qe}`, "i"), Vt = `${Ie}${be}`, zt = new Je(`^${Ie}.*${be}.*`, "i");
862
+ function Ht(s = ae) {
863
+ return [ze, ae, He].includes(s);
829
864
  }
830
- var zt = typeof URLSearchParams != `${K}`;
865
+ var Ut = typeof URLSearchParams != `${K}`;
831
866
  function Wt(s) {
832
- return x(this, null, function* () {
833
- let e = s[se] || we, t = s.encodeURI !== !1, r = s[Ce] && s[Ce].toUpperCase(), n = s.url, i = n, a = zt && s.data instanceof URLSearchParams, o = a ? te.fromEntries(s.data.entries()) : s.data, c = o, u = s != null && s[k] ? R({}, s[k]) : {}, d = s.params, g = Ut(r);
834
- if (o && typeof o.append !== je) {
835
- let h = "", y = "content-type";
836
- if (s != null && s[k]) {
837
- let p = X(s[k]).find((_) => _.toLowerCase() === y);
838
- p && (y = p, h = s[k][p]);
867
+ return T(this, null, function* () {
868
+ let e = s[ne] || we, t = s.encodeURI !== !1, r = s[Ce] && s[Ce].toUpperCase(), n = s.url, i = n, o = Ut && s.data instanceof URLSearchParams, a = o ? re.fromEntries(s.data.entries()) : s.data, c = a, u = s != null && s[_] ? x({}, s[_]) : {}, d = s.params, f = Ht(r);
869
+ if (a && typeof a.append !== je) {
870
+ let h = "", p = "content-type";
871
+ if (s != null && s[_]) {
872
+ let g = J(s[_]).find((k) => k.toLowerCase() === p);
873
+ g && (p = g, h = s[_][g]);
839
874
  }
840
- (!h || a) && (h = g || a ? Qe : Vt, u[y] = h), typeof o === M && (g && d && (d = ve(o, d)), Ht.test(h) ? c = JSON.stringify(ae(o)) : !g && jt.test(h) && (c = e(o)));
875
+ (!h || o) && (h = f || o ? Qe : Vt, u[p] = h), typeof a === O && (f && d && (d = ve(a, d)), zt.test(h) ? c = JSON.stringify(oe(a)) : !f && jt.test(h) && (c = e(a)));
841
876
  }
842
- if (d && X(d).length > 0) {
877
+ if (d && J(d).length > 0) {
843
878
  let h = e(d, t);
844
879
  n += n.includes("?") ? `&${h}` : `?${h}`;
845
880
  }
846
- return q(R({}, s), { _data: c, _url: n, data: o, url: i, method: r, [k]: u, isGet: g });
881
+ return W(x({}, s), { _data: c, _url: n, data: a, url: i, method: r, [_]: u, isGet: f });
847
882
  });
848
883
  }
849
884
  var qt = typeof AbortController != `${K}`;
850
885
  function Qt(s, e) {
851
- return x(this, null, function* () {
886
+ return T(this, null, function* () {
852
887
  let t;
853
- if (!e || !s.ok || [re, be].includes(e)) {
854
- if (t = yield s[re](), t && e !== re) try {
888
+ if (!e || !s.ok || [se, be].includes(e)) {
889
+ if (t = yield s[se](), t && e !== se) try {
855
890
  t = JSON.parse(t);
856
891
  } catch {
857
892
  }
@@ -862,9 +897,9 @@ function Qt(s, e) {
862
897
  return t;
863
898
  });
864
899
  }
865
- var Jt = (s) => new O(s), O = class {
900
+ var Jt = (s) => new M(s), M = class {
866
901
  constructor(e) {
867
- this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [k]: {} };
902
+ this.REQI = [], this.RESI = [], this.P = [], this.config = e, this.defaults = { params: {}, [_]: {} };
868
903
  }
869
904
  get interceptors() {
870
905
  return { request: { use: (e, t, r) => (this.REQI.push(e), e), eject: (e) => {
@@ -885,63 +920,63 @@ var Jt = (s) => new O(s), O = class {
885
920
  } };
886
921
  }
887
922
  request(e) {
888
- return x(this, null, function* () {
923
+ return T(this, null, function* () {
889
924
  let t = ve(this.config || {}, this.defaults, typeof e == "string" ? { url: e } : e), r = "credentials";
890
- t.withCredentials && !t[r] && (t[r] = "include"), t[se] || (t[se] = we);
891
- for (let a of this.REQI) t = yield a(t);
925
+ t.withCredentials && !t[r] && (t[r] = "include"), t[ne] || (t[ne] = we);
926
+ for (let o of this.REQI) t = yield o(t);
892
927
  let n = this._.bind(this);
893
- this.P.forEach((a) => {
894
- n = a(n, this);
928
+ this.P.forEach((o) => {
929
+ n = o(n, this);
895
930
  });
896
931
  let i = n(t);
897
932
  if (!t._did) {
898
- let a = 0, o = [];
933
+ let o = 0, a = [];
899
934
  for (this.RESI.forEach(function(c) {
900
- o.push(c.fn, c.onRejected);
901
- }); o.length > a; ) i = i.then(o[a++], o[a++]);
935
+ a.push(c.fn, c.onRejected);
936
+ }); a.length > o; ) i = i.then(a[o++], a[o++]);
902
937
  }
903
938
  return i;
904
939
  });
905
940
  }
906
941
  _(e) {
907
- return x(this, null, function* () {
908
- let t = yield Wt(e), { url: r, method: n, headers: i, timeout: a, signal: o, data: c, _data: u, _url: d, isGet: g, fetch: h } = t, y = Gt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
942
+ return T(this, null, function* () {
943
+ let t = yield Wt(e), { url: r, method: n, headers: i, timeout: o, signal: a, data: c, _data: u, _url: d, isGet: f, fetch: h } = t, p = Bt(t, ["url", "method", "headers", "timeout", "signal", "data", "_data", "_url", "isGet", "fetch"]);
909
944
  e._url = d;
910
- let p, _ = [], G = K;
911
- if (a && qt) {
945
+ let g, k = [], N = K;
946
+ if (o && qt) {
912
947
  let v = new AbortController();
913
- G = setTimeout(() => {
914
- v.abort(new xt(`timeout of ${a}ms exceeded`, e));
915
- }, a), _.push(v.signal);
948
+ N = setTimeout(() => {
949
+ v.abort(new xt(`timeout of ${o}ms exceeded`, e));
950
+ }, o), k.push(v.signal);
916
951
  }
917
- o && _.push(o), p = _[0], _.length > 1 && (p = Ot(_, () => {
918
- clearTimeout(G);
952
+ a && k.push(a), g = k[0], k.length > 1 && (g = Mt(k, () => {
953
+ clearTimeout(N);
919
954
  }));
920
- let j = d || r, _e = "baseURL";
921
- return e[_e] && !Mt(j) && (j = $t(e[_e], j)), (h || fetch)(j, q(R({ body: g ? K : u }, y), { signal: p, method: n, headers: i })).then((v) => x(this, null, function* () {
922
- let { responseType: et } = e, ke = { data: yield Qt(v, et), response: v, config: e, request: e, [V]: v[V], statusText: v.statusText, [k]: v[k] };
955
+ let B = d || r, ke = "baseURL";
956
+ return e[ke] && !Ot(B) && (B = At(e[ke], B)), (h || fetch)(B, W(x({ body: f ? K : u }, p), { signal: g, method: n, headers: i })).then((v) => T(this, null, function* () {
957
+ let { responseType: et } = e, _e = { data: yield Qt(v, et), response: v, config: e, request: e, [j]: v[j], statusText: v.statusText, [_]: v[_] };
923
958
  if (!v.ok) {
924
- let tt = new ze(v[V] ? `Request failed with status code ${v[V]}` : "Network error", e, ke);
959
+ let tt = new Ue(v[j] ? `Request failed with status code ${v[j]}` : "Network error", e, _e);
925
960
  return Promise.reject(tt);
926
961
  }
927
- return ke;
962
+ return _e;
928
963
  })).finally(() => {
929
964
  var v;
930
- G && clearTimeout(G), (v = p == null ? void 0 : p.clear) == null || v.call(p);
965
+ N && clearTimeout(N), (v = g == null ? void 0 : g.clear) == null || v.call(g);
931
966
  });
932
967
  });
933
968
  }
934
969
  cG(e) {
935
- return (t, r) => this.request(r ? q(R({}, r), { method: e, url: t }) : { method: e, url: t });
970
+ return (t, r) => this.request(r ? W(x({}, r), { method: e, url: t }) : { method: e, url: t });
936
971
  }
937
972
  cP(e) {
938
- return (t, r, n) => this.request(n ? q(R({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
973
+ return (t, r, n) => this.request(n ? W(x({}, n), { method: e, url: t, data: r }) : { method: e, url: t, data: r });
939
974
  }
940
975
  get(e, t) {
941
- return this.cG(ie)(e, t);
976
+ return this.cG(ae)(e, t);
942
977
  }
943
978
  head(e, t) {
944
- return this.cG(He)(e, t);
979
+ return this.cG(ze)(e, t);
945
980
  }
946
981
  post(e, t, r) {
947
982
  return this.cP(Lt)(e, t, r);
@@ -956,11 +991,11 @@ var Jt = (s) => new O(s), O = class {
956
991
  return this.cG(Dt)(e, t);
957
992
  }
958
993
  options(e, t) {
959
- return this.cG(Ue)(e, t);
994
+ return this.cG(He)(e, t);
960
995
  }
961
996
  };
962
- O.create = Jt, O.VERSION = "0.7.7";
963
- var Xt = Object.assign(O.create(), { create: O.create, VERSION: O.VERSION }), Xe = Xt;
997
+ M.create = Jt, M.VERSION = "0.7.7";
998
+ var Xt = Object.assign(M.create(), { create: M.create, VERSION: M.VERSION }), Xe = Xt;
964
999
  const Ye = Xe.create({
965
1000
  baseURL: "https://updater.stats.cc",
966
1001
  headers: {
@@ -1005,14 +1040,14 @@ function nr(s) {
1005
1040
  const ir = {
1006
1041
  buildChannel: "alpha"
1007
1042
  };
1008
- class ar extends N {
1043
+ class ar extends te {
1009
1044
  constructor() {
1010
1045
  super("NativeDllManager");
1011
1046
  l(this, "UPDATE_CHECK_INTERVAL_MS", 1e3 * 60 * 5);
1012
1047
  // 5 minutes
1013
1048
  l(this, "targetDir");
1014
1049
  l(this, "updateInterval");
1015
- this.targetDir = f.join(ye(), "resources"), this.logger.log("Target directory", this.targetDir);
1050
+ this.targetDir = y.join(me(), "resources"), this.logger.log("Target directory", this.targetDir);
1016
1051
  }
1017
1052
  async initWithDlls(t) {
1018
1053
  super.init(), await w.mkdir(this.targetDir, { recursive: !0 }), await this.checkForUpdates(t), clearInterval(this.updateInterval), this.updateInterval = setInterval(() => this.checkForUpdates(t), this.UPDATE_CHECK_INTERVAL_MS);
@@ -1022,63 +1057,63 @@ class ar extends N {
1022
1057
  }
1023
1058
  async getCurrentVersion(t) {
1024
1059
  try {
1025
- const r = f.join(this.targetDir, t, "version.txt");
1060
+ const r = y.join(this.targetDir, t, "version.txt");
1026
1061
  return await w.readFile(r, "utf-8");
1027
1062
  } catch {
1028
1063
  return null;
1029
1064
  }
1030
1065
  }
1031
1066
  getTargetPath(t) {
1032
- return f.join(this.targetDir, t);
1067
+ return y.join(this.targetDir, t);
1033
1068
  }
1034
1069
  getTargetVersionPath(t, r) {
1035
- return f.join(this.getTargetPath(t), r);
1070
+ return y.join(this.getTargetPath(t), r);
1036
1071
  }
1037
1072
  async checkForUpdates(t) {
1038
1073
  const r = ir.buildChannel;
1039
1074
  this.logger.log("Checking for updates");
1040
1075
  for (const n of t)
1041
1076
  try {
1042
- const { data: i } = await Yt(n, r), a = await this.getCurrentVersion(n);
1043
- this.logger.log(`${n} > Update Check. current: ${a}, latest: ${i}`);
1044
- const o = i !== a;
1045
- this.logger.log(`${n} > Update found: ${a} -> ${i}`), await this.downloadAndExtractDll(n, i, r, o), this.logger.log(`${n} > Downloaded and extracted`), o && (this.logger.log(`${n} > Cleaning up versions older than ${i}`), await this.cleanupOldVersions(n, i)), this.emit("dllUpdated", { identifier: n, version: i });
1077
+ const { data: i } = await Yt(n, r), o = await this.getCurrentVersion(n);
1078
+ this.logger.log(`${n} > Update Check. current: ${o}, latest: ${i}`);
1079
+ const a = i !== o;
1080
+ this.logger.log(`${n} > Update found: ${o} -> ${i}`), await this.downloadAndExtractDll(n, i, r, a), this.logger.log(`${n} > Downloaded and extracted`), a && (this.logger.log(`${n} > Cleaning up versions older than ${i}`), await this.cleanupOldVersions(n, i)), this.emit("dllUpdated", { identifier: n, version: i });
1046
1081
  } catch (i) {
1047
1082
  this.logger.captureSentryException(`${n} > Error checking/updating`, i);
1048
1083
  }
1049
1084
  }
1050
1085
  async downloadAndExtractDll(t, r, n, i) {
1051
- const { data: a } = await Zt(t, n), o = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
1086
+ const { data: o } = await Zt(t, n), a = this.getTargetPath(t), c = this.getTargetVersionPath(t, r);
1052
1087
  await w.mkdir(c, { recursive: !0 });
1053
1088
  const u = new Re();
1054
- await u.loadAsync(a);
1089
+ await u.loadAsync(o);
1055
1090
  const d = Object.keys(u.files).map(async (h) => {
1056
- const y = u.files[h];
1057
- if (y && !y.dir) {
1058
- const p = f.join(c, h);
1091
+ const p = u.files[h];
1092
+ if (p && !p.dir) {
1093
+ const g = y.join(c, h);
1059
1094
  if (!i)
1060
1095
  try {
1061
- await w.access(p, w.constants.F_OK);
1096
+ await w.access(g, w.constants.F_OK);
1062
1097
  return;
1063
1098
  } catch {
1064
- this.logger.warn(`${t} > File missing, re-downloading: ${p}`);
1099
+ this.logger.warn(`${t} > File missing, re-downloading: ${g}`);
1065
1100
  }
1066
- const _ = await y.async("nodebuffer");
1067
- await w.writeFile(p, _);
1101
+ const k = await p.async("nodebuffer");
1102
+ await w.writeFile(g, k);
1068
1103
  }
1069
1104
  });
1070
1105
  await Promise.all(d);
1071
- const g = f.join(o, "version.txt");
1072
- this.logger.log("Saving version file", g), await w.writeFile(g, r);
1106
+ const f = y.join(a, "version.txt");
1107
+ this.logger.log("Saving version file", f), await w.writeFile(f, r);
1073
1108
  }
1074
1109
  async cleanupOldVersions(t, r) {
1075
- const n = f.join(this.targetDir, t), i = await w.readdir(n, { withFileTypes: !0 });
1076
- for (const a of i)
1077
- a.isDirectory() && a.name !== r && await w.rm(f.join(n, a.name), { recursive: !0, force: !0 });
1110
+ const n = y.join(this.targetDir, t), i = await w.readdir(n, { withFileTypes: !0 });
1111
+ for (const o of i)
1112
+ o.isDirectory() && o.name !== r && await w.rm(y.join(n, o.name), { recursive: !0, force: !0 });
1078
1113
  }
1079
1114
  }
1080
- const Z = E(ar);
1081
- class or extends N {
1115
+ const Y = E(ar);
1116
+ class or extends te {
1082
1117
  constructor() {
1083
1118
  super("RavenManager");
1084
1119
  l(this, "REFETCH_INTERVAL", 1e3 * 60 * 5);
@@ -1104,7 +1139,7 @@ class or extends N {
1104
1139
  return this._executableToGameMap;
1105
1140
  }
1106
1141
  destroy() {
1107
- this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), Z.getInstance().destroy(), super.destroy();
1142
+ this._refetchIntervalHandler && clearInterval(this._refetchIntervalHandler), this._failedRefetchTimeoutHandler && clearTimeout(this._failedRefetchTimeoutHandler), Y.getInstance().destroy(), super.destroy();
1108
1143
  }
1109
1144
  async fetchRavenConfig() {
1110
1145
  try {
@@ -1113,12 +1148,12 @@ class or extends N {
1113
1148
  const r = /* @__PURE__ */ new Set();
1114
1149
  for (const n of this._ravenConfig.games) {
1115
1150
  for (const i of n.executables) {
1116
- const a = i.toLowerCase();
1117
- this._executableToGameMap.set(a, n), this._executablesArray.push(a);
1151
+ const o = i.toLowerCase();
1152
+ this._executableToGameMap.set(o, n), this._executablesArray.push(o);
1118
1153
  }
1119
1154
  n.dlls_to_inject.forEach((i) => r.add(i));
1120
1155
  }
1121
- await Z.getInstance().initWithDlls(Array.from(r)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1156
+ await Y.getInstance().initWithDlls(Array.from(r)), this.logger.log("Raven updated", this._ravenConfig), this.emit("executablesUpdated", { executables: this.executables, map: this._executableToGameMap });
1122
1157
  } catch (t) {
1123
1158
  this.logger.captureSentryException("Failed to fetch Raven config", t), this._failedRefetchTimeoutHandler = setTimeout(() => this.fetchRavenConfig(), this.FAILED_REFETCH_INTERVAL);
1124
1159
  }
@@ -1127,17 +1162,17 @@ class or extends N {
1127
1162
  this._executableToGameMap.clear(), this._executablesArray = [];
1128
1163
  }
1129
1164
  }
1130
- const T = E(or), lr = ee(import.meta.url), {
1131
- PipeEventServer: ls,
1132
- PipeEventClient: cs,
1133
- PipeEventBase: hs,
1165
+ const G = E(or), lr = Z(import.meta.url), {
1166
+ PipeEventServer: hs,
1167
+ PipeEventClient: us,
1168
+ PipeEventBase: ds,
1134
1169
  ProcessMonitor: cr,
1135
- Process: H,
1136
- InjectionMethod: us,
1137
- AccessLevel: ds,
1170
+ Process: V,
1171
+ InjectionMethod: gs,
1172
+ AccessLevel: fs,
1138
1173
  HardwareInterface: hr
1139
1174
  } = lr("@overlayed/app/dist/native-interface/build/overlayed_native_interface_x64.node");
1140
- class ur extends N {
1175
+ class ur extends te {
1141
1176
  constructor() {
1142
1177
  super("ProcessManager");
1143
1178
  l(this, "_processMonitor");
@@ -1152,14 +1187,14 @@ class ur extends N {
1152
1187
  return Array.from(this._processes.values()).flat().filter((t) => !t.destroyedAt);
1153
1188
  }
1154
1189
  init() {
1155
- super.init(), T.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1190
+ super.init(), G.getInstance().on("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processMonitor.on("create", (t) => {
1156
1191
  this.logger.log("Process created", t), this.addProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("create", { process: t });
1157
1192
  }), this._processMonitor.on("destroy", (t) => {
1158
1193
  this.logger.log("Process destroyed", t), this.deleteProcess(t), this.logger.log(`Active Process Count: ${this._processes.size}`), this.emit("destroy", { process: t });
1159
1194
  });
1160
1195
  }
1161
1196
  destroy() {
1162
- T.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1197
+ G.getInstance().off("executablesUpdated", this.boundOnRavenManagerExecutablesUpdated), this._processes.clear(), this._processMonitor.removeAllListeners(), super.destroy();
1163
1198
  }
1164
1199
  isProcessRunning(t) {
1165
1200
  const r = this._processes.get(t);
@@ -1187,11 +1222,11 @@ class ur extends N {
1187
1222
  n.length === 0 ? this._processes.delete(t.name) : this._processes.set(t.name, n);
1188
1223
  }
1189
1224
  }
1190
- const C = E(ur), dr = ee(import.meta.url), { RenderInterface: gr, renderHookPath: gs } = dr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1191
- var fr = Object.defineProperty, pr = (s, e, t) => e in s ? fr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, Q = (s, e, t) => pr(s, typeof e != "symbol" ? e + "" : e, t);
1225
+ const C = E(ur), dr = Z(import.meta.url), { RenderInterface: gr, renderHookPath: ps } = dr("@overlayed/app/dist/render-interface/build/overlayed_render_interface_x64.node");
1226
+ var fr = Object.defineProperty, pr = (s, e, t) => e in s ? fr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, q = (s, e, t) => pr(s, typeof e != "symbol" ? e + "" : e, t);
1192
1227
  let yr = class {
1193
1228
  constructor(e) {
1194
- Q(this, "_instance"), Q(this, "_resolution"), Q(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1229
+ q(this, "_instance"), q(this, "_resolution"), q(this, "boundOnResolutionChanged", this.onResolutionChanged.bind(this)), this._instance = e, this._resolution = { width: 0, height: 0 }, this._instance.on("resolution", this.boundOnResolutionChanged);
1195
1230
  }
1196
1231
  destroy() {
1197
1232
  this._instance.off("resolution", this.boundOnResolutionChanged);
@@ -1208,7 +1243,7 @@ let yr = class {
1208
1243
  };
1209
1244
  class mr {
1210
1245
  constructor() {
1211
- Q(this, "interfaces", {});
1246
+ q(this, "interfaces", {});
1212
1247
  }
1213
1248
  createInterface(e) {
1214
1249
  return this.interfaces[e] ? this.interfaces[e] : (this.interfaces[e] = new yr(new gr(e, { access: 1 })), this.interfaces[e]);
@@ -1217,11 +1252,11 @@ class mr {
1217
1252
  return this.interfaces[e] ? this.interfaces[e] : this.createInterface(e);
1218
1253
  }
1219
1254
  }
1220
- const $ = E(mr);
1221
- var br = Object.defineProperty, vr = (s, e, t) => e in s ? br(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, U = (s, e, t) => vr(s, typeof e != "symbol" ? e + "" : e, t);
1255
+ const A = E(mr);
1256
+ var br = Object.defineProperty, vr = (s, e, t) => e in s ? br(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, z = (s, e, t) => vr(s, typeof e != "symbol" ? e + "" : e, t);
1222
1257
  class wr {
1223
1258
  constructor(e) {
1224
- U(this, "_clientId", null), U(this, "_userId", null), U(this, "options"), U(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Ne(), this.setupFlushInterval();
1259
+ z(this, "_clientId", null), z(this, "_userId", null), z(this, "options"), z(this, "eventQueue"), this.options = this.resolveOptions(e), this.eventQueue = new Ne(), this.setupFlushInterval();
1225
1260
  }
1226
1261
  set clientId(e) {
1227
1262
  this._clientId = e;
@@ -1246,15 +1281,19 @@ class wr {
1246
1281
  };
1247
1282
  }
1248
1283
  }
1249
- const S = E(wr), Ir = ee(import.meta.url), Er = Ir.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1250
- class _r extends N {
1284
+ const S = E(wr), Ir = Z(import.meta.url), Er = Ir.resolve("@overlayed/app/dist/render-interface/build/overlayed_render_hook_x64.dll");
1285
+ class kr extends Ct {
1251
1286
  constructor() {
1252
1287
  super("GameLaunchManager");
1253
1288
  l(this, "boundOnProcessCreate", this.onProcessCreate.bind(this));
1254
1289
  l(this, "boundOnProcessDestroy", this.onProcessDestroy.bind(this));
1290
+ l(this, "subscribedGames", /* @__PURE__ */ new Set());
1291
+ }
1292
+ setSubscribedGames(t) {
1293
+ this.subscribedGames = new Set(t);
1255
1294
  }
1256
1295
  init() {
1257
- super.init(), $.getInstance().createInterface("OGG_SIEGE"), C.getInstance().on("create", this.boundOnProcessCreate), C.getInstance().on("destroy", this.boundOnProcessDestroy);
1296
+ super.init(), A.getInstance().createInterface("OGG_SIEGE"), C.getInstance().on("create", this.boundOnProcessCreate), C.getInstance().on("destroy", this.boundOnProcessDestroy);
1258
1297
  }
1259
1298
  destroy() {
1260
1299
  C.getInstance().off("create", this.boundOnProcessCreate), C.getInstance().off("destroy", this.boundOnProcessDestroy), super.destroy();
@@ -1263,69 +1302,78 @@ class _r extends N {
1263
1302
  const r = this.getRavenGame(t);
1264
1303
  if (!r)
1265
1304
  return;
1266
- if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", H.currentProcess.isElevated), t.isElevated && !H.currentProcess.isElevated) {
1305
+ if (this.subscribedGames.size === 0) {
1306
+ this.logger.warn("No subscribed games, skipping");
1307
+ return;
1308
+ }
1309
+ if (!this.subscribedGames.has(r.identifier) && !this.subscribedGames.has("*"))
1310
+ return;
1311
+ const n = new AbortController();
1312
+ if (await this.emit("gameLaunch", { game: r.identifier, reject: () => n.abort }), n.signal.aborted)
1313
+ return;
1314
+ if (this.logger.log("Game Launched", r), this.logger.log("Process is elevated: ", t.isElevated), this.logger.log("Current process is elevated: ", V.currentProcess.isElevated), t.isElevated && !V.currentProcess.isElevated) {
1267
1315
  I.getInstance().fatal("Game is elevated but the App is not", "ELEVATION_MISMATCH", {
1268
- appElevated: !!H.currentProcess.isElevated,
1316
+ appElevated: !!V.currentProcess.isElevated,
1269
1317
  gameElevated: !!t.isElevated
1270
1318
  }), this.logger.sentryLog("Game elevated but App is not", {
1271
- appElevated: H.currentProcess.isElevated,
1319
+ appElevated: V.currentProcess.isElevated,
1272
1320
  gameElevated: t.isElevated
1273
1321
  });
1274
1322
  return;
1275
1323
  }
1276
- const n = this.copyDll(Er);
1277
- if (n)
1324
+ const i = this.copyDll(Er);
1325
+ if (i)
1278
1326
  try {
1279
- await t.injectDll(n), this.logger.log("Render Interface Injection Successful", n);
1327
+ await t.injectDll(i), this.logger.log("Render Interface Injection Successful", i);
1280
1328
  } catch (a) {
1281
1329
  this.logger.captureSentryException("Render Interface Injection Failed", a), this.logger.sentryError("Render Interface Injection Failed", {
1282
- renderInterfacePath: n
1330
+ renderInterfacePath: i
1283
1331
  });
1284
1332
  }
1285
- const i = r == null ? void 0 : r.dlls_to_inject.map(async (a) => {
1286
- const o = await Z.getInstance().getCurrentVersion(a);
1287
- if (!o)
1333
+ const o = r == null ? void 0 : r.dlls_to_inject.map(async (a) => {
1334
+ const c = await Y.getInstance().getCurrentVersion(a);
1335
+ if (!c)
1288
1336
  return this.logger.sentryError("No version found for DLL", { identifier: a }), Promise.resolve();
1289
- const c = Z.getInstance().getTargetVersionPath(a, o);
1290
- this.logger.log("DLL Path", c);
1291
- const u = await this.getDllFiles(c);
1292
- return this.logger.log("DLL Files", u), Promise.all(
1293
- u.map(async (d) => {
1294
- const g = f.basename(d), h = f.join(c, g);
1295
- if (!h)
1337
+ const u = Y.getInstance().getTargetVersionPath(a, c);
1338
+ this.logger.log("DLL Path", u);
1339
+ const d = await this.getDllFiles(u);
1340
+ return this.logger.log("DLL Files", d), Promise.all(
1341
+ d.map(async (f) => {
1342
+ const h = y.basename(f), p = y.join(u, h);
1343
+ if (!p)
1296
1344
  return Promise.resolve();
1297
- this.logger.log("Injecting: ", h);
1345
+ this.logger.log("Injecting: ", p);
1298
1346
  try {
1299
- return t.injectDll(h).then(() => {
1300
- this.logger.log("Injection Successful", h);
1301
- }).catch((y) => {
1302
- this.logger.sentryError("Injection Failed [1]", { targetPath: h }, y);
1347
+ return t.injectDll(p).then(() => {
1348
+ this.logger.log("Injection Successful", p);
1349
+ }).catch((g) => {
1350
+ this.logger.sentryError("Injection Failed [1]", { targetPath: p }, g);
1303
1351
  });
1304
- } catch (y) {
1305
- return this.logger.sentryError("Injection Failed [2]", { targetPath: h }, y), Promise.reject(y);
1352
+ } catch (g) {
1353
+ return this.logger.sentryError("Injection Failed [2]", { targetPath: p }, g), Promise.reject(g);
1306
1354
  }
1307
1355
  })
1308
1356
  );
1309
1357
  });
1310
- await Promise.allSettled(i), this.emit("gameLaunchInternal", { ravenGame: r, process: t }), this.emit("gameLaunch", { game: r.identifier }), S.getInstance().track("game_launch", {
1358
+ await Promise.allSettled(o), this.emit("gameReadyInternal", { ravenGame: r, process: t }), this.emit("gameReady", { game: r.identifier }), S.getInstance().track("game_launch", {
1311
1359
  game: r.identifier
1312
1360
  });
1313
1361
  }
1314
1362
  copyDll(t) {
1315
- const r = f.basename(t), n = it(t), i = f.join(ye(), "resources"), a = f.join(i, r);
1316
- this.logger.debug("Copying", n, "to", a);
1363
+ const r = y.basename(t), n = it(t), i = y.join(me(), "resources"), o = y.join(i, r);
1364
+ this.logger.debug("Copying", n, "to", o);
1317
1365
  try {
1318
- ce(i) || le(i, { recursive: !0 });
1319
- const o = Ae(n);
1320
- he(a, o), nt(n, a);
1321
- } catch (o) {
1322
- return o.code === "EBUSY" ? a : (this.logger.captureSentryException("Failed to copy", o), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: a }), !1);
1366
+ he(i) || ce(i, { recursive: !0 });
1367
+ const a = $e(n);
1368
+ ue(o, a), nt(n, o);
1369
+ } catch (a) {
1370
+ return a.code === "EBUSY" ? o : (this.logger.captureSentryException("Failed to copy", a), this.logger.sentryError("Failed to copy", { originalPath: n, targetPath: o }), !1);
1323
1371
  }
1324
- return a;
1372
+ return o;
1325
1373
  }
1326
1374
  async getDllFiles(t) {
1327
1375
  try {
1328
- return (await w.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => f.join(t, n));
1376
+ return (await w.readdir(t)).filter((n) => n.endsWith(".dll")).map((n) => y.join(t, n));
1329
1377
  } catch (r) {
1330
1378
  return this.logger.captureSentryException("Failed to read DLL directory", r), this.logger.sentryError("Failed to read DLL directory", { dllPath: t }), [];
1331
1379
  }
@@ -1339,7 +1387,7 @@ class _r extends N {
1339
1387
  getRavenGame(t) {
1340
1388
  if (!t.name)
1341
1389
  return;
1342
- const r = T.getInstance().getExecutableData(t.name);
1390
+ const r = G.getInstance().getExecutableData(t.name);
1343
1391
  if (!r) {
1344
1392
  this.logger.sentryError("No raven game found for process", { process: t });
1345
1393
  return;
@@ -1347,17 +1395,17 @@ class _r extends N {
1347
1395
  return r;
1348
1396
  }
1349
1397
  }
1350
- const B = E(_r);
1351
- class kr extends Ge {
1398
+ const $ = E(kr);
1399
+ class _r extends Be {
1352
1400
  constructor() {
1353
1401
  super("GameBuildManager");
1354
1402
  l(this, "boundOnGameLaunch", this.onGameLaunch.bind(this));
1355
1403
  }
1356
1404
  init() {
1357
- super.init(), B.getInstance().on("gameLaunchInternal", this.boundOnGameLaunch);
1405
+ super.init(), $.getInstance().on("gameReadyInternal", this.boundOnGameLaunch);
1358
1406
  }
1359
1407
  destroy() {
1360
- B.getInstance().off("gameLaunchInternal", this.boundOnGameLaunch), super.destroy();
1408
+ $.getInstance().off("gameReadyInternal", this.boundOnGameLaunch), super.destroy();
1361
1409
  }
1362
1410
  async onGameLaunch(t) {
1363
1411
  const { ravenGame: r, process: n } = t;
@@ -1369,16 +1417,16 @@ class kr extends Ge {
1369
1417
  );
1370
1418
  return;
1371
1419
  }
1372
- const i = Ae(n.path), a = at("sha256").update(i).digest("hex");
1373
- this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", a);
1374
- let o = !1;
1420
+ const i = $e(n.path), o = at("sha256").update(i).digest("hex");
1421
+ this.logger.log("Process Path", n.path), this.logger.log("Process Name", n.name), this.logger.log("Build Hash", o);
1422
+ let a = !1;
1375
1423
  try {
1376
- o = (await tr(r.identifier, a)).data.upload;
1424
+ a = (await tr(r.identifier, o)).data.upload;
1377
1425
  } catch (d) {
1378
1426
  this.logger.captureSentryException("Error checking game build hash", d);
1379
1427
  return;
1380
1428
  }
1381
- if (!o) {
1429
+ if (!a) {
1382
1430
  this.logger.log("Build hash already exists, skipping upload");
1383
1431
  return;
1384
1432
  }
@@ -1392,7 +1440,15 @@ class kr extends Ge {
1392
1440
  }
1393
1441
  }
1394
1442
  }
1395
- const Ze = E(kr), oe = /* @__PURE__ */ new Map([
1443
+ const Ze = E(_r);
1444
+ function Pr(s = []) {
1445
+ return y.normalize(y.join(Ge(global.OVERLAYED.APP_NAME), ...s));
1446
+ }
1447
+ const Sr = L({
1448
+ game: "string",
1449
+ type: "string",
1450
+ creation_time: "number"
1451
+ }), le = /* @__PURE__ */ new Map([
1396
1452
  [1, "LeftButton"],
1397
1453
  [2, "RightButton"],
1398
1454
  [3, "Cancel"],
@@ -1585,13 +1641,13 @@ const Ze = E(kr), oe = /* @__PURE__ */ new Map([
1585
1641
  [252, "Noname"],
1586
1642
  [253, "PA1"],
1587
1643
  [254, "OEM_Clear"]
1588
- ]), De = new Map(oe.entries().map(([s, e]) => [e, s])), Pr = L({
1644
+ ]), De = new Map(le.entries().map(([s, e]) => [e, s])), Cr = L({
1589
1645
  "[string]": {
1590
1646
  keys: "string[]",
1591
1647
  mode: L("'toggle' | 'hold'").pipe((s) => s ?? "toggle")
1592
1648
  }
1593
1649
  });
1594
- class Sr extends N {
1650
+ class Lr extends te {
1595
1651
  constructor(t) {
1596
1652
  super("KeybindManager");
1597
1653
  l(this, "preferencesKeybindToCallbacks", /* @__PURE__ */ new Map());
@@ -1605,14 +1661,14 @@ class Sr extends N {
1605
1661
  // TODO try to figure out a better way to handle this
1606
1662
  l(this, "keybindListeningPaused", !1);
1607
1663
  this.keybindsFile = new _t({
1608
- path: St(["keybinds.json"]),
1609
- schema: Pr,
1664
+ path: Pr(["keybinds.json"]),
1665
+ schema: Cr,
1610
1666
  default: t
1611
1667
  });
1612
1668
  }
1613
1669
  init() {
1614
1670
  super.init();
1615
- const t = $.getInstance().getInterface("OGG_SIEGE");
1671
+ const t = A.getInstance().getInterface("OGG_SIEGE");
1616
1672
  t.instance.on("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.on("keyDown", this.boundHandleKeyDown), t.instance.on("keyUp", this.boundHandleKeyUp);
1617
1673
  }
1618
1674
  // TODO support multiple callbacks
@@ -1646,13 +1702,13 @@ class Sr extends N {
1646
1702
  return this.keybindsFile.get();
1647
1703
  }
1648
1704
  destroy() {
1649
- const t = $.getInstance().getInterface("OGG_SIEGE");
1705
+ const t = A.getInstance().getInterface("OGG_SIEGE");
1650
1706
  t.instance.off("keyboardFocus", this.boundHandleKeyboardFocus), t.instance.off("keyDown", this.boundHandleKeyDown), t.instance.off("keyUp", this.boundHandleKeyUp), super.destroy();
1651
1707
  }
1652
1708
  handleKeyDown(t) {
1653
1709
  if (this.keybindListeningPaused)
1654
1710
  return;
1655
- const r = oe.get(t.key);
1711
+ const r = le.get(t.key);
1656
1712
  if (!r) {
1657
1713
  this.logger.error("Unknown key down", t);
1658
1714
  return;
@@ -1665,7 +1721,7 @@ class Sr extends N {
1665
1721
  async handleKeyUp(t) {
1666
1722
  if (this.keybindListeningPaused)
1667
1723
  return;
1668
- const r = oe.get(t.key);
1724
+ const r = le.get(t.key);
1669
1725
  if (!r)
1670
1726
  return;
1671
1727
  this.pressedKeys.delete(r);
@@ -1679,42 +1735,42 @@ class Sr extends N {
1679
1735
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1680
1736
  if (!n.up) continue;
1681
1737
  const i = t[r];
1682
- this.activeKeybinds.has(r) && i.keys.some((a) => !this.pressedKeys.has(a)) && (this.activeKeybinds.delete(r), n.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(i)));
1738
+ this.activeKeybinds.has(r) && i.keys.some((o) => !this.pressedKeys.has(o)) && (this.activeKeybinds.delete(r), n.up(), this.logger.log("Keybind up triggered", this.getKeybindToString(i)));
1683
1739
  }
1684
1740
  }
1685
1741
  async checkKeybindings() {
1686
1742
  const t = this.keybindsFile.get();
1687
1743
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1688
1744
  const i = t[r];
1689
- if (i.keys.length === this.pressedKeys.size && i.keys.every((o) => De.has(o) ? this.pressedKeys.has(o) : !1)) {
1745
+ if (i.keys.length === this.pressedKeys.size && i.keys.every((a) => De.has(a) ? this.pressedKeys.has(a) : !1)) {
1690
1746
  this.triggerKeybind(i, n, r);
1691
1747
  return;
1692
1748
  }
1693
1749
  }
1694
1750
  for (const [r, n] of this.preferencesKeybindToCallbacks.entries()) {
1695
1751
  const i = t[r];
1696
- i.keys.every((o) => De.has(o) ? this.pressedKeys.has(o) : (this.logger.error("Unknown key", o, i), !1)) && this.triggerKeybind(i, n, r);
1752
+ i.keys.every((a) => De.has(a) ? this.pressedKeys.has(a) : (this.logger.error("Unknown key", a, i), !1)) && this.triggerKeybind(i, n, r);
1697
1753
  }
1698
1754
  }
1699
1755
  triggerKeybind(t, r, n) {
1700
1756
  const i = t.mode;
1701
1757
  if (i === "toggle" && r.toggle && !this.triggeredToggleKeybinds.has(n)) {
1702
- const a = r.toggle();
1758
+ const o = r.toggle();
1703
1759
  this.triggeredToggleKeybinds.add(n), this.logger.log(
1704
- a ? `Keybind pressed rejected: ${a}` : "Keybind pressed accepted",
1760
+ o ? `Keybind pressed rejected: ${o}` : "Keybind pressed accepted",
1705
1761
  this.getKeybindToString(t)
1706
1762
  );
1707
1763
  }
1708
1764
  if (i === "hold" && r.down && !this.activeKeybinds.has(n)) {
1709
- const a = r.down();
1710
- a ? this.logger.log(`Keybind down rejected: ${a}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(n), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1765
+ const o = r.down();
1766
+ o ? this.logger.log(`Keybind down rejected: ${o}`, this.getKeybindToString(t)) : (this.activeKeybinds.add(n), this.logger.log("Keybind down accepted", this.getKeybindToString(t)));
1711
1767
  }
1712
1768
  }
1713
1769
  getKeybindToString(t) {
1714
1770
  return `(${t.keys.join("+")}${t.mode ? ` ${t.mode}` : ""})`;
1715
1771
  }
1716
1772
  }
1717
- class Cr extends Ge {
1773
+ class Kr extends Be {
1718
1774
  constructor(t) {
1719
1775
  super("OverridesManager");
1720
1776
  l(this, "renderInterface");
@@ -1722,7 +1778,7 @@ class Cr extends Ge {
1722
1778
  l(this, "globalMouseBlockCount", /* @__PURE__ */ new Set());
1723
1779
  l(this, "globalKeyboardBlockCount", /* @__PURE__ */ new Set());
1724
1780
  l(this, "keyInputBlocks", {});
1725
- this.renderInterface = $.getInstance().getInterface(t);
1781
+ this.renderInterface = A.getInstance().getInterface(t);
1726
1782
  }
1727
1783
  scope(t) {
1728
1784
  return {
@@ -1745,35 +1801,35 @@ class Cr extends Ge {
1745
1801
  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);
1746
1802
  }
1747
1803
  }
1748
- const Lr = E(Cr, "OGG_SIEGE");
1749
- let z = !1, W;
1750
- function ps(s) {
1804
+ const Fr = E(Kr, "OGG_SIEGE");
1805
+ let H = !1, U;
1806
+ function ms(s) {
1751
1807
  const { init: e = !0 } = s;
1752
- if (Kr(s), me.getInstance().init(s.appName), z)
1753
- return W;
1808
+ if (Dr(s), ee.getInstance().init(s.appName), H)
1809
+ return U;
1754
1810
  function t() {
1755
- Tr(s);
1756
- const r = /* @__PURE__ */ new Map(), n = Or(s.modules, r), i = Mr(), a = Ar(s.keybinds), o = Rr(), c = xr();
1757
- Fr(), $r(s, r), z = !0, W = {
1811
+ Nr(s);
1812
+ const r = /* @__PURE__ */ new Map(), n = Ar(s.modules, r), i = $r(), o = xr(s.keybinds), a = Tr(), c = Gr();
1813
+ Mr(s), Rr(s, r), H = !0, U = {
1758
1814
  ...n,
1759
1815
  ...i,
1760
- keybinds: a,
1761
- windows: o,
1816
+ keybinds: o,
1817
+ windows: a,
1762
1818
  input: c,
1763
1819
  hasAnyActiveProcesses: () => C.getInstance().hasAnyActiveProcesses,
1764
1820
  init: t,
1765
- initialized: z
1821
+ initialized: H
1766
1822
  };
1767
1823
  }
1768
- return e ? (t(), W) : new Proxy(
1824
+ return e ? (t(), U) : new Proxy(
1769
1825
  {
1770
1826
  init: t
1771
1827
  },
1772
1828
  {
1773
1829
  get: (r, n) => {
1774
- if (n !== "init" && !z)
1830
+ if (n !== "init" && !H)
1775
1831
  throw new Error(`overlayed was called before initialized: ${n}`);
1776
- return n === "init" ? r[n] : W[n];
1832
+ return n === "init" ? r[n] : U[n];
1777
1833
  }
1778
1834
  }
1779
1835
  );
@@ -1783,47 +1839,48 @@ global.OVERLAYED = new Proxy({}, {
1783
1839
  throw new Error("function overlayed was not called");
1784
1840
  }
1785
1841
  });
1786
- function Kr(s) {
1842
+ function Dr(s) {
1787
1843
  global.OVERLAYED = {
1788
1844
  APP_NAME: s.appName
1789
1845
  };
1790
1846
  }
1791
- function Fr() {
1792
- Ze.getInstance().init(), B.getInstance().init(), C.getInstance().init(), T.getInstance().init(), xe.on("quit", () => {
1793
- Dr();
1847
+ function Mr(s) {
1848
+ const e = s.universal ? ["*"] : s.modules.map((t) => t.key);
1849
+ $.getInstance().setSubscribedGames(e), Ze.getInstance().init(), $.getInstance().init(), C.getInstance().init(), G.getInstance().init(), xe.on("quit", () => {
1850
+ Or();
1794
1851
  });
1795
1852
  }
1796
- function Dr() {
1797
- T.getInstance().destroy(), B.getInstance().destroy(), Ze.getInstance().destroy(), C.getInstance().destroy(), $.getInstance().getInterface("OGG_SIEGE").destroy(), ge.getInstance().destroy(), I.getInstance().destroy();
1853
+ function Or() {
1854
+ G.getInstance().destroy(), $.getInstance().destroy(), Ze.getInstance().destroy(), C.getInstance().destroy(), A.getInstance().getInterface("OGG_SIEGE").destroy(), fe.getInstance().destroy(), I.getInstance().destroy();
1798
1855
  }
1799
- function Or(s, e) {
1856
+ function Ar(s, e) {
1800
1857
  return s.reduce((t, r) => {
1801
1858
  const n = r.key;
1802
1859
  return t[n] = {
1803
1860
  // prettier-ignore
1804
- on(i, a) {
1805
- const o = F(n, i), c = e.get(o) ?? /* @__PURE__ */ new Set();
1806
- c.add(a), e.set(o, c);
1861
+ on(i, o) {
1862
+ const a = F(n, i), c = e.get(a) ?? /* @__PURE__ */ new Set();
1863
+ c.add(o), e.set(a, c);
1807
1864
  },
1808
1865
  onAny(i) {
1809
- const a = F(n, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
1810
- o.add(i), e.set(a, o);
1866
+ const o = F(n, "*"), a = e.get(o) ?? /* @__PURE__ */ new Set();
1867
+ a.add(i), e.set(o, a);
1811
1868
  },
1812
1869
  // prettier-ignore
1813
- off(i, a) {
1814
- const o = F(n, i), c = e.get(o) ?? /* @__PURE__ */ new Set();
1815
- c.delete(a), e.set(o, c);
1870
+ off(i, o) {
1871
+ const a = F(n, i), c = e.get(a) ?? /* @__PURE__ */ new Set();
1872
+ c.delete(o), e.set(a, c);
1816
1873
  },
1817
1874
  // prettier-ignore
1818
1875
  offAny(i) {
1819
- const a = F(n, "*"), o = e.get(a) ?? /* @__PURE__ */ new Set();
1820
- o.delete(i), e.set(a, o);
1876
+ const o = F(n, "*"), a = e.get(o) ?? /* @__PURE__ */ new Set();
1877
+ a.delete(i), e.set(o, a);
1821
1878
  }
1822
1879
  }, t;
1823
1880
  }, {});
1824
1881
  }
1825
- function Mr() {
1826
- const s = I.getInstance(), e = B.getInstance();
1882
+ function $r() {
1883
+ const s = I.getInstance(), e = $.getInstance();
1827
1884
  return {
1828
1885
  on: (t, r) => {
1829
1886
  switch (t) {
@@ -1842,6 +1899,9 @@ function Mr() {
1842
1899
  case "gameClose":
1843
1900
  e.on("gameClose", r);
1844
1901
  break;
1902
+ case "gameReady":
1903
+ e.on("gameReady", r);
1904
+ break;
1845
1905
  default:
1846
1906
  throw new Error(`Event type not implemented ${t}`, { cause: [t, r] });
1847
1907
  }
@@ -1863,6 +1923,9 @@ function Mr() {
1863
1923
  case "gameClose":
1864
1924
  e.off("gameClose", r);
1865
1925
  break;
1926
+ case "gameReady":
1927
+ e.off("gameReady", r);
1928
+ break;
1866
1929
  default:
1867
1930
  throw new Error(`Event type not implemented ${t}`, { cause: [t, r] });
1868
1931
  }
@@ -1872,29 +1935,29 @@ function Mr() {
1872
1935
  function F(s, e) {
1873
1936
  return `${s}:${e}`;
1874
1937
  }
1875
- function $r(s, e) {
1876
- const t = ge.getInstance();
1938
+ function Rr(s, e) {
1939
+ const t = fe.getInstance();
1877
1940
  function r(n) {
1878
- const i = Ct(n);
1941
+ const i = Sr(n);
1879
1942
  if (i instanceof L.errors) {
1880
1943
  I.getInstance().warn("Invalid event", "INVALID_EVENT", {
1881
1944
  summary: i.summary
1882
1945
  });
1883
1946
  return;
1884
1947
  }
1885
- const a = s.modules.find((p) => p.key === i.game), o = a == null ? void 0 : a.events.event;
1886
- if (!o)
1948
+ const o = s.modules.find((g) => g.key === i.game), a = o == null ? void 0 : o.events.event;
1949
+ if (!a)
1887
1950
  return;
1888
- const c = o(n);
1951
+ const c = a(n);
1889
1952
  if (c instanceof L.errors) {
1890
1953
  I.getInstance().warn("Invalid event", "INVALID_EVENT", {
1891
1954
  summary: c.summary
1892
1955
  });
1893
1956
  return;
1894
1957
  }
1895
- const u = F(a.key, c.type), d = F(a.key, "*"), g = e.get(u), h = e.get(d), y = [...Array.from(g ?? []), ...Array.from(h ?? [])];
1896
- y.length !== 0 && y.forEach((p) => {
1897
- p(c);
1958
+ const u = F(o.key, c.type), d = F(o.key, "*"), f = e.get(u), h = e.get(d), p = [...Array.from(f ?? []), ...Array.from(h ?? [])];
1959
+ p.length !== 0 && p.forEach((g) => {
1960
+ g(c);
1898
1961
  });
1899
1962
  }
1900
1963
  return t.on("data", (n) => n.forEach(r)), t.on("error", (n) => {
@@ -1903,23 +1966,23 @@ function $r(s, e) {
1903
1966
  });
1904
1967
  }), t;
1905
1968
  }
1906
- function Ar(s) {
1907
- const e = new Sr(s), t = {};
1969
+ function xr(s) {
1970
+ const e = new Lr(s), t = {};
1908
1971
  for (const n in s)
1909
1972
  t[n] = {
1910
- on: (i, a) => {
1973
+ on: (i, o) => {
1911
1974
  switch (i) {
1912
1975
  case "down":
1913
- e.onKeybindDown(n, a);
1976
+ e.onKeybindDown(n, o);
1914
1977
  break;
1915
1978
  case "up":
1916
- e.onKeybindUp(n, a);
1979
+ e.onKeybindUp(n, o);
1917
1980
  break;
1918
1981
  case "toggle":
1919
- e.onKeybindToggled(n, a);
1982
+ e.onKeybindToggled(n, o);
1920
1983
  break;
1921
1984
  default:
1922
- throw new Error(`Event type not implemented ${i}`, { cause: [i, a] });
1985
+ throw new Error(`Event type not implemented ${i}`, { cause: [i, o] });
1923
1986
  }
1924
1987
  }
1925
1988
  };
@@ -1943,7 +2006,7 @@ function Ar(s) {
1943
2006
  e.destroy();
1944
2007
  }), r;
1945
2008
  }
1946
- function Rr() {
2009
+ function Tr() {
1947
2010
  return {
1948
2011
  createWindow: (s) => m().instance.newWindowInternal(ot.BrowserWindow, s),
1949
2012
  on: (s, e) => m().instance.on(s, e),
@@ -1955,7 +2018,7 @@ function Rr() {
1955
2018
  prependListener: (s, e) => m().instance.prependListener(s, e),
1956
2019
  prependOnceListener: (s, e) => m().instance.prependOnceListener(s, e),
1957
2020
  getActiveGameInfo: () => {
1958
- const s = m(), e = ge.getInstance();
2021
+ const s = m(), e = fe.getInstance();
1959
2022
  return {
1960
2023
  resolution: s.resolution,
1961
2024
  isConnected: e.hasConnection
@@ -1963,9 +2026,9 @@ function Rr() {
1963
2026
  }
1964
2027
  };
1965
2028
  }
1966
- function xr() {
2029
+ function Gr() {
1967
2030
  return {
1968
- scope: (s) => Lr.getInstance().scope(s),
2031
+ scope: (s) => Fr.getInstance().scope(s),
1969
2032
  raw: {
1970
2033
  setGlobalMouseBlock: (s) => m().instance.setGlobalMouseBlock(s),
1971
2034
  setGlobalKeyboardBlock: (s) => m().instance.setGlobalKeyboardBlock(s),
@@ -1978,7 +2041,7 @@ function xr() {
1978
2041
  }
1979
2042
  };
1980
2043
  }
1981
- function Tr(s) {
2044
+ function Nr(s) {
1982
2045
  S.getInstance().clientId = s.appName, S.getInstance().userId = hr.generateUniqueIdentifier(), I.getInstance().on("fatal", (e) => {
1983
2046
  S.getInstance().track("fatal", {
1984
2047
  message: e.message,
@@ -2000,8 +2063,8 @@ function Tr(s) {
2000
2063
  });
2001
2064
  }
2002
2065
  function m() {
2003
- return $.getInstance().getInterface("OGG_SIEGE");
2066
+ return A.getInstance().getInterface("OGG_SIEGE");
2004
2067
  }
2005
2068
  export {
2006
- ps as overlayed
2069
+ ms as overlayed
2007
2070
  };