@w6w/ui 0.1.1 → 0.2.11

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 (87) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +7 -5
  3. package/dist/AppPicker.d.ts +48 -2
  4. package/dist/CanvasLayer.d.ts +38 -0
  5. package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-BqXDA35P.js} +2 -2
  6. package/dist/{CodeBlock-Dot3Pd7P.js.map → CodeBlock-BqXDA35P.js.map} +1 -1
  7. package/dist/{CodeBlock-CZu4TFSi.cjs → CodeBlock-CulfbnZD.cjs} +2 -2
  8. package/dist/{CodeBlock-CZu4TFSi.cjs.map → CodeBlock-CulfbnZD.cjs.map} +1 -1
  9. package/dist/ConfirmModal-Ln99S9NT.js +7919 -0
  10. package/dist/ConfirmModal-Ln99S9NT.js.map +1 -0
  11. package/dist/ConfirmModal-fjHW5rN-.cjs +14 -0
  12. package/dist/ConfirmModal-fjHW5rN-.cjs.map +1 -0
  13. package/dist/ConnectionHeader.d.ts +19 -0
  14. package/dist/Copyable-DA6eiU7w.cjs +2 -0
  15. package/dist/Copyable-DA6eiU7w.cjs.map +1 -0
  16. package/dist/{Copyable-1niV9gUa.js → Copyable-F4NTaG77.js} +91 -15
  17. package/dist/Copyable-F4NTaG77.js.map +1 -0
  18. package/dist/EditConnectionModal.d.ts +26 -0
  19. package/dist/JsonEditor.d.ts +8 -0
  20. package/dist/Markdown.d.ts +25 -0
  21. package/dist/ParamsForm.d.ts +7 -1
  22. package/dist/StepBuilderModal.d.ts +23 -5
  23. package/dist/WorkflowFlowEditor.d.ts +14 -3
  24. package/dist/app-pages.d.ts +5 -0
  25. package/dist/canvas-types.d.ts +36 -0
  26. package/dist/canvas-utils.d.ts +44 -0
  27. package/dist/code.cjs +1 -1
  28. package/dist/code.mjs +2 -2
  29. package/dist/components/AuthFieldsForm.d.ts +19 -1
  30. package/dist/components/BudgetMeter.d.ts +15 -0
  31. package/dist/components/CallableList.d.ts +58 -0
  32. package/dist/components/Combobox.d.ts +8 -1
  33. package/dist/components/ConnectionList.d.ts +43 -0
  34. package/dist/components/CredentialPicker.d.ts +35 -0
  35. package/dist/components/DataTable.d.ts +27 -0
  36. package/dist/components/EmptyState.d.ts +9 -0
  37. package/dist/components/ListItem.d.ts +16 -6
  38. package/dist/components/ReliabilityChart.d.ts +10 -0
  39. package/dist/components/ReliabilityList.d.ts +47 -0
  40. package/dist/components/icons.d.ts +1 -1
  41. package/dist/connection-app-meta.d.ts +32 -0
  42. package/dist/dynamic-fields.d.ts +60 -0
  43. package/dist/editor-theme.d.ts +24 -0
  44. package/dist/flow-fanout.d.ts +2 -2
  45. package/dist/flow-types.d.ts +18 -1
  46. package/dist/flow-utils.d.ts +10 -3
  47. package/dist/flow.cjs +2 -2
  48. package/dist/flow.cjs.map +1 -1
  49. package/dist/flow.d.ts +9 -0
  50. package/dist/flow.mjs +1519 -1138
  51. package/dist/flow.mjs.map +1 -1
  52. package/dist/index.cjs +1 -1
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.ts +30 -2
  55. package/dist/index.mjs +2053 -1005
  56. package/dist/index.mjs.map +1 -1
  57. package/dist/note-markdown.d.ts +22 -0
  58. package/dist/provider.d.ts +73 -5
  59. package/dist/reliability-board-layout.d.ts +121 -0
  60. package/dist/resolve-params.d.ts +5 -0
  61. package/dist/run-visuals.d.ts +4 -1
  62. package/dist/step-problems.d.ts +34 -0
  63. package/dist/types.d.ts +117 -3
  64. package/dist/use-dynamic-fields.d.ts +23 -0
  65. package/package.json +5 -3
  66. package/src/styles/_budget-meter.scss +46 -0
  67. package/src/styles/_callable-list.scss +69 -0
  68. package/src/styles/_canvas.scss +318 -0
  69. package/src/styles/_connections.scss +88 -0
  70. package/src/styles/_data-table.scss +55 -0
  71. package/src/styles/_empty-state.scss +21 -0
  72. package/src/styles/_flow.scss +11 -0
  73. package/src/styles/_fx.scss +23 -0
  74. package/src/styles/_layout.scss +10 -0
  75. package/src/styles/_lists.scss +4 -0
  76. package/src/styles/_markdown.scss +20 -0
  77. package/src/styles/_reliability.scss +339 -0
  78. package/src/styles/_tester.scss +1 -14
  79. package/src/styles.css +1142 -17
  80. package/src/styles.scss +8 -0
  81. package/dist/ConfirmModal-8avl9Nv8.cjs +0 -11
  82. package/dist/ConfirmModal-8avl9Nv8.cjs.map +0 -1
  83. package/dist/ConfirmModal-CD-P8mhN.js +0 -6335
  84. package/dist/ConfirmModal-CD-P8mhN.js.map +0 -1
  85. package/dist/Copyable-1niV9gUa.js.map +0 -1
  86. package/dist/Copyable-CYZU1o4X.cjs +0 -2
  87. package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,113 +1,159 @@
1
1
  "use client";
