@nodish/core 0.1.4 → 0.2.1

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 (58) hide show
  1. package/LICENSE +661 -0
  2. package/dist/{vue.css → index.css} +1 -1
  3. package/dist/index.d.ts +519 -0
  4. package/dist/{vue.js → index.js} +608 -600
  5. package/package.json +13 -14
  6. package/dist/pack.d.ts +0 -326
  7. package/dist/pack.js +0 -43
  8. package/dist/src/components/AddNodePanel.vue.d.ts +0 -20
  9. package/dist/src/components/GraphInterfacePanel.vue.d.ts +0 -13
  10. package/dist/src/components/GraphNode.vue.d.ts +0 -26
  11. package/dist/src/components/GroupPanel.vue.d.ts +0 -13
  12. package/dist/src/components/InspectorPanel.vue.d.ts +0 -43
  13. package/dist/src/components/NodePanel.vue.d.ts +0 -18
  14. package/dist/src/components/NodePort.vue.d.ts +0 -21
  15. package/dist/src/components/NodeViewer.vue.d.ts +0 -14
  16. package/dist/src/components/WireLayer.vue.d.ts +0 -8
  17. package/dist/src/components/inspector/InspectorCheckboxField.vue.d.ts +0 -10
  18. package/dist/src/components/inspector/InspectorColorField.vue.d.ts +0 -12
  19. package/dist/src/components/inspector/InspectorError.vue.d.ts +0 -5
  20. package/dist/src/components/inspector/InspectorPositionField.vue.d.ts +0 -12
  21. package/dist/src/components/inspector/InspectorSection.vue.d.ts +0 -24
  22. package/dist/src/components/inspector/InspectorWidthField.vue.d.ts +0 -12
  23. package/dist/src/components/layout.d.ts +0 -26
  24. package/dist/src/components/types/NumberWidget.vue.d.ts +0 -15
  25. package/dist/src/components/types/PortValueWidget.vue.d.ts +0 -17
  26. package/dist/src/components/types/ReadonlyWidget.vue.d.ts +0 -9
  27. package/dist/src/components/types/TextWidget.vue.d.ts +0 -15
  28. package/dist/src/components/types/registerDefaultTypeWidgets.d.ts +0 -6
  29. package/dist/src/components/types/registry.d.ts +0 -13
  30. package/dist/src/pack/index.d.ts +0 -5
  31. package/dist/src/store/composite/editContext.d.ts +0 -14
  32. package/dist/src/store/composite/guards.d.ts +0 -7
  33. package/dist/src/store/composite/index.d.ts +0 -12
  34. package/dist/src/store/graph/connect.d.ts +0 -8
  35. package/dist/src/store/graph/createNodeMap.d.ts +0 -20
  36. package/dist/src/store/graph/document.d.ts +0 -25
  37. package/dist/src/store/graph/dynamicPorts.d.ts +0 -9
  38. package/dist/src/store/graph/evaluate.d.ts +0 -18
  39. package/dist/src/store/graph/expandIO.d.ts +0 -2
  40. package/dist/src/store/graph/instance.d.ts +0 -7
  41. package/dist/src/store/graph/pruneConnections.d.ts +0 -2
  42. package/dist/src/store/graph/removeNode.d.ts +0 -3
  43. package/dist/src/store/graph/stacking.d.ts +0 -5
  44. package/dist/src/store/graph/validateGraphTypes.d.ts +0 -2
  45. package/dist/src/store/interface/editor.d.ts +0 -5
  46. package/dist/src/store/interface/graphInterface.d.ts +0 -20
  47. package/dist/src/store/model.d.ts +0 -241
  48. package/dist/src/store/nodes/io.d.ts +0 -46
  49. package/dist/src/store/packs/installPack.d.ts +0 -4
  50. package/dist/src/store/registry/defineNode.d.ts +0 -50
  51. package/dist/src/store/registry/defineType.d.ts +0 -31
  52. package/dist/src/store/registry/groups.d.ts +0 -9
  53. package/dist/src/store/registry/index.d.ts +0 -39
  54. package/dist/src/store/types/effectiveWidget.d.ts +0 -4
  55. package/dist/src/store/utils/clonePlain.d.ts +0 -1
  56. package/dist/src/vue/attachLoadPack.d.ts +0 -2
  57. package/dist/src/vue/createNodeMap.d.ts +0 -11
  58. package/dist/src/vue/index.d.ts +0 -10
@@ -1,27 +1,27 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useCssVars as b, vModelText as x, watch as ee, withCtx as S, withDirectives as C, withModifiers as w } from "vue";
2
- import './vue.css';//#region src/store/graph/pruneConnections.ts
3
- function T(e, t) {
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useCssVars as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withModifiers as T } from "vue";
2
+ import './index.css';//#region src/store/graph/pruneConnections.ts
3
+ function E(e, t) {
4
4
  e.graph.connections = e.graph.connections.filter((e) => !(e.from.node === t.id && !t.outputs[e.from.port] || e.to.node === t.id && !t.inputs[e.to.port]));
5
5
  }
6
6
  //#endregion
7
7
  //#region src/store/graph/dynamicPorts.ts
