@burdenoff/microfe-bigconsole 2026.608.1 → 2026.612.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 (27) hide show
  1. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +13 -8
  2. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
  3. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
  4. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js.map +1 -1
  5. package/dist/bigconsole/components/widgets/WidgetRegistry.js +2 -1
  6. package/dist/bigconsole/components/widgets/WidgetRegistry.js.map +1 -1
  7. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +4 -4
  8. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
  9. package/dist/bigconsole/components/widgets/form/FormWidget.js +20 -20
  10. package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
  11. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +1 -1
  12. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
  13. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +2 -2
  14. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js.map +1 -1
  15. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js +2 -2
  16. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js.map +1 -1
  17. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +37 -37
  18. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
  19. package/dist/bigconsole/hooks/useDashboardOperations.js +92 -70
  20. package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
  21. package/dist/bigconsole/pages/DashboardsPage.js +120 -77
  22. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  23. package/dist/bigconsole/pages/InsightsPage.js +787 -392
  24. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  25. package/dist/generated/wspace-operations.js +105 -107
  26. package/dist/generated/wspace-operations.js.map +1 -1
  27. package/package.json +1 -1
@@ -2,12 +2,12 @@ import { useAppNavigate as e } from "../contexts/NavigationContext.js";
2
2
  import "../contexts/index.js";
3
3
  import { isNative as t, nativeImpact as n, nativeNotify as r } from "../../utils/nativeBridge.js";
4
4
  import { memo as i, useCallback as a, useEffect as o, useState as s } from "react";
5
- import { AlertCircle as c, ArrowRight as l, CheckCircle as u, Clock as d, Loader2 as f, Sparkles as p, Trash2 as m, XCircle as h } from "lucide-react";
6
- import { gql as g } from "@apollo/client";
7
- import { useMutation as _, useQuery as v } from "@apollo/client/react";
8
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
5
+ import { AlertCircle as c, ArrowRight as l, Ban as ee, CheckCircle as u, Clock as d, Eye as f, Loader2 as p, RefreshCw as m, Sparkles as h, Trash2 as te, Wand2 as g, X as ne, XCircle as _ } from "lucide-react";
6
+ import { gql as v } from "@apollo/client";
7
+ import { useMutation as y, useQuery as b } from "@apollo/client/react";
8
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
9
9
  //#region src/bigconsole/pages/InsightsPage.tsx
