glassjar 0.5.0 → 0.5.1

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.
@@ -2,11 +2,11 @@ class S {
2
2
  static __wrap(A) {
3
3
  A = A >>> 0;
4
4
  const g = Object.create(S.prototype);
5
- return g.__wbg_ptr = A, O.register(g, g.__wbg_ptr, g), g;
5
+ return g.__wbg_ptr = A, j.register(g, g.__wbg_ptr, g), g;
6
6
  }
7
7
  __destroy_into_raw() {
8
8
  const A = this.__wbg_ptr;
9
- return this.__wbg_ptr = 0, O.unregister(this), A;
9
+ return this.__wbg_ptr = 0, j.unregister(this), A;
10
10
  }
11
11
  free() {
12
12
  const A = this.__destroy_into_raw();
@@ -25,13 +25,13 @@ function b(C, A, g, I, Q, E) {
25
25
  const w = T(C, B.__wbindgen_malloc), i = M, o = T(A, B.__wbindgen_malloc), q = M, h = G(g, B.__wbindgen_malloc, B.__wbindgen_realloc), p = M, x = G(I, B.__wbindgen_malloc, B.__wbindgen_realloc), t = M, l = G(Q, B.__wbindgen_malloc, B.__wbindgen_realloc), f = M;
26
26
  B.configure_compiler_toolchain(w, i, o, q, h, p, x, t, l, f, E);
27
27
  }
28
- function m() {
28
+ function P() {
29
29
  B.main();
30
30
  }
31
- function P(C) {
31
+ function X(C) {
32
32
  B.set_compiler_instance_observer(C);
33
33
  }
34
- function X(C) {
34
+ function m(C) {
35
35
  B.set_compiler_module_constructor(C);
36
36
  }
37
37
  function n(C) {
@@ -64,7 +64,7 @@ function r() {
64
64
  return F(I) ? 16777215 : I ? 1 : 0;
65
65
  },
66
66
  __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
67
- const I = z(g), Q = G(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E = M;
67
+ const I = d(g), Q = G(I, B.__wbindgen_malloc, B.__wbindgen_realloc), E = M;
68
68
  N().setInt32(A + 4, E, !0), N().setInt32(A + 0, Q, !0);
69
69
  },
70
70
  __wbg___wbindgen_function_table_5ae7216dfcbcc506: function() {
@@ -636,19 +636,19 @@ function r() {
636
636
  },
637
637
  __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
638
638
  const A = typeof global > "u" ? null : global;
639
- return F(A) ? 0 : U(A);
639
+ return F(A) ? 0 : J(A);
640
640
  },
641
641
  __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
642
642
  const A = typeof globalThis > "u" ? null : globalThis;
643
- return F(A) ? 0 : U(A);
643
+ return F(A) ? 0 : J(A);
644
644
  },
645
645
  __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
646
646
  const A = typeof self > "u" ? null : self;
647
- return F(A) ? 0 : U(A);
647
+ return F(A) ? 0 : J(A);
648
648
  },
649
649
  __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
650
650
  const A = typeof window > "u" ? null : window;
651
- return F(A) ? 0 : U(A);
651
+ return F(A) ? 0 : J(A);
652
652
  },
653
653
  __wbg_store_d1d951c98d9bed41: function() {
654
654
  return D(function(A, g, I) {
@@ -697,10 +697,10 @@ function r() {
697
697
  console.warn(A, g, I);
698
698
  },
699
699
  __wbindgen_cast_0000000000000001: function(A, g) {
700
- return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, j);
700
+ return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, O);
701
701
  },
702
702
  __wbindgen_cast_0000000000000002: function(A, g) {
703
- return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, j);
703
+ return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, O);
704
704
  },
705
705
  __wbindgen_cast_0000000000000003: function(A, g) {
706
706
  return Y(A, g, B.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, _);
@@ -755,29 +755,29 @@ function e(C, A, g) {
755
755
  function _(C, A, g) {
756
756
  const I = B.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(C, A, g);
757
757
  if (I[1])
758
- throw W(I[0]);
758
+ throw z(I[0]);
759
759
  }
760
- function j(C, A, g) {
760
+ function O(C, A, g) {
761
761
  const I = B.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue__(C, A, g);
762
762
  if (I[2])
763
- throw W(I[1]);
764
- return W(I[0]);
763
+ throw z(I[1]);
764
+ return z(I[0]);
765
765
  }
766
766
  function $(C, A, g, I) {
767
767
  B.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(C, A, g, I);
768
768
  }
769
769
  typeof FinalizationRegistry > "u" || new FinalizationRegistry((C) => B.__wbg_dapadapter_free(C >>> 0, 1));
770
- const O = typeof FinalizationRegistry > "u" ? { register: () => {
770
+ const j = typeof FinalizationRegistry > "u" ? { register: () => {
771
771
  }, unregister: () => {
772
772
  } } : new FinalizationRegistry((C) => B.__wbg_trap_free(C >>> 0, 1));
773
- function U(C) {
773
+ function J(C) {
774
774
  const A = B.__externref_table_alloc();
775
775
  return B.__wbindgen_externrefs.set(A, C), A;
776
776
  }
777
777
  const H = typeof FinalizationRegistry > "u" ? { register: () => {
778
778
  }, unregister: () => {
779
779
  } } : new FinalizationRegistry((C) => C.dtor(C.a, C.b));
780
- function z(C) {
780
+ function d(C) {
781
781
  const A = typeof C;
782
782
  if (A == "number" || A == "boolean" || C == null)
783
783
  return `${C}`;
@@ -794,9 +794,9 @@ function z(C) {
794
794
  if (Array.isArray(C)) {
795
795
  const Q = C.length;
796
796
  let E = "[";
797
- Q > 0 && (E += z(C[0]));
797
+ Q > 0 && (E += d(C[0]));
798
798
  for (let w = 1; w < Q; w++)
799
- E += ", " + z(C[w]);
799
+ E += ", " + d(C[w]);
800
800
  return E += "]", E;
801
801
  }
802
802
  const g = /\[object ([^\]]+)\]/.exec(toString.call(C));
@@ -831,15 +831,15 @@ function N() {
831
831
  function k(C, A) {
832
832
  return C = C >>> 0, CA(C, A);
833
833
  }
834
- let J = null;
834
+ let U = null;
835
835
  function R() {
836
- return (J === null || J.byteLength === 0) && (J = new Uint8Array(B.memory.buffer)), J;
836
+ return (U === null || U.byteLength === 0) && (U = new Uint8Array(B.memory.buffer)), U;
837
837
  }
838
838
  function D(C, A) {
839
839
  try {
840
840
  return C.apply(this, A);
841
841
  } catch (g) {
842
- const I = U(g);
842
+ const I = J(g);
843
843
  B.__wbindgen_exn_store(I);
844
844
  }
845
845
  }
@@ -898,16 +898,16 @@ function G(C, A, g) {
898
898
  }
899
899
  return M = w, Q;
900
900
  }
901
- function W(C) {
901
+ function z(C) {
902
902
  const A = B.__wbindgen_externrefs.get(C);
903
903
  return B.__externref_table_dealloc(C), A;
904
904
  }
905
905
  let c = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
906
906
  c.decode();
907
907
  const IA = 2146435072;
908
- let d = 0;
908
+ let Z = 0;
909
909
  function CA(C, A) {
910
- return d += A, d >= IA && (c = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), c.decode(), d = A), c.decode(R().subarray(C, C + A));
910
+ return Z += A, Z >= IA && (c = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }), c.decode(), Z = A), c.decode(R().subarray(C, C + A));
911
911
  }
912
912
  const L = new TextEncoder();
913
913
  "encodeInto" in L || (L.encodeInto = function(C, A) {
@@ -919,7 +919,7 @@ const L = new TextEncoder();
919
919
  });
920
920
  let M = 0, B;
921
921
  function QA(C, A) {
922
- return B = C.exports, y = null, J = null, B.__wbindgen_start(), B;
922
+ return B = C.exports, y = null, U = null, B.__wbindgen_start(), B;
923
923
  }
924
924
  async function BA(C, A) {
925
925
  if (typeof Response == "function" && C instanceof Response) {
@@ -956,7 +956,7 @@ async function EA(C) {
956
956
  const { instance: g, module: I } = await BA(await C, A);
957
957
  return QA(g);
958
958
  }
959
- var DA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.0/dist/engine_bg.wasm");
959
+ var DA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.1/dist/engine_bg.wasm");
960
960
  class wA {
961
961
  enabled = !1;
962
962
  verified;
@@ -1061,7 +1061,7 @@ function oA(C, A) {
1061
1061
  throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);
1062
1062
  return g.href;
1063
1063
  }
1064
- let K = { scopeEpoch: 0, operationId: 0, cacheEpoch: 0 }, Z;
1064
+ let K = { scopeEpoch: 0, operationId: 0, cacheEpoch: 0 }, W;
1065
1065
  const a = new wA(
1066
1066
  (C) => postMessage({ ...C, ...K })
1067
1067
  );
@@ -1083,8 +1083,8 @@ addEventListener(
1083
1083
  C.stopImmediatePropagation();
1084
1084
  const g = A;
1085
1085
  if (g.scopeEpoch === K.scopeEpoch && g.operationId === K.operationId && g.cacheEpoch === K.cacheEpoch) {
1086
- const I = Z;
1087
- Z = void 0, I?.();
1086
+ const I = W;
1087
+ W = void 0, I?.();
1088
1088
  }
1089
1089
  } else typeof A?.operation_id == "number" && (a.beginOperation(), K = {
1090
1090
  scopeEpoch: A.scope_epoch,
@@ -1095,15 +1095,15 @@ addEventListener(
1095
1095
  );
1096
1096
  try {
1097
1097
  const C = self.name ?? "", A = C.startsWith(V) ? oA(C.slice(V.length)) : void 0;
1098
- await EA({ module_or_path: A ?? DA }), X(
1098
+ await EA({ module_or_path: A ?? DA }), m(
1099
1099
  (g) => a.constructVerified(g)
1100
1100
  ), n(
1101
1101
  () => new Promise((g) => {
1102
- Z = g, postMessage({ type: "object_build_complete", ...K });
1102
+ W = g, postMessage({ type: "object_build_complete", ...K });
1103
1103
  })
1104
- ), P(
1104
+ ), X(
1105
1105
  (g) => a.instantiated(g)
1106
- ), m();
1106
+ ), P();
1107
1107
  } catch (C) {
1108
1108
  postMessage({
1109
1109
  type: "error",
Binary file
package/dist/glassjar.js CHANGED
@@ -1,9 +1,9 @@
1
- function UA(Q) {
1
+ function JA(Q) {
2
2
  return Q && Q.__esModule && Object.prototype.hasOwnProperty.call(Q, "default") ? Q.default : Q;
3
3
  }
4
- var m = { exports: {} }, BA;
5
- function JA() {
6
- if (BA) return m.exports;
4
+ var P = { exports: {} }, BA;
5
+ function UA() {
6
+ if (BA) return P.exports;
7
7
  BA = 1;
8
8
  var Q = typeof Reflect == "object" ? Reflect : null, A = Q && typeof Q.apply == "function" ? Q.apply : function(E, o, k) {
9
9
  return Function.prototype.apply.call(E, o, k);
@@ -22,7 +22,7 @@ function JA() {
22
22
  function B() {
23
23
  B.init.call(this);
24
24
  }
25
- m.exports = B, m.exports.once = p, B.EventEmitter = B, B.prototype._events = void 0, B.prototype._eventsCount = 0, B.prototype._maxListeners = void 0;
25
+ P.exports = B, P.exports.once = p, B.EventEmitter = B, B.prototype._events = void 0, B.prototype._eventsCount = 0, B.prototype._maxListeners = void 0;
26
26
  var i = 10;
27
27
  function D(w) {
28
28
  if (typeof w != "function")
@@ -61,16 +61,16 @@ function JA() {
61
61
  var G;
62
62
  if (o.length > 0 && (G = o[0]), G instanceof Error)
63
63
  throw G;
64
- var a = new Error("Unhandled error." + (G ? " (" + G.message + ")" : ""));
65
- throw a.context = G, a;
64
+ var H = new Error("Unhandled error." + (G ? " (" + G.message + ")" : ""));
65
+ throw H.context = G, H;
66
66
  }
67
- var j = R[E];
68
- if (j === void 0)
67
+ var O = R[E];
68
+ if (O === void 0)
69
69
  return !1;
70
- if (typeof j == "function")
71
- A(j, this, o);
70
+ if (typeof O == "function")
71
+ A(O, this, o);
72
72
  else
73
- for (var QA = j.length, YA = H(j, QA), k = 0; k < QA; ++k)
73
+ for (var QA = O.length, YA = a(O, QA), k = 0; k < QA; ++k)
74
74
  A(YA[k], this, o);
75
75
  return !0;
76
76
  };
@@ -84,8 +84,8 @@ function JA() {
84
84
  G = R[E] = o, ++w._eventsCount;
85
85
  else if (typeof G == "function" ? G = R[E] = k ? [o, G] : [G, o] : k ? G.unshift(o) : G.push(o), F = N(w), F > 0 && G.length > F && !G.warned) {
86
86
  G.warned = !0;
87
- var a = new Error("Possible EventEmitter memory leak detected. " + G.length + " " + String(E) + " listeners added. Use emitter.setMaxListeners() to increase limit");
88
- a.name = "MaxListenersExceededWarning", a.emitter = w, a.type = E, a.count = G.length, I(a);
87
+ var H = new Error("Possible EventEmitter memory leak detected. " + G.length + " " + String(E) + " listeners added. Use emitter.setMaxListeners() to increase limit");
88
+ H.name = "MaxListenersExceededWarning", H.emitter = w, H.type = E, H.count = G.length, I(H);
89
89
  }
90
90
  return w;
91
91
  }
@@ -94,12 +94,12 @@ function JA() {
94
94
  }, B.prototype.on = B.prototype.addListener, B.prototype.prependListener = function(E, o) {
95
95
  return K(this, E, o, !0);
96
96
  };
97
- function U() {
97
+ function J() {
98
98
  if (!this.fired)
99
99
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
100
100
  }
101
101
  function h(w, E, o) {
102
- var k = { fired: !1, wrapFn: void 0, target: w, type: E, listener: o }, F = U.bind(k);
102
+ var k = { fired: !1, wrapFn: void 0, target: w, type: E, listener: o }, F = J.bind(k);
103
103
  return F.listener = o, k.wrapFn = F, F;
104
104
  }
105
105
  B.prototype.once = function(E, o) {
@@ -107,7 +107,7 @@ function JA() {
107
107
  }, B.prototype.prependOnceListener = function(E, o) {
108
108
  return D(o), this.prependListener(E, h(this, E, o)), this;
109
109
  }, B.prototype.removeListener = function(E, o) {
110
- var k, F, R, G, a;
110
+ var k, F, R, G, H;
111
111
  if (D(o), F = this._events, F === void 0)
112
112
  return this;
113
113
  if (k = F[E], k === void 0)
@@ -117,12 +117,12 @@ function JA() {
117
117
  else if (typeof k != "function") {
118
118
  for (R = -1, G = k.length - 1; G >= 0; G--)
119
119
  if (k[G] === o || k[G].listener === o) {
120
- a = k[G].listener, R = G;
120
+ H = k[G].listener, R = G;
121
121
  break;
122
122
  }
123
123
  if (R < 0)
124
124
  return this;
125
- R === 0 ? k.shift() : Z(k, R), k.length === 1 && (F[E] = k[0]), F.removeListener !== void 0 && this.emit("removeListener", E, a || o);
125
+ R === 0 ? k.shift() : W(k, R), k.length === 1 && (F[E] = k[0]), F.removeListener !== void 0 && this.emit("removeListener", E, H || o);
126
126
  }
127
127
  return this;
128
128
  }, B.prototype.off = B.prototype.removeListener, B.prototype.removeAllListeners = function(E) {
@@ -149,7 +149,7 @@ function JA() {
149
149
  if (k === void 0)
150
150
  return [];
151
151
  var F = k[E];
152
- return F === void 0 ? [] : typeof F == "function" ? o ? [F.listener || F] : [F] : o ? e(F) : H(F, F.length);
152
+ return F === void 0 ? [] : typeof F == "function" ? o ? [F.listener || F] : [F] : o ? e(F) : a(F, F.length);
153
153
  }
154
154
  B.prototype.listeners = function(E) {
155
155
  return Y(this, E, !0);
@@ -172,12 +172,12 @@ function JA() {
172
172
  B.prototype.eventNames = function() {
173
173
  return this._eventsCount > 0 ? g(this._events) : [];
174
174
  };
175
- function H(w, E) {
175
+ function a(w, E) {
176
176
  for (var o = new Array(E), k = 0; k < E; ++k)
177
177
  o[k] = w[k];
178
178
  return o;
179
179
  }
180
- function Z(w, E) {
180
+ function W(w, E) {
181
181
  for (; E + 1 < w.length; E++)
182
182
  w[E] = w[E + 1];
183
183
  w.pop();
@@ -211,10 +211,10 @@ function JA() {
211
211
  else
212
212
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof w);
213
213
  }
214
- return m.exports;
214
+ return P.exports;
215
215
  }
216
- var LA = JA();
217
- const FA = /* @__PURE__ */ UA(LA);
216
+ var LA = UA();
217
+ const FA = /* @__PURE__ */ JA(LA);
218
218
  class $ {
219
219
  __destroy_into_raw() {
220
220
  const A = this.__wbg_ptr;
@@ -302,7 +302,7 @@ function SA() {
302
302
  }
303
303
  }
304
304
  function EA(Q) {
305
- const A = W(Q, M.__wbindgen_malloc, M.__wbindgen_realloc), g = d, I = M.prefetch_urls(A, g);
305
+ const A = z(Q, M.__wbindgen_malloc, M.__wbindgen_realloc), g = d, I = M.prefetch_urls(A, g);
306
306
  var C = GA(I[0], I[1]).slice();
307
307
  return M.__wbindgen_free(I[0], I[1] * 4, 4), C;
308
308
  }
@@ -321,7 +321,7 @@ function hA() {
321
321
  return Number(A);
322
322
  },
323
323
  __wbg_String_8f0eb39a4a4c2f66: function(A, g) {
324
- const I = String(g), C = W(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
324
+ const I = String(g), C = z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
325
325
  S().setInt32(A + 4, B, !0), S().setInt32(A + 0, C, !0);
326
326
  },
327
327
  __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(A, g) {
@@ -333,7 +333,7 @@ function hA() {
333
333
  return x(I) ? 16777215 : I ? 1 : 0;
334
334
  },
335
335
  __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(A, g) {
336
- const I = AA(g), C = W(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
336
+ const I = AA(g), C = z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
337
337
  S().setInt32(A + 4, B, !0), S().setInt32(A + 0, C, !0);
338
338
  },
339
339
  __wbg___wbindgen_function_table_5ae7216dfcbcc506: function() {
@@ -382,7 +382,7 @@ function hA() {
382
382
  },
383
383
  __wbg___wbindgen_string_get_72fb696202c56729: function(A, g) {
384
384
  const I = g, C = typeof I == "string" ? I : void 0;
385
- var B = x(C) ? 0 : W(C, M.__wbindgen_malloc, M.__wbindgen_realloc), i = d;
385
+ var B = x(C) ? 0 : z(C, M.__wbindgen_malloc, M.__wbindgen_realloc), i = d;
386
386
  S().setInt32(A + 4, i, !0), S().setInt32(A + 0, B, !0);
387
387
  },
388
388
  __wbg___wbindgen_throw_be289d5034ed271b: function(A, g) {
@@ -765,7 +765,7 @@ function hA() {
765
765
  return new Uint8Array(A);
766
766
  },
767
767
  __wbg_new_from_slice_a3d2629dc1826784: function(A, g) {
768
- return new Uint8Array(P(A, g));
768
+ return new Uint8Array(X(A, g));
769
769
  },
770
770
  __wbg_new_no_args_1c7c842f08d00ebb: function(A, g) {
771
771
  return new Function(c(A, g));
@@ -822,7 +822,7 @@ function hA() {
822
822
  return A.process;
823
823
  },
824
824
  __wbg_prototypesetcall_bdcdcc5842e4d77d: function(A, g, I) {
825
- Uint8Array.prototype.set.call(P(A, g), I);
825
+ Uint8Array.prototype.set.call(X(A, g), I);
826
826
  },
827
827
  __wbg_push_8ffdcb2063340ba5: function(A, g) {
828
828
  return A.push(g);
@@ -879,7 +879,7 @@ function hA() {
879
879
  }, arguments);
880
880
  },
881
881
  __wbg_set_cc56eefd2dd91957: function(A, g, I) {
882
- A.set(P(g, I));
882
+ A.set(X(g, I));
883
883
  },
884
884
  __wbg_set_f43e577aea94465b: function(A, g, I) {
885
885
  A[g >>> 0] = I;
@@ -900,24 +900,24 @@ function hA() {
900
900
  return A.slice(g >>> 0, I >>> 0);
901
901
  },
902
902
  __wbg_stack_0ed75d68575b0f3c: function(A, g) {
903
- const I = g.stack, C = W(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
903
+ const I = g.stack, C = z(I, M.__wbindgen_malloc, M.__wbindgen_realloc), B = d;
904
904
  S().setInt32(A + 4, B, !0), S().setInt32(A + 0, C, !0);
905
905
  },
906
906
  __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
907
907
  const A = typeof global > "u" ? null : global;
908
- return x(A) ? 0 : O(A);
908
+ return x(A) ? 0 : j(A);
909
909
  },
910
910
  __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
911
911
  const A = typeof globalThis > "u" ? null : globalThis;
912
- return x(A) ? 0 : O(A);
912
+ return x(A) ? 0 : j(A);
913
913
  },
914
914
  __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
915
915
  const A = typeof self > "u" ? null : self;
916
- return x(A) ? 0 : O(A);
916
+ return x(A) ? 0 : j(A);
917
917
  },
918
918
  __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
919
919
  const A = typeof window > "u" ? null : window;
920
- return x(A) ? 0 : O(A);
920
+ return x(A) ? 0 : j(A);
921
921
  },
922
922
  __wbg_store_d1d951c98d9bed41: function() {
923
923
  return y(function(A, g, I) {
@@ -934,7 +934,7 @@ function hA() {
934
934
  return A.then(g);
935
935
  },
936
936
  __wbg_toString_56d946daff83867b: function(A, g, I) {
937
- const C = g.toString(I), B = W(C, M.__wbindgen_malloc, M.__wbindgen_realloc), i = d;
937
+ const C = g.toString(I), B = z(C, M.__wbindgen_malloc, M.__wbindgen_realloc), i = d;
938
938
  S().setInt32(A + 4, i, !0), S().setInt32(A + 0, B, !0);
939
939
  },
940
940
  __wbg_toString_964ff7fe6eca8362: function(A) {
@@ -972,7 +972,7 @@ function hA() {
972
972
  return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, DA);
973
973
  },
974
974
  __wbindgen_cast_0000000000000003: function(A, g) {
975
- return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, aA);
975
+ return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___, HA);
976
976
  },
977
977
  __wbindgen_cast_0000000000000004: function(A, g) {
978
978
  return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______, sA);
@@ -981,7 +981,7 @@ function hA() {
981
981
  return pA(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, cA);
982
982
  },
983
983
  __wbindgen_cast_0000000000000006: function(A, g) {
984
- return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, HA);
984
+ return t(A, g, M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______, aA);
985
985
  },
986
986
  __wbindgen_cast_0000000000000007: function(A) {
987
987
  return A;
@@ -990,7 +990,7 @@ function hA() {
990
990
  return A;
991
991
  },
992
992
  __wbindgen_cast_0000000000000009: function(A, g) {
993
- return P(A, g);
993
+ return X(A, g);
994
994
  },
995
995
  __wbindgen_cast_000000000000000a: function(A, g) {
996
996
  return c(A, g);
@@ -1018,10 +1018,10 @@ function sA(Q, A, g) {
1018
1018
  function cA(Q, A, g) {
1019
1019
  M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(Q, A, g);
1020
1020
  }
1021
- function HA(Q, A, g) {
1021
+ function aA(Q, A, g) {
1022
1022
  M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q, A, g);
1023
1023
  }
1024
- function aA(Q, A, g) {
1024
+ function HA(Q, A, g) {
1025
1025
  const I = M.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(Q, A, g);
1026
1026
  if (I[1])
1027
1027
  throw gA(I[0]);
@@ -1040,7 +1040,7 @@ const wA = typeof FinalizationRegistry > "u" ? { register: () => {
1040
1040
  } } : new FinalizationRegistry((Q) => M.__wbg_dapadapter_free(Q >>> 0, 1)), iA = typeof FinalizationRegistry > "u" ? { register: () => {
1041
1041
  }, unregister: () => {
1042
1042
  } } : new FinalizationRegistry((Q) => M.__wbg_trap_free(Q >>> 0, 1));
1043
- function O(Q) {
1043
+ function j(Q) {
1044
1044
  const A = M.__externref_table_alloc();
1045
1045
  return M.__wbindgen_externrefs.set(A, Q), A;
1046
1046
  }
@@ -1091,12 +1091,12 @@ function GA(Q, A) {
1091
1091
  I.push(M.__wbindgen_externrefs.get(g.getUint32(C, !0)));
1092
1092
  return M.__externref_drop_slice(Q, A), I;
1093
1093
  }
1094
- function P(Q, A) {
1094
+ function X(Q, A) {
1095
1095
  return Q = Q >>> 0, V().subarray(Q / 1, Q / 1 + A);
1096
1096
  }
1097
- let z = null;
1097
+ let Z = null;
1098
1098
  function S() {
1099
- return (z === null || z.buffer.detached === !0 || z.buffer.detached === void 0 && z.buffer !== M.memory.buffer) && (z = new DataView(M.memory.buffer)), z;
1099
+ return (Z === null || Z.buffer.detached === !0 || Z.buffer.detached === void 0 && Z.buffer !== M.memory.buffer) && (Z = new DataView(M.memory.buffer)), Z;
1100
1100
  }
1101
1101
  function c(Q, A) {
1102
1102
  return Q = Q >>> 0, dA(Q, A);
@@ -1109,7 +1109,7 @@ function y(Q, A) {
1109
1109
  try {
1110
1110
  return Q.apply(this, A);
1111
1111
  } catch (g) {
1112
- const I = O(g);
1112
+ const I = j(g);
1113
1113
  M.__wbindgen_exn_store(I);
1114
1114
  }
1115
1115
  }
@@ -1144,7 +1144,7 @@ function t(Q, A, g, I) {
1144
1144
  --C.cnt === 0 && (C.dtor(C.a, C.b), C.a = 0, r.unregister(C));
1145
1145
  }, r.register(B, C, C), B;
1146
1146
  }
1147
- function W(Q, A, g) {
1147
+ function z(Q, A, g) {
1148
1148
  if (g === void 0) {
1149
1149
  const D = l.encode(Q), N = A(D.length, 1) >>> 0;
1150
1150
  return V().subarray(N, N + D.length).set(D), d = D.length, N;
@@ -1184,10 +1184,10 @@ const l = new TextEncoder();
1184
1184
  };
1185
1185
  });
1186
1186
  let d = 0, M;
1187
- function zA(Q, A) {
1188
- return M = Q.exports, z = null, T = null, M.__wbindgen_start(), M;
1187
+ function ZA(Q, A) {
1188
+ return M = Q.exports, Z = null, T = null, M.__wbindgen_start(), M;
1189
1189
  }
1190
- async function WA(Q, A) {
1190
+ async function zA(Q, A) {
1191
1191
  if (typeof Response == "function" && Q instanceof Response) {
1192
1192
  if (typeof WebAssembly.instantiateStreaming == "function")
1193
1193
  try {
@@ -1214,21 +1214,21 @@ async function WA(Q, A) {
1214
1214
  return !1;
1215
1215
  }
1216
1216
  }
1217
- async function ZA(Q) {
1217
+ async function WA(Q) {
1218
1218
  if (M !== void 0) return M;
1219
1219
  Q !== void 0 && (Object.getPrototypeOf(Q) === Object.prototype ? { module_or_path: Q } = Q : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), Q === void 0 && (Q = new URL("", import.meta.url));
1220
1220
  const A = hA();
1221
1221
  (typeof Q == "string" || typeof Request == "function" && Q instanceof Request || typeof URL == "function" && Q instanceof URL) && (Q = fetch(Q));
1222
- const { instance: g, module: I } = await WA(await Q, A);
1223
- return zA(g);
1222
+ const { instance: g, module: I } = await zA(await Q, A);
1223
+ return ZA(g);
1224
1224
  }
1225
- const jA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.0/dist/engine_bg.wasm"), tA = Object.freeze({
1225
+ const OA = new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.1/dist/engine_bg.wasm"), tA = Object.freeze({
1226
1226
  maxObjectBytes: 128 * 1024 * 1024,
1227
1227
  maxEntries: 256,
1228
1228
  maxMetadataBytes: 8 * 1024 * 1024,
1229
1229
  maxEntryMetadataBytes: 1024 * 1024
1230
1230
  });
1231
- class OA {
1231
+ class jA {
1232
1232
  records = /* @__PURE__ */ new Map();
1233
1233
  staged = /* @__PURE__ */ new Map();
1234
1234
  stagingFailed = !1;
@@ -1396,7 +1396,7 @@ function TA(Q) {
1396
1396
  return !1;
1397
1397
  }
1398
1398
  }
1399
- const J = /* @__PURE__ */ Symbol();
1399
+ const U = /* @__PURE__ */ Symbol();
1400
1400
  function L(Q) {
1401
1401
  return Q instanceof Error ? {
1402
1402
  type: "error",
@@ -1423,7 +1423,7 @@ class lA extends FA {
1423
1423
  * These are put under a special symbol so that they cannot be accessed by
1424
1424
  * clients of the library.
1425
1425
  */
1426
- [J];
1426
+ [U];
1427
1427
  dap;
1428
1428
  /**
1429
1429
  * Whether or not debugging is enabled.
@@ -1440,7 +1440,7 @@ class lA extends FA {
1440
1440
  this.dap.setFilterInternals(A);
1441
1441
  }
1442
1442
  constructor() {
1443
- super(), this[J] = {
1443
+ super(), this[U] = {
1444
1444
  attach: this.attach.bind(this),
1445
1445
  detach: this.detach.bind(this),
1446
1446
  beginRun: () => this.dap.resetRun()
@@ -1471,17 +1471,17 @@ function bA(Q, A) {
1471
1471
  throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);
1472
1472
  return g.href;
1473
1473
  }
1474
- function mA(Q) {
1474
+ function PA(Q) {
1475
1475
  return new Worker(
1476
- "" + new URL("assets/worker-BMydG-4n.js", import.meta.url).href,
1476
+ "" + new URL("assets/worker-nLuvLwEg.js", import.meta.url).href,
1477
1477
  {
1478
1478
  type: "module",
1479
1479
  name: Q?.name
1480
1480
  }
1481
1481
  );
1482
1482
  }
1483
- function PA(Q) {
1484
- return new mA(Q ? { name: fA + Q } : void 0);
1483
+ function XA(Q) {
1484
+ return new PA(Q ? { name: fA + Q } : void 0);
1485
1485
  }
1486
1486
  const rA = "/dev/debugger-sh-host";
1487
1487
  class oA {
@@ -1511,7 +1511,7 @@ function NA(Q) {
1511
1511
  return IA(A);
1512
1512
  }
1513
1513
  }
1514
- class XA {
1514
+ class mA {
1515
1515
  constructor(A) {
1516
1516
  this.onFailure = A;
1517
1517
  }
@@ -1630,9 +1630,9 @@ class f {
1630
1630
  if (A.length !== 2) throw new Error("Missing C++ toolchain assets");
1631
1631
  let D, N;
1632
1632
  const K = await Promise.allSettled(
1633
- A.map(async (Z, e) => {
1633
+ A.map(async (W, e) => {
1634
1634
  try {
1635
- const p = await fetch(Z, { cache: "force-cache", signal: I });
1635
+ const p = await fetch(W, { cache: "force-cache", signal: I });
1636
1636
  if (!p.ok) throw new Error(`Cannot load C++ toolchain (${p.status})`);
1637
1637
  return e === 0 && g && typeof WebAssembly.compileStreaming == "function" && typeof p.clone == "function" && (N = WebAssembly.compileStreaming(p.clone()).catch(() => {
1638
1638
  })), new Uint8Array(await p.arrayBuffer());
@@ -1643,19 +1643,19 @@ class f {
1643
1643
  );
1644
1644
  if (K[0].status === "rejected" || K[1].status === "rejected")
1645
1645
  throw D?.error;
1646
- const [U, h] = [K[0].value, K[1].value], [Y, s] = await Promise.allSettled([
1647
- f.ingestOwned(U, h, !1, C),
1646
+ const [J, h] = [K[0].value, K[1].value], [Y, s] = await Promise.allSettled([
1647
+ f.ingestOwned(J, h, !1, C),
1648
1648
  g ? (N ?? Promise.resolve(void 0)).then(
1649
- (Z) => Z ?? WebAssembly.compile(U)
1649
+ (W) => W ?? WebAssembly.compile(J)
1650
1650
  ) : Promise.resolve(void 0)
1651
1651
  ]);
1652
1652
  if (Y.status === "rejected") throw Y.reason;
1653
- const H = Y.value;
1654
- if (H.#A.compilerHash !== i.digests.compiler || H.#A.sysrootHash !== i.digests.sysroot || H.#A.exceptionsHash !== i.digests.exceptions)
1653
+ const a = Y.value;
1654
+ if (a.#A.compilerHash !== i.digests.compiler || a.#A.sysrootHash !== i.digests.sysroot || a.#A.exceptionsHash !== i.digests.exceptions)
1655
1655
  throw new Error("C++ toolchain integrity mismatch");
1656
1656
  if (I?.aborted) throw new DOMException("Toolchain loading aborted", "AbortError");
1657
1657
  if (s.status === "rejected") throw s.reason;
1658
- return H.#A.stockProfile = i.profile === "stock-certified-v1", H.#A.module = s.value, H;
1658
+ return a.#A.stockProfile = i.profile === "stock-certified-v1", a.#A.module = s.value, a;
1659
1659
  }
1660
1660
  /** Captures even Buffer/subclass inputs before the first asynchronous boundary. */
1661
1661
  static async fromBytes(A, g, I) {
@@ -1704,7 +1704,7 @@ async function MA(Q) {
1704
1704
  const A = await crypto.subtle.digest("SHA-256", Q);
1705
1705
  return Array.from(new Uint8Array(A), (g) => g.toString(16).padStart(2, "0")).join("");
1706
1706
  }
1707
- let _, X;
1707
+ let _, m;
1708
1708
  class KA {
1709
1709
  stdout = new kA(1);
1710
1710
  stderr = new kA(2);
@@ -1748,15 +1748,15 @@ class KA {
1748
1748
  cacheValidation;
1749
1749
  static async create(A, g = {}) {
1750
1750
  const { wasmUrl: I, ...C } = g, B = I === void 0 ? void 0 : bA(I, globalThis.location?.href), i = structuredClone(C), D = B ?? null;
1751
- if (X !== void 0 && X !== D)
1751
+ if (m !== void 0 && m !== D)
1752
1752
  throw new Error("The engine Wasm is already loaded from a different wasmUrl");
1753
- X = D, _ ??= ZA({ module_or_path: B ?? jA }).catch((K) => {
1754
- throw _ = void 0, X = void 0, K;
1753
+ m = D, _ ??= WA({ module_or_path: B ?? OA }).catch((K) => {
1754
+ throw _ = void 0, m = void 0, K;
1755
1755
  }), await _;
1756
1756
  const N = new KA(A, i);
1757
1757
  if (N.wasmUrl = B, A !== "c" && typeof window < "u" && typeof fetch < "u")
1758
1758
  for (const K of EA(A))
1759
- fetch(K, { cache: "force-cache" }).then((U) => U.arrayBuffer()).catch(() => {
1759
+ fetch(K, { cache: "force-cache" }).then((J) => J.arrayBuffer()).catch(() => {
1760
1760
  });
1761
1761
  return N;
1762
1762
  }
@@ -1774,7 +1774,7 @@ class KA {
1774
1774
  throw new TypeError("Invalid compiler lifetime");
1775
1775
  yA(I.toolchainProfile), this.scope = Object.freeze({ ...I.scope }), this.options = Object.freeze({ ...I, scope: this.scope, idleTimeoutMs: C });
1776
1776
  }
1777
- this.objects = new OA(typeof I?.objectCache == "object" ? I.objectCache : {}), this.debugger = new lA(), this.lang = A;
1777
+ this.objects = new jA(typeof I?.objectCache == "object" ? I.objectCache : {}), this.debugger = new lA(), this.lang = A;
1778
1778
  }
1779
1779
  /** A retained worker reuses clang, compiled once on this thread and cloned to it. */
1780
1780
  get cacheCompilerModule() {
@@ -1890,9 +1890,9 @@ class KA {
1890
1890
  B = {
1891
1891
  fs: C ? {} : structuredClone(this.fs),
1892
1892
  binary_files: Object.fromEntries(
1893
- Object.entries(C ? {} : this.binaryFiles).map(([s, H]) => [
1893
+ Object.entries(C ? {} : this.binaryFiles).map(([s, a]) => [
1894
1894
  s,
1895
- new Uint8Array(H)
1895
+ new Uint8Array(a)
1896
1896
  ])
1897
1897
  ),
1898
1898
  cpp_artifacts: structuredClone(Y)
@@ -1903,13 +1903,13 @@ class KA {
1903
1903
  const i = !A && this.debugger.enabled, D = A ? void 0 : this.hostDevice;
1904
1904
  if (D !== void 0 && (typeof D != "function" || !["c", "python"].includes(this.lang)))
1905
1905
  return Promise.resolve(L(new TypeError("Invalid host device configuration")));
1906
- clearTimeout(this.idleTimer), this.stdin[J].clear();
1906
+ clearTimeout(this.idleTimer), this.stdin[U].clear();
1907
1907
  const N = !!this.slot;
1908
1908
  let K;
1909
- const U = new Promise((Y) => {
1909
+ const J = new Promise((Y) => {
1910
1910
  K = Y;
1911
1911
  });
1912
- this.promise = U;
1912
+ this.promise = J;
1913
1913
  const h = {
1914
1914
  generation: this.generation,
1915
1915
  scopeEpoch: this.scopeEpoch,
@@ -1938,7 +1938,7 @@ class KA {
1938
1938
  cache_epoch: this.generation,
1939
1939
  is_debug: i,
1940
1940
  build_only: A,
1941
- stdin_buffer: this.stdin[J].buffer,
1941
+ stdin_buffer: this.stdin[U].buffer,
1942
1942
  cpp_cache: this.options?.objectCache && !i && !g ? {
1943
1943
  generation: this.generation,
1944
1944
  entries: this.objects.snapshot(),
@@ -1952,7 +1952,7 @@ class KA {
1952
1952
  };
1953
1953
  this.objects.beginBatch(), this.active = h;
1954
1954
  try {
1955
- if (this.slot || this.makeWorker(), !this.current(h)) return U;
1955
+ if (this.slot || this.makeWorker(), !this.current(h)) return J;
1956
1956
  const Y = this.slot;
1957
1957
  this.lang === "c" && !this.toolchain && this.ensureToolchain().catch((s) => {
1958
1958
  this.current(h) && this.slot === Y && this.finish(h, L(s));
@@ -1960,13 +1960,13 @@ class KA {
1960
1960
  } catch (Y) {
1961
1961
  this.finish(h, L(Y));
1962
1962
  }
1963
- return U;
1963
+ return J;
1964
1964
  }
1965
1965
  current(A) {
1966
1966
  return this.active === A && !A.settled;
1967
1967
  }
1968
1968
  makeWorker() {
1969
- const A = PA(this.wasmUrl), g = { worker: A, ready: !1, remove: () => {
1969
+ const A = XA(this.wasmUrl), g = { worker: A, ready: !1, remove: () => {
1970
1970
  } };
1971
1971
  this.slot = g;
1972
1972
  const I = (i) => {
@@ -1987,13 +1987,13 @@ class KA {
1987
1987
  if (D.type === "cpp_cache_eligibility") {
1988
1988
  if (this.options?.toolchainProfile !== "stock-certified-v1" || N.prepareOnly && !N.validateCacheInputs)
1989
1989
  return;
1990
- const K = (h) => typeof h == "string" && /^[0-9a-f]{64}$/.test(h), U = D.eligible === !0 && K(D.certificate_sha256) && K(D.snapshot);
1990
+ const K = (h) => typeof h == "string" && /^[0-9a-f]{64}$/.test(h), J = D.eligible === !0 && K(D.certificate_sha256) && K(D.snapshot);
1991
1991
  this.cacheValidation = {
1992
- eligible: U,
1992
+ eligible: J,
1993
1993
  certificate: K(D.certificate_sha256) ? D.certificate_sha256 : void 0,
1994
- snapshot: U ? D.snapshot : void 0,
1994
+ snapshot: J ? D.snapshot : void 0,
1995
1995
  operationId: N.operationId,
1996
- reason: U ? void 0 : typeof D.reason == "string" ? D.reason.slice(0, 128) : "stock-input-validation"
1996
+ reason: J ? void 0 : typeof D.reason == "string" ? D.reason.slice(0, 128) : "stock-input-validation"
1997
1997
  };
1998
1998
  } else if (D.type === "stop")
1999
1999
  this.finish(N, {
@@ -2021,8 +2021,8 @@ class KA {
2021
2021
  }, C = (i) => {
2022
2022
  this.slot === g && (this.clearCaches(), this.active ? this.finish(this.active, L(i.error ?? new Error(i.message))) : this.retireWorker());
2023
2023
  }, B = () => C({ message: "Unreadable execution worker message" });
2024
- this.debugger[J].attach(A), A.addEventListener("message", I), A.addEventListener("error", C), A.addEventListener("messageerror", B), g.remove = () => {
2025
- A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[J].detach(A);
2024
+ this.debugger[U].attach(A), A.addEventListener("message", I), A.addEventListener("error", C), A.addEventListener("messageerror", B), g.remove = () => {
2025
+ A.removeEventListener("message", I), A.removeEventListener("error", C), A.removeEventListener("messageerror", B), this.debugger[U].detach(A);
2026
2026
  };
2027
2027
  }
2028
2028
  async publishObjects(A, g) {
@@ -2100,8 +2100,8 @@ class KA {
2100
2100
  const I = g.worker;
2101
2101
  A.stats.workerReadyMs = performance.now() - A.startedAt;
2102
2102
  const C = (B) => this.current(A) && B.scopeEpoch === A.scopeEpoch && B.operationId === A.operationId;
2103
- if (this.stdout[J].attach(I, C), this.stderr[J].attach(I, C), A.prepareOnly || this.debugger[J].beginRun(), A.opener) {
2104
- if (A.device = new XA((B) => this.finish(A, L(B))), A.device.attach(I), A.device.open(A.opener), !this.current(A)) return;
2103
+ if (this.stdout[U].attach(I, C), this.stderr[U].attach(I, C), A.prepareOnly || this.debugger[U].beginRun(), A.opener) {
2104
+ if (A.device = new mA((B) => this.finish(A, L(B))), A.device.attach(I), A.device.open(A.opener), !this.current(A)) return;
2105
2105
  A.start.host_device = A.device.workerStart;
2106
2106
  }
2107
2107
  this.current(A) && (I.postMessage(A.start), A.start.fs = {}, A.start.binary_files = {}, A.start.cpp_artifacts = null, A.start.cpp_cache = null);
@@ -2113,7 +2113,7 @@ class KA {
2113
2113
  if (!this.current(A)) return;
2114
2114
  (g.type !== "completed" || g.exitCode !== 0) && (this.cacheValidation = void 0), A.settled = !0;
2115
2115
  const I = this.slot?.worker;
2116
- I && (this.stdout[J].detach(I), this.stderr[J].detach(I));
2116
+ I && (this.stdout[U].detach(I), this.stderr[U].detach(I));
2117
2117
  const C = A.device?.close();
2118
2118
  C && (g = L(C));
2119
2119
  const B = g.type === "completed" && A.generation === this.generation && !this.disposed, i = B && g.type === "completed" && g.exitCode === 0;
@@ -2121,14 +2121,14 @@ class KA {
2121
2121
  for (const D of A.stats.cache?.invalid_sources ?? []) this.objects.delete(D);
2122
2122
  if (i)
2123
2123
  for (const D of A.stats.cache?.hit_sources ?? []) this.objects.touch(D);
2124
- this.objects.discardBatch(), this.latest = A.stats, this.stdin[J].clear(), (!B || !this.retain) && this.retireWorker(), !this.disposed && A.cacheEpoch === this.generation && (this.slot || this.toolchain && this.cacheCompilerModule) && this.options?.compilerLifetime !== "project" && (this.idleTimer = setTimeout(() => {
2124
+ this.objects.discardBatch(), this.latest = A.stats, this.stdin[U].clear(), (!B || !this.retain) && this.retireWorker(), !this.disposed && A.cacheEpoch === this.generation && (this.slot || this.toolchain && this.cacheCompilerModule) && this.options?.compilerLifetime !== "project" && (this.idleTimer = setTimeout(() => {
2125
2125
  this.retireWorker(), this.toolchain = void 0, this.toolchainLoading = void 0;
2126
2126
  }, this.idleTimeoutMs)), !this.retain && !this.cacheCompilerModule && (this.toolchain = void 0), A.cacheEpoch !== this.generation && (this.toolchainController?.abort(), this.toolchainLoading = void 0), this.active = void 0, this.promise = void 0, this.flushReleases(), A.resolve(g);
2127
2127
  }
2128
2128
  retireWorker() {
2129
2129
  clearTimeout(this.idleTimer);
2130
2130
  const A = this.slot;
2131
- A && (this.slot = void 0, A.remove(), this.stdout[J].detach(A.worker), this.stderr[J].detach(A.worker), A.worker.onerror = (g) => g.preventDefault(), A.worker.terminate(), this.retirements++);
2131
+ A && (this.slot = void 0, A.remove(), this.stdout[U].detach(A.worker), this.stderr[U].detach(A.worker), A.worker.onerror = (g) => g.preventDefault(), A.worker.terminate(), this.retirements++);
2132
2132
  }
2133
2133
  }
2134
2134
  class kA extends FA {
@@ -2138,14 +2138,14 @@ class kA extends FA {
2138
2138
  if (this.accepts && !this.accepts(I) || I.type !== "stdout" || I.mode !== this.mode) return;
2139
2139
  const C = I.data;
2140
2140
  this.emit("data", C);
2141
- }).bind(this), this[J] = {
2141
+ }).bind(this), this[U] = {
2142
2142
  attach: this.attach.bind(this),
2143
2143
  detach: this.detach.bind(this)
2144
2144
  };
2145
2145
  }
2146
2146
  callback;
2147
2147
  accepts;
2148
- [J];
2148
+ [U];
2149
2149
  attach(A, g) {
2150
2150
  this.accepts = g, A.addEventListener("message", this.callback);
2151
2151
  }
@@ -2171,11 +2171,11 @@ class q {
2171
2171
  generation = 0;
2172
2172
  indices;
2173
2173
  data;
2174
- [J];
2174
+ [U];
2175
2175
  constructor() {
2176
2176
  this.indices = new Int32Array(this.buffer, 0, 2), this.data = new Int8Array(this.buffer, q.HEADER_SIZE);
2177
2177
  const A = () => this.buffer;
2178
- this[J] = {
2178
+ this[U] = {
2179
2179
  clear: this.clear.bind(this),
2180
2180
  get buffer() {
2181
2181
  return A();
@@ -2202,8 +2202,8 @@ class q {
2202
2202
  await Atomics.waitAsync(this.indices, I, D).value;
2203
2203
  continue;
2204
2204
  }
2205
- const U = Math.min(A.length - B, K);
2206
- this.data.set(A.subarray(B, B + U), N), Atomics.store(this.indices, C, (N + U) % g), Atomics.notify(this.indices, C), B += U;
2205
+ const J = Math.min(A.length - B, K);
2206
+ this.data.set(A.subarray(B, B + J), N), Atomics.store(this.indices, C, (N + J) % g), Atomics.notify(this.indices, C), B += J;
2207
2207
  }
2208
2208
  }
2209
2209
  }
@@ -1,2 +1,2 @@
1
- (function(a,W){typeof exports=="object"&&typeof module<"u"?W(exports):typeof define=="function"&&define.amd?define(["exports"],W):(a=typeof globalThis<"u"?globalThis:a||self,W(a.engine={}))})(this,(function(a){"use strict";var W=typeof document<"u"?document.currentScript:null;function LA(Q){return Q&&Q.__esModule&&Object.prototype.hasOwnProperty.call(Q,"default")?Q.default:Q}var X={exports:{}},DA;function SA(){if(DA)return X.exports;DA=1;var Q=typeof Reflect=="object"?Reflect:null,A=Q&&typeof Q.apply=="function"?Q.apply:function(E,o,k){return Function.prototype.apply.call(E,o,k)},g;Q&&typeof Q.ownKeys=="function"?g=Q.ownKeys:Object.getOwnPropertySymbols?g=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:g=function(E){return Object.getOwnPropertyNames(E)};function I(w){console&&console.warn&&console.warn(w)}var C=Number.isNaN||function(E){return E!==E};function B(){B.init.call(this)}X.exports=B,X.exports.once=d,B.EventEmitter=B,B.prototype._events=void 0,B.prototype._eventsCount=0,B.prototype._maxListeners=void 0;var i=10;function D(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(B,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(w){if(typeof w!="number"||w<0||C(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");i=w}}),B.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},B.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||C(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function N(w){return w._maxListeners===void 0?B.defaultMaxListeners:w._maxListeners}B.prototype.getMaxListeners=function(){return N(this)},B.prototype.emit=function(E){for(var o=[],k=1;k<arguments.length;k++)o.push(arguments[k]);var F=E==="error",R=this._events;if(R!==void 0)F=F&&R.error===void 0;else if(!F)return!1;if(F){var G;if(o.length>0&&(G=o[0]),G instanceof Error)throw G;var p=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw p.context=G,p}var P=R[E];if(P===void 0)return!1;if(typeof P=="function")A(P,this,o);else for(var JA=P.length,eA=q(P,JA),k=0;k<JA;++k)A(eA[k],this,o);return!0};function K(w,E,o,k){var F,R,G;if(D(o),R=w._events,R===void 0?(R=w._events=Object.create(null),w._eventsCount=0):(R.newListener!==void 0&&(w.emit("newListener",E,o.listener?o.listener:o),R=w._events),G=R[E]),G===void 0)G=R[E]=o,++w._eventsCount;else if(typeof G=="function"?G=R[E]=k?[o,G]:[G,o]:k?G.unshift(o):G.push(o),F=N(w),F>0&&G.length>F&&!G.warned){G.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=w,p.type=E,p.count=G.length,I(p)}return w}B.prototype.addListener=function(E,o){return K(this,E,o,!1)},B.prototype.on=B.prototype.addListener,B.prototype.prependListener=function(E,o){return K(this,E,o,!0)};function J(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,E,o){var k={fired:!1,wrapFn:void 0,target:w,type:E,listener:o},F=J.bind(k);return F.listener=o,k.wrapFn=F,F}B.prototype.once=function(E,o){return D(o),this.on(E,h(this,E,o)),this},B.prototype.prependOnceListener=function(E,o){return D(o),this.prependListener(E,h(this,E,o)),this},B.prototype.removeListener=function(E,o){var k,F,R,G,p;if(D(o),F=this._events,F===void 0)return this;if(k=F[E],k===void 0)return this;if(k===o||k.listener===o)--this._eventsCount===0?this._events=Object.create(null):(delete F[E],F.removeListener&&this.emit("removeListener",E,k.listener||o));else if(typeof k!="function"){for(R=-1,G=k.length-1;G>=0;G--)if(k[G]===o||k[G].listener===o){p=k[G].listener,R=G;break}if(R<0)return this;R===0?k.shift():m(k,R),k.length===1&&(F[E]=k[0]),F.removeListener!==void 0&&this.emit("removeListener",E,p||o)}return this},B.prototype.off=B.prototype.removeListener,B.prototype.removeAllListeners=function(E){var o,k,F;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[E]),this;if(arguments.length===0){var R=Object.keys(k),G;for(F=0;F<R.length;++F)G=R[F],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(o=k[E],typeof o=="function")this.removeListener(E,o);else if(o!==void 0)for(F=o.length-1;F>=0;F--)this.removeListener(E,o[F]);return this};function Y(w,E,o){var k=w._events;if(k===void 0)return[];var F=k[E];return F===void 0?[]:typeof F=="function"?o?[F.listener||F]:[F]:o?EA(F):q(F,F.length)}B.prototype.listeners=function(E){return Y(this,E,!0)},B.prototype.rawListeners=function(E){return Y(this,E,!1)},B.listenerCount=function(w,E){return typeof w.listenerCount=="function"?w.listenerCount(E):s.call(w,E)},B.prototype.listenerCount=s;function s(w){var E=this._events;if(E!==void 0){var o=E[w];if(typeof o=="function")return 1;if(o!==void 0)return o.length}return 0}B.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]};function q(w,E){for(var o=new Array(E),k=0;k<E;++k)o[k]=w[k];return o}function m(w,E){for(;E+1<w.length;E++)w[E]=w[E+1];w.pop()}function EA(w){for(var E=new Array(w.length),o=0;o<E.length;++o)E[o]=w[o].listener||w[o];return E}function d(w,E){return new Promise(function(o,k){function F(G){w.removeListener(E,R),k(G)}function R(){typeof w.removeListener=="function"&&w.removeListener("error",F),o([].slice.call(arguments))}UA(w,E,R,{once:!0}),E!=="error"&&uA(w,F,{once:!0})})}function uA(w,E,o){typeof w.on=="function"&&UA(w,"error",E,o)}function UA(w,E,o,k){if(typeof w.on=="function")k.once?w.once(E,o):w.on(E,o);else if(typeof w.addEventListener=="function")w.addEventListener(E,function F(R){k.once&&w.removeEventListener(E,F),o(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return X.exports}var hA=SA();const wA=LA(hA);class _{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,NA.unregister(this),A}free(){const A=this.__destroy_into_raw();M.__wbg_dapadapter_free(A,0)}attach(A){M.dapadapter_attach(this.__wbg_ptr,A)}detach(){M.dapadapter_detach(this.__wbg_ptr)}constructor(){const A=M.dapadapter_new();return this.__wbg_ptr=A>>>0,NA.register(this,this.__wbg_ptr,this),this}on(A){M.dapadapter_on(this.__wbg_ptr,A)}resetRun(){M.dapadapter_resetRun(this.__wbg_ptr)}sendMessage(A){return M.dapadapter_sendMessage(this.__wbg_ptr,A)}setFilterInternals(A){M.dapadapter_setFilterInternals(this.__wbg_ptr,A)}}Symbol.dispose&&(_.prototype[Symbol.dispose]=_.prototype.free);class t{static __wrap(A){A=A>>>0;const g=Object.create(t.prototype);return g.__wbg_ptr=A,MA.register(g,g.__wbg_ptr,g),g}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,MA.unregister(this),A}free(){const A=this.__destroy_into_raw();M.__wbg_trap_free(A,0)}static __wbg_wasmer_trap(){M.trap___wbg_wasmer_trap()}}Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);function sA(){let Q,A;try{const g=M.cpp_exception_hash();return Q=g[0],A=g[1],c(g[0],g[1])}finally{M.__wbindgen_free(Q,A,1)}}function iA(Q){const A=j(Q,M.__wbindgen_malloc,M.__wbindgen_realloc),g=z,I=M.prefetch_urls(A,g);var C=kA(I[0],I[1]).slice();return M.__wbindgen_free(I[0],I[1]*4,4),C}function cA(){return{__proto__:null,"./engine_bg.js":{__proto__:null,__wbg_BigInt_b7bbccdff258c9f2:function(A){return BigInt(A)},__wbg_Error_8c4e43fe74559d73:function(A,g){return Error(c(A,g))},__wbg_Number_04624de7d0e8332d:function(A){return Number(A)},__wbg_String_8f0eb39a4a4c2f66:function(A,g){const I=String(g),C=j(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2:function(A,g){const I=g,C=typeof I=="bigint"?I:void 0;L().setBigInt64(A+8,x(C)?BigInt(0):C,!0),L().setInt32(A+0,!x(C),!0)},__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:function(A){const g=A,I=typeof g=="boolean"?g:void 0;return x(I)?16777215:I?1:0},__wbg___wbindgen_debug_string_0bc8482c6e3508ae:function(A,g){const I=$(g),C=j(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg___wbindgen_function_table_5ae7216dfcbcc506:function(){return M.__wbindgen_export},__wbg___wbindgen_in_47fa6863be6f2f25:function(A,g){return A in g},__wbg___wbindgen_is_bigint_31b12575b56f32fc:function(A){return typeof A=="bigint"},__wbg___wbindgen_is_function_0095a73b8b156f76:function(A){return typeof A=="function"},__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:function(A){const g=A;return typeof g=="object"&&g!==null},__wbg___wbindgen_is_string_cd444516edc5b180:function(A){return typeof A=="string"},__wbg___wbindgen_is_undefined_9e4d92534c42d778:function(A){return A===void 0},__wbg___wbindgen_jsval_eq_11888390b0186270:function(A,g){return A===g},__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:function(A,g){return A==g},__wbg___wbindgen_lt_bb59cc3d23526e0d:function(A,g){return A<g},__wbg___wbindgen_neg_6b4d356dff49dcc6:function(A){return-A},__wbg___wbindgen_number_get_8ff4255516ccad3e:function(A,g){const I=g,C=typeof I=="number"?I:void 0;L().setFloat64(A+8,x(C)?0:C,!0),L().setInt32(A+0,!x(C),!0)},__wbg___wbindgen_rethrow_05525c567f154472:function(A){throw A},__wbg___wbindgen_shr_ef8e07cce709eb54:function(A,g){return A>>g},__wbg___wbindgen_string_get_72fb696202c56729:function(A,g){const I=g,C=typeof I=="string"?I:void 0;var B=x(C)?0:j(C,M.__wbindgen_malloc,M.__wbindgen_realloc),i=z;L().setInt32(A+4,i,!0),L().setInt32(A+0,B,!0)},__wbg___wbindgen_throw_be289d5034ed271b:function(A,g){throw new Error(c(A,g))},__wbg__wbg_cb_unref_d9b87ff7982e3b21:function(A){A._wbg_cb_unref()},__wbg_addEventListener_3acb0aad4483804c:function(){return y(function(A,g,I,C){A.addEventListener(c(g,I),C)},arguments)},__wbg_apply_2e22c45cb4f12415:function(){return y(function(A,g,I){return Reflect.apply(A,g,I)},arguments)},__wbg_apply_ada2ee1a60ac7b3c:function(){return y(function(A,g,I){return A.apply(g,I)},arguments)},__wbg_arrayBuffer_bb54076166006c39:function(){return y(function(A){return A.arrayBuffer()},arguments)},__wbg_bind_1dc37de2b9939128:function(A,g,I,C){return A.bind(g,I,C)},__wbg_bind_29ba380591735d8c:function(A,g,I){return A.bind(g,I)},__wbg_buffer_7b5f53e46557d8f1:function(A){return A.buffer},__wbg_byteLength_7b03c17ff1e4037f:function(A){return A.byteLength},__wbg_byteLength_b5d783d06792ed2c:function(A){return A.byteLength},__wbg_call_389efe28435a9388:function(){return y(function(A,g){return A.call(g)},arguments)},__wbg_call_4708e0c13bdc8e95:function(){return y(function(A,g,I){return A.call(g,I)},arguments)},__wbg_compareExchange_b578410c358e695e:function(){return y(function(A,g,I,C){return Atomics.compareExchange(A,g>>>0,I,C)},arguments)},__wbg_constructor_ad6c0ed428f55d34:function(A){return A.constructor},__wbg_crypto_86f2631e91b51511:function(A){return A.crypto},__wbg_customSections_193491b069139fb1:function(A,g,I){return WebAssembly.Module.customSections(A,c(g,I))},__wbg_data_5330da50312d0bc1:function(A){return A.data},__wbg_done_57b39ecd9addfe81:function(A){return A.done},__wbg_entries_58c7934c745daac7:function(A){return Object.entries(A)},__wbg_error_7534b8e9a36f1ab4:function(A,g){let I,C;try{I=A,C=g,console.error(c(A,g))}finally{M.__wbindgen_free(I,C,1)}},__wbg_exports_794a42000dacd046:function(A){return WebAssembly.Module.exports(A)},__wbg_exports_86b4926134c40288:function(A){return A.exports},__wbg_fetch_d1488f40cef1e210:function(A,g,I){return A.fetch(c(g,I))},__wbg_from_bddd64e7d5ff6941:function(A){return Array.from(A)},__wbg_getPrototypeOf_2653517f1dc884d5:function(){return y(function(A){return Reflect.getPrototypeOf(A)},arguments)},__wbg_getRandomValues_b3f15fcbfabb0f8b:function(){return y(function(A,g){A.getRandomValues(g)},arguments)},__wbg_getTime_1e3cd1391c5c3995:function(A){return A.getTime()},__wbg_getTimezoneOffset_81776d10a4ec18a8:function(A){return A.getTimezoneOffset()},__wbg_getUint32_bb6f5a401408e7fa:function(A,g,I){return A.getUint32(g>>>0,I!==0)},__wbg_get_7efbcc3819719b0f:function(){return y(function(A,g){return A.get(g>>>0)},arguments)},__wbg_get_9b94d73e6221f75c:function(A,g){return A[g>>>0]},__wbg_get_b3ed3ad4be2bc8ac:function(){return y(function(A,g){return Reflect.get(A,g)},arguments)},__wbg_get_index_253dd2a9e007656d:function(A,g){return A[g>>>0]},__wbg_get_index_9a5bfdd2ca49c65f:function(A,g){return A[g>>>0]},__wbg_get_with_ref_key_1dc361bd10053bfe:function(A,g){return A[g]},__wbg_grow_5d42bf28c2da22cb:function(){return y(function(A,g){return A.grow(g>>>0)},arguments)},__wbg_grow_d034989fce14cc8e:function(){return y(function(A,g){return A.grow(g>>>0)},arguments)},__wbg_imports_8333d40ab24779ad:function(A){return WebAssembly.Module.imports(A)},__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:function(A){let g;try{g=A instanceof ArrayBuffer}catch{g=!1}return g},__wbg_instanceof_Error_8573fe0b0b480f46:function(A){let g;try{g=A instanceof Error}catch{g=!1}return g},__wbg_instanceof_Function_2a29eec978bb3b11:function(A){let g;try{g=A instanceof Function}catch{g=!1}return g},__wbg_instanceof_Global_2db767b6b2347f01:function(A){let g;try{g=A instanceof WebAssembly.Global}catch{g=!1}return g},__wbg_instanceof_Map_53af74335dec57f4:function(A){let g;try{g=A instanceof Map}catch{g=!1}return g},__wbg_instanceof_Memory_dc8c61e3f831ee37:function(A){let g;try{g=A instanceof WebAssembly.Memory}catch{g=!1}return g},__wbg_instanceof_Module_d0d412b14363ba9a:function(A){let g;try{g=A instanceof WebAssembly.Module}catch{g=!1}return g},__wbg_instanceof_Object_1c6af87502b733ed:function(A){let g;try{g=A instanceof Object}catch{g=!1}return g},__wbg_instanceof_RangeError_0b0dd056bc557b89:function(A){let g;try{g=A instanceof RangeError}catch{g=!1}return g},__wbg_instanceof_Response_ee1d54d79ae41977:function(A){let g;try{g=A instanceof Response}catch{g=!1}return g},__wbg_instanceof_SharedArrayBuffer_91d8a2fa16a2cc26:function(A){let g;try{g=A instanceof SharedArrayBuffer}catch{g=!1}return g},__wbg_instanceof_Table_127f216e592f4159:function(A){let g;try{g=A instanceof WebAssembly.Table}catch{g=!1}return g},__wbg_instanceof_Tag_f1d6b24a98b95210:function(A){let g;try{g=A instanceof WebAssembly.Tag}catch{g=!1}return g},__wbg_instanceof_Uint8Array_9b9075935c74707c:function(A){let g;try{g=A instanceof Uint8Array}catch{g=!1}return g},__wbg_isArray_d314bb98fcf08331:function(A){return Array.isArray(A)},__wbg_isSafeInteger_bfbc7332a9768d2a:function(A){return Number.isSafeInteger(A)},__wbg_is_f29129f676e5410c:function(A,g){return Object.is(A,g)},__wbg_iterator_6ff6560ca1568e55:function(){return Symbol.iterator},__wbg_length_32ed9a279acd054c:function(A){return A.length},__wbg_length_35a7bace40f36eac:function(A){return A.length},__wbg_length_aeb94ff17a8a8556:function(A){return A.length},__wbg_load_eff64ff5e429a422:function(){return y(function(A,g){return Atomics.load(A,g>>>0)},arguments)},__wbg_message_9ddc4b9a62a7c379:function(A){return A.message},__wbg_msCrypto_d562bbe83e0d4b91:function(A){return A.msCrypto},__wbg_new_0728bd2d4c5d41dd:function(){return y(function(A){return new WebAssembly.Tag(A)},arguments)},__wbg_new_0_73afc35eb544e539:function(){return new Date},__wbg_new_245cd5c49157e602:function(A){return new Date(A)},__wbg_new_2ac7fa8be584d280:function(A,g,I){return new DataView(A,g>>>0,I>>>0)},__wbg_new_361308b2356cecd0:function(){return new Object},__wbg_new_3eb36ae241fe6f44:function(){return new Array},__wbg_new_4a996a46a82782b6:function(){return y(function(A,g){return new WebAssembly.Global(A,g)},arguments)},__wbg_new_57c27ff3ddf5b62c:function(){return y(function(A){return new WebAssembly.Module(A)},arguments)},__wbg_new_67274f72d5abea37:function(){return y(function(A){return new WebAssembly.Table(A)},arguments)},__wbg_new_8a6f238a6ece86ea:function(){return new Error},__wbg_new_a4e3cab1cdd635ba:function(){return y(function(A,g){return new WebAssembly.Instance(A,g)},arguments)},__wbg_new_b061c0550d9f3281:function(){return y(function(A){return new WebAssembly.Memory(A)},arguments)},__wbg_new_b5d9e2fb389fef91:function(A,g){try{var I={a:A,b:g},C=(i,D)=>{const N=I.a;I.a=0;try{return xA(N,I.b,i,D)}finally{I.a=N}};return new Promise(C)}finally{I.a=I.b=0}},__wbg_new_ca409f861989e0c5:function(A){return new SharedArrayBuffer(A>>>0)},__wbg_new_dca287b076112a51:function(){return new Map},__wbg_new_dd2b680c8bf6ae29:function(A){return new Uint8Array(A)},__wbg_new_from_slice_a3d2629dc1826784:function(A,g){return new Uint8Array(r(A,g))},__wbg_new_no_args_1c7c842f08d00ebb:function(A,g){return new Function(c(A,g))},__wbg_new_with_args_7bba34e94b1cfa40:function(A,g,I,C){return new Function(c(A,g),c(I,C))},__wbg_new_with_byte_offset_9120ba79e057895b:function(A,g){return new Uint8Array(A,g>>>0)},__wbg_new_with_byte_offset_and_length_aa261d9c9da49eb1:function(A,g,I){return new Uint8Array(A,g>>>0,I>>>0)},__wbg_new_with_byte_offset_and_length_bc2e7b72cc96d1c1:function(A,g,I){return new Int32Array(A,g>>>0,I>>>0)},__wbg_new_with_length_1763c527b2923202:function(A){return new Array(A>>>0)},__wbg_new_with_length_a2c39cbe88fd8ff1:function(A){return new Uint8Array(A>>>0)},__wbg_next_3482f54c49e8af19:function(){return y(function(A){return A.next()},arguments)},__wbg_next_418f80d8f5303233:function(A){return A.next},__wbg_node_e1f24f89a7336c2e:function(A){return A.node},__wbg_notify_78a90977fab74963:function(){return y(function(A,g){return Atomics.notify(A,g>>>0)},arguments)},__wbg_now_a3af9a2f4bbaa4d1:function(){return Date.now()},__wbg_now_ebffdf7e580f210d:function(A){return A.now()},__wbg_ok_87f537440a0acf85:function(A){return A.ok},__wbg_postMessage_2041f4e90af61318:function(){return y(function(A,g){A.postMessage(g)},arguments)},__wbg_process_3975fd6c72f520aa:function(A){return A.process},__wbg_prototypesetcall_bdcdcc5842e4d77d:function(A,g,I){Uint8Array.prototype.set.call(r(A,g),I)},__wbg_push_8ffdcb2063340ba5:function(A,g){return A.push(g)},__wbg_queueMicrotask_0aa0a927f78f5d98:function(A){return A.queueMicrotask},__wbg_queueMicrotask_5bb536982f78a56f:function(A){queueMicrotask(A)},__wbg_randomFillSync_f8c153b79f285817:function(){return y(function(A,g){A.randomFillSync(g)},arguments)},__wbg_removeEventListener_e63328781a5b9af9:function(){return y(function(A,g,I,C){A.removeEventListener(c(g,I),C)},arguments)},__wbg_require_b74f47fc2d022fd6:function(){return y(function(){return module.require},arguments)},__wbg_resolve_002c4b7d9d8f6b64:function(A){return Promise.resolve(A)},__wbg_setTimeout_e0aacd5a637418a6:function(){return y(function(A,g,I){return A.setTimeout(g,I)},arguments)},__wbg_setUint32_d168af7751a8557e:function(A,g,I,C){A.setUint32(g>>>0,I>>>0,C!==0)},__wbg_set_0af2522656c2a71b:function(){return y(function(A,g,I){A.set(g>>>0,I)},arguments)},__wbg_set_1eb0999cf5d27fc8:function(A,g,I){return A.set(g,I)},__wbg_set_25cf9deff6bf0ea8:function(A,g,I){A.set(g,I>>>0)},__wbg_set_3f1d0b984ed272ed:function(A,g,I){A[g]=I},__wbg_set_6cb8631f80447a67:function(){return y(function(A,g,I){return Reflect.set(A,g,I)},arguments)},__wbg_set_cc56eefd2dd91957:function(A,g,I){A.set(r(g,I))},__wbg_set_f43e577aea94465b:function(A,g,I){A[g>>>0]=I},__wbg_set_index_b3244a6c458021e4:function(A,g,I){A[g>>>0]=I},__wbg_set_index_f259b54e97f7b177:function(A,g,I){A[g>>>0]=I},__wbg_set_onmessage_ea7cc2ba099021cd:function(A,g){A.onmessage=g},__wbg_set_value_fc06e541de098215:function(A,g){A.value=g},__wbg_slice_8bbd46adb2100583:function(A,g,I){return A.slice(g>>>0,I>>>0)},__wbg_stack_0ed75d68575b0f3c:function(A,g){const I=g.stack,C=j(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg_static_accessor_GLOBAL_12837167ad935116:function(){const A=typeof global>"u"?null:global;return x(A)?0:O(A)},__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f:function(){const A=typeof globalThis>"u"?null:globalThis;return x(A)?0:O(A)},__wbg_static_accessor_SELF_a621d3dfbb60d0ce:function(){const A=typeof self>"u"?null:self;return x(A)?0:O(A)},__wbg_static_accessor_WINDOW_f8727f0cf888e0bd:function(){const A=typeof window>"u"?null:window;return x(A)?0:O(A)},__wbg_store_d1d951c98d9bed41:function(){return y(function(A,g,I){return Atomics.store(A,g>>>0,I)},arguments)},__wbg_subarray_a96e1fef17ed23cb:function(A,g,I){return A.subarray(g>>>0,I>>>0)},__wbg_then_0d9fe2c7b1857d32:function(A,g,I){return A.then(g,I)},__wbg_then_b9e7b3b5f1a9e1b5:function(A,g){return A.then(g)},__wbg_toString_56d946daff83867b:function(A,g,I){const C=g.toString(I),B=j(C,M.__wbindgen_malloc,M.__wbindgen_realloc),i=z;L().setInt32(A+4,i,!0),L().setInt32(A+0,B,!0)},__wbg_toString_964ff7fe6eca8362:function(A){return A.toString()},__wbg_trap_new:function(A){return t.__wrap(A)},__wbg_validate_71c2d02a71bda62f:function(){return y(function(A){return WebAssembly.validate(A)},arguments)},__wbg_value_0546255b415e96c1:function(A){return A.value},__wbg_value_ce37a60e576310ff:function(A){return A.value},__wbg_versions_4e31226f5e8dc909:function(A){return A.versions},__wbg_wait_be5dae1e53f590f1:function(){return y(function(A,g,I){return Atomics.wait(A,g>>>0,I)},arguments)},__wbg_warn_81ab00e6e16e886d:function(A,g,I){console.warn(A,g,I)},__wbindgen_cast_0000000000000001:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,oA)},__wbindgen_cast_0000000000000002:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,oA)},__wbindgen_cast_0000000000000003:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,pA)},__wbindgen_cast_0000000000000004:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______,HA)},__wbindgen_cast_0000000000000005:function(A,g){return dA(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______,aA)},__wbindgen_cast_0000000000000006:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______,qA)},__wbindgen_cast_0000000000000007:function(A){return A},__wbindgen_cast_0000000000000008:function(A){return A},__wbindgen_cast_0000000000000009:function(A,g){return r(A,g)},__wbindgen_cast_000000000000000a:function(A,g){return c(A,g)},__wbindgen_cast_000000000000000b:function(A,g){return BigInt.asUintN(64,A)|BigInt.asUintN(64,g)<<BigInt(64)},__wbindgen_cast_000000000000000c:function(A){return BigInt.asUintN(64,A)},__wbindgen_cast_000000000000000d:function(A,g){var I=kA(A,g).slice();return M.__wbindgen_free(A,g*4,4),I},__wbindgen_init_externref_table:function(){const A=M.__wbindgen_externrefs,g=A.grow(4);A.set(0,void 0),A.set(g+0,void 0),A.set(g+1,null),A.set(g+2,!0),A.set(g+3,!1)}}}}function HA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue_____(Q,A,g)}function aA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(Q,A,g)}function qA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q,A,g)}function pA(Q,A,g){const I=M.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(Q,A,g);if(I[1])throw AA(I[0])}function oA(Q,A,g){const I=M.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue__(Q,A,g);if(I[2])throw AA(I[1]);return AA(I[0])}function xA(Q,A,g,I){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(Q,A,g,I)}const NA=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>M.__wbg_dapadapter_free(Q>>>0,1)),MA=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>M.__wbg_trap_free(Q>>>0,1));function O(Q){const A=M.__externref_table_alloc();return M.__wbindgen_externrefs.set(A,Q),A}const n=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>Q.dtor(Q.a,Q.b));function $(Q){const A=typeof Q;if(A=="number"||A=="boolean"||Q==null)return`${Q}`;if(A=="string")return`"${Q}"`;if(A=="symbol"){const C=Q.description;return C==null?"Symbol":`Symbol(${C})`}if(A=="function"){const C=Q.name;return typeof C=="string"&&C.length>0?`Function(${C})`:"Function"}if(Array.isArray(Q)){const C=Q.length;let B="[";C>0&&(B+=$(Q[0]));for(let i=1;i<C;i++)B+=", "+$(Q[i]);return B+="]",B}const g=/\[object ([^\]]+)\]/.exec(toString.call(Q));let I;if(g&&g.length>1)I=g[1];else return toString.call(Q);if(I=="Object")try{return"Object("+JSON.stringify(Q)+")"}catch{return"Object"}return Q instanceof Error?`${Q.name}: ${Q.message}
2
- ${Q.stack}`:I}function kA(Q,A){Q=Q>>>0;const g=L(),I=[];for(let C=Q;C<Q+4*A;C+=4)I.push(M.__wbindgen_externrefs.get(g.getUint32(C,!0)));return M.__externref_drop_slice(Q,A),I}function r(Q,A){return Q=Q>>>0,V().subarray(Q/1,Q/1+A)}let Z=null;function L(){return(Z===null||Z.buffer.detached===!0||Z.buffer.detached===void 0&&Z.buffer!==M.memory.buffer)&&(Z=new DataView(M.memory.buffer)),Z}function c(Q,A){return Q=Q>>>0,WA(Q,A)}let T=null;function V(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(M.memory.buffer)),T}function y(Q,A){try{return Q.apply(this,A)}catch(g){const I=O(g);M.__wbindgen_exn_store(I)}}function x(Q){return Q==null}function dA(Q,A,g,I){const C={a:Q,b:A,cnt:1,dtor:g},B=(...i)=>{C.cnt++;try{return I(C.a,C.b,...i)}finally{B._wbg_cb_unref()}};return B._wbg_cb_unref=()=>{--C.cnt===0&&(C.dtor(C.a,C.b),C.a=0,n.unregister(C))},n.register(B,C,C),B}function l(Q,A,g,I){const C={a:Q,b:A,cnt:1,dtor:g},B=(...i)=>{C.cnt++;const D=C.a;C.a=0;try{return I(D,C.b,...i)}finally{C.a=D,B._wbg_cb_unref()}};return B._wbg_cb_unref=()=>{--C.cnt===0&&(C.dtor(C.a,C.b),C.a=0,n.unregister(C))},n.register(B,C,C),B}function j(Q,A,g){if(g===void 0){const D=f.encode(Q),N=A(D.length,1)>>>0;return V().subarray(N,N+D.length).set(D),z=D.length,N}let I=Q.length,C=A(I,1)>>>0;const B=V();let i=0;for(;i<I;i++){const D=Q.charCodeAt(i);if(D>127)break;B[C+i]=D}if(i!==I){i!==0&&(Q=Q.slice(i)),C=g(C,I,I=i+Q.length*3,1)>>>0;const D=V().subarray(C+i,C+I),N=f.encodeInto(Q,D);i+=N.written,C=g(C,I,i,1)>>>0}return z=i,C}function AA(Q){const A=M.__wbindgen_externrefs.get(Q);return M.__externref_table_dealloc(Q),A}let u=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});u.decode();const zA=2146435072;let gA=0;function WA(Q,A){return gA+=A,gA>=zA&&(u=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),u.decode(),gA=A),u.decode(V().subarray(Q,Q+A))}const f=new TextEncoder;"encodeInto"in f||(f.encodeInto=function(Q,A){const g=f.encode(Q);return A.set(g),{read:Q.length,written:g.length}});let z=0,M;function ZA(Q,A){return M=Q.exports,Z=null,T=null,M.__wbindgen_start(),M}async function jA(Q,A){if(typeof Response=="function"&&Q instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(Q,A)}catch(C){if(Q.ok&&g(Q.type)&&Q.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",C);else throw C}const I=await Q.arrayBuffer();return await WebAssembly.instantiate(I,A)}else{const I=await WebAssembly.instantiate(Q,A);return I instanceof WebAssembly.Instance?{instance:I,module:Q}:I}function g(I){switch(I){case"basic":case"cors":case"default":return!0}return!1}}async function tA(Q){if(M!==void 0)return M;Q!==void 0&&(Object.getPrototypeOf(Q)===Object.prototype?{module_or_path:Q}=Q:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),Q===void 0&&(Q=new URL("",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:W&&W.tagName.toUpperCase()==="SCRIPT"&&W.src||new URL("glassjar.umd.cjs",document.baseURI).href));const A=cA();(typeof Q=="string"||typeof Request=="function"&&Q instanceof Request||typeof URL=="function"&&Q instanceof URL)&&(Q=fetch(Q));const{instance:g,module:I}=await jA(await Q,A);return ZA(g)}const OA=new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.0/dist/engine_bg.wasm"),TA=Object.freeze({maxObjectBytes:128*1024*1024,maxEntries:256,maxMetadataBytes:8*1024*1024,maxEntryMetadataBytes:1024*1024});class VA{records=new Map;staged=new Map;stagingFailed=!1;objectBytes=0;metadataBytes=0;evictions=0;oversized=0;limits;constructor(A={}){this.limits=Object.freeze({...TA,...A});for(const g of Object.values(this.limits))if(!Number.isSafeInteger(g)||g<0)throw new RangeError("C++ cache limits must be nonnegative safe integers")}beginBatch(){this.discardBatch(),this.stagingFailed=!1}stage(A){if(this.stagingFailed)return;const g=this.recordSize(A);if(g===void 0||this.staged.has(A.source)){this.failBatch();return}const I=this.limits;for(;this.records.size&&(this.records.size+this.staged.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes);)this.remove(this.records.keys().next().value),this.evictions++;if(this.records.size+this.staged.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes||g>I.maxEntryMetadataBytes){this.oversized++,this.failBatch();return}this.staged.set(A.source,{...A,object:new Uint8Array(A.object),metadataBytes:g}),this.objectBytes+=A.object.byteLength,this.metadataBytes+=g}abandonBatch(){this.failBatch()}failBatch(){this.discardBatch(),this.stagingFailed=!0}recordSize(A){if(!(typeof A.source!="string"||!A.source.startsWith("/")||A.source.split("/").slice(1).some(g=>!g||g==="."||g==="..")||typeof A.key!="string"||typeof A.object_hash!="string"||!/^[a-f0-9]{64}$/.test(A.key)||!/^[a-f0-9]{64}$/.test(A.object_hash)||A.receipt!=null&&typeof A.receipt!="string"||!(A.object instanceof Uint8Array)))return new TextEncoder().encode(JSON.stringify({source:A.source,key:A.key,object_hash:A.object_hash,...A.receipt==null?{}:{receipt:A.receipt}})).byteLength}async validateBatch(){if(this.stagingFailed)return!1;const A=[...this.staged.values()];for(const g of A){if(!lA(g.object))return!1;const I=await crypto.subtle.digest("SHA-256",g.object);if(Array.from(new Uint8Array(I),B=>B.toString(16).padStart(2,"0")).join("")!==g.object_hash)return!1}return!0}commitBatch(){for(const[A,g]of this.staged)this.remove(A),this.records.set(A,g);this.staged.clear(),this.stagingFailed=!1}discardBatch(){for(const A of this.staged.values())this.objectBytes-=A.object.byteLength,this.metadataBytes-=A.metadataBytes;this.staged.clear()}snapshot(){return[...this.records.values()].map(({source:A,key:g,object_hash:I,object:C,receipt:B})=>({source:A,key:g,object_hash:I,...B==null?{}:{receipt:B},object:C.slice()}))}touch(A){const g=this.records.get(A);g&&(this.records.delete(A),this.records.set(A,g))}put(A){if(typeof A.source!="string"||!A.source.startsWith("/")||A.source.split("/").slice(1).some(B=>!B||B==="."||B==="..")||typeof A.key!="string"||typeof A.object_hash!="string"||!/^[a-f0-9]{64}$/.test(A.object_hash)||!/^[a-f0-9]{64}$/.test(A.key)||!(A.object instanceof Uint8Array))return;const g=this.recordSize(A);if(g===void 0)return;const I=this.limits;if(this.remove(A.source),I.maxEntries===0||A.object.byteLength>I.maxObjectBytes||g>I.maxMetadataBytes||g>I.maxEntryMetadataBytes){this.oversized++;return}for(;this.records.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes;)this.remove(this.records.keys().next().value),this.evictions++;const C={...A,object:new Uint8Array(A.object),metadataBytes:g};this.records.set(A.source,C),this.objectBytes+=C.object.byteLength,this.metadataBytes+=g}delete(A){this.remove(A)}remove(A){const g=this.records.get(A);g&&(this.objectBytes-=g.object.byteLength,this.metadataBytes-=g.metadataBytes,this.records.delete(A))}clear(){this.records.clear(),this.staged.clear(),this.stagingFailed=!1,this.objectBytes=this.metadataBytes=0}stats(){return{objectBytes:this.objectBytes,metadataBytes:this.metadataBytes,entries:this.records.size,stagingEntries:this.staged.size,stagingObjectBytes:[...this.staged.values()].reduce((A,g)=>A+g.object.byteLength,0),stagingMetadataBytes:[...this.staged.values()].reduce((A,g)=>A+g.metadataBytes,0),evictions:this.evictions,oversized:this.oversized}}}function lA(Q){if(!WebAssembly.validate(Q)||Q.length<8)return!1;let A=8,g=!1;const I=()=>{let C=0,B=0;for(let i=0;i<5&&A<Q.length;i++,B+=7){const D=Q[A++];if(C+=(D&127)*2**B,!(D&128))return C}throw new Error("Malformed object section")};try{for(;A<Q.length;){const C=Q[A++],B=I(),i=A+B;if(i>Q.length||C===8)return!1;if(C===0){const D=I();if(A+D>i)return!1;const N=new TextDecoder().decode(Q.subarray(A,A+D));if(A+=D,N==="linking"){if(g||I()!==2)return!1;g=!0}}A=i}return g}catch{return!1}}const U=Symbol();function S(Q){return Q instanceof Error?{type:"error",error:{type:Q.constructor.name,message:Q.message}}:{type:"error",error:{type:typeof Q,message:String(Q)}}}class FA{name;data;constructor(A,g){this.name=A,this.data=g}download(){const A=new Uint8Array(this.data),g=new Blob([A]),I=URL.createObjectURL(g),C=document.createElement("a");C.href=I,C.download=this.name,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(I)}}class GA extends wA{[U];dap;enabled=!0;set filterInternals(A){this.dap.setFilterInternals(A)}constructor(){super(),this[U]={attach:this.attach.bind(this),detach:this.detach.bind(this),beginRun:()=>this.dap.resetRun()},this.onMessage=this.onMessage.bind(this),this.dap=new _,this.dap.on(this.onMessage)}send(A){return this.dap.sendMessage(A)}artifactListener=A=>{if(A.data.type!=="artifact")return;const g=new FA(A.data.name,new Uint8Array(A.data.data));this.emit("artifact",g)};attach(A){A.addEventListener("message",this.artifactListener),this.dap.attach(A)}detach(A){A.removeEventListener("message",this.artifactListener),this.dap.detach()}onMessage(A){this.emit("event",A)}}const fA="glassjar-wasm:";function bA(Q,A){const g=new URL(String(Q),A);if(g.protocol!=="https:"&&g.protocol!=="http:")throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);return g.href}function mA(Q){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/worker-BMydG-4n.js").href:new URL("assets/worker-BMydG-4n.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),{type:"module",name:Q?.name})}function PA(Q){return new mA(Q?{name:fA+Q}:void 0)}const XA="/dev/debugger-sh-host";class yA{buffer=new SharedArrayBuffer(4+64*1024);length=new Int32Array(this.buffer,0,1);bytes=new Uint8Array(this.buffer,4);publish(A){Atomics.store(this.length,0,A),Atomics.notify(this.length,0)}}function IA(Q){try{return new Error(`Host device callback failed: ${Q instanceof Error?Q.message:String(Q)}`)}catch{return new Error("Host device callback failed")}}function KA(Q){try{const A=Q?.();if(A&&typeof A.then=="function")return Promise.resolve(A).catch(()=>{}),new TypeError("Host device cleanup must be synchronous")}catch(A){return IA(A)}}class nA{constructor(A){this.onFailure=A}incoming=new yA;outgoing=new yA;workerStart={guest_to_host:this.incoming.buffer,host_to_guest:this.outgoing.buffer};abort=new AbortController;listeners=new Set;cleanup;worker;writing=!1;open(A){let g;try{g=A({signal:this.abort.signal,onData:I=>{if(this.assertOpen(),typeof I!="function")throw new TypeError("Host device listener must be a function");return this.listeners.add(I),()=>{this.listeners.delete(I)}},write:I=>this.write(I)})}catch(I){throw IA(I)}if(g!==void 0&&typeof g!="function")throw Promise.resolve(g).catch(()=>{}),new TypeError("Host device opener must return a cleanup function or undefined");if(typeof g=="function")if(this.abort.signal.aborted){const I=KA(g);if(I)throw I}else this.cleanup=g}attach(A){this.assertOpen(),this.worker=A,A.addEventListener("message",this.onMessage)}assertOpen(){if(this.abort.signal.aborted)throw new Error("Host device is closed")}async write(A){if(this.assertOpen(),!(A instanceof Uint8Array))throw new TypeError("Host device writes require Uint8Array");if(this.writing)throw new Error("Await the previous host device write before writing again");this.writing=!0;try{const g=new Uint8Array(A),I=this.outgoing;let C=0;for(;C<g.length;){this.assertOpen();const B=Atomics.load(I.length,0);if(B!==0){await Atomics.waitAsync(I.length,0,B).value;continue}const i=g.subarray(C,C+I.bytes.length);I.bytes.set(i),I.publish(i.length),C+=i.length}}finally{this.writing=!1}}onMessage=A=>{if(!(this.abort.signal.aborted||A.data?.type!=="host_wake"))try{const g=Atomics.load(this.incoming.length,0);if(g<=0)return;const I=this.incoming.bytes.slice(0,g);this.incoming.publish(0);for(const C of this.listeners){if(this.abort.signal.aborted)break;Promise.resolve(C(I)).catch(B=>this.fail(B))}}catch(g){this.fail(g)}};fail(A){this.abort.signal.aborted||(this.close(),this.onFailure(IA(A)))}close(){if(this.abort.signal.aborted)return;this.worker?.removeEventListener("message",this.onMessage),this.worker=void 0,this.incoming.publish(-1),this.outgoing.publish(-1),this.abort.abort(),this.listeners.clear();const A=this.cleanup;return this.cleanup=void 0,KA(A)}}const rA=["4847c7cda81eb51b1cec18fe40b396605579fe84e17eca2760702b8a9666e4e1"],e=Object.freeze({compiler:"2d2c6ae498b27592a3cec7a270f274a08848a834e762cc08818c78626c32053a",sysroot:"8745c6af23fd841fa507d0c73f6b6b8e8da1b4ec216a6339739a28b38ff7227b",exceptions:"20986166552953de0e3ca5c1e9f341e7aec8b9ba54dcb244d0d2b2f9ca843ab4"});function RA(Q="legacy"){if(Q==="legacy")return{profile:Q,digests:e};if(Q==="stock-certified-v1"&&rA.length>0)return{profile:Q,digests:e};throw new Error(`The ${Q} toolchain is not available in this build`)}class b{#A;hashCount=3;hashMs;constructor(A,g){this.#A=A,this.hashMs=g}static async load(A,g,I,C=e.exceptions,B="legacy"){const i=RA(B);if(A.length!==2)throw new Error("Missing C++ toolchain assets");let D,N;const K=await Promise.allSettled(A.map(async(m,EA)=>{try{const d=await fetch(m,{cache:"force-cache",signal:I});if(!d.ok)throw new Error(`Cannot load C++ toolchain (${d.status})`);return EA===0&&g&&typeof WebAssembly.compileStreaming=="function"&&typeof d.clone=="function"&&(N=WebAssembly.compileStreaming(d.clone()).catch(()=>{})),new Uint8Array(await d.arrayBuffer())}catch(d){throw D??={error:d},d}}));if(K[0].status==="rejected"||K[1].status==="rejected")throw D?.error;const[J,h]=[K[0].value,K[1].value],[Y,s]=await Promise.allSettled([b.ingestOwned(J,h,!1,C),g?(N??Promise.resolve(void 0)).then(m=>m??WebAssembly.compile(J)):Promise.resolve(void 0)]);if(Y.status==="rejected")throw Y.reason;const q=Y.value;if(q.#A.compilerHash!==i.digests.compiler||q.#A.sysrootHash!==i.digests.sysroot||q.#A.exceptionsHash!==i.digests.exceptions)throw new Error("C++ toolchain integrity mismatch");if(I?.aborted)throw new DOMException("Toolchain loading aborted","AbortError");if(s.status==="rejected")throw s.reason;return q.#A.stockProfile=i.profile==="stock-certified-v1",q.#A.module=s.value,q}static async fromBytes(A,g,I){const C=new Uint8Array(A),B=new Uint8Array(g);return b.ingestOwned(C,B,I,e.exceptions)}static async ingestOwned(A,g,I,C){const B=performance.now(),i=await Promise.allSettled([YA(A),YA(g)]);if(i[0].status==="rejected")throw i[0].reason;if(i[1].status==="rejected")throw i[1].reason;const[D,N]=[i[0].value,i[1].value],K=I?await WebAssembly.compile(A):void 0;return new b({compiler:A,sysroot:g,compilerHash:D,sysrootHash:N,exceptionsHash:C,module:K},performance.now()-B)}matchesExpectation(A){return A.compilerSha256===this.#A.compilerHash&&A.sysrootSha256===this.#A.sysrootHash&&A.exceptionsSha256===this.#A.exceptionsHash}get identity(){return`${this.#A.compilerHash}:${this.#A.sysrootHash}:${this.#A.exceptionsHash}`}get identityBytes(){return this.#A.compiler.byteLength+this.#A.sysroot.byteLength}get compilerBytes(){return this.#A.compiler.byteLength}configure(A,g){try{return A.postMessage({...g,toolchain:this.#A}),!!this.#A.module}catch(I){if(!(I instanceof DOMException)||I.name!=="DataCloneError"||!this.#A.module)throw I;return A.postMessage({...g,toolchain:{...this.#A,module:void 0}}),!1}}}async function YA(Q){const A=await crypto.subtle.digest("SHA-256",Q);return Array.from(new Uint8Array(A),g=>g.toString(16).padStart(2,"0")).join("")}let CA,v;class QA{stdout=new BA(1);stderr=new BA(2);stdin=new H;debugger;lang;scope;fs={};binaryFiles={};cppArtifacts;hostDevice;options;retain;idleTimeoutMs;wasmUrl;objects;generation=0;scopeEpoch=0;operationId=0;disposed=!1;active;promise;slot;idleTimer;toolchain;toolchainLoading;toolchainController;initializing=new Set;toolchainIdentity;toolchainIngestions=0;toolchainHashCount=0;toolchainHashMs=0;compilerModuleCloned=!1;disposal;cancellationDraining;releaseDrain;releases=new Set;retirements=0;latest;cacheValidation;static async create(A,g={}){const{wasmUrl:I,...C}=g,B=I===void 0?void 0:bA(I,globalThis.location?.href),i=structuredClone(C),D=B??null;if(v!==void 0&&v!==D)throw new Error("The engine Wasm is already loaded from a different wasmUrl");v=D,CA??=tA({module_or_path:B??OA}).catch(K=>{throw CA=void 0,v=void 0,K}),await CA;const N=new QA(A,i);if(N.wasmUrl=B,A!=="c"&&typeof window<"u"&&typeof fetch<"u")for(const K of iA(A))fetch(K,{cache:"force-cache"}).then(J=>J.arrayBuffer()).catch(()=>{});return N}constructor(A,g){const I=g.cpp;this.retain=g.retainWorker??I?.retainWorker??!0;const C=g.idleTimeoutMs??I?.idleTimeoutMs??3e4;if(!Number.isSafeInteger(C)||C<1||C>3e5)throw new RangeError("Worker idle timeout must be between 1 and 300000 milliseconds");if(this.idleTimeoutMs=C,I){if(A!=="c")throw new TypeError("C++ performance options require C/C++");if(!I.scope?.projectId||!I.scope.accountId)throw new TypeError("C++ performance options require project and account identity");if(I.compilerLifetime!==void 0&&!["idle","project"].includes(I.compilerLifetime))throw new TypeError("Invalid compiler lifetime");RA(I.toolchainProfile),this.scope=Object.freeze({...I.scope}),this.options=Object.freeze({...I,scope:this.scope,idleTimeoutMs:C})}this.objects=new VA(typeof I?.objectCache=="object"?I.objectCache:{}),this.debugger=new GA,this.lang=A}get cacheCompilerModule(){return this.options?.cacheCompilerModule??this.retain}get cacheStats(){return structuredClone({...this.objects.stats(),generation:this.generation,scopeEpoch:this.scopeEpoch,operationId:this.operationId,cacheEpoch:this.generation,toolchainProfile:this.options?.toolchainProfile??"legacy",cacheEligible:this.cacheValidation?.eligible??!1,stockCertificateSha256:this.cacheValidation?.certificate,cacheEligibilitySnapshot:this.cacheValidation?.snapshot,cacheEligibilityOperationId:this.cacheValidation?.operationId,cacheEligibilityReason:this.cacheValidation?.reason,toolchainIdentityBytes:this.toolchain?.identityBytes??0,toolchainIngestions:this.toolchainIngestions,toolchainHashCount:this.toolchainHashCount,toolchainHashMs:this.toolchainHashMs,compilerModuleCloned:this.compilerModuleCloned,workerRetained:!!this.slot&&!this.active,workerRetirements:this.retirements,compilerModuleIdentityBytes:this.cacheCompilerModule?this.toolchain?.compilerBytes??0:0,latest:this.active?.stats??this.latest})}clearCaches(){this.cacheValidation=void 0,this.generation++,this.objects.clear(),this.toolchain=void 0,this.active||(this.toolchainController?.abort(),this.toolchainLoading=void 0),this.active||this.retireWorker()}stop(){return this.clearCaches(),this.cancelCurrentOperation()}cancelCurrentOperation(){if(this.cancellationDraining)return this.cancellationDraining;this.operationId++;const A=this.promise,g=this.active?.publication;this.retireWorker(),this.objects.discardBatch(),this.active&&this.finish(this.active,{type:"stopped"});const I=Promise.allSettled([A,g]).then(()=>{this.cancellationDraining===I&&(this.cancellationDraining=void 0)});return this.cancellationDraining=I,I}releaseCompilerResources(A={}){const g=A.signal;return g?.aborted?Promise.resolve("cancelled"):this.disposed?Promise.resolve("released"):new Promise(I=>{const C={resolve:I,signal:g,abort:()=>this.settleRelease(C,"cancelled")};this.releases.add(C),g?.addEventListener("abort",C.abort,{once:!0}),this.flushReleases()})}settleRelease(A,g){this.releases.delete(A)&&(A.signal?.removeEventListener("abort",A.abort),A.resolve(g))}flushReleases(){if(!(this.active||!this.releases.size||this.releaseDrain)){if(this.initializing.size){this.toolchainController?.abort();const A=[...this.initializing];this.toolchainLoading=void 0,this.releaseDrain=Promise.allSettled(A).then(()=>{this.releaseDrain=void 0,this.flushReleases()});return}this.retireWorker(),this.toolchainController?.abort(),this.toolchain=void 0,this.toolchainLoading=void 0;for(const A of this.releases)this.settleRelease(A,"released")}}dispose(){if(this.disposal)return this.disposal;this.disposed=!0,this.scopeEpoch++,this.fs={},this.binaryFiles={},this.cppArtifacts=void 0,this.hostDevice=void 0,this.stdout.removeAllListeners(),this.stderr.removeAllListeners(),this.debugger.removeAllListeners();const A=[...this.initializing];return this.toolchainController?.abort(),this.disposal=Promise.allSettled([this.stop(),...A]).then(()=>{this.latest=void 0,this.flushReleases()}),this.disposal}prepareCompiler(A){if(A?.validateCacheInputs!==void 0&&typeof A.validateCacheInputs!="boolean")return Promise.resolve(S(new TypeError("Invalid compiler preparation options")));const g=A?.validateCacheInputs===!0&&this.options?.toolchainProfile==="stock-certified-v1"&&!!this.options?.objectCache&&this.objects.limits.maxEntries>0&&this.objects.limits.maxObjectBytes>0&&this.objects.limits.maxMetadataBytes>0&&this.objects.limits.maxEntryMetadataBytes>0;return this.submit(!0,!0,g)}run(){return this.submit(!1)}compile(){return this.submit(!0)}submit(A,g=!1,I=!1){if(this.disposed)return Promise.resolve(S(new Error("Engine is disposed")));if(this.active||this.cancellationDraining)return Promise.resolve(S(new Error("An engine job is already active")));if(A&&this.lang!=="c")return Promise.resolve(S(new Error("Compile-only is supported for C/C++")));this.cacheValidation=void 0;const C=g&&!I;let B;try{const Y=C||!this.cppArtifacts?null:{...this.cppArtifacts};if(Y?.cacheCertificate!==void 0){const s=Y.cacheCertificate;(typeof s!="string"||s.length>1024*1024||new TextEncoder().encode(s).byteLength>1024*1024)&&delete Y.cacheCertificate}B={fs:C?{}:structuredClone(this.fs),binary_files:Object.fromEntries(Object.entries(C?{}:this.binaryFiles).map(([s,q])=>[s,new Uint8Array(q)])),cpp_artifacts:structuredClone(Y)}}catch(Y){return Promise.resolve(S(Y))}const i=!A&&this.debugger.enabled,D=A?void 0:this.hostDevice;if(D!==void 0&&(typeof D!="function"||!["c","python"].includes(this.lang)))return Promise.resolve(S(new TypeError("Invalid host device configuration")));clearTimeout(this.idleTimer),this.stdin[U].clear();const N=!!this.slot;let K;const J=new Promise(Y=>{K=Y});this.promise=J;const h={generation:this.generation,scopeEpoch:this.scopeEpoch,operationId:++this.operationId,cacheEpoch:this.generation,prepareOnly:g,validateCacheInputs:I,settled:!1,buildOnly:A,debug:i,opener:D,startedAt:performance.now(),resolve:K,stats:{operation:g?"prepare_compiler":A?"compile":"run",workerReadyMs:0,workerReused:N},start:{...B,lang:this.lang,prepare_compiler:g,validate_cache_inputs:I,scope_epoch:this.scopeEpoch,operation_id:this.operationId,cache_epoch:this.generation,is_debug:i,build_only:A,stdin_buffer:this.stdin[U].buffer,cpp_cache:this.options?.objectCache&&!i&&!g?{generation:this.generation,entries:this.objects.snapshot(),max_entry_metadata_bytes:Math.min(this.objects.limits.maxEntryMetadataBytes,this.objects.limits.maxMetadataBytes,1024*1024)}:null}};this.objects.beginBatch(),this.active=h;try{if(this.slot||this.makeWorker(),!this.current(h))return J;const Y=this.slot;this.lang==="c"&&!this.toolchain&&this.ensureToolchain().catch(s=>{this.current(h)&&this.slot===Y&&this.finish(h,S(s))}),this.slot.ready&&this.dispatch(h)}catch(Y){this.finish(h,S(Y))}return J}current(A){return this.active===A&&!A.settled}makeWorker(){const A=PA(this.wasmUrl),g={worker:A,ready:!1,remove:()=>{}};this.slot=g;const I=i=>{if(this.slot!==g)return;const D=i.data,N=this.active;if(D.type==="ready"){if(g.ready)return;g.ready=!0,N&&this.current(N)&&this.dispatch(N);return}if(!(!N||!this.current(N))){if(!g.ready&&D.type==="error"){this.finish(N,S(new Error(D.message)));return}if(!(D.operationId!==N.operationId||D.scopeEpoch!==N.scopeEpoch))try{if(D.type==="cpp_cache_eligibility"){if(this.options?.toolchainProfile!=="stock-certified-v1"||N.prepareOnly&&!N.validateCacheInputs)return;const K=h=>typeof h=="string"&&/^[0-9a-f]{64}$/.test(h),J=D.eligible===!0&&K(D.certificate_sha256)&&K(D.snapshot);this.cacheValidation={eligible:J,certificate:K(D.certificate_sha256)?D.certificate_sha256:void 0,snapshot:J?D.snapshot:void 0,operationId:N.operationId,reason:J?void 0:typeof D.reason=="string"?D.reason.slice(0,128):"stock-input-validation"}}else if(D.type==="stop")this.finish(N,{type:"completed",exitCode:D.exit_code,timing:{totalMs:performance.now()-N.startedAt,buildMs:D.build_ms,runMs:D.run_ms}});else if(D.type==="error")this.finish(N,S(new Error(D.message)));else if(D.type==="cpp_cache_object"&&D.generation===this.generation&&N.generation===this.generation)try{this.objects.stage(D)}catch{this.objects.abandonBatch()}else D.type==="cpp_cache_stats"&&D.generation===N.generation?N.stats.cache=D.stats:D.type==="cpp_cache_abandon"?this.objects.abandonBatch():D.type==="object_build_complete"?N.publication??=this.publishObjects(N,g):D.type==="compiler_module_stats"&&(N.stats.compilerModule=D)}catch(K){this.finish(N,S(K))}}},C=i=>{this.slot===g&&(this.clearCaches(),this.active?this.finish(this.active,S(i.error??new Error(i.message))):this.retireWorker())},B=()=>C({message:"Unreadable execution worker message"});this.debugger[U].attach(A),A.addEventListener("message",I),A.addEventListener("error",C),A.addEventListener("messageerror",B),g.remove=()=>{A.removeEventListener("message",I),A.removeEventListener("error",C),A.removeEventListener("messageerror",B),this.debugger[U].detach(A)}}async publishObjects(A,g){let I=!1;try{I=await this.objects.validateBatch()}catch{}if(!(!this.current(A)||this.slot!==g)){try{I&&A.cacheEpoch===this.generation?this.objects.commitBatch():(this.objects.abandonBatch(),this.cacheValidation?.operationId===A.operationId&&(this.cacheValidation={...this.cacheValidation,eligible:!1,snapshot:void 0,reason:"stock-publication-budget-or-validation"}))}catch{this.objects.clear(),this.cacheValidation?.operationId===A.operationId&&(this.cacheValidation={...this.cacheValidation,eligible:!1,snapshot:void 0,reason:"stock-publication-failure"})}this.current(A)&&g.worker.postMessage({type:"object_build_ack",scopeEpoch:A.scopeEpoch,operationId:A.operationId,cacheEpoch:A.cacheEpoch})}}ensureToolchain(){if(this.toolchain)return Promise.resolve(this.toolchain);if(this.toolchainLoading)return this.toolchainLoading;this.toolchainController=new AbortController;const A=b.load(iA("c"),this.cacheCompilerModule,this.toolchainController.signal,sA(),this.options?.toolchainProfile);return this.toolchainLoading=A,this.initializing.add(A),A.then(()=>this.initializing.delete(A),()=>{this.initializing.delete(A),this.toolchainLoading===A&&(this.toolchainLoading=void 0)}),A}async dispatch(A){const g=this.slot;if(!(!this.current(A)||!g))try{if(this.lang==="c"){const B=this.scopeEpoch,i=this.generation,D=this.ensureToolchain(),N=this.toolchain??await D;if(!this.current(A)||this.slot!==g||B!==this.scopeEpoch)return;const K=A.start.cpp_artifacts?.requiredToolchain;if(K&&!N.matchesExpectation(K)){this.finish(A,{type:"error",error:{type:"artifact-toolchain-integrity",message:"C++ artifacts require a different compiler, sysroot, or exception runtime"}});return}i===this.generation&&(this.toolchainIdentity&&this.toolchainIdentity!==N.identity&&(this.objects.clear(),A.start.cpp_cache=null),this.toolchain!==N&&(this.toolchainIngestions++,this.toolchainHashCount+=N.hashCount,this.toolchainHashMs+=N.hashMs),this.toolchainIdentity=N.identity,this.toolchain=N,this.toolchainLoading===D&&(this.toolchainLoading=void 0)),g.toolchain!==N&&(this.compilerModuleCloned=N.configure(g.worker,{type:"configure_cpp",cacheCompilerModule:this.cacheCompilerModule}),g.toolchain=N)}if(!this.current(A)||this.slot!==g)return;const I=g.worker;A.stats.workerReadyMs=performance.now()-A.startedAt;const C=B=>this.current(A)&&B.scopeEpoch===A.scopeEpoch&&B.operationId===A.operationId;if(this.stdout[U].attach(I,C),this.stderr[U].attach(I,C),A.prepareOnly||this.debugger[U].beginRun(),A.opener){if(A.device=new nA(B=>this.finish(A,S(B))),A.device.attach(I),A.device.open(A.opener),!this.current(A))return;A.start.host_device=A.device.workerStart}this.current(A)&&(I.postMessage(A.start),A.start.fs={},A.start.binary_files={},A.start.cpp_artifacts=null,A.start.cpp_cache=null)}catch(I){this.current(A)&&(this.toolchainLoading=void 0,this.finish(A,S(I)))}}finish(A,g){if(!this.current(A))return;(g.type!=="completed"||g.exitCode!==0)&&(this.cacheValidation=void 0),A.settled=!0;const I=this.slot?.worker;I&&(this.stdout[U].detach(I),this.stderr[U].detach(I));const C=A.device?.close();C&&(g=S(C));const B=g.type==="completed"&&A.generation===this.generation&&!this.disposed,i=B&&g.type==="completed"&&g.exitCode===0;if(A.generation===this.generation)for(const D of A.stats.cache?.invalid_sources??[])this.objects.delete(D);if(i)for(const D of A.stats.cache?.hit_sources??[])this.objects.touch(D);this.objects.discardBatch(),this.latest=A.stats,this.stdin[U].clear(),(!B||!this.retain)&&this.retireWorker(),!this.disposed&&A.cacheEpoch===this.generation&&(this.slot||this.toolchain&&this.cacheCompilerModule)&&this.options?.compilerLifetime!=="project"&&(this.idleTimer=setTimeout(()=>{this.retireWorker(),this.toolchain=void 0,this.toolchainLoading=void 0},this.idleTimeoutMs)),!this.retain&&!this.cacheCompilerModule&&(this.toolchain=void 0),A.cacheEpoch!==this.generation&&(this.toolchainController?.abort(),this.toolchainLoading=void 0),this.active=void 0,this.promise=void 0,this.flushReleases(),A.resolve(g)}retireWorker(){clearTimeout(this.idleTimer);const A=this.slot;A&&(this.slot=void 0,A.remove(),this.stdout[U].detach(A.worker),this.stderr[U].detach(A.worker),A.worker.onerror=g=>g.preventDefault(),A.worker.terminate(),this.retirements++)}}class BA extends wA{constructor(A){super(),this.mode=A,this.callback=(g=>{const I=g.data;if(this.accepts&&!this.accepts(I)||I.type!=="stdout"||I.mode!==this.mode)return;const C=I.data;this.emit("data",C)}).bind(this),this[U]={attach:this.attach.bind(this),detach:this.detach.bind(this)}}callback;accepts;[U];attach(A,g){this.accepts=g,A.addEventListener("message",this.callback)}detach(A){A.removeEventListener("message",this.callback)}}class H{static BUFFER_SIZE=2048;static HEADER_SIZE=8;static DATA_SIZE=H.BUFFER_SIZE-H.HEADER_SIZE;static READ_IDX=0;static WRITE_IDX=1;static encoder=new TextEncoder;buffer=new SharedArrayBuffer(H.BUFFER_SIZE);generation=0;indices;data;[U];constructor(){this.indices=new Int32Array(this.buffer,0,2),this.data=new Int8Array(this.buffer,H.HEADER_SIZE);const A=()=>this.buffer;this[U]={clear:this.clear.bind(this),get buffer(){return A()}}}clear(){this.generation++,Atomics.notify(this.indices,H.READ_IDX),this.buffer=new SharedArrayBuffer(H.BUFFER_SIZE),this.indices=new Int32Array(this.buffer,0,2),this.data=new Int8Array(this.buffer,H.HEADER_SIZE)}async write(A){const g=typeof A=="string"?H.encoder.encode(A):A;return this.writeBytes(g)}async writeBytes(A){const{DATA_SIZE:g,READ_IDX:I,WRITE_IDX:C}=H;let B=0;const i=this.generation;for(;B<A.length&&i===this.generation;){const D=Atomics.load(this.indices,I);let N=Atomics.load(this.indices,C);N===g-1&&D>0&&(N=0);const K=D<=N?g-N-1:D-N-1;if(K===0){await Atomics.waitAsync(this.indices,I,D).value;continue}const J=Math.min(A.length-B,K);this.data.set(A.subarray(B,B+J),N),Atomics.store(this.indices,C,(N+J)%g),Atomics.notify(this.indices,C),B+=J}}}a.Artifact=FA,a.Debugger=GA,a.Engine=QA,a.HOST_DEVICE_PATH=XA,a.Stdin=H,a.Stdout=BA,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(H,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):(H=typeof globalThis<"u"?globalThis:H||self,z(H.engine={}))})(this,(function(H){"use strict";var z=typeof document<"u"?document.currentScript:null;function LA(Q){return Q&&Q.__esModule&&Object.prototype.hasOwnProperty.call(Q,"default")?Q.default:Q}var m={exports:{}},DA;function SA(){if(DA)return m.exports;DA=1;var Q=typeof Reflect=="object"?Reflect:null,A=Q&&typeof Q.apply=="function"?Q.apply:function(E,o,k){return Function.prototype.apply.call(E,o,k)},g;Q&&typeof Q.ownKeys=="function"?g=Q.ownKeys:Object.getOwnPropertySymbols?g=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:g=function(E){return Object.getOwnPropertyNames(E)};function I(w){console&&console.warn&&console.warn(w)}var C=Number.isNaN||function(E){return E!==E};function B(){B.init.call(this)}m.exports=B,m.exports.once=d,B.EventEmitter=B,B.prototype._events=void 0,B.prototype._eventsCount=0,B.prototype._maxListeners=void 0;var i=10;function D(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(B,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(w){if(typeof w!="number"||w<0||C(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");i=w}}),B.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},B.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||C(E))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+E+".");return this._maxListeners=E,this};function N(w){return w._maxListeners===void 0?B.defaultMaxListeners:w._maxListeners}B.prototype.getMaxListeners=function(){return N(this)},B.prototype.emit=function(E){for(var o=[],k=1;k<arguments.length;k++)o.push(arguments[k]);var F=E==="error",R=this._events;if(R!==void 0)F=F&&R.error===void 0;else if(!F)return!1;if(F){var G;if(o.length>0&&(G=o[0]),G instanceof Error)throw G;var p=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw p.context=G,p}var X=R[E];if(X===void 0)return!1;if(typeof X=="function")A(X,this,o);else for(var UA=X.length,eA=q(X,UA),k=0;k<UA;++k)A(eA[k],this,o);return!0};function K(w,E,o,k){var F,R,G;if(D(o),R=w._events,R===void 0?(R=w._events=Object.create(null),w._eventsCount=0):(R.newListener!==void 0&&(w.emit("newListener",E,o.listener?o.listener:o),R=w._events),G=R[E]),G===void 0)G=R[E]=o,++w._eventsCount;else if(typeof G=="function"?G=R[E]=k?[o,G]:[G,o]:k?G.unshift(o):G.push(o),F=N(w),F>0&&G.length>F&&!G.warned){G.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(E)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=w,p.type=E,p.count=G.length,I(p)}return w}B.prototype.addListener=function(E,o){return K(this,E,o,!1)},B.prototype.on=B.prototype.addListener,B.prototype.prependListener=function(E,o){return K(this,E,o,!0)};function U(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(w,E,o){var k={fired:!1,wrapFn:void 0,target:w,type:E,listener:o},F=U.bind(k);return F.listener=o,k.wrapFn=F,F}B.prototype.once=function(E,o){return D(o),this.on(E,h(this,E,o)),this},B.prototype.prependOnceListener=function(E,o){return D(o),this.prependListener(E,h(this,E,o)),this},B.prototype.removeListener=function(E,o){var k,F,R,G,p;if(D(o),F=this._events,F===void 0)return this;if(k=F[E],k===void 0)return this;if(k===o||k.listener===o)--this._eventsCount===0?this._events=Object.create(null):(delete F[E],F.removeListener&&this.emit("removeListener",E,k.listener||o));else if(typeof k!="function"){for(R=-1,G=k.length-1;G>=0;G--)if(k[G]===o||k[G].listener===o){p=k[G].listener,R=G;break}if(R<0)return this;R===0?k.shift():P(k,R),k.length===1&&(F[E]=k[0]),F.removeListener!==void 0&&this.emit("removeListener",E,p||o)}return this},B.prototype.off=B.prototype.removeListener,B.prototype.removeAllListeners=function(E){var o,k,F;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[E]),this;if(arguments.length===0){var R=Object.keys(k),G;for(F=0;F<R.length;++F)G=R[F],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(o=k[E],typeof o=="function")this.removeListener(E,o);else if(o!==void 0)for(F=o.length-1;F>=0;F--)this.removeListener(E,o[F]);return this};function Y(w,E,o){var k=w._events;if(k===void 0)return[];var F=k[E];return F===void 0?[]:typeof F=="function"?o?[F.listener||F]:[F]:o?EA(F):q(F,F.length)}B.prototype.listeners=function(E){return Y(this,E,!0)},B.prototype.rawListeners=function(E){return Y(this,E,!1)},B.listenerCount=function(w,E){return typeof w.listenerCount=="function"?w.listenerCount(E):s.call(w,E)},B.prototype.listenerCount=s;function s(w){var E=this._events;if(E!==void 0){var o=E[w];if(typeof o=="function")return 1;if(o!==void 0)return o.length}return 0}B.prototype.eventNames=function(){return this._eventsCount>0?g(this._events):[]};function q(w,E){for(var o=new Array(E),k=0;k<E;++k)o[k]=w[k];return o}function P(w,E){for(;E+1<w.length;E++)w[E]=w[E+1];w.pop()}function EA(w){for(var E=new Array(w.length),o=0;o<E.length;++o)E[o]=w[o].listener||w[o];return E}function d(w,E){return new Promise(function(o,k){function F(G){w.removeListener(E,R),k(G)}function R(){typeof w.removeListener=="function"&&w.removeListener("error",F),o([].slice.call(arguments))}JA(w,E,R,{once:!0}),E!=="error"&&uA(w,F,{once:!0})})}function uA(w,E,o){typeof w.on=="function"&&JA(w,"error",E,o)}function JA(w,E,o,k){if(typeof w.on=="function")k.once?w.once(E,o):w.on(E,o);else if(typeof w.addEventListener=="function")w.addEventListener(E,function F(R){k.once&&w.removeEventListener(E,F),o(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return m.exports}var hA=SA();const wA=LA(hA);class _{__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,NA.unregister(this),A}free(){const A=this.__destroy_into_raw();M.__wbg_dapadapter_free(A,0)}attach(A){M.dapadapter_attach(this.__wbg_ptr,A)}detach(){M.dapadapter_detach(this.__wbg_ptr)}constructor(){const A=M.dapadapter_new();return this.__wbg_ptr=A>>>0,NA.register(this,this.__wbg_ptr,this),this}on(A){M.dapadapter_on(this.__wbg_ptr,A)}resetRun(){M.dapadapter_resetRun(this.__wbg_ptr)}sendMessage(A){return M.dapadapter_sendMessage(this.__wbg_ptr,A)}setFilterInternals(A){M.dapadapter_setFilterInternals(this.__wbg_ptr,A)}}Symbol.dispose&&(_.prototype[Symbol.dispose]=_.prototype.free);class t{static __wrap(A){A=A>>>0;const g=Object.create(t.prototype);return g.__wbg_ptr=A,MA.register(g,g.__wbg_ptr,g),g}__destroy_into_raw(){const A=this.__wbg_ptr;return this.__wbg_ptr=0,MA.unregister(this),A}free(){const A=this.__destroy_into_raw();M.__wbg_trap_free(A,0)}static __wbg_wasmer_trap(){M.trap___wbg_wasmer_trap()}}Symbol.dispose&&(t.prototype[Symbol.dispose]=t.prototype.free);function sA(){let Q,A;try{const g=M.cpp_exception_hash();return Q=g[0],A=g[1],c(g[0],g[1])}finally{M.__wbindgen_free(Q,A,1)}}function iA(Q){const A=O(Q,M.__wbindgen_malloc,M.__wbindgen_realloc),g=Z,I=M.prefetch_urls(A,g);var C=kA(I[0],I[1]).slice();return M.__wbindgen_free(I[0],I[1]*4,4),C}function cA(){return{__proto__:null,"./engine_bg.js":{__proto__:null,__wbg_BigInt_b7bbccdff258c9f2:function(A){return BigInt(A)},__wbg_Error_8c4e43fe74559d73:function(A,g){return Error(c(A,g))},__wbg_Number_04624de7d0e8332d:function(A){return Number(A)},__wbg_String_8f0eb39a4a4c2f66:function(A,g){const I=String(g),C=O(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=Z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2:function(A,g){const I=g,C=typeof I=="bigint"?I:void 0;L().setBigInt64(A+8,x(C)?BigInt(0):C,!0),L().setInt32(A+0,!x(C),!0)},__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:function(A){const g=A,I=typeof g=="boolean"?g:void 0;return x(I)?16777215:I?1:0},__wbg___wbindgen_debug_string_0bc8482c6e3508ae:function(A,g){const I=$(g),C=O(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=Z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg___wbindgen_function_table_5ae7216dfcbcc506:function(){return M.__wbindgen_export},__wbg___wbindgen_in_47fa6863be6f2f25:function(A,g){return A in g},__wbg___wbindgen_is_bigint_31b12575b56f32fc:function(A){return typeof A=="bigint"},__wbg___wbindgen_is_function_0095a73b8b156f76:function(A){return typeof A=="function"},__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:function(A){const g=A;return typeof g=="object"&&g!==null},__wbg___wbindgen_is_string_cd444516edc5b180:function(A){return typeof A=="string"},__wbg___wbindgen_is_undefined_9e4d92534c42d778:function(A){return A===void 0},__wbg___wbindgen_jsval_eq_11888390b0186270:function(A,g){return A===g},__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:function(A,g){return A==g},__wbg___wbindgen_lt_bb59cc3d23526e0d:function(A,g){return A<g},__wbg___wbindgen_neg_6b4d356dff49dcc6:function(A){return-A},__wbg___wbindgen_number_get_8ff4255516ccad3e:function(A,g){const I=g,C=typeof I=="number"?I:void 0;L().setFloat64(A+8,x(C)?0:C,!0),L().setInt32(A+0,!x(C),!0)},__wbg___wbindgen_rethrow_05525c567f154472:function(A){throw A},__wbg___wbindgen_shr_ef8e07cce709eb54:function(A,g){return A>>g},__wbg___wbindgen_string_get_72fb696202c56729:function(A,g){const I=g,C=typeof I=="string"?I:void 0;var B=x(C)?0:O(C,M.__wbindgen_malloc,M.__wbindgen_realloc),i=Z;L().setInt32(A+4,i,!0),L().setInt32(A+0,B,!0)},__wbg___wbindgen_throw_be289d5034ed271b:function(A,g){throw new Error(c(A,g))},__wbg__wbg_cb_unref_d9b87ff7982e3b21:function(A){A._wbg_cb_unref()},__wbg_addEventListener_3acb0aad4483804c:function(){return y(function(A,g,I,C){A.addEventListener(c(g,I),C)},arguments)},__wbg_apply_2e22c45cb4f12415:function(){return y(function(A,g,I){return Reflect.apply(A,g,I)},arguments)},__wbg_apply_ada2ee1a60ac7b3c:function(){return y(function(A,g,I){return A.apply(g,I)},arguments)},__wbg_arrayBuffer_bb54076166006c39:function(){return y(function(A){return A.arrayBuffer()},arguments)},__wbg_bind_1dc37de2b9939128:function(A,g,I,C){return A.bind(g,I,C)},__wbg_bind_29ba380591735d8c:function(A,g,I){return A.bind(g,I)},__wbg_buffer_7b5f53e46557d8f1:function(A){return A.buffer},__wbg_byteLength_7b03c17ff1e4037f:function(A){return A.byteLength},__wbg_byteLength_b5d783d06792ed2c:function(A){return A.byteLength},__wbg_call_389efe28435a9388:function(){return y(function(A,g){return A.call(g)},arguments)},__wbg_call_4708e0c13bdc8e95:function(){return y(function(A,g,I){return A.call(g,I)},arguments)},__wbg_compareExchange_b578410c358e695e:function(){return y(function(A,g,I,C){return Atomics.compareExchange(A,g>>>0,I,C)},arguments)},__wbg_constructor_ad6c0ed428f55d34:function(A){return A.constructor},__wbg_crypto_86f2631e91b51511:function(A){return A.crypto},__wbg_customSections_193491b069139fb1:function(A,g,I){return WebAssembly.Module.customSections(A,c(g,I))},__wbg_data_5330da50312d0bc1:function(A){return A.data},__wbg_done_57b39ecd9addfe81:function(A){return A.done},__wbg_entries_58c7934c745daac7:function(A){return Object.entries(A)},__wbg_error_7534b8e9a36f1ab4:function(A,g){let I,C;try{I=A,C=g,console.error(c(A,g))}finally{M.__wbindgen_free(I,C,1)}},__wbg_exports_794a42000dacd046:function(A){return WebAssembly.Module.exports(A)},__wbg_exports_86b4926134c40288:function(A){return A.exports},__wbg_fetch_d1488f40cef1e210:function(A,g,I){return A.fetch(c(g,I))},__wbg_from_bddd64e7d5ff6941:function(A){return Array.from(A)},__wbg_getPrototypeOf_2653517f1dc884d5:function(){return y(function(A){return Reflect.getPrototypeOf(A)},arguments)},__wbg_getRandomValues_b3f15fcbfabb0f8b:function(){return y(function(A,g){A.getRandomValues(g)},arguments)},__wbg_getTime_1e3cd1391c5c3995:function(A){return A.getTime()},__wbg_getTimezoneOffset_81776d10a4ec18a8:function(A){return A.getTimezoneOffset()},__wbg_getUint32_bb6f5a401408e7fa:function(A,g,I){return A.getUint32(g>>>0,I!==0)},__wbg_get_7efbcc3819719b0f:function(){return y(function(A,g){return A.get(g>>>0)},arguments)},__wbg_get_9b94d73e6221f75c:function(A,g){return A[g>>>0]},__wbg_get_b3ed3ad4be2bc8ac:function(){return y(function(A,g){return Reflect.get(A,g)},arguments)},__wbg_get_index_253dd2a9e007656d:function(A,g){return A[g>>>0]},__wbg_get_index_9a5bfdd2ca49c65f:function(A,g){return A[g>>>0]},__wbg_get_with_ref_key_1dc361bd10053bfe:function(A,g){return A[g]},__wbg_grow_5d42bf28c2da22cb:function(){return y(function(A,g){return A.grow(g>>>0)},arguments)},__wbg_grow_d034989fce14cc8e:function(){return y(function(A,g){return A.grow(g>>>0)},arguments)},__wbg_imports_8333d40ab24779ad:function(A){return WebAssembly.Module.imports(A)},__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:function(A){let g;try{g=A instanceof ArrayBuffer}catch{g=!1}return g},__wbg_instanceof_Error_8573fe0b0b480f46:function(A){let g;try{g=A instanceof Error}catch{g=!1}return g},__wbg_instanceof_Function_2a29eec978bb3b11:function(A){let g;try{g=A instanceof Function}catch{g=!1}return g},__wbg_instanceof_Global_2db767b6b2347f01:function(A){let g;try{g=A instanceof WebAssembly.Global}catch{g=!1}return g},__wbg_instanceof_Map_53af74335dec57f4:function(A){let g;try{g=A instanceof Map}catch{g=!1}return g},__wbg_instanceof_Memory_dc8c61e3f831ee37:function(A){let g;try{g=A instanceof WebAssembly.Memory}catch{g=!1}return g},__wbg_instanceof_Module_d0d412b14363ba9a:function(A){let g;try{g=A instanceof WebAssembly.Module}catch{g=!1}return g},__wbg_instanceof_Object_1c6af87502b733ed:function(A){let g;try{g=A instanceof Object}catch{g=!1}return g},__wbg_instanceof_RangeError_0b0dd056bc557b89:function(A){let g;try{g=A instanceof RangeError}catch{g=!1}return g},__wbg_instanceof_Response_ee1d54d79ae41977:function(A){let g;try{g=A instanceof Response}catch{g=!1}return g},__wbg_instanceof_SharedArrayBuffer_91d8a2fa16a2cc26:function(A){let g;try{g=A instanceof SharedArrayBuffer}catch{g=!1}return g},__wbg_instanceof_Table_127f216e592f4159:function(A){let g;try{g=A instanceof WebAssembly.Table}catch{g=!1}return g},__wbg_instanceof_Tag_f1d6b24a98b95210:function(A){let g;try{g=A instanceof WebAssembly.Tag}catch{g=!1}return g},__wbg_instanceof_Uint8Array_9b9075935c74707c:function(A){let g;try{g=A instanceof Uint8Array}catch{g=!1}return g},__wbg_isArray_d314bb98fcf08331:function(A){return Array.isArray(A)},__wbg_isSafeInteger_bfbc7332a9768d2a:function(A){return Number.isSafeInteger(A)},__wbg_is_f29129f676e5410c:function(A,g){return Object.is(A,g)},__wbg_iterator_6ff6560ca1568e55:function(){return Symbol.iterator},__wbg_length_32ed9a279acd054c:function(A){return A.length},__wbg_length_35a7bace40f36eac:function(A){return A.length},__wbg_length_aeb94ff17a8a8556:function(A){return A.length},__wbg_load_eff64ff5e429a422:function(){return y(function(A,g){return Atomics.load(A,g>>>0)},arguments)},__wbg_message_9ddc4b9a62a7c379:function(A){return A.message},__wbg_msCrypto_d562bbe83e0d4b91:function(A){return A.msCrypto},__wbg_new_0728bd2d4c5d41dd:function(){return y(function(A){return new WebAssembly.Tag(A)},arguments)},__wbg_new_0_73afc35eb544e539:function(){return new Date},__wbg_new_245cd5c49157e602:function(A){return new Date(A)},__wbg_new_2ac7fa8be584d280:function(A,g,I){return new DataView(A,g>>>0,I>>>0)},__wbg_new_361308b2356cecd0:function(){return new Object},__wbg_new_3eb36ae241fe6f44:function(){return new Array},__wbg_new_4a996a46a82782b6:function(){return y(function(A,g){return new WebAssembly.Global(A,g)},arguments)},__wbg_new_57c27ff3ddf5b62c:function(){return y(function(A){return new WebAssembly.Module(A)},arguments)},__wbg_new_67274f72d5abea37:function(){return y(function(A){return new WebAssembly.Table(A)},arguments)},__wbg_new_8a6f238a6ece86ea:function(){return new Error},__wbg_new_a4e3cab1cdd635ba:function(){return y(function(A,g){return new WebAssembly.Instance(A,g)},arguments)},__wbg_new_b061c0550d9f3281:function(){return y(function(A){return new WebAssembly.Memory(A)},arguments)},__wbg_new_b5d9e2fb389fef91:function(A,g){try{var I={a:A,b:g},C=(i,D)=>{const N=I.a;I.a=0;try{return xA(N,I.b,i,D)}finally{I.a=N}};return new Promise(C)}finally{I.a=I.b=0}},__wbg_new_ca409f861989e0c5:function(A){return new SharedArrayBuffer(A>>>0)},__wbg_new_dca287b076112a51:function(){return new Map},__wbg_new_dd2b680c8bf6ae29:function(A){return new Uint8Array(A)},__wbg_new_from_slice_a3d2629dc1826784:function(A,g){return new Uint8Array(r(A,g))},__wbg_new_no_args_1c7c842f08d00ebb:function(A,g){return new Function(c(A,g))},__wbg_new_with_args_7bba34e94b1cfa40:function(A,g,I,C){return new Function(c(A,g),c(I,C))},__wbg_new_with_byte_offset_9120ba79e057895b:function(A,g){return new Uint8Array(A,g>>>0)},__wbg_new_with_byte_offset_and_length_aa261d9c9da49eb1:function(A,g,I){return new Uint8Array(A,g>>>0,I>>>0)},__wbg_new_with_byte_offset_and_length_bc2e7b72cc96d1c1:function(A,g,I){return new Int32Array(A,g>>>0,I>>>0)},__wbg_new_with_length_1763c527b2923202:function(A){return new Array(A>>>0)},__wbg_new_with_length_a2c39cbe88fd8ff1:function(A){return new Uint8Array(A>>>0)},__wbg_next_3482f54c49e8af19:function(){return y(function(A){return A.next()},arguments)},__wbg_next_418f80d8f5303233:function(A){return A.next},__wbg_node_e1f24f89a7336c2e:function(A){return A.node},__wbg_notify_78a90977fab74963:function(){return y(function(A,g){return Atomics.notify(A,g>>>0)},arguments)},__wbg_now_a3af9a2f4bbaa4d1:function(){return Date.now()},__wbg_now_ebffdf7e580f210d:function(A){return A.now()},__wbg_ok_87f537440a0acf85:function(A){return A.ok},__wbg_postMessage_2041f4e90af61318:function(){return y(function(A,g){A.postMessage(g)},arguments)},__wbg_process_3975fd6c72f520aa:function(A){return A.process},__wbg_prototypesetcall_bdcdcc5842e4d77d:function(A,g,I){Uint8Array.prototype.set.call(r(A,g),I)},__wbg_push_8ffdcb2063340ba5:function(A,g){return A.push(g)},__wbg_queueMicrotask_0aa0a927f78f5d98:function(A){return A.queueMicrotask},__wbg_queueMicrotask_5bb536982f78a56f:function(A){queueMicrotask(A)},__wbg_randomFillSync_f8c153b79f285817:function(){return y(function(A,g){A.randomFillSync(g)},arguments)},__wbg_removeEventListener_e63328781a5b9af9:function(){return y(function(A,g,I,C){A.removeEventListener(c(g,I),C)},arguments)},__wbg_require_b74f47fc2d022fd6:function(){return y(function(){return module.require},arguments)},__wbg_resolve_002c4b7d9d8f6b64:function(A){return Promise.resolve(A)},__wbg_setTimeout_e0aacd5a637418a6:function(){return y(function(A,g,I){return A.setTimeout(g,I)},arguments)},__wbg_setUint32_d168af7751a8557e:function(A,g,I,C){A.setUint32(g>>>0,I>>>0,C!==0)},__wbg_set_0af2522656c2a71b:function(){return y(function(A,g,I){A.set(g>>>0,I)},arguments)},__wbg_set_1eb0999cf5d27fc8:function(A,g,I){return A.set(g,I)},__wbg_set_25cf9deff6bf0ea8:function(A,g,I){A.set(g,I>>>0)},__wbg_set_3f1d0b984ed272ed:function(A,g,I){A[g]=I},__wbg_set_6cb8631f80447a67:function(){return y(function(A,g,I){return Reflect.set(A,g,I)},arguments)},__wbg_set_cc56eefd2dd91957:function(A,g,I){A.set(r(g,I))},__wbg_set_f43e577aea94465b:function(A,g,I){A[g>>>0]=I},__wbg_set_index_b3244a6c458021e4:function(A,g,I){A[g>>>0]=I},__wbg_set_index_f259b54e97f7b177:function(A,g,I){A[g>>>0]=I},__wbg_set_onmessage_ea7cc2ba099021cd:function(A,g){A.onmessage=g},__wbg_set_value_fc06e541de098215:function(A,g){A.value=g},__wbg_slice_8bbd46adb2100583:function(A,g,I){return A.slice(g>>>0,I>>>0)},__wbg_stack_0ed75d68575b0f3c:function(A,g){const I=g.stack,C=O(I,M.__wbindgen_malloc,M.__wbindgen_realloc),B=Z;L().setInt32(A+4,B,!0),L().setInt32(A+0,C,!0)},__wbg_static_accessor_GLOBAL_12837167ad935116:function(){const A=typeof global>"u"?null:global;return x(A)?0:j(A)},__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f:function(){const A=typeof globalThis>"u"?null:globalThis;return x(A)?0:j(A)},__wbg_static_accessor_SELF_a621d3dfbb60d0ce:function(){const A=typeof self>"u"?null:self;return x(A)?0:j(A)},__wbg_static_accessor_WINDOW_f8727f0cf888e0bd:function(){const A=typeof window>"u"?null:window;return x(A)?0:j(A)},__wbg_store_d1d951c98d9bed41:function(){return y(function(A,g,I){return Atomics.store(A,g>>>0,I)},arguments)},__wbg_subarray_a96e1fef17ed23cb:function(A,g,I){return A.subarray(g>>>0,I>>>0)},__wbg_then_0d9fe2c7b1857d32:function(A,g,I){return A.then(g,I)},__wbg_then_b9e7b3b5f1a9e1b5:function(A,g){return A.then(g)},__wbg_toString_56d946daff83867b:function(A,g,I){const C=g.toString(I),B=O(C,M.__wbindgen_malloc,M.__wbindgen_realloc),i=Z;L().setInt32(A+4,i,!0),L().setInt32(A+0,B,!0)},__wbg_toString_964ff7fe6eca8362:function(A){return A.toString()},__wbg_trap_new:function(A){return t.__wrap(A)},__wbg_validate_71c2d02a71bda62f:function(){return y(function(A){return WebAssembly.validate(A)},arguments)},__wbg_value_0546255b415e96c1:function(A){return A.value},__wbg_value_ce37a60e576310ff:function(A){return A.value},__wbg_versions_4e31226f5e8dc909:function(A){return A.versions},__wbg_wait_be5dae1e53f590f1:function(){return y(function(A,g,I){return Atomics.wait(A,g>>>0,I)},arguments)},__wbg_warn_81ab00e6e16e886d:function(A,g,I){console.warn(A,g,I)},__wbindgen_cast_0000000000000001:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,oA)},__wbindgen_cast_0000000000000002:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,oA)},__wbindgen_cast_0000000000000003:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_for__a__core_37ee0ce0c4cd57d5___ops__function__FnMut____a_js_sys_9eaf8169b8189500___Array____Output___core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue___,pA)},__wbindgen_cast_0000000000000004:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__FnMut__wasm_bindgen_36932265c58943ab___JsValue____Output_______,aA)},__wbindgen_cast_0000000000000005:function(A,g){return dA(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______,HA)},__wbindgen_cast_0000000000000006:function(A,g){return l(A,g,M.wasm_bindgen_36932265c58943ab___closure__destroy___dyn_core_37ee0ce0c4cd57d5___ops__function__Fn__web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent____Output_______,qA)},__wbindgen_cast_0000000000000007:function(A){return A},__wbindgen_cast_0000000000000008:function(A){return A},__wbindgen_cast_0000000000000009:function(A,g){return r(A,g)},__wbindgen_cast_000000000000000a:function(A,g){return c(A,g)},__wbindgen_cast_000000000000000b:function(A,g){return BigInt.asUintN(64,A)|BigInt.asUintN(64,g)<<BigInt(64)},__wbindgen_cast_000000000000000c:function(A){return BigInt.asUintN(64,A)},__wbindgen_cast_000000000000000d:function(A,g){var I=kA(A,g).slice();return M.__wbindgen_free(A,g*4,4),I},__wbindgen_init_externref_table:function(){const A=M.__wbindgen_externrefs,g=A.grow(4);A.set(0,void 0),A.set(g+0,void 0),A.set(g+1,null),A.set(g+2,!0),A.set(g+3,!1)}}}}function aA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue_____(Q,A,g)}function HA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent_____(Q,A,g)}function qA(Q,A,g){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___web_sys_ca373f7aaf47173f___features__gen_MessageEvent__MessageEvent______1_(Q,A,g)}function pA(Q,A,g){const I=M.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_36932265c58943ab___JsValue__(Q,A,g);if(I[1])throw AA(I[0])}function oA(Q,A,g){const I=M.wasm_bindgen_36932265c58943ab___convert__closures________invoke___js_sys_9eaf8169b8189500___Array__core_37ee0ce0c4cd57d5___result__Result_js_sys_9eaf8169b8189500___Array__wasm_bindgen_36932265c58943ab___JsValue__(Q,A,g);if(I[2])throw AA(I[1]);return AA(I[0])}function xA(Q,A,g,I){M.wasm_bindgen_36932265c58943ab___convert__closures_____invoke___wasm_bindgen_36932265c58943ab___JsValue__wasm_bindgen_36932265c58943ab___JsValue_____(Q,A,g,I)}const NA=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>M.__wbg_dapadapter_free(Q>>>0,1)),MA=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>M.__wbg_trap_free(Q>>>0,1));function j(Q){const A=M.__externref_table_alloc();return M.__wbindgen_externrefs.set(A,Q),A}const n=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(Q=>Q.dtor(Q.a,Q.b));function $(Q){const A=typeof Q;if(A=="number"||A=="boolean"||Q==null)return`${Q}`;if(A=="string")return`"${Q}"`;if(A=="symbol"){const C=Q.description;return C==null?"Symbol":`Symbol(${C})`}if(A=="function"){const C=Q.name;return typeof C=="string"&&C.length>0?`Function(${C})`:"Function"}if(Array.isArray(Q)){const C=Q.length;let B="[";C>0&&(B+=$(Q[0]));for(let i=1;i<C;i++)B+=", "+$(Q[i]);return B+="]",B}const g=/\[object ([^\]]+)\]/.exec(toString.call(Q));let I;if(g&&g.length>1)I=g[1];else return toString.call(Q);if(I=="Object")try{return"Object("+JSON.stringify(Q)+")"}catch{return"Object"}return Q instanceof Error?`${Q.name}: ${Q.message}
2
+ ${Q.stack}`:I}function kA(Q,A){Q=Q>>>0;const g=L(),I=[];for(let C=Q;C<Q+4*A;C+=4)I.push(M.__wbindgen_externrefs.get(g.getUint32(C,!0)));return M.__externref_drop_slice(Q,A),I}function r(Q,A){return Q=Q>>>0,V().subarray(Q/1,Q/1+A)}let W=null;function L(){return(W===null||W.buffer.detached===!0||W.buffer.detached===void 0&&W.buffer!==M.memory.buffer)&&(W=new DataView(M.memory.buffer)),W}function c(Q,A){return Q=Q>>>0,zA(Q,A)}let T=null;function V(){return(T===null||T.byteLength===0)&&(T=new Uint8Array(M.memory.buffer)),T}function y(Q,A){try{return Q.apply(this,A)}catch(g){const I=j(g);M.__wbindgen_exn_store(I)}}function x(Q){return Q==null}function dA(Q,A,g,I){const C={a:Q,b:A,cnt:1,dtor:g},B=(...i)=>{C.cnt++;try{return I(C.a,C.b,...i)}finally{B._wbg_cb_unref()}};return B._wbg_cb_unref=()=>{--C.cnt===0&&(C.dtor(C.a,C.b),C.a=0,n.unregister(C))},n.register(B,C,C),B}function l(Q,A,g,I){const C={a:Q,b:A,cnt:1,dtor:g},B=(...i)=>{C.cnt++;const D=C.a;C.a=0;try{return I(D,C.b,...i)}finally{C.a=D,B._wbg_cb_unref()}};return B._wbg_cb_unref=()=>{--C.cnt===0&&(C.dtor(C.a,C.b),C.a=0,n.unregister(C))},n.register(B,C,C),B}function O(Q,A,g){if(g===void 0){const D=f.encode(Q),N=A(D.length,1)>>>0;return V().subarray(N,N+D.length).set(D),Z=D.length,N}let I=Q.length,C=A(I,1)>>>0;const B=V();let i=0;for(;i<I;i++){const D=Q.charCodeAt(i);if(D>127)break;B[C+i]=D}if(i!==I){i!==0&&(Q=Q.slice(i)),C=g(C,I,I=i+Q.length*3,1)>>>0;const D=V().subarray(C+i,C+I),N=f.encodeInto(Q,D);i+=N.written,C=g(C,I,i,1)>>>0}return Z=i,C}function AA(Q){const A=M.__wbindgen_externrefs.get(Q);return M.__externref_table_dealloc(Q),A}let u=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});u.decode();const ZA=2146435072;let gA=0;function zA(Q,A){return gA+=A,gA>=ZA&&(u=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),u.decode(),gA=A),u.decode(V().subarray(Q,Q+A))}const f=new TextEncoder;"encodeInto"in f||(f.encodeInto=function(Q,A){const g=f.encode(Q);return A.set(g),{read:Q.length,written:g.length}});let Z=0,M;function WA(Q,A){return M=Q.exports,W=null,T=null,M.__wbindgen_start(),M}async function OA(Q,A){if(typeof Response=="function"&&Q instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(Q,A)}catch(C){if(Q.ok&&g(Q.type)&&Q.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",C);else throw C}const I=await Q.arrayBuffer();return await WebAssembly.instantiate(I,A)}else{const I=await WebAssembly.instantiate(Q,A);return I instanceof WebAssembly.Instance?{instance:I,module:Q}:I}function g(I){switch(I){case"basic":case"cors":case"default":return!0}return!1}}async function tA(Q){if(M!==void 0)return M;Q!==void 0&&(Object.getPrototypeOf(Q)===Object.prototype?{module_or_path:Q}=Q:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),Q===void 0&&(Q=new URL("",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:z&&z.tagName.toUpperCase()==="SCRIPT"&&z.src||new URL("glassjar.umd.cjs",document.baseURI).href));const A=cA();(typeof Q=="string"||typeof Request=="function"&&Q instanceof Request||typeof URL=="function"&&Q instanceof URL)&&(Q=fetch(Q));const{instance:g,module:I}=await OA(await Q,A);return WA(g)}const jA=new URL("https://cdn.jsdelivr.net/npm/glassjar@0.5.1/dist/engine_bg.wasm"),TA=Object.freeze({maxObjectBytes:128*1024*1024,maxEntries:256,maxMetadataBytes:8*1024*1024,maxEntryMetadataBytes:1024*1024});class VA{records=new Map;staged=new Map;stagingFailed=!1;objectBytes=0;metadataBytes=0;evictions=0;oversized=0;limits;constructor(A={}){this.limits=Object.freeze({...TA,...A});for(const g of Object.values(this.limits))if(!Number.isSafeInteger(g)||g<0)throw new RangeError("C++ cache limits must be nonnegative safe integers")}beginBatch(){this.discardBatch(),this.stagingFailed=!1}stage(A){if(this.stagingFailed)return;const g=this.recordSize(A);if(g===void 0||this.staged.has(A.source)){this.failBatch();return}const I=this.limits;for(;this.records.size&&(this.records.size+this.staged.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes);)this.remove(this.records.keys().next().value),this.evictions++;if(this.records.size+this.staged.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes||g>I.maxEntryMetadataBytes){this.oversized++,this.failBatch();return}this.staged.set(A.source,{...A,object:new Uint8Array(A.object),metadataBytes:g}),this.objectBytes+=A.object.byteLength,this.metadataBytes+=g}abandonBatch(){this.failBatch()}failBatch(){this.discardBatch(),this.stagingFailed=!0}recordSize(A){if(!(typeof A.source!="string"||!A.source.startsWith("/")||A.source.split("/").slice(1).some(g=>!g||g==="."||g==="..")||typeof A.key!="string"||typeof A.object_hash!="string"||!/^[a-f0-9]{64}$/.test(A.key)||!/^[a-f0-9]{64}$/.test(A.object_hash)||A.receipt!=null&&typeof A.receipt!="string"||!(A.object instanceof Uint8Array)))return new TextEncoder().encode(JSON.stringify({source:A.source,key:A.key,object_hash:A.object_hash,...A.receipt==null?{}:{receipt:A.receipt}})).byteLength}async validateBatch(){if(this.stagingFailed)return!1;const A=[...this.staged.values()];for(const g of A){if(!lA(g.object))return!1;const I=await crypto.subtle.digest("SHA-256",g.object);if(Array.from(new Uint8Array(I),B=>B.toString(16).padStart(2,"0")).join("")!==g.object_hash)return!1}return!0}commitBatch(){for(const[A,g]of this.staged)this.remove(A),this.records.set(A,g);this.staged.clear(),this.stagingFailed=!1}discardBatch(){for(const A of this.staged.values())this.objectBytes-=A.object.byteLength,this.metadataBytes-=A.metadataBytes;this.staged.clear()}snapshot(){return[...this.records.values()].map(({source:A,key:g,object_hash:I,object:C,receipt:B})=>({source:A,key:g,object_hash:I,...B==null?{}:{receipt:B},object:C.slice()}))}touch(A){const g=this.records.get(A);g&&(this.records.delete(A),this.records.set(A,g))}put(A){if(typeof A.source!="string"||!A.source.startsWith("/")||A.source.split("/").slice(1).some(B=>!B||B==="."||B==="..")||typeof A.key!="string"||typeof A.object_hash!="string"||!/^[a-f0-9]{64}$/.test(A.object_hash)||!/^[a-f0-9]{64}$/.test(A.key)||!(A.object instanceof Uint8Array))return;const g=this.recordSize(A);if(g===void 0)return;const I=this.limits;if(this.remove(A.source),I.maxEntries===0||A.object.byteLength>I.maxObjectBytes||g>I.maxMetadataBytes||g>I.maxEntryMetadataBytes){this.oversized++;return}for(;this.records.size>=I.maxEntries||this.objectBytes+A.object.byteLength>I.maxObjectBytes||this.metadataBytes+g>I.maxMetadataBytes;)this.remove(this.records.keys().next().value),this.evictions++;const C={...A,object:new Uint8Array(A.object),metadataBytes:g};this.records.set(A.source,C),this.objectBytes+=C.object.byteLength,this.metadataBytes+=g}delete(A){this.remove(A)}remove(A){const g=this.records.get(A);g&&(this.objectBytes-=g.object.byteLength,this.metadataBytes-=g.metadataBytes,this.records.delete(A))}clear(){this.records.clear(),this.staged.clear(),this.stagingFailed=!1,this.objectBytes=this.metadataBytes=0}stats(){return{objectBytes:this.objectBytes,metadataBytes:this.metadataBytes,entries:this.records.size,stagingEntries:this.staged.size,stagingObjectBytes:[...this.staged.values()].reduce((A,g)=>A+g.object.byteLength,0),stagingMetadataBytes:[...this.staged.values()].reduce((A,g)=>A+g.metadataBytes,0),evictions:this.evictions,oversized:this.oversized}}}function lA(Q){if(!WebAssembly.validate(Q)||Q.length<8)return!1;let A=8,g=!1;const I=()=>{let C=0,B=0;for(let i=0;i<5&&A<Q.length;i++,B+=7){const D=Q[A++];if(C+=(D&127)*2**B,!(D&128))return C}throw new Error("Malformed object section")};try{for(;A<Q.length;){const C=Q[A++],B=I(),i=A+B;if(i>Q.length||C===8)return!1;if(C===0){const D=I();if(A+D>i)return!1;const N=new TextDecoder().decode(Q.subarray(A,A+D));if(A+=D,N==="linking"){if(g||I()!==2)return!1;g=!0}}A=i}return g}catch{return!1}}const J=Symbol();function S(Q){return Q instanceof Error?{type:"error",error:{type:Q.constructor.name,message:Q.message}}:{type:"error",error:{type:typeof Q,message:String(Q)}}}class FA{name;data;constructor(A,g){this.name=A,this.data=g}download(){const A=new Uint8Array(this.data),g=new Blob([A]),I=URL.createObjectURL(g),C=document.createElement("a");C.href=I,C.download=this.name,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(I)}}class GA extends wA{[J];dap;enabled=!0;set filterInternals(A){this.dap.setFilterInternals(A)}constructor(){super(),this[J]={attach:this.attach.bind(this),detach:this.detach.bind(this),beginRun:()=>this.dap.resetRun()},this.onMessage=this.onMessage.bind(this),this.dap=new _,this.dap.on(this.onMessage)}send(A){return this.dap.sendMessage(A)}artifactListener=A=>{if(A.data.type!=="artifact")return;const g=new FA(A.data.name,new Uint8Array(A.data.data));this.emit("artifact",g)};attach(A){A.addEventListener("message",this.artifactListener),this.dap.attach(A)}detach(A){A.removeEventListener("message",this.artifactListener),this.dap.detach()}onMessage(A){this.emit("event",A)}}const fA="glassjar-wasm:";function bA(Q,A){const g=new URL(String(Q),A);if(g.protocol!=="https:"&&g.protocol!=="http:")throw new TypeError(`Engine Wasm must be served over http(s), not ${g.protocol}`);return g.href}function PA(Q){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/worker-nLuvLwEg.js").href:new URL("assets/worker-nLuvLwEg.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),{type:"module",name:Q?.name})}function XA(Q){return new PA(Q?{name:fA+Q}:void 0)}const mA="/dev/debugger-sh-host";class yA{buffer=new SharedArrayBuffer(4+64*1024);length=new Int32Array(this.buffer,0,1);bytes=new Uint8Array(this.buffer,4);publish(A){Atomics.store(this.length,0,A),Atomics.notify(this.length,0)}}function IA(Q){try{return new Error(`Host device callback failed: ${Q instanceof Error?Q.message:String(Q)}`)}catch{return new Error("Host device callback failed")}}function KA(Q){try{const A=Q?.();if(A&&typeof A.then=="function")return Promise.resolve(A).catch(()=>{}),new TypeError("Host device cleanup must be synchronous")}catch(A){return IA(A)}}class nA{constructor(A){this.onFailure=A}incoming=new yA;outgoing=new yA;workerStart={guest_to_host:this.incoming.buffer,host_to_guest:this.outgoing.buffer};abort=new AbortController;listeners=new Set;cleanup;worker;writing=!1;open(A){let g;try{g=A({signal:this.abort.signal,onData:I=>{if(this.assertOpen(),typeof I!="function")throw new TypeError("Host device listener must be a function");return this.listeners.add(I),()=>{this.listeners.delete(I)}},write:I=>this.write(I)})}catch(I){throw IA(I)}if(g!==void 0&&typeof g!="function")throw Promise.resolve(g).catch(()=>{}),new TypeError("Host device opener must return a cleanup function or undefined");if(typeof g=="function")if(this.abort.signal.aborted){const I=KA(g);if(I)throw I}else this.cleanup=g}attach(A){this.assertOpen(),this.worker=A,A.addEventListener("message",this.onMessage)}assertOpen(){if(this.abort.signal.aborted)throw new Error("Host device is closed")}async write(A){if(this.assertOpen(),!(A instanceof Uint8Array))throw new TypeError("Host device writes require Uint8Array");if(this.writing)throw new Error("Await the previous host device write before writing again");this.writing=!0;try{const g=new Uint8Array(A),I=this.outgoing;let C=0;for(;C<g.length;){this.assertOpen();const B=Atomics.load(I.length,0);if(B!==0){await Atomics.waitAsync(I.length,0,B).value;continue}const i=g.subarray(C,C+I.bytes.length);I.bytes.set(i),I.publish(i.length),C+=i.length}}finally{this.writing=!1}}onMessage=A=>{if(!(this.abort.signal.aborted||A.data?.type!=="host_wake"))try{const g=Atomics.load(this.incoming.length,0);if(g<=0)return;const I=this.incoming.bytes.slice(0,g);this.incoming.publish(0);for(const C of this.listeners){if(this.abort.signal.aborted)break;Promise.resolve(C(I)).catch(B=>this.fail(B))}}catch(g){this.fail(g)}};fail(A){this.abort.signal.aborted||(this.close(),this.onFailure(IA(A)))}close(){if(this.abort.signal.aborted)return;this.worker?.removeEventListener("message",this.onMessage),this.worker=void 0,this.incoming.publish(-1),this.outgoing.publish(-1),this.abort.abort(),this.listeners.clear();const A=this.cleanup;return this.cleanup=void 0,KA(A)}}const rA=["4847c7cda81eb51b1cec18fe40b396605579fe84e17eca2760702b8a9666e4e1"],e=Object.freeze({compiler:"2d2c6ae498b27592a3cec7a270f274a08848a834e762cc08818c78626c32053a",sysroot:"8745c6af23fd841fa507d0c73f6b6b8e8da1b4ec216a6339739a28b38ff7227b",exceptions:"20986166552953de0e3ca5c1e9f341e7aec8b9ba54dcb244d0d2b2f9ca843ab4"});function RA(Q="legacy"){if(Q==="legacy")return{profile:Q,digests:e};if(Q==="stock-certified-v1"&&rA.length>0)return{profile:Q,digests:e};throw new Error(`The ${Q} toolchain is not available in this build`)}class b{#A;hashCount=3;hashMs;constructor(A,g){this.#A=A,this.hashMs=g}static async load(A,g,I,C=e.exceptions,B="legacy"){const i=RA(B);if(A.length!==2)throw new Error("Missing C++ toolchain assets");let D,N;const K=await Promise.allSettled(A.map(async(P,EA)=>{try{const d=await fetch(P,{cache:"force-cache",signal:I});if(!d.ok)throw new Error(`Cannot load C++ toolchain (${d.status})`);return EA===0&&g&&typeof WebAssembly.compileStreaming=="function"&&typeof d.clone=="function"&&(N=WebAssembly.compileStreaming(d.clone()).catch(()=>{})),new Uint8Array(await d.arrayBuffer())}catch(d){throw D??={error:d},d}}));if(K[0].status==="rejected"||K[1].status==="rejected")throw D?.error;const[U,h]=[K[0].value,K[1].value],[Y,s]=await Promise.allSettled([b.ingestOwned(U,h,!1,C),g?(N??Promise.resolve(void 0)).then(P=>P??WebAssembly.compile(U)):Promise.resolve(void 0)]);if(Y.status==="rejected")throw Y.reason;const q=Y.value;if(q.#A.compilerHash!==i.digests.compiler||q.#A.sysrootHash!==i.digests.sysroot||q.#A.exceptionsHash!==i.digests.exceptions)throw new Error("C++ toolchain integrity mismatch");if(I?.aborted)throw new DOMException("Toolchain loading aborted","AbortError");if(s.status==="rejected")throw s.reason;return q.#A.stockProfile=i.profile==="stock-certified-v1",q.#A.module=s.value,q}static async fromBytes(A,g,I){const C=new Uint8Array(A),B=new Uint8Array(g);return b.ingestOwned(C,B,I,e.exceptions)}static async ingestOwned(A,g,I,C){const B=performance.now(),i=await Promise.allSettled([YA(A),YA(g)]);if(i[0].status==="rejected")throw i[0].reason;if(i[1].status==="rejected")throw i[1].reason;const[D,N]=[i[0].value,i[1].value],K=I?await WebAssembly.compile(A):void 0;return new b({compiler:A,sysroot:g,compilerHash:D,sysrootHash:N,exceptionsHash:C,module:K},performance.now()-B)}matchesExpectation(A){return A.compilerSha256===this.#A.compilerHash&&A.sysrootSha256===this.#A.sysrootHash&&A.exceptionsSha256===this.#A.exceptionsHash}get identity(){return`${this.#A.compilerHash}:${this.#A.sysrootHash}:${this.#A.exceptionsHash}`}get identityBytes(){return this.#A.compiler.byteLength+this.#A.sysroot.byteLength}get compilerBytes(){return this.#A.compiler.byteLength}configure(A,g){try{return A.postMessage({...g,toolchain:this.#A}),!!this.#A.module}catch(I){if(!(I instanceof DOMException)||I.name!=="DataCloneError"||!this.#A.module)throw I;return A.postMessage({...g,toolchain:{...this.#A,module:void 0}}),!1}}}async function YA(Q){const A=await crypto.subtle.digest("SHA-256",Q);return Array.from(new Uint8Array(A),g=>g.toString(16).padStart(2,"0")).join("")}let CA,v;class QA{stdout=new BA(1);stderr=new BA(2);stdin=new a;debugger;lang;scope;fs={};binaryFiles={};cppArtifacts;hostDevice;options;retain;idleTimeoutMs;wasmUrl;objects;generation=0;scopeEpoch=0;operationId=0;disposed=!1;active;promise;slot;idleTimer;toolchain;toolchainLoading;toolchainController;initializing=new Set;toolchainIdentity;toolchainIngestions=0;toolchainHashCount=0;toolchainHashMs=0;compilerModuleCloned=!1;disposal;cancellationDraining;releaseDrain;releases=new Set;retirements=0;latest;cacheValidation;static async create(A,g={}){const{wasmUrl:I,...C}=g,B=I===void 0?void 0:bA(I,globalThis.location?.href),i=structuredClone(C),D=B??null;if(v!==void 0&&v!==D)throw new Error("The engine Wasm is already loaded from a different wasmUrl");v=D,CA??=tA({module_or_path:B??jA}).catch(K=>{throw CA=void 0,v=void 0,K}),await CA;const N=new QA(A,i);if(N.wasmUrl=B,A!=="c"&&typeof window<"u"&&typeof fetch<"u")for(const K of iA(A))fetch(K,{cache:"force-cache"}).then(U=>U.arrayBuffer()).catch(()=>{});return N}constructor(A,g){const I=g.cpp;this.retain=g.retainWorker??I?.retainWorker??!0;const C=g.idleTimeoutMs??I?.idleTimeoutMs??3e4;if(!Number.isSafeInteger(C)||C<1||C>3e5)throw new RangeError("Worker idle timeout must be between 1 and 300000 milliseconds");if(this.idleTimeoutMs=C,I){if(A!=="c")throw new TypeError("C++ performance options require C/C++");if(!I.scope?.projectId||!I.scope.accountId)throw new TypeError("C++ performance options require project and account identity");if(I.compilerLifetime!==void 0&&!["idle","project"].includes(I.compilerLifetime))throw new TypeError("Invalid compiler lifetime");RA(I.toolchainProfile),this.scope=Object.freeze({...I.scope}),this.options=Object.freeze({...I,scope:this.scope,idleTimeoutMs:C})}this.objects=new VA(typeof I?.objectCache=="object"?I.objectCache:{}),this.debugger=new GA,this.lang=A}get cacheCompilerModule(){return this.options?.cacheCompilerModule??this.retain}get cacheStats(){return structuredClone({...this.objects.stats(),generation:this.generation,scopeEpoch:this.scopeEpoch,operationId:this.operationId,cacheEpoch:this.generation,toolchainProfile:this.options?.toolchainProfile??"legacy",cacheEligible:this.cacheValidation?.eligible??!1,stockCertificateSha256:this.cacheValidation?.certificate,cacheEligibilitySnapshot:this.cacheValidation?.snapshot,cacheEligibilityOperationId:this.cacheValidation?.operationId,cacheEligibilityReason:this.cacheValidation?.reason,toolchainIdentityBytes:this.toolchain?.identityBytes??0,toolchainIngestions:this.toolchainIngestions,toolchainHashCount:this.toolchainHashCount,toolchainHashMs:this.toolchainHashMs,compilerModuleCloned:this.compilerModuleCloned,workerRetained:!!this.slot&&!this.active,workerRetirements:this.retirements,compilerModuleIdentityBytes:this.cacheCompilerModule?this.toolchain?.compilerBytes??0:0,latest:this.active?.stats??this.latest})}clearCaches(){this.cacheValidation=void 0,this.generation++,this.objects.clear(),this.toolchain=void 0,this.active||(this.toolchainController?.abort(),this.toolchainLoading=void 0),this.active||this.retireWorker()}stop(){return this.clearCaches(),this.cancelCurrentOperation()}cancelCurrentOperation(){if(this.cancellationDraining)return this.cancellationDraining;this.operationId++;const A=this.promise,g=this.active?.publication;this.retireWorker(),this.objects.discardBatch(),this.active&&this.finish(this.active,{type:"stopped"});const I=Promise.allSettled([A,g]).then(()=>{this.cancellationDraining===I&&(this.cancellationDraining=void 0)});return this.cancellationDraining=I,I}releaseCompilerResources(A={}){const g=A.signal;return g?.aborted?Promise.resolve("cancelled"):this.disposed?Promise.resolve("released"):new Promise(I=>{const C={resolve:I,signal:g,abort:()=>this.settleRelease(C,"cancelled")};this.releases.add(C),g?.addEventListener("abort",C.abort,{once:!0}),this.flushReleases()})}settleRelease(A,g){this.releases.delete(A)&&(A.signal?.removeEventListener("abort",A.abort),A.resolve(g))}flushReleases(){if(!(this.active||!this.releases.size||this.releaseDrain)){if(this.initializing.size){this.toolchainController?.abort();const A=[...this.initializing];this.toolchainLoading=void 0,this.releaseDrain=Promise.allSettled(A).then(()=>{this.releaseDrain=void 0,this.flushReleases()});return}this.retireWorker(),this.toolchainController?.abort(),this.toolchain=void 0,this.toolchainLoading=void 0;for(const A of this.releases)this.settleRelease(A,"released")}}dispose(){if(this.disposal)return this.disposal;this.disposed=!0,this.scopeEpoch++,this.fs={},this.binaryFiles={},this.cppArtifacts=void 0,this.hostDevice=void 0,this.stdout.removeAllListeners(),this.stderr.removeAllListeners(),this.debugger.removeAllListeners();const A=[...this.initializing];return this.toolchainController?.abort(),this.disposal=Promise.allSettled([this.stop(),...A]).then(()=>{this.latest=void 0,this.flushReleases()}),this.disposal}prepareCompiler(A){if(A?.validateCacheInputs!==void 0&&typeof A.validateCacheInputs!="boolean")return Promise.resolve(S(new TypeError("Invalid compiler preparation options")));const g=A?.validateCacheInputs===!0&&this.options?.toolchainProfile==="stock-certified-v1"&&!!this.options?.objectCache&&this.objects.limits.maxEntries>0&&this.objects.limits.maxObjectBytes>0&&this.objects.limits.maxMetadataBytes>0&&this.objects.limits.maxEntryMetadataBytes>0;return this.submit(!0,!0,g)}run(){return this.submit(!1)}compile(){return this.submit(!0)}submit(A,g=!1,I=!1){if(this.disposed)return Promise.resolve(S(new Error("Engine is disposed")));if(this.active||this.cancellationDraining)return Promise.resolve(S(new Error("An engine job is already active")));if(A&&this.lang!=="c")return Promise.resolve(S(new Error("Compile-only is supported for C/C++")));this.cacheValidation=void 0;const C=g&&!I;let B;try{const Y=C||!this.cppArtifacts?null:{...this.cppArtifacts};if(Y?.cacheCertificate!==void 0){const s=Y.cacheCertificate;(typeof s!="string"||s.length>1024*1024||new TextEncoder().encode(s).byteLength>1024*1024)&&delete Y.cacheCertificate}B={fs:C?{}:structuredClone(this.fs),binary_files:Object.fromEntries(Object.entries(C?{}:this.binaryFiles).map(([s,q])=>[s,new Uint8Array(q)])),cpp_artifacts:structuredClone(Y)}}catch(Y){return Promise.resolve(S(Y))}const i=!A&&this.debugger.enabled,D=A?void 0:this.hostDevice;if(D!==void 0&&(typeof D!="function"||!["c","python"].includes(this.lang)))return Promise.resolve(S(new TypeError("Invalid host device configuration")));clearTimeout(this.idleTimer),this.stdin[J].clear();const N=!!this.slot;let K;const U=new Promise(Y=>{K=Y});this.promise=U;const h={generation:this.generation,scopeEpoch:this.scopeEpoch,operationId:++this.operationId,cacheEpoch:this.generation,prepareOnly:g,validateCacheInputs:I,settled:!1,buildOnly:A,debug:i,opener:D,startedAt:performance.now(),resolve:K,stats:{operation:g?"prepare_compiler":A?"compile":"run",workerReadyMs:0,workerReused:N},start:{...B,lang:this.lang,prepare_compiler:g,validate_cache_inputs:I,scope_epoch:this.scopeEpoch,operation_id:this.operationId,cache_epoch:this.generation,is_debug:i,build_only:A,stdin_buffer:this.stdin[J].buffer,cpp_cache:this.options?.objectCache&&!i&&!g?{generation:this.generation,entries:this.objects.snapshot(),max_entry_metadata_bytes:Math.min(this.objects.limits.maxEntryMetadataBytes,this.objects.limits.maxMetadataBytes,1024*1024)}:null}};this.objects.beginBatch(),this.active=h;try{if(this.slot||this.makeWorker(),!this.current(h))return U;const Y=this.slot;this.lang==="c"&&!this.toolchain&&this.ensureToolchain().catch(s=>{this.current(h)&&this.slot===Y&&this.finish(h,S(s))}),this.slot.ready&&this.dispatch(h)}catch(Y){this.finish(h,S(Y))}return U}current(A){return this.active===A&&!A.settled}makeWorker(){const A=XA(this.wasmUrl),g={worker:A,ready:!1,remove:()=>{}};this.slot=g;const I=i=>{if(this.slot!==g)return;const D=i.data,N=this.active;if(D.type==="ready"){if(g.ready)return;g.ready=!0,N&&this.current(N)&&this.dispatch(N);return}if(!(!N||!this.current(N))){if(!g.ready&&D.type==="error"){this.finish(N,S(new Error(D.message)));return}if(!(D.operationId!==N.operationId||D.scopeEpoch!==N.scopeEpoch))try{if(D.type==="cpp_cache_eligibility"){if(this.options?.toolchainProfile!=="stock-certified-v1"||N.prepareOnly&&!N.validateCacheInputs)return;const K=h=>typeof h=="string"&&/^[0-9a-f]{64}$/.test(h),U=D.eligible===!0&&K(D.certificate_sha256)&&K(D.snapshot);this.cacheValidation={eligible:U,certificate:K(D.certificate_sha256)?D.certificate_sha256:void 0,snapshot:U?D.snapshot:void 0,operationId:N.operationId,reason:U?void 0:typeof D.reason=="string"?D.reason.slice(0,128):"stock-input-validation"}}else if(D.type==="stop")this.finish(N,{type:"completed",exitCode:D.exit_code,timing:{totalMs:performance.now()-N.startedAt,buildMs:D.build_ms,runMs:D.run_ms}});else if(D.type==="error")this.finish(N,S(new Error(D.message)));else if(D.type==="cpp_cache_object"&&D.generation===this.generation&&N.generation===this.generation)try{this.objects.stage(D)}catch{this.objects.abandonBatch()}else D.type==="cpp_cache_stats"&&D.generation===N.generation?N.stats.cache=D.stats:D.type==="cpp_cache_abandon"?this.objects.abandonBatch():D.type==="object_build_complete"?N.publication??=this.publishObjects(N,g):D.type==="compiler_module_stats"&&(N.stats.compilerModule=D)}catch(K){this.finish(N,S(K))}}},C=i=>{this.slot===g&&(this.clearCaches(),this.active?this.finish(this.active,S(i.error??new Error(i.message))):this.retireWorker())},B=()=>C({message:"Unreadable execution worker message"});this.debugger[J].attach(A),A.addEventListener("message",I),A.addEventListener("error",C),A.addEventListener("messageerror",B),g.remove=()=>{A.removeEventListener("message",I),A.removeEventListener("error",C),A.removeEventListener("messageerror",B),this.debugger[J].detach(A)}}async publishObjects(A,g){let I=!1;try{I=await this.objects.validateBatch()}catch{}if(!(!this.current(A)||this.slot!==g)){try{I&&A.cacheEpoch===this.generation?this.objects.commitBatch():(this.objects.abandonBatch(),this.cacheValidation?.operationId===A.operationId&&(this.cacheValidation={...this.cacheValidation,eligible:!1,snapshot:void 0,reason:"stock-publication-budget-or-validation"}))}catch{this.objects.clear(),this.cacheValidation?.operationId===A.operationId&&(this.cacheValidation={...this.cacheValidation,eligible:!1,snapshot:void 0,reason:"stock-publication-failure"})}this.current(A)&&g.worker.postMessage({type:"object_build_ack",scopeEpoch:A.scopeEpoch,operationId:A.operationId,cacheEpoch:A.cacheEpoch})}}ensureToolchain(){if(this.toolchain)return Promise.resolve(this.toolchain);if(this.toolchainLoading)return this.toolchainLoading;this.toolchainController=new AbortController;const A=b.load(iA("c"),this.cacheCompilerModule,this.toolchainController.signal,sA(),this.options?.toolchainProfile);return this.toolchainLoading=A,this.initializing.add(A),A.then(()=>this.initializing.delete(A),()=>{this.initializing.delete(A),this.toolchainLoading===A&&(this.toolchainLoading=void 0)}),A}async dispatch(A){const g=this.slot;if(!(!this.current(A)||!g))try{if(this.lang==="c"){const B=this.scopeEpoch,i=this.generation,D=this.ensureToolchain(),N=this.toolchain??await D;if(!this.current(A)||this.slot!==g||B!==this.scopeEpoch)return;const K=A.start.cpp_artifacts?.requiredToolchain;if(K&&!N.matchesExpectation(K)){this.finish(A,{type:"error",error:{type:"artifact-toolchain-integrity",message:"C++ artifacts require a different compiler, sysroot, or exception runtime"}});return}i===this.generation&&(this.toolchainIdentity&&this.toolchainIdentity!==N.identity&&(this.objects.clear(),A.start.cpp_cache=null),this.toolchain!==N&&(this.toolchainIngestions++,this.toolchainHashCount+=N.hashCount,this.toolchainHashMs+=N.hashMs),this.toolchainIdentity=N.identity,this.toolchain=N,this.toolchainLoading===D&&(this.toolchainLoading=void 0)),g.toolchain!==N&&(this.compilerModuleCloned=N.configure(g.worker,{type:"configure_cpp",cacheCompilerModule:this.cacheCompilerModule}),g.toolchain=N)}if(!this.current(A)||this.slot!==g)return;const I=g.worker;A.stats.workerReadyMs=performance.now()-A.startedAt;const C=B=>this.current(A)&&B.scopeEpoch===A.scopeEpoch&&B.operationId===A.operationId;if(this.stdout[J].attach(I,C),this.stderr[J].attach(I,C),A.prepareOnly||this.debugger[J].beginRun(),A.opener){if(A.device=new nA(B=>this.finish(A,S(B))),A.device.attach(I),A.device.open(A.opener),!this.current(A))return;A.start.host_device=A.device.workerStart}this.current(A)&&(I.postMessage(A.start),A.start.fs={},A.start.binary_files={},A.start.cpp_artifacts=null,A.start.cpp_cache=null)}catch(I){this.current(A)&&(this.toolchainLoading=void 0,this.finish(A,S(I)))}}finish(A,g){if(!this.current(A))return;(g.type!=="completed"||g.exitCode!==0)&&(this.cacheValidation=void 0),A.settled=!0;const I=this.slot?.worker;I&&(this.stdout[J].detach(I),this.stderr[J].detach(I));const C=A.device?.close();C&&(g=S(C));const B=g.type==="completed"&&A.generation===this.generation&&!this.disposed,i=B&&g.type==="completed"&&g.exitCode===0;if(A.generation===this.generation)for(const D of A.stats.cache?.invalid_sources??[])this.objects.delete(D);if(i)for(const D of A.stats.cache?.hit_sources??[])this.objects.touch(D);this.objects.discardBatch(),this.latest=A.stats,this.stdin[J].clear(),(!B||!this.retain)&&this.retireWorker(),!this.disposed&&A.cacheEpoch===this.generation&&(this.slot||this.toolchain&&this.cacheCompilerModule)&&this.options?.compilerLifetime!=="project"&&(this.idleTimer=setTimeout(()=>{this.retireWorker(),this.toolchain=void 0,this.toolchainLoading=void 0},this.idleTimeoutMs)),!this.retain&&!this.cacheCompilerModule&&(this.toolchain=void 0),A.cacheEpoch!==this.generation&&(this.toolchainController?.abort(),this.toolchainLoading=void 0),this.active=void 0,this.promise=void 0,this.flushReleases(),A.resolve(g)}retireWorker(){clearTimeout(this.idleTimer);const A=this.slot;A&&(this.slot=void 0,A.remove(),this.stdout[J].detach(A.worker),this.stderr[J].detach(A.worker),A.worker.onerror=g=>g.preventDefault(),A.worker.terminate(),this.retirements++)}}class BA extends wA{constructor(A){super(),this.mode=A,this.callback=(g=>{const I=g.data;if(this.accepts&&!this.accepts(I)||I.type!=="stdout"||I.mode!==this.mode)return;const C=I.data;this.emit("data",C)}).bind(this),this[J]={attach:this.attach.bind(this),detach:this.detach.bind(this)}}callback;accepts;[J];attach(A,g){this.accepts=g,A.addEventListener("message",this.callback)}detach(A){A.removeEventListener("message",this.callback)}}class a{static BUFFER_SIZE=2048;static HEADER_SIZE=8;static DATA_SIZE=a.BUFFER_SIZE-a.HEADER_SIZE;static READ_IDX=0;static WRITE_IDX=1;static encoder=new TextEncoder;buffer=new SharedArrayBuffer(a.BUFFER_SIZE);generation=0;indices;data;[J];constructor(){this.indices=new Int32Array(this.buffer,0,2),this.data=new Int8Array(this.buffer,a.HEADER_SIZE);const A=()=>this.buffer;this[J]={clear:this.clear.bind(this),get buffer(){return A()}}}clear(){this.generation++,Atomics.notify(this.indices,a.READ_IDX),this.buffer=new SharedArrayBuffer(a.BUFFER_SIZE),this.indices=new Int32Array(this.buffer,0,2),this.data=new Int8Array(this.buffer,a.HEADER_SIZE)}async write(A){const g=typeof A=="string"?a.encoder.encode(A):A;return this.writeBytes(g)}async writeBytes(A){const{DATA_SIZE:g,READ_IDX:I,WRITE_IDX:C}=a;let B=0;const i=this.generation;for(;B<A.length&&i===this.generation;){const D=Atomics.load(this.indices,I);let N=Atomics.load(this.indices,C);N===g-1&&D>0&&(N=0);const K=D<=N?g-N-1:D-N-1;if(K===0){await Atomics.waitAsync(this.indices,I,D).value;continue}const U=Math.min(A.length-B,K);this.data.set(A.subarray(B,B+U),N),Atomics.store(this.indices,C,(N+U)%g),Atomics.notify(this.indices,C),B+=U}}}H.Artifact=FA,H.Debugger=GA,H.Engine=QA,H.HOST_DEVICE_PATH=mA,H.Stdin=a,H.Stdout=BA,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glassjar",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "A browser-based execution engine and debugger powered by WebAssembly",
5
5
  "keywords": [
6
6
  "wasm",