@w6w/embed 0.2.31 → 0.2.32

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.
@@ -1,21 +1,21 @@
1
1
  import { jsx as n, jsxs as r, Fragment as V } from "react/jsx-runtime";
2
- import { r as En, l as We, m as $e, d as Me, e as An, h as je, c as Pn } from "./import-bindings-EUtxZ9Ti.js";
2
+ import { r as Cn, l as We, m as $e, d as Re, e as En, h as je, c as An } from "./import-bindings-EUtxZ9Ti.js";
3
3
  import { useContext as ve, useState as u, useMemo as Fe, useEffect as be, createContext as He, useRef as qe } from "react";
4
- import { ExpressionOptionsProvider as Je, Icon as K, RetryPolicyFields as In, StepBuilderModal as Tn, IconButton as Se, useEnterSubmit as Dn, CodeBlock as pe, DeleteButton as On, EditButton as Rn, ConfirmModal as Le, JsonEditor as Mn, useExpressionOptions as jn, ExpressionInput as Ln, ResultViewer as Vn } from "@w6w/ui";
5
- import { d as Qn, p as Wn, i as $n, t as Fn, e as Ve, a as Hn, h as qn, s as Jn } from "./document-sources-Khcw2zB5.js";
6
- import { u as Bn, a as Be } from "./spec-export-BtnoV0ex.js";
7
- import { i as Kn, f as Un, e as _n, b as zn, u as Gn } from "./vault-BSEWhMYC.js";
8
- import { k as Yn, q as Zn, n as Xn, l as xn, r as Ke, m as Ue, o as _e } from "./spec-import-CGPqUUjN.js";
9
- import { s as et, M as B, c as nt, C as tt } from "./ConfirmModal-WqBfWftD.js";
10
- import { u as it, i as st, f as at } from "./slug-BVdgiP_L.js";
11
- import { WorkflowConnectionsPanel as rt } from "@w6w/ui/flow";
4
+ import { ExpressionOptionsProvider as Je, Icon as K, RetryPolicyFields as Pn, StepBuilderModal as In, IconButton as Se, useEnterSubmit as Tn, CodeBlock as ge, DeleteButton as Dn, EditButton as On, ConfirmModal as Le, JsonEditor as Mn, useExpressionOptions as Rn, ExpressionInput as jn, ResultViewer as Ln } from "@w6w/ui";
5
+ import { d as Vn, p as Qn, i as Wn, t as $n, e as Ve, a as Fn, h as Hn, s as qn } from "./document-sources-Khcw2zB5.js";
6
+ import { u as Jn, a as Be } from "./spec-export-BtnoV0ex.js";
7
+ import { i as Bn, f as Kn, e as Un, b as _n, u as zn } from "./vault-BSEWhMYC.js";
8
+ import { k as Gn, q as Yn, n as Zn, l as Xn, r as Ke, m as Ue, o as _e } from "./spec-import-CGPqUUjN.js";
9
+ import { s as xn, M as B, c as et, C as nt } from "./ConfirmModal-WqBfWftD.js";
10
+ import { u as tt, i as it, f as st } from "./slug-BVdgiP_L.js";
11
+ import { WorkflowConnectionsPanel as at } from "@w6w/ui/flow";
12
12
  import { ApiError as j } from "@w6w/sdk";
13
13
  import { c as ze } from "./callable-record-Bhxim8C1.js";
14
- import { i as ot, p as Ge, d as lt } from "./settings-rail-BjsTjg2u.js";
15
- import { s as Ye, r as Ze, v as Xe, t as xe, b as en, d as dt, g as ct, u as ut, q as ht, p as ft, o as mt, n as gt } from "./endpoints-zOuwci2U.js";
16
- import { a1 as nn, a0 as pt, _ as vt, P as bt, U as yt, a3 as kt, Z as wt, V as Nt, X as St, K as Ct, I as Et } from "./workflows-Dz8LMjnt.js";
14
+ import { i as rt, d as ot, p as lt } from "./settings-rail-gUU2ZbSw.js";
15
+ import { s as Ge, r as Ye, v as Ze, t as Xe, b as xe, d as dt, g as ct, u as ut, q as ht, p as ft, o as mt, n as pt } from "./endpoints-zOuwci2U.js";
16
+ import { a1 as en, a0 as gt, _ as vt, P as bt, U as yt, a3 as kt, Z as wt, V as Nt, X as St, K as Ct, I as Et } from "./workflows-Dz8LMjnt.js";
17
17
  import { j as At } from "./callables-B49tS2vv.js";
18
- import { I as tn } from "./ImportSpecModal-fU5RsVTa.js";
18
+ import { I as nn } from "./ImportSpecModal-fU5RsVTa.js";
19
19
  import { useQueryClient as Pt } from "@tanstack/react-query";
20
20
  import { foldStateLog as It } from "@w6w/expr";
21
21
  const ye = He(null);
@@ -40,13 +40,13 @@ function Tt() {
40
40
  if (!e) throw new Error("useWorkspaceCallable must be used within <WorkspaceProvider>");
41
41
  return e.resource;
42
42
  }
43
- const sn = { open: !1, activeTool: null };
43
+ const tn = { open: !1, activeTool: null };
44
44
  function Dt(e) {
45
- if (typeof localStorage > "u") return sn;
46
- const t = localStorage.getItem(e), { activeTool: i } = En(t);
45
+ if (typeof localStorage > "u") return tn;
46
+ const t = localStorage.getItem(e), { activeTool: i } = Cn(t);
47
47
  return { open: !1, activeTool: i };
48
48
  }
