@burdenoff/microfe-vibecontrols 2026.709.2 → 2026.710.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.
- package/dist/components/agent-manager/AgentManagerBookmarksDrawer.js +87 -85
- package/dist/components/agent-manager/AgentManagerBookmarksDrawer.js.map +1 -1
- package/dist/components/ai/InstructionFilesManager.js +138 -136
- package/dist/components/ai/InstructionFilesManager.js.map +1 -1
- package/dist/components/ai/PluginHarnessPicker.js +70 -64
- package/dist/components/ai/PluginHarnessPicker.js.map +1 -1
- package/dist/components/docs/DocsEditPanel.js +1 -1
- package/dist/components/docs/DocsEditPanel.js.map +1 -1
- package/dist/components/docs/DocsPageTree.js +1 -1
- package/dist/components/docs/DocsPageTree.js.map +1 -1
- package/dist/components/docs/DocsTabPanel.js +108 -106
- package/dist/components/docs/DocsTabPanel.js.map +1 -1
- package/dist/components/notes/NotesTabPanel.js +99 -99
- package/dist/components/notes/NotesTabPanel.js.map +1 -1
- package/dist/components/scorecard/ScorecardPanel.js +309 -308
- package/dist/components/scorecard/ScorecardPanel.js.map +1 -1
- package/dist/components/sessions/SessionPublicLinkPanel.js +104 -102
- package/dist/components/sessions/SessionPublicLinkPanel.js.map +1 -1
- package/dist/components/settings/AdvancedSection.js +92 -90
- package/dist/components/settings/AdvancedSection.js.map +1 -1
- package/dist/components/vibedeck/VibeDeckPublicLinkPanel.js +104 -102
- package/dist/components/vibedeck/VibeDeckPublicLinkPanel.js.map +1 -1
- package/dist/constants/permissions.js +7 -0
- package/dist/constants/permissions.js.map +1 -1
- package/dist/pages/ActionsPage.js +303 -303
- package/dist/pages/ActionsPage.js.map +1 -1
- package/dist/pages/AgentDetailsPage.js +520 -516
- package/dist/pages/AgentDetailsPage.js.map +1 -1
- package/dist/pages/AgentsPage.js +287 -283
- package/dist/pages/AgentsPage.js.map +1 -1
- package/dist/pages/TargetsPage.js +554 -549
- package/dist/pages/TargetsPage.js.map +1 -1
- package/dist/pages/VibeAuditPage.js +2 -2
- package/dist/pages/VibeAuditPage.js.map +1 -1
- package/dist/pages/VibeDeckPage.js +257 -257
- package/dist/pages/VibeDeckPage.js.map +1 -1
- package/dist/pages/VibeDetailsPage.js +688 -693
- package/dist/pages/VibeDetailsPage.js.map +1 -1
- package/dist/pages/VibesPage.js +49 -41
- package/dist/pages/VibesPage.js.map +1 -1
- package/dist/pages/WebhooksPage.js +162 -138
- package/dist/pages/WebhooksPage.js.map +1 -1
- package/dist/pages/tunnels/DomainsTab.js +54 -47
- package/dist/pages/tunnels/DomainsTab.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,21 +4,22 @@ import { ErrorState as s } from "../shared/ErrorState.js";
|
|
|
4
4
|
import { ScorecardTier as c } from "../../generated/wspace-types.js";
|
|
5
5
|
import { Card as l } from "../shared/Card.js";
|
|
6
6
|
import "../shared/index.js";
|
|
7
|
+
import { VIBE_PERMISSIONS as u } from "../../constants/permissions.js";
|
|
7
8
|
import { EntityShareButton as ee } from "../sharing/EntityShareButton.js";
|
|
8
9
|
import "../sharing/index.js";
|
|
9
|
-
import { DIRECTION_OPTIONS as
|
|
10
|
-
import { ScorecardEmptyState as
|
|
11
|
-
import { ScorecardsOverviewPanel as
|
|
12
|
-
import { MetricTrend as
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { Info as
|
|
16
|
-
import { useActiveContext as
|
|
17
|
-
import { AnimatePresence as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import { MotionItem as
|
|
10
|
+
import { DIRECTION_OPTIONS as te, METRIC_TYPE_OPTIONS as ne, STATUS_OPTIONS as re, deriveStatus as ie, statusConfig as d } from "./scorecardConstants.js";
|
|
11
|
+
import { ScorecardEmptyState as ae } from "./ScorecardEmptyState.js";
|
|
12
|
+
import { ScorecardsOverviewPanel as oe } from "./ScorecardsOverviewPanel.js";
|
|
13
|
+
import { MetricTrend as se } from "./MetricTrend.js";
|
|
14
|
+
import { useCallback as f, useEffect as ce, useState as p } from "react";
|
|
15
|
+
import { useI18n as le } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
|
+
import { Info as ue, Pencil as de, Plus as fe, RefreshCw as pe, ShieldCheck as m, Trash2 as me, TrendingUp as he } from "lucide-react";
|
|
17
|
+
import { useActiveContext as ge, usePermissions as _e } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
18
|
+
import { AnimatePresence as h, motion as g } from "framer-motion";
|
|
19
|
+
import { Fragment as ve, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
20
|
+
import { MotionItem as ye, MotionList as be } from "@burdenoff/fe-libs/shared/motion";
|
|
20
21
|
//#region src/components/scorecard/ScorecardPanel.tsx
|
|
21
|
-
var
|
|
22
|
+
var y = {
|
|
22
23
|
name: "",
|
|
23
24
|
description: "",
|
|
24
25
|
type: "CUSTOM",
|
|
@@ -31,27 +32,27 @@ var b = {
|
|
|
31
32
|
remediation: "",
|
|
32
33
|
iframeUrl: "",
|
|
33
34
|
iframeHeight: ""
|
|
34
|
-
},
|
|
35
|
-
let { t:
|
|
36
|
-
let n =
|
|
35
|
+
}, b = "w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary outline-none focus:border-action-primary-bg", x = ({ ownerType: c, ownerId: m, onAddMetric: x }) => {
|
|
36
|
+
let { t: S } = le(), C = f((e, t) => {
|
|
37
|
+
let n = S(e);
|
|
37
38
|
return n === e ? t : n;
|
|
38
|
-
}, [
|
|
39
|
+
}, [S]), { workspaceId: Se } = ge(), { hasPermission: w, permissions: T } = _e(), E = (Array.isArray(T) ? T : T?.permissionStrings)?.some?.((e) => e.startsWith("scorecard:")), Ce = E ? w(u.SCORECARD_CREATE) : !0, we = E ? w(u.SCORECARD_UPDATE) : !0, Te = E ? w(u.SCORECARD_DELETE) : !0, [Ee, D] = p(null), [De, O] = p(!1), [k, A] = p(null), [j, M] = p(null), [N, P] = p(null), [F, I] = p(y), [L, R] = p(null), [Oe, z] = p(null), { data: ke, loading: Ae, error: B, refetch: V } = n({
|
|
39
40
|
variables: {
|
|
40
41
|
ownerType: c,
|
|
41
|
-
ownerId:
|
|
42
|
+
ownerId: m
|
|
42
43
|
},
|
|
43
|
-
skip: !
|
|
44
|
+
skip: !m,
|
|
44
45
|
fetchPolicy: "cache-and-network"
|
|
45
|
-
}), [
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
if (
|
|
49
|
-
|
|
46
|
+
}), [je, { loading: Me }] = a(), [Ne, { loading: Pe }] = e(), [Fe, { loading: Ie }] = i(), [Le, { loading: H }] = r(), [Re] = t(), U = ke?.vibecontrolsScorecard ?? null, W = Me || Pe || Ie, G = k !== null, K = () => {
|
|
47
|
+
I(y), R(null), A(null);
|
|
48
|
+
}, q = () => {
|
|
49
|
+
if (x) {
|
|
50
|
+
x();
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
e.stopPropagation(),
|
|
53
|
+
K(), O(!0);
|
|
54
|
+
}, ze = (e, t) => {
|
|
55
|
+
e.stopPropagation(), I({
|
|
55
56
|
name: t.name,
|
|
56
57
|
description: t.description ?? "",
|
|
57
58
|
type: t.type,
|
|
@@ -64,103 +65,103 @@ var b = {
|
|
|
64
65
|
remediation: t.remediation ?? "",
|
|
65
66
|
iframeUrl: t.iframeUrl ?? "",
|
|
66
67
|
iframeHeight: t.iframeHeight !== null && t.iframeHeight !== void 0 ? String(t.iframeHeight) : ""
|
|
67
|
-
}),
|
|
68
|
-
},
|
|
69
|
-
e.stopPropagation(),
|
|
68
|
+
}), R(null), A(t.id), O(!0);
|
|
69
|
+
}, Be = (e, t) => {
|
|
70
|
+
e.stopPropagation(), P(null), M({
|
|
70
71
|
id: t.id,
|
|
71
72
|
name: t.name
|
|
72
73
|
});
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
if (!
|
|
74
|
+
}, J = () => {
|
|
75
|
+
W || (O(!1), K());
|
|
76
|
+
}, Y = f(() => {
|
|
77
|
+
H || (M(null), P(null));
|
|
78
|
+
}, [H]);
|
|
79
|
+
ce(() => {
|
|
80
|
+
if (!j) return;
|
|
80
81
|
let e = (e) => {
|
|
81
|
-
e.key === "Escape" &&
|
|
82
|
+
e.key === "Escape" && Y();
|
|
82
83
|
};
|
|
83
84
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
84
|
-
}, [
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
87
|
-
|
|
85
|
+
}, [j, Y]);
|
|
86
|
+
let Ve = async () => {
|
|
87
|
+
if (j) {
|
|
88
|
+
P(null);
|
|
88
89
|
try {
|
|
89
|
-
await
|
|
90
|
+
await Le({ variables: { id: j.id } }), await V(), M(null);
|
|
90
91
|
} catch (e) {
|
|
91
|
-
|
|
92
|
+
P(e instanceof Error ? e.message : "Failed to remove metric");
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
},
|
|
95
|
-
|
|
95
|
+
}, X = (e, t) => {
|
|
96
|
+
I((n) => ({
|
|
96
97
|
...n,
|
|
97
98
|
[e]: t
|
|
98
99
|
}));
|
|
99
|
-
},
|
|
100
|
+
}, Z = (e, t) => {
|
|
100
101
|
let n = e.trim();
|
|
101
102
|
if (!n) return;
|
|
102
103
|
let r = Number(n);
|
|
103
104
|
if (!Number.isFinite(r)) throw Error(`${t} must be a valid number`);
|
|
104
105
|
return r;
|
|
105
|
-
},
|
|
106
|
-
if (
|
|
107
|
-
let e = (await
|
|
106
|
+
}, He = async () => {
|
|
107
|
+
if (U?.id) return U.id;
|
|
108
|
+
let e = (await je({ variables: { input: {
|
|
108
109
|
ownerType: c,
|
|
109
|
-
ownerId:
|
|
110
|
+
ownerId: m
|
|
110
111
|
} } })).data?.upsertVibecontrolsScorecard.id;
|
|
111
|
-
if (!e) throw Error(
|
|
112
|
+
if (!e) throw Error(C("scorecard.scorecardCreateFailed", "Unable to create scorecard"));
|
|
112
113
|
return e;
|
|
113
|
-
},
|
|
114
|
-
|
|
114
|
+
}, Ue = async (e) => {
|
|
115
|
+
z(e);
|
|
115
116
|
try {
|
|
116
|
-
await
|
|
117
|
+
await Re({ variables: {
|
|
117
118
|
templateId: e,
|
|
118
119
|
ownerType: c,
|
|
119
|
-
ownerId:
|
|
120
|
-
} }), await
|
|
120
|
+
ownerId: m
|
|
121
|
+
} }), await V();
|
|
121
122
|
} finally {
|
|
122
|
-
|
|
123
|
+
z(null);
|
|
123
124
|
}
|
|
124
|
-
},
|
|
125
|
-
e.preventDefault(),
|
|
126
|
-
let t =
|
|
125
|
+
}, We = async (e) => {
|
|
126
|
+
e.preventDefault(), R(null);
|
|
127
|
+
let t = F.name.trim();
|
|
127
128
|
if (!t) {
|
|
128
|
-
|
|
129
|
+
R(C("scorecard.metricNameRequired", "Metric name is required"));
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
let n =
|
|
132
|
+
let n = F.statusMode === "AUTO" ? void 0 : F.statusMode;
|
|
132
133
|
try {
|
|
133
134
|
let e = {
|
|
134
135
|
name: t,
|
|
135
|
-
description:
|
|
136
|
-
type:
|
|
137
|
-
value:
|
|
138
|
-
threshold:
|
|
139
|
-
unit:
|
|
140
|
-
direction:
|
|
141
|
-
weight:
|
|
136
|
+
description: F.description.trim() || null,
|
|
137
|
+
type: F.type,
|
|
138
|
+
value: Z(F.value, C("scorecard.value", "Value")) ?? null,
|
|
139
|
+
threshold: Z(F.threshold, C("scorecard.threshold", "Threshold")) ?? null,
|
|
140
|
+
unit: F.unit.trim() || null,
|
|
141
|
+
direction: F.direction,
|
|
142
|
+
weight: Z(F.weight, C("scorecard.weight", "Weight")) ?? 1,
|
|
142
143
|
status: n ?? null,
|
|
143
|
-
remediation:
|
|
144
|
-
iframeUrl:
|
|
145
|
-
iframeHeight:
|
|
144
|
+
remediation: F.remediation.trim() || null,
|
|
145
|
+
iframeUrl: F.iframeUrl.trim() || null,
|
|
146
|
+
iframeHeight: Z(F.iframeHeight, C("scorecard.iframeHeight", "Iframe height")) ?? null
|
|
146
147
|
};
|
|
147
|
-
|
|
148
|
-
id:
|
|
148
|
+
k ? await Fe({ variables: {
|
|
149
|
+
id: k,
|
|
149
150
|
input: e
|
|
150
|
-
} }) : await
|
|
151
|
-
scorecardId: await
|
|
151
|
+
} }) : await Ne({ variables: {
|
|
152
|
+
scorecardId: await He(),
|
|
152
153
|
input: e
|
|
153
|
-
} }), await
|
|
154
|
+
} }), await V(), O(!1), K();
|
|
154
155
|
} catch (e) {
|
|
155
|
-
|
|
156
|
+
R(e instanceof Error ? e.message : k ? "Failed to update metric" : "Failed to add metric");
|
|
156
157
|
}
|
|
157
|
-
},
|
|
158
|
+
}, Ge = F.statusMode === "AUTO" ? ie(F.value.trim() ? Number(F.value) : null, F.threshold.trim() ? Number(F.threshold) : null, F.direction) : F.statusMode, Q = () => /* @__PURE__ */ _(h, { children: j && /* @__PURE__ */ _(g.div, {
|
|
158
159
|
initial: { opacity: 0 },
|
|
159
160
|
animate: { opacity: 1 },
|
|
160
161
|
exit: { opacity: 0 },
|
|
161
162
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay p-4",
|
|
162
|
-
onClick:
|
|
163
|
-
children: /* @__PURE__ */
|
|
163
|
+
onClick: Y,
|
|
164
|
+
children: /* @__PURE__ */ v(g.div, {
|
|
164
165
|
initial: {
|
|
165
166
|
scale: .96,
|
|
166
167
|
y: 12
|
|
@@ -179,54 +180,54 @@ var b = {
|
|
|
179
180
|
"aria-modal": "true",
|
|
180
181
|
"aria-labelledby": "scorecard-delete-title",
|
|
181
182
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ v("div", {
|
|
183
184
|
className: "border-b border-border-default px-5 py-4",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ _("h3", {
|
|
185
186
|
id: "scorecard-delete-title",
|
|
186
187
|
className: "text-lg font-semibold text-text-primary",
|
|
187
|
-
children:
|
|
188
|
-
}), /* @__PURE__ */
|
|
188
|
+
children: C("scorecard.removeMetricTitle", "Remove metric")
|
|
189
|
+
}), /* @__PURE__ */ _("p", {
|
|
189
190
|
className: "mt-1 text-sm text-text-secondary",
|
|
190
|
-
children:
|
|
191
|
+
children: C("scorecard.removeMetricConfirm", "Are you sure you want to remove this metric? This cannot be undone.")
|
|
191
192
|
})]
|
|
192
193
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ v("div", {
|
|
194
195
|
className: "px-5 py-4 text-sm text-text-primary",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ _("p", {
|
|
196
197
|
className: "font-medium",
|
|
197
|
-
children:
|
|
198
|
-
}),
|
|
198
|
+
children: j.name
|
|
199
|
+
}), N && /* @__PURE__ */ _("p", {
|
|
199
200
|
className: "mt-3 rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
200
|
-
children:
|
|
201
|
+
children: N
|
|
201
202
|
})]
|
|
202
203
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ v("div", {
|
|
204
205
|
className: "flex items-center justify-end gap-3 border-t border-border-default px-5 py-4",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ _("button", {
|
|
206
207
|
type: "button",
|
|
207
|
-
onClick:
|
|
208
|
-
disabled:
|
|
208
|
+
onClick: Y,
|
|
209
|
+
disabled: H,
|
|
209
210
|
className: "rounded-md border border-border-default px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60",
|
|
210
|
-
children:
|
|
211
|
-
}), /* @__PURE__ */
|
|
211
|
+
children: C("common.cancel", "Cancel")
|
|
212
|
+
}), /* @__PURE__ */ _("button", {
|
|
212
213
|
type: "button",
|
|
213
|
-
onClick:
|
|
214
|
-
disabled:
|
|
214
|
+
onClick: Ve,
|
|
215
|
+
disabled: H,
|
|
215
216
|
className: "rounded-md bg-status-error-bg px-4 py-2 text-sm text-status-error-text hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",
|
|
216
|
-
children:
|
|
217
|
+
children: H ? C("scorecard.removingMetric", "Removing...") : C("scorecard.removeMetric", "Remove metric")
|
|
217
218
|
})]
|
|
218
219
|
})
|
|
219
220
|
]
|
|
220
221
|
})
|
|
221
|
-
}) }),
|
|
222
|
-
let e = d[
|
|
223
|
-
return /* @__PURE__ */
|
|
222
|
+
}) }), Ke = () => {
|
|
223
|
+
let e = d[Ge] ?? d.UNKNOWN;
|
|
224
|
+
return /* @__PURE__ */ _(h, { children: De && /* @__PURE__ */ _(g.div, {
|
|
224
225
|
initial: { opacity: 0 },
|
|
225
226
|
animate: { opacity: 1 },
|
|
226
227
|
exit: { opacity: 0 },
|
|
227
228
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay p-4",
|
|
228
|
-
onClick:
|
|
229
|
-
children: /* @__PURE__ */
|
|
229
|
+
onClick: J,
|
|
230
|
+
children: /* @__PURE__ */ _(g.div, {
|
|
230
231
|
initial: {
|
|
231
232
|
scale: .96,
|
|
232
233
|
y: 12
|
|
@@ -241,226 +242,226 @@ var b = {
|
|
|
241
242
|
},
|
|
242
243
|
className: "w-full max-w-2xl rounded-xl border border-border-default bg-bg-surface shadow-xl",
|
|
243
244
|
onClick: (e) => e.stopPropagation(),
|
|
244
|
-
children: /* @__PURE__ */
|
|
245
|
-
onSubmit:
|
|
245
|
+
children: /* @__PURE__ */ v("form", {
|
|
246
|
+
onSubmit: We,
|
|
246
247
|
className: "flex max-h-[85vh] flex-col",
|
|
247
248
|
children: [
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ v("div", {
|
|
249
250
|
className: "border-b border-border-default px-5 py-4",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ _("h3", {
|
|
251
252
|
className: "text-lg font-semibold text-text-primary",
|
|
252
|
-
children:
|
|
253
|
-
}), /* @__PURE__ */
|
|
253
|
+
children: G ? C("scorecard.editMetricTitle", "Edit scorecard metric") : C("scorecard.addMetricTitle", "Add scorecard metric")
|
|
254
|
+
}), /* @__PURE__ */ _("p", {
|
|
254
255
|
className: "mt-1 text-sm text-text-secondary",
|
|
255
|
-
children:
|
|
256
|
+
children: C("scorecard.addMetricDescription", "Define a metric. Status is derived from value vs threshold unless you pin it.")
|
|
256
257
|
})]
|
|
257
258
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ v("div", {
|
|
259
260
|
className: "space-y-4 overflow-y-auto px-5 py-4",
|
|
260
261
|
children: [
|
|
261
|
-
|
|
262
|
+
L && /* @__PURE__ */ _("div", {
|
|
262
263
|
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
263
|
-
children:
|
|
264
|
+
children: L
|
|
264
265
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ v("label", {
|
|
266
267
|
className: "block space-y-1.5",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ _("span", {
|
|
268
269
|
className: "text-sm font-medium text-text-primary",
|
|
269
|
-
children:
|
|
270
|
-
}), /* @__PURE__ */
|
|
270
|
+
children: C("scorecard.metricName", "Metric name")
|
|
271
|
+
}), /* @__PURE__ */ _("input", {
|
|
271
272
|
"aria-label": "control",
|
|
272
|
-
value:
|
|
273
|
-
onChange: (e) =>
|
|
274
|
-
className:
|
|
275
|
-
placeholder:
|
|
273
|
+
value: F.name,
|
|
274
|
+
onChange: (e) => X("name", e.target.value),
|
|
275
|
+
className: b,
|
|
276
|
+
placeholder: C("scorecard.metricNamePlaceholder", "Test coverage")
|
|
276
277
|
})]
|
|
277
278
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ v("label", {
|
|
279
280
|
className: "block space-y-1.5",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ _("span", {
|
|
281
282
|
className: "text-sm font-medium text-text-primary",
|
|
282
|
-
children:
|
|
283
|
-
}), /* @__PURE__ */
|
|
283
|
+
children: C("scorecard.metricDescription", "Description")
|
|
284
|
+
}), /* @__PURE__ */ _("textarea", {
|
|
284
285
|
"aria-label": "control",
|
|
285
|
-
value:
|
|
286
|
-
onChange: (e) =>
|
|
287
|
-
className: `min-h-16 ${
|
|
288
|
-
placeholder:
|
|
286
|
+
value: F.description,
|
|
287
|
+
onChange: (e) => X("description", e.target.value),
|
|
288
|
+
className: `min-h-16 ${b}`,
|
|
289
|
+
placeholder: C("scorecard.metricDescriptionPlaceholder", "Explain what this metric measures")
|
|
289
290
|
})]
|
|
290
291
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ v("div", {
|
|
292
293
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
293
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ v("label", {
|
|
294
295
|
className: "block space-y-1.5",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ _("span", {
|
|
296
297
|
className: "text-sm font-medium text-text-primary",
|
|
297
|
-
children:
|
|
298
|
-
}), /* @__PURE__ */
|
|
299
|
-
value:
|
|
300
|
-
onChange: (e) =>
|
|
301
|
-
className:
|
|
302
|
-
children:
|
|
298
|
+
children: C("scorecard.metricType", "Type")
|
|
299
|
+
}), /* @__PURE__ */ _("select", {
|
|
300
|
+
value: F.type,
|
|
301
|
+
onChange: (e) => X("type", e.target.value),
|
|
302
|
+
className: b,
|
|
303
|
+
children: ne.map((e) => /* @__PURE__ */ _("option", {
|
|
303
304
|
value: e.value,
|
|
304
305
|
children: e.label
|
|
305
306
|
}, e.value))
|
|
306
307
|
})]
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
+
}), /* @__PURE__ */ v("label", {
|
|
308
309
|
className: "block space-y-1.5",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ _("span", {
|
|
310
311
|
className: "text-sm font-medium text-text-primary",
|
|
311
|
-
children:
|
|
312
|
-
}), /* @__PURE__ */
|
|
313
|
-
value:
|
|
314
|
-
onChange: (e) =>
|
|
315
|
-
className:
|
|
316
|
-
children:
|
|
312
|
+
children: C("scorecard.metricDirection", "Direction")
|
|
313
|
+
}), /* @__PURE__ */ _("select", {
|
|
314
|
+
value: F.direction,
|
|
315
|
+
onChange: (e) => X("direction", e.target.value),
|
|
316
|
+
className: b,
|
|
317
|
+
children: te.map((e) => /* @__PURE__ */ _("option", {
|
|
317
318
|
value: e.value,
|
|
318
319
|
children: e.label
|
|
319
320
|
}, e.value))
|
|
320
321
|
})]
|
|
321
322
|
})]
|
|
322
323
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ v("div", {
|
|
324
325
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
325
326
|
children: [
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ v("label", {
|
|
327
328
|
className: "block space-y-1.5",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ _("span", {
|
|
329
330
|
className: "text-sm font-medium text-text-primary",
|
|
330
|
-
children:
|
|
331
|
-
}), /* @__PURE__ */
|
|
331
|
+
children: C("scorecard.value", "Value")
|
|
332
|
+
}), /* @__PURE__ */ _("input", {
|
|
332
333
|
"aria-label": "value",
|
|
333
|
-
value:
|
|
334
|
-
onChange: (e) =>
|
|
334
|
+
value: F.value,
|
|
335
|
+
onChange: (e) => X("value", e.target.value),
|
|
335
336
|
inputMode: "decimal",
|
|
336
|
-
className:
|
|
337
|
+
className: b,
|
|
337
338
|
placeholder: "86"
|
|
338
339
|
})]
|
|
339
340
|
}),
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ v("label", {
|
|
341
342
|
className: "block space-y-1.5",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ _("span", {
|
|
343
344
|
className: "text-sm font-medium text-text-primary",
|
|
344
|
-
children:
|
|
345
|
-
}), /* @__PURE__ */
|
|
345
|
+
children: C("scorecard.threshold", "Threshold")
|
|
346
|
+
}), /* @__PURE__ */ _("input", {
|
|
346
347
|
"aria-label": "threshold",
|
|
347
|
-
value:
|
|
348
|
-
onChange: (e) =>
|
|
348
|
+
value: F.threshold,
|
|
349
|
+
onChange: (e) => X("threshold", e.target.value),
|
|
349
350
|
inputMode: "decimal",
|
|
350
|
-
className:
|
|
351
|
+
className: b,
|
|
351
352
|
placeholder: "80"
|
|
352
353
|
})]
|
|
353
354
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ v("label", {
|
|
355
356
|
className: "block space-y-1.5",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ _("span", {
|
|
357
358
|
className: "text-sm font-medium text-text-primary",
|
|
358
|
-
children:
|
|
359
|
-
}), /* @__PURE__ */
|
|
359
|
+
children: C("scorecard.unit", "Unit")
|
|
360
|
+
}), /* @__PURE__ */ _("input", {
|
|
360
361
|
"aria-label": "unit",
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
363
|
-
className:
|
|
362
|
+
value: F.unit,
|
|
363
|
+
onChange: (e) => X("unit", e.target.value),
|
|
364
|
+
className: b,
|
|
364
365
|
placeholder: "%"
|
|
365
366
|
})]
|
|
366
367
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ v("label", {
|
|
368
369
|
className: "block space-y-1.5",
|
|
369
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ _("span", {
|
|
370
371
|
className: "text-sm font-medium text-text-primary",
|
|
371
|
-
children:
|
|
372
|
-
}), /* @__PURE__ */
|
|
372
|
+
children: C("scorecard.weight", "Weight")
|
|
373
|
+
}), /* @__PURE__ */ _("input", {
|
|
373
374
|
"aria-label": "weight",
|
|
374
|
-
value:
|
|
375
|
-
onChange: (e) =>
|
|
375
|
+
value: F.weight,
|
|
376
|
+
onChange: (e) => X("weight", e.target.value),
|
|
376
377
|
inputMode: "decimal",
|
|
377
|
-
className:
|
|
378
|
+
className: b,
|
|
378
379
|
placeholder: "1"
|
|
379
380
|
})]
|
|
380
381
|
})
|
|
381
382
|
]
|
|
382
383
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ v("div", {
|
|
384
385
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ v("label", {
|
|
386
387
|
className: "block space-y-1.5",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
388
|
+
children: [/* @__PURE__ */ _("span", {
|
|
388
389
|
className: "text-sm font-medium text-text-primary",
|
|
389
|
-
children:
|
|
390
|
-
}), /* @__PURE__ */
|
|
391
|
-
value:
|
|
392
|
-
onChange: (e) =>
|
|
393
|
-
className:
|
|
394
|
-
children:
|
|
390
|
+
children: C("scorecard.metricStatus", "Status")
|
|
391
|
+
}), /* @__PURE__ */ _("select", {
|
|
392
|
+
value: F.statusMode,
|
|
393
|
+
onChange: (e) => X("statusMode", e.target.value),
|
|
394
|
+
className: b,
|
|
395
|
+
children: re.map((e) => /* @__PURE__ */ _("option", {
|
|
395
396
|
value: e.value,
|
|
396
397
|
children: e.label
|
|
397
398
|
}, e.value))
|
|
398
399
|
})]
|
|
399
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ _("div", {
|
|
400
401
|
className: "flex items-end",
|
|
401
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ v("div", {
|
|
402
403
|
className: `flex items-center gap-2 rounded-md px-3 py-2 text-sm ${e.bg} ${e.text}`,
|
|
403
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ _(e.icon, { className: "size-4" }), /* @__PURE__ */ v("span", { children: [F.statusMode === "AUTO" ? "Derived: " : "Pinned: ", e.label] })]
|
|
404
405
|
})
|
|
405
406
|
})]
|
|
406
407
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ v("label", {
|
|
408
409
|
className: "block space-y-1.5",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ _("span", {
|
|
410
411
|
className: "text-sm font-medium text-text-primary",
|
|
411
|
-
children:
|
|
412
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: C("scorecard.remediation", "Remediation guidance")
|
|
413
|
+
}), /* @__PURE__ */ _("textarea", {
|
|
413
414
|
"aria-label": "control",
|
|
414
|
-
value:
|
|
415
|
-
onChange: (e) =>
|
|
416
|
-
className: `min-h-16 ${
|
|
417
|
-
placeholder:
|
|
415
|
+
value: F.remediation,
|
|
416
|
+
onChange: (e) => X("remediation", e.target.value),
|
|
417
|
+
className: `min-h-16 ${b}`,
|
|
418
|
+
placeholder: C("scorecard.remediationPlaceholder", "What should someone do when this metric is failing?")
|
|
418
419
|
})]
|
|
419
420
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ v("div", {
|
|
421
422
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-[1fr_10rem]",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ v("label", {
|
|
423
424
|
className: "block space-y-1.5",
|
|
424
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ _("span", {
|
|
425
426
|
className: "text-sm font-medium text-text-primary",
|
|
426
|
-
children:
|
|
427
|
-
}), /* @__PURE__ */
|
|
427
|
+
children: C("scorecard.iframeUrl", "Embed URL")
|
|
428
|
+
}), /* @__PURE__ */ _("input", {
|
|
428
429
|
"aria-label": "control",
|
|
429
|
-
value:
|
|
430
|
-
onChange: (e) =>
|
|
431
|
-
className:
|
|
432
|
-
placeholder:
|
|
430
|
+
value: F.iframeUrl,
|
|
431
|
+
onChange: (e) => X("iframeUrl", e.target.value),
|
|
432
|
+
className: b,
|
|
433
|
+
placeholder: C("scorecard.iframeUrlPlaceholder", "Optional dashboard URL")
|
|
433
434
|
})]
|
|
434
|
-
}), /* @__PURE__ */
|
|
435
|
+
}), /* @__PURE__ */ v("label", {
|
|
435
436
|
className: "block space-y-1.5",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
437
|
+
children: [/* @__PURE__ */ _("span", {
|
|
437
438
|
className: "text-sm font-medium text-text-primary",
|
|
438
|
-
children:
|
|
439
|
-
}), /* @__PURE__ */
|
|
439
|
+
children: C("scorecard.iframeHeight", "Iframe height")
|
|
440
|
+
}), /* @__PURE__ */ _("input", {
|
|
440
441
|
"aria-label": "iframe height",
|
|
441
|
-
value:
|
|
442
|
-
onChange: (e) =>
|
|
442
|
+
value: F.iframeHeight,
|
|
443
|
+
onChange: (e) => X("iframeHeight", e.target.value),
|
|
443
444
|
inputMode: "numeric",
|
|
444
|
-
className:
|
|
445
|
+
className: b,
|
|
445
446
|
placeholder: "320"
|
|
446
447
|
})]
|
|
447
448
|
})]
|
|
448
449
|
})
|
|
449
450
|
]
|
|
450
451
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ v("div", {
|
|
452
453
|
className: "flex items-center justify-end gap-3 border-t border-border-default px-5 py-4",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ _("button", {
|
|
454
455
|
type: "button",
|
|
455
|
-
onClick:
|
|
456
|
-
disabled:
|
|
456
|
+
onClick: J,
|
|
457
|
+
disabled: W,
|
|
457
458
|
className: "rounded-md border border-border-default px-4 py-2 text-sm text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60",
|
|
458
|
-
children:
|
|
459
|
-
}), /* @__PURE__ */
|
|
459
|
+
children: C("common.cancel", "Cancel")
|
|
460
|
+
}), /* @__PURE__ */ _("button", {
|
|
460
461
|
type: "submit",
|
|
461
|
-
disabled:
|
|
462
|
+
disabled: W,
|
|
462
463
|
className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm text-action-primary-text hover:bg-action-primary-bg-hover disabled:cursor-not-allowed disabled:opacity-60",
|
|
463
|
-
children:
|
|
464
|
+
children: W ? C("scorecard.savingMetric", "Saving...") : G ? C("scorecard.updateMetric", "Update Metric") : C("scorecard.saveMetric", "Save Metric")
|
|
464
465
|
})]
|
|
465
466
|
})
|
|
466
467
|
]
|
|
@@ -468,146 +469,146 @@ var b = {
|
|
|
468
469
|
})
|
|
469
470
|
}) });
|
|
470
471
|
};
|
|
471
|
-
if (
|
|
472
|
-
if (
|
|
473
|
-
title:
|
|
474
|
-
message:
|
|
475
|
-
onRetry: () =>
|
|
472
|
+
if (Ae && !U) return /* @__PURE__ */ _(o, { message: C("scorecard.loading", "Loading scorecard...") });
|
|
473
|
+
if (B && !U) return /* @__PURE__ */ _(s, {
|
|
474
|
+
title: C("scorecard.failedLoad", "Failed to load scorecard"),
|
|
475
|
+
message: B.message,
|
|
476
|
+
onRetry: () => V()
|
|
476
477
|
});
|
|
477
|
-
if (!
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
if (!U || U.metrics.length === 0) return /* @__PURE__ */ v(ve, { children: [
|
|
479
|
+
/* @__PURE__ */ _(ae, {
|
|
479
480
|
ownerType: c,
|
|
480
|
-
ownerId:
|
|
481
|
-
workspaceId:
|
|
482
|
-
applyingTemplateId:
|
|
483
|
-
onApplyTemplate:
|
|
484
|
-
onAddManual:
|
|
481
|
+
ownerId: m,
|
|
482
|
+
workspaceId: Se,
|
|
483
|
+
applyingTemplateId: Oe,
|
|
484
|
+
onApplyTemplate: Ue,
|
|
485
|
+
onAddManual: q
|
|
485
486
|
}),
|
|
486
|
-
|
|
487
|
-
|
|
487
|
+
Ke(),
|
|
488
|
+
Q()
|
|
488
489
|
] });
|
|
489
|
-
let
|
|
490
|
-
return /* @__PURE__ */
|
|
490
|
+
let $ = U.overallScore ?? 0, qe = $ >= 80 ? "text-status-success-text" : $ >= 50 ? "text-status-warning-text" : "text-status-error-text";
|
|
491
|
+
return /* @__PURE__ */ v("div", {
|
|
491
492
|
className: "space-y-6",
|
|
492
493
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ _(l, {
|
|
494
495
|
padding: "lg",
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ v("div", {
|
|
496
497
|
className: "flex items-center justify-between",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("p", {
|
|
498
499
|
className: "flex items-center gap-1.5 text-sm font-medium text-text-secondary",
|
|
499
|
-
children: [
|
|
500
|
+
children: [C("scorecard.overallScore", "Overall Score"), /* @__PURE__ */ _("span", {
|
|
500
501
|
title: "Weighted average of each metric's score (0–100). Status is derived from value vs threshold.",
|
|
501
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ _(ue, { className: "size-3.5 text-text-muted" })
|
|
502
503
|
})]
|
|
503
|
-
}), /* @__PURE__ */
|
|
504
|
-
className: `text-4xl font-bold ${
|
|
505
|
-
children: [
|
|
504
|
+
}), /* @__PURE__ */ v("p", {
|
|
505
|
+
className: `text-4xl font-bold ${qe}`,
|
|
506
|
+
children: [$, /* @__PURE__ */ _("span", {
|
|
506
507
|
className: "text-lg text-text-muted",
|
|
507
508
|
children: "/100"
|
|
508
509
|
})]
|
|
509
|
-
})] }), /* @__PURE__ */
|
|
510
|
+
})] }), /* @__PURE__ */ v("div", {
|
|
510
511
|
className: "flex items-center gap-2",
|
|
511
512
|
children: [
|
|
512
|
-
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
513
|
+
U.securityTier && /* @__PURE__ */ _(xe, { tier: U.securityTier }),
|
|
514
|
+
/* @__PURE__ */ _(he, { className: `size-6 ${qe}` }),
|
|
515
|
+
/* @__PURE__ */ _(ee, {
|
|
515
516
|
entity: "scorecard",
|
|
516
517
|
resource: {
|
|
517
|
-
id:
|
|
518
|
-
name:
|
|
518
|
+
id: U.id,
|
|
519
|
+
name: U.id,
|
|
519
520
|
owner: {
|
|
520
|
-
ownerId:
|
|
521
|
+
ownerId: m,
|
|
521
522
|
ownerType: c
|
|
522
523
|
}
|
|
523
524
|
},
|
|
524
|
-
label:
|
|
525
|
+
label: C("scorecard.share", "Share")
|
|
525
526
|
}),
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ _("button", {
|
|
527
528
|
type: "button",
|
|
528
|
-
onClick: () =>
|
|
529
|
+
onClick: () => V(),
|
|
529
530
|
className: "rounded-md p-2 text-text-secondary transition-colors hover:bg-bg-sunken",
|
|
530
|
-
title:
|
|
531
|
-
children: /* @__PURE__ */
|
|
531
|
+
title: C("common.refresh", "Refresh"),
|
|
532
|
+
children: /* @__PURE__ */ _(pe, { className: "size-4" })
|
|
532
533
|
}),
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
+
Ce && /* @__PURE__ */ v("button", {
|
|
534
535
|
type: "button",
|
|
535
|
-
onClick:
|
|
536
|
+
onClick: q,
|
|
536
537
|
className: "flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-2 text-sm text-action-primary-text transition-colors hover:bg-action-primary-bg-hover",
|
|
537
|
-
children: [/* @__PURE__ */
|
|
538
|
+
children: [/* @__PURE__ */ _(fe, { className: "size-4" }), C("scorecard.addMetric", "Add Metric")]
|
|
538
539
|
})
|
|
539
540
|
]
|
|
540
541
|
})]
|
|
541
542
|
})
|
|
542
543
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ _(be, {
|
|
544
545
|
stagger: .04,
|
|
545
546
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
546
|
-
children:
|
|
547
|
-
let t = d[e.status] || d.UNKNOWN, n = t.icon, r = e.value ?? 0, i = e.threshold ?? 100, a = i > 0 ? Math.min(100, Math.max(0, r / i * 100)) : 0, o =
|
|
548
|
-
return /* @__PURE__ */
|
|
547
|
+
children: U.metrics.map((e) => {
|
|
548
|
+
let t = d[e.status] || d.UNKNOWN, n = t.icon, r = e.value ?? 0, i = e.threshold ?? 100, a = i > 0 ? Math.min(100, Math.max(0, r / i * 100)) : 0, o = Ee === e.id, s = e.remediation && (e.status === "WARNING" || e.status === "FAILING");
|
|
549
|
+
return /* @__PURE__ */ _(ye, { children: /* @__PURE__ */ v(l, {
|
|
549
550
|
hoverable: !0,
|
|
550
551
|
padding: "none",
|
|
551
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ v("div", {
|
|
552
553
|
role: "button",
|
|
553
554
|
tabIndex: 0,
|
|
554
|
-
onClick: () =>
|
|
555
|
+
onClick: () => D(o ? null : e.id),
|
|
555
556
|
onKeyDown: (t) => {
|
|
556
|
-
t.target === t.currentTarget && (t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
557
|
+
t.target === t.currentTarget && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), D(o ? null : e.id));
|
|
557
558
|
},
|
|
558
559
|
className: "cursor-pointer rounded-lg p-4 focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
559
560
|
"aria-expanded": o,
|
|
560
561
|
"aria-label": `${e.name} metric details`,
|
|
561
562
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
+
/* @__PURE__ */ v("div", {
|
|
563
564
|
className: "flex items-start justify-between gap-2",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
565
|
+
children: [/* @__PURE__ */ v("div", {
|
|
565
566
|
className: "min-w-0 flex-1",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ _("p", {
|
|
567
568
|
className: "truncate text-sm font-medium text-text-primary",
|
|
568
569
|
children: e.name
|
|
569
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ v("p", {
|
|
570
571
|
className: "mt-0.5 flex items-center gap-1.5 text-xs text-text-muted",
|
|
571
572
|
children: [
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
e.weight && e.weight !== 1 ? /* @__PURE__ */
|
|
574
|
-
e.statusOverride ? /* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ _("span", { children: e.direction === "LOWER_IS_BETTER" ? "↓ lower better" : "↑ higher better" }),
|
|
574
|
+
e.weight && e.weight !== 1 ? /* @__PURE__ */ v("span", { children: ["· ×", e.weight] }) : null,
|
|
575
|
+
e.statusOverride ? /* @__PURE__ */ _("span", { children: "· pinned" }) : null
|
|
575
576
|
]
|
|
576
577
|
})]
|
|
577
|
-
}), /* @__PURE__ */
|
|
578
|
+
}), /* @__PURE__ */ v("div", {
|
|
578
579
|
className: "flex flex-shrink-0 items-center gap-1",
|
|
579
580
|
children: [
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
+
we && /* @__PURE__ */ _("button", {
|
|
581
582
|
type: "button",
|
|
582
|
-
onClick: (t) =>
|
|
583
|
+
onClick: (t) => ze(t, e),
|
|
583
584
|
className: "rounded-md p-1 text-text-secondary hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg",
|
|
584
|
-
"aria-label":
|
|
585
|
-
title:
|
|
586
|
-
children: /* @__PURE__ */
|
|
585
|
+
"aria-label": C("scorecard.editMetric", "Edit metric"),
|
|
586
|
+
title: C("scorecard.editMetric", "Edit metric"),
|
|
587
|
+
children: /* @__PURE__ */ _(de, { className: "size-4" })
|
|
587
588
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
+
Te && /* @__PURE__ */ _("button", {
|
|
589
590
|
type: "button",
|
|
590
|
-
onClick: (t) =>
|
|
591
|
+
onClick: (t) => Be(t, e),
|
|
591
592
|
className: "rounded-md p-1 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text focus:outline-none focus:ring-2 focus:ring-status-error-text",
|
|
592
|
-
"aria-label":
|
|
593
|
-
title:
|
|
594
|
-
children: /* @__PURE__ */
|
|
593
|
+
"aria-label": C("scorecard.removeMetric", "Remove metric"),
|
|
594
|
+
title: C("scorecard.removeMetric", "Remove metric"),
|
|
595
|
+
children: /* @__PURE__ */ _(me, { className: "size-4" })
|
|
595
596
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ _("div", {
|
|
597
598
|
className: `flex size-7 items-center justify-center rounded-full ${t.bg}`,
|
|
598
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ _(n, { className: `size-4 ${t.text}` })
|
|
599
600
|
})
|
|
600
601
|
]
|
|
601
602
|
})]
|
|
602
603
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
+
/* @__PURE__ */ v("div", {
|
|
604
605
|
className: "mt-3",
|
|
605
|
-
children: [/* @__PURE__ */
|
|
606
|
+
children: [/* @__PURE__ */ v("div", {
|
|
606
607
|
className: "flex items-baseline justify-between",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
608
|
+
children: [/* @__PURE__ */ v("span", {
|
|
608
609
|
className: "text-lg font-bold text-text-primary",
|
|
609
610
|
children: [r, e.unit ? ` ${e.unit}` : ""]
|
|
610
|
-
}), /* @__PURE__ */
|
|
611
|
+
}), /* @__PURE__ */ v("span", {
|
|
611
612
|
className: "text-xs text-text-muted",
|
|
612
613
|
children: [
|
|
613
614
|
"/ ",
|
|
@@ -615,9 +616,9 @@ var b = {
|
|
|
615
616
|
e.unit ? ` ${e.unit}` : ""
|
|
616
617
|
]
|
|
617
618
|
})]
|
|
618
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ _("div", {
|
|
619
620
|
className: "mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
620
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ _(g.div, {
|
|
621
622
|
initial: { width: 0 },
|
|
622
623
|
animate: { width: `${a}%` },
|
|
623
624
|
transition: {
|
|
@@ -628,12 +629,12 @@ var b = {
|
|
|
628
629
|
})
|
|
629
630
|
})]
|
|
630
631
|
}),
|
|
631
|
-
s && /* @__PURE__ */
|
|
632
|
+
s && /* @__PURE__ */ _("p", {
|
|
632
633
|
className: "mt-2 rounded-md border border-status-warning-border bg-status-warning-bg-subtle px-2 py-1.5 text-xs text-status-warning-text",
|
|
633
634
|
children: e.remediation
|
|
634
635
|
})
|
|
635
636
|
]
|
|
636
|
-
}), /* @__PURE__ */
|
|
637
|
+
}), /* @__PURE__ */ _(h, { children: o && /* @__PURE__ */ v(g.div, {
|
|
637
638
|
initial: {
|
|
638
639
|
height: 0,
|
|
639
640
|
opacity: 0
|
|
@@ -648,13 +649,13 @@ var b = {
|
|
|
648
649
|
},
|
|
649
650
|
transition: { duration: .2 },
|
|
650
651
|
className: "overflow-hidden border-t border-border-default",
|
|
651
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ _("div", {
|
|
652
653
|
className: "px-4 py-3",
|
|
653
|
-
children: /* @__PURE__ */
|
|
654
|
+
children: /* @__PURE__ */ _(se, {
|
|
654
655
|
metricId: e.id,
|
|
655
656
|
colorClass: t.text
|
|
656
657
|
})
|
|
657
|
-
}), e.iframeUrl && /* @__PURE__ */
|
|
658
|
+
}), e.iframeUrl && /* @__PURE__ */ _("iframe", {
|
|
658
659
|
src: e.iframeUrl,
|
|
659
660
|
className: "w-full border-0",
|
|
660
661
|
style: { height: e.iframeHeight ? `${e.iframeHeight}px` : "200px" },
|
|
@@ -665,15 +666,15 @@ var b = {
|
|
|
665
666
|
}) }, e.id);
|
|
666
667
|
})
|
|
667
668
|
}),
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ _(oe, {
|
|
669
670
|
ownerType: c,
|
|
670
|
-
highlightOwnerId:
|
|
671
|
+
highlightOwnerId: m
|
|
671
672
|
}),
|
|
672
|
-
|
|
673
|
-
|
|
673
|
+
Ke(),
|
|
674
|
+
Q()
|
|
674
675
|
]
|
|
675
676
|
});
|
|
676
|
-
},
|
|
677
|
+
}, S = {
|
|
677
678
|
[c.Bronze]: {
|
|
678
679
|
label: "Bronze",
|
|
679
680
|
cls: "bg-status-warning-bg-subtle text-status-warning-text border border-status-warning-border"
|
|
@@ -686,15 +687,15 @@ var b = {
|
|
|
686
687
|
label: "Gold",
|
|
687
688
|
cls: "bg-status-success-bg-subtle text-status-success-text border border-status-success-border"
|
|
688
689
|
}
|
|
689
|
-
},
|
|
690
|
-
let t =
|
|
691
|
-
return /* @__PURE__ */
|
|
690
|
+
}, xe = ({ tier: e }) => {
|
|
691
|
+
let t = S[e];
|
|
692
|
+
return /* @__PURE__ */ v("span", {
|
|
692
693
|
className: `inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-xs font-semibold ${t.cls}`,
|
|
693
694
|
title: `Security readiness tier: ${t.label}`,
|
|
694
|
-
children: [/* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ _(m, { className: "size-3.5" }), t.label]
|
|
695
696
|
});
|
|
696
697
|
};
|
|
697
698
|
//#endregion
|
|
698
|
-
export {
|
|
699
|
+
export { x as ScorecardPanel };
|
|
699
700
|
|
|
700
701
|
//# sourceMappingURL=ScorecardPanel.js.map
|