adonisjs-server-stats 1.10.0 → 1.11.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 (248) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/field-resolvers.d.ts +64 -0
  10. package/dist/core/formatters-helpers.d.ts +23 -0
  11. package/dist/core/formatters.d.ts +15 -0
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.js +599 -509
  14. package/dist/core/log-utils-helpers.d.ts +13 -0
  15. package/dist/core/metrics.d.ts +3 -28
  16. package/dist/core/pagination.d.ts +0 -9
  17. package/dist/core/server-stats-controller.d.ts +6 -0
  18. package/dist/core/transmit-helpers.d.ts +7 -0
  19. package/dist/core/types-dashboard.d.ts +178 -0
  20. package/dist/core/types-diagnostics.d.ts +85 -0
  21. package/dist/core/types.d.ts +10 -442
  22. package/dist/react/CacheSection-BYN53kYO.js +135 -0
  23. package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
  24. package/dist/react/CacheTab-DOhuK05d.js +106 -0
  25. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-B9EHh4Rp.js} +1 -1
  26. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-C8kriE2b.js} +1 -1
  27. package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
  28. package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
  29. package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
  30. package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
  31. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-DJPwHeT8.js} +28 -27
  32. package/dist/react/EventsTab-B-FoehXC.js +58 -0
  33. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  34. package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
  35. package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
  36. package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
  37. package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
  38. package/dist/react/JobsSection-DWF4i1t_.js +167 -0
  39. package/dist/react/JobsTab-DqnifQXV.js +129 -0
  40. package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
  41. package/dist/react/LogsSection-C1xC5aP4.js +198 -0
  42. package/dist/react/LogsTab-CS4sLfLw.js +79 -0
  43. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-CxvfOR0v.js} +70 -80
  44. package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
  45. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-x85PjkyS.js} +38 -40
  46. package/dist/react/RequestsSection-DETN9oZb.js +321 -0
  47. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-CmorkJeC.js} +2 -2
  48. package/dist/react/RoutesTab-CbzBOzpc.js +68 -0
  49. package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
  50. package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
  51. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-Ue9tUD_n.js} +76 -102
  52. package/dist/react/index-DwDK-4oX.js +1121 -0
  53. package/dist/react/index.js +6 -6
  54. package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
  55. package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
  56. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  57. package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
  58. package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
  59. package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
  60. package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
  61. package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
  62. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  63. package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
  64. package/dist/react/style.css +1 -1
  65. package/dist/src/collectors/app_collector.d.ts +0 -8
  66. package/dist/src/collectors/app_collector.js +45 -52
  67. package/dist/src/collectors/auto_detect.d.ts +0 -23
  68. package/dist/src/collectors/auto_detect.js +33 -55
  69. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  70. package/dist/src/collectors/db_pool_collector.js +72 -57
  71. package/dist/src/collectors/log_collector.d.ts +0 -47
  72. package/dist/src/collectors/log_collector.js +36 -65
  73. package/dist/src/collectors/queue_collector.d.ts +0 -20
  74. package/dist/src/collectors/queue_collector.js +60 -76
  75. package/dist/src/collectors/redis_collector.d.ts +10 -10
  76. package/dist/src/collectors/redis_collector.js +69 -66
  77. package/dist/src/config/deprecation_migration.d.ts +7 -0
  78. package/dist/src/config/deprecation_migration.js +201 -0
  79. package/dist/src/controller/debug_controller.d.ts +1 -1
  80. package/dist/src/controller/debug_controller.js +87 -81
  81. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  82. package/dist/src/dashboard/cache_handlers.js +52 -0
  83. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  84. package/dist/src/dashboard/chart_aggregator.js +68 -50
  85. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  86. package/dist/src/dashboard/coalesce_cache.js +47 -0
  87. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  88. package/dist/src/dashboard/dashboard_controller.js +51 -544
  89. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  90. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  91. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  92. package/dist/src/dashboard/dashboard_store.js +115 -1116
  93. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  94. package/dist/src/dashboard/dashboard_types.js +4 -0
  95. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  96. package/dist/src/dashboard/detail_queries.js +98 -0
  97. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  98. package/dist/src/dashboard/email_event_builder.js +65 -0
  99. package/dist/src/dashboard/explain_query.d.ts +8 -0
  100. package/dist/src/dashboard/explain_query.js +22 -0
  101. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  102. package/dist/src/dashboard/filter_handlers.js +56 -0
  103. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  104. package/dist/src/dashboard/filtered_queries.js +155 -0
  105. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  106. package/dist/src/dashboard/flush_manager.js +107 -0
  107. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  108. package/dist/src/dashboard/format_helpers.js +140 -0
  109. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  110. package/dist/src/dashboard/inspector_manager.js +102 -0
  111. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  112. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  113. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  114. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  115. package/dist/src/dashboard/jobs_handlers.js +61 -0
  116. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  117. package/dist/src/dashboard/knex_factory.js +91 -0
  118. package/dist/src/dashboard/migrator.js +30 -159
  119. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  120. package/dist/src/dashboard/migrator_tables.js +153 -0
  121. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  122. package/dist/src/dashboard/overview_queries.js +155 -0
  123. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  124. package/dist/src/dashboard/overview_query_runners.js +84 -0
  125. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  126. package/dist/src/dashboard/overview_store_queries.js +69 -0
  127. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  128. package/dist/src/dashboard/paginate_helper.js +33 -0
  129. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  130. package/dist/src/dashboard/query_explain_handler.js +80 -0
  131. package/dist/src/dashboard/read_queries.d.ts +32 -0
  132. package/dist/src/dashboard/read_queries.js +107 -0
  133. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  134. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  135. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  136. package/dist/src/dashboard/storage_stats.js +81 -0
  137. package/dist/src/dashboard/write_queue.d.ts +106 -0
  138. package/dist/src/dashboard/write_queue.js +225 -0
  139. package/dist/src/data/data_access.d.ts +2 -39
  140. package/dist/src/data/data_access.js +17 -193
  141. package/dist/src/data/data_access_helpers.d.ts +130 -0
  142. package/dist/src/data/data_access_helpers.js +212 -0
  143. package/dist/src/debug/debug_store.js +37 -32
  144. package/dist/src/debug/email_collector.d.ts +1 -10
  145. package/dist/src/debug/email_collector.js +78 -81
  146. package/dist/src/debug/event_collector.d.ts +0 -9
  147. package/dist/src/debug/event_collector.js +79 -62
  148. package/dist/src/debug/query_collector.js +23 -19
  149. package/dist/src/debug/route_inspector.d.ts +1 -5
  150. package/dist/src/debug/route_inspector.js +50 -51
  151. package/dist/src/debug/trace_collector.d.ts +9 -1
  152. package/dist/src/debug/trace_collector.js +21 -15
  153. package/dist/src/debug/types.d.ts +1 -1
  154. package/dist/src/define_config.d.ts +0 -65
  155. package/dist/src/define_config.js +93 -333
  156. package/dist/src/edge/client/dashboard.js +2 -2
  157. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  158. package/dist/src/edge/client/stats-bar.js +1 -1
  159. package/dist/src/edge/client-vue/dashboard.js +5 -5
  160. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
  161. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  162. package/dist/src/edge/plugin.d.ts +0 -16
  163. package/dist/src/edge/plugin.js +57 -64
  164. package/dist/src/engine/request_metrics.d.ts +1 -0
  165. package/dist/src/engine/request_metrics.js +32 -42
  166. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  167. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  168. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  169. package/dist/src/provider/auth_middleware_detector.js +97 -0
  170. package/dist/src/provider/boot_helpers.d.ts +20 -0
  171. package/dist/src/provider/boot_helpers.js +91 -0
  172. package/dist/src/provider/boot_initializer.d.ts +28 -0
  173. package/dist/src/provider/boot_initializer.js +35 -0
  174. package/dist/src/provider/dashboard_init.d.ts +30 -0
  175. package/dist/src/provider/dashboard_init.js +138 -0
  176. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  177. package/dist/src/provider/dashboard_setup.js +78 -0
  178. package/dist/src/provider/diagnostics.d.ts +134 -0
  179. package/dist/src/provider/diagnostics.js +127 -0
  180. package/dist/src/provider/email_bridge.d.ts +43 -0
  181. package/dist/src/provider/email_bridge.js +80 -0
  182. package/dist/src/provider/email_helpers.d.ts +13 -0
  183. package/dist/src/provider/email_helpers.js +68 -0
  184. package/dist/src/provider/pino_hook.d.ts +17 -0
  185. package/dist/src/provider/pino_hook.js +35 -0
  186. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  187. package/dist/src/provider/provider_helpers_extra.js +177 -0
  188. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  189. package/dist/src/provider/server_stats_provider.js +132 -951
  190. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  191. package/dist/src/provider/shutdown_helpers.js +70 -0
  192. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  193. package/dist/src/provider/toolbar_setup.js +141 -0
  194. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  195. package/dist/src/routes/dashboard_routes.js +197 -0
  196. package/dist/src/routes/debug_routes.d.ts +14 -0
  197. package/dist/src/routes/debug_routes.js +101 -0
  198. package/dist/src/routes/register_routes.d.ts +0 -78
  199. package/dist/src/routes/register_routes.js +22 -352
  200. package/dist/src/routes/stats_routes.d.ts +5 -0
  201. package/dist/src/routes/stats_routes.js +14 -0
  202. package/dist/src/styles/components.css +163 -0
  203. package/dist/src/styles/dashboard.css +13 -105
  204. package/dist/src/styles/debug-panel.css +2 -53
  205. package/dist/src/styles/utilities.css +3 -1
  206. package/dist/src/types.d.ts +305 -14
  207. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-DT2Mwf_s.js} +1 -1
  208. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-BwKwS9lh.js} +1 -1
  209. package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
  210. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-B65g0FVS.js} +1 -1
  211. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-CxqtVF-o.js} +1 -1
  212. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-rMIyMb-g.js} +1 -1
  213. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-DmmZVJ7D.js} +9 -3
  214. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  215. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-BMabyqw-.js} +49 -50
  216. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-BfDFwGqH.js} +44 -45
  217. package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
  218. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
  219. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-CTu4jPZ_.js} +143 -147
  220. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-zQZDedL7.js} +1 -1
  221. package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
  222. package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
  223. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  224. package/dist/vue/index-CM3yNVUR.js +1232 -0
  225. package/dist/vue/index.js +1 -1
  226. package/dist/vue/style.css +1 -1
  227. package/package.json +1 -1
  228. package/dist/react/CacheSection-UCMptWyn.js +0 -146
  229. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  230. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  231. package/dist/react/EmailsSection-CM7stSyh.js +0 -262
  232. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  233. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  234. package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
  235. package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
  236. package/dist/react/JobsSection-DF3qEv9O.js +0 -187
  237. package/dist/react/JobsTab-BbrBWIOb.js +0 -141
  238. package/dist/react/LogsSection-DcFTZY7b.js +0 -227
  239. package/dist/react/LogsTab-CicucmVk.js +0 -103
  240. package/dist/react/QueriesSection-PswteoF9.js +0 -461
  241. package/dist/react/RelatedLogs-DFDOyUMr.js +0 -40
  242. package/dist/react/RequestsSection-Nag30rEA.js +0 -341
  243. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  244. package/dist/react/index-Cflz9Ebj.js +0 -1069
  245. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
  246. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
  247. package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
  248. package/dist/vue/index-Dtgysd26.js +0 -1229
