@oomol-lab/open-flow 0.1.0-beta.4 → 0.1.0-beta.5

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 (34) hide show
  1. package/dist/browser/{DesignerIcon-DdfuH2jW.js → DesignerIcon-XKBRy_0Q.js} +640 -640
  2. package/dist/browser/createResourceDialog-Cf7QpXp6.js +505 -0
  3. package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
  4. package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
  5. package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
  6. package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
  7. package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
  8. package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
  9. package/dist/browser/dist-DxahK_I8.js +2688 -0
  10. package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
  11. package/dist/browser/{esm-C9jQK70n.js → esm-xWDFFpGd.js} +5 -6
  12. package/dist/browser/flow-authoring-module.d.ts +2 -2
  13. package/dist/browser/flow-authoring-node.d.ts +2 -2
  14. package/dist/browser/flow-authoring.js +469 -209
  15. package/dist/browser/flow-change.d.ts +96 -8
  16. package/dist/browser/flow-change.js +319 -96
  17. package/dist/browser/{flowChanges-Bs-ZcJV8.js → flowChanges-CeMiiZIO.js} +1578 -1541
  18. package/dist/browser/{flowRunInputEditorStore-BYa8zFLC.js → flowRunInputEditorStore-DDidwd8h.js} +9 -1
  19. package/dist/browser/{flowWorkspace-BewofPeU.js → flowWorkspace-VnS8nLMT.js} +9354 -9349
  20. package/dist/browser/{getPseudoElementBounds-qDxSDwzN.js → getPseudoElementBounds-5LArT6Xc.js} +494 -474
  21. package/dist/browser/icons-CRxvozBE.js +726 -0
  22. package/dist/browser/{typeScriptSession-CwMPjseS.js → typeScriptSession-Bj2HDFRd.js} +255 -256
  23. package/dist/browser/{waitNotificationInputs-DtrPBwA1.js → waitNotificationInputs-ClCAEIAM.js} +2 -2
  24. package/dist/browser/workbench.css +1 -1
  25. package/dist/browser/workbench.js +547 -611
  26. package/dist/browser/{workbenchSelect-CX8KtT7L.js → workbenchSelect-Cf1zlVm9.js} +398 -398
  27. package/dist/common/control-api-conformance.js +21 -19
  28. package/dist/common/control-api.d.ts +4 -11
  29. package/dist/common/control-api.js +6 -18
  30. package/package.json +1 -1
  31. package/dist/browser/createResourceDialog-4YQKl8lG.js +0 -505
  32. package/dist/browser/dist-BpopSHwP.js +0 -1543
  33. package/dist/browser/dist-CUSrALSX.js +0 -1620
  34. package/dist/browser/icons-DRoMXL5h.js +0 -521