49
- function an({
49
+ function sn({
50
50
  tools: e,
51
51
  ctx: t,
52
52
  state: i,
@@ -101,18 +101,18 @@ function Ot({
101
101
  (d) => d.open && d.activeTool === l ? { open: !1, activeTool: l } : { open: !0, activeTool: l }
102
102
  );
103
103
  }
104
- return /* @__PURE__ */ n(an, { tools: t, ctx: i, state: s, onToggle: o });
104
+ return /* @__PURE__ */ n(sn, { tools: t, ctx: i, state: s, onToggle: o });
105
105
  }
106
106
  function Ji({
107
107
  tools: e,
108
108
  storageKey: t
109
109
  }) {
110
110
  const i = Tt(), s = e.filter((a) => a.isAvailable(i));
111
- return s.length === 0 ? null : t === null ? /* @__PURE__ */ n(an, { tools: s, ctx: i, state: sn, onToggle: () => {
111
+ return s.length === 0 ? null : t === null ? /* @__PURE__ */ n(sn, { tools: s, ctx: i, state: tn, onToggle: () => {
112
112
  } }) : /* @__PURE__ */ n(Ot, { storageKey: t, tools: s, ctx: i }, t);
113
113
  }
114
- function Rt(e) {
115
- const t = e, i = Kn(t ?? void 0, t != null), s = Un(), a = Bn(), o = Yn(t ?? void 0, t != null), l = _n(), d = zn(), h = Gn();
114
+ function Mt(e) {
115
+ const t = e, i = Bn(t ?? void 0, t != null), s = Kn(), a = Jn(), o = Gn(t ?? void 0, t != null), l = Un(), d = _n(), h = zn();
116
116
  return Fe(
117
117
  () => ({
118
118
  vars: (i.data ?? []).map((c) => c.name),
@@ -122,14 +122,14 @@ function Rt(e) {
122
122
  // field enumeration — no parsing, no gate logic, and no filtering here
123
123
  // (A5c); `isRefSafeKey` filtering happens once, downstream, at the
124
124
  // modal's render site.
125
- documents: Wn(o.data ?? []),
125
+ documents: Qn(o.data ?? []),
126
126
  // Real project values so the ƒx Result preview substitutes them for
127
127
  // `var.<name>` / `const.<name>` / `documents.<key>` / `documents.<key>.<field>` refs
128
128
  // instead of the raw template.
129
129
  sampleValues: {
130
130
  ...Object.fromEntries((i.data ?? []).map((c) => [`var.${c.name}`, c.value])),
131
131
  ...Object.fromEntries((a.data ?? []).map((c) => [`const.${c.name}`, c.value])),
132
- ...Qn(o.data ?? [])
132
+ ...Vn(o.data ?? [])
133
133
  },
134
134
  sealSecret: l,
135
135
  // A created var carries the SAME project the read above carried (B3) —
@@ -168,14 +168,14 @@ function Bi({
168
168
  project: e,
169
169
  children: t
170
170
  }) {
171
- const i = Rt(e);
171
+ const i = Mt(e);
172
172
  return /* @__PURE__ */ n(Je, { value: i, children: t });
173
173
  }
174
- function Mt({ ctx: e }) {
175
- const [t, i] = u(null), s = Fn(e);
174
+ function Rt({ ctx: e }) {
175
+ const [t, i] = u(null), s = $n(e);
176
176
  if (!s) return null;
177
- const a = (e == null ? void 0 : e.kind) === "workflow" ? e.triggers : void 0, o = et(s);
178
- return o.length === 0 ? /* @__PURE__ */ n("p", { className: "muted", children: it(s) }) : /* @__PURE__ */ r("div", { children: [
177
+ const a = (e == null ? void 0 : e.kind) === "workflow" ? e.triggers : void 0, o = xn(s);
178
+ return o.length === 0 ? /* @__PURE__ */ n("p", { className: "muted", children: tt(s) }) : /* @__PURE__ */ r("div", { children: [
179
179
  /* @__PURE__ */ n("p", { className: "muted small", style: { marginTop: 0 }, children: "Call this from:" }),
180
180
  /* @__PURE__ */ n("div", { className: "rail-code-langs", children: o.map(({ id: l, label: d, icon: h }) => /* @__PURE__ */ r(
181
181
  "button",
@@ -193,7 +193,7 @@ function Mt({ ctx: e }) {
193
193
  },
194
194
  l
195
195
  )) }),
196
- t !== null && /* @__PURE__ */ n(B, { title: "Call from code", wide: !0, onClose: () => i(null), children: /* @__PURE__ */ n("div", { style: { height: 450 }, children: /* @__PURE__ */ n(nt, { resource: s, triggers: a, initialTab: t }) }) })
196
+ t !== null && /* @__PURE__ */ n(B, { title: "Call from code", wide: !0, onClose: () => i(null), children: /* @__PURE__ */ n("div", { style: { height: 450 }, children: /* @__PURE__ */ n(et, { resource: s, triggers: a, initialTab: t }) }) })
197
197
  ] });
198
198
  }
199
199
  function jt() {
@@ -203,8 +203,8 @@ const Lt = {
203
203
  id: "code",
204
204
  title: "Code",
205
205
  Icon: jt,
206
- isAvailable: (e) => $n(e),
207
- Panel: Mt
206
+ isAvailable: (e) => Wn(e),
207
+ Panel: Rt
208
208
  }, Vt = {
209
209
  id: "connections",
210
210
  title: "Connections",
@@ -215,18 +215,18 @@ const Lt = {
215
215
  var t;
216
216
  return (e == null ? void 0 : e.kind) === "workflow" && Object.keys(((t = e.connectionResources) == null ? void 0 : t.connections) ?? {}).length > 0;
217
217
  },
218
- Panel: ({ ctx: e }) => (e == null ? void 0 : e.kind) === "workflow" && e.connectionResources ? /* @__PURE__ */ n(rt, { resources: e.connectionResources }, e.id) : null
218
+ Panel: ({ ctx: e }) => (e == null ? void 0 : e.kind) === "workflow" && e.connectionResources ? /* @__PURE__ */ n(at, { resources: e.connectionResources }, e.id) : null
219
219
  }, Qt = { project: null, onNavigate: () => {
220
- } }, rn = He(Qt);
220
+ } }, an = He(Qt);
221
221
  function Ki({
222
222
  project: e,
223
223
  onNavigate: t,
224
224
  children: i
225
225
  }) {
226
- return /* @__PURE__ */ n(rn.Provider, { value: { project: e, onNavigate: t }, children: i });
226
+ return /* @__PURE__ */ n(an.Provider, { value: { project: e, onNavigate: t }, children: i });
227
227
  }
228
- function on() {
229
- return ve(rn);
228
+ function rn() {
229
+ return ve(an);
230
230
  }
231
231
  const Wt = "@w6w/call";
232
232
  function Qe(e) {
@@ -235,7 +235,7 @@ function Qe(e) {
235
235
  function $t(e) {
236
236
  return (e == null ? void 0 : e.kind) === "workflow" ? "Workflow (asynchronous)" : (e == null ? void 0 : e.kind) === "function" ? "Function (synchronous)" : "App action (synchronous)";
237
237
  }
238
- function ln({
238
+ function on({
239
239
  kind: e,
240
240
  id: t,
241
241
  policy: i,
@@ -243,44 +243,44 @@ function ln({
243
243
  saving: a,
244
244
  onPersist: o
245
245
  }) {
246
- var y, M, Q, N;
247
- const l = en(!0), { project: d } = on(), h = nn(d ?? void 0, !0), [c, v] = u(!1), [b, m] = u(null), C = (y = i.reroute) == null ? void 0 : y.target, k = Qe(C), D = C ? Ve({
246
+ var y, R, Q, N;
247
+ const l = xe(!0), { project: d } = rn(), h = en(d ?? void 0, !0), [c, v] = u(!1), [b, m] = u(null), C = (y = i.reroute) == null ? void 0 : y.target, k = Qe(C), D = C ? Ve({
248
248
  resource: { kind: e, id: t },
249
249
  target: { kind: C.kind, id: k },
250
- hasAdapter: ((M = i.reroute) == null ? void 0 : M.with) !== void 0
251
- }) : "allow", O = (C == null ? void 0 : C.kind) === "workflow" ? ((N = (Q = h.data) == null ? void 0 : Q.find((p) => p.id === k)) == null ? void 0 : N.displayName) ?? void 0 : (() => {
252
- var P;
253
- const p = (P = l.data) == null ? void 0 : P.find((q) => q.id === k);
254
- return p ? p.displayName || p.key : void 0;
250
+ hasAdapter: ((R = i.reroute) == null ? void 0 : R.with) !== void 0
251
+ }) : "allow", O = (C == null ? void 0 : C.kind) === "workflow" ? ((N = (Q = h.data) == null ? void 0 : Q.find((g) => g.id === k)) == null ? void 0 : N.displayName) ?? void 0 : (() => {
252
+ var A;
253
+ const g = (A = l.data) == null ? void 0 : A.find((q) => q.id === k);
254
+ return g ? g.displayName || g.key : void 0;
255
255
  })();
256
256
  be(() => {
257
257
  t && e && m(null);
258
258
  }, [t, e]);
259
- function E(p) {
260
- m(null), o(p, m);
259
+ function E(g) {
260
+ m(null), o(g, m);
261
261
  }
262
- function R(p) {
262
+ function M(g) {
263
263
  var U;
264
- let P;
265
- if (p.uses.app === Wt) {
266
- const W = p.with ?? {}, $ = typeof W.targetId == "string" ? W.targetId : "";
264
+ let A;
265
+ if (g.uses.app === Wt) {
266
+ const W = g.with ?? {}, $ = typeof W.targetId == "string" ? W.targetId : "";
267
267
  if (!$) return;
268
- P = W.targetKind === "workflow" ? { kind: "workflow", workflow: $ } : { kind: "function", function: $ };
269
- } else if (!p.uses.app.startsWith("@w6w/"))
270
- P = {
268
+ A = W.targetKind === "workflow" ? { kind: "workflow", workflow: $ } : { kind: "function", function: $ };
269
+ } else if (!g.uses.app.startsWith("@w6w/"))
270
+ A = {
271
271
  kind: "action",
272
272
  uses: {
273
- app: p.uses.app,
274
- action: p.uses.action,
275
- connection: p.uses.connection ?? void 0
273
+ app: g.uses.app,
274
+ action: g.uses.action,
275
+ connection: g.uses.connection ?? void 0
276
276
  },
277
- ...p.with ? { with: p.with } : {}
277
+ ...g.with ? { with: g.with } : {}
278
278
  };
279
279
  else
280
280
  return;
281
281
  if (Ve({
282
282
  resource: { kind: e, id: t },
283
- target: { kind: P.kind, id: Qe(P) },
283
+ target: { kind: A.kind, id: Qe(A) },
284
284
  hasAdapter: ((U = i.reroute) == null ? void 0 : U.with) !== void 0
285
285
  }) === "block") {
286
286
  m(
@@ -288,19 +288,42 @@ function ln({
288
288
  ), v(!1);
289
289
  return;
290
290
  }
291
- E({ ...i, reroute: { ...i.reroute, target: P } }), v(!1);
291
+ E({ ...i, reroute: { ...i.reroute, target: A } }), v(!1);
292
292
  }
293
293
  return !s && !a ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-errorhandling-body", children: [
294
294
  /* @__PURE__ */ r("section", { "data-testid": "rail-retry-section", children: [
295
295
  /* @__PURE__ */ n(
296
- In,
296
+ Pn,
297
297
  {
298
298
  value: i.retry,
299
- onChange: (p) => E({ ...i, retry: p }),
299
+ onChange: (g) => E({ ...i, retry: g }),
300
300
  readOnly: a,
301
301
  target: e
302
302
  }
303
303
  ),
304
+ e === "function" && i.timeoutApplicable && /* @__PURE__ */ r("label", { className: "w6w-field", "data-testid": "rail-timeout-field", children: [
305
+ /* @__PURE__ */ n("span", { children: "Timeout (seconds)" }),
306
+ /* @__PURE__ */ n(
307
+ "input",
308
+ {
309
+ type: "number",
310
+ min: 1,
311
+ max: 280,
312
+ step: 1,
313
+ placeholder: "120",
314
+ value: i.timeoutMs === void 0 ? "" : i.timeoutMs / 1e3,
315
+ disabled: a,
316
+ onChange: (g) => {
317
+ const A = g.target.valueAsNumber;
318
+ E({
319
+ ...i,
320
+ timeoutMs: g.target.value === "" || !Number.isFinite(A) ? void 0 : Math.round(A * 1e3)
321
+ });
322
+ }
323
+ }
324
+ ),
325
+ /* @__PURE__ */ n("span", { className: "w6w-hint", children: "How long this step waits for the app before it fails. Default 120 seconds; up to 280." })
326
+ ] }),
304
327
  e === "workflow" && /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-retry-run-warning", children: "Retrying re-runs the whole workflow from its first step, so steps that already succeeded run again. For a step that must not repeat (a send or a charge), set retry on that step instead." })
305
328
  ] }),
306
329
  /* @__PURE__ */ n("p", { className: "muted small", children: e === "workflow" ? "What runs when this workflow's run fails, after every node's own retry is spent." : "What runs when this call fails, after retry (if any) is exhausted." }),
@@ -347,13 +370,13 @@ function ln({
347
370
  D === "warn" && /* @__PURE__ */ n("div", { className: "result error", "data-testid": "rail-errorhandling-self-caution", children: "This handler targets itself. Its imported input adapter is preserved; the server will refuse it if it resolves to the failed call's same inputs." }),
348
371
  b && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-errorhandling-error", children: b }),
349
372
  c && /* @__PURE__ */ n(
350
- Tn,
373
+ In,
351
374
  {
352
375
  appsOnly: !0,
353
376
  callables: ["function", "workflow"],
354
377
  title: "Choose what runs on failure",
355
378
  onClose: () => v(!1),
356
- onAdd: R
379
+ onAdd: M
357
380
  }
358
381
  )
359
382
  ] });
@@ -361,11 +384,11 @@ function ln({
361
384
  function Ft({ ctx: e }) {
362
385
  const t = "policy" in e ? e.policy : void 0, i = "onPolicyChange" in e ? e.onPolicyChange : void 0;
363
386
  return /* @__PURE__ */ n(
364
- ln,
387
+ on,
365
388
  {
366
389
  kind: e.kind,
367
390
  id: e.id,
368
- policy: t ? Ge(t) : {},
391
+ policy: t ?? {},
369
392
  ready: !!i,
370
393
  saving: !1,
371
394
  onPersist: (s) => i == null ? void 0 : i(s)
@@ -373,19 +396,19 @@ function Ft({ ctx: e }) {
373
396
  );
374
397
  }
375
398
  function Ht({ id: e, kind: t }) {
376
- const i = Ye(e, t === "function"), s = Ze(e, t === "endpoint"), a = Xe(), o = xe(), l = ze(t, t === "function" ? i.data : s.data), d = t === "function" ? a.isPending : o.isPending;
399
+ const i = Ge(e, t === "function"), s = Ye(e, t === "endpoint"), a = Ze(), o = Xe(), l = ze(t, t === "function" ? i.data : s.data), d = t === "function" ? a.isPending : o.isPending;
377
400
  return /* @__PURE__ */ n(
378
- ln,
401
+ on,
379
402
  {
380
403
  kind: t,
381
404
  id: e,
382
- policy: l ? Ge(l.definition) : {},
405
+ policy: l ? lt(l.definition) : {},
383
406
  ready: !!l,
384
407
  saving: d,
385
408
  onPersist: (h, c) => {
386
409
  if (!l) return;
387
410
  const v = {
388
- definition: lt(l.definition, h),
411
+ definition: ot(l.definition, h),
389
412
  ifUnmodifiedSince: l.updatedAt
390
413
  }, b = {
391
414
  onError: (m) => c(m instanceof j ? m.message : String(m))
@@ -405,7 +428,7 @@ const Bt = {
405
428
  id: "error-handling",
406
429
  title: "Error handling",
407
430
  Icon: Jt,
408
- isAvailable: (e) => ot(e),
431
+ isAvailable: (e) => rt(e),
409
432
  Panel: qt
410
433
  }, Kt = {
411
434
  id: "history",
@@ -461,9 +484,9 @@ function zt({ tags: e, onChange: t }) {
461
484
  )
462
485
  ] });
463
486
  }
464
- function dn(e) {
465
- const t = At(e.kind).settings, { initial: i } = e, [s, a] = u(i.displayName), [o, l] = u(i.key ?? ""), [d, h] = u(i.tags ?? []), [c, v] = u(!1), [b, m] = u(null), C = s !== i.displayName, k = o !== (i.key ?? ""), D = t.hasTags && JSON.stringify(d) !== JSON.stringify(i.tags ?? []), O = C || k || D, E = t.canEditKey, R = o === "" || st(o), y = O && R && !c;
466
- async function M() {
487
+ function ln(e) {
488
+ const t = At(e.kind).settings, { initial: i } = e, [s, a] = u(i.displayName), [o, l] = u(i.key ?? ""), [d, h] = u(i.tags ?? []), [c, v] = u(!1), [b, m] = u(null), C = s !== i.displayName, k = o !== (i.key ?? ""), D = t.hasTags && JSON.stringify(d) !== JSON.stringify(i.tags ?? []), O = C || k || D, E = t.canEditKey, M = o === "" || it(o), y = O && M && !c;
489
+ async function R() {
467
490
  if (y) {
468
491
  m(null), v(!0);
469
492
  try {
@@ -479,7 +502,7 @@ function dn(e) {
479
502
  }
480
503
  }
481
504
  }
482
- const Q = Dn(M, { enabled: y });
505
+ const Q = Tn(R, { enabled: y });
483
506
  return /* @__PURE__ */ r(B, { title: "Edit settings", onClose: e.onClose, children: [
484
507
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
485
508
  /* @__PURE__ */ r("label", { className: "field", children: [
@@ -503,7 +526,7 @@ function dn(e) {
503
526
  {
504
527
  type: "text",
505
528
  value: o,
506
- onChange: (N) => l(at(N.target.value)),
529
+ onChange: (N) => l(st(N.target.value)),
507
530
  placeholder: t.keyPlaceholder,
508
531
  ...Q
509
532
  }
@@ -521,7 +544,7 @@ function dn(e) {
521
544
  ] }),
522
545
  /* @__PURE__ */ r("div", { className: "modal-actions", children: [
523
546
  /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
524
- /* @__PURE__ */ n("button", { type: "button", className: "btn", disabled: !y, onClick: M, children: c ? "Saving…" : "Save" })
547
+ /* @__PURE__ */ n("button", { type: "button", className: "btn", disabled: !y, onClick: R, children: c ? "Saving…" : "Save" })
525
548
  ] })
526
549
  ] });
527
550
  }
@@ -551,13 +574,13 @@ const Gt = {
551
574
  invokeError: "endpoints-version-invoke-error"
552
575
  }
553
576
  };
554
- function cn(e) {
555
- const { kind: t, id: i, versionNumber: s } = e, a = Gt[t], o = Zn(t, i, s, !0), l = Xn(t), d = xn(t), [h, c] = u(!1), [v, b] = u(null);
577
+ function dn(e) {
578
+ const { kind: t, id: i, versionNumber: s } = e, a = Gt[t], o = Yn(t, i, s, !0), l = Zn(t), d = Xn(t), [h, c] = u(!1), [v, b] = u(null);
556
579
  return /* @__PURE__ */ r(V, { children: [
557
580
  /* @__PURE__ */ r(B, { title: `Version ${s}`, onClose: e.onClose, wide: !0, children: [
558
581
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
559
582
  o.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : o.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": a.error, children: o.error instanceof Error ? o.error.message : String(o.error) }) : o.data ? /* @__PURE__ */ n("div", { "data-testid": a.json, children: /* @__PURE__ */ n(
560
- pe,
583
+ ge,
561
584
  {
562
585
  code: JSON.stringify(o.data.definition, null, 2),
563
586
  language: "json",
@@ -567,7 +590,7 @@ function cn(e) {
567
590
  ) }) : null,
568
591
  (v || l.isError) && /* @__PURE__ */ n("div", { className: "error", children: v ?? String(l.error) }),
569
592
  d.data !== void 0 && /* @__PURE__ */ n("div", { "data-testid": a.invokeJson, children: /* @__PURE__ */ n(
570
- pe,
593
+ ge,
571
594
  {
572
595
  code: JSON.stringify(d.data, null, 2),
573
596
  language: "json",
@@ -604,7 +627,7 @@ function cn(e) {
604
627
  ] })
605
628
  ] }),
606
629
  h && /* @__PURE__ */ n(
607
- tt,
630
+ nt,
608
631
  {
609
632
  title: "Revert to this version",
610
633
  message: `Revert to version ${s}? This restores its content onto the resource's current draft; the resource's key and address stay unchanged.`,
@@ -655,7 +678,7 @@ function Yt(e) {
655
678
  }
656
679
  ) : t ? /* @__PURE__ */ r("span", { className: "rail-danger-zone-delete", children: [
657
680
  /* @__PURE__ */ n(
658
- On,
681
+ Dn,
659
682
  {
660
683
  label: i,
661
684
  "data-testid": s,
@@ -670,13 +693,13 @@ function Yt(e) {
670
693
  h && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-archive-error", children: h })
671
694
  ] });
672
695
  }
673
- function un(e) {
696
+ function cn(e) {
674
697
  return /* @__PURE__ */ r("div", { className: "right-rail-panel-head rail-settings-head", children: [
675
698
  /* @__PURE__ */ n("h3", { children: "Settings" }),
676
- /* @__PURE__ */ n(Rn, { label: "Edit settings", "data-testid": "rail-settings-edit", onClick: e.onEdit })
699
+ /* @__PURE__ */ n(On, { label: "Edit settings", "data-testid": "rail-settings-edit", onClick: e.onEdit })
677
700
  ] });
678
701
  }
679
- function hn(e) {
702
+ function un(e) {
680
703
  const { id: t, displayName: i, fields: s, row: a, tags: o } = e;
681
704
  return /* @__PURE__ */ n("div", { className: "rail-meta", children: /* @__PURE__ */ n(
682
705
  "div",
@@ -710,7 +733,7 @@ function hn(e) {
710
733
  }
711
734
  ) });
712
735
  }
713
- function fn(e) {
736
+ function hn(e) {
714
737
  return /* @__PURE__ */ n("div", { className: "rail-spec-actions", children: /* @__PURE__ */ n(
715
738
  Se,
716
739
  {
@@ -721,7 +744,7 @@ function fn(e) {
721
744
  }
722
745
  ) });
723
746
  }
724
- function mn(e) {
747
+ function fn(e) {
725
748
  const { kind: t, children: i, onImport: s, onClose: a } = e;
726
749
  return /* @__PURE__ */ r(B, { title: "Definition", onClose: a, children: [
727
750
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
@@ -747,7 +770,7 @@ function mn(e) {
747
770
  /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: a, children: "Close" }) })
748
771
  ] });
749
772
  }
750
- function gn(e) {
773
+ function mn(e) {
751
774
  const { open: t, versions: i } = e;
752
775
  return /* @__PURE__ */ r("div", { className: "rail-version-section", children: [
753
776
  e.definitionStatus && /* @__PURE__ */ r("div", { "aria-live": "polite", "data-testid": "rail-definition-status", children: [
@@ -858,7 +881,7 @@ const Zt = {
858
881
  archiveTestId: "wf-settings-archive"
859
882
  }
860
883
  };
861
- function vn(e) {
884
+ function gn(e) {
862
885
  const t = Zt[e.kind];
863
886
  return /* @__PURE__ */ r(V, { children: [
864
887
  /* @__PURE__ */ n(
@@ -900,7 +923,7 @@ function vn(e) {
900
923
  )
901
924
  ] });
902
925
  }
903
- const bn = { functionsKey: ct, endpointsKey: dt, workflowsKey: kt };
926
+ const vn = { functionsKey: ct, endpointsKey: dt, workflowsKey: kt };
904
927
  function Xt({
905
928
  ctx: e,
906
929
  project: t,
@@ -915,7 +938,7 @@ function Xt({
915
938
  setHistoryOpen: d,
916
939
  versionListOpen: h,
917
940
  setVersionListOpen: c
918
- } = s, v = nn(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = pt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = qe(!1), [R, y] = u(!1), [M, Q] = u(!1), [N, p] = u(!1), [P, q] = u(!1), [U, W] = u(!1), [$, oe] = u(null), [_, le] = u(null), F = Be(We("workflow"), m, N), z = Ke("workflow", m, l && b), te = Ue("workflow"), de = _e("workflow"), [ke, G] = u(null), [ie, ce] = u(null), [se, ue] = u(
941
+ } = s, v = en(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = gt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = qe(!1), [M, y] = u(!1), [R, Q] = u(!1), [N, g] = u(!1), [A, q] = u(!1), [U, W] = u(!1), [$, oe] = u(null), [_, le] = u(null), F = Be(We("workflow"), m, N), z = Ke("workflow", m, l && b), te = Ue("workflow"), de = _e("workflow"), [ke, G] = u(null), [ie, ce] = u(null), [se, ue] = u(
919
942
  null
920
943
  );
921
944
  if (!e || e.kind !== "workflow")
@@ -944,7 +967,7 @@ function Xt({
944
967
  });
945
968
  }
946
969
  return /* @__PURE__ */ r("div", { className: "rail-settings-panel", children: [
947
- /* @__PURE__ */ n(un, { onEdit: () => o(!0) }),
970
+ /* @__PURE__ */ n(cn, { onEdit: () => o(!0) }),
948
971
  e.authoringSettings && e.onAuthoringSettingChange && /* @__PURE__ */ r("section", { className: "w6w-stack", "data-testid": "rail-workflow-authoring", children: [
949
972
  /* @__PURE__ */ r("label", { children: [
950
973
  /* @__PURE__ */ n(
@@ -953,8 +976,8 @@ function Xt({
953
976
  type: "checkbox",
954
977
  checked: e.authoringSettings.autoSave,
955
978
  onChange: (f) => {
956
- var A;
957
- return (A = e.onAuthoringSettingChange) == null ? void 0 : A.call(e, "autoSave", f.target.checked);
979
+ var P;
980
+ return (P = e.onAuthoringSettingChange) == null ? void 0 : P.call(e, "autoSave", f.target.checked);
958
981
  }
959
982
  }
960
983
  ),
@@ -967,8 +990,8 @@ function Xt({
967
990
  type: "checkbox",
968
991
  checked: e.authoringSettings.savePosition,
969
992
  onChange: (f) => {
970
- var A;
971
- return (A = e.onAuthoringSettingChange) == null ? void 0 : A.call(e, "savePosition", f.target.checked);
993
+ var P;
994
+ return (P = e.onAuthoringSettingChange) == null ? void 0 : P.call(e, "savePosition", f.target.checked);
972
995
  }
973
996
  }
974
997
  ),
@@ -976,7 +999,7 @@ function Xt({
976
999
  ] })
977
1000
  ] }),
978
1001
  /* @__PURE__ */ n(
979
- hn,
1002
+ un,
980
1003
  {
981
1004
  id: e.id,
982
1005
  displayName: he,
@@ -985,9 +1008,9 @@ function Xt({
985
1008
  tags: H
986
1009
  }
987
1010
  ),
988
- /* @__PURE__ */ n(fn, { onOpen: () => y(!0) }),
1011
+ /* @__PURE__ */ n(hn, { onOpen: () => y(!0) }),
989
1012
  /* @__PURE__ */ n(
990
- gn,
1013
+ mn,
991
1014
  {
992
1015
  definitionStatus: e.definitionStatus,
993
1016
  publishDisabled: e.publishDisabled,
@@ -1013,7 +1036,7 @@ function Xt({
1013
1036
  var f;
1014
1037
  ce(null), de.mutate(
1015
1038
  { id: m, enabled: !((f = z.data) != null && f.enabled) },
1016
- { onError: (A) => ce(A instanceof j ? A.message : String(A)) }
1039
+ { onError: (P) => ce(P instanceof j ? P.message : String(P)) }
1017
1040
  );
1018
1041
  }
1019
1042
  }
@@ -1028,7 +1051,7 @@ function Xt({
1028
1051
  }
1029
1052
  ),
1030
1053
  se && se.id === m && /* @__PURE__ */ n(
1031
- cn,
1054
+ dn,
1032
1055
  {
1033
1056
  kind: "workflow",
1034
1057
  id: m,
@@ -1037,8 +1060,8 @@ function Xt({
1037
1060
  onClose: () => ue(null)
1038
1061
  }
1039
1062
  ),
1040
- R && /* @__PURE__ */ r(
1041
- mn,
1063
+ M && /* @__PURE__ */ r(
1064
+ fn,
1042
1065
  {
1043
1066
  kind: "workflow",
1044
1067
  onClose: () => y(!1),
@@ -1054,7 +1077,7 @@ function Xt({
1054
1077
  className: "btn ghost",
1055
1078
  "data-testid": "rail-spec-export",
1056
1079
  onClick: () => {
1057
- y(!1), p(!0);
1080
+ y(!1), g(!0);
1058
1081
  },
1059
1082
  children: "Export"
1060
1083
  }
@@ -1062,9 +1085,9 @@ function Xt({
1062
1085
  ]
1063
1086
  }
1064
1087
  ),
1065
- N && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => p(!1), wide: !0, children: [
1088
+ N && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => g(!1), wide: !0, children: [
1066
1089
  /* @__PURE__ */ n("div", { className: "modal-body", children: F.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : F.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: F.error instanceof Error ? F.error.message : String(F.error) }) : F.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
1067
- pe,
1090
+ ge,
1068
1091
  {
1069
1092
  code: JSON.stringify(F.data, null, 2),
1070
1093
  language: "json",
@@ -1072,10 +1095,10 @@ function Xt({
1072
1095
  copyable: !0
1073
1096
  }
1074
1097
  ) }) : null }),
1075
- /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => p(!1), children: "Close" }) })
1098
+ /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => g(!1), children: "Close" }) })
1076
1099
  ] }),
1077
1100
  a && I && /* @__PURE__ */ n(
1078
- dn,
1101
+ ln,
1079
1102
  {
1080
1103
  kind: "workflow",
1081
1104
  id: m,
@@ -1086,15 +1109,15 @@ function Xt({
1086
1109
  },
1087
1110
  onSave: async (f) => {
1088
1111
  if (!C.data) throw new Error("Unable to save settings");
1089
- const A = C.data;
1090
- return new Promise((ge, re) => {
1112
+ const P = C.data;
1113
+ return new Promise((pe, re) => {
1091
1114
  const X = {
1092
- ...A.workflow,
1115
+ ...P.workflow,
1093
1116
  displayName: f.displayName
1094
1117
  };
1095
1118
  f.key !== void 0 && (X.key = f.key), f.tags !== void 0 && (X.tags = f.tags), k.mutate(
1096
- { definition: X, ifUnmodifiedSince: A.updatedAt },
1097
- { onSuccess: () => ge(), onError: re }
1119
+ { definition: X, ifUnmodifiedSince: P.updatedAt },
1120
+ { onSuccess: () => pe(), onError: re }
1098
1121
  );
1099
1122
  });
1100
1123
  },
@@ -1103,12 +1126,12 @@ function Xt({
1103
1126
  m
1104
1127
  ),
1105
1128
  /* @__PURE__ */ n(
1106
- vn,
1129
+ gn,
1107
1130
  {
1108
1131
  kind: "workflow",
1109
1132
  archived: Y,
1110
1133
  pending: D.isPending || O.isPending,
1111
- deleteConfirming: P,
1134
+ deleteConfirming: A,
1112
1135
  archiveConfirming: U,
1113
1136
  deleteError: $,
1114
1137
  archiveError: _,
@@ -1120,20 +1143,20 @@ function Xt({
1120
1143
  onCloseArchive: () => W(!1)
1121
1144
  }
1122
1145
  ),
1123
- M && /* @__PURE__ */ n(
1124
- tn,
1146
+ R && /* @__PURE__ */ n(
1147
+ nn,
1125
1148
  {
1126
1149
  kind: "workflow",
1127
1150
  project: t ?? void 0,
1128
- listKeys: bn,
1129
- onOpenImported: (f, A) => i({ type: "imported", kind: f, id: A }),
1151
+ listKeys: vn,
1152
+ onOpenImported: (f, P) => i({ type: "imported", kind: f, id: P }),
1130
1153
  onClose: () => Q(!1)
1131
1154
  }
1132
1155
  )
1133
1156
  ] });
1134
1157
  }
1135
1158
  function xt({ ctx: e }) {
1136
- const { project: t, onNavigate: i } = on(), [s, a] = u(!1), [o, l] = u(!1), [d, h] = u(!1), c = {
1159
+ const { project: t, onNavigate: i } = rn(), [s, a] = u(!1), [o, l] = u(!1), [d, h] = u(!1), c = {
1137
1160
  editingSettings: s,
1138
1161
  setEditingSettings: a,
1139
1162
  historyOpen: o,
@@ -1157,29 +1180,29 @@ function ei({
1157
1180
  setHistoryOpen: d,
1158
1181
  versionListOpen: h,
1159
1182
  setVersionListOpen: c
1160
- } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = en(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, R] = u(null), [y, M] = u(null), [Q, N] = u(!1), [p, P] = u(!1), [q, U] = u(!1), [W, $] = u(!1), [oe, _] = u(!1), [le, F] = u(null), [z, te] = u(null), de = Ye((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = Ze((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Xe(), ie = xe(), ce = ht(), se = ft(), ue = mt(), I = gt(), he = e ? We(e.kind) : null, H = Be(he, (e == null ? void 0 : e.id) ?? "", p), Y = e && Me(e.kind) ? e.kind : null, Z = Ke(Y, (e == null ? void 0 : e.id) ?? "", l), fe = Ue(Y ?? "function"), ae = _e(Y ?? "function"), [me, f] = u(null), [A, ge] = u(null), [re, X] = u(
1183
+ } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = xe(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, M] = u(null), [y, R] = u(null), [Q, N] = u(!1), [g, A] = u(!1), [q, U] = u(!1), [W, $] = u(!1), [oe, _] = u(!1), [le, F] = u(null), [z, te] = u(null), de = Ge((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = Ye((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Ze(), ie = Xe(), ce = ht(), se = ft(), ue = mt(), I = pt(), he = e ? We(e.kind) : null, H = Be(he, (e == null ? void 0 : e.id) ?? "", g), Y = e && Re(e.kind) ? e.kind : null, Z = Ke(Y, (e == null ? void 0 : e.id) ?? "", l), fe = Ue(Y ?? "function"), ae = _e(Y ?? "function"), [me, f] = u(null), [P, pe] = u(null), [re, X] = u(
1161
1184
  null
1162
1185
  );
1163
1186
  if (!e || e.kind !== "function" && e.kind !== "endpoint")
1164
1187
  return /* @__PURE__ */ n("p", { className: "muted small", children: "Open a workflow, function, or endpoint to see its settings." });
1165
- const S = e.kind, T = e.id, L = S === "function" ? (Pe = m.data) == null ? void 0 : Pe.find((g) => g.id === T) : (Ie = b.data) == null ? void 0 : Ie.find((g) => g.id === T), J = ze(S, S === "function" ? de.data : ke.data), x = (J == null ? void 0 : J.definition) ?? null, Ee = L && typeof L.displayName == "string" ? L.displayName : "", yn = x ? JSON.stringify(x, null, 2) : "";
1166
- function kn() {
1167
- R(null), O(yn), M((J == null ? void 0 : J.updatedAt) ?? null), k(!0);
1188
+ const S = e.kind, T = e.id, L = S === "function" ? (Pe = m.data) == null ? void 0 : Pe.find((p) => p.id === T) : (Ie = b.data) == null ? void 0 : Ie.find((p) => p.id === T), J = ze(S, S === "function" ? de.data : ke.data), x = (J == null ? void 0 : J.definition) ?? null, Ee = L && typeof L.displayName == "string" ? L.displayName : "", bn = x ? JSON.stringify(x, null, 2) : "";
1189
+ function yn() {
1190
+ M(null), O(bn), R((J == null ? void 0 : J.updatedAt) ?? null), k(!0);
1168
1191
  }
1169
- const ee = x ? An(D, { id: String(x.id), key: String(x.key) }) : { parsed: null, blockedReason: "No definition loaded yet." }, Ae = S === "function" ? G.isPending : ie.isPending;
1170
- function wn() {
1192
+ const ee = x ? En(D, { id: String(x.id), key: String(x.key) }) : { parsed: null, blockedReason: "No definition loaded yet." }, Ae = S === "function" ? G.isPending : ie.isPending;
1193
+ function kn() {
1171
1194
  if (!ee.parsed || ee.blockedReason) return;
1172
- R(null);
1173
- const g = {
1195
+ M(null);
1196
+ const p = {
1174
1197
  onSuccess: () => k(!1),
1175
- onError: (ne) => R(ne instanceof j ? ne.message : String(ne))
1198
+ onError: (ne) => M(ne instanceof j ? ne.message : String(ne))
1176
1199
  }, w = { definition: ee.parsed, ifUnmodifiedSince: y };
1177
- S === "function" ? G.mutate(w, g) : ie.mutate(w, g);
1200
+ S === "function" ? G.mutate(w, p) : ie.mutate(w, p);
1178
1201
  }
1179
- const Nn = (L == null ? void 0 : L.archivedAt) != null;
1180
- function Sn() {
1202
+ const wn = (L == null ? void 0 : L.archivedAt) != null;
1203
+ function Nn() {
1181
1204
  F(null);
1182
- const g = {
1205
+ const p = {
1183
1206
  onSuccess: () => {
1184
1207
  $(!1), i({ type: "list" });
1185
1208
  },
@@ -1187,11 +1210,11 @@ function ei({
1187
1210
  $(!1), F(w instanceof j ? w.message : String(w));
1188
1211
  }
1189
1212
  };
1190
- S === "function" ? ce.mutate(T, g) : se.mutate(T, g);
1213
+ S === "function" ? ce.mutate(T, p) : se.mutate(T, p);
1191
1214
  }
1192
- function Cn() {
1215
+ function Sn() {
1193
1216
  te(null);
1194
- const g = {
1217
+ const p = {
1195
1218
  onSuccess: () => {
1196
1219
  _(!1), i({ type: "list" });
1197
1220
  },
@@ -1199,12 +1222,12 @@ function ei({
1199
1222
  _(!1), te(w instanceof j ? w.message : String(w));
1200
1223
  }
1201
1224
  };
1202
- S === "function" ? ue.mutate(T, g) : I.mutate(T, g);
1225
+ S === "function" ? ue.mutate(T, p) : I.mutate(T, p);
1203
1226
  }
1204
1227
  return /* @__PURE__ */ r("div", { className: "rail-settings-panel", children: [
1205
- /* @__PURE__ */ n(un, { onEdit: () => o(!0) }),
1228
+ /* @__PURE__ */ n(cn, { onEdit: () => o(!0) }),
1206
1229
  /* @__PURE__ */ n(
1207
- hn,
1230
+ un,
1208
1231
  {
1209
1232
  id: T,
1210
1233
  displayName: Ee,
@@ -1212,29 +1235,29 @@ function ei({
1212
1235
  row: L
1213
1236
  }
1214
1237
  ),
1215
- je(S) && /* @__PURE__ */ n(fn, { onOpen: () => N(!0) }),
1216
- Me(S) && /* @__PURE__ */ n(
1217
- gn,
1238
+ je(S) && /* @__PURE__ */ n(hn, { onOpen: () => N(!0) }),
1239
+ Re(S) && /* @__PURE__ */ n(
1240
+ mn,
1218
1241
  {
1219
1242
  open: l,
1220
1243
  versions: Z.data,
1221
1244
  publishing: fe.isPending,
1222
1245
  togglingEnabled: ae.isPending,
1223
1246
  publishError: me,
1224
- enableError: A,
1247
+ enableError: P,
1225
1248
  onShow: () => {
1226
1249
  d(!0), c(!0);
1227
1250
  },
1228
1251
  onPublish: () => {
1229
1252
  f(null), fe.mutate(T, {
1230
- onError: (g) => f(g instanceof j ? g.message : String(g))
1253
+ onError: (p) => f(p instanceof j ? p.message : String(p))
1231
1254
  });
1232
1255
  },
1233
1256
  onToggleEnabled: () => {
1234
- var g;
1235
- ge(null), ae.mutate(
1236
- { id: T, enabled: !((g = Z.data) != null && g.enabled) },
1237
- { onError: (w) => ge(w instanceof j ? w.message : String(w)) }
1257
+ var p;
1258
+ pe(null), ae.mutate(
1259
+ { id: T, enabled: !((p = Z.data) != null && p.enabled) },
1260
+ { onError: (w) => pe(w instanceof j ? w.message : String(w)) }
1238
1261
  );
1239
1262
  }
1240
1263
  }
@@ -1244,12 +1267,12 @@ function ei({
1244
1267
  {
1245
1268
  loading: Z.isLoading,
1246
1269
  versions: (Te = Z.data) == null ? void 0 : Te.versions,
1247
- onSelect: (g) => X({ id: T, versionNumber: g }),
1270
+ onSelect: (p) => X({ id: T, versionNumber: p }),
1248
1271
  onClose: () => c(!1)
1249
1272
  }
1250
1273
  ),
1251
1274
  re && re.id === T && /* @__PURE__ */ n(
1252
- cn,
1275
+ dn,
1253
1276
  {
1254
1277
  kind: S,
1255
1278
  id: T,
@@ -1258,7 +1281,7 @@ function ei({
1258
1281
  }
1259
1282
  ),
1260
1283
  Q && /* @__PURE__ */ n(
1261
- mn,
1284
+ fn,
1262
1285
  {
1263
1286
  kind: S,
1264
1287
  onClose: () => N(!1),
@@ -1275,7 +1298,7 @@ function ei({
1275
1298
  className: "btn ghost",
1276
1299
  "data-testid": "rail-spec-export",
1277
1300
  onClick: () => {
1278
- N(!1), P(!0);
1301
+ N(!1), A(!0);
1279
1302
  },
1280
1303
  children: "Export"
1281
1304
  }
@@ -1289,7 +1312,7 @@ function ei({
1289
1312
  disabled: !x,
1290
1313
  "data-testid": "rail-json-edit",
1291
1314
  onClick: () => {
1292
- N(!1), kn();
1315
+ N(!1), yn();
1293
1316
  },
1294
1317
  children: "Edit JSON"
1295
1318
  }
@@ -1298,9 +1321,9 @@ function ei({
1298
1321
  ] })
1299
1322
  }
1300
1323
  ),
1301
- p && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => P(!1), wide: !0, children: [
1324
+ g && /* @__PURE__ */ r(B, { title: "Export spec document", onClose: () => A(!1), wide: !0, children: [
1302
1325
  /* @__PURE__ */ n("div", { className: "modal-body", children: H.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : H.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: H.error instanceof Error ? H.error.message : String(H.error) }) : H.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
1303
- pe,
1326
+ ge,
1304
1327
  {
1305
1328
  code: JSON.stringify(H.data, null, 2),
1306
1329
  language: "json",
@@ -1308,7 +1331,7 @@ function ei({
1308
1331
  copyable: !0
1309
1332
  }
1310
1333
  ) }) : null }),
1311
- /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => P(!1), children: "Close" }) })
1334
+ /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => A(!1), children: "Close" }) })
1312
1335
  ] }),
1313
1336
  C && /* @__PURE__ */ r(B, { title: "Edit definition", onClose: () => k(!1), wide: !0, children: [
1314
1337
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
@@ -1333,14 +1356,14 @@ function ei({
1333
1356
  className: "btn",
1334
1357
  disabled: ee.blockedReason !== null || Ae,
1335
1358
  "data-testid": "rail-json-save",
1336
- onClick: wn,
1359
+ onClick: kn,
1337
1360
  children: Ae ? "Saving…" : "Save"
1338
1361
  }
1339
1362
  )
1340
1363
  ] })
1341
1364
  ] }),
1342
1365
  a && L && /* @__PURE__ */ n(
1343
- dn,
1366
+ ln,
1344
1367
  {
1345
1368
  kind: S,
1346
1369
  id: T,
@@ -1349,46 +1372,46 @@ function ei({
1349
1372
  key: L.key ?? null,
1350
1373
  tags: L.tags ?? []
1351
1374
  },
1352
- onSave: async (g) => {
1375
+ onSave: async (p) => {
1353
1376
  if (!J) throw new Error("Unable to save settings");
1354
- const w = J.definition, ne = L.tags ?? [], De = g.tags !== void 0 && (g.tags.length !== ne.length || g.tags.some((we, Ne) => we !== ne[Ne])) ? { tags: g.tags } : {}, Oe = { definition: S === "function" ? (
1377
+ const w = J.definition, ne = L.tags ?? [], De = p.tags !== void 0 && (p.tags.length !== ne.length || p.tags.some((we, Ne) => we !== ne[Ne])) ? { tags: p.tags } : {}, Oe = { definition: S === "function" ? (
1355
1378
  // `canEditKey: true` for function (`callable-descriptors.ts`): `data.key` must
1356
1379
  // reach the server (the modal falls back to `initial.key` when unchanged).
1357
- { ...w, displayName: g.displayName, key: g.key ?? w.key, ...De }
1358
- ) : { ...w, displayName: g.displayName, ...De }, ifUnmodifiedSince: J.updatedAt };
1380
+ { ...w, displayName: p.displayName, key: p.key ?? w.key, ...De }
1381
+ ) : { ...w, displayName: p.displayName, ...De }, ifUnmodifiedSince: J.updatedAt };
1359
1382
  return new Promise((we, Ne) => {
1360
- const Re = { onSuccess: () => we(), onError: Ne };
1361
- S === "function" ? G.mutate(Oe, Re) : ie.mutate(Oe, Re);
1383
+ const Me = { onSuccess: () => we(), onError: Ne };
1384
+ S === "function" ? G.mutate(Oe, Me) : ie.mutate(Oe, Me);
1362
1385
  });
1363
1386
  },
1364
1387
  onClose: () => o(!1)
1365
1388
  },
1366
1389
  T
1367
1390
  ),
1368
- Pn(S) && /* @__PURE__ */ n(
1369
- vn,
1391
+ An(S) && /* @__PURE__ */ n(
1392
+ gn,
1370
1393
  {
1371
1394
  kind: S,
1372
- archived: Nn,
1395
+ archived: wn,
1373
1396
  deleteConfirming: W,
1374
1397
  archiveConfirming: oe,
1375
1398
  deleteError: le,
1376
1399
  archiveError: z,
1377
1400
  onRequestDelete: () => $(!0),
1378
1401
  onRequestArchive: () => _(!0),
1379
- onConfirmDelete: Sn,
1380
- onConfirmArchive: Cn,
1402
+ onConfirmDelete: Nn,
1403
+ onConfirmArchive: Sn,
1381
1404
  onCloseDelete: () => $(!1),
1382
1405
  onCloseArchive: () => _(!1)
1383
1406
  }
1384
1407
  ),
1385
1408
  q && /* @__PURE__ */ n(
1386
- tn,
1409
+ nn,
1387
1410
  {
1388
1411
  kind: S,
1389
1412
  project: t ?? void 0,
1390
- listKeys: bn,
1391
- onOpenImported: (g, w) => i({ type: "imported", kind: g, id: w }),
1413
+ listKeys: vn,
1414
+ onOpenImported: (p, w) => i({ type: "imported", kind: p, id: w }),
1392
1415
  onClose: () => U(!1)
1393
1416
  }
1394
1417
  )
@@ -1409,7 +1432,7 @@ function si({
1409
1432
  variables: e,
1410
1433
  onVariablesChange: t
1411
1434
  }) {
1412
- const i = jn().vars ?? [];
1435
+ const i = Rn().vars ?? [];
1413
1436
  function s() {
1414
1437
  t([...e, { key: "" }]);
1415
1438
  }
@@ -1419,7 +1442,7 @@ function si({
1419
1442
  function o(d) {
1420
1443
  t(e.filter((h, c) => c !== d));
1421
1444
  }
1422
- const l = Hn(e);
1445
+ const l = Fn(e);
1423
1446
  return /* @__PURE__ */ r("div", { className: "workflow-variable-fields", children: [
1424
1447
  /* @__PURE__ */ r("p", { className: "muted small", children: [
1425
1448
  "Declaring variables here defines this workflow's ",
@@ -1470,9 +1493,9 @@ function si({
1470
1493
  /* @__PURE__ */ n(
1471
1494
  Je,
1472
1495
  {
1473
- value: { vars: qn(e, h, i) },
1496
+ value: { vars: Hn(e, h, i) },
1474
1497
  children: /* @__PURE__ */ n(
1475
- Ln,
1498
+ jn,
1476
1499
  {
1477
1500
  value: d.default,
1478
1501
  onChange: (c) => a(h, { default: c }),
@@ -1576,7 +1599,7 @@ function hi() {
1576
1599
  return /* @__PURE__ */ n(K, { name: "database" });
1577
1600
  }
1578
1601
  function fi({ ctx: e }) {
1579
- var k, D, O, E, R;
1602
+ var k, D, O, E, M;
1580
1603
  const t = Pt(), i = wt(e.id), s = (k = i.data) == null ? void 0 : k[0], a = Nt((s == null ? void 0 : s.runId) ?? null), o = ((D = a.data) == null ? void 0 : D.status) ?? (s == null ? void 0 : s.status), l = St((s == null ? void 0 : s.runId) ?? null, o), d = o !== void 0 && !Ct(o), h = qe(null);
1581
1604
  if (be(() => {
1582
1605
  !d || !s || s.finishedAt !== null || h.current !== s.runId && (h.current = s.runId, t.invalidateQueries({ queryKey: Et(e.id) }));
@@ -1607,23 +1630,23 @@ function fi({ ctx: e }) {
1607
1630
  }
1608
1631
  ),
1609
1632
  a.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : C.length === 0 || !b ? /* @__PURE__ */ n("p", { className: "muted small", "data-testid": "rail-state-current-none", children: "This run has no state." }) : /* @__PURE__ */ r(V, { children: [
1610
- /* @__PURE__ */ n(Vn, { value: b }),
1633
+ /* @__PURE__ */ n(Ln, { value: b }),
1611
1634
  /* @__PURE__ */ n("ul", { className: "list", "data-testid": "rail-state-writers", children: C.map((y) => {
1612
- const M = m.get(y);
1635
+ const R = m.get(y);
1613
1636
  return /* @__PURE__ */ n("li", { "data-testid": "rail-state-writer", children: /* @__PURE__ */ r("span", { className: "list-main", children: [
1614
1637
  /* @__PURE__ */ n("code", { children: y }),
1615
- /* @__PURE__ */ n("span", { className: "muted small block", children: M ? /* @__PURE__ */ r(V, { children: [
1638
+ /* @__PURE__ */ n("span", { className: "muted small block", children: R ? /* @__PURE__ */ r(V, { children: [
1616
1639
  "Last written by ",
1617
- /* @__PURE__ */ n("code", { children: M })
1640
+ /* @__PURE__ */ n("code", { children: R })
1618
1641
  ] }) : m.has(y) ? "From the starting state" : "No step wrote it" })
1619
1642
  ] }) }, y);
1620
1643
  }) }),
1621
- ((R = l.data) == null ? void 0 : R.truncated) && /* @__PURE__ */ n("p", { className: "muted small", children: "The run's state log reached its limit, so later writers aren't shown." })
1644
+ ((M = l.data) == null ? void 0 : M.truncated) && /* @__PURE__ */ n("p", { className: "muted small", children: "The run's state log reached its limit, so later writers aren't shown." })
1622
1645
  ] })
1623
1646
  ] });
1624
1647
  }
1625
1648
  function mi({ ctx: e }) {
1626
- const t = di(e.startingState), i = Jn(e.startingState, e.variables ?? []);
1649
+ const t = di(e.startingState), i = qn(e.startingState, e.variables ?? []);
1627
1650
  return /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-state-starting", children: [
1628
1651
  /* @__PURE__ */ n("p", { className: "muted small", children: "Workflow inputs override starting state; starting state overrides project variables with the same name." }),
1629
1652
  i.length > 0 && /* @__PURE__ */ r("p", { className: "muted small", "data-testid": "starting-data-collision", children: [
@@ -1654,7 +1677,7 @@ function mi({ ctx: e }) {
1654
1677
  ] }) }, s.path)) })
1655
1678
  ] });
1656
1679
  }
1657
- function gi({
1680
+ function pi({
1658
1681
  variables: e,
1659
1682
  onVariablesChange: t
1660
1683
  }) {
@@ -1697,11 +1720,11 @@ function gi({
1697
1720
  )
1698
1721
  ] });
1699
1722
  }
1700
- function pi({ ctx: e }) {
1723
+ function gi({ ctx: e }) {
1701
1724
  return (e == null ? void 0 : e.kind) !== "workflow" || !e.onOpenStartingState ? null : /* @__PURE__ */ r("div", { className: "w6w-stack", "data-testid": "rail-state-body", children: [
1702
1725
  /* @__PURE__ */ n("div", { className: "right-rail-panel-head", children: /* @__PURE__ */ n("h3", { children: "Data" }) }),
1703
1726
  e.onVariablesChange && /* @__PURE__ */ n(
1704
- gi,
1727
+ pi,
1705
1728
  {
1706
1729
  variables: e.variables ?? [],
1707
1730
  onVariablesChange: e.onVariablesChange
@@ -1724,7 +1747,7 @@ const vi = {
1724
1747
  rendersHeading: !0,
1725
1748
  Icon: hi,
1726
1749
  isAvailable: (e) => ui(e) !== void 0,
1727
- Panel: pi,
1750
+ Panel: gi,
1728
1751
  hasIndicator: (e) => (e == null ? void 0 : e.kind) === "workflow" && e.hasStartingState === !0
1729
1752
  }, Ui = [
1730
1753
  ti,
@@ -1739,11 +1762,11 @@ export {
1739
1762
  Bi as P,
1740
1763
  Ki as R,
1741
1764
  Fi as W,
1742
- on as a,
1765
+ rn as a,
1743
1766
  Ji as b,
1744
1767
  qi as c,
1745
1768
  Hi as d,
1746
1769
  Ui as e,
1747
1770
  Tt as u
1748
1771
  };
1749
- //# sourceMappingURL=editor-tools-Ch1cAE4F.js.map
1772
+ //# sourceMappingURL=editor-tools-Dn7TgCP4.js.map