@burdenoff/microfe-subscriberbot 2026.827.1 → 2026.1014.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
  2. package/dist/subscriberbot/admin/AdminDashboardPage.js +80 -83
  3. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  4. package/dist/subscriberbot/hooks/index.d.ts +1 -0
  5. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  6. package/dist/subscriberbot/hooks/index.js +1 -0
  7. package/dist/subscriberbot/hooks/useTr.d.ts +17 -0
  8. package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -0
  9. package/dist/subscriberbot/hooks/useTr.js +14 -0
  10. package/dist/subscriberbot/hooks/useTr.js.map +1 -0
  11. package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
  12. package/dist/subscriberbot/pages/AssetVaultPage.js +111 -109
  13. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
  14. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  15. package/dist/subscriberbot/pages/DashboardPage.js +113 -105
  16. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  17. package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
  18. package/dist/subscriberbot/pages/InboxPage.js +404 -369
  19. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  20. package/dist/subscriberbot/pages/InsightsPage.d.ts.map +1 -1
  21. package/dist/subscriberbot/pages/InsightsPage.js +94 -93
  22. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
  23. package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
  24. package/dist/subscriberbot/pages/InvoicesPage.js +360 -366
  25. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  26. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  27. package/dist/subscriberbot/pages/WorkflowsPage.js +209 -193
  28. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  29. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  30. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +268 -236
  31. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  32. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  33. package/dist/subscriberbot/pages/agents/AgentNewPage.js +96 -76
  34. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  35. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  36. package/dist/subscriberbot/pages/agents/AgentsListPage.js +145 -161
  37. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  38. package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
  39. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +514 -441
  40. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  41. package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
  42. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +167 -129
  43. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  44. package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
  45. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +171 -218
  46. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  47. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  48. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +340 -279
  49. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  50. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
  51. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +185 -166
  52. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  53. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  54. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +153 -182
  55. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  56. package/package.json +1 -1
@@ -7,56 +7,62 @@ import { Modal as a } from "../components/Modal.js";
7
7
  import { ErrorView as o, LoadingView as s } from "../components/StateViews.js";
8
8
  import "../components/index.js";
9
9
  import { useActivateWorkflow as c, useCreateWorkflow as l, useWorkflows as u } from "../hooks/useSubscriberBotApi.js";