@@ -1,17 +1,17 @@
1
- class w extends Error {
1
+ class b extends Error {
2
2
  status;
3
3
  constructor(t = 403) {
4
4
  super(`Unauthorized (HTTP ${t})`), this.name = "UnauthorizedError", this.status = t;
5
5
  }
6
6
  }
7
- class _ extends Error {
7
+ class B extends Error {
8
8
  status;
9
9
  body;
10
10
  constructor(t, r) {
11
11
  super(`API error (HTTP ${t})`), this.name = "ApiError", this.status = t, this.body = r;
12
12
  }
13
13
  }
14
- class T {
14
+ class v {
15
15
  baseUrl;
16
16
  authToken;
17
17
  constructor(t) {
@@ -25,7 +25,7 @@ class T {
25
25
  * @returns Parsed JSON response body typed as `T`.
26
26
  */
27
27
  async fetch(t, r) {
28
- const i = {
28
+ const o = {
29
29
  ...{
30
30
  Accept: "application/json",
31
31
  ...this.authToken ? { Authorization: `Bearer ${this.authToken}` } : {}
@@ -33,16 +33,16 @@ class T {
33
33
  ...r?.headers
34
34
  }, s = await globalThis.fetch(`${this.baseUrl}${t}`, {
35
35
  ...r,
36
- headers: i,
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
41
  if (s.status === 401 || s.status === 403)
42
- throw new w(s.status);
42
+ throw new b(s.status);
43
43
  if (!s.ok) {
44
- const o = await s.text().catch(() => "");
45
- throw new _(s.status, o);
44
+ const i = await s.text().catch(() => "");
45
+ throw new B(s.status, i);
46
46
  }
47
47
  return s.json();
48
48
  }
@@ -84,7 +84,22 @@ class T {
84
84
  return this.fetch(t, { method: "DELETE" });
85
85
  }
86
86
  }
87
- async function B() {
87
+ function H(e, t) {
88
+ const r = e || (typeof window < "u" ? window.location.origin : "");
89
+ if (!t)
90
+ return { baseUrl: r };
91
+ const n = { headers: { Authorization: `Bearer ${t}` } };
92
+ return {
93
+ baseUrl: r,
94
+ beforeSubscribe(o) {
95
+ return n;
96
+ },
97
+ beforeUnsubscribe(o) {
98
+ return n;
99
+ }
100
+ };
101
+ }
102
+ async function N() {
88
103
  if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
89
104
  return window.Transmit;
90
105
  try {
@@ -94,51 +109,33 @@ async function B() {
94
109
  return null;
95
110
  }
96
111
  }
97
- function H(e) {
112
+ function q(e) {
98
113
  let t = null, r = null, n = !1;
99
114
  return { subscribe: async () => {
100
115
  try {
101
- const o = await B();
102
- if (!o)
116
+ const i = await N();
117
+ if (!i)
103
118
  throw new Error(
104
119
  "Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
105
120
  );
106
121
  if (n) return;
107
- t = new o({
108
- baseUrl: e.baseUrl || window.location.origin,
109
- ...e.authToken ? {
110
- beforeSubscribe(l) {
111
- return {
112
- headers: {
113
- Authorization: `Bearer ${e.authToken}`
114
- }
115
- };
116
- },
117
- beforeUnsubscribe(l) {
118
- return {
119
- headers: {
120
- Authorization: `Bearer ${e.authToken}`
121
- }
122
- };
123
- }
124
- } : {}
125
- }), r = t.subscription(e.channelName), r.onMessage((l) => {
126
- n || e.onMessage(l);
122
+ t = new i(H(e.baseUrl, e.authToken)), r = t.subscription(e.channelName), r.onMessage((a) => {
123
+ n || e.onMessage(a);
127
124
  }), await r.create();
128
- } catch (o) {
129
- e.onError && e.onError(o);
125
+ } catch (i) {
126
+ e.onError?.(i);
130
127
  }
131
128
  }, unsubscribe: async () => {
132
129
  n = !0;
133
130
  try {
134
- r && (await r.delete(), r = null), t && (t = null);
131
+ await r?.delete(), r = null, t = null;
135
132
  } catch {
136
133
  }
137
134
  } };
138
135
  }
139
- function q(e) {
136
+ function K(e) {
140
137
  let t = !1;
141
- const r = H({
138
+ const r = q({
142
139
  baseUrl: e.baseUrl,
143
140
  channelName: e.channelName,
144
141
  authToken: e.authToken,
@@ -158,38 +155,38 @@ function q(e) {
158
155
  }
159
156
  };
160
157
  }
161
- const v = "ss-dash-theme", M = "ss-theme-change";
158
+ const S = "ss-dash-theme", k = "ss-theme-change";
162
159
  function U() {
163
160
  if (typeof window > "u") return "light";
164
- const e = localStorage.getItem(v);
161
+ const e = localStorage.getItem(S);
165
162
  return e === "dark" || e === "light" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
166
163
  }
167
- function N(e) {
168
- typeof window > "u" || (localStorage.setItem(v, e), window.dispatchEvent(new CustomEvent(M, { detail: e })));
164
+ function z(e) {
165
+ typeof window > "u" || (localStorage.setItem(S, e), window.dispatchEvent(new CustomEvent(k, { detail: e })));
169
166
  }
170
- function Ae() {
167
+ function qe() {
171
168
  const t = U() === "dark" ? "light" : "dark";
172
- return N(t), t;
169
+ return z(t), t;
173
170
  }
174
- function Le(e) {
171
+ function Ke(e) {
175
172
  if (typeof window > "u") return () => {
176
173
  };
177
174
  const t = (s) => {
178
- const o = s.detail;
179
- (o === "dark" || o === "light") && e(o);
175
+ const i = s.detail;
176
+ (i === "dark" || i === "light") && e(i);
180
177
  }, r = (s) => {
181
- if (s.key === v) {
182
- const o = s.newValue;
183
- e(o === "dark" || o === "light" ? o : U());
178
+ if (s.key === S) {
179
+ const i = s.newValue;
180
+ e(i === "dark" || i === "light" ? i : U());
184
181
  }
185
- }, n = window.matchMedia("(prefers-color-scheme: dark)"), i = (s) => {
186
- localStorage.getItem(v) || e(s.matches ? "dark" : "light");
182
+ }, n = window.matchMedia("(prefers-color-scheme: dark)"), o = (s) => {
183
+ localStorage.getItem(S) || e(s.matches ? "dark" : "light");
187
184
  };
188
- return window.addEventListener(M, t), window.addEventListener("storage", r), n.addEventListener("change", i), () => {
189
- window.removeEventListener(M, t), window.removeEventListener("storage", r), n.removeEventListener("change", i);
185
+ return window.addEventListener(k, t), window.addEventListener("storage", r), n.addEventListener("change", o), () => {
186
+ window.removeEventListener(k, t), window.removeEventListener("storage", r), n.removeEventListener("change", o);
190
187
  };
191
188
  }
192
- const y = {
189
+ const m = {
193
190
  color: "#34d399",
194
191
  fillOpacityTop: 0.25,
195
192
  fillOpacityBottom: 0.02,
@@ -198,77 +195,94 @@ const y = {
198
195
  height: 32,
199
196
  padding: 2
200
197
  };
201
- function K(e) {
202
- return { ...y, ...e };
198
+ function j(e) {
199
+ return { ...m, ...e };
203
200
  }
204
- function Re(e, t = y.width, r = y.height, n = y.padding) {
201
+ function ze(e, t = m.width, r = m.height, n = m.padding) {
205
202
  if (e.length < 2) return null;
206
- const i = t - n * 2, s = r - n * 2, o = Math.min(...e), a = Math.max(...e) - o || 1;
207
- return e.map((m, d) => {
208
- const f = n + d / (e.length - 1) * i, p = n + s - (m - o) / a * s;
209
- return `${f.toFixed(1)},${p.toFixed(1)}`;
203
+ const o = t - n * 2, s = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1;
204
+ return e.map((p, h) => {
205
+ const d = n + h / (e.length - 1) * o, f = n + s - (p - i) / c * s;
206
+ return `${d.toFixed(1)},${f.toFixed(1)}`;
210
207
  }).join(" ");
211
208
  }
212
- function Ue(e, t = y.width, r = y.height, n = y.padding) {
209
+ function je(e, t = m.width, r = m.height, n = m.padding) {
213
210
  if (e.length < 2) return null;
214
- const i = t - n * 2, s = r - n * 2, o = Math.min(...e), a = Math.max(...e) - o || 1, h = e.map((p, x) => {
215
- const u = n + x / (e.length - 1) * i, E = n + s - (p - o) / a * s;
211
+ const o = t - n * 2, s = r - n * 2, i = Math.min(...e), c = Math.max(...e) - i || 1, l = e.map((f, y) => {
212
+ const u = n + y / (e.length - 1) * o, E = n + s - (f - i) / c * s;
216
213
  return `${u.toFixed(1)},${E.toFixed(1)}`;
217
- }), m = (n + i).toFixed(1), d = (n + s).toFixed(1), f = n.toFixed(1);
218
- return `M${h[0]} ` + h.slice(1).map((p) => `L${p}`).join(" ") + ` L${m},${d} L${f},${d} Z`;
214
+ }), p = (n + o).toFixed(1), h = (n + s).toFixed(1), d = n.toFixed(1);
215
+ return `M${l[0]} ` + l.slice(1).map((f) => `L${f}`).join(" ") + ` L${p},${h} L${d},${h} Z`;
219
216
  }
220
- let z = 0;
217
+ let V = 0;
221
218
  function W() {
222
- return `ss-grad-${z++}`;
219
+ return `ss-grad-${V++}`;
223
220
  }
224
- function V(e) {
221
+ function G(e) {
225
222
  if (e.length === 0) return null;
226
223
  let t = e[0], r = e[0], n = e[0];
227
- for (let i = 1; i < e.length; i++) {
228
- const s = e[i];
224
+ for (let o = 1; o < e.length; o++) {
225
+ const s = e[o];
229
226
  s < t && (t = s), s > r && (r = s), n += s;
230
227
  }
231
228
  return { min: t, max: r, avg: n / e.length };
232
229
  }
233
- function De(e, t) {
230
+ function Ve(e, t) {
234
231
  if (e.length < 2) return null;
235
- const r = K(t), n = V(e), i = n.max - n.min || 1, s = r.width - r.padding * 2, o = r.height - r.padding * 2, l = r.padding, a = e.length, h = Array.from({ length: a });
236
- for (let u = 0; u < a; u++) {
237
- const E = l + u / (a - 1) * s, O = l + o - (e[u] - n.min) / i * o;
238
- h[u] = `${E.toFixed(1)},${O.toFixed(1)}`;
232
+ const r = j(t), n = G(e), o = n.max - n.min || 1, s = 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 E = a + u / (c - 1) * s, _ = a + i - (e[u] - n.min) / o * i;
235
+ l[u] = `${E.toFixed(1)},${_.toFixed(1)}`;
239
236
  }
240
- const m = h.join(" "), d = (l + s).toFixed(1), f = (l + o).toFixed(1), p = l.toFixed(1), x = `M${h[0]} ` + h.slice(1).map((u) => `L${u}`).join(" ") + ` L${d},${f} L${p},${f} Z`;
237
+ const p = l.join(" "), h = (a + s).toFixed(1), d = (a + i).toFixed(1), f = a.toFixed(1), y = `M${l[0]} ` + l.slice(1).map((u) => `L${u}`).join(" ") + ` L${h},${d} L${f},${d} Z`;
241
238
  return {
242
- points: m,
243
- areaPath: x,
239
+ points: p,
240
+ areaPath: y,
244
241
  gradientId: W(),
245
242
  options: r,
246
243
  stats: n
247
244
  };
248
245
  }
249
- const j = 5e3, G = 1e4, J = 3e3, Q = 100, X = 500;
250
- function Y(e) {
246
+ const Q = 5e3, J = 1e4, Y = 3e3, X = 100, Z = 500, ee = 60, te = 1e4;
247
+ function re(e) {
248
+ return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
249
+ }
250
+ function ne(e, t, r) {
251
+ if (e.length === 0) return "[]";
252
+ const n = e.slice(0, 3).map((i) => r(i, 30)), o = e.length > 3 ? ", ..." + e.length + " items" : "", s = "[" + n.join(", ") + o + "]";
253
+ return s.length > t ? "[" + e.length + " items]" : s;
254
+ }
255
+ function se(e, t, r) {
256
+ const n = Object.keys(e);
257
+ if (n.length === 0) return "{}";
258
+ const o = [];
259
+ for (let c = 0; c < Math.min(n.length, 4); c++)
260
+ o.push(n[c] + ": " + r(e[n[c]], 30));
261
+ const s = n.length > 4 ? ", ...+" + (n.length - 4) : "", i = "{ " + o.join(", ") + s + " }";
262
+ return i.length <= t ? i : "{ " + (n.slice(0, 6).join(", ") + (n.length > 6 ? ", ..." : "")) + " }";
263
+ }
264
+ function oe(e) {
251
265
  if (!e && e !== 0) return "-";
252
- const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), i = Math.floor(t % 3600 / 60);
253
- return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${i}m` : i > 0 ? `${i}m ${t % 60}s` : `${t}s`;
266
+ const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), o = Math.floor(t % 3600 / 60);
267
+ return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${o}m` : o > 0 ? `${o}m ${t % 60}s` : `${t}s`;
254
268
  }
255
- function P(e) {
269
+ function M(e) {
256
270
  const t = e / 1048576;
257
271
  return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(0)}M`;
258
272
  }
259
- function $(e) {
273
+ function A(e) {
260
274
  return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(1)}M`;
261
275
  }
262
- function Z(e) {
276
+ function ie(e) {
263
277
  return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : `${e}`;
264
278
  }
265
- function Fe(e) {
279
+ function We(e) {
266
280
  return e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : e >= 1 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`;
267
281
  }
268
282
  function D(e) {
269
283
  return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(e) ? e : e + "Z";
270
284
  }
271
- function Ie(e) {
285
+ function Ge(e) {
272
286
  if (!e) return "-";
273
287
  const t = typeof e == "string" ? new Date(D(e)) : new Date(e);
274
288
  return Number.isNaN(t.getTime()) ? "-" : t.toLocaleTimeString("en-US", {
@@ -278,12 +292,12 @@ function Ie(e) {
278
292
  second: "2-digit"
279
293
  }) + "." + String(t.getMilliseconds()).padStart(3, "0");
280
294
  }
281
- function Oe(e) {
295
+ function Qe(e) {
282
296
  if (!e) return "-";
283
297
  const t = typeof e == "string" ? new Date(D(e)).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
284
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`;
285
299
  }
286
- function _e(e, t) {
300
+ function Je(e, t) {
287
301
  switch (t) {
288
302
  case "%":
289
303
  return `${e.toFixed(1)}%`;
@@ -292,7 +306,7 @@ function _e(e, t) {
292
306
  case "MB":
293
307
  return `${e.toFixed(1)}M`;
294
308
  case "bytes":
295
- return P(e);
309
+ return M(e);
296
310
  case "/s":
297
311
  case "/m":
298
312
  return e.toFixed(1);
@@ -300,90 +314,75 @@ function _e(e, t) {
300
314
  return e.toFixed(1);
301
315
  }
302
316
  }
303
- function S(e, t, r) {
317
+ function x(e, t, r) {
304
318
  return e > r ? "red" : e > t ? "amber" : "green";
305
319
  }
306
- function ee(e, t, r) {
320
+ function ae(e, t, r) {
307
321
  return e < r ? "red" : e < t ? "amber" : "green";
308
322
  }
309
- function A(e, t) {
323
+ function R(e, t) {
310
324
  if (t === 0) return "green";
311
325
  const r = e / t;
312
326
  return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
313
327
  }
314
- const te = {
328
+ const ce = {
315
329
  green: "ss-green",
316
330
  amber: "ss-amber",
317
331
  red: "ss-red"
318
- }, Be = {
332
+ }, Ye = {
319
333
  green: "#34d399",
320
334
  amber: "#fbbf24",
321
335
  red: "#f87171"
322
- }, He = {
336
+ }, Xe = {
323
337
  green: "--ss-accent",
324
338
  amber: "--ss-amber-fg",
325
339
  red: "--ss-red-fg"
326
340
  };
327
- function qe(e) {
341
+ function Ze(e) {
328
342
  return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
329
343
  }
330
- function Ne(e) {
331
- return e > X ? "very-slow" : e > Q ? "slow" : "normal";
344
+ function le(e) {
345
+ return e > Z ? "very-slow" : e > X ? "slow" : "normal";
332
346
  }
333
- function Ke(e) {
347
+ function et(e, t = "ss-dash") {
348
+ const r = le(e);
349
+ return r === "very-slow" ? `${t}-very-slow` : r === "slow" ? `${t}-slow` : "";
350
+ }
351
+ function tt(e) {
334
352
  return e ? e.length <= 8 ? e : e.slice(0, 8) + "…" : "--";
335
353
  }
336
354
  function L(e, t = 100) {
337
- if (e === null) return "null";
338
- if (e === void 0) return "-";
339
- if (typeof e == "string")
340
- return '"' + (e.length > 40 ? e.slice(0, 40) + "..." : e) + '"';
341
- if (typeof e == "number" || typeof e == "boolean") return String(e);
342
- if (Array.isArray(e)) {
343
- if (e.length === 0) return "[]";
344
- const n = "[" + e.slice(0, 3).map((i) => L(i, 30)).join(", ") + (e.length > 3 ? ", ..." + e.length + " items" : "") + "]";
345
- return n.length > t ? "[" + e.length + " items]" : n;
346
- }
347
- if (typeof e == "object") {
348
- const r = Object.keys(e);
349
- if (r.length === 0) return "{}";
350
- const n = [];
351
- for (let s = 0; s < Math.min(r.length, 4); s++)
352
- n.push(r[s] + ": " + L(e[r[s]], 30));
353
- const i = "{ " + n.join(", ") + (r.length > 4 ? ", ...+" + (r.length - 4) : "") + " }";
354
- return i.length > t ? "{ " + r.slice(0, 6).join(", ") + (r.length > 6 ? ", ..." : "") + " }" : i;
355
- }
356
- return String(e);
357
- }
358
- function ze(e) {
355
+ return e === null ? "null" : e === void 0 ? "-" : typeof e == "string" ? re(e) : typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? ne(e, t, L) : typeof e == "object" ? se(e, t, L) : String(e);
356
+ }
357
+ function rt(e) {
359
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`;
360
359
  }
361
- function We(e) {
360
+ function nt(e) {
362
361
  return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / (1024 * 1024)).toFixed(1)}MB`;
363
362
  }
364
- const F = 50;
365
- function Ve(e, t, r) {
363
+ const O = 50;
364
+ function st(e, t, r) {
366
365
  const n = new URLSearchParams();
367
366
  if (n.set("page", String(e.page)), n.set("perPage", String(e.perPage)), t) {
368
367
  t.search && n.set("search", t.search);
369
- for (const [i, s] of Object.entries(t.filters))
370
- s && n.set(i, s);
368
+ for (const [o, s] of Object.entries(t.filters))
369
+ s && n.set(o, s);
371
370
  }
372
371
  return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
373
372
  }
374
- function je(e, t = F) {
375
- const r = e.data ?? e.items ?? [], n = e.total ?? 0, i = e.page ?? 1, s = e.perPage ?? e.limit ?? t, o = e.totalPages ?? (Math.ceil(n / s) || 1);
373
+ function ot(e, t = O) {
374
+ const r = e.data ?? e.items ?? [], n = e.total ?? 0, o = e.page ?? 1, s = e.perPage ?? e.limit ?? t, i = e.totalPages ?? (Math.ceil(n / s) || 1);
376
375
  return {
377
376
  data: r,
378
377
  pagination: {
379
- page: i,
378
+ page: o,
380
379
  perPage: s,
381
380
  total: n,
382
- totalPages: o
381
+ totalPages: i
383
382
  }
384
383
  };
385
384
  }
386
- function Ge(e = F) {
385
+ function it(e = O) {
387
386
  return {
388
387
  page: 1,
389
388
  perPage: e,
@@ -391,44 +390,97 @@ function Ge(e = F) {
391
390
  totalPages: 1
392
391
  };
393
392
  }
394
- function Je() {
393
+ function at() {
395
394
  return {
396
395
  search: "",
397
396
  filters: {}
398
397
  };
399
398
  }
400
- function Qe(e = "id", t = "desc") {
399
+ function ct(e = "id", t = "desc") {
401
400
  return { field: e, direction: t };
402
401
  }
403
- function re(e) {
404
- const t = new URLSearchParams();
405
- if (e.page !== null && e.page !== void 0 && t.set("page", String(e.page)), e.perPage !== null && e.perPage !== void 0 && t.set("perPage", String(e.perPage)), e.search && t.set("search", e.search), e.sort && t.set("sort", e.sort), e.sortDir && t.set("direction", e.sortDir), e.timeRange && t.set("range", e.timeRange), e.filters)
406
- for (const [r, n] of Object.entries(e.filters))
407
- n && t.set(r, n);
402
+ const ue = [
403
+ { key: "page", param: "page", isNumeric: !0 },
404
+ { key: "perPage", param: "perPage", isNumeric: !0 },
405
+ { key: "search", param: "search" },
406
+ { key: "sort", param: "sort" },
407
+ { key: "sortDir", param: "direction" },
408
+ { key: "timeRange", param: "range" }
409
+ ];
410
+ function he(e) {
411
+ const t = new URLSearchParams(), r = e;
412
+ for (const { key: n, param: o, isNumeric: s } of ue) {
413
+ const i = r[n];
414
+ (s ? i != null : i) && t.set(o, String(i));
415
+ }
416
+ if (e.filters)
417
+ for (const [n, o] of Object.entries(e.filters))
418
+ o && t.set(n, o);
408
419
  return t.toString();
409
420
  }
410
- function Xe(e) {
411
- 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, i = Math.min(r * e.perPage, e.total);
421
+ function lt(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, o = Math.min(r * e.perPage, e.total);
412
423
  return {
413
424
  page: r,
414
425
  perPage: e.perPage,
415
426
  total: e.total,
416
427
  lastPage: t,
417
428
  from: n,
418
- to: i,
429
+ to: o,
419
430
  hasPrev: r > 1,
420
431
  hasNext: r < t
421
432
  };
422
433
  }
423
- function Ye(e, t, r = 2) {
434
+ function ut(e, t, r = 2) {
424
435
  if (t <= 1) return [1];
425
- const n = [], i = Math.max(2, e - r), s = Math.min(t - 1, e + r);
426
- n.push(1), i > 2 && n.push("...");
427
- for (let o = i; o <= s; o++)
428
- n.push(o);
436
+ const n = [], o = Math.max(2, e - r), s = Math.min(t - 1, e + r);
437
+ n.push(1), o > 2 && n.push("...");
438
+ for (let i = o; i <= s; i++)
439
+ n.push(i);
429
440
  return s < t - 1 && n.push("..."), t > 1 && n.push(t), n;
430
441
  }
431
- const I = "/admin/api/debug", ne = {
442
+ const de = [
443
+ "tracing",
444
+ "process",
445
+ "system",
446
+ "http",
447
+ "db",
448
+ "redis",
449
+ "queues",
450
+ "cache",
451
+ "app",
452
+ "log",
453
+ "emails",
454
+ "dashboard"
455
+ ], fe = [
456
+ { flag: "process", group: "process" },
457
+ { flag: "process", group: "memory" },
458
+ { flag: "system", group: "memory" },
459
+ { flag: "http", group: "http" },
460
+ { flag: "db", group: "db" },
461
+ { flag: "redis", group: "redis" },
462
+ { flag: "queues", group: "queue" },
463
+ { flag: "app", group: "app" },
464
+ { flag: "log", group: "log" }
465
+ ], pe = [
466
+ { group: "process", fields: ["cpuPercent", "uptime", "nodeVersion"] },
467
+ {
468
+ group: "memory",
469
+ fields: ["memHeapUsed", "memRss", "systemMemoryTotalMb", "systemMemoryFreeMb"]
470
+ },
471
+ {
472
+ group: "http",
473
+ fields: ["requestsPerSecond", "avgResponseTimeMs", "errorRate", "activeHttpConnections"]
474
+ },
475
+ { group: "db", fields: ["dbPoolMax", "dbPoolUsed", "dbPoolFree", "dbPoolPending"] },
476
+ { group: "queue", fields: ["queueActive", "queueWaiting", "queueWorkerCount"] },
477
+ { group: "app", fields: ["onlineUsers", "pendingWebhooks", "pendingEmails"] },
478
+ { group: "log", fields: ["logErrorsLast5m", "logEntriesPerMinute"] }
479
+ ];
480
+ function T(e) {
481
+ return typeof e == "number" && !Number.isNaN(e);
482
+ }
483
+ const I = "/admin/api/debug", ge = {
432
484
  tracing: !1,
433
485
  process: !1,
434
486
  system: !1,
@@ -443,54 +495,45 @@ const I = "/admin/api/debug", ne = {
443
495
  dashboard: !1,
444
496
  customPanes: []
445
497
  };
446
- function se(e) {
447
- return {
448
- tracing: e.features?.tracing ?? !1,
449
- process: e.features?.process ?? !1,
450
- system: e.features?.system ?? !1,
451
- http: e.features?.http ?? !1,
452
- db: e.features?.db ?? !1,
453
- redis: e.features?.redis ?? !1,
454
- queues: e.features?.queues ?? !1,
455
- cache: e.features?.cache ?? !1,
456
- app: e.features?.app ?? !1,
457
- log: e.features?.log ?? !1,
458
- emails: e.features?.emails ?? !1,
459
- dashboard: e.features?.dashboard ?? !1,
460
- customPanes: e.customPanes ?? []
461
- };
498
+ function me(e) {
499
+ const t = { customPanes: e.customPanes ?? [] }, r = e.features;
500
+ for (const n of de)
501
+ t[n] = r?.[n] ?? !1;
502
+ return t;
462
503
  }
463
- async function ie(e, t = I) {
504
+ async function ye(e, t = I) {
464
505
  const r = `${t.replace(/\/+$/, "")}/config`;
465
506
  return e.fetch(r);
466
507
  }
467
- async function Ze(e) {
468
- const { baseUrl: t = "", debugEndpoint: r = I, authToken: n } = e, i = new T({ baseUrl: t, authToken: n });
508
+ async function ht(e) {
509
+ const { baseUrl: t = "", debugEndpoint: r = I, authToken: n } = e, o = new v({ baseUrl: t, authToken: n });
469
510
  try {
470
- const s = await ie(i, r);
471
- return se(s);
511
+ const s = await ye(o, r);
512
+ return me(s);
472
513
  } catch {
473
- return ne;
514
+ return ge;
474
515
  }
475
516
  }
476
- function et(e) {
477
- const t = /* @__PURE__ */ new Set(), r = "features" in e && typeof e.features == "object" && e.features !== null ? e.features : e;
478
- return "process" in r && r.process && t.add("process"), ("process" in r && r.process || "system" in r && r.system) && t.add("memory"), "http" in r && r.http && t.add("http"), "db" in r && r.db && t.add("db"), "redis" in r && r.redis && t.add("redis"), "queues" in r && r.queues && t.add("queue"), "app" in r && r.app && t.add("app"), "log" in r && r.log && t.add("log"), t;
517
+ function dt(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: o, group: s } of fe)
520
+ n[o] && t.add(s);
521
+ return t;
479
522
  }
480
- function tt(e) {
523
+ function ft(e) {
481
524
  const t = /* @__PURE__ */ new Set();
482
- return (c(e.cpuPercent) || c(e.uptime) || oe(e.nodeVersion)) && t.add("process"), (c(e.memHeapUsed) || c(e.memRss)) && t.add("memory"), (c(e.systemMemoryTotalMb) || c(e.systemMemoryFreeMb)) && t.add("memory"), (c(e.requestsPerSecond) || c(e.avgResponseTimeMs) || c(e.errorRate) || c(e.activeHttpConnections)) && t.add("http"), (c(e.dbPoolMax) || c(e.dbPoolUsed) || c(e.dbPoolFree) || c(e.dbPoolPending)) && t.add("db"), e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), (c(e.queueActive) || c(e.queueWaiting) || c(e.queueWorkerCount)) && t.add("queue"), (c(e.onlineUsers) || c(e.pendingWebhooks) || c(e.pendingEmails)) && t.add("app"), (c(e.logErrorsLast5m) || c(e.logEntriesPerMinute)) && t.add("log"), t;
525
+ (T(e.cpuPercent) || T(e.uptime) || be(e)) && t.add("process");
526
+ for (const r of pe)
527
+ r.fields.some((n) => T(e[n])) && t.add(r.group);
528
+ return e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), t;
483
529
  }
484
- function c(e) {
485
- return typeof e == "number" && !Number.isNaN(e);
486
- }
487
- function oe(e) {
488
- return typeof e == "string" && e.length > 0;
530
+ function be(e) {
531
+ return typeof e.nodeVersion == "string" && e.nodeVersion.length > 0;
489
532
  }
490
533
  function g(e) {
491
- return te[e] || "";
534
+ return ce[e] || "";
492
535
  }
493
- const k = [
536
+ const P = [
494
537
  // ── Process group ─────────────────────────────────────────────────────────
495
538
  // -- Node version ---------------------------------------------------------
496
539
  {
@@ -511,7 +554,7 @@ const k = [
511
554
  unit: "",
512
555
  group: "process",
513
556
  extract: (e) => e.uptime,
514
- format: (e) => Y(e.uptime),
557
+ format: (e) => oe(e.uptime),
515
558
  color: () => ""
516
559
  },
517
560
  // -- CPU ------------------------------------------------------------------
@@ -525,7 +568,7 @@ const k = [
525
568
  critThreshold: 80,
526
569
  extract: (e) => e.cpuPercent,
527
570
  format: (e) => `${e.cpuPercent.toFixed(1)}%`,
528
- color: (e) => g(S(e.cpuPercent, 50, 80)),
571
+ color: (e) => g(x(e.cpuPercent, 50, 80)),
529
572
  historyKey: "cpuPercent"
530
573
  },
531
574
  // -- Event loop -----------------------------------------------------------
@@ -539,7 +582,7 @@ const k = [
539
582
  critThreshold: 50,
540
583
  extract: (e) => e.eventLoopLag,
541
584
  format: (e) => `${e.eventLoopLag.toFixed(1)}ms`,
542
- color: (e) => g(S(e.eventLoopLag, 20, 50)),
585
+ color: (e) => g(x(e.eventLoopLag, 20, 50)),
543
586
  historyKey: "eventLoopLag"
544
587
  },
545
588
  // ── Memory group ──────────────────────────────────────────────────────────
@@ -551,7 +594,7 @@ const k = [
551
594
  unit: "bytes",
552
595
  group: "memory",
553
596
  extract: (e) => e.memHeapUsed,
554
- format: (e) => P(e.memHeapUsed),
597
+ format: (e) => M(e.memHeapUsed),
555
598
  color: () => "",
556
599
  historyKey: "memHeapUsed"
557
600
  },
@@ -563,7 +606,7 @@ const k = [
563
606
  unit: "bytes",
564
607
  group: "memory",
565
608
  extract: (e) => e.memRss,
566
- format: (e) => P(e.memRss),
609
+ format: (e) => M(e.memRss),
567
610
  color: () => "",
568
611
  historyKey: "memRss"
569
612
  },
@@ -575,12 +618,12 @@ const k = [
575
618
  unit: "MB",
576
619
  group: "memory",
577
620
  extract: (e) => e.systemMemoryTotalMb - e.systemMemoryFreeMb,
578
- format: (e) => `${$(e.systemMemoryTotalMb - e.systemMemoryFreeMb)}/${$(e.systemMemoryTotalMb)}`,
621
+ format: (e) => `${A(e.systemMemoryTotalMb - e.systemMemoryFreeMb)}/${A(e.systemMemoryTotalMb)}`,
579
622
  color: (e) => {
580
623
  const t = e.systemMemoryTotalMb;
581
624
  if (t === 0) return "";
582
625
  const r = t - e.systemMemoryFreeMb;
583
- return g(A(r, t));
626
+ return g(R(r, t));
584
627
  },
585
628
  historyKey: "_sysMemUsed",
586
629
  show: (e) => e.systemMemoryTotalMb !== null && e.systemMemoryTotalMb !== void 0
@@ -609,7 +652,7 @@ const k = [
609
652
  critThreshold: 500,
610
653
  extract: (e) => e.avgResponseTimeMs,
611
654
  format: (e) => `${e.avgResponseTimeMs.toFixed(0)}ms`,
612
- color: (e) => g(S(e.avgResponseTimeMs, 200, 500)),
655
+ color: (e) => g(x(e.avgResponseTimeMs, 200, 500)),
613
656
  historyKey: "avgResponseTimeMs"
614
657
  },
615
658
  // -- Error rate -----------------------------------------------------------
@@ -623,7 +666,7 @@ const k = [
623
666
  critThreshold: 5,
624
667
  extract: (e) => e.errorRate,
625
668
  format: (e) => `${e.errorRate.toFixed(1)}%`,
626
- color: (e) => g(S(e.errorRate, 1, 5)),
669
+ color: (e) => g(x(e.errorRate, 1, 5)),
627
670
  historyKey: "errorRate"
628
671
  },
629
672
  // -- Active connections ---------------------------------------------------
@@ -648,7 +691,7 @@ const k = [
648
691
  group: "db",
649
692
  extract: (e) => e.dbPoolUsed,
650
693
  format: (e) => `${e.dbPoolUsed}/${e.dbPoolFree}/${e.dbPoolMax}`,
651
- color: (e) => g(A(e.dbPoolUsed, e.dbPoolMax)),
694
+ color: (e) => g(R(e.dbPoolUsed, e.dbPoolMax)),
652
695
  historyKey: "dbPoolUsed"
653
696
  },
654
697
  // ── Redis group ───────────────────────────────────────────────────────────
@@ -684,7 +727,7 @@ const k = [
684
727
  unit: "",
685
728
  group: "redis",
686
729
  extract: (e) => e.redisKeysCount,
687
- format: (e) => Z(e.redisKeysCount),
730
+ format: (e) => ie(e.redisKeysCount),
688
731
  color: () => "",
689
732
  historyKey: "redisKeysCount",
690
733
  show: (e) => e.redisOk
@@ -701,7 +744,7 @@ const k = [
701
744
  inverseThreshold: !0,
702
745
  extract: (e) => e.redisHitRate,
703
746
  format: (e) => `${e.redisHitRate.toFixed(0)}%`,
704
- color: (e) => g(ee(e.redisHitRate, 90, 70)),
747
+ color: (e) => g(ae(e.redisHitRate, 90, 70)),
705
748
  historyKey: "redisHitRate",
706
749
  show: (e) => e.redisOk
707
750
  },
@@ -792,18 +835,18 @@ const k = [
792
835
  historyKey: "logEntriesPerMinute"
793
836
  }
794
837
  ];
795
- function rt(e) {
796
- return k.find((t) => t.id === e);
838
+ function pt(e) {
839
+ return P.find((t) => t.id === e);
797
840
  }
798
- function nt() {
841
+ function gt() {
799
842
  const e = /* @__PURE__ */ new Map();
800
- for (const t of k) {
843
+ for (const t of P) {
801
844
  const r = t.group || "core";
802
845
  e.has(r) || e.set(r, []), e.get(r).push(t);
803
846
  }
804
847
  return e;
805
848
  }
806
- const ae = 60, le = 1e4, ce = {
849
+ const xe = {
807
850
  queries: "/queries",
808
851
  events: "/events",
809
852
  emails: "/emails",
@@ -815,10 +858,10 @@ const ae = 60, le = 1e4, ce = {
815
858
  config: "/config",
816
859
  internals: "/diagnostics"
817
860
  };
818
- function he(e) {
819
- return ce[e] || `/${e}`;
861
+ function Se(e) {
862
+ return xe[e] || `/${e}`;
820
863
  }
821
- const ue = {
864
+ const we = {
822
865
  overview: "/overview",
823
866
  requests: "/requests",
824
867
  queries: "/queries",
@@ -831,45 +874,45 @@ const ue = {
831
874
  jobs: "/jobs",
832
875
  config: "/config"
833
876
  };
834
- function de(e) {
835
- return ue[e] || `/${e}`;
877
+ function ve(e) {
878
+ return we[e] || `/${e}`;
836
879
  }
837
- function fe(e = ae) {
880
+ function Ee(e = ee) {
838
881
  const t = {}, r = {};
839
882
  let n = !1;
840
- function i(s) {
883
+ function o(s) {
841
884
  if (s.count === 0) return [];
842
- const o = Array.from({ length: s.count }), l = s.count < e ? 0 : s.head;
843
- for (let a = 0; a < s.count; a++)
844
- o[a] = s.data[(l + a) % e];
845
- return o;
885
+ const i = Array.from({ length: s.count }), a = s.count < e ? 0 : s.head;
886
+ for (let c = 0; c < s.count; c++)
887
+ i[c] = s.data[(a + c) % e];
888
+ return i;
846
889
  }
847
890
  return {
848
891
  push(s) {
849
892
  n = !1;
850
- for (const o of k) {
851
- const l = o.historyKey;
852
- if (!l) continue;
853
- const a = o.extract(s);
854
- if (typeof a != "number") continue;
855
- t[l] || (t[l] = { data: Array.from({ length: e }), head: 0, count: 0 });
856
- const h = t[l];
857
- h.data[h.head] = a, h.head = (h.head + 1) % e, h.count < e && h.count++;
893
+ for (const i of P) {
894
+ const a = i.historyKey;
895
+ if (!a) continue;
896
+ const c = i.extract(s);
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++;
858
901
  }
859
902
  },
860
903
  get(s) {
861
- const o = t[s];
862
- return o ? i(o) : [];
904
+ const i = t[s];
905
+ return i ? o(i) : [];
863
906
  },
864
907
  getAll() {
865
908
  if (n) return r;
866
909
  for (const s of Object.keys(t))
867
- r[s] = i(t[s]);
910
+ r[s] = o(t[s]);
868
911
  return n = !0, r;
869
912
  }
870
913
  };
871
914
  }
872
- class st {
915
+ class mt {
873
916
  // -- Configuration --------------------------------------------------------
874
917
  baseUrl;
875
918
  endpoint;
@@ -898,7 +941,7 @@ class st {
898
941
  isConnected = !1;
899
942
  isStale = !1;
900
943
  constructor(t = {}) {
901
- 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 = fe();
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 = Ee();
902
945
  }
903
946
  // -- Public API -----------------------------------------------------------
904
947
  /**
@@ -909,42 +952,8 @@ class st {
909
952
  start() {
910
953
  if (this.unauthorized) return;
911
954
  this.stopped = !1;
912
- let t = !1;
913
- try {
914
- const r = q({
915
- baseUrl: this.baseUrl,
916
- channelName: this.channelName,
917
- authToken: this.authToken,
918
- onMessage: (n) => {
919
- n && typeof n == "object" && "timestamp" in n && this.processStats(n);
920
- },
921
- onConnect: () => {
922
- this.setSseActive(!0), this.setConnected(!0), this.stopPolling();
923
- },
924
- onDisconnect: () => {
925
- this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
926
- },
927
- onError: () => {
928
- t = !0;
929
- }
930
- });
931
- this.sseHandle = r;
932
- } catch {
933
- t = !0;
934
- }
935
- if (this.poll(), t || !this.sseHandle)
936
- this.startPollInterval();
937
- else {
938
- const r = setTimeout(() => {
939
- !this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
940
- }, 3e3), n = this.sseHandle?.unsubscribe;
941
- this.sseHandle && (this.sseHandle.unsubscribe = () => {
942
- clearTimeout(r), n?.();
943
- });
944
- }
945
- this.staleTimer = setInterval(() => {
946
- this.lastSuccess > 0 && Date.now() - this.lastSuccess > le && this.setStale(!0);
947
- }, 2e3);
955
+ const t = this.initSseSubscription();
956
+ this.poll(), t || !this.sseHandle ? this.startPollInterval() : this.setupSseFallbackTimer(), this.startStaleDetection();
948
957
  }
949
958
  /**
950
959
  * Stop all timers and subscriptions. Call on unmount.
@@ -971,6 +980,47 @@ class st {
971
980
  return this.unauthorized ? "disconnected" : this.sseActive ? "live" : this.pollTimer ? "polling" : "disconnected";
972
981
  }
973
982
  // -- Internal helpers -----------------------------------------------------
983
+ /** Initialize the SSE subscription. Returns true if SSE failed and polling should be used. */
984
+ initSseSubscription() {
985
+ let t = !1;
986
+ try {
987
+ this.sseHandle = K({
988
+ baseUrl: this.baseUrl,
989
+ channelName: this.channelName,
990
+ authToken: this.authToken,
991
+ onMessage: (r) => {
992
+ r && typeof r == "object" && "timestamp" in r && this.processStats(r);
993
+ },
994
+ onConnect: () => {
995
+ this.setSseActive(!0), this.setConnected(!0), this.stopPolling();
996
+ },
997
+ onDisconnect: () => {
998
+ this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
999
+ },
1000
+ onError: () => {
1001
+ t = !0;
1002
+ }
1003
+ });
1004
+ } catch {
1005
+ t = !0;
1006
+ }
1007
+ return t;
1008
+ }
1009
+ /** Set up a 3-second fallback timer to start polling if SSE hasn't connected. */
1010
+ setupSseFallbackTimer() {
1011
+ const t = setTimeout(() => {
1012
+ !this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
1013
+ }, 3e3), r = this.sseHandle?.unsubscribe;
1014
+ this.sseHandle && (this.sseHandle.unsubscribe = () => {
1015
+ clearTimeout(t), r?.();
1016
+ });
1017
+ }
1018
+ /** Start the stale detection interval. */
1019
+ startStaleDetection() {
1020
+ this.staleTimer = setInterval(() => {
1021
+ this.lastSuccess > 0 && Date.now() - this.lastSuccess > te && this.setStale(!0);
1022
+ }, 2e3);
1023
+ }
974
1024
  /** Process incoming stats data from either SSE or polling. */
975
1025
  processStats(t) {
976
1026
  this.onStatsUpdate?.(t), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(t), this.onHistoryChange?.(this.historyBuffer.getAll());
@@ -978,12 +1028,12 @@ class st {
978
1028
  /** Poll the HTTP endpoint once. */
979
1029
  async poll() {
980
1030
  if (!this.unauthorized) {
981
- this.client || (this.client = new T({ baseUrl: this.baseUrl, authToken: this.authToken }));
1031
+ this.client || (this.client = new v({ baseUrl: this.baseUrl, authToken: this.authToken }));
982
1032
  try {
983
1033
  const t = await this.client.get(this.endpoint);
984
1034
  this.processStats(t);
985
1035
  } catch (t) {
986
- t instanceof w && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(t), this.stopPolling());
1036
+ t instanceof b && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(t), this.stopPolling());
987
1037
  }
988
1038
  }
989
1039
  }
@@ -1008,7 +1058,7 @@ class st {
1008
1058
  this.isStale !== t && (this.isStale = t, this.onStaleChange?.(t));
1009
1059
  }
1010
1060
  }
1011
- class pe {
1061
+ class Te {
1012
1062
  constructor(t, r) {
1013
1063
  this.client = t, this.basePath = r;
1014
1064
  }
@@ -1020,7 +1070,7 @@ class pe {
1020
1070
  * @param init - Optional `RequestInit` overrides (e.g. `{ signal }`).
1021
1071
  */
1022
1072
  async fetchSection(t, r, n) {
1023
- const i = de(t), s = r ? `${this.basePath}${i}?${r}` : `${this.basePath}${i}`;
1073
+ const o = ve(t), s = r ? `${this.basePath}${o}?${r}` : `${this.basePath}${o}`;
1024
1074
  return this.client.fetch(s, n);
1025
1075
  }
1026
1076
  /**
@@ -1089,7 +1139,15 @@ class pe {
1089
1139
  return this.client.fetch(`${this.basePath}/emails/${t}/preview`);
1090
1140
  }
1091
1141
  }
1092
- class it {
1142
+ function Ce(e) {
1143
+ if (!e || typeof e != "object") return !1;
1144
+ const t = e;
1145
+ return t.data !== void 0 && t.meta !== void 0;
1146
+ }
1147
+ function ke(e, t) {
1148
+ return t.aborted ? !0 : e instanceof DOMException && e.name === "AbortError";
1149
+ }
1150
+ class yt {
1093
1151
  // -- Dependencies ---------------------------------------------------------
1094
1152
  client;
1095
1153
  api;
@@ -1118,7 +1176,7 @@ class it {
1118
1176
  /** AbortController for the current in-flight fetch. */
1119
1177
  abortController = null;
1120
1178
  constructor(t) {
1121
- this.client = new T({ 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;
1179
+ this.client = new v({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new Te(this.client, t.endpoint), this.endpoint = t.endpoint, this.section = t.section, this.perPage = t.perPage, this.callbacks = t.callbacks;
1122
1180
  }
1123
1181
  // -- Public API -----------------------------------------------------------
1124
1182
  /**
@@ -1141,40 +1199,15 @@ class it {
1141
1199
  * and loading state is not modified.
1142
1200
  */
1143
1201
  async fetch(t = !0) {
1144
- if (t && this.explicitFetchPending) return;
1145
- this.abortController?.abort();
1146
- const r = new AbortController();
1147
- this.abortController = r;
1148
- const n = ++this.fetchId, i = this.section;
1149
- if (!i) return;
1150
- const s = this.filters, o = this.sort ? this.sort.replace(/[A-Z]/g, (a) => "_" + a.toLowerCase()) : void 0, l = re({
1151
- page: this.page,
1152
- perPage: this.perPage,
1153
- search: this.search,
1154
- sort: o,
1155
- sortDir: this.sort ? this.sortDir : void 0,
1156
- filters: s && Object.keys(s).length > 0 ? s : void 0,
1157
- timeRange: i.startsWith("overview") ? this.timeRange : void 0
1158
- });
1159
- t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0);
1202
+ if (this.shouldSkipFetch(t)) return;
1203
+ const { controller: r, myFetchId: n } = this.prepareFetch(t);
1160
1204
  try {
1161
- const a = await this.api.fetchSection(i, l || void 0, {
1162
- signal: r.signal
1163
- });
1164
- if (n !== this.fetchId || this.stopped) return;
1165
- if (a && typeof a == "object" && a.data !== void 0 && a.meta !== void 0) {
1166
- const h = a;
1167
- this.callbacks.onData(h.data), this.callbacks.onPagination(h.meta);
1168
- } else
1169
- this.callbacks.onData(a), this.callbacks.onPagination(null);
1170
- this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
1171
- } catch (a) {
1172
- if (a instanceof DOMException && a.name === "AbortError" || r.signal.aborted || n !== this.fetchId || this.stopped) return;
1173
- if (a instanceof w) {
1174
- this.callbacks.onError(a), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
1175
- return;
1176
- }
1177
- t || (this.callbacks.onError(a instanceof Error ? a : new Error(String(a))), this.callbacks.onLoading(!1));
1205
+ const o = await this.executeFetch(r);
1206
+ if (this.isStaleResponse(n)) return;
1207
+ this.applyFetchResult(o);
1208
+ } catch (o) {
1209
+ if (this.shouldIgnoreError(o, r.signal, n)) return;
1210
+ this.handleFetchError(o, t);
1178
1211
  } finally {
1179
1212
  t || (this.explicitFetchPending = !1);
1180
1213
  }
@@ -1223,9 +1256,9 @@ class it {
1223
1256
  * then silently refresh the current data.
1224
1257
  */
1225
1258
  async mutate(t, r = "post", n) {
1226
- const i = `${this.endpoint}/${t}`;
1259
+ const o = `${this.endpoint}/${t}`;
1227
1260
  try {
1228
- const s = r === "post" ? await this.client.post(i, n) : await this.client.delete(i);
1261
+ const s = r === "post" ? await this.client.post(o, n) : await this.client.delete(o);
1229
1262
  return await this.fetch(!0), s;
1230
1263
  } catch (s) {
1231
1264
  throw s instanceof Error ? s : new Error(String(s));
@@ -1266,17 +1299,70 @@ class it {
1266
1299
  getClient() {
1267
1300
  return this.client;
1268
1301
  }
1302
+ // -- Fetch helpers (private) -----------------------------------------------
1303
+ /** Whether this fetch call should be skipped entirely. */
1304
+ shouldSkipFetch(t) {
1305
+ return t && this.explicitFetchPending ? !0 : !this.section;
1306
+ }
1307
+ /** Prepare abort controller, increment fetch ID, set loading state. */
1308
+ prepareFetch(t) {
1309
+ this.abortController?.abort();
1310
+ const r = new AbortController();
1311
+ this.abortController = r;
1312
+ const n = ++this.fetchId;
1313
+ return t || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0), { controller: r, myFetchId: n };
1314
+ }
1315
+ /** Execute the actual API fetch for the current section. */
1316
+ async executeFetch(t) {
1317
+ const r = this.buildCurrentQueryString();
1318
+ return this.api.fetchSection(this.section, r || void 0, {
1319
+ signal: t.signal
1320
+ });
1321
+ }
1322
+ /** Check if a response is stale (fetch ID mismatch or controller stopped). */
1323
+ isStaleResponse(t) {
1324
+ return t !== this.fetchId || this.stopped;
1325
+ }
1326
+ /** Check if an error should be silently ignored (abort or stale). */
1327
+ shouldIgnoreError(t, r, n) {
1328
+ return ke(t, r) ? !0 : this.isStaleResponse(n);
1329
+ }
1330
+ /** Build query string from current controller state. */
1331
+ buildCurrentQueryString() {
1332
+ const t = this.sort ? this.sort.replace(/[A-Z]/g, (n) => "_" + n.toLowerCase()) : void 0, r = this.filters;
1333
+ return he({
1334
+ page: this.page,
1335
+ perPage: this.perPage,
1336
+ search: this.search,
1337
+ sort: t,
1338
+ sortDir: this.sort ? this.sortDir : void 0,
1339
+ filters: r && Object.keys(r).length > 0 ? r : void 0,
1340
+ timeRange: this.section.startsWith("overview") ? this.timeRange : void 0
1341
+ });
1342
+ }
1343
+ /** Apply a successful fetch result to the callbacks. */
1344
+ applyFetchResult(t) {
1345
+ Ce(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;
1346
+ }
1347
+ /** Handle a fetch error (unauthorized, network, etc.). */
1348
+ handleFetchError(t, r) {
1349
+ if (t instanceof b) {
1350
+ this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
1351
+ return;
1352
+ }
1353
+ r || (this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1));
1354
+ }
1269
1355
  // -- Timer management (private) -------------------------------------------
1270
1356
  startRefreshTimer() {
1271
1357
  this.stopRefreshTimer();
1272
- const t = this.section === "overview" ? j : G;
1358
+ const t = this.section === "overview" ? Q : J;
1273
1359
  this.timer = setInterval(() => this.fetch(!0), t);
1274
1360
  }
1275
1361
  stopRefreshTimer() {
1276
1362
  this.timer && (clearInterval(this.timer), this.timer = null);
1277
1363
  }
1278
1364
  }
1279
- const ot = {
1365
+ const bt = {
1280
1366
  // ---------------------------------------------------------------------------
1281
1367
  // Debug-panel tabs / Dashboard sidebar sections (shared)
1282
1368
  // ---------------------------------------------------------------------------
@@ -1468,14 +1554,14 @@ const ot = {
1468
1554
  viewBox: "0 0 16 16",
1469
1555
  elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
1470
1556
  }
1471
- }, me = "ss-col-resize", R = "ss-resizing";
1472
- function at(e) {
1557
+ }, Me = "ss-col-resize", F = "ss-resizing";
1558
+ function xt(e) {
1473
1559
  const t = Array.from(e.querySelectorAll("thead th"));
1474
1560
  if (t.length === 0) return () => {
1475
1561
  };
1476
1562
  const r = [];
1477
1563
  let n = !1;
1478
- function i() {
1564
+ function o() {
1479
1565
  if (!n) {
1480
1566
  n = !0;
1481
1567
  for (const s of t)
@@ -1484,30 +1570,30 @@ function at(e) {
1484
1570
  }
1485
1571
  }
1486
1572
  for (const s of t) {
1487
- let o = function(a) {
1488
- a.preventDefault(), a.stopPropagation(), i();
1489
- const h = a.clientX, m = s.offsetWidth;
1490
- l.classList.add(R), l.setPointerCapture(a.pointerId);
1491
- function d(p) {
1492
- const x = p.clientX - h, u = Math.max(30, m + x);
1573
+ let i = function(c) {
1574
+ c.preventDefault(), c.stopPropagation(), o();
1575
+ const l = c.clientX, p = s.offsetWidth;
1576
+ a.classList.add(F), a.setPointerCapture(c.pointerId);
1577
+ function h(f) {
1578
+ const y = f.clientX - l, u = Math.max(30, p + y);
1493
1579
  s.style.width = u + "px";
1494
1580
  }
1495
- function f() {
1496
- l.classList.remove(R), l.removeEventListener("pointermove", d), l.removeEventListener("pointerup", f);
1581
+ function d() {
1582
+ a.classList.remove(F), a.removeEventListener("pointermove", h), a.removeEventListener("pointerup", d);
1497
1583
  }
1498
- l.addEventListener("pointermove", d), l.addEventListener("pointerup", f);
1584
+ a.addEventListener("pointermove", h), a.addEventListener("pointerup", d);
1499
1585
  };
1500
1586
  if (!s.textContent?.trim()) continue;
1501
- const l = document.createElement("div");
1502
- l.className = me, s.appendChild(l), l.addEventListener("pointerdown", o), r.push(() => {
1503
- l.removeEventListener("pointerdown", o), l.remove();
1587
+ const a = document.createElement("div");
1588
+ a.className = Me, s.appendChild(a), a.addEventListener("pointerdown", i), r.push(() => {
1589
+ a.removeEventListener("pointerdown", i), a.remove();
1504
1590
  });
1505
1591
  }
1506
1592
  return () => {
1507
1593
  for (const s of r) s();
1508
1594
  };
1509
1595
  }
1510
- class lt {
1596
+ class St {
1511
1597
  client;
1512
1598
  endpoint;
1513
1599
  refreshInterval;
@@ -1517,10 +1603,10 @@ class lt {
1517
1603
  fetchOnceCache = {};
1518
1604
  abortController = null;
1519
1605
  constructor(t) {
1520
- this.client = new T({
1606
+ this.client = new v({
1521
1607
  baseUrl: t.baseUrl,
1522
1608
  authToken: t.authToken
1523
- }), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? J, this.callbacks = {
1609
+ }), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? Y, this.callbacks = {
1524
1610
  onData: t.onData,
1525
1611
  onLoading: t.onLoading,
1526
1612
  onError: t.onError,
@@ -1574,7 +1660,7 @@ class lt {
1574
1660
  const n = await this.client.fetch(t);
1575
1661
  this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[t] = n);
1576
1662
  } catch (n) {
1577
- if (n instanceof w) {
1663
+ if (n instanceof b) {
1578
1664
  this.callbacks.onUnauthorized(n);
1579
1665
  return;
1580
1666
  }
@@ -1602,43 +1688,48 @@ class lt {
1602
1688
  // -------------------------------------------------------------------------
1603
1689
  async fetchData() {
1604
1690
  const t = this.currentTab;
1605
- if (!t) return;
1606
- if (this.fetchOnceCache[t] !== void 0) {
1607
- this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1);
1608
- return;
1609
- }
1691
+ if (!t || this.serveFromCache(t)) return;
1610
1692
  this.abortController?.abort();
1611
1693
  const r = new AbortController();
1612
1694
  this.abortController = r;
1613
1695
  try {
1614
- const n = `${this.endpoint}${he(t)}`, i = await this.client.fetch(n, { signal: r.signal });
1696
+ const n = `${this.endpoint}${Se(t)}`, o = await this.client.fetch(n, { signal: r.signal });
1615
1697
  if (r.signal.aborted) return;
1616
- this.callbacks.onData(i), this.callbacks.onError(null), this.callbacks.onLoading(!1);
1698
+ this.callbacks.onData(o), this.callbacks.onError(null), this.callbacks.onLoading(!1);
1617
1699
  } catch (n) {
1618
- if (n instanceof DOMException && n.name === "AbortError" || r.signal.aborted) return;
1619
- if (n instanceof w) {
1620
- this.callbacks.onError(n), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(n);
1700
+ this.handleFetchError(n, r);
1701
+ }
1702
+ }
1703
+ /** Serve cached data if available. Returns true if cache hit. */
1704
+ serveFromCache(t) {
1705
+ return this.fetchOnceCache[t] === void 0 ? !1 : (this.callbacks.onData(this.fetchOnceCache[t]), this.callbacks.onLoading(!1), !0);
1706
+ }
1707
+ /** Handle errors from fetchData. */
1708
+ handleFetchError(t, r) {
1709
+ if (!(t instanceof DOMException && t.name === "AbortError") && !r.signal.aborted) {
1710
+ if (t instanceof b) {
1711
+ this.callbacks.onError(t), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(t);
1621
1712
  return;
1622
1713
  }
1623
- this.callbacks.onError(n instanceof Error ? n : new Error(String(n))), this.callbacks.onLoading(!1);
1714
+ this.callbacks.onError(t instanceof Error ? t : new Error(String(t))), this.callbacks.onLoading(!1);
1624
1715
  }
1625
1716
  }
1626
1717
  }
1627
- const ct = ["all", "error", "warn", "info", "debug"];
1628
- function ge(e) {
1718
+ const wt = ["all", "error", "warn", "info", "debug"];
1719
+ function Pe(e) {
1629
1720
  return (e.levelName || e.level_name || (typeof e.level == "string" ? e.level : "") || "info").toLowerCase();
1630
1721
  }
1631
- function ht(e) {
1722
+ function vt(e) {
1632
1723
  return e.msg || e.message || JSON.stringify(e);
1633
1724
  }
1634
- function ut(e) {
1725
+ function Et(e) {
1635
1726
  return e.createdAt || e.created_at || e.time || e.timestamp || 0;
1636
1727
  }
1637
- function dt(e) {
1728
+ function Tt(e) {
1638
1729
  const t = e.data || {};
1639
1730
  return e.requestId || e.request_id || e["x-request-id"] || t.requestId || t.request_id || t["x-request-id"] || "";
1640
1731
  }
1641
- function ft(e, t = "ss-dbg-log-level") {
1732
+ function Ct(e, t = "ss-dbg-log-level") {
1642
1733
  switch (e) {
1643
1734
  case "error":
1644
1735
  case "fatal":
@@ -1655,30 +1746,30 @@ function ft(e, t = "ss-dbg-log-level") {
1655
1746
  return `${t}-info`;
1656
1747
  }
1657
1748
  }
1658
- function pt(e, t) {
1749
+ function kt(e, t) {
1659
1750
  return t === "all" ? e : e.filter((r) => {
1660
- const n = ge(r);
1751
+ const n = Pe(r);
1661
1752
  return t === "error" ? n === "error" || n === "fatal" : n === t;
1662
1753
  });
1663
1754
  }
1664
- function mt(e, t) {
1755
+ function Mt(e, t) {
1665
1756
  if (!t) return e;
1666
1757
  const r = t.toLowerCase();
1667
1758
  return e.filter(
1668
1759
  (n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
1669
1760
  );
1670
1761
  }
1671
- function gt(e) {
1762
+ function Pt(e) {
1672
1763
  const t = {};
1673
1764
  for (const r of e)
1674
1765
  t[r.sql] = (t[r.sql] || 0) + 1;
1675
1766
  return t;
1676
1767
  }
1677
- function yt(e, t) {
1678
- const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length, i = e.length > 0 ? e.reduce((s, o) => s + o.duration, 0) / e.length : 0;
1679
- return { slowCount: r, dupCount: n, avgDuration: i, totalCount: e.length };
1768
+ function $t(e, t) {
1769
+ const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length, o = e.length > 0 ? e.reduce((s, i) => s + i.duration, 0) / e.length : 0;
1770
+ return { slowCount: r, dupCount: n, avgDuration: o, totalCount: e.length };
1680
1771
  }
1681
- const bt = [
1772
+ const At = [
1682
1773
  "all",
1683
1774
  "active",
1684
1775
  "waiting",
@@ -1686,7 +1777,7 @@ const bt = [
1686
1777
  "completed",
1687
1778
  "failed"
1688
1779
  ];
1689
- function xt(e, t = "ss-dbg-job-status") {
1780
+ function Rt(e, t = "ss-dbg-job-status") {
1690
1781
  switch (e) {
1691
1782
  case "completed":
1692
1783
  case "failed":
@@ -1698,7 +1789,7 @@ function xt(e, t = "ss-dbg-job-status") {
1698
1789
  return "ss-dbg-badge-muted";
1699
1790
  }
1700
1791
  }
1701
- function wt(e) {
1792
+ function Lt(e) {
1702
1793
  switch (e) {
1703
1794
  case "active":
1704
1795
  return "blue";
@@ -1714,18 +1805,18 @@ function wt(e) {
1714
1805
  return "muted";
1715
1806
  }
1716
1807
  }
1717
- function St(e) {
1808
+ function Ft(e) {
1718
1809
  if (!e) return [];
1719
1810
  if (Array.isArray(e)) return e;
1720
1811
  const t = e;
1721
1812
  return t.jobs || t.data || [];
1722
1813
  }
1723
- function vt(e) {
1814
+ function Ut(e) {
1724
1815
  if (!e || Array.isArray(e)) return null;
1725
1816
  const t = e;
1726
1817
  return t.stats || t.overview || null;
1727
1818
  }
1728
- function ye(e) {
1819
+ function $e(e) {
1729
1820
  if (!e) return [];
1730
1821
  if (typeof e == "string")
1731
1822
  try {
@@ -1735,7 +1826,7 @@ function ye(e) {
1735
1826
  }
1736
1827
  return Array.isArray(e) ? e : [];
1737
1828
  }
1738
- function be(e) {
1829
+ function Ae(e) {
1739
1830
  if (!e) return [];
1740
1831
  if (typeof e == "string")
1741
1832
  try {
@@ -1748,25 +1839,25 @@ function be(e) {
1748
1839
  function C(e, t, r, n = 0) {
1749
1840
  return e[t] ?? e[r] ?? n;
1750
1841
  }
1751
- function Tt(e) {
1842
+ function Dt(e) {
1752
1843
  return {
1753
1844
  method: e.method || "",
1754
1845
  url: e.url || "",
1755
1846
  statusCode: C(e, "status_code", "statusCode"),
1756
1847
  totalDuration: C(e, "total_duration", "totalDuration") || e.duration || 0,
1757
1848
  spanCount: C(e, "span_count", "spanCount"),
1758
- spans: ye(e.spans),
1759
- warnings: be(e.warnings),
1849
+ spans: $e(e.spans),
1850
+ warnings: Ae(e.warnings),
1760
1851
  logs: e.logs || [],
1761
1852
  httpRequestId: e.httpRequestId || e.http_request_id || void 0
1762
1853
  };
1763
1854
  }
1764
- const xe = ["password", "secret", "token", "key", "credential", "auth"];
1765
- function we(e) {
1855
+ const Re = ["password", "secret", "token", "key", "credential", "auth"];
1856
+ function Le(e) {
1766
1857
  const t = e.toLowerCase();
1767
- return xe.some((r) => t.includes(r));
1858
+ return Re.some((r) => t.includes(r));
1768
1859
  }
1769
- function Se(e) {
1860
+ function Fe(e) {
1770
1861
  if (e == null) return "-";
1771
1862
  if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
1772
1863
  return String(e);
@@ -1777,89 +1868,87 @@ function Se(e) {
1777
1868
  return String(e);
1778
1869
  }
1779
1870
  }
1780
- const ve = {
1871
+ const Ue = {
1781
1872
  collectionInterval: "Stats Collection",
1782
1873
  dashboardBroadcast: "Dashboard Broadcast",
1783
1874
  debugBroadcast: "Debug Broadcast",
1784
1875
  persistFlush: "Persist Flush",
1785
1876
  retentionCleanup: "Retention Cleanup"
1786
1877
  };
1787
- function Et(e) {
1788
- return ve[e] || e;
1878
+ function Ot(e) {
1879
+ return Ue[e] || e;
1789
1880
  }
1790
- const Te = {
1881
+ const De = {
1791
1882
  prometheus: "Prometheus",
1792
1883
  pinoHook: "Pino Log Hook",
1793
1884
  edgePlugin: "Edge Plugin",
1794
1885
  cacheInspector: "Cache Inspector",
1795
1886
  queueInspector: "Queue Inspector"
1796
1887
  };
1797
- function Ct(e) {
1798
- return Te[e] || e;
1888
+ function It(e) {
1889
+ return De[e] || e;
1799
1890
  }
1800
- function Mt(e) {
1891
+ function _t(e) {
1801
1892
  return "active" in e ? e.active ? "active" : "inactive" : "available" in e ? e.available ? "available" : "unavailable" : "unknown";
1802
1893
  }
1803
- function Pt(e, t) {
1894
+ function Bt(e, t) {
1804
1895
  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" : "-";
1805
1896
  }
1806
- function kt(e) {
1897
+ function Ht(e) {
1807
1898
  return Object.entries(e).map(([t, r]) => ({
1808
1899
  key: t,
1809
- value: Se(r),
1810
- secret: we(t)
1900
+ value: Fe(r),
1901
+ secret: Le(t)
1811
1902
  }));
1812
1903
  }
1813
- function $t(e, t) {
1904
+ function Nt(e, t) {
1814
1905
  return t ? Math.min(100, Math.round(e / t * 100)) : 0;
1815
1906
  }
1816
- const Ee = ["healthy", "active", "connected", "available", "ready"], Ce = ["errored", "unavailable"];
1817
- function At(e) {
1818
- return Ee.includes(e) ? "ok" : Ce.includes(e) ? "err" : "";
1907
+ const Oe = ["healthy", "active", "connected", "available", "ready"], Ie = ["errored", "unavailable"];
1908
+ function qt(e) {
1909
+ return Oe.includes(e) ? "ok" : Ie.includes(e) ? "err" : "";
1819
1910
  }
1820
- function b(e) {
1911
+ function $(e) {
1821
1912
  return e !== null && typeof e == "object" && !Array.isArray(e) && e.__redacted === !0;
1822
1913
  }
1823
- function Me(e, t = "") {
1824
- if (typeof e != "object" || e === null || e === void 0)
1825
- return [{ path: t, value: e }];
1826
- if (Array.isArray(e) || b(e))
1914
+ function w(e) {
1915
+ return e != null && typeof e == "object" && !Array.isArray(e) && !$(e);
1916
+ }
1917
+ function _e(e, t = "") {
1918
+ if (!w(e))
1827
1919
  return [{ path: t, value: e }];
1828
1920
  const r = [];
1829
1921
  for (const n of Object.keys(e)) {
1830
- const i = t ? `${t}.${n}` : n, s = e[n];
1831
- typeof s == "object" && s !== null && !Array.isArray(s) && !b(s) ? r.push(...Me(s, i)) : r.push({ path: i, value: s });
1922
+ const o = t ? `${t}.${n}` : n, s = e[n];
1923
+ w(s) ? r.push(..._e(s, o)) : r.push({ path: o, value: s });
1832
1924
  }
1833
1925
  return r;
1834
1926
  }
1835
- function Lt(e) {
1927
+ function Kt(e) {
1836
1928
  return e == null ? { text: "null", color: "var(--ss-dim)" } : typeof e == "boolean" ? {
1837
1929
  text: String(e),
1838
1930
  color: e ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
1839
1931
  } : 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) };
1840
1932
  }
1841
- function Pe(e) {
1842
- if (e == null || typeof e != "object" || Array.isArray(e) || b(e))
1933
+ function Be(e) {
1934
+ if (e == null || typeof e != "object" || Array.isArray(e) || $(e))
1843
1935
  return 1;
1844
1936
  let t = 0;
1845
1937
  for (const r of Object.keys(e))
1846
- t += Pe(e[r]);
1938
+ t += Be(e[r]);
1847
1939
  return t;
1848
1940
  }
1849
- function Rt(e) {
1850
- if (e == null || typeof e != "object" || Array.isArray(e) || b(e))
1851
- return [];
1941
+ function zt(e) {
1942
+ if (!w(e)) return [];
1852
1943
  const t = [];
1853
- for (const r of Object.keys(e)) {
1854
- const n = e[r];
1855
- n !== null && typeof n == "object" && !Array.isArray(n) && !b(n) && t.push(r);
1856
- }
1944
+ for (const r of Object.keys(e))
1945
+ w(e[r]) && t.push(r);
1857
1946
  return t;
1858
1947
  }
1859
- function Ut(e, t, r) {
1860
- return !r || e.toLowerCase().includes(r) ? !0 : (b(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
1948
+ function jt(e, t, r) {
1949
+ return !r || e.toLowerCase().includes(r) ? !0 : ($(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
1861
1950
  }
1862
- function Dt(e, t, r) {
1951
+ function Vt(e, t, r) {
1863
1952
  t && navigator.clipboard.writeText(e).then(() => {
1864
1953
  const n = t.textContent;
1865
1954
  t.textContent = "✓", t.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
@@ -1868,7 +1957,7 @@ function Dt(e, t, r) {
1868
1957
  }).catch(() => {
1869
1958
  });
1870
1959
  }
1871
- const ke = /* @__PURE__ */ new Set([
1960
+ const He = /* @__PURE__ */ new Set([
1872
1961
  "secret",
1873
1962
  "key",
1874
1963
  "token",
@@ -1882,128 +1971,129 @@ const ke = /* @__PURE__ */ new Set([
1882
1971
  "private",
1883
1972
  "encryption"
1884
1973
  ]);
1885
- function $e(e) {
1974
+ function Ne(e) {
1886
1975
  const t = e.split(/[._-]/), r = [];
1887
1976
  for (const n of t) {
1888
- const i = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
1889
- for (const s of i)
1977
+ const o = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
1978
+ for (const s of o)
1890
1979
  s && r.push(s);
1891
1980
  }
1892
1981
  return r;
1893
1982
  }
1894
- function Ft(e) {
1895
- return $e(e).some((r) => ke.has(r.toLowerCase()));
1983
+ function Wt(e) {
1984
+ return Ne(e).some((r) => He.has(r.toLowerCase()));
1896
1985
  }
1897
- const It = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
1986
+ const Gt = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
1898
1987
  export {
1899
- T as ApiClient,
1900
- _ as ApiError,
1901
- ue as DASHBOARD_SECTION_PATHS,
1902
- J as DEBUG_REFRESH_MS,
1903
- ce as DEBUG_TAB_PATHS,
1904
- ne as DEFAULT_FEATURES,
1905
- F as DEFAULT_PER_PAGE,
1906
- pe as DashboardApi,
1907
- it as DashboardDataController,
1908
- lt as DebugDataController,
1909
- Ce as ERROR_STATUSES,
1910
- Te as INTEGRATION_LABELS,
1911
- bt as JOB_STATUS_FILTERS,
1912
- ct as LOG_LEVELS,
1913
- ae as MAX_HISTORY,
1914
- k as METRIC_DEFINITIONS,
1915
- Ee as OK_STATUSES,
1916
- j as OVERVIEW_REFRESH_MS,
1917
- It as REDACT_PATTERN,
1918
- G as SECTION_REFRESH_MS,
1919
- Q as SLOW_DURATION_MS,
1920
- le as STALE_MS,
1921
- st as ServerStatsController,
1922
- ot as TAB_ICONS,
1923
- te as THRESHOLD_CSS_CLASS,
1924
- He as THRESHOLD_CSS_VAR,
1925
- Be as THRESHOLD_HEX_FALLBACK,
1926
- ve as TIMER_LABELS,
1927
- w as UnauthorizedError,
1928
- X as VERY_SLOW_DURATION_MS,
1929
- re as buildQueryParams,
1930
- Ve as buildQueryString,
1931
- De as buildSparklineData,
1932
- At as classifyStatus,
1933
- Rt as collectTopLevelObjectKeys,
1988
+ v as ApiClient,
1989
+ B as ApiError,
1990
+ we as DASHBOARD_SECTION_PATHS,
1991
+ Y as DEBUG_REFRESH_MS,
1992
+ xe as DEBUG_TAB_PATHS,
1993
+ ge as DEFAULT_FEATURES,
1994
+ O as DEFAULT_PER_PAGE,
1995
+ Te as DashboardApi,
1996
+ yt as DashboardDataController,
1997
+ St as DebugDataController,
1998
+ Ie as ERROR_STATUSES,
1999
+ De as INTEGRATION_LABELS,
2000
+ At as JOB_STATUS_FILTERS,
2001
+ wt as LOG_LEVELS,
2002
+ ee as MAX_HISTORY,
2003
+ P as METRIC_DEFINITIONS,
2004
+ Oe as OK_STATUSES,
2005
+ Q as OVERVIEW_REFRESH_MS,
2006
+ Gt as REDACT_PATTERN,
2007
+ J as SECTION_REFRESH_MS,
2008
+ X as SLOW_DURATION_MS,
2009
+ te as STALE_MS,
2010
+ mt as ServerStatsController,
2011
+ bt as TAB_ICONS,
2012
+ ce as THRESHOLD_CSS_CLASS,
2013
+ Xe as THRESHOLD_CSS_VAR,
2014
+ Ye as THRESHOLD_HEX_FALLBACK,
2015
+ Ue as TIMER_LABELS,
2016
+ b as UnauthorizedError,
2017
+ Z as VERY_SLOW_DURATION_MS,
2018
+ he as buildQueryParams,
2019
+ st as buildQueryString,
2020
+ Ve as buildSparklineData,
2021
+ qt as classifyStatus,
2022
+ zt as collectTopLevelObjectKeys,
1934
2023
  L as compactPreview,
1935
- Xe as computePagination,
1936
- yt as computeQuerySummary,
1937
- V as computeStats,
1938
- Dt as copyWithFeedback,
1939
- gt as countDuplicateQueries,
1940
- Pe as countLeaves,
1941
- Je as createFilterState,
1942
- fe as createHistoryBuffer,
1943
- Ge as createPaginationState,
1944
- Qe as createSortState,
1945
- H as createTransmitSubscription,
1946
- Ze as detectFeatures,
1947
- tt as detectMetricGroupsFromStats,
1948
- Ne as durationSeverity,
1949
- vt as extractJobStats,
1950
- St as extractJobs,
1951
- ie as fetchFeatures,
1952
- $t as fillPercent,
1953
- pt as filterLogsByLevel,
1954
- mt as filterQueries,
1955
- Me as flattenConfig,
1956
- P as formatBytes,
1957
- We as formatCacheSize,
1958
- kt as formatCollectorConfig,
1959
- Se as formatConfigVal,
1960
- Z as formatCount,
1961
- Fe as formatDuration,
1962
- Lt as formatFlatValue,
1963
- $ as formatMb,
1964
- _e as formatStatNum,
1965
- Ie as formatTime,
1966
- ze as formatTtl,
1967
- Y as formatUptime,
2024
+ lt as computePagination,
2025
+ $t as computeQuerySummary,
2026
+ G as computeStats,
2027
+ Vt as copyWithFeedback,
2028
+ Pt as countDuplicateQueries,
2029
+ Be as countLeaves,
2030
+ at as createFilterState,
2031
+ Ee as createHistoryBuffer,
2032
+ it as createPaginationState,
2033
+ ct as createSortState,
2034
+ q as createTransmitSubscription,
2035
+ ht as detectFeatures,
2036
+ ft as detectMetricGroupsFromStats,
2037
+ et as durationClassName,
2038
+ le as durationSeverity,
2039
+ Ut as extractJobStats,
2040
+ Ft as extractJobs,
2041
+ ye as fetchFeatures,
2042
+ Nt as fillPercent,
2043
+ kt as filterLogsByLevel,
2044
+ Mt as filterQueries,
2045
+ _e as flattenConfig,
2046
+ M as formatBytes,
2047
+ nt as formatCacheSize,
2048
+ Ht as formatCollectorConfig,
2049
+ Fe as formatConfigVal,
2050
+ ie as formatCount,
2051
+ We as formatDuration,
2052
+ Kt as formatFlatValue,
2053
+ A as formatMb,
2054
+ Je as formatStatNum,
2055
+ Ge as formatTime,
2056
+ rt as formatTtl,
2057
+ oe as formatUptime,
1968
2058
  W as generateGradientId,
1969
- Ue as generateSparklinePath,
1970
- Re as generateSparklinePoints,
1971
- de as getDashboardSectionPath,
1972
- he as getDebugTabPath,
1973
- Pt as getIntegrationDetails,
1974
- Ct as getIntegrationLabel,
1975
- Mt as getIntegrationStatus,
1976
- wt as getJobStatusBadgeColor,
1977
- xt as getJobStatusCssClass,
1978
- ft as getLogLevelCssClass,
1979
- rt as getMetricById,
1980
- nt as getMetricsByGroup,
1981
- Ye as getPageNumbers,
1982
- A as getRatioColor,
2059
+ je as generateSparklinePath,
2060
+ ze as generateSparklinePoints,
2061
+ ve as getDashboardSectionPath,
2062
+ Se as getDebugTabPath,
2063
+ Bt as getIntegrationDetails,
2064
+ It as getIntegrationLabel,
2065
+ _t as getIntegrationStatus,
2066
+ Lt as getJobStatusBadgeColor,
2067
+ Rt as getJobStatusCssClass,
2068
+ Ct as getLogLevelCssClass,
2069
+ pt as getMetricById,
2070
+ gt as getMetricsByGroup,
2071
+ ut as getPageNumbers,
2072
+ R as getRatioColor,
1983
2073
  U as getTheme,
1984
- S as getThresholdColor,
1985
- ee as getThresholdColorInverse,
1986
- Et as getTimerLabel,
1987
- et as getVisibleMetricGroups,
1988
- at as initResizableColumns,
1989
- b as isRedactedValue,
1990
- we as isSecretKey,
1991
- Ut as matchesConfigSearch,
1992
- Tt as normalizeTraceFields,
1993
- Le as onThemeChange,
1994
- je as parsePaginatedResponse,
1995
- ye as parseTraceSpans,
1996
- be as parseTraceWarnings,
1997
- ge as resolveLogLevel,
1998
- ht as resolveLogMessage,
1999
- dt as resolveLogRequestId,
2000
- ut as resolveLogTimestamp,
2074
+ x as getThresholdColor,
2075
+ ae as getThresholdColorInverse,
2076
+ Ot as getTimerLabel,
2077
+ dt as getVisibleMetricGroups,
2078
+ xt as initResizableColumns,
2079
+ $ as isRedactedValue,
2080
+ Le as isSecretKey,
2081
+ jt as matchesConfigSearch,
2082
+ Dt as normalizeTraceFields,
2083
+ Ke as onThemeChange,
2084
+ ot as parsePaginatedResponse,
2085
+ $e as parseTraceSpans,
2086
+ Ae as parseTraceWarnings,
2087
+ Pe as resolveLogLevel,
2088
+ vt as resolveLogMessage,
2089
+ Tt as resolveLogRequestId,
2090
+ Et as resolveLogTimestamp,
2001
2091
  C as resolveTraceField,
2002
- N as setTheme,
2003
- Ke as shortReqId,
2004
- Ft as shouldRedact,
2005
- qe as statusColor,
2006
- q as subscribeToChannel,
2007
- Oe as timeAgo,
2008
- Ae as toggleTheme
2092
+ z as setTheme,
2093
+ tt as shortReqId,
2094
+ Wt as shouldRedact,
2095
+ Ze as statusColor,
2096
+ K as subscribeToChannel,
2097
+ Qe as timeAgo,
2098
+ qe as toggleTheme
2009
2099
  };