@burdenoff/microfe-bigconsole 2026.1013.3 → 2026.1013.5
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.
- package/README.md +16 -0
- package/dist/bigconsole/components/widgets/WidgetHeader.js +2 -2
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +363 -329
- package/dist/bigconsole/pages/InsightsPage.js +367 -335
- package/dist/bigconsole/utils/generationApproval.d.ts +22 -0
- package/dist/bigconsole/utils/generationApproval.js +18 -0
- package/dist/bigconsole/utils/widgetDisplayData.d.ts +30 -0
- package/dist/bigconsole/utils/widgetDisplayData.js +80 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-operations.js +1 -0
- package/dist/generated/wspace-types.d.ts +91062 -34804
- package/package.json +1 -1
|
@@ -5,20 +5,21 @@ import { SECTION_FOCUS_RING as n } from "../components/common/sectionStyles.js";
|
|
|
5
5
|
import { Section as r, SectionStack as i } from "../components/common/Section.js";
|
|
6
6
|
import "../components/common/index.js";
|
|
7
7
|
import a from "../hooks/useBigConsoleAnalytics.js";
|
|
8
|
-
import { isNative as ee, nativeImpact as o, nativeNotify as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { isNative as ee, nativeImpact as o, nativeNotify as te } from "../../utils/nativeBridge.js";
|
|
9
|
+
import { generationApproval as s } from "../utils/generationApproval.js";
|
|
10
|
+
import { isInsightsDraftDirty as ne } from "../utils/insightsDraft.js";
|
|
11
|
+
import { GeneratedFormattingReview as re, GenerationExecutionStatus as ie } from "../components/insights/GeneratedFormattingReview.js";
|
|
11
12
|
/* empty css */
|
|
12
|
-
import { memo as c, useCallback as l, useEffect as
|
|
13
|
-
import { AlertCircle as
|
|
14
|
-
import { AuroraBackground as
|
|
15
|
-
import { useUnsavedChanges as
|
|
13
|
+
import { memo as c, useCallback as l, useEffect as ae, useState as u } from "react";
|
|
14
|
+
import { AlertCircle as oe, ArrowRight as d, Ban as se, CheckCircle as f, Clock as p, Eye as ce, History as le, Lightbulb as ue, Loader2 as m, RefreshCw as de, Sparkles as h, Trash2 as fe, Wand2 as g, X as pe, XCircle as _ } from "lucide-react";
|
|
15
|
+
import { AuroraBackground as me, GlassCard as he, GradientText as ge, IllustratedEmptyState as _e, PagePurpose as ve } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { useUnsavedChanges as ye } from "@burdenoff/fe-libs/shared/hooks";
|
|
16
17
|
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
|
-
import { useMutation as y, useQuery as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { gql as
|
|
18
|
+
import { useMutation as y, useQuery as b } from "@apollo/client/react";
|
|
19
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
20
|
+
import { gql as C } from "@apollo/client";
|
|
20
21
|
//#region src/bigconsole/pages/InsightsPage.tsx
|
|
21
|
-
var be =
|
|
22
|
+
var be = C`
|
|
22
23
|
query ListPromptGenerations($status: PromptGenerationStatus, $first: Int) {
|
|
23
24
|
listPromptGenerations(status: $status, first: $first) {
|
|
24
25
|
edges {
|
|
@@ -27,6 +28,8 @@ var be = S`
|
|
|
27
28
|
prompt
|
|
28
29
|
status
|
|
29
30
|
dashboardId
|
|
31
|
+
generatedSpecDigest
|
|
32
|
+
updatedAt
|
|
30
33
|
errorMessage
|
|
31
34
|
createdAt
|
|
32
35
|
completedAt
|
|
@@ -60,7 +63,7 @@ var be = S`
|
|
|
60
63
|
totalCount
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
`, xe =
|
|
66
|
+
`, xe = C`
|
|
64
67
|
query GetPromptSuggestions($category: String, $limit: Int) {
|
|
65
68
|
getPromptSuggestions(category: $category, limit: $limit) {
|
|
66
69
|
id
|
|
@@ -71,7 +74,7 @@ var be = S`
|
|
|
71
74
|
tags
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
|
-
`, Se =
|
|
77
|
+
`, Se = C`
|
|
75
78
|
mutation GenerateDashboardFromPrompt($input: GenerateDashboardFromPromptInput!) {
|
|
76
79
|
generateDashboardFromPrompt(input: $input) {
|
|
77
80
|
id
|
|
@@ -79,24 +82,24 @@ var be = S`
|
|
|
79
82
|
prompt
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
`, Ce =
|
|
85
|
+
`, Ce = C`
|
|
83
86
|
mutation CreateDashboardFromGeneration($input: CreateDashboardFromGenerationInput!) {
|
|
84
87
|
createDashboardFromGeneration(input: $input) {
|
|
85
88
|
id
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
|
-
`, we =
|
|
91
|
+
`, we = C`
|
|
89
92
|
mutation DeletePromptGeneration($generationId: ID!) {
|
|
90
93
|
deletePromptGeneration(generationId: $generationId)
|
|
91
94
|
}
|
|
92
|
-
`, Te =
|
|
95
|
+
`, Te = C`
|
|
93
96
|
mutation CancelPromptGeneration($generationId: ID!) {
|
|
94
97
|
cancelPromptGeneration(generationId: $generationId) {
|
|
95
98
|
id
|
|
96
99
|
status
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
|
-
`, Ee =
|
|
102
|
+
`, Ee = C`
|
|
100
103
|
mutation RegenerateDashboard($input: RegenerateDashboardInput!) {
|
|
101
104
|
regenerateDashboard(input: $input) {
|
|
102
105
|
id
|
|
@@ -104,7 +107,7 @@ var be = S`
|
|
|
104
107
|
prompt
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
|
-
`, De =
|
|
110
|
+
`, De = C`
|
|
108
111
|
mutation RefineGeneratedDashboard($input: RefineGeneratedDashboardInput!) {
|
|
109
112
|
refineGeneratedDashboard(input: $input) {
|
|
110
113
|
id
|
|
@@ -175,7 +178,7 @@ var be = S`
|
|
|
175
178
|
12,
|
|
176
179
|
16,
|
|
177
180
|
24
|
|
178
|
-
],
|
|
181
|
+
], w = {
|
|
179
182
|
display: "inline-flex",
|
|
180
183
|
alignItems: "center",
|
|
181
184
|
justifyContent: "center",
|
|
@@ -187,35 +190,35 @@ var be = S`
|
|
|
187
190
|
fontWeight: "var(--font-weight-medium)",
|
|
188
191
|
lineHeight: 1.2,
|
|
189
192
|
cursor: "pointer"
|
|
190
|
-
},
|
|
191
|
-
...
|
|
193
|
+
}, T = {
|
|
194
|
+
...w,
|
|
192
195
|
border: "1px solid var(--color-border-default)",
|
|
193
196
|
backgroundColor: "transparent",
|
|
194
197
|
color: "var(--color-text-primary)"
|
|
195
|
-
},
|
|
196
|
-
...
|
|
198
|
+
}, E = {
|
|
199
|
+
...w,
|
|
197
200
|
border: "1px solid transparent",
|
|
198
201
|
backgroundColor: "var(--color-action-primary-bg)",
|
|
199
202
|
color: "var(--color-action-primary-text)"
|
|
200
203
|
}, Fe = {
|
|
201
|
-
...
|
|
204
|
+
...w,
|
|
202
205
|
border: "1px solid var(--color-status-warning-border)",
|
|
203
206
|
backgroundColor: "transparent",
|
|
204
207
|
color: "var(--color-status-warning-text)"
|
|
205
208
|
}, Ie = {
|
|
206
|
-
...
|
|
209
|
+
...w,
|
|
207
210
|
minWidth: "var(--size-controlHeight-md)",
|
|
208
211
|
padding: "0 var(--space-controlGap)",
|
|
209
212
|
border: "1px solid var(--color-border-default)",
|
|
210
213
|
backgroundColor: "transparent",
|
|
211
214
|
color: "var(--color-status-error-text)"
|
|
212
|
-
},
|
|
215
|
+
}, D = {
|
|
213
216
|
display: "block",
|
|
214
217
|
marginBottom: "2px",
|
|
215
218
|
fontSize: "var(--font-size-body-sm)",
|
|
216
219
|
fontWeight: "var(--font-weight-medium)",
|
|
217
220
|
color: "var(--color-text-secondary)"
|
|
218
|
-
},
|
|
221
|
+
}, O = {
|
|
219
222
|
width: "100%",
|
|
220
223
|
minHeight: "var(--size-controlHeight-md)",
|
|
221
224
|
padding: "0 var(--space-controlGap)",
|
|
@@ -224,7 +227,7 @@ var be = S`
|
|
|
224
227
|
backgroundColor: "var(--color-bg-canvas)",
|
|
225
228
|
color: "var(--color-text-primary)",
|
|
226
229
|
fontSize: "var(--font-size-body-sm)"
|
|
227
|
-
},
|
|
230
|
+
}, k = {
|
|
228
231
|
display: "inline-flex",
|
|
229
232
|
alignItems: "center",
|
|
230
233
|
gap: "var(--space-iconGap)",
|
|
@@ -236,7 +239,7 @@ var be = S`
|
|
|
236
239
|
backgroundColor: "var(--color-bg-sunken)",
|
|
237
240
|
color: "var(--color-text-secondary)"
|
|
238
241
|
};
|
|
239
|
-
function
|
|
242
|
+
function A(e) {
|
|
240
243
|
switch (e) {
|
|
241
244
|
case "COMPLETED": return "success";
|
|
242
245
|
case "FAILED": return "danger";
|
|
@@ -246,7 +249,7 @@ function k(e) {
|
|
|
246
249
|
default: return "neutral";
|
|
247
250
|
}
|
|
248
251
|
}
|
|
249
|
-
var
|
|
252
|
+
var j = {
|
|
250
253
|
success: {
|
|
251
254
|
text: "var(--color-status-success-text)",
|
|
252
255
|
bg: "var(--color-status-success-bgSubtle)",
|
|
@@ -269,35 +272,35 @@ var A = {
|
|
|
269
272
|
}
|
|
270
273
|
};
|
|
271
274
|
function Le(e) {
|
|
272
|
-
let t = A
|
|
275
|
+
let t = j[A(e)].text;
|
|
273
276
|
switch (e) {
|
|
274
|
-
case "COMPLETED": return /* @__PURE__ */
|
|
277
|
+
case "COMPLETED": return /* @__PURE__ */ x(f, {
|
|
275
278
|
size: 14,
|
|
276
279
|
style: { color: t },
|
|
277
280
|
"aria-hidden": "true"
|
|
278
281
|
});
|
|
279
282
|
case "FAILED":
|
|
280
|
-
case "CANCELLED": return /* @__PURE__ */
|
|
283
|
+
case "CANCELLED": return /* @__PURE__ */ x(_, {
|
|
281
284
|
size: 14,
|
|
282
285
|
style: { color: t },
|
|
283
286
|
"aria-hidden": "true"
|
|
284
287
|
});
|
|
285
288
|
case "PENDING":
|
|
286
289
|
case "PROCESSING":
|
|
287
|
-
case "GENERATING": return /* @__PURE__ */
|
|
290
|
+
case "GENERATING": return /* @__PURE__ */ x(m, {
|
|
288
291
|
size: 14,
|
|
289
292
|
className: "animate-spin",
|
|
290
293
|
style: { color: t },
|
|
291
294
|
"aria-hidden": "true"
|
|
292
295
|
});
|
|
293
|
-
default: return /* @__PURE__ */
|
|
296
|
+
default: return /* @__PURE__ */ x(p, {
|
|
294
297
|
size: 14,
|
|
295
298
|
style: { color: t },
|
|
296
299
|
"aria-hidden": "true"
|
|
297
300
|
});
|
|
298
301
|
}
|
|
299
302
|
}
|
|
300
|
-
function
|
|
303
|
+
function M(e, t) {
|
|
301
304
|
switch (e) {
|
|
302
305
|
case "COMPLETED": return t("bigconsole.insights.status.completed", "Completed");
|
|
303
306
|
case "FAILED": return t("bigconsole.insights.status.failed", "Failed");
|
|
@@ -309,35 +312,35 @@ function j(e, t) {
|
|
|
309
312
|
}
|
|
310
313
|
}
|
|
311
314
|
var Re = ({ status: e }) => {
|
|
312
|
-
let { t } = v(), n = A
|
|
313
|
-
return /* @__PURE__ */
|
|
315
|
+
let { t } = v(), n = j[A(e)];
|
|
316
|
+
return /* @__PURE__ */ S("span", {
|
|
314
317
|
"data-status": e,
|
|
315
318
|
style: {
|
|
316
|
-
...
|
|
319
|
+
...k,
|
|
317
320
|
border: `1px solid ${n.border}`,
|
|
318
321
|
backgroundColor: n.bg,
|
|
319
322
|
color: n.text
|
|
320
323
|
},
|
|
321
|
-
children: [Le(e),
|
|
324
|
+
children: [Le(e), M(e, t)]
|
|
322
325
|
});
|
|
323
326
|
};
|
|
324
327
|
function ze(e) {
|
|
325
|
-
let t =
|
|
328
|
+
let t = j[e >= .8 ? "success" : e >= .5 ? "neutral" : "danger"];
|
|
326
329
|
return {
|
|
327
|
-
...
|
|
330
|
+
...k,
|
|
328
331
|
border: `1px solid ${t.border}`,
|
|
329
332
|
backgroundColor: t.bg,
|
|
330
333
|
color: t.text
|
|
331
334
|
};
|
|
332
335
|
}
|
|
333
|
-
function
|
|
336
|
+
function N(e) {
|
|
334
337
|
return e.pages.reduce((e, t) => e + t.widgets.length, 0);
|
|
335
338
|
}
|
|
336
339
|
function Be(e) {
|
|
337
340
|
let t = e?.toUpperCase();
|
|
338
341
|
return t === "HIGH" || t === "MEDIUM" || t === "LOW" ? t : null;
|
|
339
342
|
}
|
|
340
|
-
var
|
|
343
|
+
var P = {
|
|
341
344
|
HIGH: "success",
|
|
342
345
|
MEDIUM: "neutral",
|
|
343
346
|
LOW: "danger"
|
|
@@ -355,9 +358,9 @@ function He(e, t) {
|
|
|
355
358
|
};
|
|
356
359
|
}
|
|
357
360
|
function Ue(e) {
|
|
358
|
-
let t =
|
|
361
|
+
let t = j[P[e]];
|
|
359
362
|
return {
|
|
360
|
-
...
|
|
363
|
+
...k,
|
|
361
364
|
padding: "0 var(--space-controlGap)",
|
|
362
365
|
fontSize: "var(--font-size-xs)",
|
|
363
366
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -367,183 +370,193 @@ function Ue(e) {
|
|
|
367
370
|
color: t.text
|
|
368
371
|
};
|
|
369
372
|
}
|
|
370
|
-
var
|
|
371
|
-
let { t: c } = v(), f = e(), p = a(), [_,
|
|
372
|
-
|
|
373
|
+
var F = c(function() {
|
|
374
|
+
let { t: c } = v(), f = e(), p = a(), [_, C] = u(""), [w, A] = u("MODERN"), [j, Le] = u("GRID"), [M, P] = u(ke), [F, We] = u(Ae), [I, L] = u(!1), [Ge, R] = u(null), [z, Ke] = u(() => /* @__PURE__ */ new Set()), [B, V] = u(null), [H, U] = u(null), [W, G] = u("");
|
|
375
|
+
ye({
|
|
373
376
|
id: "insights-prompt",
|
|
374
377
|
label: c("bigconsole.assistant.unsaved.insightsPrompt", "the dashboard description"),
|
|
375
|
-
dirty:
|
|
378
|
+
dirty: ne({
|
|
376
379
|
promptText: _,
|
|
377
|
-
isGenerating:
|
|
378
|
-
refineOpen:
|
|
379
|
-
refineText:
|
|
380
|
-
refineBusy:
|
|
380
|
+
isGenerating: I,
|
|
381
|
+
refineOpen: H !== null,
|
|
382
|
+
refineText: W,
|
|
383
|
+
refineBusy: H !== null && z.has(H.id)
|
|
381
384
|
})
|
|
382
385
|
});
|
|
383
|
-
let
|
|
386
|
+
let K = l((e) => {
|
|
384
387
|
Ke((t) => new Set(t).add(e));
|
|
385
|
-
}, []),
|
|
388
|
+
}, []), q = l((e) => {
|
|
386
389
|
Ke((t) => {
|
|
387
390
|
let n = new Set(t);
|
|
388
391
|
return n.delete(e), n;
|
|
389
392
|
});
|
|
390
|
-
}, []), { data: qe, loading: Je, error:
|
|
393
|
+
}, []), { data: qe, loading: Je, error: J, refetch: Y, startPolling: Ye, stopPolling: X } = b(be, {
|
|
391
394
|
variables: { first: 20 },
|
|
392
395
|
fetchPolicy: "cache-and-network"
|
|
393
|
-
}),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
}), Z = qe?.listPromptGenerations?.edges?.some((e) => Oe.includes(e.node.status)) ?? !1, { data: Xe, error: Ze, refetch: Qe } = b(xe, { variables: { limit: 6 } }), [$e] = y(Se), [et] = y(Ce), [tt] = y(we), [nt] = y(Te), [rt] = y(Ee), [it] = y(De), Q = qe?.listPromptGenerations?.edges?.map((e) => e.node) || [], at = Xe?.getPromptSuggestions || [];
|
|
397
|
+
ae(() => (Z || I ? Ye(2e3) : X(), () => X()), [
|
|
398
|
+
Z,
|
|
399
|
+
I,
|
|
397
400
|
Ye,
|
|
398
|
-
|
|
399
|
-
]),
|
|
400
|
-
if (!
|
|
401
|
+
X
|
|
402
|
+
]), ae(() => {
|
|
403
|
+
if (!B && !H) return;
|
|
401
404
|
let e = (e) => {
|
|
402
|
-
e.key === "Escape" && (
|
|
405
|
+
e.key === "Escape" && (V(null), U(null));
|
|
403
406
|
};
|
|
404
407
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
405
|
-
}, [
|
|
408
|
+
}, [B, H]);
|
|
406
409
|
let ot = l(async () => {
|
|
407
|
-
if (!(!_.trim() ||
|
|
410
|
+
if (!(!_.trim() || I)) {
|
|
408
411
|
if (_.length > 2e3) {
|
|
409
|
-
|
|
412
|
+
R(c("bigconsole.insights.error.promptTooLong", "Prompt is too long (max 2000 characters)."));
|
|
410
413
|
return;
|
|
411
414
|
}
|
|
412
|
-
|
|
415
|
+
R(null), L(!0);
|
|
413
416
|
try {
|
|
414
|
-
p("bigconsole.ai.generate_clicked", { maxWidgets:
|
|
417
|
+
p("bigconsole.ai.generate_clicked", { maxWidgets: F });
|
|
415
418
|
let e = await $e({ variables: { input: {
|
|
416
419
|
prompt: _.trim(),
|
|
417
|
-
styleType:
|
|
418
|
-
layoutType:
|
|
419
|
-
gridColumns:
|
|
420
|
-
maxWidgets:
|
|
420
|
+
styleType: w,
|
|
421
|
+
layoutType: j,
|
|
422
|
+
gridColumns: M,
|
|
423
|
+
maxWidgets: F
|
|
421
424
|
} } });
|
|
422
425
|
if (t(e, "command")) return;
|
|
423
426
|
let n = e.data?.generateDashboardFromPrompt?.id;
|
|
424
427
|
n && p("bigconsole.ai.dashboard_generated", {
|
|
425
428
|
generationId: n,
|
|
426
|
-
maxWidgets:
|
|
427
|
-
}),
|
|
429
|
+
maxWidgets: F
|
|
430
|
+
}), C(""), Y();
|
|
428
431
|
} catch (e) {
|
|
429
432
|
if (t(e, "command")) return;
|
|
430
|
-
|
|
433
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.generateFailed", "Failed to generate dashboard"));
|
|
431
434
|
} finally {
|
|
432
|
-
|
|
435
|
+
L(!1);
|
|
433
436
|
}
|
|
434
437
|
}
|
|
435
438
|
}, [
|
|
436
439
|
p,
|
|
437
440
|
_,
|
|
438
|
-
|
|
441
|
+
I,
|
|
439
442
|
$e,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
A,
|
|
443
|
+
Y,
|
|
444
|
+
w,
|
|
443
445
|
j,
|
|
444
|
-
|
|
446
|
+
M,
|
|
447
|
+
F,
|
|
445
448
|
c
|
|
446
|
-
]),
|
|
447
|
-
|
|
449
|
+
]), st = l(async (e) => {
|
|
450
|
+
R(null);
|
|
451
|
+
let n = s(e);
|
|
452
|
+
if (n.kind === "view") {
|
|
453
|
+
f(`/dashboards/${n.dashboardId}`);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (n.kind === "hold") {
|
|
457
|
+
R(c("bigconsole.insights.error.reviewUnavailable", "Reload the proposal before creating its dashboard."));
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
let r = e.id;
|
|
448
461
|
try {
|
|
449
|
-
p("bigconsole.ai.create_dashboard_clicked", { generationId:
|
|
450
|
-
let
|
|
451
|
-
if (t(
|
|
452
|
-
let
|
|
453
|
-
|
|
454
|
-
generationId:
|
|
455
|
-
dashboardId:
|
|
456
|
-
}), f(`/dashboards/${
|
|
462
|
+
p("bigconsole.ai.create_dashboard_clicked", { generationId: r });
|
|
463
|
+
let e = await et({ variables: { input: n.input } });
|
|
464
|
+
if (t(e, "project")) return;
|
|
465
|
+
let i = e.data?.createDashboardFromGeneration?.id;
|
|
466
|
+
i && (p("bigconsole.ai.dashboard_created", {
|
|
467
|
+
generationId: r,
|
|
468
|
+
dashboardId: i
|
|
469
|
+
}), f(`/dashboards/${i}`));
|
|
457
470
|
} catch (e) {
|
|
458
471
|
if (t(e, "project")) return;
|
|
459
|
-
|
|
472
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.createFailed", "Failed to create dashboard"));
|
|
460
473
|
}
|
|
461
474
|
}, [
|
|
462
475
|
et,
|
|
463
476
|
p,
|
|
464
477
|
f,
|
|
465
478
|
c
|
|
466
|
-
]),
|
|
467
|
-
|
|
479
|
+
]), ct = l(async (e) => {
|
|
480
|
+
R(null);
|
|
468
481
|
try {
|
|
469
|
-
await tt({ variables: { generationId: e } }), ee() &&
|
|
482
|
+
await tt({ variables: { generationId: e } }), ee() && te("success"), Y();
|
|
470
483
|
} catch (e) {
|
|
471
|
-
|
|
484
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.deleteFailed", "Failed to delete generation")), ee() && te("error");
|
|
472
485
|
}
|
|
473
486
|
}, [
|
|
474
487
|
tt,
|
|
475
|
-
|
|
488
|
+
Y,
|
|
476
489
|
c
|
|
477
|
-
]),
|
|
478
|
-
|
|
490
|
+
]), lt = l(async (e) => {
|
|
491
|
+
R(null), K(e);
|
|
479
492
|
try {
|
|
480
|
-
await nt({ variables: { generationId: e } }),
|
|
493
|
+
await nt({ variables: { generationId: e } }), Y();
|
|
481
494
|
} catch (e) {
|
|
482
|
-
|
|
495
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.cancelFailed", "Failed to cancel generation"));
|
|
483
496
|
} finally {
|
|
484
|
-
|
|
497
|
+
q(e);
|
|
485
498
|
}
|
|
486
499
|
}, [
|
|
487
500
|
nt,
|
|
488
|
-
|
|
501
|
+
Y,
|
|
489
502
|
c
|
|
490
|
-
]),
|
|
491
|
-
|
|
503
|
+
]), ut = l(async (e) => {
|
|
504
|
+
R(null), K(e);
|
|
492
505
|
try {
|
|
493
506
|
if (t(await rt({ variables: { input: { generationId: e } } }), "command")) return;
|
|
494
|
-
|
|
507
|
+
Y();
|
|
495
508
|
} catch (e) {
|
|
496
509
|
if (t(e, "command")) return;
|
|
497
|
-
|
|
510
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.regenerateFailed", "Failed to regenerate dashboard"));
|
|
498
511
|
} finally {
|
|
499
|
-
|
|
512
|
+
q(e);
|
|
500
513
|
}
|
|
501
514
|
}, [
|
|
502
515
|
rt,
|
|
503
|
-
|
|
516
|
+
Y,
|
|
504
517
|
c
|
|
505
|
-
]),
|
|
506
|
-
if (!
|
|
507
|
-
let e =
|
|
508
|
-
|
|
518
|
+
]), dt = l(async () => {
|
|
519
|
+
if (!H || !W.trim()) return;
|
|
520
|
+
let e = H.id;
|
|
521
|
+
R(null), K(e);
|
|
509
522
|
let n = !1;
|
|
510
523
|
try {
|
|
511
524
|
if (t(await it({ variables: { input: {
|
|
512
525
|
generationId: e,
|
|
513
|
-
refinementPrompt:
|
|
526
|
+
refinementPrompt: W.trim()
|
|
514
527
|
} } }), "command")) {
|
|
515
528
|
n = !0;
|
|
516
529
|
return;
|
|
517
530
|
}
|
|
518
|
-
n = !0,
|
|
531
|
+
n = !0, Y();
|
|
519
532
|
} catch (e) {
|
|
520
533
|
if (t(e, "command")) {
|
|
521
534
|
n = !0;
|
|
522
535
|
return;
|
|
523
536
|
}
|
|
524
|
-
|
|
537
|
+
R(e instanceof Error ? e.message : c("bigconsole.insights.error.refineFailed", "Failed to refine generation"));
|
|
525
538
|
} finally {
|
|
526
|
-
n && (
|
|
539
|
+
n && (U(null), G("")), q(e);
|
|
527
540
|
}
|
|
528
541
|
}, [
|
|
529
|
-
|
|
530
|
-
|
|
542
|
+
H,
|
|
543
|
+
W,
|
|
531
544
|
it,
|
|
532
|
-
|
|
545
|
+
Y,
|
|
533
546
|
c
|
|
534
|
-
]),
|
|
535
|
-
|
|
536
|
-
}, []), $ =
|
|
537
|
-
return /* @__PURE__ */
|
|
547
|
+
]), ft = l((e) => {
|
|
548
|
+
C(e);
|
|
549
|
+
}, []), $ = B?.generatedSpec;
|
|
550
|
+
return /* @__PURE__ */ S("div", {
|
|
538
551
|
"data-tour": "bigconsole-ai-insights",
|
|
539
552
|
className: "min-w-0",
|
|
540
553
|
style: { backgroundColor: "var(--color-bg-canvas)" },
|
|
541
554
|
children: [
|
|
542
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ S("header", {
|
|
543
556
|
className: "relative overflow-hidden border-b border-[var(--color-border-seam)] bg-[image:var(--gradient-gloss-card)]",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ x(me, { intensity: "subtle" }), /* @__PURE__ */ x("div", {
|
|
545
558
|
style: { padding: "var(--space-pagePadding)" },
|
|
546
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ S("div", {
|
|
547
560
|
style: {
|
|
548
561
|
display: "flex",
|
|
549
562
|
alignItems: "center",
|
|
@@ -551,7 +564,7 @@ var P = c(function() {
|
|
|
551
564
|
flexWrap: "wrap",
|
|
552
565
|
minWidth: 0
|
|
553
566
|
},
|
|
554
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ x("div", {
|
|
555
568
|
style: {
|
|
556
569
|
display: "flex",
|
|
557
570
|
height: "var(--size-controlHeight-lg)",
|
|
@@ -562,17 +575,17 @@ var P = c(function() {
|
|
|
562
575
|
borderRadius: "var(--radius-card)",
|
|
563
576
|
backgroundColor: "var(--color-action-primary-bg)"
|
|
564
577
|
},
|
|
565
|
-
children: /* @__PURE__ */
|
|
578
|
+
children: /* @__PURE__ */ x(h, { style: {
|
|
566
579
|
height: "var(--size-icon-lg)",
|
|
567
580
|
width: "var(--size-icon-lg)",
|
|
568
581
|
color: "var(--color-action-primary-text)"
|
|
569
582
|
} })
|
|
570
|
-
}), /* @__PURE__ */
|
|
583
|
+
}), /* @__PURE__ */ S("div", {
|
|
571
584
|
style: { minWidth: 0 },
|
|
572
|
-
children: [/* @__PURE__ */
|
|
585
|
+
children: [/* @__PURE__ */ x("h1", {
|
|
573
586
|
className: "m-0 text-2xl font-bold text-text-primary",
|
|
574
|
-
children: /* @__PURE__ */
|
|
575
|
-
}), /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ x(ge, { children: c("bigconsole.insights.header.title", "AI Insights") })
|
|
588
|
+
}), /* @__PURE__ */ x("p", {
|
|
576
589
|
className: "m-0 text-sm text-text-secondary",
|
|
577
590
|
children: c("bigconsole.insights.header.subtitle", "Generate dashboards from natural language prompts")
|
|
578
591
|
})]
|
|
@@ -580,47 +593,47 @@ var P = c(function() {
|
|
|
580
593
|
})
|
|
581
594
|
})]
|
|
582
595
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ S("div", {
|
|
584
597
|
style: { padding: "var(--space-pagePadding)" },
|
|
585
|
-
children: [/* @__PURE__ */
|
|
598
|
+
children: [/* @__PURE__ */ x(ve, {
|
|
586
599
|
className: "mb-[var(--space-sectionGap)]",
|
|
587
600
|
children: "Describe the dashboard you need in plain English and BigConsole proposes the pages, widgets and layout for it. Review the proposal, refine it in place, then create the real dashboard in one step — a generation is only a proposal until you accept it."
|
|
588
|
-
}), /* @__PURE__ */
|
|
589
|
-
Ge && /* @__PURE__ */
|
|
601
|
+
}), /* @__PURE__ */ S(i, { children: [
|
|
602
|
+
Ge && /* @__PURE__ */ x(r, {
|
|
590
603
|
headingLevel: 2,
|
|
591
604
|
tone: "danger",
|
|
592
605
|
padding: "compact",
|
|
593
606
|
title: "That request did not go through",
|
|
594
607
|
description: Ge,
|
|
595
|
-
icon: /* @__PURE__ */
|
|
608
|
+
icon: /* @__PURE__ */ x(oe, { className: "h-icon-sm w-icon-sm" }),
|
|
596
609
|
"data-testid": "insights-error",
|
|
597
|
-
actions: /* @__PURE__ */
|
|
610
|
+
actions: /* @__PURE__ */ x("button", {
|
|
598
611
|
type: "button",
|
|
599
|
-
onClick: () =>
|
|
612
|
+
onClick: () => R(null),
|
|
600
613
|
"aria-label": c("bigconsole.insights.error.dismiss", "Dismiss error"),
|
|
601
614
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
602
|
-
style:
|
|
615
|
+
style: T,
|
|
603
616
|
children: "Dismiss"
|
|
604
617
|
})
|
|
605
618
|
}),
|
|
606
|
-
(
|
|
619
|
+
(J || Ze) && /* @__PURE__ */ x("div", {
|
|
607
620
|
role: "alert",
|
|
608
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ x(r, {
|
|
609
622
|
tone: "danger",
|
|
610
623
|
padding: "compact",
|
|
611
624
|
headingLevel: 2,
|
|
612
625
|
title: c("bigconsole.insights.error.loadFailed", "AI Insights could not be loaded"),
|
|
613
626
|
description: c("bigconsole.insights.error.loadFailedDescription", "Your saved generations and suggestions may be unavailable. Retry the failed request."),
|
|
614
627
|
"data-testid": "insights-load-error",
|
|
615
|
-
actions: /* @__PURE__ */
|
|
628
|
+
actions: /* @__PURE__ */ S("button", {
|
|
616
629
|
type: "button",
|
|
617
630
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
618
|
-
style:
|
|
631
|
+
style: T,
|
|
619
632
|
onClick: () => {
|
|
620
|
-
|
|
633
|
+
J && Y().catch(() => void 0), Ze && Qe().catch(() => void 0);
|
|
621
634
|
},
|
|
622
635
|
children: [
|
|
623
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ x(de, {
|
|
624
637
|
size: 14,
|
|
625
638
|
"aria-hidden": "true"
|
|
626
639
|
}),
|
|
@@ -630,22 +643,22 @@ var P = c(function() {
|
|
|
630
643
|
})
|
|
631
644
|
})
|
|
632
645
|
}),
|
|
633
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ x(r, {
|
|
634
647
|
id: "insights-prompt",
|
|
635
648
|
emphasis: "primary",
|
|
636
649
|
headingLevel: 2,
|
|
637
650
|
title: "Describe your dashboard",
|
|
638
651
|
description: "One or two sentences is enough — name the metrics, the breakdowns and who will read it.",
|
|
639
|
-
icon: /* @__PURE__ */
|
|
652
|
+
icon: /* @__PURE__ */ x(h, { className: "h-icon-sm w-icon-sm" }),
|
|
640
653
|
"data-testid": "insights-prompt",
|
|
641
|
-
children: /* @__PURE__ */
|
|
654
|
+
children: /* @__PURE__ */ S("div", {
|
|
642
655
|
style: {
|
|
643
656
|
display: "flex",
|
|
644
657
|
flexDirection: "column",
|
|
645
658
|
gap: "var(--space-controlGap)"
|
|
646
659
|
},
|
|
647
660
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ x("label", {
|
|
649
662
|
htmlFor: "prompt-input",
|
|
650
663
|
style: {
|
|
651
664
|
display: "block",
|
|
@@ -655,10 +668,10 @@ var P = c(function() {
|
|
|
655
668
|
},
|
|
656
669
|
children: c("bigconsole.insights.prompt.label", "Your prompt")
|
|
657
670
|
}),
|
|
658
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ x("textarea", {
|
|
659
672
|
id: "prompt-input",
|
|
660
673
|
value: _,
|
|
661
|
-
onChange: (e) =>
|
|
674
|
+
onChange: (e) => C(e.target.value),
|
|
662
675
|
placeholder: c("bigconsole.insights.prompt.placeholder", "e.g., Create a sales dashboard showing revenue trends, top products, and regional performance"),
|
|
663
676
|
rows: 3,
|
|
664
677
|
maxLength: 2e3,
|
|
@@ -678,7 +691,7 @@ var P = c(function() {
|
|
|
678
691
|
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), ot());
|
|
679
692
|
}
|
|
680
693
|
}),
|
|
681
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ S("div", {
|
|
682
695
|
role: "group",
|
|
683
696
|
"aria-label": c("bigconsole.insights.prompt.optionsLabel", "Generation options"),
|
|
684
697
|
"data-testid": "insights-generation-options",
|
|
@@ -688,69 +701,69 @@ var P = c(function() {
|
|
|
688
701
|
gap: "var(--space-controlGap)"
|
|
689
702
|
},
|
|
690
703
|
children: [
|
|
691
|
-
/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
692
705
|
htmlFor: "prompt-style",
|
|
693
|
-
style:
|
|
706
|
+
style: D,
|
|
694
707
|
children: c("bigconsole.insights.prompt.style", "Style")
|
|
695
|
-
}), /* @__PURE__ */
|
|
708
|
+
}), /* @__PURE__ */ x("select", {
|
|
696
709
|
id: "prompt-style",
|
|
697
|
-
value:
|
|
698
|
-
onChange: (e) =>
|
|
710
|
+
value: w,
|
|
711
|
+
onChange: (e) => A(e.target.value),
|
|
699
712
|
className: n,
|
|
700
|
-
style:
|
|
701
|
-
children: je.map((e) => /* @__PURE__ */
|
|
713
|
+
style: O,
|
|
714
|
+
children: je.map((e) => /* @__PURE__ */ x("option", {
|
|
702
715
|
value: e.value,
|
|
703
716
|
children: e.label
|
|
704
717
|
}, e.value))
|
|
705
718
|
})] }),
|
|
706
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
707
720
|
htmlFor: "prompt-layout",
|
|
708
|
-
style:
|
|
721
|
+
style: D,
|
|
709
722
|
children: c("bigconsole.insights.prompt.layout", "Layout")
|
|
710
|
-
}), /* @__PURE__ */
|
|
723
|
+
}), /* @__PURE__ */ x("select", {
|
|
711
724
|
id: "prompt-layout",
|
|
712
|
-
value:
|
|
725
|
+
value: j,
|
|
713
726
|
onChange: (e) => Le(e.target.value),
|
|
714
727
|
className: n,
|
|
715
|
-
style:
|
|
716
|
-
children: Me.map((e) => /* @__PURE__ */
|
|
728
|
+
style: O,
|
|
729
|
+
children: Me.map((e) => /* @__PURE__ */ x("option", {
|
|
717
730
|
value: e.value,
|
|
718
731
|
children: e.label
|
|
719
732
|
}, e.value))
|
|
720
733
|
})] }),
|
|
721
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
722
735
|
htmlFor: "prompt-columns",
|
|
723
|
-
style:
|
|
736
|
+
style: D,
|
|
724
737
|
children: c("bigconsole.insights.prompt.columns", "Columns")
|
|
725
|
-
}), /* @__PURE__ */
|
|
738
|
+
}), /* @__PURE__ */ x("select", {
|
|
726
739
|
id: "prompt-columns",
|
|
727
|
-
value:
|
|
728
|
-
onChange: (e) =>
|
|
740
|
+
value: M,
|
|
741
|
+
onChange: (e) => P(Number(e.target.value)),
|
|
729
742
|
className: n,
|
|
730
|
-
style:
|
|
731
|
-
children: Ne.map((e) => /* @__PURE__ */
|
|
743
|
+
style: O,
|
|
744
|
+
children: Ne.map((e) => /* @__PURE__ */ x("option", {
|
|
732
745
|
value: e,
|
|
733
746
|
children: e
|
|
734
747
|
}, e))
|
|
735
748
|
})] }),
|
|
736
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
737
750
|
htmlFor: "prompt-max-widgets",
|
|
738
|
-
style:
|
|
751
|
+
style: D,
|
|
739
752
|
children: c("bigconsole.insights.prompt.maxWidgets", "Max widgets")
|
|
740
|
-
}), /* @__PURE__ */
|
|
753
|
+
}), /* @__PURE__ */ x("select", {
|
|
741
754
|
id: "prompt-max-widgets",
|
|
742
|
-
value:
|
|
755
|
+
value: F,
|
|
743
756
|
onChange: (e) => We(Number(e.target.value)),
|
|
744
757
|
className: n,
|
|
745
|
-
style:
|
|
746
|
-
children: Pe.map((e) => /* @__PURE__ */
|
|
758
|
+
style: O,
|
|
759
|
+
children: Pe.map((e) => /* @__PURE__ */ x("option", {
|
|
747
760
|
value: e,
|
|
748
761
|
children: e
|
|
749
762
|
}, e))
|
|
750
763
|
})] })
|
|
751
764
|
]
|
|
752
765
|
}),
|
|
753
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ S("div", {
|
|
754
767
|
style: {
|
|
755
768
|
display: "flex",
|
|
756
769
|
alignItems: "center",
|
|
@@ -759,7 +772,7 @@ var P = c(function() {
|
|
|
759
772
|
borderTop: "1px solid var(--color-border-subtle)",
|
|
760
773
|
paddingTop: "var(--space-controlGap)"
|
|
761
774
|
},
|
|
762
|
-
children: [/* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ S("span", {
|
|
763
776
|
style: {
|
|
764
777
|
flex: "1 1 12rem",
|
|
765
778
|
minWidth: 0,
|
|
@@ -772,22 +785,22 @@ var P = c(function() {
|
|
|
772
785
|
_.length,
|
|
773
786
|
"/2000"
|
|
774
787
|
]
|
|
775
|
-
}), /* @__PURE__ */
|
|
788
|
+
}), /* @__PURE__ */ S("button", {
|
|
776
789
|
type: "button",
|
|
777
790
|
onClick: ot,
|
|
778
|
-
disabled: !_.trim() ||
|
|
791
|
+
disabled: !_.trim() || I,
|
|
779
792
|
className: n,
|
|
780
793
|
style: {
|
|
781
|
-
...
|
|
794
|
+
...E,
|
|
782
795
|
marginLeft: "auto",
|
|
783
|
-
cursor: !_.trim() ||
|
|
784
|
-
opacity: !_.trim() ||
|
|
796
|
+
cursor: !_.trim() || I ? "not-allowed" : "pointer",
|
|
797
|
+
opacity: !_.trim() || I ? .5 : 1
|
|
785
798
|
},
|
|
786
|
-
children: [
|
|
799
|
+
children: [I ? /* @__PURE__ */ x(m, {
|
|
787
800
|
size: 16,
|
|
788
801
|
className: "animate-spin",
|
|
789
802
|
"aria-hidden": "true"
|
|
790
|
-
}) : /* @__PURE__ */
|
|
803
|
+
}) : /* @__PURE__ */ x(h, {
|
|
791
804
|
size: 16,
|
|
792
805
|
"aria-hidden": "true"
|
|
793
806
|
}), c("bigconsole.insights.prompt.generateButton", "Generate dashboard")]
|
|
@@ -796,22 +809,22 @@ var P = c(function() {
|
|
|
796
809
|
]
|
|
797
810
|
})
|
|
798
811
|
}),
|
|
799
|
-
at.length > 0 && /* @__PURE__ */
|
|
812
|
+
at.length > 0 && /* @__PURE__ */ x(r, {
|
|
800
813
|
emphasis: "muted",
|
|
801
814
|
headingLevel: 2,
|
|
802
815
|
title: c("bigconsole.insights.suggestions.heading", "Starting points"),
|
|
803
816
|
description: "Pick one to drop it into the prompt box above, then edit it before generating.",
|
|
804
|
-
icon: /* @__PURE__ */
|
|
817
|
+
icon: /* @__PURE__ */ x(ue, { className: "h-icon-sm w-icon-sm" }),
|
|
805
818
|
"data-testid": "insights-suggestions",
|
|
806
|
-
children: /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ x("div", {
|
|
807
820
|
style: {
|
|
808
821
|
display: "grid",
|
|
809
822
|
gridTemplateColumns: "repeat(auto-fill, minmax(min(260px, 100%), 1fr))",
|
|
810
823
|
gap: "var(--space-controlGap)"
|
|
811
824
|
},
|
|
812
|
-
children: at.map((e) => /* @__PURE__ */
|
|
825
|
+
children: at.map((e) => /* @__PURE__ */ S("button", {
|
|
813
826
|
type: "button",
|
|
814
|
-
onClick: () =>
|
|
827
|
+
onClick: () => ft(e.prompt),
|
|
815
828
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
816
829
|
style: {
|
|
817
830
|
textAlign: "left",
|
|
@@ -824,7 +837,7 @@ var P = c(function() {
|
|
|
824
837
|
cursor: "pointer"
|
|
825
838
|
},
|
|
826
839
|
children: [
|
|
827
|
-
/* @__PURE__ */
|
|
840
|
+
/* @__PURE__ */ x("span", {
|
|
828
841
|
style: {
|
|
829
842
|
display: "block",
|
|
830
843
|
fontWeight: "var(--font-weight-medium)",
|
|
@@ -834,7 +847,7 @@ var P = c(function() {
|
|
|
834
847
|
},
|
|
835
848
|
children: e.title
|
|
836
849
|
}),
|
|
837
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ x("span", {
|
|
838
851
|
style: {
|
|
839
852
|
display: "block",
|
|
840
853
|
fontSize: "var(--font-size-body-sm)",
|
|
@@ -843,15 +856,15 @@ var P = c(function() {
|
|
|
843
856
|
},
|
|
844
857
|
children: e.exampleDescription || e.prompt
|
|
845
858
|
}),
|
|
846
|
-
e.tags.length > 0 && /* @__PURE__ */
|
|
859
|
+
e.tags.length > 0 && /* @__PURE__ */ x("span", {
|
|
847
860
|
style: {
|
|
848
861
|
display: "flex",
|
|
849
862
|
gap: "var(--space-iconGap)",
|
|
850
863
|
marginTop: "var(--space-controlGap)",
|
|
851
864
|
flexWrap: "wrap"
|
|
852
865
|
},
|
|
853
|
-
children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */
|
|
854
|
-
style:
|
|
866
|
+
children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ x("span", {
|
|
867
|
+
style: k,
|
|
855
868
|
children: e
|
|
856
869
|
}, e))
|
|
857
870
|
})
|
|
@@ -859,29 +872,29 @@ var P = c(function() {
|
|
|
859
872
|
}, e.id))
|
|
860
873
|
})
|
|
861
874
|
}),
|
|
862
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ x(r, {
|
|
863
876
|
emphasis: "bare",
|
|
864
877
|
padding: "none",
|
|
865
878
|
headingLevel: 2,
|
|
866
879
|
title: c("bigconsole.insights.generations.heading", "Recent generations"),
|
|
867
880
|
description: "Newest first. A generation stays a proposal until you create the dashboard from it.",
|
|
868
|
-
icon: /* @__PURE__ */
|
|
869
|
-
meta:
|
|
870
|
-
style:
|
|
881
|
+
icon: /* @__PURE__ */ x(le, { className: "h-icon-sm w-icon-sm" }),
|
|
882
|
+
meta: Q.length > 0 ? /* @__PURE__ */ S("span", {
|
|
883
|
+
style: k,
|
|
871
884
|
children: [
|
|
872
|
-
|
|
885
|
+
Q.length,
|
|
873
886
|
" generation",
|
|
874
|
-
|
|
887
|
+
Q.length === 1 ? "" : "s"
|
|
875
888
|
]
|
|
876
889
|
}) : void 0,
|
|
877
890
|
"data-testid": "insights-generations",
|
|
878
|
-
children: Je &&
|
|
891
|
+
children: Je && Q.length === 0 ? /* @__PURE__ */ x(r, {
|
|
879
892
|
emphasis: "muted",
|
|
880
893
|
headingLevel: 3,
|
|
881
894
|
"aria-label": "Loading generations",
|
|
882
895
|
className: "min-h-[10rem]",
|
|
883
896
|
"data-testid": "insights-generations-loading",
|
|
884
|
-
children: /* @__PURE__ */
|
|
897
|
+
children: /* @__PURE__ */ S("div", {
|
|
885
898
|
style: {
|
|
886
899
|
display: "flex",
|
|
887
900
|
minHeight: "8rem",
|
|
@@ -891,84 +904,84 @@ var P = c(function() {
|
|
|
891
904
|
gap: "var(--space-controlGap)",
|
|
892
905
|
color: "var(--color-text-muted)"
|
|
893
906
|
},
|
|
894
|
-
children: [/* @__PURE__ */
|
|
907
|
+
children: [/* @__PURE__ */ x(m, {
|
|
895
908
|
size: 24,
|
|
896
909
|
className: "animate-spin",
|
|
897
910
|
"aria-hidden": "true"
|
|
898
|
-
}), /* @__PURE__ */
|
|
911
|
+
}), /* @__PURE__ */ x("p", {
|
|
899
912
|
style: { fontSize: "var(--font-size-body-sm)" },
|
|
900
913
|
children: c("bigconsole.insights.generations.loading", "Loading generations…")
|
|
901
914
|
})]
|
|
902
915
|
})
|
|
903
|
-
}) :
|
|
916
|
+
}) : Q.length === 0 && !I && !J ? /* @__PURE__ */ x(he, {
|
|
904
917
|
treatment: "insight",
|
|
905
918
|
className: "border-[var(--color-border-seam)]",
|
|
906
|
-
children: /* @__PURE__ */
|
|
919
|
+
children: /* @__PURE__ */ x(_e, {
|
|
907
920
|
illustration: "onboarding",
|
|
908
921
|
title: c("bigconsole.insights.generations.emptyTitle", "No generations yet"),
|
|
909
922
|
description: c("bigconsole.insights.generations.emptyDescription", "Describe a dashboard above to get started")
|
|
910
923
|
})
|
|
911
|
-
}) : /* @__PURE__ */
|
|
924
|
+
}) : /* @__PURE__ */ S("div", {
|
|
912
925
|
className: "flex flex-col gap-list-gap",
|
|
913
|
-
children: [
|
|
926
|
+
children: [I && !Z && /* @__PURE__ */ x(r, {
|
|
914
927
|
emphasis: "muted",
|
|
915
928
|
tone: "info",
|
|
916
929
|
padding: "compact",
|
|
917
930
|
headingLevel: 3,
|
|
918
931
|
title: "Sending your prompt…",
|
|
919
932
|
description: "The new generation appears here as soon as the backend accepts it.",
|
|
920
|
-
icon: /* @__PURE__ */
|
|
933
|
+
icon: /* @__PURE__ */ x(m, { className: "h-icon-sm w-icon-sm animate-spin" }),
|
|
921
934
|
"data-testid": "insights-generation-pending"
|
|
922
|
-
}),
|
|
923
|
-
let t = e.generatedSpec, i =
|
|
924
|
-
return /* @__PURE__ */
|
|
935
|
+
}), Q.map((e) => {
|
|
936
|
+
let t = e.generatedSpec, i = z.has(e.id), a = Oe.includes(e.status);
|
|
937
|
+
return /* @__PURE__ */ S(r, {
|
|
925
938
|
emphasis: "standard",
|
|
926
939
|
padding: "compact",
|
|
927
940
|
headingLevel: 3,
|
|
928
941
|
title: t?.name || (a ? c("bigconsole.insights.generations.generating", "Generating…") : "Untitled generation"),
|
|
929
|
-
meta: /* @__PURE__ */
|
|
942
|
+
meta: /* @__PURE__ */ x(Re, { status: e.status }),
|
|
930
943
|
description: e.prompt.length > 160 ? `${e.prompt.slice(0, 160)}…` : e.prompt,
|
|
931
944
|
"data-testid": "insights-generation-card",
|
|
932
945
|
bodyClassName: "flex flex-col gap-control-gap",
|
|
933
946
|
children: [
|
|
934
|
-
t && /* @__PURE__ */
|
|
947
|
+
t && /* @__PURE__ */ S("div", {
|
|
935
948
|
style: {
|
|
936
949
|
display: "flex",
|
|
937
950
|
flexWrap: "wrap",
|
|
938
951
|
gap: "var(--space-iconGap)"
|
|
939
952
|
},
|
|
940
953
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
style:
|
|
954
|
+
/* @__PURE__ */ S("span", {
|
|
955
|
+
style: k,
|
|
943
956
|
children: [
|
|
944
|
-
|
|
957
|
+
N(t),
|
|
945
958
|
" widget",
|
|
946
|
-
|
|
959
|
+
N(t) === 1 ? "" : "s"
|
|
947
960
|
]
|
|
948
961
|
}),
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
style:
|
|
962
|
+
/* @__PURE__ */ S("span", {
|
|
963
|
+
style: k,
|
|
951
964
|
children: [
|
|
952
965
|
t.pages.length,
|
|
953
966
|
" page",
|
|
954
967
|
t.pages.length === 1 ? "" : "s"
|
|
955
968
|
]
|
|
956
969
|
}),
|
|
957
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ S("span", {
|
|
958
971
|
style: ze(t.overallConfidence),
|
|
959
972
|
children: [Math.round(t.overallConfidence * 100), "% confidence"]
|
|
960
973
|
})
|
|
961
974
|
]
|
|
962
975
|
}),
|
|
963
|
-
e.errorMessage && /* @__PURE__ */
|
|
976
|
+
e.errorMessage && /* @__PURE__ */ x(r, {
|
|
964
977
|
headingLevel: 4,
|
|
965
978
|
tone: "danger",
|
|
966
979
|
padding: "compact",
|
|
967
980
|
title: "Generation failed",
|
|
968
981
|
description: e.errorMessage,
|
|
969
|
-
icon: /* @__PURE__ */
|
|
982
|
+
icon: /* @__PURE__ */ x(oe, { className: "h-icon-sm w-icon-sm" })
|
|
970
983
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ S("div", {
|
|
972
985
|
style: {
|
|
973
986
|
display: "flex",
|
|
974
987
|
flexWrap: "wrap",
|
|
@@ -978,10 +991,10 @@ var P = c(function() {
|
|
|
978
991
|
paddingTop: "var(--space-controlGap)"
|
|
979
992
|
},
|
|
980
993
|
children: [
|
|
981
|
-
a && /* @__PURE__ */
|
|
994
|
+
a && /* @__PURE__ */ S("button", {
|
|
982
995
|
type: "button",
|
|
983
996
|
onClick: () => {
|
|
984
|
-
o("medium"),
|
|
997
|
+
o("medium"), lt(e.id);
|
|
985
998
|
},
|
|
986
999
|
disabled: i,
|
|
987
1000
|
title: c("bigconsole.insights.actions.cancelTitle", "Cancel generation"),
|
|
@@ -991,7 +1004,7 @@ var P = c(function() {
|
|
|
991
1004
|
cursor: i ? "wait" : "pointer"
|
|
992
1005
|
},
|
|
993
1006
|
children: [
|
|
994
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ x(se, {
|
|
995
1008
|
size: 14,
|
|
996
1009
|
"aria-hidden": "true"
|
|
997
1010
|
}),
|
|
@@ -999,14 +1012,14 @@ var P = c(function() {
|
|
|
999
1012
|
c("bigconsole.insights.actions.cancel", "Cancel")
|
|
1000
1013
|
]
|
|
1001
1014
|
}),
|
|
1002
|
-
e.status === "COMPLETED" && t && /* @__PURE__ */
|
|
1015
|
+
e.status === "COMPLETED" && t && /* @__PURE__ */ S("button", {
|
|
1003
1016
|
type: "button",
|
|
1004
|
-
onClick: () =>
|
|
1017
|
+
onClick: () => V(e),
|
|
1005
1018
|
title: c("bigconsole.insights.actions.previewTitle", "Preview proposed layout"),
|
|
1006
1019
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1007
|
-
style:
|
|
1020
|
+
style: T,
|
|
1008
1021
|
children: [
|
|
1009
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ x(ce, {
|
|
1010
1023
|
size: 14,
|
|
1011
1024
|
"aria-hidden": "true"
|
|
1012
1025
|
}),
|
|
@@ -1014,16 +1027,16 @@ var P = c(function() {
|
|
|
1014
1027
|
c("bigconsole.insights.actions.preview", "Preview")
|
|
1015
1028
|
]
|
|
1016
1029
|
}),
|
|
1017
|
-
e.status === "COMPLETED" && t && /* @__PURE__ */
|
|
1030
|
+
e.status === "COMPLETED" && t && /* @__PURE__ */ S("button", {
|
|
1018
1031
|
type: "button",
|
|
1019
1032
|
onClick: () => {
|
|
1020
|
-
|
|
1033
|
+
U(e), G("");
|
|
1021
1034
|
},
|
|
1022
1035
|
title: c("bigconsole.insights.actions.refineTitle", "Refine with instructions"),
|
|
1023
1036
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1024
|
-
style:
|
|
1037
|
+
style: T,
|
|
1025
1038
|
children: [
|
|
1026
|
-
/* @__PURE__ */
|
|
1039
|
+
/* @__PURE__ */ x(g, {
|
|
1027
1040
|
size: 14,
|
|
1028
1041
|
"aria-hidden": "true"
|
|
1029
1042
|
}),
|
|
@@ -1031,20 +1044,20 @@ var P = c(function() {
|
|
|
1031
1044
|
c("bigconsole.insights.actions.refine", "Refine")
|
|
1032
1045
|
]
|
|
1033
1046
|
}),
|
|
1034
|
-
(e.status === "COMPLETED" || e.status === "FAILED" || e.status === "CANCELLED") && /* @__PURE__ */
|
|
1047
|
+
(e.status === "COMPLETED" || e.status === "FAILED" || e.status === "CANCELLED") && /* @__PURE__ */ S("button", {
|
|
1035
1048
|
type: "button",
|
|
1036
1049
|
onClick: () => {
|
|
1037
|
-
o("medium"),
|
|
1050
|
+
o("medium"), ut(e.id);
|
|
1038
1051
|
},
|
|
1039
1052
|
disabled: i,
|
|
1040
1053
|
title: c("bigconsole.insights.actions.regenerateTitle", "Regenerate with the same prompt"),
|
|
1041
1054
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1042
1055
|
style: {
|
|
1043
|
-
...
|
|
1056
|
+
...T,
|
|
1044
1057
|
cursor: i ? "wait" : "pointer"
|
|
1045
1058
|
},
|
|
1046
1059
|
children: [
|
|
1047
|
-
/* @__PURE__ */
|
|
1060
|
+
/* @__PURE__ */ x(de, {
|
|
1048
1061
|
size: 14,
|
|
1049
1062
|
className: i ? "animate-spin" : "",
|
|
1050
1063
|
"aria-hidden": "true"
|
|
@@ -1053,7 +1066,7 @@ var P = c(function() {
|
|
|
1053
1066
|
c("bigconsole.insights.actions.regenerate", "Regenerate")
|
|
1054
1067
|
]
|
|
1055
1068
|
}),
|
|
1056
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ S("div", {
|
|
1057
1070
|
style: {
|
|
1058
1071
|
display: "flex",
|
|
1059
1072
|
flexWrap: "wrap",
|
|
@@ -1062,44 +1075,50 @@ var P = c(function() {
|
|
|
1062
1075
|
marginLeft: "auto"
|
|
1063
1076
|
},
|
|
1064
1077
|
children: [
|
|
1065
|
-
e.status === "COMPLETED" &&
|
|
1078
|
+
e.status === "COMPLETED" && s(e).kind === "hold" && /* @__PURE__ */ x("span", {
|
|
1079
|
+
role: "status",
|
|
1080
|
+
children: c("bigconsole.insights.error.reviewUnavailable", "Reload the proposal before creating its dashboard.")
|
|
1081
|
+
}),
|
|
1082
|
+
e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ S("button", {
|
|
1066
1083
|
type: "button",
|
|
1067
|
-
onClick: () =>
|
|
1084
|
+
onClick: () => st(e),
|
|
1085
|
+
disabled: s(e).kind !== "create",
|
|
1086
|
+
title: s(e).kind === "hold" ? "Reload the proposal before creating its dashboard." : void 0,
|
|
1068
1087
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1069
|
-
style:
|
|
1088
|
+
style: E,
|
|
1070
1089
|
children: [
|
|
1071
1090
|
c("bigconsole.insights.actions.create", "Create dashboard"),
|
|
1072
1091
|
" ",
|
|
1073
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ x(d, {
|
|
1074
1093
|
size: 14,
|
|
1075
1094
|
"aria-hidden": "true"
|
|
1076
1095
|
})
|
|
1077
1096
|
]
|
|
1078
1097
|
}),
|
|
1079
|
-
e.dashboardId && /* @__PURE__ */
|
|
1098
|
+
e.dashboardId && /* @__PURE__ */ S("button", {
|
|
1080
1099
|
type: "button",
|
|
1081
1100
|
onClick: () => f(`/dashboards/${e.dashboardId ?? ""}`),
|
|
1082
1101
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1083
|
-
style:
|
|
1102
|
+
style: T,
|
|
1084
1103
|
children: [
|
|
1085
1104
|
c("bigconsole.insights.actions.viewDashboard", "View dashboard"),
|
|
1086
1105
|
" ",
|
|
1087
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ x(d, {
|
|
1088
1107
|
size: 14,
|
|
1089
1108
|
"aria-hidden": "true"
|
|
1090
1109
|
})
|
|
1091
1110
|
]
|
|
1092
1111
|
}),
|
|
1093
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ x("button", {
|
|
1094
1113
|
type: "button",
|
|
1095
1114
|
onClick: () => {
|
|
1096
|
-
o("medium"),
|
|
1115
|
+
o("medium"), ct(e.id);
|
|
1097
1116
|
},
|
|
1098
1117
|
title: c("bigconsole.insights.actions.deleteTitle", "Delete generation"),
|
|
1099
1118
|
"aria-label": c("bigconsole.insights.actions.deleteTitle", "Delete generation"),
|
|
1100
1119
|
className: n,
|
|
1101
1120
|
style: Ie,
|
|
1102
|
-
children: /* @__PURE__ */
|
|
1121
|
+
children: /* @__PURE__ */ x(fe, {
|
|
1103
1122
|
size: 14,
|
|
1104
1123
|
"aria-hidden": "true"
|
|
1105
1124
|
})
|
|
@@ -1115,11 +1134,11 @@ var P = c(function() {
|
|
|
1115
1134
|
})
|
|
1116
1135
|
] })]
|
|
1117
1136
|
}),
|
|
1118
|
-
|
|
1137
|
+
B && $ && /* @__PURE__ */ x("div", {
|
|
1119
1138
|
role: "dialog",
|
|
1120
1139
|
"aria-modal": "true",
|
|
1121
1140
|
"aria-label": c("bigconsole.insights.preview.ariaLabel", "Generation preview"),
|
|
1122
|
-
onClick: () =>
|
|
1141
|
+
onClick: () => V(null),
|
|
1123
1142
|
style: {
|
|
1124
1143
|
position: "fixed",
|
|
1125
1144
|
inset: 0,
|
|
@@ -1130,7 +1149,7 @@ var P = c(function() {
|
|
|
1130
1149
|
justifyContent: "center",
|
|
1131
1150
|
padding: "var(--space-pagePadding)"
|
|
1132
1151
|
},
|
|
1133
|
-
children: /* @__PURE__ */
|
|
1152
|
+
children: /* @__PURE__ */ S("div", {
|
|
1134
1153
|
onClick: (e) => e.stopPropagation(),
|
|
1135
1154
|
style: {
|
|
1136
1155
|
display: "flex",
|
|
@@ -1144,7 +1163,7 @@ var P = c(function() {
|
|
|
1144
1163
|
boxShadow: "var(--shadow-elevation-3)"
|
|
1145
1164
|
},
|
|
1146
1165
|
children: [
|
|
1147
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ S("div", {
|
|
1148
1167
|
style: {
|
|
1149
1168
|
display: "flex",
|
|
1150
1169
|
justifyContent: "space-between",
|
|
@@ -1153,16 +1172,16 @@ var P = c(function() {
|
|
|
1153
1172
|
padding: "var(--space-cardPadding)",
|
|
1154
1173
|
borderBottom: "1px solid var(--color-border-subtle)"
|
|
1155
1174
|
},
|
|
1156
|
-
children: [/* @__PURE__ */
|
|
1175
|
+
children: [/* @__PURE__ */ S("div", {
|
|
1157
1176
|
style: { minWidth: 0 },
|
|
1158
|
-
children: [/* @__PURE__ */
|
|
1177
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
1159
1178
|
style: {
|
|
1160
1179
|
fontSize: "var(--font-size-heading-h4)",
|
|
1161
1180
|
fontWeight: "var(--font-weight-semibold)",
|
|
1162
1181
|
color: "var(--color-text-primary)"
|
|
1163
1182
|
},
|
|
1164
1183
|
children: $.name
|
|
1165
|
-
}), $.description && /* @__PURE__ */
|
|
1184
|
+
}), $.description && /* @__PURE__ */ x("p", {
|
|
1166
1185
|
style: {
|
|
1167
1186
|
fontSize: "var(--font-size-body-sm)",
|
|
1168
1187
|
color: "var(--color-text-secondary)",
|
|
@@ -1170,22 +1189,22 @@ var P = c(function() {
|
|
|
1170
1189
|
},
|
|
1171
1190
|
children: $.description
|
|
1172
1191
|
})]
|
|
1173
|
-
}), /* @__PURE__ */
|
|
1192
|
+
}), /* @__PURE__ */ x("button", {
|
|
1174
1193
|
type: "button",
|
|
1175
|
-
onClick: () =>
|
|
1194
|
+
onClick: () => V(null),
|
|
1176
1195
|
"aria-label": c("bigconsole.insights.preview.close", "Close preview"),
|
|
1177
1196
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1178
1197
|
style: {
|
|
1179
1198
|
...Ie,
|
|
1180
1199
|
color: "var(--color-text-muted)"
|
|
1181
1200
|
},
|
|
1182
|
-
children: /* @__PURE__ */
|
|
1201
|
+
children: /* @__PURE__ */ x(pe, {
|
|
1183
1202
|
size: 18,
|
|
1184
1203
|
"aria-hidden": "true"
|
|
1185
1204
|
})
|
|
1186
1205
|
})]
|
|
1187
1206
|
}),
|
|
1188
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ S("div", {
|
|
1189
1208
|
style: {
|
|
1190
1209
|
flex: "1 1 auto",
|
|
1191
1210
|
minHeight: 0,
|
|
@@ -1196,39 +1215,39 @@ var P = c(function() {
|
|
|
1196
1215
|
gap: "var(--space-controlGap)"
|
|
1197
1216
|
},
|
|
1198
1217
|
children: [
|
|
1199
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ S("div", {
|
|
1200
1219
|
style: {
|
|
1201
1220
|
display: "flex",
|
|
1202
1221
|
flexWrap: "wrap",
|
|
1203
1222
|
gap: "var(--space-iconGap)"
|
|
1204
1223
|
},
|
|
1205
1224
|
children: [
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
style:
|
|
1225
|
+
/* @__PURE__ */ S("span", {
|
|
1226
|
+
style: k,
|
|
1208
1227
|
children: [
|
|
1209
|
-
|
|
1228
|
+
N($),
|
|
1210
1229
|
" widget",
|
|
1211
|
-
|
|
1230
|
+
N($) === 1 ? "" : "s"
|
|
1212
1231
|
]
|
|
1213
1232
|
}),
|
|
1214
|
-
/* @__PURE__ */
|
|
1215
|
-
style:
|
|
1233
|
+
/* @__PURE__ */ S("span", {
|
|
1234
|
+
style: k,
|
|
1216
1235
|
children: [
|
|
1217
1236
|
$.pages.length,
|
|
1218
1237
|
" page",
|
|
1219
1238
|
$.pages.length === 1 ? "" : "s"
|
|
1220
1239
|
]
|
|
1221
1240
|
}),
|
|
1222
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ S("span", {
|
|
1223
1242
|
style: ze($.overallConfidence),
|
|
1224
1243
|
children: [Math.round($.overallConfidence * 100), "% confidence"]
|
|
1225
1244
|
})
|
|
1226
1245
|
]
|
|
1227
1246
|
}),
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
$.reasoning && /* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ x(ie, { metadata: B.processingMetadata }),
|
|
1248
|
+
$.reasoning && /* @__PURE__ */ S("details", {
|
|
1230
1249
|
"data-testid": "preview-reasoning",
|
|
1231
|
-
children: [/* @__PURE__ */
|
|
1250
|
+
children: [/* @__PURE__ */ x("summary", {
|
|
1232
1251
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1233
1252
|
style: {
|
|
1234
1253
|
cursor: "pointer",
|
|
@@ -1238,7 +1257,7 @@ var P = c(function() {
|
|
|
1238
1257
|
borderRadius: "var(--radius-button)"
|
|
1239
1258
|
},
|
|
1240
1259
|
children: c("bigconsole.insights.preview.reasoningToggle", "Why these widgets?")
|
|
1241
|
-
}), /* @__PURE__ */
|
|
1260
|
+
}), /* @__PURE__ */ x("p", {
|
|
1242
1261
|
style: {
|
|
1243
1262
|
marginTop: "var(--space-controlGap)",
|
|
1244
1263
|
fontSize: "var(--font-size-body-sm)",
|
|
@@ -1248,20 +1267,20 @@ var P = c(function() {
|
|
|
1248
1267
|
children: $.reasoning
|
|
1249
1268
|
})]
|
|
1250
1269
|
}),
|
|
1251
|
-
$.pages.map((e, t) => /* @__PURE__ */
|
|
1270
|
+
$.pages.map((e, t) => /* @__PURE__ */ S(r, {
|
|
1252
1271
|
emphasis: "muted",
|
|
1253
1272
|
padding: "compact",
|
|
1254
1273
|
headingLevel: 3,
|
|
1255
1274
|
title: e.name,
|
|
1256
|
-
meta: /* @__PURE__ */
|
|
1257
|
-
style:
|
|
1275
|
+
meta: /* @__PURE__ */ S("span", {
|
|
1276
|
+
style: k,
|
|
1258
1277
|
children: [
|
|
1259
1278
|
e.widgets.length,
|
|
1260
1279
|
" widget",
|
|
1261
1280
|
e.widgets.length === 1 ? "" : "s"
|
|
1262
1281
|
]
|
|
1263
1282
|
}),
|
|
1264
|
-
children: [/* @__PURE__ */
|
|
1283
|
+
children: [/* @__PURE__ */ S("p", {
|
|
1265
1284
|
style: {
|
|
1266
1285
|
fontSize: "var(--font-size-body-sm)",
|
|
1267
1286
|
color: "var(--color-text-secondary)",
|
|
@@ -1277,12 +1296,12 @@ var P = c(function() {
|
|
|
1277
1296
|
" ",
|
|
1278
1297
|
e.layout.toLowerCase().replaceAll("_", " ")
|
|
1279
1298
|
]
|
|
1280
|
-
}), /* @__PURE__ */
|
|
1299
|
+
}), /* @__PURE__ */ x("div", {
|
|
1281
1300
|
className: "insights-proposal-grid",
|
|
1282
1301
|
style: Ve(e.gridColumns),
|
|
1283
1302
|
children: e.widgets.map((t, n) => {
|
|
1284
1303
|
let r = Be(t.confidence);
|
|
1285
|
-
return /* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ S("div", {
|
|
1286
1305
|
className: "insights-proposal-widget",
|
|
1287
1306
|
style: {
|
|
1288
1307
|
...He(t.position, e.gridColumns),
|
|
@@ -1295,7 +1314,7 @@ var P = c(function() {
|
|
|
1295
1314
|
border: "1px solid var(--color-border-subtle)"
|
|
1296
1315
|
},
|
|
1297
1316
|
children: [
|
|
1298
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ S("div", {
|
|
1299
1318
|
style: {
|
|
1300
1319
|
display: "flex",
|
|
1301
1320
|
flexWrap: "wrap",
|
|
@@ -1303,7 +1322,7 @@ var P = c(function() {
|
|
|
1303
1322
|
gap: "var(--space-iconGap)"
|
|
1304
1323
|
},
|
|
1305
1324
|
children: [
|
|
1306
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ x("span", {
|
|
1307
1326
|
style: {
|
|
1308
1327
|
fontSize: "var(--font-size-body-sm)",
|
|
1309
1328
|
fontWeight: "var(--font-weight-medium)",
|
|
@@ -1312,7 +1331,7 @@ var P = c(function() {
|
|
|
1312
1331
|
},
|
|
1313
1332
|
children: t.title
|
|
1314
1333
|
}),
|
|
1315
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ x("span", {
|
|
1316
1335
|
style: {
|
|
1317
1336
|
fontSize: "var(--font-size-xs)",
|
|
1318
1337
|
color: "var(--color-text-muted)"
|
|
@@ -1320,7 +1339,7 @@ var P = c(function() {
|
|
|
1320
1339
|
"data-testid": "preview-widget-type",
|
|
1321
1340
|
children: t.type
|
|
1322
1341
|
}),
|
|
1323
|
-
r && /* @__PURE__ */
|
|
1342
|
+
r && /* @__PURE__ */ x("span", {
|
|
1324
1343
|
style: {
|
|
1325
1344
|
...Ue(r),
|
|
1326
1345
|
marginLeft: "auto"
|
|
@@ -1330,7 +1349,7 @@ var P = c(function() {
|
|
|
1330
1349
|
})
|
|
1331
1350
|
]
|
|
1332
1351
|
}),
|
|
1333
|
-
t.reasoning && /* @__PURE__ */
|
|
1352
|
+
t.reasoning && /* @__PURE__ */ x("p", {
|
|
1334
1353
|
style: {
|
|
1335
1354
|
margin: 0,
|
|
1336
1355
|
fontSize: "var(--font-size-xs)",
|
|
@@ -1339,7 +1358,7 @@ var P = c(function() {
|
|
|
1339
1358
|
},
|
|
1340
1359
|
children: t.reasoning
|
|
1341
1360
|
}),
|
|
1342
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ x(re, { config: t.config })
|
|
1343
1362
|
]
|
|
1344
1363
|
}, n);
|
|
1345
1364
|
})
|
|
@@ -1347,7 +1366,7 @@ var P = c(function() {
|
|
|
1347
1366
|
}, t))
|
|
1348
1367
|
]
|
|
1349
1368
|
}),
|
|
1350
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ S("div", {
|
|
1351
1370
|
style: {
|
|
1352
1371
|
display: "flex",
|
|
1353
1372
|
justifyContent: "flex-end",
|
|
@@ -1357,24 +1376,24 @@ var P = c(function() {
|
|
|
1357
1376
|
borderTop: "1px solid var(--color-border-subtle)"
|
|
1358
1377
|
},
|
|
1359
1378
|
children: [
|
|
1360
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ x("button", {
|
|
1361
1380
|
type: "button",
|
|
1362
|
-
onClick: () =>
|
|
1381
|
+
onClick: () => V(null),
|
|
1363
1382
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1364
|
-
style:
|
|
1383
|
+
style: T,
|
|
1365
1384
|
children: "Close"
|
|
1366
1385
|
}),
|
|
1367
|
-
|
|
1386
|
+
B.status === "COMPLETED" && $ && /* @__PURE__ */ S("button", {
|
|
1368
1387
|
type: "button",
|
|
1369
1388
|
onClick: () => {
|
|
1370
|
-
let e =
|
|
1371
|
-
|
|
1389
|
+
let e = B;
|
|
1390
|
+
V(null), U(e), G("");
|
|
1372
1391
|
},
|
|
1373
1392
|
title: c("bigconsole.insights.actions.refineTitle", "Refine with instructions"),
|
|
1374
1393
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1375
|
-
style:
|
|
1394
|
+
style: T,
|
|
1376
1395
|
children: [
|
|
1377
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ x(g, {
|
|
1378
1397
|
size: 14,
|
|
1379
1398
|
"aria-hidden": "true"
|
|
1380
1399
|
}),
|
|
@@ -1382,18 +1401,31 @@ var P = c(function() {
|
|
|
1382
1401
|
c("bigconsole.insights.actions.refine", "Refine")
|
|
1383
1402
|
]
|
|
1384
1403
|
}),
|
|
1385
|
-
|
|
1404
|
+
B.status === "COMPLETED" && s(B).kind === "hold" && /* @__PURE__ */ x("span", {
|
|
1405
|
+
role: "status",
|
|
1406
|
+
children: c("bigconsole.insights.error.reviewUnavailable", "Reload the proposal before creating its dashboard.")
|
|
1407
|
+
}),
|
|
1408
|
+
B.dashboardId && /* @__PURE__ */ x("button", {
|
|
1386
1409
|
type: "button",
|
|
1410
|
+
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1411
|
+
style: T,
|
|
1412
|
+
onClick: () => f(`/dashboards/${B.dashboardId}`),
|
|
1413
|
+
children: c("bigconsole.insights.actions.viewDashboard", "View dashboard")
|
|
1414
|
+
}),
|
|
1415
|
+
B.status === "COMPLETED" && !B.dashboardId && /* @__PURE__ */ S("button", {
|
|
1416
|
+
type: "button",
|
|
1417
|
+
disabled: s(B).kind !== "create",
|
|
1418
|
+
title: s(B).kind === "hold" ? "Reload the proposal before creating its dashboard." : void 0,
|
|
1387
1419
|
onClick: () => {
|
|
1388
|
-
let e =
|
|
1389
|
-
|
|
1420
|
+
let e = B;
|
|
1421
|
+
V(null), st(e);
|
|
1390
1422
|
},
|
|
1391
1423
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1392
|
-
style:
|
|
1424
|
+
style: E,
|
|
1393
1425
|
children: [
|
|
1394
1426
|
c("bigconsole.insights.actions.create", "Create dashboard"),
|
|
1395
1427
|
" ",
|
|
1396
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ x(d, {
|
|
1397
1429
|
size: 14,
|
|
1398
1430
|
"aria-hidden": "true"
|
|
1399
1431
|
})
|
|
@@ -1404,11 +1436,11 @@ var P = c(function() {
|
|
|
1404
1436
|
]
|
|
1405
1437
|
})
|
|
1406
1438
|
}),
|
|
1407
|
-
|
|
1439
|
+
H && /* @__PURE__ */ x("div", {
|
|
1408
1440
|
role: "dialog",
|
|
1409
1441
|
"aria-modal": "true",
|
|
1410
1442
|
"aria-label": c("bigconsole.insights.refine.ariaLabel", "Refine generation"),
|
|
1411
|
-
onClick: () =>
|
|
1443
|
+
onClick: () => U(null),
|
|
1412
1444
|
style: {
|
|
1413
1445
|
position: "fixed",
|
|
1414
1446
|
inset: 0,
|
|
@@ -1419,7 +1451,7 @@ var P = c(function() {
|
|
|
1419
1451
|
justifyContent: "center",
|
|
1420
1452
|
padding: "var(--space-pagePadding)"
|
|
1421
1453
|
},
|
|
1422
|
-
children: /* @__PURE__ */
|
|
1454
|
+
children: /* @__PURE__ */ S("div", {
|
|
1423
1455
|
onClick: (e) => e.stopPropagation(),
|
|
1424
1456
|
style: {
|
|
1425
1457
|
display: "flex",
|
|
@@ -1433,19 +1465,19 @@ var P = c(function() {
|
|
|
1433
1465
|
boxShadow: "var(--shadow-elevation-3)"
|
|
1434
1466
|
},
|
|
1435
1467
|
children: [
|
|
1436
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ S("div", {
|
|
1437
1469
|
style: {
|
|
1438
1470
|
padding: "var(--space-cardPadding)",
|
|
1439
1471
|
borderBottom: "1px solid var(--color-border-subtle)"
|
|
1440
1472
|
},
|
|
1441
|
-
children: [/* @__PURE__ */
|
|
1473
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
1442
1474
|
style: {
|
|
1443
1475
|
fontSize: "var(--font-size-heading-h4)",
|
|
1444
1476
|
fontWeight: "var(--font-weight-semibold)",
|
|
1445
1477
|
color: "var(--color-text-primary)"
|
|
1446
1478
|
},
|
|
1447
1479
|
children: c("bigconsole.insights.refine.heading", "Refine dashboard")
|
|
1448
|
-
}), /* @__PURE__ */
|
|
1480
|
+
}), /* @__PURE__ */ x("p", {
|
|
1449
1481
|
style: {
|
|
1450
1482
|
fontSize: "var(--font-size-body-sm)",
|
|
1451
1483
|
color: "var(--color-text-secondary)",
|
|
@@ -1454,7 +1486,7 @@ var P = c(function() {
|
|
|
1454
1486
|
children: c("bigconsole.insights.refine.subtitle", "Describe what to change — the AI keeps the existing spec and applies your instructions.")
|
|
1455
1487
|
})]
|
|
1456
1488
|
}),
|
|
1457
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ S("div", {
|
|
1458
1490
|
style: {
|
|
1459
1491
|
flex: "1 1 auto",
|
|
1460
1492
|
minHeight: 0,
|
|
@@ -1464,20 +1496,20 @@ var P = c(function() {
|
|
|
1464
1496
|
flexDirection: "column",
|
|
1465
1497
|
gap: "var(--space-controlGap)"
|
|
1466
1498
|
},
|
|
1467
|
-
children: [/* @__PURE__ */
|
|
1499
|
+
children: [/* @__PURE__ */ x(r, {
|
|
1468
1500
|
emphasis: "muted",
|
|
1469
1501
|
padding: "compact",
|
|
1470
1502
|
headingLevel: 3,
|
|
1471
|
-
title:
|
|
1472
|
-
description:
|
|
1473
|
-
icon: /* @__PURE__ */
|
|
1474
|
-
}), /* @__PURE__ */
|
|
1503
|
+
title: H.generatedSpec?.name || "Current proposal",
|
|
1504
|
+
description: H.prompt.length > 240 ? `${H.prompt.slice(0, 240)}…` : H.prompt,
|
|
1505
|
+
icon: /* @__PURE__ */ x(h, { className: "h-icon-sm w-icon-sm" })
|
|
1506
|
+
}), /* @__PURE__ */ S("div", {
|
|
1475
1507
|
style: {
|
|
1476
1508
|
display: "flex",
|
|
1477
1509
|
flexDirection: "column",
|
|
1478
1510
|
gap: "var(--space-controlGap)"
|
|
1479
1511
|
},
|
|
1480
|
-
children: [/* @__PURE__ */
|
|
1512
|
+
children: [/* @__PURE__ */ x("label", {
|
|
1481
1513
|
htmlFor: "refine-input",
|
|
1482
1514
|
style: {
|
|
1483
1515
|
display: "block",
|
|
@@ -1486,10 +1518,10 @@ var P = c(function() {
|
|
|
1486
1518
|
color: "var(--color-text-primary)"
|
|
1487
1519
|
},
|
|
1488
1520
|
children: "What should change?"
|
|
1489
|
-
}), /* @__PURE__ */
|
|
1521
|
+
}), /* @__PURE__ */ x("textarea", {
|
|
1490
1522
|
id: "refine-input",
|
|
1491
|
-
value:
|
|
1492
|
-
onChange: (e) =>
|
|
1523
|
+
value: W,
|
|
1524
|
+
onChange: (e) => G(e.target.value),
|
|
1493
1525
|
maxLength: 2e3,
|
|
1494
1526
|
rows: 4,
|
|
1495
1527
|
placeholder: c("bigconsole.insights.refine.placeholder", "e.g., Add a revenue-by-region map and remove the duplicate KPI cards"),
|
|
@@ -1508,7 +1540,7 @@ var P = c(function() {
|
|
|
1508
1540
|
})]
|
|
1509
1541
|
})]
|
|
1510
1542
|
}),
|
|
1511
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ S("div", {
|
|
1512
1544
|
style: {
|
|
1513
1545
|
display: "flex",
|
|
1514
1546
|
justifyContent: "flex-end",
|
|
@@ -1517,27 +1549,27 @@ var P = c(function() {
|
|
|
1517
1549
|
padding: "var(--space-cardPadding)",
|
|
1518
1550
|
borderTop: "1px solid var(--color-border-subtle)"
|
|
1519
1551
|
},
|
|
1520
|
-
children: [/* @__PURE__ */
|
|
1552
|
+
children: [/* @__PURE__ */ x("button", {
|
|
1521
1553
|
type: "button",
|
|
1522
|
-
onClick: () =>
|
|
1554
|
+
onClick: () => U(null),
|
|
1523
1555
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1524
|
-
style:
|
|
1556
|
+
style: T,
|
|
1525
1557
|
children: c("bigconsole.insights.actions.cancel", "Cancel")
|
|
1526
|
-
}), /* @__PURE__ */
|
|
1558
|
+
}), /* @__PURE__ */ S("button", {
|
|
1527
1559
|
type: "button",
|
|
1528
|
-
onClick: () => void
|
|
1529
|
-
disabled: !
|
|
1560
|
+
onClick: () => void dt(),
|
|
1561
|
+
disabled: !W.trim() || z.has(H.id),
|
|
1530
1562
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1531
1563
|
style: {
|
|
1532
|
-
...
|
|
1533
|
-
cursor: !
|
|
1534
|
-
opacity:
|
|
1564
|
+
...E,
|
|
1565
|
+
cursor: !W.trim() || z.has(H.id) ? "not-allowed" : "pointer",
|
|
1566
|
+
opacity: W.trim() ? 1 : .6
|
|
1535
1567
|
},
|
|
1536
|
-
children: [
|
|
1568
|
+
children: [z.has(H.id) ? /* @__PURE__ */ x(m, {
|
|
1537
1569
|
size: 14,
|
|
1538
1570
|
className: "animate-spin",
|
|
1539
1571
|
"aria-hidden": "true"
|
|
1540
|
-
}) : /* @__PURE__ */
|
|
1572
|
+
}) : /* @__PURE__ */ x(g, {
|
|
1541
1573
|
size: 14,
|
|
1542
1574
|
"aria-hidden": "true"
|
|
1543
1575
|
}), c("bigconsole.insights.refine.apply", "Apply refinement")]
|
|
@@ -1550,4 +1582,4 @@ var P = c(function() {
|
|
|
1550
1582
|
});
|
|
1551
1583
|
});
|
|
1552
1584
|
//#endregion
|
|
1553
|
-
export {
|
|
1585
|
+
export { F as InsightsPage, F as default };
|