adonisjs-server-stats 1.11.6 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +13 -0
  2. package/dist/core/explain-utils.d.ts +77 -0
  3. package/dist/core/index.d.ts +8 -2
  4. package/dist/core/index.js +1089 -877
  5. package/dist/core/queries-columns.d.ts +42 -0
  6. package/dist/core/queries-controller.d.ts +94 -0
  7. package/dist/core/query-utils.d.ts +49 -0
  8. package/dist/core/types-diagnostics.d.ts +2 -0
  9. package/dist/react/{CacheSection-BYN53kYO.js → CacheSection-DZFOiOYH.js} +1 -1
  10. package/dist/react/{CacheTab-DOhuK05d.js → CacheTab-D8js5o69.js} +1 -1
  11. package/dist/react/{ConfigSection-B9EHh4Rp.js → ConfigSection-DoJmvNkF.js} +1 -1
  12. package/dist/react/{ConfigTab-C8kriE2b.js → ConfigTab-CDvljuBF.js} +1 -1
  13. package/dist/react/{CustomPaneTab-CvzQS_Wh.js → CustomPaneTab-Db9eIQ-9.js} +1 -1
  14. package/dist/react/{EmailsSection-BJyFJf7A.js → EmailsSection-D7oxvAjA.js} +1 -1
  15. package/dist/react/{EmailsTab-Ch8jp10B.js → EmailsTab-BITuGTQm.js} +1 -1
  16. package/dist/react/{EventsSection-DJPwHeT8.js → EventsSection-7mDZv70I.js} +1 -1
  17. package/dist/react/{EventsTab-B-FoehXC.js → EventsTab-DF13BChE.js} +1 -1
  18. package/dist/react/InternalsContent-BNOnSoi9.js +393 -0
  19. package/dist/react/{InternalsSection-B6VlVx5f.js → InternalsSection-BwrTfpjA.js} +1 -1
  20. package/dist/react/{InternalsTab-CkEKpRMU.js → InternalsTab--RD-L1dX.js} +1 -1
  21. package/dist/react/{JobsSection-DWF4i1t_.js → JobsSection-B_VJFWy6.js} +1 -1
  22. package/dist/react/{JobsTab-DqnifQXV.js → JobsTab-DK8Fl9nz.js} +1 -1
  23. package/dist/react/{LogEntryRow-CMMkqA9M.js → LogEntryRow-Bdie9SFe.js} +1 -1
  24. package/dist/react/{LogsSection-C1xC5aP4.js → LogsSection-CrWqxWRr.js} +2 -2
  25. package/dist/react/{LogsTab-CS4sLfLw.js → LogsTab-DYSpL637.js} +2 -2
  26. package/dist/react/{OverviewSection-CxvfOR0v.js → OverviewSection-CuaccMZt.js} +1 -1
  27. package/dist/react/QueriesContent-BDIx8zFn.js +288 -0
  28. package/dist/react/QueriesSection-CvGGh5Ij.js +117 -0
  29. package/dist/react/QueriesTab-C7CCwhVc.js +87 -0
  30. package/dist/react/{RequestsSection-DETN9oZb.js → RequestsSection-mENyeNsk.js} +2 -2
  31. package/dist/react/{RoutesSection-CmorkJeC.js → RoutesSection-DjovlaNS.js} +1 -1
  32. package/dist/react/{RoutesTab-CbzBOzpc.js → RoutesTab-CbQECiUc.js} +1 -1
  33. package/dist/react/{SplitPaneWrapper-BiIgT4ND.js → SplitPaneWrapper-DyRyH5Re.js} +1 -1
  34. package/dist/react/{TimelineTab-Ue9tUD_n.js → TimelineTab-BKTFbsPe.js} +2 -2
  35. package/dist/react/components/Dashboard/shared/DataTable.d.ts +1 -1
  36. package/dist/react/components/shared/QueriesContent.d.ts +33 -0
  37. package/dist/react/{index-DwDK-4oX.js → index-CAUHa8QX.js} +2 -2
  38. package/dist/react/index.js +1 -1
  39. package/dist/react/style.css +1 -1
  40. package/dist/src/collectors/db_pool_collector.js +17 -23
  41. package/dist/src/dashboard/query_explain_handler.d.ts +11 -0
  42. package/dist/src/dashboard/query_explain_handler.js +64 -11
  43. package/dist/src/debug/query_collector.d.ts +1 -0
  44. package/dist/src/debug/query_collector.js +3 -0
  45. package/dist/src/edge/client/dashboard.js +2 -2
  46. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  47. package/dist/src/edge/client-vue/dashboard.js +4 -4
  48. package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
  49. package/dist/src/provider/diagnostics.d.ts +3 -0
  50. package/dist/src/provider/diagnostics.js +1 -0
  51. package/dist/src/provider/server_stats_provider.d.ts +7 -0
  52. package/dist/src/provider/server_stats_provider.js +38 -0
  53. package/dist/src/routes/debug_routes.d.ts +4 -0
  54. package/dist/src/routes/debug_routes.js +45 -0
  55. package/dist/src/routes/register_routes.d.ts +4 -0
  56. package/dist/src/routes/register_routes.js +2 -0
  57. package/dist/src/styles/components.css +254 -0
  58. package/dist/src/styles/dashboard.css +26 -185
  59. package/dist/src/styles/debug-panel.css +2 -24
  60. package/dist/vue/{CacheSection-DT2Mwf_s.js → CacheSection-Bx41lpfK.js} +1 -1
  61. package/dist/vue/{ConfigSection-BwKwS9lh.js → ConfigSection-fkfUdCmx.js} +1 -1
  62. package/dist/vue/{EmailsSection-B65g0FVS.js → EmailsSection-CbcDKF9Q.js} +1 -1
  63. package/dist/vue/{EventsSection-CxqtVF-o.js → EventsSection-CWbTYOBi.js} +1 -1
  64. package/dist/vue/{InternalsSection-BJUXE-5F.js → InternalsSection-jhTCuK3j.js} +149 -130
  65. package/dist/vue/{InternalsTab-DEMjqtlw.js → InternalsTab-521fxYYj.js} +152 -133
  66. package/dist/vue/{JobsSection-rMIyMb-g.js → JobsSection-CGGO6rtS.js} +1 -1
  67. package/dist/vue/{LogsSection-DmmZVJ7D.js → LogsSection-BPB-C-XA.js} +1 -1
  68. package/dist/vue/{OverviewSection-BMabyqw-.js → OverviewSection-BTcnPeoM.js} +1 -1
  69. package/dist/vue/QueriesSection-2SE3igQJ.js +411 -0
  70. package/dist/vue/QueriesTab-DO5XwJ--.js +112 -0
  71. package/dist/vue/{RequestsSection-CTu4jPZ_.js → RequestsSection-DXcG5Zok.js} +1 -1
  72. package/dist/vue/{RoutesSection-zQZDedL7.js → RoutesSection-BkNGWdoP.js} +1 -1
  73. package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +1 -41
  74. package/dist/vue/{index-CM3yNVUR.js → index-CptF6Qbp.js} +2 -2
  75. package/dist/vue/index.js +1 -1
  76. package/dist/vue/style.css +1 -1
  77. package/package.json +1 -1
  78. package/dist/react/InternalsContent-O8ino9oM.js +0 -370
  79. package/dist/react/QueriesSection-CrMdU5Ax.js +0 -458
  80. package/dist/react/QueriesTab-x85PjkyS.js +0 -88
  81. package/dist/vue/QueriesSection-BfDFwGqH.js +0 -428
  82. package/dist/vue/QueriesTab-DuTG7cpC.js +0 -106
