@oomol-lab/open-flow 0.1.0-beta.12 → 0.1.0-beta.13

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.
Files changed (43) hide show
  1. package/dist/browser/{DesignerIcon-ckcKnxxJ.js → DesignerIcon-Bzpx8BtG.js} +7 -2
  2. package/dist/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
  3. package/dist/browser/carbon-Cn-DTyjG.js +54 -0
  4. package/dist/browser/{createResourceDialog-2pESP2wA.js → createResourceDialog-Cdixb0WC.js} +13 -13
  5. package/dist/browser/{dist-BZ5PTFAs.js → dist-D1VYgicl.js} +426 -305
  6. package/dist/browser/{dist-Bmb2mZvW.js → dist-DYjIVIZC.js} +22 -22
  7. package/dist/browser/{dist-Ce71Szg7.js → dist-DwvhuMxw.js} +15 -15
  8. package/dist/browser/{dist-DY4qlXTK.js → dist-TJfrvoIQ.js} +21 -21
  9. package/dist/browser/{esm-BPZ0P6x4.js → esm-nAA6DHox.js} +1 -1
  10. package/dist/browser/flow-authoring-node.d.ts +4 -0
  11. package/dist/browser/flow-authoring.d.ts +1 -1
  12. package/dist/browser/flow-authoring.js +1525 -1454
  13. package/dist/browser/flow-change.d.ts +42 -0
  14. package/dist/browser/flow-change.js +1423 -1387
  15. package/dist/browser/{flowChanges-CHPdBmZb.js → flowChanges-CX0dLRzD.js} +2797 -1609
  16. package/dist/browser/{flowWorkspace-BLGcgnHj.js → flowWorkspace-BhpxeXhY.js} +50485 -49229
  17. package/dist/browser/inputValues-CFlfnXlS.js +30 -0
  18. package/dist/browser/licenses.md +3 -1
  19. package/dist/browser/{select-Dn3vpjGC.js → select-DCGY8Lom.js} +2569 -2013
  20. package/dist/browser/{typeScriptSession-BoV-FDl3.js → typeScriptSession-DnAmJCzu.js} +6 -6
  21. package/dist/browser/workbench.css +1 -1
  22. package/dist/browser/workbench.js +828 -767
  23. package/dist/browser/workbenchSelect-DdXtOYD1.js +30 -0
  24. package/dist/common/control-api-conformance.js +5339 -218
  25. package/dist/common/control-api.d.ts +244 -11
  26. package/dist/common/control-api.js +2007 -1615
  27. package/dist/common/control-requests.js +1153 -1117
  28. package/dist/common/flow-agent.d.ts +10 -0
  29. package/dist/common/flow-encoding.js +162 -127
  30. package/dist/common/flow-semantics.d.ts +4 -2
  31. package/dist/common/flow-semantics.js +4495 -3448
  32. package/dist/common/mcp.js +1351 -1308
  33. package/dist/common/run-events.js +2 -1
  34. package/dist/common/run-lifecycle.d.ts +4 -0
  35. package/dist/common/run-lifecycle.js +30 -0
  36. package/dist/common/run-results.d.ts +56 -0
  37. package/dist/common/runtime-contract.d.ts +24 -0
  38. package/dist/common/scheduler.d.ts +29 -9
  39. package/dist/common/scheduler.js +3246 -2323
  40. package/package.json +1 -1
  41. package/dist/browser/carbon-DMCVsjHo.js +0 -53
  42. package/dist/browser/waitNotificationInputs-BFbQUOyp.js +0 -29
  43. package/dist/browser/workbenchSelect-DzF8oik9.js +0 -435
@@ -1,19 +1,19 @@
1
1
  import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
2
2
  import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
3
- import { $ as s, A as c, B as l, C as u, D as d, E as f, F as p, H as m, I as h, J as g, K as _, M as v, N as y, O as b, P as x, Q as S, R as C, S as w, U as T, V as E, W as D, X as O, Y as ee, Z as k, _ as A, a as j, at as te, b as M, c as N, ct as ne, d as re, dt as ie, et as ae, f as oe, ft as P, g as se, gt as F, h as ce, ht as le, i as ue, it as de, j as I, l as fe, lt as pe, m as me, mt as L, n as R, nt as he, o as ge, ot as _e, p as ve, pt as ye, q as be, rt as xe, s as Se, st as Ce, t as we, tt as z, u as Te, ut as Ee, v as De, w as Oe, x as ke, y as Ae, z as je } from "./flowChanges-CHPdBmZb.js";
4
- import { Ot as Me, Un as Ne, Vn as B, jt as V } from "./getPseudoElementBounds-Dfqo78k7.js";
5
- import { C as Pe, S as Fe, T as Ie, _ as Le, b as Re, c as H, h as U, l as ze, m as Be, w as Ve } from "./select-Dn3vpjGC.js";
6
- import { _ as He, c as Ue, f as We, s as Ge, u as Ke } from "./DesignerIcon-ckcKnxxJ.js";
7
- import { i as qe, n as Je, r as Ye, t as Xe } from "./languages-i3Xmpt6S.js";
8
- import { a as Ze, c as Qe, i as $e, n as et, o as tt, r as nt, s as rt, t as it } from "./workbenchSelect-DzF8oik9.js";
9
- import { Suspense as at, lazy as ot, useEffect as W, useRef as G, useState as K } from "react";
10
- import { Fragment as st, jsx as q, jsxs as J } from "react/jsx-runtime";
11
- import * as ct from "effect/Cause";
12
- import * as Y from "effect/Effect";
13
- import * as lt from "effect/Exit";
14
- import * as ut from "effect/Fiber";
3
+ import { $ as s, B as c, C as l, D as u, F as d, G as f, H as p, I as m, J as h, L as g, M as _, N as v, O as y, P as b, Q as x, S, T as C, U as w, V as T, W as E, X as D, Y as ee, Z as O, _ as k, _t as A, a as j, at as te, b as ne, c as re, ct as ie, d as ae, dt as oe, et as se, f as ce, ft as le, g as ue, gt as de, h as fe, ht as M, it as pe, j as me, k as he, l as ge, lt as _e, m as ve, mt as ye, nt as N, o as be, ot as xe, p as Se, pt as P, q as Ce, r as F, rt as we, s as Te, st as Ee, t as De, tt as Oe, u as ke, ut as Ae, v as je, w as Me, x as Ne, y as Pe, z as I } from "./flowChanges-CX0dLRzD.js";
4
+ import { Ot as Fe, Un as Ie, Vn as L, jt as R } from "./getPseudoElementBounds-Dfqo78k7.js";
5
+ import { B as Le, C as z, G as Re, H as ze, L as Be, S as Ve, U as He, W as Ue, _ as We, c as B, d as Ge, f as Ke, h as qe, l as Je, m as Ye, p as Xe, u as Ze } from "./select-DCGY8Lom.js";
6
+ import { _ as Qe, c as $e, f as et, s as tt, u as nt } from "./DesignerIcon-Bzpx8BtG.js";
7
+ import { i as rt, n as it, r as V, t as at } from "./languages-i3Xmpt6S.js";
8
+ import { t as ot } from "./workbenchSelect-DdXtOYD1.js";
9
+ import { Suspense as st, lazy as ct, useEffect as H, useRef as U, useState as W } from "react";
10
+ import { Fragment as lt, jsx as G, jsxs as K } from "react/jsx-runtime";
11
+ import * as ut from "effect/Cause";
12
+ import * as q from "effect/Effect";
13
+ import * as dt from "effect/Exit";
14
+ import * as ft from "effect/Fiber";
15
15
  //#region src/workbench/browser/runtime/navigation.ts
