@burdenoff/microfe-security 2026.601.4 → 2026.602.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.
@@ -3,272 +3,277 @@ import { SECURITY_FEATURE_FLAGS as t } from "../constants/featureFlags.js";
3
3
  import { cn as n } from "../utils/cn.js";
4
4
  import { PageLayout as r } from "../components/PageLayout.js";
5
5
  import { Badge as i, Button as a, Card as o } from "../components/ui.js";
6
- import { translateWithFallback as ee } from "../utils/i18n.js";
7
- import { ConfirmDialog as te } from "../components/ConfirmDialog.js";
8
- import { useGetSecretVersionsQuery as ne } from "../../generated/wspace-operations.js";
9
- import { useSecurityEventEmitter as s } from "../hooks/useSecurityEventEmitter.js";
10
- import { useDeleteSecret as re, useGetSecret as ie, useRollbackSecret as c, useRotateSecret as l } from "../hooks/useSecretQueries.js";
11
- import { nativeConfirm as u, nativeImpact as d, nativeNotify as f } from "../../utils/nativeBridge.js";
12
- import { SecurityPermissionGuard as p } from "../components/SecurityPermissionGuard.js";
13
- import { SecretValueDisplay as ae } from "../components/SecretValueDisplay.js";
14
- import { SecretTypeBadge as oe } from "../components/SecretTypeBadge.js";
15
- import { RotationStatusBadge as se } from "../components/RotationStatusBadge.js";
16
- import { useSecretValue as ce } from "../hooks/useSecretValue.js";
17
- import { useRef as le, useState as m } from "react";
18
- import { usePermission as h } from "@burdenoff/fe-libs/shared/providers/shell";
19
- import { useNavigate as ue, useParams as de } from "react-router-dom";
20
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
21
- import { AlertTriangle as fe, ArrowLeft as v, Calendar as y, Clock as b, History as x, KeyRound as pe, Loader2 as S, RefreshCw as C, Shield as me, Trash2 as he, X as w } from "lucide-react";
22
- import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
+ import { translateWithFallback as s } from "../utils/i18n.js";
7
+ import { ConfirmDialog as c } from "../components/ConfirmDialog.js";
8
+ import { useGetSecretVersionsQuery as ee } from "../../generated/wspace-operations.js";
9
+ import { useSecurityEventEmitter as te } from "../hooks/useSecurityEventEmitter.js";
10
+ import { useDeleteSecret as ne, useGetSecret as re, useRollbackSecret as ie, useRotateSecret as ae } from "../hooks/useSecretQueries.js";
11
+ import { nativeConfirm as oe, nativeImpact as se, nativeNotify as l } from "../../utils/nativeBridge.js";
12
+ import { SecurityPermissionGuard as u } from "../components/SecurityPermissionGuard.js";
13
+ import { SecretValueDisplay as d } from "../components/SecretValueDisplay.js";
14
+ import { SecretTypeBadge as f } from "../components/SecretTypeBadge.js";
15
+ import { RotationStatusBadge as p } from "../components/RotationStatusBadge.js";
16
+ import { SecretShareDialog as m } from "../components/SecretShareDialog.js";
17
+ import { useSecretValue as h } from "../hooks/useSecretValue.js";
18
+ import { useRef as ce, useState as g } from "react";
19
+ import { usePermission as _ } from "@burdenoff/fe-libs/shared/providers/shell";
20
+ import { useNavigate as le, useParams as ue } from "react-router-dom";
21
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
22
+ import { AlertTriangle as de, ArrowLeft as b, Calendar as fe, Clock as pe, History as x, KeyRound as me, Loader2 as S, RefreshCw as C, Share2 as he, Shield as ge, Trash2 as w, X as T } from "lucide-react";
23
+ import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
23
24
  //#region src/security/pages/SecretDetailPage.tsx
