@yoltra/devtools-ui 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,47 @@
1
- import Re, { createContext as ve, useState as k, useRef as A, useCallback as O, useEffect as M, useContext as be, useMemo as Oe } from "react";
2
- import { DevtoolsRole as b, PROTOCOL_VERSION as K } from "@yoltra/devtools-protocol";
3
- const H = () => {
4
- }, de = ve({
1
+ import Re, { createContext as be, useState as A, useRef as I, useCallback as O, useEffect as M, useContext as ve, useMemo as Oe } from "react";
2
+ import { DevtoolsRole as v, PROTOCOL_VERSION as K } from "@yoltra/devtools-protocol";
3
+ const W = () => {
4
+ }, de = be({
5
5
  status: "disconnected",
6
6
  extensionId: "",
7
- send: H,
8
- subscribe: () => H,
9
- disconnect: H,
10
- reconnect: H
7
+ send: W,
8
+ subscribe: () => W,
9
+ disconnect: W,
10
+ reconnect: W
11
11
  });
12
- var X = { exports: {} }, L = {};
13
- var ie;
14
- function ye() {
15
- if (ie) return L;
16
- ie = 1;
17
- var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
18
- function r(o, t, c) {
19
- var i = null;
20
- if (c !== void 0 && (i = "" + c), t.key !== void 0 && (i = "" + t.key), "key" in t) {
12
+ var H = { exports: {} }, Y = {};
13
+ var ae;
14
+ function _e() {
15
+ if (ae) return Y;
16
+ ae = 1;
17
+ var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
18
+ function n(s, e, c) {
19
+ var a = null;
20
+ if (c !== void 0 && (a = "" + c), e.key !== void 0 && (a = "" + e.key), "key" in e) {
21
21
  c = {};
22
- for (var a in t)
23
- a !== "key" && (c[a] = t[a]);
24
- } else c = t;
25
- return t = c.ref, {
26
- $$typeof: e,
27
- type: o,
28
- key: i,
29
- ref: t !== void 0 ? t : null,
22
+ for (var i in e)
23
+ i !== "key" && (c[i] = e[i]);
24
+ } else c = e;
25
+ return e = c.ref, {
26
+ $$typeof: t,
27
+ type: s,
28
+ key: a,
29
+ ref: e !== void 0 ? e : null,
30
30
  props: c
31
31
  };
32
32
  }
33
- return L.Fragment = s, L.jsx = r, L.jsxs = r, L;
33
+ return Y.Fragment = o, Y.jsx = n, Y.jsxs = n, Y;
34
34
  }
35
35
  var U = {};
36
- var ae;
37
- function _e() {
38
- return ae || (ae = 1, process.env.NODE_ENV !== "production" && (function() {
39
- function e(n) {
40
- if (n == null) return null;
41
- if (typeof n == "function")
42
- return n.$$typeof === he ? null : n.displayName || n.name || null;
43
- if (typeof n == "string") return n;
44
- switch (n) {
36
+ var ie;
37
+ function ye() {
38
+ return ie || (ie = 1, process.env.NODE_ENV !== "production" && (function() {
39
+ function t(r) {
40
+ if (r == null) return null;
41
+ if (typeof r == "function")
42
+ return r.$$typeof === he ? null : r.displayName || r.name || null;
43
+ if (typeof r == "string") return r;
44
+ switch (r) {
45
45
  case N:
46
46
  return "Fragment";
47
47
  case R:
@@ -55,236 +55,236 @@ function _e() {
55
55
  case Se:
56
56
  return "Activity";
57
57
  }
58
- if (typeof n == "object")
59
- switch (typeof n.tag == "number" && console.error(
58
+ if (typeof r == "object")
59
+ switch (typeof r.tag == "number" && console.error(
60
60
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
61
- ), n.$$typeof) {
61
+ ), r.$$typeof) {
62
62
  case T:
63
63
  return "Portal";
64
64
  case g:
65
- return (n.displayName || "Context") + ".Provider";
65
+ return (r.displayName || "Context") + ".Provider";
66
66
  case x:
67
- return (n._context.displayName || "Context") + ".Consumer";
68
- case I:
69
- var f = n.render;
70
- return n = n.displayName, n || (n = f.displayName || f.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
67
+ return (r._context.displayName || "Context") + ".Consumer";
68
+ case k:
69
+ var f = r.render;
70
+ return r = r.displayName, r || (r = f.displayName || f.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
71
71
  case C:
72
- return f = n.displayName || null, f !== null ? f : e(n.type) || "Memo";
73
- case V:
74
- f = n._payload, n = n._init;
72
+ return f = r.displayName || null, f !== null ? f : t(r.type) || "Memo";
73
+ case L:
74
+ f = r._payload, r = r._init;
75
75
  try {
76
- return e(n(f));
76
+ return t(r(f));
77
77
  } catch {
78
78
  }
79
79
  }
80
80
  return null;
81
81
  }
82
- function s(n) {
83
- return "" + n;
82
+ function o(r) {
83
+ return "" + r;
84
84
  }
85
- function r(n) {
85
+ function n(r) {
86
86
  try {
87
- s(n);
87
+ o(r);
88
88
  var f = !1;
89
89
  } catch {
90
90
  f = !0;
91
91
  }
92
92
  if (f) {
93
93
  f = console;
94
- var p = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
94
+ var p = f.error, _ = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
95
95
  return p.call(
96
96
  f,
97
97
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
98
- y
99
- ), s(n);
98
+ _
99
+ ), o(r);
100
100
  }
101
101
  }
102
- function o(n) {
103
- if (n === N) return "<>";
104
- if (typeof n == "object" && n !== null && n.$$typeof === V)
102
+ function s(r) {
103
+ if (r === N) return "<>";
104
+ if (typeof r == "object" && r !== null && r.$$typeof === L)
105
105
  return "<...>";
106
106
  try {
107
- var f = e(n);
107
+ var f = t(r);
108
108
  return f ? "<" + f + ">" : "<...>";
109
109
  } catch {
110
110
  return "<...>";
111
111
  }
112
112
  }
113
- function t() {
114
- var n = J.A;
115
- return n === null ? null : n.getOwner();
113
+ function e() {
114
+ var r = $.A;
115
+ return r === null ? null : r.getOwner();
116
116
  }
117
117
  function c() {
118
118
  return Error("react-stack-top-frame");
119
119
  }
120
- function i(n) {
121
- if (te.call(n, "key")) {
122
- var f = Object.getOwnPropertyDescriptor(n, "key").get;
120
+ function a(r) {
121
+ if (te.call(r, "key")) {
122
+ var f = Object.getOwnPropertyDescriptor(r, "key").get;
123
123
  if (f && f.isReactWarning) return !1;
124
124
  }
125
- return n.key !== void 0;
125
+ return r.key !== void 0;
126
126
  }
127
- function a(n, f) {
127
+ function i(r, f) {
128
128
  function p() {
129
129
  re || (re = !0, console.error(
130
130
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
131
131
  f
132
132
  ));
133
133
  }
134
- p.isReactWarning = !0, Object.defineProperty(n, "key", {
134
+ p.isReactWarning = !0, Object.defineProperty(r, "key", {
135
135
  get: p,
136
136
  configurable: !0
137
137
  });
138
138
  }
139
- function u() {
140
- var n = e(this.type);
141
- return ne[n] || (ne[n] = !0, console.error(
139
+ function l() {
140
+ var r = t(this.type);
141
+ return ne[r] || (ne[r] = !0, console.error(
142
142
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
143
- )), n = this.props.ref, n !== void 0 ? n : null;
143
+ )), r = this.props.ref, r !== void 0 ? r : null;
144
144
  }
145
- function S(n, f, p, y, D, P, W, G) {
146
- return p = P.ref, n = {
147
- $$typeof: v,
148
- type: n,
145
+ function S(r, f, p, _, D, P, q, G) {
146
+ return p = P.ref, r = {
147
+ $$typeof: b,
148
+ type: r,
149
149
  key: f,
150
150
  props: P,
151
151
  _owner: D
152
- }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(n, "ref", {
152
+ }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(r, "ref", {
153
153
  enumerable: !1,
154
- get: u
155
- }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
154
+ get: l
155
+ }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
156
156
  configurable: !1,
157
157
  enumerable: !1,
158
158
  writable: !0,
159
159
  value: 0
160
- }), Object.defineProperty(n, "_debugInfo", {
160
+ }), Object.defineProperty(r, "_debugInfo", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
164
  value: null
165
- }), Object.defineProperty(n, "_debugStack", {
165
+ }), Object.defineProperty(r, "_debugStack", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: W
170
- }), Object.defineProperty(n, "_debugTask", {
169
+ value: q
170
+ }), Object.defineProperty(r, "_debugTask", {
171
171
  configurable: !1,
172
172
  enumerable: !1,
173
173
  writable: !0,
174
174
  value: G
175
- }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
175
+ }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
176
176
  }
177
- function l(n, f, p, y, D, P, W, G) {
178
- var _ = f.children;
179
- if (_ !== void 0)
180
- if (y)
181
- if (Te(_)) {
182
- for (y = 0; y < _.length; y++)
183
- h(_[y]);
184
- Object.freeze && Object.freeze(_);
177
+ function u(r, f, p, _, D, P, q, G) {
178
+ var y = f.children;
179
+ if (y !== void 0)
180
+ if (_)
181
+ if (Te(y)) {
182
+ for (_ = 0; _ < y.length; _++)
183
+ h(y[_]);
184
+ Object.freeze && Object.freeze(y);
185
185
  } else
186
186
  console.error(
187
187
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
188
188
  );
189
- else h(_);
189
+ else h(y);
190
190
  if (te.call(f, "key")) {
191
- _ = e(n);
192
- var Y = Object.keys(f).filter(function(me) {
191
+ y = t(r);
192
+ var V = Object.keys(f).filter(function(me) {
193
193
  return me !== "key";
194
194
  });
195
- y = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ce[_ + y] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
195
+ _ = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", ce[y + _] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
196
196
  `A props object containing a "key" prop is being spread into JSX:
197
197
  let props = %s;
198
198
  <%s {...props} />
199
199
  React keys must be passed directly to JSX without using spread:
200
200
  let props = %s;
201
201
  <%s key={someKey} {...props} />`,
202
- y,
203
202
  _,
204
- Y,
205
- _
206
- ), ce[_ + y] = !0);
203
+ y,
204
+ V,
205
+ y
206
+ ), ce[y + _] = !0);
207
207
  }
208
- if (_ = null, p !== void 0 && (r(p), _ = "" + p), i(f) && (r(f.key), _ = "" + f.key), "key" in f) {
208
+ if (y = null, p !== void 0 && (n(p), y = "" + p), a(f) && (n(f.key), y = "" + f.key), "key" in f) {
209
209
  p = {};
210
210
  for (var B in f)
211
211
  B !== "key" && (p[B] = f[B]);
212
212
  } else p = f;
213
- return _ && a(
213
+ return y && i(
214
214
  p,
215
- typeof n == "function" ? n.displayName || n.name || "Unknown" : n
215
+ typeof r == "function" ? r.displayName || r.name || "Unknown" : r
216
216
  ), S(
217
- n,
218
- _,
217
+ r,
218
+ y,
219
219
  P,
220
220
  D,
221
- t(),
221
+ e(),
222
222
  p,
223
- W,
223
+ q,
224
224
  G
225
225
  );
226
226
  }
227
- function h(n) {
228
- typeof n == "object" && n !== null && n.$$typeof === v && n._store && (n._store.validated = 1);
227
+ function h(r) {
228
+ typeof r == "object" && r !== null && r.$$typeof === b && r._store && (r._store.validated = 1);
229
229
  }
230
- var m = Re, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), E = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), g = /* @__PURE__ */ Symbol.for("react.context"), I = /* @__PURE__ */ Symbol.for("react.forward_ref"), d = /* @__PURE__ */ Symbol.for("react.suspense"), w = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), Se = /* @__PURE__ */ Symbol.for("react.activity"), he = /* @__PURE__ */ Symbol.for("react.client.reference"), J = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, Te = Array.isArray, q = console.createTask ? console.createTask : function() {
230
+ var m = Re, b = /* @__PURE__ */ Symbol.for("react.transitional.element"), T = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), E = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), g = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.forward_ref"), d = /* @__PURE__ */ Symbol.for("react.suspense"), w = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), Se = /* @__PURE__ */ Symbol.for("react.activity"), he = /* @__PURE__ */ Symbol.for("react.client.reference"), $ = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, Te = Array.isArray, J = console.createTask ? console.createTask : function() {
231
231
  return null;
232
232
  };
233
233
  m = {
234
- react_stack_bottom_frame: function(n) {
235
- return n();
234
+ react_stack_bottom_frame: function(r) {
235
+ return r();
236
236
  }
237
237
  };
238
- var re, ne = {}, se = m.react_stack_bottom_frame.bind(
238
+ var re, ne = {}, oe = m.react_stack_bottom_frame.bind(
239
239
  m,
240
240
  c
241
- )(), oe = q(o(c)), ce = {};
242
- U.Fragment = N, U.jsx = function(n, f, p, y, D) {
243
- var P = 1e4 > J.recentlyCreatedOwnerStacks++;
244
- return l(
245
- n,
241
+ )(), se = J(s(c)), ce = {};
242
+ U.Fragment = N, U.jsx = function(r, f, p, _, D) {
243
+ var P = 1e4 > $.recentlyCreatedOwnerStacks++;
244
+ return u(
245
+ r,
246
246
  f,
247
247
  p,
248
248
  !1,
249
- y,
249
+ _,
250
250
  D,
251
- P ? Error("react-stack-top-frame") : se,
252
- P ? q(o(n)) : oe
251
+ P ? Error("react-stack-top-frame") : oe,
252
+ P ? J(s(r)) : se
253
253
  );
254
- }, U.jsxs = function(n, f, p, y, D) {
255
- var P = 1e4 > J.recentlyCreatedOwnerStacks++;
256
- return l(
257
- n,
254
+ }, U.jsxs = function(r, f, p, _, D) {
255
+ var P = 1e4 > $.recentlyCreatedOwnerStacks++;
256
+ return u(
257
+ r,
258
258
  f,
259
259
  p,
260
260
  !0,
261
- y,
261
+ _,
262
262
  D,
263
- P ? Error("react-stack-top-frame") : se,
264
- P ? q(o(n)) : oe
263
+ P ? Error("react-stack-top-frame") : oe,
264
+ P ? J(s(r)) : se
265
265
  );
266
266
  };
267
267
  })()), U;
268
268
  }
269
269
  var ue;
270
270
  function Ne() {
271
- return ue || (ue = 1, process.env.NODE_ENV === "production" ? X.exports = ye() : X.exports = _e()), X.exports;
271
+ return ue || (ue = 1, process.env.NODE_ENV === "production" ? H.exports = _e() : H.exports = ye()), H.exports;
272
272
  }
273
- var Ie = Ne();
274
- const Ae = {
273
+ var ke = Ne();
274
+ const Ie = {
275
275
  timeTravel: !0,
276
276
  eventReplay: !0,
277
277
  stateExplorer: !0,
278
278
  eventEmit: !0,
279
279
  performanceMetrics: !0
280
- }, ke = 750, xe = 3e4;
281
- function Le({
282
- config: e,
283
- children: s
280
+ }, Ae = 750, xe = 3e4;
281
+ function Ye({
282
+ config: t,
283
+ children: o
284
284
  }) {
285
- const [r, o] = k("disconnected"), t = A(null), c = A(/* @__PURE__ */ new Set()), i = A(0), a = A(null), u = A(crypto.randomUUID()), S = A(e);
286
- S.current = e;
287
- const l = O(() => {
285
+ const [n, s] = A("disconnected"), e = I(null), c = I(/* @__PURE__ */ new Set()), a = I(0), i = I(null), l = I(crypto.randomUUID()), S = I(t);
286
+ S.current = t;
287
+ const u = O(() => {
288
288
  const E = S.current, x = `ws://${E.host ?? "localhost"}:${E.port}`, g = E.WebSocket ?? (typeof globalThis.WebSocket < "u" ? globalThis.WebSocket : void 0);
289
289
  if (!g) {
290
290
  console.error(
@@ -292,430 +292,430 @@ function Le({
292
292
  );
293
293
  return;
294
294
  }
295
- o("connecting");
295
+ s("connecting");
296
296
  try {
297
- const I = new g(x);
298
- t.current = I, I.onopen = () => {
299
- i.current = 0;
297
+ const k = new g(x);
298
+ e.current = k, k.onopen = () => {
299
+ a.current = 0;
300
300
  const d = JSON.stringify({
301
301
  type: "HANDSHAKE_REQUEST",
302
302
  protocolVersion: K,
303
- role: b.EXTENSION,
303
+ role: v.EXTENSION,
304
304
  extension: {
305
- id: u.current,
305
+ id: l.current,
306
306
  name: E.extensionName ?? "DevTools UI",
307
- capabilities: Ae
307
+ capabilities: Ie
308
308
  }
309
309
  });
310
- I.send(d);
311
- }, I.onmessage = (d) => {
310
+ k.send(d);
311
+ }, k.onmessage = (d) => {
312
312
  try {
313
313
  const w = typeof d.data == "string" ? d.data : String(d.data), C = JSON.parse(w);
314
314
  if (C.type === "HANDSHAKE_RESPONSE") {
315
- C.success ? o("connected") : I.close();
315
+ C.success ? s("connected") : k.close();
316
316
  return;
317
317
  }
318
- c.current.forEach((V) => V(C));
318
+ c.current.forEach((L) => L(C));
319
319
  } catch {
320
320
  }
321
- }, I.onclose = () => {
322
- t.current = null, o("disconnected");
321
+ }, k.onclose = () => {
322
+ e.current = null, s("disconnected");
323
323
  const d = E.autoReconnect ?? !0, w = E.maxReconnectAttempts ?? 1 / 0;
324
- if (d && i.current < w) {
325
- const C = i.current++, V = Math.min(
326
- ke * Math.pow(2, C) + Math.random() * 500,
324
+ if (d && a.current < w) {
325
+ const C = a.current++, L = Math.min(
326
+ Ae * Math.pow(2, C) + Math.random() * 500,
327
327
  xe
328
328
  );
329
- a.current = setTimeout(l, V);
329
+ i.current = setTimeout(u, L);
330
330
  }
331
- }, I.onerror = () => {
331
+ }, k.onerror = () => {
332
332
  };
333
333
  } catch {
334
- o("disconnected");
334
+ s("disconnected");
335
335
  }
336
336
  }, []), h = O(() => {
337
- a.current && (clearTimeout(a.current), a.current = null), i.current = 1 / 0, t.current?.close(), t.current = null, o("disconnected");
337
+ i.current && (clearTimeout(i.current), i.current = null), a.current = 1 / 0, e.current?.close(), e.current = null, s("disconnected");
338
338
  }, []), m = O(() => {
339
- i.current = 0, t.current?.close(), t.current = null, l();
340
- }, [l]), v = O((E) => {
341
- const R = t.current;
339
+ a.current = 0, e.current?.close(), e.current = null, u();
340
+ }, [u]), b = O((E) => {
341
+ const R = e.current;
342
342
  R && R.readyState === 1 && R.send(JSON.stringify(E));
343
343
  }, []), T = O((E) => (c.current.add(E), () => {
344
344
  c.current.delete(E);
345
345
  }), []);
346
- M(() => (l(), () => {
347
- a.current && clearTimeout(a.current), i.current = 1 / 0, t.current?.close();
348
- }), [l]);
346
+ M(() => (u(), () => {
347
+ i.current && clearTimeout(i.current), a.current = 1 / 0, e.current?.close();
348
+ }), [u]);
349
349
  const N = {
350
- status: r,
351
- extensionId: u.current,
352
- send: v,
350
+ status: n,
351
+ extensionId: l.current,
352
+ send: b,
353
353
  subscribe: T,
354
354
  disconnect: h,
355
355
  reconnect: m
356
356
  };
357
- return /* @__PURE__ */ Ie.jsx(de.Provider, { value: N, children: s });
357
+ return /* @__PURE__ */ ke.jsx(de.Provider, { value: N, children: o });
358
358
  }
359
359
  function j() {
360
- return be(de);
360
+ return ve(de);
361
361
  }
362
- function Ue(e) {
363
- const { send: s, extensionId: r } = j();
362
+ function Ue(t) {
363
+ const { send: o, extensionId: n } = j();
364
364
  return { emit: O(
365
- (t, c, i) => {
366
- e && s({
365
+ (e, c, a) => {
366
+ t && o({
367
367
  type: "EMIT_TO_STORE",
368
- storeId: e,
369
- event: { channel: t, type: c, payload: i },
368
+ storeId: t,
369
+ event: { channel: e, type: c, payload: a },
370
370
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
371
- sourceId: r,
372
- sourceRole: b.EXTENSION
371
+ sourceId: n,
372
+ sourceRole: v.EXTENSION
373
373
  });
374
374
  },
375
- [e, s, r]
375
+ [t, o, n]
376
376
  ) };
377
377
  }
378
378
  const we = 2e3;
379
- function Fe(e, s) {
380
- const { subscribe: r } = j(), o = s?.maxEntries ?? we, t = A(/* @__PURE__ */ new Map()), c = A(o);
381
- c.current = o;
382
- const [, i] = k(0);
383
- M(() => r((l) => {
384
- if (l.type !== "STORE_EVENT") return;
385
- const h = l.storeId, m = {
386
- event: l.event,
379
+ function Fe(t, o) {
380
+ const { subscribe: n } = j(), s = o?.maxEntries ?? we, e = I(/* @__PURE__ */ new Map()), c = I(s);
381
+ c.current = s;
382
+ const [, a] = A(0);
383
+ M(() => n((u) => {
384
+ if (u.type !== "STORE_EVENT") return;
385
+ const h = u.storeId, m = {
386
+ event: u.event,
387
387
  storeId: h,
388
- patches: l.patches,
389
- snapshotVersion: l.snapshotVersion,
390
- committed: l.committed,
391
- timestamp: l.timestamp
392
- }, T = [...t.current.get(h) ?? [], m];
393
- t.current.set(
388
+ patches: u.patches,
389
+ snapshotVersion: u.snapshotVersion,
390
+ committed: u.committed,
391
+ timestamp: u.timestamp
392
+ }, T = [...e.current.get(h) ?? [], m];
393
+ e.current.set(
394
394
  h,
395
395
  T.length > c.current ? T.slice(T.length - c.current) : T
396
- ), i((N) => N + 1);
397
- }), [r]);
398
- const a = O(() => {
399
- e && (t.current.delete(e), i((S) => S + 1));
400
- }, [e]);
401
- return { entries: e ? t.current.get(e) ?? [] : [], clear: a };
396
+ ), a((N) => N + 1);
397
+ }), [n]);
398
+ const i = O(() => {
399
+ t && (e.current.delete(t), a((S) => S + 1));
400
+ }, [t]);
401
+ return { entries: t ? e.current.get(t) ?? [] : [], clear: i };
402
402
  }
403
- function He(e) {
404
- const { send: s, extensionId: r } = j();
403
+ function We(t) {
404
+ const { send: o, extensionId: n } = j();
405
405
  return { replay: O(
406
- (t, c) => {
407
- e && s({
406
+ (e, c) => {
407
+ t && o({
408
408
  type: "EVENT_REPLAY",
409
- storeId: e,
410
- snapshot: t,
411
- events: c.map((i) => ({
412
- id: i.event.id,
413
- channel: i.event.channel,
414
- type: i.event.type,
415
- payload: i.event.payload
409
+ storeId: t,
410
+ snapshot: e,
411
+ events: c.map((a) => ({
412
+ id: a.event.id,
413
+ channel: a.event.channel,
414
+ type: a.event.type,
415
+ payload: a.event.payload
416
416
  })),
417
417
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
418
- sourceId: r,
419
- sourceRole: b.EXTENSION
418
+ sourceId: n,
419
+ sourceRole: v.EXTENSION
420
420
  });
421
421
  },
422
- [e, s, r]
422
+ [t, o, n]
423
423
  ) };
424
424
  }
425
- function Xe(e, s) {
426
- const { send: r, subscribe: o, extensionId: t } = j(), [c, i] = k(null), [a, u] = k(!1), S = s?.refreshIntervalMs ?? 2e3, l = A(null), h = O(() => {
427
- e && (u(!0), r({
425
+ function He(t, o) {
426
+ const { send: n, subscribe: s, extensionId: e } = j(), [c, a] = A(null), [i, l] = A(!1), S = o?.refreshIntervalMs ?? 2e3, u = I(null), h = O(() => {
427
+ t && (l(!0), n({
428
428
  type: "REQUEST_METRICS",
429
- storeId: e,
429
+ storeId: t,
430
430
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
431
- sourceId: t,
432
- sourceRole: b.EXTENSION
431
+ sourceId: e,
432
+ sourceRole: v.EXTENSION
433
433
  }));
434
- }, [e, r, t]);
434
+ }, [t, n, e]);
435
435
  return M(() => {
436
- if (!e) {
437
- i(null);
436
+ if (!t) {
437
+ a(null);
438
438
  return;
439
439
  }
440
440
  h();
441
- const m = o((v) => {
442
- v.type === "STORE_METRICS" && v.storeId === e && (i(v.metrics), u(!1));
441
+ const m = s((b) => {
442
+ b.type === "STORE_METRICS" && b.storeId === t && (a(b.metrics), l(!1));
443
443
  });
444
- return S > 0 && (l.current = setInterval(h, S)), () => {
445
- m(), l.current && (clearInterval(l.current), l.current = null);
444
+ return S > 0 && (u.current = setInterval(h, S)), () => {
445
+ m(), u.current && (clearInterval(u.current), u.current = null);
446
446
  };
447
- }, [e, o, h, S]), { metrics: c, loading: a, refresh: h };
447
+ }, [t, s, h, S]), { metrics: c, loading: i, refresh: h };
448
448
  }
449
- function $e() {
450
- const { subscribe: e } = j(), [s, r] = k([]);
451
- return M(() => e((t) => {
452
- switch (t.type) {
449
+ function Xe() {
450
+ const { subscribe: t } = j(), [o, n] = A([]);
451
+ return M(() => t((e) => {
452
+ switch (e.type) {
453
453
  case "STORE_REGISTRY":
454
- r(t.stores);
454
+ n(e.stores);
455
455
  break;
456
456
  case "STORE_CONNECTED":
457
- r((c) => c.some((a) => a.id === t.store.id) ? c.map(
458
- (a) => a.id === t.store.id ? { ...a, status: "connected" } : a
457
+ n((c) => c.some((i) => i.id === e.store.id) ? c.map(
458
+ (i) => i.id === e.store.id ? { ...i, status: "connected" } : i
459
459
  ) : [
460
460
  ...c,
461
461
  {
462
- id: t.store.id,
463
- name: t.store.name,
462
+ id: e.store.id,
463
+ name: e.store.name,
464
464
  status: "connected",
465
- capabilities: t.store.capabilities,
466
- connectedAt: t.timestamp
465
+ capabilities: e.store.capabilities,
466
+ connectedAt: e.timestamp
467
467
  }
468
468
  ]);
469
469
  break;
470
470
  case "STORE_DISCONNECTED":
471
- r(
471
+ n(
472
472
  (c) => c.map(
473
- (i) => i.id === t.storeId ? { ...i, status: "disconnected" } : i
473
+ (a) => a.id === e.storeId ? { ...a, status: "disconnected" } : a
474
474
  )
475
475
  );
476
476
  break;
477
477
  }
478
- }), [e]), s;
478
+ }), [t]), o;
479
479
  }
480
- function Z(e, s) {
481
- let r = e;
482
- for (const o of s) {
483
- const t = Ce(o.path);
484
- switch (o.op) {
480
+ function Z(t, o) {
481
+ let n = t;
482
+ for (const s of o) {
483
+ const e = Ce(s.path);
484
+ switch (s.op) {
485
485
  case "add":
486
- r = ee(r, t, o.value, !0);
486
+ n = ee(n, e, s.value, !0);
487
487
  break;
488
488
  case "replace":
489
- r = ee(r, t, o.value, !1);
489
+ n = ee(n, e, s.value, !1);
490
490
  break;
491
491
  case "remove":
492
- r = pe(r, t);
492
+ n = pe(n, e);
493
493
  break;
494
494
  }
495
495
  }
496
- return r;
496
+ return n;
497
497
  }
498
- function Ce(e) {
499
- return e === "" || e === "/" ? [] : e.slice(1).split("/").map((s) => s.replace(/~1/g, "/").replace(/~0/g, "~"));
498
+ function Ce(t) {
499
+ return t === "" || t === "/" ? [] : t.slice(1).split("/").map((o) => o.replace(/~1/g, "/").replace(/~0/g, "~"));
500
500
  }
501
501
  const Ee = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
502
- function ee(e, s, r, o) {
503
- if (s.length === 0) return r;
504
- const t = Array.isArray(e) ? [...e] : { ...e }, [c, ...i] = s;
505
- if (Ee.has(c)) return t;
506
- if (i.length === 0)
507
- if (o && Array.isArray(t)) {
508
- const a = c === "-" ? t.length : Number(c);
509
- Number.isInteger(a) && a >= 0 && a <= t.length ? t.splice(a, 0, r) : t[c] = r;
502
+ function ee(t, o, n, s) {
503
+ if (o.length === 0) return n;
504
+ const e = Array.isArray(t) ? [...t] : { ...t }, [c, ...a] = o;
505
+ if (Ee.has(c)) return e;
506
+ if (a.length === 0)
507
+ if (s && Array.isArray(e)) {
508
+ const i = c === "-" ? e.length : Number(c);
509
+ Number.isInteger(i) && i >= 0 && i <= e.length ? e.splice(i, 0, n) : e[c] = n;
510
510
  } else
511
- t[c] = r;
511
+ e[c] = n;
512
512
  else
513
- t[c] = ee(t[c] ?? {}, i, r, o);
514
- return t;
513
+ e[c] = ee(e[c] ?? {}, a, n, s);
514
+ return e;
515
515
  }
516
- function pe(e, s) {
517
- if (s.length === 0) return;
518
- const r = Array.isArray(e) ? [...e] : { ...e }, [o, ...t] = s;
519
- return Ee.has(o) || (t.length === 0 ? Array.isArray(r) ? r.splice(Number(o), 1) : delete r[o] : r[o] = pe(r[o], t)), r;
516
+ function pe(t, o) {
517
+ if (o.length === 0) return;
518
+ const n = Array.isArray(t) ? [...t] : { ...t }, [s, ...e] = o;
519
+ return Ee.has(s) || (e.length === 0 ? Array.isArray(n) ? n.splice(Number(s), 1) : delete n[s] : n[s] = pe(n[s], e)), n;
520
520
  }
521
- function ge(e) {
522
- const s = e.scheduler ?? {
523
- setInterval: (t, c) => setInterval(t, c),
524
- clearInterval: (t) => clearInterval(t)
521
+ function ge(t) {
522
+ const o = t.scheduler ?? {
523
+ setInterval: (e, c) => setInterval(e, c),
524
+ clearInterval: (e) => clearInterval(e)
525
525
  };
526
- let r = s.setInterval(() => {
527
- if (e.isSettled()) {
528
- o();
526
+ let n = o.setInterval(() => {
527
+ if (t.isSettled()) {
528
+ s();
529
529
  return;
530
530
  }
531
- e.request();
532
- }, e.intervalMs);
533
- function o() {
534
- r !== null && (s.clearInterval(r), r = null);
531
+ t.request();
532
+ }, t.intervalMs);
533
+ function s() {
534
+ n !== null && (o.clearInterval(n), n = null);
535
535
  }
536
- return o;
536
+ return s;
537
537
  }
538
538
  const Pe = 1500;
539
- function Je(e) {
540
- const { send: s, subscribe: r, extensionId: o } = j(), [t, c] = k(null), [i, a] = k(0), [u, S] = k(!1), l = A(0), h = A([]), m = A(null), v = O(() => {
539
+ function $e(t) {
540
+ const { send: o, subscribe: n, extensionId: s } = j(), [e, c] = A(null), [a, i] = A(0), [l, S] = A(!1), u = I(0), h = I([]), m = I(null), b = O(() => {
541
541
  m.current?.(), m.current = null;
542
542
  }, []), T = O(() => {
543
- e && (S(!0), s({
543
+ t && (S(!0), o({
544
544
  type: "REQUEST_STATE",
545
- storeId: e,
545
+ storeId: t,
546
546
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
547
- sourceId: o,
548
- sourceRole: b.EXTENSION
547
+ sourceId: s,
548
+ sourceRole: v.EXTENSION
549
549
  }));
550
- }, [e, s, o]);
550
+ }, [t, o, s]);
551
551
  return M(() => {
552
- if (!e) {
553
- c(null), a(0), l.current = 0;
552
+ if (!t) {
553
+ c(null), i(0), u.current = 0;
554
554
  return;
555
555
  }
556
556
  T(), m.current = ge({
557
557
  request: T,
558
- isSettled: () => l.current !== 0,
558
+ isSettled: () => u.current !== 0,
559
559
  intervalMs: Pe
560
560
  });
561
- const N = r((E) => {
562
- if (E.type === "STATE_SNAPSHOT" && E.storeId === e) {
563
- v(), c(E.state), a(E.version), l.current = E.version, S(!1);
561
+ const N = n((E) => {
562
+ if (E.type === "STATE_SNAPSHOT" && E.storeId === t) {
563
+ b(), c(E.state), i(E.version), u.current = E.version, S(!1);
564
564
  const R = h.current.filter((x) => x.version > E.version).sort((x, g) => x.version - g.version);
565
565
  if (h.current = [], R.length > 0) {
566
566
  c((g) => {
567
- let I = g;
567
+ let k = g;
568
568
  for (const d of R)
569
- I = Z(I, d.patches);
570
- return I;
569
+ k = Z(k, d.patches);
570
+ return k;
571
571
  });
572
572
  const x = R[R.length - 1].version;
573
- a(x), l.current = x;
573
+ i(x), u.current = x;
574
574
  }
575
575
  return;
576
576
  }
577
- if (E.type === "STORE_EVENT" && E.storeId === e && E.committed) {
578
- if (l.current === 0) {
577
+ if (E.type === "STORE_EVENT" && E.storeId === t && E.committed) {
578
+ if (u.current === 0) {
579
579
  h.current.push({
580
580
  patches: E.patches,
581
581
  version: E.snapshotVersion
582
582
  });
583
583
  return;
584
584
  }
585
- if (E.snapshotVersion <= l.current)
585
+ if (E.snapshotVersion <= u.current)
586
586
  return;
587
- c((R) => Z(R, E.patches)), a(E.snapshotVersion), l.current = E.snapshotVersion;
587
+ c((R) => Z(R, E.patches)), i(E.snapshotVersion), u.current = E.snapshotVersion;
588
588
  }
589
589
  });
590
590
  return () => {
591
- N(), v(), h.current = [];
591
+ N(), b(), h.current = [];
592
592
  };
593
- }, [e, r, T, v]), { state: t, version: i, loading: u, refresh: T };
593
+ }, [t, n, T, b]), { state: e, version: a, loading: l, refresh: T };
594
594
  }
595
- function qe(e) {
596
- const { send: s, subscribe: r, extensionId: o } = j(), [t, c] = k(null), [i, a] = k(!1), u = O(() => {
597
- e && (a(!0), s({
595
+ function Je(t) {
596
+ const { send: o, subscribe: n, extensionId: s } = j(), [e, c] = A(null), [a, i] = A(!1), l = O(() => {
597
+ t && (i(!0), o({
598
598
  type: "REQUEST_SUBSCRIPTIONS",
599
- storeId: e,
599
+ storeId: t,
600
600
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
601
- sourceId: o,
602
- sourceRole: b.EXTENSION
601
+ sourceId: s,
602
+ sourceRole: v.EXTENSION
603
603
  }));
604
- }, [e, s, o]);
604
+ }, [t, o, s]);
605
605
  return M(() => {
606
- if (!e) {
606
+ if (!t) {
607
607
  c(null);
608
608
  return;
609
609
  }
610
- return u(), r((l) => {
611
- l.type === "STORE_SUBSCRIPTIONS" && l.storeId === e && (c({
612
- atomic: l.atomic,
613
- event: l.event,
614
- coarse: l.coarse,
615
- effects: l.effects,
616
- middleware: l.middleware,
617
- reducers: l.reducers
618
- }), a(!1));
610
+ return l(), n((u) => {
611
+ u.type === "STORE_SUBSCRIPTIONS" && u.storeId === t && (c({
612
+ atomic: u.atomic,
613
+ event: u.event,
614
+ coarse: u.coarse,
615
+ effects: u.effects,
616
+ middleware: u.middleware,
617
+ reducers: u.reducers
618
+ }), i(!1));
619
619
  });
620
- }, [e, r, u]), { data: t, loading: i, refresh: u };
620
+ }, [t, n, l]), { data: e, loading: a, refresh: l };
621
621
  }
622
- function le(e, s) {
623
- const { isTimeTraveling: r, currentIndex: o, entryCount: t } = s, c = t - 1;
624
- if (e === "back") {
625
- const u = (r ? o : c) - 1;
626
- return u >= 0 ? { kind: "jump", index: u } : { kind: "none" };
622
+ function le(t, o) {
623
+ const { isTimeTraveling: n, currentIndex: s, entryCount: e } = o, c = e - 1;
624
+ if (t === "back") {
625
+ const l = (n ? s : c) - 1;
626
+ return l >= 0 ? { kind: "jump", index: l } : { kind: "none" };
627
627
  }
628
- if (!r) return { kind: "none" };
629
- const i = o + 1;
630
- return i > c ? { kind: "resume" } : { kind: "jump", index: i };
628
+ if (!n) return { kind: "none" };
629
+ const a = s + 1;
630
+ return a > c ? { kind: "resume" } : { kind: "jump", index: a };
631
631
  }
632
- function De(e) {
633
- const { baseline: s, entries: r, index: o, cache: t } = e;
634
- if (s === null) return { state: null, cache: null };
635
- let c = 0, i = s.state;
636
- t !== null && t.index <= o && r[t.index] === t.marker && (c = t.index + 1, i = t.state);
637
- for (let u = c; u <= o; u++) {
638
- const S = r[u];
632
+ function De(t) {
633
+ const { baseline: o, entries: n, index: s, cache: e } = t;
634
+ if (o === null) return { state: null, cache: null };
635
+ let c = 0, a = o.state;
636
+ e !== null && e.index <= s && n[e.index] === e.marker && (c = e.index + 1, a = e.state);
637
+ for (let l = c; l <= s; l++) {
638
+ const S = n[l];
639
639
  if (S === void 0) break;
640
- S.snapshotVersion <= s.version || (i = Z(i, S.patches));
640
+ S.snapshotVersion <= o.version || (a = Z(a, S.patches));
641
641
  }
642
- const a = r[o];
642
+ const i = n[s];
643
643
  return {
644
- state: i,
645
- cache: o >= 0 && a !== void 0 ? { index: o, state: i, marker: a } : null
644
+ state: a,
645
+ cache: s >= 0 && i !== void 0 ? { index: s, state: a, marker: i } : null
646
646
  };
647
647
  }
648
- function We(e, s, r = !0) {
649
- const { send: o, subscribe: t, extensionId: c } = j(), [i, a] = k(-1), [u, S] = k(!1), [l, h] = k(null), m = A(null), v = A(null);
648
+ function qe(t, o, n = !0) {
649
+ const { send: s, subscribe: e, extensionId: c } = j(), [a, i] = A(-1), [l, S] = A(!1), [u, h] = A(null), m = I(null), b = I(null);
650
650
  M(() => {
651
- if (m.current = null, v.current = null, h(null), !!e)
652
- return t((d) => {
653
- d.type === "STATE_SNAPSHOT" && d.storeId === e && m.current === null && (m.current = { state: d.state, version: d.version });
651
+ if (m.current = null, b.current = null, h(null), !!t)
652
+ return e((d) => {
653
+ d.type === "STATE_SNAPSHOT" && d.storeId === t && m.current === null && (m.current = { state: d.state, version: d.version });
654
654
  });
655
- }, [e, t]);
655
+ }, [t, e]);
656
656
  const T = O(
657
657
  (d) => {
658
658
  const { state: w, cache: C } = De({
659
659
  baseline: m.current,
660
- entries: s,
660
+ entries: o,
661
661
  index: d,
662
- cache: v.current
662
+ cache: b.current
663
663
  });
664
- return v.current = C, w;
664
+ return b.current = C, w;
665
665
  },
666
- [s]
666
+ [o]
667
667
  ), N = O(
668
668
  (d) => {
669
- if (!e || !r || d < 0 || d >= s.length) return;
670
- h((C) => C ?? s.length), a(d), S(!0);
671
- const w = s[d];
672
- o({
669
+ if (!t || !n || d < 0 || d >= o.length) return;
670
+ h((C) => C ?? o.length), i(d), S(!0);
671
+ const w = o[d];
672
+ s({
673
673
  type: "TIME_TRAVEL",
674
- storeId: e,
674
+ storeId: t,
675
675
  state: T(d),
676
676
  snapshotVersion: w.snapshotVersion,
677
677
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
678
678
  sourceId: c,
679
- sourceRole: b.EXTENSION
679
+ sourceRole: v.EXTENSION
680
680
  });
681
681
  },
682
- [e, s, o, T, r, c]
682
+ [t, o, s, T, n, c]
683
683
  ), E = O(() => {
684
- if (S(!1), a(-1), h(null), r && e && s.length > 0) {
685
- const d = s.length - 1, w = s[d];
686
- o({
684
+ if (S(!1), i(-1), h(null), n && t && o.length > 0) {
685
+ const d = o.length - 1, w = o[d];
686
+ s({
687
687
  type: "TIME_TRAVEL",
688
- storeId: e,
688
+ storeId: t,
689
689
  state: T(d),
690
690
  snapshotVersion: w.snapshotVersion,
691
691
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
692
692
  sourceId: c,
693
- sourceRole: b.EXTENSION
693
+ sourceRole: v.EXTENSION
694
694
  });
695
695
  }
696
- }, [e, s, o, T, r, c]), R = l ?? s.length, x = O(() => {
696
+ }, [t, o, s, T, n, c]), R = u ?? o.length, x = O(() => {
697
697
  const d = le("back", {
698
- isTimeTraveling: u,
699
- currentIndex: i,
698
+ isTimeTraveling: l,
699
+ currentIndex: a,
700
700
  entryCount: R
701
701
  });
702
702
  d.kind === "jump" && N(d.index);
703
- }, [u, i, R, N]), g = O(() => {
703
+ }, [l, a, R, N]), g = O(() => {
704
704
  const d = le("forward", {
705
- isTimeTraveling: u,
706
- currentIndex: i,
705
+ isTimeTraveling: l,
706
+ currentIndex: a,
707
707
  entryCount: R
708
708
  });
709
709
  d.kind === "jump" ? N(d.index) : d.kind === "resume" && E();
710
- }, [u, i, R, N, E]), I = Oe(
711
- () => T(u ? i : s.length - 1),
712
- [T, u, i, s.length]
710
+ }, [l, a, R, N, E]), k = Oe(
711
+ () => T(l ? a : o.length - 1),
712
+ [T, l, a, o.length]
713
713
  );
714
714
  return {
715
- currentIndex: i,
716
- isTimeTraveling: u,
717
- previewState: I,
718
- frameCount: l,
715
+ currentIndex: a,
716
+ isTimeTraveling: l,
717
+ previewState: k,
718
+ frameCount: u,
719
719
  jumpTo: N,
720
720
  stepBack: x,
721
721
  stepForward: g,
@@ -723,145 +723,156 @@ function We(e, s, r = !0) {
723
723
  };
724
724
  }
725
725
  const z = 0, Q = 1, je = 2, F = 3;
726
- function $() {
726
+ function X() {
727
727
  return {
728
728
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
729
729
  sourceId: "loopback-hub",
730
- sourceRole: b.HUB
730
+ sourceRole: v.HUB
731
731
  };
732
732
  }
733
- function fe(e) {
734
- return e.split(".")[0] ?? "0";
733
+ function fe(t) {
734
+ return t.split(".")[0] ?? "0";
735
735
  }
736
736
  class Me {
737
737
  constructor() {
738
738
  this.peers = /* @__PURE__ */ new Set();
739
739
  }
740
- add(s) {
741
- const r = { role: null, id: null, deliver: s, closed: !1 };
742
- return this.peers.add(r), r;
740
+ add(o) {
741
+ const n = { role: null, id: null, deliver: o, closed: !1 };
742
+ return this.peers.add(n), n;
743
743
  }
744
- remove(s) {
745
- if (this.peers.delete(s) && (s.closed = !0, s.role === b.STORE && s.id)) {
746
- const r = JSON.stringify({
744
+ remove(o) {
745
+ if (this.peers.delete(o) && (o.closed = !0, o.role === v.STORE && o.id)) {
746
+ const n = JSON.stringify({
747
747
  type: "STORE_DISCONNECTED",
748
- storeId: s.id,
748
+ storeId: o.id,
749
749
  reason: "disconnected",
750
- ...$()
750
+ ...X()
751
751
  });
752
- this.eachExtension((o) => o.deliver(r));
752
+ this.eachExtension((s) => s.deliver(n));
753
753
  }
754
754
  }
755
- receive(s, r) {
756
- if (s.closed) return;
757
- let o;
755
+ receive(o, n) {
756
+ if (o.closed) return;
757
+ let s;
758
758
  try {
759
- o = JSON.parse(r);
759
+ s = JSON.parse(n);
760
760
  } catch {
761
761
  return;
762
762
  }
763
- if (!(o === null || typeof o != "object" || typeof o.type != "string")) {
764
- if (s.role === null) {
765
- this.handshake(s, o);
763
+ if (!(s === null || typeof s != "object" || typeof s.type != "string")) {
764
+ if (o.role === null) {
765
+ this.handshake(o, s);
766
766
  return;
767
767
  }
768
- if (s.role === b.STORE)
769
- this.eachExtension((t) => t.deliver(r));
770
- else if (typeof o.storeId == "string")
771
- for (const t of this.peers)
772
- t.role === b.STORE && t.id === o.storeId && t.deliver(r);
768
+ if (o.role === v.STORE)
769
+ this.eachExtension((e) => e.deliver(n));
770
+ else if (typeof s.storeId == "string")
771
+ for (const e of this.peers)
772
+ e.role === v.STORE && e.id === s.storeId && e.deliver(n);
773
773
  }
774
774
  }
775
- handshake(s, r) {
776
- if (r.type !== "HANDSHAKE_REQUEST") return;
777
- const o = r.role, t = o === b.STORE ? r.store?.id : o === b.EXTENSION ? r.extension?.id : void 0, i = fe(String(r.protocolVersion ?? "")) === fe(K) && typeof t == "string";
778
- if (s.deliver(
775
+ handshake(o, n) {
776
+ if (n.type !== "HANDSHAKE_REQUEST") return;
777
+ const s = n.role, e = s === v.STORE ? n.store?.id : s === v.EXTENSION ? n.extension?.id : void 0, a = fe(String(n.protocolVersion ?? "")) === fe(K) && typeof e == "string";
778
+ if (o.deliver(
779
779
  JSON.stringify({
780
780
  type: "HANDSHAKE_RESPONSE",
781
- success: i,
781
+ success: a,
782
782
  // `negotiatedVersion`, the name the interface and the real hub use. This sent
783
783
  // `protocolVersion` instead — harmless only for as long as nothing reads it, and the
784
784
  // moment something did, the embedded panel would have failed where the real hub worked,
785
785
  // in the one path with no server to inspect.
786
786
  negotiatedVersion: K,
787
- ...$(),
788
- ...i ? {} : { error: "Loopback handshake rejected (version or id mismatch)" }
787
+ ...X(),
788
+ ...a ? {} : { error: "Loopback handshake rejected (version or id mismatch)" }
789
789
  })
790
- ), !!i)
791
- if (s.role = o, s.id = t, o === b.STORE) {
792
- s.storeInfo = { name: r.store?.name ?? t, capabilities: r.store?.capabilities };
793
- const a = JSON.stringify({
790
+ ), !!a)
791
+ if (o.role = s, o.id = e, s === v.STORE) {
792
+ o.storeInfo = { name: n.store?.name ?? e, capabilities: n.store?.capabilities };
793
+ const i = JSON.stringify({
794
794
  type: "STORE_CONNECTED",
795
- store: { id: t, name: s.storeInfo.name, capabilities: s.storeInfo.capabilities },
796
- ...$()
795
+ store: { id: e, name: o.storeInfo.name, capabilities: o.storeInfo.capabilities },
796
+ ...X()
797
797
  });
798
- this.eachExtension((u) => u.deliver(a));
798
+ this.eachExtension((l) => l.deliver(i));
799
799
  } else {
800
- const a = [...this.peers].filter((u) => u.role === b.STORE && u.storeInfo).map((u) => ({
801
- id: u.id,
802
- name: u.storeInfo.name,
800
+ const i = [...this.peers].filter((l) => l.role === v.STORE && l.storeInfo).map((l) => ({
801
+ id: l.id,
802
+ name: l.storeInfo.name,
803
803
  status: "connected",
804
- capabilities: u.storeInfo.capabilities,
804
+ capabilities: l.storeInfo.capabilities,
805
805
  connectedAt: (/* @__PURE__ */ new Date()).toISOString()
806
806
  }));
807
- s.deliver(JSON.stringify({ type: "STORE_REGISTRY", stores: a, ...$() }));
807
+ o.deliver(JSON.stringify({ type: "STORE_REGISTRY", stores: i, ...X() }));
808
808
  }
809
809
  }
810
- eachExtension(s) {
811
- for (const r of this.peers) r.role === b.EXTENSION && s(r);
810
+ eachExtension(o) {
811
+ for (const n of this.peers) n.role === v.EXTENSION && o(n);
812
812
  }
813
813
  }
814
814
  function Ge() {
815
- const e = new Me(), s = (t, c) => {
816
- let i = z;
817
- const a = e.add((u) => c.onMessage(u));
815
+ const t = new Me(), o = (s, e) => {
816
+ let c = z;
817
+ const a = t.add((i) => e.onMessage(i));
818
818
  return queueMicrotask(() => {
819
- i = Q, c.onOpen();
819
+ c = Q, e.onOpen();
820
820
  }), {
821
821
  get readyState() {
822
- return i;
822
+ return c;
823
823
  },
824
- send: (u) => e.receive(a, u),
824
+ send: (i) => t.receive(a, i),
825
825
  close: () => {
826
- i !== F && (i = F, e.remove(a), c.onClose());
826
+ c !== F && (c = F, t.remove(a), e.onClose());
827
827
  },
828
828
  dispose: () => {
829
829
  a.closed = !0;
830
830
  }
831
831
  };
832
- }, o = class o {
833
- constructor(c) {
834
- this.onopen = null, this.onmessage = null, this.onclose = null, this.onerror = null, this.readyState = z, this.peer = e.add((i) => this.onmessage?.({ data: i })), queueMicrotask(() => {
832
+ };
833
+ class n {
834
+ constructor(e) {
835
+ this.onopen = null, this.onmessage = null, this.onclose = null, this.onerror = null, this.readyState = z, this.peer = t.add((c) => this.onmessage?.({ data: c })), queueMicrotask(() => {
835
836
  this.readyState = Q, this.onopen?.();
836
837
  });
837
838
  }
838
- send(c) {
839
- e.receive(this.peer, c);
839
+ static {
840
+ this.CONNECTING = z;
841
+ }
842
+ static {
843
+ this.OPEN = Q;
844
+ }
845
+ static {
846
+ this.CLOSING = je;
847
+ }
848
+ static {
849
+ this.CLOSED = F;
850
+ }
851
+ send(e) {
852
+ t.receive(this.peer, e);
840
853
  }
841
854
  close() {
842
- this.readyState !== F && (this.readyState = F, e.remove(this.peer), this.onclose?.());
855
+ this.readyState !== F && (this.readyState = F, t.remove(this.peer), this.onclose?.());
843
856
  }
844
- };
845
- o.CONNECTING = z, o.OPEN = Q, o.CLOSING = je, o.CLOSED = F;
846
- let r = o;
857
+ }
847
858
  return {
848
- agentSocketFactory: s,
849
- WebSocket: r
859
+ agentSocketFactory: o,
860
+ WebSocket: n
850
861
  };
851
862
  }
852
863
  export {
853
864
  de as HubContext,
854
- Le as HubProvider,
865
+ Ye as HubProvider,
855
866
  Z as applyPatches,
856
867
  Ge as createLoopbackHub,
857
868
  Ue as useEventEmitter,
858
869
  Fe as useEventLog,
859
- He as useEventReplay,
870
+ We as useEventReplay,
860
871
  j as useHubConnection,
861
- Xe as useStoreMetrics,
862
- $e as useStoreRegistry,
863
- Je as useStoreState,
864
- qe as useStoreSubscriptions,
865
- We as useTimeTravel
872
+ He as useStoreMetrics,
873
+ Xe as useStoreRegistry,
874
+ $e as useStoreState,
875
+ Je as useStoreSubscriptions,
876
+ qe as useTimeTravel
866
877
  };
867
878
  //# sourceMappingURL=devtools-ui.mjs.map