16
- var dt = class {
16
+ var pt = class {
17
17
  #e;
18
18
  #t;
19
19
  #n;
@@ -72,7 +72,7 @@ var dt = class {
72
72
  this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
73
73
  }
74
74
  async apply(e) {
75
- if (ft(e, this.#t)) return;
75
+ if (mt(e, this.#t)) return;
76
76
  this.#t = e;
77
77
  let t = ++this.#i;
78
78
  this.#s = !0;
@@ -88,37 +88,37 @@ var dt = class {
88
88
  flowId: n,
89
89
  view: n == null ? "design" : e
90
90
  };
91
- ft(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
91
+ mt(r, this.#t) || (this.#t = r, this.#e(r, { replace: t })), this.#r.set(r.view);
92
92
  }
93
93
  };
94
- function ft(e, t) {
94
+ function mt(e, t) {
95
95
  return e.flowId == t.flowId && e.view == t.view;
96
96
  }
97
97
  //#endregion
98
98
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
99
- var pt = ot(() => import("./createResourceDialog-2pESP2wA.js")), mt = qe.map((e) => ({
100
- label: Ye[e],
99
+ var ht = ct(() => import("./createResourceDialog-Cdixb0WC.js")), gt = rt.map((e) => ({
100
+ label: V[e],
101
101
  value: e
102
102
  }));
103
- function ht({ language: e, onLanguageChange: t }) {
104
- let n = r(), [i, a] = K(null);
105
- return t == null ? null : /* @__PURE__ */ J("div", {
103
+ function _t({ language: e, onLanguageChange: t }) {
104
+ let n = r(), [i, a] = W(null);
105
+ return t == null ? null : /* @__PURE__ */ K("div", {
106
106
  className: "resource-language",
107
107
  ref: a,
108
- children: [/* @__PURE__ */ q("span", {
108
+ children: [/* @__PURE__ */ G("span", {
109
109
  className: "sr-only",
110
110
  children: n("language.label")
111
- }), /* @__PURE__ */ q(it, {
111
+ }), /* @__PURE__ */ G(ot, {
112
112
  ariaLabel: n("language.label"),
113
113
  onValueChange: (e) => t(e),
114
- options: mt,
114
+ options: gt,
115
115
  portalRoot: i,
116
116
  value: e
117
117
  })]
118
118
  });
119
119
  }
120
- function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
121
- let [c, l] = K(null), u = G(null), d = G(null), f = G(null), p = i(), m = r(), [h, g] = K("idle"), [_, v] = K(n.name), [y, b] = K(), x = n.live != null && n.live.revisionId != n.draftRevisionId;
120
+ function vt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
121
+ let [c, l] = W(null), u = U(null), d = U(null), f = U(null), p = i(), m = r(), [h, g] = W("idle"), [_, v] = W(n.name), [y, b] = W(), x = n.live != null && n.live.revisionId != n.draftRevisionId;
122
122
  async function S(e) {
123
123
  b(e == "publish" ? "publish" : "enabled");
124
124
  try {
@@ -127,20 +127,20 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
127
127
  b(void 0);
128
128
  }
129
129
  }
130
- let C = U(_);
130
+ let C = z(_);
131
131
  async function w(e) {
132
132
  e.preventDefault();
133
133
  let t = _.trim();
134
- U(t) == null && await s.workspace.renameFlow(n.flowId, t) && g("idle");
134
+ z(t) == null && await s.workspace.renameFlow(n.flowId, t) && g("idle");
135
135
  }
136
136
  async function T() {
137
137
  await s.workspace.deleteFlow(n.flowId) && g("idle");
138
138
  }
139
- return /* @__PURE__ */ J("div", {
139
+ return /* @__PURE__ */ K("div", {
140
140
  className: "resource-item-row",
141
141
  ref: l,
142
142
  children: [
143
- /* @__PURE__ */ J(B, {
143
+ /* @__PURE__ */ K(L, {
144
144
  "aria-disabled": n.status == "retiring",
145
145
  className: "resource-list-row flow-columns",
146
146
  nativeButton: !1,
@@ -149,64 +149,64 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
149
149
  e.preventDefault();
150
150
  return;
151
151
  }
152
- ae(e, () => o(n));
152
+ Oe(e, () => o(n));
153
153
  },
154
- render: /* @__PURE__ */ q("a", { href: n.status == "retiring" ? void 0 : a }),
154
+ render: /* @__PURE__ */ G("a", { href: n.status == "retiring" ? void 0 : a }),
155
155
  tabIndex: n.status == "retiring" ? -1 : void 0,
156
156
  variant: "ghost",
157
157
  children: [
158
- /* @__PURE__ */ J("span", {
158
+ /* @__PURE__ */ K("span", {
159
159
  className: "resource-primary-cell",
160
- children: [/* @__PURE__ */ q("span", {
160
+ children: [/* @__PURE__ */ G("span", {
161
161
  className: "resource-icon",
162
- children: /* @__PURE__ */ q(H, { name: "flow" })
163
- }), /* @__PURE__ */ J("span", { children: [/* @__PURE__ */ J("span", {
162
+ children: /* @__PURE__ */ G(B, { name: "flow" })
163
+ }), /* @__PURE__ */ K("span", { children: [/* @__PURE__ */ K("span", {
164
164
  className: "flex min-w-0 items-center gap-2",
165
- children: [/* @__PURE__ */ q("strong", {
165
+ children: [/* @__PURE__ */ G("strong", {
166
166
  className: "min-w-0 truncate",
167
167
  children: n.name
168
- }), e != null && /* @__PURE__ */ q(ie, {
168
+ }), e != null && /* @__PURE__ */ G(le, {
169
169
  className: "min-w-0 shrink",
170
170
  title: e,
171
171
  variant: "secondary",
172
- children: /* @__PURE__ */ q("span", {
172
+ children: /* @__PURE__ */ G("span", {
173
173
  className: "truncate",
174
174
  children: e
175
175
  })
176
176
  })]
177
- }), /* @__PURE__ */ q("code", {
177
+ }), /* @__PURE__ */ G("code", {
178
178
  translate: "no",
179
179
  children: n.flowId
180
180
  })] })]
181
181
  }),
182
- /* @__PURE__ */ q("time", {
182
+ /* @__PURE__ */ G("time", {
183
183
  dateTime: n.updatedAt,
184
184
  children: new Date(n.updatedAt).toLocaleString(p)
185
185
  }),
186
- /* @__PURE__ */ q("span", {
186
+ /* @__PURE__ */ G("span", {
187
187
  className: "resource-status",
188
188
  children: m(n.status == "retiring" ? "resource.retiring" : n.live == null ? "resource.notPublished" : x ? "resource.unpublishedChanges" : "resource.isPublished")
189
189
  })
190
190
  ]
191
191
  }),
192
- /* @__PURE__ */ J("div", {
192
+ /* @__PURE__ */ K("div", {
193
193
  className: "resource-live-controls",
194
194
  "aria-busy": y != null,
195
- children: [n.live == null ? /* @__PURE__ */ q("span", {
195
+ children: [n.live == null ? /* @__PURE__ */ G("span", {
196
196
  className: "resource-status",
197
197
  title: m("resource.publishFirst"),
198
198
  children: "—"
199
- }) : /* @__PURE__ */ J(Ie, {
199
+ }) : /* @__PURE__ */ K(Re, {
200
200
  className: "resource-enable",
201
201
  title: m("resource.enabledHint"),
202
- children: [/* @__PURE__ */ q(Ge, {
202
+ children: [/* @__PURE__ */ G(tt, {
203
203
  "aria-label": m("resource.enableFlow", { name: n.name }),
204
204
  checked: n.live?.enabled ?? !1,
205
205
  disabled: n.status != "active" || n.live == null || t != null || y != null,
206
206
  onCheckedChange: (e) => void S(e),
207
207
  size: "sm"
208
- }), /* @__PURE__ */ q("span", { children: m(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
209
- }), /* @__PURE__ */ q(B, {
208
+ }), /* @__PURE__ */ G("span", { children: m(n.live?.enabled ? "resource.enabled" : "resource.disabled") })]
209
+ }), /* @__PURE__ */ G(L, {
210
210
  disabled: n.status != "active" || t != null || y != null || n.live != null && !x,
211
211
  onClick: () => void S("publish"),
212
212
  size: "sm",
@@ -214,55 +214,55 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
214
214
  children: m(y == "publish" ? "workspace.publishing" : n.live == null ? "resource.publish" : "resource.publishUpdate")
215
215
  })]
216
216
  }),
217
- n.status == "active" && /* @__PURE__ */ J(Ue, { children: [/* @__PURE__ */ q(He, {
217
+ n.status == "active" && /* @__PURE__ */ K($e, { children: [/* @__PURE__ */ G(Qe, {
218
218
  "aria-label": m("sidebar.flowActions", { name: n.name }),
219
219
  disabled: t != null || y != null,
220
- render: /* @__PURE__ */ q(B, {
220
+ render: /* @__PURE__ */ G(L, {
221
221
  className: "resource-row-more",
222
222
  ref: u,
223
223
  size: "icon-sm",
224
224
  variant: "ghost",
225
- children: /* @__PURE__ */ q(H, { name: "more" })
225
+ children: /* @__PURE__ */ G(B, { name: "more" })
226
226
  })
227
- }), /* @__PURE__ */ J(Ke, {
227
+ }), /* @__PURE__ */ K(nt, {
228
228
  align: "end",
229
229
  className: "min-w-36",
230
230
  container: c,
231
231
  finalFocus: h == "idle",
232
- children: [/* @__PURE__ */ q(We, {
232
+ children: [/* @__PURE__ */ G(et, {
233
233
  onClick: () => {
234
234
  v(n.name), g("rename");
235
235
  },
236
236
  children: m("common.rename")
237
- }), /* @__PURE__ */ q(We, {
237
+ }), /* @__PURE__ */ G(et, {
238
238
  onClick: () => g("delete"),
239
239
  variant: "destructive",
240
240
  children: m("common.delete")
241
241
  })]
242
242
  })] }),
243
- /* @__PURE__ */ q(et, {
243
+ /* @__PURE__ */ G(Je, {
244
244
  open: h == "rename",
245
245
  onOpenChange: (e) => {
246
246
  e || g("idle");
247
247
  },
248
- children: /* @__PURE__ */ q($e, {
248
+ children: /* @__PURE__ */ G(Ge, {
249
249
  container: c,
250
250
  initialFocus: d,
251
251
  finalFocus: u,
252
252
  closeLabel: m("common.cancel"),
253
- children: /* @__PURE__ */ J("form", {
253
+ children: /* @__PURE__ */ K("form", {
254
254
  className: "flex flex-col gap-4",
255
255
  onSubmit: (e) => void w(e),
256
256
  children: [
257
- /* @__PURE__ */ q(rt, { children: /* @__PURE__ */ q(Qe, { children: m("sidebar.renameFlow", { name: n.name }) }) }),
258
- /* @__PURE__ */ J(Re, {
257
+ /* @__PURE__ */ G(Ye, { children: /* @__PURE__ */ G(qe, { children: m("sidebar.renameFlow", { name: n.name }) }) }),
258
+ /* @__PURE__ */ K(Le, {
259
259
  "data-invalid": _.length > 0 && C != null,
260
260
  children: [
261
- /* @__PURE__ */ q(Ve, {
261
+ /* @__PURE__ */ G(Ue, {
262
262
  htmlFor: `rename-flow-${n.flowId}`,
263
263
  children: m("resource.flowName")
264
264
  }),
265
- /* @__PURE__ */ q(V, {
265
+ /* @__PURE__ */ G(R, {
266
266
  autoComplete: "off",
267
267
  "aria-invalid": _.length > 0 && C != null,
268
268
  "aria-describedby": _.length > 0 && C != null ? `rename-error-${n.flowId}` : void 0,
@@ -273,17 +273,17 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
273
273
  required: !0,
274
274
  value: _
275
275
  }),
276
- _.length > 0 && C != null && /* @__PURE__ */ q(Fe, {
276
+ _.length > 0 && C != null && /* @__PURE__ */ G(ze, {
277
277
  id: `rename-error-${n.flowId}`,
278
278
  children: m(`resource.nameIssue.${C}`, { max: 80 })
279
279
  })
280
280
  ]
281
281
  }),
282
- /* @__PURE__ */ J(tt, { children: [/* @__PURE__ */ q(nt, {
283
- render: /* @__PURE__ */ q(B, { variant: "outline" }),
282
+ /* @__PURE__ */ K(Xe, { children: [/* @__PURE__ */ G(Ze, {
283
+ render: /* @__PURE__ */ G(L, { variant: "outline" }),
284
284
  type: "button",
285
285
  children: m("common.cancel")
286
- }), /* @__PURE__ */ q(B, {
286
+ }), /* @__PURE__ */ G(L, {
287
287
  disabled: t != null || C != null,
288
288
  type: "submit",
289
289
  children: m("common.save")
@@ -292,23 +292,23 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
292
292
  })
293
293
  })
294
294
  }),
295
- /* @__PURE__ */ q(et, {
295
+ /* @__PURE__ */ G(Je, {
296
296
  open: h == "delete",
297
297
  onOpenChange: (e) => {
298
298
  e || g("idle");
299
299
  },
300
- children: /* @__PURE__ */ J($e, {
300
+ children: /* @__PURE__ */ K(Ge, {
301
301
  container: c,
302
302
  initialFocus: f,
303
303
  finalFocus: u,
304
304
  showCloseButton: !1,
305
- children: [/* @__PURE__ */ J(rt, { children: [/* @__PURE__ */ q(Qe, { children: m("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ q(Ze, { children: m("resource.deleteDescription") })] }), /* @__PURE__ */ J(tt, { children: [/* @__PURE__ */ q(nt, {
306
- render: /* @__PURE__ */ q(B, {
305
+ children: [/* @__PURE__ */ K(Ye, { children: [/* @__PURE__ */ G(qe, { children: m("sidebar.deleteFlowConfirm", { name: n.name }) }), /* @__PURE__ */ G(Ke, { children: m("resource.deleteDescription") })] }), /* @__PURE__ */ K(Xe, { children: [/* @__PURE__ */ G(Ze, {
306
+ render: /* @__PURE__ */ G(L, {
307
307
  ref: f,
308
308
  variant: "outline"
309
309
  }),
310
310
  children: m("common.cancel")
311
- }), /* @__PURE__ */ q(B, {
311
+ }), /* @__PURE__ */ G(L, {
312
312
  disabled: t != null,
313
313
  onClick: () => void T(),
314
314
  variant: "destructive",
@@ -319,185 +319,185 @@ function gt({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: s }) {
319
319
  ]
320
320
  });
321
321
  }
322
- function _t() {
323
- return /* @__PURE__ */ J("div", {
322
+ function yt() {
323
+ return /* @__PURE__ */ K("div", {
324
324
  "aria-hidden": "true",
325
325
  className: "resource-list-row resource-skeleton-row flow-columns",
326
326
  children: [
327
- /* @__PURE__ */ J("span", {
327
+ /* @__PURE__ */ K("span", {
328
328
  className: "resource-primary-cell",
329
- children: [/* @__PURE__ */ q(z, { className: "size-8 shrink-0" }), /* @__PURE__ */ J("span", {
329
+ children: [/* @__PURE__ */ G(N, { className: "size-8 shrink-0" }), /* @__PURE__ */ K("span", {
330
330
  className: "resource-skeleton-copy",
331
- children: [/* @__PURE__ */ q(z, { className: "h-3.5 w-36" }), /* @__PURE__ */ q(z, { className: "h-2.5 w-48 max-w-full" })]
331
+ children: [/* @__PURE__ */ G(N, { className: "h-3.5 w-36" }), /* @__PURE__ */ G(N, { className: "h-2.5 w-48 max-w-full" })]
332
332
  })]
333
333
  }),
334
- /* @__PURE__ */ q(z, { className: "h-3 w-28" }),
335
- /* @__PURE__ */ q(z, { className: "h-3 w-16" })
334
+ /* @__PURE__ */ G(N, { className: "h-3 w-28" }),
335
+ /* @__PURE__ */ G(N, { className: "h-3 w-16" })
336
336
  ]
337
337
  });
338
338
  }
339
- function vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: c, hostTitle: l, language: u, onCreateFlow: d, onHostAction: f, onLanguageChange: p, onSelectFlow: m, store: h }) {
340
- let g = r(), _ = a(h.workspace.$.busy), v = a(h.workspace.$.flowLoadFailed), y = a(h.workspace.$.flowLoadMoreFailed), b = a(h.workspace.$.flowLoading), x = a(h.workspace.$.flowLoadingMore), S = a(h.workspace.$.flowNextCursor), C = a(h.workspace.$.flowRefreshing), w = a(h.workspace.$.flows), T = a(h.workspace.$.flowTotal), [E, D] = K(!1), [O, ee] = K(""), [k, A] = K(""), j = O.trim().toLocaleLowerCase(), M = w.filter((e) => e.name.toLocaleLowerCase().includes(j));
341
- async function N(e) {
339
+ function bt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: s, hostTitle: c, language: l, onCreateFlow: u, onHostAction: d, onLanguageChange: f, onSelectFlow: p, store: m }) {
340
+ let h = r(), g = a(m.workspace.$.busy), _ = a(m.workspace.$.flowLoadFailed), v = a(m.workspace.$.flowLoadMoreFailed), y = a(m.workspace.$.flowLoading), b = a(m.workspace.$.flowLoadingMore), x = a(m.workspace.$.flowNextCursor), S = a(m.workspace.$.flowRefreshing), C = a(m.workspace.$.flows), w = a(m.workspace.$.flowTotal), [T, E] = W(!1), [D, ee] = W(""), [O, k] = W(""), A = D.trim().toLocaleLowerCase(), j = C.filter((e) => e.name.toLocaleLowerCase().includes(A));
341
+ async function ne(e) {
342
342
  e.preventDefault();
343
- let t = k.trim();
344
- U(t) != null || !await d(t) || (D(!1), A(""));
343
+ let t = O.trim();
344
+ z(t) != null || !await u(t) || (E(!1), k(""));
345
345
  }
346
- return /* @__PURE__ */ q("main", {
346
+ return /* @__PURE__ */ G("main", {
347
347
  className: "resource-browser",
348
- children: /* @__PURE__ */ J("div", {
349
- className: Ne("resource-page", e != "default" && "resource-page-full"),
348
+ children: /* @__PURE__ */ K("div", {
349
+ className: Ie("resource-page", e != "default" && "resource-page-full"),
350
350
  children: [
351
- /* @__PURE__ */ q("h1", {
351
+ /* @__PURE__ */ G("h1", {
352
352
  className: "sr-only",
353
- children: g("resource.flows")
353
+ children: h("resource.flows")
354
354
  }),
355
- /* @__PURE__ */ J("section", {
355
+ /* @__PURE__ */ K("section", {
356
356
  "aria-labelledby": "flow-list-title",
357
357
  className: "resource-list-section",
358
358
  children: [
359
- /* @__PURE__ */ J("div", {
359
+ /* @__PURE__ */ K("div", {
360
360
  className: "resource-list-title",
361
- children: [/* @__PURE__ */ J("div", {
361
+ children: [/* @__PURE__ */ K("div", {
362
362
  className: "resource-list-heading",
363
- children: [/* @__PURE__ */ q("h2", {
363
+ children: [/* @__PURE__ */ G("h2", {
364
364
  id: "flow-list-title",
365
- children: g("resource.allFlows")
366
- }), !b && /* @__PURE__ */ q("span", { children: g("resource.flowCount", { count: T ?? w.length }) })]
367
- }), /* @__PURE__ */ J("div", {
365
+ children: h("resource.allFlows")
366
+ }), !y && /* @__PURE__ */ G("span", { children: h("resource.flowCount", { count: w ?? C.length }) })]
367
+ }), /* @__PURE__ */ K("div", {
368
368
  className: "resource-list-actions",
369
369
  children: [
370
- /* @__PURE__ */ q(ht, {
371
- language: u,
372
- onLanguageChange: p
370
+ /* @__PURE__ */ G(_t, {
371
+ language: l,
372
+ onLanguageChange: f
373
373
  }),
374
- /* @__PURE__ */ J(he, {
374
+ /* @__PURE__ */ K(we, {
375
375
  className: "w-full sm:w-56",
376
- children: [/* @__PURE__ */ q(xe, { children: /* @__PURE__ */ q(H, {
376
+ children: [/* @__PURE__ */ G(pe, { children: /* @__PURE__ */ G(B, {
377
377
  name: "search",
378
378
  size: 17
379
- }) }), /* @__PURE__ */ q(de, {
379
+ }) }), /* @__PURE__ */ G(te, {
380
380
  autoComplete: "off",
381
- "aria-label": g("resource.searchFlows"),
381
+ "aria-label": h("resource.searchFlows"),
382
382
  name: "flow-search",
383
383
  onChange: (e) => ee(e.target.value),
384
- placeholder: g("resource.searchFlows"),
385
- value: O
384
+ placeholder: h("resource.searchFlows"),
385
+ value: D
386
386
  })]
387
387
  }),
388
- /* @__PURE__ */ q(B, {
389
- "aria-label": g("common.refresh"),
390
- disabled: b || C || _ != null,
391
- onClick: () => void h.workspace.reloadFlows(),
388
+ /* @__PURE__ */ G(L, {
389
+ "aria-label": h("common.refresh"),
390
+ disabled: y || S || g != null,
391
+ onClick: () => void m.workspace.reloadFlows(),
392
392
  size: "icon",
393
- title: g("common.refresh"),
393
+ title: h("common.refresh"),
394
394
  variant: "outline",
395
- children: /* @__PURE__ */ q(H, {
396
- className: C ? "animate-spin" : void 0,
395
+ children: /* @__PURE__ */ G(B, {
396
+ className: S ? "animate-spin" : void 0,
397
397
  name: "refresh"
398
398
  })
399
399
  }),
400
- /* @__PURE__ */ J(B, {
400
+ /* @__PURE__ */ K(L, {
401
401
  className: "resource-page-primary-action",
402
- disabled: _ != null,
403
- onClick: () => D(!0),
404
- children: [/* @__PURE__ */ q(H, {
402
+ disabled: g != null,
403
+ onClick: () => E(!0),
404
+ children: [/* @__PURE__ */ G(B, {
405
405
  "data-icon": "inline-start",
406
406
  name: "plus"
407
- }), g("resource.newFlow")]
407
+ }), h("resource.newFlow")]
408
408
  }),
409
- c != null && l != null && f != null && /* @__PURE__ */ q(s, {
410
- action: c,
411
- onAction: f,
412
- title: l
409
+ s != null && c != null && d != null && /* @__PURE__ */ G(se, {
410
+ action: s,
411
+ onAction: d,
412
+ title: c
413
413
  })
414
414
  ]
415
415
  })]
416
416
  }),
417
- /* @__PURE__ */ J("div", {
417
+ /* @__PURE__ */ K("div", {
418
418
  "aria-hidden": "true",
419
419
  className: "resource-list-columns flow-columns",
420
420
  children: [
421
- /* @__PURE__ */ q("span", { children: g("resource.name") }),
422
- /* @__PURE__ */ q("span", { children: g("resource.updated") }),
423
- /* @__PURE__ */ q("span", { children: g("resource.publication") }),
424
- /* @__PURE__ */ q("span", { children: g("resource.enabledColumn") })
421
+ /* @__PURE__ */ G("span", { children: h("resource.name") }),
422
+ /* @__PURE__ */ G("span", { children: h("resource.updated") }),
423
+ /* @__PURE__ */ G("span", { children: h("resource.publication") }),
424
+ /* @__PURE__ */ G("span", { children: h("resource.enabledColumn") })
425
425
  ]
426
426
  }),
427
- /* @__PURE__ */ q("div", {
427
+ /* @__PURE__ */ G("div", {
428
428
  className: "resource-list",
429
- children: b ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ q(_t, {}, t)) : v ? /* @__PURE__ */ J(te, {
429
+ children: y ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ G(yt, {}, t)) : _ ? /* @__PURE__ */ K(xe, {
430
430
  className: "min-h-64",
431
431
  role: "alert",
432
- children: [/* @__PURE__ */ J(ne, { children: [
433
- /* @__PURE__ */ q(pe, {
432
+ children: [/* @__PURE__ */ K(_e, { children: [
433
+ /* @__PURE__ */ G(Ae, {
434
434
  variant: "icon",
435
- children: /* @__PURE__ */ q(H, {
435
+ children: /* @__PURE__ */ G(B, {
436
436
  name: "alert",
437
437
  size: 20
438
438
  })
439
439
  }),
440
- /* @__PURE__ */ q(Ee, { children: g("resource.flowsLoadFailed") }),
441
- /* @__PURE__ */ q(Ce, { children: g("resource.flowsLoadFailedDescription") })
442
- ] }), /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ q(B, {
443
- onClick: () => void h.retryFlows(),
440
+ /* @__PURE__ */ G(oe, { children: h("resource.flowsLoadFailed") }),
441
+ /* @__PURE__ */ G(ie, { children: h("resource.flowsLoadFailedDescription") })
442
+ ] }), /* @__PURE__ */ G(Ee, { children: /* @__PURE__ */ G(L, {
443
+ onClick: () => void m.retryFlows(),
444
444
  variant: "outline",
445
- children: g("empty.retry")
445
+ children: h("empty.retry")
446
446
  }) })]
447
- }) : M.length == 0 ? /* @__PURE__ */ J(te, {
447
+ }) : j.length == 0 ? /* @__PURE__ */ K(xe, {
448
448
  className: "min-h-64",
449
- children: [/* @__PURE__ */ J(ne, { children: [
450
- /* @__PURE__ */ q(pe, {
449
+ children: [/* @__PURE__ */ K(_e, { children: [
450
+ /* @__PURE__ */ G(Ae, {
451
451
  variant: "icon",
452
- children: /* @__PURE__ */ q(H, {
452
+ children: /* @__PURE__ */ G(B, {
453
453
  name: "flow",
454
454
  size: 20
455
455
  })
456
456
  }),
457
- /* @__PURE__ */ q(Ee, { children: g(j.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
458
- /* @__PURE__ */ q(Ce, { children: g(j.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
459
- ] }), j.length == 0 && /* @__PURE__ */ q(_e, { children: /* @__PURE__ */ J(B, {
460
- onClick: () => D(!0),
457
+ /* @__PURE__ */ G(oe, { children: h(A.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
458
+ /* @__PURE__ */ G(ie, { children: h(A.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
459
+ ] }), A.length == 0 && /* @__PURE__ */ G(Ee, { children: /* @__PURE__ */ K(L, {
460
+ onClick: () => E(!0),
461
461
  variant: "outline",
462
- children: [/* @__PURE__ */ q(H, {
462
+ children: [/* @__PURE__ */ G(B, {
463
463
  "data-icon": "inline-start",
464
464
  name: "plus"
465
- }), g("resource.newFlow")]
465
+ }), h("resource.newFlow")]
466
466
  }) })]
467
- }) : M.map((e) => /* @__PURE__ */ q(gt, {
467
+ }) : j.map((e) => /* @__PURE__ */ G(vt, {
468
468
  badge: i?.[e.flowId],
469
- busy: _,
469
+ busy: g,
470
470
  flow: e,
471
471
  href: o(e),
472
- onSelect: m,
473
- store: h
472
+ onSelect: p,
473
+ store: m
474
474
  }, e.flowId))
475
475
  }),
476
- S != null && /* @__PURE__ */ q("div", {
476
+ x != null && /* @__PURE__ */ G("div", {
477
477
  className: "resource-list-footer",
478
- children: /* @__PURE__ */ q(B, {
479
- disabled: x || C,
480
- onClick: () => void h.workspace.loadMoreFlows(),
478
+ children: /* @__PURE__ */ G(L, {
479
+ disabled: b || S,
480
+ onClick: () => void m.workspace.loadMoreFlows(),
481
481
  variant: "outline",
482
- children: g(x ? "resource.loadingMore" : y ? "resource.retryLoadMore" : "resource.loadMore")
482
+ children: h(b ? "resource.loadingMore" : v ? "resource.retryLoadMore" : "resource.loadMore")
483
483
  })
484
484
  })
485
485
  ]
486
486
  }),
487
- E && /* @__PURE__ */ q(at, {
487
+ T && /* @__PURE__ */ G(st, {
488
488
  fallback: null,
489
- children: /* @__PURE__ */ q(pt, {
489
+ children: /* @__PURE__ */ G(ht, {
490
490
  disabled: t,
491
491
  field: n,
492
492
  id: "flow-name",
493
- issue: U(k),
494
- label: g("resource.flowName"),
495
- name: k,
496
- onNameChange: A,
497
- onOpenChange: D,
498
- onSubmit: (e) => void N(e),
499
- pending: _ == "flow",
500
- title: g("resource.newFlow")
493
+ issue: z(O),
494
+ label: h("resource.flowName"),
495
+ name: O,
496
+ onNameChange: k,
497
+ onOpenChange: E,
498
+ onSubmit: (e) => void ne(e),
499
+ pending: g == "flow",
500
+ title: h("resource.newFlow")
501
501
  })
502
502
  })
503
503
  ]
@@ -506,7 +506,7 @@ function vt({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
506
506
  }
507
507
  //#endregion
508
508
  //#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
509
- var yt = (e) => crypto.getRandomValues(new Uint8Array(e)), bt = (e, t, n) => {
509
+ var xt = (e) => crypto.getRandomValues(new Uint8Array(e)), St = (e, t, n) => {
510
510
  let r = 256 - 256 % e.length;
511
511
  if (r === 256) {
512
512
  let r = e.length - 1;
@@ -528,29 +528,29 @@ var yt = (e) => crypto.getRandomValues(new Uint8Array(e)), bt = (e, t, n) => {
528
528
  for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
529
529
  }
530
530
  };
531
- }, xt = (e, t = 21) => bt(e, t | 0, yt);
531
+ }, Ct = (e, t = 21) => St(e, t | 0, xt);
532
532
  //#endregion
533
533
  //#region src/flow/common/edgeChanges.ts
534
- function St(e, t, n) {
535
- return wt(e, t)?.edges.some((e) => Me(e, n)) ? [] : [{
534
+ function wt(e, t, n) {
535
+ return Et(e, t)?.edges.some((e) => Fe(e, n)) ? [] : [{
536
536
  edge: n,
537
537
  kind: "graph.edge.connect",
538
538
  target: t
539
539
  }];
540
540
  }
541
- function Ct(e, t, n) {
542
- return wt(e, t)?.edges.some((e) => Me(e, n)) ? [{
541
+ function Tt(e, t, n) {
542
+ return Et(e, t)?.edges.some((e) => Fe(e, n)) ? [{
543
543
  edge: n,
544
544
  kind: "graph.edge.disconnect",
545
545
  target: t
546
546
  }] : [];
547
547
  }
548
- function wt(e, t) {
548
+ function Et(e, t) {
549
549
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
550
550
  }
551
551
  //#endregion
552
552
  //#region src/flow/common/moduleChanges.ts
553
- async function Tt(e) {
553
+ async function Dt(e) {
554
554
  try {
555
555
  let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
556
556
  errorRecovery: !0,
@@ -566,7 +566,7 @@ async function Tt(e) {
566
566
  return [];
567
567
  }
568
568
  }
569
- function Et(e, t, n, r, i) {
569
+ function Ot(e, t, n, r, i) {
570
570
  return [{
571
571
  beforeImports: n,
572
572
  beforeSource: t,
@@ -576,7 +576,7 @@ function Et(e, t, n, r, i) {
576
576
  source: r
577
577
  }];
578
578
  }
579
- var Dt = xt("23456789abcdefghjkmnpqrstuvwxyz", 10), X = {
579
+ var kt = Ct("23456789abcdefghjkmnpqrstuvwxyz", 10), J = {
580
580
  activities: [],
581
581
  activitiesLoadFailed: !1,
582
582
  activitiesLoading: !1,
@@ -591,25 +591,25 @@ var Dt = xt("23456789abcdefghjkmnpqrstuvwxyz", 10), X = {
591
591
  publications: [],
592
592
  publishing: !1,
593
593
  refreshing: !1
594
- }, Ot = 20, kt = 50, At = 750;
595
- function Z(e, t) {
594
+ }, At = 20, jt = 50, Mt = 750;
595
+ function Y(e, t) {
596
596
  return e?.flowId == t.flowId;
597
597
  }
598
- var jt = class {
598
+ var Nt = class {
599
599
  #e;
600
600
  #t;
601
601
  #n;
602
- #r = new m();
603
- #i = new m();
602
+ #r = new w();
603
+ #i = new w();
604
604
  #a;
605
- #o = new m();
606
- #s = new m();
605
+ #o = new w();
606
+ #s = new w();
607
607
  #c;
608
- #l = t(X);
608
+ #l = t(J);
609
609
  #u;
610
610
  #d;
611
611
  #f;
612
- constructor(t, n, r, i, a = F, o = P()) {
612
+ constructor(t, n, r, i, a = A, o = P()) {
613
613
  this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
614
614
  activities: e(this.#l, (e) => e.activities),
615
615
  activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
@@ -638,29 +638,29 @@ var jt = class {
638
638
  };
639
639
  }
640
640
  dispose() {
641
- this.#r.invalidate(), this.#i.invalidate(), this.#v(), this.#o.invalidate(), this.#s.invalidate();
641
+ this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate();
642
642
  for (let e of Object.values(this.$)) e.dispose();
643
643
  this.#l.dispose();
644
644
  }
645
645
  reset() {
646
- this.#r.invalidate(), this.#i.invalidate(), this.#v(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(X);
646
+ this.#r.invalidate(), this.#i.invalidate(), this.#y(), this.#o.invalidate(), this.#s.invalidate(), this.#f = void 0, this.#l.set(J);
647
647
  }
648
648
  async load(e) {
649
- let t = { flowId: e }, n = this.#l.value, r = n.loaded && Z(n.target, t), i = this.#r.begin();
650
- Z(n.target, t) || (this.#i.invalidate(), this.#v(), this.#f = void 0), r ? this.#x({
649
+ let t = { flowId: e }, n = this.#l.value, r = n.loaded && Y(n.target, t), i = this.#r.begin();
650
+ Y(n.target, t) || (this.#i.invalidate(), this.#y(), this.#f = void 0), r ? this.#S({
651
651
  loadFailed: !1,
652
652
  loadingMore: !1,
653
653
  loadMoreFailed: !1,
654
654
  refreshing: !0
655
655
  }) : (this.#c(void 0), this.#l.set({
656
- ...X,
656
+ ...J,
657
657
  loading: !0,
658
658
  target: t
659
659
  }));
660
660
  try {
661
661
  let e = r ? n.operation : await this.#g(t), [a, o, s] = await this.#h(t);
662
662
  if (!i()) return;
663
- if (this.#u.updateLive(a), this.#x({
663
+ if (this.#u.updateLive(a), this.#S({
664
664
  bindings: s,
665
665
  live: a,
666
666
  loaded: !0,
@@ -679,29 +679,29 @@ var jt = class {
679
679
  }
680
680
  } catch (e) {
681
681
  if (!i()) return;
682
- this.#x({
682
+ this.#S({
683
683
  loadFailed: !r,
684
684
  loading: !1,
685
685
  refreshing: !1
686
- }), this.#c(E(e, this.#n.t));
686
+ }), this.#c(p(e, this.#n.t));
687
687
  }
688
688
  }
689
689
  async loadMore() {
690
690
  let { loadingMore: e, nextCursor: t, target: n } = this.#l.value;
691
691
  if (e || t == null || n == null) return;
692
692
  let r = this.#r.capture();
693
- this.#x({
693
+ this.#S({
694
694
  loadMoreFailed: !1,
695
695
  loadingMore: !0
696
696
  });
697
697
  try {
698
698
  let e = await this.#e.listPublications(n.flowId, {
699
699
  cursor: t,
700
- limit: kt
700
+ limit: jt
701
701
  });
702
702
  if (!r()) return;
703
703
  let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
704
- this.#x({
704
+ this.#S({
705
705
  loadingMore: !1,
706
706
  loadMoreFailed: !1,
707
707
  nextCursor: e.nextCursor,
@@ -709,10 +709,10 @@ var jt = class {
709
709
  });
710
710
  } catch (e) {
711
711
  if (!r()) return;
712
- this.#x({
712
+ this.#S({
713
713
  loadMoreFailed: !0,
714
714
  loadingMore: !1
715
- }), this.#c(E(e, this.#n.t));
715
+ }), this.#c(p(e, this.#n.t));
716
716
  }
717
717
  }
718
718
  async publish() {
@@ -729,19 +729,19 @@ var jt = class {
729
729
  key: this.#t(),
730
730
  signature: a
731
731
  };
732
- this.#v();
732
+ this.#y();
733
733
  let s = this.#i.begin();
734
- this.#f = o, this.#c(void 0), this.#b(r, { publishing: !0 });
734
+ this.#f = o, this.#c(void 0), this.#x(r, { publishing: !0 });
735
735
  try {
736
736
  let e = await this.#e.publishFlow(t.flowId, n.revisionId, i, { idempotencyKey: o.key });
737
- return s() ? (this.#a.setItem(this.#y(r.flowId), e.operationId), this.#x({
737
+ return s() ? (this.#a.setItem(this.#b(r.flowId), e.operationId), this.#S({
738
738
  operation: e,
739
739
  publishing: e.status == "pending"
740
740
  }), await this.#_(r, e, s, t.name)) : !1;
741
741
  } catch (e) {
742
- return s() ? (e instanceof L && e.code == "live.conflict" && await this.#m(r), this.#c(E(e, this.#n.t)), !1) : !1;
742
+ return s() ? (e instanceof M && e.code == "live.conflict" && await this.#m(r), this.#c(p(e, this.#n.t)), !1) : !1;
743
743
  } finally {
744
- s() && this.#x({ publishing: !1 });
744
+ s() && this.#S({ publishing: !1 });
745
745
  }
746
746
  }
747
747
  async rollback(e) {
@@ -756,22 +756,22 @@ var jt = class {
756
756
  key: this.#t(),
757
757
  signature: a
758
758
  };
759
- this.#v();
759
+ this.#y();
760
760
  let s = this.#i.begin();
761
- this.#f = o, this.#c(void 0), this.#x({ rollingBackPublicationId: e.publicationId });
761
+ this.#f = o, this.#c(void 0), this.#S({ rollingBackPublicationId: e.publicationId });
762
762
  try {
763
763
  return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !s() || (await this.#p(r), !s()) ? !1 : (this.#f = void 0, this.#c({
764
764
  kind: "success",
765
765
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
766
766
  }), !0);
767
767
  } catch (e) {
768
- return s() ? (e instanceof L && e.code == "live.conflict" && await this.#m(r), this.#c(E(e, this.#n.t)), !1) : !1;
768
+ return s() ? (e instanceof M && e.code == "live.conflict" && await this.#m(r), this.#c(p(e, this.#n.t)), !1) : !1;
769
769
  } finally {
770
- s() && this.#x({ rollingBackPublicationId: void 0 });
770
+ s() && this.#S({ rollingBackPublicationId: void 0 });
771
771
  }
772
772
  }
773
773
  closeTrigger() {
774
- this.#o.invalidate(), this.#s.invalidate(), this.#x({
774
+ this.#o.invalidate(), this.#s.invalidate(), this.#S({
775
775
  activities: [],
776
776
  activitiesLoadFailed: !1,
777
777
  activitiesLoading: !1,
@@ -788,7 +788,7 @@ var jt = class {
788
788
  let t = this.#l.value.target;
789
789
  if (t == null) return;
790
790
  let n = this.#o.begin();
791
- this.#s.invalidate(), this.#x({
791
+ this.#s.invalidate(), this.#S({
792
792
  activities: [],
793
793
  activitiesLoadFailed: !1,
794
794
  activitiesLoading: !0,
@@ -800,45 +800,45 @@ var jt = class {
800
800
  testingTriggerId: void 0,
801
801
  testResult: void 0
802
802
  });
803
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: Ot })]);
803
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: At })]);
804
804
  if (n()) {
805
805
  if (r.status == "rejected") {
806
- this.#x({
806
+ this.#S({
807
807
  activitiesLoading: !1,
808
808
  detailLoading: !1
809
- }), this.#c(E(r.reason, this.#n.t));
809
+ }), this.#c(p(r.reason, this.#n.t));
810
810
  return;
811
811
  }
812
- this.#x({
812
+ this.#S({
813
813
  detail: r.value,
814
814
  detailLoading: !1
815
- }), i.status == "fulfilled" ? this.#x({
815
+ }), i.status == "fulfilled" ? this.#S({
816
816
  activities: i.value.activities,
817
817
  activitiesLoadFailed: !1,
818
818
  activitiesLoading: !1,
819
819
  activitiesNextCursor: i.value.nextCursor
820
- }) : (this.#x({
820
+ }) : (this.#S({
821
821
  activitiesLoadFailed: !0,
822
822
  activitiesLoading: !1
823
- }), this.#c(E(i.reason, this.#n.t)));
823
+ }), this.#c(p(i.reason, this.#n.t)));
824
824
  }
825
825
  }
826
826
  async loadMoreTriggerActivities() {
827
827
  let { activitiesLoadingMore: e, activitiesNextCursor: t, selectedTriggerId: n, target: r } = this.#l.value;
828
828
  if (e || t == null || n == null || r == null) return;
829
829
  let i = this.#o.capture();
830
- this.#x({
830
+ this.#S({
831
831
  activitiesLoadFailed: !1,
832
832
  activitiesLoadingMore: !0
833
833
  });
834
834
  try {
835
835
  let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
836
836
  cursor: t,
837
- limit: Ot
837
+ limit: At
838
838
  });
839
839
  if (!i() || this.#l.value.selectedTriggerId != n) return;
840
840
  let a = new Set(this.#l.value.activities.map((e) => e.activityId));
841
- this.#x({
841
+ this.#S({
842
842
  activities: [...this.#l.value.activities, ...e.activities.filter((e) => !a.has(e.activityId))],
843
843
  activitiesLoadFailed: !1,
844
844
  activitiesLoadingMore: !1,
@@ -846,53 +846,53 @@ var jt = class {
846
846
  });
847
847
  } catch (e) {
848
848
  if (!i() || this.#l.value.selectedTriggerId != n) return;
849
- this.#x({
849
+ this.#S({
850
850
  activitiesLoadFailed: !0,
851
851
  activitiesLoadingMore: !1
852
- }), this.#c(E(e, this.#n.t));
852
+ }), this.#c(p(e, this.#n.t));
853
853
  }
854
854
  }
855
855
  async testTrigger() {
856
856
  let { detail: e, selectedTriggerId: t, target: n, testingTriggerId: r } = this.#l.value;
857
857
  if (e?.binding.kind != "poll" || e.binding.currentPublicationId == null || t == null || n == null || r != null) return !1;
858
858
  let i = this.#s.begin();
859
- this.#x({
859
+ this.#S({
860
860
  testingTriggerId: t,
861
861
  testResult: void 0
862
862
  });
863
863
  try {
864
864
  let e = await this.#e.testFlowPollTrigger(n.flowId, t);
865
- return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#x({ testResult: e }), !0);
865
+ return !i() || this.#l.value.selectedTriggerId != t ? !1 : (this.#S({ testResult: e }), !0);
866
866
  } catch (e) {
867
- return i() && this.#l.value.selectedTriggerId == t && this.#c(E(e, this.#n.t)), !1;
867
+ return i() && this.#l.value.selectedTriggerId == t && this.#c(p(e, this.#n.t)), !1;
868
868
  } finally {
869
- i() && this.#l.value.selectedTriggerId == t && this.#x({ testingTriggerId: void 0 });
869
+ i() && this.#l.value.selectedTriggerId == t && this.#S({ testingTriggerId: void 0 });
870
870
  }
871
871
  }
872
872
  async toggleTrigger(e) {
873
873
  let t = this.#l.value.target;
874
874
  if (t == null || this.#l.value.changingTriggerId != null || this.#l.value.publishing || this.#l.value.rollingBackPublicationId != null) return !1;
875
- this.#v();
875
+ this.#y();
876
876
  let n = this.#i.begin();
877
- this.#x({ changingTriggerId: e.triggerNodeId });
877
+ this.#S({ changingTriggerId: e.triggerNodeId });
878
878
  try {
879
879
  if (e.operatorState == "active" ? await this.#e.pauseFlowTrigger(t.flowId, e.triggerNodeId) : await this.#e.resumeFlowTrigger(t.flowId, e.triggerNodeId), !n()) return !1;
880
880
  let r = await this.#e.listFlowTriggerBindings(t.flowId);
881
- return n() ? (this.#x({ bindings: r }), this.#l.value.selectedTriggerId == e.triggerNodeId && this.openTrigger(e.triggerNodeId), this.#c({
881
+ return n() ? (this.#S({ bindings: r }), this.#l.value.selectedTriggerId == e.triggerNodeId && this.openTrigger(e.triggerNodeId), this.#c({
882
882
  kind: "success",
883
883
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
884
884
  }), !0) : !1;
885
885
  } catch (e) {
886
- return n() && this.#c(E(e, this.#n.t)), !1;
886
+ return n() && this.#c(p(e, this.#n.t)), !1;
887
887
  } finally {
888
- n() && this.#x({ changingTriggerId: void 0 });
888
+ n() && this.#S({ changingTriggerId: void 0 });
889
889
  }
890
890
  }
891
891
  async #p(e, t) {
892
892
  let n = this.#r.begin(), [r, i, a] = await this.#h(e, t).catch((t) => {
893
- throw n() && Z(this.#l.value.target, e) && this.#x({ refreshing: !1 }), t;
893
+ throw n() && Y(this.#l.value.target, e) && this.#S({ refreshing: !1 }), t;
894
894
  });
895
- t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Z(this.#l.value.target, e) && this.#x({
895
+ t?.throwIfAborted(), n() && this.#u.updateLive(r), n() && Y(this.#l.value.target, e) && this.#S({
896
896
  bindings: a,
897
897
  live: r,
898
898
  loaded: !0,
@@ -916,61 +916,40 @@ var jt = class {
916
916
  this.#e.getLive(e.flowId, t),
917
917
  this.#e.listPublications(e.flowId, {
918
918
  includeTotal: !0,
919
- limit: kt
919
+ limit: jt
920
920
  }, t),
921
921
  this.#e.listFlowTriggerBindings(e.flowId, t)
922
922
  ]);
923
923
  }
924
924
  async #g(e) {
925
- let t = this.#a.getItem(this.#y(e.flowId));
925
+ let t = this.#a.getItem(this.#b(e.flowId));
926
926
  if (t != null && t != "") try {
927
927
  return await this.#e.getPublishOperation(e.flowId, t);
928
928
  } catch (t) {
929
- if (t instanceof L && t.code == "publication.operation-not-found") {
930
- this.#a.setItem(this.#y(e.flowId), "");
929
+ if (t instanceof M && t.code == "publication.operation-not-found") {
930
+ this.#a.setItem(this.#b(e.flowId), "");
931
931
  return;
932
932
  }
933
933
  throw t;
934
934
  }
935
935
  }
936
936
  async #_(e, t, n, r) {
937
- this.#v();
938
- let i = Y.runFork(Y.gen({ self: this }, function* () {
939
- let i = t;
940
- for (; i.status == "pending";) {
941
- if (yield* Y.sleep(At), !n()) return !1;
942
- let t = yield* Y.tryPromise({
943
- try: (t) => this.#e.getPublishOperation(e.flowId, i.operationId, t),
944
- catch: (e) => e
945
- }).pipe(Y.match({
946
- onFailure: (e) => ({ error: e }),
947
- onSuccess: (e) => ({ value: e })
948
- }));
949
- if (!n()) return !1;
950
- if ("error" in t) {
951
- let n = t.error;
952
- if (n instanceof L && n.code == "publication.operation-not-found") return this.#a.setItem(this.#y(e.flowId), ""), this.#b(e, {
953
- operation: void 0,
954
- publishing: !1
955
- }), this.#c(E(n, this.#n.t)), !1;
956
- this.#c(E(n, this.#n.t));
957
- continue;
958
- }
959
- i = t.value, this.#b(e, { operation: i });
960
- }
961
- if (!n()) return !1;
962
- if (this.#f = void 0, this.#b(e, {
937
+ this.#y();
938
+ let i = q.runFork(q.gen({ self: this }, function* () {
939
+ let i = yield* this.#v(e, t, n);
940
+ if (i == null || !n()) return !1;
941
+ if (this.#f = void 0, this.#x(e, {
963
942
  operation: i,
964
943
  publishing: !1
965
944
  }), i.status == "failed") return this.#c({
966
945
  kind: "error",
967
946
  message: i.issue.message
968
947
  }), !1;
969
- let a = yield* Y.tryPromise({
948
+ let a = yield* q.tryPromise({
970
949
  try: (t) => this.#p(e, t),
971
950
  catch: (e) => e
972
- }).pipe(Y.match({
973
- onFailure: (e) => (n() && this.#c(E(e, this.#n.t)), !1),
951
+ }).pipe(q.match({
952
+ onFailure: (e) => (n() && this.#c(p(e, this.#n.t)), !1),
974
953
  onSuccess: () => !0
975
954
  }));
976
955
  return n() ? (a && this.#c({
@@ -979,223 +958,302 @@ var jt = class {
979
958
  }), !0) : !1;
980
959
  }));
981
960
  this.#d = i;
982
- let a = await Y.runPromiseExit(ut.join(i));
983
- if (lt.isSuccess(a)) return a.value;
984
- if (ct.hasInterruptsOnly(a.cause)) return !1;
985
- throw ct.squash(a.cause);
961
+ let a = await q.runPromiseExit(ft.join(i));
962
+ if (dt.isSuccess(a)) return a.value;
963
+ if (ut.hasInterruptsOnly(a.cause)) return !1;
964
+ throw ut.squash(a.cause);
965
+ }
966
+ #v(e, t, n) {
967
+ return q.gen({ self: this }, function* () {
968
+ let r = t;
969
+ for (; r.status == "pending";) {
970
+ if (yield* q.sleep(Mt), !n()) return;
971
+ let t = yield* q.tryPromise({
972
+ try: (t) => this.#e.getPublishOperation(e.flowId, r.operationId, t),
973
+ catch: (e) => e
974
+ }).pipe(q.match({
975
+ onFailure: (e) => ({ error: e }),
976
+ onSuccess: (e) => ({ value: e })
977
+ }));
978
+ if (!n()) return;
979
+ if ("error" in t) {
980
+ let n = t.error;
981
+ if (n instanceof M && n.code == "publication.operation-not-found") {
982
+ this.#a.setItem(this.#b(e.flowId), ""), this.#x(e, {
983
+ operation: void 0,
984
+ publishing: !1
985
+ }), this.#c(p(n, this.#n.t));
986
+ return;
987
+ }
988
+ this.#c(p(n, this.#n.t));
989
+ continue;
990
+ }
991
+ r = t.value, this.#x(e, { operation: r });
992
+ }
993
+ return r;
994
+ });
986
995
  }
987
- #v() {
996
+ #y() {
988
997
  this.#d?.interruptUnsafe(), this.#d = void 0;
989
998
  }
990
- #y(e) {
999
+ #b(e) {
991
1000
  return `publish-operation:${e}`;
992
1001
  }
993
- #b(e, t) {
994
- Z(this.#l.value.target, e) ? this.#x(t) : this.#l.set({
995
- ...X,
1002
+ #x(e, t) {
1003
+ Y(this.#l.value.target, e) ? this.#S(t) : this.#l.set({
1004
+ ...J,
996
1005
  ...t,
997
1006
  target: e
998
1007
  });
999
1008
  }
1000
- #x(e) {
1009
+ #S(e) {
1001
1010
  this.#l.set({
1002
1011
  ...this.#l.value,
1003
1012
  ...e
1004
1013
  });
1005
1014
  }
1006
- }, Mt = { starting: !1 };
1007
- function Nt(e) {
1015
+ }, Pt = { starting: !1 };
1016
+ function Ft(e) {
1008
1017
  switch (e.kind) {
1009
1018
  case "condition": return { [e.node.input.handle]: e.node.input };
1010
- case "subflow": return Be(e.definition?.inputs ?? []);
1011
- case "task": return Be(e.definition?.inputs ?? []);
1019
+ case "subflow": return Ve(e.definition?.inputs ?? []);
1020
+ case "task": return Ve(e.definition?.inputs ?? []);
1012
1021
  case "value": return {};
1013
1022
  case "wait": return { [e.node.input.handle]: e.node.input };
1014
1023
  }
1015
1024
  }
1016
- function Pt(e) {
1025
+ function It(e) {
1017
1026
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
1018
1027
  }
1019
- async function Ft(e, t, n) {
1020
- let { FlowRunInputEditorStore: r } = await import("./flowRunInputEditorStore-NPGePkvP.js").then((e) => e.r), i = C(e), a = i.graph({ kind: "flow" });
1021
- if (a == null) return [];
1022
- let o = /* @__PURE__ */ new Set([n]), s = [n];
1023
- for (; s.length > 0;) {
1024
- let e = s.pop();
1025
- for (let t of a.edges) t.source != e || o.has(t.target) || (o.add(t.target), s.push(t.target));
1026
- }
1027
- return Object.entries(a.nodes).filter(([e]) => o.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, n]) => {
1028
- let a = i.resolveNode(e, n);
1029
- if (a.kind == "trigger") {
1030
- if (a.trigger.kind == "manual" || a.trigger.kind == "cron") return [];
1031
- let n = new r([{
1028
+ function X(e, t) {
1029
+ let n = I(e), r = n.graph({ kind: "flow" });
1030
+ if (r == null) return [];
1031
+ let i = /* @__PURE__ */ new Set([t]), a = [t];
1032
+ for (; a.length > 0;) {
1033
+ let e = a.pop();
1034
+ for (let t of r.edges) t.source != e || i.has(t.target) || (i.add(t.target), a.push(t.target));
1035
+ }
1036
+ return Object.entries(r.nodes).filter(([e]) => i.has(e)).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, t]) => {
1037
+ let r = n.resolveNode(e, t);
1038
+ if (r.kind == "trigger") return r.trigger.kind == "manual" || r.trigger.kind == "cron" ? [] : [{
1039
+ definitions: [{
1032
1040
  handle: "payload",
1033
- jsonSchema: l(a.trigger),
1041
+ jsonSchema: T(r.trigger),
1034
1042
  nullable: !1
1035
- }], t);
1036
- return n.replaceValues({ payload: {} }), [{
1037
- editor: n,
1038
- nodeId: e,
1039
- title: a.trigger.name
1040
- }];
1041
- }
1042
- let o = Object.entries(Nt(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
1043
+ }],
1044
+ nodeId: e,
1045
+ title: r.trigger.name
1046
+ }];
1047
+ let i = Object.entries(Ft(r)).filter(([e, t]) => r.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
1043
1048
  handle: e,
1044
1049
  jsonSchema: t.jsonSchema,
1045
1050
  nullable: t.nullable
1046
1051
  }, t.description == null ? {} : { description: t.description }));
1047
- return o.length == 0 ? [] : [{
1048
- editor: new r(o, t),
1052
+ return i.length == 0 ? [] : [{
1053
+ definitions: i,
1049
1054
  nodeId: e,
1050
- title: Pt(a)
1055
+ title: It(r)
1051
1056
  }];
1052
1057
  });
1053
1058
  }
1054
- var It = class {
1059
+ function Z(e) {
1060
+ return JSON.stringify(e.map((e) => [e.nodeId, e.definitions.map((e) => [
1061
+ e.handle,
1062
+ e.jsonSchema,
1063
+ e.nullable
1064
+ ])]));
1065
+ }
1066
+ async function Lt(e, t, n, r) {
1067
+ let { FlowRunInputEditorStore: i } = await import("./flowRunInputEditorStore-NPGePkvP.js").then((e) => e.r);
1068
+ return e.map((e) => {
1069
+ let a = new i(e.definitions, t);
1070
+ return e.nodeId == n && a.replaceValues({ payload: {} }), r?.[e.nodeId] != null && a.replaceValues(r[e.nodeId]), {
1071
+ editor: a,
1072
+ nodeId: e.nodeId,
1073
+ title: e.title
1074
+ };
1075
+ });
1076
+ }
1077
+ function Rt(e) {
1078
+ return Object.fromEntries(e.map((e) => [e.nodeId, e.editor.values()]));
1079
+ }
1080
+ function zt(e, t) {
1081
+ return {
1082
+ inputs: Object.fromEntries(e.filter((e) => e.nodeId != t).map((e) => [e.nodeId, e.editor.values()])),
1083
+ payload: e.find((e) => e.nodeId == t)?.editor.values().payload ?? {}
1084
+ };
1085
+ }
1086
+ var Bt = class {
1055
1087
  #e;
1056
1088
  #t;
1057
1089
  #n;
1058
1090
  #r;
1059
- #i = new m();
1060
- #a = new m();
1091
+ #i = new w();
1092
+ #a = new w();
1061
1093
  #o;
1062
- #s;
1063
- #c = t(Mt);
1064
- #l;
1065
- constructor(t, n, r, i, a = P(), o = F) {
1066
- this.#e = i, this.#t = t, this.#o = n, this.#s = r, this.#r = a, this.#n = o, this.$ = {
1067
- inputRequest: e(this.#c, (e) => e.inputRequest),
1068
- starting: e(this.#c, (e) => e.starting),
1069
- submitting: e(this.#c, (e) => e.submitting)
1094
+ #s = /* @__PURE__ */ new Map();
1095
+ #c;
1096
+ #l = t(Pt);
1097
+ #u;
1098
+ constructor(t, n, r, i, a = P(), o = A) {
1099
+ this.#e = i, this.#t = t, this.#o = n, this.#c = r, this.#r = a, this.#n = o, this.$ = {
1100
+ inputRequest: e(this.#l, (e) => e.inputRequest),
1101
+ starting: e(this.#l, (e) => e.starting),
1102
+ submitting: e(this.#l, (e) => e.submitting)
1070
1103
  };
1071
1104
  }
1072
1105
  dispose() {
1073
- this.#i.invalidate(), this.#a.invalidate(), this.#f();
1106
+ this.#i.invalidate(), this.#a.invalidate(), this.#p();
1074
1107
  for (let e of Object.values(this.$)) e.dispose();
1075
- this.#c.dispose();
1108
+ this.#l.dispose();
1076
1109
  }
1077
1110
  reset() {
1078
- this.#i.invalidate(), this.#a.invalidate(), this.#l = void 0;
1079
- let e = this.#c.value.inputRequest;
1080
- this.#c.set(Mt), this.#f(e);
1111
+ this.#i.invalidate(), this.#a.invalidate(), this.#u = void 0;
1112
+ let e = this.#l.value.inputRequest;
1113
+ this.#h(e), this.#l.set(Pt), this.#p(e);
1081
1114
  }
1082
1115
  async requestDraft(e, t, n) {
1083
1116
  let r = this.#a.begin();
1084
1117
  try {
1085
- return await this.#u("draft", e, t, t.revisionId, r, void 0, n);
1118
+ return await this.#d("draft", e, t, t.revisionId, r, void 0, n);
1086
1119
  } catch (e) {
1087
- return r() && this.#s(E(e, this.#r.t)), "unavailable";
1120
+ return r() && this.#c(p(e, this.#r.t)), "unavailable";
1088
1121
  } finally {
1089
- r() && this.#p({ starting: !1 });
1122
+ r() && this.#g({ starting: !1 });
1090
1123
  }
1091
1124
  }
1125
+ async editDraft(e, t, n) {
1126
+ let r = this.#a.begin();
1127
+ try {
1128
+ return await this.#d("draft", e, t, t.revisionId, r, void 0, n, !0);
1129
+ } catch (e) {
1130
+ return r() && this.#c(p(e, this.#r.t)), "unavailable";
1131
+ } finally {
1132
+ r() && this.#g({ starting: !1 });
1133
+ }
1134
+ }
1135
+ inputStatus(e, t, n) {
1136
+ let r = X(t, n);
1137
+ if (r.length == 0) return "none";
1138
+ let i = this.#s.get(this.#m(e, n));
1139
+ return i?.valid == 1 && i.signature == Z(r) ? "ready" : "missing";
1140
+ }
1092
1141
  async requestLive(e) {
1093
1142
  let t = this.#a.begin();
1094
- this.#s(void 0), this.#p({ starting: !0 });
1143
+ this.#c(void 0), this.#g({ starting: !0 });
1095
1144
  try {
1096
1145
  let n = (await this.#t.getLive(e.flowId)).publication;
1097
1146
  if (n == null) return "unavailable";
1098
1147
  let r = await this.#t.getRevision(e.flowId, n.revisionId);
1099
- return t() ? await this.#u("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
1148
+ return t() ? await this.#d("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
1100
1149
  } catch (e) {
1101
- return t() && this.#s(E(e, this.#r.t)), "unavailable";
1150
+ return t() && this.#c(p(e, this.#r.t)), "unavailable";
1102
1151
  } finally {
1103
- t() && this.#p({ starting: !1 });
1152
+ t() && this.#g({ starting: !1 });
1104
1153
  }
1105
1154
  }
1106
1155
  dismissInputs() {
1107
- let e = this.#c.value.inputRequest;
1108
- this.#p({ inputRequest: void 0 }), this.#f(e);
1156
+ let e = this.#l.value.inputRequest;
1157
+ this.#h(e), this.#g({ inputRequest: void 0 }), this.#p(e);
1109
1158
  }
1110
1159
  async confirmInputs() {
1111
- let e = this.#c.value.inputRequest;
1160
+ let e = this.#l.value.inputRequest;
1112
1161
  if (e == null || e.triggerId == null) return !1;
1113
- if (!e.valid.value) return this.#p({ inputRequest: {
1162
+ if (!e.valid.value) return this.#g({ inputRequest: {
1114
1163
  ...e,
1115
1164
  attempted: !0
1116
1165
  } }), !1;
1117
- let t = Object.fromEntries(e.groups.filter((t) => t.nodeId != e.triggerId).map((e) => [e.nodeId, e.editor.values()])), n = e.groups.find((t) => t.nodeId == e.triggerId)?.editor.values().payload ?? {}, r = await this.#d(e.source, e.flow, e.revisionId, {
1166
+ this.#h(e);
1167
+ let { inputs: t, payload: n } = zt(e.groups, e.triggerId), r = await this.#f(e.source, e.flow, e.revisionId, {
1118
1168
  nodeId: e.triggerId,
1119
1169
  payload: n
1120
1170
  }, t, e.publicationId);
1121
- return r && this.#c.value.inputRequest === e && this.dismissInputs(), r;
1171
+ return r && this.#l.value.inputRequest === e && this.dismissInputs(), r;
1122
1172
  }
1123
1173
  async selectTrigger(e) {
1124
- let t = this.#c.value.inputRequest;
1174
+ let t = this.#l.value.inputRequest;
1125
1175
  if (t == null || !t.triggers.some((t) => t.nodeId == e)) return;
1126
1176
  let r = this.#a.begin();
1127
- this.#p({ starting: !0 });
1177
+ this.#h(t), this.#g({ starting: !0 });
1128
1178
  try {
1129
- let i = await Ft(t.revision, this.#r.lang$, e);
1130
- if (!r() || this.#c.value.inputRequest !== t) {
1131
- for (let e of i) e.editor.dispose();
1179
+ let i = X(t.revision, e), a = this.#s.get(this.#m(t.flow.flowId, e)), o = await Lt(i, this.#r.lang$, e, a?.values);
1180
+ if (!r() || this.#l.value.inputRequest !== t) {
1181
+ for (let e of o) e.editor.dispose();
1132
1182
  return;
1133
1183
  }
1134
- let a = n((e) => i.every((t) => e(t.editor.valid$)));
1135
- this.#p({ inputRequest: {
1184
+ let s = n((e) => o.every((t) => e(t.editor.valid$)));
1185
+ this.#g({ inputRequest: {
1136
1186
  ...t,
1137
1187
  attempted: !1,
1138
- groups: i,
1188
+ groups: o,
1139
1189
  triggerId: e,
1140
- valid: a
1141
- } }), this.#f(t);
1190
+ valid: s
1191
+ } }), this.#p(t);
1142
1192
  } catch (e) {
1143
- r() && this.#s(E(e, this.#r.t));
1193
+ r() && this.#c(p(e, this.#r.t));
1144
1194
  } finally {
1145
- r() && this.#p({ starting: !1 });
1195
+ r() && this.#g({ starting: !1 });
1146
1196
  }
1147
1197
  }
1148
- async #u(e, t, r, i, a, o, s) {
1149
- let c = this.#c.value.inputRequest;
1150
- this.#p({
1198
+ async #d(e, t, r, i, a, o, s, c = !1) {
1199
+ let l = this.#l.value.inputRequest;
1200
+ this.#h(l), this.#g({
1151
1201
  inputRequest: void 0,
1152
1202
  starting: !0,
1153
1203
  submitting: void 0
1154
- }), this.#f(c);
1155
- let l = C(r).graph({ kind: "flow" }), u = Object.entries(l?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1204
+ }), this.#p(l);
1205
+ let u = I(r).graph({ kind: "flow" }), d = Object.entries(u?.nodes ?? {}).flatMap(([e, t]) => "inputs" in t ? [] : [{
1156
1206
  nodeId: e,
1157
1207
  title: t.name
1158
1208
  }]);
1159
- if (u.length == 0) return this.#p({ starting: !1 }), this.#s({
1209
+ if (d.length == 0) return this.#g({ starting: !1 }), this.#c({
1160
1210
  kind: "error",
1161
1211
  message: this.#r.t("runInput.noTrigger")
1162
1212
  }), "unavailable";
1163
- let d = s == null ? u.length == 1 ? u[0] : void 0 : u.find((e) => e.nodeId == s);
1164
- if (s != null && d == null) return this.#p({ starting: !1 }), this.#s({
1213
+ let f = s == null ? d[0] : d.find((e) => e.nodeId == s);
1214
+ if (s != null && f == null) return this.#g({ starting: !1 }), this.#c({
1165
1215
  kind: "error",
1166
1216
  message: this.#r.t("runInput.selectTrigger")
1167
1217
  }), "unavailable";
1168
- let f = d == null ? [] : await Ft(r, this.#r.lang$, d.nodeId);
1218
+ let p = f == null ? [] : X(r, f.nodeId), m = Z(p), h = f == null ? void 0 : this.#s.get(this.#m(t.flowId, f.nodeId)), g = f == null ? [] : await Lt(p, this.#r.lang$, f.nodeId, h?.values);
1169
1219
  if (!a()) {
1170
- for (let e of f) e.editor.dispose();
1220
+ for (let e of g) e.editor.dispose();
1171
1221
  return "unavailable";
1172
1222
  }
1173
- if (d != null && f.length == 0) return await this.#d(e, t, i, {
1174
- nodeId: d.nodeId,
1223
+ if (!c && f != null && g.length == 0) return await this.#f(e, t, i, {
1224
+ nodeId: f.nodeId,
1175
1225
  payload: {}
1176
1226
  }, {}, o) ? "started" : "unavailable";
1177
- let p = n((e) => d != null && f.every((t) => e(t.editor.valid$)));
1178
- return this.#p({
1227
+ if (!c && f != null && h?.valid == 1 && h.signature == m && g.every((e) => e.editor.valid$.value)) {
1228
+ let n = zt(g, f.nodeId);
1229
+ for (let e of g) e.editor.dispose();
1230
+ return await this.#f(e, t, i, {
1231
+ nodeId: f.nodeId,
1232
+ payload: n.payload
1233
+ }, n.inputs, o) ? "started" : "unavailable";
1234
+ }
1235
+ let _ = n((e) => f != null && g.every((t) => e(t.editor.valid$)));
1236
+ return this.#g({
1179
1237
  inputRequest: {
1180
1238
  attempted: !1,
1181
1239
  flow: t,
1182
- groups: f,
1240
+ groups: g,
1183
1241
  revision: r,
1184
- triggers: u,
1185
- triggerId: d?.nodeId,
1242
+ triggers: d,
1243
+ triggerId: f?.nodeId,
1186
1244
  ...o == null ? {} : { publicationId: o },
1187
1245
  revisionId: i,
1188
1246
  source: e,
1189
- valid: p
1247
+ valid: _
1190
1248
  },
1191
1249
  starting: !1,
1192
1250
  submitting: void 0
1193
1251
  }), "input";
1194
1252
  }
1195
- async #d(e, t, n, r, i = {}, a) {
1253
+ async #f(e, t, n, r, i = {}, a) {
1196
1254
  if (e == "live" && a == null) return !1;
1197
1255
  let o = this.#i.capture(), s = this.#o.prepareStart();
1198
- this.#s(void 0), this.#p({
1256
+ this.#c(void 0), this.#g({
1199
1257
  starting: !0,
1200
1258
  submitting: e
1201
1259
  });
@@ -1213,11 +1271,11 @@ var It = class {
1213
1271
  trigger: r,
1214
1272
  source: e,
1215
1273
  ...c
1216
- }), u = this.#l?.signature == l ? this.#l : {
1274
+ }), u = this.#u?.signature == l ? this.#u : {
1217
1275
  key: this.#n(),
1218
1276
  signature: l
1219
1277
  };
1220
- this.#l = u;
1278
+ this.#u = u;
1221
1279
  let d = e == "draft" ? await this.#t.createDraftRun(t.flowId, n, {
1222
1280
  idempotencyKey: u.key,
1223
1281
  inputs: i,
@@ -1227,33 +1285,43 @@ var It = class {
1227
1285
  inputs: i,
1228
1286
  trigger: r
1229
1287
  });
1230
- return !o() || !s() ? !1 : (this.#l = void 0, this.#o.follow(d, s));
1288
+ return !o() || !s() ? !1 : (this.#u = void 0, this.#o.follow(d, s));
1231
1289
  } catch (e) {
1232
- return o() && s() && this.#s(E(e, this.#r.t)), !1;
1290
+ return o() && s() && this.#c(p(e, this.#r.t)), !1;
1233
1291
  } finally {
1234
- o() && this.#p({
1292
+ o() && this.#g({
1235
1293
  starting: !1,
1236
1294
  submitting: void 0
1237
1295
  });
1238
1296
  }
1239
1297
  }
1240
- #f(e = this.#c.value.inputRequest) {
1298
+ #p(e = this.#l.value.inputRequest) {
1241
1299
  if (e != null) {
1242
1300
  e.valid.dispose();
1243
1301
  for (let t of e.groups) t.editor.dispose();
1244
1302
  }
1245
1303
  }
1246
- #p(e) {
1247
- this.#c.set({
1248
- ...this.#c.value,
1304
+ #m(e, t) {
1305
+ return `${e}\u0000${t}`;
1306
+ }
1307
+ #h(e) {
1308
+ e?.triggerId != null && e.groups.length != 0 && this.#s.set(this.#m(e.flow.flowId, e.triggerId), {
1309
+ signature: Z(X(e.revision, e.triggerId)),
1310
+ valid: e.valid.value,
1311
+ values: Rt(e.groups)
1312
+ });
1313
+ }
1314
+ #g(e) {
1315
+ this.#l.set({
1316
+ ...this.#l.value,
1249
1317
  ...e
1250
1318
  });
1251
1319
  }
1252
- }, Lt = {
1320
+ }, Vt = {
1253
1321
  actions: {},
1254
1322
  catalogs: {}
1255
1323
  };
1256
- function Rt(e) {
1324
+ function Ht(e) {
1257
1325
  return Object.entries(e).map(([e, t]) => ({
1258
1326
  description: t.description,
1259
1327
  handle: e,
@@ -1268,15 +1336,15 @@ function Q(e, t) {
1268
1336
  service: e.serviceName
1269
1337
  }) : e.description,
1270
1338
  group: t("addNode.connectorActions"),
1271
- icon: p(e),
1339
+ icon: m(e),
1272
1340
  id: `connector:${e.actionId}`,
1273
- inputs: Rt(e.inputs),
1341
+ inputs: Ht(e.inputs),
1274
1342
  kind: "connector",
1275
1343
  label: e.name,
1276
- outputs: Rt(e.outputs)
1344
+ outputs: Ht(e.outputs)
1277
1345
  };
1278
1346
  }
1279
- function zt(e, t) {
1347
+ function Ut(e, t) {
1280
1348
  let n = /* @__PURE__ */ new Map();
1281
1349
  for (let t of e) {
1282
1350
  let e = n.get(t.serviceId) ?? [];
@@ -1295,7 +1363,7 @@ function zt(e, t) {
1295
1363
  choices: r,
1296
1364
  description: t(r.length == 1 ? "addNode.connectorActionCountOne" : "addNode.connectorActionCount", { count: r.length }),
1297
1365
  group: t("addNode.connectorActions"),
1298
- icon: p(n),
1366
+ icon: m(n),
1299
1367
  id: `connector-provider:${n.serviceId}`,
1300
1368
  inputs: [],
1301
1369
  kind: "connector-group",
@@ -1305,12 +1373,12 @@ function zt(e, t) {
1305
1373
  };
1306
1374
  });
1307
1375
  }
1308
- function Bt(e, t) {
1376
+ function Wt(e, t) {
1309
1377
  return {
1310
1378
  choices: [],
1311
1379
  description: t("addNode.connectorBrowseActions"),
1312
1380
  group: t("addNode.connectorActions"),
1313
- icon: p(e),
1381
+ icon: m(e),
1314
1382
  id: `connector-provider:${e.serviceId}`,
1315
1383
  inputs: [],
1316
1384
  kind: "connector-group",
@@ -1319,7 +1387,7 @@ function Bt(e, t) {
1319
1387
  serviceId: e.serviceId
1320
1388
  };
1321
1389
  }
1322
- function Vt(e, t) {
1390
+ function Gt(e, t) {
1323
1391
  if (e == null) return;
1324
1392
  let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
1325
1393
  if (n == null) return;
@@ -1331,10 +1399,10 @@ function Vt(e, t) {
1331
1399
  taskId: n
1332
1400
  };
1333
1401
  }
1334
- function Ht(e, t, n) {
1402
+ function Kt(e, t, n) {
1335
1403
  if (e == null) return [];
1336
1404
  let r = [];
1337
- for (let i of [...je(e.revision.content).tasks].toSorted()) {
1405
+ for (let i of [...c(e.revision.content).tasks].toSorted()) {
1338
1406
  let a = e.task(i);
1339
1407
  if (a?.executor.kind != "connector") continue;
1340
1408
  let o = t[a.executor.action];
@@ -1351,7 +1419,7 @@ function Ht(e, t, n) {
1351
1419
  }
1352
1420
  return r;
1353
1421
  }
1354
- var Ut = class {
1422
+ var qt = class {
1355
1423
  #e;
1356
1424
  #t;
1357
1425
  #n;
@@ -1369,12 +1437,12 @@ var Ut = class {
1369
1437
  #m;
1370
1438
  #h;
1371
1439
  constructor(r, i, a, o, s = P()) {
1372
- this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new m(), this.#o = new m(), this.#d = t(Lt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
1440
+ this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new w(), this.#o = new w(), this.#d = t(Vt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
1373
1441
  if (this.#h) return;
1374
1442
  let t = this.#f.$.flowId.value;
1375
1443
  if (t == null) return;
1376
1444
  let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
1377
- if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Bt(e, this.#t.t));
1445
+ if (!(e.aborted || this.#h || t != this.#f.$.flowId.value)) return this.#m = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => Wt(e, this.#t.t));
1378
1446
  }, this.provideAddNodeOptionChoices = async (e, t) => {
1379
1447
  if (this.#h) return;
1380
1448
  let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
@@ -1400,11 +1468,11 @@ var Ut = class {
1400
1468
  let t = a[e];
1401
1469
  t != null && o.set(e, t);
1402
1470
  }
1403
- return zt([...o.values()], this.#t.t);
1471
+ return Ut([...o.values()], this.#t.t);
1404
1472
  }, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = s;
1405
1473
  let c = e(this.#d, (e) => e.actions), l = e(this.#d, (e) => e.catalogs);
1406
1474
  this.#l = n((e) => {
1407
- let t = Vt(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1475
+ let t = Gt(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1408
1476
  if (t == null) return { authorizationPending: !1 };
1409
1477
  let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
1410
1478
  return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
@@ -1420,7 +1488,7 @@ var Ut = class {
1420
1488
  actions: c,
1421
1489
  catalogs: l,
1422
1490
  connectionLoading: e(this.#d, (e) => e.connectionLoading),
1423
- diagnostics: n((e) => Ht(e(i.$.revision), e(c), e(l))),
1491
+ diagnostics: n((e) => Kt(e(i.$.revision), e(c), e(l))),
1424
1492
  selectedAction: e(this.#l, (e) => e.action),
1425
1493
  selectedActionError: e(this.#l, (e) => e.actionError),
1426
1494
  selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
@@ -1435,11 +1503,11 @@ var Ut = class {
1435
1503
  this.#l.dispose(), this.#d.dispose();
1436
1504
  }
1437
1505
  reset() {
1438
- this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(Lt));
1506
+ this.#h || (this.#a.invalidate(), this.#o.invalidate(), this.#p = void 0, this.#r.clear(), this.#m = void 0, this.#i.clear(), this.#d.set(Vt));
1439
1507
  }
1440
1508
  async refresh(e = !1) {
1441
1509
  if (this.#h) return;
1442
- let t = this.#o.begin(), n = this.#f.$.flowId.value, r = Vt(this.#f.$.selection.value, this.#f.$.revision.value);
1510
+ let t = this.#o.begin(), n = this.#f.$.flowId.value, r = Gt(this.#f.$.selection.value, this.#f.$.revision.value);
1443
1511
  if (n == null || r == null) {
1444
1512
  (this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
1445
1513
  actionLoading: void 0,
@@ -1463,7 +1531,7 @@ var Ut = class {
1463
1531
  } catch (e) {
1464
1532
  this.#x(t, n) && this.#b({ actionError: {
1465
1533
  actionId: r.actionId,
1466
- message: E(e, this.#t.t).message
1534
+ message: p(e, this.#t.t).message
1467
1535
  } });
1468
1536
  } finally {
1469
1537
  this.#x(t, n) && this.#d.value.actionLoading == r.actionId && this.#b({ actionLoading: void 0 });
@@ -1475,7 +1543,7 @@ var Ut = class {
1475
1543
  let r = await this.#e.listConnectorConnections(e, t, n);
1476
1544
  t.aborted || this.#h || n != this.#f.$.flowId.value || this.#b({ catalogs: {
1477
1545
  ...this.#d.value.catalogs,
1478
- [e]: d(r)
1546
+ [e]: y(r)
1479
1547
  } });
1480
1548
  }
1481
1549
  async loadCodeAction(e, t) {
@@ -1506,7 +1574,7 @@ var Ut = class {
1506
1574
  serviceId: e
1507
1575
  }, this.#b({ authorizationServiceId: e });
1508
1576
  } catch (e) {
1509
- this.#h || this.#u(E(e, this.#t.t));
1577
+ this.#h || this.#u(p(e, this.#t.t));
1510
1578
  }
1511
1579
  }
1512
1580
  async setConnection(e, t) {
@@ -1539,13 +1607,13 @@ var Ut = class {
1539
1607
  a = await this.#e.listConnectorConnections(t, void 0, e);
1540
1608
  } catch (n) {
1541
1609
  this.#x(r, e) && this.#b({ connectionError: {
1542
- message: E(n, this.#t.t).message,
1610
+ message: p(n, this.#t.t).message,
1543
1611
  serviceId: t
1544
1612
  } });
1545
1613
  return;
1546
1614
  }
1547
1615
  if (!this.#x(r, e)) return;
1548
- let o = d(a);
1616
+ let o = y(a);
1549
1617
  return this.#b({ catalogs: {
1550
1618
  ...this.#d.value.catalogs,
1551
1619
  [t]: o
@@ -1585,7 +1653,7 @@ var Ut = class {
1585
1653
  }
1586
1654
  if (!this.#x(e, t)) return;
1587
1655
  let i = /* @__PURE__ */ new Set();
1588
- for (let e of je(n.revision.content).tasks) {
1656
+ for (let e of c(n.revision.content).tasks) {
1589
1657
  let t = n.task(e);
1590
1658
  if (t?.executor.kind != "connector") continue;
1591
1659
  let r = this.#d.value.actions[t.executor.action];
@@ -1593,8 +1661,8 @@ var Ut = class {
1593
1661
  }
1594
1662
  await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
1595
1663
  }
1596
- }, Wt = { catalogs: {} }, Gt = "trigger:";
1597
- function Kt(e, t) {
1664
+ }, Jt = { catalogs: {} }, Yt = "trigger:";
1665
+ function $(e, t) {
1598
1666
  if (e?.kind != "trigger") return;
1599
1667
  let n = e.trigger;
1600
1668
  if (n.kind != "poll" && n.kind != "integration") return;
@@ -1605,15 +1673,15 @@ function Kt(e, t) {
1605
1673
  triggerId: e.id
1606
1674
  };
1607
1675
  }
1608
- function qt(e, t) {
1676
+ function Xt(e, t) {
1609
1677
  return {
1610
1678
  description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
1611
1679
  group: t.t("addNode.integrationTriggers"),
1612
- icon: p({
1680
+ icon: m({
1613
1681
  serviceId: e.provider,
1614
1682
  serviceName: e.provider
1615
1683
  }),
1616
- id: `${Gt}${e.key}`,
1684
+ id: `${Yt}${e.key}`,
1617
1685
  inputs: [],
1618
1686
  kind: "trigger",
1619
1687
  label: e.displayName,
@@ -1627,7 +1695,7 @@ function qt(e, t) {
1627
1695
  }
1628
1696
  };
1629
1697
  }
1630
- var Jt = class {
1698
+ var Zt = class {
1631
1699
  #e;
1632
1700
  #t;
1633
1701
  #n;
@@ -1641,11 +1709,11 @@ var Jt = class {
1641
1709
  #u;
1642
1710
  #d;
1643
1711
  constructor(r, i, a, o, s = P()) {
1644
- this.#t = new AbortController(), this.#a = new m(), this.#o = /* @__PURE__ */ new Set(), this.#l = t(Wt), this.#d = !1, this.browseAddNodeOptions = async (e) => {
1712
+ this.#t = new AbortController(), this.#a = new w(), this.#o = /* @__PURE__ */ new Set(), this.#l = t(Jt), this.#d = !1, this.browseAddNodeOptions = async (e) => {
1645
1713
  let t = this.#u.$.flowId.value;
1646
1714
  if (e.aborted || this.#d || t == null || this.#u.$.target.value?.kind != "flow") return [];
1647
1715
  let n = await this.#f();
1648
- if (!(e.aborted || this.#d || t != this.#u.$.flowId.value)) return [...n.values()].map((e) => qt(e, this.#i));
1716
+ if (!(e.aborted || this.#d || t != this.#u.$.flowId.value)) return [...n.values()].map((e) => Xt(e, this.#i));
1649
1717
  }, this.provideAddNodeOptions = async (e, t) => {
1650
1718
  let n = this.#u.$.flowId.value;
1651
1719
  if (t.aborted || this.#d || n == null || this.#u.$.target.value?.kind != "flow") return [];
@@ -1659,9 +1727,9 @@ var Jt = class {
1659
1727
  e.name,
1660
1728
  e.provider,
1661
1729
  e.type
1662
- ].some((e) => e.toLowerCase().includes(r))).map((e) => qt(e, this.#i));
1730
+ ].some((e) => e.toLowerCase().includes(r))).map((e) => Xt(e, this.#i));
1663
1731
  }, this.#n = r, this.#r = o, this.#i = s, this.#c = a, this.#u = i, this.#s = n((e) => {
1664
- let t = e(i.$.selection), n = Kt(t, i), r = e(this.#l);
1732
+ let t = e(i.$.selection), n = $(t, i), r = e(this.#l);
1665
1733
  if (t?.kind != "trigger") return { authorizationPending: !1 };
1666
1734
  let a = t.trigger;
1667
1735
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
@@ -1688,11 +1756,11 @@ var Jt = class {
1688
1756
  this.#s.dispose(), this.#l.dispose();
1689
1757
  }
1690
1758
  reset() {
1691
- this.#d || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#o.clear(), this.#a.invalidate(), this.#l.set(Wt));
1759
+ this.#d || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#o.clear(), this.#a.invalidate(), this.#l.set(Jt));
1692
1760
  }
1693
1761
  async refresh(e = !1) {
1694
1762
  if (this.#d) return;
1695
- let t = this.#a.begin(), n = this.#u.$.flowId.value, r = Kt(this.#u.$.selection.value, this.#u);
1763
+ let t = this.#a.begin(), n = this.#u.$.flowId.value, r = $(this.#u.$.selection.value, this.#u);
1696
1764
  if (n == null || r == null) {
1697
1765
  this.#l.value.connectionLoading != null && this.#p({ connectionLoading: void 0 });
1698
1766
  return;
@@ -1706,7 +1774,7 @@ var Jt = class {
1706
1774
  connectionLoading: r.provider
1707
1775
  });
1708
1776
  try {
1709
- let e = d(await this.#n.listConnectorConnections(r.provider, void 0, n));
1777
+ let e = y(await this.#n.listConnectorConnections(r.provider, void 0, n));
1710
1778
  if (!this.#m(t, n)) return;
1711
1779
  this.#o.delete(r.provider), this.#p({ catalogs: {
1712
1780
  ...this.#l.value.catalogs,
@@ -1714,7 +1782,7 @@ var Jt = class {
1714
1782
  } });
1715
1783
  } catch (e) {
1716
1784
  this.#m(t, n) && this.#p({ connectionError: {
1717
- message: E(e, this.#i.t).message,
1785
+ message: p(e, this.#i.t).message,
1718
1786
  provider: r.provider
1719
1787
  } });
1720
1788
  } finally {
@@ -1733,7 +1801,7 @@ var Jt = class {
1733
1801
  }
1734
1802
  !this.#d && t == this.#u.$.flowId.value && this.#p({ authorizationProvider: e });
1735
1803
  } catch (e) {
1736
- this.#d || this.#c(E(e, this.#i.t));
1804
+ this.#d || this.#c(p(e, this.#i.t));
1737
1805
  }
1738
1806
  }
1739
1807
  async setConnection(e, t) {
@@ -1742,7 +1810,7 @@ var Jt = class {
1742
1810
  async refreshAfterAuthorization() {
1743
1811
  if (this.#d) return;
1744
1812
  let e = this.#l.value.authorizationProvider;
1745
- e != null && (this.#o.add(e), this.#p({ authorizationProvider: void 0 }), Kt(this.#u.$.selection.value, this.#u)?.provider == e && await this.refresh(!0));
1813
+ e != null && (this.#o.add(e), this.#p({ authorizationProvider: void 0 }), $(this.#u.$.selection.value, this.#u)?.provider == e && await this.refresh(!0));
1746
1814
  }
1747
1815
  #f() {
1748
1816
  if (this.#e != null) return this.#e;
@@ -1763,7 +1831,7 @@ var Jt = class {
1763
1831
  };
1764
1832
  //#endregion
1765
1833
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
1766
- function Yt(e, t) {
1834
+ function Qt(e, t) {
1767
1835
  if (e.length != 1 || t.length != 1) return;
1768
1836
  let n = e[0], r = t[0];
1769
1837
  if (n?.kind == "graph.node.field.set" && r?.kind == "graph.node.field.set") return n.nodeId != r.nodeId || n.field != r.field || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
@@ -1783,7 +1851,7 @@ function Yt(e, t) {
1783
1851
  value: r.value
1784
1852
  }];
1785
1853
  }
1786
- var Xt = class {
1854
+ var $t = class {
1787
1855
  #e;
1788
1856
  #t;
1789
1857
  #n;
@@ -1811,28 +1879,28 @@ var Xt = class {
1811
1879
  this.#a = e;
1812
1880
  let t = e, n = [];
1813
1881
  for (let e of this.#o) try {
1814
- t = R(t, e.changes), n.push(e);
1882
+ t = F(t, e.changes), n.push(e);
1815
1883
  } catch (t) {
1816
- if (!(t instanceof ze)) throw t;
1884
+ if (!(t instanceof We)) throw t;
1817
1885
  e.active = !1;
1818
1886
  }
1819
1887
  return this.#o = n, t;
1820
1888
  }
1821
1889
  project(e) {
1822
- return this.#o.reduce((e, t) => R(e, t.changes), e);
1890
+ return this.#o.reduce((e, t) => F(e, t.changes), e);
1823
1891
  }
1824
1892
  enqueue(e) {
1825
1893
  let t = this.#s.then(e);
1826
1894
  return this.#s = t, t;
1827
1895
  }
1828
1896
  async change(e, t, n, r = !0) {
1829
- let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Yt(i.changes, n);
1897
+ let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : Qt(i.changes, n);
1830
1898
  if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
1831
1899
  this.#t.beforeChange(r);
1832
1900
  let o = {
1833
1901
  ...e,
1834
1902
  active: !0,
1835
- changeId: F(),
1903
+ changeId: A(),
1836
1904
  changes: n,
1837
1905
  started: !1
1838
1906
  };
@@ -1857,21 +1925,21 @@ var Xt = class {
1857
1925
  let r = this.#l(e, n, t);
1858
1926
  return this.#o.length == 0 && this.#t.check(), r;
1859
1927
  } catch (n) {
1860
- if (n instanceof L && n.code == "flow.revision-conflict") {
1928
+ if (n instanceof M && n.code == "flow.revision-conflict") {
1861
1929
  if (!t && await this.#t.recover(e)) {
1862
- t = !0, e.changeId = F();
1930
+ t = !0, e.changeId = A();
1863
1931
  continue;
1864
1932
  }
1865
1933
  t && await this.#t.recover(e), this.#u(e);
1866
1934
  } else {
1867
- if (!(n instanceof L) && !t) {
1935
+ if (!(n instanceof M) && !t) {
1868
1936
  let n = this.#a?.revisionId;
1869
1937
  if (await this.#t.recover(e)) {
1870
- t = !0, e.active && this.#a?.revisionId != n && (e.changeId = F());
1938
+ t = !0, e.active && this.#a?.revisionId != n && (e.changeId = A());
1871
1939
  continue;
1872
1940
  }
1873
1941
  }
1874
- this.#u(e), this.#t.current(e) && this.#r(E(n, this.#n.t));
1942
+ this.#u(e), this.#t.current(e) && this.#r(p(n, this.#n.t));
1875
1943
  }
1876
1944
  return;
1877
1945
  }
@@ -1880,7 +1948,7 @@ var Xt = class {
1880
1948
  #l(e, t, n) {
1881
1949
  let r = {
1882
1950
  ...n.revision,
1883
- content: R(t, e.changes).content
1951
+ content: F(t, e.changes).content
1884
1952
  };
1885
1953
  this.#o = this.#o.filter((t) => t !== e), this.#a = r;
1886
1954
  let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
@@ -1889,7 +1957,7 @@ var Xt = class {
1889
1957
  #u(e) {
1890
1958
  e.active = !1, this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
1891
1959
  }
1892
- }, Zt = 50, Qt = {
1960
+ }, en = 50, tn = {
1893
1961
  failed: !1,
1894
1962
  loaded: !1,
1895
1963
  loading: !0,
@@ -1897,12 +1965,12 @@ var Xt = class {
1897
1965
  loadMoreFailed: !1,
1898
1966
  refreshing: !1,
1899
1967
  flows: []
1900
- }, $t = class {
1968
+ }, nn = class {
1901
1969
  #e;
1902
1970
  #t;
1903
- #n = new m();
1971
+ #n = new w();
1904
1972
  #r;
1905
- #i = t(Qt);
1973
+ #i = t(tn);
1906
1974
  #a = new AbortController();
1907
1975
  #o = /* @__PURE__ */ new Set();
1908
1976
  #s = !1;
@@ -1949,7 +2017,7 @@ var Xt = class {
1949
2017
  try {
1950
2018
  let t = await this.#e.listFlows({
1951
2019
  includeTotal: !0,
1952
- limit: Zt
2020
+ limit: en
1953
2021
  });
1954
2022
  if (!e()) return;
1955
2023
  this.#c({
@@ -1966,7 +2034,7 @@ var Xt = class {
1966
2034
  failed: !t,
1967
2035
  loading: !1,
1968
2036
  refreshing: !1
1969
- }), this.#r(E(n, this.#t.t));
2037
+ }), this.#r(p(n, this.#t.t));
1970
2038
  }
1971
2039
  }
1972
2040
  async loadMore() {
@@ -1980,7 +2048,7 @@ var Xt = class {
1980
2048
  try {
1981
2049
  let e = await this.#e.listFlows({
1982
2050
  cursor: t,
1983
- limit: Zt
2051
+ limit: en
1984
2052
  });
1985
2053
  if (!r()) return;
1986
2054
  let n = new Set(this.#i.value.flows.map((e) => e.flowId));
@@ -1994,7 +2062,7 @@ var Xt = class {
1994
2062
  this.#c({
1995
2063
  loadingMore: !1,
1996
2064
  loadMoreFailed: !0
1997
- }), this.#r(E(e, this.#t.t));
2065
+ }), this.#r(p(e, this.#t.t));
1998
2066
  }
1999
2067
  }
2000
2068
  async setEnabled(e, t) {
@@ -2004,7 +2072,7 @@ var Xt = class {
2004
2072
  let n = await this.#e.setFlowEnabled(e.flowId, e.live.publicationId, t);
2005
2073
  this.#s || this.include(n);
2006
2074
  } catch (e) {
2007
- this.#s || (this.#r(E(e, this.#t.t)), await this.reload());
2075
+ this.#s || (this.#r(p(e, this.#t.t)), await this.reload());
2008
2076
  } finally {
2009
2077
  this.#o.delete(e.flowId);
2010
2078
  }
@@ -2016,9 +2084,9 @@ var Xt = class {
2016
2084
  try {
2017
2085
  let t = await this.#e.publishFlow(e.flowId, e.draftRevisionId, e.live?.publicationId ?? null);
2018
2086
  if (this.#s) return;
2019
- let n = await Y.runPromise(Y.gen({ self: this }, function* () {
2087
+ let n = await q.runPromise(q.gen({ self: this }, function* () {
2020
2088
  let n = t;
2021
- for (; n.status == "pending";) yield* Y.sleep(1e3), n = yield* Y.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
2089
+ for (; n.status == "pending";) yield* q.sleep(1e3), n = yield* q.tryPromise((t) => this.#e.getPublishOperation(e.flowId, n.operationId, t));
2022
2090
  return n;
2023
2091
  }), { signal: this.#a.signal });
2024
2092
  if (this.#s) return;
@@ -2030,7 +2098,7 @@ var Xt = class {
2030
2098
  message: this.#t.t("notice.published", { name: e.name })
2031
2099
  }), this.include(await this.#e.getFlow(e.flowId));
2032
2100
  } catch (e) {
2033
- this.#s || this.#r(E(e, this.#t.t));
2101
+ this.#s || this.#r(p(e, this.#t.t));
2034
2102
  } finally {
2035
2103
  this.#o.delete(e.flowId);
2036
2104
  }
@@ -2072,7 +2140,7 @@ var Xt = class {
2072
2140
  ...e
2073
2141
  });
2074
2142
  }
2075
- }, en = class {
2143
+ }, rn = class {
2076
2144
  #e;
2077
2145
  #t;
2078
2146
  #n;
@@ -2115,7 +2183,7 @@ var Xt = class {
2115
2183
  this.#c(a, r);
2116
2184
  } catch (r) {
2117
2185
  if (this.#o || !n()) return;
2118
- if (r instanceof L && r.code == "flow.presentation-conflict") try {
2186
+ if (r instanceof M && r.code == "flow.presentation-conflict") try {
2119
2187
  let t = await this.#e.getPresentation(e);
2120
2188
  if (this.#o || !n()) return;
2121
2189
  this.#c(a, t), this.#n({
@@ -2123,9 +2191,9 @@ var Xt = class {
2123
2191
  message: this.#t.t("notice.layoutConflict")
2124
2192
  });
2125
2193
  } catch (e) {
2126
- !this.#o && n() && this.#n(E(e, this.#t.t));
2194
+ !this.#o && n() && this.#n(p(e, this.#t.t));
2127
2195
  }
2128
- else this.#c(a, t), this.#n(E(r, this.#t.t));
2196
+ else this.#c(a, t), this.#n(p(r, this.#t.t));
2129
2197
  }
2130
2198
  }), await this.#i;
2131
2199
  }
@@ -2137,21 +2205,21 @@ var Xt = class {
2137
2205
  value: n
2138
2206
  });
2139
2207
  }
2140
- }, tn = {
2208
+ }, an = {
2141
2209
  checkLoading: !1,
2142
2210
  selectedNodeIds: [],
2143
2211
  workspaceLoadFailed: !1,
2144
2212
  workspaceLoading: !1
2145
2213
  };
2146
- function nn(e) {
2214
+ function on(e) {
2147
2215
  return e.workspaceLoading ? "loading" : e.moduleSaveStatus == null ? e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved" : e.moduleSaveStatus;
2148
2216
  }
2149
- function $(e, t) {
2217
+ function sn(e, t) {
2150
2218
  if (t.phase != null) return t.phase;
2151
2219
  let n = e?.content.modules[t.moduleId];
2152
2220
  return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
2153
2221
  }
2154
- function rn(e, t, n) {
2222
+ function cn(e, t, n) {
2155
2223
  if (e == null || t == null || n.length != 1) return;
2156
2224
  let r = e.node(t, n[0]);
2157
2225
  if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
@@ -2159,9 +2227,9 @@ function rn(e, t, n) {
2159
2227
  source: r.module.source
2160
2228
  };
2161
2229
  }
2162
- var an = class {
2230
+ var ln = class {
2163
2231
  #e;
2164
- #t = t(tn);
2232
+ #t = t(an);
2165
2233
  #n;
2166
2234
  constructor(t, r) {
2167
2235
  let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => {
@@ -2169,32 +2237,32 @@ var an = class {
2169
2237
  let { phase: t, ...n } = e.moduleEditor;
2170
2238
  return {
2171
2239
  ...n,
2172
- status: $(e.draft, e.moduleEditor)
2240
+ status: sn(e.draft, e.moduleEditor)
2173
2241
  };
2174
- }), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : C(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
2242
+ }), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), p = e(this.#t, (e) => e.flowId), m = e(this.#t, (e) => e.live), h = e(this.#t, (e) => e.draft == null ? void 0 : I(e.draft)), g = e(this.#t, (e) => e.selectedNodeIds), _ = e(this.#t, (e) => e.target), v = e(this.#t, (e) => e.workspaceLoadFailed), y = e(this.#t, (e) => e.workspaceLoading);
2175
2243
  this.#e = e(this.#t, (e) => ({
2176
- revision: e.draft == null ? void 0 : C(e.draft),
2244
+ revision: e.draft == null ? void 0 : I(e.draft),
2177
2245
  target: e.target
2178
2246
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
2179
- let y = e(this.#t, (e) => {
2180
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return C(e.draft).selection(e.target, e.selectedNodeIds[0]);
2247
+ let b = e(this.#t, (e) => {
2248
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return I(e.draft).selection(e.target, e.selectedNodeIds[0]);
2181
2249
  });
2182
2250
  this.$ = {
2183
2251
  addNodeOptions: n((e) => {
2184
2252
  let { revision: n, target: r } = e(this.#e);
2185
- return Oe(n?.revision, r, e(t.t$));
2253
+ return C(n?.revision, r, e(t.t$));
2186
2254
  }),
2187
2255
  busy: i,
2188
2256
  checkLoading: a,
2189
2257
  diagnosticFocus: o,
2190
- diagnosticItems: e(this.#t, (e) => D(e.draft == null ? void 0 : C(e.draft), e.target, e.diagnostics)),
2258
+ diagnosticItems: e(this.#t, (e) => f(e.draft == null ? void 0 : I(e.draft), e.target, e.diagnostics)),
2191
2259
  diagnostics: s,
2192
2260
  draft: c,
2193
2261
  flow: n((e) => {
2194
- let t = e(f);
2262
+ let t = e(p);
2195
2263
  return t == null ? void 0 : e(r.$.flows).find((e) => e.flowId == t);
2196
2264
  }),
2197
- flowId: f,
2265
+ flowId: p,
2198
2266
  flowLoadFailed: r.$.failed,
2199
2267
  flowLoadMoreFailed: r.$.loadMoreFailed,
2200
2268
  flowLoading: r.$.loading,
@@ -2203,26 +2271,22 @@ var an = class {
2203
2271
  flowRefreshing: r.$.refreshing,
2204
2272
  flowTotal: r.$.total,
2205
2273
  flows: r.$.flows,
2206
- inspectorDiagnostics: e(this.#t, (e) => T(e.draft == null ? void 0 : C(e.draft), e.target, e.diagnostics, y.value)),
2207
- live: p,
2208
- moduleDiagnostics: e(this.#t, (e) => {
2209
- let t = e.moduleEditor?.moduleId;
2210
- return t == null ? [] : e.diagnostics?.diagnostics.filter((e) => e.path.startsWith(`/modules/${t}/source`)) ?? [];
2211
- }),
2274
+ inspectorDiagnostics: e(this.#t, (e) => E(e.draft == null ? void 0 : I(e.draft), e.target, e.diagnostics, b.value)),
2275
+ live: m,
2212
2276
  moduleEditor: l,
2213
2277
  nodeFocus: u,
2214
2278
  presentation: d,
2215
- revision: m,
2216
- selection: y,
2217
- selectedNodeIds: h,
2218
- status: e(this.#t, nn),
2219
- target: g,
2220
- targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
2279
+ revision: h,
2280
+ selection: b,
2281
+ selectedNodeIds: g,
2282
+ status: e(this.#t, on),
2283
+ target: _,
2284
+ targetFlow: n((e) => e(_)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(p)) : void 0),
2221
2285
  targetName: e(this.#t, (e) => {
2222
- if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : C(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2286
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : I(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2223
2287
  }),
2224
- workspaceLoadFailed: _,
2225
- workspaceLoading: v
2288
+ workspaceLoadFailed: v,
2289
+ workspaceLoading: y
2226
2290
  }, this.#n = new Set(Object.values(r.$));
2227
2291
  }
2228
2292
  get value() {
@@ -2238,17 +2302,17 @@ var an = class {
2238
2302
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2239
2303
  this.#e.dispose(), this.#t.dispose();
2240
2304
  }
2241
- }, on = {
2305
+ }, un = {
2242
2306
  x: 40,
2243
2307
  y: 40
2244
2308
  };
2245
- function sn(e, t) {
2309
+ function dn(e, t) {
2246
2310
  if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2247
2311
  }
2248
- var cn = class {
2312
+ var fn = class {
2249
2313
  #e;
2250
2314
  #t;
2251
- #n = new m();
2315
+ #n = new w();
2252
2316
  #r;
2253
2317
  #i;
2254
2318
  #a;
@@ -2259,40 +2323,39 @@ var cn = class {
2259
2323
  #u = /* @__PURE__ */ new Map();
2260
2324
  #d;
2261
2325
  #f;
2262
- #p;
2326
+ #p = 0;
2263
2327
  #m = 0;
2264
- #h = 0;
2328
+ #h = !1;
2265
2329
  #g = !1;
2266
2330
  #_ = !1;
2267
- #v = !1;
2268
- #y = 0;
2331
+ #v = 0;
2332
+ #y;
2269
2333
  #b;
2270
- #x;
2271
- constructor(e, t, n = Dt, r = P(), i = () => {}) {
2272
- this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new $t(e, t, r), this.#l = new an(r, this.#o), this.#t = new Xt(e, t, r, {
2273
- apply: (e, t) => this.#D(e, t),
2334
+ constructor(e, t, n = kt, r = P(), i = () => {}) {
2335
+ this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new nn(e, t, r), this.#l = new ln(r, this.#o), this.#t = new $t(e, t, r, {
2336
+ apply: (e, t) => this.#E(e, "local", t),
2274
2337
  beforeChange: (e) => {
2275
- e && (this.#R({ busy: "designer" }), this.#c(void 0));
2338
+ e && (this.#I({ busy: "designer" }), this.#c(void 0));
2276
2339
  },
2277
- check: () => void this.#k(),
2278
- current: (e) => this.#L(e),
2340
+ check: () => void this.#O(),
2341
+ current: (e) => this.#N(e),
2279
2342
  diagnostics: () => this.#l.value.diagnostics,
2280
2343
  finishChanges: () => {
2281
- !this.#_ && this.#l.value.busy == "designer" && this.#R({ busy: void 0 });
2344
+ !this.#g && this.#l.value.busy == "designer" && this.#I({ busy: void 0 });
2282
2345
  },
2283
- headChanged: (e, t) => this.#M(e, t),
2284
- recover: (e) => this.#j(e, !0)
2285
- }), this.#a = new en(e, t, (e) => this.#R({ presentation: e }), r), this.$ = this.#l.$;
2346
+ headChanged: (e, t) => this.#o.advanceHead(e, t),
2347
+ recover: (e) => this.#A(e, !0)
2348
+ }), this.#a = new rn(e, t, (e) => this.#I({ presentation: e }), r), this.$ = this.#l.$;
2286
2349
  }
2287
2350
  dispose() {
2288
- this.#_ = !0, clearTimeout(this.#d), this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
2351
+ this.#g = !0, this.#n.invalidate(), this.#a.dispose(), this.#y?.(), this.#b?.(), this.#l.dispose(), this.#o.dispose();
2289
2352
  }
2290
2353
  async start(e) {
2291
- if (this.#b == null) {
2354
+ if (this.#y == null) {
2292
2355
  let e = this.#e.watchFlowCatalog(() => void this.reloadFlows());
2293
- this.#b = e.stop, await e.ready;
2356
+ this.#y = e.stop, await e.ready;
2294
2357
  }
2295
- this.#_ || (await this.reloadFlows(), this.#_ || await this.selectFlow(e));
2358
+ this.#g || (await this.reloadFlows(), this.#g || await this.selectFlow(e));
2296
2359
  }
2297
2360
  async reloadFlows() {
2298
2361
  await this.#o.reload();
@@ -2309,7 +2372,7 @@ var cn = class {
2309
2372
  async selectFlow(e) {
2310
2373
  if (!await this.saveModuleEditor()) return !1;
2311
2374
  let t = this.#n.begin();
2312
- if (this.#t.reset(), this.#a.reset(), this.#h = 0, this.#g = !1, this.#v = !1, this.#x?.(), this.#x = void 0, this.#R({
2375
+ if (this.#t.reset(), this.#a.reset(), this.#m = 0, this.#h = !1, this.#_ = !1, this.#b?.(), this.#b = void 0, this.#I({
2313
2376
  checkLoading: !1,
2314
2377
  diagnosticFocus: void 0,
2315
2378
  diagnostics: void 0,
@@ -2326,26 +2389,26 @@ var cn = class {
2326
2389
  }), e == null) return !0;
2327
2390
  try {
2328
2391
  let n = !1, r, i = this.#e.watchFlow(e, (e) => {
2329
- t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#A(e));
2392
+ t() && (this.#t.committed == null ? (n = !0, r = e) : e != this.#t.committed.revisionId && this.#k(e));
2330
2393
  }, (e) => {
2331
2394
  t() && this.#s(e);
2332
2395
  });
2333
- if (this.#x = i.stop, await i.ready, !t()) return !1;
2396
+ if (this.#b = i.stop, await i.ready, !t()) return !1;
2334
2397
  let { flow: a, draft: o, live: s, presentation: c } = await this.#e.getEditor(e);
2335
2398
  if (!t()) return !1;
2336
- this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#R({
2399
+ this.#t.reset(o), this.#a.reset(c), this.#o.include(a), this.#I({
2337
2400
  draft: o,
2338
2401
  live: s,
2339
2402
  presentation: c,
2340
2403
  target: { kind: "flow" },
2341
2404
  workspaceLoadFailed: !1,
2342
2405
  workspaceLoading: !1
2343
- }), await this.#E(t), n && r != o.revisionId && this.#A(r);
2406
+ }), await this.#T(t), n && r != o.revisionId && this.#k(r);
2344
2407
  } catch (e) {
2345
2408
  if (!t()) return !1;
2346
- this.#x?.(), this.#x = void 0;
2347
- let n = e instanceof L && e.code == le.flowNotFound;
2348
- return this.#R(n ? {
2409
+ this.#b?.(), this.#b = void 0;
2410
+ let n = e instanceof M && e.code == de.flowNotFound;
2411
+ return this.#I(n ? {
2349
2412
  flowId: void 0,
2350
2413
  target: void 0,
2351
2414
  workspaceLoadFailed: !1,
@@ -2356,39 +2419,39 @@ var cn = class {
2356
2419
  }), this.#c(n ? {
2357
2420
  kind: "error",
2358
2421
  message: this.#r.t("notice.flowMissing")
2359
- } : E(e, this.#r.t)), !1;
2422
+ } : p(e, this.#r.t)), !1;
2360
2423
  }
2361
2424
  return !0;
2362
2425
  }
2363
2426
  selectTarget(e) {
2364
- return this.#S(), this.#R({
2427
+ return this.#x(), this.#I({
2365
2428
  diagnosticFocus: void 0,
2366
2429
  diagnostics: void 0,
2367
2430
  moduleEditor: void 0,
2368
2431
  nodeFocus: void 0,
2369
2432
  selectedNodeIds: [],
2370
2433
  target: e
2371
- }), this.#k(), !0;
2434
+ }), this.#O(), !0;
2372
2435
  }
2373
2436
  selectNodes(e) {
2374
- return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#S(), this.#R({
2437
+ return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : (this.#x(), this.#I({
2375
2438
  diagnosticFocus: void 0,
2376
- moduleEditor: rn(this.#l.value.draft == null ? void 0 : C(this.#l.value.draft), this.#l.value.target, e),
2439
+ moduleEditor: cn(this.#l.value.draft == null ? void 0 : I(this.#l.value.draft), this.#l.value.target, e),
2377
2440
  nodeFocus: void 0,
2378
2441
  selectedNodeIds: e
2379
2442
  }), !0);
2380
2443
  }
2381
2444
  async createFlow(e, t) {
2382
2445
  if (await this.saveModuleEditor()) {
2383
- this.#R({ busy: "flow" }), this.#c(void 0);
2446
+ this.#I({ busy: "flow" }), this.#c(void 0);
2384
2447
  try {
2385
2448
  if (t == null) return await this.#o.create(e);
2386
2449
  let n = await this.#e.getFlow(await t(e));
2387
2450
  return this.#o.insert(n), n;
2388
2451
  } catch (e) {
2389
- this.#_ || this.#c(E(e, this.#r.t));
2452
+ this.#g || this.#c(p(e, this.#r.t));
2390
2453
  } finally {
2391
- this.#R({ busy: void 0 });
2454
+ this.#I({ busy: void 0 });
2392
2455
  }
2393
2456
  }
2394
2457
  }
@@ -2396,24 +2459,24 @@ var cn = class {
2396
2459
  if (!await this.saveModuleEditor()) return !1;
2397
2460
  let t = this.#o.flow(e);
2398
2461
  if (t == null || t.status == "retiring") return !1;
2399
- this.#R({ busy: "flow" }), this.#c(void 0);
2462
+ this.#I({ busy: "flow" }), this.#c(void 0);
2400
2463
  try {
2401
- return await this.#e.deleteFlow(e), !this.#_ && (this.#o.remove(e), this.#c({
2464
+ return await this.#e.deleteFlow(e), !this.#g && (this.#o.remove(e), this.#c({
2402
2465
  kind: "success",
2403
2466
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
2404
2467
  }), !0);
2405
2468
  } catch (e) {
2406
- return this.#_ || this.#c(E(e, this.#r.t)), !1;
2469
+ return this.#g || this.#c(p(e, this.#r.t)), !1;
2407
2470
  } finally {
2408
- this.#R({ busy: void 0 });
2471
+ this.#I({ busy: void 0 });
2409
2472
  }
2410
2473
  }
2411
2474
  async createResource(e) {
2412
2475
  if (!await this.saveModuleEditor() || this.#l.value.draft == null) return !1;
2413
2476
  let t = this.#i();
2414
- this.#R({ busy: "resource" }), this.#c(void 0);
2415
- let n = await this.#T(j(t, e), !1);
2416
- return this.#R({ busy: void 0 }), n != null && (this.selectTarget({
2477
+ this.#I({ busy: "resource" }), this.#c(void 0);
2478
+ let n = await this.#w(be(t, e), !1);
2479
+ return this.#I({ busy: void 0 }), n != null && (this.selectTarget({
2417
2480
  id: t,
2418
2481
  kind: "subflow"
2419
2482
  }), this.#c({
@@ -2425,14 +2488,14 @@ var cn = class {
2425
2488
  let n = this.#o.flow(e), r = t.trim();
2426
2489
  if (n == null || r.length == 0) return !1;
2427
2490
  if (n.name == r) return !0;
2428
- this.#R({ busy: "flow" }), this.#c(void 0);
2491
+ this.#I({ busy: "flow" }), this.#c(void 0);
2429
2492
  let i;
2430
2493
  try {
2431
2494
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
2432
2495
  } catch (e) {
2433
- this.#_ || this.#c(E(e, this.#r.t));
2496
+ this.#g || this.#c(p(e, this.#r.t));
2434
2497
  }
2435
- return this.#R({ busy: void 0 }), i != null && (this.#c({
2498
+ return this.#I({ busy: void 0 }), i != null && (this.#c({
2436
2499
  kind: "success",
2437
2500
  message: this.#r.t("notice.flowRenamed", { name: r })
2438
2501
  }), !0);
@@ -2442,74 +2505,74 @@ var cn = class {
2442
2505
  let r = this.#l.value.draft, i = this.#l.value.target;
2443
2506
  if (r == null || i == null) return;
2444
2507
  let a = this.#i();
2445
- if (e.kind == "comment") return await this.#w(i, a, t);
2446
- let o = C(r), s = u(e, o, i, this.#r.t);
2508
+ if (e.kind == "comment") return await this.#C(i, a, t);
2509
+ let o = I(r), s = Me(e, o, i, this.#r.t);
2447
2510
  if (s == null) return;
2448
- let c = n?.(a), l = we(o, i, a, s, this.#i);
2511
+ let c = n?.(a), l = De(o, i, a, s, this.#i);
2449
2512
  if (l == null) return;
2450
- let d = c == null ? l : [...l, ...St(R(r, l).content, i, {
2513
+ let u = c == null ? l : [...l, ...wt(F(r, l).content, i, {
2451
2514
  source: c.source,
2452
2515
  target: c.target,
2453
2516
  ...c.sourceHandle.startsWith("$branch:") ? { sourceHandle: c.sourceHandle.slice(8) } : {}
2454
- })], f = this.#T(d);
2517
+ })], d = this.#w(u);
2455
2518
  this.selectNodes([a]);
2456
- let p = this.moveNodes({ [a]: t });
2457
- if (await f != null && (await p, !this.#_)) return this.#R({ nodeFocus: {
2519
+ let f = this.moveNodes({ [a]: t });
2520
+ if (await d != null && (await f, !this.#g)) return this.#I({ nodeFocus: {
2458
2521
  nodeId: a,
2459
- requestId: ++this.#y
2522
+ requestId: ++this.#v
2460
2523
  } }), a;
2461
2524
  }
2462
2525
  async connect(e) {
2463
2526
  let t = this.$.revision.value, n = this.#l.value.target;
2464
2527
  if (t == null || n == null) return;
2465
- let r = St(t.revision.content, n, {
2528
+ let r = wt(t.revision.content, n, {
2466
2529
  source: e.source,
2467
2530
  target: e.target,
2468
2531
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
2469
2532
  });
2470
- r.length > 0 && await this.#T(r);
2533
+ r.length > 0 && await this.#w(r);
2471
2534
  }
2472
2535
  async disconnect(e) {
2473
2536
  let t = this.$.revision.value, n = this.#l.value.target;
2474
2537
  if (t == null || n == null) return;
2475
- let r = Ct(t.revision.content, n, {
2538
+ let r = Tt(t.revision.content, n, {
2476
2539
  source: e.source,
2477
2540
  target: e.target,
2478
2541
  ...e.sourceHandle.startsWith("$branch:") ? { sourceHandle: e.sourceHandle.slice(8) } : {}
2479
2542
  });
2480
- r.length > 0 && await this.#T(r);
2543
+ r.length > 0 && await this.#w(r);
2481
2544
  }
2482
2545
  async deleteSelectedNodes() {
2483
2546
  if (!await this.saveModuleEditor()) return;
2484
2547
  let e = this.$.revision.value, t = this.#l.value.target;
2485
2548
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2486
- let n = f(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = ge(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#T(i), o = r.size == 0 ? void 0 : this.#O((e) => c(e, t, r));
2549
+ let n = u(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Te(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#w(i), o = r.size == 0 ? void 0 : this.#D((e) => me(e, t, r));
2487
2550
  this.selectNodes([]), (a == null || await a != null) && await o;
2488
2551
  }
2489
2552
  copySelectedNodes() {
2490
2553
  let e = this.$.revision.value, t = this.#l.value.target;
2491
2554
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2492
2555
  let n = new Set(this.#l.value.selectedNodeIds);
2493
- this.#p = {
2494
- comments: this.#N().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2556
+ this.#f = {
2557
+ comments: this.#j().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2495
2558
  content: e.content,
2496
2559
  position: e.position,
2497
2560
  sourceId: e.id,
2498
2561
  title: e.title
2499
2562
  }] : []),
2500
- nodes: ue(e, t, this.#l.value.selectedNodeIds)
2563
+ nodes: j(e, t, this.#l.value.selectedNodeIds)
2501
2564
  };
2502
2565
  }
2503
- async pasteNodes(e, t = on) {
2566
+ async pasteNodes(e, t = un) {
2504
2567
  if (!await this.saveModuleEditor()) return;
2505
2568
  let n = this.$.revision.value, r = this.#l.value.target;
2506
- if (n == null || r == null || this.#p == null) return;
2507
- let i = Se(n, r, this.#p.nodes, this.#i), a = i.changes.length == 0 ? void 0 : this.#T(i.changes), o = this.#p.comments.map((e) => ({
2569
+ if (n == null || r == null || this.#f == null) return;
2570
+ let i = re(n, r, this.#f.nodes, this.#i), a = i.changes.length == 0 ? void 0 : this.#w(i.changes), o = this.#f.comments.map((e) => ({
2508
2571
  ...e,
2509
2572
  nodeId: this.#i()
2510
2573
  }));
2511
2574
  if (i.nodeIds.length == 0 && o.length == 0) return;
2512
- let s = new Map(this.#N().nodes.map((e) => [e.id, e])), c = /* @__PURE__ */ new Set([...i.nodeIds, ...o.map((e) => e.nodeId)]), l = new Set([...s].filter(([e]) => !c.has(e)).map(([, e]) => `${e.position.x}\0${e.position.y}`)), u = [...i.sourceIds.map((t) => e?.[t] ?? s.get(t)?.position ?? {
2575
+ let s = new Map(this.#j().nodes.map((e) => [e.id, e])), c = /* @__PURE__ */ new Set([...i.nodeIds, ...o.map((e) => e.nodeId)]), l = new Set([...s].filter(([e]) => !c.has(e)).map(([, e]) => `${e.position.x}\0${e.position.y}`)), u = [...i.sourceIds.map((t) => e?.[t] ?? s.get(t)?.position ?? {
2513
2576
  x: 80,
2514
2577
  y: 80
2515
2578
  }), ...o.map((e) => e.position)], d = 1;
@@ -2520,9 +2583,9 @@ var cn = class {
2520
2583
  x: (a?.x ?? 80) + t.x * d,
2521
2584
  y: (a?.y ?? 80) + t.y * d
2522
2585
  }];
2523
- })), p = this.#O((e) => {
2524
- let n = y(e, r, f);
2525
- for (let e of o) n = I(n, r, e.nodeId, {
2586
+ })), p = this.#D((e) => {
2587
+ let n = b(e, r, f);
2588
+ for (let e of o) n = _(n, r, e.nodeId, {
2526
2589
  content: e.content,
2527
2590
  position: {
2528
2591
  x: e.position.x + t.x * d,
@@ -2540,36 +2603,36 @@ var cn = class {
2540
2603
  async saveNodeSettings(e, t) {
2541
2604
  let n = this.$.revision.value, r = this.#l.value.target;
2542
2605
  if (n == null || r == null) return !1;
2543
- let i = se(n, r, e, t);
2544
- return i != null && await this.#T(i) != null;
2606
+ let i = ue(n, r, e, t);
2607
+ return i != null && await this.#w(i) != null;
2545
2608
  }
2546
2609
  async saveNodeDescription(e, t) {
2547
2610
  let n = this.$.revision.value, r = this.#l.value.target;
2548
2611
  if (n == null || r == null) return !1;
2549
- let i = ve(n, r, e, t);
2550
- return i != null && await this.#T(i) != null;
2612
+ let i = Se(n, r, e, t);
2613
+ return i != null && await this.#w(i) != null;
2551
2614
  }
2552
2615
  async saveNodeIcon(e, t) {
2553
2616
  let n = this.$.revision.value, r = this.#l.value.target;
2554
2617
  if (n == null || r == null) return !1;
2555
- let i = me(n, r, e, t);
2556
- return i != null && await this.#T(i) != null;
2618
+ let i = ve(n, r, e, t);
2619
+ return i != null && await this.#w(i) != null;
2557
2620
  }
2558
2621
  async saveNodeTitle(e, t) {
2559
2622
  let n = this.$.revision.value, r = this.#l.value.target;
2560
2623
  if (n == null || r == null) return !1;
2561
- let i = ce(n, r, e, t);
2562
- return i != null && await this.#T(i) != null;
2624
+ let i = fe(n, r, e, t);
2625
+ return i != null && await this.#w(i) != null;
2563
2626
  }
2564
2627
  async setInputValue(e, t, n) {
2565
2628
  let r = this.$.revision.value, i = this.#l.value.target;
2566
2629
  if (r == null || i == null) return !1;
2567
- let a = N(r, i, e, t, n);
2568
- return a != null && await this.#T(a) != null;
2630
+ let a = ge(r, i, e, t, n);
2631
+ return a != null && await this.#w(a) != null;
2569
2632
  }
2570
2633
  async setInputSource(e, t, n) {
2571
2634
  let r = this.$.revision.value, i = this.#l.value.target;
2572
- return r == null || i == null ? !1 : await this.#T(ee(r.revision.content, i, e, t, [{
2635
+ return r == null || i == null ? !1 : await this.#w(D(r.revision.content, i, e, t, [{
2573
2636
  kind: "node",
2574
2637
  ...n
2575
2638
  }])) != null;
@@ -2577,36 +2640,36 @@ var cn = class {
2577
2640
  async setInputVariable(e, t, n) {
2578
2641
  let r = this.$.revision.value, i = this.#l.value.target;
2579
2642
  if (r == null || i == null) return !1;
2580
- let a = n == null ? N(r, i, e, t, void 0) : fe(r, i, e, t, n, this.#i());
2581
- return a != null && await this.#T(a) != null;
2643
+ let a = n == null ? ge(r, i, e, t, void 0) : ke(r, i, e, t, n, this.#i());
2644
+ return a != null && await this.#w(a) != null;
2582
2645
  }
2583
2646
  async saveCondition(e, t) {
2584
2647
  let n = this.$.revision.value, r = this.#l.value.target;
2585
2648
  if (n == null || r == null) return !1;
2586
- let i = oe(n, r, e, t);
2587
- return i != null && await this.#T(i) != null;
2649
+ let i = ce(n, r, e, t);
2650
+ return i != null && await this.#w(i) != null;
2588
2651
  }
2589
2652
  async saveValue(e, t) {
2590
2653
  let n = this.$.revision.value, r = this.#l.value.target;
2591
2654
  if (n == null || r == null) return !1;
2592
- let i = M(n, r, e, t);
2593
- return i != null && await this.#T(i) != null;
2655
+ let i = Ne(n, r, e, t);
2656
+ return i != null && await this.#w(i) != null;
2594
2657
  }
2595
2658
  async saveWait(e, t) {
2596
2659
  let n = this.$.revision.value, r = this.#l.value.target;
2597
2660
  if (n == null || r?.kind != "flow") return !1;
2598
- let i = ke(n, r, e, t);
2599
- return i != null && await this.#T(i) != null;
2661
+ let i = S(n, r, e, t);
2662
+ return i != null && await this.#w(i) != null;
2600
2663
  }
2601
2664
  async setWaitNotification(e, t) {
2602
- let n = this.$.revision.value, r = n == null ? void 0 : Te(n, e, t, this.#i());
2603
- return r != null && await this.#T(r) != null;
2665
+ let n = this.$.revision.value, r = n == null ? void 0 : ae(n, e, t, this.#i());
2666
+ return r != null && await this.#w(r) != null;
2604
2667
  }
2605
2668
  async saveComment(e, t) {
2606
2669
  let n = this.#l.value.target;
2607
2670
  if (n == null) return;
2608
- let r = this.#N().nodes.find((t) => t.id == e)?.position;
2609
- r != null && await this.#O((i) => I(i, n, e, {
2671
+ let r = this.#j().nodes.find((t) => t.id == e)?.position;
2672
+ r != null && await this.#D((i) => _(i, n, e, {
2610
2673
  ...t,
2611
2674
  position: r
2612
2675
  }));
@@ -2614,62 +2677,62 @@ var cn = class {
2614
2677
  async saveTaskSettings(e, t) {
2615
2678
  let n = this.$.revision.value, r = this.#l.value.target;
2616
2679
  if (n == null || r == null) return !1;
2617
- let i = De(n, r, e, t);
2618
- return i != null && await this.#T(i) != null;
2680
+ let i = je(n, r, e, t);
2681
+ return i != null && await this.#w(i) != null;
2619
2682
  }
2620
2683
  async saveCodeActions(e, t) {
2621
2684
  let n = this.$.revision.value, r = this.#l.value.target;
2622
2685
  if (n == null || r == null) return !1;
2623
- let i = be(n.revision.content, r, e, t);
2624
- return i == null || await this.#T(i) != null;
2686
+ let i = h(n.revision.content, r, e, t);
2687
+ return i == null || await this.#w(i) != null;
2625
2688
  }
2626
- async saveCodeTaskPorts(e, t) {
2689
+ async saveTaskPorts(e, t) {
2627
2690
  let n = this.$.revision.value, r = this.#l.value.target;
2628
2691
  if (n == null || r == null) return !1;
2629
- let i = re(n, r, e, t);
2630
- return i != null && await this.#T(i) != null;
2692
+ let i = ne(n, r, e, t);
2693
+ return i != null && await this.#w(i) != null;
2631
2694
  }
2632
2695
  async saveTaskAdditionalInputs(e, t) {
2633
2696
  let n = this.$.revision.value, r = this.#l.value.target;
2634
2697
  if (n == null || r == null) return !1;
2635
- let i = Ae(n, r, e, t);
2636
- return i != null && await this.#T(i) != null;
2698
+ let i = Pe(n, r, e, t);
2699
+ return i != null && await this.#w(i) != null;
2637
2700
  }
2638
2701
  async setConnectorConnection(e, t) {
2639
2702
  let n = this.$.revision.value;
2640
2703
  if (n == null) return !1;
2641
- let r = g(n.revision.content, e, t);
2642
- return r != null && await this.#T(r) != null;
2704
+ let r = ee(n.revision.content, e, t);
2705
+ return r != null && await this.#w(r) != null;
2643
2706
  }
2644
2707
  async saveTriggerConfig(e, t, n) {
2645
2708
  let r = this.$.revision.value, i = this.#l.value.target;
2646
2709
  if (r == null || i?.kind != "flow") return !1;
2647
- let a = k(r.revision.content, i, e, t, n);
2648
- return a != null && await this.#T(a) != null;
2710
+ let a = x(r.revision.content, i, e, t, n);
2711
+ return a != null && await this.#w(a) != null;
2649
2712
  }
2650
2713
  async saveTriggerSchedule(e, t) {
2651
2714
  let n = this.$.revision.value, r = this.#l.value.target;
2652
2715
  if (n == null || r?.kind != "flow") return !1;
2653
- let i = S(n.revision.content, r, e, t);
2654
- return i != null && await this.#T(i) != null;
2716
+ let i = s(n.revision.content, r, e, t);
2717
+ return i != null && await this.#w(i) != null;
2655
2718
  }
2656
2719
  async saveWebhook(e, t) {
2657
2720
  let n = this.$.revision.value, r = this.#l.value.target;
2658
2721
  if (n == null || r?.kind != "flow") return !1;
2659
- let i = w(n, r, e, t);
2660
- return i != null && await this.#T(i) != null;
2722
+ let i = l(n, r, e, t);
2723
+ return i != null && await this.#w(i) != null;
2661
2724
  }
2662
2725
  async setTriggerConnection(e, t) {
2663
2726
  let n = this.$.revision.value, r = this.#l.value.target;
2664
2727
  if (n == null || r?.kind != "flow") return !1;
2665
2728
  let i = O(n.revision.content, r, e, t);
2666
- return i != null && await this.#T(i) != null;
2729
+ return i != null && await this.#w(i) != null;
2667
2730
  }
2668
2731
  async saveSubflowSettings(e, t) {
2669
2732
  let n = this.$.revision.value;
2670
2733
  if (n == null) return !1;
2671
- let r = A(n, e, t);
2672
- return r != null && await this.#T(r) != null;
2734
+ let r = k(n, e, t);
2735
+ return r != null && await this.#w(r) != null;
2673
2736
  }
2674
2737
  updateModuleSource(e) {
2675
2738
  let t = this.#l.value.moduleEditor;
@@ -2682,14 +2745,14 @@ var cn = class {
2682
2745
  phase: void 0,
2683
2746
  source: e
2684
2747
  }
2685
- }), this.#R({}), clearTimeout(this.#d), this.#d = setTimeout(() => void this.#S(), 800));
2748
+ }), this.#F());
2686
2749
  }
2687
2750
  discardModuleChanges() {
2688
2751
  let e = this.#l.value.moduleEditor;
2689
- if (e == null || this.#f != null) return;
2752
+ if (e == null || this.#d != null) return;
2690
2753
  this.#u.delete(e.moduleId);
2691
2754
  let t = this.#l.value.draft?.content.modules[e.moduleId];
2692
- this.#R({ moduleEditor: t == null ? void 0 : {
2755
+ this.#I({ moduleEditor: t == null ? void 0 : {
2693
2756
  moduleId: e.moduleId,
2694
2757
  source: t.source
2695
2758
  } });
@@ -2698,44 +2761,44 @@ var cn = class {
2698
2761
  return this.#u.size > 0;
2699
2762
  }
2700
2763
  async saveModuleEditor() {
2701
- if (this.#_) return !1;
2764
+ if (this.#g) return !1;
2702
2765
  for (let e of this.#u.values()) e.editor.phase == "failed" && (e.editor = {
2703
2766
  ...e.editor,
2704
2767
  phase: void 0
2705
2768
  });
2706
- return this.#R({}), await this.#S();
2769
+ return this.#F(), await this.#x();
2707
2770
  }
2708
- #S() {
2709
- if (clearTimeout(this.#d), this.#f != null) return this.#f;
2710
- if (this.#_) return Promise.resolve(!1);
2771
+ #x() {
2772
+ if (this.#d != null) return this.#d;
2773
+ if (this.#g) return Promise.resolve(!1);
2711
2774
  if (![...this.#u.values()].some((e) => e.editor.phase != "failed")) return Promise.resolve(this.#u.size == 0);
2712
2775
  let e = this.#n.capture();
2713
- return this.#f = this.#C(e).finally(() => {
2714
- this.#f = void 0;
2715
- }), this.#f;
2776
+ return this.#d = this.#S(e).finally(() => {
2777
+ this.#d = void 0;
2778
+ }), this.#d;
2716
2779
  }
2717
- async #C(e) {
2718
- for (; !this.#_ && e();) {
2780
+ async #S(e) {
2781
+ for (; !this.#g && e();) {
2719
2782
  let t = [...this.#u.entries()].find(([, e]) => e.editor.phase != "failed");
2720
2783
  if (t == null) return this.#u.size == 0;
2721
2784
  let [n, r] = t, i = r.editor.source;
2722
2785
  r.editor = {
2723
2786
  ...r.editor,
2724
2787
  phase: "saving"
2725
- }, this.#R({});
2788
+ }, this.#F();
2726
2789
  try {
2727
- let t = await Tt(i);
2728
- if (this.#_ || !e()) return !1;
2790
+ let t = await Dt(i);
2791
+ if (this.#g || !e()) return !1;
2729
2792
  let a = this.#l.value.draft?.content.modules[n];
2730
2793
  if (a == null || a.source != r.base.source || JSON.stringify(a.imports) != JSON.stringify(r.base.imports)) throw Error(this.#r.t("notice.moduleUpdated"));
2731
- let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#T(Et(n, r.base.source, r.base.imports, i, t), !1);
2732
- if (this.#_ || !e()) return !1;
2794
+ let o = i == a.source && JSON.stringify(t) == JSON.stringify(a.imports) ? this.#l.value.draft : await this.#w(Ot(n, r.base.source, r.base.imports, i, t), !1);
2795
+ if (this.#g || !e()) return !1;
2733
2796
  let s = this.#u.get(n);
2734
2797
  if (s == null) continue;
2735
2798
  o == null ? s.editor = {
2736
2799
  ...s.editor,
2737
2800
  phase: "failed"
2738
- } : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#R({ moduleEditor: {
2801
+ } : s.editor.source == i ? (this.#u.delete(n), this.#l.value.moduleEditor?.moduleId == n && this.#I({ moduleEditor: {
2739
2802
  moduleId: n,
2740
2803
  source: i
2741
2804
  } })) : (s.base = {
@@ -2747,115 +2810,118 @@ var cn = class {
2747
2810
  phase: void 0
2748
2811
  });
2749
2812
  } catch (t) {
2750
- if (this.#_ || !e()) return !1;
2813
+ if (this.#g || !e()) return !1;
2751
2814
  let r = this.#u.get(n);
2752
2815
  r != null && (r.editor = {
2753
2816
  ...r.editor,
2754
2817
  phase: "failed"
2755
- }), this.#c(E(t, this.#r.t));
2818
+ }), this.#c(p(t, this.#r.t));
2756
2819
  }
2757
- this.#R({});
2820
+ this.#F();
2758
2821
  }
2759
2822
  return !1;
2760
2823
  }
2761
2824
  async moveNodes(e) {
2762
2825
  let t = this.#l.value.target;
2763
- t != null && await this.#O((n) => y(n, t, e));
2826
+ t != null && await this.#D((n) => b(n, t, e));
2764
2827
  }
2765
2828
  async moveViewport(e) {
2766
2829
  let t = this.#l.value.target;
2767
- t != null && await this.#O((n) => v(n, t, e));
2830
+ t != null && await this.#D((n) => v(n, t, e));
2768
2831
  }
2769
2832
  async check() {
2770
- await this.#k();
2833
+ await this.#O();
2771
2834
  }
2772
2835
  async refreshFlows() {
2773
2836
  await this.reloadFlows();
2774
2837
  }
2775
2838
  updateLive(e) {
2776
- e.flowId == this.#l.value.flowId && this.#R({ live: e });
2839
+ e.flowId == this.#l.value.flowId && this.#I({ live: e });
2777
2840
  }
2778
2841
  locateNode(e) {
2779
2842
  let t = this.$.revision.value, n = this.#l.value.target;
2780
- return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#R({ nodeFocus: {
2843
+ return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#I({ nodeFocus: {
2781
2844
  nodeId: e,
2782
- requestId: ++this.#y
2845
+ requestId: ++this.#v
2783
2846
  } }), !0);
2784
2847
  }
2785
2848
  locateDiagnostic(e) {
2786
- return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#R({ diagnosticFocus: {
2849
+ return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#I({ diagnosticFocus: {
2787
2850
  ...e.location,
2788
2851
  diagnostic: e.diagnostic,
2789
- requestId: ++this.#m
2852
+ requestId: ++this.#p
2790
2853
  } }), !0);
2791
2854
  }
2792
- async #w(e, t, n) {
2793
- let r = Math.max(0, ...this.#N().nodes.flatMap((e) => {
2855
+ async #C(e, t, n) {
2856
+ let r = Math.max(0, ...this.#j().nodes.flatMap((e) => {
2794
2857
  if (e.kind != "comment") return [];
2795
2858
  let t = /#(\d+)$/.exec(e.title);
2796
2859
  return t == null ? [] : [Number(t[1])];
2797
- })), i = this.#O((i) => I(i, e, t, {
2860
+ })), i = this.#D((i) => _(i, e, t, {
2798
2861
  content: "",
2799
2862
  position: n,
2800
2863
  title: this.#r.t("addNode.commentName", { number: r + 1 })
2801
2864
  }));
2802
- if (this.selectNodes([t]), await i, !this.#_) return t;
2865
+ if (this.selectNodes([t]), await i, !this.#g) return t;
2803
2866
  }
2804
- async #T(e, t = !0) {
2867
+ async #w(e, t = !0) {
2805
2868
  let n = this.#l.value.flowId, r = this.#l.value.draft;
2806
2869
  if (n != null && r != null) return e.length == 0 ? r : await this.#t.change({
2807
2870
  current: this.#n.capture(),
2808
2871
  flowId: n
2809
2872
  }, r, e, t);
2810
2873
  }
2811
- async #E(e) {
2874
+ async #T(e) {
2812
2875
  for (let t = 0; t < 2 && e(); t += 1) {
2813
2876
  let t = this.#l.value.draft;
2814
2877
  if (t == null) return;
2815
- let n = _(t.content);
2878
+ let n = Ce(t.content);
2816
2879
  if (n.length == 0) {
2817
- this.#k();
2880
+ this.#O();
2818
2881
  return;
2819
2882
  }
2820
- if (await this.#T(n, !1) != null || !e()) return;
2883
+ if (await this.#w(n, !1) != null || !e()) return;
2821
2884
  if (this.#l.value.draft?.revisionId == t.revisionId) break;
2822
2885
  }
2823
- e() && this.#k();
2886
+ e() && this.#O();
2824
2887
  }
2825
- #D(e, t = !1) {
2826
- let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#P(e), o = this.#l.value.moduleEditor;
2827
- return this.#R({
2828
- diagnostics: t ? this.#l.value.diagnostics : void 0,
2888
+ #E(e, t, n = !1) {
2889
+ let r = this.#l.value.draft, { revision: i, selectedNodeIds: a, target: o } = this.#M(e), s = this.#l.value.moduleEditor, c = s != null && (t == "external" || r != null) && sn(r, s) != "saved", l;
2890
+ return l = c ? t == "external" ? {
2891
+ ...s,
2892
+ phase: "failed"
2893
+ } : s : cn(i, o, a), this.#I({
2894
+ diagnostics: n ? this.#l.value.diagnostics : void 0,
2829
2895
  draft: e,
2830
- moduleEditor: o != null && n != null && $(n, o) != "saved" ? o : rn(r, a, i),
2831
- selectedNodeIds: i,
2832
- target: a
2833
- }), r;
2896
+ moduleEditor: l,
2897
+ selectedNodeIds: a,
2898
+ target: o
2899
+ }), c;
2834
2900
  }
2835
- async #O(e) {
2836
- if (this.#_) return;
2901
+ async #D(e) {
2902
+ if (this.#g) return;
2837
2903
  let t = this.#l.value.flowId, n = this.#l.value.presentation;
2838
2904
  t != null && n != null && await this.#a.change(t, n, this.#n.capture(), e);
2839
2905
  }
2840
- async #k() {
2841
- if (this.#_) return;
2906
+ async #O() {
2907
+ if (this.#g) return;
2842
2908
  let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
2843
2909
  if (e == null || t == null || n == null) {
2844
- n ?? this.#R({
2910
+ n ?? this.#I({
2845
2911
  checkLoading: !1,
2846
2912
  diagnostics: void 0
2847
2913
  });
2848
2914
  return;
2849
2915
  }
2850
- this.#R({
2916
+ this.#I({
2851
2917
  checkLoading: !0,
2852
2918
  diagnosticFocus: void 0
2853
2919
  });
2854
2920
  try {
2855
2921
  let n = await this.#e.checkFlow(e, t.revisionId);
2856
- if (!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
2922
+ if (!this.#g && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
2857
2923
  let e = this.#l.value.live;
2858
- this.#R({
2924
+ this.#I({
2859
2925
  diagnostics: n,
2860
2926
  live: e == null ? void 0 : {
2861
2927
  ...e,
@@ -2864,16 +2930,16 @@ var cn = class {
2864
2930
  });
2865
2931
  }
2866
2932
  } catch (n) {
2867
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(E(n, this.#r.t));
2933
+ !this.#g && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(p(n, this.#r.t));
2868
2934
  } finally {
2869
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#R({ checkLoading: !1 });
2935
+ !this.#g && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#I({ checkLoading: !1 });
2870
2936
  }
2871
2937
  }
2872
- async #A(e) {
2873
- if (this.#_) return;
2938
+ async #k(e) {
2939
+ if (this.#g) return;
2874
2940
  let t = this.#l.value.flowId;
2875
- if (t == null || (this.#h += 1, e != null && (this.#g = !0), this.#v)) return;
2876
- this.#v = !0;
2941
+ if (t == null || (this.#m += 1, e != null && (this.#h = !0), this.#_)) return;
2942
+ this.#_ = !0;
2877
2943
  let n = {
2878
2944
  current: this.#n.capture(),
2879
2945
  flowId: t
@@ -2881,83 +2947,72 @@ var cn = class {
2881
2947
  await this.#t.enqueue(async () => {
2882
2948
  let e;
2883
2949
  do {
2884
- e = this.#h;
2885
- let t = this.#g;
2886
- this.#g = !1, await this.#j(n, !1, t);
2887
- } while (this.#L(n) && e != this.#h);
2888
- }), this.#L(n) && (this.#v = !1);
2950
+ e = this.#m;
2951
+ let t = this.#h;
2952
+ this.#h = !1, await this.#A(n, !1, t);
2953
+ } while (this.#N(n) && e != this.#m);
2954
+ }), this.#N(n) && (this.#_ = !1);
2889
2955
  }
2890
- async #j(e, t, n = !1) {
2956
+ async #A(e, t, n = !1) {
2891
2957
  try {
2892
2958
  let t = this.#t.committed;
2893
2959
  if (t == null) return !1;
2894
2960
  let r = await this.#e.syncDraft(e.flowId);
2895
- if (!this.#L(e)) return !1;
2961
+ if (!this.#N(e)) return !1;
2896
2962
  let i = r.draft;
2897
2963
  if (i.revisionId == t.revisionId) return !0;
2898
- let a = this.#F(i, !1);
2899
- return this.#M(e.flowId, i.revisionId), n && this.#c({
2900
- kind: a ? "error" : "success",
2901
- message: this.#r.t(a ? "notice.moduleUpdated" : "notice.draftUpdated")
2902
- }), this.#k(), !0;
2964
+ let a = this.#t.replaceCommitted(i), o = this.#E(a, "external");
2965
+ return this.#o.advanceHead(e.flowId, i.revisionId), n && this.#c({
2966
+ kind: o ? "error" : "success",
2967
+ message: this.#r.t(o ? "notice.moduleUpdated" : "notice.draftUpdated")
2968
+ }), this.#O(), !0;
2903
2969
  } catch (n) {
2904
- return t && this.#L(e) && this.#c(E(n, this.#r.t)), !1;
2970
+ return t && this.#N(e) && this.#c(p(n, this.#r.t)), !1;
2905
2971
  }
2906
2972
  }
2907
- #M(e, t) {
2908
- this.#o.advanceHead(e, t);
2909
- }
2910
- #N() {
2973
+ #j() {
2911
2974
  let e = this.#l.value;
2912
- return b(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
2975
+ return he(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
2913
2976
  }
2914
- #P(e) {
2915
- let t = C(e), n = sn(t, this.#l.value.target);
2977
+ #M(e) {
2978
+ let t = I(e), n = dn(t, this.#l.value.target);
2916
2979
  return {
2917
2980
  revision: t,
2918
2981
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
2919
2982
  target: n
2920
2983
  };
2921
2984
  }
2922
- #F(e, t) {
2923
- let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null && $(this.#l.value.draft, r) != "saved", a = this.#P(n), o = a.target;
2924
- return this.#R({
2925
- diagnostics: t ? this.#l.value.diagnostics : void 0,
2926
- draft: n,
2927
- moduleEditor: this.#I(a.revision, o, a.selectedNodeIds),
2928
- selectedNodeIds: a.selectedNodeIds,
2929
- target: o
2930
- }), i;
2985
+ #N(e) {
2986
+ return !this.#g && e.flowId == this.#l.value.flowId && e.current();
2931
2987
  }
2932
- #I(e, t, n) {
2933
- let r = this.#l.value.moduleEditor;
2934
- return r == null || $(this.#l.value.draft, r) == "saved" ? rn(e, t, n) : {
2935
- ...r,
2936
- phase: "failed"
2988
+ #P(e) {
2989
+ let t = e == null ? void 0 : this.#u.get(e.moduleId)?.editor ?? e, n;
2990
+ return [...this.#u.values()].some((e) => e.editor.phase == "failed") ? n = "failed" : this.#u.size > 0 && (n = "saving"), {
2991
+ moduleEditor: t,
2992
+ moduleSaveStatus: n
2937
2993
  };
2938
2994
  }
2939
- #L(e) {
2940
- return !this.#_ && e.flowId == this.#l.value.flowId && e.current();
2995
+ #F() {
2996
+ this.#g || this.#l.set(this.#P(this.#l.value.moduleEditor));
2941
2997
  }
2942
- #R(e) {
2943
- if (this.#_) return;
2944
- let t = Object.hasOwn(e, "moduleEditor") ? e.moduleEditor : this.#l.value.moduleEditor, n = t == null ? void 0 : this.#u.get(t.moduleId)?.editor ?? t, r = [...this.#u.values()].some((e) => e.editor.phase == "failed") ? "failed" : this.#u.size > 0 ? "saving" : void 0;
2998
+ #I(e) {
2999
+ if (this.#g) return;
3000
+ let t = Object.hasOwn(e, "moduleEditor") ? e.moduleEditor : this.#l.value.moduleEditor;
2945
3001
  this.#l.set({
2946
3002
  ...e,
2947
- moduleEditor: n,
2948
- moduleSaveStatus: r
3003
+ ...this.#P(t)
2949
3004
  });
2950
3005
  }
2951
3006
  };
2952
3007
  //#endregion
2953
3008
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
2954
- function ln(e) {
3009
+ function pn(e) {
2955
3010
  return new Map(e.nodes.map((e) => [e.id, e]));
2956
3011
  }
2957
- function un(e, t) {
2958
- return e == null || t == null ? [] : C(e).designerInputs(t);
3012
+ function mn(e, t) {
3013
+ return e == null || t == null ? [] : I(e).designerInputs(t);
2959
3014
  }
2960
- function dn(e, t, n, r, i) {
3015
+ function hn(e, t, n, r, i) {
2961
3016
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
2962
3017
  let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
2963
3018
  return typeof a == "string" ? new Map(r.flatMap((t) => {
@@ -2965,7 +3020,7 @@ function dn(e, t, n, r, i) {
2965
3020
  return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
2966
3021
  })) : /* @__PURE__ */ new Map();
2967
3022
  }
2968
- var fn = { openExternalPage: async () => !1 }, pn = class {
3023
+ var gn = { openExternalPage: async () => !1 }, _n = class {
2969
3024
  #e;
2970
3025
  #t;
2971
3026
  #n;
@@ -2977,19 +3032,19 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
2977
3032
  #c;
2978
3033
  #l;
2979
3034
  #u;
2980
- constructor(r, i, a = F, o = P(), s = fn, c = !0) {
2981
- this.#t = new m(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = !0, this.#u = !1, this.provideAddNodeOptions = async (e, t) => await this.#d([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => {
3035
+ constructor(r, i, a = A, o = P(), s = gn, c = !0) {
3036
+ this.#t = new w(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = !0, this.#u = !1, this.provideAddNodeOptions = async (e, t) => await this.#d([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => {
2982
3037
  let t = await Promise.all([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)]);
2983
3038
  if (!(e.aborted || this.#u)) return t.flatMap((e) => e ?? []);
2984
3039
  }, this.provideAddNodeOptionChoices = async (e, t) => {
2985
3040
  if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
2986
- }, this.#e = r, this.#n = o, this.#i = c;
3041
+ }, this.#e = r, this.results = r, this.#n = o, this.#i = c;
2987
3042
  let l = (e) => {
2988
3043
  this.#u || this.#r.set(e);
2989
3044
  };
2990
- this.runs = new h(r, l, o), this.workspace = new cn(r, l, Dt, o, (e) => {
3045
+ this.runs = new g(r, l, o), this.workspace = new fn(r, l, kt, o, (e) => {
2991
3046
  e.kind == "run.created" ? this.#f(r, e) : this.runs.changed(e.runId);
2992
- }), this.connectors = new Ut(r, this.workspace, l, s, o), this.triggers = new Jt(r, this.workspace, l, s, o), this.publications = new jt(r, this.workspace, l, i, a, o), this.runRequests = new It(r, this.runs, l, async (e) => {
3047
+ }), this.connectors = new qt(r, this.workspace, l, s, o), this.triggers = new Zt(r, this.workspace, l, s, o), this.publications = new Nt(r, this.workspace, l, i, a, o), this.runRequests = new Bt(r, this.runs, l, async (e) => {
2993
3048
  if (!(e != this.workspace.$.flowId.value || !await this.workspace.saveModuleEditor() || this.#u || e != this.workspace.$.flowId.value)) return this.workspace.$.draft.value?.revisionId;
2994
3049
  }, o, a);
2995
3050
  let u = n((e) => {
@@ -3001,30 +3056,30 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3001
3056
  diagnostics: [...t.diagnostics, ...n],
3002
3057
  valid: !1
3003
3058
  };
3004
- }), d = /* @__PURE__ */ new Map(), f, p = n((e) => {
3059
+ }), p = /* @__PURE__ */ new Map(), m, h = n((e) => {
3005
3060
  let t = e(this.workspace.$.draft);
3006
- f != t?.flowId && (d.clear(), f = t?.flowId);
3007
- let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), p = e(this.runs.$.events), m = e(this.#a), h = e(this.#o), g = e(this.#s), _ = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, v = [
3008
- ...un(t, n),
3009
- r == null || n == null ? void 0 : x(r, n),
3061
+ m != t?.flowId && (p.clear(), m = t?.flowId);
3062
+ let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(u)?.diagnostics ?? e(this.connectors.$.diagnostics), a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), f = e(this.runs.$.events), h = e(this.#a), g = e(this.#o), _ = e(this.#s), v = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, y = [
3063
+ ...mn(t, n),
3064
+ r == null || n == null ? void 0 : d(r, n),
3010
3065
  i,
3011
3066
  a,
3012
3067
  s,
3013
3068
  c,
3014
3069
  l,
3015
- p,
3016
- m,
3070
+ f,
3017
3071
  h,
3018
3072
  g,
3073
+ _,
3019
3074
  ...l == null ? [] : [t?.revisionId]
3020
- ], y = d.get(_);
3021
- if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
3022
- let S = b(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
3023
- return d.set(_, {
3024
- graph: S,
3025
- inputs: v
3026
- }), S;
3027
- }), g = e(p, ln);
3075
+ ], b = p.get(v);
3076
+ if (b != null && b.inputs.length == y.length && b.inputs.every((e, t) => e === y[t])) return b.graph;
3077
+ let x = he(t, n, r, i, a, s, c, l, f, h, g, _, this.#i);
3078
+ return p.set(v, {
3079
+ graph: x,
3080
+ inputs: y
3081
+ }), x;
3082
+ }), _ = e(h, pn);
3028
3083
  this.$ = {
3029
3084
  busy: n((e) => {
3030
3085
  let t = e(this.workspace.$.busy);
@@ -3035,15 +3090,15 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3035
3090
  if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
3036
3091
  if (e(this.publications.$.changingTriggerId) != null) return "trigger";
3037
3092
  }),
3038
- diagnosticItems: n((e) => D(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
3093
+ diagnosticItems: n((e) => f(e(this.workspace.$.revision), e(this.workspace.$.target), e(u))),
3039
3094
  diagnostics: u,
3040
- designer: p,
3041
- designerNodeById: g,
3095
+ designer: h,
3096
+ designerNodeById: _,
3042
3097
  notice: this.#r,
3043
- runEventNodes: n((e) => dn(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(g))),
3098
+ runEventNodes: n((e) => hn(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(_))),
3044
3099
  selectedDesignerNode: n((e) => {
3045
3100
  let t = e(this.workspace.$.selectedNodeIds);
3046
- return t.length == 1 ? e(g).get(t[0]) : void 0;
3101
+ return t.length == 1 ? e(_).get(t[0]) : void 0;
3047
3102
  }),
3048
3103
  variableNames: this.#a,
3049
3104
  variableNamesLoaded: this.#o,
@@ -3076,7 +3131,7 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3076
3131
  if (this.#u) return;
3077
3132
  this.#a.set(e.map((e) => e.name)), this.#o.set(!0);
3078
3133
  } catch (e) {
3079
- this.#c = !0, this.#u || this.#r.set(E(e, this.#n.t));
3134
+ this.#c = !0, this.#u || this.#r.set(p(e, this.#n.t));
3080
3135
  } finally {
3081
3136
  this.#l = void 0, this.#u || this.#s.set(!1);
3082
3137
  }
@@ -3121,7 +3176,7 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3121
3176
  if (t.aborted || this.#u) return;
3122
3177
  let r = n.filter((e) => e.status == "rejected");
3123
3178
  if (r.length > 0 && r.length == n.length) throw r[0].reason;
3124
- return r.length > 0 && this.#r.set(E(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3179
+ return r.length > 0 && this.#r.set(p(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3125
3180
  }
3126
3181
  async refreshSelectedConnector(e = !1) {
3127
3182
  await this.connectors.refresh(e);
@@ -3132,6 +3187,12 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3132
3187
  let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
3133
3188
  return n == null || r == null ? "unavailable" : await this.runRequests.requestDraft(n, r, e);
3134
3189
  }
3190
+ async editDraftRunInputs(e) {
3191
+ let t = this.workspace.$.flowId.value;
3192
+ if (!await this.workspace.saveModuleEditor() || this.#u || t != this.workspace.$.flowId.value) return "unavailable";
3193
+ let n = this.workspace.$.targetFlow.value, r = this.workspace.$.draft.value;
3194
+ return n == null || r == null ? "unavailable" : await this.runRequests.editDraft(n, r, e);
3195
+ }
3135
3196
  async requestLiveRun() {
3136
3197
  let e = this.workspace.$.targetFlow.value;
3137
3198
  return e == null ? "unavailable" : await this.runRequests.requestLive(e);
@@ -3148,13 +3209,13 @@ var fn = { openExternalPage: async () => !1 }, pn = class {
3148
3209
  return;
3149
3210
  }
3150
3211
  }
3151
- }, mn = ot(() => import("./flowWorkspace-BLGcgnHj.js").then((e) => e.t));
3152
- function hn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: c }) {
3153
- let l = s != null && c != null && i != null, u = s ?? "", d = /* @__PURE__ */ J(st, { children: [
3154
- /* @__PURE__ */ q("div", {
3212
+ }, vn = ct(() => import("./flowWorkspace-BhpxeXhY.js").then((e) => e.t));
3213
+ function yn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: c }) {
3214
+ let l = s != null && c != null && i != null, u = s ?? "", d = /* @__PURE__ */ K(lt, { children: [
3215
+ /* @__PURE__ */ G("div", {
3155
3216
  "aria-hidden": "true",
3156
3217
  className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
3157
- children: /* @__PURE__ */ J("svg", {
3218
+ children: /* @__PURE__ */ K("svg", {
3158
3219
  className: "size-5",
3159
3220
  fill: "none",
3160
3221
  stroke: "currentColor",
@@ -3162,40 +3223,40 @@ function hn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
3162
3223
  strokeLinejoin: "round",
3163
3224
  strokeWidth: "1.8",
3164
3225
  viewBox: "0 0 24 24",
3165
- children: [/* @__PURE__ */ q("rect", {
3226
+ children: [/* @__PURE__ */ G("rect", {
3166
3227
  height: "9",
3167
3228
  rx: "2",
3168
3229
  width: "14",
3169
3230
  x: "5",
3170
3231
  y: "11"
3171
- }), /* @__PURE__ */ q("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
3232
+ }), /* @__PURE__ */ G("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
3172
3233
  })
3173
3234
  }),
3174
- /* @__PURE__ */ J("header", {
3235
+ /* @__PURE__ */ K("header", {
3175
3236
  className: "flex flex-col gap-2",
3176
- children: [/* @__PURE__ */ q("h1", {
3237
+ children: [/* @__PURE__ */ G("h1", {
3177
3238
  className: "text-xl font-semibold tracking-tight text-balance",
3178
3239
  children: o
3179
- }), /* @__PURE__ */ q("p", {
3240
+ }), /* @__PURE__ */ G("p", {
3180
3241
  className: "text-sm/relaxed text-muted-foreground text-pretty",
3181
3242
  children: t
3182
3243
  })]
3183
3244
  }),
3184
- l && /* @__PURE__ */ q(Pe, { children: /* @__PURE__ */ J(Re, {
3245
+ l && /* @__PURE__ */ G(He, { children: /* @__PURE__ */ K(Le, {
3185
3246
  "data-invalid": n != null,
3186
3247
  children: [
3187
- /* @__PURE__ */ q(Ve, {
3248
+ /* @__PURE__ */ G(Ue, {
3188
3249
  htmlFor: "session-token",
3189
3250
  children: c
3190
3251
  }),
3191
- /* @__PURE__ */ q(V, {
3252
+ /* @__PURE__ */ G(R, {
3192
3253
  autoComplete: "username",
3193
3254
  name: "username",
3194
3255
  type: "hidden",
3195
3256
  value: "open-flow",
3196
3257
  readOnly: !0
3197
3258
  }),
3198
- /* @__PURE__ */ q(V, {
3259
+ /* @__PURE__ */ G(R, {
3199
3260
  autoComplete: "current-password",
3200
3261
  "aria-invalid": n != null,
3201
3262
  autoFocus: !0,
@@ -3207,29 +3268,29 @@ function hn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
3207
3268
  type: "password",
3208
3269
  value: u
3209
3270
  }),
3210
- n != null && /* @__PURE__ */ q(Fe, { children: n })
3271
+ n != null && /* @__PURE__ */ G(ze, { children: n })
3211
3272
  ]
3212
3273
  }) }),
3213
- e != null && r != null && /* @__PURE__ */ J(B, {
3274
+ e != null && r != null && /* @__PURE__ */ K(L, {
3214
3275
  disabled: a || l && u.length == 0,
3215
3276
  size: "lg",
3216
3277
  type: "submit",
3217
- children: [a && /* @__PURE__ */ q(Le, {
3278
+ children: [a && /* @__PURE__ */ G(Be, {
3218
3279
  "aria-label": e,
3219
3280
  "data-icon": "inline-start"
3220
3281
  }), e]
3221
3282
  }),
3222
- a && e == null && /* @__PURE__ */ q(Le, { "aria-label": t })
3283
+ a && e == null && /* @__PURE__ */ G(Be, { "aria-label": t })
3223
3284
  ] }), f = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
3224
- return /* @__PURE__ */ q("main", {
3285
+ return /* @__PURE__ */ G("main", {
3225
3286
  className: "open-flow-workbench",
3226
- children: /* @__PURE__ */ q("div", {
3287
+ children: /* @__PURE__ */ G("div", {
3227
3288
  className: "grid h-full overflow-auto bg-muted/20 p-4",
3228
- children: r == null ? /* @__PURE__ */ q("section", {
3289
+ children: r == null ? /* @__PURE__ */ G("section", {
3229
3290
  "aria-busy": a,
3230
3291
  className: f,
3231
3292
  children: d
3232
- }) : /* @__PURE__ */ q("form", {
3293
+ }) : /* @__PURE__ */ G("form", {
3233
3294
  "aria-busy": a,
3234
3295
  className: f,
3235
3296
  onSubmit: r,
@@ -3238,15 +3299,15 @@ function hn({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
3238
3299
  })
3239
3300
  });
3240
3301
  }
3241
- function gn({ host: e, store: t }) {
3302
+ function bn({ host: e, store: t }) {
3242
3303
  let n = a(t.$.notice);
3243
- return W(() => e.notify(n), [e, n]), W(() => () => e.notify(void 0), [e]), null;
3304
+ return H(() => e.notify(n), [e, n]), H(() => () => e.notify(void 0), [e]), null;
3244
3305
  }
3245
- function _n({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
3306
+ function xn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, hrefFor: o, hostAction: s, hostTitle: c, language: l, navigation: u, onConfigureConnector: d, onHostAction: f, onLanguageChange: p, store: m, theme: h }) {
3246
3307
  let g = a(m.workspace.$.flowId);
3247
- return /* @__PURE__ */ q("div", {
3308
+ return /* @__PURE__ */ G("div", {
3248
3309
  className: "app-shell",
3249
- children: g == null ? /* @__PURE__ */ q(vt, {
3310
+ children: g == null ? /* @__PURE__ */ G(bt, {
3250
3311
  catalogWidth: e,
3251
3312
  createFlowDisabled: n,
3252
3313
  createFlowField: r,
@@ -3263,12 +3324,12 @@ function _n({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3263
3324
  onLanguageChange: p,
3264
3325
  onSelectFlow: (e) => void u.selectFlow(e),
3265
3326
  store: m
3266
- }) : /* @__PURE__ */ q(at, {
3267
- fallback: /* @__PURE__ */ q("main", {
3327
+ }) : /* @__PURE__ */ G(st, {
3328
+ fallback: /* @__PURE__ */ G("main", {
3268
3329
  "aria-busy": "true",
3269
3330
  className: "workspace"
3270
3331
  }),
3271
- children: /* @__PURE__ */ q(mn, {
3332
+ children: /* @__PURE__ */ G(vn, {
3272
3333
  hostAction: s,
3273
3334
  hostTitle: c,
3274
3335
  hrefFor: o,
@@ -3281,18 +3342,18 @@ function _n({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3281
3342
  })
3282
3343
  });
3283
3344
  }
3284
- function vn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: p, onLanguageChange: m, onNavigate: h, preferences: g, theme: _, variables: v = !0 }) {
3285
- let y = G(h);
3345
+ function Sn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowField: r, flowBadges: i, host: a, hostAction: s, hostTitle: c, hrefFor: l, language: u, location: d, onConfigureConnector: f, onHostAction: p, onLanguageChange: m, onNavigate: h, preferences: g, theme: _, variables: v = !0 }) {
3346
+ let y = U(h);
3286
3347
  y.current = h;
3287
- let [{ i18n: b, navigation: x, store: S }] = K(() => {
3288
- let e = P(u), t = new pn(new ye((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, F, e, a, v);
3348
+ let [{ i18n: b, navigation: x, store: S }] = W(() => {
3349
+ let e = P(u), t = new _n(new ye((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, A, e, a, v);
3289
3350
  return {
3290
3351
  i18n: e,
3291
- navigation: new dt(t, d, (e, t) => y.current(e, t)),
3352
+ navigation: new pt(t, d, (e, t) => y.current(e, t)),
3292
3353
  store: t
3293
3354
  };
3294
3355
  });
3295
- return W(() => {
3356
+ return H(() => {
3296
3357
  x.start();
3297
3358
  let e = () => {
3298
3359
  S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.invalidateVariableNames();
@@ -3304,17 +3365,17 @@ function vn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3304
3365
  b,
3305
3366
  x,
3306
3367
  S
3307
- ]), W(() => void x.apply(d), [d, x]), W(() => {
3368
+ ]), H(() => void x.apply(d), [d, x]), H(() => {
3308
3369
  b.lang != u && b.switchLang(u);
3309
- }, [b, u]), /* @__PURE__ */ q(o, {
3370
+ }, [b, u]), /* @__PURE__ */ G(o, {
3310
3371
  i18n: b,
3311
- children: /* @__PURE__ */ J("div", {
3372
+ children: /* @__PURE__ */ K("div", {
3312
3373
  className: "open-flow-theme open-flow-workbench",
3313
3374
  "data-theme": _,
3314
- children: [/* @__PURE__ */ q(gn, {
3375
+ children: [/* @__PURE__ */ G(bn, {
3315
3376
  host: a,
3316
3377
  store: S
3317
- }), /* @__PURE__ */ q(_n, {
3378
+ }), /* @__PURE__ */ G(xn, {
3318
3379
  catalogWidth: e,
3319
3380
  createFlow: t,
3320
3381
  createFlowDisabled: n,
@@ -3334,8 +3395,8 @@ function vn({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3334
3395
  })
3335
3396
  });
3336
3397
  }
3337
- function yn({ sessionKey: e, ...t }) {
3338
- return /* @__PURE__ */ q(vn, { ...t }, e);
3398
+ function Cn({ sessionKey: e, ...t }) {
3399
+ return /* @__PURE__ */ G(Sn, { ...t }, e);
3339
3400
  }
3340
3401
  //#endregion
3341
- export { hn as OpenFlowSessionGate, yn as OpenFlowWorkbench, Xe as isWorkbenchLanguage, Je as resolveWorkbenchLanguage, Ye as workbenchLanguageNames, qe as workbenchLanguages };
3402
+ export { yn as OpenFlowSessionGate, Cn as OpenFlowWorkbench, at as isWorkbenchLanguage, it as resolveWorkbenchLanguage, V as workbenchLanguageNames, rt as workbenchLanguages };