24
- function E() {
25
- let { vaultId: E, secretId: D } = de(), { basePath: O = "/", navigate: k } = e(), { t: A } = T(), j = ue(), { data: M, loading: N, error: P, refetch: F } = ie(D ?? null), I = M?.getSecret, { data: L, loading: R } = ne({
25
+ function D() {
26
+ let { vaultId: D, secretId: O } = ue(), { basePath: k = "/", navigate: A } = e(), { t: j } = E(), M = le(), { data: N, loading: P, error: F, refetch: I } = re(O ?? null), L = N?.getSecret, { data: _e, loading: ve } = ee({
26
27
  variables: {
27
- secretId: D ?? "",
28
+ secretId: O ?? "",
28
29
  pagination: { limit: 50 }
29
30
  },
30
- skip: !D,
31
+ skip: !O,
31
32
  fetchPolicy: "network-only"
32
- }), z = L?.getSecretVersionsPaginated?.items ?? [], { value: ge, reveal: _e, hide: ve, loading: ye, isRevealed: B } = ce(D ?? ""), [be, { loading: xe }] = re(), [Se, { loading: V }] = l(), [Ce, { loading: we }] = c(), { emit: H } = s(), Te = h("secret:delete");
33
- h("secret:update");
34
- let Ee = h("secret:decrypt"), [De, U] = m(!1), [Oe, W] = m(!1), G = le(null), ke = () => {
35
- W(!0), requestAnimationFrame(() => G.current?.focus());
36
- }, [Ae, K] = m(!1), [q, J] = m(""), Y = (e, t, n) => ee(A, e, t, n), je = (e) => {
37
- k ? k(e) : j(e);
33
+ }), ye = _e?.getSecretVersionsPaginated?.items ?? [], { value: be, reveal: xe, hide: Se, loading: Ce, isRevealed: R } = h(O ?? ""), [we, { loading: Te }] = ne(), [Ee, { loading: z }] = ae(), [De, { loading: Oe }] = ie(), { emit: B } = te(), ke = _("secret:delete"), Ae = _("secret:update"), je = _("secret:decrypt"), [Me, V] = g(!1), [Ne, H] = g(!1), [Pe, U] = g(!1), W = ce(null), Fe = () => {
34
+ U(!0), requestAnimationFrame(() => W.current?.focus());
35
+ }, [G, K] = g(!1), [q, J] = g(""), Y = (e, t, n) => s(j, e, t, n), Ie = (e) => {
36
+ A ? A(e) : M(e);
38
37
  }, X = () => {
39
- je(`${O}/vaults/${E}`);
38
+ Ie(`${k}/vaults/${D}`);
40
39
  }, Z = async () => {
41
- if (D) try {
42
- await be({ variables: { id: D } }), H("secret.deleted", {
43
- secretId: D,
44
- vaultId: E
45
- }), U(!1), f("success"), X();
40
+ if (O) try {
41
+ await we({ variables: { id: O } }), B("secret.deleted", {
42
+ secretId: O,
43
+ vaultId: D
44
+ }), V(!1), l("success"), X();
46
45
  } catch (e) {
47
- console.error("Failed to delete secret:", e), f("error");
46
+ console.error("Failed to delete secret:", e), l("error");
48
47
  }
49
- }, Me = async () => {
50
- d("medium");
51
- let e = await u({
48
+ }, Le = async () => {
49
+ se("medium");
50
+ let e = await oe({
52
51
  title: "Delete Secret",
53
52
  message: "Delete this secret? This cannot be undone.",
54
53
  okButtonTitle: "Delete",
55
54
  cancelButtonTitle: "Cancel"
56
55
  });
57
56
  if (e === null) {
58
- U(!0);
57
+ V(!0);
59
58
  return;
60
59
  }
61
60
  e && await Z();
62
- }, Ne = async () => {
63
- if (!(!D || !q.trim())) try {
64
- await Se({ variables: {
65
- id: D,
61
+ }, Re = async () => {
62
+ if (!(!O || !q.trim())) try {
63
+ await Ee({ variables: {
64
+ id: O,
66
65
  newValue: q.trim()
67
- } }), H("secret.rotated", {
68
- secretId: D,
69
- vaultId: E
70
- }), W(!1), J(""), F();
66
+ } }), B("secret.rotated", {
67
+ secretId: O,
68
+ vaultId: D
69
+ }), U(!1), J(""), I();
71
70
  } catch (e) {
72
71
  console.error("Failed to rotate secret:", e);
73
72
  }
74
- }, Pe = async (e) => {
75
- if (D) try {
76
- await Ce({ variables: {
77
- id: D,
73
+ }, ze = async (e) => {
74
+ if (O) try {
75
+ await De({ variables: {
76
+ id: O,
78
77
  version: e
79
- } }), H("secret.rollback", {
80
- secretId: D,
81
- vaultId: E
82
- }), F(), K(!1);
78
+ } }), B("secret.rollback", {
79
+ secretId: O,
80
+ vaultId: D
81
+ }), I(), K(!1);
83
82
  } catch (e) {
84
83
  console.error("Failed to rollback secret:", e);
85
84
  }
86
85
  };
87
- if (N && !I) return /* @__PURE__ */ g(r, {
86
+ if (P && !L) return /* @__PURE__ */ v(r, {
88
87
  title: Y("security.secretDetail.loading.title", "Loading Secret..."),
89
88
  breadcrumbs: [{
90
89
  label: Y("security.common.breadcrumbs.security", "Security"),
91
- path: O
90
+ path: k
92
91
  }, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
93
- children: /* @__PURE__ */ g("div", {
92
+ children: /* @__PURE__ */ v("div", {
94
93
  className: "flex items-center justify-center py-20",
95
- children: /* @__PURE__ */ g(S, { className: "size-10 animate-spin text-primary/60" })
94
+ children: /* @__PURE__ */ v(S, { className: "size-10 animate-spin text-primary/60" })
96
95
  })
97
96
  });
98
- if (P || !I) return /* @__PURE__ */ g(r, {
97
+ if (F || !L) return /* @__PURE__ */ v(r, {
99
98
  title: Y("security.common.errorPage.title", "Error"),
100
99
  breadcrumbs: [{
101
100
  label: Y("security.common.breadcrumbs.security", "Security"),
102
- path: O
101
+ path: k
103
102
  }, { label: Y("security.common.breadcrumbs.secret", "Secret") }],
104
- children: /* @__PURE__ */ g(o, {
103
+ children: /* @__PURE__ */ v(o, {
105
104
  className: "p-8 text-center max-w-lg mx-auto mt-10",
106
- children: /* @__PURE__ */ _("div", {
105
+ children: /* @__PURE__ */ y("div", {
107
106
  className: "flex flex-col items-center gap-4",
108
107
  children: [
109
- /* @__PURE__ */ g("div", {
108
+ /* @__PURE__ */ v("div", {
110
109
  className: "p-3 rounded-full bg-destructive/10",
111
- children: /* @__PURE__ */ g(fe, { className: "size-8 text-destructive" })
110
+ children: /* @__PURE__ */ v(de, { className: "size-8 text-destructive" })
112
111
  }),
113
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h3", {
112
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h3", {
114
113
  className: "text-lg font-bold text-foreground",
115
114
  children: Y("security.secretDetail.error.title", "Failed to load secret")
116
- }), /* @__PURE__ */ g("p", {
115
+ }), /* @__PURE__ */ v("p", {
117
116
  className: "text-sm text-muted-foreground mt-2",
118
- children: P?.message ?? Y("security.secretDetail.error.description", "Secret not found or access denied.")
117
+ children: F?.message ?? Y("security.secretDetail.error.description", "Secret not found or access denied.")
119
118
  })] }),
120
- /* @__PURE__ */ _(a, {
119
+ /* @__PURE__ */ y(a, {
121
120
  variant: "outline",
122
121
  onClick: X,
123
122
  className: "mt-4",
124
- children: [/* @__PURE__ */ g(v, { className: "size-4" }), Y("security.secretDetail.actions.backToVault", "Go Back to Vault")]
123
+ children: [/* @__PURE__ */ v(b, { className: "size-4" }), Y("security.secretDetail.actions.backToVault", "Go Back to Vault")]
125
124
  })
126
125
  ]
127
126
  })
128
127
  })
129
128
  });
130
- let Q = I.versionCount ?? 0, $ = I.lastRotatedAt ? "healthy" : void 0;
131
- return /* @__PURE__ */ _(r, {
132
- title: I.name,
133
- description: I.description ?? Y("security.secretDetail.description", "View and manage this secret."),
129
+ let Q = L.versionCount ?? 0, $ = L.lastRotatedAt ? "healthy" : void 0;
130
+ return /* @__PURE__ */ y(r, {
131
+ title: L.name,
132
+ description: L.description ?? Y("security.secretDetail.description", "View and manage this secret."),
134
133
  breadcrumbs: [
135
134
  {
136
135
  label: Y("security.common.breadcrumbs.security", "Security"),
137
- path: O
136
+ path: k
138
137
  },
139
138
  {
140
139
  label: Y("security.common.breadcrumbs.vault", "Vault"),
141
- path: `${O}/vaults/${E}`
140
+ path: `${k}/vaults/${D}`
142
141
  },
143
- { label: I.name }
142
+ { label: L.name }
144
143
  ],
145
- actions: /* @__PURE__ */ _("div", {
144
+ actions: /* @__PURE__ */ y("div", {
146
145
  className: "flex flex-wrap items-center gap-2",
147
146
  children: [
148
- /* @__PURE__ */ _(a, {
147
+ /* @__PURE__ */ y(a, {
149
148
  variant: "outline",
150
149
  size: "sm",
151
150
  onClick: X,
152
151
  children: [
153
- /* @__PURE__ */ g(v, { className: "size-4" }),
154
- /* @__PURE__ */ g("span", {
152
+ /* @__PURE__ */ v(b, { className: "size-4" }),
153
+ /* @__PURE__ */ v("span", {
155
154
  className: "hidden sm:inline",
156
155
  children: Y("security.secretDetail.actions.backToVault", "Back to Vault")
157
156
  }),
158
- /* @__PURE__ */ g("span", {
157
+ /* @__PURE__ */ v("span", {
159
158
  className: "sm:hidden",
160
159
  children: Y("security.common.actions.back", "Back")
161
160
  })
162
161
  ]
163
162
  }),
164
- /* @__PURE__ */ g(p, {
163
+ Ae && /* @__PURE__ */ y(a, {
164
+ variant: "outline",
165
+ size: "sm",
166
+ onClick: () => H(!0),
167
+ children: [/* @__PURE__ */ v(he, { className: "size-4" }), Y("security.common.actions.share", "Share")]
168
+ }),
169
+ /* @__PURE__ */ v(u, {
165
170
  permission: "secret:update",
166
171
  featureFlagKey: t.SECRET_ROTATE,
167
172
  featureFlagDefault: !1,
168
- children: /* @__PURE__ */ _(a, {
173
+ children: /* @__PURE__ */ y(a, {
169
174
  variant: "outline",
170
175
  size: "sm",
171
- onClick: ke,
172
- children: [/* @__PURE__ */ g(C, { className: "size-4" }), Y("security.secretDetail.actions.rotate", "Rotate")]
176
+ onClick: Fe,
177
+ children: [/* @__PURE__ */ v(C, { className: "size-4" }), Y("security.secretDetail.actions.rotate", "Rotate")]
173
178
  })
174
179
  }),
175
- Te && /* @__PURE__ */ _(a, {
180
+ ke && /* @__PURE__ */ y(a, {
176
181
  variant: "outline",
177
182
  size: "sm",
178
183
  className: "text-destructive hover:bg-destructive/10 border-destructive/20",
179
- onClick: () => void Me(),
180
- children: [/* @__PURE__ */ g(he, { className: "size-4" }), Y("security.common.actions.delete", "Delete")]
184
+ onClick: () => void Le(),
185
+ children: [/* @__PURE__ */ v(w, { className: "size-4" }), Y("security.common.actions.delete", "Delete")]
181
186
  })
182
187
  ]
183
188
  }),
184
189
  children: [
185
- /* @__PURE__ */ _("div", {
190
+ /* @__PURE__ */ y("div", {
186
191
  className: "space-y-6",
187
- children: [/* @__PURE__ */ _("div", {
192
+ children: [/* @__PURE__ */ y("div", {
188
193
  className: "flex flex-wrap items-center gap-3",
189
194
  children: [
190
- /* @__PURE__ */ g(oe, { type: I.type }),
191
- $ && /* @__PURE__ */ g(se, { status: $ }),
192
- /* @__PURE__ */ g(i, {
195
+ /* @__PURE__ */ v(f, { type: L.type }),
196
+ $ && /* @__PURE__ */ v(p, { status: $ }),
197
+ /* @__PURE__ */ v(i, {
193
198
  variant: "outline",
194
199
  className: "bg-background/50",
195
- children: Y("security.secretDetail.status.label", "Status: {status}", { status: I.status })
200
+ children: Y("security.secretDetail.status.label", "Status: {status}", { status: L.status })
196
201
  }),
197
- I.labels?.map((e) => /* @__PURE__ */ g(i, {
202
+ L.labels?.map((e) => /* @__PURE__ */ v(i, {
198
203
  variant: "outline",
199
204
  className: "border-primary/20 text-primary",
200
205
  children: e.label
201
206
  }, e.id))
202
207
  ]
203
- }), /* @__PURE__ */ _("div", {
208
+ }), /* @__PURE__ */ y("div", {
204
209
  className: "grid grid-cols-1 md:grid-cols-3 gap-6",
205
- children: [/* @__PURE__ */ _("div", {
210
+ children: [/* @__PURE__ */ y("div", {
206
211
  className: "md:col-span-2 space-y-6",
207
- children: [/* @__PURE__ */ _(o, {
212
+ children: [/* @__PURE__ */ y(o, {
208
213
  className: "p-6 shadow-sm border-border/60",
209
214
  children: [
210
- /* @__PURE__ */ _("div", {
215
+ /* @__PURE__ */ y("div", {
211
216
  className: "flex items-center justify-between mb-4",
212
- children: [/* @__PURE__ */ _("h2", {
217
+ children: [/* @__PURE__ */ y("h2", {
213
218
  className: "text-lg font-bold text-foreground flex items-center gap-2",
214
- children: [/* @__PURE__ */ g(pe, { className: "size-5 text-primary" }), Y("security.secretDetail.value.title", "Secret Value")]
215
- }), I.expiresAt && /* @__PURE__ */ _("div", {
219
+ children: [/* @__PURE__ */ v(me, { className: "size-5 text-primary" }), Y("security.secretDetail.value.title", "Secret Value")]
220
+ }), L.expiresAt && /* @__PURE__ */ y("div", {
216
221
  className: "flex items-center gap-1.5 text-xs text-warning",
217
- children: [/* @__PURE__ */ g(y, { className: "size-3.5" }), Y("security.secretDetail.value.expires", "Expires: {date}", { date: new Date(I.expiresAt).toLocaleDateString() })]
222
+ children: [/* @__PURE__ */ v(fe, { className: "size-3.5" }), Y("security.secretDetail.value.expires", "Expires: {date}", { date: new Date(L.expiresAt).toLocaleDateString() })]
218
223
  })]
219
224
  }),
220
- /* @__PURE__ */ g(ae, {
221
- value: ge ?? "",
222
- isRevealed: B,
223
- onToggleReveal: Ee ? () => {
224
- B ? ve() : _e();
225
+ /* @__PURE__ */ v(d, {
226
+ value: be ?? "",
227
+ isRevealed: R,
228
+ onToggleReveal: je ? () => {
229
+ R ? Se() : xe();
225
230
  } : void 0,
226
- isLoading: ye
231
+ isLoading: Ce
227
232
  }),
228
- /* @__PURE__ */ g("p", {
233
+ /* @__PURE__ */ v("p", {
229
234
  className: "text-xs text-muted-foreground mt-4 italic",
230
235
  children: Y("security.secretDetail.value.note", "Secret values are decrypted on-demand and never stored in plain text.")
231
236
  })
232
237
  ]
233
- }), /* @__PURE__ */ _(o, {
238
+ }), /* @__PURE__ */ y(o, {
234
239
  className: "p-6 shadow-sm border-border/60",
235
- children: [/* @__PURE__ */ _("div", {
240
+ children: [/* @__PURE__ */ y("div", {
236
241
  className: "flex items-center justify-between mb-6",
237
- children: [/* @__PURE__ */ _("h2", {
242
+ children: [/* @__PURE__ */ y("h2", {
238
243
  className: "text-lg font-bold text-foreground flex items-center gap-2",
239
- children: [/* @__PURE__ */ g(x, { className: "size-5 text-primary" }), Y("security.secretDetail.history.title", "Version History")]
240
- }), /* @__PURE__ */ g(i, {
244
+ children: [/* @__PURE__ */ v(x, { className: "size-5 text-primary" }), Y("security.secretDetail.history.title", "Version History")]
245
+ }), /* @__PURE__ */ v(i, {
241
246
  variant: "outline",
242
247
  className: "bg-muted font-mono",
243
248
  children: Y("security.secretDetail.history.totalVersions", "{count} total versions", { count: Q })
244
249
  })]
245
- }), /* @__PURE__ */ _("div", {
250
+ }), /* @__PURE__ */ y("div", {
246
251
  className: "space-y-4",
247
- children: [/* @__PURE__ */ _("div", {
252
+ children: [/* @__PURE__ */ y("div", {
248
253
  className: "flex items-center justify-between p-4 rounded-lg bg-primary/5 border border-primary/10",
249
- children: [/* @__PURE__ */ _("div", {
254
+ children: [/* @__PURE__ */ y("div", {
250
255
  className: "flex items-center gap-3",
251
- children: [/* @__PURE__ */ _("div", {
256
+ children: [/* @__PURE__ */ y("div", {
252
257
  className: "size-8 rounded-full bg-primary/10 flex items-center justify-center text-primary text-xs font-bold",
253
- children: ["v", I.version ?? Q]
254
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
258
+ children: ["v", L.version ?? Q]
259
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
255
260
  className: "text-sm font-semibold",
256
261
  children: Y("security.secretDetail.history.currentVersion", "Current Active Version")
257
- }), /* @__PURE__ */ g("p", {
262
+ }), /* @__PURE__ */ v("p", {
258
263
  className: "text-xs text-muted-foreground",
259
- children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(I.updatedAt).toLocaleString() })
264
+ children: Y("security.secretDetail.history.lastUpdated", "Last updated {date}", { date: new Date(L.updatedAt).toLocaleString() })
260
265
  })] })]
261
- }), /* @__PURE__ */ g(i, {
266
+ }), /* @__PURE__ */ v(i, {
262
267
  variant: "success",
263
268
  className: "text-[10px] uppercase",
264
269
  children: Y("security.common.status.active", "Active")
265
270
  })]
266
- }), Q > 1 && /* @__PURE__ */ _("div", {
271
+ }), Q > 1 && /* @__PURE__ */ y("div", {
267
272
  className: "text-center py-4 border-2 border-dashed border-border/40 rounded-lg bg-muted/20",
268
- children: [/* @__PURE__ */ g("p", {
273
+ children: [/* @__PURE__ */ v("p", {
269
274
  className: "text-sm text-muted-foreground",
270
275
  children: Y("security.secretDetail.history.available", "Historical versions are available. You can rollback to a previous state if needed.")
271
- }), /* @__PURE__ */ g(a, {
276
+ }), /* @__PURE__ */ v(a, {
272
277
  variant: "outline",
273
278
  size: "sm",
274
279
  className: "mt-3",
@@ -278,52 +283,52 @@ function E() {
278
283
  })]
279
284
  })]
280
285
  })]
281
- }), /* @__PURE__ */ _("div", {
286
+ }), /* @__PURE__ */ y("div", {
282
287
  className: "space-y-6",
283
- children: [/* @__PURE__ */ _(o, {
288
+ children: [/* @__PURE__ */ y(o, {
284
289
  className: "p-6 shadow-sm border-border/60 space-y-4",
285
- children: [/* @__PURE__ */ g("h3", {
290
+ children: [/* @__PURE__ */ v("h3", {
286
291
  className: "font-bold text-sm uppercase tracking-wider text-muted-foreground",
287
292
  children: Y("security.secretDetail.details.title", "Details")
288
- }), /* @__PURE__ */ _("div", {
293
+ }), /* @__PURE__ */ y("div", {
289
294
  className: "space-y-3",
290
295
  children: [
291
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
296
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
292
297
  className: "text-xs text-muted-foreground",
293
298
  children: Y("security.secretDetail.details.keyIdentifier", "Key Identifier")
294
- }), /* @__PURE__ */ g("code", {
299
+ }), /* @__PURE__ */ v("code", {
295
300
  className: "text-xs font-mono bg-muted px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap",
296
- children: I.key
301
+ children: L.key
297
302
  })] }),
298
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
303
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
299
304
  className: "text-xs text-muted-foreground",
300
305
  children: Y("security.secretDetail.details.createdBy", "Created By")
301
- }), /* @__PURE__ */ g("p", {
306
+ }), /* @__PURE__ */ v("p", {
302
307
  className: "text-sm font-medium mt-1",
303
- children: I.createdBy
308
+ children: L.createdBy
304
309
  })] }),
305
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
310
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
306
311
  className: "text-xs text-muted-foreground",
307
312
  children: Y("security.secretDetail.details.createdAt", "Created At")
308
- }), /* @__PURE__ */ _("div", {
313
+ }), /* @__PURE__ */ y("div", {
309
314
  className: "flex items-center gap-1.5 text-sm mt-1",
310
- children: [/* @__PURE__ */ g(b, { className: "size-3.5" }), new Date(I.createdAt).toLocaleDateString()]
315
+ children: [/* @__PURE__ */ v(pe, { className: "size-3.5" }), new Date(L.createdAt).toLocaleDateString()]
311
316
  })] }),
312
- I.lastRotatedAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
317
+ L.lastRotatedAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
313
318
  className: "text-xs text-muted-foreground",
314
319
  children: Y("security.secretDetail.details.lastRotation", "Last Rotation")
315
- }), /* @__PURE__ */ g("p", {
320
+ }), /* @__PURE__ */ v("p", {
316
321
  className: "text-sm mt-1",
317
- children: new Date(I.lastRotatedAt).toLocaleString()
322
+ children: new Date(L.lastRotatedAt).toLocaleString()
318
323
  })] })
319
324
  ]
320
325
  })]
321
- }), /* @__PURE__ */ _(o, {
326
+ }), /* @__PURE__ */ y(o, {
322
327
  className: "p-6 shadow-sm border-border/60 space-y-4 bg-primary/5 border-primary/10",
323
- children: [/* @__PURE__ */ _("h3", {
328
+ children: [/* @__PURE__ */ y("h3", {
324
329
  className: "font-bold text-sm text-primary flex items-center gap-2",
325
- children: [/* @__PURE__ */ g(me, { className: "size-4" }), Y("security.secretDetail.security.title", "Security")]
326
- }), /* @__PURE__ */ g("p", {
330
+ children: [/* @__PURE__ */ v(ge, { className: "size-4" }), Y("security.secretDetail.security.title", "Security")]
331
+ }), /* @__PURE__ */ v("p", {
327
332
  className: "text-xs text-muted-foreground leading-relaxed",
328
333
  children: Y("security.secretDetail.security.description", "This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.")
329
334
  })]
@@ -331,75 +336,75 @@ function E() {
331
336
  })]
332
337
  })]
333
338
  }),
334
- Ae && /* @__PURE__ */ _("div", {
339
+ G && /* @__PURE__ */ y("div", {
335
340
  className: "fixed inset-0 z-50 flex items-center justify-center p-4",
336
- children: [/* @__PURE__ */ g("button", {
341
+ children: [/* @__PURE__ */ v("button", {
337
342
  type: "button",
338
343
  "aria-label": "Close version history",
339
344
  className: "absolute inset-0 bg-background/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default",
340
345
  onClick: () => K(!1)
341
- }), /* @__PURE__ */ _(o, {
346
+ }), /* @__PURE__ */ y(o, {
342
347
  className: "relative z-10 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20 max-h-[80vh] flex flex-col",
343
- children: [/* @__PURE__ */ _("div", {
348
+ children: [/* @__PURE__ */ y("div", {
344
349
  className: "flex items-center justify-between p-6 border-b border-border",
345
- children: [/* @__PURE__ */ _("div", {
350
+ children: [/* @__PURE__ */ y("div", {
346
351
  className: "flex items-center gap-3",
347
- children: [/* @__PURE__ */ g("div", {
352
+ children: [/* @__PURE__ */ v("div", {
348
353
  className: "p-2 rounded-full bg-primary/10 text-primary",
349
- children: /* @__PURE__ */ g(x, { className: "size-5" })
350
- }), /* @__PURE__ */ g("h2", {
354
+ children: /* @__PURE__ */ v(x, { className: "size-5" })
355
+ }), /* @__PURE__ */ v("h2", {
351
356
  className: "text-xl font-bold text-foreground",
352
357
  children: Y("security.secretDetail.history.modalTitle", "Version History")
353
358
  })]
354
- }), /* @__PURE__ */ g("button", {
359
+ }), /* @__PURE__ */ v("button", {
355
360
  type: "button",
356
361
  onClick: () => K(!1),
357
362
  className: "p-2 rounded-md hover:bg-muted text-muted-foreground transition-colors",
358
- children: /* @__PURE__ */ g(w, { className: "size-5" })
363
+ children: /* @__PURE__ */ v(T, { className: "size-5" })
359
364
  })]
360
- }), /* @__PURE__ */ g("div", {
365
+ }), /* @__PURE__ */ v("div", {
361
366
  className: "p-6 overflow-y-auto flex-1",
362
- children: R ? /* @__PURE__ */ g("div", {
367
+ children: ve ? /* @__PURE__ */ v("div", {
363
368
  className: "flex justify-center py-8",
364
- children: /* @__PURE__ */ g(S, { className: "size-8 animate-spin text-primary/60" })
365
- }) : /* @__PURE__ */ g("div", {
369
+ children: /* @__PURE__ */ v(S, { className: "size-8 animate-spin text-primary/60" })
370
+ }) : /* @__PURE__ */ v("div", {
366
371
  className: "space-y-4",
367
- children: z.map((e) => /* @__PURE__ */ g("div", {
368
- className: n("p-4 rounded-lg border", e.version === I.version ? "bg-primary/5 border-primary/20" : "bg-card border-border"),
369
- children: /* @__PURE__ */ _("div", {
372
+ children: ye.map((e) => /* @__PURE__ */ v("div", {
373
+ className: n("p-4 rounded-lg border", e.version === L.version ? "bg-primary/5 border-primary/20" : "bg-card border-border"),
374
+ children: /* @__PURE__ */ y("div", {
370
375
  className: "flex items-center justify-between",
371
- children: [/* @__PURE__ */ _("div", { children: [
372
- /* @__PURE__ */ _("div", {
376
+ children: [/* @__PURE__ */ y("div", { children: [
377
+ /* @__PURE__ */ y("div", {
373
378
  className: "flex items-center gap-2",
374
- children: [/* @__PURE__ */ g("span", {
379
+ children: [/* @__PURE__ */ v("span", {
375
380
  className: "font-semibold",
376
381
  children: Y("security.secretDetail.history.versionLabel", "Version {version}", { version: e.version })
377
- }), e.version === I.version && /* @__PURE__ */ g(i, {
382
+ }), e.version === L.version && /* @__PURE__ */ v(i, {
378
383
  variant: "success",
379
384
  className: "text-[10px] uppercase",
380
385
  children: Y("security.common.status.active", "Active")
381
386
  })]
382
387
  }),
383
- /* @__PURE__ */ g("p", {
388
+ /* @__PURE__ */ v("p", {
384
389
  className: "text-xs text-muted-foreground mt-1",
385
390
  children: Y("security.secretDetail.history.versionMeta", "{date} by {createdBy}", {
386
391
  date: new Date(e.createdAt).toLocaleString(),
387
392
  createdBy: e.createdBy
388
393
  })
389
394
  }),
390
- e.changeReason && /* @__PURE__ */ g("p", {
395
+ e.changeReason && /* @__PURE__ */ v("p", {
391
396
  className: "text-sm mt-2",
392
397
  children: e.changeReason
393
398
  })
394
- ] }), e.version !== I.version && /* @__PURE__ */ g(p, {
399
+ ] }), e.version !== L.version && /* @__PURE__ */ v(u, {
395
400
  permission: "secret:update",
396
401
  featureFlagKey: t.SECRET_ROLLBACK,
397
402
  featureFlagDefault: !1,
398
- children: /* @__PURE__ */ g(a, {
403
+ children: /* @__PURE__ */ v(a, {
399
404
  variant: "outline",
400
405
  size: "sm",
401
- onClick: () => Pe(e.version),
402
- disabled: we,
406
+ onClick: () => ze(e.version),
407
+ disabled: Oe,
403
408
  children: Y("security.secretDetail.actions.rollback", "Rollback")
404
409
  })
405
410
  })]
@@ -409,51 +414,51 @@ function E() {
409
414
  })]
410
415
  })]
411
416
  }),
412
- /* @__PURE__ */ g(te, {
413
- isOpen: De,
414
- onClose: () => U(!1),
417
+ /* @__PURE__ */ v(c, {
418
+ isOpen: Me,
419
+ onClose: () => V(!1),
415
420
  onConfirm: Z,
416
421
  title: Y("security.secretDetail.delete.title", "Delete Secret"),
417
- description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name: I.name }),
418
- confirmLabel: xe ? Y("security.secretDetail.delete.deleting", "Deleting...") : Y("security.secretDetail.delete.confirm", "Delete Secret"),
422
+ description: Y("security.secretDetail.delete.description", "Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.", { name: L.name }),
423
+ confirmLabel: Te ? Y("security.secretDetail.delete.deleting", "Deleting...") : Y("security.secretDetail.delete.confirm", "Delete Secret"),
419
424
  variant: "destructive"
420
425
  }),
421
- Oe && /* @__PURE__ */ _("div", {
426
+ Pe && /* @__PURE__ */ y("div", {
422
427
  className: "fixed inset-0 z-50 flex items-center justify-center p-4",
423
- children: [/* @__PURE__ */ g("button", {
428
+ children: [/* @__PURE__ */ v("button", {
424
429
  type: "button",
425
430
  "aria-label": "Close rotate dialog",
426
431
  className: "absolute inset-0 bg-background/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default",
427
- onClick: () => W(!1)
428
- }), /* @__PURE__ */ g(o, {
432
+ onClick: () => U(!1)
433
+ }), /* @__PURE__ */ v(o, {
429
434
  className: "relative z-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20",
430
- children: /* @__PURE__ */ _("div", {
435
+ children: /* @__PURE__ */ y("div", {
431
436
  className: "p-6 space-y-4",
432
437
  children: [
433
- /* @__PURE__ */ _("div", {
438
+ /* @__PURE__ */ y("div", {
434
439
  className: "flex items-center gap-3",
435
- children: [/* @__PURE__ */ g("div", {
440
+ children: [/* @__PURE__ */ v("div", {
436
441
  className: "p-2 rounded-full bg-primary/10 text-primary",
437
- children: /* @__PURE__ */ g(C, { className: "size-5" })
438
- }), /* @__PURE__ */ g("h2", {
442
+ children: /* @__PURE__ */ v(C, { className: "size-5" })
443
+ }), /* @__PURE__ */ v("h2", {
439
444
  className: "text-xl font-bold text-foreground",
440
445
  children: Y("security.secretDetail.rotate.title", "Rotate Secret")
441
446
  })]
442
447
  }),
443
- /* @__PURE__ */ g("p", {
448
+ /* @__PURE__ */ v("p", {
444
449
  className: "text-sm text-muted-foreground",
445
- children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name: I.name })
450
+ children: Y("security.secretDetail.rotate.description", "Enter a new value for {name}. The current value will be moved to version history.", { name: L.name })
446
451
  }),
447
- /* @__PURE__ */ _("div", {
452
+ /* @__PURE__ */ y("div", {
448
453
  className: "space-y-2",
449
- children: [/* @__PURE__ */ g("label", {
454
+ children: [/* @__PURE__ */ v("label", {
450
455
  htmlFor: "new-secret-value",
451
456
  className: "text-sm font-medium",
452
457
  children: Y("security.secretDetail.rotate.newValue", "New Secret Value")
453
- }), /* @__PURE__ */ g("textarea", {
458
+ }), /* @__PURE__ */ v("textarea", {
454
459
  id: "new-secret-value",
455
460
  "aria-label": Y("security.secretDetail.rotate.newValue", "New Secret Value"),
456
- ref: G,
461
+ ref: W,
457
462
  value: q,
458
463
  onChange: (e) => J(e.target.value),
459
464
  placeholder: Y("security.secretDetail.rotate.placeholder", "Enter new secret value..."),
@@ -461,27 +466,34 @@ function E() {
461
466
  className: n("w-full rounded-md border border-border bg-background px-3 py-2 text-sm font-mono transition-all", "focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary", "placeholder:text-muted-foreground/50")
462
467
  })]
463
468
  }),
464
- /* @__PURE__ */ _("div", {
469
+ /* @__PURE__ */ y("div", {
465
470
  className: "flex justify-end gap-3 pt-2",
466
- children: [/* @__PURE__ */ g(a, {
471
+ children: [/* @__PURE__ */ v(a, {
467
472
  variant: "outline",
468
- onClick: () => W(!1),
469
- disabled: V,
473
+ onClick: () => U(!1),
474
+ disabled: z,
470
475
  children: Y("security.common.actions.cancel", "Cancel")
471
- }), /* @__PURE__ */ _(a, {
472
- onClick: Ne,
473
- disabled: V || !q.trim(),
474
- children: [V ? /* @__PURE__ */ g(S, { className: "size-4 animate-spin" }) : /* @__PURE__ */ g(C, { className: "size-4" }), V ? Y("security.secretDetail.rotate.loading", "Rotating...") : Y("security.secretDetail.rotate.confirm", "Rotate Secret")]
476
+ }), /* @__PURE__ */ y(a, {
477
+ onClick: Re,
478
+ disabled: z || !q.trim(),
479
+ children: [z ? /* @__PURE__ */ v(S, { className: "size-4 animate-spin" }) : /* @__PURE__ */ v(C, { className: "size-4" }), z ? Y("security.secretDetail.rotate.loading", "Rotating...") : Y("security.secretDetail.rotate.confirm", "Rotate Secret")]
475
480
  })]
476
481
  })
477
482
  ]
478
483
  })
479
484
  })]
485
+ }),
486
+ D && O && /* @__PURE__ */ v(m, {
487
+ isOpen: Ne,
488
+ onClose: () => H(!1),
489
+ vaultId: D,
490
+ secretId: O,
491
+ name: L.name
480
492
  })
481
493
  ]
482
494
  });
483
495
  }
484
496
  //#endregion
485
- export { E as SecretDetailPage };
497
+ export { D as SecretDetailPage };
486
498
 
487
499
  //# sourceMappingURL=SecretDetailPage.js.map