2
- var Tt = Object.defineProperty;
3
- var At = (e, s, n) => s in e ? Tt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
4
- var V = (e, s, n) => At(e, typeof s != "symbol" ? s + "" : s, n);
5
- import { j as Et, a0 as Mt, J as z, ab as _t, M as Ve, L as Pt, l as It, am as L } from "./ConfirmModal-CD-P8mhN.js";
6
- import { aa as en, Q as tn, a9 as sn, an as nn, ao as an, ap as rn, H as ln, a1 as on, a8 as cn, aq as dn, S as un, ar as wn, as as mn, at as hn, au as pn, av as fn, Y as vn, aw as yn, ax as Nn, ay as gn, u as bn } from "./ConfirmModal-CD-P8mhN.js";
7
- import { jsxs as o, jsx as t, Fragment as k } from "react/jsx-runtime";
8
- import { useMemo as ye, useState as v, useEffect as G, useId as Ut, useRef as Ft } from "react";
9
- import { C as ke } from "./CodeBlock-Dot3Pd7P.js";
10
- import { yaml as Lt } from "@codemirror/lang-yaml";
11
- import { EditorView as Bt } from "@codemirror/view";
12
- import Jt from "@uiw/react-codemirror";
13
- import { u as Dt, a as Ht, b as jt, C as qt, I as ze } from "./Copyable-1niV9gUa.js";
14
- import { i as xn } from "./Copyable-1niV9gUa.js";
15
- class ce extends Error {
16
- constructor(n, l, d, a) {
17
- super(d);
18
- V(this, "status");
19
- V(this, "code");
2
+ var qt = Object.defineProperty;
3
+ var Vt = (e, n, a) => n in e ? qt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a;
4
+ var he = (e, n, a) => Vt(e, typeof n != "symbol" ? n + "" : n, a);
5
+ import { j as bt, a2 as zt, J as me, ad as Gt, ap as ot, O as Fe, M as Yt, l as Qt, aq as Zt, I as ae, T as be, ar as Xt, as as Re, at as en, au as tn, av as nn } from "./ConfirmModal-Ln99S9NT.js";
6
+ import { ac as Fa, ab as Da, K as Ba, aw as Ja, ax as Ka, ay as ja, H as Ha, ai as Wa, a3 as qa, aa as Va, az as za, S as Ga, aA as Ya, aB as Qa, aC as Za, aD as Xa, aE as es, aF as ts, _ as ns, aG as as, aH as ss, aI as ls, u as is } from "./ConfirmModal-Ln99S9NT.js";
7
+ import { jsx as t, jsxs as l, Fragment as A } from "react/jsx-runtime";
8
+ import { useMemo as De, useState as g, useEffect as Q, useId as an, useRef as sn } from "react";
9
+ import { C as He } from "./CodeBlock-BqXDA35P.js";
10
+ import { yaml as ln } from "@codemirror/lang-yaml";
11
+ import { EditorView as rn } from "@codemirror/view";
12
+ import cn from "@uiw/react-codemirror";
13
+ import { u as on, a as dn, b as un, C as wn, I as dt } from "./Copyable-F4NTaG77.js";
14
+ import { i as cs } from "./Copyable-F4NTaG77.js";
15
+ class pe extends Error {
16
+ constructor(a, i, o, c) {
17
+ super(o);
18
+ he(this, "status");
19
+ he(this, "code");
20
20
  /**
21
21
  * The parsed error response body, when the server sent one. Carries the
22
22
  * fields that ride alongside an error — e.g. an invoke's `logs` and
23
23
  * `apiCalls` — which the message alone would drop.
24
24
  */
25
- V(this, "body");
26
- this.name = "ApiError", this.status = n, this.code = l, this.body = a;
25
+ he(this, "body");
26
+ this.name = "ApiError", this.status = a, this.code = i, this.body = c;
27
27
  }
28
28
  }
29
- function _s(e) {
30
- const s = e.baseUrl.replace(/\/$/, ""), n = e.fetch ?? globalThis.fetch, l = async () => typeof e.token == "function" ? await e.token() : e.token;
31
- async function d(r, c) {
32
- const u = new Headers(c == null ? void 0 : c.headers), w = await l();
33
- w && u.set("authorization", `Bearer ${w}`), c != null && c.body && !u.has("content-type") && u.set("content-type", "application/json");
29
+ function ma(e) {
30
+ const n = e.baseUrl.replace(/\/$/, ""), a = e.fetch ?? globalThis.fetch, i = async () => typeof e.token == "function" ? await e.token() : e.token;
31
+ async function o(s, r) {
32
+ const d = new Headers(r == null ? void 0 : r.headers), u = await i();
33
+ u && d.set("authorization", `Bearer ${u}`), r != null && r.body && !d.has("content-type") && d.set("content-type", "application/json");
34
34
  let h;
35
35
  try {
36
- h = await n(`${s}${r}`, { ...c, headers: u });
37
- } catch (N) {
38
- throw new ce(
36
+ h = await a(`${n}${s}`, { ...r, headers: d });
37
+ } catch (m) {
38
+ throw new pe(
39
39
  0,
40
40
  "network_error",
41
- `Could not reach the w6w server (${(c == null ? void 0 : c.method) ?? "GET"} ${s}${r}). It may be down or unreachable. (${N.message})`
41
+ `Could not reach the w6w server (${(r == null ? void 0 : r.method) ?? "GET"} ${n}${s}). It may be down or unreachable. (${m.message})`
42
42
  );
43
43
  }
44
- const m = await h.text();
45
- let p = null;
46
- if (m)
44
+ const f = await h.text();
45
+ let v = null;
46
+ if (f)
47
47
  try {
48
- p = JSON.parse(m);
48
+ v = JSON.parse(f);
49
49
  } catch {
50
50
  if (!h.ok)
51
- throw new ce(
51
+ throw new pe(
52
52
  h.status,
53
53
  "bad_response",
54
- `Server returned a non-JSON ${h.status} response: ${m.slice(0, 200)}`
54
+ `Server returned a non-JSON ${h.status} response: ${f.slice(0, 200)}`
55
55
  );
56
56
  }
57
57
  if (!h.ok) {
58
- const N = (p == null ? void 0 : p.error) ?? {};
59
- throw new ce(h.status, N.code ?? "error", N.message ?? h.statusText, p);
58
+ const m = (v == null ? void 0 : v.error) ?? {};
59
+ throw new pe(h.status, m.code ?? "error", m.message ?? h.statusText, v);
60
60
  }
61
- return { status: h.status, data: p };
61
+ return { status: h.status, data: v };
62
62
  }
63
- async function a(r, c) {
64
- const { data: u } = await d(r, c);
65
- return u;
63
+ async function c(s, r) {
64
+ const { data: d } = await o(s, r);
65
+ return d;
66
66
  }
67
67
  return {
68
68
  // A bare GET only returns the server's default page (50) — every consumer
69
- // of this client treats the result as the complete catalog, so page
70
- // through it here. Capped at 20 pages as a runaway backstop.
69
+ // of this client treats the result as the complete catalog, so walk one
70
+ // server snapshot by `nextCursor` (opaque; the cursor encodes the
71
+ // snapshot, so `snapshot`/`offset` are never sent). No page cap: the walk
72
+ // ends when the cursor is absent or fails to advance. If the snapshot
73
+ // expired mid-walk (410 `snapshot_expired` / 404 `unknown_snapshot`, alike
74
+ // to a token holder), drop what was gathered and restart once.
71
75
  listApps: async () => {
72
- const r = [];
73
- let c;
74
- for (let u = 0; u < 20; u++) {
75
- const w = new URLSearchParams({ limit: "200" });
76
- c && w.set("cursor", c);
77
- const h = await a(`/apps?${w}`);
78
- if (r.push(...h.apps), !h.nextCursor) break;
79
- c = h.nextCursor;
76
+ const s = async () => {
77
+ const r = [];
78
+ let d;
79
+ for (; ; ) {
80
+ const u = new URLSearchParams({ limit: "200" });
81
+ d && u.set("cursor", d);
82
+ const h = await c(`/apps?${u}`);
83
+ if (r.push(...h.apps), !h.nextCursor || h.nextCursor === d) return r;
84
+ d = h.nextCursor;
85
+ }
86
+ };
87
+ try {
88
+ return await s();
89
+ } catch (r) {
90
+ if (r instanceof pe && (r.code === "snapshot_expired" || r.code === "unknown_snapshot"))
91
+ return await s();
92
+ throw r;
80
93
  }
81
- return r;
82
94
  },
83
95
  // Bounded lookup: dedupe; `[]` sends nothing; chunks of <= 100 (the server's
84
96
  // `MAX_IDS_PER_QUERY`), each `GET /apps?ids=a,b` with no limit/cursor.
85
- listAppsByIds: async (r) => {
86
- const c = Array.from(new Set(r)), u = [];
87
- for (let w = 0; w < c.length; w += 100) {
88
- const m = c.slice(w, w + 100).map(encodeURIComponent).join(","), p = await a(`/apps?ids=${m}`);
89
- u.push(...p.apps);
97
+ listAppsByIds: async (s) => {
98
+ const r = Array.from(new Set(s)), d = [];
99
+ for (let u = 0; u < r.length; u += 100) {
100
+ const f = r.slice(u, u + 100).map(encodeURIComponent).join(","), v = await c(`/apps?ids=${f}`);
101
+ d.push(...v.apps);
90
102
  }
91
- return u;
103
+ return d;
92
104
  },
93
- getAppAuth: async (r) => (await a(`/apps/${encodeURIComponent(r)}/auths`)).auths ?? [],
94
- createConnection: (r, c) => a(`/apps/${encodeURIComponent(r)}/connections`, {
105
+ getAppAuth: async (s) => (await c(`/apps/${encodeURIComponent(s)}/auths`)).auths ?? [],
106
+ createConnection: (s, r) => c(`/apps/${encodeURIComponent(s)}/connections`, {
95
107
  method: "POST",
96
- body: JSON.stringify(c)
97
- }).then((u) => u.connection),
98
- startAppOAuthFlow: (r, c, u) => a(
99
- `/apps/${encodeURIComponent(r)}/oauth-config/${encodeURIComponent(c)}/authorize-url`,
100
- { method: "POST", body: JSON.stringify(u) }
108
+ body: JSON.stringify(r)
109
+ }).then((d) => d.connection),
110
+ updateConnection: (s, r) => c(`/connections/${encodeURIComponent(s)}`, {
111
+ method: "PATCH",
112
+ body: JSON.stringify(r)
113
+ }).then((d) => d.connection),
114
+ listCredentials: (s) => {
115
+ const r = new URLSearchParams();
116
+ (s == null ? void 0 : s.contract) !== void 0 && r.set("contract", s.contract), (s == null ? void 0 : s.appId) !== void 0 && r.set("appId", s.appId), (s == null ? void 0 : s.authKey) !== void 0 && r.set("authKey", s.authKey);
117
+ const d = r.toString();
118
+ return c(`/credentials${d ? `?${d}` : ""}`).then(
119
+ (u) => u.credentials ?? []
120
+ );
121
+ },
122
+ createCredential: (s) => c("/credentials", {
123
+ method: "POST",
124
+ body: JSON.stringify(s)
125
+ }).then((r) => r.credential),
126
+ getCredential: (s) => c(`/credentials/${encodeURIComponent(s)}`).then(
127
+ (r) => r.credential
101
128
  ),
102
- getAppActions: (r) => a(`/apps/${encodeURIComponent(r)}`).then(
103
- (c) => c.actions ?? []
129
+ rotateCredential: (s, r) => c(`/credentials/${encodeURIComponent(s)}/rotate`, {
130
+ method: "POST",
131
+ body: JSON.stringify(r)
132
+ }).then((d) => d.credential),
133
+ setCredentialStatus: (s, r) => c(
134
+ `/credentials/${encodeURIComponent(s)}/${r === "disabled" ? "disable" : "enable"}`,
135
+ { method: "POST" }
136
+ ).then((d) => d.credential),
137
+ testCredential: (s) => c(`/credentials/${encodeURIComponent(s)}/test`, { method: "POST" }),
138
+ credentialDependents: (s) => c(
139
+ `/credentials/${encodeURIComponent(s)}/dependents`
140
+ ).then((r) => r.dependents),
141
+ deleteCredential: async (s) => {
142
+ await c(`/credentials/${encodeURIComponent(s)}`, { method: "DELETE" });
143
+ },
144
+ startAppOAuthFlow: (s, r, d) => c(
145
+ `/apps/${encodeURIComponent(s)}/oauth-config/${encodeURIComponent(r)}/authorize-url`,
146
+ { method: "POST", body: JSON.stringify(d) }
104
147
  ),
105
- listConnectionsForApp: (r) => a(
106
- `/apps/${encodeURIComponent(r)}/connections`
107
- ).then((c) => c.connections ?? []),
108
- listConnections: () => a("/connections").then((r) => r.connections ?? []),
109
- invokeAction: (r, c, u, w = {}) => a(
110
- `/apps/${encodeURIComponent(r)}/actions/${encodeURIComponent(c)}/invoke`,
148
+ getAppActions: (s) => c(`/apps/${encodeURIComponent(s)}`).then(
149
+ (r) => r.actions ?? []
150
+ ),
151
+ listConnectionsForApp: (s) => c(
152
+ `/apps/${encodeURIComponent(s)}/connections`
153
+ ).then((r) => r.connections ?? []),
154
+ listConnections: () => c("/connections").then((s) => s.connections ?? []),
155
+ invokeAction: (s, r, d, u = {}) => c(
156
+ `/apps/${encodeURIComponent(s)}/actions/${encodeURIComponent(r)}/invoke`,
111
157
  // This body is built KEY BY KEY, not by spreading `opts` — so every new
112
158
  // option has to be named here or it is silently dropped before the wire
113
159
  // (the caller compiles, the UI looks right, the field never leaves the
@@ -119,385 +165,332 @@ function _s(e) {
119
165
  {
120
166
  method: "POST",
121
167
  body: JSON.stringify({
122
- params: u,
123
- connectionId: w.connectionId,
124
- project: w.project,
125
- state: w.state
168
+ params: d,
169
+ connectionId: u.connectionId,
170
+ project: u.project,
171
+ state: u.state
126
172
  })
127
173
  }
128
174
  ),
129
- listSavedTests: (r) => a(
130
- `/connections/${encodeURIComponent(r)}/saved-tests`
131
- ).then((c) => c.savedTests ?? []),
132
- createSavedTest: (r, c) => a(
133
- `/connections/${encodeURIComponent(r)}/saved-tests`,
134
- { method: "POST", body: JSON.stringify(c) }
175
+ listSavedTests: (s) => c(
176
+ `/connections/${encodeURIComponent(s)}/saved-tests`
177
+ ).then((r) => r.savedTests ?? []),
178
+ createSavedTest: (s, r) => c(
179
+ `/connections/${encodeURIComponent(s)}/saved-tests`,
180
+ { method: "POST", body: JSON.stringify(r) }
181
+ ).then((d) => d.savedTest),
182
+ updateSavedTest: (s, r, d) => c(
183
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(r)}`,
184
+ { method: "PATCH", body: JSON.stringify(d) }
135
185
  ).then((u) => u.savedTest),
136
- updateSavedTest: (r, c, u) => a(
137
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
138
- { method: "PATCH", body: JSON.stringify(u) }
139
- ).then((w) => w.savedTest),
140
- deleteSavedTest: (r, c) => a(
141
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
186
+ deleteSavedTest: (s, r) => c(
187
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(r)}`,
142
188
  { method: "DELETE" }
143
189
  ).then(() => {
144
190
  }),
145
- recordTestRun: (r, c) => a(`/connections/${encodeURIComponent(r)}/test-runs`, {
191
+ recordTestRun: (s, r) => c(`/connections/${encodeURIComponent(s)}/test-runs`, {
146
192
  method: "POST",
147
- body: JSON.stringify(c)
193
+ body: JSON.stringify(r)
148
194
  }).then(() => {
149
195
  }),
150
- listTestRuns: (r) => a(
151
- `/connections/${encodeURIComponent(r)}/test-runs`
152
- ).then((c) => c.runs ?? []),
153
- saveStepTest: (r, c, u) => a(
154
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/tests`,
155
- { method: "POST", body: JSON.stringify(u) }
156
- ).then((w) => w.stepTest),
157
- listStepTests: (r, c) => a(
158
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/tests`
159
- ).then((u) => u.stepTests ?? []),
160
- recordStepTestRun: (r, c, u) => a(
161
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/test-runs`,
162
- { method: "POST", body: JSON.stringify(u) }
196
+ listTestRuns: (s) => c(
197
+ `/connections/${encodeURIComponent(s)}/test-runs`
198
+ ).then((r) => r.runs ?? []),
199
+ saveStepTest: (s, r, d) => c(
200
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(r)}/tests`,
201
+ { method: "POST", body: JSON.stringify(d) }
202
+ ).then((u) => u.stepTest),
203
+ listStepTests: (s, r) => c(
204
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(r)}/tests`
205
+ ).then((d) => d.stepTests ?? []),
206
+ recordStepTestRun: (s, r, d) => c(
207
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(r)}/test-runs`,
208
+ { method: "POST", body: JSON.stringify(d) }
163
209
  ).then(() => {
164
210
  }),
165
- listFunctions: () => a("/functions").then((r) => r.functions ?? []),
166
- getFunction: (r) => a(
167
- `/functions/${encodeURIComponent(r)}`
168
- ).then((c) => ({ ...c.function, valid: c.valid })),
211
+ listFunctions: () => c("/functions").then((s) => s.functions ?? []),
212
+ getFunction: (s) => c(
213
+ `/functions/${encodeURIComponent(s)}`
214
+ ).then((r) => ({ ...r.function, valid: r.valid })),
169
215
  // The real synchronous route (`/functions/:id/invoke`) — deliberately NOT
170
216
  // `POST /run`, which would give the test stage a different code path than
171
217
  // the `@w6w/call` node it's standing in for. Returns the raw output,
172
218
  // pinned against the committed `studio/src/repos/functions.ts` signature.
173
- invokeFunction: (r, c) => a(`/functions/${encodeURIComponent(r)}/invoke`, {
219
+ invokeFunction: (s, r) => c(`/functions/${encodeURIComponent(s)}/invoke`, {
174
220
  method: "POST",
175
- body: JSON.stringify({ inputs: c })
176
- }).then((u) => u.output),
177
- listWorkflows: () => a("/workflows").then((r) => r.workflows ?? []),
178
- getWorkflow: (r) => a(`/workflows/${encodeURIComponent(r)}`).then(
179
- (c) => c.workflow
221
+ body: JSON.stringify({ inputs: r })
222
+ }).then((d) => d.output),
223
+ listWorkflows: () => c("/workflows").then((s) => s.workflows ?? []),
224
+ getWorkflow: (s) => c(`/workflows/${encodeURIComponent(s)}`).then(
225
+ (r) => r.workflow
180
226
  ),
181
227
  // `rawReq`, not `req<T>` — the ONE caller that needs the response's own
182
228
  // status code: `200` (the run reached a terminal state inside the wait
183
229
  // window) vs `202` (the server's own wait-timeout, still running). Both
184
230
  // are 2xx successes; `rawReq` already throws on a non-2xx.
185
- runWorkflow: (r, c = {}) => d(`/workflows/${encodeURIComponent(r)}/run?wait=true`, {
231
+ runWorkflow: (s, r = {}) => o(`/workflows/${encodeURIComponent(s)}/run?wait=true`, {
186
232
  method: "POST",
187
- body: JSON.stringify({ variables: c.variables, input: c.input })
188
- }).then(({ status: u, data: w }) => ({ ...w ?? {}, terminal: u === 200 }))
233
+ body: JSON.stringify({ variables: r.variables, input: r.input })
234
+ }).then(({ status: d, data: u }) => ({ ...u ?? {}, terminal: d === 200 }))
189
235
  };
190
236
  }
191
- function Ge(e) {
192
- if (!e) return "";
193
- try {
194
- return JSON.stringify(JSON.parse(e), null, 2);
195
- } catch {
196
- return e;
197
- }
198
- }
199
- function Kt(e, s) {
200
- return `${e.method}-${e.url ?? e.host}-${s}`;
201
- }
202
- function Wt({ calls: e, defaultOpen: s, keyOf: n, title: l }) {
203
- if (e.length === 0) return null;
204
- const d = n ?? Kt;
205
- return /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 4 }, children: [
206
- l !== !1 && /* @__PURE__ */ t("strong", { className: "w6w-small", children: l ?? /* @__PURE__ */ o(k, { children: [
207
- "API ",
208
- e.length === 1 ? "call" : "calls",
209
- " (",
210
- e.length,
211
- ")"
212
- ] }) }),
213
- e.map((a, r) => /* @__PURE__ */ o(
214
- "details",
215
- {
216
- open: s,
217
- className: "w6w-result",
218
- style: { padding: 8 },
219
- children: [
220
- /* @__PURE__ */ t("summary", { style: { cursor: "pointer" }, children: /* @__PURE__ */ o("span", { className: "w6w-small", children: [
221
- a.method,
222
- " ",
223
- a.url ?? a.host,
224
- " →",
225
- " ",
226
- /* @__PURE__ */ t("strong", { children: a.error ? "failed" : a.status }),
227
- a.durationMs !== void 0 && /* @__PURE__ */ o("span", { className: "w6w-muted", children: [
228
- " · ",
229
- a.durationMs,
230
- "ms"
231
- ] })
232
- ] }) }),
233
- /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 6, marginTop: 8 }, children: [
234
- a.error && /* @__PURE__ */ t("div", { className: "w6w-error w6w-small", children: a.error }),
235
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request headers" }),
236
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.requestHeaders ?? {}, null, 2) }),
237
- a.requestBody && /* @__PURE__ */ o(k, { children: [
238
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request body" }),
239
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.requestBody) })
240
- ] }),
241
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response headers" }),
242
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.responseHeaders ?? {}, null, 2) }),
243
- a.responseBody && /* @__PURE__ */ o(k, { children: [
244
- /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response body" }),
245
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.responseBody) })
246
- ] }),
247
- a.truncated && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "A captured body exceeded the size cap and was truncated." })
248
- ] })
249
- ]
250
- },
251
- d(a, r)
252
- ))
253
- ] });
254
- }
255
- function Ne({
237
+ function Be({
256
238
  title: e,
257
- subtitle: s,
258
- icon: n,
259
- trailing: l,
260
- active: d = !1,
261
- onClick: a,
239
+ subtitle: n,
240
+ icon: a,
241
+ trailing: i,
242
+ active: o = !1,
243
+ onClick: c,
244
+ href: s,
262
245
  ariaLabel: r
263
246
  }) {
264
- const c = /* @__PURE__ */ o(k, { children: [
265
- n != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-icon", children: n }),
266
- /* @__PURE__ */ o("span", { className: "w6w-list-item-body", children: [
247
+ const d = /* @__PURE__ */ l(A, { children: [
248
+ a != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-icon", children: a }),
249
+ /* @__PURE__ */ l("span", { className: "w6w-list-item-body", children: [
267
250
  /* @__PURE__ */ t("span", { className: "w6w-list-item-title", children: e }),
268
- s != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-subtitle", children: s })
251
+ n != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-subtitle", children: n })
269
252
  ] }),
270
- l != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-trailing", children: l })
271
- ] }), u = `w6w-list-item${d ? " active" : ""}`;
272
- return a ? /* @__PURE__ */ t(
253
+ i != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-trailing", children: i })
254
+ ] }), u = `w6w-list-item${o ? " active" : ""}`;
255
+ return s !== void 0 ? /* @__PURE__ */ t(
256
+ "a",
257
+ {
258
+ className: u,
259
+ href: s,
260
+ "aria-current": o ? "true" : void 0,
261
+ "aria-label": r,
262
+ onClick: c,
263
+ children: d
264
+ }
265
+ ) : c ? /* @__PURE__ */ t(
273
266
  "button",
274
267
  {
275
268
  type: "button",
276
269
  className: u,
277
- "aria-pressed": d,
270
+ "aria-pressed": o,
278
271
  "aria-label": r,
279
- onClick: a,
280
- children: c
272
+ onClick: c,
273
+ children: d
281
274
  }
282
- ) : /* @__PURE__ */ t("div", { className: u, "aria-label": r, children: c });
283
- }
284
- function de(e) {
285
- const s = Date.parse(e);
286
- if (Number.isNaN(s)) return "";
287
- const n = Math.max(0, Math.round((Date.now() - s) / 1e3));
288
- if (n < 45) return "just now";
289
- const l = Math.round(n / 60);
290
- if (l < 60) return `${l}m ago`;
291
- const d = Math.round(l / 60);
292
- if (d < 24) return `${d}h ago`;
293
- const a = Math.round(d / 24);
294
- return a < 7 ? `${a}d ago` : new Date(s).toLocaleDateString();
295
- }
296
- function Qe(e) {
297
- const s = {};
298
- for (const n of (e == null ? void 0 : e.params) ?? [])
299
- n.key && n.default !== void 0 && (s[n.key] = n.default);
300
- return s;
301
- }
302
- function Vt(e) {
303
- var n, l, d;
304
- const s = e.indexOf("{");
305
- if (s >= 0)
275
+ ) : /* @__PURE__ */ t("div", { className: u, "aria-label": r, children: d });
276
+ }
277
+ function Ie(e) {
278
+ const n = Date.parse(e);
279
+ if (Number.isNaN(n)) return "";
280
+ const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
281
+ if (a < 45) return "just now";
282
+ const i = Math.round(a / 60);
283
+ if (i < 60) return `${i}m ago`;
284
+ const o = Math.round(i / 60);
285
+ if (o < 24) return `${o}h ago`;
286
+ const c = Math.round(o / 24);
287
+ return c < 7 ? `${c}d ago` : new Date(n).toLocaleDateString();
288
+ }
289
+ function ut(e) {
290
+ const n = {};
291
+ for (const a of (e == null ? void 0 : e.params) ?? [])
292
+ a.key && a.default !== void 0 && (n[a.key] = a.default);
293
+ return n;
294
+ }
295
+ function hn(e) {
296
+ var a, i, o;
297
+ const n = e.indexOf("{");
298
+ if (n >= 0)
306
299
  try {
307
- const a = JSON.parse(e.slice(s)), r = ((l = (n = a == null ? void 0 : a.errors) == null ? void 0 : n[0]) == null ? void 0 : l.message) ?? (typeof (a == null ? void 0 : a.error) == "object" ? (d = a.error) == null ? void 0 : d.message : a == null ? void 0 : a.error) ?? (a == null ? void 0 : a.message);
308
- if (typeof r == "string" && r.trim()) {
309
- const c = e.slice(0, s).replace(/[:\s]+$/, "");
310
- return c ? `${c}: ${r.trim()}` : r.trim();
300
+ const c = JSON.parse(e.slice(n)), s = ((i = (a = c == null ? void 0 : c.errors) == null ? void 0 : a[0]) == null ? void 0 : i.message) ?? (typeof (c == null ? void 0 : c.error) == "object" ? (o = c.error) == null ? void 0 : o.message : c == null ? void 0 : c.error) ?? (c == null ? void 0 : c.message);
301
+ if (typeof s == "string" && s.trim()) {
302
+ const r = e.slice(0, n).replace(/[:\s]+$/, "");
303
+ return r ? `${r}: ${s.trim()}` : s.trim();
311
304
  }
312
305
  } catch {
313
306
  }
314
307
  return e;
315
308
  }
316
- function tt(e) {
309
+ function kt(e) {
317
310
  return typeof e == "object" && e !== null && typeof e.status == "number" && typeof e.code == "string";
318
311
  }
319
- function zt(e) {
320
- if (!tt(e))
312
+ function mn(e) {
313
+ if (!kt(e))
321
314
  return { headline: (e == null ? void 0 : e.message) ?? "The action failed to run." };
322
- const s = Vt(e.message ?? ""), n = `${e.status} ${e.code} ${e.message ?? ""}`.toLowerCase();
315
+ const n = hn(e.message ?? ""), a = `${e.status} ${e.code} ${e.message ?? ""}`.toLowerCase();
323
316
  return e.status === 401 || e.status === 403 || /\b(401|403)\b|forbidden|unauthorized|not authorized|permission|scope|access denied|invalid api key|invalid credential/.test(
324
- n
317
+ a
325
318
  ) ? {
326
319
  headline: "Permission denied by the provider — this is a credential/scope problem, not a w6w error.",
327
320
  hint: "The connection's API key is missing the permissions this action needs. Fix it at the provider — e.g. SendGrid → Settings → API Keys → give the key the required scopes (or Full Access), or create a new key — then update this connection's credential and try again.",
328
- detail: s
329
- } : { headline: "The action returned an error.", detail: s };
330
- }
331
- function Gt(e) {
332
- const s = tt(e) ? e.body ?? e.raw : null;
333
- return (s == null ? void 0 : s.apiCalls) ?? [];
334
- }
335
- function ue() {
336
- const [e, s] = v(""), [n, l] = v(void 0), [d, a] = v(!1);
337
- return { text: e, value: n, invalid: d, onChange: (c) => {
338
- s(c);
339
- const u = c.trim();
340
- if (u === "") {
341
- a(!1);
321
+ detail: n
322
+ } : { headline: "The action returned an error.", detail: n };
323
+ }
324
+ function pn(e) {
325
+ const n = kt(e) ? e.body ?? e.raw : null;
326
+ return (n == null ? void 0 : n.apiCalls) ?? [];
327
+ }
328
+ function Oe() {
329
+ const [e, n] = g(""), [a, i] = g(void 0), [o, c] = g(!1);
330
+ return { text: e, value: a, invalid: o, onChange: (r) => {
331
+ n(r);
332
+ const d = r.trim();
333
+ if (d === "") {
334
+ c(!1);
342
335
  return;
343
336
  }
344
337
  try {
345
- const w = JSON.parse(u);
346
- w !== null && typeof w == "object" && !Array.isArray(w) ? (l(w), a(!1)) : a(!0);
338
+ const u = JSON.parse(d);
339
+ u !== null && typeof u == "object" && !Array.isArray(u) ? (i(u), c(!1)) : c(!0);
347
340
  } catch {
348
- a(!0);
341
+ c(!0);
349
342
  }
350
343
  } };
351
344
  }
352
- function Ps({
345
+ function pa({
353
346
  appId: e,
354
- actions: s,
355
- connectionId: n,
356
- action: l,
357
- seedValues: d,
358
- onSavedTestsChanged: a,
359
- seedTestId: r,
360
- onDirtyChange: c,
361
- onTestSaved: u,
362
- onDeleted: w,
347
+ actions: n,
348
+ connectionId: a,
349
+ action: i,
350
+ seedValues: o,
351
+ onSavedTestsChanged: c,
352
+ seedTestId: s,
353
+ onDirtyChange: r,
354
+ onTestSaved: d,
355
+ onDeleted: u,
363
356
  embedded: h = !1
364
357
  }) {
365
- var qe;
366
- const m = Et(), p = ye(() => {
367
- const i = [...s];
368
- return i.sort((f, g) => (f.title || f.key).localeCompare(g.title || g.key)), i;
369
- }, [s]), [N, ee] = v((l == null ? void 0 : l.key) ?? ""), y = l ?? s.find((i) => i.key === N) ?? null, [Ce, Oe] = v(!1), [A, _] = v(null), [Re, P] = v(void 0), [nt, E] = v([]), C = ue(), O = ue(), R = ue(), [te, at] = v(""), [se, rt] = v(""), Te = C.invalid || O.invalid || R.invalid, lt = () => {
370
- const i = {};
371
- return C.text.trim() !== "" && C.value !== void 0 && (i.body = C.value), O.text.trim() !== "" && O.value !== void 0 && (i.query = O.value), R.text.trim() !== "" && R.value !== void 0 && (i.headers = R.value), te && (i.target = te), se.trim() !== "" && (i.match = se.trim()), Object.keys(i).length > 0 ? i : void 0;
372
- }, [I, ne] = v("form"), [it, Ae] = v(""), [ot, Ee] = v(!1), [T, Me] = v(!1), b = (y == null ? void 0 : y.key) ?? null, _e = d ? { ...d } : Qe(y), [Pe, D] = v(() => ({
373
- key: b,
374
- values: _e
375
- })), [x, U] = v(r ?? null), [Ie, H] = v(_e);
376
- if (Pe.key !== b) {
377
- const i = Qe(y);
378
- D({ key: b, values: i }), H(i), U(r ?? null), _(null), P(void 0), E([]);
358
+ var rt;
359
+ const f = bt(), v = De(() => {
360
+ const w = [...n];
361
+ return w.sort((x, _) => (x.title || x.key).localeCompare(_.title || _.key)), w;
362
+ }, [n]), [m, N] = g((i == null ? void 0 : i.key) ?? ""), y = i ?? n.find((w) => w.key === m) ?? null, [p, P] = g(!1), [E, M] = g(null), [I, C] = g(void 0), [S, O] = g([]), F = Oe(), U = Oe(), k = Oe(), [R, Z] = g(""), [B, J] = g(""), D = F.invalid || U.invalid || k.invalid, X = () => {
363
+ const w = {};
364
+ return F.text.trim() !== "" && F.value !== void 0 && (w.body = F.value), U.text.trim() !== "" && U.value !== void 0 && (w.query = U.value), k.text.trim() !== "" && k.value !== void 0 && (w.headers = k.value), R && (w.target = R), B.trim() !== "" && (w.match = B.trim()), Object.keys(w).length > 0 ? w : void 0;
365
+ }, [V, z] = g("form"), [ke, ie] = g(""), [xe, G] = g(!1), [b, $] = g(!1), T = (y == null ? void 0 : y.key) ?? null, K = o ? { ...o } : ut(y), [Ge, re] = g(() => ({
366
+ key: T,
367
+ values: K
368
+ })), [j, ee] = g(s ?? null), [Ye, ce] = g(K);
369
+ if (Ge.key !== T) {
370
+ const w = ut(y);
371
+ re({ key: T, values: w }), ce(w), ee(s ?? null), M(null), C(void 0), O([]);
379
372
  }
380
- const [ct, dt] = v(r);
381
- r !== ct && (dt(r), U(r ?? null));
382
- const [Ue, ut] = v(d);
383
- if (d !== Ue) {
384
- const i = JSON.stringify(d ?? null) !== JSON.stringify(Ue ?? null);
385
- if (ut(d), d && i) {
386
- const f = { ...d };
387
- D({ key: b, values: f }), H(f), _(null), P(void 0), E([]);
373
+ const [At, Rt] = g(s);
374
+ s !== At && (Rt(s), ee(s ?? null));
375
+ const [Qe, It] = g(o);
376
+ if (o !== Qe) {
377
+ const w = JSON.stringify(o ?? null) !== JSON.stringify(Qe ?? null);
378
+ if (It(o), o && w) {
379
+ const x = { ...o };
380
+ re({ key: T, values: x }), ce(x), M(null), C(void 0), O([]);
388
381
  }
389
382
  }
390
- const S = Pe.values, Fe = (i) => D({ key: b, values: i }), Le = ye(
391
- () => JSON.stringify(S) !== JSON.stringify(Ie),
392
- [S, Ie]
383
+ const H = Ge.values, Ze = (w) => re({ key: T, values: w }), Xe = De(
384
+ () => JSON.stringify(H) !== JSON.stringify(Ye),
385
+ [H, Ye]
393
386
  );
394
- G(() => {
395
- c == null || c(Le);
396
- }, [Le]);
397
- const wt = () => {
398
- Ae(JSON.stringify(S, null, 2)), Ee(!1), ne("json");
399
- }, mt = async (i) => {
400
- if (!y || Te) return;
401
- const f = y.key;
402
- Oe(!0), _(null), P(void 0), E([]);
403
- let g;
404
- const Ke = lt();
387
+ Q(() => {
388
+ r == null || r(Xe);
389
+ }, [Xe]);
390
+ const Ot = () => {
391
+ ie(JSON.stringify(H, null, 2)), G(!1), z("json");
392
+ }, Et = async (w) => {
393
+ if (!y || D) return;
394
+ const x = y.key;
395
+ P(!0), M(null), C(void 0), O([]);
396
+ let _;
397
+ const Y = X();
405
398
  try {
406
- const M = await m.invokeAction(e, f, i, {
407
- connectionId: n,
408
- ...Ke ? { overrides: Ke } : {}
399
+ const W = await f.invokeAction(e, x, w, {
400
+ connectionId: a,
401
+ ...Y ? { overrides: Y } : {}
409
402
  });
410
- P(M.value), E(M.apiCalls ?? []), g = { ok: !0, summary: "OK", result: M.value };
411
- } catch (M) {
412
- const We = zt(M);
413
- _(We), E(Gt(M)), g = { ok: !1, summary: We.headline };
403
+ C(W.value), O(W.apiCalls ?? []), _ = { ok: !0, summary: "OK", result: W.value };
404
+ } catch (W) {
405
+ const ct = mn(W);
406
+ M(ct), O(pn(W)), _ = { ok: !1, summary: ct.headline };
414
407
  } finally {
415
- Oe(!1);
408
+ P(!1);
416
409
  }
417
- if (n)
410
+ if (a)
418
411
  try {
419
- await m.recordTestRun(n, {
420
- savedTestId: x ?? null,
421
- actionKey: f,
422
- ok: g.ok,
423
- summary: g.summary.slice(0, 200),
424
- result: g.result
425
- }), ie(), kt(), a == null || a();
412
+ await f.recordTestRun(a, {
413
+ savedTestId: j ?? null,
414
+ actionKey: x,
415
+ ok: _.ok,
416
+ summary: _.summary.slice(0, 200),
417
+ result: _.result
418
+ }), Te(), Jt(), c == null || c();
426
419
  } catch {
427
420
  }
428
- }, ht = () => mt(S), [j, Be] = v(null), [q, F] = v(null), [pt, ft] = v(0), [vt, K] = v(!1), [ae, re] = v(""), [yt, le] = v(!1), ie = () => ft((i) => i + 1);
429
- G(() => {
430
- if (!n) {
431
- Be(null);
421
+ }, Mt = () => Et(H), [oe, et] = g(null), [de, te] = g(null), [Pt, _t] = g(0), [Lt, ue] = g(!1), [Ce, Se] = g(""), [Ut, $e] = g(!1), Te = () => _t((w) => w + 1);
422
+ Q(() => {
423
+ if (!a) {
424
+ et(null);
432
425
  return;
433
426
  }
434
- let i = !1;
435
- return F(null), m.listSavedTests(n).then((f) => !i && Be(f)).catch((f) => !i && F(f.message)), () => {
436
- i = !0;
427
+ let w = !1;
428
+ return te(null), f.listSavedTests(a).then((x) => !w && et(x)).catch((x) => !w && te(x.message)), () => {
429
+ w = !0;
437
430
  };
438
- }, [m, n, pt]);
439
- const Je = b ? (j ?? []).filter((i) => i.actionKey === b) : [], [Nt, oe] = v(null), [gt, bt] = v(0), kt = () => bt((i) => i + 1);
440
- G(() => {
441
- const i = m.listTestRuns;
442
- if (!n || !i) {
443
- oe(null);
431
+ }, [f, a, Pt]);
432
+ const tt = T ? (oe ?? []).filter((w) => w.actionKey === T) : [], [Ft, Ae] = g(null), [Dt, Bt] = g(0), Jt = () => Bt((w) => w + 1);
433
+ Q(() => {
434
+ const w = f.listTestRuns;
435
+ if (!a || !w) {
436
+ Ae(null);
444
437
  return;
445
438
  }
446
- let f = !1;
447
- return i(n).then((g) => !f && oe(g)).catch(() => !f && oe(null)), () => {
448
- f = !0;
439
+ let x = !1;
440
+ return w(a).then((_) => !x && Ae(_)).catch(() => !x && Ae(null)), () => {
441
+ x = !0;
449
442
  };
450
- }, [m, n, gt]);
451
- const De = b ? (Nt ?? []).filter((i) => i.actionKey === b).slice().sort((i, f) => Date.parse(f.occurredAt) - Date.parse(i.occurredAt)) : [], xt = () => {
452
- !n || !y || (re(""), F(null), K(!0));
453
- }, St = () => {
454
- !n || !y || (x ? He() : xt());
455
- }, He = async () => {
456
- if (!(!n || !y))
443
+ }, [f, a, Dt]);
444
+ const nt = T ? (Ft ?? []).filter((w) => w.actionKey === T).slice().sort((w, x) => Date.parse(x.occurredAt) - Date.parse(w.occurredAt)) : [], Kt = () => {
445
+ !a || !y || (Se(""), te(null), ue(!0));
446
+ }, jt = () => {
447
+ !a || !y || (j ? at() : Kt());
448
+ }, at = async () => {
449
+ if (!(!a || !y))
457
450
  try {
458
- let i;
459
- if (x)
460
- i = await m.updateSavedTest(n, x, { values: S });
451
+ let w;
452
+ if (j)
453
+ w = await f.updateSavedTest(a, j, { values: H });
461
454
  else {
462
- const f = ae.trim();
463
- if (!f) return;
464
- i = await m.createSavedTest(n, {
455
+ const x = Ce.trim();
456
+ if (!x) return;
457
+ w = await f.createSavedTest(a, {
465
458
  actionKey: y.key,
466
- name: f,
467
- values: S
468
- }), U(i.id);
459
+ name: x,
460
+ values: H
461
+ }), ee(w.id);
469
462
  }
470
- H({ ...S }), K(!1), re(""), ie(), a == null || a(), u == null || u(i);
471
- } catch (i) {
472
- F(i.message);
463
+ ce({ ...H }), ue(!1), Se(""), Te(), c == null || c(), d == null || d(w);
464
+ } catch (w) {
465
+ te(w.message);
473
466
  }
474
- }, $t = (i) => {
475
- const f = { ...i.values };
476
- D({ key: b, values: f }), H(f), U(i.id), ne("form"), _(null), P(void 0), E([]);
477
- }, Ct = async () => {
478
- if (!n || !x) return;
479
- const i = x;
467
+ }, Ht = (w) => {
468
+ const x = { ...w.values };
469
+ re({ key: T, values: x }), ce(x), ee(w.id), z("form"), M(null), C(void 0), O([]);
470
+ }, Wt = async () => {
471
+ if (!a || !j) return;
472
+ const w = j;
480
473
  try {
481
- await m.deleteSavedTest(n, i), U(null), ie(), a == null || a(), w == null || w(i);
482
- } catch (f) {
483
- F(f.message);
474
+ await f.deleteSavedTest(a, w), ee(null), Te(), c == null || c(), u == null || u(w);
475
+ } catch (x) {
476
+ te(x.message);
484
477
  }
485
- }, Ot = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
486
- /* @__PURE__ */ o(
478
+ }, st = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
479
+ /* @__PURE__ */ l(
487
480
  "div",
488
481
  {
489
482
  className: "w6w-field-labelrow",
490
483
  style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
491
484
  children: [
492
485
  /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Parameters" }),
493
- /* @__PURE__ */ o("div", { style: { display: "flex", gap: "var(--w6w-sp-1)" }, children: [
486
+ /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1)" }, children: [
494
487
  /* @__PURE__ */ t(
495
488
  "button",
496
489
  {
497
490
  type: "button",
498
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "form" ? " active" : ""}`,
499
- "aria-pressed": I === "form",
500
- onClick: () => ne("form"),
491
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${V === "form" ? " active" : ""}`,
492
+ "aria-pressed": V === "form",
493
+ onClick: () => z("form"),
501
494
  children: "Form"
502
495
  }
503
496
  ),
@@ -505,9 +498,9 @@ function Ps({
505
498
  "button",
506
499
  {
507
500
  type: "button",
508
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "json" ? " active" : ""}`,
509
- "aria-pressed": I === "json",
510
- onClick: wt,
501
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${V === "json" ? " active" : ""}`,
502
+ "aria-pressed": V === "json",
503
+ onClick: Ot,
511
504
  children: "JSON"
512
505
  }
513
506
  ),
@@ -516,86 +509,94 @@ function Ps({
516
509
  {
517
510
  type: "button",
518
511
  className: "w6w-btn w6w-btn-sm w6w-btn-ghost",
519
- "aria-pressed": T,
520
- title: T ? "Collapse the params editor" : "Open the params editor in a larger view",
521
- "aria-label": T ? "Collapse the params editor" : "Open the params editor in a larger view",
522
- onClick: () => Me((i) => !i),
523
- children: T ? "⤡" : "⤢"
512
+ "aria-pressed": b,
513
+ title: b ? "Collapse the params editor" : "Open the params editor in a larger view",
514
+ "aria-label": b ? "Collapse the params editor" : "Open the params editor in a larger view",
515
+ onClick: () => $((w) => !w),
516
+ children: b ? "⤡" : "⤢"
524
517
  }
525
518
  )
526
519
  ] })
527
520
  ]
528
521
  }
529
522
  ),
530
- I === "form" ? /* @__PURE__ */ t(Mt, { params: (y == null ? void 0 : y.params) ?? [], values: S, onChange: Fe }) : /* @__PURE__ */ o(k, { children: [
523
+ V === "form" ? /* @__PURE__ */ t(
524
+ zt,
525
+ {
526
+ params: (y == null ? void 0 : y.params) ?? [],
527
+ values: H,
528
+ onChange: Ze,
529
+ dynamic: y ? { appId: e, actionKey: y.key, connectionId: a } : void 0
530
+ }
531
+ ) : /* @__PURE__ */ l(A, { children: [
531
532
  /* @__PURE__ */ t(
532
- z,
533
+ me,
533
534
  {
534
- value: it,
535
- onChange: Ae,
536
- minHeight: T ? "50vh" : "200px",
535
+ value: ke,
536
+ onChange: ie,
537
+ minHeight: b ? "50vh" : "200px",
537
538
  "aria-label": "Params JSON",
538
- onValidChange: (i) => {
539
- i !== null && typeof i == "object" && !Array.isArray(i) && Fe(i);
539
+ onValidChange: (w) => {
540
+ w !== null && typeof w == "object" && !Array.isArray(w) && Ze(w);
540
541
  },
541
- onValidityChange: ({ valid: i }) => Ee(!i)
542
+ onValidityChange: ({ valid: w }) => G(!w)
542
543
  }
543
544
  ),
544
- ot && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
545
+ xe && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
545
546
  ] })
546
- ] }), Rt = /* @__PURE__ */ o("details", { className: "w6w-section", "data-testid": "overrides-region", children: [
547
- /* @__PURE__ */ o("summary", { className: "w6w-section-summary", children: [
547
+ ] }), lt = /* @__PURE__ */ l("details", { className: "w6w-section", "data-testid": "overrides-region", children: [
548
+ /* @__PURE__ */ l("summary", { className: "w6w-section-summary", children: [
548
549
  /* @__PURE__ */ t("span", { className: "w6w-section-title", children: "Overrides" }),
549
550
  /* @__PURE__ */ t("span", { className: "w6w-section-subtitle", children: "Reach a vendor field this action's own params don't declare" })
550
551
  ] }),
551
- /* @__PURE__ */ o("div", { className: "w6w-stack w6w-section-body", style: { gap: "var(--w6w-sp-2)" }, children: [
552
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
552
+ /* @__PURE__ */ l("div", { className: "w6w-stack w6w-section-body", style: { gap: "var(--w6w-sp-2)" }, children: [
553
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
553
554
  /* @__PURE__ */ t("span", { children: "Body" }),
554
555
  /* @__PURE__ */ t(
555
- z,
556
+ me,
556
557
  {
557
- value: C.text,
558
- onChange: C.onChange,
558
+ value: F.text,
559
+ onChange: F.onChange,
559
560
  minHeight: "80px",
560
561
  "aria-label": "Overrides body (JSON)"
561
562
  }
562
563
  ),
563
- C.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
564
+ F.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
564
565
  ] }),
565
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
566
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
566
567
  /* @__PURE__ */ t("span", { children: "Query" }),
567
568
  /* @__PURE__ */ t(
568
- z,
569
+ me,
569
570
  {
570
- value: O.text,
571
- onChange: O.onChange,
571
+ value: U.text,
572
+ onChange: U.onChange,
572
573
  minHeight: "80px",
573
574
  "aria-label": "Overrides query (JSON)"
574
575
  }
575
576
  ),
576
- O.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
577
+ U.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
577
578
  ] }),
578
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
579
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
579
580
  /* @__PURE__ */ t("span", { children: "Headers" }),
580
581
  /* @__PURE__ */ t(
581
- z,
582
+ me,
582
583
  {
583
- value: R.text,
584
- onChange: R.onChange,
584
+ value: k.text,
585
+ onChange: k.onChange,
585
586
  minHeight: "80px",
586
587
  "aria-label": "Overrides headers (JSON)"
587
588
  }
588
589
  ),
589
- R.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
590
+ k.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
590
591
  ] }),
591
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
592
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
592
593
  /* @__PURE__ */ t("span", { children: "Target" }),
593
- /* @__PURE__ */ o(
594
+ /* @__PURE__ */ l(
594
595
  "select",
595
596
  {
596
597
  "aria-label": "Overrides target",
597
- value: te,
598
- onChange: (i) => at(i.target.value),
598
+ value: R,
599
+ onChange: (w) => Z(w.target.value),
599
600
  children: [
600
601
  /* @__PURE__ */ t("option", { value: "", children: "— default (first) —" }),
601
602
  /* @__PURE__ */ t("option", { value: "first", children: "first" }),
@@ -605,22 +606,22 @@ function Ps({
605
606
  }
606
607
  )
607
608
  ] }),
608
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
609
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
609
610
  /* @__PURE__ */ t("span", { children: "Match" }),
610
611
  /* @__PURE__ */ t(
611
612
  "input",
612
613
  {
613
614
  type: "text",
614
615
  "aria-label": "Overrides match",
615
- value: se,
616
+ value: B,
616
617
  placeholder: "Restrict to requests whose URL contains…",
617
- onChange: (i) => rt(i.target.value)
618
+ onChange: (w) => J(w.target.value)
618
619
  }
619
620
  )
620
621
  ] }),
621
622
  /* @__PURE__ */ t("span", { className: "w6w-hint", children: "Merged onto the outbound request at the wire, never into the params above — name a field the way the vendor's own API documents it." })
622
623
  ] })
623
- ] }), W = n ? /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
624
+ ] }), we = a ? /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
624
625
  /* @__PURE__ */ t(
625
626
  "div",
626
627
  {
@@ -629,35 +630,35 @@ function Ps({
629
630
  children: /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Saved tests" })
630
631
  }
631
632
  ),
632
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
633
- Je.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No saved tests for this action yet." }) : /* @__PURE__ */ t(
633
+ de && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: de }),
634
+ tt.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No saved tests for this action yet." }) : /* @__PURE__ */ t(
634
635
  "ul",
635
636
  {
636
637
  className: "w6w-stack",
637
638
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
638
- children: Je.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
639
- Ne,
639
+ children: tt.map((w) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
640
+ Be,
640
641
  {
641
- title: i.name,
642
- subtitle: i.lastRunAt ? /* @__PURE__ */ o("span", { children: [
642
+ title: w.name,
643
+ subtitle: w.lastRunAt ? /* @__PURE__ */ l("span", { children: [
643
644
  /* @__PURE__ */ t(
644
645
  "span",
645
646
  {
646
- style: { color: i.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
647
- children: i.lastRunOk ? "✓" : "✗"
647
+ style: { color: w.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
648
+ children: w.lastRunOk ? "✓" : "✗"
648
649
  }
649
650
  ),
650
651
  " ",
651
- i.lastRunSummary ? `${i.lastRunSummary} · ` : "",
652
- de(i.lastRunAt)
653
- ] }) : `saved ${de(i.updatedAt)}`,
654
- active: i.id === x,
655
- onClick: () => $t(i)
652
+ w.lastRunSummary ? `${w.lastRunSummary} · ` : "",
653
+ Ie(w.lastRunAt)
654
+ ] }) : `saved ${Ie(w.updatedAt)}`,
655
+ active: w.id === j,
656
+ onClick: () => Ht(w)
656
657
  }
657
- ) }, i.id))
658
+ ) }, w.id))
658
659
  }
659
660
  ),
660
- m.listTestRuns && De.length > 0 && /* @__PURE__ */ o(k, { children: [
661
+ f.listTestRuns && nt.length > 0 && /* @__PURE__ */ l(A, { children: [
661
662
  /* @__PURE__ */ t(
662
663
  "div",
663
664
  {
@@ -671,49 +672,49 @@ function Ps({
671
672
  {
672
673
  className: "w6w-stack",
673
674
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
674
- children: De.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
675
- Ne,
675
+ children: nt.map((w) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
676
+ Be,
676
677
  {
677
- title: /* @__PURE__ */ o("span", { children: [
678
- /* @__PURE__ */ t("span", { style: { color: i.ok ? "var(--w6w-success)" : "var(--w6w-danger)" }, children: i.ok ? "✓" : "✗" }),
678
+ title: /* @__PURE__ */ l("span", { children: [
679
+ /* @__PURE__ */ t("span", { style: { color: w.ok ? "var(--w6w-success)" : "var(--w6w-danger)" }, children: w.ok ? "✓" : "✗" }),
679
680
  " ",
680
- i.actionKey
681
+ w.actionKey
681
682
  ] }),
682
- subtitle: /* @__PURE__ */ o("span", { children: [
683
- i.summary ? `${i.summary} · ` : "",
684
- de(i.occurredAt)
683
+ subtitle: /* @__PURE__ */ l("span", { children: [
684
+ w.summary ? `${w.summary} · ` : "",
685
+ Ie(w.occurredAt)
685
686
  ] })
686
687
  }
687
- ) }, i.id))
688
+ ) }, w.id))
688
689
  }
689
690
  )
690
691
  ] })
691
- ] }) : null, je = (qe = j == null ? void 0 : j.find((i) => i.id === x)) == null ? void 0 : qe.name;
692
- return /* @__PURE__ */ o("div", { className: `w6w-stack${h ? " w6w-tester-embedded-root" : ""}`, children: [
693
- !l && (s.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This app exposes no actions." }) : (
692
+ ] }) : null, it = (rt = oe == null ? void 0 : oe.find((w) => w.id === j)) == null ? void 0 : rt.name;
693
+ return /* @__PURE__ */ l("div", { className: `w6w-stack${h ? " w6w-tester-embedded-root" : ""}`, children: [
694
+ !i && (n.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This app exposes no actions." }) : (
694
695
  // biome-ignore lint/a11y/noLabelWithoutControl: Combobox renders its own <select>/<input> INSIDE this label, so the field text labels the control at runtime; the rule cannot see through the component boundary.
695
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
696
- /* @__PURE__ */ o("span", { children: [
696
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
697
+ /* @__PURE__ */ l("span", { children: [
697
698
  "Action",
698
- b ? "" : " *"
699
+ T ? "" : " *"
699
700
  ] }),
700
701
  /* @__PURE__ */ t(
701
- _t,
702
+ Gt,
702
703
  {
703
- value: N,
704
+ value: m,
704
705
  placeholder: "— pick an action —",
705
- onChange: ee,
706
- options: p.map((i) => ({
707
- value: i.key,
708
- label: `${i.title ?? i.key} (${i.key})`
706
+ onChange: N,
707
+ options: v.map((w) => ({
708
+ value: w.key,
709
+ label: `${w.title ?? w.key} (${w.key})`
709
710
  }))
710
711
  }
711
712
  )
712
713
  ] })
713
714
  )),
714
- y ? /* @__PURE__ */ o(k, { children: [
715
- /* @__PURE__ */ o("div", { children: [
716
- /* @__PURE__ */ o("strong", { children: [
715
+ y ? /* @__PURE__ */ l(A, { children: [
716
+ /* @__PURE__ */ l("div", { children: [
717
+ /* @__PURE__ */ l("strong", { children: [
717
718
  y.title ?? y.key,
718
719
  " ",
719
720
  /* @__PURE__ */ t("code", { className: "w6w-muted", children: y.key })
@@ -721,34 +722,34 @@ function Ps({
721
722
  y.description && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", style: { margin: "var(--w6w-sp-0-5) 0 0" }, children: y.description })
722
723
  ] }),
723
724
  (() => {
724
- const i = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
725
- Ot,
726
- Rt,
727
- A && /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
728
- /* @__PURE__ */ t("strong", { children: A.headline }),
729
- A.hint && /* @__PURE__ */ t("div", { style: { marginTop: "var(--w6w-sp-1-5)" }, children: A.hint }),
730
- A.detail && /* @__PURE__ */ t(
731
- "div",
732
- {
733
- className: "w6w-muted w6w-small",
734
- style: {
735
- marginTop: "var(--w6w-sp-1-5)",
736
- whiteSpace: "pre-wrap",
737
- wordBreak: "break-word"
738
- },
739
- children: A.detail
740
- }
741
- )
742
- ] }),
743
- Re !== void 0 && /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1)" }, children: [
744
- /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Result" }),
745
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(Re, null, 2) })
746
- ] }),
747
- /* @__PURE__ */ t(Wt, { calls: nt })
748
- ] }), f = /* @__PURE__ */ o(
725
+ const w = E ? /* @__PURE__ */ l("div", { className: "w6w-result w6w-error", children: [
726
+ /* @__PURE__ */ t("strong", { children: E.headline }),
727
+ E.hint && /* @__PURE__ */ t("div", { style: { marginTop: "var(--w6w-sp-1-5)" }, children: E.hint }),
728
+ E.detail && /* @__PURE__ */ t(
729
+ "div",
730
+ {
731
+ className: "w6w-muted w6w-small",
732
+ style: {
733
+ marginTop: "var(--w6w-sp-1-5)",
734
+ whiteSpace: "pre-wrap",
735
+ wordBreak: "break-word"
736
+ },
737
+ children: E.detail
738
+ }
739
+ )
740
+ ] }) : null, x = I !== void 0 ? /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1)" }, children: [
741
+ /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Result" }),
742
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(I, null, 2) })
743
+ ] }) : null, _ = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
744
+ st,
745
+ lt,
746
+ w,
747
+ x,
748
+ /* @__PURE__ */ t(ot, { calls: S })
749
+ ] }), Y = /* @__PURE__ */ l(
749
750
  "div",
750
751
  {
751
- className: `w6w-tester-actions${h || T ? " w6w-tester-actions-footer" : ""}`,
752
+ className: `w6w-tester-actions${h || b ? " w6w-tester-actions-footer" : ""}`,
752
753
  style: { display: "flex", gap: "var(--w6w-sp-2)" },
753
754
  children: [
754
755
  /* @__PURE__ */ t(
@@ -756,42 +757,59 @@ function Ps({
756
757
  {
757
758
  type: "button",
758
759
  className: "w6w-btn",
759
- disabled: Ce || Te,
760
- onClick: ht,
761
- children: Ce ? "Running…" : "Run action"
760
+ disabled: p || D,
761
+ onClick: Mt,
762
+ children: p ? "Running…" : "Run action"
762
763
  }
763
764
  ),
764
- n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: St, children: "Save test" }),
765
- n && x && /* @__PURE__ */ t(
765
+ a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: jt, children: "Save test" }),
766
+ a && j && /* @__PURE__ */ t(
766
767
  "button",
767
768
  {
768
769
  type: "button",
769
770
  className: "w6w-btn w6w-btn-ghost",
770
771
  style: { marginLeft: "auto", color: "var(--w6w-danger)" },
771
- onClick: () => le(!0),
772
+ onClick: () => $e(!0),
772
773
  children: "Delete"
773
774
  }
774
775
  )
775
776
  ]
776
777
  }
777
- ), g = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
778
- i,
779
- f
778
+ ), W = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
779
+ _,
780
+ Y
780
781
  ] });
781
- return h ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded", children: [
782
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-scroll", children: W ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded-cols", children: [
783
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-main", children: i }),
784
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-rail", children: W })
785
- ] }) : i }),
786
- f
787
- ] }) : T ? /* @__PURE__ */ t(
788
- Ve,
782
+ return h ? /* @__PURE__ */ l("div", { className: "w6w-tester-embedded", children: [
783
+ /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-scroll", children: /* @__PURE__ */ l("div", { className: "w6w-card-stack", children: [
784
+ /* @__PURE__ */ l("div", { className: "card", children: [
785
+ /* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ t("h3", { children: "Parameters" }) }),
786
+ /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
787
+ st,
788
+ lt,
789
+ w
790
+ ] })
791
+ ] }),
792
+ (x || S.length > 0) && /* @__PURE__ */ l("div", { className: "card", children: [
793
+ /* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ t("h3", { children: "Result" }) }),
794
+ /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
795
+ I !== void 0 && /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(I, null, 2) }),
796
+ /* @__PURE__ */ t(ot, { calls: S })
797
+ ] })
798
+ ] }),
799
+ we && /* @__PURE__ */ l("div", { className: "card", children: [
800
+ /* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ t("h3", { children: "Saved tests and history" }) }),
801
+ we
802
+ ] })
803
+ ] }) }),
804
+ Y
805
+ ] }) : b ? /* @__PURE__ */ t(
806
+ Fe,
789
807
  {
790
808
  title: `Edit params — ${y.title ?? y.key}`,
791
- onClose: () => Me(!1),
809
+ onClose: () => $(!1),
792
810
  size: "full",
793
- children: /* @__PURE__ */ o("div", { className: "w6w-tester-popout", children: [
794
- /* @__PURE__ */ t("div", { className: "w6w-tester-popout-scroll", children: W ? /* @__PURE__ */ o(
811
+ children: /* @__PURE__ */ l("div", { className: "w6w-tester-popout", children: [
812
+ /* @__PURE__ */ t("div", { className: "w6w-tester-popout-scroll", children: we ? /* @__PURE__ */ l(
795
813
  "div",
796
814
  {
797
815
  style: {
@@ -800,39 +818,39 @@ function Ps({
800
818
  alignItems: "flex-start"
801
819
  },
802
820
  children: [
803
- /* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: i }),
804
- /* @__PURE__ */ t("div", { style: { width: 260, flexShrink: 0 }, children: W })
821
+ /* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: _ }),
822
+ /* @__PURE__ */ t("div", { style: { width: 260, flexShrink: 0 }, children: we })
805
823
  ]
806
824
  }
807
- ) : i }),
808
- f
825
+ ) : _ }),
826
+ Y
809
827
  ] })
810
828
  }
811
- ) : g;
829
+ ) : W;
812
830
  })(),
813
- vt && /* @__PURE__ */ t(Ve, { title: "Save test", onClose: () => K(!1), children: /* @__PURE__ */ o(
831
+ Lt && /* @__PURE__ */ t(Fe, { title: "Save test", onClose: () => ue(!1), children: /* @__PURE__ */ l(
814
832
  "form",
815
833
  {
816
834
  className: "w6w-stack",
817
835
  style: { gap: "var(--w6w-sp-3)" },
818
- onSubmit: (i) => {
819
- i.preventDefault(), He();
836
+ onSubmit: (w) => {
837
+ w.preventDefault(), at();
820
838
  },
821
839
  children: [
822
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
840
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
823
841
  /* @__PURE__ */ t("span", { children: "Name this saved test" }),
824
842
  /* @__PURE__ */ t(
825
843
  "input",
826
844
  {
827
845
  type: "text",
828
- value: ae,
846
+ value: Ce,
829
847
  placeholder: "e.g. valid sender",
830
- onChange: (i) => re(i.target.value)
848
+ onChange: (w) => Se(w.target.value)
831
849
  }
832
850
  )
833
851
  ] }),
834
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
835
- /* @__PURE__ */ o(
852
+ de && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: de }),
853
+ /* @__PURE__ */ l(
836
854
  "div",
837
855
  {
838
856
  style: { display: "flex", gap: "var(--w6w-sp-2)", justifyContent: "flex-end" },
@@ -842,71 +860,48 @@ function Ps({
842
860
  {
843
861
  type: "button",
844
862
  className: "w6w-btn w6w-btn-ghost",
845
- onClick: () => K(!1),
863
+ onClick: () => ue(!1),
846
864
  children: "Cancel"
847
865
  }
848
866
  ),
849
- /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: !ae.trim(), children: "Save" })
867
+ /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: !Ce.trim(), children: "Save" })
850
868
  ]
851
869
  }
852
870
  )
853
871
  ]
854
872
  }
855
873
  ) }),
856
- yt && /* @__PURE__ */ t(
857
- Pt,
874
+ Ut && /* @__PURE__ */ t(
875
+ Yt,
858
876
  {
859
877
  title: "Delete saved test",
860
- message: je ? `Delete "${je}"? This cannot be undone.` : "Delete this saved test? This cannot be undone.",
878
+ message: it ? `Delete "${it}"? This cannot be undone.` : "Delete this saved test? This cannot be undone.",
861
879
  confirmLabel: "Delete",
862
880
  onConfirm: () => {
863
- le(!1), Ct();
881
+ $e(!1), Wt();
864
882
  },
865
- onClose: () => le(!1)
883
+ onClose: () => $e(!1)
866
884
  }
867
885
  )
868
- ] }) : !l && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Pick an action above to test it." })
886
+ ] }) : !i && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Pick an action above to test it." })
869
887
  ] });
870
888
  }
871
- function Is(e) {
872
- const s = It(e.theme), { copied: n, copy: l } = Dt(e.value), d = ye(
873
- () => [
874
- Lt(),
875
- Bt.theme({
876
- "&": {
877
- fontSize: "13px",
878
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
879
- backgroundColor: "var(--w6w-panel-2)",
880
- color: "var(--w6w-text)",
881
- border: "1px solid var(--w6w-border)",
882
- borderRadius: "8px"
883
- },
884
- "&.cm-focused": { outline: "2px solid var(--w6w-accent)" },
885
- ".cm-gutters": {
886
- backgroundColor: "var(--w6w-panel)",
887
- color: "var(--w6w-muted)",
888
- border: "none",
889
- borderRight: "1px solid var(--w6w-border)"
890
- },
891
- ".cm-scroller": { overflow: "auto" }
892
- })
893
- ],
894
- []
895
- );
896
- function a(r) {
897
- e.onChange(r);
889
+ function fa(e) {
890
+ const n = Qt(e.theme), { copied: a, copy: i } = on(e.value), o = De(() => [ln(), rn.theme(Zt)], []);
891
+ function c(s) {
892
+ e.onChange(s);
898
893
  }
899
- return /* @__PURE__ */ o("div", { className: "w6w-yaml-editor", "aria-label": e["aria-label"] ?? "YAML editor", children: [
894
+ return /* @__PURE__ */ l("div", { className: "w6w-yaml-editor", "aria-label": e["aria-label"] ?? "YAML editor", children: [
900
895
  /* @__PURE__ */ t(
901
- Jt,
896
+ cn,
902
897
  {
903
898
  value: e.value,
904
- onChange: a,
905
- extensions: d,
899
+ onChange: c,
900
+ extensions: o,
906
901
  placeholder: e.placeholder,
907
902
  readOnly: e.readOnly,
908
903
  editable: !e.readOnly,
909
- theme: s,
904
+ theme: n,
910
905
  height: e.height,
911
906
  minHeight: e.minHeight ?? "240px",
912
907
  maxHeight: e.maxHeight,
@@ -920,128 +915,128 @@ function Is(e) {
920
915
  }
921
916
  }
922
917
  ),
923
- e.copyable && /* @__PURE__ */ o(k, { children: [
918
+ e.copyable && /* @__PURE__ */ l(A, { children: [
924
919
  /* @__PURE__ */ t(
925
920
  "button",
926
921
  {
927
922
  type: "button",
928
- className: `w6w-icon-btn w6w-copyable-btn${n ? " is-copied" : ""}`,
923
+ className: `w6w-icon-btn w6w-copyable-btn${a ? " is-copied" : ""}`,
929
924
  "aria-label": "Copy",
930
- onClick: () => void l(),
931
- children: n ? /* @__PURE__ */ t(Ht, {}) : /* @__PURE__ */ t(jt, {})
925
+ onClick: () => void i(),
926
+ children: a ? /* @__PURE__ */ t(dn, {}) : /* @__PURE__ */ t(un, {})
932
927
  }
933
928
  ),
934
- /* @__PURE__ */ t("span", { className: "w6w-copyable-status", "aria-live": "polite", children: n ? "Copied" : "" })
929
+ /* @__PURE__ */ t("span", { className: "w6w-copyable-status", "aria-live": "polite", children: a ? "Copied" : "" })
935
930
  ] })
936
931
  ] });
937
932
  }
938
- const we = "…";
939
- function Qt(e, s, n = "end") {
940
- if (s === void 0 || s < 1 || s >= e.length) return e;
941
- if (n === "start")
942
- return `${we}${e.slice(e.length - s)}`;
943
- if (n === "end")
944
- return `${e.slice(0, s)}${we}`;
945
- const l = Math.ceil(s / 2), d = s - l;
946
- return `${e.slice(0, l)}${we}${e.slice(e.length - d)}`;
947
- }
948
- function Us(e) {
949
- const { value: s, chars: n, crop: l = "end", label: d, className: a, copiedMs: r } = e, c = Qt(s, n, l), u = ["w6w-copyable--bare", a].filter(Boolean).join(" ");
950
- return /* @__PURE__ */ t(qt, { value: s, readOnly: !0, label: d, className: u, copiedMs: r, children: /* @__PURE__ */ t("span", { children: c }) });
951
- }
952
- const Yt = {
933
+ const Ee = "…";
934
+ function fn(e, n, a = "end") {
935
+ if (n === void 0 || n < 1 || n >= e.length) return e;
936
+ if (a === "start")
937
+ return `${Ee}${e.slice(e.length - n)}`;
938
+ if (a === "end")
939
+ return `${e.slice(0, n)}${Ee}`;
940
+ const i = Math.ceil(n / 2), o = n - i;
941
+ return `${e.slice(0, i)}${Ee}${e.slice(e.length - o)}`;
942
+ }
943
+ function vn(e) {
944
+ const { value: n, chars: a, crop: i = "end", label: o, className: c, copiedMs: s } = e, r = fn(n, a, i), d = ["w6w-copyable--bare", c].filter(Boolean).join(" ");
945
+ return /* @__PURE__ */ t(wn, { value: n, readOnly: !0, label: o, className: d, copiedMs: s, children: /* @__PURE__ */ t("span", { children: r }) });
946
+ }
947
+ const yn = {
953
948
  ok: "Operational",
954
949
  degraded: "Degraded",
955
950
  down: "Down",
956
951
  unknown: "Unknown"
957
952
  };
958
- function Fs({ state: e, label: s, ariaLabel: n }) {
959
- const l = s ?? Yt[e];
960
- return /* @__PURE__ */ o("span", { className: `w6w-health-pill w6w-health-pill-${e}`, "aria-label": n, children: [
953
+ function We({ state: e, label: n, ariaLabel: a }) {
954
+ const i = n ?? yn[e];
955
+ return /* @__PURE__ */ l("span", { className: `w6w-health-pill w6w-health-pill-${e}`, "aria-label": a, children: [
961
956
  /* @__PURE__ */ t("span", { className: "w6w-health-pill-dot", "aria-hidden": "true" }),
962
- /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: l })
957
+ /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: i })
963
958
  ] });
964
959
  }
965
- const Zt = {
960
+ const Nn = {
966
961
  ok: "Operational",
967
962
  degraded: "Degraded",
968
963
  down: "Down",
969
964
  unknown: "Unknown"
970
965
  };
971
- function Ls({ days: e, ariaLabel: s }) {
966
+ function gn({ days: e, ariaLabel: n }) {
972
967
  return e.length === 0 ? null : /* @__PURE__ */ t(
973
968
  "div",
974
969
  {
975
970
  className: "w6w-uptime-strip",
976
971
  role: "img",
977
- "aria-label": s ?? `${e.length}-day status`,
978
- children: e.map((n, l) => /* @__PURE__ */ t(
972
+ "aria-label": n ?? `${e.length}-day status`,
973
+ children: e.map((a, i) => /* @__PURE__ */ t(
979
974
  "span",
980
975
  {
981
- className: `w6w-uptime-cell w6w-uptime-cell-${n.state}`,
982
- title: n.label ?? `${n.day} — ${Zt[n.state]}`
976
+ className: `w6w-uptime-cell w6w-uptime-cell-${a.state}`,
977
+ title: a.label ?? `${a.day} — ${Nn[a.state]}`
983
978
  },
984
- `${n.day}-${l}`
979
+ `${a.day}-${i}`
985
980
  ))
986
981
  }
987
982
  );
988
983
  }
989
- const st = "—", Ye = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
990
- function Xt(e) {
991
- if (e === null || !Number.isFinite(e)) return st;
984
+ const xt = "—", wt = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
985
+ function bn(e) {
986
+ if (e === null || !Number.isFinite(e)) return xt;
992
987
  if (e < 1024) return `${Math.round(e)} B`;
993
- let s = e, n = 0;
994
- for (; s >= 1024 && n < Ye.length - 1; )
995
- s /= 1024, n += 1;
996
- return `${s.toFixed(1)} ${Ye[n]}`;
988
+ let n = e, a = 0;
989
+ for (; n >= 1024 && a < wt.length - 1; )
990
+ n /= 1024, a += 1;
991
+ return `${n.toFixed(1)} ${wt[a]}`;
997
992
  }
998
- function $(e) {
999
- return e === null || !Number.isFinite(e) ? st : `${Math.round(e * 100)}%`;
993
+ function q(e) {
994
+ return e === null || !Number.isFinite(e) ? xt : `${Math.round(e * 100)}%`;
1000
995
  }
1001
- function B(e) {
996
+ function se(e) {
1002
997
  if (e === void 0 || e.load1 === null) return null;
1003
- const s = e.cpuLimit ?? e.cpus;
1004
- return s === null || s <= 0 ? null : e.load1 / s;
998
+ const n = e.cpuLimit ?? e.cpus;
999
+ return n === null || n <= 0 ? null : e.load1 / n;
1005
1000
  }
1006
- function J(e) {
1001
+ function le(e) {
1007
1002
  if (e === void 0) return null;
1008
- const { memoryTotal: s, memoryAvailable: n } = e;
1009
- return s === null || n === null || s <= 0 ? null : (s - n) / s;
1010
- }
1011
- function es(e, s, n) {
1012
- return e < s ? s : e > n ? n : e;
1013
- }
1014
- function ts(e, s, n, l) {
1015
- const d = e.length;
1016
- if (d < 2) return "";
1017
- const a = [];
1018
- for (let r = 0; r < d; r++) {
1019
- const c = e[r];
1020
- if (c === null) continue;
1021
- const u = r / (d - 1) * s, w = l <= 0 ? n : n - es(c, 0, l) / l * n;
1022
- a.push(`${Number(u.toFixed(2))},${Number(w.toFixed(2))}`);
1003
+ const { memoryTotal: n, memoryAvailable: a } = e;
1004
+ return n === null || a === null || n <= 0 ? null : (n - a) / n;
1005
+ }
1006
+ function kn(e, n, a) {
1007
+ return e < n ? n : e > a ? a : e;
1008
+ }
1009
+ function xn(e, n, a, i) {
1010
+ const o = e.length;
1011
+ if (o < 2) return "";
1012
+ const c = [];
1013
+ for (let s = 0; s < o; s++) {
1014
+ const r = e[s];
1015
+ if (r === null) continue;
1016
+ const d = s / (o - 1) * n, u = i <= 0 ? a : a - kn(r, 0, i) / i * a;
1017
+ c.push(`${Number(d.toFixed(2))},${Number(u.toFixed(2))}`);
1023
1018
  }
1024
- return a.join(" ");
1019
+ return c.join(" ");
1025
1020
  }
1026
- const ss = "—", Ze = 100, Xe = 24;
1027
- function ge({
1021
+ const Cn = "—", ht = 100, mt = 24;
1022
+ function Je({
1028
1023
  values: e,
1029
- max: s,
1030
- className: n
1024
+ max: n,
1025
+ className: a
1031
1026
  }) {
1032
- const l = ts(e, Ze, Xe, s);
1033
- return l === "" ? null : /* @__PURE__ */ t(
1027
+ const i = xn(e, ht, mt, n);
1028
+ return i === "" ? null : /* @__PURE__ */ t(
1034
1029
  "svg",
1035
1030
  {
1036
- className: n,
1037
- viewBox: `0 0 ${Ze} ${Xe}`,
1031
+ className: a,
1032
+ viewBox: `0 0 ${ht} ${mt}`,
1038
1033
  preserveAspectRatio: "none",
1039
1034
  "aria-hidden": "true",
1040
1035
  focusable: "false",
1041
1036
  children: /* @__PURE__ */ t(
1042
1037
  "polyline",
1043
1038
  {
1044
- points: l,
1039
+ points: i,
1045
1040
  fill: "none",
1046
1041
  stroke: "var(--w6w-accent)",
1047
1042
  strokeWidth: 2,
@@ -1051,279 +1046,279 @@ function ge({
1051
1046
  }
1052
1047
  );
1053
1048
  }
1054
- function me(e) {
1055
- return e === null ? ss : e.toFixed(2);
1049
+ function Me(e) {
1050
+ return e === null ? Cn : e.toFixed(2);
1056
1051
  }
1057
- function Z(e) {
1058
- let s = 1;
1059
- for (const n of e) n !== null && n > s && (s = n);
1060
- return s;
1052
+ function Ne(e) {
1053
+ let n = 1;
1054
+ for (const a of e) a !== null && a > n && (n = a);
1055
+ return n;
1061
1056
  }
1062
- function Q({
1057
+ function ve({
1063
1058
  label: e,
1064
- value: s,
1065
- values: n,
1066
- max: l
1059
+ value: n,
1060
+ values: a,
1061
+ max: i
1067
1062
  }) {
1068
- return /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1063
+ return /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1069
1064
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: e }),
1070
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: s }),
1071
- /* @__PURE__ */ t(ge, { className: "w6w-server-resources__spark", values: n, max: l })
1065
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: n }),
1066
+ /* @__PURE__ */ t(Je, { className: "w6w-server-resources__spark", values: a, max: i })
1072
1067
  ] });
1073
1068
  }
1074
- function xe(e) {
1075
- const s = e[e.length - 1], n = e.map((a) => B(a)), l = e.map((a) => J(a)), d = e.map((a) => a.processRss);
1076
- return { last: s, cpuValues: n, memoryValues: l, rssValues: d };
1069
+ function qe(e) {
1070
+ const n = e[e.length - 1], a = e.map((c) => se(c)), i = e.map((c) => le(c)), o = e.map((c) => c.processRss);
1071
+ return { last: n, cpuValues: a, memoryValues: i, rssValues: o };
1077
1072
  }
1078
- function Bs({
1073
+ function va({
1079
1074
  samples: e,
1080
- title: s = "Server resources",
1081
- intervalMs: n
1075
+ title: n = "Server resources",
1076
+ intervalMs: a
1082
1077
  }) {
1083
- const { last: l, cpuValues: d, memoryValues: a, rssValues: r } = xe(e);
1084
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--card", "aria-label": s, children: [
1085
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1086
- /* @__PURE__ */ o("ul", { className: "w6w-server-resources__rows", children: [
1078
+ const { last: i, cpuValues: o, memoryValues: c, rssValues: s } = qe(e);
1079
+ return /* @__PURE__ */ l("section", { className: "w6w-server-resources w6w-server-resources--card", "aria-label": n, children: [
1080
+ /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: n }),
1081
+ /* @__PURE__ */ l("ul", { className: "w6w-server-resources__rows", children: [
1087
1082
  /* @__PURE__ */ t(
1088
- Q,
1083
+ ve,
1089
1084
  {
1090
1085
  label: "CPU",
1091
- value: $(B(l)),
1092
- values: d,
1093
- max: Z(d)
1086
+ value: q(se(i)),
1087
+ values: o,
1088
+ max: Ne(o)
1094
1089
  }
1095
1090
  ),
1096
1091
  /* @__PURE__ */ t(
1097
- Q,
1092
+ ve,
1098
1093
  {
1099
1094
  label: "Memory",
1100
- value: $(J(l)),
1101
- values: a,
1095
+ value: q(le(i)),
1096
+ values: c,
1102
1097
  max: 1
1103
1098
  }
1104
1099
  ),
1105
1100
  /* @__PURE__ */ t(
1106
- Q,
1101
+ ve,
1107
1102
  {
1108
1103
  label: "Process",
1109
- value: Xt((l == null ? void 0 : l.processRss) ?? null),
1110
- values: r,
1111
- max: Z(r)
1104
+ value: bn((i == null ? void 0 : i.processRss) ?? null),
1105
+ values: s,
1106
+ max: Ne(s)
1112
1107
  }
1113
1108
  )
1114
1109
  ] }),
1115
- /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Load ${me((l == null ? void 0 : l.load1) ?? null)} / ${me((l == null ? void 0 : l.load5) ?? null)} / ${me(
1116
- (l == null ? void 0 : l.load15) ?? null
1110
+ /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Load ${Me((i == null ? void 0 : i.load1) ?? null)} / ${Me((i == null ? void 0 : i.load5) ?? null)} / ${Me(
1111
+ (i == null ? void 0 : i.load15) ?? null
1117
1112
  )}` }),
1118
- n !== void 0 && /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Sampled every ${n / 1e3}s` })
1113
+ a !== void 0 && /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Sampled every ${a / 1e3}s` })
1119
1114
  ] });
1120
1115
  }
1121
- function Js({ samples: e, title: s = "Server" }) {
1122
- const { last: n, cpuValues: l } = xe(e);
1123
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--small", "aria-label": s, children: [
1124
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1125
- /* @__PURE__ */ o("ul", { className: "w6w-server-resources__rows", children: [
1116
+ function ya({ samples: e, title: n = "Server" }) {
1117
+ const { last: a, cpuValues: i } = qe(e);
1118
+ return /* @__PURE__ */ l("section", { className: "w6w-server-resources w6w-server-resources--small", "aria-label": n, children: [
1119
+ /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: n }),
1120
+ /* @__PURE__ */ l("ul", { className: "w6w-server-resources__rows", children: [
1126
1121
  /* @__PURE__ */ t(
1127
- Q,
1122
+ ve,
1128
1123
  {
1129
1124
  label: "CPU",
1130
- value: $(B(n)),
1131
- values: l,
1132
- max: Z(l)
1125
+ value: q(se(a)),
1126
+ values: i,
1127
+ max: Ne(i)
1133
1128
  }
1134
1129
  ),
1135
- /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1130
+ /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1136
1131
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "Memory" }),
1137
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) })
1132
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: q(le(a)) })
1138
1133
  ] })
1139
1134
  ] })
1140
1135
  ] });
1141
1136
  }
1142
- function Ds({ samples: e, onExpand: s }) {
1143
- const { last: n, cpuValues: l, memoryValues: d } = xe(e);
1144
- return /* @__PURE__ */ o("aside", { className: "w6w-server-resources w6w-server-resources--rail", children: [
1145
- /* @__PURE__ */ o("div", { className: "w6w-server-resources__rail-row", children: [
1137
+ function Na({ samples: e, onExpand: n }) {
1138
+ const { last: a, cpuValues: i, memoryValues: o } = qe(e);
1139
+ return /* @__PURE__ */ l("aside", { className: "w6w-server-resources w6w-server-resources--rail", children: [
1140
+ /* @__PURE__ */ l("div", { className: "w6w-server-resources__rail-row", children: [
1146
1141
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "CPU" }),
1147
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(B(n)) }),
1142
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: q(se(a)) }),
1148
1143
  /* @__PURE__ */ t(
1149
- ge,
1144
+ Je,
1150
1145
  {
1151
1146
  className: "w6w-server-resources__spark",
1152
- values: l,
1153
- max: Z(l)
1147
+ values: i,
1148
+ max: Ne(i)
1154
1149
  }
1155
1150
  )
1156
1151
  ] }),
1157
- /* @__PURE__ */ o("div", { className: "w6w-server-resources__rail-row", children: [
1152
+ /* @__PURE__ */ l("div", { className: "w6w-server-resources__rail-row", children: [
1158
1153
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "MEM" }),
1159
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) }),
1160
- /* @__PURE__ */ t(ge, { className: "w6w-server-resources__spark", values: d, max: 1 })
1154
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: q(le(a)) }),
1155
+ /* @__PURE__ */ t(Je, { className: "w6w-server-resources__spark", values: o, max: 1 })
1161
1156
  ] }),
1162
- s !== void 0 && /* @__PURE__ */ t(
1157
+ n !== void 0 && /* @__PURE__ */ t(
1163
1158
  "button",
1164
1159
  {
1165
1160
  type: "button",
1166
1161
  className: "w6w-server-resources__expand",
1167
1162
  "aria-label": "Show server resources",
1168
- onClick: s,
1163
+ onClick: n,
1169
1164
  children: "Details"
1170
1165
  }
1171
1166
  )
1172
1167
  ] });
1173
1168
  }
1174
- function Hs({ samples: e }) {
1175
- const s = e[e.length - 1], n = $(B(s)), l = $(J(s));
1176
- return /* @__PURE__ */ t("span", { className: "w6w-server-resources w6w-server-resources--badge", children: `CPU ${n} · MEM ${l}` });
1169
+ function ga({ samples: e }) {
1170
+ const n = e[e.length - 1], a = q(se(n)), i = q(le(n));
1171
+ return /* @__PURE__ */ t("span", { className: "w6w-server-resources w6w-server-resources--badge", children: `CPU ${a} · MEM ${i}` });
1177
1172
  }
1178
- const ns = 1, as = 1440 * 60 * 1e3;
1179
- function rs(e, s, n) {
1180
- const l = s.startedAt ?? s.updatedAt;
1181
- if (l === void 0) return null;
1182
- const d = Date.parse(l), a = s.resolvedAt !== void 0 ? Date.parse(s.resolvedAt) : s.startedAt !== void 0 ? n : d, r = Date.parse(`${e.from}T00:00:00.000Z`), c = Date.parse(`${e.to}T00:00:00.000Z`) + as, u = c - r;
1183
- if (a < r || d >= c) return null;
1184
- const w = d < r, h = a > c, m = Math.max(d, r), p = Math.min(a, c), N = (m - r) / u * 100, ee = (p - m) / u * 100, y = Math.max(ee, ns);
1185
- return { leftPct: N, widthPct: y, clippedStart: w, clippedEnd: h };
1173
+ const Sn = 1, $n = 1440 * 60 * 1e3;
1174
+ function Tn(e, n, a) {
1175
+ const i = n.startedAt ?? n.updatedAt;
1176
+ if (i === void 0) return null;
1177
+ const o = Date.parse(i), c = n.resolvedAt !== void 0 ? Date.parse(n.resolvedAt) : n.startedAt !== void 0 ? a : o, s = Date.parse(`${e.from}T00:00:00.000Z`), r = Date.parse(`${e.to}T00:00:00.000Z`) + $n, d = r - s;
1178
+ if (c < s || o >= r) return null;
1179
+ const u = o < s, h = c > r, f = Math.max(o, s), v = Math.min(c, r), m = (f - s) / d * 100, N = (v - f) / d * 100, y = Math.max(N, Sn);
1180
+ return { leftPct: m, widthPct: y, clippedStart: u, clippedEnd: h };
1186
1181
  }
1187
- const ls = {
1182
+ const An = {
1188
1183
  ok: "Operational",
1189
1184
  degraded: "Degraded",
1190
1185
  down: "Down",
1191
1186
  unknown: "Unknown"
1192
- }, is = "This vendor publishes no incident history.", os = "No incidents in this window.";
1193
- function cs(e) {
1194
- const s = e.startedAt ?? e.updatedAt, n = [e.title];
1195
- return e.components !== void 0 && e.components.length > 0 && n.push(`(${e.components.join(", ")})`), s !== void 0 && n.push(
1196
- e.resolvedAt !== void 0 ? `${s} – ${e.resolvedAt}` : `${s} – ongoing`
1197
- ), n.join(" ");
1198
- }
1199
- function js({
1187
+ }, Rn = "This vendor publishes no incident history.", In = "No incidents in this window.";
1188
+ function On(e) {
1189
+ const n = e.startedAt ?? e.updatedAt, a = [e.title];
1190
+ return e.components !== void 0 && e.components.length > 0 && a.push(`(${e.components.join(", ")})`), n !== void 0 && a.push(
1191
+ e.resolvedAt !== void 0 ? `${n} – ${e.resolvedAt}` : `${n} – ongoing`
1192
+ ), a.join(" ");
1193
+ }
1194
+ function ba({
1200
1195
  window: e,
1201
- days: s,
1202
- incidents: n,
1203
- vendorEmptyLabel: l,
1204
- nowMs: d = Date.now(),
1205
- ariaLabel: a
1196
+ days: n,
1197
+ incidents: a,
1198
+ vendorEmptyLabel: i,
1199
+ nowMs: o = Date.now(),
1200
+ ariaLabel: c
1206
1201
  }) {
1207
- const r = s.length, c = r > 0 ? 100 / r : 0, u = n === void 0 ? l ?? is : n.length === 0 ? l ?? os : null;
1208
- return /* @__PURE__ */ t("div", { className: "w6w-history-timeline", role: "img", "aria-label": a ?? `${r}-day history`, children: /* @__PURE__ */ o("div", { className: "w6w-history-plot", children: [
1209
- /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-execution", children: s.map((w, h) => /* @__PURE__ */ t(
1202
+ const s = n.length, r = s > 0 ? 100 / s : 0, d = a === void 0 ? i ?? Rn : a.length === 0 ? i ?? In : null;
1203
+ return /* @__PURE__ */ t("div", { className: "w6w-history-timeline", role: "img", "aria-label": c ?? `${s}-day history`, children: /* @__PURE__ */ l("div", { className: "w6w-history-plot", children: [
1204
+ /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-execution", children: n.map((u, h) => /* @__PURE__ */ t(
1210
1205
  "span",
1211
1206
  {
1212
- className: `w6w-history-cell w6w-history-cell-${w.state}`,
1213
- style: { left: `${h * c}%`, width: `${c}%` },
1214
- title: w.label ?? `${w.day} — ${ls[w.state]}`
1207
+ className: `w6w-history-cell w6w-history-cell-${u.state}`,
1208
+ style: { left: `${h * r}%`, width: `${r}%` },
1209
+ title: u.label ?? `${u.day} — ${An[u.state]}`
1215
1210
  },
1216
- `${w.day}-${h}`
1211
+ `${u.day}-${h}`
1217
1212
  )) }),
1218
- /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-vendor", children: u !== null ? /* @__PURE__ */ t("span", { className: "w6w-history-empty", title: u, children: u }) : n == null ? void 0 : n.map((w, h) => {
1219
- const m = rs(e, w, d);
1220
- if (m === null) return null;
1221
- const p = [
1222
- m.clippedStart ? "w6w-history-bar-clip-start" : "",
1223
- m.clippedEnd ? "w6w-history-bar-clip-end" : ""
1213
+ /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-vendor", children: d !== null ? /* @__PURE__ */ t("span", { className: "w6w-history-empty", title: d, children: d }) : a == null ? void 0 : a.map((u, h) => {
1214
+ const f = Tn(e, u, o);
1215
+ if (f === null) return null;
1216
+ const v = [
1217
+ f.clippedStart ? "w6w-history-bar-clip-start" : "",
1218
+ f.clippedEnd ? "w6w-history-bar-clip-end" : ""
1224
1219
  ].filter(Boolean).join(" ");
1225
1220
  return /* @__PURE__ */ t(
1226
1221
  "span",
1227
1222
  {
1228
- className: `w6w-history-bar w6w-history-bar-${w.state}${p ? ` ${p}` : ""}`,
1229
- style: { left: `${m.leftPct}%`, width: `${m.widthPct}%` },
1230
- title: cs(w)
1223
+ className: `w6w-history-bar w6w-history-bar-${u.state}${v ? ` ${v}` : ""}`,
1224
+ style: { left: `${f.leftPct}%`, width: `${f.widthPct}%` },
1225
+ title: On(u)
1231
1226
  },
1232
- w.id ?? `${w.title}-${h}`
1227
+ u.id ?? `${u.title}-${h}`
1233
1228
  );
1234
1229
  }) }),
1235
- /* @__PURE__ */ o("div", { className: "w6w-history-axis", children: [
1230
+ /* @__PURE__ */ l("div", { className: "w6w-history-axis", children: [
1236
1231
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-start", style: { left: "0%" }, children: e.from }),
1237
1232
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-end", style: { left: "100%" }, children: e.to })
1238
1233
  ] })
1239
1234
  ] }) });
1240
1235
  }
1241
- function qs({ label: e, children: s, className: n }) {
1242
- const [l, d] = v(!1), a = Ut();
1243
- return /* @__PURE__ */ o("span", { className: ["w6w-info-tip", n ?? ""].filter(Boolean).join(" "), children: [
1236
+ function ka({ label: e, children: n, className: a }) {
1237
+ const [i, o] = g(!1), c = an();
1238
+ return /* @__PURE__ */ l("span", { className: ["w6w-info-tip", a ?? ""].filter(Boolean).join(" "), children: [
1244
1239
  /* @__PURE__ */ t(
1245
- L,
1240
+ ae,
1246
1241
  {
1247
1242
  label: e,
1248
1243
  icon: "info",
1249
- "aria-expanded": l,
1250
- "aria-controls": a,
1251
- onClick: () => d((r) => !r)
1244
+ "aria-expanded": i,
1245
+ "aria-controls": c,
1246
+ onClick: () => o((s) => !s)
1252
1247
  }
1253
1248
  ),
1254
- l && /* @__PURE__ */ t("span", { id: a, className: "w6w-info-tip-body w6w-muted w6w-small", children: s })
1249
+ i && /* @__PURE__ */ t("span", { id: c, className: "w6w-info-tip-body w6w-muted w6w-small", children: n })
1255
1250
  ] });
1256
1251
  }
1257
- function Ks(e) {
1258
- const { label: s, onClick: n, disabled: l, className: d, ...a } = e;
1252
+ function En(e) {
1253
+ const { label: n, onClick: a, disabled: i, className: o, ...c } = e;
1259
1254
  return /* @__PURE__ */ t(
1260
- L,
1255
+ ae,
1261
1256
  {
1262
- label: s,
1263
- onClick: n,
1264
- disabled: l,
1265
- className: d,
1257
+ label: n,
1258
+ onClick: a,
1259
+ disabled: i,
1260
+ className: o,
1266
1261
  icon: "edit",
1267
- "data-testid": a["data-testid"]
1262
+ "data-testid": c["data-testid"]
1268
1263
  }
1269
1264
  );
1270
1265
  }
1271
- function Ws(e) {
1272
- const { label: s, onClick: n, disabled: l, className: d, ...a } = e;
1266
+ function Mn(e) {
1267
+ const { label: n, onClick: a, disabled: i, className: o, ...c } = e;
1273
1268
  return /* @__PURE__ */ t(
1274
- L,
1269
+ ae,
1275
1270
  {
1276
- label: s,
1277
- onClick: n,
1278
- disabled: l,
1279
- className: d,
1271
+ label: n,
1272
+ onClick: a,
1273
+ disabled: i,
1274
+ className: o,
1280
1275
  danger: !0,
1281
1276
  icon: "delete",
1282
- "data-testid": a["data-testid"]
1277
+ "data-testid": c["data-testid"]
1283
1278
  }
1284
1279
  );
1285
1280
  }
1286
- function Vs(e) {
1287
- const { branch: s, shortSha: n, lastSyncLabel: l, onSyncNow: d, syncing: a, className: r, ...c } = e, [u, w] = v(!1), h = Ft(null);
1288
- return G(() => {
1289
- if (!u) return;
1290
- const m = (N) => {
1291
- h.current && !h.current.contains(N.target) && w(!1);
1292
- }, p = (N) => N.key === "Escape" && w(!1);
1293
- return document.addEventListener("mousedown", m), document.addEventListener("keydown", p), () => {
1294
- document.removeEventListener("mousedown", m), document.removeEventListener("keydown", p);
1281
+ function xa(e) {
1282
+ const { branch: n, shortSha: a, lastSyncLabel: i, onSyncNow: o, syncing: c, className: s, ...r } = e, [d, u] = g(!1), h = sn(null);
1283
+ return Q(() => {
1284
+ if (!d) return;
1285
+ const f = (m) => {
1286
+ h.current && !h.current.contains(m.target) && u(!1);
1287
+ }, v = (m) => m.key === "Escape" && u(!1);
1288
+ return document.addEventListener("mousedown", f), document.addEventListener("keydown", v), () => {
1289
+ document.removeEventListener("mousedown", f), document.removeEventListener("keydown", v);
1295
1290
  };
1296
- }, [u]), /* @__PURE__ */ o(
1291
+ }, [d]), /* @__PURE__ */ l(
1297
1292
  "div",
1298
1293
  {
1299
- className: `w6w-repo-sync${r ? ` ${r}` : ""}`,
1294
+ className: `w6w-repo-sync${s ? ` ${s}` : ""}`,
1300
1295
  ref: h,
1301
- "data-testid": c["data-testid"],
1296
+ "data-testid": r["data-testid"],
1302
1297
  children: [
1303
- /* @__PURE__ */ o(
1298
+ /* @__PURE__ */ l(
1304
1299
  "button",
1305
1300
  {
1306
1301
  type: "button",
1307
1302
  className: "w6w-repo-sync-trigger",
1308
1303
  "aria-haspopup": "menu",
1309
- "aria-expanded": u,
1310
- "aria-busy": a,
1311
- onClick: () => w((m) => !m),
1304
+ "aria-expanded": d,
1305
+ "aria-busy": c,
1306
+ onClick: () => u((f) => !f),
1312
1307
  children: [
1313
- /* @__PURE__ */ o("span", { className: "w6w-repo-sync-icon", children: [
1314
- /* @__PURE__ */ t(ze, { name: "github" }),
1315
- a && /* @__PURE__ */ t(ze, { name: "sync", size: 10, className: "w6w-repo-sync-spin" })
1308
+ /* @__PURE__ */ l("span", { className: "w6w-repo-sync-icon", children: [
1309
+ /* @__PURE__ */ t(dt, { name: "github" }),
1310
+ c && /* @__PURE__ */ t(dt, { name: "sync", size: 10, className: "w6w-repo-sync-spin" })
1316
1311
  ] }),
1317
- /* @__PURE__ */ t("span", { className: "w6w-repo-sync-branch", children: s }),
1318
- n != null && /* @__PURE__ */ t("code", { className: "w6w-repo-sync-sha", children: n })
1312
+ /* @__PURE__ */ t("span", { className: "w6w-repo-sync-branch", children: n }),
1313
+ a != null && /* @__PURE__ */ t("code", { className: "w6w-repo-sync-sha", children: a })
1319
1314
  ]
1320
1315
  }
1321
1316
  ),
1322
- u && /* @__PURE__ */ o("div", { className: "w6w-repo-sync-menu", role: "menu", children: [
1323
- /* @__PURE__ */ o("div", { className: "w6w-repo-sync-detail", children: [
1324
- /* @__PURE__ */ t("span", { children: s }),
1325
- n != null && /* @__PURE__ */ t("code", { children: n }),
1326
- l != null && /* @__PURE__ */ t("span", { children: l })
1317
+ d && /* @__PURE__ */ l("div", { className: "w6w-repo-sync-menu", role: "menu", children: [
1318
+ /* @__PURE__ */ l("div", { className: "w6w-repo-sync-detail", children: [
1319
+ /* @__PURE__ */ t("span", { children: n }),
1320
+ a != null && /* @__PURE__ */ t("code", { children: a }),
1321
+ i != null && /* @__PURE__ */ t("span", { children: i })
1327
1322
  ] }),
1328
1323
  /* @__PURE__ */ t(
1329
1324
  "button",
@@ -1332,9 +1327,9 @@ function Vs(e) {
1332
1327
  role: "menuitem",
1333
1328
  className: "w6w-repo-sync-item",
1334
1329
  "data-testid": "repo-sync-now",
1335
- disabled: a,
1336
- onClick: d,
1337
- children: a ? "Syncing…" : "Sync now"
1330
+ disabled: c,
1331
+ onClick: o,
1332
+ children: c ? "Syncing…" : "Sync now"
1338
1333
  }
1339
1334
  )
1340
1335
  ] })
@@ -1342,7 +1337,7 @@ function Vs(e) {
1342
1337
  }
1343
1338
  );
1344
1339
  }
1345
- const ds = {
1340
+ const Pn = {
1346
1341
  pending: "Pending",
1347
1342
  running: "Running",
1348
1343
  succeeded: "Succeeded",
@@ -1351,47 +1346,47 @@ const ds = {
1351
1346
  queued: "Queued",
1352
1347
  canceled: "Canceled"
1353
1348
  };
1354
- function Se({ state: e, label: s, ariaLabel: n }) {
1355
- const l = s ?? ds[e];
1356
- return /* @__PURE__ */ o("span", { className: `w6w-step-pill w6w-step-pill-${e}`, "aria-label": n, children: [
1349
+ function Ve({ state: e, label: n, ariaLabel: a }) {
1350
+ const i = n ?? Pn[e];
1351
+ return /* @__PURE__ */ l("span", { className: `w6w-step-pill w6w-step-pill-${e}`, "aria-label": a, children: [
1357
1352
  /* @__PURE__ */ t("span", { className: "w6w-step-pill-dot", "aria-hidden": "true" }),
1358
- /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: l })
1353
+ /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: i })
1359
1354
  ] });
1360
1355
  }
1361
- const us = "—", he = 1e3, pe = 6e4;
1362
- function $e(e) {
1363
- return e == null || !Number.isFinite(e) || e < 0 ? us : e < he ? `${Math.round(e)} ms` : e < pe ? `${(e / he).toFixed(1)} s` : `${Math.floor(e / pe)}m ${Math.round(e % pe / he)}s`;
1356
+ const _n = "—", Pe = 1e3, _e = 6e4;
1357
+ function ze(e) {
1358
+ return e == null || !Number.isFinite(e) || e < 0 ? _n : e < Pe ? `${Math.round(e)} ms` : e < _e ? `${(e / Pe).toFixed(1)} s` : `${Math.floor(e / _e)}m ${Math.round(e % _e / Pe)}s`;
1364
1359
  }
1365
- function X(e) {
1366
- const s = new Date(e);
1367
- return Number.isNaN(s.getTime()) ? e : s.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
1360
+ function ge(e) {
1361
+ const n = new Date(e);
1362
+ return Number.isNaN(n.getTime()) ? e : n.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
1368
1363
  }
1369
- const ws = {
1364
+ const Ln = {
1370
1365
  function: "Function",
1371
1366
  endpoint: "Endpoint",
1372
1367
  workflow: "Workflow"
1373
1368
  };
1374
- function zs({
1369
+ function Ca({
1375
1370
  items: e,
1376
- selectedId: s = null,
1377
- onSelect: n,
1378
- showCallable: l = !1,
1379
- loading: d = !1,
1380
- emptyLabel: a,
1381
- hasPrev: r,
1382
- hasNext: c,
1383
- onPrev: u,
1384
- onNext: w
1371
+ selectedId: n = null,
1372
+ onSelect: a,
1373
+ showCallable: i = !1,
1374
+ loading: o = !1,
1375
+ emptyLabel: c,
1376
+ hasPrev: s,
1377
+ hasNext: r,
1378
+ onPrev: d,
1379
+ onNext: u
1385
1380
  }) {
1386
- const h = u || w ? /* @__PURE__ */ o("div", { className: "w6w-execution-list-pager", children: [
1381
+ const h = d || u ? /* @__PURE__ */ l("div", { className: "w6w-execution-list-pager", children: [
1387
1382
  /* @__PURE__ */ t(
1388
1383
  "button",
1389
1384
  {
1390
1385
  type: "button",
1391
1386
  className: "w6w-btn w6w-btn-ghost",
1392
1387
  "data-testid": "execution-list-prev",
1393
- disabled: !r,
1394
- onClick: u,
1388
+ disabled: !s,
1389
+ onClick: d,
1395
1390
  children: "Previous"
1396
1391
  }
1397
1392
  ),
@@ -1401,144 +1396,144 @@ function zs({
1401
1396
  type: "button",
1402
1397
  className: "w6w-btn w6w-btn-ghost",
1403
1398
  "data-testid": "execution-list-next",
1404
- disabled: !c,
1405
- onClick: w,
1399
+ disabled: !r,
1400
+ onClick: u,
1406
1401
  children: "Next"
1407
1402
  }
1408
1403
  )
1409
1404
  ] }) : null;
1410
- let m;
1411
- return d && e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-loading", children: "Loading…" }) : e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-empty", children: a ?? "No executions yet." }) : m = /* @__PURE__ */ t("ul", { className: "w6w-execution-list-rows", children: e.map((p) => /* @__PURE__ */ t("li", { "data-testid": "execution-row", "data-execution-id": p.id, children: /* @__PURE__ */ t(
1412
- Ne,
1405
+ let f;
1406
+ return o && e.length === 0 ? f = /* @__PURE__ */ t("p", { "data-testid": "execution-list-loading", children: "Loading…" }) : e.length === 0 ? f = /* @__PURE__ */ t("p", { "data-testid": "execution-list-empty", children: c ?? "No executions yet." }) : f = /* @__PURE__ */ t("ul", { className: "w6w-execution-list-rows", children: e.map((v) => /* @__PURE__ */ t("li", { "data-testid": "execution-row", "data-execution-id": v.id, children: /* @__PURE__ */ t(
1407
+ Be,
1413
1408
  {
1414
- icon: /* @__PURE__ */ t(Se, { state: p.status }),
1415
- title: l ? p.callableName : X(p.startedAt),
1416
- subtitle: l ? `${ws[p.kind]} · ${X(p.startedAt)}` : p.id,
1417
- trailing: $e(p.durationMs),
1418
- active: p.id === s,
1419
- onClick: n ? () => n(p.id) : void 0
1409
+ icon: /* @__PURE__ */ t(Ve, { state: v.status }),
1410
+ title: i ? v.callableName : ge(v.startedAt),
1411
+ subtitle: i ? `${Ln[v.kind]} · ${ge(v.startedAt)}` : v.id,
1412
+ trailing: ze(v.durationMs),
1413
+ active: v.id === n,
1414
+ onClick: a ? () => a(v.id) : void 0
1420
1415
  }
1421
- ) }, p.id)) }), /* @__PURE__ */ o("div", { className: "w6w-execution-list", "data-testid": "execution-list", children: [
1422
- m,
1416
+ ) }, v.id)) }), /* @__PURE__ */ l("div", { className: "w6w-execution-list", "data-testid": "execution-list", children: [
1417
+ f,
1423
1418
  h
1424
1419
  ] });
1425
1420
  }
1426
- function ms({
1421
+ function Un({
1427
1422
  steps: e,
1428
- emptyLabel: s,
1429
- onDismiss: n,
1430
- runError: l,
1431
- stepErrors: d
1423
+ emptyLabel: n,
1424
+ onDismiss: a,
1425
+ runError: i,
1426
+ stepErrors: o
1432
1427
  }) {
1433
- const a = n ? /* @__PURE__ */ t("div", { className: "w6w-execution-log-head", children: /* @__PURE__ */ t(L, { label: "Dismiss run log", "data-testid": "execution-log-dismiss", onClick: n, children: "×" }) }) : null, r = d ?? [], c = l || r.length > 0 ? /* @__PURE__ */ o("div", { className: "w6w-execution-log-errors w6w-stack", children: [
1434
- l && /* @__PURE__ */ t(be, { error: l }),
1435
- r.map((u, w) => /* @__PURE__ */ t(
1436
- be,
1428
+ const c = a ? /* @__PURE__ */ t("div", { className: "w6w-execution-log-head", children: /* @__PURE__ */ t(ae, { label: "Dismiss run log", "data-testid": "execution-log-dismiss", onClick: a, children: "×" }) }) : null, s = o ?? [], r = i || s.length > 0 ? /* @__PURE__ */ l("div", { className: "w6w-execution-log-errors w6w-stack", children: [
1429
+ i && /* @__PURE__ */ t(Ke, { error: i }),
1430
+ s.map((d, u) => /* @__PURE__ */ t(
1431
+ Ke,
1437
1432
  {
1438
- label: u.label ?? u.stepId,
1439
- error: u.error
1433
+ label: d.label ?? d.stepId,
1434
+ error: d.error
1440
1435
  },
1441
- `${u.stepId}:${w}`
1436
+ `${d.stepId}:${u}`
1442
1437
  ))
1443
1438
  ] }) : null;
1444
- return e.length === 0 ? /* @__PURE__ */ o(k, { children: [
1445
- a,
1439
+ return e.length === 0 ? /* @__PURE__ */ l(A, { children: [
1446
1440
  c,
1447
- /* @__PURE__ */ t("div", { className: "w6w-execution-log-empty", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: s ?? "No steps have run yet." }) })
1448
- ] }) : /* @__PURE__ */ o(k, { children: [
1449
- a,
1441
+ r,
1442
+ /* @__PURE__ */ t("div", { className: "w6w-execution-log-empty", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: n ?? "No nodes have run yet." }) })
1443
+ ] }) : /* @__PURE__ */ l(A, { children: [
1450
1444
  c,
1451
- /* @__PURE__ */ t("ol", { className: "w6w-execution-log", children: e.map((u) => /* @__PURE__ */ t(hs, { step: u }, u.id)) })
1445
+ r,
1446
+ /* @__PURE__ */ t("ol", { className: "w6w-execution-log", children: e.map((d) => /* @__PURE__ */ t(Fn, { step: d }, d.id)) })
1452
1447
  ] });
1453
1448
  }
1454
- function hs({ step: e }) {
1455
- const [s, n] = v(!1), l = /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-header", children: [
1456
- /* @__PURE__ */ t(Se, { state: e.status }),
1449
+ function Fn({ step: e }) {
1450
+ const [n, a] = g(!1), i = /* @__PURE__ */ l("div", { className: "w6w-execution-log-row-header", children: [
1451
+ /* @__PURE__ */ t(Ve, { state: e.status }),
1457
1452
  /* @__PURE__ */ t("span", { className: "w6w-execution-log-row-label", children: e.label ?? e.id }),
1458
- /* @__PURE__ */ t(ps, { startedAt: e.startedAt, finishedAt: e.finishedAt })
1459
- ] }), d = e.error ? /* @__PURE__ */ t(be, { error: e.error }) : null;
1460
- return e.input === void 0 && e.output === void 0 && !e.meta ? /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1461
- /* @__PURE__ */ t("div", { className: "w6w-section", children: l }),
1462
- d
1463
- ] }) : /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1464
- /* @__PURE__ */ o("details", { className: "w6w-section", open: s, onToggle: (a) => n(a.currentTarget.open), children: [
1465
- /* @__PURE__ */ t("summary", { className: "w6w-section-summary", children: l }),
1466
- s && /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-body w6w-section-body w6w-stack", children: [
1467
- /* @__PURE__ */ t(et, { title: "Input", value: e.input }),
1468
- /* @__PURE__ */ t(et, { title: "Output", value: e.output }),
1469
- e.meta && /* @__PURE__ */ o("div", { className: "w6w-execution-log-json w6w-stack", children: [
1453
+ /* @__PURE__ */ t(Dn, { startedAt: e.startedAt, finishedAt: e.finishedAt })
1454
+ ] }), o = e.error ? /* @__PURE__ */ t(Ke, { error: e.error }) : null;
1455
+ return e.input === void 0 && e.output === void 0 && !e.meta ? /* @__PURE__ */ l("li", { className: "w6w-execution-log-row", children: [
1456
+ /* @__PURE__ */ t("div", { className: "w6w-section", children: i }),
1457
+ o
1458
+ ] }) : /* @__PURE__ */ l("li", { className: "w6w-execution-log-row", children: [
1459
+ /* @__PURE__ */ l("details", { className: "w6w-section", open: n, onToggle: (c) => a(c.currentTarget.open), children: [
1460
+ /* @__PURE__ */ t("summary", { className: "w6w-section-summary", children: i }),
1461
+ n && /* @__PURE__ */ l("div", { className: "w6w-execution-log-row-body w6w-section-body w6w-stack", children: [
1462
+ /* @__PURE__ */ t(pt, { title: "Input", value: e.input }),
1463
+ /* @__PURE__ */ t(pt, { title: "Output", value: e.output }),
1464
+ e.meta && /* @__PURE__ */ l("div", { className: "w6w-execution-log-json w6w-stack", children: [
1470
1465
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Metadata" }),
1471
- /* @__PURE__ */ t(ke, { code: JSON.stringify(e.meta, null, 2), language: "json" })
1466
+ /* @__PURE__ */ t(He, { code: JSON.stringify(e.meta, null, 2), language: "json" })
1472
1467
  ] })
1473
1468
  ] })
1474
1469
  ] }),
1475
- d
1470
+ o
1476
1471
  ] });
1477
1472
  }
1478
- function be({ error: e, label: s }) {
1479
- return /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
1480
- s !== void 0 && /* @__PURE__ */ t("strong", { className: "w6w-execution-log-error-label", children: s }),
1473
+ function Ke({ error: e, label: n }) {
1474
+ return /* @__PURE__ */ l("div", { className: "w6w-result w6w-error", children: [
1475
+ n !== void 0 && /* @__PURE__ */ t("strong", { className: "w6w-execution-log-error-label", children: n }),
1481
1476
  e.code && /* @__PURE__ */ t("div", { className: "w6w-small w6w-execution-log-error-code", children: /* @__PURE__ */ t("code", { children: e.code }) }),
1482
1477
  e.message
1483
1478
  ] });
1484
1479
  }
1485
- function ps({ startedAt: e, finishedAt: s }) {
1486
- if (e && s) {
1487
- const n = fs(e, s);
1488
- return /* @__PURE__ */ o("span", { className: "w6w-execution-log-timing", children: [
1480
+ function Dn({ startedAt: e, finishedAt: n }) {
1481
+ if (e && n) {
1482
+ const a = Bn(e, n);
1483
+ return /* @__PURE__ */ l("span", { className: "w6w-execution-log-timing", children: [
1489
1484
  e,
1490
1485
  " → ",
1491
- s,
1492
- n && /* @__PURE__ */ o("span", { children: [
1486
+ n,
1487
+ a && /* @__PURE__ */ l("span", { children: [
1493
1488
  " (",
1494
- n,
1489
+ a,
1495
1490
  ")"
1496
1491
  ] })
1497
1492
  ] });
1498
1493
  }
1499
- return e ? /* @__PURE__ */ o("span", { className: "w6w-execution-log-timing", children: [
1494
+ return e ? /* @__PURE__ */ l("span", { className: "w6w-execution-log-timing", children: [
1500
1495
  "Started ",
1501
1496
  e
1502
1497
  ] }) : /* @__PURE__ */ t("span", { className: "w6w-execution-log-timing", children: "—" });
1503
1498
  }
1504
- function fs(e, s) {
1505
- const n = Date.parse(e), l = Date.parse(s);
1506
- if (!Number.isFinite(n) || !Number.isFinite(l) || l < n) return null;
1507
- const d = l - n;
1508
- if (d < 1e3) return `${d}ms`;
1509
- const a = d / 1e3;
1510
- if (a < 60) return `${a.toFixed(1)}s`;
1511
- const r = Math.floor(a / 60), c = Math.round(a % 60);
1512
- return `${r}m ${c}s`;
1513
- }
1514
- function et({ title: e, value: s }) {
1515
- return /* @__PURE__ */ o("div", { className: "w6w-execution-log-json w6w-stack", children: [
1499
+ function Bn(e, n) {
1500
+ const a = Date.parse(e), i = Date.parse(n);
1501
+ if (!Number.isFinite(a) || !Number.isFinite(i) || i < a) return null;
1502
+ const o = i - a;
1503
+ if (o < 1e3) return `${o}ms`;
1504
+ const c = o / 1e3;
1505
+ if (c < 60) return `${c.toFixed(1)}s`;
1506
+ const s = Math.floor(c / 60), r = Math.round(c % 60);
1507
+ return `${s}m ${r}s`;
1508
+ }
1509
+ function pt({ title: e, value: n }) {
1510
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-log-json w6w-stack", children: [
1516
1511
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1517
- s === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Not available." }) : /* @__PURE__ */ t(ke, { code: JSON.stringify(s, null, 2), language: "json" })
1512
+ n === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Not available." }) : /* @__PURE__ */ t(He, { code: JSON.stringify(n, null, 2), language: "json" })
1518
1513
  ] });
1519
1514
  }
1520
- const vs = { status: "", kind: "", from: "", to: "", q: "" }, ys = [
1515
+ const Jn = { status: "", kind: "", from: "", to: "", q: "" }, Kn = [
1521
1516
  { value: "", label: "Any status" },
1522
1517
  { value: "queued", label: "Queued" },
1523
1518
  { value: "running", label: "Running" },
1524
1519
  { value: "succeeded", label: "Succeeded" },
1525
1520
  { value: "failed", label: "Failed" },
1526
1521
  { value: "canceled", label: "Canceled" }
1527
- ], Ns = [
1522
+ ], jn = [
1528
1523
  { value: "", label: "Any type" },
1529
1524
  { value: "function", label: "Function" },
1530
1525
  { value: "endpoint", label: "Endpoint" },
1531
1526
  { value: "workflow", label: "Workflow" }
1532
1527
  ];
1533
- function Gs({
1528
+ function Sa({
1534
1529
  value: e,
1535
- onChange: s,
1536
- showKind: n = !1,
1537
- searchPlaceholder: l = "Search by id or name",
1538
- disabled: d = !1
1530
+ onChange: n,
1531
+ showKind: a = !1,
1532
+ searchPlaceholder: i = "Search by id or name",
1533
+ disabled: o = !1
1539
1534
  }) {
1540
- const a = e.status !== "" || e.kind !== "" || e.from !== "" || e.to !== "" || e.q !== "";
1541
- return /* @__PURE__ */ o("div", { className: "w6w-execution-filters", "data-testid": "execution-filters", children: [
1535
+ const c = e.status !== "" || e.kind !== "" || e.from !== "" || e.to !== "" || e.q !== "";
1536
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-filters", "data-testid": "execution-filters", children: [
1542
1537
  /* @__PURE__ */ t(
1543
1538
  "input",
1544
1539
  {
@@ -1546,10 +1541,10 @@ function Gs({
1546
1541
  className: "w6w-execution-filters-search",
1547
1542
  "data-testid": "execution-filter-q",
1548
1543
  "aria-label": "Search executions",
1549
- placeholder: l,
1544
+ placeholder: i,
1550
1545
  value: e.q,
1551
- disabled: d,
1552
- onChange: (r) => s({ ...e, q: r.target.value })
1546
+ disabled: o,
1547
+ onChange: (s) => n({ ...e, q: s.target.value })
1553
1548
  }
1554
1549
  ),
1555
1550
  /* @__PURE__ */ t(
@@ -1559,21 +1554,21 @@ function Gs({
1559
1554
  "data-testid": "execution-filter-status",
1560
1555
  "aria-label": "Status",
1561
1556
  value: e.status,
1562
- disabled: d,
1563
- onChange: (r) => s({ ...e, status: r.target.value }),
1564
- children: ys.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1557
+ disabled: o,
1558
+ onChange: (s) => n({ ...e, status: s.target.value }),
1559
+ children: Kn.map((s) => /* @__PURE__ */ t("option", { value: s.value, children: s.label }, s.value))
1565
1560
  }
1566
1561
  ),
1567
- n && /* @__PURE__ */ t(
1562
+ a && /* @__PURE__ */ t(
1568
1563
  "select",
1569
1564
  {
1570
1565
  className: "w6w-execution-filters-select",
1571
1566
  "data-testid": "execution-filter-kind",
1572
1567
  "aria-label": "Type",
1573
1568
  value: e.kind,
1574
- disabled: d,
1575
- onChange: (r) => s({ ...e, kind: r.target.value }),
1576
- children: Ns.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1569
+ disabled: o,
1570
+ onChange: (s) => n({ ...e, kind: s.target.value }),
1571
+ children: jn.map((s) => /* @__PURE__ */ t("option", { value: s.value, children: s.label }, s.value))
1577
1572
  }
1578
1573
  ),
1579
1574
  /* @__PURE__ */ t(
@@ -1584,8 +1579,8 @@ function Gs({
1584
1579
  "data-testid": "execution-filter-from",
1585
1580
  "aria-label": "From date",
1586
1581
  value: e.from,
1587
- disabled: d,
1588
- onChange: (r) => s({ ...e, from: r.target.value })
1582
+ disabled: o,
1583
+ onChange: (s) => n({ ...e, from: s.target.value })
1589
1584
  }
1590
1585
  ),
1591
1586
  /* @__PURE__ */ t(
@@ -1596,217 +1591,1270 @@ function Gs({
1596
1591
  "data-testid": "execution-filter-to",
1597
1592
  "aria-label": "To date",
1598
1593
  value: e.to,
1599
- disabled: d,
1600
- onChange: (r) => s({ ...e, to: r.target.value })
1594
+ disabled: o,
1595
+ onChange: (s) => n({ ...e, to: s.target.value })
1601
1596
  }
1602
1597
  ),
1603
- a && /* @__PURE__ */ t(
1598
+ c && /* @__PURE__ */ t(
1604
1599
  "button",
1605
1600
  {
1606
1601
  type: "button",
1607
1602
  className: "w6w-btn w6w-btn-ghost w6w-execution-filters-clear",
1608
1603
  "data-testid": "execution-filter-clear",
1609
- disabled: d,
1610
- onClick: () => s({ ...vs }),
1604
+ disabled: o,
1605
+ onClick: () => n({ ...Jn }),
1611
1606
  children: "Clear"
1612
1607
  }
1613
1608
  )
1614
1609
  ] });
1615
1610
  }
1616
- const Y = "—";
1617
- function Qs({ stats: e, label: s }) {
1618
- const n = [
1611
+ const ye = "—";
1612
+ function $a({ stats: e, label: n }) {
1613
+ const a = [
1619
1614
  {
1620
1615
  testid: "execution-stat-total",
1621
1616
  label: "Executions",
1622
- value: e ? String(e.total) : Y
1617
+ value: e ? String(e.total) : ye
1623
1618
  },
1624
1619
  {
1625
1620
  testid: "execution-stat-success-rate",
1626
1621
  label: "Success rate",
1627
- value: gs(e == null ? void 0 : e.successRate)
1622
+ value: Hn(e == null ? void 0 : e.successRate)
1628
1623
  },
1629
1624
  {
1630
1625
  testid: "execution-stat-failed",
1631
1626
  label: "Failed",
1632
- value: e ? String(e.failed) : Y
1627
+ value: e ? String(e.failed) : ye
1633
1628
  },
1634
1629
  {
1635
1630
  testid: "execution-stat-avg-duration",
1636
1631
  label: "Avg duration",
1637
- value: e ? $e(e.avgDurationMs) : Y
1632
+ value: e ? ze(e.avgDurationMs) : ye
1638
1633
  }
1639
1634
  ];
1640
- return e && e.inFlight > 0 && n.push({
1635
+ return e && e.inFlight > 0 && a.push({
1641
1636
  testid: "execution-stat-in-flight",
1642
1637
  label: "In flight",
1643
1638
  value: String(e.inFlight)
1644
- }), /* @__PURE__ */ o("section", { className: "w6w-execution-stats", "data-testid": "execution-stats", children: [
1645
- s != null && /* @__PURE__ */ t("p", { className: "w6w-execution-stats-label", children: s }),
1646
- /* @__PURE__ */ t("div", { className: "w6w-execution-stats-cards", children: n.map((l) => /* @__PURE__ */ o("div", { className: "w6w-execution-stat", "data-testid": l.testid, children: [
1647
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-value", "data-stat-value": l.value, children: l.value }),
1648
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-label", children: l.label })
1649
- ] }, l.testid)) })
1639
+ }), /* @__PURE__ */ l("section", { className: "w6w-execution-stats", "data-testid": "execution-stats", children: [
1640
+ n != null && /* @__PURE__ */ t("p", { className: "w6w-execution-stats-label", children: n }),
1641
+ /* @__PURE__ */ t("div", { className: "w6w-execution-stats-cards", children: a.map((i) => /* @__PURE__ */ l("div", { className: "w6w-execution-stat", "data-testid": i.testid, children: [
1642
+ /* @__PURE__ */ t("span", { className: "w6w-execution-stat-value", "data-stat-value": i.value, children: i.value }),
1643
+ /* @__PURE__ */ t("span", { className: "w6w-execution-stat-label", children: i.label })
1644
+ ] }, i.testid)) })
1650
1645
  ] });
1651
1646
  }
1652
- function gs(e) {
1653
- return e == null || !Number.isFinite(e) ? Y : `${Math.round(e * 100)}%`;
1647
+ function Hn(e) {
1648
+ return e == null || !Number.isFinite(e) ? ye : `${Math.round(e * 100)}%`;
1654
1649
  }
1655
- const bs = {
1650
+ const Wn = {
1656
1651
  function: "Function",
1657
1652
  endpoint: "Endpoint",
1658
1653
  workflow: "Workflow"
1659
1654
  };
1660
- function ks(e) {
1655
+ function qn(e) {
1661
1656
  return JSON.stringify(e, null, 2) ?? "null";
1662
1657
  }
1663
- function Ys({
1658
+ function Ta({
1664
1659
  execution: e,
1665
- loading: s = !1,
1666
- errorMessage: n,
1667
- onClose: l,
1668
- onOpenInEditor: d
1660
+ loading: n = !1,
1661
+ errorMessage: a,
1662
+ onClose: i,
1663
+ onOpenInEditor: o
1669
1664
  }) {
1670
- return /* @__PURE__ */ o("section", { className: "w6w-execution-detail w6w-stack", "data-testid": "execution-detail", children: [
1671
- n != null && /* @__PURE__ */ t(
1665
+ return /* @__PURE__ */ l("section", { className: "w6w-execution-detail w6w-stack", "data-testid": "execution-detail", children: [
1666
+ a != null && /* @__PURE__ */ t(
1672
1667
  "p",
1673
1668
  {
1674
1669
  role: "alert",
1675
1670
  className: "w6w-execution-detail-error-message",
1676
1671
  "data-testid": "execution-detail-error-message",
1677
- children: n
1672
+ children: a
1678
1673
  }
1679
1674
  ),
1680
- e ? /* @__PURE__ */ t(xs, { execution: e, onClose: l, onOpenInEditor: d }) : s ? /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-loading", children: "Loading…" }) : /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-empty", children: "No execution selected." })
1675
+ e ? /* @__PURE__ */ t(Vn, { execution: e, onClose: i, onOpenInEditor: o }) : n ? /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-loading", children: "Loading…" }) : /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-empty", children: "No execution selected." })
1681
1676
  ] });
1682
1677
  }
1683
- function xs({
1678
+ function Vn({
1684
1679
  execution: e,
1685
- onClose: s,
1686
- onOpenInEditor: n
1680
+ onClose: n,
1681
+ onOpenInEditor: a
1687
1682
  }) {
1688
- return /* @__PURE__ */ o(k, { children: [
1689
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-head", children: [
1690
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-title", children: [
1683
+ return /* @__PURE__ */ l(A, { children: [
1684
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-head", children: [
1685
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-title", children: [
1691
1686
  /* @__PURE__ */ t("h3", { className: "w6w-execution-detail-name", children: e.callableName }),
1692
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-meta", children: [
1693
- /* @__PURE__ */ t(Se, { state: e.status }),
1694
- /* @__PURE__ */ t("span", { className: "w6w-execution-detail-kind w6w-muted w6w-small", children: bs[e.kind] })
1687
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-meta", children: [
1688
+ /* @__PURE__ */ t(Ve, { state: e.status }),
1689
+ /* @__PURE__ */ t("span", { className: "w6w-execution-detail-kind w6w-muted w6w-small", children: Wn[e.kind] })
1695
1690
  ] })
1696
1691
  ] }),
1697
- (n || s) && /* @__PURE__ */ o("div", { className: "w6w-execution-detail-actions", children: [
1698
- n && /* @__PURE__ */ t(
1692
+ (a || n) && /* @__PURE__ */ l("div", { className: "w6w-execution-detail-actions", children: [
1693
+ a && /* @__PURE__ */ t(
1699
1694
  "button",
1700
1695
  {
1701
1696
  type: "button",
1702
1697
  className: "w6w-btn w6w-btn-ghost",
1703
1698
  "data-testid": "execution-detail-open-editor",
1704
- onClick: n,
1699
+ onClick: a,
1705
1700
  children: "Open in visual editor"
1706
1701
  }
1707
1702
  ),
1708
- s && /* @__PURE__ */ t(L, { label: "Close", "data-testid": "execution-detail-close", onClick: s, children: "×" })
1703
+ n && /* @__PURE__ */ t(ae, { label: "Close", "data-testid": "execution-detail-close", onClick: n, children: "×" })
1709
1704
  ] })
1710
1705
  ] }),
1711
1706
  /* @__PURE__ */ t("p", { className: "w6w-execution-detail-id-line", children: /* @__PURE__ */ t("code", { className: "w6w-execution-detail-id", "data-testid": "execution-detail-id", children: e.id }) }),
1712
- /* @__PURE__ */ o("dl", { className: "w6w-execution-detail-timing", children: [
1713
- /* @__PURE__ */ t(fe, { label: "Started", value: X(e.startedAt) }),
1707
+ /* @__PURE__ */ l("dl", { className: "w6w-execution-detail-timing", children: [
1708
+ /* @__PURE__ */ t(Le, { label: "Started", value: ge(e.startedAt) }),
1714
1709
  /* @__PURE__ */ t(
1715
- fe,
1710
+ Le,
1716
1711
  {
1717
1712
  label: "Finished",
1718
- value: e.finishedAt ? X(e.finishedAt) : "—"
1713
+ value: e.finishedAt ? ge(e.finishedAt) : "—"
1719
1714
  }
1720
1715
  ),
1721
- /* @__PURE__ */ t(fe, { label: "Duration", value: $e(e.durationMs) })
1716
+ /* @__PURE__ */ t(Le, { label: "Duration", value: ze(e.durationMs) })
1722
1717
  ] }),
1723
- e.steps !== void 0 && /* @__PURE__ */ o(
1718
+ e.steps !== void 0 && /* @__PURE__ */ l(
1724
1719
  "section",
1725
1720
  {
1726
1721
  className: "w6w-execution-detail-section w6w-stack",
1727
1722
  "data-testid": "execution-detail-steps",
1728
1723
  children: [
1729
- /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Steps" }),
1730
- /* @__PURE__ */ t(ms, { steps: e.steps, emptyLabel: "No steps ran." })
1724
+ /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Nodes" }),
1725
+ /* @__PURE__ */ t(Un, { steps: e.steps, emptyLabel: "No nodes ran." })
1731
1726
  ]
1732
1727
  }
1733
1728
  ),
1734
- e.input !== void 0 && /* @__PURE__ */ t(ve, { title: "Input", testid: "execution-detail-input", value: e.input }),
1735
- e.output !== void 0 && /* @__PURE__ */ t(ve, { title: "Output", testid: "execution-detail-output", value: e.output }),
1736
- e.error != null && /* @__PURE__ */ t(ve, { title: "Error", testid: "execution-detail-error", value: e.error })
1729
+ e.input !== void 0 && /* @__PURE__ */ t(Ue, { title: "Input", testid: "execution-detail-input", value: e.input }),
1730
+ e.output !== void 0 && /* @__PURE__ */ t(Ue, { title: "Output", testid: "execution-detail-output", value: e.output }),
1731
+ e.error != null && /* @__PURE__ */ t(Ue, { title: "Error", testid: "execution-detail-error", value: e.error })
1737
1732
  ] });
1738
1733
  }
1739
- function fe({ label: e, value: s }) {
1740
- return /* @__PURE__ */ o("div", { className: "w6w-execution-detail-timing-item", children: [
1734
+ function Le({ label: e, value: n }) {
1735
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-detail-timing-item", children: [
1741
1736
  /* @__PURE__ */ t("dt", { children: e }),
1742
- /* @__PURE__ */ t("dd", { children: s })
1737
+ /* @__PURE__ */ t("dd", { children: n })
1743
1738
  ] });
1744
1739
  }
1745
- function ve({ title: e, testid: s, value: n }) {
1746
- return /* @__PURE__ */ o("section", { className: "w6w-execution-detail-section w6w-stack", "data-testid": s, children: [
1740
+ function Ue({ title: e, testid: n, value: a }) {
1741
+ return /* @__PURE__ */ l("section", { className: "w6w-execution-detail-section w6w-stack", "data-testid": n, children: [
1747
1742
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1748
- /* @__PURE__ */ t(ke, { code: ks(n), language: "json" })
1743
+ /* @__PURE__ */ t(He, { code: qn(a), language: "json" })
1744
+ ] });
1745
+ }
1746
+ function zn(e) {
1747
+ const n = [];
1748
+ for (const a of e)
1749
+ a.p95Ms !== null && n.push({
1750
+ appId: a.appId,
1751
+ displayName: a.displayName,
1752
+ calls: a.calls,
1753
+ p95Ms: a.p95Ms,
1754
+ state: a.state,
1755
+ errorCount: a.errors.e4xx + a.errors.e429 + a.errors.eAuth + a.errors.e5xx
1756
+ });
1757
+ return n;
1758
+ }
1759
+ function Aa(e) {
1760
+ return e.attention === "now" || e.attention === "recent";
1761
+ }
1762
+ function Gn(e) {
1763
+ const n = { now: [], recent: [], clear: [] };
1764
+ for (const a of e)
1765
+ a.attention === "now" ? n.now.push(a) : a.attention === "recent" ? n.recent.push(a) : n.clear.push(a);
1766
+ return n;
1767
+ }
1768
+ function Yn(e) {
1769
+ return e.uptime.map((n) => ({ day: n.day, state: n.state }));
1770
+ }
1771
+ const ft = 3, Qn = 5;
1772
+ function Zn(e, n = {}) {
1773
+ const a = n.compact ?? !1, { now: i, recent: o } = Gn(e), c = i.length + o.length, s = a ? i.slice(0, ft) : i, r = a ? o.slice(0, Math.max(0, ft - s.length)) : o, d = a ? e.slice(0, n.limit ?? Qn) : [...e];
1774
+ return {
1775
+ attentionCount: c,
1776
+ shownNow: s,
1777
+ shownRecent: r,
1778
+ hiddenAttentionCount: c - s.length - r.length,
1779
+ shownTable: d,
1780
+ hiddenTableCount: e.length - d.length
1781
+ };
1782
+ }
1783
+ const fe = 640, ne = 340, L = { top: 16, right: 24, bottom: 40, left: 56 };
1784
+ function vt(e) {
1785
+ if (e <= 0) return 1;
1786
+ const n = 10 ** Math.floor(Math.log10(e)), a = [1, 2, 5, 10];
1787
+ for (const i of a)
1788
+ if (e <= i * n) return i * n;
1789
+ return 10 * n;
1790
+ }
1791
+ function yt(e, n = 5) {
1792
+ return Array.from({ length: n + 1 }, (a, i) => Math.round(e * i / n));
1793
+ }
1794
+ function Xn({
1795
+ services: e,
1796
+ getHref: n,
1797
+ onOpen: a
1798
+ }) {
1799
+ const i = zn(e);
1800
+ if (i.length === 0)
1801
+ return /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No timed calls in this window yet." });
1802
+ const o = vt(Math.max(...i.map((p) => p.calls))), c = vt(Math.max(...i.map((p) => p.p95Ms))), s = Math.max(1, ...i.map((p) => p.errorCount)), r = fe - L.left - L.right, d = ne - L.top - L.bottom, u = (p) => L.left + p / o * r, h = (p) => L.top + p / c * d, f = (p) => 16 + p / s * 14, v = yt(o), m = yt(c), N = 18, y = L.top + d / 2;
1803
+ return /* @__PURE__ */ l("div", { className: "w6w-rel-scatter", children: [
1804
+ /* @__PURE__ */ l(
1805
+ "svg",
1806
+ {
1807
+ viewBox: `0 0 ${fe} ${ne}`,
1808
+ style: { aspectRatio: `${fe} / ${ne}` },
1809
+ role: "img",
1810
+ "aria-label": "API performance: calls versus p95 latency, one point per API",
1811
+ children: [
1812
+ /* @__PURE__ */ t(
1813
+ "rect",
1814
+ {
1815
+ x: L.left,
1816
+ y: L.top,
1817
+ width: r,
1818
+ height: d,
1819
+ className: "w6w-rel-scatter-plot-bg"
1820
+ }
1821
+ ),
1822
+ m.map((p) => /* @__PURE__ */ l("g", { children: [
1823
+ /* @__PURE__ */ t(
1824
+ "line",
1825
+ {
1826
+ x1: L.left,
1827
+ x2: fe - L.right,
1828
+ y1: h(p),
1829
+ y2: h(p),
1830
+ className: "w6w-rel-scatter-grid"
1831
+ }
1832
+ ),
1833
+ /* @__PURE__ */ t("text", { x: L.left - 8, y: h(p), className: "w6w-rel-scatter-axis-label", textAnchor: "end", children: p })
1834
+ ] }, `y-${p}`)),
1835
+ v.map((p) => /* @__PURE__ */ t(
1836
+ "text",
1837
+ {
1838
+ x: u(p),
1839
+ y: ne - L.bottom + 18,
1840
+ className: "w6w-rel-scatter-axis-label",
1841
+ textAnchor: "middle",
1842
+ children: p
1843
+ },
1844
+ `x-${p}`
1845
+ )),
1846
+ /* @__PURE__ */ t(
1847
+ "text",
1848
+ {
1849
+ x: N,
1850
+ y,
1851
+ className: "w6w-rel-scatter-axis-title",
1852
+ textAnchor: "middle",
1853
+ transform: `rotate(-90, ${N}, ${y})`,
1854
+ children: "p95 (ms)"
1855
+ }
1856
+ ),
1857
+ /* @__PURE__ */ t(
1858
+ "text",
1859
+ {
1860
+ x: L.left + r / 2,
1861
+ y: ne - 4,
1862
+ className: "w6w-rel-scatter-axis-title",
1863
+ textAnchor: "middle",
1864
+ children: "calls in this window"
1865
+ }
1866
+ ),
1867
+ i.map((p) => {
1868
+ const P = f(p.errorCount), E = u(p.calls), M = h(p.p95Ms), I = /* @__PURE__ */ l(A, { children: [
1869
+ /* @__PURE__ */ t(
1870
+ "circle",
1871
+ {
1872
+ cx: E,
1873
+ cy: M,
1874
+ r: P / 2 + 2.5,
1875
+ className: `w6w-rel-scatter-ring w6w-rel-scatter-ring-${p.state}`,
1876
+ children: /* @__PURE__ */ l("title", { children: [
1877
+ p.displayName,
1878
+ " — ",
1879
+ p.calls,
1880
+ " calls, ",
1881
+ p.p95Ms,
1882
+ " ms p95, ",
1883
+ p.errorCount,
1884
+ " errors"
1885
+ ] })
1886
+ }
1887
+ ),
1888
+ /* @__PURE__ */ t(
1889
+ "circle",
1890
+ {
1891
+ cx: E,
1892
+ cy: M,
1893
+ r: P / 2,
1894
+ className: `w6w-rel-scatter-point w6w-rel-scatter-point-${p.state}`
1895
+ }
1896
+ )
1897
+ ] });
1898
+ return n ? /* @__PURE__ */ t(
1899
+ "a",
1900
+ {
1901
+ href: n(p.appId),
1902
+ className: "w6w-rel-scatter-point-link",
1903
+ onClick: a ? (C) => a(p.appId, C) : void 0,
1904
+ children: I
1905
+ },
1906
+ p.appId
1907
+ ) : a ? /* @__PURE__ */ t(
1908
+ "g",
1909
+ {
1910
+ role: "button",
1911
+ tabIndex: 0,
1912
+ className: "w6w-rel-scatter-point-link",
1913
+ onClick: (C) => a(p.appId, C),
1914
+ onKeyDown: (C) => {
1915
+ (C.key === "Enter" || C.key === " ") && (C.preventDefault(), C.currentTarget.dispatchEvent(
1916
+ new MouseEvent("click", { bubbles: !0 })
1917
+ ));
1918
+ },
1919
+ children: I
1920
+ },
1921
+ p.appId
1922
+ ) : /* @__PURE__ */ t("g", { children: I }, p.appId);
1923
+ })
1924
+ ]
1925
+ }
1926
+ ),
1927
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-rel-scatter-note", children: "Up is faster, right is more calls — top-right is the best outcome. Icon size is the error count in this window; ring colour is exec status." })
1749
1928
  ] });
1750
1929
  }
1930
+ function Nt(e) {
1931
+ const n = new Date(e);
1932
+ return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
1933
+ }
1934
+ function Ct({
1935
+ appId: e,
1936
+ className: n,
1937
+ title: a,
1938
+ getHref: i,
1939
+ onOpen: o,
1940
+ children: c
1941
+ }) {
1942
+ return i ? /* @__PURE__ */ t(
1943
+ "a",
1944
+ {
1945
+ className: n,
1946
+ href: i(e),
1947
+ title: a,
1948
+ onClick: o ? (s) => o(e, s) : void 0,
1949
+ children: c
1950
+ }
1951
+ ) : o ? /* @__PURE__ */ t("button", { type: "button", className: n, title: a, onClick: (s) => o(e, s), children: c }) : /* @__PURE__ */ t("div", { className: n, title: a, children: c });
1952
+ }
1953
+ function St({ service: e }) {
1954
+ return /* @__PURE__ */ l("span", { className: "w6w-rel-signal", children: [
1955
+ /* @__PURE__ */ t(We, { state: e.state }),
1956
+ e.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage open" }),
1957
+ e.calls === 0 && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "no calls" })
1958
+ ] });
1959
+ }
1960
+ function $t({ vendor: e }) {
1961
+ if (!e) return /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "not published" });
1962
+ const n = e.state === "unknown";
1963
+ return /* @__PURE__ */ l("span", { className: "w6w-rel-signal", title: e.message ?? void 0, children: [
1964
+ /* @__PURE__ */ t(We, { state: e.state, label: n ? "Unavailable" : void 0 }),
1965
+ !n && e.message && /* @__PURE__ */ t("span", { className: "w6w-rel-vendor-msg w6w-small", children: e.message })
1966
+ ] });
1967
+ }
1968
+ function ea({ service: e, getHref: n, onOpen: a }) {
1969
+ return /* @__PURE__ */ l(
1970
+ Ct,
1971
+ {
1972
+ appId: e.appId,
1973
+ className: "w6w-rel-issue-card",
1974
+ title: `${e.displayName} — open service detail`,
1975
+ getHref: n,
1976
+ onOpen: a,
1977
+ children: [
1978
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-head", children: [
1979
+ /* @__PURE__ */ t(
1980
+ be,
1981
+ {
1982
+ src: e.iconSrc,
1983
+ srcDark: e.iconSrcDark,
1984
+ brandColor: e.brandColor,
1985
+ name: e.displayName,
1986
+ size: 24
1987
+ }
1988
+ ),
1989
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-head-text", children: [
1990
+ /* @__PURE__ */ t("strong", { children: e.displayName }),
1991
+ e.attention === "recent" && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "trouble earlier in this window" })
1992
+ ] })
1993
+ ] }),
1994
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signals", children: [
1995
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signal", children: [
1996
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "w6w exec" }),
1997
+ /* @__PURE__ */ t(St, { service: e })
1998
+ ] }),
1999
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signal", children: [
2000
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "API status" }),
2001
+ /* @__PURE__ */ t($t, { vendor: e.vendorStatus })
2002
+ ] })
2003
+ ] })
2004
+ ]
2005
+ }
2006
+ );
2007
+ }
2008
+ function ta({
2009
+ service: e,
2010
+ getHref: n,
2011
+ onOpen: a
2012
+ }) {
2013
+ const i = e.calls === 0;
2014
+ return /* @__PURE__ */ l(
2015
+ "tr",
2016
+ {
2017
+ className: `w6w-rel-tr${e.attention !== "none" ? " w6w-rel-attention" : ""}`,
2018
+ "data-attention": e.attention === "none" ? void 0 : e.attention,
2019
+ children: [
2020
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-service", children: /* @__PURE__ */ l(Ct, { appId: e.appId, className: "w6w-rel-open", getHref: n, onOpen: a, children: [
2021
+ /* @__PURE__ */ t(
2022
+ be,
2023
+ {
2024
+ src: e.iconSrc,
2025
+ srcDark: e.iconSrcDark,
2026
+ brandColor: e.brandColor,
2027
+ name: e.displayName,
2028
+ size: 28
2029
+ }
2030
+ ),
2031
+ /* @__PURE__ */ l("span", { className: "w6w-rel-td-service-text", children: [
2032
+ /* @__PURE__ */ t("strong", { children: e.displayName }),
2033
+ /* @__PURE__ */ t("code", { className: "w6w-muted w6w-small", children: e.appId })
2034
+ ] })
2035
+ ] }) }),
2036
+ /* @__PURE__ */ l("td", { className: "w6w-rel-td-status", children: [
2037
+ /* @__PURE__ */ l("span", { className: "w6w-rel-status-row", children: [
2038
+ /* @__PURE__ */ t("span", { className: "w6w-rel-status-label w6w-muted w6w-small", children: "Ops" }),
2039
+ /* @__PURE__ */ t(St, { service: e })
2040
+ ] }),
2041
+ /* @__PURE__ */ l("span", { className: "w6w-rel-status-row", children: [
2042
+ /* @__PURE__ */ t("span", { className: "w6w-rel-status-label w6w-muted w6w-small", children: "API" }),
2043
+ /* @__PURE__ */ t($t, { vendor: e.vendorStatus })
2044
+ ] })
2045
+ ] }),
2046
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-uptime", children: i ? (
2047
+ // A zero-call window is one identical hatched strip — the note says it better.
2048
+ /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" })
2049
+ ) : /* @__PURE__ */ l(A, { children: [
2050
+ /* @__PURE__ */ t(
2051
+ gn,
2052
+ {
2053
+ days: Yn(e),
2054
+ ariaLabel: `${e.displayName}, ${e.uptime.length}-day status, oldest day first`
2055
+ }
2056
+ ),
2057
+ /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2058
+ e.calls,
2059
+ " calls"
2060
+ ] })
2061
+ ] }) }),
2062
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-p95", children: e.p95Ms === null ? "—" : `${e.p95Ms} ms` })
2063
+ ]
2064
+ }
2065
+ );
2066
+ }
2067
+ function Ra({
2068
+ services: e,
2069
+ window: n,
2070
+ days: a,
2071
+ compact: i = !1,
2072
+ showChart: o,
2073
+ limit: c,
2074
+ getHref: s,
2075
+ onOpen: r,
2076
+ showAllHref: d,
2077
+ onShowAll: u,
2078
+ slots: h
2079
+ }) {
2080
+ const f = a ?? (n == null ? void 0 : n.days) ?? 30, v = e.length > 0 && e.every((S) => S.calls > 0 && S.state === "ok"), {
2081
+ attentionCount: m,
2082
+ shownNow: N,
2083
+ shownRecent: y,
2084
+ hiddenAttentionCount: p,
2085
+ shownTable: P,
2086
+ hiddenTableCount: E
2087
+ } = Zn(e, { compact: i, limit: c }), M = o ?? !i, I = d !== void 0 || u !== void 0, C = (S) => {
2088
+ const O = S.startsWith("Show") ? "w6w-muted w6w-small" : void 0;
2089
+ return d !== void 0 ? /* @__PURE__ */ t("a", { href: d, className: O, onClick: u, children: S }) : u ? /* @__PURE__ */ t(
2090
+ "button",
2091
+ {
2092
+ type: "button",
2093
+ className: `w6w-rel-show-all${O ? ` ${O}` : ""}`,
2094
+ onClick: u,
2095
+ children: S
2096
+ }
2097
+ ) : null;
2098
+ };
2099
+ return /* @__PURE__ */ l("section", { className: "w6w-rel-section", children: [
2100
+ /* @__PURE__ */ l("h3", { className: "w6w-rel-heading", children: [
2101
+ /* @__PURE__ */ l("span", { children: [
2102
+ (h == null ? void 0 : h.header) ?? "Service reliability",
2103
+ " ",
2104
+ n && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2105
+ Nt(n.from),
2106
+ " – ",
2107
+ Nt(n.to),
2108
+ " · ",
2109
+ n.days,
2110
+ " days"
2111
+ ] })
2112
+ ] }),
2113
+ i && C("Show all services →"),
2114
+ h == null ? void 0 : h.actions
2115
+ ] }),
2116
+ /* @__PURE__ */ l("div", { className: i ? "w6w-rel-card" : void 0, children: [
2117
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-rel-intro", children: "Connected services across your account. Performance for the selected project." }),
2118
+ v && /* @__PURE__ */ l("div", { className: i ? "w6w-rel-allclear" : "w6w-rel-card w6w-rel-allclear", children: [
2119
+ /* @__PURE__ */ t("h4", { children: "All clear" }),
2120
+ /* @__PURE__ */ l("p", { children: [
2121
+ "Every service you called in the last ",
2122
+ f,
2123
+ " days came back",
2124
+ " ",
2125
+ /* @__PURE__ */ t(We, { state: "ok" }),
2126
+ " — no degraded stretches, no outages."
2127
+ ] })
2128
+ ] }),
2129
+ e.length === 0 && ((h == null ? void 0 : h.empty) ?? /* @__PURE__ */ t("div", { className: i ? void 0 : "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No services yet — connect an integration or use a service in this project." }) })),
2130
+ e.length > 0 && /* @__PURE__ */ l(A, { children: [
2131
+ m > 0 && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2132
+ /* @__PURE__ */ l("h4", { className: "w6w-rel-group-head", children: [
2133
+ "Needs attention",
2134
+ " ",
2135
+ /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2136
+ N.length + y.length,
2137
+ " of ",
2138
+ m
2139
+ ] })
2140
+ ] }),
2141
+ /* @__PURE__ */ t("div", { className: "w6w-rel-issues", children: [...N, ...y].map((S) => /* @__PURE__ */ t(ea, { service: S, getHref: s, onOpen: r }, S.appId)) }),
2142
+ p > 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-rel-more-note", children: [
2143
+ p,
2144
+ " more ",
2145
+ p === 1 ? "needs" : "need",
2146
+ " ",
2147
+ "attention",
2148
+ I && /* @__PURE__ */ l(A, { children: [
2149
+ " — ",
2150
+ C("view all →")
2151
+ ] })
2152
+ ] })
2153
+ ] }),
2154
+ M && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2155
+ /* @__PURE__ */ t("h4", { className: "w6w-rel-group-head", children: "Performance across your APIs" }),
2156
+ /* @__PURE__ */ t(Xn, { services: e, getHref: s, onOpen: r })
2157
+ ] }),
2158
+ P.length > 0 && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2159
+ /* @__PURE__ */ l("h4", { className: "w6w-rel-group-head", children: [
2160
+ i ? "Services" : "All services",
2161
+ " ",
2162
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: i ? `${P.length} of ${e.length}` : e.length })
2163
+ ] }),
2164
+ /* @__PURE__ */ t("div", { className: "w6w-rel-table-wrap", children: /* @__PURE__ */ l("table", { className: "w6w-rel-table", children: [
2165
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { children: [
2166
+ /* @__PURE__ */ t("th", { children: "Service" }),
2167
+ /* @__PURE__ */ t("th", { children: "Status" }),
2168
+ /* @__PURE__ */ l("th", { children: [
2169
+ "Last ",
2170
+ f,
2171
+ " days"
2172
+ ] }),
2173
+ /* @__PURE__ */ t("th", { children: "Latency" })
2174
+ ] }) }),
2175
+ /* @__PURE__ */ t("tbody", { children: P.map((S) => /* @__PURE__ */ t(
2176
+ ta,
2177
+ {
2178
+ service: S,
2179
+ getHref: s,
2180
+ onOpen: r
2181
+ },
2182
+ S.appId
2183
+ )) })
2184
+ ] }) }),
2185
+ E > 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-rel-more-note", children: [
2186
+ E,
2187
+ " more",
2188
+ I && /* @__PURE__ */ l(A, { children: [
2189
+ " — ",
2190
+ C("view all →")
2191
+ ] })
2192
+ ] })
2193
+ ] })
2194
+ ] })
2195
+ ] })
2196
+ ] });
2197
+ }
2198
+ function na(e, n) {
2199
+ return e.render ? e.render(n) : String(n[e.key] ?? "");
2200
+ }
2201
+ function Tt(e) {
2202
+ const { columns: n, rows: a, rowKey: i, onRowClick: o, getRowHref: c, empty: s, loading: r, className: d, testId: u } = e;
2203
+ return a.length === 0 && !r && s !== void 0 && s !== null ? /* @__PURE__ */ t(A, { children: s }) : /* @__PURE__ */ t("div", { className: "w6w-data-table-frame", children: /* @__PURE__ */ l(
2204
+ "table",
2205
+ {
2206
+ className: d ? `w6w-data-table ${d}` : "w6w-data-table",
2207
+ "data-testid": u,
2208
+ "aria-busy": r ? !0 : void 0,
2209
+ children: [
2210
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: n.map((h) => /* @__PURE__ */ t("th", { style: { width: h.width, textAlign: h.align }, scope: "col", children: h.header }, h.key)) }) }),
2211
+ /* @__PURE__ */ t("tbody", { children: a.map((h) => {
2212
+ var v;
2213
+ const f = c == null ? void 0 : c(h);
2214
+ return (
2215
+ // biome-ignore lint/a11y/useKeyWithClickEvents: row click is a mouse convenience; keyboard users reach the row through its cell anchors (getRowHref) or the column's own controls.
2216
+ /* @__PURE__ */ t(
2217
+ "tr",
2218
+ {
2219
+ "data-testid": (v = e.rowTestId) == null ? void 0 : v.call(e, h),
2220
+ className: o ? "w6w-data-table-row-clickable" : void 0,
2221
+ onClick: o ? (m) => o(h, m) : void 0,
2222
+ children: n.map((m) => {
2223
+ const N = na(m, h);
2224
+ return /* @__PURE__ */ t("td", { style: { textAlign: m.align }, children: f !== void 0 && m.link !== !1 ? /* @__PURE__ */ t("a", { className: "w6w-data-table-link", href: f, children: N }) : N }, m.key);
2225
+ })
2226
+ },
2227
+ i(h)
2228
+ )
2229
+ );
2230
+ }) })
2231
+ ]
2232
+ }
2233
+ ) });
2234
+ }
2235
+ function je({ title: e, children: n, action: a, className: i, testId: o }) {
2236
+ return /* @__PURE__ */ t(
2237
+ "div",
2238
+ {
2239
+ className: i ? `w6w-empty-state ${i}` : "w6w-empty-state",
2240
+ "data-testid": o,
2241
+ children: /* @__PURE__ */ l("div", { className: "w6w-empty-state-inner", children: [
2242
+ e != null && /* @__PURE__ */ t("div", { className: "w6w-empty-state-title", children: e }),
2243
+ n != null && /* @__PURE__ */ t("div", { className: "w6w-empty-state-body", children: n }),
2244
+ a != null && /* @__PURE__ */ t("div", { className: "w6w-empty-state-action", children: a })
2245
+ ] })
2246
+ }
2247
+ );
2248
+ }
2249
+ function Ia({
2250
+ rows: e,
2251
+ title: n,
2252
+ description: a,
2253
+ emptyCopy: i,
2254
+ newLabel: o = "New",
2255
+ openRowTitle: c,
2256
+ testIds: s,
2257
+ loading: r,
2258
+ error: d,
2259
+ onCreate: u,
2260
+ creating: h,
2261
+ onImport: f,
2262
+ onOpen: v,
2263
+ getHref: m,
2264
+ showArchived: N,
2265
+ onShowArchivedChange: y,
2266
+ slots: p
2267
+ }) {
2268
+ const [P, E] = g(!1), M = N !== void 0, I = M ? N : P, C = I ? e : e.filter((k) => !k.archived), S = v !== void 0 || m !== void 0, O = (k) => {
2269
+ M || E(k), y == null || y(k);
2270
+ }, F = [
2271
+ {
2272
+ key: "main",
2273
+ header: "Name",
2274
+ render: (k) => {
2275
+ const R = /* @__PURE__ */ l("span", { className: "w6w-callable-list-main", title: S ? c : void 0, children: [
2276
+ /* @__PURE__ */ t("span", { children: k.title }),
2277
+ k.description != null && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small w6w-callable-list-row-desc", children: k.description })
2278
+ ] });
2279
+ return v && !m ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-callable-list-open", children: R }) : R;
2280
+ }
2281
+ },
2282
+ {
2283
+ key: "trail",
2284
+ header: "",
2285
+ align: "right",
2286
+ render: (k) => k.archived || k.badges != null || k.trailing != null ? /* @__PURE__ */ l("span", { className: "w6w-callable-list-trail", children: [
2287
+ k.badges,
2288
+ k.archived && /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", "data-testid": s == null ? void 0 : s.archivedBadge, children: "archived" }),
2289
+ k.trailing
2290
+ ] }) : null
2291
+ }
2292
+ ], U = e.length > 0 && C.length === 0;
2293
+ return /* @__PURE__ */ l("section", { className: "w6w-callable-list", children: [
2294
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-head", children: [
2295
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-heading", children: [
2296
+ (p == null ? void 0 : p.header) ?? /* @__PURE__ */ l(A, { children: [
2297
+ /* @__PURE__ */ t("h2", { className: "w6w-callable-list-title", children: n }),
2298
+ a != null && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-callable-list-description", children: a })
2299
+ ] }),
2300
+ /* @__PURE__ */ l("label", { className: "w6w-muted w6w-small w6w-callable-list-toggle", children: [
2301
+ /* @__PURE__ */ t(
2302
+ "input",
2303
+ {
2304
+ type: "checkbox",
2305
+ checked: I,
2306
+ "data-testid": s == null ? void 0 : s.showArchived,
2307
+ onChange: (k) => O(k.target.checked)
2308
+ }
2309
+ ),
2310
+ "Show archived"
2311
+ ] })
2312
+ ] }),
2313
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-actions", children: [
2314
+ p == null ? void 0 : p.actions,
2315
+ f && /* @__PURE__ */ t(
2316
+ "button",
2317
+ {
2318
+ type: "button",
2319
+ className: "w6w-btn w6w-btn-ghost",
2320
+ "data-testid": s == null ? void 0 : s.importOpen,
2321
+ onClick: f,
2322
+ children: "Import"
2323
+ }
2324
+ ),
2325
+ u && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: h, onClick: u, children: h ? "Creating…" : o })
2326
+ ] })
2327
+ ] }),
2328
+ d && /* @__PURE__ */ t("div", { className: "w6w-error", children: d }),
2329
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-body", children: [
2330
+ r && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
2331
+ C.length === 0 && !r ? U ? /* @__PURE__ */ t(
2332
+ je,
2333
+ {
2334
+ testId: "w6w-callable-list-empty",
2335
+ action: /* @__PURE__ */ t(
2336
+ "button",
2337
+ {
2338
+ type: "button",
2339
+ className: "w6w-btn w6w-btn-ghost",
2340
+ onClick: () => O(!0),
2341
+ children: "Show archived"
2342
+ }
2343
+ ),
2344
+ children: e.length === 1 ? "The only item is archived." : `All ${e.length} items are archived.`
2345
+ }
2346
+ ) : /* @__PURE__ */ t(je, { testId: "w6w-callable-list-empty", children: (p == null ? void 0 : p.empty) ?? i }) : /* @__PURE__ */ t(
2347
+ Tt,
2348
+ {
2349
+ columns: F,
2350
+ rows: C,
2351
+ rowKey: (k) => k.id,
2352
+ loading: r,
2353
+ getRowHref: m ? (k) => m(k.id) : void 0,
2354
+ onRowClick: v ? (k, R) => v(k.id, R) : void 0
2355
+ }
2356
+ )
2357
+ ] })
2358
+ ] });
2359
+ }
2360
+ function aa(e, n) {
2361
+ if (e.app) return e.app;
2362
+ if (e.app !== null)
2363
+ return n.get(e.appId);
2364
+ }
2365
+ function Oa(e) {
2366
+ const n = /* @__PURE__ */ new Set();
2367
+ for (const a of e)
2368
+ a.app === void 0 && n.add(a.appId);
2369
+ return [...n];
2370
+ }
2371
+ function Ea({
2372
+ connections: e,
2373
+ appsById: n,
2374
+ loading: a,
2375
+ error: i,
2376
+ onOpen: o,
2377
+ getHref: c,
2378
+ onEdit: s,
2379
+ onDelete: r,
2380
+ busy: d,
2381
+ slots: u
2382
+ }) {
2383
+ const h = n ?? /* @__PURE__ */ new Map(), f = s !== void 0 || r !== void 0, v = [
2384
+ {
2385
+ key: "name",
2386
+ header: "Name",
2387
+ render: (m) => {
2388
+ const N = aa(m, h), y = m.displayName || m.id;
2389
+ return /* @__PURE__ */ l("span", { className: "w6w-connection-cell-name", children: [
2390
+ /* @__PURE__ */ t(
2391
+ be,
2392
+ {
2393
+ src: N == null ? void 0 : N.iconSvg,
2394
+ srcDark: N == null ? void 0 : N.iconSvgDark,
2395
+ brandColor: N == null ? void 0 : N.brandColor,
2396
+ name: (N == null ? void 0 : N.displayName) ?? m.appId
2397
+ }
2398
+ ),
2399
+ /* @__PURE__ */ t("strong", { className: "w6w-connection-name", title: y, children: y }),
2400
+ " ",
2401
+ /* @__PURE__ */ t("span", { className: "w6w-muted", children: (N == null ? void 0 : N.displayName) ?? m.appId })
2402
+ ] });
2403
+ }
2404
+ },
2405
+ {
2406
+ key: "status",
2407
+ header: "Status",
2408
+ render: (m) => /* @__PURE__ */ l(A, { children: [
2409
+ "auth ",
2410
+ /* @__PURE__ */ t("code", { children: m.authKey }),
2411
+ " ·",
2412
+ " ",
2413
+ /* @__PURE__ */ t(
2414
+ "span",
2415
+ {
2416
+ className: `w6w-connection-tag${m.state === "connected" ? "" : " w6w-connection-tag-warn"}`,
2417
+ children: m.state
2418
+ }
2419
+ ),
2420
+ m.lastTestOk === !1 && /* @__PURE__ */ t(
2421
+ "span",
2422
+ {
2423
+ className: "w6w-connection-tag w6w-connection-tag-danger",
2424
+ title: "Last test failed — update or re-test.",
2425
+ children: "invalid"
2426
+ }
2427
+ )
2428
+ ] })
2429
+ }
2430
+ ];
2431
+ return f && v.push({
2432
+ key: "actions",
2433
+ header: "",
2434
+ align: "right",
2435
+ link: !1,
2436
+ render: (m) => m.builtIn === !0 ? null : (
2437
+ // Clicks here must not reach the row's onOpen.
2438
+ // biome-ignore lint/a11y/useKeyWithClickEvents: propagation guard only; the buttons inside are the controls.
2439
+ /* @__PURE__ */ l("div", { className: "w6w-connection-row-actions", onClick: (N) => N.stopPropagation(), children: [
2440
+ s && /* @__PURE__ */ t(
2441
+ En,
2442
+ {
2443
+ label: "Edit",
2444
+ onClick: () => s(m),
2445
+ "data-testid": `connection-edit-${m.id}`
2446
+ }
2447
+ ),
2448
+ r && /* @__PURE__ */ t(
2449
+ Mn,
2450
+ {
2451
+ label: "Delete",
2452
+ onClick: () => r(m),
2453
+ disabled: d,
2454
+ "data-testid": `connection-delete-${m.id}`
2455
+ }
2456
+ )
2457
+ ] })
2458
+ )
2459
+ }), /* @__PURE__ */ l("section", { className: "w6w-connection-list", children: [
2460
+ ((u == null ? void 0 : u.header) != null || (u == null ? void 0 : u.actions) != null) && /* @__PURE__ */ l("div", { className: "w6w-connection-list-head", children: [
2461
+ /* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: u == null ? void 0 : u.header }),
2462
+ /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: u == null ? void 0 : u.actions })
2463
+ ] }),
2464
+ i && /* @__PURE__ */ t("div", { className: "w6w-error", children: i }),
2465
+ a && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
2466
+ e.length === 0 && !a ? /* @__PURE__ */ t(je, { testId: "w6w-connection-list-empty", children: (u == null ? void 0 : u.empty) ?? "No connections yet." }) : /* @__PURE__ */ t(
2467
+ Tt,
2468
+ {
2469
+ columns: v,
2470
+ rows: e,
2471
+ rowKey: (m) => m.id,
2472
+ loading: a,
2473
+ getRowHref: c ? (m) => m.builtIn === !0 ? void 0 : c(m.id) : void 0,
2474
+ onRowClick: o ? (m, N) => m.builtIn === !0 ? void 0 : o(m.id, N) : void 0
2475
+ }
2476
+ )
2477
+ ] });
2478
+ }
2479
+ function Ma({ connection: e, onClose: n, onSaved: a }) {
2480
+ const i = bt(), o = i.updateConnection, c = e.builtIn === !0, s = !c && typeof o == "function", [r, d] = g(e.displayName ?? ""), [u, h] = g({}), [f, v] = g(null), [m, N] = g(null), [y, p] = g(!1), [P, E] = g({}), [M, I] = g(!1), [C, S] = g(!1), [O, F] = g(null), [U, k] = g(null);
2481
+ Q(() => {
2482
+ if (!s) return;
2483
+ let b = !1;
2484
+ return v(null), i.getAppAuth(e.appId).then(($) => !b && v($)).catch(($) => !b && N($.message)), () => {
2485
+ b = !0;
2486
+ };
2487
+ }, [i, s, e.appId]);
2488
+ const R = f == null ? void 0 : f.find((b) => b.key === e.authKey), Z = (R == null ? void 0 : R.type) === "oauth2", B = Z ? [] : (R == null ? void 0 : R.fields) ?? [], J = e.credentialId, D = !!J && typeof i.rotateCredential == "function" && !Z, X = D && (R != null && R.serviceAccount) ? Xt(R.serviceAccount) : [];
2489
+ Q(() => {
2490
+ if (!s || !D || !J || typeof i.getCredential != "function") return;
2491
+ let b = !1;
2492
+ return i.getCredential(J).then(($) => !b && F($.connectionCount)).catch(() => {
2493
+ }), () => {
2494
+ b = !0;
2495
+ };
2496
+ }, [i, s, D, J]);
2497
+ function V() {
2498
+ if (D) {
2499
+ const T = {};
2500
+ r !== (e.displayName ?? "") && (T.displayName = r);
2501
+ const K = nn(X, P);
2502
+ return K && (T.binding = K), T.displayName === void 0 && T.binding === void 0 ? null : T;
2503
+ }
2504
+ const b = {};
2505
+ for (const T of B) {
2506
+ const K = u[T.key];
2507
+ K !== void 0 && K !== "" && (b[T.key] = K);
2508
+ }
2509
+ const $ = {};
2510
+ return r !== (e.displayName ?? "") && ($.displayName = r), Object.keys(b).length > 0 && ($.credential = b), $.displayName === void 0 && $.credential === void 0 ? null : $;
2511
+ }
2512
+ async function z() {
2513
+ if (!s || !o || y) return;
2514
+ N(null);
2515
+ const b = V();
2516
+ if (!b) {
2517
+ N(
2518
+ D ? "Nothing to update — change the name or a binding field." : "Nothing to update — change the name or a credential field."
2519
+ );
2520
+ return;
2521
+ }
2522
+ p(!0);
2523
+ try {
2524
+ const $ = await o.call(i, e.id, b);
2525
+ h({}), a($);
2526
+ } catch ($) {
2527
+ N($.message);
2528
+ } finally {
2529
+ p(!1);
2530
+ }
2531
+ }
2532
+ const ke = B.some(
2533
+ (b) => b.required && (u[b.key] === void 0 || u[b.key] === "")
2534
+ );
2535
+ async function ie() {
2536
+ if (!J || !i.rotateCredential || y) return;
2537
+ N(null);
2538
+ const b = tn(B, u);
2539
+ if ("error" in b) {
2540
+ N(b.error);
2541
+ return;
2542
+ }
2543
+ p(!0);
2544
+ try {
2545
+ await i.rotateCredential(J, { source: b.values }), h({}), I(!1), S(!0), k(null);
2546
+ } catch ($) {
2547
+ N($.message);
2548
+ } finally {
2549
+ p(!1);
2550
+ }
2551
+ }
2552
+ async function xe() {
2553
+ if (!(!J || !i.testCredential)) {
2554
+ N(null);
2555
+ try {
2556
+ k(await i.testCredential(J));
2557
+ } catch (b) {
2558
+ N(b.message);
2559
+ }
2560
+ }
2561
+ }
2562
+ const G = en(z, { enabled: s && !y });
2563
+ return /* @__PURE__ */ t(Fe, { title: "Edit connection", onClose: n, children: /* @__PURE__ */ l("div", { className: "w6w-stepconfig", children: [
2564
+ /* @__PURE__ */ t("div", { className: "w6w-modal-body", children: /* @__PURE__ */ l("div", { className: "w6w-stack", children: [
2565
+ c && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This connection is built in — it has no stored credential to edit." }),
2566
+ !c && !s && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Editing connections is not available here." }),
2567
+ s && /* @__PURE__ */ l(A, { children: [
2568
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
2569
+ /* @__PURE__ */ t("span", { children: "Display name" }),
2570
+ /* @__PURE__ */ t(
2571
+ "input",
2572
+ {
2573
+ type: "text",
2574
+ value: r,
2575
+ onChange: (b) => d(b.target.value),
2576
+ placeholder: "Connection name",
2577
+ maxLength: 80,
2578
+ name: "w6w-connection-label",
2579
+ autoComplete: "off",
2580
+ "data-1p-ignore": "true",
2581
+ "data-lpignore": "true",
2582
+ "data-bwignore": "true",
2583
+ "data-form-type": "other",
2584
+ ...G
2585
+ }
2586
+ )
2587
+ ] }),
2588
+ f === null && !m && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading auth fields…" }),
2589
+ Z && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This is an OAuth connection. You can rename it here; its credential is renewed by re-authorizing it." }),
2590
+ D && X.length > 0 && /* @__PURE__ */ l(A, { children: [
2591
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Leave a binding field blank to keep it unchanged." }),
2592
+ /* @__PURE__ */ t(
2593
+ Re,
2594
+ {
2595
+ mode: "edit",
2596
+ fields: X,
2597
+ values: P,
2598
+ onChange: E,
2599
+ enterSubmitProps: G
2600
+ }
2601
+ )
2602
+ ] }),
2603
+ D && /* @__PURE__ */ l("div", { className: "w6w-stack", "data-w6w": "credential-section", children: [
2604
+ typeof i.testCredential == "function" && /* @__PURE__ */ l("div", { children: [
2605
+ /* @__PURE__ */ t(
2606
+ "button",
2607
+ {
2608
+ type: "button",
2609
+ className: "w6w-btn w6w-btn-ghost",
2610
+ onClick: xe,
2611
+ children: "Test credential"
2612
+ }
2613
+ ),
2614
+ U && /* @__PURE__ */ l("p", { className: "w6w-small", "data-w6w": "credential-health", children: [
2615
+ "Credential health: ",
2616
+ U.ok ? "ok" : U.code ?? "failed"
2617
+ ] })
2618
+ ] }),
2619
+ /* @__PURE__ */ l("p", { className: "w6w-small", "data-w6w": "app-access", children: [
2620
+ "App access:",
2621
+ " ",
2622
+ e.lastTestOk === !0 ? "passed" : e.lastTestOk === !1 ? "failed" : "never tested"
2623
+ ] }),
2624
+ C && /* @__PURE__ */ t("p", { className: "w6w-small", children: "Credential rotated." }),
2625
+ M ? /* @__PURE__ */ l(A, { children: [
2626
+ /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small", children: [
2627
+ "Enter the full new credential; it replaces the stored one.",
2628
+ O !== null && ` It is used by ${O} connection${O === 1 ? "" : "s"}, and all of them switch to it.`
2629
+ ] }),
2630
+ /* @__PURE__ */ t(
2631
+ Re,
2632
+ {
2633
+ fields: B,
2634
+ values: u,
2635
+ onChange: h
2636
+ }
2637
+ ),
2638
+ /* @__PURE__ */ l("div", { children: [
2639
+ /* @__PURE__ */ t(
2640
+ "button",
2641
+ {
2642
+ type: "button",
2643
+ className: "w6w-btn",
2644
+ disabled: y || ke,
2645
+ onClick: ie,
2646
+ children: "Rotate"
2647
+ }
2648
+ ),
2649
+ " ",
2650
+ /* @__PURE__ */ t(
2651
+ "button",
2652
+ {
2653
+ type: "button",
2654
+ className: "w6w-btn w6w-btn-ghost",
2655
+ onClick: () => {
2656
+ I(!1), h({});
2657
+ },
2658
+ children: "Cancel rotation"
2659
+ }
2660
+ )
2661
+ ] })
2662
+ ] }) : /* @__PURE__ */ t(
2663
+ "button",
2664
+ {
2665
+ type: "button",
2666
+ className: "w6w-btn w6w-btn-ghost",
2667
+ onClick: () => I(!0),
2668
+ children: "Rotate credential"
2669
+ }
2670
+ )
2671
+ ] }),
2672
+ !D && B.length > 0 && /* @__PURE__ */ l(A, { children: [
2673
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Leave a field blank to keep it unchanged. Filled fields replace the stored credential." }),
2674
+ /* @__PURE__ */ t(
2675
+ Re,
2676
+ {
2677
+ mode: "edit",
2678
+ fields: B,
2679
+ values: u,
2680
+ onChange: h,
2681
+ enterSubmitProps: G
2682
+ }
2683
+ )
2684
+ ] })
2685
+ ] }),
2686
+ m && /* @__PURE__ */ t("div", { className: "w6w-result w6w-error", children: m })
2687
+ ] }) }),
2688
+ /* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
2689
+ /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: n, children: "Cancel" }),
2690
+ s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: y, onClick: z, children: y ? "Saving…" : "Save" })
2691
+ ] })
2692
+ ] }) });
2693
+ }
2694
+ function Pa({ conn: e, app: n, children: a }) {
2695
+ return /* @__PURE__ */ l("div", { className: "w6w-connection-header", "data-testid": "connection-header", children: [
2696
+ /* @__PURE__ */ t(
2697
+ be,
2698
+ {
2699
+ src: n == null ? void 0 : n.iconSvg,
2700
+ srcDark: n == null ? void 0 : n.iconSvgDark,
2701
+ brandColor: n == null ? void 0 : n.brandColor,
2702
+ name: (n == null ? void 0 : n.displayName) ?? e.appId,
2703
+ size: 56
2704
+ }
2705
+ ),
2706
+ /* @__PURE__ */ l("div", { className: "w6w-connection-header-main", children: [
2707
+ /* @__PURE__ */ t("h2", { className: "w6w-connection-header-title", children: e.displayName || e.id }),
2708
+ /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-connection-header-meta", children: [
2709
+ /* @__PURE__ */ t(vn, { value: e.id, className: "w6w-connection-id-copy" }),
2710
+ " · App",
2711
+ " ",
2712
+ /* @__PURE__ */ t("code", { children: e.appId }),
2713
+ " · Auth ",
2714
+ /* @__PURE__ */ t("code", { children: e.authKey }),
2715
+ " ·",
2716
+ " ",
2717
+ /* @__PURE__ */ t(
2718
+ "span",
2719
+ {
2720
+ className: `w6w-connection-tag${e.state === "connected" ? "" : " w6w-connection-tag-warn"}`,
2721
+ children: e.state
2722
+ }
2723
+ ),
2724
+ e.lastTestOk === !1 && /* @__PURE__ */ t(
2725
+ "span",
2726
+ {
2727
+ className: "w6w-connection-tag w6w-connection-tag-danger",
2728
+ title: "Last test failed — update or re-test.",
2729
+ children: "invalid"
2730
+ }
2731
+ )
2732
+ ] })
2733
+ ] }),
2734
+ a && /* @__PURE__ */ t("div", { className: "w6w-connection-header-actions", children: a })
2735
+ ] });
2736
+ }
2737
+ const sa = (e) => String(e);
2738
+ function gt(e) {
2739
+ const n = Math.min(100, Math.max(0, e));
2740
+ return Number(n.toFixed(4));
2741
+ }
2742
+ function _a({
2743
+ label: e,
2744
+ used: n,
2745
+ limit: a,
2746
+ reserved: i = 0,
2747
+ format: o,
2748
+ className: c,
2749
+ testId: s
2750
+ }) {
2751
+ const r = o ?? sa, d = Number.isFinite(i) && i > 0, u = a > 0 ? gt(n / a * 100) : 100, h = d && a > 0 ? gt(Math.min(100 - u, i / a * 100)) : 0, f = n >= a, v = `${r(n)} / ${r(a)}`, m = ["w6w-budget-meter"];
2752
+ return f && m.push("w6w-budget-meter-over"), c && m.push(c), /* @__PURE__ */ l(
2753
+ "div",
2754
+ {
2755
+ role: "meter",
2756
+ className: m.join(" "),
2757
+ "aria-label": e,
2758
+ "aria-valuemin": 0,
2759
+ "aria-valuenow": n,
2760
+ "aria-valuemax": a,
2761
+ "aria-valuetext": v,
2762
+ "data-testid": s,
2763
+ children: [
2764
+ /* @__PURE__ */ l("div", { className: "w6w-budget-meter-head", children: [
2765
+ /* @__PURE__ */ t("span", { className: "w6w-budget-meter-label", children: e }),
2766
+ /* @__PURE__ */ t("span", { className: "w6w-budget-meter-value", children: v })
2767
+ ] }),
2768
+ /* @__PURE__ */ l("div", { className: "w6w-budget-meter-track", children: [
2769
+ /* @__PURE__ */ t("div", { className: "w6w-budget-meter-used", style: { width: `${u}%` } }),
2770
+ d && /* @__PURE__ */ t("div", { className: "w6w-budget-meter-reserved", style: { width: `${h}%` } })
2771
+ ] })
2772
+ ]
2773
+ }
2774
+ );
2775
+ }
1751
2776
  export {
1752
- Ps as ActionTestForm,
1753
- en as AddConnectionModal,
1754
- Wt as ApiCallsPanel,
1755
- ce as ApiError,
1756
- tn as AppIcon,
1757
- sn as AppPicker,
1758
- nn as AuthFieldsForm,
1759
- ke as CodeBlock,
1760
- an as CodeEditor,
1761
- _t as Combobox,
1762
- Pt as ConfirmModal,
1763
- qt as Copyable,
1764
- Us as CopyableText,
1765
- Ws as DeleteButton,
1766
- Ks as EditButton,
1767
- Ys as ExecutionDetail,
1768
- Gs as ExecutionFilters,
1769
- zs as ExecutionList,
1770
- ms as ExecutionLogPanel,
1771
- Qs as ExecutionStats,
1772
- rn as ExpressionInput,
1773
- ln as ExpressionOptionsProvider,
1774
- Fs as HealthStatusPill,
1775
- js as HistoryTimeline,
1776
- ze as Icon,
1777
- L as IconButton,
1778
- qs as InfoTip,
1779
- z as JsonEditor,
1780
- Ne as ListItem,
1781
- Ve as Modal,
1782
- on as NodeConfigForm,
1783
- Mt as ParamsForm,
1784
- cn as PropertyEntryForm,
1785
- Vs as RepoSyncIndicator,
1786
- dn as RetryPolicyFields,
1787
- Hs as ServerResourcesBadge,
1788
- Bs as ServerResourcesCard,
1789
- Js as ServerResourcesCardSmall,
1790
- Ds as ServerResourcesRail,
1791
- un as StepBuilderModal,
1792
- Se as StepStatusPill,
1793
- Ls as UptimeStrip,
1794
- wn as W6WUIProvider,
1795
- Is as YamlEditor,
1796
- _s as createW6WApi,
1797
- Qt as cropText,
1798
- mn as filterOptions,
1799
- $e as formatDurationMs,
1800
- X as formatExecutionTime,
1801
- xn as iconNames,
1802
- hn as isExprValue,
1803
- pn as isSecretValue,
1804
- fn as isTestRequired,
1805
- vn as requiredParamsFilled,
1806
- yn as shouldUseCombobox,
1807
- Nn as startOAuthPopup,
1808
- gn as useEnterSubmit,
1809
- bn as useExpressionOptions,
1810
- Et as useW6WApi
2777
+ ft as ATTENTION_DISPLAY_CAP,
2778
+ pa as ActionTestForm,
2779
+ Fa as AddConnectionModal,
2780
+ ot as ApiCallsPanel,
2781
+ pe as ApiError,
2782
+ be as AppIcon,
2783
+ Da as AppPicker,
2784
+ Re as AuthFieldsForm,
2785
+ _a as BudgetMeter,
2786
+ Ia as CallableList,
2787
+ Ba as CanvasLayer,
2788
+ He as CodeBlock,
2789
+ Ja as CodeEditor,
2790
+ Gt as Combobox,
2791
+ Yt as ConfirmModal,
2792
+ Pa as ConnectionHeader,
2793
+ Ea as ConnectionList,
2794
+ wn as Copyable,
2795
+ vn as CopyableText,
2796
+ Ka as CredentialPicker,
2797
+ Tt as DataTable,
2798
+ Mn as DeleteButton,
2799
+ En as EditButton,
2800
+ Ma as EditConnectionModal,
2801
+ je as EmptyState,
2802
+ Ta as ExecutionDetail,
2803
+ Sa as ExecutionFilters,
2804
+ Ca as ExecutionList,
2805
+ Un as ExecutionLogPanel,
2806
+ $a as ExecutionStats,
2807
+ ja as ExpressionInput,
2808
+ Ha as ExpressionOptionsProvider,
2809
+ We as HealthStatusPill,
2810
+ ba as HistoryTimeline,
2811
+ dt as Icon,
2812
+ ae as IconButton,
2813
+ ka as InfoTip,
2814
+ me as JsonEditor,
2815
+ Be as ListItem,
2816
+ Wa as Markdown,
2817
+ Fe as Modal,
2818
+ qa as NodeConfigForm,
2819
+ zt as ParamsForm,
2820
+ Va as PropertyEntryForm,
2821
+ Qn as RECENT_DISPLAY_CAP,
2822
+ Xn as ReliabilityChart,
2823
+ Ra as ReliabilityList,
2824
+ xa as RepoSyncIndicator,
2825
+ za as RetryPolicyFields,
2826
+ ga as ServerResourcesBadge,
2827
+ va as ServerResourcesCard,
2828
+ ya as ServerResourcesCardSmall,
2829
+ Na as ServerResourcesRail,
2830
+ Ga as StepBuilderModal,
2831
+ Ve as StepStatusPill,
2832
+ gn as UptimeStrip,
2833
+ Ya as W6WUIProvider,
2834
+ fa as YamlEditor,
2835
+ Oa as connectionAppIdsToLookUp,
2836
+ ma as createW6WApi,
2837
+ fn as cropText,
2838
+ Zn as displayBoard,
2839
+ Qa as filterOptions,
2840
+ ze as formatDurationMs,
2841
+ ge as formatExecutionTime,
2842
+ cs as iconNames,
2843
+ Za as isExprValue,
2844
+ Xa as isFormResolvedOptions,
2845
+ es as isSecretValue,
2846
+ ts as isTestRequired,
2847
+ Aa as needsAttention,
2848
+ Gn as partitionBoard,
2849
+ zn as performancePoints,
2850
+ ns as requiredParamsFilled,
2851
+ aa as resolveConnectionAppMeta,
2852
+ as as shouldUseCombobox,
2853
+ ss as splitFrontmatter,
2854
+ ls as startOAuthPopup,
2855
+ Yn as uptimeDays,
2856
+ en as useEnterSubmit,
2857
+ is as useExpressionOptions,
2858
+ bt as useW6WApi
1811
2859
  };
1812
2860
  //# sourceMappingURL=index.mjs.map