@oomol-lab/open-flow 0.1.0-alpha.6 → 0.1.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
2
- import { Ir as r, Rr as i, Wr as a } from "./createLucideIcon-ggJB9CTC.js";
3
- import { _ as o, a as s, at as c, c as l, ct as u, d, f, g as p, h as m, i as h, l as g, lt as _, n as ee, o as v, p as y, t as b, u as te, v as ne } from "./addNodeOptions-C4wix0_u.js";
4
- import { Suspense as re, lazy as ie, useEffect as x, useRef as ae, useState as oe } from "react";
5
- import { jsx as S, jsxs as se } from "react/jsx-runtime";
2
+ import { Ar as r, Dr as i, Ir as a, Or as o } from "./createLucideIcon-CqjqCezK.js";
3
+ import { $ as s, Q as c, Y as l, _ as u, a as d, c as f, d as p, f as m, g as h, i as g, l as _, m as v, n as ee, o as y, t as b, u as te, v as x, y as ne } from "./addNodeOptions-DRndy4EK.js";
4
+ import { Suspense as re, lazy as ie, useEffect as S, useRef as ae, useState as oe } from "react";
5
+ import { jsx as C, jsxs as se } from "react/jsx-runtime";
6
6
  //#region src/workbench/browser/runtime/navigation.ts
7
7
  var ce = class {
8
8
  #e;
@@ -63,7 +63,7 @@ var ce = class {
63
63
  this.#s = !0, await this.#n.selectFlow(void 0), e == this.#i && (this.#u("design", !1), this.#s = !1);
64
64
  }
65
65
  async apply(e) {
66
- if (le(e, this.#t)) return;
66
+ if (w(e, this.#t)) return;
67
67
  this.#t = e;
68
68
  let t = ++this.#i;
69
69
  this.#s = !0;
@@ -79,15 +79,15 @@ var ce = class {
79
79
  flowId: this.#n.workspace.$.flowId.value,
80
80
  view: e
81
81
  };
82
- le(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
82
+ w(n, this.#t) || (this.#t = n, this.#e(n, { replace: t })), this.#r.set(e);
83
83
  }
84
84
  };
85
- function le(e, t) {
85
+ function w(e, t) {
86
86
  return e.flowId == t.flowId && e.view == t.view;
87
87
  }
88
88
  //#endregion
89
89
  //#region src/workbench/browser/runtime/publications/publicationStore.ts
90
- var C = {
90
+ var T = {
91
91
  activities: [],
92
92
  activitiesLoadFailed: !1,
93
93
  activitiesLoading: !1,
@@ -100,23 +100,23 @@ var C = {
100
100
  loadingMore: !1,
101
101
  publications: [],
102
102
  publishing: !1
103
- }, w = 20, ue = 50;
104
- function T(e, t) {
103
+ }, le = 20, ue = 50;
104
+ function E(e, t) {
105
105
  return e?.flowId == t.flowId;
106
106
  }
107
107
  var de = class {
108
108
  #e;
109
109
  #t;
110
110
  #n;
111
- #r = new o();
112
- #i = new o();
113
- #a = new o();
114
- #o = new o();
111
+ #r = new x();
112
+ #i = new x();
113
+ #a = new x();
114
+ #o = new x();
115
115
  #s;
116
- #c = t(C);
116
+ #c = t(T);
117
117
  #l;
118
118
  #u;
119
- constructor(t, n, r, i = () => crypto.randomUUID(), a = c()) {
119
+ constructor(t, n, r, i = () => crypto.randomUUID(), a = l()) {
120
120
  this.#e = t, this.#t = i, this.#n = a, this.#s = r, this.#l = n, this.$ = {
121
121
  activities: e(this.#c, (e) => e.activities),
122
122
  activitiesLoadFailed: e(this.#c, (e) => e.activitiesLoadFailed),
@@ -148,12 +148,12 @@ var de = class {
148
148
  this.#c.dispose();
149
149
  }
150
150
  reset() {
151
- this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(C);
151
+ this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(T);
152
152
  }
153
153
  async load(e) {
154
154
  let t = { flowId: e }, n = this.#r.begin();
155
- T(this.#c.value.target, t) || (this.#u = void 0), this.#s(void 0), this.#c.set({
156
- ...C,
155
+ E(this.#c.value.target, t) || (this.#u = void 0), this.#s(void 0), this.#c.set({
156
+ ...T,
157
157
  loading: !0,
158
158
  target: t
159
159
  });
@@ -173,7 +173,7 @@ var de = class {
173
173
  this.#h({
174
174
  loadFailed: !0,
175
175
  loading: !1
176
- }), this.#s(p(e, this.#n.t));
176
+ }), this.#s(u(e, this.#n.t));
177
177
  }
178
178
  }
179
179
  async loadMore() {
@@ -202,7 +202,7 @@ var de = class {
202
202
  this.#h({
203
203
  loadMoreFailed: !0,
204
204
  loadingMore: !1
205
- }), this.#s(p(e, this.#n.t));
205
+ }), this.#s(u(e, this.#n.t));
206
206
  }
207
207
  }
208
208
  async publish() {
@@ -224,7 +224,7 @@ var de = class {
224
224
  message: this.#n.t("notice.published", { name: e.name })
225
225
  }), !0);
226
226
  } catch (e) {
227
- return o() ? (e instanceof _ && e.code == "live.conflict" && await this.#f(n), this.#s(p(e, this.#n.t)), !1) : !1;
227
+ return o() ? (e instanceof s && e.code == "live.conflict" && await this.#f(n), this.#s(u(e, this.#n.t)), !1) : !1;
228
228
  } finally {
229
229
  o() && this.#h({ publishing: !1 });
230
230
  }
@@ -240,17 +240,17 @@ var de = class {
240
240
  }), o = this.#u?.signature == a ? this.#u : {
241
241
  key: this.#t(),
242
242
  signature: a
243
- }, s = this.#i.begin();
243
+ }, c = this.#i.begin();
244
244
  this.#u = o, this.#s(void 0), this.#h({ rollingBackPublicationId: e.publicationId });
245
245
  try {
246
- return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !s() || (await this.#d(r), !s()) ? !1 : (this.#u = void 0, this.#s({
246
+ return await this.#e.rollbackFlow(r.flowId, e.publicationId, i, { idempotencyKey: o.key }), !c() || (await this.#d(r), !c()) ? !1 : (this.#u = void 0, this.#s({
247
247
  kind: "success",
248
248
  message: this.#n.t("notice.rolledBack", { revision: e.revisionId })
249
249
  }), !0);
250
250
  } catch (e) {
251
- return s() ? (e instanceof _ && e.code == "live.conflict" && await this.#f(r), this.#s(p(e, this.#n.t)), !1) : !1;
251
+ return c() ? (e instanceof s && e.code == "live.conflict" && await this.#f(r), this.#s(u(e, this.#n.t)), !1) : !1;
252
252
  } finally {
253
- s() && this.#h({ rollingBackPublicationId: void 0 });
253
+ c() && this.#h({ rollingBackPublicationId: void 0 });
254
254
  }
255
255
  }
256
256
  closeTrigger() {
@@ -283,13 +283,13 @@ var de = class {
283
283
  testingTriggerId: void 0,
284
284
  testResult: void 0
285
285
  });
286
- let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: w })]);
286
+ let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: le })]);
287
287
  if (n()) {
288
288
  if (r.status == "rejected") {
289
289
  this.#h({
290
290
  activitiesLoading: !1,
291
291
  detailLoading: !1
292
- }), this.#s(p(r.reason, this.#n.t));
292
+ }), this.#s(u(r.reason, this.#n.t));
293
293
  return;
294
294
  }
295
295
  this.#h({
@@ -303,7 +303,7 @@ var de = class {
303
303
  }) : (this.#h({
304
304
  activitiesLoadFailed: !0,
305
305
  activitiesLoading: !1
306
- }), this.#s(p(i.reason, this.#n.t)));
306
+ }), this.#s(u(i.reason, this.#n.t)));
307
307
  }
308
308
  }
309
309
  async loadMoreTriggerActivities() {
@@ -317,7 +317,7 @@ var de = class {
317
317
  try {
318
318
  let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
319
319
  cursor: t,
320
- limit: w
320
+ limit: le
321
321
  });
322
322
  if (!i() || this.#c.value.selectedTriggerId != n) return;
323
323
  let a = new Set(this.#c.value.activities.map((e) => e.activityId));
@@ -332,7 +332,7 @@ var de = class {
332
332
  this.#h({
333
333
  activitiesLoadFailed: !0,
334
334
  activitiesLoadingMore: !1
335
- }), this.#s(p(e, this.#n.t));
335
+ }), this.#s(u(e, this.#n.t));
336
336
  }
337
337
  }
338
338
  async testTrigger() {
@@ -347,7 +347,7 @@ var de = class {
347
347
  let e = await this.#e.testFlowPollTrigger(n.flowId, t);
348
348
  return !i() || this.#c.value.selectedTriggerId != t ? !1 : (this.#h({ testResult: e }), !0);
349
349
  } catch (e) {
350
- return i() && this.#c.value.selectedTriggerId == t && this.#s(p(e, this.#n.t)), !1;
350
+ return i() && this.#c.value.selectedTriggerId == t && this.#s(u(e, this.#n.t)), !1;
351
351
  } finally {
352
352
  i() && this.#c.value.selectedTriggerId == t && this.#h({ testingTriggerId: void 0 });
353
353
  }
@@ -365,14 +365,14 @@ var de = class {
365
365
  message: this.#n.t(e.operatorState == "active" ? "notice.triggerPaused" : "notice.triggerResumed")
366
366
  }), !0) : !1;
367
367
  } catch (e) {
368
- return n() && this.#s(p(e, this.#n.t)), !1;
368
+ return n() && this.#s(u(e, this.#n.t)), !1;
369
369
  } finally {
370
370
  n() && this.#h({ changingTriggerId: void 0 });
371
371
  }
372
372
  }
373
373
  async #d(e) {
374
374
  let [t, n, r] = await this.#p(e);
375
- this.#l.updateLive(t), await this.#l.refreshFlows(), T(this.#c.value.target, e) && this.#h({
375
+ this.#l.updateLive(t), await this.#l.refreshFlows(), E(this.#c.value.target, e) && this.#h({
376
376
  bindings: r,
377
377
  live: t,
378
378
  loadFailed: !1,
@@ -399,8 +399,8 @@ var de = class {
399
399
  ]);
400
400
  }
401
401
  #m(e, t) {
402
- T(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
403
- ...C,
402
+ E(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
403
+ ...T,
404
404
  ...t,
405
405
  target: e
406
406
  });
@@ -411,24 +411,24 @@ var de = class {
411
411
  ...e
412
412
  });
413
413
  }
414
- }, E = { starting: !1 };
415
- function fe(e) {
414
+ }, fe = { starting: !1 };
415
+ function pe(e) {
416
416
  switch (e.kind) {
417
417
  case "condition": return { [e.node.input.handle]: e.node.input };
418
- case "subflow": return e.definition?.inputs ?? {};
419
- case "task": return e.definition?.inputs ?? {};
418
+ case "subflow": return o(e.definition?.inputs ?? []);
419
+ case "task": return o(e.definition?.inputs ?? []);
420
420
  case "value": return {};
421
421
  }
422
422
  }