10
- var x = g`
10
+ var C = v`
11
11
  query ListPromptGenerations($status: PromptGenerationStatus, $first: Int) {
12
12
  listPromptGenerations(status: $status, first: $first) {
13
13
  edges {
@@ -36,7 +36,7 @@ var x = g`
36
36
  totalCount
37
37
  }
38
38
  }
39
- `, S = g`
39
+ `, re = v`
40
40
  query GetPromptSuggestions($category: String, $limit: Int) {
41
41
  getPromptSuggestions(category: $category, limit: $limit) {
42
42
  id
@@ -47,7 +47,7 @@ var x = g`
47
47
  tags
48
48
  }
49
49
  }
50
- `, C = g`
50
+ `, ie = v`
51
51
  mutation GenerateDashboardFromPrompt($input: GenerateDashboardFromPromptInput!) {
52
52
  generateDashboardFromPrompt(input: $input) {
53
53
  id
@@ -55,42 +55,65 @@ var x = g`
55
55
  prompt
56
56
  }
57
57
  }
58
- `, w = g`
58
+ `, w = v`
59
59
  mutation CreateDashboardFromGeneration($input: CreateDashboardFromGenerationInput!) {
60
60
  createDashboardFromGeneration(input: $input) {
61
61
  id
62
62
  }
63
63
  }
64
- `, T = g`
64
+ `, T = v`
65
65
  mutation DeletePromptGeneration($generationId: ID!) {
66
66
  deletePromptGeneration(generationId: $generationId)
67
67
  }
68
- `, E = [
68
+ `, ae = v`
69
+ mutation CancelPromptGeneration($generationId: ID!) {
70
+ cancelPromptGeneration(generationId: $generationId) {
71
+ id
72
+ status
73
+ }
74
+ }
75
+ `, E = v`
76
+ mutation RegenerateDashboard($input: RegenerateDashboardInput!) {
77
+ regenerateDashboard(input: $input) {
78
+ id
79
+ status
80
+ prompt
81
+ }
82
+ }
83
+ `, oe = v`
84
+ mutation RefineGeneratedDashboard($input: RefineGeneratedDashboardInput!) {
85
+ refineGeneratedDashboard(input: $input) {
86
+ id
87
+ status
88
+ prompt
89
+ }
90
+ }
91
+ `, D = [
69
92
  "PENDING",
70
93
  "PROCESSING",
71
94
  "GENERATING"
72
95
  ];
73
- function D(e) {
96
+ function se(e) {
74
97
  switch (e) {
75
- case "COMPLETED": return /* @__PURE__ */ y(u, {
98
+ case "COMPLETED": return /* @__PURE__ */ x(u, {
76
99
  size: 16,
77
100
  className: "text-green-500"
78
101
  });
79
- case "FAILED": return /* @__PURE__ */ y(h, {
102
+ case "FAILED": return /* @__PURE__ */ x(_, {
80
103
  size: 16,
81
104
  className: "text-red-500"
82
105
  });
83
- case "CANCELLED": return /* @__PURE__ */ y(h, {
106
+ case "CANCELLED": return /* @__PURE__ */ x(_, {
84
107
  size: 16,
85
108
  className: "text-gray-400"
86
109
  });
87
110
  case "PENDING":
88
111
  case "PROCESSING":
89
- case "GENERATING": return /* @__PURE__ */ y(f, {
112
+ case "GENERATING": return /* @__PURE__ */ x(p, {
90
113
  size: 16,
91
114
  className: "text-blue-500 animate-spin"
92
115
  });
93
- default: return /* @__PURE__ */ y(d, {
116
+ default: return /* @__PURE__ */ x(d, {
94
117
  size: 16,
95
118
  className: "text-gray-400"
96
119
  });
@@ -108,476 +131,848 @@ function O(e) {
108
131
  }
109
132
  }
110
133
  var k = i(function() {
111
- let i = e(), [u, d] = s(""), [h, g] = s(!1), [k, A] = s(null), { data: j, loading: M, refetch: N } = v(x, {
134
+ let i = e(), [u, d] = s(""), [_, v] = s(!1), [k, A] = s(null), [j, M] = s(() => /* @__PURE__ */ new Set()), [N, P] = s(null), [F, I] = s(null), [L, R] = s(""), z = a((e) => {
135
+ M((t) => new Set(t).add(e));
136
+ }, []), B = a((e) => {
137
+ M((t) => {
138
+ let n = new Set(t);
139
+ return n.delete(e), n;
140
+ });
141
+ }, []), { data: V, loading: H, refetch: U } = b(C, {
112
142
  variables: { first: 20 },
113
143
  fetchPolicy: "cache-and-network"
114
- }), { data: P } = v(S, { variables: { limit: 6 } }), [F] = _(C), [I] = _(w), [L] = _(T), R = j?.listPromptGenerations?.edges?.map((e) => e.node) || [], z = P?.getPromptSuggestions || [];
144
+ }), { data: W } = b(re, { variables: { limit: 6 } }), [G] = y(ie), [K] = y(w), [q] = y(T), [J] = y(ae), [Y] = y(E), [X] = y(oe), Z = V?.listPromptGenerations?.edges?.map((e) => e.node) || [], Q = W?.getPromptSuggestions || [];
115
145
  o(() => {
116
- if (!R.some((e) => E.includes(e.status))) return;
146
+ if (!Z.some((e) => D.includes(e.status))) return;
117
147
  let e = setInterval(() => {
118
- N();
148
+ U();
119
149
  }, 3e3);
120
150
  return () => clearInterval(e);
121
- }, [R, N]);
122
- let B = a(async () => {
123
- if (!(!u.trim() || h)) {
124
- A(null), g(!0);
151
+ }, [Z, U]), o(() => {
152
+ if (!N && !F) return;
153
+ let e = (e) => {
154
+ e.key === "Escape" && (P(null), I(null));
155
+ };
156
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
157
+ }, [N, F]);
158
+ let $ = a(async () => {
159
+ if (!(!u.trim() || _)) {
160
+ if (u.length > 2e3) {
161
+ A("Prompt is too long (max 2000 characters).");
162
+ return;
163
+ }
164
+ A(null), v(!0);
125
165
  try {
126
- await F({ variables: { input: {
166
+ await G({ variables: { input: {
127
167
  prompt: u.trim(),
128
168
  styleType: "MODERN",
129
169
  layoutType: "GRID",
130
170
  maxWidgets: 8
131
- } } }), d(""), N();
171
+ } } }), d(""), U();
132
172
  } catch (e) {
133
173
  A(e instanceof Error ? e.message : "Failed to generate dashboard");
134
174
  } finally {
135
- g(!1);
175
+ v(!1);
136
176
  }
137
177
  }
138
178
  }, [
139
179
  u,
140
- h,
141
- F,
142
- N
143
- ]), V = a(async (e) => {
180
+ _,
181
+ G,
182
+ U
183
+ ]), ce = a(async (e) => {
144
184
  A(null);
145
185
  try {
146
- let t = (await I({ variables: { input: { generationId: e } } })).data?.createDashboardFromGeneration?.id;
186
+ let t = (await K({ variables: { input: { generationId: e } } })).data?.createDashboardFromGeneration?.id;
147
187
  t && i(`/dashboards/${t}`);
148
188
  } catch (e) {
149
189
  A(e instanceof Error ? e.message : "Failed to create dashboard");
150
190
  }
151
- }, [I, i]), H = a(async (e) => {
191
+ }, [K, i]), le = a(async (e) => {
152
192
  A(null);
153
193
  try {
154
- await L({ variables: { generationId: e } }), t() && r("success"), N();
194
+ await q({ variables: { generationId: e } }), t() && r("success"), U();
155
195
  } catch (e) {
156
196
  A(e instanceof Error ? e.message : "Failed to delete generation"), t() && r("error");
157
197
  }
158
- }, [L, N]), U = a((e) => {
198
+ }, [q, U]), ue = a(async (e) => {
199
+ A(null), z(e);
200
+ try {
201
+ await J({ variables: { generationId: e } }), U();
202
+ } catch (e) {
203
+ A(e instanceof Error ? e.message : "Failed to cancel generation");
204
+ } finally {
205
+ B(e);
206
+ }
207
+ }, [J, U]), de = a(async (e) => {
208
+ A(null), z(e);
209
+ try {
210
+ await Y({ variables: { input: { generationId: e } } }), U();
211
+ } catch (e) {
212
+ A(e instanceof Error ? e.message : "Failed to regenerate dashboard");
213
+ } finally {
214
+ B(e);
215
+ }
216
+ }, [Y, U]), fe = a(async () => {
217
+ if (!F || !L.trim()) return;
218
+ let e = F.id;
219
+ A(null), z(e);
220
+ try {
221
+ await X({ variables: { input: {
222
+ generationId: e,
223
+ refinementPrompt: L.trim()
224
+ } } }), I(null), R(""), U();
225
+ } catch (e) {
226
+ A(e instanceof Error ? e.message : "Failed to refine generation");
227
+ } finally {
228
+ B(e);
229
+ }
230
+ }, [
231
+ F,
232
+ L,
233
+ X,
234
+ U
235
+ ]), pe = a((e) => {
159
236
  d(e);
160
237
  }, []);
161
- return /* @__PURE__ */ y("div", {
238
+ return /* @__PURE__ */ S("div", {
162
239
  style: {
163
240
  minHeight: "100vh",
164
241
  backgroundColor: "var(--color-bg-canvas)"
165
242
  },
166
- children: /* @__PURE__ */ b("div", {
167
- style: {
168
- padding: "var(--space-pagePadding)",
169
- maxWidth: 960,
170
- margin: "0 auto"
171
- },
172
- children: [
173
- /* @__PURE__ */ b("div", {
174
- style: { marginBottom: "var(--space-sectionGap)" },
175
- children: [/* @__PURE__ */ b("div", {
176
- style: {
177
- display: "flex",
178
- alignItems: "center",
179
- gap: "var(--space-iconGap)"
180
- },
181
- children: [/* @__PURE__ */ y(p, {
182
- size: 24,
183
- style: { color: "var(--color-action-primary-bg)" }
184
- }), /* @__PURE__ */ y("h1", {
243
+ children: [
244
+ /* @__PURE__ */ S("div", {
245
+ style: {
246
+ padding: "var(--space-pagePadding)",
247
+ maxWidth: 960,
248
+ margin: "0 auto"
249
+ },
250
+ children: [
251
+ /* @__PURE__ */ S("div", {
252
+ style: { marginBottom: "var(--space-sectionGap)" },
253
+ children: [/* @__PURE__ */ S("div", {
185
254
  style: {
186
- fontSize: "var(--font-size-heading-h4)",
187
- fontWeight: "var(--font-weight-bold)",
188
- color: "var(--color-text-primary)"
189
- },
190
- children: "AI Insights"
191
- })]
192
- }), /* @__PURE__ */ y("p", {
193
- style: {
194
- fontSize: "var(--font-size-body-md)",
195
- color: "var(--color-text-secondary)",
196
- marginTop: 4
197
- },
198
- children: "Generate dashboards from natural language prompts"
199
- })]
200
- }),
201
- /* @__PURE__ */ b("div", {
202
- style: {
203
- backgroundColor: "var(--color-bg-surface)",
204
- border: "1px solid var(--color-border)",
205
- borderRadius: "var(--radius-card)",
206
- padding: "var(--space-cardPadding)",
207
- marginBottom: "var(--space-sectionGap)"
208
- },
209
- children: [
210
- /* @__PURE__ */ y("label", {
211
- htmlFor: "prompt-input",
212
- style: {
213
- display: "block",
214
- fontSize: "var(--font-size-body-sm)",
215
- fontWeight: "var(--font-weight-medium)",
216
- color: "var(--color-text-primary)",
217
- marginBottom: 8
255
+ display: "flex",
256
+ alignItems: "center",
257
+ gap: "var(--space-iconGap)"
218
258
  },
219
- children: "Describe the dashboard you want to create"
220
- }),
221
- /* @__PURE__ */ y("textarea", {
222
- id: "prompt-input",
223
- value: u,
224
- onChange: (e) => d(e.target.value),
225
- placeholder: "e.g., Create a sales dashboard showing revenue trends, top products, and regional performance",
226
- rows: 3,
259
+ children: [/* @__PURE__ */ x(h, {
260
+ size: 24,
261
+ style: { color: "var(--color-action-primary-bg)" }
262
+ }), /* @__PURE__ */ x("h1", {
263
+ style: {
264
+ fontSize: "var(--font-size-heading-h4)",
265
+ fontWeight: "var(--font-weight-bold)",
266
+ color: "var(--color-text-primary)"
267
+ },
268
+ children: "AI Insights"
269
+ })]
270
+ }), /* @__PURE__ */ x("p", {
227
271
  style: {
228
- width: "100%",
229
- padding: "8px 12px",
230
- borderRadius: "var(--radius-button)",
231
- border: "1px solid var(--color-border)",
232
- backgroundColor: "var(--color-bg-canvas)",
233
- color: "var(--color-text-primary)",
234
272
  fontSize: "var(--font-size-body-md)",
235
- resize: "vertical",
236
- outline: "none"
237
- },
238
- onKeyDown: (e) => {
239
- e.key === "Enter" && (e.metaKey || e.ctrlKey) && B();
240
- }
241
- }),
242
- /* @__PURE__ */ b("div", {
243
- style: {
244
- display: "flex",
245
- justifyContent: "space-between",
246
- alignItems: "center",
247
- marginTop: 8
273
+ color: "var(--color-text-secondary)",
274
+ marginTop: 4
248
275
  },
249
- children: [/* @__PURE__ */ y("span", {
276
+ children: "Generate dashboards from natural language prompts"
277
+ })]
278
+ }),
279
+ /* @__PURE__ */ S("div", {
280
+ style: {
281
+ backgroundColor: "var(--color-bg-surface)",
282
+ border: "1px solid var(--color-border)",
283
+ borderRadius: "var(--radius-card)",
284
+ padding: "var(--space-cardPadding)",
285
+ marginBottom: "var(--space-sectionGap)"
286
+ },
287
+ children: [
288
+ /* @__PURE__ */ x("label", {
289
+ htmlFor: "prompt-input",
250
290
  style: {
291
+ display: "block",
251
292
  fontSize: "var(--font-size-body-sm)",
252
- color: "var(--color-text-muted)"
293
+ fontWeight: "var(--font-weight-medium)",
294
+ color: "var(--color-text-primary)",
295
+ marginBottom: 8
253
296
  },
254
- children: "Press Ctrl+Enter to generate"
255
- }), /* @__PURE__ */ b("button", {
256
- onClick: B,
257
- disabled: !u.trim() || h,
297
+ children: "Describe the dashboard you want to create"
298
+ }),
299
+ /* @__PURE__ */ x("textarea", {
300
+ id: "prompt-input",
301
+ value: u,
302
+ onChange: (e) => d(e.target.value),
303
+ placeholder: "e.g., Create a sales dashboard showing revenue trends, top products, and regional performance",
304
+ rows: 3,
305
+ maxLength: 2e3,
306
+ style: {
307
+ width: "100%",
308
+ padding: "8px 12px",
309
+ borderRadius: "var(--radius-button)",
310
+ border: "1px solid var(--color-border)",
311
+ backgroundColor: "var(--color-bg-canvas)",
312
+ color: "var(--color-text-primary)",
313
+ fontSize: "var(--font-size-body-md)",
314
+ resize: "vertical",
315
+ outline: "none"
316
+ },
317
+ onKeyDown: (e) => {
318
+ e.key === "Enter" && (e.metaKey || e.ctrlKey) && $();
319
+ }
320
+ }),
321
+ /* @__PURE__ */ S("div", {
258
322
  style: {
259
323
  display: "flex",
324
+ justifyContent: "space-between",
260
325
  alignItems: "center",
261
- gap: 8,
262
- padding: "8px 16px",
263
- borderRadius: "var(--radius-button)",
264
- backgroundColor: "var(--color-action-primary-bg)",
265
- color: "var(--color-action-primary-text)",
266
- fontWeight: "var(--font-weight-medium)",
267
- fontSize: "var(--font-size-body-sm)",
268
- border: "none",
269
- cursor: !u.trim() || h ? "not-allowed" : "pointer",
270
- opacity: !u.trim() || h ? .5 : 1
326
+ marginTop: 8,
327
+ flexWrap: "wrap",
328
+ gap: 8
271
329
  },
272
- children: [h ? /* @__PURE__ */ y(f, {
273
- size: 16,
274
- className: "animate-spin"
275
- }) : /* @__PURE__ */ y(p, { size: 16 }), "Generate Dashboard"]
276
- })]
277
- })
278
- ]
279
- }),
280
- k && /* @__PURE__ */ b("div", {
281
- style: {
282
- display: "flex",
283
- alignItems: "center",
284
- justifyContent: "space-between",
285
- gap: 8,
286
- padding: "10px 16px",
287
- marginBottom: "var(--space-sectionGap)",
288
- borderRadius: "var(--radius-card)",
289
- border: "1px solid var(--color-status-error-text)",
290
- backgroundColor: "var(--color-bg-surface)",
291
- color: "var(--color-status-error-text)",
292
- fontSize: "var(--font-size-body-sm)"
293
- },
294
- children: [/* @__PURE__ */ b("div", {
330
+ children: [/* @__PURE__ */ x("span", {
331
+ style: {
332
+ fontSize: "var(--font-size-body-sm)",
333
+ color: "var(--color-text-muted)"
334
+ },
335
+ children: "Press Ctrl+Enter to generate"
336
+ }), /* @__PURE__ */ S("button", {
337
+ onClick: $,
338
+ disabled: !u.trim() || _,
339
+ style: {
340
+ display: "flex",
341
+ alignItems: "center",
342
+ gap: 8,
343
+ padding: "8px 16px",
344
+ borderRadius: "var(--radius-button)",
345
+ backgroundColor: "var(--color-action-primary-bg)",
346
+ color: "var(--color-action-primary-text)",
347
+ fontWeight: "var(--font-weight-medium)",
348
+ fontSize: "var(--font-size-body-sm)",
349
+ border: "none",
350
+ cursor: !u.trim() || _ ? "not-allowed" : "pointer",
351
+ opacity: !u.trim() || _ ? .5 : 1
352
+ },
353
+ children: [_ ? /* @__PURE__ */ x(p, {
354
+ size: 16,
355
+ className: "animate-spin"
356
+ }) : /* @__PURE__ */ x(h, { size: 16 }), "Generate Dashboard"]
357
+ })]
358
+ })
359
+ ]
360
+ }),
361
+ k && /* @__PURE__ */ S("div", {
295
362
  style: {
296
363
  display: "flex",
297
364
  alignItems: "center",
298
- gap: 8
299
- },
300
- children: [/* @__PURE__ */ y(c, { size: 16 }), k]
301
- }), /* @__PURE__ */ y("button", {
302
- onClick: () => A(null),
303
- style: {
304
- background: "none",
305
- border: "none",
365
+ justifyContent: "space-between",
366
+ gap: 8,
367
+ padding: "10px 16px",
368
+ marginBottom: "var(--space-sectionGap)",
369
+ borderRadius: "var(--radius-card)",
370
+ border: "1px solid var(--color-status-error-text)",
371
+ backgroundColor: "var(--color-bg-surface)",
306
372
  color: "var(--color-status-error-text)",
307
- cursor: "pointer",
308
- fontSize: "var(--font-size-body-md)",
309
- padding: "0 4px"
373
+ fontSize: "var(--font-size-body-sm)"
310
374
  },
311
- "aria-label": "Dismiss error",
312
- children: "×"
313
- })]
314
- }),
315
- z.length > 0 && /* @__PURE__ */ b("div", {
316
- style: { marginBottom: "var(--space-sectionGap)" },
317
- children: [/* @__PURE__ */ y("h2", {
375
+ children: [/* @__PURE__ */ S("div", {
376
+ style: {
377
+ display: "flex",
378
+ alignItems: "center",
379
+ gap: 8
380
+ },
381
+ children: [/* @__PURE__ */ x(c, { size: 16 }), k]
382
+ }), /* @__PURE__ */ x("button", {
383
+ onClick: () => A(null),
384
+ style: {
385
+ background: "none",
386
+ border: "none",
387
+ color: "var(--color-status-error-text)",
388
+ cursor: "pointer",
389
+ fontSize: "var(--font-size-body-md)",
390
+ padding: "0 4px"
391
+ },
392
+ "aria-label": "Dismiss error",
393
+ children: "×"
394
+ })]
395
+ }),
396
+ Q.length > 0 && /* @__PURE__ */ S("div", {
397
+ style: { marginBottom: "var(--space-sectionGap)" },
398
+ children: [/* @__PURE__ */ x("h2", {
399
+ style: {
400
+ fontSize: "var(--font-size-body-md)",
401
+ fontWeight: "var(--font-weight-semibold)",
402
+ color: "var(--color-text-primary)",
403
+ marginBottom: 12
404
+ },
405
+ children: "Suggestions"
406
+ }), /* @__PURE__ */ x("div", {
407
+ style: {
408
+ display: "grid",
409
+ gridTemplateColumns: "repeat(auto-fill, minmax(min(280px, 100%), 1fr))",
410
+ gap: 12
411
+ },
412
+ children: Q.map((e) => /* @__PURE__ */ S("button", {
413
+ onClick: () => pe(e.prompt),
414
+ style: {
415
+ textAlign: "left",
416
+ padding: 12,
417
+ borderRadius: "var(--radius-card)",
418
+ border: "1px solid var(--color-border)",
419
+ backgroundColor: "var(--color-bg-surface)",
420
+ cursor: "pointer"
421
+ },
422
+ children: [
423
+ /* @__PURE__ */ x("div", {
424
+ style: {
425
+ fontWeight: "var(--font-weight-medium)",
426
+ fontSize: "var(--font-size-body-sm)",
427
+ color: "var(--color-text-primary)",
428
+ marginBottom: 4
429
+ },
430
+ children: e.title
431
+ }),
432
+ /* @__PURE__ */ x("div", {
433
+ style: {
434
+ fontSize: "var(--font-size-body-sm)",
435
+ color: "var(--color-text-secondary)",
436
+ lineHeight: 1.4
437
+ },
438
+ children: e.exampleDescription || e.prompt.slice(0, 80)
439
+ }),
440
+ /* @__PURE__ */ x("div", {
441
+ style: {
442
+ display: "flex",
443
+ gap: 4,
444
+ marginTop: 8,
445
+ flexWrap: "wrap"
446
+ },
447
+ children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ x("span", {
448
+ style: {
449
+ fontSize: 11,
450
+ padding: "2px 6px",
451
+ borderRadius: 4,
452
+ backgroundColor: "var(--color-bg-sunken)",
453
+ color: "var(--color-text-muted)"
454
+ },
455
+ children: e
456
+ }, e))
457
+ })
458
+ ]
459
+ }, e.id))
460
+ })]
461
+ }),
462
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h2", {
318
463
  style: {
319
464
  fontSize: "var(--font-size-body-md)",
320
465
  fontWeight: "var(--font-weight-semibold)",
321
466
  color: "var(--color-text-primary)",
322
467
  marginBottom: 12
323
468
  },
324
- children: "Suggestions"
325
- }), /* @__PURE__ */ y("div", {
469
+ children: "Recent Generations"
470
+ }), H && Z.length === 0 ? /* @__PURE__ */ S("div", {
326
471
  style: {
327
- display: "grid",
328
- gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
472
+ textAlign: "center",
473
+ padding: 40,
474
+ color: "var(--color-text-muted)"
475
+ },
476
+ children: [/* @__PURE__ */ x(p, {
477
+ size: 24,
478
+ className: "animate-spin",
479
+ style: { margin: "0 auto 8px" }
480
+ }), /* @__PURE__ */ x("p", { children: "Loading generations..." })]
481
+ }) : Z.length === 0 ? /* @__PURE__ */ S("div", {
482
+ style: {
483
+ textAlign: "center",
484
+ padding: 40,
485
+ backgroundColor: "var(--color-bg-surface)",
486
+ border: "1px solid var(--color-border)",
487
+ borderRadius: "var(--radius-card)"
488
+ },
489
+ children: [
490
+ /* @__PURE__ */ x(h, {
491
+ size: 32,
492
+ style: {
493
+ color: "var(--color-text-muted)",
494
+ margin: "0 auto 8px"
495
+ }
496
+ }),
497
+ /* @__PURE__ */ x("p", {
498
+ style: {
499
+ color: "var(--color-text-secondary)",
500
+ fontWeight: "var(--font-weight-medium)"
501
+ },
502
+ children: "No generations yet"
503
+ }),
504
+ /* @__PURE__ */ x("p", {
505
+ style: {
506
+ color: "var(--color-text-muted)",
507
+ fontSize: "var(--font-size-body-sm)",
508
+ marginTop: 4
509
+ },
510
+ children: "Describe a dashboard above to get started"
511
+ })
512
+ ]
513
+ }) : /* @__PURE__ */ x("div", {
514
+ style: {
515
+ display: "flex",
516
+ flexDirection: "column",
329
517
  gap: 12
330
518
  },
331
- children: z.map((e) => /* @__PURE__ */ b("button", {
332
- onClick: () => U(e.prompt),
519
+ children: Z.map((e) => /* @__PURE__ */ x("div", {
333
520
  style: {
334
- textAlign: "left",
335
- padding: 12,
521
+ padding: 16,
336
522
  borderRadius: "var(--radius-card)",
337
523
  border: "1px solid var(--color-border)",
338
- backgroundColor: "var(--color-bg-surface)",
339
- cursor: "pointer"
524
+ backgroundColor: "var(--color-bg-surface)"
340
525
  },
341
- children: [
342
- /* @__PURE__ */ y("div", {
343
- style: {
344
- fontWeight: "var(--font-weight-medium)",
345
- fontSize: "var(--font-size-body-sm)",
346
- color: "var(--color-text-primary)",
347
- marginBottom: 4
348
- },
349
- children: e.title
350
- }),
351
- /* @__PURE__ */ y("div", {
526
+ children: /* @__PURE__ */ S("div", {
527
+ style: {
528
+ display: "flex",
529
+ justifyContent: "space-between",
530
+ alignItems: "flex-start",
531
+ flexWrap: "wrap",
532
+ gap: 8
533
+ },
534
+ children: [/* @__PURE__ */ S("div", {
352
535
  style: {
353
- fontSize: "var(--font-size-body-sm)",
354
- color: "var(--color-text-secondary)",
355
- lineHeight: 1.4
536
+ flex: "1 1 200px",
537
+ minWidth: 0
356
538
  },
357
- children: e.exampleDescription || e.prompt.slice(0, 80)
358
- }),
359
- /* @__PURE__ */ y("div", {
539
+ children: [
540
+ /* @__PURE__ */ S("div", {
541
+ style: {
542
+ display: "flex",
543
+ alignItems: "center",
544
+ gap: 8,
545
+ marginBottom: 4,
546
+ minWidth: 0
547
+ },
548
+ children: [
549
+ se(e.status),
550
+ /* @__PURE__ */ x("span", {
551
+ style: {
552
+ fontSize: "var(--font-size-body-sm)",
553
+ fontWeight: "var(--font-weight-medium)",
554
+ color: "var(--color-text-primary)",
555
+ minWidth: 0,
556
+ overflow: "hidden",
557
+ textOverflow: "ellipsis",
558
+ whiteSpace: "nowrap"
559
+ },
560
+ children: e.generatedSpec?.name || "Generating..."
561
+ }),
562
+ /* @__PURE__ */ x("span", {
563
+ style: {
564
+ fontSize: 11,
565
+ color: "var(--color-text-muted)",
566
+ padding: "2px 6px",
567
+ borderRadius: 4,
568
+ backgroundColor: "var(--color-bg-sunken)"
569
+ },
570
+ children: O(e.status)
571
+ })
572
+ ]
573
+ }),
574
+ /* @__PURE__ */ x("p", {
575
+ style: {
576
+ fontSize: "var(--font-size-body-sm)",
577
+ color: "var(--color-text-secondary)",
578
+ marginBottom: 4
579
+ },
580
+ children: e.prompt.length > 120 ? e.prompt.slice(0, 120) + "..." : e.prompt
581
+ }),
582
+ e.generatedSpec && /* @__PURE__ */ S("div", {
583
+ style: {
584
+ fontSize: 11,
585
+ color: "var(--color-text-muted)"
586
+ },
587
+ children: [
588
+ e.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
589
+ " widgets across",
590
+ " ",
591
+ e.generatedSpec.pages.length,
592
+ " page(s) ·",
593
+ " ",
594
+ Math.round(e.generatedSpec.overallConfidence * 100),
595
+ "% confidence"
596
+ ]
597
+ }),
598
+ e.errorMessage && /* @__PURE__ */ S("div", {
599
+ style: {
600
+ display: "flex",
601
+ alignItems: "center",
602
+ gap: 4,
603
+ marginTop: 4,
604
+ fontSize: "var(--font-size-body-sm)",
605
+ color: "var(--color-status-error-text)"
606
+ },
607
+ children: [/* @__PURE__ */ x(c, { size: 14 }), e.errorMessage]
608
+ })
609
+ ]
610
+ }), /* @__PURE__ */ S("div", {
360
611
  style: {
361
612
  display: "flex",
362
- gap: 4,
363
- marginTop: 8,
613
+ gap: 8,
364
614
  flexWrap: "wrap"
365
615
  },
366
- children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ y("span", {
367
- style: {
368
- fontSize: 11,
369
- padding: "2px 6px",
370
- borderRadius: 4,
371
- backgroundColor: "var(--color-bg-sunken)",
372
- color: "var(--color-text-muted)"
373
- },
374
- children: e
375
- }, e))
376
- })
377
- ]
616
+ children: [
617
+ D.includes(e.status) && /* @__PURE__ */ S("button", {
618
+ onClick: () => {
619
+ n("medium"), ue(e.id);
620
+ },
621
+ disabled: j.has(e.id),
622
+ title: "Cancel generation",
623
+ style: {
624
+ display: "flex",
625
+ alignItems: "center",
626
+ gap: 4,
627
+ padding: "6px 12px",
628
+ borderRadius: "var(--radius-button)",
629
+ border: "1px solid var(--color-border)",
630
+ backgroundColor: "transparent",
631
+ color: "var(--color-status-warning-text)",
632
+ fontSize: "var(--font-size-body-sm)",
633
+ cursor: j.has(e.id) ? "wait" : "pointer"
634
+ },
635
+ children: [/* @__PURE__ */ x(ee, { size: 14 }), " Cancel"]
636
+ }),
637
+ e.status === "COMPLETED" && e.generatedSpec && /* @__PURE__ */ S("button", {
638
+ onClick: () => P(e),
639
+ title: "Preview proposed layout",
640
+ style: {
641
+ display: "flex",
642
+ alignItems: "center",
643
+ gap: 4,
644
+ padding: "6px 12px",
645
+ borderRadius: "var(--radius-button)",
646
+ border: "1px solid var(--color-border)",
647
+ backgroundColor: "transparent",
648
+ color: "var(--color-text-primary)",
649
+ fontSize: "var(--font-size-body-sm)",
650
+ cursor: "pointer"
651
+ },
652
+ children: [/* @__PURE__ */ x(f, { size: 14 }), " Preview"]
653
+ }),
654
+ e.status === "COMPLETED" && e.generatedSpec && /* @__PURE__ */ S("button", {
655
+ onClick: () => {
656
+ I(e), R("");
657
+ },
658
+ title: "Refine with instructions",
659
+ style: {
660
+ display: "flex",
661
+ alignItems: "center",
662
+ gap: 4,
663
+ padding: "6px 12px",
664
+ borderRadius: "var(--radius-button)",
665
+ border: "1px solid var(--color-border)",
666
+ backgroundColor: "transparent",
667
+ color: "var(--color-text-primary)",
668
+ fontSize: "var(--font-size-body-sm)",
669
+ cursor: "pointer"
670
+ },
671
+ children: [/* @__PURE__ */ x(g, { size: 14 }), " Refine"]
672
+ }),
673
+ (e.status === "COMPLETED" || e.status === "FAILED" || e.status === "CANCELLED") && /* @__PURE__ */ S("button", {
674
+ onClick: () => {
675
+ n("medium"), de(e.id);
676
+ },
677
+ disabled: j.has(e.id),
678
+ title: "Regenerate with the same prompt",
679
+ style: {
680
+ display: "flex",
681
+ alignItems: "center",
682
+ gap: 4,
683
+ padding: "6px 12px",
684
+ borderRadius: "var(--radius-button)",
685
+ border: "1px solid var(--color-border)",
686
+ backgroundColor: "transparent",
687
+ color: "var(--color-text-primary)",
688
+ fontSize: "var(--font-size-body-sm)",
689
+ cursor: j.has(e.id) ? "wait" : "pointer"
690
+ },
691
+ children: [/* @__PURE__ */ x(m, {
692
+ size: 14,
693
+ className: j.has(e.id) ? "animate-spin" : ""
694
+ }), " Regenerate"]
695
+ }),
696
+ e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ S("button", {
697
+ onClick: () => ce(e.id),
698
+ style: {
699
+ display: "flex",
700
+ alignItems: "center",
701
+ gap: 4,
702
+ padding: "6px 12px",
703
+ borderRadius: "var(--radius-button)",
704
+ backgroundColor: "var(--color-action-primary-bg)",
705
+ color: "var(--color-action-primary-text)",
706
+ border: "none",
707
+ fontSize: "var(--font-size-body-sm)",
708
+ cursor: "pointer"
709
+ },
710
+ children: ["Create ", /* @__PURE__ */ x(l, { size: 14 })]
711
+ }),
712
+ e.dashboardId && /* @__PURE__ */ S("button", {
713
+ onClick: () => i(`/dashboards/${e.dashboardId}`),
714
+ style: {
715
+ display: "flex",
716
+ alignItems: "center",
717
+ gap: 4,
718
+ padding: "6px 12px",
719
+ borderRadius: "var(--radius-button)",
720
+ border: "1px solid var(--color-border)",
721
+ backgroundColor: "transparent",
722
+ color: "var(--color-text-primary)",
723
+ fontSize: "var(--font-size-body-sm)",
724
+ cursor: "pointer"
725
+ },
726
+ children: ["View Dashboard ", /* @__PURE__ */ x(l, { size: 14 })]
727
+ }),
728
+ /* @__PURE__ */ x("button", {
729
+ onClick: () => {
730
+ n("medium"), le(e.id);
731
+ },
732
+ title: "Delete generation",
733
+ style: {
734
+ display: "flex",
735
+ alignItems: "center",
736
+ padding: 6,
737
+ borderRadius: "var(--radius-button)",
738
+ border: "1px solid var(--color-border)",
739
+ backgroundColor: "transparent",
740
+ color: "var(--color-text-muted)",
741
+ cursor: "pointer"
742
+ },
743
+ children: /* @__PURE__ */ x(te, { size: 14 })
744
+ })
745
+ ]
746
+ })]
747
+ })
378
748
  }, e.id))
379
- })]
380
- }),
381
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h2", {
382
- style: {
383
- fontSize: "var(--font-size-body-md)",
384
- fontWeight: "var(--font-weight-semibold)",
385
- color: "var(--color-text-primary)",
386
- marginBottom: 12
387
- },
388
- children: "Recent Generations"
389
- }), M && R.length === 0 ? /* @__PURE__ */ b("div", {
749
+ })] })
750
+ ]
751
+ }),
752
+ N?.generatedSpec && /* @__PURE__ */ x("div", {
753
+ role: "dialog",
754
+ "aria-modal": "true",
755
+ "aria-label": "Generation preview",
756
+ onClick: () => P(null),
757
+ style: {
758
+ position: "fixed",
759
+ inset: 0,
760
+ zIndex: 1e3,
761
+ backgroundColor: "var(--color-overlay-scrim)",
762
+ display: "flex",
763
+ alignItems: "center",
764
+ justifyContent: "center",
765
+ padding: "var(--space-pagePadding)"
766
+ },
767
+ children: /* @__PURE__ */ S("div", {
768
+ onClick: (e) => e.stopPropagation(),
390
769
  style: {
391
- textAlign: "center",
392
- padding: 40,
393
- color: "var(--color-text-muted)"
394
- },
395
- children: [/* @__PURE__ */ y(f, {
396
- size: 24,
397
- className: "animate-spin",
398
- style: { margin: "0 auto 8px" }
399
- }), /* @__PURE__ */ y("p", { children: "Loading generations..." })]
400
- }) : R.length === 0 ? /* @__PURE__ */ b("div", {
401
- style: {
402
- textAlign: "center",
403
- padding: 40,
770
+ width: "min(640px, 100%)",
771
+ maxHeight: "80vh",
772
+ overflowY: "auto",
404
773
  backgroundColor: "var(--color-bg-surface)",
774
+ borderRadius: "var(--radius-card)",
405
775
  border: "1px solid var(--color-border)",
406
- borderRadius: "var(--radius-card)"
776
+ boxShadow: "var(--shadow-elevation-3)",
777
+ padding: "var(--space-cardPadding)"
407
778
  },
408
779
  children: [
409
- /* @__PURE__ */ y(p, {
410
- size: 32,
411
- style: {
412
- color: "var(--color-text-muted)",
413
- margin: "0 auto 8px"
414
- }
415
- }),
416
- /* @__PURE__ */ y("p", {
780
+ /* @__PURE__ */ S("div", {
417
781
  style: {
418
- color: "var(--color-text-secondary)",
419
- fontWeight: "var(--font-weight-medium)"
782
+ display: "flex",
783
+ justifyContent: "space-between",
784
+ alignItems: "flex-start",
785
+ gap: 8,
786
+ marginBottom: "var(--space-controlGap)"
420
787
  },
421
- children: "No generations yet"
788
+ children: [/* @__PURE__ */ S("div", {
789
+ style: { minWidth: 0 },
790
+ children: [/* @__PURE__ */ x("h3", {
791
+ style: {
792
+ fontSize: "var(--font-size-heading-h4)",
793
+ fontWeight: "var(--font-weight-semibold)"
794
+ },
795
+ children: N.generatedSpec.name
796
+ }), N.generatedSpec.description && /* @__PURE__ */ x("p", {
797
+ style: {
798
+ fontSize: "var(--font-size-body-sm)",
799
+ color: "var(--color-text-muted)",
800
+ marginTop: 2
801
+ },
802
+ children: N.generatedSpec.description
803
+ })]
804
+ }), /* @__PURE__ */ x("button", {
805
+ onClick: () => P(null),
806
+ "aria-label": "Close preview",
807
+ style: {
808
+ display: "flex",
809
+ padding: 4,
810
+ borderRadius: "var(--radius-button)",
811
+ border: "none",
812
+ backgroundColor: "transparent",
813
+ color: "var(--color-text-muted)",
814
+ cursor: "pointer"
815
+ },
816
+ children: /* @__PURE__ */ x(ne, { size: 18 })
817
+ })]
422
818
  }),
423
- /* @__PURE__ */ y("p", {
819
+ /* @__PURE__ */ S("div", {
424
820
  style: {
821
+ fontSize: 11,
425
822
  color: "var(--color-text-muted)",
426
- fontSize: "var(--font-size-body-sm)",
427
- marginTop: 4
823
+ marginBottom: "var(--space-controlGap)"
428
824
  },
429
- children: "Describe a dashboard above to get started"
430
- })
825
+ children: [
826
+ N.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
827
+ " widgets across",
828
+ " ",
829
+ N.generatedSpec.pages.length,
830
+ " page(s) ·",
831
+ " ",
832
+ Math.round(N.generatedSpec.overallConfidence * 100),
833
+ "% confidence"
834
+ ]
835
+ }),
836
+ N.generatedSpec.pages.map((e, t) => /* @__PURE__ */ S("div", {
837
+ style: { marginBottom: "var(--space-controlGap)" },
838
+ children: [/* @__PURE__ */ x("div", {
839
+ style: {
840
+ fontSize: "var(--font-size-body-sm)",
841
+ fontWeight: "var(--font-weight-medium)",
842
+ color: "var(--color-text-primary)",
843
+ marginBottom: 4
844
+ },
845
+ children: e.name
846
+ }), /* @__PURE__ */ x("div", {
847
+ style: {
848
+ display: "flex",
849
+ flexWrap: "wrap",
850
+ gap: 6
851
+ },
852
+ children: e.widgets.map((e, t) => /* @__PURE__ */ S("span", {
853
+ style: {
854
+ fontSize: 11,
855
+ padding: "3px 8px",
856
+ borderRadius: "var(--radius-pill)",
857
+ backgroundColor: "var(--color-bg-sunken)",
858
+ color: "var(--color-text-secondary)"
859
+ },
860
+ children: [
861
+ e.title,
862
+ " · ",
863
+ e.type
864
+ ]
865
+ }, t))
866
+ })]
867
+ }, t))
431
868
  ]
432
- }) : /* @__PURE__ */ y("div", {
869
+ })
870
+ }),
871
+ F && /* @__PURE__ */ x("div", {
872
+ role: "dialog",
873
+ "aria-modal": "true",
874
+ "aria-label": "Refine generation",
875
+ onClick: () => I(null),
876
+ style: {
877
+ position: "fixed",
878
+ inset: 0,
879
+ zIndex: 1e3,
880
+ backgroundColor: "var(--color-overlay-scrim)",
881
+ display: "flex",
882
+ alignItems: "center",
883
+ justifyContent: "center",
884
+ padding: "var(--space-pagePadding)"
885
+ },
886
+ children: /* @__PURE__ */ S("div", {
887
+ onClick: (e) => e.stopPropagation(),
433
888
  style: {
434
- display: "flex",
435
- flexDirection: "column",
436
- gap: 12
889
+ width: "min(520px, 100%)",
890
+ backgroundColor: "var(--color-bg-surface)",
891
+ borderRadius: "var(--radius-card)",
892
+ border: "1px solid var(--color-border)",
893
+ boxShadow: "var(--shadow-elevation-3)",
894
+ padding: "var(--space-cardPadding)"
437
895
  },
438
- children: R.map((e) => /* @__PURE__ */ y("div", {
439
- style: {
440
- padding: 16,
441
- borderRadius: "var(--radius-card)",
442
- border: "1px solid var(--color-border)",
443
- backgroundColor: "var(--color-bg-surface)"
444
- },
445
- children: /* @__PURE__ */ b("div", {
896
+ children: [
897
+ /* @__PURE__ */ x("h3", {
898
+ style: {
899
+ fontSize: "var(--font-size-heading-h4)",
900
+ fontWeight: "var(--font-weight-semibold)",
901
+ marginBottom: 4
902
+ },
903
+ children: "Refine dashboard"
904
+ }),
905
+ /* @__PURE__ */ x("p", {
906
+ style: {
907
+ fontSize: "var(--font-size-body-sm)",
908
+ color: "var(--color-text-muted)",
909
+ marginBottom: "var(--space-controlGap)"
910
+ },
911
+ children: "Describe what to change — the AI keeps the existing spec and applies your instructions."
912
+ }),
913
+ /* @__PURE__ */ x("textarea", {
914
+ value: L,
915
+ onChange: (e) => R(e.target.value),
916
+ maxLength: 2e3,
917
+ rows: 4,
918
+ placeholder: "e.g., Add a revenue-by-region map and remove the duplicate KPI cards",
919
+ style: {
920
+ width: "100%",
921
+ resize: "vertical",
922
+ padding: "var(--space-inputPadding, 8px)",
923
+ borderRadius: "var(--radius-input)",
924
+ border: "1px solid var(--color-border)",
925
+ backgroundColor: "var(--color-bg-canvas)",
926
+ color: "var(--color-text-primary)",
927
+ fontSize: "var(--font-size-body-sm)",
928
+ marginBottom: "var(--space-controlGap)"
929
+ }
930
+ }),
931
+ /* @__PURE__ */ S("div", {
446
932
  style: {
447
933
  display: "flex",
448
- justifyContent: "space-between",
449
- alignItems: "flex-start"
934
+ justifyContent: "flex-end",
935
+ gap: 8,
936
+ flexWrap: "wrap"
450
937
  },
451
- children: [/* @__PURE__ */ b("div", {
452
- style: { flex: 1 },
453
- children: [
454
- /* @__PURE__ */ b("div", {
455
- style: {
456
- display: "flex",
457
- alignItems: "center",
458
- gap: 8,
459
- marginBottom: 4
460
- },
461
- children: [
462
- D(e.status),
463
- /* @__PURE__ */ y("span", {
464
- style: {
465
- fontSize: "var(--font-size-body-sm)",
466
- fontWeight: "var(--font-weight-medium)",
467
- color: "var(--color-text-primary)"
468
- },
469
- children: e.generatedSpec?.name || "Generating..."
470
- }),
471
- /* @__PURE__ */ y("span", {
472
- style: {
473
- fontSize: 11,
474
- color: "var(--color-text-muted)",
475
- padding: "2px 6px",
476
- borderRadius: 4,
477
- backgroundColor: "var(--color-bg-sunken)"
478
- },
479
- children: O(e.status)
480
- })
481
- ]
482
- }),
483
- /* @__PURE__ */ y("p", {
484
- style: {
485
- fontSize: "var(--font-size-body-sm)",
486
- color: "var(--color-text-secondary)",
487
- marginBottom: 4
488
- },
489
- children: e.prompt.length > 120 ? e.prompt.slice(0, 120) + "..." : e.prompt
490
- }),
491
- e.generatedSpec && /* @__PURE__ */ b("div", {
492
- style: {
493
- fontSize: 11,
494
- color: "var(--color-text-muted)"
495
- },
496
- children: [
497
- e.generatedSpec.pages.reduce((e, t) => e + t.widgets.length, 0),
498
- " widgets across",
499
- " ",
500
- e.generatedSpec.pages.length,
501
- " page(s) ·",
502
- " ",
503
- Math.round(e.generatedSpec.overallConfidence * 100),
504
- "% confidence"
505
- ]
506
- }),
507
- e.errorMessage && /* @__PURE__ */ b("div", {
508
- style: {
509
- display: "flex",
510
- alignItems: "center",
511
- gap: 4,
512
- marginTop: 4,
513
- fontSize: "var(--font-size-body-sm)",
514
- color: "var(--color-status-error-text)"
515
- },
516
- children: [/* @__PURE__ */ y(c, { size: 14 }), e.errorMessage]
517
- })
518
- ]
519
- }), /* @__PURE__ */ b("div", {
938
+ children: [/* @__PURE__ */ x("button", {
939
+ onClick: () => I(null),
940
+ style: {
941
+ padding: "8px 16px",
942
+ borderRadius: "var(--radius-button)",
943
+ border: "1px solid var(--color-border)",
944
+ backgroundColor: "transparent",
945
+ color: "var(--color-text-primary)",
946
+ fontSize: "var(--font-size-body-sm)",
947
+ cursor: "pointer"
948
+ },
949
+ children: "Cancel"
950
+ }), /* @__PURE__ */ S("button", {
951
+ onClick: () => void fe(),
952
+ disabled: !L.trim() || j.has(F.id),
520
953
  style: {
521
954
  display: "flex",
522
- gap: 8
955
+ alignItems: "center",
956
+ gap: 6,
957
+ padding: "8px 16px",
958
+ borderRadius: "var(--radius-button)",
959
+ border: "none",
960
+ backgroundColor: "var(--color-action-primary-bg)",
961
+ color: "var(--color-action-primary-text)",
962
+ fontSize: "var(--font-size-body-sm)",
963
+ cursor: !L.trim() || j.has(F.id) ? "not-allowed" : "pointer",
964
+ opacity: L.trim() ? 1 : .6
523
965
  },
524
- children: [
525
- e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ b("button", {
526
- onClick: () => V(e.id),
527
- style: {
528
- display: "flex",
529
- alignItems: "center",
530
- gap: 4,
531
- padding: "6px 12px",
532
- borderRadius: "var(--radius-button)",
533
- backgroundColor: "var(--color-action-primary-bg)",
534
- color: "var(--color-action-primary-text)",
535
- border: "none",
536
- fontSize: "var(--font-size-body-sm)",
537
- cursor: "pointer"
538
- },
539
- children: ["Create ", /* @__PURE__ */ y(l, { size: 14 })]
540
- }),
541
- e.dashboardId && /* @__PURE__ */ b("button", {
542
- onClick: () => i(`/dashboards/${e.dashboardId}`),
543
- style: {
544
- display: "flex",
545
- alignItems: "center",
546
- gap: 4,
547
- padding: "6px 12px",
548
- borderRadius: "var(--radius-button)",
549
- border: "1px solid var(--color-border)",
550
- backgroundColor: "transparent",
551
- color: "var(--color-text-primary)",
552
- fontSize: "var(--font-size-body-sm)",
553
- cursor: "pointer"
554
- },
555
- children: ["View Dashboard ", /* @__PURE__ */ y(l, { size: 14 })]
556
- }),
557
- /* @__PURE__ */ y("button", {
558
- onClick: () => {
559
- n("medium"), H(e.id);
560
- },
561
- title: "Delete generation",
562
- style: {
563
- display: "flex",
564
- alignItems: "center",
565
- padding: 6,
566
- borderRadius: "var(--radius-button)",
567
- border: "1px solid var(--color-border)",
568
- backgroundColor: "transparent",
569
- color: "var(--color-text-muted)",
570
- cursor: "pointer"
571
- },
572
- children: /* @__PURE__ */ y(m, { size: 14 })
573
- })
574
- ]
966
+ children: [j.has(F.id) ? /* @__PURE__ */ x(p, {
967
+ size: 14,
968
+ className: "animate-spin"
969
+ }) : /* @__PURE__ */ x(g, { size: 14 }), "Apply refinement"]
575
970
  })]
576
971
  })
577
- }, e.id))
578
- })] })
579
- ]
580
- })
972
+ ]
973
+ })
974
+ })
975
+ ]
581
976
  });
582
977
  });
583
978
  //#endregion