@oomol-lab/open-flow 0.1.0-beta.31 → 0.1.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/browser/{createResourceDialog-FBRnCMK6.js → createResourceDialog-DRB0OEtr.js} +2 -2
  2. package/dist/browser/{editorComponent-CyH2o-Ji.js → editorComponent-bXA-KosC.js} +2744 -1113
  3. package/dist/browser/flow-authoring-node.d.ts +5 -3
  4. package/dist/browser/flow-authoring.js +1569 -1462
  5. package/dist/browser/flow-change.d.ts +44 -17
  6. package/dist/browser/flow-change.js +1614 -1492
  7. package/dist/browser/flow-input-value.d.ts +6 -0
  8. package/dist/browser/flow-notifications.d.ts +5 -0
  9. package/dist/browser/flowChanges-FiZJreeB.js +9855 -0
  10. package/dist/browser/{flowRunInputEditorStore-CTORQcA2.js → flowRunInputEditorStore-Bgb5vSeS.js} +3 -3
  11. package/dist/browser/flowWorkspace-CBo6Ih_c.js +40987 -0
  12. package/dist/browser/{inputValues-C21gYJuc.js → inputValues-CUyjbECo.js} +2 -2
  13. package/dist/browser/licenses.md +0 -58
  14. package/dist/browser/{lite-BuKZ8joP.js → lite-BA96NG4M.js} +8 -4
  15. package/dist/browser/theme.css +2 -0
  16. package/dist/browser/ui.css +2 -1
  17. package/dist/browser/ui.d.ts +31 -3
  18. package/dist/browser/ui.js +3547 -772
  19. package/dist/browser/{value-DPg_9yXB.js → value-B_yE9ean.js} +22 -14
  20. package/dist/browser/workbench.css +1 -1
  21. package/dist/browser/workbench.d.ts +1 -0
  22. package/dist/browser/workbench.js +3944 -1077
  23. package/dist/browser/{workbenchSelect-DAaGuZwP.js → workbenchSelect-DNteZJYP.js} +1695 -1471
  24. package/dist/common/control-api-conformance.d.ts +6 -0
  25. package/dist/common/control-api-conformance.js +502 -388
  26. package/dist/common/control-api-errors.d.ts +16 -0
  27. package/dist/common/control-api.d.ts +49 -6
  28. package/dist/common/control-api.js +1715 -1564
  29. package/dist/common/control-requests.d.ts +10 -0
  30. package/dist/common/control-requests.js +1182 -1137
  31. package/dist/common/event-sources.d.ts +0 -1
  32. package/dist/common/feishu-events.d.ts +0 -1
  33. package/dist/common/flow-encoding.js +580 -557
  34. package/dist/common/flow-graph.d.ts +16 -9
  35. package/dist/common/flow-notifications.d.ts +5 -0
  36. package/dist/common/flow-semantics.d.ts +2 -2
  37. package/dist/common/flow-semantics.js +2184 -1912
  38. package/dist/common/fr-ClB96SQY.js +298 -0
  39. package/dist/common/integration-trigger.d.ts +1 -0
  40. package/dist/common/integration-trigger.js +7572 -88
  41. package/dist/common/ja-BJF-VrP2.js +298 -0
  42. package/dist/common/ko-Bght_VaB.js +298 -0
  43. package/dist/common/mcp.js +1718 -1571
  44. package/dist/common/poll-trigger.d.ts +3 -1
  45. package/dist/common/poll-trigger.js +7512 -28
  46. package/dist/common/provider-triggers.js +6798 -3518
  47. package/dist/common/ru-DrP4BRM5.js +298 -0
  48. package/dist/common/runtime-contract.d.ts +1 -1
  49. package/dist/common/runtime-contract.js +41 -27
  50. package/dist/common/scheduler.js +921 -738
  51. package/dist/common/trigger-catalog.d.ts +3 -1
  52. package/dist/common/trigger-config.d.ts +7 -0
  53. package/dist/common/zh-CN-D2od3TNw.js +298 -0
  54. package/dist/common/zh-TW-CRmc3FMz.js +298 -0
  55. package/package.json +1 -1
  56. package/dist/browser/flowChanges-ScpWTKtQ.js +0 -12293
  57. package/dist/browser/flowWorkspace-CY1r6dwz.js +0 -153101
  58. package/dist/common/fr-iv1541dF.js +0 -93
  59. package/dist/common/ja-Bq-ZDOD4.js +0 -93
  60. package/dist/common/ko-Z-k9R2c6.js +0 -93
  61. package/dist/common/ru-B4gFecYZ.js +0 -93
  62. package/dist/common/zh-CN-ByQ6nYam.js +0 -93
  63. package/dist/common/zh-TW-QjIarvX9.js +0 -93
@@ -75,22 +75,22 @@ var ee = /* @__PURE__*/ r(() => {
75
75
  return !1;
76
76
  }
77
77
  });