10
- import { useState as d } from "react";
11
- import { ArrowRight as f, CheckCircle2 as p, Clock as m, Play as h, Plus as g, Sparkles as _, Workflow as v, X as y, Zap as b } from "lucide-react";
12
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
13
- import { GlassCard as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
10
+ import { useTr as d } from "../hooks/useTr.js";
11
+ import { useState as f } from "react";
12
+ import { ArrowRight as p, CheckCircle2 as m, Clock as h, Play as g, Plus as _, Sparkles as v, Workflow as y, X as b, Zap as x } from "lucide-react";
13
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
14
+ import { GlassCard as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/subscriberbot/pages/WorkflowsPage.tsx
15
- var E = [
16
+ var D = [
16
17
  {
17
18
  value: "",
18
- label: "All statuses"
19
+ labelKey: "workflows.filters.allStatuses",
20
+ fallback: "All statuses"
19
21
  },
20
22
  {
21
23
  value: "ACTIVE",
22
- label: "Active"
24
+ labelKey: "workflows.filters.active",
25
+ fallback: "Active"
23
26
  },
24
27
  {
25
28
  value: "DRAFT",
26
- label: "Draft"
29
+ labelKey: "workflows.filters.draft",
30
+ fallback: "Draft"
27
31
  },
28
32
  {
29
33
  value: "PAUSED",
30
- label: "Paused"
34
+ labelKey: "workflows.filters.paused",
35
+ fallback: "Paused"
31
36
  },
32
37
  {
33
38
  value: "ARCHIVED",
34
- label: "Archived"
39
+ labelKey: "workflows.filters.archived",
40
+ fallback: "Archived"
35
41
  }
36
- ], D = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", O = "mb-1 block text-xs font-medium text-text-secondary";
37
- function k({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
38
- return /* @__PURE__ */ C("div", {
42
+ ], O = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", k = "mb-1 block text-xs font-medium text-text-secondary";
43
+ function A({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
44
+ return /* @__PURE__ */ w("div", {
39
45
  className: "w-48 shrink-0 overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-sm",
40
- children: [/* @__PURE__ */ S("div", {
46
+ children: [/* @__PURE__ */ C("div", {
41
47
  className: `h-1 w-full ${i === "done" ? "bg-status-success-text" : i === "run" ? "bg-status-warning-text" : "bg-[var(--color-accent-indigo)]"}`,
42
48
  "aria-hidden": !0
43
- }), /* @__PURE__ */ C("div", {
49
+ }), /* @__PURE__ */ w("div", {
44
50
  className: "p-3",
45
51
  children: [
46
- /* @__PURE__ */ S("span", {
52
+ /* @__PURE__ */ C("span", {
47
53
  className: "flex size-8 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
48
54
  children: e
49
55
  }),
50
- /* @__PURE__ */ S("p", {
56
+ /* @__PURE__ */ C("p", {
51
57
  className: "mt-2 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
52
58
  children: t
53
59
  }),
54
- /* @__PURE__ */ S("p", {
60
+ /* @__PURE__ */ C("p", {
55
61
  className: "truncate text-sm font-semibold text-text-primary",
56
62
  title: n,
57
63
  children: n
58
64
  }),
59
- r && /* @__PURE__ */ S("p", {
65
+ r && /* @__PURE__ */ C("p", {
60
66
  className: "mt-0.5 truncate text-xs text-text-secondary",
61
67
  children: r
62
68
  })
@@ -64,339 +70,349 @@ function k({ icon: e, kicker: t, title: n, sub: r, accent: i }) {
64
70
  })]
65
71
  });
66
72
  }
67
- function A({ workflow: e, onClose: t, onActivate: i, activating: a }) {
68
- let o = /* @__PURE__ */ C("div", {
73
+ function j({ workflow: e, onClose: t, onActivate: i, activating: a }) {
74
+ let o = d(), s = /* @__PURE__ */ w("div", {
69
75
  className: "flex shrink-0 items-center px-1 text-text-secondary",
70
76
  "aria-hidden": !0,
71
- children: [/* @__PURE__ */ S("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ S(f, { className: "h-4 w-4" })]
72
- });
73
- return /* @__PURE__ */ C(w, {
77
+ children: [/* @__PURE__ */ C("span", { className: "h-px w-4 bg-border-seam sm:w-6" }), /* @__PURE__ */ C(p, { className: "h-4 w-4" })]
78
+ }), c = e.status.charAt(0) + e.status.slice(1).toLowerCase();
79
+ return /* @__PURE__ */ w(T, {
74
80
  treatment: "glass",
75
81
  glow: !0,
76
82
  className: "mt-6 p-5",
77
83
  children: [
78
- /* @__PURE__ */ C("div", {
84
+ /* @__PURE__ */ w("div", {
79
85
  className: "flex flex-wrap items-start justify-between gap-3",
80
- children: [/* @__PURE__ */ C("div", {
86
+ children: [/* @__PURE__ */ w("div", {
81
87
  className: "min-w-0",
82
- children: [/* @__PURE__ */ C("div", {
88
+ children: [/* @__PURE__ */ w("div", {
83
89
  className: "flex flex-wrap items-center gap-2",
84
- children: [/* @__PURE__ */ S("p", {
90
+ children: [/* @__PURE__ */ C("p", {
85
91
  className: "text-base font-semibold text-text-primary",
86
92
  children: e.name
87
- }), /* @__PURE__ */ S(r, { status: e.status })]
88
- }), /* @__PURE__ */ C("p", {
93
+ }), /* @__PURE__ */ C(r, { status: e.status })]
94
+ }), /* @__PURE__ */ w("p", {
89
95
  className: "mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary",
90
96
  children: [/* @__PURE__ */ C("span", {
91
97
  className: "tabular-nums",
92
- children: [
93
- "Ran ",
94
- e.runCount,
95
- "×"
96
- ]
97
- }), e.lastRunAt && /* @__PURE__ */ C("span", {
98
+ children: o("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount })
99
+ }), e.lastRunAt && /* @__PURE__ */ w("span", {
98
100
  className: "inline-flex items-center gap-1",
99
101
  children: [
100
- /* @__PURE__ */ S(m, {
102
+ /* @__PURE__ */ C(h, {
101
103
  className: "h-3 w-3",
102
104
  "aria-hidden": !0
103
105
  }),
104
- " last",
105
106
  " ",
106
- n(e.lastRunAt)
107
+ o("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })
107
108
  ]
108
109
  })]
109
110
  })]
110
- }), /* @__PURE__ */ S("button", {
111
+ }), /* @__PURE__ */ C("button", {
111
112
  type: "button",
112
113
  onClick: t,
113
- "aria-label": "Close flow",
114
+ "aria-label": o("workflows.flow.closeAriaLabel", "Close flow"),
114
115
  className: "rounded-lg border border-border-subtle p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
115
- children: /* @__PURE__ */ S(y, { className: "h-4 w-4" })
116
+ children: /* @__PURE__ */ C(b, { className: "h-4 w-4" })
116
117
  })]
117
118
  }),
118
- e.description && /* @__PURE__ */ S("p", {
119
+ e.description && /* @__PURE__ */ C("p", {
119
120
  className: "mt-2 max-w-3xl text-sm text-text-secondary",
120
121
  children: e.description
121
122
  }),
122
- /* @__PURE__ */ S("div", {
123
+ /* @__PURE__ */ C("div", {
123
124
  className: "mt-4 overflow-x-auto pb-2",
124
- children: /* @__PURE__ */ C("div", {
125
+ children: /* @__PURE__ */ w("div", {
125
126
  className: "flex min-w-max items-stretch",
126
127
  children: [
127
- /* @__PURE__ */ S(k, {
128
+ /* @__PURE__ */ C(A, {
128
129
  accent: "trigger",
129
- kicker: "When",
130
- icon: /* @__PURE__ */ S(b, { className: "h-4 w-4" }),
130
+ kicker: o("workflows.flow.trigger", "When"),
131
+ icon: /* @__PURE__ */ C(x, { className: "h-4 w-4" }),
131
132
  title: e.triggerEvent,
132
- sub: "Trigger event"
133
+ sub: o("workflows.flow.triggerEvent", "Trigger event")
133
134
  }),
134
- o,
135
- /* @__PURE__ */ S(k, {
135
+ s,
136
+ /* @__PURE__ */ C(A, {
136
137
  accent: "run",
137
- kicker: "Run",
138
- icon: /* @__PURE__ */ S(_, { className: "h-4 w-4" }),
138
+ kicker: o("workflows.flow.run", "Run"),
139
+ icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" }),
139
140
  title: e.name,
140
- sub: "Automation"
141
+ sub: o("workflows.flow.automation", "Automation")
141
142
  }),
142
- o,
143
- /* @__PURE__ */ S(k, {
143
+ s,
144
+ /* @__PURE__ */ C(A, {
144
145
  accent: "done",
145
- kicker: "Then",
146
- icon: /* @__PURE__ */ S(p, { className: "h-4 w-4" }),
147
- title: e.status === "ACTIVE" ? "Live" : "Awaiting activation",
148
- sub: `Status: ${e.status.charAt(0) + e.status.slice(1).toLowerCase()}`
146
+ kicker: o("workflows.flow.then", "Then"),
147
+ icon: /* @__PURE__ */ C(m, { className: "h-4 w-4" }),
148
+ title: e.status === "ACTIVE" ? o("workflows.flow.live", "Live") : o("workflows.flow.awaitingActivation", "Awaiting activation"),
149
+ sub: o("workflows.flow.status", "Status: {{status}}", { status: c })
149
150
  })
150
151
  ]
151
152
  })
152
153
  }),
153
- e.status !== "ACTIVE" && /* @__PURE__ */ S("div", {
154
+ e.status !== "ACTIVE" && /* @__PURE__ */ C("div", {
154
155
  className: "mt-3 flex justify-end",
155
- children: /* @__PURE__ */ C("button", {
156
+ children: /* @__PURE__ */ w("button", {
156
157
  type: "button",
157
158
  disabled: a,
158
159
  onClick: i,
159
160
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
160
161
  children: [
161
- /* @__PURE__ */ S(h, { className: "h-4 w-4" }),
162
+ /* @__PURE__ */ C(g, { className: "h-4 w-4" }),
162
163
  " ",
163
- a ? "Activating…" : "Activate workflow"
164
+ a ? o("common.activating", "Activating…") : o("workflows.flow.activate", "Activate workflow")
164
165
  ]
165
166
  })
166
167
  })
167
168
  ]
168
169
  });
169
170
  }
170
- function j() {
171
- let [f, p] = d(""), [m, _] = d(!1), [y, k] = d(null), { data: j, isLoading: M, isError: N, refetch: P } = u(f || void 0), F = l(), I = c(), [L, R] = d(""), [z, B] = d(""), [V, H] = d(""), [U, W] = d(null), G = j ?? [], K = G.find((e) => e.id === y) ?? null, q = G.filter((e) => e.status === "ACTIVE").length, J = G.reduce((e, t) => e + (t.runCount || 0), 0), Y = () => {
172
- R(""), B(""), H(""), W(null);
173
- }, X = () => {
174
- _(!1), Y();
171
+ function M() {
172
+ let [p, m] = f(""), [h, v] = f(!1), [b, A] = f(null), M = d(), { data: N, isLoading: P, isError: F, refetch: I } = u(p || void 0), L = l(), R = c(), [z, B] = f(""), [V, H] = f(""), [U, W] = f(""), [G, K] = f(null), q = N ?? [], J = q.find((e) => e.id === b) ?? null, Y = q.filter((e) => e.status === "ACTIVE").length, X = q.reduce((e, t) => e + (t.runCount || 0), 0), Z = () => {
173
+ B(""), H(""), W(""), K(null);
174
+ }, Q = () => {
175
+ v(!1), Z();
175
176
  };
176
- return /* @__PURE__ */ C(e, {
177
- title: "Workflows",
178
- description: "Event-driven automation across your portfolio",
179
- actions: /* @__PURE__ */ C("button", {
177
+ return /* @__PURE__ */ w(e, {
178
+ title: M("workflows.title", "Workflows"),
179
+ description: M("workflows.description", "Event-driven automation across your portfolio"),
180
+ actions: /* @__PURE__ */ w("button", {
180
181
  type: "button",
181
- onClick: () => _(!0),
182
+ onClick: () => v(!0),
182
183
  className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
183
- children: [/* @__PURE__ */ S(g, { className: "h-4 w-4" }), " New workflow"]
184
+ children: [
185
+ /* @__PURE__ */ C(_, { className: "h-4 w-4" }),
186
+ " ",
187
+ M("workflows.newWorkflow", "New workflow")
188
+ ]
184
189
  }),
185
190
  children: [
186
- /* @__PURE__ */ S(T, {
191
+ /* @__PURE__ */ C(E, {
187
192
  className: "mb-4",
188
- children: "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready."
193
+ children: M("workflows.purpose", "Workflows react to domain events — a new invoice, a detected renewal, a cancelled relationship — and run multi-step automations. Draft a workflow, then activate it when you're ready.")
189
194
  }),
190
- /* @__PURE__ */ S("div", {
195
+ /* @__PURE__ */ C("div", {
191
196
  className: "flex flex-wrap items-center gap-3",
192
- children: /* @__PURE__ */ S("select", {
193
- "aria-label": "Filter by status",
194
- value: f,
195
- onChange: (e) => p(e.target.value),
197
+ children: /* @__PURE__ */ C("select", {
198
+ "aria-label": M("common.filter", "Filter"),
199
+ value: p,
200
+ onChange: (e) => m(e.target.value),
196
201
  className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
197
- children: E.map((e) => /* @__PURE__ */ S("option", {
202
+ children: D.map((e) => /* @__PURE__ */ C("option", {
198
203
  value: e.value,
199
- children: e.label
204
+ children: M(e.labelKey, e.fallback)
200
205
  }, e.value))
201
206
  })
202
207
  }),
203
- M ? /* @__PURE__ */ S(s, { label: "Loading workflows…" }) : N ? /* @__PURE__ */ S(o, {
204
- message: "Could not load workflows.",
205
- onRetry: () => void P()
206
- }) : G.length === 0 ? /* @__PURE__ */ S("div", {
208
+ P ? /* @__PURE__ */ C(s, { label: M("workflows.loading", "Loading workflows…") }) : F ? /* @__PURE__ */ C(o, {
209
+ message: M("workflows.error", "Could not load workflows."),
210
+ onRetry: () => void I()
211
+ }) : q.length === 0 ? /* @__PURE__ */ C("div", {
207
212
  className: "mt-6",
208
- children: /* @__PURE__ */ S(i, {
213
+ children: /* @__PURE__ */ C(i, {
209
214
  illustration: "empty-data",
210
- icon: /* @__PURE__ */ S(v, { className: "h-12 w-12" }),
211
- title: "No workflows yet",
212
- description: "Create your first event-driven workflow to automate your recurring portfolio.",
213
- action: /* @__PURE__ */ S("button", {
215
+ icon: /* @__PURE__ */ C(y, { className: "h-12 w-12" }),
216
+ title: M("workflows.empty.title", "No workflows yet"),
217
+ description: M("workflows.empty.description", "Create your first event-driven workflow to automate your recurring portfolio."),
218
+ action: /* @__PURE__ */ C("button", {
214
219
  type: "button",
215
- onClick: () => _(!0),
220
+ onClick: () => v(!0),
216
221
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
217
- children: "New workflow"
222
+ children: M("workflows.newWorkflow", "New workflow")
218
223
  })
219
224
  })
220
- }) : /* @__PURE__ */ C(x, { children: [
221
- /* @__PURE__ */ C("div", {
225
+ }) : /* @__PURE__ */ w(S, { children: [
226
+ /* @__PURE__ */ w("div", {
222
227
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
223
228
  children: [
224
- /* @__PURE__ */ S(t, {
225
- icon: /* @__PURE__ */ S(v, { className: "h-5 w-5" }),
226
- value: G.length,
227
- label: "Workflows"
229
+ /* @__PURE__ */ C(t, {
230
+ icon: /* @__PURE__ */ C(y, { className: "h-5 w-5" }),
231
+ value: q.length,
232
+ label: M("workflows.metrics.workflows", "Workflows")
228
233
  }),
229
- /* @__PURE__ */ S(t, {
230
- icon: /* @__PURE__ */ S(b, { className: "h-5 w-5" }),
231
- value: q,
232
- label: "Active"
234
+ /* @__PURE__ */ C(t, {
235
+ icon: /* @__PURE__ */ C(x, { className: "h-5 w-5" }),
236
+ value: Y,
237
+ label: M("workflows.metrics.active", "Active")
233
238
  }),
234
- /* @__PURE__ */ S(t, {
235
- icon: /* @__PURE__ */ S(h, { className: "h-5 w-5" }),
236
- value: J,
237
- label: "Total runs"
239
+ /* @__PURE__ */ C(t, {
240
+ icon: /* @__PURE__ */ C(g, { className: "h-5 w-5" }),
241
+ value: X,
242
+ label: M("workflows.metrics.totalRuns", "Total runs")
238
243
  })
239
244
  ]
240
245
  }),
241
- K && /* @__PURE__ */ S(A, {
242
- workflow: K,
243
- onClose: () => k(null),
244
- onActivate: () => I.mutate(K.id),
245
- activating: I.isPending
246
+ J && /* @__PURE__ */ C(j, {
247
+ workflow: J,
248
+ onClose: () => A(null),
249
+ onActivate: () => R.mutate(J.id),
250
+ activating: R.isPending
246
251
  }),
247
- /* @__PURE__ */ S("div", {
252
+ /* @__PURE__ */ C("div", {
248
253
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
249
- children: G.map((e) => {
250
- let t = e.id === y;
251
- return /* @__PURE__ */ C(w, {
254
+ children: q.map((e) => {
255
+ let t = e.id === b;
256
+ return /* @__PURE__ */ w(T, {
252
257
  treatment: "metric",
253
258
  glow: t || e.status === "ACTIVE",
254
259
  role: "button",
255
260
  tabIndex: 0,
256
261
  "aria-pressed": t,
257
- "aria-label": `View flow for ${e.name}`,
258
- onClick: () => k(t ? null : e.id),
262
+ "aria-label": M("workflows.card.viewAriaLabel", "View flow for {{name}}", { name: e.name }),
263
+ onClick: () => A(t ? null : e.id),
259
264
  onKeyDown: (n) => {
260
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), k(t ? null : e.id));
265
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), A(t ? null : e.id));
261
266
  },
262
267
  className: "flex cursor-pointer flex-col p-5 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
263
268
  children: [
264
- /* @__PURE__ */ C("div", {
269
+ /* @__PURE__ */ w("div", {
265
270
  className: "flex items-start justify-between gap-2",
266
- children: [/* @__PURE__ */ S("span", {
271
+ children: [/* @__PURE__ */ C("span", {
267
272
  className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
268
- children: /* @__PURE__ */ S(v, { className: "h-5 w-5" })
269
- }), /* @__PURE__ */ S(r, { status: e.status })]
273
+ children: /* @__PURE__ */ C(y, { className: "h-5 w-5" })
274
+ }), /* @__PURE__ */ C(r, { status: e.status })]
270
275
  }),
271
- /* @__PURE__ */ S("p", {
276
+ /* @__PURE__ */ C("p", {
272
277
  className: "mt-3 truncate text-sm font-semibold text-text-primary",
273
278
  children: e.name
274
279
  }),
275
- /* @__PURE__ */ C("p", {
280
+ /* @__PURE__ */ w("p", {
276
281
  className: "flex items-center gap-1 truncate text-xs text-text-secondary",
277
282
  children: [
278
- /* @__PURE__ */ S(b, {
283
+ /* @__PURE__ */ C(x, {
279
284
  className: "h-3 w-3 shrink-0",
280
285
  "aria-hidden": !0
281
286
  }),
282
- " on ",
283
- e.triggerEvent
287
+ " ",
288
+ M("workflows.card.onTrigger", "on {{trigger}}", { trigger: e.triggerEvent })
284
289
  ]
285
290
  }),
286
- e.description && /* @__PURE__ */ S("p", {
291
+ e.description && /* @__PURE__ */ C("p", {
287
292
  className: "mt-2 line-clamp-2 min-h-[2rem] text-xs text-text-secondary",
288
293
  children: e.description
289
294
  }),
290
- /* @__PURE__ */ C("p", {
295
+ /* @__PURE__ */ w("p", {
291
296
  className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary tabular-nums",
292
297
  children: [
293
- /* @__PURE__ */ S(h, {
298
+ /* @__PURE__ */ C(g, {
294
299
  className: "h-3.5 w-3.5",
295
300
  "aria-hidden": !0
296
301
  }),
297
- " Ran ",
298
- e.runCount,
299
- "×",
300
- e.lastRunAt ? ` · last ${n(e.lastRunAt)}` : ""
302
+ " ",
303
+ M("workflows.flow.ran", "Ran {{count}}×", { count: e.runCount }),
304
+ e.lastRunAt ? ` · ${M("workflows.flow.lastRun", "last {{when}}", { when: n(e.lastRunAt) })}` : ""
301
305
  ]
302
306
  }),
303
- e.status !== "ACTIVE" && /* @__PURE__ */ C("button", {
307
+ e.status !== "ACTIVE" && /* @__PURE__ */ w("button", {
304
308
  type: "button",
305
- disabled: I.isPending,
309
+ disabled: R.isPending,
306
310
  onClick: (t) => {
307
- t.stopPropagation(), I.mutate(e.id);
311
+ t.stopPropagation(), R.mutate(e.id);
308
312
  },
309
313
  className: "mt-4 inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
310
- children: [/* @__PURE__ */ S(h, { className: "h-3.5 w-3.5" }), " Activate"]
314
+ children: [
315
+ /* @__PURE__ */ C(g, { className: "h-3.5 w-3.5" }),
316
+ " ",
317
+ M("common.activate", "Activate")
318
+ ]
311
319
  })
312
320
  ]
313
321
  }, e.id);
314
322
  })
315
323
  })
316
324
  ] }),
317
- m && /* @__PURE__ */ S(a, {
318
- title: "New workflow",
319
- onClose: X,
320
- children: /* @__PURE__ */ C("form", {
325
+ h && /* @__PURE__ */ C(a, {
326
+ title: M("workflows.newWorkflow", "New workflow"),
327
+ onClose: Q,
328
+ children: /* @__PURE__ */ w("form", {
321
329
  onSubmit: (e) => {
322
- if (e.preventDefault(), W(null), !L.trim() || !z.trim()) {
323
- W("Name and trigger event are required.");
330
+ if (e.preventDefault(), K(null), !z.trim() || !V.trim()) {
331
+ K(M("workflows.form.nameRequired", "Name and trigger event are required."));
324
332
  return;
325
333
  }
326
334
  let t = {
327
- name: L.trim(),
328
- triggerEvent: z.trim(),
329
- ...V.trim() ? { description: V.trim() } : {}
335
+ name: z.trim(),
336
+ triggerEvent: V.trim(),
337
+ ...U.trim() ? { description: U.trim() } : {}
330
338
  };
331
- F.mutate(t, {
339
+ L.mutate(t, {
332
340
  onSuccess: () => {
333
- Y(), _(!1);
341
+ Z(), v(!1);
334
342
  },
335
- onError: (e) => W(e instanceof Error ? e.message : "Could not create workflow.")
343
+ onError: (e) => K(e instanceof Error ? e.message : M("common.error", "An error occurred"))
336
344
  });
337
345
  },
338
346
  className: "space-y-4",
339
347
  children: [
340
- U && /* @__PURE__ */ S("div", {
348
+ G && /* @__PURE__ */ C("div", {
341
349
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
342
- children: U
350
+ children: G
343
351
  }),
344
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
352
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
345
353
  htmlFor: "wf-name",
346
- className: O,
347
- children: ["Name ", /* @__PURE__ */ S("span", {
348
- className: "text-status-error-text",
349
- children: "*"
350
- })]
351
- }), /* @__PURE__ */ S("input", {
354
+ className: k,
355
+ children: [
356
+ M("workflows.form.nameLabel", "Name"),
357
+ " ",
358
+ /* @__PURE__ */ C("span", {
359
+ className: "text-status-error-text",
360
+ children: "*"
361
+ })
362
+ ]
363
+ }), /* @__PURE__ */ C("input", {
352
364
  id: "wf-name",
353
365
  type: "text",
354
- value: L,
355
- onChange: (e) => R(e.target.value),
356
- placeholder: "e.g. Invoice → notify finance",
357
- className: D,
366
+ value: z,
367
+ onChange: (e) => B(e.target.value),
368
+ placeholder: M("workflows.form.namePlaceholder", "e.g. Invoice → notify finance"),
369
+ className: O,
358
370
  required: !0
359
371
  })] }),
360
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
372
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("label", {
361
373
  htmlFor: "wf-trigger",
362
- className: O,
363
- children: ["Trigger event ", /* @__PURE__ */ S("span", {
364
- className: "text-status-error-text",
365
- children: "*"
366
- })]
367
- }), /* @__PURE__ */ S("input", {
374
+ className: k,
375
+ children: [
376
+ M("workflows.form.triggerLabel", "Trigger event"),
377
+ " ",
378
+ /* @__PURE__ */ C("span", {
379
+ className: "text-status-error-text",
380
+ children: "*"
381
+ })
382
+ ]
383
+ }), /* @__PURE__ */ C("input", {
368
384
  id: "wf-trigger",
369
385
  type: "text",
370
- value: z,
371
- onChange: (e) => B(e.target.value),
372
- placeholder: "e.g. InvoiceReceived, RenewalDetected",
373
- className: D,
386
+ value: V,
387
+ onChange: (e) => H(e.target.value),
388
+ placeholder: M("workflows.form.triggerPlaceholder", "e.g. InvoiceReceived, RenewalDetected"),
389
+ className: O,
374
390
  required: !0
375
391
  })] }),
376
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
392
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("label", {
377
393
  htmlFor: "wf-desc",
378
- className: O,
379
- children: "Description"
380
- }), /* @__PURE__ */ S("textarea", {
394
+ className: k,
395
+ children: M("workflows.form.descriptionLabel", "Description")
396
+ }), /* @__PURE__ */ C("textarea", {
381
397
  id: "wf-desc",
382
- value: V,
383
- onChange: (e) => H(e.target.value),
398
+ value: U,
399
+ onChange: (e) => W(e.target.value),
384
400
  rows: 3,
385
- placeholder: "What should this workflow do when the event fires?",
386
- className: D
401
+ placeholder: M("workflows.form.descriptionPlaceholder", "What should this workflow do when the event fires?"),
402
+ className: O
387
403
  })] }),
388
- /* @__PURE__ */ C("div", {
404
+ /* @__PURE__ */ w("div", {
389
405
  className: "flex justify-end gap-3",
390
- children: [/* @__PURE__ */ S("button", {
406
+ children: [/* @__PURE__ */ C("button", {
391
407
  type: "button",
392
- onClick: X,
408
+ onClick: Q,
393
409
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
394
- children: "Cancel"
395
- }), /* @__PURE__ */ S("button", {
410
+ children: M("common.cancel", "Cancel")
411
+ }), /* @__PURE__ */ C("button", {
396
412
  type: "submit",
397
- disabled: F.isPending,
413
+ disabled: L.isPending,
398
414
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
399
- children: F.isPending ? "Creating…" : "Create workflow"
415
+ children: L.isPending ? M("workflows.creating", "Creating…") : M("workflows.createWorkflow", "Create workflow")
400
416
  })]
401
417
  })
402
418
  ]
@@ -406,6 +422,6 @@ function j() {
406
422
  });
407
423
  }
408
424
  //#endregion
409
- export { j as WorkflowsPage };
425
+ export { M as WorkflowsPage };
410
426
 
411
427
  //# sourceMappingURL=WorkflowsPage.js.map