@@ -1,21 +1,21 @@
1
- class x extends Error {
1
+ class w extends Error {
2
2
  status;
3
- constructor(t = 403) {
4
- super(`Unauthorized (HTTP ${t})`), this.name = "UnauthorizedError", this.status = t;
3
+ constructor(e = 403) {
4
+ super(`Unauthorized (HTTP ${e})`), this.name = "UnauthorizedError", this.status = e;
5
5
  }
6
6
  }
7
- class K extends Error {
7
+ class j extends Error {
8
8
  status;
9
9
  body;
10
- constructor(t, r) {
11
- super(`API error (HTTP ${t})`), this.name = "ApiError", this.status = t, this.body = r;
10
+ constructor(e, r) {
11
+ super(`API error (HTTP ${e})`), this.name = "ApiError", this.status = e, this.body = r;
12
12
  }
13
13
  }
14
- class C {
14
+ class T {
15
15
  baseUrl;
16
16
  authToken;
17
- constructor(t) {
18
- this.baseUrl = t.baseUrl.replace(/\/+$/, ""), this.authToken = t.authToken;
17
+ constructor(e) {
18
+ this.baseUrl = e.baseUrl.replace(/\/+$/, ""), this.authToken = e.authToken;
19
19
  }
20
20
  /**
21
21
  * Perform a JSON fetch against the configured base URL.
@@ -24,27 +24,27 @@ class C {
24
24
  * @param init - Optional `RequestInit` overrides. Headers are merged.
25
25
  * @returns Parsed JSON response body typed as `T`.
26
26
  */
27
- async fetch(t, r) {
28
- const s = {
27
+ async fetch(e, r) {
28
+ const o = {
29
29
  ...{
30
30
  Accept: "application/json",
31
31
  ...this.authToken ? { Authorization: `Bearer ${this.authToken}` } : {}
32
32
  },
33
33
  ...r?.headers
34
- }, o = await globalThis.fetch(`${this.baseUrl}${t}`, {
34
+ }, s = await globalThis.fetch(`${this.baseUrl}${e}`, {
35
35
  ...r,
36
- headers: s,
36
+ headers: o,
37
37
  credentials: this.authToken ? "omit" : "include"
38
38
  });
39
39
  if (r?.signal?.aborted)
40
40
  throw new DOMException("The operation was aborted.", "AbortError");
41
- if (o.status === 401 || o.status === 403)
42
- throw new x(o.status);
43
- if (!o.ok) {
44
- const i = await o.text().catch(() => "");
45
- throw new K(o.status, i);
41
+ if (s.status === 401 || s.status === 403)
42
+ throw new w(s.status);
43
+ if (!s.ok) {
44
+ const i = await s.text().catch(() => "");
45
+ throw new j(s.status, i);
46
46
  }
47
- return o.json();
47
+ return s.json();
48
48
  }
49
49
  /**
50
50
  * Perform a GET request.
@@ -53,8 +53,8 @@ class C {
53
53
  * @param query - Optional query string (without leading `?`).
54
54
  * @returns Parsed JSON response body typed as `T`.
55
55
  */
56
- async get(t, r) {
57
- const n = r ? `${t}?${r}` : t;
56
+ async get(e, r) {
57
+ const n = r ? `${e}?${r}` : e;
58
58
  return this.fetch(n);
59
59
  }
60
60
  /**
@@ -64,7 +64,7 @@ class C {
64
64
  * @param body - Optional request body (will be JSON-serialized).
65
65
  * @returns Parsed JSON response body typed as `T`.
66
66
  */
67
- async post(t, r) {
67
+ async post(e, r) {
68
68
  const n = {
69
69
  method: "POST",
70
70
  ...r !== void 0 ? {
@@ -72,7 +72,7 @@ class C {
72
72
  headers: { "Content-Type": "application/json" }
73
73
  } : {}
74
74
  };
75
- return this.fetch(t, n);
75
+ return this.fetch(e, n);
76
76
  }
77
77
  /**
78
78
  * Perform a DELETE request.
@@ -80,74 +80,74 @@ class C {
80
80
  * @param path - URL path appended to `baseUrl`.
81
81
  * @returns Parsed JSON response body typed as `T`.
82
82
  */
83
- async delete(t) {
84
- return this.fetch(t, { method: "DELETE" });
83
+ async delete(e) {
84
+ return this.fetch(e, { method: "DELETE" });
85
85
  }
86
86
  }
87
- function z(e, t) {
88
- const r = e || (typeof window < "u" ? window.location.origin : "");
89
- if (!t)
87
+ function W(t, e) {
88
+ const r = t || (typeof window < "u" ? window.location.origin : "");
89
+ if (!e)
90
90
  return { baseUrl: r };
91
- const n = { headers: { Authorization: `Bearer ${t}` } };
91
+ const n = { headers: { Authorization: `Bearer ${e}` } };
92
92
  return {
93
93
  baseUrl: r,
94
- beforeSubscribe(s) {
94
+ beforeSubscribe(o) {
95
95
  return n;
96
96
  },
97
- beforeUnsubscribe(s) {
97
+ beforeUnsubscribe(o) {
98
98
  return n;
99
99
  }
100
100
  };
101
101
  }
102
- async function j() {
102
+ async function V() {
103
103
  if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
104
104
  return window.Transmit;
105
105
  try {
106
- const e = await import("@adonisjs/transmit-client");
107
- return e.Transmit ?? e.default ?? null;
106
+ const t = await import("@adonisjs/transmit-client");
107
+ return t.Transmit ?? t.default ?? null;
108
108
  } catch {
109
109
  return null;
110
110
  }
111
111
  }
112
- function W(e) {
113
- let t = null, r = null, n = !1;
112
+ function G(t) {
113
+ let e = null, r = null, n = !1;
114
114
  return { subscribe: async () => {
115
115
  try {
116
- const i = await j();
116
+ const i = await V();
117
117
  if (!i)
118
118
  throw new Error(
119
119
  "Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
120
120
  );
121
121
  if (n) return;
122
- t = new i(z(e.baseUrl, e.authToken)), r = t.subscription(e.channelName), r.onMessage((a) => {
123
- n || e.onMessage(a);
122
+ e = new i(W(t.baseUrl, t.authToken)), r = e.subscription(t.channelName), r.onMessage((l) => {
123
+ n || t.onMessage(l);
124
124
  }), await r.create();
125
125
  } catch (i) {
126
- e.onError?.(i);
126
+ t.onError?.(i);
127
127
  }
128
128
  }, unsubscribe: async () => {
129
129
  n = !0;
130
130
  try {
131
- await r?.delete(), r = null, t = null;
131
+ await r?.delete(), r = null, e = null;
132
132
  } catch {
133
133
  }
134
134
  } };
135
135
  }
136
- function V(e) {
137
- let t = !1;
138
- const r = W({
139
- baseUrl: e.baseUrl,
140
- channelName: e.channelName,
141
- authToken: e.authToken,
142
- onMessage: e.onMessage,
136
+ function Q(t) {
137
+ let e = !1;
138
+ const r = G({
139
+ baseUrl: t.baseUrl,
140
+ channelName: t.channelName,
141
+ authToken: t.authToken,
142
+ onMessage: t.onMessage,
143
143
  onError: (n) => {
144
- t = !0, e.onError?.(n), e.onDisconnect?.();
144
+ e = !0, t.onError?.(n), t.onDisconnect?.();
145
145
  }
146
146
  });
147
147
  return r.subscribe().then(() => {
148
- t || e.onConnect?.();
148
+ e || t.onConnect?.();
149
149
  }).catch((n) => {
150
- e.onError?.(n), e.onDisconnect?.();
150
+ t.onError?.(n), t.onDisconnect?.();
151
151
  }), {
152
152
  unsubscribe: () => {
153
153
  r.unsubscribe().catch(() => {
@@ -155,38 +155,38 @@ function V(e) {
155
155
  }
156
156
  };
157
157
  }
158
- const E = "ss-dash-theme", P = "ss-theme-change";
159
- function I() {
158
+ const C = "ss-dash-theme", P = "ss-theme-change";
159
+ function O() {
160
160
  if (typeof window > "u") return "light";
161
- const e = localStorage.getItem(E);
162
- return e === "dark" || e === "light" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
161
+ const t = localStorage.getItem(C);
162
+ return t === "dark" || t === "light" ? t : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
163
163
  }
164
- function G(e) {
165
- typeof window > "u" || (localStorage.setItem(E, e), window.dispatchEvent(new CustomEvent(P, { detail: e })));
164
+ function J(t) {
165
+ typeof window > "u" || (localStorage.setItem(C, t), window.dispatchEvent(new CustomEvent(P, { detail: t })));
166
166
  }
167
- function Ge() {
168
- const t = I() === "dark" ? "light" : "dark";
169
- return G(t), t;
167
+ function te() {
168
+ const e = O() === "dark" ? "light" : "dark";
169
+ return J(e), e;
170
170
  }
171
- function Qe(e) {
171
+ function ee(t) {
172
172
  if (typeof window > "u") return () => {
173
173
  };
174
- const t = (o) => {
175
- const i = o.detail;
176
- (i === "dark" || i === "light") && e(i);
177
- }, r = (o) => {
178
- if (o.key === E) {
179
- const i = o.newValue;
180
- e(i === "dark" || i === "light" ? i : I());
174
+ const e = (s) => {
175
+ const i = s.detail;
176
+ (i === "dark" || i === "light") && t(i);
177
+ }, r = (s) => {
178
+ if (s.key === C) {
179
+ const i = s.newValue;
180
+ t(i === "dark" || i === "light" ? i : O());
181
181
  }
182
- }, n = window.matchMedia("(prefers-color-scheme: dark)"), s = (o) => {
183
- localStorage.getItem(E) || e(o.matches ? "dark" : "light");
182
+ }, n = window.matchMedia("(prefers-color-scheme: dark)"), o = (s) => {
183
+ localStorage.getItem(C) || t(s.matches ? "dark" : "light");
184
184
  };
185
- return window.addEventListener(P, t), window.addEventListener("storage", r), n.addEventListener("change", s), () => {
186
- window.removeEventListener(P, t), window.removeEventListener("storage", r), n.removeEventListener("change", s);
185
+ return window.addEventListener(P, e), window.addEventListener("storage", r), n.addEventListener("change", o), () => {
186
+ window.removeEventListener(P, e), window.removeEventListener("storage", r), n.removeEventListener("change", o);
187
187
  };
188
188
  }
189
- const S = {
189
+ const x = {
190
190
  color: "#34d399",
191
191
  fillOpacityTop: 0.25,
192
192
  fillOpacityBottom: 0.02,
@@ -195,211 +195,211 @@ const S = {
195
195
  height: 32,
196
196
  padding: 2
197
197
  };
198
- function Q(e) {
199
- return { ...S, ...e };
200
- }
201
- function Je(e, t = S.width, r = S.height, n = S.padding) {
202
- if (e.length < 2) return null;
203
- const s = t - n * 2, o = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1;
204
- return e.map((g, f) => {
205
- const p = n + f / (e.length - 1) * s, d = n + o - (g - i) / c * o;
198
+ function Y(t) {
199
+ return { ...x, ...t };
200
+ }
201
+ function re(t, e = x.width, r = x.height, n = x.padding) {
202
+ if (t.length < 2) return null;
203
+ const o = e - n * 2, s = r - n * 2, i = Math.min(...t), a = Math.max(...t) - i || 1;
204
+ return t.map((m, f) => {
205
+ const p = n + f / (t.length - 1) * o, d = n + s - (m - i) / a * s;
206
206
  return `${p.toFixed(1)},${d.toFixed(1)}`;
207
207
  }).join(" ");
208
208
  }
209
- function Ye(e, t = S.width, r = S.height, n = S.padding) {
210
- if (e.length < 2) return null;
211
- const s = t - n * 2, o = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1, l = e.map((d, m) => {
212
- const u = n + m / (e.length - 1) * s, y = n + o - (d - i) / c * o;
213
- return `${u.toFixed(1)},${y.toFixed(1)}`;
214
- }), g = (n + s).toFixed(1), f = (n + o).toFixed(1), p = n.toFixed(1);
215
- return `M${l[0]} ` + l.slice(1).map((d) => `L${d}`).join(" ") + ` L${g},${f} L${p},${f} Z`;
216
- }
217
- let J = 0;
218
- function Y() {
219
- return `ss-grad-${J++}`;
220
- }
221
- function X(e) {
222
- if (e.length === 0) return null;
223
- let t = e[0], r = e[0], n = e[0];
224
- for (let s = 1; s < e.length; s++) {
225
- const o = e[s];
226
- o < t && (t = o), o > r && (r = o), n += o;
227
- }
228
- return { min: t, max: r, avg: n / e.length };
229
- }
230
- function Xe(e, t) {
231
- if (e.length < 2) return null;
232
- const r = Q(t), n = X(e), s = n.max - n.min || 1, o = r.width - r.padding * 2, i = r.height - r.padding * 2, a = r.padding, c = e.length, l = Array.from({ length: c });
233
- for (let u = 0; u < c; u++) {
234
- const y = a + u / (c - 1) * o, v = a + i - (e[u] - n.min) / s * i;
235
- l[u] = `${y.toFixed(1)},${v.toFixed(1)}`;
236
- }
237
- const g = l.join(" "), f = (a + o).toFixed(1), p = (a + i).toFixed(1), d = a.toFixed(1), m = `M${l[0]} ` + l.slice(1).map((u) => `L${u}`).join(" ") + ` L${f},${p} L${d},${p} Z`;
209
+ function ne(t, e = x.width, r = x.height, n = x.padding) {
210
+ if (t.length < 2) return null;
211
+ const o = e - n * 2, s = r - n * 2, i = Math.min(...t), a = Math.max(...t) - i || 1, c = t.map((d, g) => {
212
+ const h = n + g / (t.length - 1) * o, y = n + s - (d - i) / a * s;
213
+ return `${h.toFixed(1)},${y.toFixed(1)}`;
214
+ }), m = (n + o).toFixed(1), f = (n + s).toFixed(1), p = n.toFixed(1);
215
+ return `M${c[0]} ` + c.slice(1).map((d) => `L${d}`).join(" ") + ` L${m},${f} L${p},${f} Z`;
216
+ }
217
+ let X = 0;
218
+ function Z() {
219
+ return `ss-grad-${X++}`;
220
+ }
221
+ function tt(t) {
222
+ if (t.length === 0) return null;
223
+ let e = t[0], r = t[0], n = t[0];
224
+ for (let o = 1; o < t.length; o++) {
225
+ const s = t[o];
226
+ s < e && (e = s), s > r && (r = s), n += s;
227
+ }
228
+ return { min: e, max: r, avg: n / t.length };
229
+ }
230
+ function se(t, e) {
231
+ if (t.length < 2) return null;
232
+ const r = Y(e), n = tt(t), o = n.max - n.min || 1, s = r.width - r.padding * 2, i = r.height - r.padding * 2, l = r.padding, a = t.length, c = Array.from({ length: a });
233
+ for (let h = 0; h < a; h++) {
234
+ const y = l + h / (a - 1) * s, S = l + i - (t[h] - n.min) / o * i;
235
+ c[h] = `${y.toFixed(1)},${S.toFixed(1)}`;
236
+ }
237
+ const m = c.join(" "), f = (l + s).toFixed(1), p = (l + i).toFixed(1), d = l.toFixed(1), g = `M${c[0]} ` + c.slice(1).map((h) => `L${h}`).join(" ") + ` L${f},${p} L${d},${p} Z`;
238
238
  return {
239
- points: g,
240
- areaPath: m,
241
- gradientId: Y(),
239
+ points: m,
240
+ areaPath: g,
241
+ gradientId: Z(),
242
242
  options: r,
243
243
  stats: n
244
244
  };
245
245
  }
246
- const Z = 5e3, ee = 1e4, te = 3e3, re = 100, ne = 500, oe = 60, se = 1e4;
247
- function ie(e) {
248
- return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
246
+ const et = 5e3, rt = 1e4, nt = 3e3, N = 100, st = 500, ot = 60, it = 1e4;
247
+ function at(t) {
248
+ return '"' + (t.length > 40 ? t.slice(0, 40) + "..." : t) + '"';
249
249
  }
250
- function ae(e, t, r) {
251
- if (e.length === 0) return "[]";
252
- const n = e.slice(0, 3).map((i) => r(i, 30)), s = e.length > 3 ? ", ..." + e.length + " items" : "", o = "[" + n.join(", ") + s + "]";
253
- return o.length > t ? "[" + e.length + " items]" : o;
250
+ function lt(t, e, r) {
251
+ if (t.length === 0) return "[]";
252
+ const n = t.slice(0, 3).map((i) => r(i, 30)), o = t.length > 3 ? ", ..." + t.length + " items" : "", s = "[" + n.join(", ") + o + "]";
253
+ return s.length > e ? "[" + t.length + " items]" : s;
254
254
  }
255
- function ce(e, t, r) {
256
- const n = Object.keys(e);
255
+ function ct(t, e, r) {
256
+ const n = Object.keys(t);
257
257
  if (n.length === 0) return "{}";
258
- const s = [];
259
- for (let c = 0; c < Math.min(n.length, 4); c++)
260
- s.push(n[c] + ": " + r(e[n[c]], 30));
261
- const o = n.length > 4 ? ", ...+" + (n.length - 4) : "", i = "{ " + s.join(", ") + o + " }";
262
- return i.length <= t ? i : "{ " + (n.slice(0, 6).join(", ") + (n.length > 6 ? ", ..." : "")) + " }";
258
+ const o = [];
259
+ for (let a = 0; a < Math.min(n.length, 4); a++)
260
+ o.push(n[a] + ": " + r(t[n[a]], 30));
261
+ const s = n.length > 4 ? ", ...+" + (n.length - 4) : "", i = "{ " + o.join(", ") + s + " }";
262
+ return i.length <= e ? i : "{ " + (n.slice(0, 6).join(", ") + (n.length > 6 ? ", ..." : "")) + " }";
263
263
  }
264
- function le(e) {
265
- if (!e && e !== 0) return "-";
266
- const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), s = Math.floor(t % 3600 / 60);
267
- return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${s}m` : s > 0 ? `${s}m ${t % 60}s` : `${t}s`;
264
+ function ut(t) {
265
+ if (!t && t !== 0) return "-";
266
+ const e = Math.floor(t), r = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), o = Math.floor(e % 3600 / 60);
267
+ return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${o}m` : o > 0 ? `${o}m ${e % 60}s` : `${e}s`;
268
268
  }
269
- function A(e) {
270
- const t = e / 1048576;
271
- return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(0)}M`;
269
+ function A(t) {
270
+ const e = t / 1048576;
271
+ return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(0)}M`;
272
272
  }
273
- function F(e) {
274
- return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(1)}M`;
273
+ function D(t) {
274
+ return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(1)}M`;
275
275
  }
276
- function ue(e) {
277
- return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : `${e}`;
276
+ function ht(t) {
277
+ return t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : `${t}`;
278
278
  }
279
- function Ze(e) {
280
- return e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : e >= 1 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`;
279
+ function oe(t) {
280
+ return t >= 1e3 ? `${(t / 1e3).toFixed(2)}s` : t >= 1 ? `${t.toFixed(0)}ms` : `${t.toFixed(2)}ms`;
281
281
  }
282
- function H(e) {
283
- return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(e) ? e : e + "Z";
282
+ function H(t) {
283
+ return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(t) ? t : t + "Z";
284
284
  }
285
- function et(e) {
286
- if (!e) return "-";
287
- const t = typeof e == "string" ? new Date(H(e)) : new Date(e);
288
- return Number.isNaN(t.getTime()) ? "-" : t.toLocaleTimeString("en-US", {
285
+ function ie(t) {
286
+ if (!t) return "-";
287
+ const e = typeof t == "string" ? new Date(H(t)) : new Date(t);
288
+ return Number.isNaN(e.getTime()) ? "-" : e.toLocaleTimeString("en-US", {
289
289
  hour12: !1,
290
290
  hour: "2-digit",
291
291
  minute: "2-digit",
292
292
  second: "2-digit"
293
- }) + "." + String(t.getMilliseconds()).padStart(3, "0");
293
+ }) + "." + String(e.getMilliseconds()).padStart(3, "0");
294
294
  }
295
- function tt(e) {
296
- if (!e) return "-";
297
- const t = typeof e == "string" ? new Date(H(e)).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
295
+ function ae(t) {
296
+ if (!t) return "-";
297
+ const e = typeof t == "string" ? new Date(H(t)).getTime() : t, r = Math.floor((Date.now() - e) / 1e3);
298
298
  return r < 0 ? "just now" : r < 60 ? `${r}s ago` : r < 3600 ? `${Math.floor(r / 60)}m ago` : r < 86400 ? `${Math.floor(r / 3600)}h ago` : `${Math.floor(r / 86400)}d ago`;
299
299
  }
300
- function rt(e, t) {
301
- switch (t) {
300
+ function le(t, e) {
301
+ switch (e) {
302
302
  case "%":
303
- return `${e.toFixed(1)}%`;
303
+ return `${t.toFixed(1)}%`;
304
304
  case "ms":
305
- return `${e.toFixed(0)}ms`;
305
+ return `${t.toFixed(0)}ms`;
306
306
  case "MB":
307
- return `${e.toFixed(1)}M`;
307
+ return `${t.toFixed(1)}M`;
308
308
  case "bytes":
309
- return A(e);
309
+ return A(t);
310
310
  case "/s":
311
311
  case "/m":
312
- return e.toFixed(1);
312
+ return t.toFixed(1);
313
313
  default:
314
- return e.toFixed(1);
314
+ return t.toFixed(1);
315
315
  }
316
316
  }
317
- function w(e, t, r) {
318
- return e > r ? "red" : e > t ? "amber" : "green";
317
+ function v(t, e, r) {
318
+ return t > r ? "red" : t > e ? "amber" : "green";
319
319
  }
320
- function he(e, t, r) {
321
- return e < r ? "red" : e < t ? "amber" : "green";
320
+ function dt(t, e, r) {
321
+ return t < r ? "red" : t < e ? "amber" : "green";
322
322
  }
323
- function U(e, t) {
324
- if (t === 0) return "green";
325
- const r = e / t;
323
+ function F(t, e) {
324
+ if (e === 0) return "green";
325
+ const r = t / e;
326
326
  return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
327
327
  }
328
- const de = {
328
+ const ft = {
329
329
  green: "ss-green",
330
330
  amber: "ss-amber",
331
331
  red: "ss-red"
332
- }, nt = {
332
+ }, ce = {
333
333
  green: "#34d399",
334
334
  amber: "#fbbf24",
335
335
  red: "#f87171"
336
- }, ot = {
336
+ }, ue = {
337
337
  green: "--ss-accent",
338
338
  amber: "--ss-amber-fg",
339
339
  red: "--ss-red-fg"
340
340
  };
341
- function st(e) {
342
- return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
341
+ function he(t) {
342
+ return t >= 500 ? "red" : t >= 400 ? "amber" : "green";
343
343
  }
344
- function fe(e) {
345
- return e > ne ? "very-slow" : e > re ? "slow" : "normal";
344
+ function pt(t) {
345
+ return t > st ? "very-slow" : t > N ? "slow" : "normal";
346
346
  }
347
- function it(e, t = "ss-dash") {
348
- const r = fe(e);
349
- return r === "very-slow" ? `${t}-very-slow` : r === "slow" ? `${t}-slow` : "";
347
+ function de(t, e = "ss-dash") {
348
+ const r = pt(t);
349
+ return r === "very-slow" ? `${e}-very-slow` : r === "slow" ? `${e}-slow` : "";
350
350
  }
351
- function at(e) {
352
- return e ? e.length <= 8 ? e : e.slice(0, 8) + "…" : "--";
351
+ function fe(t) {
352
+ return t ? t.length <= 8 ? t : t.slice(0, 8) + "…" : "--";
353
353
  }
354
- function D(e, t = 100) {
355
- return e === null ? "null" : e === void 0 ? "-" : typeof e == "string" ? ie(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? ae(e, t, D) : typeof e == "object" ? ce(e, t, D) : String(e);
354
+ function U(t, e = 100) {
355
+ return t === null ? "null" : t === void 0 ? "-" : typeof t == "string" ? at(t) : typeof t == "number" || typeof t == "boolean" ? String(t) : Array.isArray(t) ? lt(t, e, U) : typeof t == "object" ? ct(t, e, U) : String(t);
356
356
  }
357
- function ct(e) {
358
- return e < 0 ? "no expiry" : e < 60 ? `${e}s` : e < 3600 ? `${Math.floor(e / 60)}m` : e < 86400 ? `${Math.floor(e / 3600)}h` : `${Math.floor(e / 86400)}d`;
357
+ function pe(t) {
358
+ return t < 0 ? "no expiry" : t < 60 ? `${t}s` : t < 3600 ? `${Math.floor(t / 60)}m` : t < 86400 ? `${Math.floor(t / 3600)}h` : `${Math.floor(t / 86400)}d`;
359
359
  }
360
- function lt(e) {
361
- return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / (1024 * 1024)).toFixed(1)}MB`;
360
+ function me(t) {
361
+ return t < 1024 ? `${t}B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)}KB` : `${(t / (1024 * 1024)).toFixed(1)}MB`;
362
362
  }
363
- const B = 50;
364
- function ut(e, t, r) {
363
+ const q = 50;
364
+ function ge(t, e, r) {
365
365
  const n = new URLSearchParams();
366
- if (n.set("page", String(e.page)), n.set("perPage", String(e.perPage)), t) {
367
- t.search && n.set("search", t.search);
368
- for (const [s, o] of Object.entries(t.filters))
369
- o && n.set(s, o);
366
+ if (n.set("page", String(t.page)), n.set("perPage", String(t.perPage)), e) {
367
+ e.search && n.set("search", e.search);
368
+ for (const [o, s] of Object.entries(e.filters))
369
+ s && n.set(o, s);
370
370
  }
371
371
  return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
372
372
  }
373
- function ht(e, t = B) {
374
- const r = e.data ?? e.items ?? [], n = e.total ?? 0, s = e.page ?? 1, o = e.perPage ?? e.limit ?? t, i = e.totalPages ?? (Math.ceil(n / o) || 1);
373
+ function ye(t, e = q) {
374
+ const r = t.data ?? t.items ?? [], n = t.total ?? 0, o = t.page ?? 1, s = t.perPage ?? t.limit ?? e, i = t.totalPages ?? (Math.ceil(n / s) || 1);
375
375
  return {
376
376
  data: r,
377
377
  pagination: {
378
- page: s,
379
- perPage: o,
378
+ page: o,
379
+ perPage: s,
380
380
  total: n,
381
381
  totalPages: i
382
382
  }
383
383
  };
384
384
  }
385
- function dt(e = B) {
385
+ function be(t = q) {
386
386
  return {
387
387
  page: 1,
388
- perPage: e,
388
+ perPage: t,
389
389
  total: 0,
390
390
  totalPages: 1
391
391
  };
392
392
  }
393
- function ft() {
393
+ function xe() {
394
394
  return {
395
395
  search: "",
396
396
  filters: {}
397
397
  };
398
398
  }
399
- function pt(e = "id", t = "desc") {
400
- return { field: e, direction: t };
399
+ function Se(t = "id", e = "desc") {
400
+ return { field: t, direction: e };
401
401
  }
402
- const pe = [
402
+ const mt = [
403
403
  { key: "page", param: "page", isNumeric: !0 },
404
404
  { key: "perPage", param: "perPage", isNumeric: !0 },
405
405
  { key: "search", param: "search" },
@@ -407,39 +407,39 @@ const pe = [
407
407
  { key: "sortDir", param: "direction" },
408
408
  { key: "timeRange", param: "range" }
409
409
  ];
410
- function ge(e) {
411
- const t = new URLSearchParams(), r = e;
412
- for (const { key: n, param: s, isNumeric: o } of pe) {
410
+ function gt(t) {
411
+ const e = new URLSearchParams(), r = t;
412
+ for (const { key: n, param: o, isNumeric: s } of mt) {
413
413
  const i = r[n];
414
- (o ? i != null : i) && t.set(s, String(i));
414
+ (s ? i != null : i) && e.set(o, String(i));
415
415
  }
416
- if (e.filters)
417
- for (const [n, s] of Object.entries(e.filters))
418
- s && t.set(n, s);
419
- return t.toString();
416
+ if (t.filters)
417
+ for (const [n, o] of Object.entries(t.filters))
418
+ o && e.set(n, o);
419
+ return e.toString();
420
420
  }
421
- function gt(e) {
422
- const t = Math.max(1, Math.ceil(e.total / e.perPage)), r = Math.min(e.page, t), n = e.total === 0 ? 0 : (r - 1) * e.perPage + 1, s = Math.min(r * e.perPage, e.total);
421
+ function we(t) {
422
+ const e = Math.max(1, Math.ceil(t.total / t.perPage)), r = Math.min(t.page, e), n = t.total === 0 ? 0 : (r - 1) * t.perPage + 1, o = Math.min(r * t.perPage, t.total);
423
423
  return {
424
424
  page: r,
425
- perPage: e.perPage,
426
- total: e.total,
427
- lastPage: t,
425
+ perPage: t.perPage,
426
+ total: t.total,
427
+ lastPage: e,
428
428
  from: n,
429
- to: s,
429
+ to: o,
430
430
  hasPrev: r > 1,
431
- hasNext: r < t
431
+ hasNext: r < e
432
432
  };
433
433
  }
434
- function mt(e, t, r = 2) {
435
- if (t <= 1) return [1];
436
- const n = [], s = Math.max(2, e - r), o = Math.min(t - 1, e + r);
437
- n.push(1), s > 2 && n.push("...");
438
- for (let i = s; i <= o; i++)
434
+ function ve(t, e, r = 2) {
435
+ if (e <= 1) return [1];
436
+ const n = [], o = Math.max(2, t - r), s = Math.min(e - 1, t + r);
437
+ n.push(1), o > 2 && n.push("...");
438
+ for (let i = o; i <= s; i++)
439
439
  n.push(i);
440
- return o < t - 1 && n.push("..."), t > 1 && n.push(t), n;
440
+ return s < e - 1 && n.push("..."), e > 1 && n.push(e), n;
441
441
  }
442
- const me = [
442
+ const yt = [
443
443
  "tracing",
444
444
  "process",
445
445
  "system",
@@ -452,7 +452,7 @@ const me = [
452
452
  "log",
453
453
  "emails",
454
454
  "dashboard"
455
- ], ye = [
455
+ ], bt = [
456
456
  { flag: "process", group: "process" },
457
457
  { flag: "process", group: "memory" },
458
458
  { flag: "system", group: "memory" },
@@ -462,7 +462,7 @@ const me = [
462
462
  { flag: "queues", group: "queue" },
463
463
  { flag: "app", group: "app" },
464
464
  { flag: "log", group: "log" }
465
- ], be = [
465
+ ], xt = [
466
466
  { group: "process", fields: ["cpuPercent", "uptime", "nodeVersion"] },
467
467
  {
468
468
  group: "memory",
@@ -477,10 +477,10 @@ const me = [
477
477
  { group: "app", fields: ["onlineUsers", "pendingWebhooks", "pendingEmails"] },
478
478
  { group: "log", fields: ["logErrorsLast5m", "logEntriesPerMinute"] }
479
479
  ];
480
- function M(e) {
481
- return typeof e == "number" && !Number.isNaN(e);
480
+ function k(t) {
481
+ return typeof t == "number" && !Number.isNaN(t);
482
482
  }
483
- const N = "/admin/api/debug", Se = {
483
+ const B = "/admin/api/debug", St = {
484
484
  tracing: !1,
485
485
  process: !1,
486
486
  system: !1,
@@ -495,43 +495,43 @@ const N = "/admin/api/debug", Se = {
495
495
  dashboard: !1,
496
496
  customPanes: []
497
497
  };
498
- function ve(e) {
499
- const t = { customPanes: e.customPanes ?? [] }, r = e.features;
500
- for (const n of me)
501
- t[n] = r?.[n] ?? !1;
502
- return t;
498
+ function wt(t) {
499
+ const e = { customPanes: t.customPanes ?? [] }, r = t.features;
500
+ for (const n of yt)
501
+ e[n] = r?.[n] ?? !1;
502
+ return e;
503
503
  }
504
- async function xe(e, t = N) {
505
- const r = `${t.replace(/\/+$/, "")}/config`;
506
- return e.fetch(r);
504
+ async function vt(t, e = B) {
505
+ const r = `${e.replace(/\/+$/, "")}/config`;
506
+ return t.fetch(r);
507
507
  }
508
- async function yt(e) {
509
- const { baseUrl: t = "", debugEndpoint: r = N, authToken: n } = e, s = new C({ baseUrl: t, authToken: n });
508
+ async function Ce(t) {
509
+ const { baseUrl: e = "", debugEndpoint: r = B, authToken: n } = t, o = new T({ baseUrl: e, authToken: n });
510
510
  try {
511
- const o = await xe(s, r);
512
- return ve(o);
511
+ const s = await vt(o, r);
512
+ return wt(s);
513
513
  } catch {
514
- return Se;
514
+ return St;
515
515
  }
516
516
  }
517
- function bt(e) {
518
- const t = /* @__PURE__ */ new Set(), n = "features" in e && typeof e.features == "object" && e.features !== null ? e.features : e;
519
- for (const { flag: s, group: o } of ye)
520
- n[s] && t.add(o);
521
- return t;
517
+ function Ee(t) {
518
+ const e = /* @__PURE__ */ new Set(), n = "features" in t && typeof t.features == "object" && t.features !== null ? t.features : t;
519
+ for (const { flag: o, group: s } of bt)
520
+ n[o] && e.add(s);
521
+ return e;
522
522
  }
523
- function St(e) {
524
- const t = /* @__PURE__ */ new Set();
525
- (M(e.cpuPercent) || M(e.uptime) || we(e)) && t.add("process");
526
- for (const r of be)
527
- r.fields.some((n) => M(e[n])) && t.add(r.group);
528
- return e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), t;
523
+ function Te(t) {
524
+ const e = /* @__PURE__ */ new Set();
525
+ (k(t.cpuPercent) || k(t.uptime) || Ct(t)) && e.add("process");
526
+ for (const r of xt)
527
+ r.fields.some((n) => k(t[n])) && e.add(r.group);
528
+ return t.redisOk !== void 0 && t.redisOk !== null && e.add("redis"), e;
529
529
  }
530
- function we(e) {
531
- return typeof e.nodeVersion == "string" && e.nodeVersion.length > 0;
530
+ function Ct(t) {
531
+ return typeof t.nodeVersion == "string" && t.nodeVersion.length > 0;
532
532
  }
533
- function b(e) {
534
- return de[e] || "";
533
+ function b(t) {
534
+ return ft[t] || "";
535
535
  }
536
536
  const $ = [
537
537
  // ── Process group ─────────────────────────────────────────────────────────
@@ -542,8 +542,8 @@ const $ = [
542
542
  title: "Node.js Runtime",
543
543
  unit: "",
544
544
  group: "process",
545
- extract: (e) => 0,
546
- format: (e) => e.nodeVersion,
545
+ extract: (t) => 0,
546
+ format: (t) => t.nodeVersion,
547
547
  color: () => ""
548
548
  },
549
549
  // -- Uptime ---------------------------------------------------------------
@@ -553,8 +553,8 @@ const $ = [
553
553
  title: "Process Uptime",
554
554
  unit: "",
555
555
  group: "process",
556
- extract: (e) => e.uptime,
557
- format: (e) => le(e.uptime),
556
+ extract: (t) => t.uptime,
557
+ format: (t) => ut(t.uptime),
558
558
  color: () => ""
559
559
  },
560
560
  // -- CPU ------------------------------------------------------------------
@@ -566,9 +566,9 @@ const $ = [
566
566
  group: "process",
567
567
  warnThreshold: 50,
568
568
  critThreshold: 80,
569
- extract: (e) => e.cpuPercent,
570
- format: (e) => `${e.cpuPercent.toFixed(1)}%`,
571
- color: (e) => b(w(e.cpuPercent, 50, 80)),
569
+ extract: (t) => t.cpuPercent,
570
+ format: (t) => `${t.cpuPercent.toFixed(1)}%`,
571
+ color: (t) => b(v(t.cpuPercent, 50, 80)),
572
572
  historyKey: "cpuPercent"
573
573
  },
574
574
  // -- Event loop -----------------------------------------------------------
@@ -580,9 +580,9 @@ const $ = [
580
580
  group: "process",
581
581
  warnThreshold: 20,
582
582
  critThreshold: 50,
583
- extract: (e) => e.eventLoopLag,
584
- format: (e) => `${e.eventLoopLag.toFixed(1)}ms`,
585
- color: (e) => b(w(e.eventLoopLag, 20, 50)),
583
+ extract: (t) => t.eventLoopLag,
584
+ format: (t) => `${t.eventLoopLag.toFixed(1)}ms`,
585
+ color: (t) => b(v(t.eventLoopLag, 20, 50)),
586
586
  historyKey: "eventLoopLag"
587
587
  },
588
588
  // ── Memory group ──────────────────────────────────────────────────────────
@@ -593,8 +593,8 @@ const $ = [
593
593
  title: "V8 Heap Usage",
594
594
  unit: "bytes",
595
595
  group: "memory",
596
- extract: (e) => e.memHeapUsed,
597
- format: (e) => A(e.memHeapUsed),
596
+ extract: (t) => t.memHeapUsed,
597
+ format: (t) => A(t.memHeapUsed),
598
598
  color: () => "",
599
599
  historyKey: "memHeapUsed"
600
600
  },
@@ -605,8 +605,8 @@ const $ = [
605
605
  title: "Resident Set Size",
606
606
  unit: "bytes",
607
607
  group: "memory",
608
- extract: (e) => e.memRss,
609
- format: (e) => A(e.memRss),
608
+ extract: (t) => t.memRss,
609
+ format: (t) => A(t.memRss),
610
610
  color: () => "",
611
611
  historyKey: "memRss"
612
612
  },
@@ -617,16 +617,16 @@ const $ = [
617
617
  title: "System Memory",
618
618
  unit: "MB",
619
619
  group: "memory",
620
- extract: (e) => e.systemMemoryTotalMb - e.systemMemoryFreeMb,
621
- format: (e) => `${F(e.systemMemoryTotalMb - e.systemMemoryFreeMb)}/${F(e.systemMemoryTotalMb)}`,
622
- color: (e) => {
623
- const t = e.systemMemoryTotalMb;
624
- if (t === 0) return "";
625
- const r = t - e.systemMemoryFreeMb;
626
- return b(U(r, t));
620
+ extract: (t) => t.systemMemoryTotalMb - t.systemMemoryFreeMb,
621
+ format: (t) => `${D(t.systemMemoryTotalMb - t.systemMemoryFreeMb)}/${D(t.systemMemoryTotalMb)}`,
622
+ color: (t) => {
623
+ const e = t.systemMemoryTotalMb;
624
+ if (e === 0) return "";
625
+ const r = e - t.systemMemoryFreeMb;
626
+ return b(F(r, e));
627
627
  },
628
628
  historyKey: "_sysMemUsed",
629
- show: (e) => e.systemMemoryTotalMb !== null && e.systemMemoryTotalMb !== void 0
629
+ show: (t) => t.systemMemoryTotalMb !== null && t.systemMemoryTotalMb !== void 0
630
630
  },
631
631
  // ── HTTP group ────────────────────────────────────────────────────────────
632
632
  // -- Requests per second --------------------------------------------------
@@ -636,8 +636,8 @@ const $ = [
636
636
  title: "Requests per Second",
637
637
  unit: "/s",
638
638
  group: "http",
639
- extract: (e) => e.requestsPerSecond,
640
- format: (e) => e.requestsPerSecond.toFixed(1),
639
+ extract: (t) => t.requestsPerSecond,
640
+ format: (t) => t.requestsPerSecond.toFixed(1),
641
641
  color: () => "",
642
642
  historyKey: "requestsPerSecond"
643
643
  },
@@ -650,9 +650,9 @@ const $ = [
650
650
  group: "http",
651
651
  warnThreshold: 200,
652
652
  critThreshold: 500,
653
- extract: (e) => e.avgResponseTimeMs,
654
- format: (e) => `${e.avgResponseTimeMs.toFixed(0)}ms`,
655
- color: (e) => b(w(e.avgResponseTimeMs, 200, 500)),
653
+ extract: (t) => t.avgResponseTimeMs,
654
+ format: (t) => `${t.avgResponseTimeMs.toFixed(0)}ms`,
655
+ color: (t) => b(v(t.avgResponseTimeMs, 200, 500)),
656
656
  historyKey: "avgResponseTimeMs"
657
657
  },
658
658
  // -- Error rate -----------------------------------------------------------
@@ -664,9 +664,9 @@ const $ = [
664
664
  group: "http",
665
665
  warnThreshold: 1,
666
666
  critThreshold: 5,
667
- extract: (e) => e.errorRate,
668
- format: (e) => `${e.errorRate.toFixed(1)}%`,
669
- color: (e) => b(w(e.errorRate, 1, 5)),
667
+ extract: (t) => t.errorRate,
668
+ format: (t) => `${t.errorRate.toFixed(1)}%`,
669
+ color: (t) => b(v(t.errorRate, 1, 5)),
670
670
  historyKey: "errorRate"
671
671
  },
672
672
  // -- Active connections ---------------------------------------------------
@@ -676,8 +676,8 @@ const $ = [
676
676
  title: "Active Connections",
677
677
  unit: "",
678
678
  group: "http",
679
- extract: (e) => e.activeHttpConnections,
680
- format: (e) => `${e.activeHttpConnections}`,
679
+ extract: (t) => t.activeHttpConnections,
680
+ format: (t) => `${t.activeHttpConnections}`,
681
681
  color: () => "",
682
682
  historyKey: "activeHttpConnections"
683
683
  },
@@ -689,9 +689,9 @@ const $ = [
689
689
  title: "Database Pool",
690
690
  unit: "",
691
691
  group: "db",
692
- extract: (e) => e.dbPoolUsed,
693
- format: (e) => `${e.dbPoolUsed}/${e.dbPoolFree}/${e.dbPoolMax}`,
694
- color: (e) => b(U(e.dbPoolUsed, e.dbPoolMax)),
692
+ extract: (t) => t.dbPoolUsed,
693
+ format: (t) => `${t.dbPoolUsed}/${t.dbPoolFree}/${t.dbPoolMax}`,
694
+ color: (t) => b(F(t.dbPoolUsed, t.dbPoolMax)),
695
695
  historyKey: "dbPoolUsed"
696
696
  },
697
697
  // ── Redis group ───────────────────────────────────────────────────────────
@@ -702,9 +702,9 @@ const $ = [
702
702
  title: "Redis Status",
703
703
  unit: "",
704
704
  group: "redis",
705
- extract: (e) => e.redisOk ? 1 : 0,
706
- format: (e) => e.redisOk ? "✓" : "✗",
707
- color: (e) => e.redisOk ? "ss-green" : "ss-red"
705
+ extract: (t) => t.redisOk ? 1 : 0,
706
+ format: (t) => t.redisOk ? "✓" : "✗",
707
+ color: (t) => t.redisOk ? "ss-green" : "ss-red"
708
708
  },
709
709
  // -- Redis memory ---------------------------------------------------------
710
710
  {
@@ -713,11 +713,11 @@ const $ = [
713
713
  title: "Redis Memory",
714
714
  unit: "MB",
715
715
  group: "redis",
716
- extract: (e) => e.redisMemoryUsedMb,
717
- format: (e) => `${e.redisMemoryUsedMb.toFixed(1)}M`,
716
+ extract: (t) => t.redisMemoryUsedMb,
717
+ format: (t) => `${t.redisMemoryUsedMb.toFixed(1)}M`,
718
718
  color: () => "",
719
719
  historyKey: "redisMemoryUsedMb",
720
- show: (e) => e.redisOk
720
+ show: (t) => t.redisOk
721
721
  },
722
722
  // -- Redis keys -----------------------------------------------------------
723
723
  {
@@ -726,11 +726,11 @@ const $ = [
726
726
  title: "Redis Keys",
727
727
  unit: "",
728
728
  group: "redis",
729
- extract: (e) => e.redisKeysCount,
730
- format: (e) => ue(e.redisKeysCount),
729
+ extract: (t) => t.redisKeysCount,
730
+ format: (t) => ht(t.redisKeysCount),
731
731
  color: () => "",
732
732
  historyKey: "redisKeysCount",
733
- show: (e) => e.redisOk
733
+ show: (t) => t.redisOk
734
734
  },
735
735
  // -- Redis hit rate -------------------------------------------------------
736
736
  {
@@ -742,11 +742,11 @@ const $ = [
742
742
  warnThreshold: 90,
743
743
  critThreshold: 70,
744
744
  inverseThreshold: !0,
745
- extract: (e) => e.redisHitRate,
746
- format: (e) => `${e.redisHitRate.toFixed(0)}%`,
747
- color: (e) => b(he(e.redisHitRate, 90, 70)),
745
+ extract: (t) => t.redisHitRate,
746
+ format: (t) => `${t.redisHitRate.toFixed(0)}%`,
747
+ color: (t) => b(dt(t.redisHitRate, 90, 70)),
748
748
  historyKey: "redisHitRate",
749
- show: (e) => e.redisOk
749
+ show: (t) => t.redisOk
750
750
  },
751
751
  // ── Queue group ───────────────────────────────────────────────────────────
752
752
  // -- Queue ----------------------------------------------------------------
@@ -756,9 +756,9 @@ const $ = [
756
756
  title: "Job Queue",
757
757
  unit: "",
758
758
  group: "queue",
759
- extract: (e) => e.queueActive,
760
- format: (e) => `${e.queueActive}/${e.queueWaiting}/${e.queueDelayed}`,
761
- color: (e) => e.queueFailed > 0 ? "ss-amber" : "ss-green",
759
+ extract: (t) => t.queueActive,
760
+ format: (t) => `${t.queueActive}/${t.queueWaiting}/${t.queueDelayed}`,
761
+ color: (t) => t.queueFailed > 0 ? "ss-amber" : "ss-green",
762
762
  historyKey: "queueActive"
763
763
  },
764
764
  // -- Queue workers --------------------------------------------------------
@@ -768,8 +768,8 @@ const $ = [
768
768
  title: "Queue Workers",
769
769
  unit: "",
770
770
  group: "queue",
771
- extract: (e) => e.queueWorkerCount,
772
- format: (e) => `${e.queueWorkerCount}`,
771
+ extract: (t) => t.queueWorkerCount,
772
+ format: (t) => `${t.queueWorkerCount}`,
773
773
  color: () => ""
774
774
  },
775
775
  // ── App group ─────────────────────────────────────────────────────────────
@@ -780,8 +780,8 @@ const $ = [
780
780
  title: "Online Users",
781
781
  unit: "",
782
782
  group: "app",
783
- extract: (e) => e.onlineUsers,
784
- format: (e) => `${e.onlineUsers}`,
783
+ extract: (t) => t.onlineUsers,
784
+ format: (t) => `${t.onlineUsers}`,
785
785
  color: () => "",
786
786
  historyKey: "onlineUsers"
787
787
  },
@@ -792,9 +792,9 @@ const $ = [
792
792
  title: "Pending Webhooks",
793
793
  unit: "",
794
794
  group: "app",
795
- extract: (e) => e.pendingWebhooks,
796
- format: (e) => `${e.pendingWebhooks}`,
797
- color: (e) => e.pendingWebhooks > 0 ? "ss-amber" : "",
795
+ extract: (t) => t.pendingWebhooks,
796
+ format: (t) => `${t.pendingWebhooks}`,
797
+ color: (t) => t.pendingWebhooks > 0 ? "ss-amber" : "",
798
798
  historyKey: "pendingWebhooks"
799
799
  },
800
800
  // -- Pending emails -------------------------------------------------------
@@ -804,9 +804,9 @@ const $ = [
804
804
  title: "Pending Emails",
805
805
  unit: "",
806
806
  group: "app",
807
- extract: (e) => e.pendingEmails,
808
- format: (e) => `${e.pendingEmails}`,
809
- color: (e) => e.pendingEmails > 0 ? "ss-amber" : "",
807
+ extract: (t) => t.pendingEmails,
808
+ format: (t) => `${t.pendingEmails}`,
809
+ color: (t) => t.pendingEmails > 0 ? "ss-amber" : "",
810
810
  historyKey: "pendingEmails"
811
811
  },
812
812
  // ── Logs group ────────────────────────────────────────────────────────────
@@ -817,9 +817,9 @@ const $ = [
817
817
  title: "Log Errors (5m)",
818
818
  unit: "",
819
819
  group: "log",
820
- extract: (e) => e.logErrorsLast5m,
821
- format: (e) => `${e.logErrorsLast5m}`,
822
- color: (e) => e.logErrorsLast5m > 0 ? "ss-red" : e.logWarningsLast5m > 0 ? "ss-amber" : "",
820
+ extract: (t) => t.logErrorsLast5m,
821
+ format: (t) => `${t.logErrorsLast5m}`,
822
+ color: (t) => t.logErrorsLast5m > 0 ? "ss-red" : t.logWarningsLast5m > 0 ? "ss-amber" : "",
823
823
  historyKey: "logErrorsLast5m"
824
824
  },
825
825
  // -- Log rate -------------------------------------------------------------
@@ -829,24 +829,24 @@ const $ = [
829
829
  title: "Log Entries / Minute",
830
830
  unit: "/m",
831
831
  group: "log",
832
- extract: (e) => e.logEntriesPerMinute,
833
- format: (e) => `${e.logEntriesPerMinute}`,
832
+ extract: (t) => t.logEntriesPerMinute,
833
+ format: (t) => `${t.logEntriesPerMinute}`,
834
834
  color: () => "",
835
835
  historyKey: "logEntriesPerMinute"
836
836
  }
837
837
  ];
838
- function vt(e) {
839
- return $.find((t) => t.id === e);
838
+ function ke(t) {
839
+ return $.find((e) => e.id === t);
840
840
  }
841
- function xt() {
842
- const e = /* @__PURE__ */ new Map();
843
- for (const t of $) {
844
- const r = t.group || "core";
845
- e.has(r) || e.set(r, []), e.get(r).push(t);
841
+ function Me() {
842
+ const t = /* @__PURE__ */ new Map();
843
+ for (const e of $) {
844
+ const r = e.group || "core";
845
+ t.has(r) || t.set(r, []), t.get(r).push(e);
846
846
  }
847
- return e;
847
+ return t;
848
848
  }
849
- const Ee = {
849
+ const Et = {
850
850
  queries: "/queries",
851
851
  events: "/events",
852
852
  emails: "/emails",
@@ -858,10 +858,10 @@ const Ee = {
858
858
  config: "/config",
859
859
  internals: "/diagnostics"
860
860
  };
861
- function Te(e) {
862
- return Ee[e] || `/${e}`;
861
+ function Tt(t) {
862
+ return Et[t] || `/${t}`;
863
863
  }
864
- const Ce = {
864
+ const kt = {
865
865
  overview: "/overview",
866
866
  requests: "/requests",
867
867
  queries: "/queries",
@@ -874,45 +874,45 @@ const Ce = {
874
874
  jobs: "/jobs",
875
875
  config: "/config"
876
876
  };
877
- function Me(e) {
878
- return Ce[e] || `/${e}`;
877
+ function Mt(t) {
878
+ return kt[t] || `/${t}`;
879
879
  }
880
- function ke(e = oe) {
881
- const t = {}, r = {};
880
+ function Pt(t = ot) {
881
+ const e = {}, r = {};
882
882
  let n = !1;
883
- function s(o) {
884
- if (o.count === 0) return [];
885
- const i = Array.from({ length: o.count }), a = o.count < e ? 0 : o.head;
886
- for (let c = 0; c < o.count; c++)
887
- i[c] = o.data[(a + c) % e];
883
+ function o(s) {
884
+ if (s.count === 0) return [];
885
+ const i = Array.from({ length: s.count }), l = s.count < t ? 0 : s.head;
886
+ for (let a = 0; a < s.count; a++)
887
+ i[a] = s.data[(l + a) % t];
888
888
  return i;
889
889
  }
890
890
  return {
891
- push(o) {
891
+ push(s) {
892
892
  n = !1;
893
893
  for (const i of $) {
894
- const a = i.historyKey;
895
- if (!a) continue;
896
- const c = i.extract(o);
897
- if (typeof c != "number") continue;
898
- t[a] || (t[a] = { data: Array.from({ length: e }), head: 0, count: 0 });
899
- const l = t[a];
900
- l.data[l.head] = c, l.head = (l.head + 1) % e, l.count < e && l.count++;
894
+ const l = i.historyKey;
895
+ if (!l) continue;
896
+ const a = i.extract(s);
897
+ if (typeof a != "number") continue;
898
+ e[l] || (e[l] = { data: Array.from({ length: t }), head: 0, count: 0 });
899
+ const c = e[l];
900
+ c.data[c.head] = a, c.head = (c.head + 1) % t, c.count < t && c.count++;
901
901
  }
902
902
  },
903
- get(o) {
904
- const i = t[o];
905
- return i ? s(i) : [];
903
+ get(s) {
904
+ const i = e[s];
905
+ return i ? o(i) : [];
906
906
  },
907
907
  getAll() {
908
908
  if (n) return r;
909
- for (const o of Object.keys(t))
910
- r[o] = s(t[o]);
909
+ for (const s of Object.keys(e))
910
+ r[s] = o(e[s]);
911
911
  return n = !0, r;
912
912
  }
913
913
  };
914
914
  }
915
- class wt {
915
+ class Pe {
916
916
  // -- Configuration --------------------------------------------------------
917
917
  baseUrl;
918
918
  endpoint;
@@ -940,8 +940,8 @@ class wt {
940
940
  sseActive = !1;
941
941
  isConnected = !1;
942
942
  isStale = !1;
943
- constructor(t = {}) {
944
- this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer = ke();
943
+ constructor(e = {}) {
944
+ this.baseUrl = e.baseUrl ?? "", this.endpoint = e.endpoint ?? "/admin/api/server-stats", this.channelName = e.channelName ?? "admin/server-stats", this.authToken = e.authToken, this.pollInterval = e.pollInterval ?? 3e3, this.onStatsUpdate = e.onStatsUpdate, this.onConnectionChange = e.onConnectionChange, this.onStaleChange = e.onStaleChange, this.onError = e.onError, this.onUnauthorizedChange = e.onUnauthorizedChange, this.onHistoryChange = e.onHistoryChange, this.onSseActiveChange = e.onSseActiveChange, this.onPollActiveChange = e.onPollActiveChange, this.historyBuffer = Pt();
945
945
  }
946
946
  // -- Public API -----------------------------------------------------------
947
947
  /**
@@ -952,8 +952,8 @@ class wt {
952
952
  start() {
953
953
  if (this.unauthorized) return;
954
954
  this.stopped = !1;
955
- const t = this.initSseSubscription();
956
- this.poll(), t || !this.sseHandle ? this.startPollInterval() : this.setupSseFallbackTimer(), this.startStaleDetection();
955
+ const e = this.initSseSubscription();
956
+ this.poll(), e || !this.sseHandle ? this.startPollInterval() : this.setupSseFallbackTimer(), this.startStaleDetection();
957
957
  }
958
958
  /**
959
959
  * Stop all timers and subscriptions. Call on unmount.
@@ -964,8 +964,8 @@ class wt {
964
964
  /**
965
965
  * Get the history array for a single metric key.
966
966
  */
967
- getHistory(t) {
968
- return this.historyBuffer.get(t);
967
+ getHistory(e) {
968
+ return this.historyBuffer.get(e);
969
969
  }
970
970
  /**
971
971
  * Get the entire history map (all keys).
@@ -982,9 +982,9 @@ class wt {
982
982
  // -- Internal helpers -----------------------------------------------------
983
983
  /** Initialize the SSE subscription. Returns true if SSE failed and polling should be used. */
984
984
  initSseSubscription() {
985
- let t = !1;
985
+ let e = !1;
986
986
  try {
987
- this.sseHandle = V({
987
+ this.sseHandle = Q({
988
988
  baseUrl: this.baseUrl,
989
989
  channelName: this.channelName,
990
990
  authToken: this.authToken,
@@ -998,42 +998,42 @@ class wt {
998
998
  this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
999
999
  },
1000
1000
  onError: () => {
1001
- t = !0;
1001
+ e = !0;
1002
1002
  }
1003
1003
  });
1004
1004
  } catch {
1005
- t = !0;
1005
+ e = !0;
1006
1006
  }
1007
- return t;
1007
+ return e;
1008
1008
  }
1009
1009
  /** Set up a 3-second fallback timer to start polling if SSE hasn't connected. */
1010
1010
  setupSseFallbackTimer() {
1011
- const t = setTimeout(() => {
1011
+ const e = setTimeout(() => {
1012
1012
  !this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
1013
1013
  }, 3e3), r = this.sseHandle?.unsubscribe;
1014
1014
  this.sseHandle && (this.sseHandle.unsubscribe = () => {
1015
- clearTimeout(t), r?.();
1015
+ clearTimeout(e), r?.();
1016
1016
  });
1017
1017
  }
1018
1018
  /** Start the stale detection interval. */
1019
1019
  startStaleDetection() {
1020
1020
  this.staleTimer = setInterval(() => {
1021
- this.lastSuccess > 0 && Date.now() - this.lastSuccess > se && this.setStale(!0);
1021
+ this.lastSuccess > 0 && Date.now() - this.lastSuccess > it && this.setStale(!0);
1022
1022
  }, 2e3);
1023
1023
  }
1024
1024
  /** Process incoming stats data from either SSE or polling. */
1025
- processStats(t) {
1026
- this.onStatsUpdate?.(t), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(t), this.onHistoryChange?.(this.historyBuffer.getAll());
1025
+ processStats(e) {
1026
+ this.onStatsUpdate?.(e), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(e), this.onHistoryChange?.(this.historyBuffer.getAll());
1027
1027
  }
1028
1028
  /** Poll the HTTP endpoint once. */
1029
1029
  async poll() {
1030
1030
  if (!this.unauthorized) {
1031
- this.client || (this.client = new C({ baseUrl: this.baseUrl, authToken: this.authToken }));
1031
+ this.client || (this.client = new T({ baseUrl: this.baseUrl, authToken: this.authToken }));
1032
1032
  try {
1033
- const t = await this.client.get(this.endpoint);
1034
- this.processStats(t);
1035
- } catch (t) {
1036
- t instanceof x && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(t), this.stopPolling());
1033
+ const e = await this.client.get(this.endpoint);
1034
+ this.processStats(e);
1035
+ } catch (e) {
1036
+ e instanceof w && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(e), this.stopPolling());
1037
1037
  }
1038
1038
  }
1039
1039
  }
@@ -1046,21 +1046,21 @@ class wt {
1046
1046
  this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null, this.onPollActiveChange?.(!1));
1047
1047
  }
1048
1048
  /** Update SSE active state and notify. */
1049
- setSseActive(t) {
1050
- this.sseActive !== t && (this.sseActive = t, this.onSseActiveChange?.(t));
1049
+ setSseActive(e) {
1050
+ this.sseActive !== e && (this.sseActive = e, this.onSseActiveChange?.(e));
1051
1051
  }
1052
1052
  /** Update connected state and notify. */
1053
- setConnected(t) {
1054
- this.isConnected !== t && (this.isConnected = t, this.onConnectionChange?.(t));
1053
+ setConnected(e) {
1054
+ this.isConnected !== e && (this.isConnected = e, this.onConnectionChange?.(e));
1055
1055
  }
1056
1056
  /** Update stale state and notify. */
1057
- setStale(t) {
1058
- this.isStale !== t && (this.isStale = t, this.onStaleChange?.(t));
1057
+ setStale(e) {
1058
+ this.isStale !== e && (this.isStale = e, this.onStaleChange?.(e));
1059
1059
  }
1060
1060
  }
1061
- class Pe {
1062
- constructor(t, r) {
1063
- this.client = t, this.basePath = r;
1061
+ class At {
1062
+ constructor(e, r) {
1063
+ this.client = e, this.basePath = r;
1064
1064
  }
1065
1065
  /**
1066
1066
  * Fetch data for a dashboard section, optionally with a query string.
@@ -1069,18 +1069,18 @@ class Pe {
1069
1069
  * @param queryString - Optional query string (without leading `?`).
1070
1070
  * @param init - Optional `RequestInit` overrides (e.g. `{ signal }`).
1071
1071
  */
1072
- async fetchSection(t, r, n) {
1073
- const s = Me(t), o = r ? `${this.basePath}${s}?${r}` : `${this.basePath}${s}`;
1074
- return this.client.fetch(o, n);
1072
+ async fetchSection(e, r, n) {
1073
+ const o = Mt(e), s = r ? `${this.basePath}${o}?${r}` : `${this.basePath}${o}`;
1074
+ return this.client.fetch(s, n);
1075
1075
  }
1076
1076
  /**
1077
1077
  * Fetch chart time-series data for the overview section.
1078
1078
  *
1079
1079
  * @param range - Time range identifier (e.g. `'1h'`, `'24h'`).
1080
1080
  */
1081
- async fetchChart(t) {
1081
+ async fetchChart(e) {
1082
1082
  return this.client.fetch(
1083
- `${this.basePath}/overview/chart?range=${t}`
1083
+ `${this.basePath}/overview/chart?range=${e}`
1084
1084
  );
1085
1085
  }
1086
1086
  /**
@@ -1094,16 +1094,16 @@ class Pe {
1094
1094
  *
1095
1095
  * @param id - Query record ID.
1096
1096
  */
1097
- async explainQuery(t) {
1098
- return this.client.fetch(`${this.basePath}/queries/${t}/explain`);
1097
+ async explainQuery(e) {
1098
+ return this.client.fetch(`${this.basePath}/queries/${e}/explain`);
1099
1099
  }
1100
1100
  /**
1101
1101
  * Retry a failed job by ID.
1102
1102
  *
1103
1103
  * @param id - Job record ID.
1104
1104
  */
1105
- async retryJob(t) {
1106
- return this.client.fetch(`${this.basePath}/jobs/${t}/retry`, {
1105
+ async retryJob(e) {
1106
+ return this.client.fetch(`${this.basePath}/jobs/${e}/retry`, {
1107
1107
  method: "POST"
1108
1108
  });
1109
1109
  }
@@ -1112,9 +1112,9 @@ class Pe {
1112
1112
  *
1113
1113
  * @param key - Cache key (will be URI-encoded).
1114
1114
  */
1115
- async fetchCacheKey(t) {
1115
+ async fetchCacheKey(e) {
1116
1116
  return this.client.fetch(
1117
- `${this.basePath}/cache/${encodeURIComponent(t)}`
1117
+ `${this.basePath}/cache/${encodeURIComponent(e)}`
1118
1118
  );
1119
1119
  }
1120
1120
  /**
@@ -1122,9 +1122,9 @@ class Pe {
1122
1122
  *
1123
1123
  * @param key - Cache key (will be URI-encoded).
1124
1124
  */
1125
- async deleteCacheKey(t) {
1125
+ async deleteCacheKey(e) {
1126
1126
  return this.client.fetch(
1127
- `${this.basePath}/cache/${encodeURIComponent(t)}`,
1127
+ `${this.basePath}/cache/${encodeURIComponent(e)}`,
1128
1128
  {
1129
1129
  method: "DELETE"
1130
1130
  }
@@ -1135,19 +1135,19 @@ class Pe {
1135
1135
  *
1136
1136
  * @param id - Email record ID.
1137
1137
  */
1138
- async fetchEmailPreview(t) {
1139
- return this.client.fetch(`${this.basePath}/emails/${t}/preview`);
1138
+ async fetchEmailPreview(e) {
1139
+ return this.client.fetch(`${this.basePath}/emails/${e}/preview`);
1140
1140
  }
1141
1141
  }
1142
- function Ae(e) {
1143
- if (!e || typeof e != "object") return !1;
1144
- const t = e;
1145
- return t.data !== void 0 && t.meta !== void 0;
1142
+ function $t(t) {
1143
+ if (!t || typeof t != "object") return !1;
1144
+ const e = t;
1145
+ return e.data !== void 0 && e.meta !== void 0;
1146
1146
  }
1147
- function $e(e, t) {
1148
- return t.aborted ? !0 : e instanceof DOMException && e.name === "AbortError";
1147
+ function Rt(t, e) {
1148
+ return e.aborted ? !0 : t instanceof DOMException && t.name === "AbortError";
1149
1149
  }
1150
- class Et {
1150
+ class Ae {
1151
1151
  // -- Dependencies ---------------------------------------------------------
1152
1152
  client;
1153
1153
  api;
@@ -1175,8 +1175,8 @@ class Et {
1175
1175
  stopped = !1;
1176
1176
  /** AbortController for the current in-flight fetch. */
1177
1177
  abortController = null;
1178
- constructor(t) {
1179
- this.client = new C({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new Pe(this.client, t.endpoint), this.endpoint = t.endpoint, this.section = t.section, this.perPage = t.perPage, this.callbacks = t.callbacks;
1178
+ constructor(e) {
1179
+ this.client = new T({ baseUrl: e.baseUrl, authToken: e.authToken }), this.api = new At(this.client, e.endpoint), this.endpoint = e.endpoint, this.section = e.section, this.perPage = e.perPage, this.callbacks = e.callbacks;
1180
1180
  }
1181
1181
  // -- Public API -----------------------------------------------------------
1182
1182
  /**
@@ -1198,70 +1198,70 @@ class Et {
1198
1198
  * @param silent - When `true`, errors are swallowed (keeps stale data)
1199
1199
  * and loading state is not modified.
1200
1200
  */
1201
- async fetch(t = !0) {
1202
- if (this.shouldSkipFetch(t)) return;
1203
- const { controller: r, myFetchId: n } = this.prepareFetch(t);
1201
+ async fetch(e = !0) {
1202
+ if (this.shouldSkipFetch(e)) return;
1203
+ const { controller: r, myFetchId: n } = this.prepareFetch(e);
1204
1204
  try {
1205
- const s = await this.executeFetch(r);
1205
+ const o = await this.executeFetch(r);
1206
1206
  if (this.isStaleResponse(n)) return;
1207
- this.applyFetchResult(s);
1208
- } catch (s) {
1209
- if (this.shouldIgnoreError(s, r.signal, n)) return;
1210
- this.handleFetchError(s, t);
1207
+ this.applyFetchResult(o);
1208
+ } catch (o) {
1209
+ if (this.shouldIgnoreError(o, r.signal, n)) return;
1210
+ this.handleFetchError(o, e);
1211
1211
  } finally {
1212
- t || (this.explicitFetchPending = !1);
1212
+ e || (this.explicitFetchPending = !1);
1213
1213
  }
1214
1214
  }
1215
1215
  /**
1216
1216
  * Change the active section. Resets pagination, filters, sort, and
1217
1217
  * performs a full (non-silent) fetch.
1218
1218
  */
1219
- setSection(t) {
1220
- this.section !== t && (this.section = t, this.page = 1, this.search = void 0, this.sort = void 0, this.sortDir = void 0, this.filters = void 0, this.hasFetched = !1, this.callbacks.onData(null), this.callbacks.onPagination(null), this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetch(!1), this.startRefreshTimer());
1219
+ setSection(e) {
1220
+ this.section !== e && (this.section = e, this.page = 1, this.search = void 0, this.sort = void 0, this.sortDir = void 0, this.filters = void 0, this.hasFetched = !1, this.callbacks.onData(null), this.callbacks.onPagination(null), this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetch(!1), this.startRefreshTimer());
1221
1221
  }
1222
1222
  /**
1223
1223
  * Navigate to a specific page. Triggers a non-silent fetch.
1224
1224
  */
1225
- setPage(t) {
1226
- this.page = t, this.fetch(!1);
1225
+ setPage(e) {
1226
+ this.page = e, this.fetch(!1);
1227
1227
  }
1228
1228
  /**
1229
1229
  * Update the search query. Resets to page 1. Triggers a non-silent fetch.
1230
1230
  */
1231
- setSearch(t) {
1232
- this.search = t || void 0, this.page = 1, this.fetch(!1);
1231
+ setSearch(e) {
1232
+ this.search = e || void 0, this.page = 1, this.fetch(!1);
1233
1233
  }
1234
1234
  /**
1235
1235
  * Set a filter key-value pair. Resets to page 1. Triggers a non-silent fetch.
1236
1236
  */
1237
- setFilter(t, r) {
1238
- this.filters || (this.filters = {}), this.filters[t] = String(r), this.page = 1, this.fetch(!1);
1237
+ setFilter(e, r) {
1238
+ this.filters || (this.filters = {}), this.filters[e] = String(r), this.page = 1, this.fetch(!1);
1239
1239
  }
1240
1240
  /**
1241
1241
  * Update sort column and direction. Triggers a non-silent fetch.
1242
1242
  *
1243
1243
  * If the same column is passed without a direction, toggles asc/desc.
1244
1244
  */
1245
- setSort(t, r) {
1246
- this.sort === t && !r ? this.sortDir = this.sortDir === "asc" ? "desc" : "asc" : (this.sort = t, this.sortDir = r || "desc"), this.fetch(!1);
1245
+ setSort(e, r) {
1246
+ this.sort === e && !r ? this.sortDir = this.sortDir === "asc" ? "desc" : "asc" : (this.sort = e, this.sortDir = r || "desc"), this.fetch(!1);
1247
1247
  }
1248
1248
  /**
1249
1249
  * Update the time range. Triggers a non-silent fetch.
1250
1250
  */
1251
- setTimeRange(t) {
1252
- this.timeRange = t, this.fetch(!1);
1251
+ setTimeRange(e) {
1252
+ this.timeRange = e, this.fetch(!1);
1253
1253
  }
1254
1254
  /**
1255
1255
  * Execute a mutation (POST/DELETE) against the dashboard API,
1256
1256
  * then silently refresh the current data.
1257
1257
  */
1258
- async mutate(t, r = "post", n) {
1259
- const s = `${this.endpoint}/${t}`;
1258
+ async mutate(e, r = "post", n) {
1259
+ const o = `${this.endpoint}/${e}`;
1260
1260
  try {
1261
- const o = r === "post" ? await this.client.post(s, n) : await this.client.delete(s);
1262
- return await this.fetch(!0), o;
1263
- } catch (o) {
1264
- throw o instanceof Error ? o : new Error(String(o));
1261
+ const s = r === "post" ? await this.client.post(o, n) : await this.client.delete(o);
1262
+ return await this.fetch(!0), s;
1263
+ } catch (s) {
1264
+ throw s instanceof Error ? s : new Error(String(s));
1265
1265
  }
1266
1266
  }
1267
1267
  /**
@@ -1271,8 +1271,8 @@ class Et {
1271
1271
  * controls pagination/search/sort state externally and passes it in
1272
1272
  * as props on each render cycle.
1273
1273
  */
1274
- configure(t) {
1275
- t.page !== void 0 && (this.page = t.page), t.perPage !== void 0 && (this.perPage = t.perPage), this.search = t.search, this.sort = t.sort, this.sortDir = t.sortDir, this.filters = t.filters, this.timeRange = t.timeRange;
1274
+ configure(e) {
1275
+ e.page !== void 0 && (this.page = e.page), e.perPage !== void 0 && (this.perPage = e.perPage), this.search = e.search, this.sort = e.sort, this.sortDir = e.sortDir, this.filters = e.filters, this.timeRange = e.timeRange;
1276
1276
  }
1277
1277
  /**
1278
1278
  * Whether data has been fetched at least once.
@@ -1301,68 +1301,68 @@ class Et {
1301
1301
  }
1302
1302
  // -- Fetch helpers (private) -----------------------------------------------
1303
1303
  /** Whether this fetch call should be skipped entirely. */
1304
- shouldSkipFetch(t) {
1305
- return t && this.explicitFetchPending ? !0 : !this.section;
1304
+ shouldSkipFetch(e) {
1305
+ return e && this.explicitFetchPending ? !0 : !this.section;
1306
1306
  }
1307
1307
  /** Prepare abort controller, increment fetch ID, set loading state. */
1308
- prepareFetch(t) {
1308
+ prepareFetch(e) {
1309
1309
  this.abortController?.abort();
1310
1310
  const r = new AbortController();
1311
1311
  this.abortController = r;
1312
1312
  const n = ++this.fetchId;
1313
- return t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0), { controller: r, myFetchId: n };
1313
+ return e || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0), { controller: r, myFetchId: n };
1314
1314
  }
1315
1315
  /** Execute the actual API fetch for the current section. */
1316
- async executeFetch(t) {
1316
+ async executeFetch(e) {
1317
1317
  const r = this.buildCurrentQueryString();
1318
1318
  return this.api.fetchSection(this.section, r || void 0, {
1319
- signal: t.signal
1319
+ signal: e.signal
1320
1320
  });
1321
1321
  }
1322
1322
  /** Check if a response is stale (fetch ID mismatch or controller stopped). */
1323
- isStaleResponse(t) {
1324
- return t !== this.fetchId || this.stopped;
1323
+ isStaleResponse(e) {
1324
+ return e !== this.fetchId || this.stopped;
1325
1325
  }
1326
1326
  /** Check if an error should be silently ignored (abort or stale). */
1327
- shouldIgnoreError(t, r, n) {
1328
- return $e(t, r) ? !0 : this.isStaleResponse(n);
1327
+ shouldIgnoreError(e, r, n) {
1328
+ return Rt(e, r) ? !0 : this.isStaleResponse(n);
1329
1329
  }
1330
1330
  /** Build query string from current controller state. */
1331
1331
  buildCurrentQueryString() {
1332
- const t = this.sort ? this.sort.replace(/[A-Z]/g, (n) => "_" + n.toLowerCase()) : void 0, r = this.filters;
1333
- return ge({
1332
+ const e = this.sort ? this.sort.replace(/[A-Z]/g, (n) => "_" + n.toLowerCase()) : void 0, r = this.filters;
1333
+ return gt({
1334
1334
  page: this.page,
1335
1335
  perPage: this.perPage,
1336
1336
  search: this.search,
1337
- sort: t,
1337
+ sort: e,
1338
1338
  sortDir: this.sort ? this.sortDir : void 0,
1339
1339
  filters: r && Object.keys(r).length > 0 ? r : void 0,
1340
1340
  timeRange: this.section.startsWith("overview") ? this.timeRange : void 0
1341
1341
  });
1342
1342
  }
1343
1343
  /** Apply a successful fetch result to the callbacks. */
1344
- applyFetchResult(t) {
1345
- Ae(t) ? (this.callbacks.onData(t.data), this.callbacks.onPagination(t.meta)) : (this.callbacks.onData(t), this.callbacks.onPagination(null)), this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
1344
+ applyFetchResult(e) {
1345
+ $t(e) ? (this.callbacks.onData(e.data), this.callbacks.onPagination(e.meta)) : (this.callbacks.onData(e), this.callbacks.onPagination(null)), this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
1346
1346
  }
1347
1347
  /** Handle a fetch error (unauthorized, network, etc.). */
1348
- handleFetchError(t, r) {
1349
- if (t instanceof x) {
1350
- this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
1348
+ handleFetchError(e, r) {
1349
+ if (e instanceof w) {
1350
+ this.callbacks.onError(e), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
1351
1351
  return;
1352
1352
  }
1353
- r || (this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1));
1353
+ r || (this.callbacks.onError(e instanceof Error ? e : new Error(String(e))), this.callbacks.onLoading(!1));
1354
1354
  }
1355
1355
  // -- Timer management (private) -------------------------------------------
1356
1356
  startRefreshTimer() {
1357
1357
  this.stopRefreshTimer();
1358
- const t = this.section === "overview" ? Z : ee;
1359
- this.timer = setInterval(() => this.fetch(!0), t);
1358
+ const e = this.section === "overview" ? et : rt;
1359
+ this.timer = setInterval(() => this.fetch(!0), e);
1360
1360
  }
1361
1361
  stopRefreshTimer() {
1362
1362
  this.timer && (clearInterval(this.timer), this.timer = null);
1363
1363
  }
1364
1364
  }
1365
- const Tt = {
1365
+ const $e = {
1366
1366
  // ---------------------------------------------------------------------------
1367
1367
  // Debug-panel tabs / Dashboard sidebar sections (shared)
1368
1368
  // ---------------------------------------------------------------------------
@@ -1554,81 +1554,81 @@ const Tt = {
1554
1554
  viewBox: "0 0 16 16",
1555
1555
  elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
1556
1556
  }
1557
- }, Re = "ss-col-resize", _ = "ss-resizing";
1558
- function Ct(e) {
1559
- const t = Array.from(e.querySelectorAll("thead th"));
1560
- if (t.length === 0) return () => {
1557
+ }, Lt = "ss-col-resize", _ = "ss-resizing";
1558
+ function Re(t) {
1559
+ const e = Array.from(t.querySelectorAll("thead th"));
1560
+ if (e.length === 0) return () => {
1561
1561
  };
1562
1562
  const r = [];
1563
1563
  let n = !1;
1564
- function s() {
1564
+ function o() {
1565
1565
  if (!n) {
1566
1566
  n = !0;
1567
- for (const o of t)
1568
- o.style.width = o.offsetWidth + "px";
1569
- e.style.tableLayout = "fixed";
1567
+ for (const s of e)
1568
+ s.style.width = s.offsetWidth + "px";
1569
+ t.style.tableLayout = "fixed";
1570
1570
  }
1571
1571
  }
1572
- for (const o of t) {
1573
- let i = function(c) {
1574
- c.preventDefault(), c.stopPropagation(), s();
1575
- const l = c.clientX, g = o.offsetWidth;
1576
- a.classList.add(_), a.setPointerCapture(c.pointerId);
1572
+ for (const s of e) {
1573
+ let i = function(a) {
1574
+ a.preventDefault(), a.stopPropagation(), o();
1575
+ const c = a.clientX, m = s.offsetWidth;
1576
+ l.classList.add(_), l.setPointerCapture(a.pointerId);
1577
1577
  function f(d) {
1578
- const m = d.clientX - l, u = Math.max(30, g + m);
1579
- o.style.width = u + "px";
1578
+ const g = d.clientX - c, h = Math.max(30, m + g);
1579
+ s.style.width = h + "px";
1580
1580
  }
1581
1581
  function p() {
1582
- a.classList.remove(_), a.removeEventListener("pointermove", f), a.removeEventListener("pointerup", p);
1582
+ l.classList.remove(_), l.removeEventListener("pointermove", f), l.removeEventListener("pointerup", p);
1583
1583
  }
1584
- a.addEventListener("pointermove", f), a.addEventListener("pointerup", p);
1584
+ l.addEventListener("pointermove", f), l.addEventListener("pointerup", p);
1585
1585
  };
1586
- if (!o.textContent?.trim()) continue;
1587
- const a = document.createElement("div");
1588
- a.className = Re, o.appendChild(a), a.addEventListener("pointerdown", i), r.push(() => {
1589
- a.removeEventListener("pointerdown", i), a.remove();
1586
+ if (!s.textContent?.trim()) continue;
1587
+ const l = document.createElement("div");
1588
+ l.className = Lt, s.appendChild(l), l.addEventListener("pointerdown", i), r.push(() => {
1589
+ l.removeEventListener("pointerdown", i), l.remove();
1590
1590
  });
1591
1591
  }
1592
1592
  return () => {
1593
- for (const o of r) o();
1593
+ for (const s of r) s();
1594
1594
  };
1595
1595
  }
1596
- function Mt(e) {
1597
- const { container: t, handle: r, topPane: n, bottomPane: s, storageKey: o, minHeight: i = 60 } = e;
1598
- if (o) {
1599
- const c = localStorage.getItem(o);
1600
- if (c) {
1601
- const l = parseFloat(c);
1602
- l > 0 && l < 1 && (n.style.flex = `${l}`, s.style.flex = `${1 - l}`);
1596
+ function Le(t) {
1597
+ const { container: e, handle: r, topPane: n, bottomPane: o, storageKey: s, minHeight: i = 60 } = t;
1598
+ if (s) {
1599
+ const a = localStorage.getItem(s);
1600
+ if (a) {
1601
+ const c = parseFloat(a);
1602
+ c > 0 && c < 1 && (n.style.flex = `${c}`, o.style.flex = `${1 - c}`);
1603
1603
  }
1604
1604
  }
1605
- function a(c) {
1606
- c.preventDefault(), r.setPointerCapture(c.pointerId);
1607
- const g = t.getBoundingClientRect().height, f = c.clientY, p = n.getBoundingClientRect().height;
1608
- function d(u) {
1609
- const y = u.clientY - f;
1610
- let v = p + y;
1611
- const q = g - i - r.offsetHeight;
1612
- v = Math.max(i, Math.min(v, q));
1613
- const L = v / (g - r.offsetHeight);
1614
- n.style.flex = `${L}`, s.style.flex = `${1 - L}`;
1605
+ function l(a) {
1606
+ a.preventDefault(), r.setPointerCapture(a.pointerId);
1607
+ const m = e.getBoundingClientRect().height, f = a.clientY, p = n.getBoundingClientRect().height;
1608
+ function d(h) {
1609
+ const y = h.clientY - f;
1610
+ let S = p + y;
1611
+ const z = m - i - r.offsetHeight;
1612
+ S = Math.max(i, Math.min(S, z));
1613
+ const L = S / (m - r.offsetHeight);
1614
+ n.style.flex = `${L}`, o.style.flex = `${1 - L}`;
1615
1615
  }
1616
- function m() {
1617
- if (r.removeEventListener("pointermove", d), r.removeEventListener("pointerup", m), o) {
1618
- const u = t.getBoundingClientRect().height - r.offsetHeight;
1619
- if (u > 0) {
1620
- const y = n.getBoundingClientRect().height / u;
1621
- localStorage.setItem(o, String(y));
1616
+ function g() {
1617
+ if (r.removeEventListener("pointermove", d), r.removeEventListener("pointerup", g), s) {
1618
+ const h = e.getBoundingClientRect().height - r.offsetHeight;
1619
+ if (h > 0) {
1620
+ const y = n.getBoundingClientRect().height / h;
1621
+ localStorage.setItem(s, String(y));
1622
1622
  }
1623
1623
  }
1624
1624
  }
1625
- r.addEventListener("pointermove", d), r.addEventListener("pointerup", m);
1625
+ r.addEventListener("pointermove", d), r.addEventListener("pointerup", g);
1626
1626
  }
1627
- return r.addEventListener("pointerdown", a), () => {
1628
- r.removeEventListener("pointerdown", a);
1627
+ return r.addEventListener("pointerdown", l), () => {
1628
+ r.removeEventListener("pointerdown", l);
1629
1629
  };
1630
1630
  }
1631
- class kt {
1631
+ class De {
1632
1632
  client;
1633
1633
  endpoint;
1634
1634
  refreshInterval;
@@ -1637,15 +1637,15 @@ class kt {
1637
1637
  currentTab = null;
1638
1638
  fetchOnceCache = {};
1639
1639
  abortController = null;
1640
- constructor(t) {
1641
- this.client = new C({
1642
- baseUrl: t.baseUrl,
1643
- authToken: t.authToken
1644
- }), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? te, this.callbacks = {
1645
- onData: t.onData,
1646
- onLoading: t.onLoading,
1647
- onError: t.onError,
1648
- onUnauthorized: t.onUnauthorized
1640
+ constructor(e) {
1641
+ this.client = new T({
1642
+ baseUrl: e.baseUrl,
1643
+ authToken: e.authToken
1644
+ }), this.endpoint = e.endpoint ?? "/admin/api/debug", this.refreshInterval = e.refreshInterval ?? nt, this.callbacks = {
1645
+ onData: e.onData,
1646
+ onLoading: e.onLoading,
1647
+ onError: e.onError,
1648
+ onUnauthorized: e.onUnauthorized
1649
1649
  };
1650
1650
  }
1651
1651
  // -------------------------------------------------------------------------
@@ -1656,8 +1656,8 @@ class kt {
1656
1656
  *
1657
1657
  * If a timer is already running it will be stopped first.
1658
1658
  */
1659
- start(t) {
1660
- this.stop(), this.currentTab = t, this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetchData(), this.timer = setInterval(() => this.fetchData(), this.refreshInterval);
1659
+ start(e) {
1660
+ this.stop(), this.currentTab = e, this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetchData(), this.timer = setInterval(() => this.fetchData(), this.refreshInterval);
1661
1661
  }
1662
1662
  /**
1663
1663
  * Stop the auto-refresh timer.
@@ -1671,8 +1671,8 @@ class kt {
1671
1671
  * Stops the current timer, resets loading/error state, and starts
1672
1672
  * fetching for the new tab.
1673
1673
  */
1674
- switchTab(t) {
1675
- this.start(t);
1674
+ switchTab(e) {
1675
+ this.start(e);
1676
1676
  }
1677
1677
  /**
1678
1678
  * Force an immediate re-fetch of the current tab (ignoring the
@@ -1685,17 +1685,17 @@ class kt {
1685
1685
  * Fetch a custom pane endpoint. Optionally honours the fetchOnce
1686
1686
  * cache so a pane that has already been loaded is not re-requested.
1687
1687
  */
1688
- async fetchCustomPane(t, r = !1) {
1689
- if (r && this.fetchOnceCache[t] !== void 0) {
1690
- this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1);
1688
+ async fetchCustomPane(e, r = !1) {
1689
+ if (r && this.fetchOnceCache[e] !== void 0) {
1690
+ this.callbacks.onData(this.fetchOnceCache[e]), this.callbacks.onLoading(!1);
1691
1691
  return;
1692
1692
  }
1693
1693
  this.callbacks.onLoading(!0);
1694
1694
  try {
1695
- const n = await this.client.fetch(t);
1696
- this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[t] = n);
1695
+ const n = await this.client.fetch(e);
1696
+ this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[e] = n);
1697
1697
  } catch (n) {
1698
- if (n instanceof x) {
1698
+ if (n instanceof w) {
1699
1699
  this.callbacks.onUnauthorized(n);
1700
1700
  return;
1701
1701
  }
@@ -1709,8 +1709,8 @@ class kt {
1709
1709
  * Subsequent `start()` / `switchTab()` calls for this tab will
1710
1710
  * serve the cached value instead of hitting the network.
1711
1711
  */
1712
- cacheForTab(t, r) {
1713
- this.fetchOnceCache[t] = r;
1712
+ cacheForTab(e, r) {
1713
+ this.fetchOnceCache[e] = r;
1714
1714
  }
1715
1715
  /**
1716
1716
  * Clear all cached fetchOnce data.
@@ -1722,87 +1722,87 @@ class kt {
1722
1722
  // Internal
1723
1723
  // -------------------------------------------------------------------------
1724
1724
  async fetchData() {
1725
- const t = this.currentTab;
1726
- if (!t || this.serveFromCache(t)) return;
1725
+ const e = this.currentTab;
1726
+ if (!e || this.serveFromCache(e)) return;
1727
1727
  this.abortController?.abort();
1728
1728
  const r = new AbortController();
1729
1729
  this.abortController = r;
1730
1730
  try {
1731
- const n = `${this.endpoint}${Te(t)}`, s = await this.client.fetch(n, { signal: r.signal });
1731
+ const n = `${this.endpoint}${Tt(e)}`, o = await this.client.fetch(n, { signal: r.signal });
1732
1732
  if (r.signal.aborted) return;
1733
- this.callbacks.onData(s), this.callbacks.onError(null), this.callbacks.onLoading(!1);
1733
+ this.callbacks.onData(o), this.callbacks.onError(null), this.callbacks.onLoading(!1);
1734
1734
  } catch (n) {
1735
1735
  this.handleFetchError(n, r);
1736
1736
  }
1737
1737
  }
1738
1738
  /** Serve cached data if available. Returns true if cache hit. */
1739
- serveFromCache(t) {
1740
- return this.fetchOnceCache[t] === void 0 ? !1 : (this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1), !0);
1739
+ serveFromCache(e) {
1740
+ return this.fetchOnceCache[e] === void 0 ? !1 : (this.callbacks.onData(this.fetchOnceCache[e]), this.callbacks.onLoading(!1), !0);
1741
1741
  }
1742
1742
  /** Handle errors from fetchData. */
1743
- handleFetchError(t, r) {
1744
- if (!(t instanceof DOMException && t.name === "AbortError") && !r.signal.aborted) {
1745
- if (t instanceof x) {
1746
- this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(t);
1743
+ handleFetchError(e, r) {
1744
+ if (!(e instanceof DOMException && e.name === "AbortError") && !r.signal.aborted) {
1745
+ if (e instanceof w) {
1746
+ this.callbacks.onError(e), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(e);
1747
1747
  return;
1748
1748
  }
1749
- this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1);
1749
+ this.callbacks.onError(e instanceof Error ? e : new Error(String(e))), this.callbacks.onLoading(!1);
1750
1750
  }
1751
1751
  }
1752
1752
  }
1753
- function Le(e) {
1754
- if (typeof e == "string")
1753
+ function Dt(t) {
1754
+ if (typeof t == "string")
1755
1755
  try {
1756
- return JSON.parse(e);
1756
+ return JSON.parse(t);
1757
1757
  } catch {
1758
1758
  return null;
1759
1759
  }
1760
- return typeof e == "object" && e !== null && !Array.isArray(e) ? e : null;
1760
+ return typeof t == "object" && t !== null && !Array.isArray(t) ? t : null;
1761
1761
  }
1762
- function O(e) {
1763
- const t = {};
1764
- for (const [r, n] of Object.entries(e))
1765
- Ue.has(r) || (t[r] = n);
1766
- return Object.keys(t).length > 0 ? t : null;
1762
+ function I(t) {
1763
+ const e = {};
1764
+ for (const [r, n] of Object.entries(t))
1765
+ Ut.has(r) || (e[r] = n);
1766
+ return Object.keys(e).length > 0 ? e : null;
1767
1767
  }
1768
- const Pt = ["all", "error", "warn", "info", "debug"];
1769
- function Fe(e) {
1770
- return (e.levelName || e.level_name || (typeof e.level == "string" ? e.level : "") || "info").toLowerCase();
1768
+ const Fe = ["all", "error", "warn", "info", "debug"];
1769
+ function Ft(t) {
1770
+ return (t.levelName || t.level_name || (typeof t.level == "string" ? t.level : "") || "info").toLowerCase();
1771
1771
  }
1772
- function At(e) {
1773
- return e.msg || e.message || JSON.stringify(e);
1772
+ function Ue(t) {
1773
+ return t.msg || t.message || JSON.stringify(t);
1774
1774
  }
1775
- function $t(e) {
1776
- return e.createdAt || e.created_at || e.time || e.timestamp || 0;
1775
+ function _e(t) {
1776
+ return t.createdAt || t.created_at || t.time || t.timestamp || 0;
1777
1777
  }
1778
- function Rt(e) {
1779
- const t = e.data || {};
1780
- return e.requestId || e.request_id || e["x-request-id"] || t.requestId || t.request_id || t["x-request-id"] || "";
1778
+ function Ie(t) {
1779
+ const e = t.data || {};
1780
+ return t.requestId || t.request_id || t["x-request-id"] || e.requestId || e.request_id || e["x-request-id"] || "";
1781
1781
  }
1782
- function Lt(e, t = "ss-dbg-log-level") {
1783
- switch (e) {
1782
+ function Oe(t, e = "ss-dbg-log-level") {
1783
+ switch (t) {
1784
1784
  case "error":
1785
1785
  case "fatal":
1786
- return `${t}-error`;
1786
+ return `${e}-error`;
1787
1787
  case "warn":
1788
- return `${t}-warn`;
1788
+ return `${e}-warn`;
1789
1789
  case "info":
1790
- return `${t}-info`;
1790
+ return `${e}-info`;
1791
1791
  case "debug":
1792
- return `${t}-debug`;
1792
+ return `${e}-debug`;
1793
1793
  case "trace":
1794
- return `${t}-trace`;
1794
+ return `${e}-trace`;
1795
1795
  default:
1796
- return `${t}-info`;
1796
+ return `${e}-info`;
1797
1797
  }
1798
1798
  }
1799
- function Ft(e, t) {
1800
- return t === "all" ? e : e.filter((r) => {
1801
- const n = Fe(r);
1802
- return t === "error" ? n === "error" || n === "fatal" : n === t;
1799
+ function Ne(t, e) {
1800
+ return e === "all" ? t : t.filter((r) => {
1801
+ const n = Ft(r);
1802
+ return e === "error" ? n === "error" || n === "fatal" : n === e;
1803
1803
  });
1804
1804
  }
1805
- const Ue = /* @__PURE__ */ new Set([
1805
+ const Ut = /* @__PURE__ */ new Set([
1806
1806
  "level",
1807
1807
  "time",
1808
1808
  "pid",
@@ -1822,34 +1822,283 @@ const Ue = /* @__PURE__ */ new Set([
1822
1822
  "id",
1823
1823
  "data"
1824
1824
  ]);
1825
- function Ut(e) {
1826
- if (e.data) {
1827
- const t = Le(e.data);
1828
- if (t) {
1829
- const r = O(t);
1825
+ function He(t) {
1826
+ if (t.data) {
1827
+ const e = Dt(t.data);
1828
+ if (e) {
1829
+ const r = I(e);
1830
1830
  if (r) return r;
1831
1831
  }
1832
1832
  }
1833
- return O(e);
1833
+ return I(t);
1834
+ }
1835
+ function u(t, ...e) {
1836
+ for (const r of e) {
1837
+ const n = t[r];
1838
+ if (n != null) return n;
1839
+ }
1840
+ }
1841
+ function _t(t) {
1842
+ return u(t, "createdAt", "created_at", "timestamp");
1843
+ }
1844
+ function qe(t) {
1845
+ return u(t, "timestamp", "createdAt", "processedAt", "created_at");
1846
+ }
1847
+ function Be(t) {
1848
+ return u(t, "statusCode", "status_code");
1849
+ }
1850
+ function Ke(t) {
1851
+ return u(t, "total_duration", "totalDuration", "duration") ?? 0;
1852
+ }
1853
+ function ze(t) {
1854
+ return u(t, "span_count", "spanCount") ?? 0;
1855
+ }
1856
+ function je(t) {
1857
+ return u(t, "warning_count", "warningCount") ?? 0;
1858
+ }
1859
+ function We(t) {
1860
+ return u(t, "from_addr", "from") ?? "";
1834
1861
  }
1835
- function Dt(e, t) {
1836
- if (!t) return e;
1837
- const r = t.toLowerCase();
1838
- return e.filter(
1862
+ function Ve(t) {
1863
+ return u(t, "to_addr", "to") ?? "";
1864
+ }
1865
+ function Ge(t) {
1866
+ return u(t, "cc", "cc_addr") ?? "";
1867
+ }
1868
+ function Qe(t) {
1869
+ return u(t, "attachment_count", "attachmentCount") ?? 0;
1870
+ }
1871
+ function Je(t) {
1872
+ return u(t, "event_name", "eventName", "event") ?? "";
1873
+ }
1874
+ function It(t) {
1875
+ return u(t, "method", "sql_method") ?? "";
1876
+ }
1877
+ function K(t) {
1878
+ return u(t, "sqlNormalized", "normalizedSql", "sql_normalized", "sql") ?? "";
1879
+ }
1880
+ function Ye(t, e, r) {
1881
+ const n = t[e];
1882
+ return n != null && n !== 0 ? Number(n) : Number(t[r]) || 0;
1883
+ }
1884
+ function Xe(t, e) {
1885
+ if (!e) return t;
1886
+ const r = e.toLowerCase();
1887
+ return t.filter(
1839
1888
  (n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
1840
1889
  );
1841
1890
  }
1842
- function _t(e) {
1843
- const t = {};
1844
- for (const r of e)
1845
- t[r.sql] = (t[r.sql] || 0) + 1;
1846
- return t;
1891
+ function Ze(t) {
1892
+ const e = {};
1893
+ for (const r of t)
1894
+ e[r.sql] = (e[r.sql] || 0) + 1;
1895
+ return e;
1847
1896
  }
1848
- function Ot(e, t) {
1849
- const r = e.filter((o) => o.duration > 100).length, n = Object.values(t).filter((o) => o > 1).length, s = e.length > 0 ? e.reduce((o, i) => o + i.duration, 0) / e.length : 0;
1850
- return { slowCount: r, dupCount: n, avgDuration: s, totalCount: e.length };
1897
+ function tr(t, e) {
1898
+ const r = t.filter((s) => s.duration > 100).length, n = Object.values(e).filter((s) => s > 1).length, o = t.length > 0 ? t.reduce((s, i) => s + i.duration, 0) / t.length : 0;
1899
+ return { slowCount: r, dupCount: n, avgDuration: o, totalCount: t.length };
1900
+ }
1901
+ function er(t, e) {
1902
+ let r = 0, n = 0;
1903
+ for (const a of t) {
1904
+ const c = u(a, "duration") ?? 0;
1905
+ n += c, c > N && r++;
1906
+ }
1907
+ const o = Ot(t);
1908
+ let s = 0;
1909
+ for (const a of o.values())
1910
+ a > 1 && (s += a);
1911
+ const i = t.length > 0 ? n / t.length : 0, l = e?.total ?? t.length;
1912
+ return { slowCount: r, dupCount: s, avgDuration: i, totalCount: l };
1913
+ }
1914
+ function rr(t) {
1915
+ return {
1916
+ id: u(t, "id") ?? 0,
1917
+ sql: u(t, "sql", "sql_text") ?? "",
1918
+ sqlNormalized: K(t),
1919
+ duration: u(t, "duration") ?? 0,
1920
+ method: It(t),
1921
+ model: u(t, "model") ?? "",
1922
+ connection: u(t, "connection") ?? "",
1923
+ timestamp: _t(t) ?? 0,
1924
+ inTransaction: u(t, "inTransaction", "in_transaction") ?? !1
1925
+ };
1926
+ }
1927
+ function Ot(t) {
1928
+ const e = /* @__PURE__ */ new Map();
1929
+ for (const r of t) {
1930
+ const o = K(r);
1931
+ e.set(o, (e.get(o) || 0) + 1);
1932
+ }
1933
+ return e;
1934
+ }
1935
+ function Nt(t) {
1936
+ const e = [];
1937
+ if (t["Startup Cost"] !== null && t["Startup Cost"] !== void 0 && e.push(`cost=${t["Startup Cost"]}..${t["Total Cost"]}`), t["Plan Rows"] !== null && t["Plan Rows"] !== void 0 && e.push(`rows=${t["Plan Rows"]}`), t["Plan Width"] !== null && t["Plan Width"] !== void 0 && e.push(`width=${t["Plan Width"]}`), t.Filter && e.push(`filter: ${t.Filter}`), t["Index Cond"] && e.push(`cond: ${t["Index Cond"]}`), t["Hash Cond"] && e.push(`hash: ${t["Hash Cond"]}`), t["Join Type"] && e.push(`join: ${t["Join Type"]}`), t["Sort Key"]) {
1938
+ const r = Array.isArray(t["Sort Key"]) ? t["Sort Key"].join(", ") : t["Sort Key"];
1939
+ e.push(`sort: ${r}`);
1940
+ }
1941
+ return e;
1942
+ }
1943
+ function Ht(t, e = 0) {
1944
+ if (!t) return [];
1945
+ const n = [{
1946
+ depth: e,
1947
+ nodeType: t["Node Type"] || "Unknown",
1948
+ relationName: t["Relation Name"] || "",
1949
+ alias: t.Alias && t.Alias !== t["Relation Name"] ? t.Alias : "",
1950
+ indexName: t["Index Name"] || "",
1951
+ metrics: Nt(t),
1952
+ isRoot: e === 0
1953
+ }], o = t.Plans || [];
1954
+ for (const s of o)
1955
+ n.push(...Ht(s, e + 1));
1956
+ return n;
1957
+ }
1958
+ function nr(t) {
1959
+ return !t || typeof t != "object" ? !1 : "Plan" in t;
1960
+ }
1961
+ function sr(t) {
1962
+ if (!t || t.length === 0) return [];
1963
+ const e = t[0];
1964
+ return !e || typeof e != "object" ? [] : Object.keys(e);
1965
+ }
1966
+ function or(t) {
1967
+ return t == null ? "-" : String(t);
1968
+ }
1969
+ function ir() {
1970
+ return [
1971
+ { key: "id", label: "#", width: "50px", type: "index" },
1972
+ { key: "sql", label: "SQL", type: "sql" },
1973
+ { key: "duration", label: "Duration", width: "80px", type: "duration" },
1974
+ { key: "method", label: "Method", width: "70px", type: "method" },
1975
+ { key: "model", label: "Model", width: "100px", type: "model" },
1976
+ { key: "timestamp", label: "Time", width: "80px", type: "time" }
1977
+ ];
1978
+ }
1979
+ function ar(t) {
1980
+ const e = t?.showExplain ?? !0, r = [
1981
+ { key: "id", label: "#", width: "40px", type: "index" },
1982
+ { key: "sql", label: "SQL", type: "sql" },
1983
+ { key: "duration", label: "Duration", width: "70px", sortable: !0, type: "duration" },
1984
+ { key: "method", label: "Method", width: "60px", type: "method" },
1985
+ { key: "model", label: "Model", width: "90px", type: "model" },
1986
+ { key: "connection", label: "Connection", width: "80px", type: "connection" },
1987
+ { key: "createdAt", label: "Time", width: "90px", sortable: !0, type: "time" }
1988
+ ];
1989
+ return e && r.push({ key: "id", label: "", width: "70px", type: "explain" }), r;
1990
+ }
1991
+ function lr() {
1992
+ return [
1993
+ { key: "sqlNormalized", label: "Pattern", type: "sql" },
1994
+ { key: "count", label: "Count", width: "60px", sortable: !0 },
1995
+ { key: "avgDuration", label: "Avg", width: "70px", sortable: !0, type: "duration" },
1996
+ { key: "minDuration", label: "Min", width: "70px", type: "duration" },
1997
+ { key: "maxDuration", label: "Max", width: "70px", type: "duration" },
1998
+ { key: "totalDuration", label: "Total", width: "70px", sortable: !0, type: "duration" },
1999
+ { key: "percentOfTotal", label: "% Time", width: "60px" }
2000
+ ];
2001
+ }
2002
+ class cr {
2003
+ state;
2004
+ constructor(e = "list") {
2005
+ this.state = {
2006
+ viewMode: e,
2007
+ sort: {
2008
+ key: e === "list" ? "createdAt" : "count",
2009
+ dir: "desc"
2010
+ },
2011
+ expandedIds: /* @__PURE__ */ new Set(),
2012
+ explainData: /* @__PURE__ */ new Map(),
2013
+ search: ""
2014
+ };
2015
+ }
2016
+ // -----------------------------------------------------------------------
2017
+ // View mode
2018
+ // -----------------------------------------------------------------------
2019
+ /**
2020
+ * Switch between list and grouped view.
2021
+ *
2022
+ * Resets sort, expanded IDs, EXPLAIN data, and search.
2023
+ */
2024
+ setViewMode(e) {
2025
+ return this.state.viewMode = e, this.state.sort = {
2026
+ key: e === "list" ? "createdAt" : "count",
2027
+ dir: "desc"
2028
+ }, this.state.expandedIds = /* @__PURE__ */ new Set(), this.state.explainData = /* @__PURE__ */ new Map(), this.state;
2029
+ }
2030
+ // -----------------------------------------------------------------------
2031
+ // Sorting
2032
+ // -----------------------------------------------------------------------
2033
+ /**
2034
+ * Toggle sort on a column. If the column is already sorted, flips
2035
+ * direction; otherwise sorts descending on the new column.
2036
+ */
2037
+ toggleSort(e) {
2038
+ return this.state.sort.key === e ? this.state.sort = {
2039
+ key: e,
2040
+ dir: this.state.sort.dir === "asc" ? "desc" : "asc"
2041
+ } : this.state.sort = { key: e, dir: "desc" }, this.state;
2042
+ }
2043
+ // -----------------------------------------------------------------------
2044
+ // Expand / collapse
2045
+ // -----------------------------------------------------------------------
2046
+ /**
2047
+ * Toggle the expanded state of a row by its ID.
2048
+ */
2049
+ toggleExpand(e) {
2050
+ return this.state.expandedIds.has(e) ? this.state.expandedIds.delete(e) : this.state.expandedIds.add(e), this.state;
2051
+ }
2052
+ /**
2053
+ * Check whether a row is currently expanded.
2054
+ */
2055
+ isExpanded(e) {
2056
+ return this.state.expandedIds.has(e);
2057
+ }
2058
+ // -----------------------------------------------------------------------
2059
+ // Search
2060
+ // -----------------------------------------------------------------------
2061
+ /**
2062
+ * Update the search string.
2063
+ */
2064
+ setSearch(e) {
2065
+ return this.state.search = e, this.state;
2066
+ }
2067
+ // -----------------------------------------------------------------------
2068
+ // EXPLAIN lifecycle
2069
+ // -----------------------------------------------------------------------
2070
+ /**
2071
+ * Mark a query as loading its EXPLAIN plan.
2072
+ */
2073
+ startExplain(e) {
2074
+ this.state.explainData.set(e, { loading: !0 });
2075
+ }
2076
+ /**
2077
+ * Store a successful EXPLAIN result for a query.
2078
+ */
2079
+ completeExplain(e, r) {
2080
+ this.state.explainData.set(e, { loading: !1, result: r });
2081
+ }
2082
+ /**
2083
+ * Store an EXPLAIN error for a query.
2084
+ */
2085
+ failExplain(e, r) {
2086
+ this.state.explainData.set(e, { loading: !1, error: r });
2087
+ }
2088
+ /**
2089
+ * Clear all EXPLAIN data.
2090
+ */
2091
+ clearExplain() {
2092
+ this.state.explainData = /* @__PURE__ */ new Map();
2093
+ }
2094
+ /**
2095
+ * Get the current EXPLAIN state for a specific query.
2096
+ */
2097
+ getExplainState(e) {
2098
+ return this.state.explainData.get(e);
2099
+ }
1851
2100
  }
1852
- const It = [
2101
+ const ur = [
1853
2102
  "all",
1854
2103
  "active",
1855
2104
  "waiting",
@@ -1857,20 +2106,20 @@ const It = [
1857
2106
  "completed",
1858
2107
  "failed"
1859
2108
  ];
1860
- function Ht(e, t = "ss-dbg-job-status") {
1861
- switch (e) {
2109
+ function hr(t, e = "ss-dbg-job-status") {
2110
+ switch (t) {
1862
2111
  case "completed":
1863
2112
  case "failed":
1864
2113
  case "active":
1865
2114
  case "waiting":
1866
2115
  case "delayed":
1867
- return `${t}-${e}`;
2116
+ return `${e}-${t}`;
1868
2117
  default:
1869
2118
  return "ss-dbg-badge-muted";
1870
2119
  }
1871
2120
  }
1872
- function Bt(e) {
1873
- switch (e) {
2121
+ function dr(t) {
2122
+ switch (t) {
1874
2123
  case "active":
1875
2124
  return "blue";
1876
2125
  case "waiting":
@@ -1885,159 +2134,159 @@ function Bt(e) {
1885
2134
  return "muted";
1886
2135
  }
1887
2136
  }
1888
- function Nt(e) {
1889
- if (!e) return [];
1890
- if (Array.isArray(e)) return e;
1891
- const t = e;
1892
- return t.jobs || t.data || [];
2137
+ function fr(t) {
2138
+ if (!t) return [];
2139
+ if (Array.isArray(t)) return t;
2140
+ const e = t;
2141
+ return e.jobs || e.data || [];
1893
2142
  }
1894
- function qt(e) {
1895
- if (!e || Array.isArray(e)) return null;
1896
- const t = e;
1897
- return t.stats || t.overview || null;
2143
+ function pr(t) {
2144
+ if (!t || Array.isArray(t)) return null;
2145
+ const e = t;
2146
+ return e.stats || e.overview || null;
1898
2147
  }
1899
- function De(e) {
1900
- if (!e) return [];
1901
- if (typeof e == "string")
2148
+ function qt(t) {
2149
+ if (!t) return [];
2150
+ if (typeof t == "string")
1902
2151
  try {
1903
- return JSON.parse(e);
2152
+ return JSON.parse(t);
1904
2153
  } catch {
1905
2154
  return [];
1906
2155
  }
1907
- return Array.isArray(e) ? e : [];
2156
+ return Array.isArray(t) ? t : [];
1908
2157
  }
1909
- function _e(e) {
1910
- if (!e) return [];
1911
- if (typeof e == "string")
2158
+ function Bt(t) {
2159
+ if (!t) return [];
2160
+ if (typeof t == "string")
1912
2161
  try {
1913
- return JSON.parse(e);
2162
+ return JSON.parse(t);
1914
2163
  } catch {
1915
2164
  return [];
1916
2165
  }
1917
- return Array.isArray(e) ? e : [];
2166
+ return Array.isArray(t) ? t : [];
1918
2167
  }
1919
- function k(e, t, r, n = 0) {
1920
- return e[t] ?? e[r] ?? n;
2168
+ function M(t, e, r, n = 0) {
2169
+ return t[e] ?? t[r] ?? n;
1921
2170
  }
1922
- function Kt(e) {
2171
+ function mr(t) {
1923
2172
  return {
1924
- method: e.method || "",
1925
- url: e.url || "",
1926
- statusCode: k(e, "status_code", "statusCode"),
1927
- totalDuration: k(e, "total_duration", "totalDuration") || e.duration || 0,
1928
- spanCount: k(e, "span_count", "spanCount"),
1929
- spans: De(e.spans),
1930
- warnings: _e(e.warnings),
1931
- logs: e.logs || [],
1932
- httpRequestId: e.httpRequestId || e.http_request_id || void 0
2173
+ method: t.method || "",
2174
+ url: t.url || "",
2175
+ statusCode: M(t, "status_code", "statusCode"),
2176
+ totalDuration: M(t, "total_duration", "totalDuration") || t.duration || 0,
2177
+ spanCount: M(t, "span_count", "spanCount"),
2178
+ spans: qt(t.spans),
2179
+ warnings: Bt(t.warnings),
2180
+ logs: t.logs || [],
2181
+ httpRequestId: t.httpRequestId || t.http_request_id || void 0
1933
2182
  };
1934
2183
  }
1935
- const Oe = ["password", "secret", "token", "key", "credential", "auth"];
1936
- function Ie(e) {
1937
- const t = e.toLowerCase();
1938
- return Oe.some((r) => t.includes(r));
2184
+ const Kt = ["password", "secret", "token", "key", "credential", "auth"];
2185
+ function zt(t) {
2186
+ const e = t.toLowerCase();
2187
+ return Kt.some((r) => e.includes(r));
1939
2188
  }
1940
- function He(e) {
1941
- if (e == null) return "-";
1942
- if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
1943
- return String(e);
1944
- if (Array.isArray(e)) return e.join(", ") || "-";
2189
+ function jt(t) {
2190
+ if (t == null) return "-";
2191
+ if (typeof t == "string" || typeof t == "number" || typeof t == "boolean")
2192
+ return String(t);
2193
+ if (Array.isArray(t)) return t.join(", ") || "-";
1945
2194
  try {
1946
- return JSON.stringify(e);
2195
+ return JSON.stringify(t);
1947
2196
  } catch {
1948
- return String(e);
2197
+ return String(t);
1949
2198
  }
1950
2199
  }
1951
- const Be = {
2200
+ const Wt = {
1952
2201
  collectionInterval: "Stats Collection",
1953
2202
  dashboardBroadcast: "Dashboard Broadcast",
1954
2203
  debugBroadcast: "Debug Broadcast",
1955
2204
  persistFlush: "Persist Flush",
1956
2205
  retentionCleanup: "Retention Cleanup"
1957
2206
  };
1958
- function zt(e) {
1959
- return Be[e] || e;
2207
+ function gr(t) {
2208
+ return Wt[t] || t;
1960
2209
  }
1961
- const Ne = {
2210
+ const Vt = {
1962
2211
  prometheus: "Prometheus",
1963
2212
  pinoHook: "Pino Log Hook",
1964
2213
  edgePlugin: "Edge Plugin",
1965
2214
  cacheInspector: "Cache Inspector",
1966
2215
  queueInspector: "Queue Inspector"
1967
2216
  };
1968
- function jt(e) {
1969
- return Ne[e] || e;
2217
+ function yr(t) {
2218
+ return Vt[t] || t;
1970
2219
  }
1971
- function Wt(e) {
1972
- return "active" in e ? e.active ? "active" : "inactive" : "available" in e ? e.available ? "available" : "unavailable" : "unknown";
2220
+ function br(t) {
2221
+ return "active" in t ? t.active ? "active" : "inactive" : "available" in t ? t.available ? "available" : "unavailable" : "unknown";
1973
2222
  }
1974
- function Vt(e, t) {
1975
- return t.mode ? `Mode: ${t.mode}` : e === "edgePlugin" && t.active ? "@serverStats() tag registered" : e === "cacheInspector" ? t.available ? "Redis dependency detected" : "Redis not installed" : e === "queueInspector" ? t.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
2223
+ function xr(t, e) {
2224
+ return e.mode ? `Mode: ${e.mode}` : t === "edgePlugin" && e.active ? "@serverStats() tag registered" : t === "cacheInspector" ? e.available ? "Redis dependency detected" : "Redis not installed" : t === "queueInspector" ? e.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
1976
2225
  }
1977
- function Gt(e) {
1978
- return Object.entries(e).map(([t, r]) => ({
1979
- key: t,
1980
- value: He(r),
1981
- secret: Ie(t)
2226
+ function Sr(t) {
2227
+ return Object.entries(t).map(([e, r]) => ({
2228
+ key: e,
2229
+ value: jt(r),
2230
+ secret: zt(e)
1982
2231
  }));
1983
2232
  }
1984
- function Qt(e, t) {
1985
- return t ? Math.min(100, Math.round(e / t * 100)) : 0;
2233
+ function wr(t, e) {
2234
+ return e ? Math.min(100, Math.round(t / e * 100)) : 0;
1986
2235
  }
1987
- const qe = ["healthy", "active", "connected", "available", "ready"], Ke = ["errored", "unavailable"];
1988
- function Jt(e) {
1989
- return qe.includes(e) ? "ok" : Ke.includes(e) ? "err" : "";
2236
+ const Gt = ["healthy", "active", "connected", "available", "ready"], Qt = ["errored", "unavailable"];
2237
+ function vr(t) {
2238
+ return Gt.includes(t) ? "ok" : Qt.includes(t) ? "err" : "";
1990
2239
  }
1991
- function R(e) {
1992
- return e !== null && typeof e == "object" && !Array.isArray(e) && e.__redacted === !0;
2240
+ function R(t) {
2241
+ return t !== null && typeof t == "object" && !Array.isArray(t) && t.__redacted === !0;
1993
2242
  }
1994
- function T(e) {
1995
- return e != null && typeof e == "object" && !Array.isArray(e) && !R(e);
2243
+ function E(t) {
2244
+ return t != null && typeof t == "object" && !Array.isArray(t) && !R(t);
1996
2245
  }
1997
- function ze(e, t = "") {
1998
- if (!T(e))
1999
- return [{ path: t, value: e }];
2246
+ function Jt(t, e = "") {
2247
+ if (!E(t))
2248
+ return [{ path: e, value: t }];
2000
2249
  const r = [];
2001
- for (const n of Object.keys(e)) {
2002
- const s = t ? `${t}.${n}` : n, o = e[n];
2003
- T(o) ? r.push(...ze(o, s)) : r.push({ path: s, value: o });
2250
+ for (const n of Object.keys(t)) {
2251
+ const o = e ? `${e}.${n}` : n, s = t[n];
2252
+ E(s) ? r.push(...Jt(s, o)) : r.push({ path: o, value: s });
2004
2253
  }
2005
2254
  return r;
2006
2255
  }
2007
- function Yt(e) {
2008
- return e == null ? { text: "null", color: "var(--ss-dim)" } : typeof e == "boolean" ? {
2009
- text: String(e),
2010
- color: e ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
2011
- } : typeof e == "number" ? { text: String(e), color: "var(--ss-amber-fg)" } : Array.isArray(e) ? { text: `[${e.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof e == "object" ? { text: JSON.stringify(e), color: "var(--ss-dim)" } : { text: String(e) };
2256
+ function Cr(t) {
2257
+ return t == null ? { text: "null", color: "var(--ss-dim)" } : typeof t == "boolean" ? {
2258
+ text: String(t),
2259
+ color: t ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
2260
+ } : typeof t == "number" ? { text: String(t), color: "var(--ss-amber-fg)" } : Array.isArray(t) ? { text: `[${t.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof t == "object" ? { text: JSON.stringify(t), color: "var(--ss-dim)" } : { text: String(t) };
2012
2261
  }
2013
- function je(e) {
2014
- if (e == null || typeof e != "object" || Array.isArray(e) || R(e))
2262
+ function Yt(t) {
2263
+ if (t == null || typeof t != "object" || Array.isArray(t) || R(t))
2015
2264
  return 1;
2016
- let t = 0;
2017
- for (const r of Object.keys(e))
2018
- t += je(e[r]);
2019
- return t;
2265
+ let e = 0;
2266
+ for (const r of Object.keys(t))
2267
+ e += Yt(t[r]);
2268
+ return e;
2020
2269
  }
2021
- function Xt(e) {
2022
- if (!T(e)) return [];
2023
- const t = [];
2024
- for (const r of Object.keys(e))
2025
- T(e[r]) && t.push(r);
2026
- return t;
2270
+ function Er(t) {
2271
+ if (!E(t)) return [];
2272
+ const e = [];
2273
+ for (const r of Object.keys(t))
2274
+ E(t[r]) && e.push(r);
2275
+ return e;
2027
2276
  }
2028
- function Zt(e, t, r) {
2029
- return !r || e.toLowerCase().includes(r) ? !0 : (R(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
2277
+ function Tr(t, e, r) {
2278
+ return !r || t.toLowerCase().includes(r) ? !0 : (R(e) ? e.display : e == null ? "" : String(e)).toLowerCase().includes(r);
2030
2279
  }
2031
- function er(e, t, r) {
2032
- t && navigator.clipboard.writeText(e).then(() => {
2033
- const n = t.textContent;
2034
- t.textContent = "✓", t.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
2035
- t.textContent = n, t.classList.remove(`${r}-copy-row-ok`);
2280
+ function kr(t, e, r) {
2281
+ e && navigator.clipboard.writeText(t).then(() => {
2282
+ const n = e.textContent;
2283
+ e.textContent = "✓", e.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
2284
+ e.textContent = n, e.classList.remove(`${r}-copy-row-ok`);
2036
2285
  }, 1200);
2037
2286
  }).catch(() => {
2038
2287
  });
2039
2288
  }
2040
- const We = /* @__PURE__ */ new Set([
2289
+ const Xt = /* @__PURE__ */ new Set([
2041
2290
  "secret",
2042
2291
  "key",
2043
2292
  "token",
@@ -2051,195 +2300,158 @@ const We = /* @__PURE__ */ new Set([
2051
2300
  "private",
2052
2301
  "encryption"
2053
2302
  ]);
2054
- function Ve(e) {
2055
- const t = e.split(/[._-]/), r = [];
2056
- for (const n of t) {
2057
- const s = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
2058
- for (const o of s)
2059
- o && r.push(o);
2303
+ function Zt(t) {
2304
+ const e = t.split(/[._-]/), r = [];
2305
+ for (const n of e) {
2306
+ const o = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
2307
+ for (const s of o)
2308
+ s && r.push(s);
2060
2309
  }
2061
2310
  return r;
2062
2311
  }
2063
- function tr(e) {
2064
- return Ve(e).some((r) => We.has(r.toLowerCase()));
2065
- }
2066
- const rr = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
2067
- function h(e, ...t) {
2068
- for (const r of t) {
2069
- const n = e[r];
2070
- if (n != null) return n;
2071
- }
2072
- }
2073
- function nr(e) {
2074
- return h(e, "createdAt", "created_at", "timestamp");
2075
- }
2076
- function or(e) {
2077
- return h(e, "timestamp", "createdAt", "processedAt", "created_at");
2078
- }
2079
- function sr(e) {
2080
- return h(e, "statusCode", "status_code");
2081
- }
2082
- function ir(e) {
2083
- return h(e, "total_duration", "totalDuration", "duration") ?? 0;
2084
- }
2085
- function ar(e) {
2086
- return h(e, "span_count", "spanCount") ?? 0;
2087
- }
2088
- function cr(e) {
2089
- return h(e, "warning_count", "warningCount") ?? 0;
2090
- }
2091
- function lr(e) {
2092
- return h(e, "from_addr", "from") ?? "";
2093
- }
2094
- function ur(e) {
2095
- return h(e, "to_addr", "to") ?? "";
2096
- }
2097
- function hr(e) {
2098
- return h(e, "cc", "cc_addr") ?? "";
2099
- }
2100
- function dr(e) {
2101
- return h(e, "attachment_count", "attachmentCount") ?? 0;
2102
- }
2103
- function fr(e) {
2104
- return h(e, "event_name", "eventName", "event") ?? "";
2105
- }
2106
- function pr(e) {
2107
- return h(e, "method", "sql_method") ?? "";
2108
- }
2109
- function gr(e) {
2110
- return h(e, "sqlNormalized", "normalizedSql", "sql_normalized", "sql") ?? "";
2111
- }
2112
- function mr(e, t, r) {
2113
- const n = e[t];
2114
- return n != null && n !== 0 ? Number(n) : Number(e[r]) || 0;
2312
+ function Mr(t) {
2313
+ return Zt(t).some((r) => Xt.has(r.toLowerCase()));
2115
2314
  }
2315
+ const Pr = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
2116
2316
  export {
2117
- C as ApiClient,
2118
- K as ApiError,
2119
- Ce as DASHBOARD_SECTION_PATHS,
2120
- te as DEBUG_REFRESH_MS,
2121
- Ee as DEBUG_TAB_PATHS,
2122
- Se as DEFAULT_FEATURES,
2123
- B as DEFAULT_PER_PAGE,
2124
- Pe as DashboardApi,
2125
- Et as DashboardDataController,
2126
- kt as DebugDataController,
2127
- Ke as ERROR_STATUSES,
2128
- Ne as INTEGRATION_LABELS,
2129
- It as JOB_STATUS_FILTERS,
2130
- Pt as LOG_LEVELS,
2131
- oe as MAX_HISTORY,
2317
+ T as ApiClient,
2318
+ j as ApiError,
2319
+ kt as DASHBOARD_SECTION_PATHS,
2320
+ nt as DEBUG_REFRESH_MS,
2321
+ Et as DEBUG_TAB_PATHS,
2322
+ St as DEFAULT_FEATURES,
2323
+ q as DEFAULT_PER_PAGE,
2324
+ At as DashboardApi,
2325
+ Ae as DashboardDataController,
2326
+ De as DebugDataController,
2327
+ Qt as ERROR_STATUSES,
2328
+ Vt as INTEGRATION_LABELS,
2329
+ ur as JOB_STATUS_FILTERS,
2330
+ Fe as LOG_LEVELS,
2331
+ ot as MAX_HISTORY,
2132
2332
  $ as METRIC_DEFINITIONS,
2133
- qe as OK_STATUSES,
2134
- Z as OVERVIEW_REFRESH_MS,
2135
- rr as REDACT_PATTERN,
2136
- ee as SECTION_REFRESH_MS,
2137
- re as SLOW_DURATION_MS,
2138
- se as STALE_MS,
2139
- wt as ServerStatsController,
2140
- Tt as TAB_ICONS,
2141
- de as THRESHOLD_CSS_CLASS,
2142
- ot as THRESHOLD_CSS_VAR,
2143
- nt as THRESHOLD_HEX_FALLBACK,
2144
- Be as TIMER_LABELS,
2145
- x as UnauthorizedError,
2146
- ne as VERY_SLOW_DURATION_MS,
2147
- ge as buildQueryParams,
2148
- ut as buildQueryString,
2149
- Xe as buildSparklineData,
2150
- Jt as classifyStatus,
2151
- Xt as collectTopLevelObjectKeys,
2152
- D as compactPreview,
2153
- gt as computePagination,
2154
- Ot as computeQuerySummary,
2155
- X as computeStats,
2156
- er as copyWithFeedback,
2157
- _t as countDuplicateQueries,
2158
- je as countLeaves,
2159
- ft as createFilterState,
2160
- ke as createHistoryBuffer,
2161
- dt as createPaginationState,
2162
- pt as createSortState,
2163
- W as createTransmitSubscription,
2164
- yt as detectFeatures,
2165
- St as detectMetricGroupsFromStats,
2166
- it as durationClassName,
2167
- fe as durationSeverity,
2168
- qt as extractJobStats,
2169
- Nt as extractJobs,
2170
- xe as fetchFeatures,
2171
- Qt as fillPercent,
2172
- Ft as filterLogsByLevel,
2173
- Dt as filterQueries,
2174
- ze as flattenConfig,
2333
+ Gt as OK_STATUSES,
2334
+ et as OVERVIEW_REFRESH_MS,
2335
+ cr as QueriesController,
2336
+ Pr as REDACT_PATTERN,
2337
+ rt as SECTION_REFRESH_MS,
2338
+ N as SLOW_DURATION_MS,
2339
+ it as STALE_MS,
2340
+ Pe as ServerStatsController,
2341
+ $e as TAB_ICONS,
2342
+ ft as THRESHOLD_CSS_CLASS,
2343
+ ue as THRESHOLD_CSS_VAR,
2344
+ ce as THRESHOLD_HEX_FALLBACK,
2345
+ Wt as TIMER_LABELS,
2346
+ w as UnauthorizedError,
2347
+ st as VERY_SLOW_DURATION_MS,
2348
+ gt as buildQueryParams,
2349
+ ge as buildQueryString,
2350
+ se as buildSparklineData,
2351
+ Ot as buildSqlCounts,
2352
+ vr as classifyStatus,
2353
+ Er as collectTopLevelObjectKeys,
2354
+ U as compactPreview,
2355
+ er as computeDashboardQuerySummary,
2356
+ we as computePagination,
2357
+ tr as computeQuerySummary,
2358
+ tt as computeStats,
2359
+ kr as copyWithFeedback,
2360
+ Ze as countDuplicateQueries,
2361
+ Yt as countLeaves,
2362
+ xe as createFilterState,
2363
+ Pt as createHistoryBuffer,
2364
+ be as createPaginationState,
2365
+ Se as createSortState,
2366
+ G as createTransmitSubscription,
2367
+ Ce as detectFeatures,
2368
+ Te as detectMetricGroupsFromStats,
2369
+ de as durationClassName,
2370
+ pt as durationSeverity,
2371
+ pr as extractJobStats,
2372
+ fr as extractJobs,
2373
+ vt as fetchFeatures,
2374
+ wr as fillPercent,
2375
+ Ne as filterLogsByLevel,
2376
+ Xe as filterQueries,
2377
+ Jt as flattenConfig,
2378
+ Ht as flattenPlanTree,
2175
2379
  A as formatBytes,
2176
- lt as formatCacheSize,
2177
- Gt as formatCollectorConfig,
2178
- He as formatConfigVal,
2179
- ue as formatCount,
2180
- Ze as formatDuration,
2181
- Yt as formatFlatValue,
2182
- F as formatMb,
2183
- rt as formatStatNum,
2184
- et as formatTime,
2185
- ct as formatTtl,
2186
- le as formatUptime,
2187
- Y as generateGradientId,
2188
- Ye as generateSparklinePath,
2189
- Je as generateSparklinePoints,
2190
- Me as getDashboardSectionPath,
2191
- Te as getDebugTabPath,
2192
- Vt as getIntegrationDetails,
2193
- jt as getIntegrationLabel,
2194
- Wt as getIntegrationStatus,
2195
- Bt as getJobStatusBadgeColor,
2196
- Ht as getJobStatusCssClass,
2197
- Lt as getLogLevelCssClass,
2198
- vt as getMetricById,
2199
- xt as getMetricsByGroup,
2200
- mt as getPageNumbers,
2201
- U as getRatioColor,
2202
- Ut as getStructuredData,
2203
- I as getTheme,
2204
- w as getThresholdColor,
2205
- he as getThresholdColorInverse,
2206
- zt as getTimerLabel,
2207
- bt as getVisibleMetricGroups,
2208
- Ct as initResizableColumns,
2209
- Mt as initSplitPane,
2380
+ me as formatCacheSize,
2381
+ or as formatCellValue,
2382
+ Sr as formatCollectorConfig,
2383
+ jt as formatConfigVal,
2384
+ ht as formatCount,
2385
+ oe as formatDuration,
2386
+ Cr as formatFlatValue,
2387
+ D as formatMb,
2388
+ Nt as formatPlanNodeMetrics,
2389
+ le as formatStatNum,
2390
+ ie as formatTime,
2391
+ pe as formatTtl,
2392
+ ut as formatUptime,
2393
+ Z as generateGradientId,
2394
+ ne as generateSparklinePath,
2395
+ re as generateSparklinePoints,
2396
+ lr as getDashboardGroupedColumns,
2397
+ ar as getDashboardListColumns,
2398
+ Mt as getDashboardSectionPath,
2399
+ ir as getDebugPaneColumns,
2400
+ Tt as getDebugTabPath,
2401
+ sr as getExplainColumns,
2402
+ xr as getIntegrationDetails,
2403
+ yr as getIntegrationLabel,
2404
+ br as getIntegrationStatus,
2405
+ dr as getJobStatusBadgeColor,
2406
+ hr as getJobStatusCssClass,
2407
+ Oe as getLogLevelCssClass,
2408
+ ke as getMetricById,
2409
+ Me as getMetricsByGroup,
2410
+ ve as getPageNumbers,
2411
+ F as getRatioColor,
2412
+ He as getStructuredData,
2413
+ O as getTheme,
2414
+ v as getThresholdColor,
2415
+ dt as getThresholdColorInverse,
2416
+ gr as getTimerLabel,
2417
+ Ee as getVisibleMetricGroups,
2418
+ nr as hasNestedPlan,
2419
+ Re as initResizableColumns,
2420
+ Le as initSplitPane,
2210
2421
  R as isRedactedValue,
2211
- Ie as isSecretKey,
2212
- Zt as matchesConfigSearch,
2213
- Kt as normalizeTraceFields,
2214
- Qe as onThemeChange,
2215
- ht as parsePaginatedResponse,
2216
- De as parseTraceSpans,
2217
- _e as parseTraceWarnings,
2218
- dr as resolveAttachmentCount,
2219
- hr as resolveCcAddr,
2220
- ir as resolveDuration,
2221
- fr as resolveEventName,
2222
- h as resolveField,
2223
- lr as resolveFromAddr,
2224
- or as resolveJobTimestamp,
2225
- Fe as resolveLogLevel,
2226
- At as resolveLogMessage,
2227
- Rt as resolveLogRequestId,
2228
- $t as resolveLogTimestamp,
2229
- mr as resolveMetric,
2230
- gr as resolveNormalizedSql,
2231
- ar as resolveSpanCount,
2232
- pr as resolveSqlMethod,
2233
- sr as resolveStatusCode,
2234
- nr as resolveTimestamp,
2235
- ur as resolveToAddr,
2236
- k as resolveTraceField,
2237
- cr as resolveWarningCount,
2238
- G as setTheme,
2239
- at as shortReqId,
2240
- tr as shouldRedact,
2241
- st as statusColor,
2242
- V as subscribeToChannel,
2243
- tt as timeAgo,
2244
- Ge as toggleTheme
2422
+ zt as isSecretKey,
2423
+ Tr as matchesConfigSearch,
2424
+ rr as normalizeDashboardQuery,
2425
+ mr as normalizeTraceFields,
2426
+ ee as onThemeChange,
2427
+ ye as parsePaginatedResponse,
2428
+ qt as parseTraceSpans,
2429
+ Bt as parseTraceWarnings,
2430
+ Qe as resolveAttachmentCount,
2431
+ Ge as resolveCcAddr,
2432
+ Ke as resolveDuration,
2433
+ Je as resolveEventName,
2434
+ u as resolveField,
2435
+ We as resolveFromAddr,
2436
+ qe as resolveJobTimestamp,
2437
+ Ft as resolveLogLevel,
2438
+ Ue as resolveLogMessage,
2439
+ Ie as resolveLogRequestId,
2440
+ _e as resolveLogTimestamp,
2441
+ Ye as resolveMetric,
2442
+ K as resolveNormalizedSql,
2443
+ ze as resolveSpanCount,
2444
+ It as resolveSqlMethod,
2445
+ Be as resolveStatusCode,
2446
+ _t as resolveTimestamp,
2447
+ Ve as resolveToAddr,
2448
+ M as resolveTraceField,
2449
+ je as resolveWarningCount,
2450
+ J as setTheme,
2451
+ fe as shortReqId,
2452
+ Mr as shouldRedact,
2453
+ he as statusColor,
2454
+ Q as subscribeToChannel,
2455
+ ae as timeAgo,
2456
+ te as toggleTheme
2245
2457
  };