78
- function te(e) {
78
+ function h(e) {
79
79
  if (m(e) === !1) return !1;
80
80
  let t = e.constructor;
81
81
  if (t === void 0 || typeof t != "function") return !0;
82
82
  let n = t.prototype;
83
83
  return m(n) !== !1 && Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") !== !1;
84
84
  }
85
- function ne(e) {
86
- return te(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
85
+ function te(e) {
86
+ return h(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
87
87
  }
88
- var re = /* @__PURE__*/ new Set([
88
+ var ne = /* @__PURE__*/ new Set([
89
89
  "string",
90
90
  "number",
91
91
  "symbol"
92
92
  ]);
93
- function h(e) {
93
+ function re(e) {
94
94
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
95
95
  }
96
96
  function g(e, t, n) {
@@ -154,7 +154,7 @@ function ce(e, t) {
154
154
  }));
155
155
  }
156
156
  function le(e, t) {
157
- if (!te(t)) throw Error("Invalid input to extend: expected a plain object");
157
+ if (!h(t)) throw Error("Invalid input to extend: expected a plain object");
158
158
  let n = e._zod.def.checks;
159
159
  if (n && n.length > 0) {
160
160
  let n = e._zod.def.shape;
@@ -169,7 +169,7 @@ function le(e, t) {
169
169
  } }));
170
170
  }
171
171
  function ue(e, t) {
172
- if (!te(t)) throw Error("Invalid input to safeExtend: expected a plain object");
172
+ if (!h(t)) throw Error("Invalid input to safeExtend: expected a plain object");
173
173
  return g(e, u(e._zod.def, { get shape() {
174
174
  let n = {
175
175
  ...e._zod.def.shape,
@@ -234,48 +234,48 @@ function pe(e, t, n) {
234
234
  return l(this, "shape", i), i;
235
235
  } }));
236
236
  }
237
- function v(e, t = 0) {
237
+ function me(e, t = 0) {
238
238
  if (e.aborted === !0) return !0;
239
239
  for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
240
240
  return !1;
241
241
  }
242
- function me(e, t = 0) {
242
+ function he(e, t = 0) {
243
243
  if (e.aborted === !0) return !0;
244
244
  for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
245
245
  return !1;
246
246
  }
247
- function y(e, t) {
247
+ function v(e, t) {
248
248
  return t.map((t) => {
249
249
  var n;
250
250
  return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
251
251
  });
252
252
  }
253
- function he(e) {
253
+ function ge(e) {
254
254
  return typeof e == "string" ? e : e?.message;
255
255
  }
256
- function ge(e, t, n) {
256
+ function _e(e, t, n) {
257
257
  var r;
258
258
  for (let i = t; i < e.length; i++) (r = e[i]).schema ?? (r.schema = n);
259
259
  }
260
- function b(e, t, n) {
260
+ function y(e, t, n) {
261
261
  var r;
262
262
  let i = e.inst?._zod?.traits;
263
263
  i?.has("$ZodType") && (i.has("$ZodCheck") ? (r = e).schema ?? (r.schema = e.inst) : e.schema = e.inst);
264
- let a = e.schema === e.inst ? void 0 : e.schema?._zod.def?.error, o = e.message ? e.message : he(e.inst?._zod.def?.error?.(e)) ?? he(a?.(e)) ?? he(t?.error?.(e)) ?? he(n.customError?.(e)) ?? he(n.localeError?.(e)) ?? "Invalid input", { inst: s, schema: c, continue: l, input: u, ...d } = e;
264
+ let a = e.schema === e.inst ? void 0 : e.schema?._zod.def?.error, o = e.message ? e.message : ge(e.inst?._zod.def?.error?.(e)) ?? ge(a?.(e)) ?? ge(t?.error?.(e)) ?? ge(n.customError?.(e)) ?? ge(n.localeError?.(e)) ?? "Invalid input", { inst: s, schema: c, continue: l, input: u, ...d } = e;
265
265
  return d.path ??= [], d.message = o, t?.reportInput && (d.input = u), d;
266
266
  }
267
- var _e = /[\uD800-\uDBFF]/;
268
- function ve(e) {
267
+ var ve = /[\uD800-\uDBFF]/;
268
+ function ye(e) {
269
269
  let t = e.length;
270
- if (!_e.test(e)) return t;
270
+ if (!ve.test(e)) return t;
271
271
  let n = t;
272
272
  for (let r = 0; r < t - 1; r++) (e.charCodeAt(r) & 64512) == 55296 && (e.charCodeAt(r + 1) & 64512) == 56320 && (n--, r++);
273
273
  return n;
274
274
  }
275
- function ye(e) {
275
+ function be(e) {
276
276
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
277
277
  }
278
- function be(e) {
278
+ function xe(e) {
279
279
  let t = typeof e;
280
280
  switch (t) {
281
281
  case "number": return Number.isNaN(e) ? "nan" : "number";
@@ -288,7 +288,7 @@ function be(e) {
288
288
  }
289
289
  return t;
290
290
  }
291
- function xe(...e) {
291
+ function Se(...e) {
292
292
  let [t, n, r] = e;
293
293
  return typeof t == "string" ? {
294
294
  message: t,
@@ -297,7 +297,7 @@ function xe(...e) {
297
297
  inst: r
298
298
  } : { ...t };
299
299
  }
300
- function Se(e, t) {
300
+ function Ce(e, t) {
301
301
  for (let n in t) {
302
302
  let r = Object.getOwnPropertyDescriptor(t, n);
303
303
  r.get ? Object.defineProperty(e, n, {
@@ -306,7 +306,7 @@ function Se(e, t) {
306
306
  }) : Te(e, n, r.value);
307
307
  }
308
308
  }
309
- function Ce(e, t, n, r = !0) {
309
+ function b(e, t, n, r = !0) {
310
310
  return Object.defineProperty(e, t, {
311
311
  configurable: !0,
312
312
  writable: !0,
@@ -315,16 +315,16 @@ function Ce(e, t, n, r = !0) {
315
315
  }), n;
316
316
  }
317
317
  function we(e, t, n) {
318
- return Ce(e, t, n, !1);
318
+ return b(e, t, n, !1);
319
319
  }
320
320
  function Te(e, t, n) {
321
321
  Object.defineProperty(e, t, {
322
322
  configurable: !0,
323
323
  get() {
324
- return this == null ? n : Ce(this, t, n.bind(this));
324
+ return this == null ? n : b(this, t, n.bind(this));
325
325
  },
326
326
  set(e) {
327
- Ce(this, t, e);
327
+ b(this, t, e);
328
328
  }
329
329
  });
330
330
  }
@@ -444,7 +444,7 @@ function S(e, t, n, r) {
444
444
  let e = Object.getPrototypeOf(n), t = n._zod.constr.prototype, r = e;
445
445
  for (; r && r !== t;) r = Object.getPrototypeOf(r);
446
446
  let i = r ?? e;
447
- s.has(i) || (s.add(i), Se(i, o));
447
+ s.has(i) || (s.add(i), Ce(i, o));
448
448
  }
449
449
  let i = d.prototype;
450
450
  for (let e in i) Object.prototype.hasOwnProperty.call(i, e) && (e in n || (n[e] = i[e].bind(n)));
@@ -587,7 +587,7 @@ var Qe = (e) => {
587
587
  }, o);
588
588
  if (s instanceof Promise) throw new Le();
589
589
  if (s.issues.length) {
590
- let n = new ((a?.Err) ?? e)(s.issues.map((e) => b(e, o, w())));
590
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => y(e, o, w())));
591
591
  throw p(n, a?.callee ?? t), n;
592
592
  }
593
593
  return s.value;
@@ -603,7 +603,7 @@ var Qe = (e) => {
603
603
  issues: []
604
604
  }, o);
605
605
  if (s instanceof Promise && (s = await s), s.issues.length) {
606
- let n = new ((a?.Err) ?? e)(s.issues.map((e) => b(e, o, w())));
606
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => y(e, o, w())));
607
607
  throw p(n, a?.callee ?? t), n;
608
608
  }
609
609
  return s.value;
@@ -620,7 +620,7 @@ var Qe = (e) => {
620
620
  if (a instanceof Promise) throw new Le();
621
621
  return a.issues.length ? {
622
622
  success: !1,
623
- error: new (e ?? Ke)(a.issues.map((e) => b(e, i, w())))
623
+ error: new (e ?? Ke)(a.issues.map((e) => y(e, i, w())))
624
624
  } : {
625
625
  success: !0,
626
626
  data: a.value
@@ -635,7 +635,7 @@ var Qe = (e) => {
635
635
  }, i);
636
636
  return a instanceof Promise && (a = await a), a.issues.length ? {
637
637
  success: !1,
638
- error: new e(a.issues.map((e) => b(e, i, w())))
638
+ error: new e(a.issues.map((e) => y(e, i, w())))
639
639
  } : {
640
640
  success: !0,
641
641
  data: a.value
@@ -835,8 +835,8 @@ var zt = (e) => {
835
835
  t.maximum < n && (e._zod.bag.maximum = t.maximum);
836
836
  }), e._zod.check = (n) => {
837
837
  let r = n.value, i = r.length;
838
- if ((typeof r == "string" && i > t.maximum ? ve(r) : i) <= t.maximum) return;
839
- let a = ye(r);
838
+ if ((typeof r == "string" && i > t.maximum ? ye(r) : i) <= t.maximum) return;
839
+ let a = be(r);
840
840
  n.issues.push({
841
841
  origin: a,
842
842
  code: "too_big",
@@ -854,8 +854,8 @@ var zt = (e) => {
854
854
  t.minimum > n && (e._zod.bag.minimum = t.minimum);
855
855
  }), e._zod.check = (n) => {
856
856
  let r = n.value, i = r.length;
857
- if ((typeof r == "string" && i >= t.minimum && i < t.minimum * 2 ? ve(r) : i) >= t.minimum) return;
858
- let a = ye(r);
857
+ if ((typeof r == "string" && i >= t.minimum && i < t.minimum * 2 ? ye(r) : i) >= t.minimum) return;
858
+ let a = be(r);
859
859
  n.issues.push({
860
860
  origin: a,
861
861
  code: "too_small",
@@ -872,9 +872,9 @@ var zt = (e) => {
872
872
  let n = e._zod.bag;
873
873
  n.minimum = t.length, n.maximum = t.length, n.length = t.length;
874
874
  }), e._zod.check = (n) => {
875
- let r = n.value, i = r.length, a = typeof r == "string" && i >= t.length && i <= t.length * 2 ? ve(r) : i;
875
+ let r = n.value, i = r.length, a = typeof r == "string" && i >= t.length && i <= t.length * 2 ? ye(r) : i;
876
876
  if (a === t.length) return;
877
- let o = ye(r), s = a > t.length;
877
+ let o = be(r), s = a > t.length;
878
878
  n.issues.push({
879
879
  origin: o,
880
880
  ...s ? {
@@ -925,7 +925,7 @@ var zt = (e) => {
925
925
  t.pattern ??= Gt, tn.init(e, t);
926
926
  }), on = /*@__PURE__*/ S("$ZodCheckIncludes", (e, t) => {
927
927
  T.init(e, t);
928
- let n = h(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
928
+ let n = re(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
929
929
  t.pattern = r, e._zod.onattach.push((e) => {
930
930
  let t = e._zod.bag;
931
931
  t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
@@ -942,7 +942,7 @@ var zt = (e) => {
942
942
  };
943
943
  }), sn = /*@__PURE__*/ S("$ZodCheckStartsWith", (e, t) => {
944
944
  T.init(e, t);
945
- let n = RegExp(`^${h(t.prefix)}.*`);
945
+ let n = RegExp(`^${re(t.prefix)}.*`);
946
946
  t.pattern ??= n, e._zod.onattach.push((e) => {
947
947
  let t = e._zod.bag;
948
948
  t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
@@ -959,7 +959,7 @@ var zt = (e) => {
959
959
  };
960
960
  }), cn = /*@__PURE__*/ S("$ZodCheckEndsWith", (e, t) => {
961
961
  T.init(e, t);
962
- let n = RegExp(`.*${h(t.suffix)}$`);
962
+ let n = RegExp(`.*${re(t.suffix)}$`);
963
963
  t.pattern ??= n, e._zod.onattach.push((e) => {
964
964
  let t = e._zod.bag;
965
965
  t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
@@ -1012,24 +1012,24 @@ var zt = (e) => {
1012
1012
  else {
1013
1013
  let t = (t, n, r) => {
1014
1014
  if (t.memo) return t;
1015
- let i = v(t), a;
1015
+ let i = me(t), a;
1016
1016
  for (let o of n) {
1017
1017
  if (o._zod.def.when) {
1018
- if (me(t) || !o._zod.def.when(t)) continue;
1018
+ if (he(t) || !o._zod.def.when(t)) continue;
1019
1019
  } else if (i) continue;
1020
1020
  let n = t.issues.length, s = o._zod.check(t);
1021
1021
  if (s instanceof Promise && r?.async === !1) throw new Le();
1022
1022
  if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
1023
- await s, t.issues.length !== n && (ge(t.issues, n, e), i ||= v(t, n));
1023
+ await s, t.issues.length !== n && (_e(t.issues, n, e), i ||= me(t, n));
1024
1024
  });
1025
1025
  else {
1026
1026
  if (t.issues.length === n) continue;
1027
- ge(t.issues, n, e), i ||= v(t, n);
1027
+ _e(t.issues, n, e), i ||= me(t, n);
1028
1028
  }
1029
1029
  }
1030
1030
  return a ? a.then(() => t) : t;
1031
1031
  }, n = (n, r, a) => {
1032
- if (v(n)) return n.aborted = !0, n;
1032
+ if (me(n)) return n.aborted = !0, n;
1033
1033
  let o = t(r, i, a);
1034
1034
  if (o instanceof Promise) {
1035
1035
  if (a.async === !1) throw new Le();
@@ -1062,7 +1062,7 @@ var zt = (e) => {
1062
1062
  return we(this, "~standard", pn(this));
1063
1063
  },
1064
1064
  set "~standard"(e) {
1065
- Ce(this, "~standard", e);
1065
+ b(this, "~standard", e);
1066
1066
  }
1067
1067
  }), fn = (e) => e.success ? { value: e.data } : { issues: e.error?.issues };
1068
1068
  function pn(e) {
@@ -1364,7 +1364,7 @@ var Jn = /*@__PURE__*/ S("$ZodJWT", (e, t) => {
1364
1364
  }), t);
1365
1365
  });
1366
1366
  function tr(e, t, n) {
1367
- e.issues.length && t.issues.push(...y(n, e.issues)), t.value[n] = e.value;
1367
+ e.issues.length && t.issues.push(...v(n, e.issues)), t.value[n] = e.value;
1368
1368
  }
1369
1369
  var nr = /*@__PURE__*/ S("$ZodArray", (e, t) => {
1370
1370
  E.init(e, t);
@@ -1394,7 +1394,7 @@ function rr(e, t, n, r, i, a) {
1394
1394
  if (!(!o && s && i === "optional")) {
1395
1395
  if (e.issues.length) {
1396
1396
  if (i !== void 0 && s && !o) return;
1397
- t.issues.push(...y(n, e.issues));
1397
+ t.issues.push(...v(n, e.issues));
1398
1398
  }
1399
1399
  if (!o && i === void 0) {
1400
1400
  e.issues.length || t.issues.push({
@@ -1572,12 +1572,12 @@ var sr = /* @__PURE__ */ new WeakMap(), cr = /*@__PURE__*/ S("$ZodObject", (e, t
1572
1572
  });
1573
1573
  function ur(e, t, n, r) {
1574
1574
  for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1575
- let i = e.filter((e) => !v(e));
1575
+ let i = e.filter((e) => !me(e));
1576
1576
  return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1577
1577
  code: "invalid_union",
1578
1578
  input: t.value,
1579
1579
  inst: n,
1580
- errors: e.map((e) => e.issues.map((e) => b(e, r, w())))
1580
+ errors: e.map((e) => e.issues.map((e) => y(e, r, w())))
1581
1581
  }), t);
1582
1582
  }
1583
1583
  var dr = /*@__PURE__*/ S("$ZodUnion", (e, t) => {
@@ -1623,7 +1623,7 @@ function pr(e, t) {
1623
1623
  valid: !0,
1624
1624
  data: e
1625
1625
  };
1626
- if (te(e) && te(t)) {
1626
+ if (h(e) && h(t)) {
1627
1627
  let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1628
1628
  ...e,
1629
1629
  ...t
@@ -1691,7 +1691,7 @@ function mr(e, t, n) {
1691
1691
  }
1692
1692
  let c = pr(t.value, n.value);
1693
1693
  if (!c.valid) {
1694
- if (v(e)) return e;
1694
+ if (me(e)) return e;
1695
1695
  throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
1696
1696
  }
1697
1697
  return e.value = c.data, e;
@@ -1701,7 +1701,7 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1701
1701
  let n = C.memoizer;
1702
1702
  n?.attach(e), e._zod.parse = (r, i) => {
1703
1703
  let a = r.value;
1704
- if (!te(a)) return r.issues.push({
1704
+ if (!h(a)) return r.issues.push({
1705
1705
  expected: "record",
1706
1706
  code: "invalid_type",
1707
1707
  input: a,
@@ -1722,7 +1722,7 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1722
1722
  r.issues.push({
1723
1723
  code: "invalid_key",
1724
1724
  origin: "record",
1725
- issues: s.issues.map((e) => b(e, i, w())),
1725
+ issues: s.issues.map((e) => y(e, i, w())),
1726
1726
  input: n,
1727
1727
  path: [n],
1728
1728
  inst: e
@@ -1736,8 +1736,8 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1736
1736
  issues: []
1737
1737
  }, i);
1738
1738
  u instanceof Promise ? o.push(u.then((e) => {
1739
- e.issues.length && r.issues.push(...y(n, e.issues)), r.value[l] = e.value;
1740
- })) : (u.issues.length && r.issues.push(...y(n, u.issues)), r.value[l] = u.value);
1739
+ e.issues.length && r.issues.push(...v(n, e.issues)), r.value[l] = e.value;
1740
+ })) : (u.issues.length && r.issues.push(...v(n, u.issues)), r.value[l] = u.value);
1741
1741
  }
1742
1742
  let l;
1743
1743
  for (let e in a) if (!c.has(e)) {
@@ -1775,7 +1775,7 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1775
1775
  t.mode === "loose" ? r.value[n] = a[n] : s ? (c ??= [], c.push(n)) : r.issues.push({
1776
1776
  code: "invalid_key",
1777
1777
  origin: "record",
1778
- issues: l.issues.map((e) => b(e, i, w())),
1778
+ issues: l.issues.map((e) => y(e, i, w())),
1779
1779
  input: n,
1780
1780
  path: [n],
1781
1781
  inst: e
@@ -1789,8 +1789,8 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1789
1789
  issues: []
1790
1790
  }, i);
1791
1791
  d instanceof Promise ? o.push(d.then((e) => {
1792
- e.issues.length && r.issues.push(...y(n, e.issues)), r.value[u] = e.value;
1793
- })) : (d.issues.length && r.issues.push(...y(n, d.issues)), r.value[u] = d.value);
1792
+ e.issues.length && r.issues.push(...v(n, e.issues)), r.value[u] = e.value;
1793
+ })) : (d.issues.length && r.issues.push(...v(n, d.issues)), r.value[u] = d.value);
1794
1794
  }
1795
1795
  c && c.length > 0 && r.issues.push({
1796
1796
  code: "unrecognized_keys",
@@ -1806,8 +1806,8 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1806
1806
  E.init(t, n);
1807
1807
  let r = e(n.entries), i = new Set(r);
1808
1808
  t._zod.values = i;
1809
- let a = r.filter((e) => re.has(typeof e));
1810
- t._zod.pattern = RegExp(a.length ? `^(${a.map((e) => h(e.toString())).join("|")})$` : "^[^\\s\\S]$"), t._zod.parse = (e, n) => {
1809
+ let a = r.filter((e) => ne.has(typeof e));
1810
+ t._zod.pattern = RegExp(a.length ? `^(${a.map((e) => re(e.toString())).join("|")})$` : "^[^\\s\\S]$"), t._zod.parse = (e, n) => {
1811
1811
  let a = e.value;
1812
1812
  return i.has(a) || e.issues.push({
1813
1813
  code: "invalid_value",
@@ -1819,7 +1819,7 @@ var hr = /*@__PURE__*/ S("$ZodRecord", (e, t) => {
1819
1819
  }), _r = /*@__PURE__*/ S("$ZodLiteral", (e, t) => {
1820
1820
  E.init(e, t);
1821
1821
  let n = new Set(t.values);
1822
- e._zod.values = n, e._zod.pattern = RegExp(t.values.length ? `^(${t.values.map((e) => typeof e == "string" ? h(e) : e ? h(e.toString()) : String(e)).join("|")})$` : "^[^\\s\\S]$"), e._zod.parse = (r, i) => {
1822
+ e._zod.values = n, e._zod.pattern = RegExp(t.values.length ? `^(${t.values.map((e) => typeof e == "string" ? re(e) : e ? re(e.toString()) : String(e)).join("|")})$` : "^[^\\s\\S]$"), e._zod.parse = (r, i) => {
1823
1823
  let a = r.value;
1824
1824
  return n.has(a) || r.issues.push({
1825
1825
  code: "invalid_value",
@@ -1899,7 +1899,7 @@ function Or(e, t, n, r) {
1899
1899
  return t.issues.length ? (e.value = n.catchValue({
1900
1900
  ...t,
1901
1901
  value: e.value,
1902
- error: { issues: t.issues.map((e) => b(e, r, w())) },
1902
+ error: { issues: t.issues.map((e) => y(e, r, w())) },
1903
1903
  input: e.value
1904
1904
  }), e) : (e.value = t.value, t.memo && (e.memo = !0), e);
1905
1905
  }
@@ -1959,7 +1959,7 @@ function Ir(e, t, n, r) {
1959
1959
  path: [...r._zod.def.path ?? []],
1960
1960
  continue: !r._zod.def.abort
1961
1961
  };
1962
- r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(xe(e));
1962
+ r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(Se(e));
1963
1963
  }
1964
1964
  }
1965
1965
  //#endregion
@@ -2185,7 +2185,7 @@ var Yr = () => {
2185
2185
  }
2186
2186
  return (e) => {
2187
2187
  switch (e.code) {
2188
- case "invalid_type": return `Invalid input: expected ${a(e.expected)}, received ${a(be(e.input), e.input)}`;
2188
+ case "invalid_type": return `Invalid input: expected ${a(e.expected)}, received ${a(xe(e.input), e.input)}`;
2189
2189
  case "invalid_value": return e.values.length === 1 ? `Invalid input: expected ${ie(e.values[0])}` : `Invalid option: expected one of ${t(e.values, "|")}`;
2190
2190
  case "too_big": {
2191
2191
  let t = e.exact ? "exactly " : e.inclusive ? "<=" : "<", r = n(e.origin);
@@ -2732,10 +2732,10 @@ function ea(e, t, n) {
2732
2732
  // @__NO_SIDE_EFFECTS__
2733
2733
  function ta(e, t) {
2734
2734
  let n = /* @__PURE__ */ na((t) => (t.addIssue = (e) => {
2735
- if (typeof e == "string") t.issues.push(xe(e, t.value, n._zod.def));
2735
+ if (typeof e == "string") t.issues.push(Se(e, t.value, n._zod.def));
2736
2736
  else {
2737
2737
  let r = e;
2738
- r.fatal && (r.continue = !1), r.code ??= "custom", "input" in r || (r.input = t.value), r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(xe(r));
2738
+ r.fatal && (r.continue = !1), r.code ??= "custom", "input" in r || (r.input = t.value), r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(Se(r));
2739
2739
  }
2740
2740
  }, e(t.value, t)), t);
2741
2741
  return n;
@@ -3401,55 +3401,55 @@ var N = /*@__PURE__*/ S("ZodType", (e, t) => (oo(), E.init(e, t), e.def = t, e.t
3401
3401
  return e.add(this, t), this;
3402
3402
  },
3403
3403
  refine(e, t) {
3404
- return this.check(xs(e, t));
3404
+ return this.check(bs(e, t));
3405
3405
  },
3406
3406
  superRefine(e, t) {
3407
- return this.check(Ss(e, t));
3407
+ return this.check(xs(e, t));
3408
3408
  },
3409
3409
  overwrite(e) {
3410
3410
  return this.check(/* @__PURE__ */ O(e));
3411
3411
  },
3412
3412
  optional() {
3413
- return ts(this);
3413
+ return es(this);
3414
3414
  },
3415
3415
  exactOptional() {
3416
- return rs(this);
3416
+ return ns(this);
3417
3417
  },
3418
3418
  nullable() {
3419
- return as(this);
3419
+ return is(this);
3420
3420
  },
3421
3421
  nullish() {
3422
- return ts(as(this));
3422
+ return es(is(this));
3423
3423
  },
3424
3424
  nonoptional(e) {
3425
- return ds(this, e);
3425
+ return us(this, e);
3426
3426
  },
3427
3427
  array() {
3428
3428
  return z(this);
3429
3429
  },
3430
3430
  or(e) {
3431
- return V([this, e]);
3431
+ return H([this, e]);
3432
3432
  },
3433
3433
  and(e) {
3434
- return Jo(this, e);
3434
+ return qo(this, e);
3435
3435
  },
3436
3436
  transform(e) {
3437
- return hs(this, $o(e));
3437
+ return ms(this, Qo(e));
3438
3438
  },
3439
3439
  default(e) {
3440
- return ss(this, e);
3440
+ return os(this, e);
3441
3441
  },
3442
3442
  prefault(e) {
3443
- return ls(this, e);
3443
+ return cs(this, e);
3444
3444
  },
3445
3445
  catch(e) {
3446
- return ps(this, e);
3446
+ return fs(this, e);
3447
3447
  },
3448
3448
  pipe(e) {
3449
- return hs(this, e);
3449
+ return ms(this, e);
3450
3450
  },
3451
3451
  readonly() {
3452
- return _s(this);
3452
+ return gs(this);
3453
3453
  },
3454
3454
  describe(e) {
3455
3455
  let t = this.clone();
@@ -3479,7 +3479,7 @@ var N = /*@__PURE__*/ S("ZodType", (e, t) => (oo(), E.init(e, t), e.def = t, e.t
3479
3479
  });
3480
3480
  },
3481
3481
  set "~standard"(e) {
3482
- Ce(this, "~standard", e);
3482
+ b(this, "~standard", e);
3483
3483
  },
3484
3484
  parse: function e(t, n) {
3485
3485
  return Ja(this, t, n, { callee: e });
@@ -3497,7 +3497,7 @@ var N = /*@__PURE__*/ S("ZodType", (e, t) => (oo(), E.init(e, t), e.def = t, e.t
3497
3497
  return this?.safeParseAsync;
3498
3498
  },
3499
3499
  set spa(e) {
3500
- Ce(this, "spa", e);
3500
+ b(this, "spa", e);
3501
3501
  },
3502
3502
  encode: function e(t, n) {
3503
3503
  return Qa(this, t, n, { callee: e });
@@ -3825,7 +3825,7 @@ var Wo = /*@__PURE__*/ S("ZodObject", (e, t) => {
3825
3825
  so(), lr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oa(e, t, n, r), Ae(e, "shape", (e) => e._zod.def.shape, !1);
3826
3826
  }, {
3827
3827
  keyof() {
3828
- return U(Object.keys(this._zod.def.shape));
3828
+ return W(Object.keys(this._zod.def.shape));
3829
3829
  },
3830
3830
  catchall(e) {
3831
3831
  return this.clone({
@@ -3873,13 +3873,13 @@ var Wo = /*@__PURE__*/ S("ZodObject", (e, t) => {
3873
3873
  return ce(this, e);
3874
3874
  },
3875
3875
  partial(...e) {
3876
- return fe(es, this, e[0]);
3876
+ return fe($o, this, e[0]);
3877
3877
  },
3878
3878
  exactPartial(...e) {
3879
- return fe(ns, this, e[0], "exactPartial");
3879
+ return fe(ts, this, e[0], "exactPartial");
3880
3880
  },
3881
3881
  required(...e) {
3882
- return pe(us, this, e[0]);
3882
+ return pe(ls, this, e[0]);
3883
3883
  }
3884
3884
  });
3885
3885
  function B(e, t) {
@@ -3889,7 +3889,7 @@ function B(e, t) {
3889
3889
  ..._(t)
3890
3890
  });
3891
3891
  }
3892
- function Go(e, t) {
3892
+ function V(e, t) {
3893
3893
  return new Wo({
3894
3894
  type: "object",
3895
3895
  shape: e,
@@ -3897,50 +3897,50 @@ function Go(e, t) {
3897
3897
  ..._(t)
3898
3898
  });
3899
3899
  }
3900
- var Ko = /*@__PURE__*/ S("ZodUnion", (e, t) => {
3900
+ var Go = /*@__PURE__*/ S("ZodUnion", (e, t) => {
3901
3901
  dr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => ka(e, t, n, r), e.options = t.options;
3902
3902
  });
3903
- function V(e, t) {
3904
- return new Ko({
3903
+ function H(e, t) {
3904
+ return new Go({
3905
3905
  type: "union",
3906
3906
  options: e,
3907
3907
  ..._(t)
3908
3908
  });
3909
3909
  }
3910
- var qo = /*@__PURE__*/ S("ZodIntersection", (e, t) => {
3910
+ var Ko = /*@__PURE__*/ S("ZodIntersection", (e, t) => {
3911
3911
  fr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Aa(e, t, n, r);
3912
3912
  });
3913
- function Jo(e, t) {
3914
- return new qo({
3913
+ function qo(e, t) {
3914
+ return new Ko({
3915
3915
  type: "intersection",
3916
3916
  left: e,
3917
3917
  right: t
3918
3918
  });
3919
3919
  }
3920
- var Yo = /*@__PURE__*/ S("ZodRecord", (e, t) => {
3920
+ var Jo = /*@__PURE__*/ S("ZodRecord", (e, t) => {
3921
3921
  so(), hr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Pa(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
3922
3922
  });
3923
- function H(e, t, n) {
3924
- return !t || !t._zod ? new Yo({
3923
+ function U(e, t, n) {
3924
+ return !t || !t._zod ? new Jo({
3925
3925
  type: "record",
3926
3926
  keyType: P(),
3927
3927
  valueType: e,
3928
3928
  ..._(t)
3929
- }) : new Yo({
3929
+ }) : new Jo({
3930
3930
  type: "record",
3931
3931
  keyType: e,
3932
3932
  valueType: t,
3933
3933
  ..._(n)
3934
3934
  });
3935
3935
  }
3936
- var Xo = /*@__PURE__*/ S("ZodEnum", (e, t) => {
3936
+ var Yo = /*@__PURE__*/ S("ZodEnum", (e, t) => {
3937
3937
  gr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Sa(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
3938
3938
  let n = new Set(Object.keys(t.entries));
3939
3939
  e.extract = (e, r) => {
3940
3940
  let i = {};
3941
3941
  for (let r of e) if (n.has(r)) i[r] = t.entries[r];
3942
3942
  else throw Error(`Key ${r} not found in enum`);
3943
- return new Xo({
3943
+ return new Yo({
3944
3944
  ...t,
3945
3945
  checks: [],
3946
3946
  ..._(r),
@@ -3950,7 +3950,7 @@ var Xo = /*@__PURE__*/ S("ZodEnum", (e, t) => {
3950
3950
  let i = { ...t.entries };
3951
3951
  for (let t of e) if (n.has(t)) delete i[t];
3952
3952
  else throw Error(`Key ${t} not found in enum`);
3953
- return new Xo({
3953
+ return new Yo({
3954
3954
  ...t,
3955
3955
  checks: [],
3956
3956
  ..._(r),
@@ -3958,181 +3958,181 @@ var Xo = /*@__PURE__*/ S("ZodEnum", (e, t) => {
3958
3958
  });
3959
3959
  };
3960
3960
  });
3961
- function U(e, t) {
3962
- return new Xo({
3961
+ function W(e, t) {
3962
+ return new Yo({
3963
3963
  type: "enum",
3964
3964
  entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
3965
3965
  ..._(t)
3966
3966
  });
3967
3967
  }
3968
- var Zo = /*@__PURE__*/ S("ZodLiteral", (e, t) => {
3968
+ var Xo = /*@__PURE__*/ S("ZodLiteral", (e, t) => {
3969
3969
  _r.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ca(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
3970
3970
  if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
3971
3971
  return t.values[0];
3972
3972
  } });
3973
3973
  });
3974
- function W(e, t) {
3975
- return new Zo({
3974
+ function G(e, t) {
3975
+ return new Xo({
3976
3976
  type: "literal",
3977
3977
  values: Array.isArray(e) ? e : [e],
3978
3978
  ..._(t)
3979
3979
  });
3980
3980
  }
3981
- var Qo = /*@__PURE__*/ S("ZodTransform", (e, t) => {
3981
+ var Zo = /*@__PURE__*/ S("ZodTransform", (e, t) => {
3982
3982
  so(), vr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ta(e, t, n, r), e._zod.parse = (n, r) => {
3983
3983
  if (r.direction === "backward") throw new Re(e.constructor.name);
3984
3984
  n.addIssue = (r) => {
3985
- if (typeof r == "string") n.issues.push(xe(r, n.value, t));
3985
+ if (typeof r == "string") n.issues.push(Se(r, n.value, t));
3986
3986
  else {
3987
3987
  let t = r;
3988
- t.fatal && (t.continue = !1), t.code ??= "custom", "input" in t || (t.input = n.value), t.inst ??= e, n.issues.push(xe(t));
3988
+ t.fatal && (t.continue = !1), t.code ??= "custom", "input" in t || (t.input = n.value), t.inst ??= e, n.issues.push(Se(t));
3989
3989
  }
3990
3990
  };
3991
3991
  let i = t.transform(n.value, n);
3992
3992
  return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n);
3993
3993
  };
3994
3994
  });
3995
- function $o(e) {
3996
- return new Qo({
3995
+ function Qo(e) {
3996
+ return new Zo({
3997
3997
  type: "transform",
3998
3998
  transform: e
3999
3999
  });
4000
4000
  }
4001
- var es = /*@__PURE__*/ S("ZodOptional", (e, t) => {
4001
+ var $o = /*@__PURE__*/ S("ZodOptional", (e, t) => {
4002
4002
  br.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wa(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4003
4003
  });
4004
- function ts(e) {
4005
- return new es({
4004
+ function es(e) {
4005
+ return new $o({
4006
4006
  type: "optional",
4007
4007
  innerType: e
4008
4008
  });
4009
4009
  }
4010
- var ns = /*@__PURE__*/ S("ZodExactOptional", (e, t) => {
4010
+ var ts = /*@__PURE__*/ S("ZodExactOptional", (e, t) => {
4011
4011
  xr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wa(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4012
4012
  });
4013
- function rs(e) {
4014
- return new ns({
4013
+ function ns(e) {
4014
+ return new ts({
4015
4015
  type: "optional",
4016
4016
  innerType: e
4017
4017
  });
4018
4018
  }
4019
- var is = /*@__PURE__*/ S("ZodNullable", (e, t) => {
4019
+ var rs = /*@__PURE__*/ S("ZodNullable", (e, t) => {
4020
4020
  Sr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fa(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4021
4021
  });
4022
- function as(e) {
4023
- return new is({
4022
+ function is(e) {
4023
+ return new rs({
4024
4024
  type: "nullable",
4025
4025
  innerType: e
4026
4026
  });
4027
4027
  }
4028
- var os = /*@__PURE__*/ S("ZodDefault", (e, t) => {
4028
+ var as = /*@__PURE__*/ S("ZodDefault", (e, t) => {
4029
4029
  Cr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => za(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4030
4030
  });
4031
- function ss(e, t) {
4032
- return new os({
4031
+ function os(e, t) {
4032
+ return new as({
4033
4033
  type: "default",
4034
4034
  innerType: e,
4035
4035
  get defaultValue() {
4036
- return typeof t == "function" ? t() : ne(t);
4036
+ return typeof t == "function" ? t() : te(t);
4037
4037
  }
4038
4038
  });
4039
4039
  }
4040
- var cs = /*@__PURE__*/ S("ZodPrefault", (e, t) => {
4040
+ var ss = /*@__PURE__*/ S("ZodPrefault", (e, t) => {
4041
4041
  Tr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ba(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4042
4042
  });
4043
- function ls(e, t) {
4044
- return new cs({
4043
+ function cs(e, t) {
4044
+ return new ss({
4045
4045
  type: "prefault",
4046
4046
  innerType: e,
4047
4047
  get defaultValue() {
4048
- return typeof t == "function" ? t() : ne(t);
4048
+ return typeof t == "function" ? t() : te(t);
4049
4049
  }
4050
4050
  });
4051
4051
  }
4052
- var us = /*@__PURE__*/ S("ZodNonOptional", (e, t) => {
4052
+ var ls = /*@__PURE__*/ S("ZodNonOptional", (e, t) => {
4053
4053
  Er.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ia(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4054
4054
  });
4055
- function ds(e, t) {
4056
- return new us({
4055
+ function us(e, t) {
4056
+ return new ls({
4057
4057
  type: "nonoptional",
4058
4058
  innerType: e,
4059
4059
  ..._(t)
4060
4060
  });
4061
4061
  }
4062
- var fs = /*@__PURE__*/ S("ZodCatch", (e, t) => {
4062
+ var ds = /*@__PURE__*/ S("ZodCatch", (e, t) => {
4063
4063
  kr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Va(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
4064
4064
  });
4065
- function ps(e, t) {
4066
- return new fs({
4065
+ function fs(e, t) {
4066
+ return new ds({
4067
4067
  type: "catch",
4068
4068
  innerType: e,
4069
4069
  catchValue: typeof t == "function" ? t : Me(t)
4070
4070
  });
4071
4071
  }
4072
- var ms = /*@__PURE__*/ S("ZodPipe", (e, t) => {
4072
+ var ps = /*@__PURE__*/ S("ZodPipe", (e, t) => {
4073
4073
  Ar.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ha(e, t, n, r), e.in = t.in, e.out = t.out;
4074
4074
  });
4075
- function hs(e, t) {
4076
- return new ms({
4075
+ function ms(e, t) {
4076
+ return new ps({
4077
4077
  type: "pipe",
4078
4078
  in: e,
4079
4079
  out: t
4080
4080
  });
4081
4081
  }
4082
- var gs = /*@__PURE__*/ S("ZodReadonly", (e, t) => {
4082
+ var hs = /*@__PURE__*/ S("ZodReadonly", (e, t) => {
4083
4083
  Mr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ua(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4084
4084
  });
4085
- function _s(e) {
4086
- return new gs({
4085
+ function gs(e) {
4086
+ return new hs({
4087
4087
  type: "readonly",
4088
4088
  innerType: e
4089
4089
  });
4090
4090
  }
4091
- var vs = /*@__PURE__*/ S("ZodLazy", (e, t) => {
4091
+ var _s = /*@__PURE__*/ S("ZodLazy", (e, t) => {
4092
4092
  Pr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ga(e, t, n, r), e.unwrap = () => e._zod.def.getter();
4093
4093
  });
4094
- function ys(e) {
4095
- return new vs({
4094
+ function vs(e) {
4095
+ return new _s({
4096
4096
  type: "lazy",
4097
4097
  getter: e
4098
4098
  });
4099
4099
  }
4100
- var bs = /*@__PURE__*/ S("ZodCustom", (e, t) => {
4100
+ var ys = /*@__PURE__*/ S("ZodCustom", (e, t) => {
4101
4101
  Fr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => wa(e, t, n, r);
4102
4102
  });
4103
- function xs(e, t = {}) {
4104
- return /* @__PURE__ */ ea(bs, e, t);
4103
+ function bs(e, t = {}) {
4104
+ return /* @__PURE__ */ ea(ys, e, t);
4105
4105
  }
4106
- function Ss(e, t) {
4106
+ function xs(e, t) {
4107
4107
  return /* @__PURE__ */ ta(e, t);
4108
4108
  }
4109
- function Cs(e) {
4110
- let t = ys(() => V([
4109
+ function Ss(e) {
4110
+ let t = vs(() => H([
4111
4111
  P(e),
4112
4112
  I(),
4113
4113
  L(),
4114
4114
  zo(),
4115
4115
  z(t),
4116
- H(P(), t)
4116
+ U(P(), t)
4117
4117
  ]));
4118
4118
  return t;
4119
4119
  }
4120
4120
  //#endregion
4121
4121
  //#region src/flow/common/json.ts
4122
- var ws = 64;
4123
- function Ts(e, t = 0) {
4122
+ var Cs = 64;
4123
+ function ws(e, t = 0) {
4124
4124
  if (t > 64) throw TypeError("Value exceeds the maximum JSON depth.");
4125
- if (typeof e == "object" && e) for (let n of Object.values(e)) Ts(n, t + 1);
4125
+ if (typeof e == "object" && e) for (let n of Object.values(e)) ws(n, t + 1);
4126
4126
  }
4127
4127
  //#endregion
4128
4128
  //#region src/flow/common/triggerScheduleSchema.ts
4129
- var Es = z(V([B({
4130
- type: W("cron"),
4129
+ var Ts = z(H([B({
4130
+ type: G("cron"),
4131
4131
  expression: P(),
4132
4132
  timezone: P()
4133
4133
  }), B({
4134
- type: W("every"),
4135
- unit: U([
4134
+ type: G("every"),
4135
+ unit: W([
4136
4136
  "day",
4137
4137
  "hour",
4138
4138
  "minute",
@@ -4140,100 +4140,116 @@ var Es = z(V([B({
4140
4140
  "week"
4141
4141
  ]),
4142
4142
  value: I()
4143
- })])), G = P(), K = Cs(), Ds = z(G), Os = B({
4144
- description: G.optional(),
4145
- jsonSchema: K,
4143
+ })])), K = P(), Es = Ss(), Ds = z(K), Os = B({
4144
+ description: K.optional(),
4145
+ jsonSchema: Es,
4146
4146
  nullable: L(),
4147
- handle: G
4148
- }), q = Os.extend({ value: K.optional() }), ks = B({
4147
+ handle: K
4148
+ }), q = Os.extend({ value: Es.optional() }), ks = B({
4149
4149
  collapsed: L().optional(),
4150
- group: G
4150
+ group: K
4151
4151
  }), As = B({
4152
- kind: W("node"),
4153
- nodeId: G,
4154
- output: G
4152
+ kind: G("node"),
4153
+ nodeId: K,
4154
+ output: K,
4155
+ field: K.optional()
4155
4156
  }), js = B({
4156
- kind: W("flow"),
4157
- input: G
4158
- }), Ms = V([
4157
+ kind: G("flow"),
4158
+ input: K
4159
+ }), Ms = H([
4159
4160
  As,
4160
4161
  js,
4161
4162
  B({
4162
- kind: W("binding"),
4163
- bindingId: G
4163
+ kind: G("binding"),
4164
+ bindingId: K
4164
4165
  })
4165
- ]), Ns = V([B({
4166
- kind: W("value"),
4167
- value: K
4168
- }), B({
4169
- kind: W("sources"),
4166
+ ]), Ns = H([B({ kind: G("unset") }), B({
4167
+ kind: G("value"),
4168
+ value: Es
4169
+ })]), Ps = H([Ns, B({
4170
+ kind: G("sources"),
4170
4171
  sources: z(Ms)
4171
- })]), Ps = H(G, Ns), Fs = {
4172
- inputs: z(V([q, ks])),
4173
- outputs: z(V([Os, ks]))
4174
- }, Is = B({
4175
- kind: W("connector"),
4176
- action: G,
4177
- connectionId: G.optional(),
4178
- connections: z(B({
4179
- connectionId: G,
4180
- alias: G.optional()
4172
+ })]), Fs = U(K, Ps), Is = {
4173
+ inputs: z(H([q, ks])),
4174
+ outputs: z(H([Os, ks]))
4175
+ }, Ls = H([V({
4176
+ kind: G("connector"),
4177
+ action: K,
4178
+ connectionId: K.optional(),
4179
+ connections: z(V({
4180
+ connectionId: K,
4181
+ alias: K.optional()
4181
4182
  }))
4182
- }), Ls = B({
4183
- ...Fs,
4184
- name: G,
4185
- moduleId: G,
4186
- capabilities: z(Is).optional()
4187
- }), Rs = V([B({
4188
- kind: W("value"),
4189
- value: K
4183
+ }), V({
4184
+ kind: G("connector"),
4185
+ actionHints: z(K).optional(),
4186
+ connectionHints: z(V({
4187
+ action: K,
4188
+ connectionId: K,
4189
+ alias: K.optional()
4190
+ })).optional()
4191
+ })]), Rs = B({
4192
+ ...Is,
4193
+ name: K,
4194
+ moduleId: K,
4195
+ capabilities: z(Ls).optional()
4196
+ }), zs = H([B({
4197
+ kind: G("value"),
4198
+ value: Es
4190
4199
  }), B({
4191
- kind: W("input"),
4192
- input: G
4193
- })]), zs = V([Rs, B({ kind: W("model") })]), Bs = B({
4194
- ...Fs,
4195
- name: G,
4196
- executor: V([
4200
+ kind: G("input"),
4201
+ input: K
4202
+ })]), Bs = H([zs, B({ kind: G("model") })]), Vs = B({
4203
+ ...Is,
4204
+ name: K,
4205
+ executor: H([
4197
4206
  B({
4198
- kind: W("connector"),
4199
- action: G,
4200
- connectionId: G.optional()
4207
+ kind: G("connector"),
4208
+ action: K,
4209
+ connectionId: K.optional()
4201
4210
  }),
4202
4211
  B({
4203
- kind: W("llm"),
4204
- mode: U(["chat", "json"])
4212
+ kind: G("llm"),
4213
+ mode: W(["chat", "json"])
4205
4214
  }),
4206
4215
  B({
4207
- kind: W("agent"),
4216
+ kind: G("agent"),
4208
4217
  code: L().optional(),
4209
- model: G,
4210
- prompt: Rs,
4211
- system: G,
4218
+ model: K,
4219
+ prompt: zs,
4220
+ system: K,
4212
4221
  maxRounds: I(),
4213
4222
  tools: z(B({
4214
- id: G,
4215
- name: G,
4216
- description: G,
4217
- action: G,
4218
- connectionId: G.optional(),
4223
+ id: K,
4224
+ name: K,
4225
+ description: K,
4226
+ action: K,
4227
+ connectionId: K.optional(),
4219
4228
  approval: L(),
4220
- inputs: z(q.extend({ source: zs }))
4229
+ inputs: z(q.extend({ source: Bs }))
4221
4230
  })),
4222
4231
  notification: B({
4223
- taskId: G,
4224
- messageHandle: G,
4225
- inputs: H(G, Rs)
4232
+ taskId: K,
4233
+ messageHandle: K,
4234
+ inputs: U(K, zs)
4226
4235
  }).optional()
4227
4236
  })
4228
4237
  ])
4229
- }), Vs = {
4230
- input: q,
4238
+ }), Hs = H([B({
4239
+ kind: G("value"),
4240
+ value: Es.optional(),
4241
+ jsonSchema: Es.optional()
4242
+ }), B({
4243
+ kind: G("source"),
4244
+ source: Ms
4245
+ })]), Us = {
4246
+ matchMode: W(["first", "all"]),
4231
4247
  cases: z(B({
4232
- output: G,
4233
- relation: U(["all", "any"]),
4234
- expressions: z(B({
4235
- input: G,
4236
- operator: U([
4248
+ description: K.optional(),
4249
+ output: K,
4250
+ groups: z(B({ expressions: z(B({
4251
+ left: Hs,
4252
+ operator: W([
4237
4253
  "!=",
4238
4254
  "<",
4239
4255
  "<=",
@@ -4255,44 +4271,43 @@ var Es = z(V([B({
4255
4271
  "notHasValue",
4256
4272
  "startsWith"
4257
4273
  ]),
4258
- value: K.optional()
4259
- }))
4260
- })),
4261
- defaultOutput: G.optional()
4262
- }, Hs = {
4274
+ right: Hs.optional()
4275
+ })) }))
4276
+ }))
4277
+ }, Ws = {
4263
4278
  inputDefinitions: z(q),
4264
- prompt: G
4265
- }, Us = {
4279
+ prompt: K
4280
+ }, Gs = {
4266
4281
  bodyFields: z(q),
4267
4282
  options: B({
4268
4283
  allowedMethods: Ds.optional(),
4269
4284
  allowedOrigins: Ds.optional(),
4270
4285
  noResponseBody: L().optional(),
4271
- responseData: G.optional(),
4272
- responseHeaders: H(G, G).optional(),
4286
+ responseData: K.optional(),
4287
+ responseHeaders: U(K, K).optional(),
4273
4288
  responseStatusCode: I().optional()
4274
4289
  }).optional()
4275
- }, Ws = {
4276
- configSchema: K,
4277
- definitionVersion: W(2),
4278
- description: G,
4279
- displayName: G,
4280
- key: G,
4281
- name: G,
4290
+ }, Ks = {
4291
+ configInputs: Is.inputs,
4292
+ definitionVersion: G(2),
4293
+ description: K,
4294
+ displayName: K,
4295
+ key: K,
4296
+ name: K,
4282
4297
  outputs: z(Os).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
4283
- provider: G
4284
- }, Gs = B({
4298
+ provider: K
4299
+ }, qs = B({
4285
4300
  body: B({
4286
4301
  allowArray: L(),
4287
4302
  allowEmpty: L(),
4288
- formats: z(U([
4303
+ formats: z(W([
4289
4304
  "form",
4290
4305
  "json",
4291
4306
  "multipart",
4292
4307
  "text"
4293
4308
  ]))
4294
4309
  }),
4295
- methods: z(U([
4310
+ methods: z(W([
4296
4311
  "DELETE",
4297
4312
  "GET",
4298
4313
  "HEAD",
@@ -4301,133 +4316,134 @@ var Es = z(V([B({
4301
4316
  "PUT"
4302
4317
  ])),
4303
4318
  successStatus: I()
4304
- }), Ks = {
4305
- name: G,
4306
- description: G.optional(),
4307
- icon: G.optional()
4319
+ }), Js = {
4320
+ name: K,
4321
+ description: K.optional(),
4322
+ icon: K.optional()
4308
4323
  }, J = {
4309
4324
  maxExecutions: I().int().positive().max(2 ** 53 - 1).optional(),
4310
- inputs: Ps,
4311
- name: G.optional(),
4312
- description: G.optional(),
4313
- icon: G.optional(),
4325
+ inputs: Fs,
4326
+ name: K.optional(),
4327
+ description: K.optional(),
4328
+ icon: K.optional(),
4314
4329
  timeoutMs: I().optional()
4315
- }, qs = V([
4330
+ }, Ys = H([
4316
4331
  B({
4317
4332
  ...J,
4318
- kind: W("condition"),
4319
- ...Vs
4333
+ inputs: U(K, Ho()),
4334
+ kind: G("condition"),
4335
+ ...Us
4320
4336
  }),
4321
4337
  B({
4322
4338
  ...J,
4323
4339
  inputs: R().transform(() => ({})).default({}),
4324
- kind: W("value"),
4340
+ kind: G("value"),
4325
4341
  values: z(q)
4326
4342
  }),
4327
4343
  B({
4328
4344
  ...J,
4329
- kind: W("subflow"),
4330
- subflowId: G
4345
+ kind: G("subflow"),
4346
+ subflowId: K
4331
4347
  }),
4332
4348
  B({
4333
4349
  ...J,
4334
- kind: W("task"),
4335
- task: Ls,
4350
+ kind: G("task"),
4351
+ task: Rs,
4336
4352
  additionalInputs: z(q).optional()
4337
4353
  }),
4338
4354
  B({
4339
4355
  ...J,
4340
- kind: W("task"),
4341
- taskId: G,
4356
+ kind: G("task"),
4357
+ taskId: K,
4342
4358
  additionalInputs: z(q).optional()
4343
4359
  }),
4344
- Go({
4360
+ V({
4345
4361
  ...J,
4346
- kind: W("approval"),
4347
- ...Hs
4362
+ kind: G("approval"),
4363
+ ...Ws
4348
4364
  }).omit({ timeoutMs: !0 }),
4349
- Go({
4365
+ V({
4350
4366
  ...J,
4351
- kind: W("wait"),
4352
- ...Hs
4367
+ kind: G("wait"),
4368
+ ...Ws
4353
4369
  }).omit({ timeoutMs: !0 }),
4354
4370
  B({
4355
- ...Ks,
4356
- kind: W("manual")
4371
+ ...Js,
4372
+ kind: G("manual")
4357
4373
  }),
4358
4374
  B({
4359
- ...Ks,
4360
- kind: W("webhook"),
4361
- ...Us
4375
+ ...Js,
4376
+ kind: G("webhook"),
4377
+ ...Gs
4362
4378
  }),
4363
4379
  B({
4364
- ...Ks,
4365
- kind: W("cron"),
4366
- cronTimes: Es
4380
+ ...Js,
4381
+ kind: G("cron"),
4382
+ cronTimes: Ts
4367
4383
  }),
4368
4384
  B({
4369
- ...Ks,
4370
- kind: W("poll"),
4371
- bindingId: G,
4372
- config: H(G, K),
4385
+ ...Js,
4386
+ kind: G("poll"),
4387
+ bindingId: K,
4388
+ config: U(K, Ns),
4373
4389
  definition: B({
4374
- ...Ws,
4375
- type: W("poll")
4390
+ ...Ks,
4391
+ type: G("poll")
4376
4392
  }),
4377
- pollTimes: Es
4393
+ pollTimes: Ts
4378
4394
  }),
4379
4395
  B({
4380
- ...Ks,
4381
- kind: W("integration"),
4382
- bindingId: G,
4383
- config: H(G, K),
4396
+ ...Js,
4397
+ kind: G("integration"),
4398
+ bindingId: K,
4399
+ config: U(K, Ns),
4384
4400
  definition: B({
4385
- ...Ws,
4386
- type: W("integration"),
4387
- endpoint: Gs
4401
+ ...Ks,
4402
+ type: G("integration"),
4403
+ endpoint: qs
4388
4404
  })
4389
4405
  })
4390
- ]), Js = V([B({ kind: W("flow") }), B({
4391
- kind: W("subflow"),
4392
- id: G
4393
- })]), Ys = B({
4394
- source: G,
4395
- target: G,
4396
- sourceHandle: G.optional()
4406
+ ]), Xs = H([B({ kind: G("flow") }), B({
4407
+ kind: G("subflow"),
4408
+ id: K
4409
+ })]), Zs = B({
4410
+ source: K,
4411
+ target: K,
4412
+ sourceHandle: K.optional()
4397
4413
  }), Y = {
4398
- nodeId: G,
4399
- target: Js
4400
- }, Xs = B({
4401
- name: G,
4414
+ nodeId: K,
4415
+ target: Xs
4416
+ }, Qs = B({
4417
+ name: K,
4402
4418
  inputs: z(q),
4403
- outputs: z(Os.extend({ sources: z(V([As, js])) }))
4404
- }), Zs = B({
4405
- nodes: H(G, qs),
4406
- edges: z(Ys).default([])
4407
- }), Qs = B({
4408
- kind: U(["connection", "variable"]),
4409
- target: G
4419
+ outputs: z(Os.extend({ sources: z(H([As, js])) }))
4410
4420
  }), $s = B({
4411
- name: G,
4412
- imports: Ds,
4413
- source: G
4421
+ nodes: U(K, Ys),
4422
+ edges: z(Zs).default([])
4414
4423
  }), ec = B({
4415
- bindings: H(G, Qs),
4416
- graph: Zs,
4417
- subflows: H(G, Xs.extend({ graph: Zs })),
4418
- tasks: H(G, Bs)
4424
+ kind: W(["connection", "variable"]),
4425
+ target: K
4419
4426
  }), tc = B({
4420
- modelVersion: V([W(2), W(3)]),
4421
- document: ec,
4422
- modules: H(G, $s)
4423
- }), nc = tc.extend({
4424
- kind: W("open-flow-flow-revision"),
4425
- version: W(1)
4427
+ name: K,
4428
+ imports: Ds,
4429
+ source: K
4430
+ }), nc = B({
4431
+ bindings: U(K, ec),
4432
+ graph: $s,
4433
+ subflows: U(K, Qs.extend({ graph: $s })),
4434
+ tasks: U(K, Vs)
4435
+ }), rc = B({
4436
+ modelVersion: H([G(2), G(3)]),
4437
+ document: nc,
4438
+ modules: U(K, tc)
4439
+ }), ic = rc.extend({
4440
+ kind: G("open-flow-flow-revision"),
4441
+ version: G(1)
4426
4442
  });
4427
4443
  function X(e) {
4428
4444
  return typeof e == "object" && e && !Array.isArray(e) ? e : {};
4429
4445
  }
4430
- function rc(e, t) {
4446
+ function ac(e, t) {
4431
4447
  return Array.isArray(e) ? e.map((e) => {
4432
4448
  let n = X(e);
4433
4449
  return n.kind == "node" && typeof n.nodeId == "string" && t.has(n.nodeId) && n.output == "notification" ? {
@@ -4436,16 +4452,16 @@ function rc(e, t) {
4436
4452
  } : e;
4437
4453
  }) : e;
4438
4454
  }
4439
- function ic(e, t) {
4455
+ function oc(e, t) {
4440
4456
  return Object.fromEntries(Object.entries(X(e)).map(([e, n]) => {
4441
4457
  let r = X(n);
4442
4458
  return [e, r.kind == "sources" ? {
4443
4459
  ...r,
4444
- sources: rc(r.sources, t)
4460
+ sources: ac(r.sources, t)
4445
4461
  } : n];
4446
4462
  }));
4447
4463
  }
4448
- function ac(e) {
4464
+ function sc(e) {
4449
4465
  let t = X(e), n = /* @__PURE__ */ new Set(), r = Object.fromEntries(Object.entries(X(t.nodes)).map(([e, t]) => {
4450
4466
  let r = X(t);
4451
4467
  if (r.kind == "approval") throw TypeError("Legacy Flow models do not support Approval nodes.");
@@ -4466,7 +4482,7 @@ function ac(e) {
4466
4482
  let i = X(t);
4467
4483
  i.inputs != null && (r[e] = {
4468
4484
  ...i,
4469
- inputs: ic(i.inputs, n)
4485
+ inputs: oc(i.inputs, n)
4470
4486
  });
4471
4487
  }
4472
4488
  let i = Array.isArray(t.edges) ? t.edges.map((e) => {
@@ -4485,13 +4501,13 @@ function ac(e) {
4485
4501
  resolutionIds: n
4486
4502
  };
4487
4503
  }
4488
- function oc(e) {
4489
- let t = X(e), n = ac(t.graph), r = Object.fromEntries(Object.entries(X(t.subflows)).map(([e, t]) => {
4490
- let n = X(t), r = ac(n.graph), i = Array.isArray(n.outputs) ? n.outputs.map((e) => {
4504
+ function cc(e) {
4505
+ let t = X(e), n = sc(t.graph), r = Object.fromEntries(Object.entries(X(t.subflows)).map(([e, t]) => {
4506
+ let n = X(t), r = sc(n.graph), i = Array.isArray(n.outputs) ? n.outputs.map((e) => {
4491
4507
  let t = X(e);
4492
4508
  return {
4493
4509
  ...t,
4494
- sources: rc(t.sources, r.resolutionIds)
4510
+ sources: ac(t.sources, r.resolutionIds)
4495
4511
  };
4496
4512
  }) : n.outputs;
4497
4513
  return [e, {
@@ -4506,13 +4522,13 @@ function oc(e) {
4506
4522
  subflows: r
4507
4523
  };
4508
4524
  }
4509
- function sc(e, t, n) {
4525
+ function lc(e, t, n) {
4510
4526
  return Object.fromEntries(Object.entries(X(e)).flatMap(([e, r]) => {
4511
4527
  let i = t.safeParse(n?.(r) ?? r);
4512
4528
  return i.success ? [[e, i.data]] : [];
4513
4529
  }));
4514
4530
  }
4515
- function cc(e) {
4531
+ function uc(e) {
4516
4532
  let t = X(e);
4517
4533
  if (t.kind == "webhook" && t.bodyFields == null && t.inputsDef != null) return {
4518
4534
  ...t,
@@ -4537,113 +4553,113 @@ function cc(e) {
4537
4553
  }
4538
4554
  return t;
4539
4555
  }
4540
- function lc(e) {
4541
- let t = X(e), n = sc(t.nodes, qs, cc), r = new Set(Object.entries(n).flatMap(([e, t]) => t.kind == "webhook" ? [e] : []));
4556
+ function dc(e) {
4557
+ let t = X(e), n = lc(t.nodes, Ys, uc), r = new Set(Object.entries(n).flatMap(([e, t]) => t.kind == "webhook" ? [e] : []));
4542
4558
  for (let e of Object.values(n)) if ("inputs" in e) {
4543
4559
  for (let t of Object.values(e.inputs)) if (t.kind == "sources") for (let e of t.sources) e.kind == "node" && e.output == "payload" && r.has(e.nodeId) && (e.output = "body");
4544
4560
  }
4545
4561
  return {
4546
4562
  nodes: n,
4547
- edges: Array.isArray(t.edges) ? t.edges.flatMap((e) => Ys.safeParse(e).data ?? []) : []
4563
+ edges: Array.isArray(t.edges) ? t.edges.flatMap((e) => Zs.safeParse(e).data ?? []) : []
4548
4564
  };
4549
4565
  }
4550
- function uc(e) {
4551
- Ts(e);
4566
+ function fc(e) {
4567
+ ws(e);
4552
4568
  let t = X(e);
4553
4569
  if (t.kind != "open-flow-flow-revision" || t.version != 1) throw TypeError("The value is not an Open Flow Revision envelope.");
4554
4570
  if (typeof t.modelVersion == "number" && t.modelVersion > 3) throw TypeError("The Flow model is newer than this package.");
4555
- let n = X(t.modelVersion == 1 || t.modelVersion == 2 ? oc(t.document) : t.document), r = lc(n.graph), i = Object.fromEntries(Object.entries(X(n.subflows)).flatMap(([e, t]) => {
4556
- let n = X(t), r = Xs.extend({ graph: Zs }).safeParse({
4571
+ let n = X(t.modelVersion == 1 || t.modelVersion == 2 ? cc(t.document) : t.document), r = dc(n.graph), i = Object.fromEntries(Object.entries(X(n.subflows)).flatMap(([e, t]) => {
4572
+ let n = X(t), r = Qs.extend({ graph: $s }).safeParse({
4557
4573
  ...n,
4558
- graph: lc(n.graph)
4574
+ graph: dc(n.graph)
4559
4575
  });
4560
4576
  return r.success ? [[e, r.data]] : [];
4561
4577
  }));
4562
- return fc({
4578
+ return mc({
4563
4579
  modelVersion: 3,
4564
4580
  document: {
4565
- bindings: sc(n.bindings, Qs),
4581
+ bindings: lc(n.bindings, ec),
4566
4582
  graph: r,
4567
4583
  subflows: i,
4568
- tasks: sc(n.tasks, Bs)
4584
+ tasks: lc(n.tasks, Vs)
4569
4585
  },
4570
- modules: sc(t.modules, $s)
4586
+ modules: lc(t.modules, tc)
4571
4587
  });
4572
4588
  }
4573
- function dc(e) {
4574
- return Ts(e), ec.parse(e);
4589
+ function pc(e) {
4590
+ return ws(e), nc.parse(e);
4575
4591
  }
4576
- function fc(e) {
4577
- return Ts(e), tc.parse(e);
4592
+ function mc(e) {
4593
+ return ws(e), rc.parse(e);
4578
4594
  }
4579
- function pc(e) {
4580
- Ts(e);
4595
+ function hc(e) {
4596
+ ws(e);
4581
4597
  let t = X(e), n = t.modelVersion == 2 ? {
4582
4598
  ...t,
4583
- document: oc(t.document)
4584
- } : e, r = nc.parse(n);
4599
+ document: cc(t.document)
4600
+ } : e, r = ic.parse(n);
4585
4601
  return {
4586
4602
  modelVersion: r.modelVersion,
4587
4603
  document: r.document,
4588
4604
  modules: r.modules
4589
4605
  };
4590
4606
  }
4591
- var mc = {
4607
+ var gc = {
4592
4608
  "binding.create": {
4593
- bindingId: G,
4594
- binding: Qs
4609
+ bindingId: K,
4610
+ binding: ec
4595
4611
  },
4596
- "binding.delete": { bindingId: G },
4612
+ "binding.delete": { bindingId: K },
4597
4613
  "binding.target.set": {
4598
- bindingId: G,
4599
- before: G,
4600
- value: G
4614
+ bindingId: K,
4615
+ before: K,
4616
+ value: K
4601
4617
  },
4602
4618
  "graph.edge.connect": {
4603
- target: Js,
4604
- edge: Ys
4619
+ target: Xs,
4620
+ edge: Zs
4605
4621
  },
4606
4622
  "graph.edge.disconnect": {
4607
- target: Js,
4608
- edge: Ys
4623
+ target: Xs,
4624
+ edge: Zs
4609
4625
  },
4610
4626
  "graph.node.create": {
4611
4627
  ...Y,
4612
- node: qs
4628
+ node: Ys
4613
4629
  },
4614
4630
  "graph.node.delete": Y,
4615
- "graph.node.field.set": V([
4631
+ "graph.node.field.set": H([
4616
4632
  B({
4617
4633
  ...Y,
4618
- kind: W("graph.node.field.set"),
4619
- field: U([
4634
+ kind: G("graph.node.field.set"),
4635
+ field: W([
4620
4636
  "description",
4621
4637
  "icon",
4622
4638
  "name"
4623
4639
  ]),
4624
- before: G.optional(),
4625
- value: G.optional()
4640
+ before: K.optional(),
4641
+ value: K.optional()
4626
4642
  }),
4627
4643
  B({
4628
4644
  ...Y,
4629
- kind: W("graph.node.field.set"),
4630
- field: W("maxExecutions"),
4645
+ kind: G("graph.node.field.set"),
4646
+ field: G("maxExecutions"),
4631
4647
  before: I().int().positive().max(2 ** 53 - 1).optional(),
4632
4648
  value: I().int().positive().max(2 ** 53 - 1).optional()
4633
4649
  }),
4634
4650
  B({
4635
4651
  ...Y,
4636
- kind: W("graph.node.field.set"),
4637
- field: W("timeoutMs"),
4652
+ kind: G("graph.node.field.set"),
4653
+ field: G("timeoutMs"),
4638
4654
  before: I().optional(),
4639
4655
  value: I().optional()
4640
4656
  })
4641
4657
  ]),
4642
4658
  "graph.node.input.set": {
4643
4659
  ...Y,
4644
- handle: G,
4645
- before: Ns.optional(),
4646
- value: Ns.optional()
4660
+ handle: K,
4661
+ before: Ps.optional(),
4662
+ value: Ps.optional()
4647
4663
  },
4648
4664
  "graph.node.additional-inputs.set": {
4649
4665
  ...Y,
@@ -4652,8 +4668,8 @@ var mc = {
4652
4668
  },
4653
4669
  "graph.node.condition.set": {
4654
4670
  ...Y,
4655
- before: B(Vs),
4656
- value: B(Vs)
4671
+ before: B(Us),
4672
+ value: B(Us)
4657
4673
  },
4658
4674
  "graph.node.values.set": {
4659
4675
  ...Y,
@@ -4662,106 +4678,106 @@ var mc = {
4662
4678
  },
4663
4679
  "graph.node.resolution.set": {
4664
4680
  ...Y,
4665
- target: B({ kind: W("flow") }),
4666
- before: B(Hs),
4667
- value: B(Hs)
4681
+ target: B({ kind: G("flow") }),
4682
+ before: B(Ws),
4683
+ value: B(Ws)
4668
4684
  },
4669
4685
  "graph.node.webhook.set": {
4670
4686
  ...Y,
4671
- target: B({ kind: W("flow") }),
4672
- before: B(Us),
4673
- value: B(Us)
4687
+ target: B({ kind: G("flow") }),
4688
+ before: B(Gs),
4689
+ value: B(Gs)
4674
4690
  },
4675
4691
  "graph.node.task.ports.set": {
4676
4692
  ...Y,
4677
- before: B(Fs),
4678
- value: B(Fs)
4693
+ before: B(Is),
4694
+ value: B(Is)
4679
4695
  },
4680
4696
  "graph.node.task.name.set": {
4681
4697
  ...Y,
4682
- before: G,
4683
- value: G
4698
+ before: K,
4699
+ value: K
4684
4700
  },
4685
4701
  "graph.node.task.capabilities.set": {
4686
4702
  ...Y,
4687
- before: z(Is).optional(),
4688
- value: z(Is).optional()
4703
+ before: z(Ls).optional(),
4704
+ value: z(Ls).optional()
4689
4705
  },
4690
4706
  "graph.trigger.config.set": {
4691
- nodeId: G,
4692
- name: G,
4693
- before: K.optional(),
4694
- value: K.optional()
4707
+ nodeId: K,
4708
+ name: K,
4709
+ before: Ns.optional(),
4710
+ value: Ns.optional()
4695
4711
  },
4696
4712
  "graph.trigger.schedule.set": {
4697
- nodeId: G,
4698
- before: Es,
4699
- value: Es
4713
+ nodeId: K,
4714
+ before: Ts,
4715
+ value: Ts
4700
4716
  },
4701
4717
  "module.create": {
4702
- moduleId: G,
4703
- module: $s
4718
+ moduleId: K,
4719
+ module: tc
4704
4720
  },
4705
- "module.delete": { moduleId: G },
4721
+ "module.delete": { moduleId: K },
4706
4722
  "module.rename": {
4707
- moduleId: G,
4708
- before: G,
4709
- name: G
4723
+ moduleId: K,
4724
+ before: K,
4725
+ name: K
4710
4726
  },
4711
4727
  "module.source.replace": {
4712
- moduleId: G,
4728
+ moduleId: K,
4713
4729
  beforeImports: Ds,
4714
- beforeSource: G,
4730
+ beforeSource: K,
4715
4731
  imports: Ds,
4716
- source: G
4732
+ source: K
4717
4733
  },
4718
4734
  "subflow.create": {
4719
- subflowId: G,
4720
- subflow: Xs.extend({ graph: Zs })
4735
+ subflowId: K,
4736
+ subflow: Qs.extend({ graph: $s })
4721
4737
  },
4722
4738
  "subflow.definition.set": {
4723
- subflowId: G,
4724
- before: Xs,
4725
- definition: Xs
4739
+ subflowId: K,
4740
+ before: Qs,
4741
+ definition: Qs
4726
4742
  },
4727
- "subflow.delete": { subflowId: G },
4743
+ "subflow.delete": { subflowId: K },
4728
4744
  "task.create": {
4729
- taskId: G,
4730
- task: Bs
4745
+ taskId: K,
4746
+ task: Vs
4731
4747
  },
4732
- "task.delete": { taskId: G },
4748
+ "task.delete": { taskId: K },
4733
4749
  "task.connector.connection.set": {
4734
- taskId: G,
4735
- before: G.optional(),
4736
- value: G.optional()
4750
+ taskId: K,
4751
+ before: K.optional(),
4752
+ value: K.optional()
4737
4753
  },
4738
4754
  "task.agent.set": {
4739
- taskId: G,
4740
- before: Bs,
4741
- value: Bs
4755
+ taskId: K,
4756
+ before: Vs,
4757
+ value: Vs
4742
4758
  },
4743
4759
  "task.llm.mode.set": {
4744
- taskId: G,
4745
- before: U(["chat", "json"]),
4746
- value: U(["chat", "json"])
4760
+ taskId: K,
4761
+ before: W(["chat", "json"]),
4762
+ value: W(["chat", "json"])
4747
4763
  },
4748
4764
  "task.name.set": {
4749
- taskId: G,
4750
- before: G,
4751
- value: G
4765
+ taskId: K,
4766
+ before: K,
4767
+ value: K
4752
4768
  }
4753
4769
  };
4754
- z(V([...new Map(Object.entries(mc).map(([e, t]) => [e, t instanceof N ? t : B({
4755
- kind: W(e),
4770
+ z(H([...new Map(Object.entries(gc).map(([e, t]) => [e, t instanceof N ? t : B({
4771
+ kind: G(e),
4756
4772
  ...t
4757
4773
  })])).values()])).min(1);
4758
4774
  //#endregion
4759
4775
  //#region src/flow/common/change.ts
4760
- function hc(e) {
4776
+ function _c(e) {
4761
4777
  return e.trim().normalize("NFC");
4762
4778
  }
4763
- function gc(e, t) {
4764
- let n = hc(e), r = new Set([...t].map(hc));
4779
+ function vc(e, t) {
4780
+ let n = _c(e), r = new Set([...t].map(_c));
4765
4781
  if (!r.has(n)) return n;
4766
4782
  let i = /^(.*) \((\d+)\)$/.exec(n), a = i?.[2], o = a != null && Number(a) >= 2 ? Number(a) : void 0, s = o == null ? n : i?.[1] ?? n, c = o == null ? 2 : o + 1;
4767
4783
  for (; r.has(`${s} (${c})`);) c += 1;
@@ -4769,24 +4785,24 @@ function gc(e, t) {
4769
4785
  }
4770
4786
  //#endregion
4771
4787
  //#region src/flow/common/encoding.ts
4772
- var _c = new TextEncoder();
4788
+ var yc = new TextEncoder();
4773
4789
  function Z(e) {
4774
4790
  if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
4775
4791
  if (Array.isArray(e)) return `[${e.map(Z).join(",")}]`;
4776
4792
  let t = e;
4777
4793
  return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${Z(t[e])}`).join(",")}}`;
4778
4794
  }
4779
- function vc(e) {
4780
- return _c.encode(Z(e));
4795
+ function bc(e) {
4796
+ return yc.encode(Z(e));
4781
4797
  }
4782
- async function yc(e) {
4798
+ async function xc(e) {
4783
4799
  let t = new Uint8Array(e.byteLength);
4784
4800
  return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
4785
4801
  }
4786
4802
  function Q(e) {
4787
4803
  return Object.keys(e).toSorted().map((t) => [t, e[t]]);
4788
4804
  }
4789
- function bc(e) {
4805
+ function Sc(e) {
4790
4806
  return "handle" in e ? {
4791
4807
  ...e.description == null ? {} : { description: e.description },
4792
4808
  handle: e.handle,
@@ -4799,10 +4815,11 @@ function bc(e) {
4799
4815
  };
4800
4816
  }
4801
4817
  function $(e) {
4802
- return e.map(bc);
4818
+ return e.map(Sc);
4803
4819
  }
4804
- function xc(e) {
4820
+ function Cc(e) {
4805
4821
  switch (e.kind) {
4822
+ case "unset": return { kind: "unset" };
4806
4823
  case "sources": return {
4807
4824
  kind: e.kind,
4808
4825
  sources: e.sources.map((e) => ({ ...e }))
@@ -4813,10 +4830,10 @@ function xc(e) {
4813
4830
  };
4814
4831
  }
4815
4832
  }
4816
- function Sc(e) {
4817
- return Object.fromEntries(Q(e).map(([e, t]) => [e, xc(t)]));
4833
+ function wc(e) {
4834
+ return Object.fromEntries(Q(e).map(([e, t]) => [e, Cc(t)]));
4818
4835
  }
4819
- function Cc(e) {
4836
+ function Tc(e) {
4820
4837
  return e.map((e) => ({
4821
4838
  ...e.description == null ? {} : { description: e.description },
4822
4839
  handle: e.handle,
@@ -4825,12 +4842,22 @@ function Cc(e) {
4825
4842
  sources: e.sources.map((e) => ({ ...e }))
4826
4843
  }));
4827
4844
  }
4828
- function wc(e) {
4829
- if (!("inputs" in e)) return Rc(e);
4845
+ function Ec(e) {
4846
+ return e.kind === "source" ? {
4847
+ kind: "source",
4848
+ source: { ...e.source }
4849
+ } : {
4850
+ kind: "value",
4851
+ ...e.value === void 0 ? {} : { value: e.value },
4852
+ ...e.jsonSchema === void 0 ? {} : { jsonSchema: e.jsonSchema }
4853
+ };
4854
+ }
4855
+ function Dc(e) {
4856
+ if (!("inputs" in e)) return Vc(e);
4830
4857
  let t = {
4831
4858
  ...e.description == null ? {} : { description: e.description },
4832
4859
  ...e.icon == null ? {} : { icon: e.icon },
4833
- inputs: Sc(e.inputs),
4860
+ inputs: wc(e.inputs),
4834
4861
  ...e.name == null ? {} : { name: e.name },
4835
4862
  ...e.maxExecutions == null ? {} : { maxExecutions: e.maxExecutions },
4836
4863
  ...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
@@ -4839,19 +4866,15 @@ function wc(e) {
4839
4866
  case "condition": return {
4840
4867
  ...t,
4841
4868
  cases: e.cases.map((e) => ({
4842
- expressions: e.expressions.map((e) => ({
4843
- input: e.input,
4844
- operator: e.operator,
4845
- ...Object.hasOwn(e, "value") ? { value: e.value } : {}
4846
- })),
4869
+ ...e.description == null ? {} : { description: e.description },
4847
4870
  output: e.output,
4848
- relation: e.relation
4871
+ groups: e.groups.map((e) => ({ expressions: e.expressions.map((e) => ({
4872
+ left: Ec(e.left),
4873
+ operator: e.operator,
4874
+ ...e.right == null ? {} : { right: Ec(e.right) }
4875
+ })) }))
4849
4876
  })),
4850
- ...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
4851
- input: {
4852
- handle: e.input.handle,
4853
- ...bc(e.input)
4854
- },
4877
+ matchMode: e.matchMode,
4855
4878
  kind: e.kind
4856
4879
  };
4857
4880
  case "subflow": return {
@@ -4865,7 +4888,7 @@ function wc(e) {
4865
4888
  taskId: e.taskId
4866
4889
  }) : Object.assign({}, t, {
4867
4890
  kind: e.kind,
4868
- task: Pc(e.task)
4891
+ task: Lc(e.task)
4869
4892
  });
4870
4893
  return e.additionalInputs != null && (n.additionalInputs = $(e.additionalInputs)), n;
4871
4894
  }
@@ -4883,37 +4906,37 @@ function wc(e) {
4883
4906
  };
4884
4907
  }
4885
4908
  }
4886
- function Tc(e) {
4909
+ function Oc(e) {
4887
4910
  return {
4888
4911
  edges: e.edges.map((e) => ({ ...e })).toSorted((e, t) => {
4889
4912
  let n = Z(e), r = Z(t);
4890
4913
  return n < r ? -1 : +(n > r);
4891
4914
  }),
4892
- nodes: Object.fromEntries(Q(e.nodes).map(([e, t]) => [e, wc(t)]))
4915
+ nodes: Object.fromEntries(Q(e.nodes).map(([e, t]) => [e, Dc(t)]))
4893
4916
  };
4894
4917
  }
4895
- function Ec(e) {
4918
+ function kc(e) {
4896
4919
  return new Set(Object.entries(e.nodes).flatMap(([e, t]) => t.kind == "approval" || t.kind == "wait" ? [e] : []));
4897
4920
  }
4898
- function Dc(e, t) {
4921
+ function Ac(e, t) {
4899
4922
  let n = typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
4900
4923
  return n?.kind == "node" && typeof n.nodeId == "string" && t.has(n.nodeId) && n.output == "pending" ? {
4901
4924
  ...n,
4902
4925
  output: "notification"
4903
4926
  } : e;
4904
4927
  }
4905
- function Oc(e, t) {
4906
- let n = Sc(e);
4928
+ function jc(e, t) {
4929
+ let n = wc(e);
4907
4930
  return Object.fromEntries(Q(n).map(([e, n]) => {
4908
4931
  let r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
4909
4932
  return r?.kind != "sources" || !Array.isArray(r.sources) ? [e, n] : [e, {
4910
4933
  ...r,
4911
- sources: r.sources.map((e) => Dc(e, t))
4934
+ sources: r.sources.map((e) => Ac(e, t))
4912
4935
  }];
4913
4936
  }));
4914
4937
  }
4915
- function kc(e) {
4916
- let t = Ec(e);
4938
+ function Mc(e) {
4939
+ let t = kc(e);
4917
4940
  return {
4918
4941
  edges: e.edges.map((e) => t.has(e.source) && e.sourceHandle == "pending" ? {
4919
4942
  ...e,
@@ -4923,10 +4946,10 @@ function kc(e) {
4923
4946
  return n < r ? -1 : +(n > r);
4924
4947
  }),
4925
4948
  nodes: Object.fromEntries(Q(e.nodes).map(([e, n]) => {
4926
- let r = wc(n);
4949
+ let r = Dc(n);
4927
4950
  if (n.kind != "approval" && n.kind != "wait") return [e, "inputs" in n ? {
4928
4951
  ...r,
4929
- inputs: Oc(n.inputs, t)
4952
+ inputs: jc(n.inputs, t)
4930
4953
  } : r];
4931
4954
  let { inputDefinitions: i, ...a } = r, o = n.inputDefinitions[0];
4932
4955
  return [e, {
@@ -4934,31 +4957,31 @@ function kc(e) {
4934
4957
  actions: n.kind == "wait" ? ["continue"] : ["approve", "reject"],
4935
4958
  input: {
4936
4959
  handle: o.handle,
4937
- ...bc(o)
4960
+ ...Sc(o)
4938
4961
  },
4939
- inputs: Oc(n.inputs, t),
4962
+ inputs: jc(n.inputs, t),
4940
4963
  kind: "wait"
4941
4964
  }];
4942
4965
  }))
4943
4966
  };
4944
4967
  }
4945
- function Ac(e, t) {
4946
- let n = Ec(t);
4968
+ function Nc(e, t) {
4969
+ let n = kc(t);
4947
4970
  return e.map((e) => ({
4948
4971
  ...e.description == null ? {} : { description: e.description },
4949
4972
  handle: e.handle,
4950
4973
  jsonSchema: e.jsonSchema,
4951
4974
  nullable: e.nullable,
4952
- sources: e.sources.map((e) => Dc(e, n))
4975
+ sources: e.sources.map((e) => Ac(e, n))
4953
4976
  }));
4954
4977
  }
4955
- function jc(e, t) {
4956
- return e.modelVersion == 2 ? kc(t) : Tc(t);
4978
+ function Pc(e, t) {
4979
+ return e.modelVersion == 2 ? Mc(t) : Oc(t);
4957
4980
  }
4958
- function Mc(e, t, n) {
4959
- return e.modelVersion == 2 ? Ac(t, n) : Cc(t);
4981
+ function Fc(e, t, n) {
4982
+ return e.modelVersion == 2 ? Nc(t, n) : Tc(t);
4960
4983
  }
4961
- function Nc(e) {
4984
+ function Ic(e) {
4962
4985
  return {
4963
4986
  executor: e.executor,
4964
4987
  inputs: $(e.inputs),
@@ -4966,7 +4989,7 @@ function Nc(e) {
4966
4989
  outputs: $(e.outputs)
4967
4990
  };
4968
4991
  }
4969
- function Pc(e) {
4992
+ function Lc(e) {
4970
4993
  return {
4971
4994
  ...e.capabilities == null ? {} : { capabilities: e.capabilities },
4972
4995
  inputs: $(e.inputs),
@@ -4975,9 +4998,9 @@ function Pc(e) {
4975
4998
  outputs: $(e.outputs)
4976
4999
  };
4977
5000
  }
4978
- function Fc(e) {
5001
+ function Rc(e) {
4979
5002
  return {
4980
- configSchema: e.configSchema,
5003
+ configInputs: $(e.configInputs),
4981
5004
  definitionVersion: e.definitionVersion,
4982
5005
  description: e.description,
4983
5006
  displayName: e.displayName,
@@ -4997,7 +5020,7 @@ function Fc(e) {
4997
5020
  type: e.type
4998
5021
  };
4999
5022
  }
5000
- function Ic(e) {
5023
+ function zc(e) {
5001
5024
  return {
5002
5025
  ...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
5003
5026
  ...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
@@ -5007,7 +5030,7 @@ function Ic(e) {
5007
5030
  ...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
5008
5031
  };
5009
5032
  }
5010
- function Lc(e) {
5033
+ function Bc(e) {
5011
5034
  switch (e.type) {
5012
5035
  case "cron": return {
5013
5036
  expression: e.expression,
@@ -5021,7 +5044,7 @@ function Lc(e) {
5021
5044
  };
5022
5045
  }
5023
5046
  }
5024
- function Rc(e) {
5047
+ function Vc(e) {
5025
5048
  let t = (t) => ({
5026
5049
  ...e.description == null ? {} : { description: e.description },
5027
5050
  ...e.icon == null ? {} : { icon: e.icon },
@@ -5034,178 +5057,178 @@ function Rc(e) {
5034
5057
  ...t(e.kind),
5035
5058
  bodyFields: e.bodyFields.map((e) => ({
5036
5059
  handle: e.handle,
5037
- ...bc(e)
5060
+ ...Sc(e)
5038
5061
  })),
5039
- ...e.options == null ? {} : { options: Ic(e.options) }
5062
+ ...e.options == null ? {} : { options: zc(e.options) }
5040
5063
  };
5041
5064
  case "cron": return {
5042
5065
  ...t(e.kind),
5043
- cronTimes: e.cronTimes.map(Lc)
5066
+ cronTimes: e.cronTimes.map(Bc)
5044
5067
  };
5045
5068
  case "poll": return {
5046
5069
  ...t(e.kind),
5047
5070
  bindingId: e.bindingId,
5048
5071
  config: e.config,
5049
- definition: Fc(e.definition),
5050
- pollTimes: e.pollTimes.map(Lc)
5072
+ definition: Rc(e.definition),
5073
+ pollTimes: e.pollTimes.map(Bc)
5051
5074
  };
5052
5075
  case "integration": return {
5053
5076
  ...t(e.kind),
5054
5077
  bindingId: e.bindingId,
5055
5078
  config: e.config,
5056
- definition: Fc(e.definition)
5079
+ definition: Rc(e.definition)
5057
5080
  };
5058
5081
  }
5059
5082
  }
5060
- function zc(e) {
5083
+ function Hc(e) {
5061
5084
  let { name: t, description: n, icon: r, ...i } = e;
5062
5085
  return Z(i);
5063
5086
  }
5064
- function Bc(e) {
5087
+ function Uc(e) {
5065
5088
  return {
5066
5089
  bindings: Object.fromEntries(Q(e.bindings)),
5067
- graph: Tc(e.graph),
5090
+ graph: Oc(e.graph),
5068
5091
  subflows: Object.fromEntries(Q(e.subflows).map(([e, t]) => [e, {
5069
- graph: Tc(t.graph),
5092
+ graph: Oc(t.graph),
5070
5093
  inputs: $(t.inputs),
5071
5094
  name: t.name,
5072
- outputs: Cc(t.outputs)
5095
+ outputs: Tc(t.outputs)
5073
5096
  }])),
5074
- tasks: Object.fromEntries(Q(e.tasks).map(([e, t]) => [e, Nc(t)]))
5097
+ tasks: Object.fromEntries(Q(e.tasks).map(([e, t]) => [e, Ic(t)]))
5075
5098
  };
5076
5099
  }
5077
- function Vc(e) {
5078
- if (e.modelVersion != 2) return Bc(e.document);
5100
+ function Wc(e) {
5101
+ if (e.modelVersion != 2) return Uc(e.document);
5079
5102
  let { document: t } = e;
5080
5103
  return {
5081
5104
  bindings: Object.fromEntries(Q(t.bindings)),
5082
- graph: kc(t.graph),
5105
+ graph: Mc(t.graph),
5083
5106
  subflows: Object.fromEntries(Q(t.subflows).map(([e, t]) => [e, {
5084
- graph: kc(t.graph),
5107
+ graph: Mc(t.graph),
5085
5108
  inputs: $(t.inputs),
5086
5109
  name: t.name,
5087
- outputs: Ac(t.outputs, t.graph)
5110
+ outputs: Nc(t.outputs, t.graph)
5088
5111
  }])),
5089
- tasks: Object.fromEntries(Q(t.tasks).map(([e, t]) => [e, Nc(t)]))
5112
+ tasks: Object.fromEntries(Q(t.tasks).map(([e, t]) => [e, Ic(t)]))
5090
5113
  };
5091
5114
  }
5092
- function Hc(e) {
5115
+ function Gc(e) {
5093
5116
  return {
5094
5117
  imports: e.imports.toSorted(),
5095
5118
  name: e.name,
5096
5119
  source: e.source
5097
5120
  };
5098
5121
  }
5099
- function Uc(e) {
5122
+ function Kc(e) {
5100
5123
  return {
5101
- document: Vc(e),
5124
+ document: Wc(e),
5102
5125
  kind: "open-flow-flow-revision",
5103
5126
  modelVersion: e.modelVersion,
5104
- modules: Object.fromEntries(Q(e.modules).map(([e, t]) => [e, Hc(t)])),
5127
+ modules: Object.fromEntries(Q(e.modules).map(([e, t]) => [e, Gc(t)])),
5105
5128
  version: 1
5106
5129
  };
5107
5130
  }
5108
- function Wc(e) {
5109
- return vc(Uc(e));
5131
+ function qc(e) {
5132
+ return bc(Kc(e));
5110
5133
  }
5111
- function Gc(e) {
5112
- return pc(JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e)));
5134
+ function Jc(e) {
5135
+ return hc(JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e)));
5113
5136
  }
5114
- function Kc(e) {
5137
+ function Yc(e) {
5115
5138
  return JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e));
5116
5139
  }
5117
- function qc(e) {
5140
+ function Xc(e) {
5118
5141
  let t;
5119
5142
  try {
5120
- t = Kc(e), pc(t);
5143
+ t = Yc(e), hc(t);
5121
5144
  return;
5122
5145
  } catch {}
5123
5146
  try {
5124
- uc(t);
5147
+ fc(t);
5125
5148
  } catch {
5126
5149
  return;
5127
5150
  }
5128
5151
  let n = t;
5129
5152
  return typeof n.modelVersion == "number" && n.modelVersion < 3 ? "upgrade" : "repair";
5130
5153
  }
5131
- function Jc(e) {
5132
- return uc(Kc(e));
5154
+ function Zc(e) {
5155
+ return fc(Yc(e));
5133
5156
  }
5134
- var Yc = H(P(), R()), Xc = B({
5157
+ var Qc = U(P(), R()), $c = B({
5135
5158
  jsonSchema: R(),
5136
5159
  nullable: L(),
5137
5160
  value: R().optional(),
5138
5161
  description: P().optional()
5139
- }).strict(), Zc = H(P(), Xc), Qc = V([B({
5140
- kind: W("value"),
5162
+ }).strict(), el = U(P(), $c), tl = H([B({
5163
+ kind: G("value"),
5141
5164
  value: R()
5142
5165
  }).strict(), B({
5143
- kind: W("sources"),
5166
+ kind: G("sources"),
5144
5167
  sources: z(B({
5145
- kind: W("node"),
5168
+ kind: G("node"),
5146
5169
  nodeId: P(),
5147
5170
  output: P()
5148
5171
  }).strict())
5149
- }).strict()]), $c = {
5172
+ }).strict()]), nl = {
5150
5173
  name: P().optional(),
5151
5174
  description: P().optional(),
5152
5175
  icon: P().optional()
5153
- }, el = V([
5176
+ }, rl = H([
5154
5177
  B({
5155
- ...$c,
5156
- kind: W("cron"),
5178
+ ...nl,
5179
+ kind: G("cron"),
5157
5180
  cronTimes: z(R())
5158
5181
  }).strict(),
5159
5182
  B({
5160
- ...$c,
5161
- kind: W("manual")
5183
+ ...nl,
5184
+ kind: G("manual")
5162
5185
  }).strict(),
5163
5186
  B({
5164
- ...$c,
5165
- kind: W("task"),
5166
- concurrency: W(1).optional(),
5167
- inputs: H(P(), Qc),
5187
+ ...nl,
5188
+ kind: G("task"),
5189
+ concurrency: G(1).optional(),
5190
+ inputs: U(P(), tl),
5168
5191
  task: B({
5169
5192
  name: P(),
5170
5193
  moduleId: P(),
5171
- inputs: Zc,
5172
- outputs: H(P(), Xc.omit({ value: !0 }))
5194
+ inputs: el,
5195
+ outputs: U(P(), $c.omit({ value: !0 }))
5173
5196
  }).strict()
5174
5197
  }).strict()
5175
- ]), tl = B({
5198
+ ]), il = B({
5176
5199
  name: P(),
5177
- graph: B({ nodes: H(P(), el) }).strict()
5178
- }).strict(), nl = B({
5179
- kind: W("open-flow-project-revision"),
5180
- version: W(1),
5181
- modelVersion: V([W(1), W(2)]),
5182
- modules: H(P(), B({
5200
+ graph: B({ nodes: U(P(), rl) }).strict()
5201
+ }).strict(), al = B({
5202
+ kind: G("open-flow-project-revision"),
5203
+ version: G(1),
5204
+ modelVersion: H([G(1), G(2)]),
5205
+ modules: U(P(), B({
5183
5206
  name: P(),
5184
5207
  source: P(),
5185
5208
  imports: z(P())
5186
5209
  }).strict()),
5187
5210
  document: B({
5188
- bindings: Yc,
5189
- flows: Yc,
5190
- subflows: Yc,
5191
- tasks: Yc
5211
+ bindings: Qc,
5212
+ flows: Qc,
5213
+ subflows: Qc,
5214
+ tasks: Qc
5192
5215
  }).strict()
5193
5216
  }).strict();
5194
- function rl(e) {
5217
+ function ol(e) {
5195
5218
  return Object.entries(e).map(([e, t]) => Object.assign({ handle: e }, t));
5196
5219
  }
5197
- function il(e) {
5198
- return Object.keys(nl.parse(e).document.flows).toSorted();
5220
+ function sl(e) {
5221
+ return Object.keys(al.parse(e).document.flows).toSorted();
5199
5222
  }
5200
- function al(e, t) {
5201
- let n = nl.parse(e);
5223
+ function cl(e, t) {
5224
+ let n = al.parse(e);
5202
5225
  if ([
5203
5226
  n.document.bindings,
5204
5227
  n.document.subflows,
5205
5228
  n.document.tasks
5206
5229
  ].some((e) => Object.keys(e).length != 0)) throw Error("Project bindings, managed tasks and subflows require an explicit semantic conversion.");
5207
- let r = tl.parse(n.document.flows[t]), i = [], a = /* @__PURE__ */ new Set(), o = Object.fromEntries(Object.entries(r.graph.nodes).map(([e, t]) => {
5208
- let n = t.name ?? (t.kind == "task" ? t.task.name : e), r = gc(n, a);
5230
+ let r = il.parse(n.document.flows[t]), i = [], a = /* @__PURE__ */ new Set(), o = Object.fromEntries(Object.entries(r.graph.nodes).map(([e, t]) => {
5231
+ let n = t.name ?? (t.kind == "task" ? t.task.name : e), r = vc(n, a);
5209
5232
  if (a.add(r), r != n && i.push(`Renamed node ${e} to ${r}.`), t.kind != "task") return [e, {
5210
5233
  ...t,
5211
5234
  name: r
@@ -5216,11 +5239,11 @@ function al(e, t) {
5216
5239
  name: r,
5217
5240
  task: {
5218
5241
  ...t.task,
5219
- inputs: rl(t.task.inputs),
5220
- outputs: rl(t.task.outputs)
5242
+ inputs: ol(t.task.inputs),
5243
+ outputs: ol(t.task.outputs)
5221
5244
  }
5222
5245
  }];
5223
- })), s = fc({
5246
+ })), s = mc({
5224
5247
  modelVersion: 3,
5225
5248
  modules: n.modules,
5226
5249
  document: {
@@ -5255,7 +5278,7 @@ function al(e, t) {
5255
5278
  let f = { ...s.document.graph.nodes };
5256
5279
  return d != null && (f[d] = {
5257
5280
  kind: "manual",
5258
- name: gc("Start", a)
5281
+ name: vc("Start", a)
5259
5282
  }), {
5260
5283
  name: r.name,
5261
5284
  adjustments: i,
@@ -5272,4 +5295,4 @@ function al(e, t) {
5272
5295
  };
5273
5296
  }
5274
5297
  //#endregion
5275
- export { Bc as canonicalDocument, Tc as canonicalGraph, vc as canonicalJsonBytes, Hc as canonicalModule, Cc as canonicalOutputs, $ as canonicalPorts, jc as canonicalRevisionGraph, Mc as canonicalRevisionOutputs, Nc as canonicalTask, al as convertProjectFlow, dc as decodeFlowDocument, Gc as decodeRevision, fc as decodeRevisionContent, yc as digestBytes, Wc as encodeRevision, il as legacyProjectFlowIds, ws as maxJsonDepth, Jc as repairRevision, qc as revisionRepairKind, zc as triggerRuntimeJson };
5298
+ export { Uc as canonicalDocument, Oc as canonicalGraph, bc as canonicalJsonBytes, Gc as canonicalModule, Tc as canonicalOutputs, $ as canonicalPorts, Pc as canonicalRevisionGraph, Fc as canonicalRevisionOutputs, Ic as canonicalTask, cl as convertProjectFlow, pc as decodeFlowDocument, Jc as decodeRevision, mc as decodeRevisionContent, xc as digestBytes, qc as encodeRevision, sl as legacyProjectFlowIds, Cs as maxJsonDepth, Zc as repairRevision, Xc as revisionRepairKind, Hc as triggerRuntimeJson };