423
- function pe(e) {
423
+ function me(e) {
424
424
  return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
425
425
  }
426
- async function me(e, t) {
427
- let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DXOyyY7o.js").then((e) => e.n), r = m(e), i = r.graph({ kind: "flow" });
426
+ async function he(e, t) {
427
+ let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-DXOyyY7o.js").then((e) => e.n), r = h(e), i = r.graph({ kind: "flow" });
428
428
  return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
429
429
  let a = r.resolveNode(e, i);
430
430
  if (a.kind == "trigger") return [];
431
- let o = Object.entries(fe(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
431
+ let o = Object.entries(pe(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
432
432
  handle: e,
433
433
  jsonSchema: t.jsonSchema,
434
434
  nullable: t.nullable
@@ -436,21 +436,21 @@ async function me(e, t) {
436
436
  return o.length == 0 ? [] : [{
437
437
  editor: new n(o, t),
438
438
  nodeId: e,
439
- title: pe(a)
439
+ title: me(a)
440
440
  }];
441
441
  });
442
442
  }
443
- var he = class {
443
+ var ge = class {
444
444
  #e;
445
445
  #t;
446
446
  #n;
447
- #r = new o();
448
- #i = new o();
447
+ #r = new x();
448
+ #i = new x();
449
449
  #a;
450
450
  #o;
451
- #s = t(E);
451
+ #s = t(fe);
452
452
  #c;
453
- constructor(t, n, r, i = c(), a = () => crypto.randomUUID()) {
453
+ constructor(t, n, r, i = l(), a = () => crypto.randomUUID()) {
454
454
  this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
455
455
  inputRequest: e(this.#s, (e) => e.inputRequest),
456
456
  starting: e(this.#s, (e) => e.starting),
@@ -465,7 +465,7 @@ var he = class {
465
465
  reset() {
466
466
  this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
467
467
  let e = this.#s.value.inputRequest;
468
- this.#s.set(E), this.#d(e);
468
+ this.#s.set(fe), this.#d(e);
469
469
  }
470
470
  async requestDraft(e, t) {
471
471
  let n = this.#i.begin();
@@ -480,7 +480,7 @@ var he = class {
480
480
  let r = await this.#e.getRevision(e.flowId, n.revisionId);
481
481
  return t() ? await this.#l("live", e, r, n.revisionId, t, n.publicationId) : "unavailable";
482
482
  } catch (e) {
483
- return t() && this.#o(p(e, this.#n.t)), "unavailable";
483
+ return t() && this.#o(u(e, this.#n.t)), "unavailable";
484
484
  } finally {
485
485
  t() && this.#f({ starting: !1 });
486
486
  }
@@ -508,7 +508,7 @@ var he = class {
508
508
  }), this.#d(s);
509
509
  let c;
510
510
  try {
511
- c = await me(r, this.#n.lang$);
511
+ c = await he(r, this.#n.lang$);
512
512
  } catch (e) {
513
513
  throw a() && this.#f({
514
514
  starting: !1,
@@ -564,7 +564,7 @@ var he = class {
564
564
  });
565
565
  return !a() || !o() ? !1 : (this.#c = void 0, this.#a.follow(s, o));
566
566
  } catch (e) {
567
- return a() && o() && this.#o(p(e, this.#n.t)), !1;
567
+ return a() && o() && this.#o(u(e, this.#n.t)), !1;
568
568
  } finally {
569
569
  a() && this.#f({
570
570
  starting: !1,
@@ -611,7 +611,7 @@ function k(e, t) {
611
611
  outputs: O(e.outputs)
612
612
  };
613
613
  }
614
- function ge(e, t) {
614
+ function _e(e, t) {
615
615
  let n = /* @__PURE__ */ new Map();
616
616
  for (let t of e) {
617
617
  let e = n.get(t.serviceId) ?? [];
@@ -640,7 +640,7 @@ function ge(e, t) {
640
640
  };
641
641
  });
642
642
  }
643
- function _e(e, t) {
643
+ function ve(e, t) {
644
644
  return {
645
645
  choices: [],
646
646
  description: t("addNode.connectorBrowseActions"),
@@ -664,7 +664,7 @@ function A(e) {
664
664
  taskId: e.node.taskId
665
665
  };
666
666
  }
667
- var ve = class {
667
+ var ye = class {
668
668
  #e;
669
669
  #t;
670
670
  #n;
@@ -679,13 +679,13 @@ var ve = class {
679
679
  #d;
680
680
  #f;
681
681
  #p;
682
- constructor(r, i, a, s, l = c()) {
683
- this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new o(), this.#l = t(D), this.#p = !1, this.browseAddNodeOptions = async (e) => {
682
+ constructor(r, i, a, o, s = l()) {
683
+ this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new x(), this.#l = t(D), this.#p = !1, this.browseAddNodeOptions = async (e) => {
684
684
  if (this.#p) return;
685
685
  let t = this.#u.$.flowId.value;
686
686
  if (t == null) return;
687
687
  let n = this.#f ?? await this.#e.listConnectorProviders(e);
688
- if (!(e.aborted || this.#p || t != this.#u.$.flowId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => _e(e, this.#t.t));
688
+ if (!(e.aborted || this.#p || t != this.#u.$.flowId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => ve(e, this.#t.t));
689
689
  }, this.provideAddNodeOptionChoices = async (e, t) => {
690
690
  if (this.#p) return;
691
691
  let n = this.#u.$.flowId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
@@ -711,9 +711,9 @@ var ve = class {
711
711
  let t = a[e];
712
712
  t != null && o.set(e, t);
713
713
  }
714
- return ge([...o.values()], this.#t.t);
715
- }, this.#e = r, this.#n = s, this.#u = i, this.#c = a, this.#t = l;
716
- let u = e(this.#l, (e) => e.actions), d = e(this.#l, (e) => e.catalogs);
714
+ return _e([...o.values()], this.#t.t);
715
+ }, this.#e = r, this.#n = o, this.#u = i, this.#c = a, this.#t = s;
716
+ let c = e(this.#l, (e) => e.actions), u = e(this.#l, (e) => e.catalogs);
717
717
  this.#s = n((e) => {
718
718
  let t = A(e(i.$.selection)), n = e(this.#l);
719
719
  if (t == null) return { authorizationPending: !1 };
@@ -728,8 +728,8 @@ var ve = class {
728
728
  };
729
729
  }), this.$ = {
730
730
  actionLoading: e(this.#l, (e) => e.actionLoading),
731
- actions: u,
732
- catalogs: d,
731
+ actions: c,
732
+ catalogs: u,
733
733
  connectionLoading: e(this.#l, (e) => e.connectionLoading),
734
734
  selectedAction: e(this.#s, (e) => e.action),
735
735
  selectedActionError: e(this.#s, (e) => e.actionError),
@@ -773,7 +773,7 @@ var ve = class {
773
773
  } catch (e) {
774
774
  this.#y(t, n) && this.#v({ actionError: {
775
775
  actionId: r.actionId,
776
- message: p(e, this.#t.t).message
776
+ message: u(e, this.#t.t).message
777
777
  } });
778
778
  } finally {
779
779
  this.#y(t, n) && this.#l.value.actionLoading == r.actionId && this.#v({ actionLoading: void 0 });
@@ -798,7 +798,7 @@ var ve = class {
798
798
  serviceId: e
799
799
  }, this.#v({ authorizationServiceId: e });
800
800
  } catch (e) {
801
- this.#p || this.#c(p(e, this.#t.t));
801
+ this.#p || this.#c(u(e, this.#t.t));
802
802
  }
803
803
  }
804
804
  async setConnection(e, t) {
@@ -831,13 +831,13 @@ var ve = class {
831
831
  a = await this.#e.listConnectorConnections(t);
832
832
  } catch (n) {
833
833
  this.#y(r, e) && this.#v({ connectionError: {
834
- message: p(n, this.#t.t).message,
834
+ message: u(n, this.#t.t).message,
835
835
  serviceId: t
836
836
  } });
837
837
  return;
838
838
  }
839
839
  if (!this.#y(r, e)) return;
840
- let o = s(a);
840
+ let o = d(a);
841
841
  return this.#v({ catalogs: {
842
842
  ...this.#l.value.catalogs,
843
843
  [t]: o
@@ -907,7 +907,7 @@ function F(e, t, n, r) {
907
907
  }
908
908
  };
909
909
  }
910
- function ye(e, t) {
910
+ function I(e, t) {
911
911
  return {
912
912
  choices: [],
913
913
  description: t.t("addNode.triggerChooseConnection"),
@@ -919,7 +919,7 @@ function ye(e, t) {
919
919
  outputs: []
920
920
  };
921
921
  }
922
- function be(e, t, n) {
922
+ function L(e, t, n) {
923
923
  let r = n.t("addNode.triggers"), i = t.preferred;
924
924
  return i == null ? t.active.length > 0 ? t.active.map((t) => F(e, t.connectionId, t.displayName, r)) : [{
925
925
  description: n.t("addNode.triggerNeedsConnection", { provider: e.provider }),
@@ -935,10 +935,10 @@ function be(e, t, n) {
935
935
  }
936
936
  }] : [F(e, i.connectionId, i.displayName, r)];
937
937
  }
938
- function xe(e, t, n) {
938
+ function be(e, t, n) {
939
939
  let r = t.preferred;
940
940
  if (r != null) return F(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
941
- let i = ye(e, n), a = be(e, t, n);
941
+ let i = I(e, n), a = L(e, t, n);
942
942
  return {
943
943
  ...i,
944
944
  description: t.active.length == 0 ? n.t("addNode.triggerNeedsConnection", { provider: e.provider }) : i.description,
@@ -953,7 +953,7 @@ function xe(e, t, n) {
953
953
  }))
954
954
  };
955
955
  }
956
- var Se = class {
956
+ var xe = class {
957
957
  #e;
958
958
  #t;
959
959
  #n;
@@ -965,12 +965,12 @@ var Se = class {
965
965
  #c;
966
966
  #l;
967
967
  #u;
968
- constructor(r, i, a, l, u = c()) {
969
- this.#t = new AbortController(), this.#a = new o(), this.#c = t(j), this.#u = !1, this.browseAddNodeOptions = async (e) => {
968
+ constructor(r, i, a, o, s = l()) {
969
+ this.#t = new AbortController(), this.#a = new x(), this.#c = t(j), this.#u = !1, this.browseAddNodeOptions = async (e) => {
970
970
  let t = this.#l.$.flowId.value;
971
971
  if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
972
972
  let n = await this.#d();
973
- if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => ye(e, this.#i));
973
+ if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => I(e, this.#i));
974
974
  }, this.provideAddNodeOptions = async (e, t) => {
975
975
  let n = this.#l.$.flowId.value;
976
976
  if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
@@ -987,14 +987,14 @@ var Se = class {
987
987
  e.type
988
988
  ].some((e) => e.toLowerCase().includes(r))), o = [...new Set(a.map((e) => e.provider))].filter((e) => this.#c.value.catalogs[e] == null);
989
989
  for (let e = 0; e < o.length; e += M) {
990
- let r = await Promise.all(o.slice(e, e + M).map(async (e) => [e, s(await this.#n.listConnectorConnections(e, t))]));
990
+ let r = await Promise.all(o.slice(e, e + M).map(async (e) => [e, d(await this.#n.listConnectorConnections(e, t))]));
991
991
  if (t.aborted || this.#u || n != this.#l.$.flowId.value) return;
992
992
  this.#f({ catalogs: {
993
993
  ...this.#c.value.catalogs,
994
994
  ...Object.fromEntries(r)
995
995
  } });
996
996
  }
997
- return a.map((e) => xe(e, this.#c.value.catalogs[e.provider], this.#i));
997
+ return a.map((e) => be(e, this.#c.value.catalogs[e.provider], this.#i));
998
998
  }, this.provideAddNodeOptionChoices = async (e, t) => {
999
999
  let n = this.#l.$.flowId.value, r = e.startsWith(N) ? e.slice(8) : void 0;
1000
1000
  if (t.aborted || this.#u || n == null || r == null || this.#l.$.target.value?.kind != "flow") return;
@@ -1002,14 +1002,14 @@ var Se = class {
1002
1002
  if (t.aborted || this.#u || n != this.#l.$.flowId.value || i == null) return;
1003
1003
  let a = this.#c.value.catalogs[i.provider];
1004
1004
  if (a == null) {
1005
- if (a = s(await this.#n.listConnectorConnections(i.provider, t)), t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1005
+ if (a = d(await this.#n.listConnectorConnections(i.provider, t)), t.aborted || this.#u || n != this.#l.$.flowId.value) return;
1006
1006
  this.#f({ catalogs: {
1007
1007
  ...this.#c.value.catalogs,
1008
1008
  [i.provider]: a
1009
1009
  } });
1010
1010
  }
1011
- return be(i, a, this.#i);
1012
- }, this.#n = r, this.#r = l, this.#i = u, this.#s = a, this.#l = i, this.#o = n((e) => {
1011
+ return L(i, a, this.#i);
1012
+ }, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
1013
1013
  let t = e(i.$.selection), n = P(t, i), r = e(this.#c);
1014
1014
  if (t?.kind != "trigger") return { authorizationPending: !1 };
1015
1015
  let a = t.trigger;
@@ -1052,7 +1052,7 @@ var Se = class {
1052
1052
  connectionLoading: r.provider
1053
1053
  });
1054
1054
  try {
1055
- let e = s(await this.#n.listConnectorConnections(r.provider));
1055
+ let e = d(await this.#n.listConnectorConnections(r.provider));
1056
1056
  if (!this.#p(t, n)) return;
1057
1057
  this.#f({ catalogs: {
1058
1058
  ...this.#c.value.catalogs,
@@ -1060,7 +1060,7 @@ var Se = class {
1060
1060
  } });
1061
1061
  } catch (e) {
1062
1062
  this.#p(t, n) && this.#f({ connectionError: {
1063
- message: p(e, this.#i.t).message,
1063
+ message: u(e, this.#i.t).message,
1064
1064
  provider: r.provider
1065
1065
  } });
1066
1066
  } finally {
@@ -1081,7 +1081,7 @@ var Se = class {
1081
1081
  }
1082
1082
  !this.#u && t == this.#l.$.flowId.value && this.#f({ authorizationProvider: e });
1083
1083
  } catch (e) {
1084
- this.#u || this.#s(p(e, this.#i.t));
1084
+ this.#u || this.#s(u(e, this.#i.t));
1085
1085
  }
1086
1086
  }
1087
1087
  async setConnection(e, t) {
@@ -1118,38 +1118,38 @@ var Se = class {
1118
1118
  };
1119
1119
  //#endregion
1120
1120
  //#region src/flow/common/edgeChanges.ts
1121
- function I(e, t, n) {
1121
+ function R(e, t, n) {
1122
1122
  let r = {
1123
1123
  source: n.source,
1124
1124
  sourceHandle: n.sourceHandle,
1125
1125
  target: n.target,
1126
1126
  targetHandle: n.targetHandle
1127
- }, i = L(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1127
+ }, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1128
1128
  return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
1129
1129
  edge: r,
1130
1130
  kind: "graph.edge.connect",
1131
1131
  target: t
1132
1132
  }];
1133
1133
  }
1134
- function Ce(e, t, n) {
1134
+ function Se(e, t, n) {
1135
1135
  let r = {
1136
1136
  source: n.source,
1137
1137
  sourceHandle: n.sourceHandle,
1138
1138
  target: n.target,
1139
1139
  targetHandle: n.targetHandle
1140
- }, i = L(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1140
+ }, i = z(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
1141
1141
  return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
1142
1142
  edge: r,
1143
1143
  kind: "graph.edge.disconnect",
1144
1144
  target: t
1145
1145
  }];
1146
1146
  }
1147
- function L(e, t) {
1147
+ function z(e, t) {
1148
1148
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1149
1149
  }
1150
1150
  //#endregion
1151
1151
  //#region src/flow/common/moduleChanges.ts
1152
- async function we(e) {
1152
+ async function Ce(e) {
1153
1153
  try {
1154
1154
  let { parse: t } = await import("./lib-GrGxYjsJ.js"), n = t(e, {
1155
1155
  errorRecovery: !0,
@@ -1165,7 +1165,7 @@ async function we(e) {
1165
1165
  return [];
1166
1166
  }
1167
1167
  }
1168
- function Te(e, t, n) {
1168
+ function we(e, t, n) {
1169
1169
  return [{
1170
1170
  imports: n,
1171
1171
  kind: "module.source.replace",
@@ -1175,19 +1175,21 @@ function Te(e, t, n) {
1175
1175
  }
1176
1176
  //#endregion
1177
1177
  //#region src/flow/common/nodeChanges.ts
1178
- function Ee(e, t, n, r = {
1178
+ function Te(e, t, n, r = {
1179
1179
  imports: [],
1180
1180
  source: "export default function run(input) {\n return { result: input.value }\n}\n"
1181
1181
  }, i = {
1182
- inputs: { value: {
1182
+ inputs: [{
1183
+ handle: "value",
1183
1184
  jsonSchema: {},
1184
1185
  nullable: !0,
1185
1186
  value: null
1186
- } },
1187
- outputs: { result: {
1187
+ }],
1188
+ outputs: [{
1189
+ handle: "result",
1188
1190
  jsonSchema: {},
1189
1191
  nullable: !0
1190
- } }
1192
+ }]
1191
1193
  }) {
1192
1194
  return [{
1193
1195
  kind: "module.create",
@@ -1200,7 +1202,7 @@ function Ee(e, t, n, r = {
1200
1202
  kind: "graph.node.create",
1201
1203
  node: {
1202
1204
  concurrency: 1,
1203
- inputs: V(i.inputs),
1205
+ inputs: U(i.inputs),
1204
1206
  kind: "task",
1205
1207
  name: n,
1206
1208
  task: {
@@ -1214,7 +1216,7 @@ function Ee(e, t, n, r = {
1214
1216
  target: e
1215
1217
  }];
1216
1218
  }
1217
- function R(e, t, n) {
1219
+ function B(e, t, n) {
1218
1220
  return [{
1219
1221
  kind: "task.create",
1220
1222
  task: n,
@@ -1223,7 +1225,7 @@ function R(e, t, n) {
1223
1225
  kind: "graph.node.create",
1224
1226
  node: {
1225
1227
  concurrency: 1,
1226
- inputs: V(n.inputs),
1228
+ inputs: U(n.inputs),
1227
1229
  kind: "task",
1228
1230
  name: n.name,
1229
1231
  taskId: t.taskId
@@ -1232,54 +1234,60 @@ function R(e, t, n) {
1232
1234
  target: e
1233
1235
  }];
1234
1236
  }
1235
- function De(e, t, n, r, i, a = {}) {
1237
+ function Ee(e, t, n, r, i, a = {}) {
1236
1238
  let o = a.inputs ?? {};
1237
- return R(e, t, {
1239
+ return B(e, t, {
1238
1240
  executor: {
1239
1241
  kind: "llm",
1240
1242
  mode: r
1241
1243
  },
1242
- inputs: {
1243
- messages: {
1244
+ inputs: [
1245
+ {
1246
+ handle: "messages",
1244
1247
  jsonSchema: {
1245
1248
  items: { type: "object" },
1246
1249
  type: "array"
1247
1250
  },
1248
1251
  nullable: !0,
1249
- value: H(o, "messages", null)
1252
+ value: W(o, "messages", null)
1250
1253
  },
1251
- input: {
1254
+ {
1255
+ handle: "input",
1252
1256
  jsonSchema: { type: "string" },
1253
1257
  nullable: !1,
1254
- value: H(o, "input", "Alex")
1258
+ value: W(o, "input", "Alex")
1255
1259
  },
1256
- template: {
1260
+ {
1261
+ handle: "template",
1257
1262
  jsonSchema: {
1258
1263
  items: { type: "object" },
1259
1264
  minItems: 1,
1260
1265
  type: "array"
1261
1266
  },
1262
1267
  nullable: !1,
1263
- value: H(o, "template", [{
1268
+ value: W(o, "template", [{
1264
1269
  content: "Hello, I'm {{input}}",
1265
1270
  role: "user"
1266
1271
  }])
1267
1272
  },
1268
- model: {
1273
+ {
1274
+ handle: "model",
1269
1275
  jsonSchema: { type: "object" },
1270
1276
  nullable: !1,
1271
- value: H(o, "model", { model: "deepseek-v4-flash" })
1277
+ value: W(o, "model", { model: "deepseek-v4-flash" })
1272
1278
  }
1273
- },
1279
+ ],
1274
1280
  name: n,
1275
- outputs: { output: a.output ?? {
1276
- description: i,
1277
- jsonSchema: r == "chat" ? { type: "string" } : {},
1278
- nullable: !1
1279
- } }
1281
+ outputs: [{
1282
+ ...a.output,
1283
+ description: a.output?.description ?? i,
1284
+ handle: "output",
1285
+ jsonSchema: a.output?.jsonSchema ?? (r == "chat" ? { type: "string" } : {}),
1286
+ nullable: a.output?.nullable ?? !1
1287
+ }]
1280
1288
  });
1281
1289
  }
1282
- function Oe(e, t, n) {
1290
+ function De(e, t, n) {
1283
1291
  return [{
1284
1292
  kind: "graph.node.create",
1285
1293
  node: {
@@ -1310,7 +1318,7 @@ function Oe(e, t, n) {
1310
1318
  target: e
1311
1319
  }];
1312
1320
  }
1313
- function ke(e, t, n) {
1321
+ function Oe(e, t, n) {
1314
1322
  return [{
1315
1323
  kind: "graph.node.create",
1316
1324
  node: {
@@ -1318,17 +1326,18 @@ function ke(e, t, n) {
1318
1326
  inputs: {},
1319
1327
  kind: "value",
1320
1328
  name: n,
1321
- values: { value: {
1329
+ values: [{
1330
+ handle: "value",
1322
1331
  jsonSchema: {},
1323
1332
  nullable: !0,
1324
1333
  value: null
1325
- } }
1334
+ }]
1326
1335
  },
1327
1336
  nodeId: t,
1328
1337
  target: e
1329
1338
  }];
1330
1339
  }
1331
- function z(e, t, n) {
1340
+ function V(e, t, n) {
1332
1341
  return [{
1333
1342
  kind: "graph.node.create",
1334
1343
  node: n,
@@ -1336,7 +1345,7 @@ function z(e, t, n) {
1336
1345
  target: e
1337
1346
  }];
1338
1347
  }
1339
- function Ae(e, t, n, r) {
1348
+ function ke(e, t, n, r) {
1340
1349
  let i = r.name ?? n.displayName, a = n.type == "poll" ? {
1341
1350
  bindingId: t.bindingId,
1342
1351
  config: r.config,
@@ -1369,8 +1378,8 @@ function Ae(e, t, n, r) {
1369
1378
  target: e
1370
1379
  }];
1371
1380
  }
1372
- function je(e, t, n) {
1373
- let r = B(e, t)?.nodes;
1381
+ function Ae(e, t, n) {
1382
+ let r = H(e, t)?.nodes;
1374
1383
  if (r == null) return [];
1375
1384
  let i = new Set(n), a = n.flatMap((e) => {
1376
1385
  let n = r[e];
@@ -1394,32 +1403,32 @@ function je(e, t, n) {
1394
1403
  });
1395
1404
  return a;
1396
1405
  }
1397
- function Me(e, t, n, r) {
1398
- let i = B(e, t)?.nodes[n];
1406
+ function je(e, t, n, r) {
1407
+ let i = H(e, t)?.nodes[n];
1399
1408
  if (i == null || !("inputs" in i)) return;
1400
1409
  let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
1401
- return U(t, n, {
1410
+ return G(t, n, {
1402
1411
  ...c,
1403
1412
  ...r
1404
1413
  });
1405
1414
  }
1406
- function Ne(e, t, n, r, i) {
1407
- return Pe(e, t, n, { [r]: i });
1415
+ function Me(e, t, n, r, i) {
1416
+ return Ne(e, t, n, { [r]: i });
1408
1417
  }
1409
- function Pe(e, t, n, r) {
1410
- let i = B(e, t)?.nodes[n];
1418
+ function Ne(e, t, n, r) {
1419
+ let i = H(e, t)?.nodes[n];
1411
1420
  if (i == null || !("inputs" in i)) return;
1412
1421
  let a = { ...i.inputs };
1413
1422
  for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
1414
1423
  kind: "value",
1415
1424
  value: t
1416
1425
  };
1417
- return U(t, n, {
1426
+ return G(t, n, {
1418
1427
  ...i,
1419
1428
  inputs: a
1420
1429
  });
1421
1430
  }
1422
- function Fe(e, t, n) {
1431
+ function Pe(e, t, n) {
1423
1432
  let r = e.document.tasks[t];
1424
1433
  if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
1425
1434
  kind: "task.replace",
@@ -1433,11 +1442,12 @@ function Fe(e, t, n) {
1433
1442
  taskId: t
1434
1443
  }];
1435
1444
  }
1436
- function Ie(e, t, n, r) {
1445
+ function Fe(e, t, n, r) {
1437
1446
  let i = e.document.graph.nodes[n];
1438
1447
  if (i == null) return;
1439
1448
  let a = {
1440
1449
  ...r.description == null ? {} : { description: r.description },
1450
+ icon: i.icon,
1441
1451
  name: r.name
1442
1452
  }, o;
1443
1453
  switch (r.kind) {
@@ -1479,25 +1489,25 @@ function Ie(e, t, n, r) {
1479
1489
  config: r.config
1480
1490
  };
1481
1491
  }
1482
- return U(t, n, o);
1492
+ return G(t, n, o);
1483
1493
  }
1484
- function Le(e, t, n, r, i) {
1494
+ function Ie(e, t, n, r, i) {
1485
1495
  let a = e.document.graph.nodes[n];
1486
1496
  if (a == null || a.kind != "integration" && a.kind != "poll") return;
1487
1497
  let o = { ...a.config };
1488
- return i === void 0 ? delete o[r] : o[r] = i, U(t, n, {
1498
+ return i === void 0 ? delete o[r] : o[r] = i, G(t, n, {
1489
1499
  ...a,
1490
1500
  config: o
1491
1501
  });
1492
1502
  }
1493
- function Re(e, t, n, r) {
1503
+ function Le(e, t, n, r) {
1494
1504
  let i = e.document.graph.nodes[n];
1495
1505
  if (i != null) switch (i.kind) {
1496
- case "cron": return U(t, n, {
1506
+ case "cron": return G(t, n, {
1497
1507
  ...i,
1498
1508
  cronTimes: r
1499
1509
  });
1500
- case "poll": return U(t, n, {
1510
+ case "poll": return G(t, n, {
1501
1511
  ...i,
1502
1512
  pollTimes: r
1503
1513
  });
@@ -1506,7 +1516,7 @@ function Re(e, t, n, r) {
1506
1516
  default: return;
1507
1517
  }
1508
1518
  }
1509
- function ze(e, t, n, r) {
1519
+ function Re(e, t, n, r) {
1510
1520
  let i = e.document.graph.nodes[n];
1511
1521
  if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
1512
1522
  binding: {
@@ -1517,19 +1527,19 @@ function ze(e, t, n, r) {
1517
1527
  kind: "binding.replace"
1518
1528
  }];
1519
1529
  }
1520
- function B(e, t) {
1530
+ function H(e, t) {
1521
1531
  return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
1522
1532
  }
1523
- function V(e) {
1524
- return Object.fromEntries(Object.entries(e).flatMap(([e, t]) => Object.hasOwn(t, "value") ? [[e, {
1533
+ function U(e) {
1534
+ return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
1525
1535
  kind: "value",
1526
- value: t.value
1536
+ value: e.value
1527
1537
  }]] : []));
1528
1538
  }
1529
- function H(e, t, n) {
1539
+ function W(e, t, n) {
1530
1540
  return e != null && Object.hasOwn(e, t) ? e[t] : n;
1531
1541
  }
1532
- function U(e, t, n) {
1542
+ function G(e, t, n) {
1533
1543
  return [{
1534
1544
  kind: "graph.node.replace",
1535
1545
  node: n,
@@ -1539,46 +1549,48 @@ function U(e, t, n) {
1539
1549
  }
1540
1550
  //#endregion
1541
1551
  //#region src/workbench/browser/runtime/designer/flowChanges.ts
1542
- function W(e, t) {
1552
+ function K(e, t) {
1543
1553
  return {
1544
1554
  ...e,
1545
- content: r(e.content, t)
1555
+ content: i(e.content, t)
1546
1556
  };
1547
1557
  }
1548
- function Be(e, t) {
1558
+ function ze(e, t) {
1549
1559
  return [{
1550
1560
  kind: "subflow.create",
1551
1561
  subflow: {
1552
1562
  graph: { nodes: {} },
1553
- inputs: { value: {
1563
+ inputs: [{
1564
+ handle: "value",
1554
1565
  jsonSchema: {},
1555
1566
  nullable: !0,
1556
1567
  value: null
1557
- } },
1568
+ }],
1558
1569
  name: t,
1559
- outputs: { result: {
1570
+ outputs: [{
1571
+ handle: "result",
1560
1572
  jsonSchema: {},
1561
1573
  nullable: !0,
1562
1574
  sources: [{
1563
1575
  input: "value",
1564
1576
  kind: "flow"
1565
1577
  }]
1566
- } }
1578
+ }]
1567
1579
  },
1568
1580
  subflowId: e
1569
1581
  }];
1570
1582
  }
1571
- function Ve(e, t, n, r, i) {
1583
+ function Be(e, t, n, r, i) {
1572
1584
  switch (r.kind) {
1573
- case "code": return Ee(t, {
1585
+ case "code": return Te(t, {
1574
1586
  moduleId: i(),
1575
1587
  nodeId: n
1576
1588
  }, r.name);
1577
- case "llm": return De(t, {
1589
+ case "llm": return Ee(t, {
1578
1590
  nodeId: n,
1579
1591
  taskId: i()
1580
1592
  }, r.name, r.mode, r.outputDescription);
1581
- case "connector": return R(t, {
1593
+ case "connector": return B(t, {
1582
1594
  nodeId: n,
1583
1595
  taskId: i()
1584
1596
  }, {
@@ -1587,22 +1599,22 @@ function Ve(e, t, n, r, i) {
1587
1599
  ...r.action.defaultConnection == null ? {} : { connectionId: r.action.defaultConnection.connectionId },
1588
1600
  kind: "connector"
1589
1601
  },
1590
- inputs: r.action.inputs,
1602
+ inputs: Object.entries(r.action.inputs).map(([e, t]) => Object.assign({ handle: e }, t)),
1591
1603
  name: r.action.name,
1592
- outputs: r.action.outputs
1604
+ outputs: Object.entries(r.action.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
1593
1605
  });
1594
- case "condition": return Oe(t, n, r.name);
1595
- case "value": return ke(t, n, r.name);
1606
+ case "condition": return De(t, n, r.name);
1607
+ case "value": return Oe(t, n, r.name);
1596
1608
  case "subflow": {
1597
1609
  let i = e.subflow(r.subflowId);
1598
- return i == null ? void 0 : et(t, n, r.subflowId, i.inputs);
1610
+ return i == null ? void 0 : tt(t, n, r.subflowId, i.inputs);
1599
1611
  }
1600
- case "webhook": return t.kind == "flow" ? z(t, n, {
1612
+ case "webhook": return t.kind == "flow" ? V(t, n, {
1601
1613
  inputsDef: [],
1602
1614
  kind: "webhook",
1603
1615
  name: r.name
1604
1616
  }) : void 0;
1605
- case "cron": return t.kind == "flow" ? z(t, n, {
1617
+ case "cron": return t.kind == "flow" ? V(t, n, {
1606
1618
  cronTimes: [{
1607
1619
  type: "every",
1608
1620
  unit: "hour",
@@ -1611,7 +1623,7 @@ function Ve(e, t, n, r, i) {
1611
1623
  kind: "cron",
1612
1624
  name: r.name
1613
1625
  }) : void 0;
1614
- case "provider-trigger": return t.kind == "flow" ? Ae(t, {
1626
+ case "provider-trigger": return t.kind == "flow" ? ke(t, {
1615
1627
  bindingId: i(),
1616
1628
  nodeId: n
1617
1629
  }, r.definition, {
@@ -1620,10 +1632,10 @@ function Ve(e, t, n, r, i) {
1620
1632
  }) : void 0;
1621
1633
  }
1622
1634
  }
1623
- function He(e, t, n) {
1624
- return je(e.revision.content, t, n);
1635
+ function Ve(e, t, n) {
1636
+ return Ae(e.revision.content, t, n);
1625
1637
  }
1626
- function Ue(e, t, n) {
1638
+ function He(e, t, n) {
1627
1639
  let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
1628
1640
  return {
1629
1641
  modules: Object.fromEntries(Object.values(i).flatMap((t) => {
@@ -1634,7 +1646,7 @@ function Ue(e, t, n) {
1634
1646
  nodes: i
1635
1647
  };
1636
1648
  }
1637
- function We(e, t, n, r) {
1649
+ function Ue(e, t, n, r) {
1638
1650
  if (e.graph(t) == null) return {
1639
1651
  changes: [],
1640
1652
  nodeIds: [],
@@ -1734,25 +1746,47 @@ function We(e, t, n, r) {
1734
1746
  sourceIds: a
1735
1747
  };
1736
1748
  }
1737
- function Ge(e, t, n, r) {
1738
- return Me(e.revision.content, t, n, r);
1749
+ function We(e, t, n, r) {
1750
+ return je(e.revision.content, t, n, r);
1739
1751
  }
1740
- function Ke(e, t, n, r) {
1752
+ function Ge(e, t, n, r) {
1741
1753
  let i = e.node(t, n)?.node;
1742
1754
  if (i == null) return;
1743
1755
  let { description: a, ...o } = i;
1744
- return q(t, n, r == null ? o : {
1756
+ return Y(t, n, r == null ? o : {
1745
1757
  ...o,
1746
1758
  description: r
1747
1759
  });
1748
1760
  }
1749
- function qe(e, t, n, r, i) {
1750
- return Ne(e.revision.content, t, n, r, i);
1761
+ function Ke(e, t, n, r) {
1762
+ let i = e.node(t, n)?.node;
1763
+ if (i == null) return;
1764
+ let { icon: a, ...o } = i;
1765
+ return Y(t, n, r == null ? o : {
1766
+ ...o,
1767
+ icon: r
1768
+ });
1769
+ }
1770
+ function qe(e, t, n, r) {
1771
+ let i = e.node(t, n)?.node;
1772
+ if (i == null) return;
1773
+ if (!("inputs" in i)) return Y(t, n, {
1774
+ ...i,
1775
+ name: r ?? i.name
1776
+ });
1777
+ let { name: a, ...o } = i;
1778
+ return Y(t, n, r == null ? o : {
1779
+ ...o,
1780
+ name: r
1781
+ });
1782
+ }
1783
+ function Je(e, t, n, r, i) {
1784
+ return Me(e.revision.content, t, n, r, i);
1751
1785
  }
1752
- function Je(e, t, n, r) {
1786
+ function Ye(e, t, n, r) {
1753
1787
  let i = e.graph(t), a = i?.nodes[n];
1754
1788
  if (i == null || a?.kind != "condition") return;
1755
- let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = G(o, s), u = new Set(Object.keys(s)), d = [];
1789
+ let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = q(Object.keys(o).map((e) => ({ handle: e })), Object.keys(s).map((e) => ({ handle: e }))), u = new Set(Object.keys(s)), d = [];
1756
1790
  for (let [e, o] of Object.entries(i.nodes)) {
1757
1791
  if (!("inputs" in o)) continue;
1758
1792
  let i = e == n, s = { ...o.inputs };
@@ -1797,22 +1831,23 @@ function Je(e, t, n, r) {
1797
1831
  }
1798
1832
  return d;
1799
1833
  }
1800
- function Ye(e, t, n, r) {
1834
+ function Xe(e, t, n, r) {
1801
1835
  let i = e.node(t, n)?.node;
1802
- if (i?.kind == "value") return q(t, n, {
1836
+ if (i?.kind == "value") return Y(t, n, {
1803
1837
  ...i,
1804
- values: Object.fromEntries(r.map((e) => [e.handle, {
1838
+ values: r.map((e) => ({
1839
+ handle: e.handle,
1805
1840
  ...e.description == null ? {} : { description: e.description },
1806
1841
  jsonSchema: e.jsonSchema ?? {},
1807
1842
  nullable: e.nullable ?? !1,
1808
1843
  ...Object.hasOwn(e, "value") ? { value: e.value } : {}
1809
- }]))
1844
+ }))
1810
1845
  });
1811
1846
  }
1812
- function Xe(e, t, n, r) {
1847
+ function Ze(e, t, n, r) {
1813
1848
  let i = e.graph(t)?.nodes[n];
1814
1849
  if (i?.kind == "task") switch (r.kind) {
1815
- case "code": return i.task == null ? void 0 : K(e, t, n, {
1850
+ case "code": return i.task == null ? void 0 : J(e, t, n, {
1816
1851
  ...i.task,
1817
1852
  name: r.name
1818
1853
  });
@@ -1847,18 +1882,18 @@ function Xe(e, t, n, r) {
1847
1882
  }
1848
1883
  }
1849
1884
  }
1850
- function Ze(e, t, n, r) {
1885
+ function Qe(e, t, n, r) {
1851
1886
  let i = e.graph(t)?.nodes[n];
1852
- if (i?.kind == "task" && i.task != null) return K(e, t, n, {
1887
+ if (i?.kind == "task" && i.task != null) return J(e, t, n, {
1853
1888
  ...i.task,
1854
1889
  ...r
1855
1890
  });
1856
1891
  }
1857
- function Qe(e, t, n, r) {
1892
+ function $e(e, t, n, r) {
1858
1893
  let i = e.trigger(n);
1859
1894
  if (i == null || i.kind != "webhook") return;
1860
1895
  let { options: a, ...o } = i;
1861
- return q(t, n, Object.keys(r.options).length == 0 ? {
1896
+ return Y(t, n, Object.keys(r.options).length == 0 ? {
1862
1897
  ...o,
1863
1898
  inputsDef: r.inputs
1864
1899
  } : {
@@ -1867,19 +1902,19 @@ function Qe(e, t, n, r) {
1867
1902
  options: r.options
1868
1903
  });
1869
1904
  }
1870
- function $e(e, t, n) {
1905
+ function et(e, t, n) {
1871
1906
  if (e.subflow(t) != null) return [{
1872
1907
  definition: n,
1873
1908
  kind: "subflow.definition.replace",
1874
1909
  subflowId: t
1875
1910
  }];
1876
1911
  }
1877
- function et(e, t, n, r) {
1912
+ function tt(e, t, n, r) {
1878
1913
  return [{
1879
1914
  kind: "graph.node.create",
1880
1915
  node: {
1881
1916
  concurrency: 1,
1882
- inputs: tt(r),
1917
+ inputs: nt(r),
1883
1918
  kind: "subflow",
1884
1919
  subflowId: n
1885
1920
  },
@@ -1887,57 +1922,57 @@ function et(e, t, n, r) {
1887
1922
  target: e
1888
1923
  }];
1889
1924
  }
1890
- function tt(e) {
1891
- return Object.fromEntries(Object.entries(e).flatMap(([e, t]) => Object.hasOwn(t, "value") ? [[e, {
1925
+ function nt(e) {
1926
+ return Object.fromEntries(e.flatMap((e) => Object.hasOwn(e, "value") ? [[e.handle, {
1892
1927
  kind: "value",
1893
- value: t.value
1928
+ value: e.value
1894
1929
  }]] : []));
1895
1930
  }
1896
- function G(e, t) {
1897
- let n = Object.keys(e).filter((e) => !Object.hasOwn(t, e)), r = Object.keys(t).filter((t) => !Object.hasOwn(e, t));
1898
- return n.length == 1 && r.length == 1 ? [n[0], r[0]] : void 0;
1931
+ function q(e, t) {
1932
+ let n = new Set(e.map((e) => e.handle)), r = new Set(t.map((e) => e.handle)), i = [...n].filter((e) => !r.has(e)), a = [...r].filter((e) => !n.has(e));
1933
+ return i.length == 1 && a.length == 1 ? [i[0], a[0]] : void 0;
1899
1934
  }
1900
- function K(e, t, n, r) {
1935
+ function J(e, t, n, r) {
1901
1936
  let i = e.graph(t), a = i?.nodes[n];
1902
1937
  if (i == null || a?.kind != "task" || a.task == null) return;
1903
- let o = G(a.task.inputs, r.inputs), s = G(a.task.outputs, r.outputs), c = new Set(Object.keys(r.outputs)), l = [];
1904
- for (let [e, u] of Object.entries(i.nodes)) {
1905
- if (!("inputs" in u)) continue;
1906
- let i = e == n, d = { ...u.inputs };
1938
+ let o = q(a.task.inputs, r.inputs), s = q(a.task.outputs, r.outputs), c = new Set(r.inputs.map((e) => e.handle)), l = new Set(r.outputs.map((e) => e.handle)), u = [];
1939
+ for (let [e, d] of Object.entries(i.nodes)) {
1940
+ if (!("inputs" in d)) continue;
1941
+ let i = e == n, f = { ...d.inputs };
1907
1942
  if (e == n) {
1908
- o != null && Object.hasOwn(d, o[0]) && (d[o[1]] = d[o[0]], delete d[o[0]]);
1909
- for (let e of Object.keys(d)) Object.hasOwn(r.inputs, e) || delete d[e];
1943
+ o != null && Object.hasOwn(f, o[0]) && (f[o[1]] = f[o[0]], delete f[o[0]]);
1944
+ for (let e of Object.keys(f)) c.has(e) || delete f[e];
1910
1945
  }
1911
- for (let [e, t] of Object.entries(d)) {
1946
+ for (let [e, t] of Object.entries(f)) {
1912
1947
  if (t.kind != "sources") continue;
1913
1948
  let r = t.sources.flatMap((e) => e.kind != "node" || e.nodeId != n ? [e] : s != null && e.output == s[0] ? [{
1914
1949
  ...e,
1915
1950
  output: s[1]
1916
- }] : c.has(e.output) ? [e] : []);
1917
- r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete d[e] : d[e] = {
1951
+ }] : l.has(e.output) ? [e] : []);
1952
+ r.length == t.sources.length && r.every((e, n) => e === t.sources[n]) || (i = !0, r.length == 0 ? delete f[e] : f[e] = {
1918
1953
  kind: "sources",
1919
1954
  sources: r
1920
1955
  });
1921
1956
  }
1922
1957
  if (!i) continue;
1923
- let f = e == n ? {
1958
+ let p = e == n ? {
1924
1959
  ...a,
1925
- inputs: d,
1960
+ inputs: f,
1926
1961
  task: r
1927
1962
  } : {
1928
- ...u,
1929
- inputs: d
1963
+ ...d,
1964
+ inputs: f
1930
1965
  };
1931
- l.push({
1966
+ u.push({
1932
1967
  kind: "graph.node.replace",
1933
- node: f,
1968
+ node: p,
1934
1969
  nodeId: e,
1935
1970
  target: t
1936
1971
  });
1937
1972
  }
1938
- return l;
1973
+ return u;
1939
1974
  }
1940
- function q(e, t, n) {
1975
+ function Y(e, t, n) {
1941
1976
  return [{
1942
1977
  kind: "graph.node.replace",
1943
1978
  node: n,
@@ -1947,32 +1982,32 @@ function q(e, t, n) {
1947
1982
  }
1948
1983
  //#endregion
1949
1984
  //#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
1950
- function nt(e, t) {
1985
+ function rt(e, t) {
1951
1986
  return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
1952
1987
  }
1953
- function J(e, t, n, r) {
1988
+ function X(e, t, n, r) {
1954
1989
  for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
1955
1990
  }
1956
- function rt(e, t, n, r) {
1991
+ function it(e, t, n, r) {
1957
1992
  let i = /* @__PURE__ */ new Set();
1958
1993
  for (let a of r) switch (a.kind) {
1959
1994
  case "graph.node.create":
1960
1995
  case "graph.node.replace":
1961
- nt(a.target, n) && i.add(a.nodeId);
1996
+ rt(a.target, n) && i.add(a.nodeId);
1962
1997
  break;
1963
1998
  case "task.replace":
1964
- J(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), J(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
1999
+ 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);
1965
2000
  break;
1966
2001
  case "module.source.replace":
1967
- J(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), J(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
2002
+ 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);
1968
2003
  break;
1969
- case "subflow.definition.replace": J(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), J(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
2004
+ 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);
1970
2005
  }
1971
2006
  return new Set([...i].filter((e) => t.selection(n, e) != null));
1972
2007
  }
1973
2008
  //#endregion
1974
2009
  //#region src/workbench/browser/runtime/stores/draftChanges.ts
1975
- function Y(e) {
2010
+ function at(e) {
1976
2011
  if (e.length != 1) return;
1977
2012
  let t = e[0];
1978
2013
  switch (t.kind) {
@@ -1985,7 +2020,7 @@ function Y(e) {
1985
2020
  default: return;
1986
2021
  }
1987
2022
  }
1988
- var it = class {
2023
+ var ot = class {
1989
2024
  #e;
1990
2025
  #t;
1991
2026
  #n;
@@ -2013,15 +2048,15 @@ var it = class {
2013
2048
  this.#a = e;
2014
2049
  }
2015
2050
  project(e) {
2016
- return this.#o.reduce((e, t) => W(e, t.changes), e);
2051
+ return this.#o.reduce((e, t) => K(e, t.changes), e);
2017
2052
  }
2018
2053
  enqueue(e) {
2019
2054
  let t = this.#s.then(e);
2020
2055
  return this.#s = t, t;
2021
2056
  }
2022
2057
  async change(e, t, n, r = !0) {
2023
- this.#t.beforeChange(r), this.#t.apply(W(t, n));
2024
- let i = Y(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && Y(a.changes) == i ? a : void 0;
2058
+ this.#t.beforeChange(r), this.#t.apply(K(t, n));
2059
+ let i = at(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && at(a.changes) == i ? a : void 0;
2025
2060
  if (o != null) return o.changes = n, await o.result;
2026
2061
  let s = {
2027
2062
  ...e,
@@ -2049,7 +2084,7 @@ var it = class {
2049
2084
  let r = this.#l(e, n, t);
2050
2085
  return this.#o.length == 0 && this.#t.check(), r;
2051
2086
  } catch (n) {
2052
- if (n instanceof _ && n.code == "flow.revision-conflict") {
2087
+ if (n instanceof s && n.code == "flow.revision-conflict") {
2053
2088
  if (!t && await this.#t.recover(e)) {
2054
2089
  t = !0;
2055
2090
  continue;
@@ -2058,7 +2093,7 @@ var it = class {
2058
2093
  kind: "error",
2059
2094
  message: this.#n.t("notice.draftConflict")
2060
2095
  });
2061
- } else this.#u(e), this.#t.current(e) && this.#r(p(n, this.#n.t));
2096
+ } else this.#u(e), this.#t.current(e) && this.#r(u(n, this.#n.t));
2062
2097
  return;
2063
2098
  }
2064
2099
  }
@@ -2066,7 +2101,7 @@ var it = class {
2066
2101
  #l(e, t, n) {
2067
2102
  let r = {
2068
2103
  ...n.revision,
2069
- content: W(t, e.changes).content
2104
+ content: K(t, e.changes).content
2070
2105
  };
2071
2106
  this.#o = this.#o.filter((t) => t !== e), this.#a = r;
2072
2107
  let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
@@ -2075,19 +2110,19 @@ var it = class {
2075
2110
  #u(e) {
2076
2111
  this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
2077
2112
  }
2078
- }, X = 50, at = {
2113
+ }, st = 50, ct = {
2079
2114
  failed: !1,
2080
2115
  loaded: !1,
2081
2116
  loading: !0,
2082
2117
  loadingMore: !1,
2083
2118
  loadMoreFailed: !1,
2084
2119
  flows: []
2085
- }, ot = class {
2120
+ }, lt = class {
2086
2121
  #e;
2087
2122
  #t;
2088
- #n = new o();
2123
+ #n = new x();
2089
2124
  #r;
2090
- #i = t(at);
2125
+ #i = t(ct);
2091
2126
  #a = !1;
2092
2127
  constructor(t, n, r) {
2093
2128
  this.#e = t, this.#t = r, this.#r = n, this.$ = {
@@ -2133,7 +2168,7 @@ var it = class {
2133
2168
  try {
2134
2169
  let t = await this.#e.listFlows({
2135
2170
  includeTotal: !0,
2136
- limit: X
2171
+ limit: st
2137
2172
  });
2138
2173
  if (!e()) return;
2139
2174
  this.#o({
@@ -2148,7 +2183,7 @@ var it = class {
2148
2183
  this.#o({
2149
2184
  failed: !0,
2150
2185
  loading: !1
2151
- }), this.#r(p(t, this.#t.t));
2186
+ }), this.#r(u(t, this.#t.t));
2152
2187
  }
2153
2188
  }
2154
2189
  async loadMore() {
@@ -2162,7 +2197,7 @@ var it = class {
2162
2197
  try {
2163
2198
  let e = await this.#e.listFlows({
2164
2199
  cursor: t,
2165
- limit: X
2200
+ limit: st
2166
2201
  });
2167
2202
  if (!n()) return;
2168
2203
  let r = new Set(this.#i.value.flows.map((e) => e.flowId));
@@ -2176,7 +2211,7 @@ var it = class {
2176
2211
  this.#o({
2177
2212
  loadingMore: !1,
2178
2213
  loadMoreFailed: !0
2179
- }), this.#r(p(e, this.#t.t));
2214
+ }), this.#r(u(e, this.#t.t));
2180
2215
  }
2181
2216
  }
2182
2217
  async create(e) {
@@ -2212,7 +2247,7 @@ var it = class {
2212
2247
  ...e
2213
2248
  });
2214
2249
  }
2215
- }, st = class {
2250
+ }, ut = class {
2216
2251
  #e;
2217
2252
  #t;
2218
2253
  #n;
@@ -2255,7 +2290,7 @@ var it = class {
2255
2290
  this.#c(a, r);
2256
2291
  } catch (r) {
2257
2292
  if (this.#o || !n()) return;
2258
- if (r instanceof _ && r.code == "flow.presentation-conflict") try {
2293
+ if (r instanceof s && r.code == "flow.presentation-conflict") try {
2259
2294
  let t = await this.#e.getPresentation(e);
2260
2295
  if (this.#o || !n()) return;
2261
2296
  this.#c(a, t), this.#n({
@@ -2263,9 +2298,9 @@ var it = class {
2263
2298
  message: this.#t.t("notice.layoutConflict")
2264
2299
  });
2265
2300
  } catch (e) {
2266
- !this.#o && n() && this.#n(p(e, this.#t.t));
2301
+ !this.#o && n() && this.#n(u(e, this.#t.t));
2267
2302
  }
2268
- else this.#c(a, t), this.#n(p(r, this.#t.t));
2303
+ else this.#c(a, t), this.#n(u(r, this.#t.t));
2269
2304
  }
2270
2305
  }), await this.#i;
2271
2306
  }
@@ -2280,29 +2315,29 @@ var it = class {
2280
2315
  };
2281
2316
  //#endregion
2282
2317
  //#region src/workbench/browser/runtime/designer/diagnostics.ts
2283
- function ct(e, t) {
2318
+ function dt(e, t) {
2284
2319
  return t == e || t.startsWith(`${e}/`);
2285
2320
  }
2286
- function lt(e, t, n, r) {
2321
+ function ft(e, t, n, r) {
2287
2322
  if (e == null || t == null || n == null) return [];
2288
- if (r != null) return mt(t, r, n.diagnostics);
2323
+ if (r != null) return _t(t, r, n.diagnostics);
2289
2324
  let i = t.kind == "flow" ? "/document/graph" : `/document/subflows/${t.id}`;
2290
- return n.diagnostics.filter((e) => ct(i, e.path));
2325
+ return n.diagnostics.filter((e) => dt(i, e.path));
2291
2326
  }
2292
- function ut(e) {
2327
+ function pt(e) {
2293
2328
  return e.startsWith("/modules/") ? "code" : /\/graph\/nodes\/[^/]+\/task(?:\/|$)/.test(e) ? "task" : e.includes("/graph/nodes/") ? "node" : e.startsWith("/document/tasks/") ? "task" : "flow";
2294
2329
  }
2295
- function dt(e, t) {
2330
+ function mt(e, t) {
2296
2331
  return t.startsWith("/inputs/") ? "inputs" : e.kind == "task" && t.startsWith("/task") ? "task" : e.kind == "condition" && (t.startsWith("/cases/") || t.startsWith("/input") || t.startsWith("/defaultOutput")) ? "condition" : "node";
2297
2332
  }
2298
- function ft(e, t, n) {
2333
+ function ht(e, t, n) {
2299
2334
  if (e == null || t == null) return;
2300
2335
  let r = t.kind == "flow" ? "/document/graph/nodes/" : `/document/subflows/${t.id}/graph/nodes/`;
2301
2336
  if (n.path.startsWith(r)) {
2302
2337
  let i = n.path.slice(r.length), a = i.indexOf("/"), o = a < 0 ? i : i.slice(0, a), s = e.node(t, o);
2303
2338
  return s == null ? void 0 : {
2304
2339
  nodeId: o,
2305
- section: dt(s.node, a < 0 ? "" : i.slice(a))
2340
+ section: mt(s.node, a < 0 ? "" : i.slice(a))
2306
2341
  };
2307
2342
  }
2308
2343
  let i = /^\/document\/tasks\/([^/]+)(.*)$/.exec(n.path);
@@ -2322,31 +2357,31 @@ function ft(e, t, n) {
2322
2357
  };
2323
2358
  }
2324
2359
  }
2325
- function pt(e, t, n) {
2360
+ function gt(e, t, n) {
2326
2361
  return n?.diagnostics.map((n) => ({
2327
2362
  diagnostic: n,
2328
- location: ft(e, t, n),
2329
- scope: ut(n.path)
2363
+ location: ht(e, t, n),
2364
+ scope: pt(n.path)
2330
2365
  })) ?? [];
2331
2366
  }
2332
- function mt(e, t, n) {
2367
+ function _t(e, t, n) {
2333
2368
  let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
2334
2369
  if (t.kind == "task") {
2335
2370
  t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
2336
2371
  let e = t.definition != null && "moduleId" in t.definition ? t.definition.moduleId : void 0;
2337
2372
  e != null && i.push(`/modules/${e}`);
2338
2373
  } else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
2339
- return n.filter((e) => i.some((t) => ct(t, e.path)));
2374
+ return n.filter((e) => i.some((t) => dt(t, e.path)));
2340
2375
  }
2341
2376
  //#endregion
2342
2377
  //#region src/workbench/browser/runtime/stores/workspaceModel.ts
2343
- var ht = {
2378
+ var vt = {
2344
2379
  checkLoading: !1,
2345
2380
  selectedNodeIds: [],
2346
2381
  workspaceLoadFailed: !1,
2347
2382
  workspaceLoading: !1
2348
2383
  };
2349
- function gt(e) {
2384
+ function yt(e) {
2350
2385
  return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
2351
2386
  }
2352
2387
  function Z(e, t) {
@@ -2362,9 +2397,9 @@ function Q(e, t, n) {
2362
2397
  source: r.module.source
2363
2398
  };
2364
2399
  }
2365
- var _t = class {
2400
+ var bt = class {
2366
2401
  #e;
2367
- #t = t(ht);
2402
+ #t = t(vt);
2368
2403
  #n;
2369
2404
  constructor(t, r) {
2370
2405
  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) => {
@@ -2374,13 +2409,13 @@ var _t = class {
2374
2409
  ...n,
2375
2410
  status: Z(e.draft, e.moduleEditor)
2376
2411
  };
2377
- }), 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), h = e(this.#t, (e) => e.draft == null ? void 0 : m(e.draft)), g = e(this.#t, (e) => e.selectedNodeIds), _ = e(this.#t, (e) => e.target), v = e(this.#t, (e) => e.workspaceLoadFailed), y = e(this.#t, (e) => e.workspaceLoading);
2412
+ }), 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 : h(e.draft)), g = e(this.#t, (e) => e.selectedNodeIds), _ = e(this.#t, (e) => e.target), v = e(this.#t, (e) => e.workspaceLoadFailed), y = e(this.#t, (e) => e.workspaceLoading);
2378
2413
  this.#e = e(this.#t, (e) => ({
2379
- revision: e.draft == null ? void 0 : m(e.draft),
2414
+ revision: e.draft == null ? void 0 : h(e.draft),
2380
2415
  target: e.target
2381
2416
  }), { equal: (e, t) => e.revision === t.revision && e.target === t.target });
2382
2417
  let b = e(this.#t, (e) => {
2383
- if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return m(e.draft).selection(e.target, e.selectedNodeIds[0]);
2418
+ if (e.draft != null && e.target != null && e.selectedNodeIds.length == 1) return h(e.draft).selection(e.target, e.selectedNodeIds[0]);
2384
2419
  });
2385
2420
  this.$ = {
2386
2421
  addNodeOptions: n((e) => {
@@ -2390,7 +2425,7 @@ var _t = class {
2390
2425
  busy: i,
2391
2426
  checkLoading: a,
2392
2427
  diagnosticFocus: o,
2393
- diagnosticItems: e(this.#t, (e) => pt(e.draft == null ? void 0 : m(e.draft), e.target, e.diagnostics)),
2428
+ diagnosticItems: e(this.#t, (e) => gt(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics)),
2394
2429
  diagnostics: s,
2395
2430
  draft: c,
2396
2431
  flow: n((e) => {
@@ -2405,7 +2440,7 @@ var _t = class {
2405
2440
  flowNextCursor: r.$.nextCursor,
2406
2441
  flowTotal: r.$.total,
2407
2442
  flows: r.$.flows,
2408
- inspectorDiagnostics: e(this.#t, (e) => lt(e.draft == null ? void 0 : m(e.draft), e.target, e.diagnostics, b.value)),
2443
+ inspectorDiagnostics: e(this.#t, (e) => ft(e.draft == null ? void 0 : h(e.draft), e.target, e.diagnostics, b.value)),
2409
2444
  live: p,
2410
2445
  moduleDiagnostics: e(this.#t, (e) => {
2411
2446
  let t = e.moduleEditor?.moduleId;
@@ -2414,14 +2449,14 @@ var _t = class {
2414
2449
  moduleEditor: l,
2415
2450
  nodeFocus: u,
2416
2451
  presentation: d,
2417
- revision: h,
2452
+ revision: m,
2418
2453
  selection: b,
2419
2454
  selectedNodeIds: g,
2420
- status: e(this.#t, gt),
2455
+ status: e(this.#t, yt),
2421
2456
  target: _,
2422
2457
  targetFlow: n((e) => e(_)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
2423
2458
  targetName: e(this.#t, (e) => {
2424
- if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : m(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2459
+ if (e.target != null) return e.target.kind == "flow" ? r.flow(e.flowId ?? "")?.name : e.draft == null ? e.target.id : h(e.draft).subflow(e.target.id)?.name ?? e.target.id;
2425
2460
  }),
2426
2461
  workspaceLoadFailed: v,
2427
2462
  workspaceLoading: y
@@ -2440,17 +2475,17 @@ var _t = class {
2440
2475
  for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
2441
2476
  this.#e.dispose(), this.#t.dispose();
2442
2477
  }
2443
- }, vt = 250;
2444
- function yt(e, t) {
2478
+ }, xt = 250;
2479
+ function St(e, t) {
2445
2480
  if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
2446
2481
  }
2447
2482
  function $(e, t) {
2448
2483
  return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
2449
2484
  }
2450
- var bt = class {
2485
+ var Ct = class {
2451
2486
  #e;
2452
2487
  #t;
2453
- #n = new o();
2488
+ #n = new x();
2454
2489
  #r;
2455
2490
  #i;
2456
2491
  #a;
@@ -2470,8 +2505,8 @@ var bt = class {
2470
2505
  #y = 0;
2471
2506
  #b;
2472
2507
  #x;
2473
- constructor(e, t, n = () => crypto.randomUUID(), r = c(), i = () => {}) {
2474
- this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new ot(e, t, r), this.#l = new _t(r, this.#o), this.#t = new it(e, t, r, {
2508
+ constructor(e, t, n = () => crypto.randomUUID(), r = l(), i = () => {}) {
2509
+ this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new lt(e, t, r), this.#l = new bt(r, this.#o), this.#t = new ot(e, t, r, {
2475
2510
  apply: (e, t) => this.#w(e, t),
2476
2511
  beforeChange: (e) => {
2477
2512
  this.#M(), this.#h = !1, e && (this.#B({ busy: "designer" }), this.#c(void 0));
@@ -2484,7 +2519,7 @@ var bt = class {
2484
2519
  },
2485
2520
  headChanged: (e, t) => this.#N(e, t),
2486
2521
  recover: (e) => this.#O(e, !0)
2487
- }), this.#a = new st(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2522
+ }), this.#a = new ut(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
2488
2523
  }
2489
2524
  dispose() {
2490
2525
  this.#M(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
@@ -2539,7 +2574,7 @@ var bt = class {
2539
2574
  return t() ? (this.#B({
2540
2575
  workspaceLoadFailed: !0,
2541
2576
  workspaceLoading: !1
2542
- }), this.#c(p(e, this.#r.t)), !1) : !1;
2577
+ }), this.#c(u(e, this.#r.t)), !1) : !1;
2543
2578
  }
2544
2579
  return !0;
2545
2580
  }
@@ -2556,7 +2591,7 @@ var bt = class {
2556
2591
  selectNodes(e) {
2557
2592
  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({
2558
2593
  diagnosticFocus: void 0,
2559
- moduleEditor: Q(this.#l.value.draft == null ? void 0 : m(this.#l.value.draft), this.#l.value.target, e),
2594
+ moduleEditor: Q(this.#l.value.draft == null ? void 0 : h(this.#l.value.draft), this.#l.value.target, e),
2560
2595
  nodeFocus: void 0,
2561
2596
  selectedNodeIds: e
2562
2597
  }), !0) : !1;
@@ -2567,7 +2602,7 @@ var bt = class {
2567
2602
  try {
2568
2603
  return await this.#o.create(e);
2569
2604
  } catch (e) {
2570
- this.#_ || this.#c(p(e, this.#r.t));
2605
+ this.#_ || this.#c(u(e, this.#r.t));
2571
2606
  } finally {
2572
2607
  this.#B({ busy: void 0 });
2573
2608
  }
@@ -2584,7 +2619,7 @@ var bt = class {
2584
2619
  message: this.#r.t("notice.flowDeleteAccepted", { name: t.name })
2585
2620
  }), !0);
2586
2621
  } catch (e) {
2587
- return this.#_ || this.#c(p(e, this.#r.t)), !1;
2622
+ return this.#_ || this.#c(u(e, this.#r.t)), !1;
2588
2623
  } finally {
2589
2624
  this.#B({ busy: void 0 });
2590
2625
  }
@@ -2593,7 +2628,7 @@ var bt = class {
2593
2628
  if (!this.#F() || this.#l.value.draft == null) return !1;
2594
2629
  let t = this.#i();
2595
2630
  this.#B({ busy: "resource" }), this.#c(void 0);
2596
- let n = await this.#C(Be(t, e), !1);
2631
+ let n = await this.#C(ze(t, e), !1);
2597
2632
  return this.#B({ busy: void 0 }), n != null && (this.selectTarget({
2598
2633
  id: t,
2599
2634
  kind: "subflow"
@@ -2611,7 +2646,7 @@ var bt = class {
2611
2646
  try {
2612
2647
  i = await this.#e.renameFlow(e, r), i != null && this.#o.include(i);
2613
2648
  } catch (e) {
2614
- this.#_ || this.#c(p(e, this.#r.t));
2649
+ this.#_ || this.#c(u(e, this.#r.t));
2615
2650
  }
2616
2651
  return this.#B({ busy: void 0 }), i != null && (this.#c({
2617
2652
  kind: "success",
@@ -2624,11 +2659,11 @@ var bt = class {
2624
2659
  if (r == null || i == null) return;
2625
2660
  let a = this.#i();
2626
2661
  if (e.kind == "comment") return await this.#S(i, a, t);
2627
- let o = m(r), s = b(e, o, i, this.#r.t);
2662
+ let o = h(r), s = b(e, o, i, this.#r.t);
2628
2663
  if (s == null) return;
2629
- let c = Ve(o, i, a, s, this.#i);
2664
+ let c = Be(o, i, a, s, this.#i);
2630
2665
  if (c == null) return;
2631
- let l = n == null ? c : [...c, ...I(W(r, c).content, i, n(a))], u = this.#C(l);
2666
+ let l = n == null ? c : [...c, ...R(K(r, c).content, i, n(a))], u = this.#C(l);
2632
2667
  this.selectNodes([a]);
2633
2668
  let d = this.moveNodes({ [a]: t });
2634
2669
  if (await u != null) return await d, a;
@@ -2636,20 +2671,20 @@ var bt = class {
2636
2671
  async connect(e) {
2637
2672
  let t = this.$.revision.value, n = this.#l.value.target;
2638
2673
  if (t == null || n == null) return;
2639
- let r = I(t.revision.content, n, e);
2674
+ let r = R(t.revision.content, n, e);
2640
2675
  r.length > 0 && await this.#C(r);
2641
2676
  }
2642
2677
  async disconnect(e) {
2643
2678
  let t = this.$.revision.value, n = this.#l.value.target;
2644
2679
  if (t == null || n == null) return;
2645
- let r = Ce(t.revision.content, n, e);
2680
+ let r = Se(t.revision.content, n, e);
2646
2681
  r.length > 0 && await this.#C(r);
2647
2682
  }
2648
2683
  async deleteSelectedNodes() {
2649
2684
  if (!this.#F()) return;
2650
2685
  let e = this.$.revision.value, t = this.#l.value.target;
2651
2686
  if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
2652
- let n = h(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = He(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => l(e, t, r));
2687
+ let n = g(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ve(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => f(e, t, r));
2653
2688
  this.selectNodes([]), (a == null || await a != null) && await o;
2654
2689
  }
2655
2690
  copySelectedNodes() {
@@ -2663,27 +2698,27 @@ var bt = class {
2663
2698
  sourceId: e.id,
2664
2699
  title: e.title
2665
2700
  }] : []),
2666
- nodes: Ue(e, t, this.#l.value.selectedNodeIds)
2701
+ nodes: He(e, t, this.#l.value.selectedNodeIds)
2667
2702
  };
2668
2703
  }
2669
- async pasteNodes() {
2704
+ async pasteNodes(e) {
2670
2705
  if (!this.#F()) return;
2671
- let e = this.$.revision.value, t = this.#l.value.target;
2672
- if (e == null || t == null || this.#u == null) return;
2673
- let n = We(e, t, this.#u.nodes, this.#i), r = n.changes.length == 0 ? void 0 : this.#C(n.changes), i = this.#u.comments.map((e) => ({
2706
+ let t = this.$.revision.value, n = this.#l.value.target;
2707
+ if (t == null || n == null || this.#u == null) return;
2708
+ let r = Ue(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#C(r.changes), a = this.#u.comments.map((e) => ({
2674
2709
  ...e,
2675
2710
  nodeId: this.#i()
2676
2711
  }));
2677
- if (n.nodeIds.length == 0 && i.length == 0) return;
2678
- let a = new Map(this.#P().nodes.map((e) => [e.id, e])), o = Object.fromEntries(n.sourceIds.map((e, t) => {
2679
- let r = a.get(e);
2680
- return [n.nodeIds[t], {
2681
- x: (r?.position.x ?? 80) + 40,
2682
- y: (r?.position.y ?? 80) + 40
2712
+ if (r.nodeIds.length == 0 && a.length == 0) return;
2713
+ let o = new Map(this.#P().nodes.map((e) => [e.id, e])), s = Object.fromEntries(r.sourceIds.map((t, n) => {
2714
+ let i = e?.[t] ?? o.get(t)?.position;
2715
+ return [r.nodeIds[n], {
2716
+ x: (i?.x ?? 80) + 40,
2717
+ y: (i?.y ?? 80) + 40
2683
2718
  }];
2684
- })), s = this.#T((e) => {
2685
- let n = d(e, t, o);
2686
- for (let e of i) n = g(n, t, e.nodeId, {
2719
+ })), c = this.#T((e) => {
2720
+ let t = p(e, n, s);
2721
+ for (let e of a) t = _(t, n, e.nodeId, {
2687
2722
  content: e.content,
2688
2723
  position: {
2689
2724
  x: e.position.x + 40,
@@ -2691,48 +2726,60 @@ var bt = class {
2691
2726
  },
2692
2727
  title: this.#r.t("addNode.commentCopy", { title: e.title })
2693
2728
  });
2694
- return n;
2729
+ return t;
2695
2730
  });
2696
- this.selectNodes([...n.nodeIds, ...i.map((e) => e.nodeId)]), (r == null || await r != null) && await s;
2731
+ this.selectNodes([...r.nodeIds, ...a.map((e) => e.nodeId)]), (i == null || await i != null) && await c;
2697
2732
  }
2698
- async duplicateSelectedNodes() {
2699
- this.copySelectedNodes(), await this.pasteNodes();
2733
+ async duplicateSelectedNodes(e) {
2734
+ this.copySelectedNodes(), await this.pasteNodes(e);
2700
2735
  }
2701
2736
  async saveNodeSettings(e, t) {
2702
2737
  let n = this.$.revision.value, r = this.#l.value.target;
2703
2738
  if (n == null || r == null) return !1;
2704
- let i = Ge(n, r, e, t);
2739
+ let i = We(n, r, e, t);
2705
2740
  return i != null && await this.#C(i) != null;
2706
2741
  }
2707
2742
  async saveNodeDescription(e, t) {
2743
+ let n = this.$.revision.value, r = this.#l.value.target;
2744
+ if (n == null || r == null) return !1;
2745
+ let i = Ge(n, r, e, t);
2746
+ return i != null && await this.#C(i) != null;
2747
+ }
2748
+ async saveNodeIcon(e, t) {
2708
2749
  let n = this.$.revision.value, r = this.#l.value.target;
2709
2750
  if (n == null || r == null) return !1;
2710
2751
  let i = Ke(n, r, e, t);
2711
2752
  return i != null && await this.#C(i) != null;
2712
2753
  }
2754
+ async saveNodeTitle(e, t) {
2755
+ let n = this.$.revision.value, r = this.#l.value.target;
2756
+ if (n == null || r == null) return !1;
2757
+ let i = qe(n, r, e, t);
2758
+ return i != null && await this.#C(i) != null;
2759
+ }
2713
2760
  async setInputValue(e, t, n) {
2714
2761
  let r = this.$.revision.value, i = this.#l.value.target;
2715
2762
  if (r == null || i == null) return !1;
2716
- let a = qe(r, i, e, t, n);
2763
+ let a = Je(r, i, e, t, n);
2717
2764
  return a != null && await this.#C(a) != null;
2718
2765
  }
2719
2766
  async saveCondition(e, t) {
2720
2767
  let n = this.$.revision.value, r = this.#l.value.target;
2721
2768
  if (n == null || r == null) return !1;
2722
- let i = Je(n, r, e, t);
2769
+ let i = Ye(n, r, e, t);
2723
2770
  return i != null && await this.#C(i) != null;
2724
2771
  }
2725
2772
  async saveValue(e, t) {
2726
2773
  let n = this.$.revision.value, r = this.#l.value.target;
2727
2774
  if (n == null || r == null) return !1;
2728
- let i = Ye(n, r, e, t);
2775
+ let i = Xe(n, r, e, t);
2729
2776
  return i != null && await this.#C(i) != null;
2730
2777
  }
2731
2778
  async saveComment(e, t) {
2732
2779
  let n = this.#l.value.target;
2733
2780
  if (n == null) return;
2734
2781
  let r = this.#P().nodes.find((t) => t.id == e)?.position;
2735
- r != null && await this.#T((i) => g(i, n, e, {
2782
+ r != null && await this.#T((i) => _(i, n, e, {
2736
2783
  ...t,
2737
2784
  position: r
2738
2785
  }));
@@ -2740,55 +2787,55 @@ var bt = class {
2740
2787
  async saveTaskSettings(e, t) {
2741
2788
  let n = this.$.revision.value, r = this.#l.value.target;
2742
2789
  if (n == null || r == null) return !1;
2743
- let i = Xe(n, r, e, t);
2790
+ let i = Ze(n, r, e, t);
2744
2791
  return i != null && await this.#C(i) != null;
2745
2792
  }
2746
2793
  async saveCodeTaskPorts(e, t) {
2747
2794
  let n = this.$.revision.value, r = this.#l.value.target;
2748
2795
  if (n == null || r == null) return !1;
2749
- let i = Ze(n, r, e, t);
2796
+ let i = Qe(n, r, e, t);
2750
2797
  return i != null && await this.#C(i) != null;
2751
2798
  }
2752
2799
  async setConnectorConnection(e, t) {
2753
2800
  let n = this.$.revision.value;
2754
2801
  if (n == null) return !1;
2755
- let r = Fe(n.revision.content, e, t);
2802
+ let r = Pe(n.revision.content, e, t);
2756
2803
  return r != null && await this.#C(r) != null;
2757
2804
  }
2758
2805
  async saveTriggerSettings(e, t) {
2759
2806
  let n = this.$.revision.value, r = this.#l.value.target;
2760
2807
  if (n == null || r?.kind != "flow") return !1;
2761
- let i = Ie(n.revision.content, r, e, t);
2808
+ let i = Fe(n.revision.content, r, e, t);
2762
2809
  return i != null && await this.#C(i) != null;
2763
2810
  }
2764
2811
  async saveTriggerConfig(e, t, n) {
2765
2812
  let r = this.$.revision.value, i = this.#l.value.target;
2766
2813
  if (r == null || i?.kind != "flow") return !1;
2767
- let a = Le(r.revision.content, i, e, t, n);
2814
+ let a = Ie(r.revision.content, i, e, t, n);
2768
2815
  return a != null && await this.#C(a) != null;
2769
2816
  }
2770
2817
  async saveTriggerSchedule(e, t) {
2771
2818
  let n = this.$.revision.value, r = this.#l.value.target;
2772
2819
  if (n == null || r?.kind != "flow") return !1;
2773
- let i = Re(n.revision.content, r, e, t);
2820
+ let i = Le(n.revision.content, r, e, t);
2774
2821
  return i != null && await this.#C(i) != null;
2775
2822
  }
2776
2823
  async saveWebhook(e, t) {
2777
2824
  let n = this.$.revision.value, r = this.#l.value.target;
2778
2825
  if (n == null || r?.kind != "flow") return !1;
2779
- let i = Qe(n, r, e, t);
2826
+ let i = $e(n, r, e, t);
2780
2827
  return i != null && await this.#C(i) != null;
2781
2828
  }
2782
2829
  async setTriggerConnection(e, t) {
2783
2830
  let n = this.$.revision.value, r = this.#l.value.target;
2784
2831
  if (n == null || r?.kind != "flow") return !1;
2785
- let i = ze(n.revision.content, r, e, t);
2832
+ let i = Re(n.revision.content, r, e, t);
2786
2833
  return i != null && await this.#C(i) != null;
2787
2834
  }
2788
2835
  async saveSubflowSettings(e, t) {
2789
2836
  let n = this.$.revision.value;
2790
2837
  if (n == null) return !1;
2791
- let r = $e(n, e, t);
2838
+ let r = et(n, e, t);
2792
2839
  return r != null && await this.#C(r) != null;
2793
2840
  }
2794
2841
  updateModuleSource(e) {
@@ -2819,23 +2866,23 @@ var bt = class {
2819
2866
  ...e,
2820
2867
  phase: "saving"
2821
2868
  } });
2822
- let t = await we(e.source);
2869
+ let t = await Ce(e.source);
2823
2870
  if (this.#_) return !1;
2824
- let n = await this.#C(Te(e.moduleId, e.source, t));
2871
+ let n = await this.#C(we(e.moduleId, e.source, t));
2825
2872
  return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#B({ moduleEditor: {
2826
2873
  ...this.#l.value.moduleEditor,
2827
2874
  phase: n == null ? "failed" : void 0
2828
2875
  } }), n != null;
2829
2876
  }
2830
- async moveNodes(e) {
2831
- let t = this.#l.value.target;
2832
- t != null && await this.#T((n) => d(n, t, e));
2877
+ async moveNodes(e, t = "detail") {
2878
+ let n = this.#l.value.target;
2879
+ n != null && await this.#T((r) => p(r, n, e, t));
2833
2880
  }
2834
- async moveViewport(e) {
2835
- let t = this.#l.value.target;
2836
- if (t == null) return;
2837
- let n = this.#P().viewport;
2838
- (n.x != e.x || n.y != e.y || n.zoom != e.zoom) && this.#M(), await this.#T((n) => te(n, t, e));
2881
+ async moveViewport(e, t = "detail") {
2882
+ let n = this.#l.value.target;
2883
+ if (n == null) return;
2884
+ let r = this.#P().viewport;
2885
+ (r.x != e.x || r.y != e.y || r.zoom != e.zoom) && this.#M(), await this.#T((r) => te(r, n, e, t));
2839
2886
  }
2840
2887
  async check() {
2841
2888
  await this.#E();
@@ -2865,7 +2912,7 @@ var bt = class {
2865
2912
  if (e.kind != "comment") return [];
2866
2913
  let t = /#(\d+)$/.exec(e.title);
2867
2914
  return t == null ? [] : [Number(t[1])];
2868
- })), i = this.#T((i) => g(i, e, t, {
2915
+ })), i = this.#T((i) => _(i, e, t, {
2869
2916
  content: "",
2870
2917
  position: n,
2871
2918
  title: this.#r.t("addNode.commentName", { number: r + 1 })
@@ -2912,7 +2959,7 @@ var bt = class {
2912
2959
  let n = await this.#e.checkFlow(e, t.revisionId);
2913
2960
  !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ diagnostics: n });
2914
2961
  } catch (n) {
2915
- !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(p(n, this.#r.t));
2962
+ !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#c(u(n, this.#r.t));
2916
2963
  } finally {
2917
2964
  !this.#_ && e == this.#l.value.flowId && t.revisionId == this.#l.value.draft?.revisionId && this.#B({ checkLoading: !1 });
2918
2965
  }
@@ -2950,7 +2997,7 @@ var bt = class {
2950
2997
  s = this.#k(a, o);
2951
2998
  }
2952
2999
  if (s.revisionId == a.revisionId) return !0;
2953
- let c = o.kind == "changes" && t != null ? rt(m(a), m(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
3000
+ let c = o.kind == "changes" && t != null ? it(h(a), h(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
2954
3001
  o.kind == "snapshot" && this.#M();
2955
3002
  let l = this.#L(s, !1);
2956
3003
  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({
@@ -2958,7 +3005,7 @@ var bt = class {
2958
3005
  message: this.#r.t(l ? "notice.moduleUpdated" : "notice.draftUpdated")
2959
3006
  }), this.#E()), !0;
2960
3007
  } catch (n) {
2961
- return t && this.#z(e) && this.#c(p(n, this.#r.t)), !1;
3008
+ return t && this.#z(e) && this.#c(u(n, this.#r.t)), !1;
2962
3009
  }
2963
3010
  }
2964
3011
  #k(e, t) {
@@ -2968,7 +3015,7 @@ var bt = class {
2968
3015
  if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
2969
3016
  n = {
2970
3017
  ...e.revision,
2971
- content: W(n, e.operations).content
3018
+ content: K(n, e.operations).content
2972
3019
  };
2973
3020
  }
2974
3021
  return n;
@@ -2983,7 +3030,7 @@ var bt = class {
2983
3030
  return;
2984
3031
  }
2985
3032
  for (let e of n) a.targets.add(e);
2986
- globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), vt);
3033
+ globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), xt);
2987
3034
  return;
2988
3035
  }
2989
3036
  n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
@@ -2992,7 +3039,7 @@ var bt = class {
2992
3039
  flowId: e.flowId,
2993
3040
  target: t,
2994
3041
  targets: new Set(n),
2995
- timer: globalThis.setTimeout(() => this.#j(), vt),
3042
+ timer: globalThis.setTimeout(() => this.#j(), xt),
2996
3043
  viewport: this.#P().viewport
2997
3044
  });
2998
3045
  }
@@ -3003,7 +3050,7 @@ var bt = class {
3003
3050
  if (t.flowId != e.flowId || !$(t.target, e.target) || t.selectedNodeIds.length > 0) return;
3004
3051
  let n = this.#P().viewport;
3005
3052
  if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
3006
- let r = m(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
3053
+ let r = h(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
3007
3054
  i.length == 1 && this.#B({ nodeFocus: {
3008
3055
  nodeId: i[0],
3009
3056
  requestId: ++this.#y
@@ -3017,7 +3064,7 @@ var bt = class {
3017
3064
  }
3018
3065
  #P() {
3019
3066
  let e = this.#l.value;
3020
- return v(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3067
+ return y(e.draft, e.target, e.presentation?.value, e.diagnostics?.diagnostics, {}, {}, this.#r.t);
3021
3068
  }
3022
3069
  #F() {
3023
3070
  let e = this.#l.value.moduleEditor;
@@ -3027,7 +3074,7 @@ var bt = class {
3027
3074
  }), !1);
3028
3075
  }
3029
3076
  #I(e) {
3030
- let t = m(e), n = yt(t, this.#l.value.target);
3077
+ let t = h(e), n = St(t, this.#l.value.target);
3031
3078
  return {
3032
3079
  revision: t,
3033
3080
  selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
@@ -3061,13 +3108,13 @@ var bt = class {
3061
3108
  };
3062
3109
  //#endregion
3063
3110
  //#region src/workbench/browser/runtime/stores/workbenchStore.ts
3064
- function xt(e) {
3111
+ function wt(e) {
3065
3112
  return new Map(e.nodes.map((e) => [e.id, e]));
3066
3113
  }
3067
- function St(e, t) {
3068
- return e == null || t == null ? [] : m(e).designerInputs(t);
3114
+ function Tt(e, t) {
3115
+ return e == null || t == null ? [] : h(e).designerInputs(t);
3069
3116
  }
3070
- function Ct(e, t, n, r, i) {
3117
+ function Et(e, t, n, r, i) {
3071
3118
  if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
3072
3119
  let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
3073
3120
  return typeof a == "string" ? new Map(r.flatMap((t) => {
@@ -3075,38 +3122,38 @@ function Ct(e, t, n, r, i) {
3075
3122
  return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
3076
3123
  })) : /* @__PURE__ */ new Map();
3077
3124
  }
3078
- var wt = { openExternalPage: async () => !1 }, Tt = class {
3125
+ var Dt = { openExternalPage: async () => !1 }, Ot = class {
3079
3126
  #e;
3080
3127
  #t;
3081
3128
  #n;
3082
3129
  #r;
3083
- constructor(r, i, a = () => crypto.randomUUID(), s = c(), l = wt) {
3084
- this.#e = new o(), this.#n = t(), this.#r = !1, this.provideAddNodeOptions = async (e, t) => await this.#i([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#i([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#t = s;
3085
- let u = (e) => {
3130
+ constructor(r, i, a = () => crypto.randomUUID(), o = l(), s = Dt) {
3131
+ this.#e = new x(), this.#n = t(), this.#r = !1, this.provideAddNodeOptions = async (e, t) => await this.#i([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#i([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#t = o;
3132
+ let c = (e) => {
3086
3133
  this.#r || this.#n.set(e);
3087
3134
  };
3088
- this.runs = new y(r, u, s), this.workspace = new bt(r, u, a, s, (e) => void this.#a(r, e)), this.connectors = new ve(r, this.workspace, u, l, s), this.triggers = new Se(r, this.workspace, u, l, s), this.publications = new de(r, this.workspace, u, a, s), this.runRequests = new he(r, this.runs, u, s, a);
3089
- let d = /* @__PURE__ */ new Map(), p, m = n((e) => {
3135
+ this.runs = new v(r, c, o), this.workspace = new Ct(r, c, a, o, (e) => void this.#a(r, e)), this.connectors = new ye(r, this.workspace, c, s, o), this.triggers = new xe(r, this.workspace, c, s, o), this.publications = new de(r, this.workspace, c, a, o), this.runRequests = new ge(r, this.runs, c, o, a);
3136
+ let u = /* @__PURE__ */ new Map(), d, f = n((e) => {
3090
3137
  let t = e(this.workspace.$.draft);
3091
- p != t?.flowId && (d.clear(), p = t?.flowId);
3092
- let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), o = e(this.connectors.$.catalogs), c = e(s.t$), l = e(this.runs.$.run), u = e(this.runs.$.events), m = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, h = [
3093
- ...St(t, n),
3094
- r == null || n == null ? void 0 : f(r, n),
3138
+ d != t?.flowId && (u.clear(), d = t?.flowId);
3139
+ let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), f = e(this.runs.$.events), p = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, h = [
3140
+ ...Tt(t, n),
3141
+ r == null || n == null ? void 0 : m(r, n),
3095
3142
  i,
3096
3143
  a,
3097
- o,
3144
+ s,
3098
3145
  c,
3099
3146
  l,
3100
- u,
3147
+ f,
3101
3148
  ...l == null ? [] : [t?.revisionId]
3102
- ], g = d.get(m);
3149
+ ], g = u.get(p);
3103
3150
  if (g != null && g.inputs.length == h.length && g.inputs.every((e, t) => e === h[t])) return g.graph;
3104
- let _ = v(t, n, r, i, a, o, c, l, u);
3105
- return d.set(m, {
3151
+ let _ = y(t, n, r, i, a, s, c, l, f);
3152
+ return u.set(p, {
3106
3153
  graph: _,
3107
3154
  inputs: h
3108
3155
  }), _;
3109
- }), h = e(m, xt);
3156
+ }), p = e(f, wt);
3110
3157
  this.$ = {
3111
3158
  busy: n((e) => {
3112
3159
  let t = e(this.workspace.$.busy);
@@ -3117,13 +3164,13 @@ var wt = { openExternalPage: async () => !1 }, Tt = class {
3117
3164
  if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
3118
3165
  if (e(this.publications.$.changingTriggerId) != null) return "trigger";
3119
3166
  }),
3120
- designer: m,
3121
- designerNodeById: h,
3167
+ designer: f,
3168
+ designerNodeById: p,
3122
3169
  notice: this.#n,
3123
- runEventNodes: n((e) => Ct(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(h))),
3170
+ runEventNodes: n((e) => Et(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(p))),
3124
3171
  selectedDesignerNode: n((e) => {
3125
3172
  let t = e(this.workspace.$.selectedNodeIds);
3126
- return t.length == 1 ? e(h).get(t[0]) : void 0;
3173
+ return t.length == 1 ? e(p).get(t[0]) : void 0;
3127
3174
  })
3128
3175
  };
3129
3176
  }
@@ -3152,7 +3199,11 @@ var wt = { openExternalPage: async () => !1 }, Tt = class {
3152
3199
  }), !0);
3153
3200
  }
3154
3201
  selectNodes(e) {
3155
- this.workspace.selectNodes(e) && (this.connectors.refresh(), this.triggers.refresh());
3202
+ let t = this.workspace.$.selectedNodeIds.value;
3203
+ if (this.workspace.selectNodes(e)) {
3204
+ if (t === this.workspace.$.selectedNodeIds.value) return;
3205
+ this.connectors.refresh(), this.triggers.refresh();
3206
+ }
3156
3207
  }
3157
3208
  locateRunEvent(e) {
3158
3209
  let t = this.$.runEventNodes.value.get(e);
@@ -3171,7 +3222,7 @@ var wt = { openExternalPage: async () => !1 }, Tt = class {
3171
3222
  if (t.aborted || this.#r) return;
3172
3223
  let r = n.filter((e) => e.status == "rejected");
3173
3224
  if (r.length > 0 && r.length == n.length) throw r[0].reason;
3174
- return r.length > 0 && this.#n.set(p(r[0].reason, this.#t.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3225
+ return r.length > 0 && this.#n.set(u(r[0].reason, this.#t.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
3175
3226
  }
3176
3227
  async refreshSelectedConnector(e = !1) {
3177
3228
  await this.connectors.refresh(e);
@@ -3196,16 +3247,16 @@ var wt = { openExternalPage: async () => !1 }, Tt = class {
3196
3247
  return;
3197
3248
  }
3198
3249
  }
3199
- }, Et = ie(() => import("./flowWorkspace-Bo0bz1Uz.js"));
3200
- function Dt({ host: e, store: t }) {
3250
+ }, kt = ie(() => import("./flowWorkspace-D7-rBA1-.js").then((e) => e.t));
3251
+ function At({ host: e, store: t }) {
3201
3252
  let n = a(t.$.notice);
3202
- return x(() => e.notify(n), [e, n]), x(() => () => e.notify(void 0), [e]), null;
3253
+ return S(() => e.notify(n), [e, n]), S(() => () => e.notify(void 0), [e]), null;
3203
3254
  }
3204
- function Ot({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store: i, theme: o }) {
3255
+ function jt({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store: i, theme: o }) {
3205
3256
  let s = a(i.workspace.$.flowId);
3206
- return /* @__PURE__ */ S("div", {
3257
+ return /* @__PURE__ */ C("div", {
3207
3258
  className: "app-shell",
3208
- children: s == null ? /* @__PURE__ */ S(ne, {
3259
+ children: s == null ? /* @__PURE__ */ C(ne, {
3209
3260
  hrefForFlow: (t) => e({
3210
3261
  flowId: t.flowId,
3211
3262
  view: "design"
@@ -3215,12 +3266,12 @@ function Ot({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store
3215
3266
  onLanguageChange: r,
3216
3267
  onSelectFlow: (e) => void n.selectFlow(e),
3217
3268
  store: i
3218
- }) : /* @__PURE__ */ S(re, {
3219
- fallback: /* @__PURE__ */ S("main", {
3269
+ }) : /* @__PURE__ */ C(re, {
3270
+ fallback: /* @__PURE__ */ C("main", {
3220
3271
  "aria-busy": "true",
3221
3272
  className: "workspace"
3222
3273
  }),
3223
- children: /* @__PURE__ */ S(Et, {
3274
+ children: /* @__PURE__ */ C(kt, {
3224
3275
  hrefFor: e,
3225
3276
  language: t,
3226
3277
  navigation: n,
@@ -3231,18 +3282,18 @@ function Ot({ hrefFor: e, language: t, navigation: n, onLanguageChange: r, store
3231
3282
  })
3232
3283
  });
3233
3284
  }
3234
- function kt({ host: e, hrefFor: t, language: n, location: r, onLanguageChange: a, onNavigate: o, preferences: s, theme: l }) {
3285
+ function Mt({ host: e, hrefFor: t, language: n, location: i, onLanguageChange: a, onNavigate: o, preferences: s, theme: u }) {
3235
3286
  let d = ae(o);
3236
3287
  d.current = o;
3237
3288
  let [{ i18n: f, navigation: p, store: m }] = oe(() => {
3238
- let t = c(n), i = new Tt(new u((t, n) => e.request(t, n), (t, n) => e.subscribeFlow(t, n), (t) => e.subscribeFlowCatalog(t)), s, () => crypto.randomUUID(), t, e);
3289
+ let t = l(n), r = new Ot(new c((t, n) => e.request(t, n), (t, n) => e.subscribeFlow(t, n), (t) => e.subscribeFlowCatalog(t)), s, () => crypto.randomUUID(), t, e);
3239
3290
  return {
3240
3291
  i18n: t,
3241
- navigation: new ce(i, r, (e, t) => d.current(e, t)),
3242
- store: i
3292
+ navigation: new ce(r, i, (e, t) => d.current(e, t)),
3293
+ store: r
3243
3294
  };
3244
3295
  });
3245
- return x(() => {
3296
+ return S(() => {
3246
3297
  p.start();
3247
3298
  let e = () => {
3248
3299
  m.connectors.refreshAfterAuthorization(), m.triggers.refreshAfterAuthorization();
@@ -3254,29 +3305,29 @@ function kt({ host: e, hrefFor: t, language: n, location: r, onLanguageChange: a
3254
3305
  f,
3255
3306
  p,
3256
3307
  m
3257
- ]), x(() => void p.apply(r), [r, p]), x(() => {
3308
+ ]), S(() => void p.apply(i), [i, p]), S(() => {
3258
3309
  f.lang != n && f.switchLang(n);
3259
- }, [f, n]), /* @__PURE__ */ S(i, {
3310
+ }, [f, n]), /* @__PURE__ */ C(r, {
3260
3311
  i18n: f,
3261
3312
  children: /* @__PURE__ */ se("div", {
3262
3313
  className: "open-flow-workbench",
3263
- "data-theme": l,
3264
- children: [/* @__PURE__ */ S(Dt, {
3314
+ "data-theme": u,
3315
+ children: [/* @__PURE__ */ C(At, {
3265
3316
  host: e,
3266
3317
  store: m
3267
- }), /* @__PURE__ */ S(Ot, {
3318
+ }), /* @__PURE__ */ C(jt, {
3268
3319
  hrefFor: t,
3269
3320
  language: n,
3270
3321
  navigation: p,
3271
3322
  onLanguageChange: a,
3272
3323
  store: m,
3273
- theme: l
3324
+ theme: u
3274
3325
  })]
3275
3326
  })
3276
3327
  });
3277
3328
  }
3278
- function At({ sessionKey: e, ...t }) {
3279
- return /* @__PURE__ */ S(kt, { ...t }, e);
3329
+ function Nt({ sessionKey: e, ...t }) {
3330
+ return /* @__PURE__ */ C(Mt, { ...t }, e);
3280
3331
  }
3281
3332
  //#endregion
3282
- export { At as OpenFlowWorkbench };
3333
+ export { Nt as OpenFlowWorkbench };