8
- function E(e, t) {
8
+ function D(e, t) {
9
9
  return e.resolvePorts ? e.resolvePorts(t) : {
10
10
  inputs: e.inputs,
11
11
  outputs: e.outputs
12
12
  };
13
13
  }
14
- function D(e) {
14
+ function O(e) {
15
15
  let t = {};
16
16
  for (let n of Object.values(e.inputs)) n.userOnly && (t[n.name] = n.value);
17
17
  return t;
18
18
  }
19
- function O(e) {
19
+ function k(e) {
20
20
  let t = {};
21
21
  for (let n of Object.values(e.inputs)) n.userOnly && (t[n.name] = n.defaultValue);
22
22
  return t;
23
23
  }
24
- function k(e, t, n) {
24
+ function A(e, t, n) {
25
25
  let r = {};
26
26
  for (let t of Object.values(e)) r[t.name] = t;
27
27
  let i = {};
@@ -44,15 +44,15 @@ function k(e, t, n) {
44
44
  }
45
45
  return i;
46
46
  }
47
- function A(e, t) {
47
+ function j(e, t) {
48
48
  let n = e.nodeTypes[t.typeId];
49
49
  if (!n?.resolvePorts) return;
50
- let r = E(n, D(t));
51
- t.inputs = k(t.inputs, r.inputs, "input"), t.outputs = k(t.outputs, r.outputs, "output"), T(e, t);
50
+ let r = D(n, O(t));
51
+ t.inputs = A(t.inputs, r.inputs, "input"), t.outputs = A(t.outputs, r.outputs, "output"), E(e, t);
52
52
  }
53
53
  //#endregion
54
54
  //#region src/store/graph/expandIO.ts
55
- function j(e) {
55
+ function M(e) {
56
56
  let t = {};
57
57
  for (let [n, r] of Object.entries(e ?? {})) t[n] = {
58
58
  name: n,
@@ -62,46 +62,46 @@ function j(e) {
62
62
  }
63
63
  //#endregion
64
64
  //#region src/store/model.ts
65
- var M = {
65
+ var N = {
66
66
  parameters: {},
67
67
  returns: {}
68
68
  };
69
69
  //#endregion
70
70
  //#region src/store/registry/defineNode.ts
71
- function N(e) {
71
+ function P(e) {
72
72
  return {
73
73
  typeId: e.typeId,
74
74
  displayName: e.displayName,
75
75
  color: e.color ?? "#3a3f4b",
76
76
  description: e.description ?? "",
77
77
  group: e.group ?? [],
78
- inputs: j(e.inputs),
79
- outputs: j(e.outputs),
78
+ inputs: M(e.inputs),
79
+ outputs: M(e.outputs),
80
80
  execute: e.execute,
81
81
  graph: e.graph,
82
82
  resolvePorts: e.resolvePorts ? (t) => {
83
83
  let n = e.resolvePorts(t);
84
84
  return {
85
- inputs: j(n.inputs),
86
- outputs: j(n.outputs)
85
+ inputs: M(n.inputs),
86
+ outputs: M(n.outputs)
87
87
  };
88
88
  } : void 0
89
89
  };
90
90
  }
91
91
  //#endregion
92
92
  //#region src/store/registry/index.ts
93
- function P(e, t) {
94
- Object.assign(e.types, t);
95
- }
96
93
  function F(e, t) {
97
- for (let [n, r] of Object.entries(t)) e.nodeTypes[n] = N(r);
94
+ Object.assign(e.types, t);
98
95
  }
99
96
  function I(e, t) {
100
- t.types && P(e, t.types), t.nodeTypes && F(e, t.nodeTypes), e.extensions.includes(t.id) || e.extensions.push(t.id);
97
+ for (let [n, r] of Object.entries(t)) e.nodeTypes[n] = P(r);
98
+ }
99
+ function L(e, t) {
100
+ t.types && F(e, t.types), t.nodeTypes && I(e, t.nodeTypes), e.extensions.includes(t.id) || e.extensions.push(t.id);
101
101
  }
102
102
  //#endregion
103
103
  //#region src/store/graph/instance.ts
104
- function L(e, t) {
104
+ function R(e, t) {
105
105
  let n = {};
106
106
  for (let r of Object.values(e)) {
107
107
  let e = crypto.randomUUID();
@@ -118,34 +118,34 @@ function L(e, t) {
118
118
  }
119
119
  return n;
120
120
  }
121
- function R(e, t) {
122
- let { inputs: n, outputs: r } = E(e, O(e));
121
+ function z(e, t) {
122
+ let { inputs: n, outputs: r } = D(e, k(e));
123
123
  return {
124
124
  id: crypto.randomUUID(),
125
125
  typeId: e.typeId,
126
126
  location: t,
127
- inputs: L(n, "input"),
128
- outputs: L(r, "output")
127
+ inputs: R(n, "input"),
128
+ outputs: R(r, "output")
129
129
  };
130
130
  }
131
131
  //#endregion
132
132
  //#region src/store/utils/clonePlain.ts
133
- function z(e) {
133
+ function B(e) {
134
134
  return JSON.parse(JSON.stringify(e));
135
135
  }
136
136
  //#endregion
137
137
  //#region src/store/interface/graphInterface.ts
138
- var te = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
139
- function B(e, t) {
138
+ var ee = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
139
+ function V(e, t) {
140
140
  let n = [], r = (t, r) => {
141
141
  let i = /* @__PURE__ */ new Set();
142
- for (let [a, o] of Object.entries(t ?? {})) te.test(a) || n.push(`${r}: invalid port name "${a}"`), i.has(a) && n.push(`${r}: duplicate port name "${a}"`), i.add(a), e.types[o.type] || n.push(`${r}: unknown type "${o.type}" on port "${a}"`);
142
+ for (let [a, o] of Object.entries(t ?? {})) ee.test(a) || n.push(`${r}: invalid port name "${a}"`), i.has(a) && n.push(`${r}: duplicate port name "${a}"`), i.add(a), e.types[o.type] || n.push(`${r}: unknown type "${o.type}" on port "${a}"`);
143
143
  };
144
144
  return r(t.parameters, "parameters"), r(t.returns, "returns"), n;
145
145
  }
146
146
  //#endregion
147
147
  //#region src/store/nodes/io.ts
148
- var V = "io/input", H = "io/output", ne = {
148
+ var H = "io/input", U = "io/output", te = {
149
149
  input: {
150
150
  x: 40,
151
151
  y: 120
@@ -155,10 +155,10 @@ var V = "io/input", H = "io/output", ne = {
155
155
  y: 130
156
156
  }
157
157
  };
158
- function re(e = {}) {
158
+ function ne(e = {}) {
159
159
  return {
160
160
  input: {
161
- typeId: V,
161
+ typeId: H,
162
162
  displayName: "Input",
163
163
  color: "#7a5a3a",
164
164
  description: "Graph inputs (function parameters).",
@@ -166,7 +166,7 @@ function re(e = {}) {
166
166
  outputs: e.parameters
167
167
  },
168
168
  output: {
169
- typeId: H,
169
+ typeId: U,
170
170
  displayName: "Output",
171
171
  color: "#7a3a5a",
172
172
  description: "Graph outputs (function return values).",
@@ -175,59 +175,59 @@ function re(e = {}) {
175
175
  }
176
176
  };
177
177
  }
178
- function ie(e, t) {
178
+ function re(e, t) {
179
179
  e.graphInterface = t;
180
- let n = re(t);
181
- F(e, {
180
+ let n = ne(t);
181
+ I(e, {
182
182
  [n.input.typeId]: n.input,
183
183
  [n.output.typeId]: n.output
184
184
  });
185
185
  }
186
- function ae(e) {
187
- let t = e.graph.nodes.filter((e) => e.typeId === V), n = e.graph.nodes.filter((e) => e.typeId === H);
186
+ function ie(e) {
187
+ let t = e.graph.nodes.filter((e) => e.typeId === H), n = e.graph.nodes.filter((e) => e.typeId === U);
188
188
  if (t.length !== 1 || n.length !== 1) throw Error(`graph must have exactly one Input and one Output node (found ${t.length} input, ${n.length} output)`);
189
189
  return {
190
190
  input: t[0],
191
191
  output: n[0]
192
192
  };
193
193
  }
194
- function oe(e, t = ne) {
195
- let n = e.graph.nodes.filter((e) => e.typeId === V), r = e.graph.nodes.filter((e) => e.typeId === H);
194
+ function ae(e, t = te) {
195
+ let n = e.graph.nodes.filter((e) => e.typeId === H), r = e.graph.nodes.filter((e) => e.typeId === U);
196
196
  if (n.length > 1 || r.length > 1) throw Error(`graph must have exactly one Input and one Output node (found ${n.length} input, ${r.length} output)`);
197
- let i = n[0], a = r[0], o = re(e.graphInterface);
198
- return i || (i = R(N(o.input), t.input), e.graph.nodes.push(i)), a || (a = R(N(o.output), t.output), e.graph.nodes.push(a)), {
197
+ let i = n[0], a = r[0], o = ne(e.graphInterface);
198
+ return i || (i = z(P(o.input), t.input), e.graph.nodes.push(i)), a || (a = z(P(o.output), t.output), e.graph.nodes.push(a)), {
199
199
  input: i,
200
200
  output: a
201
201
  };
202
202
  }
203
- function U(e, t) {
204
- let n = B(e, t);
203
+ function W(e, t) {
204
+ let n = V(e, t);
205
205
  if (n.length) return n;
206
- ie(e, t);
207
- let { input: r, output: i } = ae(e);
208
- r.outputs = k(r.outputs, j(t.parameters), "output");
206
+ re(e, t);
207
+ let { input: r, output: i } = ie(e);
208
+ r.outputs = A(r.outputs, M(t.parameters), "output");
209
209
  for (let n of Object.values(r.outputs)) {
210
210
  let r = t.parameters?.[n.name];
211
211
  if (!r) continue;
212
212
  let i = e.types[r.type];
213
213
  r.defaultValue === void 0 ? i && !i.validate(n.value) && (n.value = i.defaultValue) : n.value = r.defaultValue;
214
214
  }
215
- return i.inputs = k(i.inputs, j(t.returns), "input"), T(e, r), T(e, i), [];
215
+ return i.inputs = A(i.inputs, M(t.returns), "input"), E(e, r), E(e, i), [];
216
216
  }
217
- function se(e) {
218
- let t = [], n = e.graph.nodes.filter((e) => e.typeId === V).length, r = e.graph.nodes.filter((e) => e.typeId === H).length;
217
+ function oe(e) {
218
+ let t = [], n = e.graph.nodes.filter((e) => e.typeId === H).length, r = e.graph.nodes.filter((e) => e.typeId === U).length;
219
219
  return n === 0 ? t.push("graph has no Input node") : n > 1 && t.push("graph has multiple Input nodes"), r === 0 ? t.push("graph has no Output node") : r > 1 && t.push("graph has multiple Output nodes"), t;
220
220
  }
221
221
  //#endregion
222
222
  //#region src/store/composite/index.ts
223
- var W = "composite/group", ce = {
224
- typeId: W,
223
+ var G = "composite/group", se = {
224
+ typeId: G,
225
225
  displayName: "Group",
226
226
  color: "#4a5a6a",
227
227
  description: "A nested subgraph with its own inputs and outputs.",
228
228
  group: ["Custom nodes"]
229
229
  };
230
- function G(e, t) {
230
+ function K(e, t) {
231
231
  let n = t.composite;
232
232
  if (!n) throw Error("node has no composite state");
233
233
  let r = {
@@ -238,63 +238,63 @@ function G(e, t) {
238
238
  extensions: e.extensions,
239
239
  loadPack: (t) => e.loadPack(t)
240
240
  };
241
- return ie(r, n.interface), r;
241
+ return re(r, n.interface), r;
242
242
  }
243
- function le(e, t) {
244
- let n = t.composite?.interface ?? M;
245
- t.inputs = k(t.inputs, j(n.parameters), "input"), t.outputs = k(t.outputs, j(n.returns), "output"), T(e, t);
243
+ function ce(e, t) {
244
+ let n = t.composite?.interface ?? N;
245
+ t.inputs = A(t.inputs, M(n.parameters), "input"), t.outputs = A(t.outputs, M(n.returns), "output"), E(e, t);
246
246
  }
247
- function ue(e, t, n = {}) {
248
- let r = U(e, t);
247
+ function le(e, t, n = {}) {
248
+ let r = W(e, t);
249
249
  if (r.length) return r;
250
250
  let i = n.ownerComposite;
251
- return i?.composite && n.parentMap ? (i.composite.interface = t, le(n.parentMap, i)) : e.graphInterface = t, [];
251
+ return i?.composite && n.parentMap ? (i.composite.interface = t, ce(n.parentMap, i)) : e.graphInterface = t, [];
252
252
  }
253
- function de(e) {
253
+ function ue(e) {
254
254
  let t = {};
255
255
  return {
256
- inputs: k(t, j(e.parameters), "input"),
257
- outputs: k(t, j(e.returns), "output")
256
+ inputs: A(t, M(e.parameters), "input"),
257
+ outputs: A(t, M(e.returns), "output")
258
258
  };
259
259
  }
260
- function fe(e, t) {
260
+ function de(e, t) {
261
261
  let n = {
262
262
  graph: {
263
263
  nodes: [],
264
264
  connections: []
265
265
  },
266
- graphInterface: z(t),
266
+ graphInterface: B(t),
267
267
  types: e.types,
268
268
  nodeTypes: { ...e.nodeTypes },
269
269
  extensions: e.extensions,
270
270
  loadPack: (t) => e.loadPack(t)
271
271
  };
272
- return ie(n, n.graphInterface), oe(n, ne), {
273
- graph: z(n.graph),
274
- interface: z(n.graphInterface)
272
+ return re(n, n.graphInterface), ae(n, te), {
273
+ graph: B(n.graph),
274
+ interface: B(n.graphInterface)
275
275
  };
276
276
  }
277
- function pe(e, t) {
278
- e.nodeTypes["composite/group"] || F(e, { [W]: ce });
279
- let n = z(M), r = fe(e, n), { inputs: i, outputs: a } = de(n);
277
+ function fe(e, t) {
278
+ e.nodeTypes["composite/group"] || I(e, { [G]: se });
279
+ let n = B(N), r = de(e, n), { inputs: i, outputs: a } = ue(n);
280
280
  return {
281
281
  id: crypto.randomUUID(),
282
- typeId: W,
282
+ typeId: G,
283
283
  location: t,
284
284
  inputs: i,
285
285
  outputs: a,
286
286
  composite: r
287
287
  };
288
288
  }
289
- function me(e) {
289
+ function pe(e) {
290
290
  return e.typeId === "composite/group" && !!e.composite;
291
291
  }
292
292
  //#endregion
293
293
  //#region src/store/graph/evaluate.ts
294
- function K(e) {
294
+ function q(e) {
295
295
  return e instanceof Error ? e.message : String(e);
296
296
  }
297
- function he(e, t = {}) {
297
+ function me(e, t = {}) {
298
298
  let n = {};
299
299
  for (let t of e.graph.nodes) n[t.id] = t;
300
300
  let r = /* @__PURE__ */ new Map();
@@ -304,7 +304,7 @@ function he(e, t = {}) {
304
304
  }
305
305
  let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = {};
306
306
  function s(e, t) {
307
- e.id in o || (o[e.id] = K(t));
307
+ e.id in o || (o[e.id] = q(t));
308
308
  }
309
309
  function c(e) {
310
310
  let t = n[e.node], r = t?.outputs[e.port];
@@ -334,8 +334,8 @@ function he(e, t = {}) {
334
334
  if (n.typeId === "io/input") {
335
335
  o = {};
336
336
  for (let e of Object.values(n.outputs)) o[e.name] = e.name in t ? t[e.name] : e.value;
337
- } else if (me(n)) {
338
- let t = he(G(e, n), l(n));
337
+ } else if (pe(n)) {
338
+ let t = me(K(e, n), l(n));
339
339
  for (let e of Object.values(t.errors)) {
340
340
  s(n, Error(e));
341
341
  break;
@@ -352,7 +352,7 @@ function he(e, t = {}) {
352
352
  }
353
353
  return a.delete(n.id), i.set(n.id, o), o;
354
354
  }
355
- let d = e.graph.nodes.find((e) => e.typeId === H);
355
+ let d = e.graph.nodes.find((e) => e.typeId === U);
356
356
  return {
357
357
  values: d ? l(d, { useDefaults: !1 }) : {},
358
358
  errors: o
@@ -360,11 +360,11 @@ function he(e, t = {}) {
360
360
  }
361
361
  //#endregion
362
362
  //#region src/store/graph/connect.ts
363
- function ge(e, t, n) {
363
+ function he(e, t, n) {
364
364
  let r = e.types[n];
365
365
  return r && r.accepts ? r.accepts(t) : t === n;
366
366
  }
367
- function _e(e, t) {
367
+ function ge(e, t) {
368
368
  let n = /* @__PURE__ */ new Map();
369
369
  for (let t of e.graph.connections) {
370
370
  let e = n.get(t.to.node) ?? [];
@@ -380,7 +380,7 @@ function _e(e, t) {
380
380
  }
381
381
  return [...r];
382
382
  }
383
- function ve(e, t) {
383
+ function _e(e, t) {
384
384
  let n = /* @__PURE__ */ new Map();
385
385
  for (let t of e.graph.connections) {
386
386
  let e = n.get(t.from.node) ?? [];
@@ -396,16 +396,16 @@ function ve(e, t) {
396
396
  }
397
397
  return [...r];
398
398
  }
399
- function q(e, t, n) {
400
- return ve(e, n.node).includes(t.node);
399
+ function J(e, t, n) {
400
+ return _e(e, n.node).includes(t.node);
401
401
  }
402
- function ye(e, t, n) {
402
+ function ve(e, t, n) {
403
403
  if (t.node === n.node) return !1;
404
404
  let r = e.graph.nodes.find((e) => e.id === t.node), i = e.graph.nodes.find((e) => e.id === n.node), a = r?.outputs[t.port], o = i?.inputs[n.port];
405
- return !a || !o || o.userOnly || q(e, t, n) ? !1 : ge(e, a.type, o.type);
405
+ return !a || !o || o.userOnly || J(e, t, n) ? !1 : he(e, a.type, o.type);
406
406
  }
407
- function be(e, t, n) {
408
- if (!ye(e, t, n)) return null;
407
+ function ye(e, t, n) {
408
+ if (!ve(e, t, n)) return null;
409
409
  let r = e.graph.connections.find((e) => e.from.node === t.node && e.from.port === t.port && e.to.node === n.node && e.to.port === n.port);
410
410
  if (r) return r;
411
411
  e.graph.nodes.find((e) => e.id === n.node)?.inputs[n.port]?.multi || (e.graph.connections = e.graph.connections.filter((e) => !(e.to.node === n.node && e.to.port === n.port)));
@@ -416,26 +416,26 @@ function be(e, t, n) {
416
416
  };
417
417
  return e.graph.connections.push(i), i;
418
418
  }
419
- function xe(e, t) {
419
+ function be(e, t) {
420
420
  e.graph.connections = e.graph.connections.filter((e) => e.id !== t);
421
421
  }
422
422
  //#endregion
423
423
  //#region src/store/graph/removeNode.ts
424
- function Se(e, t) {
424
+ function xe(e, t) {
425
425
  let n = e.graph.nodes.find((e) => e.id === t);
426
426
  return n ? n.typeId !== "io/input" && n.typeId !== "io/output" : !1;
427
427
  }
428
- function Ce(e, t) {
429
- Se(e, t) && (e.graph.nodes = e.graph.nodes.filter((e) => e.id !== t), e.graph.connections = e.graph.connections.filter((e) => e.from.node !== t && e.to.node !== t));
428
+ function Se(e, t) {
429
+ xe(e, t) && (e.graph.nodes = e.graph.nodes.filter((e) => e.id !== t), e.graph.connections = e.graph.connections.filter((e) => e.from.node !== t && e.to.node !== t));
430
430
  }
431
431
  //#endregion
432
432
  //#region src/store/graph/stacking.ts
433
- function we(e) {
433
+ function Ce(e) {
434
434
  let t = 0;
435
435
  for (let n of e.graph.nodes) t = Math.max(t, n.z ?? 0);
436
436
  return t;
437
437
  }
438
- function Te(e) {
438
+ function we(e) {
439
439
  e.graph.nodes.map((e, t) => ({
440
440
  n: e,
441
441
  i: t
@@ -443,21 +443,21 @@ function Te(e) {
443
443
  e.n.z = t + 1;
444
444
  });
445
445
  }
446
- function Ee(e) {
446
+ function Te(e) {
447
447
  if (e.graph.nodes.length === 0) return;
448
448
  let t = !1;
449
449
  for (let n of e.graph.nodes) n.z === void 0 && (n.z = Math.random(), t = !0);
450
- t && Te(e);
450
+ t && we(e);
451
451
  }
452
- function De(e, t) {
452
+ function Ee(e, t) {
453
453
  let n = e.graph.nodes.find((e) => e.id === t);
454
454
  if (!n) return;
455
- let r = we(e);
455
+ let r = Ce(e);
456
456
  (n.z ?? 0) >= r || (n.z = r + 1);
457
457
  }
458
458
  //#endregion
459
459
  //#region src/store/composite/editContext.ts
460
- function J(e, t, n) {
460
+ function De(e, t, n) {
461
461
  let r = e;
462
462
  for (let i = 0; i <= n; i++) {
463
463
  let a = t[i];
@@ -466,12 +466,12 @@ function J(e, t, n) {
466
466
  if (!o) return null;
467
467
  if (i === n) return o;
468
468
  if (!o.composite) return null;
469
- r = G(e, o);
469
+ r = K(e, o);
470
470
  }
471
471
  return null;
472
472
  }
473
473
  function Oe(e, t) {
474
- return t.length ? J(e, t, t.length - 1) : null;
474
+ return t.length ? De(e, t, t.length - 1) : null;
475
475
  }
476
476
  function ke(e, t) {
477
477
  if (!t.length) return { activeMap: e };
@@ -479,10 +479,10 @@ function ke(e, t) {
479
479
  for (let i = 0; i < t.length; i++) {
480
480
  let a = t[i];
481
481
  if (r = n.graph.nodes.find((e) => e.id === a.compositeNodeId), !r?.composite) return { activeMap: e };
482
- i < t.length - 1 && (n = G(e, r));
482
+ i < t.length - 1 && (n = K(e, r));
483
483
  }
484
484
  return {
485
- activeMap: G(e, r),
485
+ activeMap: K(e, r),
486
486
  interfaceOptions: {
487
487
  ownerComposite: r,
488
488
  parentMap: n
@@ -500,7 +500,7 @@ function je(e, t, n) {
500
500
  let r = Ae(e, t);
501
501
  n(r);
502
502
  let i = ke(e, t);
503
- return ue(i.activeMap, r, i.interfaceOptions ?? {});
503
+ return le(i.activeMap, r, i.interfaceOptions ?? {});
504
504
  }
505
505
  //#endregion
506
506
  //#region src/store/composite/guards.ts
@@ -520,7 +520,7 @@ function Pe(e, t, n) {
520
520
  return null;
521
521
  }
522
522
  function Fe(e, t, n) {
523
- if (!me(n)) return "Not a group node";
523
+ if (!pe(n)) return "Not a group node";
524
524
  if (t.some((e) => e.compositeNodeId === n.id)) return "Already editing this group";
525
525
  let r = Ne(e, t);
526
526
  if (r.add(n.id), n.composite?.graph) {
@@ -529,12 +529,12 @@ function Fe(e, t, n) {
529
529
  return null;
530
530
  }
531
531
  function Ie(e, t, n, r) {
532
- if (!me(n) || !n.composite) return null;
532
+ if (!pe(n) || !n.composite) return null;
533
533
  let i = Ne(e, t);
534
534
  if (i.has(n.id)) return "A group cannot be placed inside itself";
535
535
  for (let e of i) if (Y(r, e, !1)) return "A group cannot be placed inside itself";
536
536
  for (let r = 0; r < t.length; r++) {
537
- let i = J(e, t, r);
537
+ let i = De(e, t, r);
538
538
  if (i?.composite?.graph === n.composite.graph) return "A group cannot share the same interior as an ancestor";
539
539
  if (i && n.composite.graph === i.composite?.graph) return "A group cannot be placed inside itself";
540
540
  }
@@ -550,7 +550,10 @@ function X(e, t) {
550
550
  return typeof n == "number" ? n : void 0;
551
551
  }
552
552
  function Le(e, t) {
553
- let n = e?.widget, r = t.customProps;
553
+ if (!(!e || e.id !== t.type)) return e;
554
+ }
555
+ function Re(e, t) {
556
+ let n = Le(e, t)?.widget, r = t.customProps;
554
557
  if (!(!n && !r)) return n ? n.kind === "number" ? {
555
558
  kind: "number",
556
559
  min: X(r, "min") ?? n.min,
@@ -577,19 +580,19 @@ function Le(e, t) {
577
580
  rowHeight: X(r, "rowHeight")
578
581
  } : void 0;
579
582
  }
580
- function Re(e, t) {
583
+ function ze(e, t) {
581
584
  return e ? e.rowHeight === void 0 ? e.kind === "text" ? (e.rows ?? 1) * t : t : e.rowHeight : t;
582
585
  }
583
586
  //#endregion
584
587
  //#region src/components/types/NumberWidget.vue?vue&type=script&setup=true&lang.ts
585
- var ze = [
588
+ var Be = [
586
589
  "value",
587
590
  "placeholder",
588
591
  "title",
589
592
  "min",
590
593
  "max",
591
594
  "step"
592
- ], Be = /*@__PURE__*/ s({
595
+ ], Z = /*@__PURE__*/ s({
593
596
  __name: "NumberWidget",
594
597
  props: {
595
598
  port: {},
@@ -627,14 +630,14 @@ var ze = [
627
630
  step: y(o).kind === "number" ? y(o).step : void 0,
628
631
  onInput: c,
629
632
  onChange: l,
630
- onPointerdown: n[0] ||= w(() => {}, ["stop"])
631
- }, null, 40, ze));
633
+ onPointerdown: n[0] ||= T(() => {}, ["stop"])
634
+ }, null, 40, Be));
632
635
  }
633
- }), Z = (e, t) => {
636
+ }), Q = (e, t) => {
634
637
  let n = e.__vccOpts || e;
635
638
  for (let [e, r] of t) n[e] = r;
636
639
  return n;
637
- }, Q = /*#__PURE__*/ Z(Be, [["__scopeId", "data-v-4459e34d"]]), Ve = ["title"], He = /*#__PURE__*/ Z(/* @__PURE__ */ s({
640
+ }, Ve = /*#__PURE__*/ Q(Z, [["__scopeId", "data-v-4459e34d"]]), He = ["title"], Ue = /*#__PURE__*/ Q(/* @__PURE__ */ s({
638
641
  __name: "ReadonlyWidget",
639
642
  props: {
640
643
  port: {},
@@ -650,18 +653,18 @@ var ze = [
650
653
  return (t, n) => (p(), i("span", {
651
654
  class: "field readonly",
652
655
  title: e.port.name
653
- }, v(r.value), 9, Ve));
656
+ }, v(r.value), 9, He));
654
657
  }
655
- }), [["__scopeId", "data-v-0d93d0ea"]]), Ue = [
658
+ }), [["__scopeId", "data-v-0d93d0ea"]]), We = [
656
659
  "value",
657
660
  "placeholder",
658
661
  "title",
659
662
  "rows"
660
- ], We = [
663
+ ], Ge = [
661
664
  "value",
662
665
  "placeholder",
663
666
  "title"
664
- ], $ = /*#__PURE__*/ Z(/* @__PURE__ */ s({
667
+ ], $ = /*#__PURE__*/ Q(/* @__PURE__ */ s({
665
668
  __name: "TextWidget",
666
669
  props: {
667
670
  port: {},
@@ -691,8 +694,8 @@ var ze = [
691
694
  rows: c.value,
692
695
  onInput: l,
693
696
  onChange: u,
694
- onPointerdown: n[0] ||= w(() => {}, ["stop"])
695
- }, null, 40, Ue)) : (p(), i("input", {
697
+ onPointerdown: n[0] ||= T(() => {}, ["stop"])
698
+ }, null, 40, We)) : (p(), i("input", {
696
699
  key: 1,
697
700
  class: "field",
698
701
  type: "text",
@@ -701,26 +704,28 @@ var ze = [
701
704
  title: e.port.name,
702
705
  onInput: l,
703
706
  onChange: u,
704
- onPointerdown: n[1] ||= w(() => {}, ["stop"])
705
- }, null, 40, We));
707
+ onPointerdown: n[1] ||= T(() => {}, ["stop"])
708
+ }, null, 40, Ge));
706
709
  }
707
- }), [["__scopeId", "data-v-bf7ff881"]]), Ge = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map(), qe = {
708
- number: Q,
710
+ }), [["__scopeId", "data-v-bf7ff881"]]), Ke = /* @__PURE__ */ new Map(), qe = /* @__PURE__ */ new Map(), Je = {
711
+ number: Ve,
709
712
  text: $,
710
713
  custom: $
711
714
  };
712
- function Je(e, t) {
713
- Ge.set(e, t);
714
- }
715
715
  function Ye(e, t) {
716
716
  Ke.set(e, t);
717
717
  }
718
- function Xe(e, t, n) {
719
- return n === "readonly" ? He : e && Ge.has(e.id) ? Ge.get(e.id) : t?.kind === "custom" ? Ke.get(t.componentId) ?? $ : t?.kind ? qe[t.kind] ?? $ : $;
718
+ function Xe(e, t) {
719
+ qe.set(e, t);
720
+ }
721
+ function Ze(e, t, n, r) {
722
+ if (n === "readonly") return Ue;
723
+ let i = r?.type ?? e?.id, a = e && e.id === i ? e : void 0;
724
+ return i && Ke.has(i) ? Ke.get(i) : t?.kind === "custom" ? qe.get(t.componentId) ?? $ : t?.kind ? Je[t.kind] ?? $ : a?.widget?.kind === "custom" ? qe.get(a.widget.componentId) ?? $ : a?.widget?.kind ? Je[a.widget.kind] ?? $ : $;
720
725
  }
721
726
  //#endregion
722
727
  //#region src/components/types/PortValueWidget.vue
723
- var Ze = /*#__PURE__*/ Z(/* @__PURE__ */ s({
728
+ var Qe = /*#__PURE__*/ Q(/* @__PURE__ */ s({
724
729
  __name: "PortValueWidget",
725
730
  props: {
726
731
  port: {},
@@ -731,17 +736,21 @@ var Ze = /*#__PURE__*/ Z(/* @__PURE__ */ s({
731
736
  placeholder: {}
732
737
  },
733
738
  emits: ["update:value", "commit"],
734
- setup(e, { emit: t }) {
735
- let r = e, i = t, a = Xe(r.typeDef, r.effectiveWidget, r.mode);
736
- return (t, r) => (p(), n(_(y(a)), {
739
+ setup(e, { emit: r }) {
740
+ let i = e, a = r, o = t(() => Re(i.typeDef, i.port)), s = t(() => Ze(i.typeDef, o.value, i.mode, i.port)), c = t(() => {
741
+ let e = o.value, t = i.port.type;
742
+ return i.mode === "readonly" ? `readonly:${t}` : e?.kind === "custom" ? `${t}:custom:${e.componentId}` : `${t}:${e?.kind ?? "text"}`;
743
+ });
744
+ return (t, r) => (p(), n(_(s.value), {
745
+ key: c.value,
737
746
  class: "field-widget",
738
747
  port: e.port,
739
748
  "type-def": e.typeDef,
740
- "effective-widget": e.effectiveWidget,
749
+ "effective-widget": o.value,
741
750
  "display-value": e.displayValue,
742
751
  placeholder: e.placeholder,
743
- "onUpdate:value": r[0] ||= (e) => i("update:value", e),
744
- onCommit: r[1] ||= (e) => i("commit")
752
+ "onUpdate:value": r[0] ||= (e) => a("update:value", e),
753
+ onCommit: r[1] ||= (e) => a("commit")
745
754
  }, null, 40, [
746
755
  "port",
747
756
  "type-def",
@@ -750,48 +759,48 @@ var Ze = /*#__PURE__*/ Z(/* @__PURE__ */ s({
750
759
  "placeholder"
751
760
  ]));
752
761
  }
753
- }), [["__scopeId", "data-v-975cb236"]]);
754
- function Qe(e) {
762
+ }), [["__scopeId", "data-v-4e15e37d"]]);
763
+ function $e(e) {
755
764
  return Math.max(20, Math.min(240, e));
756
765
  }
757
- function $e(e, t) {
766
+ function et(e, t) {
758
767
  let n = e.customProps?.rowHeight;
759
- return Qe(typeof n == "number" && n > 0 ? n : Re(Le(t, e), 20));
768
+ return $e(typeof n == "number" && n > 0 ? n : ze(Re(t, e), 20));
760
769
  }
761
- function et(e, t) {
770
+ function tt(e, t) {
762
771
  let n = 0;
763
- for (let r of e) n += $e(r, t?.(r));
772
+ for (let r of e) n += et(r, t?.(r));
764
773
  return n;
765
774
  }
766
- function tt(e) {
775
+ function nt(e) {
767
776
  return e.width ?? 100;
768
777
  }
769
- function nt(e, t) {
770
- let n = et(Object.values(e.inputs), t), r = et(Object.values(e.outputs), t);
778
+ function rt(e, t) {
779
+ let n = tt(Object.values(e.inputs), t), r = tt(Object.values(e.outputs), t);
771
780
  return 20 + Math.max(n, r);
772
781
  }
773
- function rt(e, t, n) {
782
+ function it(e, t, n) {
774
783
  let r = 20;
775
784
  for (let i of e) {
776
- let e = $e(i, n?.(i));
785
+ let e = et(i, n?.(i));
777
786
  if (i.id === t) return r + e / 2;
778
787
  r += e;
779
788
  }
780
789
  return null;
781
790
  }
782
- function it(e, t, n) {
783
- let r = rt(Object.values(e.inputs), t, n);
791
+ function at(e, t, n) {
792
+ let r = it(Object.values(e.inputs), t, n);
784
793
  if (r !== null) return {
785
794
  x: e.location.x,
786
795
  y: e.location.y + r
787
796
  };
788
- let i = rt(Object.values(e.outputs), t, n);
797
+ let i = it(Object.values(e.outputs), t, n);
789
798
  return i === null ? null : {
790
- x: e.location.x + tt(e),
799
+ x: e.location.x + nt(e),
791
800
  y: e.location.y + i
792
801
  };
793
802
  }
794
- function at(e, t) {
803
+ function ot(e, t) {
795
804
  let n = Math.max(40, Math.abs(t.x - e.x) * .5);
796
805
  return [{
797
806
  x: e.x + n,
@@ -801,12 +810,12 @@ function at(e, t) {
801
810
  y: t.y
802
811
  }];
803
812
  }
804
- function ot(e, t) {
805
- let [n, r] = at(e, t);
813
+ function st(e, t) {
814
+ let [n, r] = ot(e, t);
806
815
  return `M ${e.x} ${e.y} C ${n.x} ${n.y}, ${r.x} ${r.y}, ${t.x} ${t.y}`;
807
816
  }
808
- function st(e, t, n = 16) {
809
- let [r, i] = at(e, t), a = [];
817
+ function ct(e, t, n = 16) {
818
+ let [r, i] = ot(e, t), a = [];
810
819
  for (let o = 0; o <= n; o++) {
811
820
  let s = o / n, c = 1 - s, l = c * c * c * e.x + 3 * c * c * s * r.x + 3 * c * s * s * i.x + s * s * s * t.x, u = c * c * c * e.y + 3 * c * c * s * r.y + 3 * c * s * s * i.y + s * s * s * t.y;
812
821
  a.push({
@@ -816,7 +825,7 @@ function st(e, t, n = 16) {
816
825
  }
817
826
  return a;
818
827
  }
819
- function ct(e, t, n, r) {
828
+ function lt(e, t, n, r) {
820
829
  let i = t.x - e.x, a = t.y - e.y, o = r.x - n.x, s = r.y - n.y, c = i * s - a * o;
821
830
  if (c === 0) return !1;
822
831
  let l = n.x - e.x, u = n.y - e.y, d = (l * s - u * o) / c, f = (l * a - u * i) / c;
@@ -824,10 +833,10 @@ function ct(e, t, n, r) {
824
833
  }
825
834
  //#endregion
826
835
  //#region src/components/NodePort.vue?vue&type=script&setup=true&lang.ts
827
- var lt = ["title"], ut = {
836
+ var ut = ["title"], dt = {
828
837
  key: 2,
829
838
  class: "label"
830
- }, dt = /*#__PURE__*/ Z(/* @__PURE__ */ s({
839
+ }, ft = /*#__PURE__*/ Q(/* @__PURE__ */ s({
831
840
  __name: "NodePort",
832
841
  props: {
833
842
  port: {},
@@ -843,19 +852,19 @@ var lt = ["title"], ut = {
843
852
  },
844
853
  emits: ["connectStart", "valueChange"],
845
854
  setup(e, { emit: a }) {
846
- b((e) => ({ v7cc4cde0: o }));
855
+ b((e) => ({ v7bfdd17c: o }));
847
856
  let o = "11px", s = e, c = a;
848
857
  function d(e) {
849
858
  e.button === 0 && c("connectStart", s.port, e);
850
859
  }
851
- let f = t(() => $e(s.port, s.typeDef)), m = t(() => Le(s.typeDef, s.port)), h = t(() => {
860
+ let f = t(() => et(s.port, s.typeDef)), m = t(() => Re(s.typeDef, s.port)), h = t(() => {
852
861
  let e = s.typeDef?.label ?? s.port.type;
853
862
  return `${s.port.name} (${e})`;
854
- }), g = t(() => s.widgetMode === "editable" || s.side === "in" && !!s.port.userOnly || s.widgetMode === "auto" && s.side === "in" && !s.connected && !s.port.multi), _ = t(() => s.widgetMode === "readonly"), y = t(() => s.side === "in" && !s.port.userOnly), x = t(() => g.value || _.value), ee = t(() => _.value ? "readonly" : "editable");
855
- function S(e) {
863
+ }), g = t(() => s.widgetMode === "editable" || s.side === "in" && !!s.port.userOnly || s.widgetMode === "auto" && s.side === "in" && !s.connected && !s.port.multi), _ = t(() => s.widgetMode === "readonly"), y = t(() => s.side === "in" && !s.port.userOnly), x = t(() => g.value || _.value), S = t(() => _.value ? "readonly" : "editable");
864
+ function C(e) {
856
865
  s.port.value = e, c("valueChange", s.port);
857
866
  }
858
- function C() {
867
+ function w() {
859
868
  s.typeDef?.coerce && (s.port.value = s.typeDef.coerce(s.port.value), c("valueChange", s.port));
860
869
  }
861
870
  return (t, a) => (p(), i("div", {
@@ -870,18 +879,18 @@ var lt = ["title"], ut = {
870
879
  class: l(["socket", { multi: e.port.multi }]),
871
880
  style: u({ background: e.color }),
872
881
  title: e.port.multi ? `${e.port.name} (accepts many)` : e.port.name,
873
- onPointerdown: w(d, ["stop"])
874
- }, null, 46, lt)) : r("", !0),
875
- x.value ? (p(), n(Ze, {
876
- key: 1,
882
+ onPointerdown: T(d, ["stop"])
883
+ }, null, 46, ut)) : r("", !0),
884
+ x.value ? (p(), n(Qe, {
885
+ key: `${e.port.id}-${e.port.type}`,
877
886
  port: e.port,
878
887
  "type-def": e.typeDef,
879
888
  "effective-widget": m.value,
880
- mode: ee.value,
889
+ mode: S.value,
881
890
  "display-value": e.displayValue,
882
891
  placeholder: h.value,
883
- "onUpdate:value": S,
884
- onCommit: C
892
+ "onUpdate:value": C,
893
+ onCommit: w
885
894
  }, null, 8, [
886
895
  "port",
887
896
  "type-def",
@@ -889,22 +898,22 @@ var lt = ["title"], ut = {
889
898
  "mode",
890
899
  "display-value",
891
900
  "placeholder"
892
- ])) : (p(), i("span", ut, v(e.port.name), 1)),
901
+ ])) : (p(), i("span", dt, v(e.port.name), 1)),
893
902
  e.side === "out" ? (p(), i("span", {
894
903
  key: 3,
895
904
  class: "socket",
896
905
  style: u({ background: e.color }),
897
- onPointerdown: w(d, ["stop"])
906
+ onPointerdown: T(d, ["stop"])
898
907
  }, null, 36)) : r("", !0)
899
908
  ], 6));
900
909
  }
901
- }), [["__scopeId", "data-v-28eb3da7"]]), ft = ["title"], pt = { class: "title" }, mt = {
910
+ }), [["__scopeId", "data-v-88269100"]]), pt = ["title"], mt = { class: "title" }, ht = {
902
911
  class: "grip",
903
912
  title: "Drag"
904
- }, ht = { class: "body" }, gt = {
913
+ }, gt = { class: "body" }, _t = {
905
914
  key: 0,
906
915
  class: "col input"
907
- }, _t = 4, vt = /*#__PURE__*/ Z(/* @__PURE__ */ s({
916
+ }, vt = 4, yt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
908
917
  __name: "GraphNode",
909
918
  props: {
910
919
  node: {},
@@ -929,8 +938,8 @@ var lt = ["title"], ut = {
929
938
  ],
930
939
  setup(o, { emit: s }) {
931
940
  b((e) => ({
932
- v50d21574: d,
933
- v691ebaeb: f
941
+ v8ff1e59c: d,
942
+ v5f589aae: f
934
943
  }));
935
944
  let d = "11px", f = "6px", m = o, g = s;
936
945
  function _(e, t) {
@@ -940,36 +949,36 @@ var lt = ["title"], ut = {
940
949
  }, e, t);
941
950
  }
942
951
  function x(e) {
943
- e.userOnly && A(m.map, m.node);
944
- }
945
- function ee(e) {
946
- e.stopPropagation(), me(m.node) && g("drillIn", m.node.id);
952
+ e.userOnly && j(m.map, m.node);
947
953
  }
948
954
  function S(e) {
955
+ e.stopPropagation(), pe(m.node) && g("drillIn", m.node.id);
956
+ }
957
+ function C(e) {
949
958
  e.button === 0 && (e.stopPropagation(), g("select", m.node.id, e.shiftKey));
950
959
  }
951
- let C = t(() => m.map.nodeTypes[m.node.typeId]), w = t(() => m.node.label || C.value?.displayName || m.node.typeId), T = t(() => m.node.color ?? C.value?.color ?? "#3a3f4b"), E = t(() => tt(m.node)), D = t(() => Object.values(m.node.inputs)), O = t(() => Object.values(m.node.outputs)), k = t(() => m.ioWidgets && m.node.typeId === "io/input"), j = t(() => {
960
+ let w = t(() => m.map.nodeTypes[m.node.typeId]), T = t(() => m.node.label || w.value?.displayName || m.node.typeId), E = t(() => m.node.color ?? w.value?.color ?? "#3a3f4b"), D = t(() => nt(m.node)), O = t(() => Object.values(m.node.inputs)), k = t(() => Object.values(m.node.outputs)), A = t(() => m.ioWidgets && m.node.typeId === "io/input"), M = t(() => {
952
961
  let e = /* @__PURE__ */ new Set();
953
962
  for (let t of m.map.graph.connections) t.to.node === m.node.id && e.add(t.to.port);
954
963
  return e;
955
964
  });
956
- function M(e) {
965
+ function N(e) {
957
966
  return m.map.types[e]?.color ?? "#888";
958
967
  }
959
- function N(e) {
968
+ function P(e) {
960
969
  return m.map.types[e.type];
961
970
  }
962
- let P = (e) => m.map.types[e.type], F = t(() => nt(m.node, P));
963
- function I(e) {
971
+ let F = (e) => m.map.types[e.type], I = t(() => rt(m.node, F));
972
+ function L(e) {
964
973
  return m.ioWidgets ? m.node.typeId === "io/input" && e === "out" ? "editable" : m.node.typeId === "io/output" && e === "in" ? "readonly" : "auto" : "auto";
965
974
  }
966
- function L(e) {
975
+ function R(e) {
967
976
  if (e.button !== 0) return;
968
977
  e.stopPropagation();
969
978
  let t = e.clientX, n = e.clientY, r = e.shiftKey, i = m.zoom, a = !1, o = null;
970
979
  async function s() {
971
980
  !r && !m.selectedIds?.has(m.node.id) && (g("select", m.node.id, !1), await c());
972
- let e = m.selectedIds ?? new Set([m.node.id]);
981
+ let e = m.selectedIds ?? /* @__PURE__ */ new Set([m.node.id]);
973
982
  o = (e.size > 1 && e.has(m.node.id) ? m.map.graph.nodes.filter((t) => e.has(t.id)) : [m.node]).map((e) => ({
974
983
  node: e,
975
984
  x: e.location.x,
@@ -979,7 +988,7 @@ var lt = ["title"], ut = {
979
988
  function l(e) {
980
989
  if (!a) {
981
990
  let r = e.clientX - t, i = e.clientY - n;
982
- if (Math.hypot(r, i) < _t) return;
991
+ if (Math.hypot(r, i) < vt) return;
983
992
  a = !0, s();
984
993
  return;
985
994
  }
@@ -1000,37 +1009,37 @@ var lt = ["title"], ut = {
1000
1009
  style: u({
1001
1010
  left: o.node.location.x + "px",
1002
1011
  top: o.node.location.y + "px",
1003
- width: E.value + "px",
1004
- height: F.value + "px",
1012
+ width: D.value + "px",
1013
+ height: I.value + "px",
1005
1014
  zIndex: o.node.z ?? 0
1006
1015
  }),
1007
- onPointerdown: S
1016
+ onPointerdown: C
1008
1017
  }, [
1009
1018
  o.error ? (p(), i("div", {
1010
1019
  key: 0,
1011
1020
  class: "error-ring",
1012
1021
  title: o.error
1013
- }, null, 8, ft)) : r("", !0),
1022
+ }, null, 8, pt)) : r("", !0),
1014
1023
  a("div", {
1015
1024
  class: "header",
1016
1025
  style: u({
1017
- background: T.value,
1026
+ background: E.value,
1018
1027
  height: y(20) + "px"
1019
1028
  }),
1020
- onPointerdown: L,
1021
- onDblclick: ee
1022
- }, [a("span", pt, v(w.value), 1), a("div", mt, [(p(), i(e, null, h(6, (e) => a("span", {
1029
+ onPointerdown: R,
1030
+ onDblclick: S
1031
+ }, [a("span", mt, v(T.value), 1), a("div", ht, [(p(), i(e, null, h(6, (e) => a("span", {
1023
1032
  key: e,
1024
1033
  class: "dot"
1025
1034
  })), 64))])], 36),
1026
- a("div", ht, [D.value.length ? (p(), i("div", gt, [(p(!0), i(e, null, h(D.value, (e) => (p(), n(dt, {
1035
+ a("div", gt, [O.value.length ? (p(), i("div", _t, [(p(!0), i(e, null, h(O.value, (e) => (p(), n(ft, {
1027
1036
  key: e.id,
1028
1037
  port: e,
1029
- "type-def": N(e),
1030
- color: M(e.type),
1038
+ "type-def": P(e),
1039
+ color: N(e.type),
1031
1040
  side: "in",
1032
- connected: j.value.has(e.id),
1033
- "widget-mode": I("in"),
1041
+ connected: M.value.has(e.id),
1042
+ "widget-mode": L("in"),
1034
1043
  "display-value": o.ioResults?.[e.name],
1035
1044
  onConnectStart: _,
1036
1045
  onValueChange: x
@@ -1041,16 +1050,16 @@ var lt = ["title"], ut = {
1041
1050
  "connected",
1042
1051
  "widget-mode",
1043
1052
  "display-value"
1044
- ]))), 128))])) : r("", !0), O.value.length ? (p(), i("div", {
1053
+ ]))), 128))])) : r("", !0), k.value.length ? (p(), i("div", {
1045
1054
  key: 1,
1046
- class: l(["col output", { wide: k.value }])
1047
- }, [(p(!0), i(e, null, h(O.value, (e) => (p(), n(dt, {
1048
- key: e.id,
1055
+ class: l(["col output", { wide: A.value }])
1056
+ }, [(p(!0), i(e, null, h(k.value, (e) => (p(), n(ft, {
1057
+ key: `${e.id}-${e.type}`,
1049
1058
  port: e,
1050
- "type-def": N(e),
1051
- color: M(e.type),
1059
+ "type-def": P(e),
1060
+ color: N(e.type),
1052
1061
  side: "out",
1053
- "widget-mode": I("out"),
1062
+ "widget-mode": L("out"),
1054
1063
  onConnectStart: _
1055
1064
  }, null, 8, [
1056
1065
  "port",
@@ -1060,7 +1069,7 @@ var lt = ["title"], ut = {
1060
1069
  ]))), 128))], 2)) : r("", !0)])
1061
1070
  ], 38));
1062
1071
  }
1063
- }), [["__scopeId", "data-v-4f4ae398"]]), yt = { class: "wires" }, bt = ["d"], xt = ["d"], St = ["d"], Ct = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1072
+ }), [["__scopeId", "data-v-24b182cb"]]), bt = { class: "wires" }, xt = ["d"], St = ["d"], Ct = ["d"], wt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1064
1073
  __name: "WireLayer",
1065
1074
  props: {
1066
1075
  map: {},
@@ -1075,30 +1084,30 @@ var lt = ["title"], ut = {
1075
1084
  }), c = t(() => a.map.graph.connections.map((e) => {
1076
1085
  let t = s.value[e.from.node], n = s.value[e.to.node];
1077
1086
  if (!t || !n) return null;
1078
- let r = it(t, e.from.port, o), i = it(n, e.to.port, o);
1087
+ let r = at(t, e.from.port, o), i = at(n, e.to.port, o);
1079
1088
  return !r || !i ? null : {
1080
1089
  id: e.id,
1081
- d: ot(r, i)
1090
+ d: st(r, i)
1082
1091
  };
1083
1092
  }).filter((e) => e !== null));
1084
- return (t, a) => (p(), i("svg", yt, [
1093
+ return (t, a) => (p(), i("svg", bt, [
1085
1094
  (p(!0), i(e, null, h(c.value, (e) => (p(), i("path", {
1086
1095
  key: e.id,
1087
1096
  d: e.d
1088
- }, null, 8, bt))), 128)),
1097
+ }, null, 8, xt))), 128)),
1089
1098
  n.pendingPath ? (p(), i("path", {
1090
1099
  key: 0,
1091
1100
  class: "pending",
1092
1101
  d: n.pendingPath
1093
- }, null, 8, xt)) : r("", !0),
1102
+ }, null, 8, St)) : r("", !0),
1094
1103
  n.slicePath ? (p(), i("path", {
1095
1104
  key: 1,
1096
1105
  class: "slice",
1097
1106
  d: n.slicePath
1098
- }, null, 8, St)) : r("", !0)
1107
+ }, null, 8, Ct)) : r("", !0)
1099
1108
  ]));
1100
1109
  }
1101
- }), [["__scopeId", "data-v-682ffd13"]]), wt = { class: "inspector-section-header" }, Tt = { class: "inspector-section-title" }, Et = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1110
+ }), [["__scopeId", "data-v-682ffd13"]]), Tt = { class: "inspector-section-header" }, Et = { class: "inspector-section-title" }, Dt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1102
1111
  __name: "InspectorSection",
1103
1112
  props: {
1104
1113
  title: {},
@@ -1108,25 +1117,25 @@ var lt = ["title"], ut = {
1108
1117
  }
1109
1118
  },
1110
1119
  setup(e) {
1111
- return (t, n) => (p(), i("div", { class: l(["inspector-section", { divided: e.divided }]) }, [a("div", wt, [a("span", Tt, v(e.title), 1), g(t.$slots, "actions", {}, void 0, !0)]), g(t.$slots, "default", {}, void 0, !0)], 2));
1120
+ return (t, n) => (p(), i("div", { class: l(["inspector-section", { divided: e.divided }]) }, [a("div", Tt, [a("span", Et, v(e.title), 1), g(t.$slots, "actions", {}, void 0, !0)]), g(t.$slots, "default", {}, void 0, !0)], 2));
1112
1121
  }
1113
- }), [["__scopeId", "data-v-5e38007a"]]), Dt = {
1122
+ }), [["__scopeId", "data-v-5e38007a"]]), Ot = {
1114
1123
  key: 0,
1115
1124
  class: "iface-grid iface-head",
1116
1125
  "aria-hidden": "true"
1117
- }, Ot = {
1126
+ }, kt = {
1118
1127
  key: 1,
1119
1128
  class: "iface-rows"
1120
- }, kt = { class: "iface-grid iface-row" }, At = ["value", "onChange"], jt = ["value", "onChange"], Mt = ["value"], Nt = ["onClick"], Pt = {
1129
+ }, At = { class: "iface-grid iface-row" }, jt = ["value", "onChange"], Mt = ["value", "onChange"], Nt = ["value"], Pt = ["onClick"], Ft = {
1121
1130
  key: 0,
1122
1131
  class: "iface-default-row"
1123
- }, Ft = {
1132
+ }, It = {
1124
1133
  key: 2,
1125
1134
  class: "iface-empty"
1126
- }, It = {
1135
+ }, Lt = {
1127
1136
  key: 3,
1128
1137
  class: "iface-error"
1129
- }, Lt = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1138
+ }, Rt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1130
1139
  __name: "GraphInterfacePanel",
1131
1140
  props: {
1132
1141
  graphInterface: {},
@@ -1137,63 +1146,63 @@ var lt = ["title"], ut = {
1137
1146
  commitError: {},
1138
1147
  applyMutation: { type: Function }
1139
1148
  },
1140
- setup(s) {
1141
- let c = s, l = m(""), u = m({}), d = t(() => c.commitError || l.value || ""), f = t(() => c.mode === "parameters" ? "Graph inputs" : "Graph outputs"), g = t(() => c.mode === "parameters"), _ = t(() => {
1142
- let e = g.value ? c.graphInterface.parameters : c.graphInterface.returns;
1149
+ setup(o) {
1150
+ let s = o, c = m(""), l = m({}), u = t(() => s.commitError || c.value || ""), d = t(() => s.mode === "parameters" ? "Graph inputs" : "Graph outputs"), f = t(() => s.mode === "parameters"), g = t(() => {
1151
+ let e = f.value ? s.graphInterface.parameters : s.graphInterface.returns;
1143
1152
  return Object.entries(e ?? {}).map(([e, t]) => ({
1144
1153
  name: e,
1145
1154
  spec: t
1146
1155
  }));
1147
1156
  });
1148
- function b(e) {
1149
- return c.types[e]?.defaultValue;
1157
+ function _(e) {
1158
+ return s.types[e]?.defaultValue;
1150
1159
  }
1151
- function x(e, t) {
1152
- return t.defaultValue === void 0 ? b(t.type) : t.defaultValue;
1160
+ function y(e, t) {
1161
+ return t.defaultValue === void 0 ? _(t.type) : t.defaultValue;
1153
1162
  }
1154
- function C() {
1155
- if (!g.value) {
1156
- u.value = {};
1163
+ function b() {
1164
+ if (!f.value) {
1165
+ l.value = {};
1157
1166
  return;
1158
1167
  }
1159
1168
  let e = {};
1160
- for (let { name: t, spec: n } of _.value) e[t] = x(t, n);
1161
- u.value = e;
1169
+ for (let { name: t, spec: n } of g.value) e[t] = y(t, n);
1170
+ l.value = e;
1162
1171
  }
1163
- ee(() => c.revision, () => {
1164
- l.value = "", C();
1165
- }), ee(g, C, { immediate: !0 });
1166
- function T(e) {
1167
- l.value = "";
1172
+ S(() => s.revision, () => {
1173
+ c.value = "", b();
1174
+ }), S(f, b, { immediate: !0 });
1175
+ function x(e) {
1176
+ c.value = "";
1168
1177
  try {
1169
- let t = c.applyMutation(e);
1170
- t.length && (l.value = t[0] ?? "Unknown error");
1178
+ let t = s.applyMutation(e);
1179
+ t.length && (c.value = t[0] ?? "Unknown error");
1171
1180
  } catch (e) {
1172
- l.value = e instanceof Error ? e.message : String(e);
1181
+ c.value = e instanceof Error ? e.message : String(e);
1173
1182
  }
1174
1183
  }
1175
- function E(e, t) {
1184
+ function w(e, t) {
1176
1185
  return {
1177
1186
  id: `iface-default-${e}`,
1178
1187
  name: e,
1179
1188
  type: t.type,
1180
1189
  direction: "input",
1181
- value: u.value[e] ?? x(e, t)
1190
+ value: l.value[e] ?? y(e, t)
1182
1191
  };
1183
1192
  }
1184
- function D(e, t) {
1185
- u.value = {
1186
- ...u.value,
1193
+ function E(e, t) {
1194
+ l.value = {
1195
+ ...l.value,
1187
1196
  [e]: t
1188
1197
  };
1189
1198
  }
1190
- function O(e) {
1191
- if (!c.graphInterface.parameters?.[e]) return;
1192
- let t = u.value[e];
1193
- T((n) => {
1199
+ function D(e) {
1200
+ if (!s.graphInterface.parameters?.[e]) return;
1201
+ let t = l.value[e];
1202
+ x((n) => {
1194
1203
  let r = n.parameters?.[e];
1195
1204
  if (!r) return;
1196
- let i = c.types[r.type], a = i?.coerce?.(t) ?? (i?.validate(t) ? t : x(e, r));
1205
+ let i = s.types[r.type], a = i?.coerce?.(t) ?? (i?.validate(t) ? t : y(e, r));
1197
1206
  n.parameters = {
1198
1207
  ...n.parameters,
1199
1208
  [e]: {
@@ -1203,19 +1212,19 @@ var lt = ["title"], ut = {
1203
1212
  };
1204
1213
  });
1205
1214
  }
1206
- function k() {
1207
- T((e) => {
1208
- let t = g.value ? e.parameters : e.returns, n = new Set(Object.keys(t ?? {})), r = g.value ? "input" : "output";
1215
+ function O() {
1216
+ x((e) => {
1217
+ let t = f.value ? e.parameters : e.returns, n = new Set(Object.keys(t ?? {})), r = f.value ? "input" : "output";
1209
1218
  if (n.has(r)) {
1210
1219
  let e = 2;
1211
1220
  for (; n.has(`${r}${e}`);) e++;
1212
1221
  r = `${r}${e}`;
1213
1222
  }
1214
- let i = c.typeIds[0] ?? "number", a = g.value ? {
1223
+ let i = s.typeIds[0] ?? "number", a = f.value ? {
1215
1224
  type: i,
1216
- defaultValue: b(i)
1225
+ defaultValue: _(i)
1217
1226
  } : { type: i };
1218
- g.value ? e.parameters = {
1227
+ f.value ? e.parameters = {
1219
1228
  ...e.parameters,
1220
1229
  [r]: a
1221
1230
  } : e.returns = {
@@ -1224,9 +1233,9 @@ var lt = ["title"], ut = {
1224
1233
  };
1225
1234
  });
1226
1235
  }
1227
- function A(e) {
1228
- T((t) => {
1229
- if (g.value) {
1236
+ function k(e) {
1237
+ x((t) => {
1238
+ if (f.value) {
1230
1239
  if (!t.parameters) return;
1231
1240
  let { [e]: n, ...r } = t.parameters;
1232
1241
  t.parameters = Object.keys(r).length ? r : void 0;
@@ -1237,14 +1246,14 @@ var lt = ["title"], ut = {
1237
1246
  }
1238
1247
  });
1239
1248
  }
1240
- function j(e, t) {
1241
- if (!t || !te.test(t)) {
1242
- l.value = `Invalid port name "${t}"`;
1249
+ function A(e, t) {
1250
+ if (!t || !ee.test(t)) {
1251
+ c.value = `Invalid port name "${t}"`;
1243
1252
  return;
1244
1253
  }
1245
- e !== t && T((n) => {
1246
- let r = (g.value ? n.parameters : n.returns)?.[e];
1247
- if (r) if (g.value) {
1254
+ e !== t && x((n) => {
1255
+ let r = (f.value ? n.parameters : n.returns)?.[e];
1256
+ if (r) if (f.value) {
1248
1257
  let { [e]: i, ...a } = n.parameters ?? {};
1249
1258
  n.parameters = {
1250
1259
  ...a,
@@ -1259,14 +1268,14 @@ var lt = ["title"], ut = {
1259
1268
  }
1260
1269
  });
1261
1270
  }
1262
- function M(e, t) {
1263
- T((n) => {
1264
- if (g.value) {
1271
+ function j(e, t) {
1272
+ x((n) => {
1273
+ if (f.value) {
1265
1274
  let r = n.parameters?.[e];
1266
1275
  if (!r) return;
1267
- let i = b(t);
1268
- u.value = {
1269
- ...u.value,
1276
+ let i = _(t);
1277
+ l.value = {
1278
+ ...l.value,
1270
1279
  [e]: i
1271
1280
  }, n.parameters = {
1272
1281
  ...n.parameters,
@@ -1289,73 +1298,72 @@ var lt = ["title"], ut = {
1289
1298
  }
1290
1299
  });
1291
1300
  }
1292
- return (t, c) => (p(), n(Et, { title: f.value }, {
1293
- actions: S(() => [a("button", {
1301
+ return (t, s) => (p(), n(Dt, { title: d.value }, {
1302
+ actions: C(() => [a("button", {
1294
1303
  class: "inspector-icon-btn",
1295
1304
  type: "button",
1296
1305
  title: "Add port",
1297
- onClick: w(k, ["stop", "prevent"])
1306
+ onClick: T(O, ["stop", "prevent"])
1298
1307
  }, " + ")]),
1299
- default: S(() => [
1300
- _.value.length ? (p(), i("div", Dt, [...c[0] ||= [
1308
+ default: C(() => [
1309
+ g.value.length ? (p(), i("div", Ot, [...s[0] ||= [
1301
1310
  a("span", null, "Name", -1),
1302
1311
  a("span", null, "Type", -1),
1303
1312
  a("span", null, null, -1)
1304
1313
  ]])) : r("", !0),
1305
- _.value.length ? (p(), i("div", Ot, [(p(!0), i(e, null, h(_.value, (t) => (p(), i("div", {
1314
+ g.value.length ? (p(), i("div", kt, [(p(!0), i(e, null, h(g.value, (t) => (p(), i("div", {
1306
1315
  key: t.name,
1307
1316
  class: "iface-entry"
1308
- }, [a("div", kt, [
1317
+ }, [a("div", At, [
1309
1318
  a("input", {
1310
1319
  class: "iface-field iface-name",
1311
1320
  type: "text",
1312
1321
  value: t.name,
1313
- onChange: (e) => j(t.name, e.target.value.trim())
1314
- }, null, 40, At),
1322
+ onChange: (e) => A(t.name, e.target.value.trim())
1323
+ }, null, 40, jt),
1315
1324
  a("select", {
1316
1325
  class: "iface-field iface-select",
1317
1326
  value: t.spec.type,
1318
- onChange: (e) => M(t.name, e.target.value)
1319
- }, [(p(!0), i(e, null, h(s.typeIds, (e) => (p(), i("option", {
1327
+ onChange: (e) => j(t.name, e.target.value)
1328
+ }, [(p(!0), i(e, null, h(o.typeIds, (e) => (p(), i("option", {
1320
1329
  key: e,
1321
1330
  value: e
1322
- }, v(e), 9, Mt))), 128))], 40, jt),
1331
+ }, v(e), 9, Nt))), 128))], 40, Mt),
1323
1332
  a("button", {
1324
1333
  class: "iface-remove",
1325
1334
  type: "button",
1326
1335
  title: "Remove port",
1327
- onClick: w((e) => A(t.name), ["stop", "prevent"])
1328
- }, " × ", 8, Nt)
1329
- ]), g.value ? (p(), i("div", Pt, [c[1] ||= a("span", { class: "iface-default-label" }, "Default", -1), o(Ze, {
1336
+ onClick: T((e) => k(t.name), ["stop", "prevent"])
1337
+ }, " × ", 8, Pt)
1338
+ ]), f.value ? (p(), i("div", Ft, [s[1] ||= a("span", { class: "iface-default-label" }, "Default", -1), (p(), n(Qe, {
1339
+ key: `${t.name}-${t.spec.type}`,
1330
1340
  class: "iface-default-widget",
1331
- port: E(t.name, t.spec),
1332
- "type-def": s.types[t.spec.type],
1333
- "effective-widget": y(Le)(s.types[t.spec.type], E(t.name, t.spec)),
1341
+ port: w(t.name, t.spec),
1342
+ "type-def": o.types[t.spec.type],
1334
1343
  mode: "editable",
1335
1344
  placeholder: t.name,
1336
- "onUpdate:value": (e) => D(t.name, e),
1337
- onCommit: (e) => O(t.name)
1345
+ "onUpdate:value": (e) => E(t.name, e),
1346
+ onCommit: (e) => D(t.name)
1338
1347
  }, null, 8, [
1339
1348
  "port",
1340
1349
  "type-def",
1341
- "effective-widget",
1342
1350
  "placeholder",
1343
1351
  "onUpdate:value",
1344
1352
  "onCommit"
1345
- ])])) : r("", !0)]))), 128))])) : (p(), i("div", Ft, "No ports")),
1346
- d.value ? (p(), i("p", It, v(d.value), 1)) : r("", !0)
1353
+ ]))])) : r("", !0)]))), 128))])) : (p(), i("div", It, "No ports")),
1354
+ u.value ? (p(), i("p", Lt, v(u.value), 1)) : r("", !0)
1347
1355
  ]),
1348
1356
  _: 1
1349
1357
  }, 8, ["title"]));
1350
1358
  }
1351
- }), [["__scopeId", "data-v-e5bdc707"]]), Rt = {
1359
+ }), [["__scopeId", "data-v-8f895443"]]), zt = {
1352
1360
  key: 0,
1353
1361
  class: "inspector-title static"
1354
- }, zt = [
1362
+ }, Bt = [
1355
1363
  "value",
1356
1364
  "placeholder",
1357
1365
  "title"
1358
- ], Bt = { class: "inspector-header-actions" }, Vt = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1366
+ ], Vt = { class: "inspector-header-actions" }, Ht = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1359
1367
  __name: "InspectorPanel",
1360
1368
  props: {
1361
1369
  title: {},
@@ -1392,7 +1400,7 @@ var lt = ["title"], ut = {
1392
1400
  return (t, o) => (p(), i("div", { class: l(["inspector-panel", { fill: e.fill }]) }, [a("div", {
1393
1401
  class: "inspector-header",
1394
1402
  style: u({ background: e.headerColor })
1395
- }, [g(t.$slots, "title", {}, () => [e.staticTitle ? (p(), i("span", Rt, v(e.title), 1)) : (p(), i("input", {
1403
+ }, [g(t.$slots, "title", {}, () => [e.staticTitle ? (p(), i("span", zt, v(e.title), 1)) : (p(), i("input", {
1396
1404
  key: 1,
1397
1405
  class: "inspector-title",
1398
1406
  type: "text",
@@ -1400,7 +1408,7 @@ var lt = ["title"], ut = {
1400
1408
  placeholder: e.titlePlaceholder,
1401
1409
  title: e.title,
1402
1410
  onInput: d
1403
- }, null, 40, zt))], !0), a("div", Bt, [g(t.$slots, "header-actions", {}, void 0, !0), e.showUp ? (p(), i("button", {
1411
+ }, null, 40, Bt))], !0), a("div", Vt, [g(t.$slots, "header-actions", {}, void 0, !0), e.showUp ? (p(), i("button", {
1404
1412
  key: 0,
1405
1413
  class: "inspector-icon-btn",
1406
1414
  type: "button",
@@ -1408,7 +1416,7 @@ var lt = ["title"], ut = {
1408
1416
  onClick: o[0] ||= (e) => n("up")
1409
1417
  }, " ↩ ")) : r("", !0)])], 4), a("div", { class: l(["inspector-body", { flush: e.flush }]) }, [g(t.$slots, "default", {}, void 0, !0)], 2)], 2));
1410
1418
  }
1411
- }), [["__scopeId", "data-v-78844099"]]), Ht = { class: "inspector-row" }, Ut = { class: "inspector-key" }, Wt = ["value"], Gt = /* @__PURE__ */ s({
1419
+ }), [["__scopeId", "data-v-78844099"]]), Ut = { class: "inspector-row" }, Wt = { class: "inspector-key" }, Gt = ["value"], Kt = /* @__PURE__ */ s({
1412
1420
  __name: "InspectorColorField",
1413
1421
  props: {
1414
1422
  modelValue: {},
@@ -1420,20 +1428,20 @@ var lt = ["title"], ut = {
1420
1428
  function r(e) {
1421
1429
  n("update:modelValue", e.target.value);
1422
1430
  }
1423
- return (t, n) => (p(), i("label", Ht, [a("span", Ut, v(e.label), 1), a("input", {
1431
+ return (t, n) => (p(), i("label", Ut, [a("span", Wt, v(e.label), 1), a("input", {
1424
1432
  class: "inspector-swatch",
1425
1433
  type: "color",
1426
1434
  value: e.modelValue,
1427
1435
  onInput: r
1428
- }, null, 40, Wt)]));
1436
+ }, null, 40, Gt)]));
1429
1437
  }
1430
- }), Kt = { class: "inspector-error" }, qt = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1438
+ }), qt = { class: "inspector-error" }, Jt = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1431
1439
  __name: "InspectorError",
1432
1440
  props: { message: {} },
1433
1441
  setup(e) {
1434
- return (t, n) => (p(), i("p", Kt, v(e.message), 1));
1442
+ return (t, n) => (p(), i("p", qt, v(e.message), 1));
1435
1443
  }
1436
- }), [["__scopeId", "data-v-a863f513"]]), Jt = { class: "inspector-row pair" }, Yt = ["value"], Xt = ["value"], Zt = /* @__PURE__ */ s({
1444
+ }), [["__scopeId", "data-v-a863f513"]]), Yt = { class: "inspector-row pair" }, Xt = ["value"], Zt = ["value"], Qt = /* @__PURE__ */ s({
1437
1445
  __name: "InspectorPositionField",
1438
1446
  props: {
1439
1447
  x: {},
@@ -1445,23 +1453,23 @@ var lt = ["title"], ut = {
1445
1453
  function r(e) {
1446
1454
  return Number(e.target.value);
1447
1455
  }
1448
- return (t, o) => (p(), i("div", Jt, [a("label", null, [o[2] ||= a("span", { class: "inspector-key" }, "X", -1), a("input", {
1456
+ return (t, o) => (p(), i("div", Yt, [a("label", null, [o[2] ||= a("span", { class: "inspector-key" }, "X", -1), a("input", {
1449
1457
  class: "inspector-field",
1450
1458
  type: "number",
1451
1459
  value: e.x,
1452
1460
  onInput: o[0] ||= (e) => n("update:x", r(e))
1453
- }, null, 40, Yt)]), a("label", null, [o[3] ||= a("span", { class: "inspector-key" }, "Y", -1), a("input", {
1461
+ }, null, 40, Xt)]), a("label", null, [o[3] ||= a("span", { class: "inspector-key" }, "Y", -1), a("input", {
1454
1462
  class: "inspector-field",
1455
1463
  type: "number",
1456
1464
  value: e.y,
1457
1465
  onInput: o[1] ||= (e) => n("update:y", r(e))
1458
- }, null, 40, Xt)])]));
1466
+ }, null, 40, Zt)])]));
1459
1467
  }
1460
- }), Qt = { class: "inspector-row" }, $t = [
1468
+ }), $t = { class: "inspector-row" }, en = [
1461
1469
  "min",
1462
1470
  "max",
1463
1471
  "value"
1464
- ], en = { class: "inspector-slider-value" }, tn = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1472
+ ], tn = { class: "inspector-slider-value" }, nn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1465
1473
  __name: "InspectorWidthField",
1466
1474
  props: {
1467
1475
  modelValue: {},
@@ -1475,7 +1483,7 @@ var lt = ["title"], ut = {
1475
1483
  function r(e) {
1476
1484
  n("update:modelValue", Number(e.target.value));
1477
1485
  }
1478
- return (t, n) => (p(), i("label", Qt, [
1486
+ return (t, n) => (p(), i("label", $t, [
1479
1487
  n[0] ||= a("span", { class: "inspector-key" }, "Width", -1),
1480
1488
  a("input", {
1481
1489
  class: "inspector-slider",
@@ -1486,11 +1494,11 @@ var lt = ["title"], ut = {
1486
1494
  value: e.modelValue,
1487
1495
  style: u({ accentColor: e.accentColor }),
1488
1496
  onInput: r
1489
- }, null, 44, $t),
1490
- a("span", en, v(e.modelValue), 1)
1497
+ }, null, 44, en),
1498
+ a("span", tn, v(e.modelValue), 1)
1491
1499
  ]));
1492
1500
  }
1493
- }), [["__scopeId", "data-v-472135f4"]]), nn = "#3a3f4b", rn = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1501
+ }), [["__scopeId", "data-v-472135f4"]]), rn = "#3a3f4b", an = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1494
1502
  __name: "NodePanel",
1495
1503
  props: {
1496
1504
  map: {},
@@ -1528,57 +1536,57 @@ var lt = ["title"], ut = {
1528
1536
  let t = l.value;
1529
1537
  t && (t.color = e);
1530
1538
  }
1531
- function ee(e) {
1539
+ function S(e) {
1532
1540
  let t = l.value;
1533
1541
  t && (t.width = e);
1534
1542
  }
1535
- function C(e) {
1543
+ function w(e) {
1536
1544
  let t = e - _.value;
1537
1545
  for (let e of a.nodes) e.location.x += t;
1538
1546
  }
1539
- function w(e) {
1547
+ function T(e) {
1540
1548
  let t = e - v.value;
1541
1549
  for (let e of a.nodes) e.location.y += t;
1542
1550
  }
1543
- return (t, i) => l.value ? (p(), n(Vt, {
1551
+ return (t, i) => l.value ? (p(), n(Ht, {
1544
1552
  key: 0,
1545
1553
  class: "node-panel",
1546
1554
  title: m.value,
1547
1555
  "title-placeholder": f.value,
1548
- "header-color": nn,
1556
+ "header-color": rn,
1549
1557
  "static-title": c.value,
1550
1558
  "onUpdate:title": b
1551
1559
  }, {
1552
- default: S(() => [
1553
- c.value ? r("", !0) : (p(), n(Gt, {
1560
+ default: C(() => [
1561
+ c.value ? r("", !0) : (p(), n(Kt, {
1554
1562
  key: 0,
1555
1563
  "model-value": h.value,
1556
1564
  "onUpdate:modelValue": x
1557
1565
  }, null, 8, ["model-value"])),
1558
- o(Zt, {
1566
+ o(Qt, {
1559
1567
  x: _.value,
1560
1568
  y: v.value,
1561
- "onUpdate:x": C,
1562
- "onUpdate:y": w
1569
+ "onUpdate:x": w,
1570
+ "onUpdate:y": T
1563
1571
  }, null, 8, ["x", "y"]),
1564
- c.value ? r("", !0) : (p(), n(tn, {
1572
+ c.value ? r("", !0) : (p(), n(nn, {
1565
1573
  key: 1,
1566
1574
  "model-value": g.value,
1567
1575
  min: y(60),
1568
1576
  max: y(320),
1569
1577
  "accent-color": h.value,
1570
- "onUpdate:modelValue": ee
1578
+ "onUpdate:modelValue": S
1571
1579
  }, null, 8, [
1572
1580
  "model-value",
1573
1581
  "min",
1574
1582
  "max",
1575
1583
  "accent-color"
1576
1584
  ])),
1577
- e.error && !c.value ? (p(), n(qt, {
1585
+ e.error && !c.value ? (p(), n(Jt, {
1578
1586
  key: 2,
1579
1587
  message: e.error
1580
1588
  }, null, 8, ["message"])) : r("", !0),
1581
- u.value ? (p(), n(Lt, {
1589
+ u.value ? (p(), n(Rt, {
1582
1590
  key: 3,
1583
1591
  "graph-interface": e.graphInterface,
1584
1592
  mode: u.value,
@@ -1604,7 +1612,7 @@ var lt = ["title"], ut = {
1604
1612
  "static-title"
1605
1613
  ])) : r("", !0);
1606
1614
  }
1607
- }), [["__scopeId", "data-v-51945220"]]), an = { class: "inspector-row inspector-check" }, on = { class: "inspector-key" }, sn = ["checked"], cn = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1615
+ }), [["__scopeId", "data-v-51945220"]]), on = { class: "inspector-row inspector-check" }, sn = { class: "inspector-key" }, cn = ["checked"], ln = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1608
1616
  __name: "InspectorCheckboxField",
1609
1617
  props: {
1610
1618
  modelValue: { type: Boolean },
@@ -1616,13 +1624,13 @@ var lt = ["title"], ut = {
1616
1624
  function r(e) {
1617
1625
  n("update:modelValue", e.target.checked);
1618
1626
  }
1619
- return (t, n) => (p(), i("label", an, [a("span", on, v(e.label), 1), a("input", {
1627
+ return (t, n) => (p(), i("label", on, [a("span", sn, v(e.label), 1), a("input", {
1620
1628
  type: "checkbox",
1621
1629
  checked: e.modelValue,
1622
1630
  onChange: r
1623
- }, null, 40, sn)]));
1631
+ }, null, 40, cn)]));
1624
1632
  }
1625
- }), [["__scopeId", "data-v-7b38cfa2"]]), ln = "#3a3f4b", un = /* @__PURE__ */ s({
1633
+ }), [["__scopeId", "data-v-7b38cfa2"]]), un = "#3a3f4b", dn = /* @__PURE__ */ s({
1626
1634
  __name: "GroupPanel",
1627
1635
  props: {
1628
1636
  composite: {},
@@ -1630,7 +1638,7 @@ var lt = ["title"], ut = {
1630
1638
  },
1631
1639
  emits: ["up", "update:ioWidgets"],
1632
1640
  setup(e, { emit: i }) {
1633
- let a = e, s = i, c = t(() => ce.displayName), l = t(() => a.composite?.label || ce.displayName), u = t(() => a.composite?.color ?? ce.color ?? ln);
1641
+ let a = e, s = i, c = t(() => se.displayName), l = t(() => a.composite?.label || se.displayName), u = t(() => a.composite?.color ?? se.color ?? un);
1634
1642
  function d(e) {
1635
1643
  let t = a.composite;
1636
1644
  t && (t.label = e);
@@ -1639,19 +1647,19 @@ var lt = ["title"], ut = {
1639
1647
  let t = a.composite;
1640
1648
  t && (t.color = e);
1641
1649
  }
1642
- return (t, i) => e.composite ? (p(), n(Vt, {
1650
+ return (t, i) => e.composite ? (p(), n(Ht, {
1643
1651
  key: 0,
1644
1652
  title: l.value,
1645
1653
  "title-placeholder": c.value,
1646
- "header-color": ln,
1654
+ "header-color": un,
1647
1655
  "show-up": "",
1648
1656
  "onUpdate:title": d,
1649
1657
  onUp: i[1] ||= (e) => s("up")
1650
1658
  }, {
1651
- default: S(() => [o(Gt, {
1659
+ default: C(() => [o(Kt, {
1652
1660
  "model-value": u.value,
1653
1661
  "onUpdate:modelValue": f
1654
- }, null, 8, ["model-value"]), o(cn, {
1662
+ }, null, 8, ["model-value"]), o(ln, {
1655
1663
  label: "IO test",
1656
1664
  "model-value": e.ioWidgets,
1657
1665
  "onUpdate:modelValue": i[0] ||= (e) => s("update:ioWidgets", e)
@@ -1662,7 +1670,7 @@ var lt = ["title"], ut = {
1662
1670
  });
1663
1671
  //#endregion
1664
1672
  //#region src/store/registry/groups.ts
1665
- function dn(e, t) {
1673
+ function fn(e, t) {
1666
1674
  return {
1667
1675
  name: e,
1668
1676
  path: t,
@@ -1670,37 +1678,37 @@ function dn(e, t) {
1670
1678
  nodes: []
1671
1679
  };
1672
1680
  }
1673
- function fn(e, t) {
1674
- let n = dn("", []);
1681
+ function pn(e, t) {
1682
+ let n = fn("", []);
1675
1683
  for (let r of Object.values(e)) {
1676
1684
  if (t && !t(r)) continue;
1677
1685
  let e = n, i = [];
1678
1686
  for (let t of r.group ?? []) {
1679
1687
  i.push(t);
1680
1688
  let n = e.subgroups.find((e) => e.name === t);
1681
- n || (n = dn(t, [...i]), e.subgroups.push(n)), e = n;
1689
+ n || (n = fn(t, [...i]), e.subgroups.push(n)), e = n;
1682
1690
  }
1683
1691
  e.nodes.push(r);
1684
1692
  }
1685
1693
  return n;
1686
1694
  }
1687
- function pn(e) {
1695
+ function mn(e) {
1688
1696
  e.subgroups.sort((e, t) => e.name.localeCompare(t.name)), e.nodes.sort((e, t) => e.displayName.localeCompare(t.displayName));
1689
- for (let t of e.subgroups) pn(t);
1697
+ for (let t of e.subgroups) mn(t);
1690
1698
  return e;
1691
1699
  }
1692
1700
  //#endregion
1693
1701
  //#region src/components/AddNodePanel.vue?vue&type=script&setup=true&lang.ts
1694
- var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n = ["title", "onClick"], vn = { class: "name" }, yn = { class: "path" }, bn = {
1702
+ var hn = ["title"], gn = { class: "picker-body" }, _n = { class: "list" }, vn = ["title", "onClick"], yn = { class: "name" }, bn = { class: "path" }, xn = {
1695
1703
  key: 0,
1696
1704
  class: "path-sep"
1697
- }, xn = { class: "path-seg" }, Sn = {
1705
+ }, Sn = { class: "path-seg" }, Cn = {
1698
1706
  key: 0,
1699
1707
  class: "empty"
1700
- }, Cn = ["onClick"], wn = { class: "name" }, Tn = ["title", "onClick"], En = { class: "name" }, Dn = {
1708
+ }, wn = ["onClick"], Tn = { class: "name" }, En = ["title", "onClick"], Dn = { class: "name" }, On = {
1701
1709
  key: 1,
1702
1710
  class: "empty"
1703
- }, On = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1711
+ }, kn = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1704
1712
  __name: "AddNodePanel",
1705
1713
  props: {
1706
1714
  map: {},
@@ -1717,125 +1725,125 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
1717
1725
  ae7fef7e: y,
1718
1726
  v113015c7: _
1719
1727
  }));
1720
- let c = n, f = s, g = "11px", _ = "6px", y = "20px", T = m(""), E = m(null);
1721
- d(() => E.value?.focus());
1722
- let D = (e) => e.typeId !== "io/input" && e.typeId !== "io/output" && e.typeId !== "composite/group", O = t(() => pn(fn(c.map.nodeTypes, D))), k = m([]), A = t(() => {
1723
- let e = O.value;
1724
- for (let t of k.value) {
1728
+ let c = n, f = s, g = "11px", _ = "6px", y = "20px", E = m(""), D = m(null);
1729
+ d(() => D.value?.focus());
1730
+ let O = (e) => e.typeId !== "io/input" && e.typeId !== "io/output" && e.typeId !== "composite/group", k = t(() => mn(pn(c.map.nodeTypes, O))), A = m([]), j = t(() => {
1731
+ let e = k.value;
1732
+ for (let t of A.value) {
1725
1733
  let n = e.subgroups.find((e) => e.name === t);
1726
1734
  if (!n) break;
1727
1735
  e = n;
1728
1736
  }
1729
1737
  return e;
1730
- }), j = t(() => k.value.length ? k.value.join(" › ") : "Add Node"), M = t(() => k.value.length ? k.value : null);
1731
- function N(e) {
1738
+ }), M = t(() => A.value.length ? A.value.join(" › ") : "Add Node"), N = t(() => A.value.length ? A.value : null);
1739
+ function P(e) {
1732
1740
  return e.group ?? [];
1733
1741
  }
1734
- function P(e) {
1735
- k.value = [...k.value, e];
1742
+ function F(e) {
1743
+ A.value = [...A.value, e];
1736
1744
  }
1737
- function F() {
1738
- k.value = k.value.slice(0, -1);
1745
+ function I() {
1746
+ A.value = A.value.slice(0, -1);
1739
1747
  }
1740
- let I = t(() => {
1741
- let e = T.value.trim().toLowerCase();
1742
- return e ? Object.values(c.map.nodeTypes).filter(D).filter((t) => t.displayName.toLowerCase().includes(e)).sort((e, t) => e.displayName.localeCompare(t.displayName)) : null;
1748
+ let L = t(() => {
1749
+ let e = E.value.trim().toLowerCase();
1750
+ return e ? Object.values(c.map.nodeTypes).filter(O).filter((t) => t.displayName.toLowerCase().includes(e)).sort((e, t) => e.displayName.localeCompare(t.displayName)) : null;
1743
1751
  });
1744
- function L(e) {
1752
+ function R(e) {
1745
1753
  f("select", e.typeId);
1746
1754
  }
1747
- let R = t(() => I.value ? I.value : A.value.nodes), z = m(0);
1748
- ee(R, () => {
1749
- z.value = 0;
1755
+ let z = t(() => L.value ? L.value : j.value.nodes), B = m(0);
1756
+ S(z, () => {
1757
+ B.value = 0;
1750
1758
  });
1751
- function te() {
1752
- let e = R.value;
1753
- e.length && L(e[z.value] ?? e[0]);
1759
+ function ee() {
1760
+ let e = z.value;
1761
+ e.length && R(e[B.value] ?? e[0]);
1754
1762
  }
1755
- function B(e) {
1756
- let t = R.value;
1757
- t.length && (e.key === "ArrowDown" ? (e.preventDefault(), z.value = (z.value + 1) % t.length) : e.key === "ArrowUp" ? (e.preventDefault(), z.value = (z.value - 1 + t.length) % t.length) : e.key === "Enter" && (e.preventDefault(), te()));
1763
+ function V(e) {
1764
+ let t = z.value;
1765
+ t.length && (e.key === "ArrowDown" ? (e.preventDefault(), B.value = (B.value + 1) % t.length) : e.key === "ArrowUp" ? (e.preventDefault(), B.value = (B.value - 1 + t.length) % t.length) : e.key === "Enter" && (e.preventDefault(), ee()));
1758
1766
  }
1759
- function V(e, t) {
1760
- z.value = t, L(e);
1767
+ function H(e, t) {
1768
+ B.value = t, R(e);
1761
1769
  }
1762
- function H(e) {
1770
+ function U(e) {
1763
1771
  e.stopPropagation(), f("close");
1764
1772
  }
1765
1773
  return (t, s) => (p(), i("div", {
1766
1774
  class: "backdrop",
1767
- onPointerdown: H,
1768
- onContextmenu: s[4] ||= w(() => {}, ["prevent"])
1775
+ onPointerdown: U,
1776
+ onContextmenu: s[4] ||= T(() => {}, ["prevent"])
1769
1777
  }, [a("div", {
1770
1778
  class: "anchor",
1771
1779
  style: u({
1772
1780
  left: n.screen.x + "px",
1773
1781
  top: n.screen.y + "px"
1774
1782
  }),
1775
- onPointerdown: s[2] ||= w(() => {}, ["stop"]),
1776
- onContextmenu: s[3] ||= w(() => {}, ["prevent"])
1777
- }, [o(Vt, {
1783
+ onPointerdown: s[2] ||= T(() => {}, ["stop"]),
1784
+ onContextmenu: s[3] ||= T(() => {}, ["prevent"])
1785
+ }, [o(Ht, {
1778
1786
  title: "Add Node",
1779
1787
  "static-title": "",
1780
1788
  fill: "",
1781
1789
  flush: ""
1782
1790
  }, {
1783
- title: S(() => [a("nav", {
1791
+ title: C(() => [a("nav", {
1784
1792
  class: "crumbs",
1785
- title: j.value
1786
- }, [a("span", { class: l(["crumb", { current: !M.value }]) }, " Add Node ", 2), M.value ? (p(!0), i(e, { key: 0 }, h(M.value, (t, n) => (p(), i(e, { key: `${n}-${t}` }, [s[5] ||= a("span", { class: "crumb-sep" }, "›", -1), a("span", { class: l(["crumb", { current: n === M.value.length - 1 }]) }, v(t), 3)], 64))), 128)) : r("", !0)], 8, mn)]),
1787
- "header-actions": S(() => [a("button", {
1793
+ title: M.value
1794
+ }, [a("span", { class: l(["crumb", { current: !N.value }]) }, " Add Node ", 2), N.value ? (p(!0), i(e, { key: 0 }, h(N.value, (t, n) => (p(), i(e, { key: `${n}-${t}` }, [s[5] ||= a("span", { class: "crumb-sep" }, "›", -1), a("span", { class: l(["crumb", { current: n === N.value.length - 1 }]) }, v(t), 3)], 64))), 128)) : r("", !0)], 8, hn)]),
1795
+ "header-actions": C(() => [a("button", {
1788
1796
  class: "inspector-icon-btn",
1789
1797
  type: "button",
1790
1798
  title: "Add composite",
1791
1799
  onClick: s[0] ||= (e) => f("addComposite")
1792
1800
  }, " + ")]),
1793
- default: S(() => [a("div", hn, [C(a("input", {
1801
+ default: C(() => [a("div", gn, [w(a("input", {
1794
1802
  ref_key: "searchEl",
1795
- ref: E,
1796
- "onUpdate:modelValue": s[1] ||= (e) => T.value = e,
1803
+ ref: D,
1804
+ "onUpdate:modelValue": s[1] ||= (e) => E.value = e,
1797
1805
  class: "search",
1798
1806
  type: "text",
1799
1807
  placeholder: "Search nodes…",
1800
- onKeydown: B
1801
- }, null, 544), [[x, T.value]]), a("div", gn, [I.value ? (p(), i(e, { key: 0 }, [(p(!0), i(e, null, h(I.value, (t, n) => (p(), i("button", {
1808
+ onKeydown: V
1809
+ }, null, 544), [[x, E.value]]), a("div", _n, [L.value ? (p(), i(e, { key: 0 }, [(p(!0), i(e, null, h(L.value, (t, n) => (p(), i("button", {
1802
1810
  key: t.typeId,
1803
- class: l(["row node", { active: n === z.value }]),
1811
+ class: l(["row node", { active: n === B.value }]),
1804
1812
  title: t.description,
1805
- onClick: (e) => V(t, n)
1813
+ onClick: (e) => H(t, n)
1806
1814
  }, [
1807
1815
  a("span", {
1808
1816
  class: "dot",
1809
1817
  style: u({ background: t.color })
1810
1818
  }, null, 4),
1811
- a("span", vn, v(t.displayName), 1),
1812
- a("span", yn, [(p(!0), i(e, null, h(N(t), (n, o) => (p(), i(e, { key: `${t.typeId}-${o}-${n}` }, [o > 0 ? (p(), i("span", bn, "›")) : r("", !0), a("span", xn, v(n), 1)], 64))), 128))])
1813
- ], 10, _n))), 128)), I.value.length ? r("", !0) : (p(), i("div", Sn, "No matches"))], 64)) : (p(), i(e, { key: 1 }, [
1814
- k.value.length ? (p(), i("button", {
1819
+ a("span", yn, v(t.displayName), 1),
1820
+ a("span", bn, [(p(!0), i(e, null, h(P(t), (n, o) => (p(), i(e, { key: `${t.typeId}-${o}-${n}` }, [o > 0 ? (p(), i("span", xn, "›")) : r("", !0), a("span", Sn, v(n), 1)], 64))), 128))])
1821
+ ], 10, vn))), 128)), L.value.length ? r("", !0) : (p(), i("div", Cn, "No matches"))], 64)) : (p(), i(e, { key: 1 }, [
1822
+ A.value.length ? (p(), i("button", {
1815
1823
  key: 0,
1816
1824
  class: "row up",
1817
- onClick: F
1825
+ onClick: I
1818
1826
  }, [...s[6] ||= [a("span", { class: "icon" }, "↩", -1), a("span", { class: "name" }, "..", -1)]])) : r("", !0),
1819
- (p(!0), i(e, null, h(A.value.subgroups, (e) => (p(), i("button", {
1827
+ (p(!0), i(e, null, h(j.value.subgroups, (e) => (p(), i("button", {
1820
1828
  key: e.name,
1821
1829
  class: "row folder",
1822
- onClick: (t) => P(e.name)
1823
- }, [a("span", wn, v(e.name), 1), s[7] ||= a("span", { class: "chev" }, "›", -1)], 8, Cn))), 128)),
1824
- (p(!0), i(e, null, h(A.value.nodes, (e, t) => (p(), i("button", {
1830
+ onClick: (t) => F(e.name)
1831
+ }, [a("span", Tn, v(e.name), 1), s[7] ||= a("span", { class: "chev" }, "›", -1)], 8, wn))), 128)),
1832
+ (p(!0), i(e, null, h(j.value.nodes, (e, t) => (p(), i("button", {
1825
1833
  key: e.typeId,
1826
- class: l(["row node", { active: t === z.value }]),
1834
+ class: l(["row node", { active: t === B.value }]),
1827
1835
  title: e.description,
1828
- onClick: (n) => V(e, t)
1836
+ onClick: (n) => H(e, t)
1829
1837
  }, [a("span", {
1830
1838
  class: "dot",
1831
1839
  style: u({ background: e.color })
1832
- }, null, 4), a("span", En, v(e.displayName), 1)], 10, Tn))), 128)),
1833
- !A.value.subgroups.length && !A.value.nodes.length ? (p(), i("div", Dn, " Empty ")) : r("", !0)
1840
+ }, null, 4), a("span", Dn, v(e.displayName), 1)], 10, En))), 128)),
1841
+ !j.value.subgroups.length && !j.value.nodes.length ? (p(), i("div", On, " Empty ")) : r("", !0)
1834
1842
  ], 64))])])]),
1835
1843
  _: 1
1836
1844
  })], 36)], 32));
1837
1845
  }
1838
- }), [["__scopeId", "data-v-999f2b7d"]]), kn = 4, An = .25, jn = 2, Mn = .001, Nn = 4, Pn = 120 * 1e3, Fn = /*#__PURE__*/ Z(/* @__PURE__ */ s({
1846
+ }), [["__scopeId", "data-v-999f2b7d"]]), An = 4, jn = .25, Mn = 2, Nn = .001, Pn = 4, Fn = 120 * 1e3, In = /*#__PURE__*/ Q(/* @__PURE__ */ s({
1839
1847
  __name: "NodeViewer",
1840
1848
  props: {
1841
1849
  map: {},
@@ -1848,68 +1856,68 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
1848
1856
  function g(e) {
1849
1857
  return b.value.types[e.type];
1850
1858
  }
1851
- let _ = s, v = m([]), y = t(() => ke(_.map, v.value)), b = t(() => y.value.activeMap), x = t(() => Ae(_.map, v.value)), S = m(0), C = m(""), T = t(() => Oe(_.map, v.value)), E = m(!1), D = t(() => v.value.length ? E.value : _.ioWidgets);
1852
- function O() {
1853
- v.value.length && (v.value = v.value.slice(0, -1), U(), q.value = null);
1859
+ let _ = s, v = m([]), y = t(() => ke(_.map, v.value)), b = t(() => y.value.activeMap), x = t(() => Ae(_.map, v.value)), C = m(0), w = m(""), E = t(() => Oe(_.map, v.value)), D = m(!1), O = t(() => v.value.length ? D.value : _.ioWidgets);
1860
+ function k() {
1861
+ v.value.length && (v.value = v.value.slice(0, -1), W(), J.value = null);
1854
1862
  }
1855
- function k(e) {
1856
- C.value = "";
1863
+ function A(e) {
1864
+ w.value = "";
1857
1865
  try {
1858
1866
  let t = je(_.map, v.value, e);
1859
- return t.length ? (C.value = t[0] ?? "Unknown error", t) : (S.value++, []);
1867
+ return t.length ? (w.value = t[0] ?? "Unknown error", t) : (C.value++, []);
1860
1868
  } catch (e) {
1861
- return C.value = e instanceof Error ? e.message : String(e), [C.value];
1869
+ return w.value = e instanceof Error ? e.message : String(e), [w.value];
1862
1870
  }
1863
1871
  }
1864
- function A(e) {
1872
+ function j(e) {
1865
1873
  let t = b.value.graph.nodes.find((t) => t.id === e);
1866
- if (!t || !me(t)) return;
1874
+ if (!t || !pe(t)) return;
1867
1875
  let n = Fe(_.map, v.value, t);
1868
1876
  if (n) {
1869
1877
  console.warn(`[Group] ${n}`);
1870
1878
  return;
1871
1879
  }
1872
- v.value.push({ compositeNodeId: e }), U(), q.value = null;
1880
+ v.value.push({ compositeNodeId: e }), W(), J.value = null;
1873
1881
  }
1874
- let j = t(() => he(b.value)), M = t(() => D.value ? j.value.values : void 0), N = t(() => j.value.errors), P = m({});
1875
- ee(N, (e) => {
1882
+ let M = t(() => me(b.value)), N = t(() => O.value ? M.value.values : void 0), P = t(() => M.value.errors), F = m({});
1883
+ S(P, (e) => {
1876
1884
  for (let [t, n] of Object.entries(e)) {
1877
- if (P.value[t] === n) continue;
1885
+ if (F.value[t] === n) continue;
1878
1886
  let e = b.value.graph.nodes.find((e) => e.id === t), r = e ? b.value.nodeTypes[e.typeId] : void 0, i = e?.label || r?.displayName || e?.typeId || t;
1879
- console.error(`[${i}] ${n}`), P.value[t] = n;
1887
+ console.error(`[${i}] ${n}`), F.value[t] = n;
1880
1888
  }
1881
- for (let t of Object.keys(P.value)) t in e || delete P.value[t];
1889
+ for (let t of Object.keys(F.value)) t in e || delete F.value[t];
1882
1890
  });
1883
- let F = m(null), I = m(0), L = m(0), z = m(1), te = m(!1), B = m([]), V = t(() => new Set(B.value)), H = t(() => b.value.graph.nodes.filter((e) => V.value.has(e.id))), ne = t(() => H.value[0] ?? null), re = t(() => ne.value ? b.value.nodeTypes[ne.value.typeId] ?? null : null);
1884
- function ie(e) {
1885
- B.value = [e], De(b.value, e);
1891
+ let I = m(null), L = m(0), R = m(0), B = m(1), ee = m(!1), V = m([]), H = t(() => new Set(V.value)), U = t(() => b.value.graph.nodes.filter((e) => H.value.has(e.id))), te = t(() => U.value[0] ?? null), ne = t(() => te.value ? b.value.nodeTypes[te.value.typeId] ?? null : null);
1892
+ function re(e) {
1893
+ V.value = [e], Ee(b.value, e);
1886
1894
  }
1887
- function ae(e) {
1888
- B.value.indexOf(e) >= 0 ? B.value = B.value.filter((t) => t !== e) : (B.value = [...B.value, e], De(b.value, e));
1895
+ function ie(e) {
1896
+ V.value.indexOf(e) >= 0 ? V.value = V.value.filter((t) => t !== e) : (V.value = [...V.value, e], Ee(b.value, e));
1889
1897
  }
1890
- function oe(e, t) {
1898
+ function ae(e, t) {
1891
1899
  if (t) {
1892
- ae(e);
1900
+ ie(e);
1893
1901
  return;
1894
1902
  }
1895
- if (V.value.has(e) && B.value.length > 1) {
1896
- De(b.value, e);
1903
+ if (H.value.has(e) && V.value.length > 1) {
1904
+ Ee(b.value, e);
1897
1905
  return;
1898
1906
  }
1899
- ie(e);
1907
+ re(e);
1900
1908
  }
1901
- function U() {
1902
- B.value = [];
1909
+ function W() {
1910
+ V.value = [];
1903
1911
  }
1904
- function se(e, t) {
1912
+ function oe(e, t) {
1905
1913
  let n = Math.min(e.x, t.x), r = Math.max(e.x, t.x), i = Math.min(e.y, t.y), a = Math.max(e.y, t.y);
1906
1914
  return b.value.graph.nodes.filter((e) => {
1907
- let t = tt(e), o = nt(e, g);
1915
+ let t = nt(e), o = rt(e, g);
1908
1916
  return e.location.x < r && e.location.x + t > n && e.location.y < a && e.location.y + o > i;
1909
1917
  }).map((e) => e.id);
1910
1918
  }
1911
- let W = m(null), ce = t(() => {
1912
- let e = W.value;
1919
+ let G = m(null), se = t(() => {
1920
+ let e = G.value;
1913
1921
  if (!e) return null;
1914
1922
  let t = Math.min(e.start.x, e.cur.x), n = Math.min(e.start.y, e.cur.y);
1915
1923
  return {
@@ -1918,107 +1926,107 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
1918
1926
  width: `${Math.abs(e.cur.x - e.start.x)}px`,
1919
1927
  height: `${Math.abs(e.cur.y - e.start.y)}px`
1920
1928
  };
1921
- }), G = null, le = !1;
1922
- function ue(e) {
1923
- if (G) {
1924
- if (!le) {
1925
- let t = e.clientX - G.clientX, n = e.clientY - G.clientY;
1926
- if (Math.hypot(t, n) < kn) return;
1927
- le = !0;
1929
+ }), K = null, ce = !1;
1930
+ function le(e) {
1931
+ if (K) {
1932
+ if (!ce) {
1933
+ let t = e.clientX - K.clientX, n = e.clientY - K.clientY;
1934
+ if (Math.hypot(t, n) < An) return;
1935
+ ce = !0;
1928
1936
  }
1929
- W.value = {
1930
- start: G.world,
1931
- cur: K(e.clientX, e.clientY)
1937
+ G.value = {
1938
+ start: K.world,
1939
+ cur: q(e.clientX, e.clientY)
1932
1940
  };
1933
1941
  }
1934
1942
  }
1935
- function de() {
1936
- window.removeEventListener("pointermove", ue), window.removeEventListener("pointerup", de), le && W.value ? B.value = se(W.value.start, W.value.cur) : G && (U(), q.value = null), W.value = null, G = null, le = !1;
1943
+ function ue() {
1944
+ window.removeEventListener("pointermove", le), window.removeEventListener("pointerup", ue), ce && G.value ? V.value = oe(G.value.start, G.value.cur) : K && (W(), J.value = null), G.value = null, K = null, ce = !1;
1937
1945
  }
1938
- let fe = t(() => ({ transform: `translate(${I.value}px, ${L.value}px) scale(${z.value})` }));
1939
- function K(e, t) {
1940
- let n = F.value?.getBoundingClientRect(), r = n?.left ?? 0, i = n?.top ?? 0;
1946
+ let de = t(() => ({ transform: `translate(${L.value}px, ${R.value}px) scale(${B.value})` }));
1947
+ function q(e, t) {
1948
+ let n = I.value?.getBoundingClientRect(), r = n?.left ?? 0, i = n?.top ?? 0;
1941
1949
  return {
1942
- x: (e - r - I.value) / z.value,
1943
- y: (t - i - L.value) / z.value
1950
+ x: (e - r - L.value) / B.value,
1951
+ y: (t - i - R.value) / B.value
1944
1952
  };
1945
1953
  }
1946
- function ge(e, t) {
1947
- let n = F.value?.getBoundingClientRect();
1954
+ function he(e, t) {
1955
+ let n = I.value?.getBoundingClientRect();
1948
1956
  return {
1949
1957
  x: e - (n?.left ?? 0),
1950
1958
  y: t - (n?.top ?? 0)
1951
1959
  };
1952
1960
  }
1953
- let q = m(null);
1954
- function ye(e) {
1961
+ let J = m(null);
1962
+ function ve(e) {
1955
1963
  if (e === "composite/group") {
1956
- we();
1964
+ Ce();
1957
1965
  return;
1958
1966
  }
1959
1967
  let t = b.value.nodeTypes[e];
1960
1968
  if (t) {
1961
- let e = q.value?.world ?? {
1969
+ let e = J.value?.world ?? {
1962
1970
  x: 0,
1963
1971
  y: 0
1964
- }, n = R(t, {
1972
+ }, n = z(t, {
1965
1973
  x: e.x,
1966
1974
  y: e.y
1967
1975
  });
1968
- b.value.graph.nodes.push(n), Ee(b.value), oe(n.id, !1);
1976
+ b.value.graph.nodes.push(n), Te(b.value), ae(n.id, !1);
1969
1977
  }
1970
- q.value = null;
1978
+ J.value = null;
1971
1979
  }
1972
- function we() {
1973
- let e = q.value?.world ?? {
1980
+ function Ce() {
1981
+ let e = J.value?.world ?? {
1974
1982
  x: 0,
1975
1983
  y: 0
1976
- }, t = b.value.graph, n = pe(_.map, {
1984
+ }, t = b.value.graph, n = fe(_.map, {
1977
1985
  x: e.x,
1978
1986
  y: e.y
1979
1987
  }), r = Ie(_.map, v.value, n, t);
1980
1988
  if (r) {
1981
- console.warn(`[Group] ${r}`), q.value = null;
1989
+ console.warn(`[Group] ${r}`), J.value = null;
1982
1990
  return;
1983
1991
  }
1984
- t.nodes.push(n), Ee(b.value), oe(n.id, !1), q.value = null;
1992
+ t.nodes.push(n), Te(b.value), ae(n.id, !1), J.value = null;
1985
1993
  }
1986
- let J = m(null), Y = m(null), Me = m(null), Ne = t(() => {
1987
- let e = J.value, t = Y.value;
1994
+ let De = m(null), Y = m(null), Me = m(null), Ne = t(() => {
1995
+ let e = De.value, t = Y.value;
1988
1996
  if (!e || !t) return null;
1989
1997
  let n = Re(t, e.dir === "output" ? "input" : "output", e.ref.node, Me.value);
1990
1998
  if (!n) return null;
1991
1999
  let r = b.value.graph.nodes.find((e) => e.id === n.node);
1992
- return r ? it(r, n.port, g) : null;
2000
+ return r ? at(r, n.port, g) : null;
1993
2001
  }), Pe = t(() => {
1994
- let e = J.value, t = Y.value;
2002
+ let e = De.value, t = Y.value;
1995
2003
  if (!e || !t) return null;
1996
2004
  let n = Ne.value ?? t;
1997
- return e.dir === "output" ? ot(e.pos, n) : ot(n, e.pos);
2005
+ return e.dir === "output" ? st(e.pos, n) : st(n, e.pos);
1998
2006
  });
1999
2007
  function X(e, t, n) {
2000
- let r = b.value.graph.nodes.find((t) => t.id === e.node), i = r ? it(r, e.port, g) : null;
2001
- i && (J.value = {
2008
+ let r = b.value.graph.nodes.find((t) => t.id === e.node), i = r ? at(r, e.port, g) : null;
2009
+ i && (De.value = {
2002
2010
  ref: e,
2003
2011
  dir: t.direction,
2004
2012
  pos: i
2005
- }, Y.value = K(n.clientX, n.clientY), Me.value = new Set(t.direction === "output" ? _e(b.value, e.node) : ve(b.value, e.node)), window.addEventListener("pointermove", Le), window.addEventListener("pointerup", ze));
2013
+ }, Y.value = q(n.clientX, n.clientY), Me.value = new Set(t.direction === "output" ? ge(b.value, e.node) : _e(b.value, e.node)), window.addEventListener("pointermove", Le), window.addEventListener("pointerup", ze));
2006
2014
  }
2007
2015
  function Le(e) {
2008
- Y.value = K(e.clientX, e.clientY);
2016
+ Y.value = q(e.clientX, e.clientY);
2009
2017
  }
2010
2018
  function Re(e, t, n, r) {
2011
2019
  let i = null, a = Infinity;
2012
2020
  for (let o of b.value.graph.nodes) {
2013
2021
  if (o.id === n || r?.has(o.id)) continue;
2014
- let s = o.location.x - 20, c = o.location.x + tt(o) + 20;
2022
+ let s = o.location.x - 20, c = o.location.x + nt(o) + 20;
2015
2023
  if (e.x < s || e.x > c) continue;
2016
2024
  let l = t === "input" ? o.inputs : o.outputs;
2017
2025
  for (let t of Object.values(l)) {
2018
2026
  if (t.userOnly) continue;
2019
- let n = g(t), r = it(o, t.id, g);
2027
+ let n = g(t), r = at(o, t.id, g);
2020
2028
  if (!r) continue;
2021
- let s = $e(t, n) / 2;
2029
+ let s = et(t, n) / 2;
2022
2030
  if (e.y < r.y - s || e.y > r.y + s) continue;
2023
2031
  let c = Math.hypot(r.x - e.x, r.y - e.y);
2024
2032
  c < a && (a = c, i = {
@@ -2030,15 +2038,15 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
2030
2038
  return i;
2031
2039
  }
2032
2040
  function ze() {
2033
- let e = J.value, t = Y.value;
2041
+ let e = De.value, t = Y.value;
2034
2042
  if (e && t) {
2035
2043
  let n = Re(t, e.dir === "output" ? "input" : "output", e.ref.node, Me.value);
2036
2044
  if (n) {
2037
2045
  let t = e.dir === "output" ? e.ref : n, r = e.dir === "output" ? n : e.ref;
2038
- be(b.value, t, r);
2046
+ ye(b.value, t, r);
2039
2047
  }
2040
2048
  }
2041
- J.value = null, Y.value = null, Me.value = null, window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", ze);
2049
+ De.value = null, Y.value = null, Me.value = null, window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", ze);
2042
2050
  }
2043
2051
  let Be = m([]), Z = null, Q = !1, Ve = t(() => {
2044
2052
  let e = Be.value;
@@ -2050,122 +2058,122 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
2050
2058
  Z = {
2051
2059
  clientX: e.clientX,
2052
2060
  clientY: e.clientY,
2053
- world: K(e.clientX, e.clientY),
2054
- screen: ge(e.clientX, e.clientY),
2061
+ world: q(e.clientX, e.clientY),
2062
+ screen: he(e.clientX, e.clientY),
2055
2063
  onBackground: !t?.closest(".node") && !t?.closest(".config-bar")
2056
- }, Q = !1, Be.value = [Z.world], window.addEventListener("pointermove", Ue), window.addEventListener("pointerup", $);
2064
+ }, Q = !1, Be.value = [Z.world], window.addEventListener("pointermove", Ue), window.addEventListener("pointerup", Ge);
2057
2065
  }
2058
2066
  function Ue(e) {
2059
2067
  if (!Z) return;
2060
2068
  if (!Q) {
2061
2069
  let t = e.clientX - Z.clientX, n = e.clientY - Z.clientY;
2062
- if (Math.hypot(t, n) < Nn) return;
2070
+ if (Math.hypot(t, n) < Pn) return;
2063
2071
  Q = !0;
2064
2072
  }
2065
- let t = K(e.clientX, e.clientY), n = Be.value, r = n[n.length - 1];
2073
+ let t = q(e.clientX, e.clientY), n = Be.value, r = n[n.length - 1];
2066
2074
  n.push(t), r && We(r, t);
2067
2075
  }
2068
2076
  function We(e, t) {
2069
2077
  for (let n of [...b.value.graph.connections]) {
2070
2078
  let r = b.value.graph.nodes.find((e) => e.id === n.from.node), i = b.value.graph.nodes.find((e) => e.id === n.to.node);
2071
2079
  if (!r || !i) continue;
2072
- let a = it(r, n.from.port, g), o = it(i, n.to.port, g);
2080
+ let a = at(r, n.from.port, g), o = at(i, n.to.port, g);
2073
2081
  if (!a || !o) continue;
2074
- let s = st(a, o);
2075
- for (let r = 0; r < s.length - 1; r++) if (ct(e, t, s[r], s[r + 1])) {
2076
- xe(b.value, n.id);
2082
+ let s = ct(a, o);
2083
+ for (let r = 0; r < s.length - 1; r++) if (lt(e, t, s[r], s[r + 1])) {
2084
+ be(b.value, n.id);
2077
2085
  break;
2078
2086
  }
2079
2087
  }
2080
2088
  }
2081
- function $() {
2082
- window.removeEventListener("pointermove", Ue), window.removeEventListener("pointerup", $);
2089
+ function Ge() {
2090
+ window.removeEventListener("pointermove", Ue), window.removeEventListener("pointerup", Ge);
2083
2091
  let e = Z, t = Q;
2084
- Be.value = [], Z = null, Q = !1, !t && e && e.onBackground && (q.value = {
2092
+ Be.value = [], Z = null, Q = !1, !t && e && e.onBackground && (J.value = {
2085
2093
  screen: e.screen,
2086
2094
  world: e.world
2087
2095
  });
2088
2096
  }
2089
- function Ge() {
2090
- I.value = 0, L.value = 0, z.value = 1;
2097
+ function $() {
2098
+ L.value = 0, R.value = 0, B.value = 1;
2091
2099
  }
2092
2100
  function Ke() {
2093
- v.value = [], U(), q.value = null, S.value++;
2101
+ v.value = [], W(), J.value = null, C.value++;
2094
2102
  }
2095
2103
  c({ resetView: Ke });
2096
2104
  function qe(e) {
2097
2105
  if (e.key === "Escape") {
2098
- q.value ? q.value = null : v.value.length ? O() : B.value.length ? U() : Ge();
2106
+ J.value ? J.value = null : v.value.length ? k() : V.value.length ? W() : $();
2099
2107
  return;
2100
2108
  }
2101
2109
  if (e.key !== "Delete" && e.key !== "Backspace") return;
2102
2110
  let t = e.target;
2103
- if (!(t instanceof HTMLElement && t.closest("input, textarea, select")) && B.value.length) {
2104
- for (let e of B.value) Se(b.value, e) && Ce(b.value, e);
2105
- U(), e.preventDefault();
2111
+ if (!(t instanceof HTMLElement && t.closest("input, textarea, select")) && V.value.length) {
2112
+ for (let e of V.value) xe(b.value, e) && Se(b.value, e);
2113
+ W(), e.preventDefault();
2106
2114
  }
2107
2115
  }
2108
2116
  function Je(e) {
2109
2117
  e.preventDefault();
2110
- let t = F.value;
2118
+ let t = I.value;
2111
2119
  if (!t) return;
2112
- let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = (r - I.value) / z.value, o = (i - L.value) / z.value, s = Math.min(jn, Math.max(An, z.value * (1 - e.deltaY * Mn)));
2113
- I.value = r - a * s, L.value = i - o * s, z.value = s;
2120
+ let n = t.getBoundingClientRect(), r = e.clientX - n.left, i = e.clientY - n.top, a = (r - L.value) / B.value, o = (i - R.value) / B.value, s = Math.min(Mn, Math.max(jn, B.value * (1 - e.deltaY * Nn)));
2121
+ L.value = r - a * s, R.value = i - o * s, B.value = s;
2114
2122
  }
2115
2123
  function Ye(e) {
2116
- let t = e.clientX, n = e.clientY, r = I.value, i = L.value;
2117
- te.value = !0;
2124
+ let t = e.clientX, n = e.clientY, r = L.value, i = R.value;
2125
+ ee.value = !0;
2118
2126
  function a(e) {
2119
- I.value = r + (e.clientX - t), L.value = i + (e.clientY - n);
2127
+ L.value = r + (e.clientX - t), R.value = i + (e.clientY - n);
2120
2128
  }
2121
2129
  function o() {
2122
- te.value = !1, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
2130
+ ee.value = !1, window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
2123
2131
  }
2124
2132
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
2125
2133
  }
2126
2134
  function Xe(e) {
2127
- e.button === 0 && (e.stopPropagation(), G = {
2135
+ e.button === 0 && (e.stopPropagation(), K = {
2128
2136
  clientX: e.clientX,
2129
2137
  clientY: e.clientY,
2130
- world: K(e.clientX, e.clientY)
2131
- }, le = !1, window.addEventListener("pointermove", ue), window.addEventListener("pointerup", de));
2138
+ world: q(e.clientX, e.clientY)
2139
+ }, ce = !1, window.addEventListener("pointermove", le), window.addEventListener("pointerup", ue));
2132
2140
  }
2133
2141
  function Ze(e) {
2134
2142
  e.button === 1 ? (e.preventDefault(), Ye(e)) : e.button === 2 && He(e);
2135
2143
  }
2136
2144
  let Qe;
2137
2145
  return d(() => {
2138
- window.addEventListener("keydown", qe), Ee(b.value), Qe = window.setInterval(() => Te(b.value), Pn);
2146
+ window.addEventListener("keydown", qe), Te(b.value), Qe = window.setInterval(() => we(b.value), Fn);
2139
2147
  }), f(() => {
2140
2148
  window.removeEventListener("keydown", qe), Qe !== void 0 && window.clearInterval(Qe);
2141
2149
  }), (t, s) => (p(), i("div", {
2142
2150
  ref_key: "viewerEl",
2143
- ref: F,
2144
- class: l(["viewer", { panning: te.value }]),
2151
+ ref: I,
2152
+ class: l(["viewer", { panning: ee.value }]),
2145
2153
  onWheel: Je,
2146
2154
  onPointerdown: Ze,
2147
- onContextmenu: s[3] ||= w(() => {}, ["prevent"])
2155
+ onContextmenu: s[3] ||= T(() => {}, ["prevent"])
2148
2156
  }, [
2149
2157
  a("div", {
2150
2158
  class: "top-right-stack",
2151
- onPointerdown: s[1] ||= w(() => {}, ["stop"])
2152
- }, [v.value.length ? (p(), n(un, {
2159
+ onPointerdown: s[1] ||= T(() => {}, ["stop"])
2160
+ }, [v.value.length ? (p(), n(dn, {
2153
2161
  key: 0,
2154
- composite: T.value,
2155
- "io-widgets": E.value,
2156
- onUp: O,
2157
- "onUpdate:ioWidgets": s[0] ||= (e) => E.value = e
2158
- }, null, 8, ["composite", "io-widgets"])) : r("", !0), ne.value ? (p(), n(rn, {
2162
+ composite: E.value,
2163
+ "io-widgets": D.value,
2164
+ onUp: k,
2165
+ "onUpdate:ioWidgets": s[0] ||= (e) => D.value = e
2166
+ }, null, 8, ["composite", "io-widgets"])) : r("", !0), te.value ? (p(), n(an, {
2159
2167
  key: 1,
2160
2168
  class: "stacked-panel",
2161
2169
  map: b.value,
2162
- nodes: H.value,
2163
- def: re.value,
2170
+ nodes: U.value,
2171
+ def: ne.value,
2164
2172
  "graph-interface": x.value,
2165
- "interface-revision": S.value,
2166
- "interface-commit-error": C.value,
2167
- "apply-interface-mutation": k,
2168
- error: H.value.length === 1 ? N.value[ne.value.id] : void 0
2173
+ "interface-revision": C.value,
2174
+ "interface-commit-error": w.value,
2175
+ "apply-interface-mutation": A,
2176
+ error: U.value.length === 1 ? P.value[te.value.id] : void 0
2169
2177
  }, null, 8, [
2170
2178
  "map",
2171
2179
  "nodes",
@@ -2177,13 +2185,13 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
2177
2185
  ])) : r("", !0)], 32),
2178
2186
  a("div", {
2179
2187
  class: "viewport",
2180
- style: u(fe.value)
2188
+ style: u(de.value)
2181
2189
  }, [
2182
2190
  a("div", {
2183
2191
  class: "canvas-bg",
2184
2192
  onPointerdown: Xe
2185
2193
  }, null, 32),
2186
- o(Ct, {
2194
+ o(wt, {
2187
2195
  map: b.value,
2188
2196
  "pending-path": Pe.value,
2189
2197
  "slice-path": Ve.value
@@ -2192,24 +2200,24 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
2192
2200
  "pending-path",
2193
2201
  "slice-path"
2194
2202
  ]),
2195
- ce.value ? (p(), i("div", {
2203
+ se.value ? (p(), i("div", {
2196
2204
  key: 0,
2197
2205
  class: "marquee",
2198
- style: u(ce.value)
2206
+ style: u(se.value)
2199
2207
  }, null, 4)) : r("", !0),
2200
- (p(!0), i(e, null, h(b.value.graph.nodes, (e) => (p(), n(vt, {
2208
+ (p(!0), i(e, null, h(b.value.graph.nodes, (e) => (p(), n(yt, {
2201
2209
  key: e.id,
2202
2210
  node: e,
2203
2211
  map: b.value,
2204
- zoom: z.value,
2205
- "io-widgets": D.value,
2206
- "io-results": M.value,
2207
- selected: B.value.includes(e.id),
2208
- "selected-ids": V.value,
2209
- error: N.value[e.id],
2212
+ zoom: B.value,
2213
+ "io-widgets": O.value,
2214
+ "io-results": N.value,
2215
+ selected: V.value.includes(e.id),
2216
+ "selected-ids": H.value,
2217
+ error: P.value[e.id],
2210
2218
  onConnectStart: X,
2211
- onSelect: oe,
2212
- onDrillIn: A
2219
+ onSelect: ae,
2220
+ onDrillIn: j
2213
2221
  }, null, 8, [
2214
2222
  "node",
2215
2223
  "map",
@@ -2221,25 +2229,25 @@ var mn = ["title"], hn = { class: "picker-body" }, gn = { class: "list" }, _n =
2221
2229
  "error"
2222
2230
  ]))), 128))
2223
2231
  ], 4),
2224
- q.value ? (p(), n(On, {
2232
+ J.value ? (p(), n(kn, {
2225
2233
  key: 0,
2226
2234
  map: b.value,
2227
- screen: q.value.screen,
2228
- onSelect: ye,
2229
- onAddComposite: we,
2230
- onClose: s[2] ||= (e) => q.value = null
2235
+ screen: J.value.screen,
2236
+ onSelect: ve,
2237
+ onAddComposite: Ce,
2238
+ onClose: s[2] ||= (e) => J.value = null
2231
2239
  }, null, 8, ["map", "screen"])) : r("", !0)
2232
2240
  ], 34));
2233
2241
  }
2234
2242
  }), [["__scopeId", "data-v-ff1ea32f"]]);
2235
2243
  //#endregion
2236
2244
  //#region src/components/types/registerDefaultTypeWidgets.ts
2237
- function In() {
2238
- Je("number", Q), Je("string", $);
2245
+ function Ln() {
2246
+ Ye("number", Ve), Ye("string", $);
2239
2247
  }
2240
2248
  //#endregion
2241
2249
  //#region src/store/graph/createNodeMap.ts
2242
- function Ln(e = {}) {
2250
+ function Rn(e = {}) {
2243
2251
  let t = {
2244
2252
  graph: e.graph ?? {
2245
2253
  nodes: [],
@@ -2248,69 +2256,69 @@ function Ln(e = {}) {
2248
2256
  types: {},
2249
2257
  nodeTypes: {},
2250
2258
  extensions: e.extensions ? [...e.extensions] : [],
2251
- graphInterface: z(e.graphInterface ?? M),
2259
+ graphInterface: B(e.graphInterface ?? N),
2252
2260
  loadPack: () => []
2253
2261
  };
2254
- return e.types && P(t, e.types), e.nodeTypes && F(t, e.nodeTypes), ie(t, t.graphInterface), oe(t), t;
2262
+ return e.types && F(t, e.types), e.nodeTypes && I(t, e.nodeTypes), re(t, t.graphInterface), ae(t), t;
2255
2263
  }
2256
2264
  //#endregion
2257
2265
  //#region src/store/packs/installPack.ts
2258
- function Rn(e, t, n) {
2266
+ function zn(e, t, n) {
2259
2267
  if (e.extensions.includes(t.id)) return [];
2260
2268
  let r = [];
2261
2269
  if (t.types) for (let n of Object.keys(t.types)) e.types[n] && r.push(`type "${n}" already registered by another pack`);
2262
2270
  if (t.nodeTypes) for (let n of Object.keys(t.nodeTypes)) e.nodeTypes[n] && r.push(`node type "${n}" already registered by another pack`);
2263
- return r.length ? r : (I(e, t), n && t.setup?.(n), []);
2271
+ return r.length ? r : (L(e, t), n && t.setup?.(n), []);
2264
2272
  }
2265
2273
  //#endregion
2266
2274
  //#region src/vue/attachLoadPack.ts
2267
- function zn() {
2275
+ function Bn() {
2268
2276
  return {
2269
- registerTypeWidget: Je,
2270
- registerComponentWidget: Ye
2277
+ registerTypeWidget: Ye,
2278
+ registerComponentWidget: Xe
2271
2279
  };
2272
2280
  }
2273
- function Bn(e) {
2274
- e.loadPack = (t) => Rn(e, t, zn());
2281
+ function Vn(e) {
2282
+ e.loadPack = (t) => zn(e, t, Bn());
2275
2283
  }
2276
2284
  //#endregion
2277
2285
  //#region src/vue/createNodeMap.ts
2278
- var Vn = !1;
2279
- function Hn(e = {}) {
2280
- Vn ||= (In(), !0);
2281
- let t = Ln(e);
2282
- Bn(t);
2286
+ var Hn = !1;
2287
+ function Un(e = {}) {
2288
+ Hn ||= (Ln(), !0);
2289
+ let t = Rn(e);
2290
+ Vn(t);
2283
2291
  for (let n of e.packs ?? []) t.loadPack(n);
2284
2292
  return t;
2285
2293
  }
2286
2294
  //#endregion
2287
2295
  //#region src/store/graph/validateGraphTypes.ts
2288
- function Un(e, t, n, r, i) {
2296
+ function Wn(e, t, n, r, i) {
2289
2297
  e.types[n.type] || i.push(`node "${t.label ?? t.typeId}" (${t.id}): unknown ${r} port type "${n.type}" on port "${n.name}"`);
2290
2298
  }
2291
- function Wn(e, t, n) {
2299
+ function Gn(e, t, n) {
2292
2300
  e.nodeTypes[t.typeId] || n.push(`node "${t.label ?? t.id}": unknown typeId "${t.typeId}"`);
2293
- for (let r of Object.values(t.inputs)) Un(e, t, r, "input", n);
2294
- for (let r of Object.values(t.outputs)) Un(e, t, r, "output", n);
2295
- t.composite?.graph && Gn(e, t.composite.graph, n);
2301
+ for (let r of Object.values(t.inputs)) Wn(e, t, r, "input", n);
2302
+ for (let r of Object.values(t.outputs)) Wn(e, t, r, "output", n);
2303
+ t.composite?.graph && Kn(e, t.composite.graph, n);
2296
2304
  }
2297
- function Gn(e, t, n = []) {
2298
- for (let r of t.nodes) Wn(e, r, n);
2305
+ function Kn(e, t, n = []) {
2306
+ for (let r of t.nodes) Gn(e, r, n);
2299
2307
  return n;
2300
2308
  }
2301
2309
  //#endregion
2302
2310
  //#region src/store/graph/document.ts
2303
- function Kn(e) {
2311
+ function qn(e) {
2304
2312
  return {
2305
- graph: z(e.graph),
2306
- interface: z(e.graphInterface),
2313
+ graph: B(e.graph),
2314
+ interface: B(e.graphInterface),
2307
2315
  extensions: e.extensions.length ? [...e.extensions] : void 0
2308
2316
  };
2309
2317
  }
2310
- function qn(e) {
2311
- return Kn(e);
2312
- }
2313
2318
  function Jn(e) {
2319
+ return qn(e);
2320
+ }
2321
+ function Yn(e) {
2314
2322
  let t;
2315
2323
  try {
2316
2324
  t = JSON.parse(e);
@@ -2326,30 +2334,30 @@ function Jn(e) {
2326
2334
  if (n.extensions !== void 0 && (!Array.isArray(n.extensions) || n.extensions.some((e) => typeof e != "string"))) throw Error("extensions must be an array of strings");
2327
2335
  return n;
2328
2336
  }
2329
- function Yn(e, t) {
2337
+ function Xn(e, t) {
2330
2338
  return t?.length ? t.filter((t) => !e.extensions.includes(t)).map((e) => `missing pack "${e}" (call map.loadPack() before import)`) : [];
2331
2339
  }
2332
- function Xn(e, t) {
2340
+ function Zn(e, t) {
2333
2341
  let n = [];
2334
- return n.push(...Yn(e, t.extensions)), n.push(...se({
2342
+ return n.push(...Xn(e, t.extensions)), n.push(...oe({
2335
2343
  ...e,
2336
2344
  graph: t.graph
2337
- })), n.push(...B(e, t.interface)), n.push(...Gn(e, t.graph)), n;
2338
- }
2339
- function Zn(e, t) {
2340
- let n = Yn(e, t.extensions);
2341
- return n.length ? n : (e.graph = z(t.graph), e.graphInterface = z(t.interface), ie(e, e.graphInterface), oe(e), n.push(...Xn(e, t)), n);
2345
+ })), n.push(...V(e, t.interface)), n.push(...Kn(e, t.graph)), n;
2342
2346
  }
2343
2347
  function Qn(e, t) {
2344
- return Zn(e, t);
2348
+ let n = Xn(e, t.extensions);
2349
+ return n.length ? n : (e.graph = B(t.graph), e.graphInterface = B(t.interface), re(e, e.graphInterface), ae(e), n.push(...Zn(e, t)), n);
2350
+ }
2351
+ function $n(e, t) {
2352
+ return Qn(e, t);
2345
2353
  }
2346
2354
  //#endregion
2347
2355
  //#region src/store/registry/defineType.ts
2348
- function $n(e) {
2349
- let t = e.widget, n = nr(t);
2356
+ function er(e) {
2357
+ let t = e.widget, n = rr(t);
2350
2358
  return {
2351
2359
  id: e.id,
2352
- label: e.label ?? er(e.id),
2360
+ label: e.label ?? tr(e.id),
2353
2361
  color: e.color ?? "#888",
2354
2362
  validate: e.validate,
2355
2363
  accepts: e.accepts,
@@ -2360,14 +2368,14 @@ function $n(e) {
2360
2368
  coerce: e.coerce ?? n.coerce
2361
2369
  };
2362
2370
  }
2363
- function er(e) {
2371
+ function tr(e) {
2364
2372
  return e.charAt(0).toUpperCase() + e.slice(1);
2365
2373
  }
2366
- function tr(e, t, n) {
2374
+ function nr(e, t, n) {
2367
2375
  let r = Number(e);
2368
2376
  return Number.isNaN(r) && (r = 0), t !== void 0 && (r = Math.max(t, r)), n !== void 0 && (r = Math.min(n, r)), r;
2369
2377
  }
2370
- function nr(e) {
2378
+ function rr(e) {
2371
2379
  if (!e) return {
2372
2380
  parse: (e) => e,
2373
2381
  format: (e) => e == null ? "" : String(e)
@@ -2376,7 +2384,7 @@ function nr(e) {
2376
2384
  case "number": return {
2377
2385
  parse: (e) => Number(e),
2378
2386
  format: (e) => e == null ? "" : String(e),
2379
- coerce: (t) => tr(t, e.min, e.max)
2387
+ coerce: (t) => nr(t, e.min, e.max)
2380
2388
  };
2381
2389
  case "text": return {
2382
2390
  parse: (e) => e,
@@ -2386,4 +2394,4 @@ function nr(e) {
2386
2394
  }
2387
2395
  }
2388
2396
  //#endregion
2389
- export { V as INPUT_TYPE, Fn as NodeViewer, H as OUTPUT_TYPE, Zn as applyDocument, ae as boundaryNodes, Hn as createNodeMap, $n as defineType, qn as exportGraph, Qn as importGraph, R as instantiate, Jn as parseGraphDocument, Ye as registerComponentWidget, In as registerDefaultTypeWidgets, Je as registerTypeWidget, he as runGraph, Kn as serializeDocument, Xn as validateDocument };
2397
+ export { H as INPUT_TYPE, In as NodeViewer, U as OUTPUT_TYPE, Qn as applyDocument, ie as boundaryNodes, Un as createNodeMap, er as defineType, Jn as exportGraph, $n as importGraph, z as instantiate, Yn as parseGraphDocument, Xe as registerComponentWidget, Ln as registerDefaultTypeWidgets, Ye as registerTypeWidget, me as runGraph, qn as serializeDocument, Zn as validateDocument };