@@ -1,14 +1,14 @@
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 { At as s, Bn as c, Hn as l } from "./getPseudoElementBounds-qDxSDwzN.js";
4
- import { a as u, d, f, i as p, l as m, r as h, s as g, t as _, u as v } from "./icons-DRoMXL5h.js";
5
- import { t as y } from "./workbenchSelect-CX8KtT7L.js";
6
- import { $ as b, A as x, C as S, D as C, E as w, F as T, G as E, H as D, I as O, J as ee, M as k, N as A, O as j, P as M, Q as N, S as P, U as F, V as I, W as te, X as ne, Y as re, Z as ie, _ as ae, a as oe, at as se, b as ce, c as le, ct as ue, d as de, dt as fe, et as pe, f as me, ft as L, g as he, h as ge, i as _e, it as ve, j as R, l as ye, lt as be, m as xe, mt as z, n as B, nt as Se, o as Ce, ot as we, p as Te, pt as Ee, q as De, rt as Oe, s as ke, st as Ae, t as je, tt as V, u as Me, ut as Ne, v as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./flowChanges-Bs-ZcJV8.js";
7
- import { a as ze, i as Be, n as Ve, r as He } from "./languages-DgJehE1g.js";
8
- import { Suspense as Ue, lazy as We, useEffect as H, useRef as Ge, useState as U } from "react";
9
- import { Fragment as Ke, jsx as W, jsxs as G } from "react/jsx-runtime";
3
+ import { Un as s, Vn as c, jt as l } from "./getPseudoElementBounds-5LArT6Xc.js";
4
+ import { a as u, c as d, d as f, f as p, i as m, n as h, o as g, p as _, t as v, u as y } from "./icons-CRxvozBE.js";
5
+ import { t as b } from "./workbenchSelect-Cf1zlVm9.js";
6
+ import { $ as x, A as S, C as ee, D as C, E as w, F as T, G as E, H as D, I as O, J as k, M as A, N as j, O as M, P as N, Q as P, S as F, U as I, V as L, W as te, X as ne, Y as re, Z as ie, _ as ae, a as oe, at as se, b as ce, c as le, ct as ue, d as de, dt as fe, et as pe, f as me, ft as R, g as he, h as ge, i as _e, it as ve, j as z, l as ye, lt as be, m as xe, mt as B, n as V, nt as Se, o as Ce, ot as we, p as Te, pt as Ee, q as De, rt as Oe, s as ke, st as Ae, t as je, tt as H, u as Me, ut as U, v as Ne, w as Pe, x as Fe, y as Ie, z as Le } from "./flowChanges-CeMiiZIO.js";
7
+ import { a as Re, i as ze, n as Be, r as Ve } from "./languages-DgJehE1g.js";
8
+ import { Suspense as He, lazy as Ue, useEffect as W, useRef as We, useState as G } from "react";
9
+ import { Fragment as Ge, jsx as K, jsxs as q } from "react/jsx-runtime";
10
10
  //#region src/workbench/browser/runtime/navigation.ts
11
- var qe = class {
11
+ var Ke = class {
12
12
  #e;
13
13
  #t;
14
14
  #n;
@@ -67,7 +67,7 @@ var qe = class {
67
67
  this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
68
68
  }
69
69
  async apply(e) {
70
- if (Je(e, this.#t)) return;
70
+ if (qe(e, this.#t)) return;
71
71
  this.#t = e;
72
72
  let t = ++this.#i;
73
73
  this.#s = !0;
@@ -83,49 +83,49 @@ var qe = class {
83
83
  flowId: this.#n.workspace.$.flowId.value,
84
84
  view: e
85
85
  };
86
- Je(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
86
+ qe(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
87
87
  }
88
88
  };
89
- function Je(e, t) {
89
+ function qe(e, t) {
90
90
  return e.flowId == t.flowId && e.view == t.view;
91
91
  }
92
92
  //#endregion
93
93
  //#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
94
- var Ye = We(() => import("./createResourceDialog-4YQKl8lG.js")), Xe = ze.map((e) => ({
95
- label: Be[e],
94
+ var Je = Ue(() => import("./createResourceDialog-Cf7QpXp6.js")), Ye = Re.map((e) => ({
95
+ label: ze[e],
96
96
  value: e
97
97
  }));
98
- function Ze({ language: e, onLanguageChange: t }) {
99
- let n = r(), [i, a] = U(null);
100
- return t == null ? null : /* @__PURE__ */ G("div", {
98
+ function Xe({ language: e, onLanguageChange: t }) {
99
+ let n = r(), [i, a] = G(null);
100
+ return t == null ? null : /* @__PURE__ */ q("div", {
101
101
  className: "resource-language",
102
102
  ref: a,
103
- children: [/* @__PURE__ */ W("span", {
103
+ children: [/* @__PURE__ */ K("span", {
104
104
  className: "sr-only",
105
105
  children: n("language.label")
106
- }), /* @__PURE__ */ W(y, {
106
+ }), /* @__PURE__ */ K(b, {
107
107
  ariaLabel: n("language.label"),
108
108
  onValueChange: (e) => t(e),
109
- options: Xe,
109
+ options: Ye,
110
110
  portalRoot: i,
111
111
  value: e
112
112
  })]
113
113
  });
114
114
  }
115
- function Qe({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: u }) {
116
- let d = i(), m = r(), [h, g] = U("idle"), [v, y] = U(n.name), b = p(v);
115
+ function Ze({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: d }) {
116
+ let f = i(), p = r(), [m, h] = G("idle"), [g, y] = G(n.name), b = u(g);
117
117
  async function x(e) {
118
118
  e.preventDefault();
119
- let t = v.trim();
120
- p(t) == null && await u.workspace.renameFlow(n.flowId, t) && g("idle");
119
+ let t = g.trim();
120
+ u(t) == null && await d.workspace.renameFlow(n.flowId, t) && h("idle");
121
121
  }
122
122
  async function S() {
123
- await u.workspace.deleteFlow(n.flowId) && g("idle");
123
+ await d.workspace.deleteFlow(n.flowId) && h("idle");
124
124
  }
125
- return /* @__PURE__ */ G("div", {
125
+ return /* @__PURE__ */ q("div", {
126
126
  className: "resource-item-row",
127
127
  children: [
128
- /* @__PURE__ */ G(c, {
128
+ /* @__PURE__ */ q(c, {
129
129
  "aria-disabled": n.status == "retiring",
130
130
  className: "resource-list-row flow-columns",
131
131
  nativeButton: !1,
@@ -136,188 +136,188 @@ function Qe({ badge: e, busy: t, flow: n, href: a, onSelect: o, store: u }) {
136
136
  }
137
137
  pe(e, () => o(n));
138
138
  },
139
- render: /* @__PURE__ */ W("a", { href: n.status == "retiring" ? void 0 : a }),
139
+ render: /* @__PURE__ */ K("a", { href: n.status == "retiring" ? void 0 : a }),
140
140
  tabIndex: n.status == "retiring" ? -1 : void 0,
141
141
  variant: "ghost",
142
142
  children: [
143
- /* @__PURE__ */ G("span", {
143
+ /* @__PURE__ */ q("span", {
144
144
  className: "resource-primary-cell",
145
- children: [/* @__PURE__ */ W("span", {
145
+ children: [/* @__PURE__ */ K("span", {
146
146
  className: "resource-icon",
147
- children: /* @__PURE__ */ W(_, { name: "flow" })
148
- }), /* @__PURE__ */ G("span", { children: [/* @__PURE__ */ G("span", {
147
+ children: /* @__PURE__ */ K(v, { name: "flow" })
148
+ }), /* @__PURE__ */ q("span", { children: [/* @__PURE__ */ q("span", {
149
149
  className: "flex min-w-0 items-center gap-2",
150
- children: [/* @__PURE__ */ W("strong", {
150
+ children: [/* @__PURE__ */ K("strong", {
151
151
  className: "min-w-0 truncate",
152
152
  children: n.name
153
- }), e != null && /* @__PURE__ */ W(fe, {
153
+ }), e != null && /* @__PURE__ */ K(fe, {
154
154
  className: "min-w-0 shrink",
155
155
  title: e,
156
156
  variant: "secondary",
157
- children: /* @__PURE__ */ W("span", {
157
+ children: /* @__PURE__ */ K("span", {
158
158
  className: "truncate",
159
159
  children: e
160
160
  })
161
161
  })]
162
- }), /* @__PURE__ */ W("code", {
162
+ }), /* @__PURE__ */ K("code", {
163
163
  translate: "no",
164
164
  children: n.flowId
165
165
  })] })]
166
166
  }),
167
- /* @__PURE__ */ W("time", {
167
+ /* @__PURE__ */ K("time", {
168
168
  dateTime: n.updatedAt,
169
- children: new Date(n.updatedAt).toLocaleString(d)
169
+ children: new Date(n.updatedAt).toLocaleString(f)
170
170
  }),
171
- /* @__PURE__ */ G("span", {
171
+ /* @__PURE__ */ q("span", {
172
172
  className: `resource-status ${n.status == "active" ? "active" : "warning"}`,
173
- children: [/* @__PURE__ */ W("span", {
173
+ children: [/* @__PURE__ */ K("span", {
174
174
  "aria-hidden": "true",
175
175
  className: `status-dot ${n.status == "active" ? "success" : "running"}`
176
- }), m(n.status == "active" ? "resource.active" : "resource.retiring")]
176
+ }), p(n.status == "active" ? "resource.active" : "resource.retiring")]
177
177
  })
178
178
  ]
179
179
  }),
180
- n.status == "active" && /* @__PURE__ */ W(c, {
181
- "aria-expanded": h != "idle",
182
- "aria-label": m("sidebar.flowActions", { name: n.name }),
183
- className: l("resource-row-more", h != "idle" && "active"),
180
+ n.status == "active" && /* @__PURE__ */ K(c, {
181
+ "aria-expanded": m != "idle",
182
+ "aria-label": p("sidebar.flowActions", { name: n.name }),
183
+ className: s("resource-row-more", m != "idle" && "active"),
184
184
  disabled: t != null,
185
- onClick: () => g(h == "idle" ? "actions" : "idle"),
185
+ onClick: () => h(m == "idle" ? "actions" : "idle"),
186
186
  size: "icon-sm",
187
187
  variant: "ghost",
188
- children: /* @__PURE__ */ W(_, { name: "more" })
188
+ children: /* @__PURE__ */ K(v, { name: "more" })
189
189
  }),
190
- h == "actions" && /* @__PURE__ */ G("div", {
190
+ m == "actions" && /* @__PURE__ */ q("div", {
191
191
  className: "resource-row-actions",
192
- children: [/* @__PURE__ */ W(c, {
192
+ children: [/* @__PURE__ */ K(c, {
193
193
  onClick: () => {
194
- y(n.name), g("rename");
194
+ y(n.name), h("rename");
195
195
  },
196
196
  size: "sm",
197
197
  variant: "outline",
198
- children: m("common.rename")
199
- }), /* @__PURE__ */ W(c, {
200
- onClick: () => g("delete"),
198
+ children: p("common.rename")
199
+ }), /* @__PURE__ */ K(c, {
200
+ onClick: () => h("delete"),
201
201
  size: "sm",
202
202
  variant: "destructive",
203
- children: m("common.delete")
203
+ children: p("common.delete")
204
204
  })]
205
205
  }),
206
- h == "rename" && /* @__PURE__ */ G("form", {
206
+ m == "rename" && /* @__PURE__ */ q("form", {
207
207
  className: "resource-row-form",
208
208
  onSubmit: (e) => void x(e),
209
209
  children: [
210
- /* @__PURE__ */ W(f, {
210
+ /* @__PURE__ */ K(_, {
211
211
  htmlFor: `rename-flow-${n.flowId}`,
212
- children: m("sidebar.renameFlow", { name: n.name })
212
+ children: p("sidebar.renameFlow", { name: n.name })
213
213
  }),
214
- /* @__PURE__ */ G("span", {
214
+ /* @__PURE__ */ q("span", {
215
215
  className: "resource-row-field",
216
- children: [/* @__PURE__ */ W(s, {
216
+ children: [/* @__PURE__ */ K(l, {
217
217
  autoComplete: "off",
218
- "aria-invalid": v.length > 0 && b != null,
218
+ "aria-invalid": g.length > 0 && b != null,
219
219
  autoFocus: !0,
220
220
  id: `rename-flow-${n.flowId}`,
221
221
  name: "flow-name",
222
222
  onChange: (e) => y(e.target.value),
223
223
  required: !0,
224
- value: v
225
- }), v.length > 0 && b != null && /* @__PURE__ */ W("small", {
224
+ value: g
225
+ }), g.length > 0 && b != null && /* @__PURE__ */ K("small", {
226
226
  className: "resource-name-message error",
227
- children: m(`resource.nameIssue.${b}`, { max: 80 })
227
+ children: p(`resource.nameIssue.${b}`, { max: 80 })
228
228
  })]
229
229
  }),
230
- /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(c, {
231
- onClick: () => g("idle"),
230
+ /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
231
+ onClick: () => h("idle"),
232
232
  size: "sm",
233
233
  variant: "outline",
234
- children: m("common.cancel")
235
- }), /* @__PURE__ */ W(c, {
234
+ children: p("common.cancel")
235
+ }), /* @__PURE__ */ K(c, {
236
236
  disabled: t != null || b != null,
237
237
  size: "sm",
238
238
  type: "submit",
239
- children: m("common.save")
239
+ children: p("common.save")
240
240
  })] })
241
241
  ]
242
242
  }),
243
- h == "delete" && /* @__PURE__ */ G("div", {
243
+ m == "delete" && /* @__PURE__ */ q("div", {
244
244
  className: "resource-row-confirm",
245
245
  role: "group",
246
- "aria-label": m("sidebar.deleteFlow", { name: n.name }),
247
- children: [/* @__PURE__ */ W("span", { children: /* @__PURE__ */ W("strong", { children: m("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(c, {
248
- onClick: () => g("idle"),
246
+ "aria-label": p("sidebar.deleteFlow", { name: n.name }),
247
+ children: [/* @__PURE__ */ K("span", { children: /* @__PURE__ */ K("strong", { children: p("sidebar.deleteFlowConfirm", { name: n.name }) }) }), /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K(c, {
248
+ onClick: () => h("idle"),
249
249
  size: "sm",
250
250
  variant: "outline",
251
- children: m("common.cancel")
252
- }), /* @__PURE__ */ W(c, {
251
+ children: p("common.cancel")
252
+ }), /* @__PURE__ */ K(c, {
253
253
  disabled: t != null,
254
254
  onClick: () => void S(),
255
255
  size: "sm",
256
256
  variant: "destructive",
257
- children: m(t == "flow" ? "common.deleting" : "common.delete")
257
+ children: p(t == "flow" ? "common.deleting" : "common.delete")
258
258
  })] })]
259
259
  })
260
260
  ]
261
261
  });
262
262
  }
263
- function $e() {
264
- return /* @__PURE__ */ G("div", {
263
+ function Qe() {
264
+ return /* @__PURE__ */ q("div", {
265
265
  "aria-hidden": "true",
266
266
  className: "resource-list-row resource-skeleton-row flow-columns",
267
267
  children: [
268
- /* @__PURE__ */ G("span", {
268
+ /* @__PURE__ */ q("span", {
269
269
  className: "resource-primary-cell",
270
- children: [/* @__PURE__ */ W(V, { className: "size-8 shrink-0" }), /* @__PURE__ */ G("span", {
270
+ children: [/* @__PURE__ */ K(H, { className: "size-8 shrink-0" }), /* @__PURE__ */ q("span", {
271
271
  className: "resource-skeleton-copy",
272
- children: [/* @__PURE__ */ W(V, { className: "h-3.5 w-36" }), /* @__PURE__ */ W(V, { className: "h-2.5 w-48 max-w-full" })]
272
+ children: [/* @__PURE__ */ K(H, { className: "h-3.5 w-36" }), /* @__PURE__ */ K(H, { className: "h-2.5 w-48 max-w-full" })]
273
273
  })]
274
274
  }),
275
- /* @__PURE__ */ W(V, { className: "h-3 w-28" }),
276
- /* @__PURE__ */ W(V, { className: "h-3 w-16" })
275
+ /* @__PURE__ */ K(H, { className: "h-3 w-28" }),
276
+ /* @__PURE__ */ K(H, { className: "h-3 w-16" })
277
277
  ]
278
278
  });
279
279
  }
280
- function et({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: s, hostTitle: u, language: d, onCreateFlow: f, onHostAction: m, onLanguageChange: h, onSelectFlow: g, store: v }) {
281
- let y = r(), x = a(v.workspace.$.busy), S = a(v.workspace.$.flowLoadFailed), C = a(v.workspace.$.flowLoadMoreFailed), w = a(v.workspace.$.flowLoading), T = a(v.workspace.$.flowLoadingMore), E = a(v.workspace.$.flowNextCursor), D = a(v.workspace.$.flows), O = a(v.workspace.$.flowTotal), [ee, k] = U(!1), [A, j] = U(""), [M, N] = U(""), P = A.trim().toLocaleLowerCase(), F = D.filter((e) => e.name.toLocaleLowerCase().includes(P));
280
+ function $e({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBadges: i, hrefForFlow: o, hostAction: l, hostTitle: d, language: f, onCreateFlow: p, onHostAction: m, onLanguageChange: h, onSelectFlow: g, store: _ }) {
281
+ let y = r(), b = a(_.workspace.$.busy), S = a(_.workspace.$.flowLoadFailed), ee = a(_.workspace.$.flowLoadMoreFailed), C = a(_.workspace.$.flowLoading), w = a(_.workspace.$.flowLoadingMore), T = a(_.workspace.$.flowNextCursor), E = a(_.workspace.$.flows), D = a(_.workspace.$.flowTotal), [O, k] = G(!1), [A, j] = G(""), [M, N] = G(""), P = A.trim().toLocaleLowerCase(), F = E.filter((e) => e.name.toLocaleLowerCase().includes(P));
282
282
  async function I(e) {
283
283
  e.preventDefault();
284
284
  let t = M.trim();
285
- p(t) != null || !await f(t) || (k(!1), N(""));
285
+ u(t) != null || !await p(t) || (k(!1), N(""));
286
286
  }
287
- return /* @__PURE__ */ W("main", {
287
+ return /* @__PURE__ */ K("main", {
288
288
  className: "resource-browser",
289
- children: /* @__PURE__ */ G("div", {
290
- className: l("resource-page", e != "default" && "resource-page-full"),
289
+ children: /* @__PURE__ */ q("div", {
290
+ className: s("resource-page", e != "default" && "resource-page-full"),
291
291
  children: [
292
- /* @__PURE__ */ W("h1", {
292
+ /* @__PURE__ */ K("h1", {
293
293
  className: "sr-only",
294
294
  children: y("resource.flows")
295
295
  }),
296
- /* @__PURE__ */ G("section", {
296
+ /* @__PURE__ */ q("section", {
297
297
  "aria-labelledby": "flow-list-title",
298
298
  className: "resource-list-section",
299
299
  children: [
300
- /* @__PURE__ */ G("div", {
300
+ /* @__PURE__ */ q("div", {
301
301
  className: "resource-list-title",
302
- children: [/* @__PURE__ */ G("div", {
302
+ children: [/* @__PURE__ */ q("div", {
303
303
  className: "resource-list-heading",
304
- children: [/* @__PURE__ */ W("h2", {
304
+ children: [/* @__PURE__ */ K("h2", {
305
305
  id: "flow-list-title",
306
306
  children: y("resource.allFlows")
307
- }), !w && /* @__PURE__ */ W("span", { children: y("resource.flowCount", { count: O ?? D.length }) })]
308
- }), /* @__PURE__ */ G("div", {
307
+ }), !C && /* @__PURE__ */ K("span", { children: y("resource.flowCount", { count: D ?? E.length }) })]
308
+ }), /* @__PURE__ */ q("div", {
309
309
  className: "resource-list-actions",
310
310
  children: [
311
- /* @__PURE__ */ W(Ze, {
312
- language: d,
311
+ /* @__PURE__ */ K(Xe, {
312
+ language: f,
313
313
  onLanguageChange: h
314
314
  }),
315
- /* @__PURE__ */ G(Se, {
315
+ /* @__PURE__ */ q(Se, {
316
316
  className: "w-full sm:w-56",
317
- children: [/* @__PURE__ */ W(Oe, { children: /* @__PURE__ */ W(_, {
317
+ children: [/* @__PURE__ */ K(Oe, { children: /* @__PURE__ */ K(v, {
318
318
  name: "search",
319
319
  size: 17
320
- }) }), /* @__PURE__ */ W(ve, {
320
+ }) }), /* @__PURE__ */ K(ve, {
321
321
  autoComplete: "off",
322
322
  "aria-label": y("resource.searchFlows"),
323
323
  name: "flow-search",
@@ -326,114 +326,114 @@ function et({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
326
326
  value: A
327
327
  })]
328
328
  }),
329
- /* @__PURE__ */ W(c, {
329
+ /* @__PURE__ */ K(c, {
330
330
  "aria-label": y("common.refresh"),
331
- disabled: w || x != null,
332
- onClick: () => void v.workspace.reloadFlows(),
331
+ disabled: C || b != null,
332
+ onClick: () => void _.workspace.reloadFlows(),
333
333
  size: "icon",
334
334
  title: y("common.refresh"),
335
335
  variant: "outline",
336
- children: /* @__PURE__ */ W(_, { name: "refresh" })
336
+ children: /* @__PURE__ */ K(v, { name: "refresh" })
337
337
  }),
338
- /* @__PURE__ */ G(c, {
338
+ /* @__PURE__ */ q(c, {
339
339
  className: "resource-page-primary-action",
340
- disabled: x != null,
340
+ disabled: b != null,
341
341
  onClick: () => k(!0),
342
- children: [/* @__PURE__ */ W(_, {
342
+ children: [/* @__PURE__ */ K(v, {
343
343
  "data-icon": "inline-start",
344
344
  name: "plus"
345
345
  }), y("resource.newFlow")]
346
346
  }),
347
- s != null && u != null && m != null && /* @__PURE__ */ W(b, {
348
- action: s,
347
+ l != null && d != null && m != null && /* @__PURE__ */ K(x, {
348
+ action: l,
349
349
  onAction: m,
350
- title: u
350
+ title: d
351
351
  })
352
352
  ]
353
353
  })]
354
354
  }),
355
- /* @__PURE__ */ G("div", {
355
+ /* @__PURE__ */ q("div", {
356
356
  "aria-hidden": "true",
357
357
  className: "resource-list-columns flow-columns",
358
358
  children: [
359
- /* @__PURE__ */ W("span", { children: y("resource.name") }),
360
- /* @__PURE__ */ W("span", { children: y("resource.updated") }),
361
- /* @__PURE__ */ W("span", { children: y("resource.status") })
359
+ /* @__PURE__ */ K("span", { children: y("resource.name") }),
360
+ /* @__PURE__ */ K("span", { children: y("resource.updated") }),
361
+ /* @__PURE__ */ K("span", { children: y("resource.status") })
362
362
  ]
363
363
  }),
364
- /* @__PURE__ */ W("div", {
364
+ /* @__PURE__ */ K("div", {
365
365
  className: "resource-list",
366
- children: w ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ W($e, {}, t)) : S ? /* @__PURE__ */ G(se, {
366
+ children: C ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ K(Qe, {}, t)) : S ? /* @__PURE__ */ q(se, {
367
367
  className: "min-h-64",
368
368
  role: "alert",
369
- children: [/* @__PURE__ */ G(ue, { children: [
370
- /* @__PURE__ */ W(be, {
369
+ children: [/* @__PURE__ */ q(ue, { children: [
370
+ /* @__PURE__ */ K(be, {
371
371
  variant: "icon",
372
- children: /* @__PURE__ */ W(_, {
372
+ children: /* @__PURE__ */ K(v, {
373
373
  name: "alert",
374
374
  size: 20
375
375
  })
376
376
  }),
377
- /* @__PURE__ */ W(Ne, { children: y("resource.flowsLoadFailed") }),
378
- /* @__PURE__ */ W(Ae, { children: y("resource.flowsLoadFailedDescription") })
379
- ] }), /* @__PURE__ */ W(we, { children: /* @__PURE__ */ W(c, {
380
- onClick: () => void v.retryFlows(),
377
+ /* @__PURE__ */ K(U, { children: y("resource.flowsLoadFailed") }),
378
+ /* @__PURE__ */ K(Ae, { children: y("resource.flowsLoadFailedDescription") })
379
+ ] }), /* @__PURE__ */ K(we, { children: /* @__PURE__ */ K(c, {
380
+ onClick: () => void _.retryFlows(),
381
381
  variant: "outline",
382
382
  children: y("empty.retry")
383
383
  }) })]
384
- }) : F.length == 0 ? /* @__PURE__ */ G(se, {
384
+ }) : F.length == 0 ? /* @__PURE__ */ q(se, {
385
385
  className: "min-h-64",
386
- children: [/* @__PURE__ */ G(ue, { children: [
387
- /* @__PURE__ */ W(be, {
386
+ children: [/* @__PURE__ */ q(ue, { children: [
387
+ /* @__PURE__ */ K(be, {
388
388
  variant: "icon",
389
- children: /* @__PURE__ */ W(_, {
389
+ children: /* @__PURE__ */ K(v, {
390
390
  name: "flow",
391
391
  size: 20
392
392
  })
393
393
  }),
394
- /* @__PURE__ */ W(Ne, { children: y(P.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
395
- /* @__PURE__ */ W(Ae, { children: y(P.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
396
- ] }), P.length == 0 && /* @__PURE__ */ W(we, { children: /* @__PURE__ */ G(c, {
394
+ /* @__PURE__ */ K(U, { children: y(P.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
395
+ /* @__PURE__ */ K(Ae, { children: y(P.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
396
+ ] }), P.length == 0 && /* @__PURE__ */ K(we, { children: /* @__PURE__ */ q(c, {
397
397
  onClick: () => k(!0),
398
398
  variant: "outline",
399
- children: [/* @__PURE__ */ W(_, {
399
+ children: [/* @__PURE__ */ K(v, {
400
400
  "data-icon": "inline-start",
401
401
  name: "plus"
402
402
  }), y("resource.newFlow")]
403
403
  }) })]
404
- }) : F.map((e) => /* @__PURE__ */ W(Qe, {
404
+ }) : F.map((e) => /* @__PURE__ */ K(Ze, {
405
405
  badge: i?.[e.flowId],
406
- busy: x,
406
+ busy: b,
407
407
  flow: e,
408
408
  href: o(e),
409
409
  onSelect: g,
410
- store: v
410
+ store: _
411
411
  }, e.flowId))
412
412
  }),
413
- E != null && /* @__PURE__ */ W("div", {
413
+ T != null && /* @__PURE__ */ K("div", {
414
414
  className: "resource-list-footer",
415
- children: /* @__PURE__ */ W(c, {
416
- disabled: T,
417
- onClick: () => void v.workspace.loadMoreFlows(),
415
+ children: /* @__PURE__ */ K(c, {
416
+ disabled: w,
417
+ onClick: () => void _.workspace.loadMoreFlows(),
418
418
  variant: "outline",
419
- children: y(T ? "resource.loadingMore" : C ? "resource.retryLoadMore" : "resource.loadMore")
419
+ children: y(w ? "resource.loadingMore" : ee ? "resource.retryLoadMore" : "resource.loadMore")
420
420
  })
421
421
  })
422
422
  ]
423
423
  }),
424
- ee && /* @__PURE__ */ W(Ue, {
424
+ O && /* @__PURE__ */ K(He, {
425
425
  fallback: null,
426
- children: /* @__PURE__ */ W(Ye, {
426
+ children: /* @__PURE__ */ K(Je, {
427
427
  disabled: t,
428
428
  field: n,
429
429
  id: "flow-name",
430
- issue: p(M),
430
+ issue: u(M),
431
431
  label: y("resource.flowName"),
432
432
  name: M,
433
433
  onNameChange: N,
434
434
  onOpenChange: k,
435
435
  onSubmit: (e) => void I(e),
436
- pending: x == "flow",
436
+ pending: b == "flow",
437
437
  title: y("resource.newFlow")
438
438
  })
439
439
  })
@@ -443,7 +443,7 @@ function et({ catalogWidth: e, createFlowDisabled: t, createFlowField: n, flowBa
443
443
  }
444
444
  //#endregion
445
445
  //#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
446
- var tt = (e) => crypto.getRandomValues(new Uint8Array(e)), nt = (e, t, n) => {
446
+ var et = (e) => crypto.getRandomValues(new Uint8Array(e)), tt = (e, t, n) => {
447
447
  let r = 256 - 256 % e.length;
448
448
  if (r === 256) {
449
449
  let r = e.length - 1;
@@ -465,41 +465,43 @@ var tt = (e) => crypto.getRandomValues(new Uint8Array(e)), nt = (e, t, n) => {
465
465
  for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
466
466
  }
467
467
  };
468
- }, rt = (e, t = 21) => nt(e, t | 0, tt);
468
+ }, nt = (e, t = 21) => tt(e, t | 0, et);
469
469
  //#endregion
470
470
  //#region src/flow/common/edgeChanges.ts
471
- function it(e, t, n) {
471
+ function rt(e, t, n) {
472
472
  let r = {
473
473
  source: n.source,
474
474
  sourceHandle: n.sourceHandle,
475
475
  target: n.target,
476
476
  targetHandle: n.targetHandle
477
- }, i = ot(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
477
+ }, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
478
478
  return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : De(e, [{
479
+ before: a,
479
480
  edge: r,
480
481
  kind: "graph.edge.connect",
481
482
  target: t
482
483
  }]);
483
484
  }
484
- function at(e, t, n) {
485
+ function it(e, t, n) {
485
486
  let r = {
486
487
  source: n.source,
487
488
  sourceHandle: n.sourceHandle,
488
489
  target: n.target,
489
490
  targetHandle: n.targetHandle
490
- }, i = ot(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
491
+ }, i = at(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
491
492
  return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
493
+ before: a,
492
494
  edge: r,
493
495
  kind: "graph.edge.disconnect",
494
496
  target: t
495
497
  }];
496
498
  }
497
- function ot(e, t) {
499
+ function at(e, t) {
498
500
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
499
501
  }
500
502
  //#endregion
501
503
  //#region src/flow/common/moduleChanges.ts
502
- async function st(e) {
504
+ async function ot(e) {
503
505
  try {
504
506
  let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
505
507
  errorRecovery: !0,
@@ -515,15 +517,17 @@ async function st(e) {
515
517
  return [];
516
518
  }
517
519
  }
518
- function ct(e, t, n) {
520
+ function st(e, t, n, r, i) {
519
521
  return [{
520
- imports: n,
522
+ beforeImports: n,
523
+ beforeSource: t,
524
+ imports: i,
521
525
  kind: "module.source.replace",
522
526
  moduleId: e,
523
- source: t
527
+ source: r
524
528
  }];
525
529
  }
526
- var lt = rt("23456789abcdefghjkmnpqrstuvwxyz", 10), K = {
530
+ var ct = nt("23456789abcdefghjkmnpqrstuvwxyz", 10), J = {
527
531
  activities: [],
528
532
  activitiesLoadFailed: !1,
529
533
  activitiesLoading: !1,
@@ -536,24 +540,24 @@ var lt = rt("23456789abcdefghjkmnpqrstuvwxyz", 10), K = {
536
540
  loadingMore: !1,
537
541
  publications: [],
538
542
  publishing: !1
539
- }, ut = 20, dt = 50, ft = 750;
540
- function q(e, t) {
543
+ }, lt = 20, ut = 50, dt = 750;
544
+ function Y(e, t) {
541
545
  return e?.flowId == t.flowId;
542
546
  }
543
- var pt = class {
547
+ var ft = class {
544
548
  #e;
545
549
  #t;
546
550
  #n;
547
- #r = new F();
548
- #i = new F();
551
+ #r = new I();
552
+ #i = new I();
549
553
  #a;
550
- #o = new F();
551
- #s = new F();
554
+ #o = new I();
555
+ #s = new I();
552
556
  #c;
553
- #l = t(K);
557
+ #l = t(J);
554
558
  #u;
555
559
  #d;
556
- constructor(t, n, r, i, a = () => crypto.randomUUID(), o = L()) {
560
+ constructor(t, n, r, i, a = () => crypto.randomUUID(), o = R()) {
557
561
  this.#e = t, this.#t = a, this.#n = o, this.#a = i, this.#c = r, this.#u = n, this.$ = {
558
562
  activities: e(this.#l, (e) => e.activities),
559
563
  activitiesLoadFailed: e(this.#l, (e) => e.activitiesLoadFailed),
@@ -586,12 +590,12 @@ var pt = class {
586
590
  this.#l.dispose();
587
591
  }
588
592
  reset() {
589
- this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(K);
593
+ this.#r.invalidate(), this.#i.invalidate(), this.#o.invalidate(), this.#s.invalidate(), this.#d = void 0, this.#l.set(J);
590
594
  }
591
595
  async load(e) {
592
596
  let t = { flowId: e }, n = this.#r.begin();
593
- q(this.#l.value.target, t) || (this.#i.invalidate(), this.#d = void 0), this.#c(void 0), this.#l.set({
594
- ...K,
597
+ Y(this.#l.value.target, t) || (this.#i.invalidate(), this.#d = void 0), this.#c(void 0), this.#l.set({
598
+ ...J,
595
599
  loading: !0,
596
600
  target: t
597
601
  });
@@ -630,7 +634,7 @@ var pt = class {
630
634
  try {
631
635
  let e = await this.#e.listPublications(n.flowId, {
632
636
  cursor: t,
633
- limit: dt
637
+ limit: ut
634
638
  });
635
639
  if (!r()) return;
636
640
  let i = new Set(this.#l.value.publications.map((e) => e.publicationId));
@@ -668,7 +672,7 @@ var pt = class {
668
672
  publishing: i.status == "pending"
669
673
  }), await this.#g(n, i, o, e.name)) : !1;
670
674
  } catch (e) {
671
- return o() ? (e instanceof z && e.code == "live.conflict" && await this.#p(n), this.#c(D(e, this.#n.t)), !1) : !1;
675
+ return o() ? (e instanceof B && e.code == "live.conflict" && await this.#p(n), this.#c(D(e, this.#n.t)), !1) : !1;
672
676
  } finally {
673
677
  o() && this.#y({ publishing: !1 });
674
678
  }
@@ -692,7 +696,7 @@ var pt = class {
692
696
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
693
697
  }), !0);
694
698
  } catch (e) {
695
- return s() ? (e instanceof z && e.code == "live.conflict" && await this.#p(r), this.#c(D(e, this.#n.t)), !1) : !1;
699
+ return s() ? (e instanceof B && e.code == "live.conflict" && await this.#p(r), this.#c(D(e, this.#n.t)), !1) : !1;
696
700
  } finally {
697
701
  s() && this.#y({ rollingBackPublicationId: void 0 });
698
702
  }
@@ -727,7 +731,7 @@ var pt = class {
727
731
  testingTriggerId: void 0,
728
732
  testResult: void 0
729
733
  });
730
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: ut })]);
734
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: lt })]);
731
735
  if (n()) {
732
736
  if (r.status == "rejected") {
733
737
  this.#y({
@@ -761,7 +765,7 @@ var pt = class {
761
765
  try {
762
766
  let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
763
767
  cursor: t,
764
- limit: ut
768
+ limit: lt
765
769
  });
766
770
  if (!i() || this.#l.value.selectedTriggerId != n) return;
767
771
  let a = new Set(this.#l.value.activities.map((e) => e.activityId));
@@ -816,7 +820,7 @@ var pt = class {
816
820
  }
817
821
  async #f(e) {
818
822
  let [t, n, r] = await this.#m(e);
819
- this.#u.updateLive(t), await this.#u.refreshFlows(), q(this.#l.value.target, e) && this.#y({
823
+ this.#u.updateLive(t), await this.#u.refreshFlows(), Y(this.#l.value.target, e) && this.#y({
820
824
  bindings: r,
821
825
  live: t,
822
826
  loadFailed: !1,
@@ -837,7 +841,7 @@ var pt = class {
837
841
  this.#e.getLive(e.flowId),
838
842
  this.#e.listPublications(e.flowId, {
839
843
  includeTotal: !0,
840
- limit: dt
844
+ limit: ut
841
845
  }),
842
846
  this.#e.listFlowTriggerBindings(e.flowId)
843
847
  ]);
@@ -847,7 +851,7 @@ var pt = class {
847
851
  if (t != null && t != "") try {
848
852
  return await this.#e.getPublishOperation(e.flowId, t);
849
853
  } catch (t) {
850
- if (t instanceof z && t.code == "publication.operation-not-found") {
854
+ if (t instanceof B && t.code == "publication.operation-not-found") {
851
855
  this.#a.setItem(this.#_(e.flowId), "");
852
856
  return;
853
857
  }
@@ -857,12 +861,12 @@ var pt = class {
857
861
  async #g(e, t, n, r) {
858
862
  let i = t;
859
863
  for (; i.status == "pending";) {
860
- if (await new Promise((e) => setTimeout(e, ft)), !n()) return !1;
864
+ if (await new Promise((e) => setTimeout(e, dt)), !n()) return !1;
861
865
  try {
862
866
  i = await this.#e.getPublishOperation(e.flowId, i.operationId);
863
867
  } catch (t) {
864
868
  if (!n()) return !1;
865
- if (t instanceof z && t.code == "publication.operation-not-found") return this.#a.setItem(this.#_(e.flowId), ""), this.#v(e, {
869
+ if (t instanceof B && t.code == "publication.operation-not-found") return this.#a.setItem(this.#_(e.flowId), ""), this.#v(e, {
866
870
  operation: void 0,
867
871
  publishing: !1
868
872
  }), this.#c(D(t, this.#n.t)), !1;
@@ -893,8 +897,8 @@ var pt = class {
893
897
  return `publish-operation:${e}`;
894
898
  }
895
899
  #v(e, t) {
896
- q(this.#l.value.target, e) ? this.#y(t) : this.#l.set({
897
- ...K,
900
+ Y(this.#l.value.target, e) ? this.#y(t) : this.#l.set({
901
+ ...J,
898
902
  ...t,
899
903
  target: e
900
904
  });
@@ -905,12 +909,12 @@ var pt = class {
905
909
  ...e
906
910
  });
907
911
  }
908
- }, mt = { starting: !1 };
909
- function ht(e) {
912
+ }, pt = { starting: !1 };
913
+ function mt(e) {
910
914
  switch (e.kind) {
911
915
  case "condition": return { [e.node.input.handle]: e.node.input };
912
- case "subflow": return h(e.definition?.inputs ?? []);
913
- case "task": return h(e.definition?.inputs ?? []);
916
+ case "subflow": return m(e.definition?.inputs ?? []);
917
+ case "task": return m(e.definition?.inputs ?? []);
914
918
  case "value": return {};
915
919
  case "wait": return { value: {
916
920
  jsonSchema: {},
@@ -919,15 +923,15 @@ function ht(e) {
919
923
  } };
920
924
  }
921
925
  }
922
- function gt(e) {
926
+ function ht(e) {
923
927
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
924
928
  }
925
- async function _t(e, t) {
926
- let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-BYa8zFLC.js").then((e) => e.r), r = I(e), i = r.graph({ kind: "flow" });
929
+ async function gt(e, t) {
930
+ let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DDidwd8h.js").then((e) => e.r), r = L(e), i = r.graph({ kind: "flow" });
927
931
  return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
928
932
  let a = r.resolveNode(e, i);
929
933
  if (a.kind == "trigger") return [];
930
- let o = Object.entries(ht(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
934
+ let o = Object.entries(mt(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
931
935
  handle: e,
932
936
  jsonSchema: t.jsonSchema,
933
937
  nullable: t.nullable
@@ -935,21 +939,21 @@ async function _t(e, t) {
935
939
  return o.length == 0 ? [] : [{
936
940
  editor: new n(o, t),
937
941
  nodeId: e,
938
- title: gt(a)
942
+ title: ht(a)
939
943
  }];
940
944
  });
941
945
  }
942
- var vt = class {
946
+ var _t = class {
943
947
  #e;
944
948
  #t;
945
949
  #n;
946
- #r = new F();
947
- #i = new F();
950
+ #r = new I();
951
+ #i = new I();
948
952
  #a;
949
953
  #o;
950
- #s = t(mt);
954
+ #s = t(pt);
951
955
  #c;
952
- constructor(t, n, r, i = L(), a = () => crypto.randomUUID()) {
956
+ constructor(t, n, r, i = R(), a = () => crypto.randomUUID()) {
953
957
  this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
954
958
  inputRequest: e(this.#s, (e) => e.inputRequest),
955
959
  starting: e(this.#s, (e) => e.starting),
@@ -964,7 +968,7 @@ var vt = class {
964
968
  reset() {
965
969
  this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
966
970
  let e = this.#s.value.inputRequest;
967
- this.#s.set(mt), this.#d(e);
971
+ this.#s.set(pt), this.#d(e);
968
972
  }
969
973
  async requestDraft(e, t) {
970
974
  let n = this.#i.begin();
@@ -1007,7 +1011,7 @@ var vt = class {
1007
1011
  }), this.#d(s);
1008
1012
  let c;
1009
1013
  try {
1010
- c = await _t(r, this.#n.lang$);
1014
+ c = await gt(r, this.#n.lang$);
1011
1015
  } catch (e) {
1012
1016
  throw a() && this.#f({
1013
1017
  starting: !1,
@@ -1083,18 +1087,18 @@ var vt = class {
1083
1087
  ...e
1084
1088
  });
1085
1089
  }
1086
- }, yt = {
1090
+ }, vt = {
1087
1091
  actions: {},
1088
1092
  catalogs: {}
1089
1093
  };
1090
- function bt(e) {
1094
+ function yt(e) {
1091
1095
  return Object.entries(e).map(([e, t]) => ({
1092
1096
  description: t.description,
1093
1097
  handle: e,
1094
1098
  jsonSchema: t.jsonSchema
1095
1099
  }));
1096
1100
  }
1097
- function J(e, t) {
1101
+ function X(e, t) {
1098
1102
  return {
1099
1103
  connector: e,
1100
1104
  description: e.authenticated && e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
@@ -1104,13 +1108,13 @@ function J(e, t) {
1104
1108
  group: t("addNode.connectorActions"),
1105
1109
  icon: T(e),
1106
1110
  id: `connector:${e.actionId}`,
1107
- inputs: bt(e.inputs),
1111
+ inputs: yt(e.inputs),
1108
1112
  kind: "connector",
1109
1113
  label: e.name,
1110
- outputs: bt(e.outputs)
1114
+ outputs: yt(e.outputs)
1111
1115
  };
1112
1116
  }
1113
- function xt(e, t) {
1117
+ function bt(e, t) {
1114
1118
  let n = /* @__PURE__ */ new Map();
1115
1119
  for (let t of e) {
1116
1120
  let e = n.get(t.serviceId) ?? [];
@@ -1118,7 +1122,7 @@ function xt(e, t) {
1118
1122
  }
1119
1123
  return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
1120
1124
  let n = e[0], r = e.map((e) => {
1121
- let n = J(e, t);
1125
+ let n = X(e, t);
1122
1126
  return {
1123
1127
  description: n.description,
1124
1128
  label: n.label,
@@ -1139,7 +1143,7 @@ function xt(e, t) {
1139
1143
  };
1140
1144
  });
1141
1145
  }
1142
- function St(e, t) {
1146
+ function xt(e, t) {
1143
1147
  return {
1144
1148
  choices: [],
1145
1149
  description: t("addNode.connectorBrowseActions"),
@@ -1153,7 +1157,7 @@ function St(e, t) {
1153
1157
  serviceId: e.serviceId
1154
1158
  };
1155
1159
  }
1156
- function Ct(e, t) {
1160
+ function St(e, t) {
1157
1161
  if (e == null) return;
1158
1162
  let n = e.kind == "wait" ? e.node.notification?.taskId : e.kind == "task" && e.node.task == null ? e.node.taskId : void 0;
1159
1163
  if (n == null) return;
@@ -1165,7 +1169,7 @@ function Ct(e, t) {
1165
1169
  taskId: n
1166
1170
  };
1167
1171
  }
1168
- function wt(e, t, n) {
1172
+ function Ct(e, t, n) {
1169
1173
  if (e == null) return [];
1170
1174
  let r = [];
1171
1175
  for (let i of [...O(e.revision.content).tasks].toSorted()) {
@@ -1185,7 +1189,7 @@ function wt(e, t, n) {
1185
1189
  }
1186
1190
  return r;
1187
1191
  }
1188
- var Tt = class {
1192
+ var wt = class {
1189
1193
  #e;
1190
1194
  #t;
1191
1195
  #n;
@@ -1202,13 +1206,13 @@ var Tt = class {
1202
1206
  #p;
1203
1207
  #m;
1204
1208
  #h;
1205
- constructor(r, i, a, o, s = L()) {
1206
- this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new F(), this.#o = new F(), this.#d = t(yt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
1209
+ constructor(r, i, a, o, s = R()) {
1210
+ this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new I(), this.#o = new I(), this.#d = t(vt), this.#h = !1, this.browseAddNodeOptions = async (e) => {
1207
1211
  if (this.#h) return;
1208
1212
  let t = this.#f.$.flowId.value;
1209
1213
  if (t == null) return;
1210
1214
  let n = this.#m ?? await this.#e.listConnectorProviders(e, t);
1211
- 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) => St(e, this.#t.t));
1215
+ 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) => xt(e, this.#t.t));
1212
1216
  }, this.provideAddNodeOptionChoices = async (e, t) => {
1213
1217
  if (this.#h) return;
1214
1218
  let n = this.#f.$.flowId.value, r = this.#m?.find((t) => `connector-provider:${t.serviceId}` == e);
@@ -1219,7 +1223,7 @@ var Tt = class {
1219
1223
  return this.#r.set(r.serviceId, a), this.#b({ actions: {
1220
1224
  ...this.#d.value.actions,
1221
1225
  ...Object.fromEntries(a.map((e) => [e.actionId, e]))
1222
- } }), a.map((e) => J(e, this.#t.t));
1226
+ } }), a.map((e) => X(e, this.#t.t));
1223
1227
  }, this.provideAddNodeOptions = async (e, t) => {
1224
1228
  if (this.#h) return;
1225
1229
  let n = this.#f.$.flowId.value;
@@ -1228,17 +1232,17 @@ var Tt = class {
1228
1232
  if (t.aborted || this.#h || n != this.#f.$.flowId.value) return;
1229
1233
  let a = { ...this.#d.value.actions };
1230
1234
  for (let e of i) a[e.actionId] = e;
1231
- if (this.#b({ actions: a }), r.length != 0) return i.map((e) => J(e, this.#t.t));
1235
+ if (this.#b({ actions: a }), r.length != 0) return i.map((e) => X(e, this.#t.t));
1232
1236
  let o = new Map(i.map((e) => [e.actionId, e]));
1233
1237
  for (let e of this.#f.$.revision.value?.connectorActionIds ?? []) {
1234
1238
  let t = a[e];
1235
1239
  t != null && o.set(e, t);
1236
1240
  }
1237
- return xt([...o.values()], this.#t.t);
1241
+ return bt([...o.values()], this.#t.t);
1238
1242
  }, this.#e = r, this.#n = o, this.#f = i, this.#u = a, this.#t = s;
1239
1243
  let c = e(this.#d, (e) => e.actions), l = e(this.#d, (e) => e.catalogs);
1240
1244
  this.#l = n((e) => {
1241
- let t = Ct(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1245
+ let t = St(e(i.$.selection), e(i.$.revision)), n = e(this.#d);
1242
1246
  if (t == null) return { authorizationPending: !1 };
1243
1247
  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);
1244
1248
  return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
@@ -1254,7 +1258,7 @@ var Tt = class {
1254
1258
  actions: c,
1255
1259
  catalogs: l,
1256
1260
  connectionLoading: e(this.#d, (e) => e.connectionLoading),
1257
- diagnostics: n((e) => wt(e(i.$.revision), e(c), e(l))),
1261
+ diagnostics: n((e) => Ct(e(i.$.revision), e(c), e(l))),
1258
1262
  selectedAction: e(this.#l, (e) => e.action),
1259
1263
  selectedActionError: e(this.#l, (e) => e.actionError),
1260
1264
  selectedActiveConnections: e(this.#l, (e) => e.activeConnections),
@@ -1269,11 +1273,11 @@ var Tt = class {
1269
1273
  this.#l.dispose(), this.#d.dispose();
1270
1274
  }
1271
1275
  reset() {
1272
- 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(yt));
1276
+ 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));
1273
1277
  }
1274
1278
  async refresh(e = !1) {
1275
1279
  if (this.#h) return;
1276
- let t = this.#o.begin(), n = this.#f.$.flowId.value, r = Ct(this.#f.$.selection.value, this.#f.$.revision.value);
1280
+ let t = this.#o.begin(), n = this.#f.$.flowId.value, r = St(this.#f.$.selection.value, this.#f.$.revision.value);
1277
1281
  if (n == null || r == null) {
1278
1282
  (this.#d.value.actionLoading != null || this.#d.value.connectionLoading != null) && this.#b({
1279
1283
  actionLoading: void 0,
@@ -1409,8 +1413,8 @@ var Tt = class {
1409
1413
  }
1410
1414
  await Promise.all([...i].map((n) => this.#v(t, n, !1, e)));
1411
1415
  }
1412
- }, Et = { catalogs: {} }, Dt = "trigger:";
1413
- function Y(e, t) {
1416
+ }, Tt = { catalogs: {} }, Et = "trigger:";
1417
+ function Z(e, t) {
1414
1418
  if (e?.kind != "trigger") return;
1415
1419
  let n = e.trigger;
1416
1420
  if (n.kind != "poll" && n.kind != "integration") return;
@@ -1421,7 +1425,7 @@ function Y(e, t) {
1421
1425
  triggerId: e.id
1422
1426
  };
1423
1427
  }
1424
- function Ot(e, t) {
1428
+ function Dt(e, t) {
1425
1429
  return {
1426
1430
  description: t.t("addNode.triggerNeedsConnection", { provider: e.provider }),
1427
1431
  group: t.t("addNode.triggers"),
@@ -1429,7 +1433,7 @@ function Ot(e, t) {
1429
1433
  serviceId: e.provider,
1430
1434
  serviceName: e.provider
1431
1435
  }),
1432
- id: `${Dt}${e.key}`,
1436
+ id: `${Et}${e.key}`,
1433
1437
  inputs: [],
1434
1438
  kind: "trigger",
1435
1439
  label: e.displayName,
@@ -1443,7 +1447,7 @@ function Ot(e, t) {
1443
1447
  }
1444
1448
  };
1445
1449
  }
1446
- var kt = class {
1450
+ var Ot = class {
1447
1451
  #e;
1448
1452
  #t;
1449
1453
  #n;
@@ -1455,12 +1459,12 @@ var kt = class {
1455
1459
  #c;
1456
1460
  #l;
1457
1461
  #u;
1458
- constructor(r, i, a, o, s = L()) {
1459
- this.#t = new AbortController(), this.#a = new F(), this.#c = t(Et), this.#u = !1, this.browseAddNodeOptions = async (e) => {
1462
+ constructor(r, i, a, o, s = R()) {
1463
+ this.#t = new AbortController(), this.#a = new I(), this.#c = t(Tt), this.#u = !1, this.browseAddNodeOptions = async (e) => {
1460
1464
  let t = this.#l.$.flowId.value;
1461
1465
  if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
1462
1466
  let n = await this.#d();
1463
- if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => Ot(e, this.#i));
1467
+ if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => Dt(e, this.#i));
1464
1468
  }, this.provideAddNodeOptions = async (e, t) => {
1465
1469
  let n = this.#l.$.flowId.value;
1466
1470
  if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
@@ -1474,9 +1478,9 @@ var kt = class {
1474
1478
  e.name,
1475
1479
  e.provider,
1476
1480
  e.type
1477
- ].some((e) => e.toLowerCase().includes(r))).map((e) => Ot(e, this.#i));
1481
+ ].some((e) => e.toLowerCase().includes(r))).map((e) => Dt(e, this.#i));
1478
1482
  }, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
1479
- let t = e(i.$.selection), n = Y(t, i), r = e(this.#c);
1483
+ let t = e(i.$.selection), n = Z(t, i), r = e(this.#c);
1480
1484
  if (t?.kind != "trigger") return { authorizationPending: !1 };
1481
1485
  let a = t.trigger;
1482
1486
  if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
@@ -1503,10 +1507,10 @@ var kt = class {
1503
1507
  this.#o.dispose(), this.#c.dispose();
1504
1508
  }
1505
1509
  reset() {
1506
- this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(Et));
1510
+ this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(Tt));
1507
1511
  }
1508
1512
  async refresh(e = !1) {
1509
- let t = this.#a.begin(), n = this.#l.$.flowId.value, r = Y(this.#l.$.selection.value, this.#l);
1513
+ let t = this.#a.begin(), n = this.#l.$.flowId.value, r = Z(this.#l.$.selection.value, this.#l);
1510
1514
  if (!this.#u) {
1511
1515
  if (n == null || r == null) {
1512
1516
  this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
@@ -1563,7 +1567,7 @@ var kt = class {
1563
1567
  delete t[e], this.#f({
1564
1568
  authorizationProvider: void 0,
1565
1569
  catalogs: t
1566
- }), Y(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1570
+ }), Z(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
1567
1571
  }
1568
1572
  #d() {
1569
1573
  if (this.#e != null) return this.#e;
@@ -1583,46 +1587,28 @@ var kt = class {
1583
1587
  }
1584
1588
  };
1585
1589
  //#endregion
1586
- //#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
1587
- function At(e, t) {
1588
- return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
1589
- }
1590
- function X(e, t, n, r) {
1591
- for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
1592
- }
1593
- function jt(e, t, n, r) {
1594
- let i = /* @__PURE__ */ new Set();
1595
- for (let a of r) switch (a.kind) {
1596
- case "graph.node.create":
1597
- case "graph.node.replace":
1598
- At(a.target, n) && i.add(a.nodeId);
1599
- break;
1600
- case "task.replace":
1601
- X(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), X(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
1602
- break;
1603
- case "module.source.replace":
1604
- X(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), X(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
1605
- break;
1606
- case "subflow.definition.replace": X(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), X(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
1607
- }
1608
- return new Set([...i].filter((e) => t.selection(n, e) != null));
1609
- }
1610
- //#endregion
1611
1590
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
1612
- function Mt(e) {
1613
- if (e.length != 1) return;
1614
- let t = e[0];
1615
- switch (t.kind) {
1616
- case "binding.replace": return `${t.kind}:${t.bindingId}`;
1617
- case "graph.node.replace": return `${t.kind}:${t.target.kind}:${t.target.kind == "subflow" ? t.target.id : ""}:${t.nodeId}`;
1618
- case "module.rename":
1619
- case "module.source.replace": return `${t.kind}:${t.moduleId}`;
1620
- case "subflow.definition.replace": return `${t.kind}:${t.subflowId}`;
1621
- case "task.replace": return `${t.kind}:${t.taskId}`;
1622
- default: return;
1623
- }
1591
+ function kt(e, t) {
1592
+ if (e.length != 1 || t.length != 1) return;
1593
+ let n = e[0], r = t[0];
1594
+ 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 : [{
1595
+ before: n.before,
1596
+ field: r.field,
1597
+ kind: r.kind,
1598
+ nodeId: r.nodeId,
1599
+ target: r.target,
1600
+ value: r.value
1601
+ }];
1602
+ if (n?.kind == "graph.node.input.set" && r?.kind == "graph.node.input.set") return n.nodeId != r.nodeId || n.handle != r.handle || n.target.kind != r.target.kind || n.target.kind == "subflow" && (r.target.kind != "subflow" || n.target.id != r.target.id) ? void 0 : [{
1603
+ before: n.before,
1604
+ handle: r.handle,
1605
+ kind: r.kind,
1606
+ nodeId: r.nodeId,
1607
+ target: r.target,
1608
+ value: r.value
1609
+ }];
1624
1610
  }
1625
- var Nt = class {
1611
+ var At = class {
1626
1612
  #e;
1627
1613
  #t;
1628
1614
  #n;
@@ -1648,54 +1634,70 @@ var Nt = class {
1648
1634
  }
1649
1635
  replaceCommitted(e) {
1650
1636
  this.#a = e;
1637
+ let t = e, n = [];
1638
+ for (let e of this.#o) try {
1639
+ t = V(t, e.changes), n.push(e);
1640
+ } catch (t) {
1641
+ if (!(t instanceof h)) throw t;
1642
+ e.active = !1;
1643
+ }
1644
+ return this.#o = n, t;
1651
1645
  }
1652
1646
  project(e) {
1653
- return this.#o.reduce((e, t) => B(e, t.changes), e);
1647
+ return this.#o.reduce((e, t) => V(e, t.changes), e);
1654
1648
  }
1655
1649
  enqueue(e) {
1656
1650
  let t = this.#s.then(e);
1657
1651
  return this.#s = t, t;
1658
1652
  }
1659
1653
  async change(e, t, n, r = !0) {
1660
- this.#t.beforeChange(r), this.#t.apply(B(t, n));
1661
- let i = Mt(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && Mt(a.changes) == i ? a : void 0;
1662
- if (o != null) return o.changes = n, await o.result;
1663
- let s = {
1654
+ let i = this.#o.at(-1), a = i == null || i.started || !i.active ? void 0 : kt(i.changes, n);
1655
+ if (i != null && a != null) return i.changes = a, this.#a != null && this.#t.apply(this.project(this.#a)), i.result;
1656
+ this.#t.beforeChange(r);
1657
+ let o = {
1664
1658
  ...e,
1659
+ active: !0,
1660
+ changeId: crypto.randomUUID(),
1665
1661
  changes: n,
1666
1662
  started: !1
1667
1663
  };
1668
- this.#a ??= t, this.#o.push(s), this.#i += 1;
1669
- let c = this.#s.then(() => (s.started = !0, this.#c(s)));
1670
- s.result = c, this.#s = c.then(() => void 0);
1664
+ this.#a ??= t, this.#o.push(o), this.#t.apply(this.project(this.#a)), this.#i += 1;
1665
+ let s = this.#s.then(() => (o.started = !0, this.#c(o)));
1666
+ o.result = s, this.#s = s.then(() => void 0);
1671
1667
  try {
1672
- return await c;
1668
+ return await s;
1673
1669
  } finally {
1674
1670
  --this.#i, this.#i == 0 && this.#t.finishChanges();
1675
1671
  }
1676
1672
  }
1677
1673
  async #c(e) {
1678
1674
  let t = !1;
1679
- for (; this.#t.current(e);) {
1675
+ for (; e.active && this.#t.current(e);) {
1680
1676
  let n = this.#a;
1681
1677
  if (n == null) return;
1682
1678
  try {
1683
- let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes);
1679
+ let t = await this.#e.changeDraft(e.flowId, n.revisionId, e.changes, e.changeId);
1684
1680
  if (!this.#t.current(e)) return;
1685
1681
  if (t.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft change response.");
1686
1682
  let r = this.#l(e, n, t);
1687
1683
  return this.#o.length == 0 && this.#t.check(), r;
1688
1684
  } catch (n) {
1689
- if (n instanceof z && n.code == "flow.revision-conflict") {
1685
+ if (n instanceof B && n.code == "flow.revision-conflict") {
1690
1686
  if (!t && await this.#t.recover(e)) {
1691
- t = !0;
1687
+ t = !0, e.changeId = crypto.randomUUID();
1692
1688
  continue;
1693
1689
  }
1694
- t && await this.#t.recover(e), this.#u(e), this.#t.current(e) && this.#r({
1695
- kind: "error",
1696
- message: this.#n.t("notice.draftConflict")
1697
- });
1698
- } else this.#u(e), this.#t.current(e) && this.#r(D(n, this.#n.t));
1690
+ t && await this.#t.recover(e), this.#u(e);
1691
+ } else {
1692
+ if (!(n instanceof B) && !t) {
1693
+ let n = this.#a?.revisionId;
1694
+ if (await this.#t.recover(e)) {
1695
+ t = !0, e.active && this.#a?.revisionId != n && (e.changeId = crypto.randomUUID());
1696
+ continue;
1697
+ }
1698
+ }
1699
+ this.#u(e), this.#t.current(e) && this.#r(D(n, this.#n.t));
1700
+ }
1699
1701
  return;
1700
1702
  }
1701
1703
  }
@@ -1703,28 +1705,28 @@ var Nt = class {
1703
1705
  #l(e, t, n) {
1704
1706
  let r = {
1705
1707
  ...n.revision,
1706
- content: B(t, e.changes).content
1708
+ content: V(t, e.changes).content
1707
1709
  };
1708
1710
  this.#o = this.#o.filter((t) => t !== e), this.#a = r;
1709
1711
  let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
1710
1712
  return this.#t.apply(this.project(r), a), this.#t.headChanged(e.flowId, r.revisionId), r;
1711
1713
  }
1712
1714
  #u(e) {
1713
- this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
1715
+ 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));
1714
1716
  }
1715
- }, Pt = 50, Ft = {
1717
+ }, jt = 50, Mt = {
1716
1718
  failed: !1,
1717
1719
  loaded: !1,
1718
1720
  loading: !0,
1719
1721
  loadingMore: !1,
1720
1722
  loadMoreFailed: !1,
1721
1723
  flows: []
1722
- }, It = class {
1724
+ }, Nt = class {
1723
1725
  #e;
1724
1726
  #t;
1725
- #n = new F();
1727
+ #n = new I();
1726
1728
  #r;
1727
- #i = t(Ft);
1729
+ #i = t(Mt);
1728
1730
  #a = !1;
1729
1731
  constructor(t, n, r) {
1730
1732
  this.#e = t, this.#t = r, this.#r = n, this.$ = {
@@ -1766,7 +1768,7 @@ var Nt = class {
1766
1768
  try {
1767
1769
  let t = await this.#e.listFlows({
1768
1770
  includeTotal: !0,
1769
- limit: Pt
1771
+ limit: jt
1770
1772
  });
1771
1773
  if (!e()) return;
1772
1774
  this.#o({
@@ -1795,7 +1797,7 @@ var Nt = class {
1795
1797
  try {
1796
1798
  let e = await this.#e.listFlows({
1797
1799
  cursor: t,
1798
- limit: Pt
1800
+ limit: jt
1799
1801
  });
1800
1802
  if (!n()) return;
1801
1803
  let r = new Set(this.#i.value.flows.map((e) => e.flowId));
@@ -1851,7 +1853,7 @@ var Nt = class {
1851
1853
  ...e
1852
1854
  });
1853
1855
  }
1854
- }, Lt = class {
1856
+ }, Pt = class {
1855
1857
  #e;
1856
1858
  #t;
1857
1859
  #n;
@@ -1894,7 +1896,7 @@ var Nt = class {
1894
1896
  this.#c(a, r);
1895
1897
  } catch (r) {
1896
1898
  if (this.#o || !n()) return;
1897
- if (r instanceof z && r.code == "flow.presentation-conflict") try {
1899
+ if (r instanceof B && r.code == "flow.presentation-conflict") try {
1898
1900
  let t = await this.#e.getPresentation(e);
1899
1901
  if (this.#o || !n()) return;
1900
1902
  this.#c(a, t), this.#n({
@@ -1916,21 +1918,21 @@ var Nt = class {
1916
1918
  value: n
1917
1919
  });
1918
1920
  }
1919
- }, Rt = {
1921
+ }, Ft = {
1920
1922
  checkLoading: !1,
1921
1923
  selectedNodeIds: [],
1922
1924
  workspaceLoadFailed: !1,
1923
1925
  workspaceLoading: !1
1924
1926
  };
1925
- function zt(e) {
1927
+ function It(e) {
1926
1928
  return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
1927
1929
  }
1928
- function Z(e, t) {
1930
+ function Q(e, t) {
1929
1931
  if (t.phase != null) return t.phase;
1930
1932
  let n = e?.content.modules[t.moduleId];
1931
1933
  return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
1932
1934
  }
1933
- function Q(e, t, n) {
1935
+ function $(e, t, n) {
1934
1936
  if (e == null || t == null || n.length != 1) return;
1935
1937
  let r = e.node(t, n[0]);
1936
1938
  if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
@@ -1938,9 +1940,9 @@ function Q(e, t, n) {
1938
1940
  source: r.module.source
1939
1941
  };
1940
1942
  }
1941
- var Bt = class {
1943
+ var Lt = class {
1942
1944
  #e;
1943
- #t = t(Rt);
1945
+ #t = t(Ft);
1944
1946
  #n;
1945
1947
  constructor(t, r) {
1946
1948
  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) => {
@@ -1948,25 +1950,25 @@ var Bt = class {
1948
1950
  let { phase: t, ...n } = e.moduleEditor;
1949
1951
  return {
1950
1952
  ...n,
1951
- status: Z(e.draft, e.moduleEditor)
1953
+ status: Q(e.draft, e.moduleEditor)
1952
1954
  };
1953
- }), 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 : I(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);
1955
+ }), 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 : L(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);
1954
1956
  this.#e = e(this.#t, (e) => ({
1955
- revision: e.draft == null ? void 0 : I(e.draft),
1957
+ revision: e.draft == null ? void 0 : L(e.draft),
1956
1958
  target: e.target
1957
1959
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
1958
1960
  let y = e(this.#t, (e) => {
1959
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return I(e.draft).selection(e.target, e.selectedNodeIds[0]);
1961
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return L(e.draft).selection(e.target, e.selectedNodeIds[0]);
1960
1962
  });
1961
1963
  this.$ = {
1962
1964
  addNodeOptions: n((e) => {
1963
1965
  let { revision: n, target: r } = e(this.#e);
1964
- return Fe(n?.revision, r, e(t.t$));
1966
+ return Pe(n?.revision, r, e(t.t$));
1965
1967
  }),
1966
1968
  busy: i,
1967
1969
  checkLoading: a,
1968
1970
  diagnosticFocus: o,
1969
- diagnosticItems: e(this.#t, (e) => E(e.draft == null ? void 0 : I(e.draft), e.target, e.diagnostics)),
1971
+ diagnosticItems: e(this.#t, (e) => E(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics)),
1970
1972
  diagnostics: s,
1971
1973
  draft: c,
1972
1974
  flow: n((e) => {
@@ -1981,7 +1983,7 @@ var Bt = class {
1981
1983
  flowNextCursor: r.$.nextCursor,
1982
1984
  flowTotal: r.$.total,
1983
1985
  flows: r.$.flows,
1984
- inspectorDiagnostics: e(this.#t, (e) => te(e.draft == null ? void 0 : I(e.draft), e.target, e.diagnostics, y.value)),
1986
+ inspectorDiagnostics: e(this.#t, (e) => te(e.draft == null ? void 0 : L(e.draft), e.target, e.diagnostics, y.value)),
1985
1987
  live: p,
1986
1988
  moduleDiagnostics: e(this.#t, (e) => {
1987
1989
  let t = e.moduleEditor?.moduleId;
@@ -1993,11 +1995,11 @@ var Bt = class {
1993
1995
  revision: m,
1994
1996
  selection: y,
1995
1997
  selectedNodeIds: h,
1996
- status: e(this.#t, zt),
1998
+ status: e(this.#t, It),
1997
1999
  target: g,
1998
2000
  targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
1999
2001
  targetName: e(this.#t, (e) => {
2000
- 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;
2002
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : L(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2001
2003
  }),
2002
2004
  workspaceLoadFailed: _,
2003
2005
  workspaceLoading: v
@@ -2016,17 +2018,16 @@ var Bt = class {
2016
2018
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2017
2019
  this.#e.dispose(), this.#t.dispose();
2018
2020
  }
2019
- }, Vt = 250;
2020
- function Ht(e, t) {
2021
+ };
2022
+ //#endregion
2023
+ //#region src/workbench/browser/runtime/stores/workspaceStore.ts
2024
+ function Rt(e, t) {
2021
2025
  if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2022
2026
  }
2023
- function $(e, t) {
2024
- return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
2025
- }
2026
- var Ut = class {
2027
+ var zt = class {
2027
2028
  #e;
2028
2029
  #t;
2029
- #n = new F();
2030
+ #n = new I();
2030
2031
  #r;
2031
2032
  #i;
2032
2033
  #a;
@@ -2037,36 +2038,33 @@ var Ut = class {
2037
2038
  #u;
2038
2039
  #d = 0;
2039
2040
  #f = 0;
2040
- #p;
2041
- #m = 0;
2041
+ #p = !1;
2042
+ #m = !1;
2042
2043
  #h = !1;
2043
- #g = !1;
2044
- #_ = !1;
2045
- #v = !1;
2046
- #y = 0;
2047
- #b;
2048
- #x;
2049
- constructor(e, t, n = lt, r = L(), i = () => {}) {
2050
- this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new It(e, t, r), this.#l = new Bt(r, this.#o), this.#t = new Nt(e, t, r, {
2051
- apply: (e, t) => this.#w(e, t),
2044
+ #g = 0;
2045
+ #_;
2046
+ #v;
2047
+ constructor(e, t, n = ct, r = R(), i = () => {}) {
2048
+ this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new Nt(e, t, r), this.#l = new Lt(r, this.#o), this.#t = new At(e, t, r, {
2049
+ apply: (e, t) => this.#x(e, t),
2052
2050
  beforeChange: (e) => {
2053
- this.#M(), this.#h = !1, e && (this.#B({ busy: "designer" }), this.#c(void 0));
2051
+ e && (this.#N({ busy: "designer" }), this.#c(void 0));
2054
2052
  },
2055
- check: () => void this.#E(),
2056
- current: (e) => this.#z(e),
2053
+ check: () => void this.#C(),
2054
+ current: (e) => this.#M(e),
2057
2055
  diagnostics: () => this.#l.value.diagnostics,
2058
2056
  finishChanges: () => {
2059
- !this.#_ && this.#l.value.busy == "designer" && this.#B({ busy: void 0 });
2057
+ !this.#m && this.#l.value.busy == "designer" && this.#N({ busy: void 0 });
2060
2058
  },
2061
- headChanged: (e, t) => this.#N(e, t),
2062
- recover: (e) => this.#O(e, !0)
2063
- }), this.#a = new Lt(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2059
+ headChanged: (e, t) => this.#E(e, t),
2060
+ recover: (e) => this.#T(e, !0)
2061
+ }), this.#a = new Pt(e, t, (e) => this.#N({ presentation: e }), r), this.$ = this.#l.$;
2064
2062
  }
2065
2063
  dispose() {
2066
- this.#M(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
2064
+ this.#m = !0, this.#n.invalidate(), this.#a.dispose(), this.#_?.(), this.#v?.(), this.#l.dispose(), this.#o.dispose();
2067
2065
  }
2068
2066
  async start(e) {
2069
- this.#b ??= this.#e.watchFlowCatalog(() => void this.reloadFlows()), await this.reloadFlows(), await this.selectFlow(e);
2067
+ this.#_ ??= this.#e.watchFlowCatalog(() => void this.reloadFlows()), await this.reloadFlows(), await this.selectFlow(e);
2070
2068
  }
2071
2069
  async reloadFlows() {
2072
2070
  await this.#o.reload();
@@ -2075,10 +2073,9 @@ var Ut = class {
2075
2073
  await this.#o.loadMore();
2076
2074
  }
2077
2075
  async selectFlow(e) {
2078
- if (!this.#F()) return !1;
2079
- this.#M();
2076
+ if (!this.#O()) return !1;
2080
2077
  let t = this.#n.begin();
2081
- if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#h = !1, this.#g = !1, this.#v = !1, this.#x?.(), this.#x = void 0, this.#B({
2078
+ if (this.#t.reset(), this.#a.reset(), this.#f = 0, this.#p = !1, this.#h = !1, this.#v?.(), this.#v = void 0, this.#N({
2082
2079
  checkLoading: !1,
2083
2080
  diagnosticFocus: void 0,
2084
2081
  diagnostics: void 0,
@@ -2101,18 +2098,18 @@ var Ut = class {
2101
2098
  this.#e.getPresentation(e)
2102
2099
  ]);
2103
2100
  if (!t()) return !1;
2104
- this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#B({
2101
+ this.#t.reset(i), this.#a.reset(o), this.#o.include(r), this.#N({
2105
2102
  draft: i,
2106
2103
  live: a,
2107
2104
  presentation: o,
2108
2105
  target: { kind: "flow" },
2109
2106
  workspaceLoadFailed: !1,
2110
2107
  workspaceLoading: !1
2111
- }), this.#E(), this.#x = this.#e.watchFlow(e, (e) => {
2112
- !this.#_ && e != this.#t.committed?.revisionId && this.#D(e);
2108
+ }), this.#C(), this.#v = this.#e.watchFlow(e, (e) => {
2109
+ !this.#m && e != this.#t.committed?.revisionId && this.#w(e);
2113
2110
  }, this.#s);
2114
2111
  } catch (e) {
2115
- return t() ? (this.#B({
2112
+ return t() ? (this.#N({
2116
2113
  workspaceLoadFailed: !0,
2117
2114
  workspaceLoading: !1
2118
2115
  }), this.#c(D(e, this.#r.t)), !1) : !1;
@@ -2120,59 +2117,59 @@ var Ut = class {
2120
2117
  return !0;
2121
2118
  }
2122
2119
  selectTarget(e) {
2123
- return this.#F() ? (this.#M(), this.#B({
2120
+ return this.#O() ? (this.#N({
2124
2121
  diagnosticFocus: void 0,
2125
2122
  diagnostics: void 0,
2126
2123
  moduleEditor: void 0,
2127
2124
  nodeFocus: void 0,
2128
2125
  selectedNodeIds: [],
2129
2126
  target: e
2130
- }), this.#E(), !0) : !1;
2127
+ }), this.#C(), !0) : !1;
2131
2128
  }
2132
2129
  selectNodes(e) {
2133
- return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#F() ? (this.#M(), this.#B({
2130
+ return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#O() ? (this.#N({
2134
2131
  diagnosticFocus: void 0,
2135
- moduleEditor: Q(this.#l.value.draft == null ? void 0 : I(this.#l.value.draft), this.#l.value.target, e),
2132
+ moduleEditor: $(this.#l.value.draft == null ? void 0 : L(this.#l.value.draft), this.#l.value.target, e),
2136
2133
  nodeFocus: void 0,
2137
2134
  selectedNodeIds: e
2138
2135
  }), !0) : !1;
2139
2136
  }
2140
2137
  async createFlow(e, t) {
2141
- if (this.#F()) {
2142
- this.#B({ busy: "flow" }), this.#c(void 0);
2138
+ if (this.#O()) {
2139
+ this.#N({ busy: "flow" }), this.#c(void 0);
2143
2140
  try {
2144
2141
  if (t == null) return await this.#o.create(e);
2145
2142
  let n = await this.#e.getFlow(await t(e));
2146
2143
  return this.#o.insert(n), n;
2147
2144
  } catch (e) {
2148
- this.#_ || this.#c(D(e, this.#r.t));
2145
+ this.#m || this.#c(D(e, this.#r.t));
2149
2146
  } finally {
2150
- this.#B({ busy: void 0 });
2147
+ this.#N({ busy: void 0 });
2151
2148
  }
2152
2149
  }
2153
2150
  }
2154
2151
  async deleteFlow(e) {
2155
- if (!this.#F()) return !1;
2152
+ if (!this.#O()) return !1;
2156
2153
  let t = this.#o.flow(e);
2157
2154
  if (t == null || t.status == "retiring") return !1;
2158
- this.#B({ busy: "flow" }), this.#c(void 0);
2155
+ this.#N({ busy: "flow" }), this.#c(void 0);
2159
2156
  try {
2160
- return await this.#e.deleteFlow(e), !this.#_ && (this.#o.remove(e), this.#c({
2157
+ return await this.#e.deleteFlow(e), !this.#m && (this.#o.remove(e), this.#c({
2161
2158
  kind: "success",
2162
2159
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
2163
2160
  }), !0);
2164
2161
  } catch (e) {
2165
- return this.#_ || this.#c(D(e, this.#r.t)), !1;
2162
+ return this.#m || this.#c(D(e, this.#r.t)), !1;
2166
2163
  } finally {
2167
- this.#B({ busy: void 0 });
2164
+ this.#N({ busy: void 0 });
2168
2165
  }
2169
2166
  }
2170
2167
  async createResource(e) {
2171
- if (!this.#F() || this.#l.value.draft == null) return !1;
2168
+ if (!this.#O() || this.#l.value.draft == null) return !1;
2172
2169
  let t = this.#i();
2173
- this.#B({ busy: "resource" }), this.#c(void 0);
2174
- let n = await this.#C(oe(t, e), !1);
2175
- return this.#B({ busy: void 0 }), n != null && (this.selectTarget({
2170
+ this.#N({ busy: "resource" }), this.#c(void 0);
2171
+ let n = await this.#b(oe(t, e), !1);
2172
+ return this.#N({ busy: void 0 }), n != null && (this.selectTarget({
2176
2173
  id: t,
2177
2174
  kind: "subflow"
2178
2175
  }), this.#c({
@@ -2184,53 +2181,53 @@ var Ut = class {
2184
2181
  let n = this.#o.flow(e), r = t.trim();
2185
2182
  if (n == null || r.length == 0) return !1;
2186
2183
  if (n.name == r) return !0;
2187
- this.#B({ busy: "flow" }), this.#c(void 0);
2184
+ this.#N({ busy: "flow" }), this.#c(void 0);
2188
2185
  let i;
2189
2186
  try {
2190
2187
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
2191
2188
  } catch (e) {
2192
- this.#_ || this.#c(D(e, this.#r.t));
2189
+ this.#m || this.#c(D(e, this.#r.t));
2193
2190
  }
2194
- return this.#B({ busy: void 0 }), i != null && (this.#c({
2191
+ return this.#N({ busy: void 0 }), i != null && (this.#c({
2195
2192
  kind: "success",
2196
2193
  message: this.#r.t("notice.flowRenamed", { name: r })
2197
2194
  }), !0);
2198
2195
  }
2199
2196
  async addNode(e, t, n) {
2200
- if (!this.#F()) return;
2197
+ if (!this.#O()) return;
2201
2198
  let r = this.#l.value.draft, i = this.#l.value.target;
2202
2199
  if (r == null || i == null) return;
2203
2200
  let a = this.#i();
2204
- if (e.kind == "comment") return await this.#S(i, a, t);
2205
- let o = I(r), s = S(e, o, i, this.#r.t);
2201
+ if (e.kind == "comment") return await this.#y(i, a, t);
2202
+ let o = L(r), s = ee(e, o, i, this.#r.t);
2206
2203
  if (s == null) return;
2207
2204
  let c = je(o, i, a, s, this.#i);
2208
2205
  if (c == null) return;
2209
- let l = n == null ? c : [...c, ...it(B(r, c).content, i, n(a))], u = this.#C(l);
2206
+ let l = n == null ? c : [...c, ...rt(V(r, c).content, i, n(a))], u = this.#b(l);
2210
2207
  this.selectNodes([a]);
2211
2208
  let d = this.moveNodes({ [a]: t });
2212
- if (await u != null && (await d, !this.#_)) return this.#B({ nodeFocus: {
2209
+ if (await u != null && (await d, !this.#m)) return this.#N({ nodeFocus: {
2213
2210
  nodeId: a,
2214
- requestId: ++this.#y
2211
+ requestId: ++this.#g
2215
2212
  } }), a;
2216
2213
  }
2217
2214
  async connect(e) {
2218
2215
  let t = this.$.revision.value, n = this.#l.value.target;
2219
2216
  if (t == null || n == null) return;
2220
- let r = it(t.revision.content, n, e);
2221
- r.length > 0 && await this.#C(r);
2217
+ let r = rt(t.revision.content, n, e);
2218
+ r.length > 0 && await this.#b(r);
2222
2219
  }
2223
2220
  async disconnect(e) {
2224
2221
  let t = this.$.revision.value, n = this.#l.value.target;
2225
2222
  if (t == null || n == null) return;
2226
- let r = at(t.revision.content, n, e);
2227
- r.length > 0 && await this.#C(r);
2223
+ let r = it(t.revision.content, n, e);
2224
+ r.length > 0 && await this.#b(r);
2228
2225
  }
2229
2226
  async deleteSelectedNodes() {
2230
- if (!this.#F()) return;
2227
+ if (!this.#O()) return;
2231
2228
  let e = this.$.revision.value, t = this.#l.value.target;
2232
2229
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2233
- let n = w(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ce(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => x(e, t, r));
2230
+ let n = w(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ce(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#b(i), o = r.size == 0 ? void 0 : this.#S((e) => S(e, t, r));
2234
2231
  this.selectNodes([]), (a == null || await a != null) && await o;
2235
2232
  }
2236
2233
  copySelectedNodes() {
@@ -2238,7 +2235,7 @@ var Ut = class {
2238
2235
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2239
2236
  let n = new Set(this.#l.value.selectedNodeIds);
2240
2237
  this.#u = {
2241
- comments: this.#P().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2238
+ comments: this.#D().nodes.flatMap((e) => e.kind == "comment" && n.has(e.id) ? [{
2242
2239
  content: e.content,
2243
2240
  position: e.position,
2244
2241
  sourceId: e.id,
@@ -2248,23 +2245,23 @@ var Ut = class {
2248
2245
  };
2249
2246
  }
2250
2247
  async pasteNodes(e) {
2251
- if (!this.#F()) return;
2248
+ if (!this.#O()) return;
2252
2249
  let t = this.$.revision.value, n = this.#l.value.target;
2253
2250
  if (t == null || n == null || this.#u == null) return;
2254
- let r = ke(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#C(r.changes), a = this.#u.comments.map((e) => ({
2251
+ let r = ke(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#b(r.changes), a = this.#u.comments.map((e) => ({
2255
2252
  ...e,
2256
2253
  nodeId: this.#i()
2257
2254
  }));
2258
2255
  if (r.nodeIds.length == 0 && a.length == 0) return;
2259
- let o = new Map(this.#P().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
2256
+ let o = new Map(this.#D().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
2260
2257
  let i = e?.[t] ?? o.get(t)?.position;
2261
2258
  return [r.nodeIds[n], {
2262
2259
  x: (i?.x ?? 80) + 40,
2263
2260
  y: (i?.y ?? 80) + 40
2264
2261
  }];
2265
- })), c = this.#T((e) => {
2266
- let t = A(e, n, s);
2267
- for (let e of a) t = R(t, n, e.nodeId, {
2262
+ })), c = this.#S((e) => {
2263
+ let t = j(e, n, s);
2264
+ for (let e of a) t = z(t, n, e.nodeId, {
2268
2265
  content: e.content,
2269
2266
  position: {
2270
2267
  x: e.position.x + 40,
@@ -2283,65 +2280,65 @@ var Ut = class {
2283
2280
  let n = this.$.revision.value, r = this.#l.value.target;
2284
2281
  if (n == null || r == null) return !1;
2285
2282
  let i = he(n, r, e, t);
2286
- return i != null && await this.#C(i) != null;
2283
+ return i != null && await this.#b(i) != null;
2287
2284
  }
2288
2285
  async saveNodeDescription(e, t) {
2289
2286
  let n = this.$.revision.value, r = this.#l.value.target;
2290
2287
  if (n == null || r == null) return !1;
2291
2288
  let i = Te(n, r, e, t);
2292
- return i != null && await this.#C(i) != null;
2289
+ return i != null && await this.#b(i) != null;
2293
2290
  }
2294
2291
  async saveNodeIcon(e, t) {
2295
2292
  let n = this.$.revision.value, r = this.#l.value.target;
2296
2293
  if (n == null || r == null) return !1;
2297
2294
  let i = xe(n, r, e, t);
2298
- return i != null && await this.#C(i) != null;
2295
+ return i != null && await this.#b(i) != null;
2299
2296
  }
2300
2297
  async saveNodeTitle(e, t) {
2301
2298
  let n = this.$.revision.value, r = this.#l.value.target;
2302
2299
  if (n == null || r == null) return !1;
2303
2300
  let i = ge(n, r, e, t);
2304
- return i != null && await this.#C(i) != null;
2301
+ return i != null && await this.#b(i) != null;
2305
2302
  }
2306
2303
  async setInputValue(e, t, n) {
2307
2304
  let r = this.$.revision.value, i = this.#l.value.target;
2308
2305
  if (r == null || i == null) return !1;
2309
2306
  let a = le(r, i, e, t, n);
2310
- return a != null && await this.#C(a) != null;
2307
+ return a != null && await this.#b(a) != null;
2311
2308
  }
2312
2309
  async setInputVariable(e, t, n) {
2313
2310
  let r = this.$.revision.value, i = this.#l.value.target;
2314
2311
  if (r == null || i == null) return !1;
2315
2312
  let a = n == null ? le(r, i, e, t, void 0) : ye(r, i, e, t, n, this.#i());
2316
- return a != null && await this.#C(a) != null;
2313
+ return a != null && await this.#b(a) != null;
2317
2314
  }
2318
2315
  async saveCondition(e, t) {
2319
2316
  let n = this.$.revision.value, r = this.#l.value.target;
2320
2317
  if (n == null || r == null) return !1;
2321
2318
  let i = me(n, r, e, t);
2322
- return i != null && await this.#C(i) != null;
2319
+ return i != null && await this.#b(i) != null;
2323
2320
  }
2324
2321
  async saveValue(e, t) {
2325
2322
  let n = this.$.revision.value, r = this.#l.value.target;
2326
2323
  if (n == null || r == null) return !1;
2327
2324
  let i = ce(n, r, e, t);
2328
- return i != null && await this.#C(i) != null;
2325
+ return i != null && await this.#b(i) != null;
2329
2326
  }
2330
2327
  async saveWait(e, t) {
2331
2328
  let n = this.$.revision.value, r = this.#l.value.target;
2332
2329
  if (n == null || r?.kind != "flow") return !1;
2333
- let i = Ie(n, r, e, t);
2334
- return i != null && await this.#C(i) != null;
2330
+ let i = Fe(n, r, e, t);
2331
+ return i != null && await this.#b(i) != null;
2335
2332
  }
2336
2333
  async setWaitNotification(e, t) {
2337
2334
  let n = this.$.revision.value, r = n == null ? void 0 : Me(n, e, t, this.#i());
2338
- return r != null && await this.#C(r) != null;
2335
+ return r != null && await this.#b(r) != null;
2339
2336
  }
2340
2337
  async saveComment(e, t) {
2341
2338
  let n = this.#l.value.target;
2342
2339
  if (n == null) return;
2343
- let r = this.#P().nodes.find((t) => t.id == e)?.position;
2344
- r != null && await this.#T((i) => R(i, n, e, {
2340
+ let r = this.#D().nodes.find((t) => t.id == e)?.position;
2341
+ r != null && await this.#S((i) => z(i, n, e, {
2345
2342
  ...t,
2346
2343
  position: r
2347
2344
  }));
@@ -2349,66 +2346,66 @@ var Ut = class {
2349
2346
  async saveTaskSettings(e, t) {
2350
2347
  let n = this.$.revision.value, r = this.#l.value.target;
2351
2348
  if (n == null || r == null) return !1;
2352
- let i = Pe(n, r, e, t);
2353
- return i != null && await this.#C(i) != null;
2349
+ let i = Ne(n, r, e, t);
2350
+ return i != null && await this.#b(i) != null;
2354
2351
  }
2355
2352
  async saveCodeTaskPorts(e, t) {
2356
2353
  let n = this.$.revision.value, r = this.#l.value.target;
2357
2354
  if (n == null || r == null) return !1;
2358
2355
  let i = de(n, r, e, t);
2359
- return i != null && await this.#C(i) != null;
2356
+ return i != null && await this.#b(i) != null;
2360
2357
  }
2361
2358
  async saveTaskAdditionalInputs(e, t) {
2362
2359
  let n = this.$.revision.value, r = this.#l.value.target;
2363
2360
  if (n == null || r == null) return !1;
2364
- let i = Le(n, r, e, t);
2365
- return i != null && await this.#C(i) != null;
2361
+ let i = Ie(n, r, e, t);
2362
+ return i != null && await this.#b(i) != null;
2366
2363
  }
2367
2364
  async setConnectorConnection(e, t) {
2368
2365
  let n = this.$.revision.value;
2369
2366
  if (n == null) return !1;
2370
- let r = ee(n.revision.content, e, t);
2371
- return r != null && await this.#C(r) != null;
2367
+ let r = k(n.revision.content, e, t);
2368
+ return r != null && await this.#b(r) != null;
2372
2369
  }
2373
2370
  async saveTriggerSettings(e, t) {
2374
2371
  let n = this.$.revision.value, r = this.#l.value.target;
2375
2372
  if (n == null || r?.kind != "flow") return !1;
2376
2373
  let i = ne(n.revision.content, r, e, t);
2377
- return i != null && await this.#C(i) != null;
2374
+ return i != null && await this.#b(i) != null;
2378
2375
  }
2379
2376
  async saveTriggerConfig(e, t, n) {
2380
2377
  let r = this.$.revision.value, i = this.#l.value.target;
2381
2378
  if (r == null || i?.kind != "flow") return !1;
2382
2379
  let a = ie(r.revision.content, i, e, t, n);
2383
- return a != null && await this.#C(a) != null;
2380
+ return a != null && await this.#b(a) != null;
2384
2381
  }
2385
2382
  async saveTriggerSchedule(e, t) {
2386
2383
  let n = this.$.revision.value, r = this.#l.value.target;
2387
2384
  if (n == null || r?.kind != "flow") return !1;
2388
- let i = N(n.revision.content, r, e, t);
2389
- return i != null && await this.#C(i) != null;
2385
+ let i = P(n.revision.content, r, e, t);
2386
+ return i != null && await this.#b(i) != null;
2390
2387
  }
2391
2388
  async saveWebhook(e, t) {
2392
2389
  let n = this.$.revision.value, r = this.#l.value.target;
2393
2390
  if (n == null || r?.kind != "flow") return !1;
2394
- let i = P(n, r, e, t);
2395
- return i != null && await this.#C(i) != null;
2391
+ let i = F(n, r, e, t);
2392
+ return i != null && await this.#b(i) != null;
2396
2393
  }
2397
2394
  async setTriggerConnection(e, t) {
2398
2395
  let n = this.$.revision.value, r = this.#l.value.target;
2399
2396
  if (n == null || r?.kind != "flow") return !1;
2400
2397
  let i = re(n.revision.content, r, e, t);
2401
- return i != null && await this.#C(i) != null;
2398
+ return i != null && await this.#b(i) != null;
2402
2399
  }
2403
2400
  async saveSubflowSettings(e, t) {
2404
2401
  let n = this.$.revision.value;
2405
2402
  if (n == null) return !1;
2406
2403
  let r = ae(n, e, t);
2407
- return r != null && await this.#C(r) != null;
2404
+ return r != null && await this.#b(r) != null;
2408
2405
  }
2409
2406
  updateModuleSource(e) {
2410
2407
  let t = this.#l.value.moduleEditor;
2411
- t != null && t.source != e && this.#B({ moduleEditor: {
2408
+ t != null && t.source != e && this.#N({ moduleEditor: {
2412
2409
  ...t,
2413
2410
  phase: void 0,
2414
2411
  source: e
@@ -2419,10 +2416,10 @@ var Ut = class {
2419
2416
  if (e == null) return;
2420
2417
  let t = this.#l.value.draft?.content.modules[e.moduleId];
2421
2418
  if (t == null) {
2422
- this.#B({ moduleEditor: void 0 });
2419
+ this.#N({ moduleEditor: void 0 });
2423
2420
  return;
2424
2421
  }
2425
- this.#B({ moduleEditor: {
2422
+ this.#N({ moduleEditor: {
2426
2423
  moduleId: e.moduleId,
2427
2424
  source: t.source
2428
2425
  } });
@@ -2430,104 +2427,104 @@ var Ut = class {
2430
2427
  async saveModuleEditor() {
2431
2428
  let e = this.#l.value.moduleEditor;
2432
2429
  if (e == null || e.phase == "saving") return !1;
2433
- this.#B({ moduleEditor: {
2430
+ this.#N({ moduleEditor: {
2434
2431
  ...e,
2435
2432
  phase: "saving"
2436
2433
  } });
2437
- let t = await st(e.source);
2438
- if (this.#_) return !1;
2439
- let n = await this.#C(ct(e.moduleId, e.source, t));
2440
- return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#B({ moduleEditor: {
2434
+ let t = await ot(e.source);
2435
+ if (this.#m) return !1;
2436
+ let n = this.#l.value.draft?.content.modules[e.moduleId];
2437
+ if (n == null) return !1;
2438
+ let r = await this.#b(st(e.moduleId, n.source, n.imports, e.source, t));
2439
+ return !this.#m && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#N({ moduleEditor: {
2441
2440
  ...this.#l.value.moduleEditor,
2442
- phase: n == null ? "failed" : void 0
2443
- } }), n != null;
2441
+ phase: r == null ? "failed" : void 0
2442
+ } }), r != null;
2444
2443
  }
2445
2444
  async moveNodes(e, t = "detail") {
2446
2445
  let n = this.#l.value.target;
2447
- n != null && await this.#T((r) => A(r, n, e, t));
2446
+ n != null && await this.#S((r) => j(r, n, e, t));
2448
2447
  }
2449
2448
  async moveViewport(e, t = "detail") {
2450
2449
  let n = this.#l.value.target;
2451
- if (n == null) return;
2452
- let r = this.#P().viewport;
2453
- (r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => k(r, n, e, t));
2450
+ n != null && await this.#S((r) => A(r, n, e, t));
2454
2451
  }
2455
2452
  async check() {
2456
- await this.#E();
2453
+ await this.#C();
2457
2454
  }
2458
2455
  async refreshFlows() {
2459
2456
  await this.reloadFlows();
2460
2457
  }
2461
2458
  updateLive(e) {
2462
- e.flowId == this.#l.value.flowId && this.#B({ live: e });
2459
+ e.flowId == this.#l.value.flowId && this.#N({ live: e });
2463
2460
  }
2464
2461
  locateNode(e) {
2465
2462
  let t = this.$.revision.value, n = this.#l.value.target;
2466
- return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#B({ nodeFocus: {
2463
+ return t == null || n == null || t.node(n, e) == null || !this.selectNodes([e]) ? !1 : (this.#N({ nodeFocus: {
2467
2464
  nodeId: e,
2468
- requestId: ++this.#y
2465
+ requestId: ++this.#g
2469
2466
  } }), !0);
2470
2467
  }
2471
2468
  locateDiagnostic(e) {
2472
- return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#B({ diagnosticFocus: {
2469
+ return e.location == null || !this.selectNodes([e.location.nodeId]) ? !1 : (this.#N({ diagnosticFocus: {
2473
2470
  ...e.location,
2474
2471
  diagnostic: e.diagnostic,
2475
2472
  requestId: ++this.#d
2476
2473
  } }), !0);
2477
2474
  }
2478
- async #S(e, t, n) {
2479
- let r = Math.max(0, ...this.#P().nodes.flatMap((e) => {
2475
+ async #y(e, t, n) {
2476
+ let r = Math.max(0, ...this.#D().nodes.flatMap((e) => {
2480
2477
  if (e.kind != "comment") return [];
2481
2478
  let t = /#(\d+)$/.exec(e.title);
2482
2479
  return t == null ? [] : [Number(t[1])];
2483
- })), i = this.#T((i) => R(i, e, t, {
2480
+ })), i = this.#S((i) => z(i, e, t, {
2484
2481
  content: "",
2485
2482
  position: n,
2486
2483
  title: this.#r.t("addNode.commentName", { number: r + 1 })
2487
2484
  }));
2488
- if (this.selectNodes([t]), await i, !this.#_) return t;
2485
+ if (this.selectNodes([t]), await i, !this.#m) return t;
2489
2486
  }
2490
- async #C(e, t = !0) {
2487
+ async #b(e, t = !0) {
2491
2488
  let n = this.#l.value.flowId, r = this.#l.value.draft;
2492
- if (n != null && r != null) return await this.#t.change({
2489
+ if (n != null && r != null) return e.length == 0 ? r : await this.#t.change({
2493
2490
  current: this.#n.capture(),
2494
2491
  flowId: n
2495
2492
  }, r, e, t);
2496
2493
  }
2497
- #w(e, t = !1) {
2498
- let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#I(e), o = this.#l.value.moduleEditor;
2499
- return this.#B({
2494
+ #x(e, t = !1) {
2495
+ let n = this.#l.value.draft, { revision: r, selectedNodeIds: i, target: a } = this.#k(e), o = this.#l.value.moduleEditor;
2496
+ return this.#N({
2500
2497
  diagnostics: t ? this.#l.value.diagnostics : void 0,
2501
2498
  draft: e,
2502
- moduleEditor: o != null && n != null && Z(n, o) != "saved" ? o : Q(r, a, i),
2499
+ moduleEditor: o != null && n != null && Q(n, o) != "saved" ? o : $(r, a, i),
2503
2500
  selectedNodeIds: i,
2504
2501
  target: a
2505
2502
  }), r;
2506
2503
  }
2507
- async #T(e) {
2508
- if (this.#_) return;
2504
+ async #S(e) {
2505
+ if (this.#m) return;
2509
2506
  let t = this.#l.value.flowId, n = this.#l.value.presentation;
2510
2507
  t != null && n != null && await this.#a.change(t, n, this.#o.capture(), e);
2511
2508
  }
2512
- async #E() {
2513
- if (this.#_) return;
2509
+ async #C() {
2510
+ if (this.#m) return;
2514
2511
  let e = this.#l.value.flowId, t = this.#l.value.draft, n = this.#l.value.target;
2515
2512
  if (e == null || t == null || n == null) {
2516
- n ?? this.#B({
2513
+ n ?? this.#N({
2517
2514
  checkLoading: !1,
2518
2515
  diagnostics: void 0
2519
2516
  });
2520
2517
  return;
2521
2518
  }
2522
- this.#B({
2519
+ this.#N({
2523
2520
  checkLoading: !0,
2524
2521
  diagnosticFocus: void 0
2525
2522
  });
2526
2523
  try {
2527
2524
  let n = await this.#e.checkFlow(e, t.revisionId);
2528
- if (!this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
2525
+ if (!this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId) {
2529
2526
  let e = this.#l.value.live;
2530
- this.#B({
2527
+ this.#N({
2531
2528
  diagnostics: n,
2532
2529
  live: e == null ? void 0 : {
2533
2530
  ...e,
@@ -2536,16 +2533,16 @@ var Ut = class {
2536
2533
  });
2537
2534
  }
2538
2535
  } catch (n) {
2539
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(D(n, this.#r.t));
2536
+ !this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(D(n, this.#r.t));
2540
2537
  } finally {
2541
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ checkLoading: !1 });
2538
+ !this.#m && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#N({ checkLoading: !1 });
2542
2539
  }
2543
2540
  }
2544
- async #D(e) {
2545
- if (this.#_) return;
2541
+ async #w(e) {
2542
+ if (this.#m) return;
2546
2543
  let t = this.#l.value.flowId;
2547
- if (t == null || (this.#f += 1, e != null && (this.#g = !0, this.#t.changing || (this.#h = !0)), this.#v)) return;
2548
- this.#v = !0;
2544
+ if (t == null || (this.#f += 1, e != null && (this.#p = !0), this.#h)) return;
2545
+ this.#h = !0;
2549
2546
  let n = {
2550
2547
  current: this.#n.capture(),
2551
2548
  flowId: t
@@ -2554,144 +2551,83 @@ var Ut = class {
2554
2551
  let e;
2555
2552
  do {
2556
2553
  e = this.#f;
2557
- let t = this.#h, r = this.#m, i = this.#g;
2558
- this.#h = !1, this.#g = !1, await this.#O(n, !1, i, t, r);
2559
- } while (this.#z(n) && e != this.#f);
2560
- }), this.#z(n) && (this.#v = !1);
2554
+ let t = this.#p;
2555
+ this.#p = !1, await this.#T(n, !1, t);
2556
+ } while (this.#M(n) && e != this.#f);
2557
+ }), this.#M(n) && (this.#h = !1);
2561
2558
  }
2562
- async #O(e, t, n = !1, r = !1, i = this.#m) {
2559
+ async #T(e, t, n = !1) {
2563
2560
  try {
2564
- let t = r ? this.#l.value.target : void 0, a = this.#t.committed;
2565
- if (a == null) return !1;
2566
- let o = await this.#e.syncDraft(e.flowId, a.revisionId);
2567
- if (!this.#z(e)) return !1;
2568
- if (o.kind == "changes" && o.revisions.length == 0) return !0;
2569
- let s;
2570
- try {
2571
- s = this.#k(a, o);
2572
- } catch {
2573
- if (o = await this.#e.syncDraft(e.flowId), !this.#z(e)) return !1;
2574
- s = this.#k(a, o);
2575
- }
2576
- if (s.revisionId == a.revisionId) return !0;
2577
- let c = o.kind == "changes" && t != null ? jt(I(a), I(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
2578
- o.kind == "snapshot" && this.#M();
2579
- let l = this.#L(s, !1);
2580
- return this.#N(e.flowId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#A(e, t, c, i), n && (this.#c({
2581
- kind: l ? "error" : "success",
2582
- message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
2583
- }), this.#E()), !0;
2561
+ let t = this.#t.committed;
2562
+ if (t == null) return !1;
2563
+ let r = await this.#e.syncDraft(e.flowId);
2564
+ if (!this.#M(e)) return !1;
2565
+ let i = r.draft;
2566
+ if (i.revisionId == t.revisionId) return !0;
2567
+ let a = this.#A(i, !1);
2568
+ return this.#E(e.flowId, i.revisionId), n && (this.#c({
2569
+ kind: a ? "error" : "success",
2570
+ message: this.#r.t(a ? "notice.moduleUpdated" : "notice.draftUpdated")
2571
+ }), this.#C()), !0;
2584
2572
  } catch (n) {
2585
- return t && this.#z(e) && this.#c(D(n, this.#r.t)), !1;
2586
- }
2587
- }
2588
- #k(e, t) {
2589
- if (t.kind == "snapshot") return t.draft;
2590
- let n = e;
2591
- for (let e of t.revisions) {
2592
- if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
2593
- n = {
2594
- ...e.revision,
2595
- content: B(n, e.operations).content
2596
- };
2573
+ return t && this.#M(e) && this.#c(D(n, this.#r.t)), !1;
2597
2574
  }
2598
- return n;
2599
- }
2600
- #A(e, t, n, r) {
2601
- let i = this.#l.value;
2602
- if (!this.#z(e) || r != this.#m || !$(i.target, t)) return;
2603
- let a = this.#p;
2604
- if (a != null) {
2605
- if (a.flowId != e.flowId || !$(a.target, t)) {
2606
- this.#M();
2607
- return;
2608
- }
2609
- for (let e of n) a.targets.add(e);
2610
- globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), Vt);
2611
- return;
2612
- }
2613
- n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
2614
- current: e.current,
2615
- generation: r,
2616
- flowId: e.flowId,
2617
- target: t,
2618
- targets: new Set(n),
2619
- timer: globalThis.setTimeout(() => this.#j(), Vt),
2620
- viewport: this.#P().viewport
2621
- });
2622
- }
2623
- #j() {
2624
- let e = this.#p;
2625
- if (this.#p = void 0, e == null || !e.current() || e.generation != this.#m) return;
2626
- let t = this.#l.value;
2627
- if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
2628
- let n = this.#P().viewport;
2629
- if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
2630
- let r = I(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
2631
- i.length == 1 && this.#B({ nodeFocus: {
2632
- nodeId: i[0],
2633
- requestId: ++this.#y
2634
- } });
2635
- }
2636
- #M() {
2637
- this.#m += 1, this.#p != null && globalThis.clearTimeout(this.#p.timer), this.#p = void 0;
2638
2575
  }
2639
- #N(e, t) {
2576
+ #E(e, t) {
2640
2577
  this.#o.advanceHead(e, t);
2641
2578
  }
2642
- #P() {
2579
+ #D() {
2643
2580
  let e = this.#l.value;
2644
- return j(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
2581
+ return M(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
2645
2582
  }
2646
- #F() {
2583
+ #O() {
2647
2584
  let e = this.#l.value.moduleEditor;
2648
- return e == null || Z(this.#l.value.draft, e) == "saved" || (this.#c({
2585
+ return e == null || Q(this.#l.value.draft, e) == "saved" || (this.#c({
2649
2586
  kind: "error",
2650
2587
  message: this.#r.t("notice.unsavedCode")
2651
2588
  }), !1);
2652
2589
  }
2653
- #I(e) {
2654
- let t = I(e), n = Ht(t, this.#l.value.target);
2590
+ #k(e) {
2591
+ let t = L(e), n = Rt(t, this.#l.value.target);
2655
2592
  return {
2656
2593
  revision: t,
2657
2594
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
2658
2595
  target: n
2659
2596
  };
2660
2597
  }
2661
- #L(e, t) {
2662
- this.#t.replaceCommitted(e);
2663
- let n = this.#t.project(e), r = this.#l.value.moduleEditor, i = r != null && Z(this.#l.value.draft, r) != "saved", a = this.#I(n), o = a.target;
2664
- return this.#B({
2598
+ #A(e, t) {
2599
+ let n = this.#t.replaceCommitted(e), r = this.#l.value.moduleEditor, i = r != null && Q(this.#l.value.draft, r) != "saved", a = this.#k(n), o = a.target;
2600
+ return this.#N({
2665
2601
  diagnostics: t ? this.#l.value.diagnostics : void 0,
2666
2602
  draft: n,
2667
- moduleEditor: this.#R(a.revision, o, a.selectedNodeIds),
2603
+ moduleEditor: this.#j(a.revision, o, a.selectedNodeIds),
2668
2604
  selectedNodeIds: a.selectedNodeIds,
2669
2605
  target: o
2670
2606
  }), i;
2671
2607
  }
2672
- #R(e, t, n) {
2608
+ #j(e, t, n) {
2673
2609
  let r = this.#l.value.moduleEditor;
2674
- return r == null || Z(this.#l.value.draft, r) == "saved" ? Q(e, t, n) : {
2610
+ return r == null || Q(this.#l.value.draft, r) == "saved" ? $(e, t, n) : {
2675
2611
  ...r,
2676
2612
  phase: "failed"
2677
2613
  };
2678
2614
  }
2679
- #z(e) {
2680
- return !this.#_ && e.flowId == this.#l.value.flowId && e.current();
2615
+ #M(e) {
2616
+ return !this.#m && e.flowId == this.#l.value.flowId && e.current();
2681
2617
  }
2682
- #B(e) {
2683
- this.#_ || this.#l.set(e);
2618
+ #N(e) {
2619
+ this.#m || this.#l.set(e);
2684
2620
  }
2685
2621
  };
2686
2622
  //#endregion
2687
2623
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
2688
- function Wt(e) {
2624
+ function Bt(e) {
2689
2625
  return new Map(e.nodes.map((e) => [e.id, e]));
2690
2626
  }
2691
- function Gt(e, t) {
2692
- return e == null || t == null ? [] : I(e).designerInputs(t);
2627
+ function Vt(e, t) {
2628
+ return e == null || t == null ? [] : L(e).designerInputs(t);
2693
2629
  }
2694
- function Kt(e, t, n, r, i) {
2630
+ function Ht(e, t, n, r, i) {
2695
2631
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
2696
2632
  let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
2697
2633
  return typeof a == "string" ? new Map(r.flatMap((t) => {
@@ -2699,7 +2635,7 @@ function Kt(e, t, n, r, i) {
2699
2635
  return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
2700
2636
  })) : /* @__PURE__ */ new Map();
2701
2637
  }
2702
- var qt = { openExternalPage: async () => !1 }, Jt = class {
2638
+ var Ut = { openExternalPage: async () => !1 }, Wt = class {
2703
2639
  #e;
2704
2640
  #t;
2705
2641
  #n;
@@ -2710,16 +2646,16 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
2710
2646
  #s;
2711
2647
  #c;
2712
2648
  #l;
2713
- constructor(r, i, a = () => crypto.randomUUID(), o = L(), s = qt, c = !0) {
2714
- this.#t = new F(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new F(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => {
2649
+ constructor(r, i, a = () => crypto.randomUUID(), o = R(), s = Ut, c = !0) {
2650
+ this.#t = new I(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new I(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => {
2715
2651
  if (!e.startsWith("trigger:")) return await this.connectors.provideAddNodeOptionChoices(e, t);
2716
2652
  }, this.#e = r, this.#n = o, this.#i = c;
2717
2653
  let l = (e) => {
2718
2654
  this.#l || this.#r.set(e);
2719
2655
  };
2720
- this.runs = new Re(r, l, o), this.workspace = new Ut(r, l, lt, o, (e) => {
2656
+ this.runs = new Le(r, l, o), this.workspace = new zt(r, l, ct, o, (e) => {
2721
2657
  e.kind == "run.created" ? this.#d(r, e) : this.runs.changed(e.runId);
2722
- }), this.connectors = new Tt(r, this.workspace, l, s, o), this.triggers = new kt(r, this.workspace, l, s, o), this.publications = new pt(r, this.workspace, l, i, a, o), this.runRequests = new vt(r, this.runs, l, o, a);
2658
+ }), this.connectors = new wt(r, this.workspace, l, s, o), this.triggers = new Ot(r, this.workspace, l, s, o), this.publications = new ft(r, this.workspace, l, i, a, o), this.runRequests = new _t(r, this.runs, l, o, a);
2723
2659
  let u = n((e) => {
2724
2660
  let t = e(this.workspace.$.diagnostics);
2725
2661
  if (t == null) return;
@@ -2733,8 +2669,8 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
2733
2669
  let t = e(this.workspace.$.draft);
2734
2670
  f != t?.flowId && (d.clear(), f = t?.flowId);
2735
2671
  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 = [
2736
- ...Gt(t, n),
2737
- r == null || n == null ? void 0 : M(r, n),
2672
+ ...Vt(t, n),
2673
+ r == null || n == null ? void 0 : N(r, n),
2738
2674
  i,
2739
2675
  a,
2740
2676
  s,
@@ -2747,12 +2683,12 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
2747
2683
  ...l == null ? [] : [t?.revisionId]
2748
2684
  ], y = d.get(_);
2749
2685
  if (y != null && y.inputs.length == v.length && y.inputs.every((e, t) => e === v[t])) return y.graph;
2750
- let b = j(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
2686
+ let b = M(t, n, r, i, a, s, c, l, p, m, h, g, this.#i);
2751
2687
  return d.set(_, {
2752
2688
  graph: b,
2753
2689
  inputs: v
2754
2690
  }), b;
2755
- }), m = e(p, Wt);
2691
+ }), m = e(p, Bt);
2756
2692
  this.$ = {
2757
2693
  busy: n((e) => {
2758
2694
  let t = e(this.workspace.$.busy);
@@ -2768,7 +2704,7 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
2768
2704
  designer: p,
2769
2705
  designerNodeById: m,
2770
2706
  notice: this.#r,
2771
- runEventNodes: n((e) => Kt(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
2707
+ runEventNodes: n((e) => Ht(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(m))),
2772
2708
  selectedDesignerNode: n((e) => {
2773
2709
  let t = e(this.workspace.$.selectedNodeIds);
2774
2710
  return t.length == 1 ? e(m).get(t[0]) : void 0;
@@ -2869,13 +2805,13 @@ var qt = { openExternalPage: async () => !1 }, Jt = class {
2869
2805
  return;
2870
2806
  }
2871
2807
  }
2872
- }, Yt = We(() => import("./flowWorkspace-BewofPeU.js").then((e) => e.t));
2873
- function Xt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: l, tokenLabel: f }) {
2874
- let p = l != null && f != null && i != null, h = l ?? "", _ = /* @__PURE__ */ G(Ke, { children: [
2875
- /* @__PURE__ */ W("div", {
2808
+ }, Gt = Ue(() => import("./flowWorkspace-VnS8nLMT.js").then((e) => e.t));
2809
+ function Kt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: u }) {
2810
+ let m = s != null && u != null && i != null, h = s ?? "", _ = /* @__PURE__ */ q(Ge, { children: [
2811
+ /* @__PURE__ */ K("div", {
2876
2812
  "aria-hidden": "true",
2877
2813
  className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
2878
- children: /* @__PURE__ */ G("svg", {
2814
+ children: /* @__PURE__ */ q("svg", {
2879
2815
  className: "size-5",
2880
2816
  fill: "none",
2881
2817
  stroke: "currentColor",
@@ -2883,40 +2819,40 @@ function Xt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
2883
2819
  strokeLinejoin: "round",
2884
2820
  strokeWidth: "1.8",
2885
2821
  viewBox: "0 0 24 24",
2886
- children: [/* @__PURE__ */ W("rect", {
2822
+ children: [/* @__PURE__ */ K("rect", {
2887
2823
  height: "9",
2888
2824
  rx: "2",
2889
2825
  width: "14",
2890
2826
  x: "5",
2891
2827
  y: "11"
2892
- }), /* @__PURE__ */ W("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
2828
+ }), /* @__PURE__ */ K("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
2893
2829
  })
2894
2830
  }),
2895
- /* @__PURE__ */ G("header", {
2831
+ /* @__PURE__ */ q("header", {
2896
2832
  className: "flex flex-col gap-2",
2897
- children: [/* @__PURE__ */ W("h1", {
2833
+ children: [/* @__PURE__ */ K("h1", {
2898
2834
  className: "text-xl font-semibold tracking-tight text-balance",
2899
2835
  children: o
2900
- }), /* @__PURE__ */ W("p", {
2836
+ }), /* @__PURE__ */ K("p", {
2901
2837
  className: "text-sm/relaxed text-muted-foreground text-pretty",
2902
2838
  children: t
2903
2839
  })]
2904
2840
  }),
2905
- p && /* @__PURE__ */ W(v, { children: /* @__PURE__ */ G(g, {
2841
+ m && /* @__PURE__ */ K(f, { children: /* @__PURE__ */ q(d, {
2906
2842
  "data-invalid": n != null,
2907
2843
  children: [
2908
- /* @__PURE__ */ W(d, {
2844
+ /* @__PURE__ */ K(p, {
2909
2845
  htmlFor: "session-token",
2910
- children: f
2846
+ children: u
2911
2847
  }),
2912
- /* @__PURE__ */ W(s, {
2848
+ /* @__PURE__ */ K(l, {
2913
2849
  autoComplete: "username",
2914
2850
  name: "username",
2915
2851
  type: "hidden",
2916
2852
  value: "open-flow",
2917
2853
  readOnly: !0
2918
2854
  }),
2919
- /* @__PURE__ */ W(s, {
2855
+ /* @__PURE__ */ K(l, {
2920
2856
  autoComplete: "current-password",
2921
2857
  "aria-invalid": n != null,
2922
2858
  autoFocus: !0,
@@ -2928,46 +2864,46 @@ function Xt({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
2928
2864
  type: "password",
2929
2865
  value: h
2930
2866
  }),
2931
- n != null && /* @__PURE__ */ W(m, { children: n })
2867
+ n != null && /* @__PURE__ */ K(y, { children: n })
2932
2868
  ]
2933
2869
  }) }),
2934
- e != null && r != null && /* @__PURE__ */ G(c, {
2935
- disabled: a || p && h.length == 0,
2870
+ e != null && r != null && /* @__PURE__ */ q(c, {
2871
+ disabled: a || m && h.length == 0,
2936
2872
  size: "lg",
2937
2873
  type: "submit",
2938
- children: [a && /* @__PURE__ */ W(u, {
2874
+ children: [a && /* @__PURE__ */ K(g, {
2939
2875
  "aria-label": e,
2940
2876
  "data-icon": "inline-start"
2941
2877
  }), e]
2942
2878
  }),
2943
- a && e == null && /* @__PURE__ */ W(u, { "aria-label": t })
2944
- ] }), y = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
2945
- return /* @__PURE__ */ W("main", {
2879
+ a && e == null && /* @__PURE__ */ K(g, { "aria-label": t })
2880
+ ] }), v = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
2881
+ return /* @__PURE__ */ K("main", {
2946
2882
  className: "open-flow-workbench",
2947
- children: /* @__PURE__ */ W("div", {
2883
+ children: /* @__PURE__ */ K("div", {
2948
2884
  className: "grid h-full overflow-auto bg-muted/20 p-4",
2949
- children: r == null ? /* @__PURE__ */ W("section", {
2885
+ children: r == null ? /* @__PURE__ */ K("section", {
2950
2886
  "aria-busy": a,
2951
- className: y,
2887
+ className: v,
2952
2888
  children: _
2953
- }) : /* @__PURE__ */ W("form", {
2889
+ }) : /* @__PURE__ */ K("form", {
2954
2890
  "aria-busy": a,
2955
- className: y,
2891
+ className: v,
2956
2892
  onSubmit: r,
2957
2893
  children: _
2958
2894
  })
2959
2895
  })
2960
2896
  });
2961
2897
  }
2962
- function Zt({ host: e, store: t }) {
2898
+ function qt({ host: e, store: t }) {
2963
2899
  let n = a(t.$.notice);
2964
- return H(() => e.notify(n), [e, n]), H(() => () => e.notify(void 0), [e]), null;
2900
+ return W(() => e.notify(n), [e, n]), W(() => () => e.notify(void 0), [e]), null;
2965
2901
  }
2966
- function Qt({ 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 }) {
2902
+ function Jt({ 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 }) {
2967
2903
  let g = a(m.workspace.$.flowId);
2968
- return /* @__PURE__ */ W("div", {
2904
+ return /* @__PURE__ */ K("div", {
2969
2905
  className: "app-shell",
2970
- children: g == null ? /* @__PURE__ */ W(et, {
2906
+ children: g == null ? /* @__PURE__ */ K($e, {
2971
2907
  catalogWidth: e,
2972
2908
  createFlowDisabled: n,
2973
2909
  createFlowField: r,
@@ -2984,12 +2920,12 @@ function Qt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
2984
2920
  onLanguageChange: p,
2985
2921
  onSelectFlow: (e) => void u.selectFlow(e),
2986
2922
  store: m
2987
- }) : /* @__PURE__ */ W(Ue, {
2988
- fallback: /* @__PURE__ */ W("main", {
2923
+ }) : /* @__PURE__ */ K(He, {
2924
+ fallback: /* @__PURE__ */ K("main", {
2989
2925
  "aria-busy": "true",
2990
2926
  className: "workspace"
2991
2927
  }),
2992
- children: /* @__PURE__ */ W(Yt, {
2928
+ children: /* @__PURE__ */ K(Gt, {
2993
2929
  hostAction: s,
2994
2930
  hostTitle: c,
2995
2931
  hrefFor: o,
@@ -3002,18 +2938,18 @@ function Qt({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3002
2938
  })
3003
2939
  });
3004
2940
  }
3005
- function $t({ 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 }) {
3006
- let y = Ge(h);
2941
+ function Yt({ 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 }) {
2942
+ let y = We(h);
3007
2943
  y.current = h;
3008
- let [{ i18n: b, navigation: x, store: S }] = U(() => {
3009
- let e = L(u), t = new Jt(new Ee((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, () => crypto.randomUUID(), e, a, v);
2944
+ let [{ i18n: b, navigation: x, store: S }] = G(() => {
2945
+ let e = R(u), t = new Wt(new Ee((e, t) => a.request(e, t), (e, t) => a.subscribeFlow(e, t), (e) => a.subscribeFlowCatalog(e)), g, () => crypto.randomUUID(), e, a, v);
3010
2946
  return {
3011
2947
  i18n: e,
3012
- navigation: new qe(t, d, (e, t) => y.current(e, t)),
2948
+ navigation: new Ke(t, d, (e, t) => y.current(e, t)),
3013
2949
  store: t
3014
2950
  };
3015
2951
  });
3016
- return H(() => {
2952
+ return W(() => {
3017
2953
  x.start();
3018
2954
  let e = () => {
3019
2955
  S.connectors.refreshAfterAuthorization(), S.triggers.refreshAfterAuthorization(), S.refreshVariableNames();
@@ -3025,17 +2961,17 @@ function $t({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3025
2961
  b,
3026
2962
  x,
3027
2963
  S
3028
- ]), H(() => void x.apply(d), [d, x]), H(() => {
2964
+ ]), W(() => void x.apply(d), [d, x]), W(() => {
3029
2965
  b.lang != u && b.switchLang(u);
3030
- }, [b, u]), /* @__PURE__ */ W(o, {
2966
+ }, [b, u]), /* @__PURE__ */ K(o, {
3031
2967
  i18n: b,
3032
- children: /* @__PURE__ */ G("div", {
2968
+ children: /* @__PURE__ */ q("div", {
3033
2969
  className: "open-flow-theme open-flow-workbench",
3034
2970
  "data-theme": _,
3035
- children: [/* @__PURE__ */ W(Zt, {
2971
+ children: [/* @__PURE__ */ K(qt, {
3036
2972
  host: a,
3037
2973
  store: S
3038
- }), /* @__PURE__ */ W(Qt, {
2974
+ }), /* @__PURE__ */ K(Jt, {
3039
2975
  catalogWidth: e,
3040
2976
  createFlow: t,
3041
2977
  createFlowDisabled: n,
@@ -3055,8 +2991,8 @@ function $t({ catalogWidth: e, createFlow: t, createFlowDisabled: n, createFlowF
3055
2991
  })
3056
2992
  });
3057
2993
  }
3058
- function en({ sessionKey: e, ...t }) {
3059
- return /* @__PURE__ */ W($t, { ...t }, e);
2994
+ function Xt({ sessionKey: e, ...t }) {
2995
+ return /* @__PURE__ */ K(Yt, { ...t }, e);
3060
2996
  }
3061
2997
  //#endregion
3062
- export { Xt as OpenFlowSessionGate, en as OpenFlowWorkbench, Ve as isWorkbenchLanguage, He as resolveWorkbenchLanguage, Be as workbenchLanguageNames, ze as workbenchLanguages };
2998
+ export { Kt as OpenFlowSessionGate, Xt as OpenFlowWorkbench, Be as isWorkbenchLanguage, Ve as resolveWorkbenchLanguage, ze as workbenchLanguageNames, Re as workbenchLanguages };