@burdenoff/microfe-bigconsole 2026.1110.7 → 2026.1111.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.
@@ -7,29 +7,30 @@ import oe from "../hooks/useParserOperations.js";
7
7
  import se from "../hooks/useDataSinkOperations.js";
8
8
  import ce from "../hooks/useDashboardOperations.js";
9
9
  import { CacheTTLSelector as le } from "../components/datasink/CacheTTLSelector.js";
10
+ import { ExpressionEditor as ue } from "../components/parser/ExpressionEditor.js";
10
11
  import "../components/common/index.js";
11
12
  import { BIGCONSOLE_PERMISSIONS as r } from "../../constants/permissions.js";
12
- import { memo as i, useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
13
- import { useParams as ue } from "react-router";
14
- import { AccessDenied as de, PermissionButton as fe } from "@burdenoff/fe-libs/shared/components";
15
- import { usePermissions as pe } from "@burdenoff/fe-libs/shared/providers/shell";
16
- import { AlertCircle as u, ArrowLeft as me, CheckCircle2 as he, ChevronDown as ge, ChevronRight as _e, Code as ve, Download as ye, Eye as be, FileCode2 as xe, LayoutDashboard as Se, Loader2 as d, Play as Ce, Save as we, Settings as Te, X as Ee } from "lucide-react";
17
- import { Button as f, PagePurpose as De, Stepper as Oe } from "@burdenoff/fe-libs/ui";
18
- import { useUnsavedChanges as ke } from "@burdenoff/fe-libs/shared/hooks";
19
- import { useI18n as Ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
20
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ import { memo as i, useCallback as a, useEffect as o, useMemo as s, useRef as de, useState as c } from "react";
14
+ import { useParams as fe } from "react-router";
15
+ import { AccessDenied as pe, PermissionButton as me } from "@burdenoff/fe-libs/shared/components";
16
+ import { usePermissions as he } from "@burdenoff/fe-libs/shared/providers/shell";
17
+ import { AlertCircle as l, ArrowLeft as ge, CheckCircle2 as _e, ChevronDown as ve, ChevronRight as ye, Code as be, Download as xe, Eye as Se, FileCode2 as Ce, LayoutDashboard as we, Loader2 as u, Play as Te, Save as Ee, Settings as De, Timer as Oe, X as ke } from "lucide-react";
18
+ import { Button as d, PagePurpose as Ae, Stepper as je } from "@burdenoff/fe-libs/ui";
19
+ import { useUnsavedChanges as Me } from "@burdenoff/fe-libs/shared/hooks";
20
+ import { useI18n as Ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
21
22
  // src/bigconsole/pages/ParserBuilderPage.tsx
22
- var g = "w-full min-w-0 min-h-control-md rounded-md border bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-action-primary-bg motion-safe:transition-colors disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60";
23
- function _(e = !1, t = "") {
24
- return `${g} ${e ? "border-status-error-border" : "border-[var(--color-border-default)]"} ${t}`.trim();
23
+ var h = "w-full min-w-0 min-h-[44px] rounded-md border bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-action-primary-bg motion-safe:transition-colors disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60";
24
+ function g(e = !1, t = "") {
25
+ return `${h} ${e ? "border-status-error-border" : "border-[var(--color-border-default)]"} ${t}`.trim();
25
26
  }
26
- var v = "block text-sm font-medium text-text-primary mb-2", y = "text-xs text-text-muted mt-1.5", b = 25, je = "default", Me = [
27
+ var _ = "block text-sm font-medium text-text-primary mb-2", v = "text-xs text-text-muted mt-1.5", Pe = "text-xs text-status-error-text mt-1.5", Fe = 1e3, Ie = "220px", y = 25, Le = "default", Re = [
27
28
  "details",
28
29
  "source",
29
30
  "expression",
30
31
  "review"
31
32
  ];
32
- function Ne(e) {
33
+ function ze(e) {
33
34
  return [
34
35
  {
35
36
  key: "details",
@@ -53,14 +54,14 @@ function Ne(e) {
53
54
  }
54
55
  ];
55
56
  }
56
- function Pe(e) {
57
+ function Be(e) {
57
58
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").substring(0, 64);
58
59
  }
59
- function Fe(e, t) {
60
+ function Ve(e, t) {
60
61
  let n = {};
61
62
  return e.name.trim() ? e.name.length < 2 && (n.name = t("bigconsole.parsers.builder.validation.nameMinLength", "Name must be at least 2 characters")) : n.name = t("bigconsole.parsers.builder.validation.nameRequired", "Name is required"), e.outputKey.trim() ? /^[a-z0-9_]+$/.test(e.outputKey) || (n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyInvalid", "Output key can only contain lowercase letters, numbers, and underscores")) : n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyRequired", "Output key is required"), e.expression.trim() || (n.expression = t("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required")), e.inputSinkKey.trim() || (n.inputSinkKey = t("bigconsole.parsers.builder.validation.inputSinkRequired", "Source DataSink is required")), e.ttl != null && e.ttl > 0 && (e.ttl < 30 || e.ttl > 86400) && (n.ttl = t("bigconsole.parsers.builder.validation.cacheDurationRange", "Cache duration must be between 30 and 86400 seconds")), n;
62
63
  }
63
- function Ie(e) {
64
+ function He(e) {
64
65
  return {
65
66
  jq: {
66
67
  name: e("bigconsole.parsers.builder.parserType.jq.name", "JQ"),
@@ -76,8 +77,8 @@ function Ie(e) {
76
77
  }
77
78
  };
78
79
  }
79
- var x = i(function() {
80
- let { parserId: i, consoleId: g } = ue(), x = e(), { t: S } = Ae(), Le = s(() => Ne(S), [S]), C = s(() => Ie(S), [S]), w = Le.length, [T, E] = l(0), [D, Re] = l(je), ze = g || D || je, O = i !== "new" && !!i, { hasPermission: Be, isLoading: Ve } = pe(), He = Be(r.PARSER_READ), Ue = Be(O ? r.PARSER_UPDATE : r.PARSER_CREATE), We = O ? r.PARSER_UPDATE : r.PARSER_CREATE, Ge = Be(r.PARSER_TEST), k = !g, [A, j] = l({
80
+ var b = i(function() {
81
+ let { parserId: i, consoleId: h } = fe(), b = e(), { t: x } = Ne(), Ue = s(() => ze(x), [x]), We = s(() => He(x), [x]), S = Ue.length, [C, w] = c(0), [T, Ge] = c(Le), Ke = h || T || Le, E = i !== "new" && !!i, { hasPermission: qe, isLoading: Je } = he(), Ye = qe(r.PARSER_READ), Xe = qe(E ? r.PARSER_UPDATE : r.PARSER_CREATE), Ze = E ? r.PARSER_UPDATE : r.PARSER_CREATE, Qe = qe(r.PARSER_TEST), D = !h, [O, k] = c({
81
82
  name: "",
82
83
  outputKey: "",
83
84
  description: "",
@@ -85,545 +86,569 @@ var x = i(function() {
85
86
  expression: "",
86
87
  inputSinkKey: "",
87
88
  ttl: 900
88
- }), [M, Ke] = l(() => O ? null : A);
89
- ke({
89
+ }), [A, $e] = c(() => E ? null : O);
90
+ Me({
90
91
  id: "parser-editor",
91
- label: S("bigconsole.assistant.unsaved.parserEditor", "the parser editor"),
92
- dirty: ee(A, M)
92
+ label: x("bigconsole.assistant.unsaved.parserEditor", "the parser editor"),
93
+ dirty: ee(O, A)
93
94
  });
94
- let [N, P] = l({}), [qe, Je] = l(!1), [Ye, Xe] = l(!1), [Ze, Qe] = l(null), [$e, F] = l("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [et, I] = l(""), [L, R] = l(null), [tt, nt] = l(!1), [z, B] = l(null), [rt, it] = l(null), [at, ot] = l(null), [st, V] = l(!1), [H, ct] = l(!1), [U, lt] = l(null), [ut, dt] = l(!1), W = c(A.inputSinkKey);
95
+ let [j, M] = c({}), [et, tt] = c(!1), [nt, rt] = c(!1), [it, at] = c(null), [ot, N] = c("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [st, P] = c(""), [ct, F] = c(null), [I, L] = c(null), [R, lt] = c(!1), [z, B] = c(null), [ut, dt] = c(null), [ft, pt] = c(null), [mt, V] = c(!1), [H, ht] = c(!1), [U, gt] = c(null), [_t, vt] = c(!1), W = de(O.inputSinkKey);
95
96
  o(() => {
96
- W.current = A.inputSinkKey;
97
- }, [A.inputSinkKey]);
98
- let [G, ft] = l(!1), [pt, mt] = l(null), [ht, gt] = l(!1), [_t, K] = l(null), [q, vt] = l(null), { loading: yt, error: bt, parsers: xt, fetchParser: St, createParser: Ct, updateParser: wt, testParserExpression: Tt } = oe({
99
- consoleId: ze || "",
97
+ W.current = O.inputSinkKey;
98
+ }, [O.inputSinkKey]);
99
+ let [G, yt] = c(!1), [bt, xt] = c(null), [St, Ct] = c(!1), [wt, K] = c(null), [q, Tt] = c(null), { loading: Et, error: Dt, parsers: Ot, fetchParser: kt, createParser: At, updateParser: jt, testParserExpression: Mt } = oe({
100
+ consoleId: Ke || "",
100
101
  skipFetch: !0
101
- }), { dataSinks: J, fetchDataSinks: Et, getDataSinkData: Y } = se({ skipFetch: !0 }), { dashboards: Dt, fetchDashboards: Ot, loading: kt } = ce(), X = O ? xt.find((e) => e.id === i) : null;
102
+ }), { dataSinks: J, fetchDataSinks: Nt, getDataSinkData: Pt } = se({ skipFetch: !0 }), { dashboards: Ft, fetchDashboards: It, loading: Lt } = ce(), Y = E ? Ot.find((e) => e.id === i) : null;
102
103
  o(() => {
103
- Et(), O && i && St(i), k && Ot();
104
+ Nt(), E && i && kt(i), D && It();
104
105
  }, [
105
- O,
106
+ E,
106
107
  i,
107
- St,
108
- Et,
109
- k,
110
- Ot
108
+ kt,
109
+ Nt,
110
+ D,
111
+ It
111
112
  ]);
112
- let At = c(null), jt = c(A), Mt = c(M);
113
+ let Rt = de(null), zt = de(O), Bt = de(A);
113
114
  o(() => {
114
- jt.current = A, Mt.current = M;
115
- }, [A, M]), o(() => {
116
- if (X && te(At.current, X.id, jt.current, Mt.current)) {
117
- At.current = X.id;
115
+ zt.current = O, Bt.current = A;
116
+ }, [O, A]), o(() => {
117
+ if (Y && te(Rt.current, Y.id, zt.current, Bt.current)) {
118
+ Rt.current = Y.id;
118
119
  let e = {
119
- name: X.name || "",
120
- outputKey: X.outputKey || "",
121
- description: X.description || "",
122
- type: X.type,
123
- expression: X.expression || "",
124
- inputSinkKey: X.inputSinkKey || "",
125
- ttl: X.ttl ?? null
120
+ name: Y.name || "",
121
+ outputKey: Y.outputKey || "",
122
+ description: Y.description || "",
123
+ type: Y.type,
124
+ expression: Y.expression || "",
125
+ inputSinkKey: Y.inputSinkKey || "",
126
+ ttl: Y.ttl ?? null
126
127
  };
127
- j(e), Ke(e), Je(!0), it(e.expression.trim() ? ae(e.type, e.expression) : null), X.consoleId && Re(X.consoleId);
128
+ k(e), $e(e), tt(!0), dt(e.expression.trim() ? ae(e.type, e.expression) : null), Y.consoleId && Ge(Y.consoleId);
128
129
  }
129
- }, [X]);
130
- let Z = s(() => J.find((e) => e.key === A.inputSinkKey)?.name || A.inputSinkKey, [J, A.inputSinkKey]), Nt = a((e) => {
130
+ }, [Y]);
131
+ let X = s(() => J.find((e) => e.key === O.inputSinkKey)?.name || O.inputSinkKey, [J, O.inputSinkKey]), Vt = a((e) => {
131
132
  let t = e.target.value;
132
- j((e) => ({
133
+ k((e) => ({
133
134
  ...e,
134
135
  name: t,
135
- outputKey: qe ? e.outputKey : Pe(t)
136
- })), P((e) => ({
136
+ outputKey: et ? e.outputKey : Be(t)
137
+ })), M((e) => ({
137
138
  ...e,
138
139
  name: void 0
139
140
  }));
140
- }, [qe]), Pt = a((e) => {
141
+ }, [et]), Ht = a((e) => {
141
142
  let t = e.target.value.toLowerCase().replace(/[^a-z0-9_]/g, "");
142
- j((e) => ({
143
+ k((e) => ({
143
144
  ...e,
144
145
  outputKey: t
145
- })), Je(!0), P((e) => ({
146
+ })), tt(!0), M((e) => ({
146
147
  ...e,
147
148
  outputKey: void 0
148
149
  }));
149
- }, []), Ft = a((e) => {
150
- j((t) => ({
150
+ }, []), Ut = a((e) => {
151
+ k((t) => ({
151
152
  ...t,
152
153
  description: e.target.value
153
154
  }));
154
- }, []), It = a((e) => {
155
- j((t) => ({
155
+ }, []), Wt = a((e) => {
156
+ k((t) => ({
156
157
  ...t,
157
158
  type: e
158
- })), I(""), R(null), ot(null);
159
- }, []), Lt = a((e) => {
160
- j((t) => ({
159
+ })), P(""), L(null), F(null), pt(null);
160
+ }, []), Gt = a((e) => {
161
+ k((t) => ({
161
162
  ...t,
162
- expression: e.target.value
163
- })), P((e) => ({
163
+ expression: e
164
+ })), M((e) => ({
164
165
  ...e,
165
166
  expression: void 0
166
167
  }));
167
- }, []), Rt = a((e) => {
168
- j((t) => ({
168
+ }, []), Kt = a((e) => {
169
+ k((t) => ({
169
170
  ...t,
170
171
  inputSinkKey: e.target.value
171
- })), P((e) => ({
172
+ })), M((e) => ({
172
173
  ...e,
173
174
  inputSinkKey: void 0
174
- })), ft(!1), mt(null), vt(null), K(null), H && (F(""), ct(!1), V(!1)), lt(null), I(""), R(null), B(null);
175
- }, [H]), zt = a((e) => {
176
- j((t) => ({
175
+ })), yt(!1), xt(null), Tt(null), K(null), H && (N(""), ht(!1), V(!1)), gt(null), P(""), L(null), B(null), F(null);
176
+ }, [H]), qt = a((e) => {
177
+ k((t) => ({
177
178
  ...t,
178
179
  ttl: e
179
- })), P((e) => ({
180
+ })), M((e) => ({
180
181
  ...e,
181
182
  ttl: void 0
182
183
  }));
183
- }, []), Bt = a((e) => {
184
- Re(e.target.value);
185
- }, []), Vt = a((e) => {
186
- F(e.target.value);
187
- }, []), Ht = a((e) => {
184
+ }, []), Jt = a((e) => {
185
+ Ge(e.target.value);
186
+ }, []), Yt = a((e) => {
187
+ N(e);
188
+ }, []), Xt = a((e) => {
188
189
  H && ie(e) && V(!0);
189
- }, [H]), Ut = a(() => {
190
+ }, [H]), Zt = a(() => {
190
191
  H && V(!0);
191
- }, [H]), Wt = a(async () => {
192
- let e = A.inputSinkKey;
192
+ }, [H]), Qt = a(async () => {
193
+ let e = O.inputSinkKey;
193
194
  if (e) {
194
- dt(!0);
195
+ vt(!0);
195
196
  try {
196
- let t = await Y({ key: e }, { limit: b });
197
+ let t = await Pt({ key: e }, { limit: y });
197
198
  if (W.current !== e) return;
198
- t?.raw !== void 0 && t?.raw !== null ? (F(JSON.stringify(t.raw, null, 2)), ct(!0), V(!1), lt({
199
+ t?.raw !== void 0 && t?.raw !== null ? (N(JSON.stringify(t.raw, null, 2)), ht(!0), V(!1), gt({
199
200
  total: t.totalCount ?? null,
200
201
  hasMore: t.hasMore ?? null,
201
- sinkName: Z
202
- }), I(""), R(null), B(null)) : R(S("bigconsole.parsers.builder.errors.loadSampleFailed", "Could not load a sample from the selected DataSink."));
202
+ sinkName: X
203
+ }), P(""), L(null), B(null), F(null)) : L(x("bigconsole.parsers.builder.errors.loadSampleFailed", "Could not load a sample from the selected DataSink."));
203
204
  } catch (t) {
204
205
  if (W.current !== e) return;
205
- R(t instanceof Error ? t.message : S("bigconsole.parsers.builder.errors.loadSampleDataFailed", "Failed to load sample data"));
206
+ L(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadSampleDataFailed", "Failed to load sample data"));
206
207
  } finally {
207
- dt(!1);
208
+ vt(!1);
208
209
  }
209
210
  }
210
211
  }, [
211
- A.inputSinkKey,
212
- Y,
213
- Z,
214
- S
215
- ]), Gt = a(() => {
216
- F(""), ct(!1), V(!1), lt(null), B(null), I(""), R(null);
217
- }, []), Kt = a(async () => {
212
+ O.inputSinkKey,
213
+ Pt,
214
+ X,
215
+ x
216
+ ]), $t = a(() => {
217
+ N(""), ht(!1), V(!1), gt(null), B(null), P(""), L(null), F(null);
218
+ }, []), en = a(async () => {
218
219
  if (G) {
219
- ft(!1);
220
+ yt(!1);
220
221
  return;
221
222
  }
222
- if (!A.inputSinkKey) {
223
- K(S("bigconsole.parsers.builder.errors.selectSourceFirst", "Please select a source DataSink first"));
223
+ if (!O.inputSinkKey) {
224
+ K(x("bigconsole.parsers.builder.errors.selectSourceFirst", "Please select a source DataSink first"));
224
225
  return;
225
226
  }
226
- ft(!0), gt(!0), K(null);
227
- let e = A.inputSinkKey;
227
+ yt(!0), Ct(!0), K(null);
228
+ let e = O.inputSinkKey;
228
229
  try {
229
- let t = await Y({ key: e }, { limit: b });
230
+ let t = await Pt({ key: e }, { limit: y });
230
231
  if (W.current !== e) return;
231
- t?.raw !== void 0 && t?.raw !== null ? (mt(t.raw), vt({
232
+ t?.raw !== void 0 && t?.raw !== null ? (xt(t.raw), Tt({
232
233
  total: t.totalCount ?? null,
233
234
  hasMore: t.hasMore ?? null,
234
- sinkName: Z
235
- })) : K(S("bigconsole.parsers.builder.errors.noDataInSink", "No data available in selected DataSink"));
235
+ sinkName: X
236
+ })) : K(x("bigconsole.parsers.builder.errors.noDataInSink", "No data available in selected DataSink"));
236
237
  } catch (t) {
237
238
  if (W.current !== e) return;
238
- K(t instanceof Error ? t.message : S("bigconsole.parsers.builder.errors.loadDataFailed", "Failed to load data"));
239
+ K(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadDataFailed", "Failed to load data"));
239
240
  } finally {
240
- gt(!1);
241
+ Ct(!1);
241
242
  }
242
243
  }, [
243
244
  G,
244
- A.inputSinkKey,
245
- Y,
246
- Z,
247
- S
248
- ]), qt = a(async () => {
249
- if (!A.expression.trim()) {
250
- R(S("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required"));
245
+ O.inputSinkKey,
246
+ Pt,
247
+ X,
248
+ x
249
+ ]), tn = a(async () => {
250
+ if (F(null), !O.expression.trim()) {
251
+ L(x("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required"));
251
252
  return;
252
253
  }
253
254
  let e;
254
255
  if (H) e = {
255
- type: A.type,
256
- expression: A.expression,
257
- dataSinkKey: A.inputSinkKey,
258
- sampleLimit: b
256
+ type: O.type,
257
+ expression: O.expression,
258
+ dataSinkKey: O.inputSinkKey,
259
+ sampleLimit: y
259
260
  };
260
261
  else {
261
262
  let t;
262
263
  try {
263
- t = JSON.parse($e);
264
+ t = JSON.parse(ot);
264
265
  } catch {
265
- R(S("bigconsole.parsers.builder.errors.invalidInputJson", "Input JSON is not valid JSON"));
266
+ L(x("bigconsole.parsers.builder.errors.invalidInputJson", "Input JSON is not valid JSON"));
266
267
  return;
267
268
  }
268
269
  e = {
269
- type: A.type,
270
- expression: A.expression,
270
+ type: O.type,
271
+ expression: O.expression,
271
272
  sampleData: t
272
273
  };
273
274
  }
274
- let t = ae(A.type, A.expression);
275
- nt(!0), R(null), I(""), B(null), it(null), ot(t);
275
+ let t = ae(O.type, O.expression);
276
+ lt(!0), L(null), P(""), B(null), dt(null), pt(t);
276
277
  try {
277
- let n = await Tt(e);
278
- n ? n.success ? (I(JSON.stringify(n.output, null, 2)), it(t), n.sampled && B({
278
+ let n = await Mt(e);
279
+ n ? (F(n.executionTimeMs), n.success ? (P(JSON.stringify(n.output, null, 2)), dt(t), n.sampled && B({
279
280
  sampledRows: n.sampledRows ?? null,
280
281
  totalRows: n.totalRows ?? null
281
- })) : R(n.error || S("bigconsole.parsers.builder.errors.testFailed", "Test failed")) : R(S("bigconsole.parsers.builder.errors.testRequestFailed", "Test request failed — please try again."));
282
+ })) : L(n.error || x("bigconsole.parsers.builder.errors.testFailed", "Test failed"))) : L(x("bigconsole.parsers.builder.errors.testRequestFailed", "Test request failed — please try again."));
282
283
  } catch (e) {
283
- R(e instanceof Error ? e.message : S("bigconsole.parsers.builder.errors.testFailed", "Test failed"));
284
+ L(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.testFailed", "Test failed"));
284
285
  } finally {
285
- nt(!1);
286
+ lt(!1);
286
287
  }
287
288
  }, [
288
- A.type,
289
- A.expression,
290
- A.inputSinkKey,
291
- $e,
289
+ O.type,
290
+ O.expression,
291
+ O.inputSinkKey,
292
+ ot,
292
293
  H,
293
- Tt,
294
- S
295
- ]), Q = a(() => {
296
- x(g ? `/dashboards/${g}/parsers` : "/parsers");
297
- }, [x, g]), Jt = re({
298
- type: A.type,
299
- expression: A.expression,
300
- passedSignature: rt,
301
- canTest: Ge
302
- }), $ = ne(Jt), Yt = at !== null && at !== ae(A.type, A.expression), Xt = a(async () => {
303
- Qe(null);
304
- let e = Fe(A, S);
305
- if (Object.keys(e).length > 0) P(e), e.name || e.outputKey ? E(0) : e.inputSinkKey ? E(1) : e.expression && E(2);
306
- else if (!$) E(2);
294
+ Mt,
295
+ x
296
+ ]), Z = a(() => {
297
+ b(h ? `/dashboards/${h}/parsers` : "/parsers");
298
+ }, [b, h]), nn = re({
299
+ type: O.type,
300
+ expression: O.expression,
301
+ passedSignature: ut,
302
+ canTest: Qe
303
+ }), Q = ne(nn), rn = ft !== null && ft !== ae(O.type, O.expression), an = a(async () => {
304
+ at(null);
305
+ let e = Ve(O, x);
306
+ if (Object.keys(e).length > 0) M(e), e.name || e.outputKey ? w(0) : e.inputSinkKey ? w(1) : e.expression && w(2);
307
+ else if (!Q) w(2);
307
308
  else {
308
- Xe(!0);
309
+ rt(!0);
309
310
  try {
310
- if (O && X) {
311
- if (!await wt(X.id, {
312
- name: A.name,
313
- description: A.description || void 0,
314
- expression: A.expression,
315
- inputSinkKey: A.inputSinkKey,
316
- outputKey: A.outputKey,
317
- ttl: A.ttl
318
- }, X.version)) throw Error(S("bigconsole.parsers.builder.errors.updateFailed", "Failed to update parser"));
319
- } else if (!await Ct({
320
- consoleId: ze || "",
321
- name: A.name,
322
- type: A.type,
323
- expression: A.expression,
324
- inputSinkKey: A.inputSinkKey,
325
- outputKey: A.outputKey,
326
- description: A.description || void 0,
327
- ttl: A.ttl ?? void 0
328
- })) throw Error(S("bigconsole.parsers.builder.errors.createFailed", "Failed to create parser"));
329
- Ke(A), Q();
311
+ if (E && Y) {
312
+ if (!await jt(Y.id, {
313
+ name: O.name,
314
+ description: O.description || void 0,
315
+ expression: O.expression,
316
+ inputSinkKey: O.inputSinkKey,
317
+ outputKey: O.outputKey,
318
+ ttl: O.ttl
319
+ }, Y.version)) throw Error(x("bigconsole.parsers.builder.errors.updateFailed", "Failed to update parser"));
320
+ } else if (!await At({
321
+ consoleId: Ke || "",
322
+ name: O.name,
323
+ type: O.type,
324
+ expression: O.expression,
325
+ inputSinkKey: O.inputSinkKey,
326
+ outputKey: O.outputKey,
327
+ description: O.description || void 0,
328
+ ttl: O.ttl ?? void 0
329
+ })) throw Error(x("bigconsole.parsers.builder.errors.createFailed", "Failed to create parser"));
330
+ $e(O), Z();
330
331
  } catch (e) {
331
- Qe(e instanceof Error ? e.message : S("bigconsole.parsers.builder.errors.saveFailed", "Failed to save parser"));
332
+ at(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.saveFailed", "Failed to save parser"));
332
333
  } finally {
333
- Xe(!1);
334
+ rt(!1);
334
335
  }
335
336
  }
336
337
  }, [
337
- A,
338
- $,
339
338
  O,
340
- X,
341
- Ct,
342
- wt,
343
- ze,
344
339
  Q,
345
- S
346
- ]), Zt = s(() => A.name.trim().length >= 2 && A.expression.trim().length > 0 && $ && A.inputSinkKey.trim().length > 0 && A.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(A.outputKey), [
347
- A.name,
348
- A.expression,
349
- $,
350
- A.inputSinkKey,
351
- A.outputKey
352
- ]), Qt = a((e) => {
353
- switch (Me[e]) {
354
- case "details": return A.name.trim().length >= 2 && A.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(A.outputKey);
355
- case "source": return A.inputSinkKey.trim().length > 0;
356
- case "expression": return $;
340
+ E,
341
+ Y,
342
+ At,
343
+ jt,
344
+ Ke,
345
+ Z,
346
+ x
347
+ ]), on = s(() => O.name.trim().length >= 2 && O.expression.trim().length > 0 && Q && O.inputSinkKey.trim().length > 0 && O.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(O.outputKey), [
348
+ O.name,
349
+ O.expression,
350
+ Q,
351
+ O.inputSinkKey,
352
+ O.outputKey
353
+ ]), $ = a((e) => {
354
+ switch (Re[e]) {
355
+ case "details": return O.name.trim().length >= 2 && O.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(O.outputKey);
356
+ case "source": return O.inputSinkKey.trim().length > 0;
357
+ case "expression": return Q;
357
358
  default: return !0;
358
359
  }
359
360
  }, [
360
- A.name,
361
- A.outputKey,
362
- A.inputSinkKey,
363
- $
364
- ]), $t = a((e) => {
365
- let t = Math.max(0, Math.min(e, w - 1));
366
- if (t > T) {
367
- for (let e = T; e < t; e++) if (!Qt(e)) return;
361
+ O.name,
362
+ O.outputKey,
363
+ O.inputSinkKey,
364
+ Q
365
+ ]), sn = a((e) => {
366
+ let t = Math.max(0, Math.min(e, S - 1));
367
+ if (t > C) {
368
+ for (let e = C; e < t; e++) if (!$(e)) return;
368
369
  }
369
- E(t);
370
+ w(t);
370
371
  }, [
371
- T,
372
- Qt,
373
- w
374
- ]), en = a(() => {
375
- E((e) => Math.min(e + 1, w - 1));
376
- }, [w]), tn = a(() => {
377
- E((e) => Math.max(e - 1, 0));
372
+ C,
373
+ $,
374
+ S
375
+ ]), cn = a(() => {
376
+ $(C) && w(Math.min(C + 1, S - 1));
377
+ }, [
378
+ C,
379
+ $,
380
+ S
381
+ ]), ln = a(() => {
382
+ w((e) => Math.max(e - 1, 0));
378
383
  }, []);
379
- if (yt && O || Ve) return /* @__PURE__ */ m("div", {
384
+ if (Et && E || Je) return /* @__PURE__ */ p("div", {
380
385
  className: "flex items-center justify-center min-h-[400px]",
381
- children: /* @__PURE__ */ m(d, { className: "w-8 h-8 text-text-secondary animate-spin" })
386
+ children: /* @__PURE__ */ p(u, { className: "w-8 h-8 text-text-secondary animate-spin" })
382
387
  });
383
- if (O && !He) return /* @__PURE__ */ m(de, {
384
- title: S("bigconsole.parsers.builder.accessDenied.title", "Access Denied"),
385
- description: S("bigconsole.parsers.builder.accessDenied.description", "You don't have permission to view this parser.")
388
+ if (E && !Ye) return /* @__PURE__ */ p(pe, {
389
+ title: x("bigconsole.parsers.builder.accessDenied.title", "Access Denied"),
390
+ description: x("bigconsole.parsers.builder.accessDenied.description", "You don't have permission to view this parser.")
386
391
  });
387
- if (bt) return /* @__PURE__ */ m("div", {
392
+ if (Dt) return /* @__PURE__ */ p("div", {
388
393
  className: "p-card-padding",
389
- children: /* @__PURE__ */ m(t, {
394
+ children: /* @__PURE__ */ p(t, {
390
395
  tone: "danger",
391
396
  headingLevel: 2,
392
- title: S("bigconsole.parsers.builder.errors.loadParserFailed", "Failed to load Parser"),
397
+ title: x("bigconsole.parsers.builder.errors.loadParserFailed", "Failed to load Parser"),
393
398
  description: "The parser could not be fetched, so the form cannot be filled in.",
394
- icon: /* @__PURE__ */ m(u, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
395
- actions: /* @__PURE__ */ h(f, {
396
- onClick: Q,
399
+ icon: /* @__PURE__ */ p(l, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
400
+ actions: /* @__PURE__ */ m(d, {
401
+ onClick: Z,
397
402
  variant: "secondary",
398
403
  size: "sm",
399
- children: [/* @__PURE__ */ m(me, { className: "w-4 h-4 mr-2" }), S("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
404
+ children: [/* @__PURE__ */ p(ge, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
400
405
  }),
401
406
  "data-testid": "parser-builder-load-error",
402
- children: /* @__PURE__ */ m("p", {
407
+ children: /* @__PURE__ */ p("p", {
403
408
  className: "font-mono text-xs break-words text-text-secondary",
404
- children: bt.message
409
+ children: Dt.message
405
410
  })
406
411
  })
407
412
  });
408
- let nn = C[A.type], rn = T === w - 1, an = /* @__PURE__ */ m("span", {
413
+ let un = We[O.type], dn = C === S - 1, fn = /* @__PURE__ */ p("span", {
409
414
  className: "text-xs font-medium text-text-muted",
410
- children: S("bigconsole.parsers.builder.header.stepCounter", "Step {{current}} of {{total}}", {
411
- current: T + 1,
412
- total: w
415
+ children: x("bigconsole.parsers.builder.header.stepCounter", "Step {{current}} of {{total}}", {
416
+ current: C + 1,
417
+ total: S
413
418
  })
414
419
  });
415
- return /* @__PURE__ */ m("div", {
420
+ return /* @__PURE__ */ p("div", {
416
421
  "data-tour": "bigconsole-parser-builder",
417
422
  className: "min-h-screen bg-bg-canvas",
418
- children: /* @__PURE__ */ m("div", {
423
+ children: /* @__PURE__ */ p("div", {
419
424
  className: "max-w-4xl mx-auto p-card-padding pb-10",
420
- children: /* @__PURE__ */ h(n, { children: [
421
- /* @__PURE__ */ h("div", {
425
+ children: /* @__PURE__ */ m(n, { children: [
426
+ /* @__PURE__ */ m("div", {
422
427
  className: "border-b border-[var(--color-border-subtle)] pb-form-gap",
423
428
  children: [
424
- /* @__PURE__ */ h(f, {
425
- onClick: Q,
429
+ /* @__PURE__ */ m(d, {
430
+ onClick: Z,
426
431
  variant: "ghost",
427
432
  size: "sm",
428
433
  className: "mb-4",
429
- children: [/* @__PURE__ */ m(me, { className: "w-4 h-4 mr-2" }), S("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
434
+ children: [/* @__PURE__ */ p(ge, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
430
435
  }),
431
- /* @__PURE__ */ m("h1", {
436
+ /* @__PURE__ */ p("h1", {
432
437
  className: "text-2xl font-bold text-text-primary sm:text-3xl",
433
- children: O ? S("bigconsole.parsers.builder.header.editTitle", "Edit Parser") : S("bigconsole.parsers.builder.header.createTitle", "Create Parser")
438
+ children: E ? x("bigconsole.parsers.builder.header.editTitle", "Edit Parser") : x("bigconsole.parsers.builder.header.createTitle", "Create Parser")
434
439
  }),
435
- /* @__PURE__ */ m("p", {
440
+ /* @__PURE__ */ p("p", {
436
441
  className: "text-sm text-text-secondary mt-1",
437
- children: S("bigconsole.parsers.builder.header.subtitle", "Transform data using JQ or JSONata expressions.")
442
+ children: x("bigconsole.parsers.builder.header.subtitle", "Transform data using JQ or JSONata expressions.")
438
443
  })
439
444
  ]
440
445
  }),
441
- /* @__PURE__ */ m(De, {
446
+ /* @__PURE__ */ p(Ae, {
442
447
  className: "max-w-[80ch]",
443
- children: S("bigconsole.parsers.builder.header.purpose", "A parser maps raw input into structured fields using a JQ or JSONata expression. Write the expression, run it against a sample to confirm the output, and save it once it produces the shape you need — then reuse it across pipelines to normalise any source.")
448
+ children: x("bigconsole.parsers.builder.header.purpose", "A parser maps raw input into structured fields using a JQ or JSONata expression. Write the expression, run it against a sample to confirm the output, and save it once it produces the shape you need — then reuse it across pipelines to normalise any source.")
444
449
  }),
445
- /* @__PURE__ */ m("div", {
450
+ /* @__PURE__ */ p("div", {
446
451
  className: "min-w-0 overflow-x-auto",
447
- children: /* @__PURE__ */ m(Oe, {
448
- steps: Le,
449
- active: T,
450
- onStepClick: $t
452
+ children: /* @__PURE__ */ p(je, {
453
+ steps: Ue,
454
+ active: C,
455
+ onStepClick: sn
451
456
  })
452
457
  }),
453
- Ze && /* @__PURE__ */ m(t, {
458
+ it && /* @__PURE__ */ p(t, {
454
459
  tone: "danger",
455
460
  headingLevel: 2,
456
- title: S("bigconsole.parsers.builder.errors.saveParserFailed", "Failed to save Parser"),
457
- icon: /* @__PURE__ */ m(u, { className: "h-icon-sm w-icon-sm text-[var(--color-status-error-text)]" }),
461
+ title: x("bigconsole.parsers.builder.errors.saveParserFailed", "Failed to save Parser"),
462
+ icon: /* @__PURE__ */ p(l, { className: "h-icon-sm w-icon-sm text-[var(--color-status-error-text)]" }),
458
463
  "data-testid": "parser-submit-error",
459
- children: /* @__PURE__ */ m("p", {
464
+ children: /* @__PURE__ */ p("p", {
460
465
  className: "font-mono text-xs break-words text-text-secondary",
461
- children: Ze
466
+ children: it
462
467
  })
463
468
  }),
464
- /* @__PURE__ */ h("form", {
469
+ /* @__PURE__ */ m("form", {
465
470
  className: "flex flex-col gap-section-gap",
466
471
  onSubmit: (e) => {
467
- e.preventDefault(), rn && Xt();
472
+ e.preventDefault(), dn && an();
468
473
  },
469
474
  children: [
470
- T === 0 && /* @__PURE__ */ h(t, {
475
+ C === 0 && /* @__PURE__ */ m(t, {
471
476
  emphasis: "primary",
472
477
  headingLevel: 2,
473
478
  title: "Basic information",
474
479
  description: "Essential details for your parser.",
475
- icon: /* @__PURE__ */ m(xe, { className: "h-icon-sm w-icon-sm" }),
476
- meta: an,
480
+ icon: /* @__PURE__ */ p(Ce, { className: "h-icon-sm w-icon-sm" }),
481
+ meta: fn,
477
482
  bodyClassName: "space-y-5",
478
483
  "data-testid": "parser-basic-information",
479
484
  children: [
480
- /* @__PURE__ */ h("div", {
485
+ /* @__PURE__ */ m("div", {
481
486
  className: "grid gap-5 sm:grid-cols-2",
482
- children: [/* @__PURE__ */ h("div", { children: [
483
- /* @__PURE__ */ h("label", {
487
+ children: [/* @__PURE__ */ m("div", { children: [
488
+ /* @__PURE__ */ m("label", {
484
489
  htmlFor: "name",
485
- className: v,
490
+ className: _,
486
491
  children: [
487
- S("bigconsole.parsers.builder.fields.name.label", "Name"),
492
+ x("bigconsole.parsers.builder.fields.name.label", "Name"),
488
493
  " ",
489
- /* @__PURE__ */ m("span", {
494
+ /* @__PURE__ */ p("span", {
490
495
  className: "text-status-error-text",
491
496
  children: "*"
492
497
  })
493
498
  ]
494
499
  }),
495
- /* @__PURE__ */ m("input", {
500
+ /* @__PURE__ */ p("input", {
496
501
  id: "name",
497
502
  type: "text",
498
- value: A.name,
499
- onChange: Nt,
500
- placeholder: S("bigconsole.parsers.builder.fields.name.placeholder", "e.g., User Analytics Parser"),
501
- className: _(!!N.name)
503
+ value: O.name,
504
+ onChange: Vt,
505
+ placeholder: x("bigconsole.parsers.builder.fields.name.placeholder", "e.g., User Analytics Parser"),
506
+ "aria-invalid": !!j.name,
507
+ "aria-describedby": j.name ? "name-error" : void 0,
508
+ className: g(!!j.name)
502
509
  }),
503
- N.name && /* @__PURE__ */ m("p", {
504
- className: "text-xs text-status-error-text mt-1.5",
505
- children: N.name
510
+ j.name && /* @__PURE__ */ p("p", {
511
+ id: "name-error",
512
+ className: Pe,
513
+ children: j.name
506
514
  })
507
- ] }), /* @__PURE__ */ h("div", { children: [
508
- /* @__PURE__ */ h("label", {
515
+ ] }), /* @__PURE__ */ m("div", { children: [
516
+ /* @__PURE__ */ m("label", {
509
517
  htmlFor: "outputKey",
510
- className: v,
518
+ className: _,
511
519
  children: [
512
- S("bigconsole.parsers.builder.fields.outputKey.label", "Output Key"),
520
+ x("bigconsole.parsers.builder.fields.outputKey.label", "Output Key"),
513
521
  " ",
514
- /* @__PURE__ */ m("span", {
522
+ /* @__PURE__ */ p("span", {
515
523
  className: "text-status-error-text",
516
524
  children: "*"
517
525
  })
518
526
  ]
519
527
  }),
520
- /* @__PURE__ */ m("input", {
528
+ /* @__PURE__ */ p("input", {
521
529
  id: "outputKey",
522
530
  type: "text",
523
- value: A.outputKey,
524
- onChange: Pt,
531
+ value: O.outputKey,
532
+ onChange: Ht,
525
533
  placeholder: "user_analytics_parser",
526
- disabled: O,
527
- className: _(!!N.outputKey, "font-mono")
534
+ disabled: E,
535
+ "aria-invalid": !!j.outputKey,
536
+ "aria-describedby": [j.outputKey ? "outputKey-error" : "", E ? "" : "outputKey-hint"].filter(Boolean).join(" ") || void 0,
537
+ className: g(!!j.outputKey, "font-mono")
528
538
  }),
529
- N.outputKey && /* @__PURE__ */ m("p", {
530
- className: "text-xs text-status-error-text mt-1.5",
531
- children: N.outputKey
539
+ j.outputKey && /* @__PURE__ */ p("p", {
540
+ id: "outputKey-error",
541
+ className: Pe,
542
+ children: j.outputKey
532
543
  }),
533
- !O && /* @__PURE__ */ m("p", {
534
- className: y,
535
- children: S("bigconsole.parsers.builder.fields.outputKey.helper", "Auto-generated from name. Customize if needed.")
544
+ !E && /* @__PURE__ */ p("p", {
545
+ id: "outputKey-hint",
546
+ className: v,
547
+ children: x("bigconsole.parsers.builder.fields.outputKey.helper", "Auto-generated from name. Customize if needed.")
536
548
  })
537
549
  ] })]
538
550
  }),
539
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
540
- htmlFor: "description",
541
- className: v,
542
- children: S("bigconsole.parsers.builder.fields.description.label", "Description")
543
- }), /* @__PURE__ */ m("textarea", {
544
- id: "description",
545
- value: A.description,
546
- onChange: Ft,
547
- placeholder: S("bigconsole.parsers.builder.fields.description.placeholder", "Describe what this parser does..."),
548
- rows: 3,
549
- className: _(!1, "resize-y")
550
- })] }),
551
- k && /* @__PURE__ */ h("div", { children: [
552
- /* @__PURE__ */ h("label", {
551
+ /* @__PURE__ */ m("div", { children: [
552
+ /* @__PURE__ */ p("label", {
553
+ htmlFor: "description",
554
+ className: _,
555
+ children: x("bigconsole.parsers.builder.fields.description.label", "Description")
556
+ }),
557
+ /* @__PURE__ */ p("textarea", {
558
+ id: "description",
559
+ value: O.description,
560
+ onChange: Ut,
561
+ placeholder: x("bigconsole.parsers.builder.fields.description.placeholder", "Describe what this parser does..."),
562
+ rows: 3,
563
+ maxLength: Fe,
564
+ "aria-describedby": "description-count",
565
+ className: g(!1, "resize-y")
566
+ }),
567
+ /* @__PURE__ */ p("p", {
568
+ id: "description-count",
569
+ className: `${v} text-right tabular-nums`,
570
+ children: x("bigconsole.parsers.builder.fields.description.characterCount", "{{current}} / {{max}} characters", {
571
+ current: O.description.length,
572
+ max: Fe
573
+ })
574
+ })
575
+ ] }),
576
+ D && /* @__PURE__ */ m("div", { children: [
577
+ /* @__PURE__ */ m("label", {
553
578
  htmlFor: "dashboard",
554
- className: `${v} flex items-center gap-2`,
555
- children: [/* @__PURE__ */ m(Se, {
579
+ className: `${_} flex items-center gap-2`,
580
+ children: [/* @__PURE__ */ p(we, {
556
581
  "aria-hidden": "true",
557
582
  className: "w-4 h-4"
558
- }), S("bigconsole.parsers.builder.fields.dashboard.label", "Dashboard Scope")]
583
+ }), x("bigconsole.parsers.builder.fields.dashboard.label", "Dashboard Scope")]
559
584
  }),
560
- /* @__PURE__ */ h("select", {
585
+ /* @__PURE__ */ m("select", {
561
586
  id: "dashboard",
562
- value: D,
563
- onChange: Bt,
564
- disabled: kt || O,
565
- className: _(),
566
- children: [/* @__PURE__ */ m("option", {
587
+ value: T,
588
+ onChange: Jt,
589
+ disabled: Lt || E,
590
+ className: g(),
591
+ children: [/* @__PURE__ */ p("option", {
567
592
  value: "default",
568
- children: S("bigconsole.parsers.builder.fields.dashboard.globalOption", "Global (available everywhere)")
569
- }), Dt.map((e) => /* @__PURE__ */ m("option", {
593
+ children: x("bigconsole.parsers.builder.fields.dashboard.globalOption", "Global (available everywhere)")
594
+ }), Ft.map((e) => /* @__PURE__ */ p("option", {
570
595
  value: e.id,
571
596
  children: e.name
572
597
  }, e.id))]
573
598
  }),
574
- /* @__PURE__ */ m("p", {
575
- className: y,
576
- children: O ? S("bigconsole.parsers.builder.fields.dashboard.helperLocked", "Dashboard scope cannot be changed after creation.") : D === "default" ? S("bigconsole.parsers.builder.fields.dashboard.helperGlobal", "Global parsers are available across all dashboards.") : S("bigconsole.parsers.builder.fields.dashboard.helperScoped", "This parser will only be available in the selected dashboard.")
599
+ /* @__PURE__ */ p("p", {
600
+ className: v,
601
+ children: E ? x("bigconsole.parsers.builder.fields.dashboard.helperLocked", "Dashboard scope cannot be changed after creation.") : T === "default" ? x("bigconsole.parsers.builder.fields.dashboard.helperGlobal", "Global parsers are available across all dashboards.") : x("bigconsole.parsers.builder.fields.dashboard.helperScoped", "This parser will only be available in the selected dashboard.")
577
602
  })
578
603
  ] })
579
604
  ]
580
605
  }),
581
- T === 1 && /* @__PURE__ */ h(t, {
606
+ C === 1 && /* @__PURE__ */ m(t, {
582
607
  emphasis: "primary",
583
608
  headingLevel: 2,
584
609
  title: "Parser configuration",
585
610
  description: "Pick the language and point it at a source.",
586
- icon: /* @__PURE__ */ m(ve, { className: "h-icon-sm w-icon-sm" }),
587
- meta: an,
611
+ icon: /* @__PURE__ */ p(be, { className: "h-icon-sm w-icon-sm" }),
612
+ meta: fn,
588
613
  bodyClassName: "space-y-5",
589
614
  "data-testid": "parser-configuration",
590
- children: [/* @__PURE__ */ h("fieldset", {
615
+ children: [/* @__PURE__ */ m("fieldset", {
591
616
  className: "min-w-0 border-0 p-0 m-0",
592
- children: [/* @__PURE__ */ h("legend", {
617
+ children: [/* @__PURE__ */ m("legend", {
593
618
  className: "mb-3 text-sm font-medium text-text-primary",
594
619
  children: [
595
- S("bigconsole.parsers.builder.fields.parserType.label", "Parser Type"),
620
+ x("bigconsole.parsers.builder.fields.parserType.label", "Parser Type"),
596
621
  " ",
597
- /* @__PURE__ */ m("span", {
622
+ /* @__PURE__ */ p("span", {
598
623
  className: "text-status-error-text",
599
624
  children: "*"
600
625
  })
601
626
  ]
602
- }), /* @__PURE__ */ m("div", {
627
+ }), /* @__PURE__ */ p("div", {
603
628
  className: "space-y-2",
604
- children: Object.keys(C).map((e) => {
605
- let t = C[e];
606
- return /* @__PURE__ */ h("label", {
629
+ children: Object.keys(We).map((e) => {
630
+ let t = We[e];
631
+ return /* @__PURE__ */ m("label", {
607
632
  className: `
608
633
  flex items-start gap-3 p-3
609
634
  rounded-md border
610
635
  cursor-pointer
611
636
  motion-safe:transition-colors
612
- ${A.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-transparent bg-bg-sunken hover:border-[var(--color-border-subtle)]"}
637
+ ${O.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-transparent bg-bg-sunken hover:border-[var(--color-border-subtle)]"}
613
638
  `,
614
- children: [/* @__PURE__ */ m("input", {
639
+ children: [/* @__PURE__ */ p("input", {
615
640
  type: "radio",
616
641
  name: "parserType",
617
642
  value: e,
618
- checked: A.type === e,
619
- onChange: () => It(e),
643
+ checked: O.type === e,
644
+ onChange: () => Wt(e),
620
645
  className: "mt-1 w-4 h-4 text-action-primary-bg"
621
- }), /* @__PURE__ */ h("span", {
646
+ }), /* @__PURE__ */ m("span", {
622
647
  className: "min-w-0",
623
- children: [/* @__PURE__ */ m("span", {
648
+ children: [/* @__PURE__ */ p("span", {
624
649
  className: "block text-sm font-medium text-text-primary",
625
650
  children: t.name
626
- }), /* @__PURE__ */ m("span", {
651
+ }), /* @__PURE__ */ p("span", {
627
652
  className: "mt-0.5 block text-xs text-text-secondary",
628
653
  children: t.description
629
654
  })]
@@ -631,57 +656,60 @@ var x = i(function() {
631
656
  }, e);
632
657
  })
633
658
  })]
634
- }), /* @__PURE__ */ h("div", { children: [
635
- /* @__PURE__ */ h("label", {
659
+ }), /* @__PURE__ */ m("div", { children: [
660
+ /* @__PURE__ */ m("label", {
636
661
  htmlFor: "inputSinkKey",
637
- className: v,
662
+ className: _,
638
663
  children: [
639
- S("bigconsole.parsers.builder.fields.sourceDataSink.label", "Source DataSink"),
664
+ x("bigconsole.parsers.builder.fields.sourceDataSink.label", "Source DataSink"),
640
665
  " ",
641
- /* @__PURE__ */ m("span", {
666
+ /* @__PURE__ */ p("span", {
642
667
  className: "text-status-error-text",
643
668
  children: "*"
644
669
  })
645
670
  ]
646
671
  }),
647
- /* @__PURE__ */ h("select", {
672
+ /* @__PURE__ */ m("select", {
648
673
  id: "inputSinkKey",
649
- value: A.inputSinkKey,
650
- onChange: Rt,
651
- className: _(!!N.inputSinkKey),
652
- children: [/* @__PURE__ */ m("option", {
674
+ value: O.inputSinkKey,
675
+ onChange: Kt,
676
+ "aria-invalid": !!j.inputSinkKey,
677
+ "aria-describedby": j.inputSinkKey ? "inputSinkKey-error" : void 0,
678
+ className: g(!!j.inputSinkKey),
679
+ children: [/* @__PURE__ */ p("option", {
653
680
  value: "",
654
- children: S("bigconsole.parsers.builder.fields.sourceDataSink.placeholder", "Select a DataSink...")
655
- }), J.map((e) => /* @__PURE__ */ m("option", {
681
+ children: x("bigconsole.parsers.builder.fields.sourceDataSink.placeholder", "Select a DataSink...")
682
+ }), J.map((e) => /* @__PURE__ */ p("option", {
656
683
  value: e.key,
657
684
  children: e.name || e.key
658
685
  }, e.id))]
659
686
  }),
660
- N.inputSinkKey && /* @__PURE__ */ m("p", {
661
- className: "text-xs text-status-error-text mt-1.5",
662
- children: N.inputSinkKey
687
+ j.inputSinkKey && /* @__PURE__ */ p("p", {
688
+ id: "inputSinkKey-error",
689
+ className: Pe,
690
+ children: j.inputSinkKey
663
691
  }),
664
- J.length === 0 ? /* @__PURE__ */ m("p", {
665
- className: y,
666
- children: S("bigconsole.parsers.builder.fields.sourceDataSink.emptyState", "No DataSinks yet — create one first, then return here to build a parser for it.")
667
- }) : /* @__PURE__ */ m("p", {
668
- className: y,
692
+ J.length === 0 ? /* @__PURE__ */ p("p", {
693
+ className: v,
694
+ children: x("bigconsole.parsers.builder.fields.sourceDataSink.emptyState", "No DataSinks yet — create one first, then return here to build a parser for it.")
695
+ }) : /* @__PURE__ */ p("p", {
696
+ className: v,
669
697
  children: "Select the data source for this parser to transform."
670
698
  }),
671
- A.inputSinkKey && /* @__PURE__ */ h("div", {
699
+ O.inputSinkKey && /* @__PURE__ */ m("div", {
672
700
  className: "mt-3",
673
- children: [/* @__PURE__ */ h("button", {
701
+ children: [/* @__PURE__ */ m("button", {
674
702
  type: "button",
675
- onClick: Kt,
703
+ onClick: en,
676
704
  "aria-expanded": G,
677
705
  "aria-controls": "parser-data-preview",
678
- className: "inline-flex min-h-control-md items-center gap-2 rounded-md text-sm text-action-primary-bg hover:text-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
706
+ className: "inline-flex min-h-[44px] items-center gap-2 rounded-md text-sm text-action-primary-bg hover:text-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
679
707
  children: [
680
- m(G ? ge : _e, { className: "w-4 h-4" }),
681
- /* @__PURE__ */ m(be, { className: "w-4 h-4" }),
682
- S("bigconsole.parsers.builder.dataPreview.toggle", "Show Data Preview")
708
+ p(G ? ve : ye, { className: "w-4 h-4" }),
709
+ /* @__PURE__ */ p(Se, { className: "w-4 h-4" }),
710
+ x("bigconsole.parsers.builder.dataPreview.toggle", "Show Data Preview")
683
711
  ]
684
- }), G && /* @__PURE__ */ m(t, {
712
+ }), G && /* @__PURE__ */ p(t, {
685
713
  id: "parser-data-preview",
686
714
  emphasis: "muted",
687
715
  padding: "compact",
@@ -690,301 +718,324 @@ var x = i(function() {
690
718
  description: "A slice of the payload stored on the selected DataSink.",
691
719
  className: "mt-3",
692
720
  "data-testid": "parser-data-preview",
693
- children: ht ? /* @__PURE__ */ h("div", {
721
+ children: St ? /* @__PURE__ */ m("div", {
694
722
  className: "flex items-center justify-center p-4",
695
- children: [/* @__PURE__ */ m(d, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ m("span", {
723
+ children: [/* @__PURE__ */ p(u, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ p("span", {
696
724
  className: "ml-2 text-sm text-text-secondary",
697
- children: S("bigconsole.parsers.builder.dataPreview.loading", "Loading sample…")
725
+ children: x("bigconsole.parsers.builder.dataPreview.loading", "Loading sample…")
698
726
  })]
699
- }) : _t ? /* @__PURE__ */ m("p", {
727
+ }) : wt ? /* @__PURE__ */ p("p", {
700
728
  className: "text-sm text-status-error-text",
701
- children: _t
702
- }) : pt ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("pre", {
729
+ children: wt
730
+ }) : bt ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("pre", {
703
731
  className: "max-h-48 min-w-0 overflow-auto rounded-md bg-bg-canvas p-3 font-mono text-xs text-text-primary",
704
- children: JSON.stringify(pt, null, 2)
705
- }), q && /* @__PURE__ */ h("p", {
706
- className: y,
732
+ children: JSON.stringify(bt, null, 2)
733
+ }), q && /* @__PURE__ */ m("p", {
734
+ className: v,
707
735
  children: [
708
- S("bigconsole.parsers.builder.dataPreview.previewingSample", "Previewing a sample"),
709
- q.total == null ? "" : S("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
710
- shown: Math.min(b, q.total),
736
+ x("bigconsole.parsers.builder.dataPreview.previewingSample", "Previewing a sample"),
737
+ q.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
738
+ shown: Math.min(y, q.total),
711
739
  total: q.total
712
740
  }),
713
741
  " · ",
714
742
  q.sinkName
715
743
  ]
716
- })] }) : /* @__PURE__ */ m("p", {
744
+ })] }) : /* @__PURE__ */ p("p", {
717
745
  className: "text-center text-sm text-text-secondary",
718
- children: S("bigconsole.parsers.builder.dataPreview.noData", "No data available")
746
+ children: x("bigconsole.parsers.builder.dataPreview.noData", "No data available")
719
747
  })
720
748
  })]
721
749
  })
722
750
  ] })]
723
751
  }),
724
- T === 2 && /* @__PURE__ */ h(t, {
752
+ C === 2 && /* @__PURE__ */ m(t, {
725
753
  emphasis: "primary",
726
754
  headingLevel: 2,
727
755
  title: "Test expression",
728
756
  description: "Write the expression, then run it against sample data before you save.",
729
- icon: /* @__PURE__ */ m(Ce, { className: "h-icon-sm w-icon-sm" }),
730
- meta: an,
757
+ icon: /* @__PURE__ */ p(Te, { className: "h-icon-sm w-icon-sm" }),
758
+ meta: fn,
731
759
  bodyClassName: "space-y-5",
732
760
  "data-testid": "parser-test-expression",
733
761
  children: [
734
- /* @__PURE__ */ h("div", { children: [
735
- /* @__PURE__ */ h("label", {
736
- htmlFor: "expression",
737
- className: v,
762
+ /* @__PURE__ */ m("div", { children: [
763
+ /* @__PURE__ */ m("p", {
764
+ id: "expression-label",
765
+ className: _,
738
766
  children: [
739
- S("bigconsole.parsers.builder.fields.expression.label", "Expression"),
767
+ x("bigconsole.parsers.builder.fields.expression.label", "Expression"),
740
768
  " ",
741
- /* @__PURE__ */ m("span", {
769
+ /* @__PURE__ */ p("span", {
742
770
  className: "text-status-error-text",
743
771
  children: "*"
744
772
  })
745
773
  ]
746
774
  }),
747
- /* @__PURE__ */ m("textarea", {
748
- id: "expression",
749
- value: A.expression,
750
- onChange: Lt,
751
- placeholder: nn.placeholder,
752
- rows: 8,
753
- className: _(!!N.expression, "font-mono resize-y min-h-[12rem]")
754
- }),
755
- N.expression && /* @__PURE__ */ m("p", {
756
- className: "text-xs text-status-error-text mt-1.5",
757
- children: N.expression
775
+ /* @__PURE__ */ p("div", {
776
+ role: "group",
777
+ "aria-labelledby": "expression-label",
778
+ "aria-describedby": "expression-hint",
779
+ children: /* @__PURE__ */ p(ue, {
780
+ value: O.expression,
781
+ type: O.type,
782
+ onChange: Gt,
783
+ height: Ie,
784
+ error: j.expression ?? null
785
+ })
758
786
  }),
759
- /* @__PURE__ */ m("p", {
760
- className: y,
761
- children: S("bigconsole.parsers.builder.fields.expression.example", "Example: {{example}}", { example: nn.example })
787
+ /* @__PURE__ */ p("p", {
788
+ id: "expression-hint",
789
+ className: v,
790
+ children: x("bigconsole.parsers.builder.fields.expression.example", "Example: {{example}}", { example: un.example })
762
791
  })
763
792
  ] }),
764
- /* @__PURE__ */ h("div", { children: [
765
- /* @__PURE__ */ h("div", {
793
+ /* @__PURE__ */ m("div", { children: [
794
+ /* @__PURE__ */ m("div", {
766
795
  className: "mb-2 flex flex-wrap items-center justify-between gap-control-gap",
767
- children: [/* @__PURE__ */ h("label", {
768
- htmlFor: "test-input",
769
- className: `${v} mb-0 flex flex-wrap items-center gap-2`,
770
- children: [S("bigconsole.parsers.builder.test.inputJsonLabel", "Input JSON"), /* @__PURE__ */ m("span", {
796
+ children: [/* @__PURE__ */ m("p", {
797
+ id: "test-input-label",
798
+ className: `${_} mb-0 flex flex-wrap items-center gap-2`,
799
+ children: [x("bigconsole.parsers.builder.test.inputJsonLabel", "Input JSON"), /* @__PURE__ */ p("span", {
771
800
  className: `rounded border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${H ? "text-action-primary-bg bg-action-primary-bg/10 border-action-primary-bg/30" : "text-text-secondary bg-bg-sunken border-[var(--color-border-subtle)]"}`,
772
- children: H ? S("bigconsole.parsers.builder.test.referenceMode", "Reference mode") : S("bigconsole.parsers.builder.test.sampleMode", "Sample mode")
801
+ children: H ? x("bigconsole.parsers.builder.test.referenceMode", "Reference mode") : x("bigconsole.parsers.builder.test.sampleMode", "Sample mode")
773
802
  })]
774
- }), /* @__PURE__ */ h("div", {
803
+ }), /* @__PURE__ */ m("div", {
775
804
  className: "flex flex-wrap items-center gap-2",
776
- children: [A.inputSinkKey && !H && /* @__PURE__ */ h("button", {
805
+ children: [O.inputSinkKey && !H && /* @__PURE__ */ m("button", {
777
806
  type: "button",
778
- onClick: Wt,
779
- disabled: ut,
780
- className: "inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-action-primary-bg px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg hover:bg-action-primary-bg/10 motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface disabled:opacity-50 disabled:cursor-not-allowed",
781
- children: [ut ? /* @__PURE__ */ m(d, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ m(ye, { className: "w-3.5 h-3.5" }), S("bigconsole.parsers.builder.actions.loadSample", "Load Sample")]
782
- }), H && /* @__PURE__ */ h("button", {
807
+ onClick: Qt,
808
+ disabled: _t,
809
+ className: "inline-flex min-h-[44px] items-center gap-1.5 whitespace-nowrap rounded-md border border-action-primary-bg px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg hover:bg-action-primary-bg/10 motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface disabled:opacity-50 disabled:cursor-not-allowed",
810
+ children: [_t ? /* @__PURE__ */ p(u, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ p(xe, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.loadSample", "Load Sample")]
811
+ }), H && /* @__PURE__ */ m("button", {
783
812
  type: "button",
784
- onClick: Gt,
785
- className: "inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-semibold text-text-primary hover:bg-bg-sunken motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
786
- children: [/* @__PURE__ */ m(Ee, { className: "w-3.5 h-3.5" }), S("bigconsole.parsers.builder.actions.clear", "Clear")]
813
+ onClick: $t,
814
+ className: "inline-flex min-h-[44px] items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-semibold text-text-primary hover:bg-bg-sunken motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
815
+ children: [/* @__PURE__ */ p(ke, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.clear", "Clear")]
787
816
  })]
788
817
  })]
789
818
  }),
790
- /* @__PURE__ */ m("textarea", {
791
- id: "test-input",
792
- value: $e,
793
- onChange: Vt,
794
- onKeyDown: Ht,
795
- onPaste: Ut,
796
- readOnly: H,
797
- "aria-describedby": H ? "test-input-locked-hint" : void 0,
798
- placeholder: S("bigconsole.parsers.builder.test.inputPlaceholder", "Type sample JSON to test against it — or Load a sample from the source…"),
799
- rows: 8,
800
- className: _(!1, `font-mono leading-relaxed resize-y ${H ? "bg-bg-sunken opacity-80 cursor-not-allowed" : ""}`)
819
+ /* @__PURE__ */ p("div", {
820
+ role: "group",
821
+ "aria-labelledby": "test-input-label",
822
+ "aria-describedby": "test-input-hint",
823
+ onKeyDownCapture: Xt,
824
+ onPasteCapture: Zt,
825
+ className: H ? "opacity-80" : void 0,
826
+ children: /* @__PURE__ */ p(ue, {
827
+ value: ot,
828
+ language: "json",
829
+ onChange: Yt,
830
+ readOnly: H,
831
+ height: Ie
832
+ })
801
833
  }),
802
- H && st && /* @__PURE__ */ h("p", {
834
+ H && mt && /* @__PURE__ */ m("p", {
803
835
  role: "status",
804
836
  "data-testid": "parser-test-input-locked-notice",
805
837
  className: "mt-2 flex items-start gap-1.5 rounded-md border border-[var(--color-status-warning-border)] bg-[var(--color-status-warning-bgSubtle)] px-2.5 py-1.5 text-xs text-[var(--color-status-warning-text)]",
806
- children: [/* @__PURE__ */ m(u, {
838
+ children: [/* @__PURE__ */ p(l, {
807
839
  className: "mt-0.5 h-3.5 w-3.5 shrink-0",
808
840
  "aria-hidden": "true"
809
- }), S("bigconsole.parsers.builder.test.lockedNotice", "This sample is read-only in Reference mode — tests run against the source sink. Press Clear to type your own test input.")]
841
+ }), x("bigconsole.parsers.builder.test.lockedNotice", "This sample is read-only in Reference mode — tests run against the source sink. Press Clear to type your own test input.")]
810
842
  }),
811
- H && U ? /* @__PURE__ */ h("p", {
812
- id: "test-input-locked-hint",
813
- className: y,
843
+ H && U ? /* @__PURE__ */ m("p", {
844
+ id: "test-input-hint",
845
+ className: v,
814
846
  children: [
815
- S("bigconsole.parsers.builder.test.loadedSample", "Loaded a small sample"),
816
- U.total == null ? "" : S("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
817
- shown: Math.min(b, U.total),
847
+ x("bigconsole.parsers.builder.test.loadedSample", "Loaded a small sample"),
848
+ U.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
849
+ shown: Math.min(y, U.total),
818
850
  total: U.total
819
851
  }),
820
852
  " ",
821
- S("bigconsole.parsers.builder.test.loadedSampleFrom", "from {{sinkName}} · locked — press Clear to edit.", { sinkName: U.sinkName })
853
+ x("bigconsole.parsers.builder.test.loadedSampleFrom", "from {{sinkName}} · locked — press Clear to edit.", { sinkName: U.sinkName })
822
854
  ]
823
- }) : /* @__PURE__ */ m("p", {
824
- className: y,
825
- children: S("bigconsole.parsers.builder.test.inputHelper", "Type sample JSON to test against it, or Load a sample from the source.")
855
+ }) : /* @__PURE__ */ p("p", {
856
+ id: "test-input-hint",
857
+ className: v,
858
+ children: x("bigconsole.parsers.builder.test.inputHelper", "Type sample JSON to test against it, or Load a sample from the source.")
826
859
  })
827
860
  ] }),
828
- /* @__PURE__ */ m(fe, {
829
- permission: r.PARSER_TEST,
830
- deniedBehavior: "disable",
831
- children: /* @__PURE__ */ m(f, {
832
- type: "button",
833
- onClick: qt,
834
- disabled: tt || !A.expression.trim(),
835
- variant: "default",
836
- className: "w-full",
837
- children: tt ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "w-4 h-4 mr-2 animate-spin" }), S("bigconsole.parsers.builder.actions.testing", "Testing...")] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Ce, { className: "w-4 h-4 mr-2" }), S("bigconsole.parsers.builder.actions.runTest", "Run Test")] })
838
- })
861
+ /* @__PURE__ */ m("div", {
862
+ className: "flex items-center gap-3",
863
+ children: [/* @__PURE__ */ p("div", {
864
+ className: "min-w-0 flex-1",
865
+ children: /* @__PURE__ */ p(me, {
866
+ permission: r.PARSER_TEST,
867
+ deniedBehavior: "disable",
868
+ children: /* @__PURE__ */ p(d, {
869
+ type: "button",
870
+ onClick: tn,
871
+ disabled: R || !O.expression.trim(),
872
+ variant: "default",
873
+ className: "w-full min-h-[44px]",
874
+ children: R ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.testing", "Testing...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Te, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.runTest", "Run Test")] })
875
+ })
876
+ })
877
+ }), ct !== null && !R && /* @__PURE__ */ m("span", {
878
+ className: "inline-flex items-center gap-1.5 whitespace-nowrap text-xs text-text-muted tabular-nums",
879
+ "data-testid": "parser-test-duration",
880
+ children: [/* @__PURE__ */ p(Oe, {
881
+ className: "w-3.5 h-3.5",
882
+ "aria-hidden": "true"
883
+ }), x("bigconsole.parsers.testPanel.executedIn", "Executed in {{ms}}ms", { ms: ct })]
884
+ })]
839
885
  }),
840
- Jt === "untested" && !tt && /* @__PURE__ */ m("p", {
841
- className: y,
886
+ nn === "untested" && !R && /* @__PURE__ */ p("p", {
887
+ className: v,
842
888
  role: "status",
843
889
  "data-testid": "parser-test-gate",
844
- children: L && !Yt ? S("bigconsole.parsers.builder.test.gateFailed", "The test failed. Fix the expression and run the test again to continue.") : S("bigconsole.parsers.builder.test.gateUntested", "Run a passing test of this expression to continue.")
890
+ children: I && !rn ? x("bigconsole.parsers.builder.test.gateFailed", "The test failed. Fix the expression and run the test again to continue.") : x("bigconsole.parsers.builder.test.gateUntested", "Run a passing test of this expression to continue.")
845
891
  }),
846
- Jt === "untestable" && /* @__PURE__ */ h("p", {
892
+ nn === "untestable" && /* @__PURE__ */ m("p", {
847
893
  role: "status",
848
894
  "data-testid": "parser-test-gate",
849
895
  className: "flex items-start gap-1.5 rounded-md border border-[var(--color-status-warning-border)] bg-[var(--color-status-warning-bgSubtle)] px-2.5 py-1.5 text-xs text-[var(--color-status-warning-text)]",
850
- children: [/* @__PURE__ */ m(u, {
896
+ children: [/* @__PURE__ */ p(l, {
851
897
  className: "mt-0.5 h-3.5 w-3.5 shrink-0",
852
898
  "aria-hidden": "true"
853
- }), S("bigconsole.parsers.builder.test.gateUntestable", "You don’t have permission to run tests, so this expression has not been tested. Ask someone who can to test it before dashboards rely on it.")]
899
+ }), x("bigconsole.parsers.builder.test.gateUntestable", "You don’t have permission to run tests, so this expression has not been tested. Ask someone who can to test it before dashboards rely on it.")]
854
900
  }),
855
- (et || L) && /* @__PURE__ */ h(t, {
901
+ (st || I) && /* @__PURE__ */ m(t, {
856
902
  emphasis: "muted",
857
903
  padding: "compact",
858
904
  headingLevel: 3,
859
- tone: L ? "danger" : "success",
860
- title: L ? S("bigconsole.parsers.builder.test.errorOutputLabel", "Error Output") : S("bigconsole.parsers.builder.test.outputLabel", "Output"),
861
- meta: L ? /* @__PURE__ */ h("span", {
905
+ tone: I ? "danger" : "success",
906
+ title: I ? x("bigconsole.parsers.builder.test.errorOutputLabel", "Error Output") : x("bigconsole.parsers.builder.test.outputLabel", "Output"),
907
+ meta: I ? /* @__PURE__ */ m("span", {
862
908
  className: "inline-flex items-center gap-1 text-xs text-[var(--color-status-error-text)]",
863
909
  children: [
864
- /* @__PURE__ */ m(u, { className: "w-3 h-3" }),
910
+ /* @__PURE__ */ p(l, { className: "w-3 h-3" }),
865
911
  " ",
866
- S("bigconsole.parsers.builder.test.failed", "Failed")
912
+ x("bigconsole.parsers.builder.test.failed", "Failed")
867
913
  ]
868
- }) : /* @__PURE__ */ h("span", {
914
+ }) : /* @__PURE__ */ m("span", {
869
915
  className: "inline-flex items-center gap-1 text-xs text-status-success-text",
870
916
  children: [
871
- /* @__PURE__ */ m(he, { className: "w-3 h-3" }),
917
+ /* @__PURE__ */ p(_e, { className: "w-3 h-3" }),
872
918
  " ",
873
- S("bigconsole.parsers.builder.test.passed", "Passed")
919
+ x("bigconsole.parsers.builder.test.passed", "Passed")
874
920
  ]
875
921
  }),
876
922
  "data-testid": "parser-test-output",
877
923
  children: [
878
- Yt && /* @__PURE__ */ m("p", {
879
- className: `${y} mb-2`,
924
+ rn && /* @__PURE__ */ p("p", {
925
+ className: `${v} mb-2`,
880
926
  "data-testid": "parser-test-output-stale",
881
- children: S("bigconsole.parsers.builder.test.staleResult", "This result is from an earlier version of the expression. Run the test again.")
927
+ children: x("bigconsole.parsers.builder.test.staleResult", "This result is from an earlier version of the expression. Run the test again.")
882
928
  }),
883
- /* @__PURE__ */ m("pre", {
884
- className: "max-h-[150px] min-w-0 overflow-auto rounded-md bg-bg-canvas px-3 py-2.5 font-mono text-xs leading-relaxed text-text-primary",
885
- children: L || et
929
+ I ? /* @__PURE__ */ p("pre", {
930
+ className: "max-h-[150px] min-w-0 overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-canvas px-3 py-2.5 font-mono text-xs leading-relaxed text-text-primary",
931
+ children: I
932
+ }) : /* @__PURE__ */ p(ue, {
933
+ value: st,
934
+ language: "json",
935
+ readOnly: !0,
936
+ height: Ie
886
937
  }),
887
- z && !L && /* @__PURE__ */ h("p", {
888
- className: y,
938
+ z && !I && /* @__PURE__ */ m("p", {
939
+ className: v,
889
940
  children: [
890
- S("bigconsole.parsers.builder.test.testedSample", "Tested a sample"),
891
- z.sampledRows != null && z.totalRows != null ? S("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
941
+ x("bigconsole.parsers.builder.test.testedSample", "Tested a sample"),
942
+ z.sampledRows != null && z.totalRows != null ? x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
892
943
  shown: z.sampledRows,
893
944
  total: z.totalRows
894
945
  }) : "",
895
- S("bigconsole.parsers.builder.test.testedSampleNote", " — a saved parser runs over the full source, so results may differ.")
946
+ x("bigconsole.parsers.builder.test.testedSampleNote", " — a saved parser runs over the full source, so results may differ.")
896
947
  ]
897
948
  })
898
949
  ]
899
950
  }),
900
- !et && !L && /* @__PURE__ */ m(t, {
951
+ !st && !I && /* @__PURE__ */ p(t, {
901
952
  emphasis: "muted",
902
953
  padding: "compact",
903
954
  headingLevel: 3,
904
955
  title: "No run yet",
905
956
  "data-testid": "parser-test-empty",
906
- children: /* @__PURE__ */ h("p", {
957
+ children: /* @__PURE__ */ m("p", {
907
958
  className: "text-xs leading-relaxed text-text-secondary",
908
959
  children: [
909
- /* @__PURE__ */ m("strong", { children: S("bigconsole.parsers.builder.test.tipLabel", "Tip:") }),
960
+ /* @__PURE__ */ p("strong", { children: x("bigconsole.parsers.builder.test.tipLabel", "Tip:") }),
910
961
  " ",
911
- S("bigconsole.parsers.builder.test.tipBody", "write your expression and click “Run Test” to see the transformation.")
962
+ x("bigconsole.parsers.builder.test.tipBody", "write your expression and click “Run Test” to see the transformation.")
912
963
  ]
913
964
  })
914
965
  })
915
966
  ]
916
967
  }),
917
- T === 3 && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(t, {
968
+ C === 3 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(t, {
918
969
  emphasis: "primary",
919
970
  headingLevel: 2,
920
- title: S("bigconsole.parsers.builder.review.cacheDurationLabel", "Cache Duration"),
921
- description: S("bigconsole.parsers.builder.review.cacheDurationHelper", "How long should data be cached before refreshing?"),
922
- icon: /* @__PURE__ */ m(Te, { className: "h-icon-sm w-icon-sm" }),
923
- meta: an,
971
+ title: x("bigconsole.parsers.builder.review.cacheDurationLabel", "Cache Duration"),
972
+ description: x("bigconsole.parsers.builder.review.cacheDurationHelper", "How long should data be cached before refreshing?"),
973
+ icon: /* @__PURE__ */ p(De, { className: "h-icon-sm w-icon-sm" }),
974
+ meta: fn,
924
975
  "data-testid": "parser-advanced-settings",
925
- children: /* @__PURE__ */ m(le, {
926
- value: A.ttl,
927
- onChange: zt,
928
- error: N.ttl,
976
+ children: /* @__PURE__ */ p(le, {
977
+ value: O.ttl,
978
+ onChange: qt,
979
+ error: j.ttl,
929
980
  hideLabel: !0
930
981
  })
931
- }), /* @__PURE__ */ m(t, {
982
+ }), /* @__PURE__ */ p(t, {
932
983
  emphasis: "muted",
933
984
  headingLevel: 2,
934
- title: S("bigconsole.parsers.builder.review.label", "Review"),
985
+ title: x("bigconsole.parsers.builder.review.label", "Review"),
935
986
  description: "Check these details before you save.",
936
987
  "data-testid": "parser-review",
937
- children: /* @__PURE__ */ m("div", {
988
+ children: /* @__PURE__ */ p("div", {
938
989
  className: "overflow-hidden rounded-lg border border-[var(--color-border-subtle)]",
939
990
  children: [
940
- [S("bigconsole.parsers.builder.review.name", "Name"), A.name || "—"],
941
- [S("bigconsole.parsers.builder.review.outputKey", "Output Key"), A.outputKey || "—"],
942
- [S("bigconsole.parsers.builder.review.scope", "Scope"), k ? D === "default" ? S("bigconsole.parsers.builder.review.scopeGlobal", "Global") : Dt.find((e) => e.id === D)?.name || D : S("bigconsole.parsers.builder.review.scopeDashboard", "Dashboard")],
943
- [S("bigconsole.parsers.builder.review.type", "Type"), C[A.type].name],
944
- [S("bigconsole.parsers.builder.review.source", "Source"), Z || "—"]
945
- ].map(([e, t]) => /* @__PURE__ */ h("div", {
991
+ [x("bigconsole.parsers.builder.review.name", "Name"), O.name || "—"],
992
+ [x("bigconsole.parsers.builder.review.outputKey", "Output Key"), O.outputKey || "—"],
993
+ [x("bigconsole.parsers.builder.review.scope", "Scope"), D ? T === "default" ? x("bigconsole.parsers.builder.review.scopeGlobal", "Global") : Ft.find((e) => e.id === T)?.name || T : x("bigconsole.parsers.builder.review.scopeDashboard", "Dashboard")],
994
+ [x("bigconsole.parsers.builder.review.type", "Type"), We[O.type].name],
995
+ [x("bigconsole.parsers.builder.review.source", "Source"), X || "—"]
996
+ ].map(([e, t]) => /* @__PURE__ */ m("div", {
946
997
  className: "flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-border-subtle)] px-4 py-2.5 text-sm last:border-b-0",
947
- children: [/* @__PURE__ */ m("span", {
998
+ children: [/* @__PURE__ */ p("span", {
948
999
  className: "text-text-secondary",
949
1000
  children: e
950
- }), /* @__PURE__ */ m("span", {
1001
+ }), /* @__PURE__ */ p("span", {
951
1002
  className: "min-w-0 break-words text-right font-medium text-text-primary",
952
1003
  children: t
953
1004
  })]
954
1005
  }, e))
955
1006
  })
956
1007
  })] }),
957
- /* @__PURE__ */ h("div", {
1008
+ /* @__PURE__ */ m("div", {
958
1009
  className: "sticky bottom-0 z-10 flex flex-col-reverse gap-control-gap border-t border-[var(--color-border-subtle)] bg-bg-canvas py-form-gap sm:flex-row sm:items-center sm:justify-between",
959
- children: [T === 0 ? /* @__PURE__ */ m(f, {
1010
+ children: [C === 0 ? /* @__PURE__ */ p(d, {
960
1011
  type: "button",
961
- onClick: Q,
1012
+ onClick: Z,
962
1013
  variant: "secondary",
963
1014
  className: "w-full sm:w-auto",
964
- children: S("bigconsole.parsers.builder.actions.cancel", "Cancel")
965
- }) : /* @__PURE__ */ h(f, {
1015
+ children: x("bigconsole.parsers.builder.actions.cancel", "Cancel")
1016
+ }) : /* @__PURE__ */ m(d, {
966
1017
  type: "button",
967
- onClick: tn,
1018
+ onClick: ln,
968
1019
  variant: "secondary",
969
1020
  className: "w-full sm:w-auto",
970
- children: [/* @__PURE__ */ m(me, { className: "w-4 h-4 mr-2" }), S("bigconsole.parsers.builder.actions.back", "Back")]
971
- }), rn ? /* @__PURE__ */ m(fe, {
972
- permission: We,
1021
+ children: [/* @__PURE__ */ p(ge, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.back", "Back")]
1022
+ }), dn ? /* @__PURE__ */ p(me, {
1023
+ permission: Ze,
973
1024
  deniedBehavior: "disable",
974
- children: /* @__PURE__ */ m(f, {
1025
+ children: /* @__PURE__ */ p(d, {
975
1026
  type: "submit",
976
- disabled: !Zt || Ye || !Ue,
1027
+ disabled: !on || nt || !Xe,
977
1028
  variant: "default",
978
1029
  className: "w-full sm:w-auto",
979
- children: Ye ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(d, { className: "w-4 h-4 mr-2 animate-spin" }), S("bigconsole.parsers.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(we, { className: "w-4 h-4 mr-2" }), O ? S("bigconsole.parsers.builder.actions.saveChanges", "Save Changes") : S("bigconsole.parsers.builder.actions.createParser", "Create Parser")] })
1030
+ children: nt ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Ee, { className: "w-4 h-4 mr-2" }), E ? x("bigconsole.parsers.builder.actions.saveChanges", "Save Changes") : x("bigconsole.parsers.builder.actions.createParser", "Create Parser")] })
980
1031
  })
981
- }) : /* @__PURE__ */ h(f, {
1032
+ }) : /* @__PURE__ */ m(d, {
982
1033
  type: "button",
983
- onClick: en,
984
- disabled: !Qt(T),
1034
+ onClick: cn,
1035
+ disabled: !$(C),
985
1036
  variant: "default",
986
1037
  className: "w-full sm:w-auto",
987
- children: [S("bigconsole.parsers.builder.actions.next", "Next"), /* @__PURE__ */ m(_e, { className: "w-4 h-4 ml-2" })]
1038
+ children: [x("bigconsole.parsers.builder.actions.next", "Next"), /* @__PURE__ */ p(ye, { className: "w-4 h-4 ml-2" })]
988
1039
  })]
989
1040
  })
990
1041
  ]
@@ -993,4 +1044,4 @@ var x = i(function() {
993
1044
  })
994
1045
  });
995
1046
  });
996
- export { x as ParserBuilderPage, x as default };
1047
+ export { b as ParserBuilderPage, b as default };