geonodes-web-render 0.2.0 → 0.3.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.
package/dist/embed.js CHANGED
@@ -7108,8 +7108,24 @@ function ud({ nodes: e, edges: t, defaultNodes: n, defaultEdges: r, className: i
7108
7108
  });
7109
7109
  }
7110
7110
  var dd = tl(ud);
7111
+ function fd(e) {
7112
+ let [t, n] = f(e);
7113
+ return [
7114
+ t,
7115
+ n,
7116
+ a((e) => n((t) => Gc(e, t)), [])
7117
+ ];
7118
+ }
7119
+ function pd(e) {
7120
+ let [t, n] = f(e);
7121
+ return [
7122
+ t,
7123
+ n,
7124
+ a((e) => n((t) => Kc(e, t)), [])
7125
+ ];
7126
+ }
7111
7127
  J.error014();
7112
- function fd({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7128
+ function md({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7113
7129
  return g("path", {
7114
7130
  strokeWidth: t,
7115
7131
  d: `M${e[0] / 2} 0 V${e[1]} M0 ${e[1] / 2} H${e[0]}`,
@@ -7120,7 +7136,7 @@ function fd({ dimensions: e, lineWidth: t, variant: n, className: r }) {
7120
7136
  ])
7121
7137
  });
7122
7138
  }
7123
- function pd({ radius: e, className: t }) {
7139
+ function hd({ radius: e, className: t }) {
7124
7140
  return g("circle", {
7125
7141
  cx: e,
7126
7142
  cy: e,
@@ -7132,20 +7148,20 @@ function pd({ radius: e, className: t }) {
7132
7148
  ])
7133
7149
  });
7134
7150
  }
7135
- var md;
7151
+ var gd;
7136
7152
  (function(e) {
7137
7153
  e.Lines = "lines", e.Dots = "dots", e.Cross = "cross";
7138
- })(md ||= {});
7139
- var hd = {
7140
- [md.Dots]: 1,
7141
- [md.Lines]: 1,
7142
- [md.Cross]: 6
7143
- }, gd = (e) => ({
7154
+ })(gd ||= {});
7155
+ var _d = {
7156
+ [gd.Dots]: 1,
7157
+ [gd.Lines]: 1,
7158
+ [gd.Cross]: 6
7159
+ }, vd = (e) => ({
7144
7160
  transform: e.transform,
7145
7161
  patternId: `pattern-${e.rfId}`
7146
7162
  });
7147
- function _d({ id: e, variant: t = md.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
7148
- let f = d(null), { transform: p, patternId: m } = Z(gd, X), h = r || hd[t], v = t === md.Dots, y = t === md.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
7163
+ function yd({ id: e, variant: t = gd.Dots, gap: n = 20, size: r, lineWidth: i = 1, offset: a = 0, color: o, bgColor: s, style: c, className: l, patternClassName: u }) {
7164
+ let f = d(null), { transform: p, patternId: m } = Z(vd, X), h = r || _d[t], v = t === gd.Dots, y = t === gd.Cross, b = Array.isArray(n) ? n : [n, n], x = [b[0] * p[2] || 1, b[1] * p[2] || 1], C = h * p[2], w = Array.isArray(a) ? a : [a, a], T = y ? [C, C] : x, E = [w[0] * p[2] || 1 + T[0] / 2, w[1] * p[2] || 1 + T[1] / 2], D = `${m}${e || ""}`;
7149
7165
  return _("svg", {
7150
7166
  className: S(["react-flow__background", l]),
7151
7167
  style: {
@@ -7164,10 +7180,10 @@ function _d({ id: e, variant: t = md.Dots, gap: n = 20, size: r, lineWidth: i =
7164
7180
  height: x[1],
7165
7181
  patternUnits: "userSpaceOnUse",
7166
7182
  patternTransform: `translate(-${E[0]},-${E[1]})`,
7167
- children: v ? g(pd, {
7183
+ children: v ? g(hd, {
7168
7184
  radius: C / 2,
7169
7185
  className: u
7170
- }) : g(fd, {
7186
+ }) : g(md, {
7171
7187
  dimensions: T,
7172
7188
  lineWidth: i,
7173
7189
  variant: t,
@@ -7182,44 +7198,44 @@ function _d({ id: e, variant: t = md.Dots, gap: n = 20, size: r, lineWidth: i =
7182
7198
  })]
7183
7199
  });
7184
7200
  }
7185
- _d.displayName = "Background";
7186
- var vd = i(_d);
7187
- function yd() {
7201
+ yd.displayName = "Background";
7202
+ var bd = i(yd);
7203
+ function xd() {
7188
7204
  return g("svg", {
7189
7205
  xmlns: "http://www.w3.org/2000/svg",
7190
7206
  viewBox: "0 0 32 32",
7191
7207
  children: g("path", { d: "M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z" })
7192
7208
  });
7193
7209
  }
7194
- function bd() {
7210
+ function Sd() {
7195
7211
  return g("svg", {
7196
7212
  xmlns: "http://www.w3.org/2000/svg",
7197
7213
  viewBox: "0 0 32 5",
7198
7214
  children: g("path", { d: "M0 0h32v4.2H0z" })
7199
7215
  });
7200
7216
  }
7201
- function xd() {
7217
+ function Cd() {
7202
7218
  return g("svg", {
7203
7219
  xmlns: "http://www.w3.org/2000/svg",
7204
7220
  viewBox: "0 0 32 30",
7205
7221
  children: g("path", { d: "M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z" })
7206
7222
  });
7207
7223
  }
7208
- function Sd() {
7224
+ function wd() {
7209
7225
  return g("svg", {
7210
7226
  xmlns: "http://www.w3.org/2000/svg",
7211
7227
  viewBox: "0 0 25 32",
7212
7228
  children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z" })
7213
7229
  });
7214
7230
  }
7215
- function Cd() {
7231
+ function Td() {
7216
7232
  return g("svg", {
7217
7233
  xmlns: "http://www.w3.org/2000/svg",
7218
7234
  viewBox: "0 0 25 32",
7219
7235
  children: g("path", { d: "M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z" })
7220
7236
  });
7221
7237
  }
7222
- function wd({ children: e, className: t, ...n }) {
7238
+ function Ed({ children: e, className: t, ...n }) {
7223
7239
  return g("button", {
7224
7240
  type: "button",
7225
7241
  className: S(["react-flow__controls-button", t]),
@@ -7227,14 +7243,14 @@ function wd({ children: e, className: t, ...n }) {
7227
7243
  children: e
7228
7244
  });
7229
7245
  }
7230
- var Td = (e) => ({
7246
+ var Dd = (e) => ({
7231
7247
  isInteractive: e.nodesDraggable || e.nodesConnectable || e.elementsSelectable,
7232
7248
  minZoomReached: e.transform[2] <= e.minZoom,
7233
7249
  maxZoomReached: e.transform[2] >= e.maxZoom,
7234
7250
  ariaLabelConfig: e.ariaLabelConfig
7235
7251
  });
7236
- function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
7237
- let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Td, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
7252
+ function Od({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive: r = !0, fitViewOptions: i, onZoomIn: a, onZoomOut: o, onFitView: s, onInteractiveChange: c, className: l, children: u, position: d = "bottom-left", orientation: f = "vertical", "aria-label": p }) {
7253
+ let m = Q(), { isInteractive: v, minZoomReached: y, maxZoomReached: b, ariaLabelConfig: x } = Z(Dd, X), { zoomIn: C, zoomOut: w, fitView: T } = ll();
7238
7254
  return _(Sc, {
7239
7255
  className: S([
7240
7256
  "react-flow__controls",
@@ -7246,7 +7262,7 @@ function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
7246
7262
  "data-testid": "rf__controls",
7247
7263
  "aria-label": p ?? x["controls.ariaLabel"],
7248
7264
  children: [
7249
- t && _(h, { children: [g(wd, {
7265
+ t && _(h, { children: [g(Ed, {
7250
7266
  onClick: () => {
7251
7267
  C(), a?.();
7252
7268
  },
@@ -7254,8 +7270,8 @@ function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
7254
7270
  title: x["controls.zoomIn.ariaLabel"],
7255
7271
  "aria-label": x["controls.zoomIn.ariaLabel"],
7256
7272
  disabled: b,
7257
- children: g(yd, {})
7258
- }), g(wd, {
7273
+ children: g(xd, {})
7274
+ }), g(Ed, {
7259
7275
  onClick: () => {
7260
7276
  w(), o?.();
7261
7277
  },
@@ -7263,18 +7279,18 @@ function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
7263
7279
  title: x["controls.zoomOut.ariaLabel"],
7264
7280
  "aria-label": x["controls.zoomOut.ariaLabel"],
7265
7281
  disabled: y,
7266
- children: g(bd, {})
7282
+ children: g(Sd, {})
7267
7283
  })] }),
7268
- n && g(wd, {
7284
+ n && g(Ed, {
7269
7285
  className: "react-flow__controls-fitview",
7270
7286
  onClick: () => {
7271
7287
  T(i), s?.();
7272
7288
  },
7273
7289
  title: x["controls.fitView.ariaLabel"],
7274
7290
  "aria-label": x["controls.fitView.ariaLabel"],
7275
- children: g(xd, {})
7291
+ children: g(Cd, {})
7276
7292
  }),
7277
- r && g(wd, {
7293
+ r && g(Ed, {
7278
7294
  className: "react-flow__controls-interactive",
7279
7295
  onClick: () => {
7280
7296
  m.setState({
@@ -7285,15 +7301,15 @@ function Ed({ style: e, showZoom: t = !0, showFitView: n = !0, showInteractive:
7285
7301
  },
7286
7302
  title: x["controls.interactive.ariaLabel"],
7287
7303
  "aria-label": x["controls.interactive.ariaLabel"],
7288
- children: g(v ? Cd : Sd, {})
7304
+ children: g(v ? Td : wd, {})
7289
7305
  }),
7290
7306
  u
7291
7307
  ]
7292
7308
  });
7293
7309
  }
7294
- Ed.displayName = "Controls";
7295
- var Dd = i(Ed);
7296
- function Od({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
7310
+ Od.displayName = "Controls";
7311
+ var kd = i(Od);
7312
+ function Ad({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, strokeColor: s, strokeWidth: c, className: l, borderRadius: u, shapeRendering: d, selected: f, onClick: p }) {
7297
7313
  let { background: m, backgroundColor: h } = a || {}, _ = o || m || h;
7298
7314
  return g("rect", {
7299
7315
  className: S([
@@ -7316,10 +7332,10 @@ function Od({ id: e, x: t, y: n, width: r, height: i, style: a, color: o, stroke
7316
7332
  onClick: p ? (t) => p(t, e) : void 0
7317
7333
  });
7318
7334
  }
7319
- var kd = i(Od), Ad = (e) => e.nodes.map((e) => e.id), jd = (e) => e instanceof Function ? e : () => e;
7320
- function Md({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = kd, onClick: o }) {
7321
- let s = Z(Ad, X), c = jd(t), l = jd(e), u = jd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
7322
- return g(h, { children: s.map((e) => g(Pd, {
7335
+ var jd = i(Ad), Md = (e) => e.nodes.map((e) => e.id), Nd = (e) => e instanceof Function ? e : () => e;
7336
+ function Pd({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorderRadius: r = 5, nodeStrokeWidth: i, nodeComponent: a = jd, onClick: o }) {
7337
+ let s = Z(Md, X), c = Nd(t), l = Nd(e), u = Nd(n), d = typeof window > "u" || window.chrome ? "crispEdges" : "geometricPrecision";
7338
+ return g(h, { children: s.map((e) => g(Id, {
7323
7339
  id: e,
7324
7340
  nodeColorFunc: c,
7325
7341
  nodeStrokeColorFunc: l,
@@ -7331,7 +7347,7 @@ function Md({ nodeStrokeColor: e, nodeColor: t, nodeClassName: n = "", nodeBorde
7331
7347
  shapeRendering: d
7332
7348
  }, e)) });
7333
7349
  }
7334
- function Nd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
7350
+ function Fd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc: r, nodeBorderRadius: i, nodeStrokeWidth: a, shapeRendering: o, NodeComponent: s, onClick: c }) {
7335
7351
  let { node: l, x: u, y: d, width: f, height: p } = Z((t) => {
7336
7352
  let n = t.nodeLookup.get(e);
7337
7353
  if (!n) return {
@@ -7367,7 +7383,7 @@ function Nd({ id: e, nodeColorFunc: t, nodeStrokeColorFunc: n, nodeClassNameFunc
7367
7383
  id: l.id
7368
7384
  });
7369
7385
  }
7370
- var Pd = i(Nd), Fd = i(Md), Id = 200, Ld = 150, Rd = (e) => !e.hidden, zd = (e) => {
7386
+ var Id = i(Fd), Ld = i(Pd), Rd = 200, zd = 150, Bd = (e) => !e.hidden, Vd = (e) => {
7371
7387
  let t = {
7372
7388
  x: -e.transform[0] / e.transform[2],
7373
7389
  y: -e.transform[1] / e.transform[2],
@@ -7376,7 +7392,7 @@ var Pd = i(Nd), Fd = i(Md), Id = 200, Ld = 150, Rd = (e) => !e.hidden, zd = (e)
7376
7392
  };
7377
7393
  return {
7378
7394
  viewBB: t,
7379
- boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Rd }), t) : t,
7395
+ boundingRect: e.nodeLookup.size > 0 ? Ka(ka(e.nodeLookup, { filter: Bd }), t) : t,
7380
7396
  rfId: e.rfId,
7381
7397
  panZoom: e.panZoom,
7382
7398
  translateExtent: e.translateExtent,
@@ -7384,9 +7400,9 @@ var Pd = i(Nd), Fd = i(Md), Id = 200, Ld = 150, Rd = (e) => !e.hidden, zd = (e)
7384
7400
  flowHeight: e.height,
7385
7401
  ariaLabelConfig: e.ariaLabelConfig
7386
7402
  };
7387
- }, Bd = "react-flow__minimap-desc";
7388
- function Vd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
7389
- let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(zd, X), L = e?.width ?? Id, R = e?.height ?? Ld, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Bd}-${j}`, ae = d(0), oe = d();
7403
+ }, Hd = "react-flow__minimap-desc";
7404
+ function Ud({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClassName: i = "", nodeBorderRadius: o = 5, nodeStrokeWidth: s, nodeComponent: l, bgColor: u, maskColor: f, maskStrokeColor: p, maskStrokeWidth: m, position: h = "bottom-right", onClick: v, onNodeClick: y, pannable: b = !1, zoomable: x = !1, ariaLabel: C, inversePan: w, zoomStep: T = 1, offsetScale: E = 5 }) {
7405
+ let D = Q(), O = d(null), { boundingRect: k, viewBB: A, rfId: j, panZoom: M, translateExtent: N, flowWidth: P, flowHeight: F, ariaLabelConfig: I } = Z(Vd, X), L = e?.width ?? Rd, R = e?.height ?? zd, ee = k.width / L, z = k.height / R, B = Math.max(ee, z), V = B * L, H = B * R, U = E * B, W = k.x - (V - k.width) / 2 - U, te = k.y - (H - k.height) / 2 - U, ne = V + U * 2, re = H + U * 2, ie = `${Hd}-${j}`, ae = d(0), oe = d();
7390
7406
  ae.current = B, c(() => {
7391
7407
  if (O.current && M) return oe.current = Ts({
7392
7408
  domNode: O.current,
@@ -7453,7 +7469,7 @@ function Vd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
7453
7469
  id: ie,
7454
7470
  children: le
7455
7471
  }),
7456
- g(Fd, {
7472
+ g(Ld, {
7457
7473
  onClick: ce,
7458
7474
  nodeColor: r,
7459
7475
  nodeStrokeColor: n,
@@ -7473,13 +7489,13 @@ function Vd({ style: e, className: t, nodeStrokeColor: n, nodeColor: r, nodeClas
7473
7489
  })
7474
7490
  });
7475
7491
  }
7476
- Vd.displayName = "MiniMap", i(Vd);
7477
- var Hd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Ud = {
7492
+ Ud.displayName = "MiniMap", i(Ud);
7493
+ var Wd = (e) => (t) => e ? `${Math.max(1 / t.transform[2], 1)}` : void 0, Gd = {
7478
7494
  [Bs.Line]: "right",
7479
7495
  [Bs.Handle]: "bottom-right"
7480
7496
  };
7481
- function Wd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
7482
- let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Hd(D && _), [D, _]), X), k = d(null), A = t ?? Ud[n];
7497
+ function Kd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, style: i = void 0, children: o, color: s, minWidth: l = 10, minHeight: u = 10, maxWidth: f = Number.MAX_VALUE, maxHeight: p = Number.MAX_VALUE, keepAspectRatio: m = !1, resizeDirection: h, autoScale: _ = !0, shouldResize: v, onResizeStart: y, onResize: b, onResizeEnd: x }) {
7498
+ let C = Ol(), w = typeof e == "string" ? e : C, T = Q(), E = d(null), D = n === Bs.Handle, O = Z(a(Wd(D && _), [D, _]), X), k = d(null), A = t ?? Gd[n];
7483
7499
  return c(() => {
7484
7500
  if (!(!E.current || !w)) return k.current ||= Zs({
7485
7501
  domNode: E.current,
@@ -7605,17 +7621,17 @@ function Wd({ nodeId: e, position: t, variant: n = Bs.Handle, className: r, styl
7605
7621
  children: o
7606
7622
  });
7607
7623
  }
7608
- i(Wd);
7624
+ i(Kd);
7609
7625
  //#endregion
7610
7626
  //#region src/gn/ir/socketColors.ts
7611
- function Gd(e) {
7627
+ function qd(e) {
7612
7628
  return e <= .0031308 ? 12.92 * e : 1.055 * e ** (1 / 2.4) - .055;
7613
7629
  }
7614
7630
  function $(e, t, n) {
7615
- let r = (e) => Math.round(Math.min(1, Math.max(0, Gd(e))) * 255).toString(16).padStart(2, "0");
7631
+ let r = (e) => Math.round(Math.min(1, Math.max(0, qd(e))) * 255).toString(16).padStart(2, "0");
7616
7632
  return `#${r(e)}${r(t)}${r(n)}`;
7617
7633
  }
7618
- var Kd = {
7634
+ var Jd = {
7619
7635
  FLOAT: $(.63, .63, .63),
7620
7636
  VECTOR: $(.39, .39, .78),
7621
7637
  RGBA: $(.78, .78, .16),
@@ -7637,12 +7653,12 @@ var Kd = {
7637
7653
  INT_VECTOR: $(.36, .47, .61),
7638
7654
  CUSTOM: $(.2, .2, .2)
7639
7655
  };
7640
- function qd(e) {
7641
- return Kd[e] ?? Kd.CUSTOM;
7656
+ function Yd(e) {
7657
+ return Jd[e] ?? Jd.CUSTOM;
7642
7658
  }
7643
7659
  //#endregion
7644
7660
  //#region src/gn/ir/nodeColors.ts
7645
- var Jd = {
7661
+ var Xd = {
7646
7662
  GEOMETRY: "#1d725e",
7647
7663
  INPUT: "#82354c",
7648
7664
  OUTPUT: "#3e232a",
@@ -7659,10 +7675,10 @@ var Jd = {
7659
7675
  SCRIPT: "#203c3c",
7660
7676
  DEFAULT: "#303030"
7661
7677
  };
7662
- function Yd(e) {
7678
+ function Zd(e) {
7663
7679
  return e === "NodeGroupInput" || e === "NodeGroupOutput" ? "INTERFACE" : e.startsWith("NodeGroup") ? "GROUP" : e.startsWith("GeometryNodeSet") || e.startsWith("GeometryNodeTransform") || e.startsWith("GeometryNodeMerge") || e.startsWith("GeometryNodeJoin") || e.startsWith("GeometryNodeDelete") || e.startsWith("GeometryNodeSeparate") || e.startsWith("GeometryNodeDuplicate") || e.startsWith("GeometryNodeExtrude") || e.startsWith("GeometryNodeFlip") || e.startsWith("GeometryNodeSubdivide") || e.startsWith("GeometryNodeTriangulate") || e.startsWith("GeometryNodeMesh") || e.startsWith("GeometryNodeCurve") || e.startsWith("GeometryNodePoints") || e.startsWith("GeometryNodeVolume") || e.startsWith("GeometryNodeInstance") || e.startsWith("GeometryNodeRealize") || e.startsWith("GeometryNodeConvex") || e.startsWith("GeometryNodeFill") || e.startsWith("GeometryNodeSDF") || e.startsWith("GeometryNode") ? "GEOMETRY" : e.startsWith("ShaderNode") ? "SHADER" : e.startsWith("FunctionNode") ? "CONVERTER" : "DEFAULT";
7664
7680
  }
7665
- var Xd = {
7681
+ var Qd = {
7666
7682
  GeometryNodeInputMaterial: "INPUT",
7667
7683
  GeometryNodeInputMaterialIndex: "INPUT",
7668
7684
  GeometryNodeInputRadius: "INPUT",
@@ -7713,12 +7729,12 @@ var Xd = {
7713
7729
  GeometryNodeFieldVariance: "CONVERTER",
7714
7730
  GeometryNodeViewer: "OUTPUT"
7715
7731
  };
7716
- function Zd(e) {
7717
- return Jd[Xd[e] ?? Yd(e)] ?? Jd.DEFAULT;
7732
+ function $d(e) {
7733
+ return Xd[Qd[e] ?? Zd(e)] ?? Xd.DEFAULT;
7718
7734
  }
7719
7735
  //#endregion
7720
7736
  //#region src/gn/importer/blenderTree.ts
7721
- var Qd = {
7737
+ var ef = {
7722
7738
  NodeSocketGeometry: "GEOMETRY",
7723
7739
  NodeSocketFloat: "FLOAT",
7724
7740
  NodeSocketVector: "VECTOR",
@@ -7735,10 +7751,10 @@ var Qd = {
7735
7751
  NodeSocketMatrix: "MATRIX",
7736
7752
  NodeSocketMenu: "MENU"
7737
7753
  };
7738
- function $d(e) {
7739
- return Qd[e] ?? "CUSTOM";
7754
+ function tf(e) {
7755
+ return ef[e] ?? "CUSTOM";
7740
7756
  }
7741
- var ef = {
7757
+ var nf = {
7742
7758
  HSV: [
7743
7759
  "Hue",
7744
7760
  "Saturation",
@@ -7755,7 +7771,7 @@ var ef = {
7755
7771
  "Blue"
7756
7772
  ]
7757
7773
  };
7758
- function tf(e) {
7774
+ function rf(e) {
7759
7775
  let t = e.data.mapping?.data;
7760
7776
  if (!t) return;
7761
7777
  let n = t.curves?.data?.items;
@@ -7773,8 +7789,8 @@ function tf(e) {
7773
7789
  points: r
7774
7790
  };
7775
7791
  }
7776
- function nf(e, t) {
7777
- let n = ef[t ?? "RGB"] ?? ef.RGB, r = ef.RGB;
7792
+ function af(e, t) {
7793
+ let n = nf[t ?? "RGB"] ?? nf.RGB, r = nf.RGB;
7778
7794
  return e.map((e) => {
7779
7795
  let t = r.indexOf(e.name);
7780
7796
  return t === -1 ? e : {
@@ -7783,11 +7799,11 @@ function nf(e, t) {
7783
7799
  };
7784
7800
  });
7785
7801
  }
7786
- function rf(e) {
7802
+ function of(e) {
7787
7803
  return e.replace(/\.\d{3}$/, "");
7788
7804
  }
7789
- function af(e, t) {
7790
- let n = $d(e.data.socket_idname ?? ""), r = qd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7805
+ function sf(e, t) {
7806
+ let n = tf(e.data.socket_idname ?? ""), r = Yd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7791
7807
  id: e,
7792
7808
  name: "",
7793
7809
  dataType: n,
@@ -7812,7 +7828,7 @@ function af(e, t) {
7812
7828
  outputs: [o(a)]
7813
7829
  };
7814
7830
  }
7815
- function of(e) {
7831
+ function cf(e) {
7816
7832
  return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
7817
7833
  kind: "vec",
7818
7834
  values: e
@@ -7821,20 +7837,20 @@ function of(e) {
7821
7837
  value: e
7822
7838
  } : null;
7823
7839
  }
7824
- function sf(e, t) {
7840
+ function lf(e, t) {
7825
7841
  return {
7826
7842
  id: String(e.id),
7827
7843
  name: e.data.name,
7828
7844
  dataType: e.data.type,
7829
7845
  displayShape: e.data.display_shape,
7830
- color: qd(e.data.type),
7831
- defaultValue: of(e.data.default_value),
7846
+ color: Yd(e.data.type),
7847
+ defaultValue: cf(e.data.default_value),
7832
7848
  hideValue: e.data.hide_value ?? !1,
7833
7849
  enabled: e.data.enabled ?? !0,
7834
7850
  index: t
7835
7851
  };
7836
7852
  }
7837
- function cf(e) {
7853
+ function uf(e) {
7838
7854
  if (e.data.bl_idname === "FunctionNodeCompare") {
7839
7855
  let t = {};
7840
7856
  return e.data.data_type && (t.data_type = e.data.data_type), e.data.operation && (t.operation = e.data.operation), Object.keys(t).length > 0 ? t : void 0;
@@ -7844,7 +7860,7 @@ function cf(e) {
7844
7860
  return e.data.operation && (t.operation = e.data.operation), e.data.use_clamp && (t.use_clamp = "true"), Object.keys(t).length > 0 ? t : void 0;
7845
7861
  }
7846
7862
  }
7847
- function lf(e, t) {
7863
+ function df(e, t) {
7848
7864
  if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
7849
7865
  if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
7850
7866
  if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
@@ -7854,10 +7870,10 @@ function lf(e, t) {
7854
7870
  nodes: e.data.nodes.data.items.map((e, t) => {
7855
7871
  if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
7856
7872
  let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
7857
- if (e.data.bl_idname === "NodeReroute") return af(e, n);
7873
+ if (e.data.bl_idname === "NodeReroute") return sf(e, n);
7858
7874
  let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
7859
7875
  if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
7860
- return sf(t, n);
7876
+ return lf(t, n);
7861
7877
  });
7862
7878
  e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
7863
7879
  ...r[0],
@@ -7868,20 +7884,20 @@ function lf(e, t) {
7868
7884
  });
7869
7885
  let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
7870
7886
  if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
7871
- return sf(t, n);
7887
+ return lf(t, n);
7872
7888
  });
7873
- (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = nf(i, e.data.mode));
7874
- let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? tf(e) : void 0, o = cf(e);
7889
+ (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = af(i, e.data.mode));
7890
+ let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? rf(e) : void 0, o = uf(e);
7875
7891
  return {
7876
7892
  id: String(e.id),
7877
7893
  type: e.data.bl_idname,
7878
- label: e.data.label || rf(e.data.name),
7894
+ label: e.data.label || of(e.data.name),
7879
7895
  position: {
7880
7896
  x: n[0],
7881
7897
  y: -n[1]
7882
7898
  },
7883
7899
  width: e.data.width ?? 140,
7884
- headerColor: Zd(e.data.bl_idname),
7900
+ headerColor: $d(e.data.bl_idname),
7885
7901
  inputs: i,
7886
7902
  outputs: r,
7887
7903
  floatCurve: a,
@@ -7899,12 +7915,12 @@ function lf(e, t) {
7899
7915
  })
7900
7916
  };
7901
7917
  }
7902
- function uf(e) {
7918
+ function ff(e) {
7903
7919
  if (!e || typeof e != "object") throw Error("JSON root must be an object.");
7904
7920
  if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
7905
7921
  let t = {};
7906
7922
  for (let n = 0; n < e.node_trees.length; n++) {
7907
- let r = lf(e.node_trees[n], n);
7923
+ let r = df(e.node_trees[n], n);
7908
7924
  t[r.id] = r;
7909
7925
  }
7910
7926
  let n = /* @__PURE__ */ new Set();
@@ -7923,21 +7939,21 @@ function uf(e) {
7923
7939
  trees: t
7924
7940
  };
7925
7941
  }
7926
- function df(e, t) {
7942
+ function pf(e, t) {
7927
7943
  return {
7928
7944
  ...t,
7929
7945
  nodeId: e,
7930
7946
  direction: "input"
7931
7947
  };
7932
7948
  }
7933
- function ff(e, t) {
7949
+ function mf(e, t) {
7934
7950
  return {
7935
7951
  ...t,
7936
7952
  nodeId: e,
7937
7953
  direction: "output"
7938
7954
  };
7939
7955
  }
7940
- function pf(e) {
7956
+ function hf(e) {
7941
7957
  let t = e.nodes.map((e) => ({
7942
7958
  id: e.id,
7943
7959
  type: e.type,
@@ -7945,8 +7961,8 @@ function pf(e) {
7945
7961
  position: e.position,
7946
7962
  width: e.width,
7947
7963
  headerColor: e.headerColor,
7948
- inputs: e.inputs.map((t) => df(e.id, t)),
7949
- outputs: e.outputs.map((t) => ff(e.id, t)),
7964
+ inputs: e.inputs.map((t) => pf(e.id, t)),
7965
+ outputs: e.outputs.map((t) => mf(e.id, t)),
7950
7966
  floatCurve: e.floatCurve,
7951
7967
  properties: e.properties,
7952
7968
  groupTreeId: e.groupTreeId,
@@ -7970,11 +7986,11 @@ function pf(e) {
7970
7986
  }
7971
7987
  //#endregion
7972
7988
  //#region src/gn/xyflow/mapGraphIRToFlow.ts
7973
- function mf(e) {
7989
+ function gf(e) {
7974
7990
  let t = Math.max(e.inputs.length, e.outputs.length);
7975
7991
  return Math.max(60, 32 + t * 18 + 16);
7976
7992
  }
7977
- function hf(e, t) {
7993
+ function _f(e, t) {
7978
7994
  if (e.type === "NodeReroute") {
7979
7995
  let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
7980
7996
  return {
@@ -8014,7 +8030,7 @@ function hf(e, t) {
8014
8030
  }
8015
8031
  };
8016
8032
  }
8017
- function gf(e, t, n) {
8033
+ function vf(e, t, n) {
8018
8034
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
8019
8035
  for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
8020
8036
  for (let e of n.edges) r.has(e.sourceNodeId) || r.set(e.sourceNodeId, []), i.has(e.targetNodeId) || i.set(e.targetNodeId, []), r.get(e.sourceNodeId).push(e.targetNodeId), i.get(e.targetNodeId).push(e.sourceNodeId);
@@ -8038,16 +8054,16 @@ function gf(e, t, n) {
8038
8054
  for (let e of a) s.has(e) && l.add(e);
8039
8055
  return l;
8040
8056
  }
8041
- function _f(e) {
8042
- let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => hf(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
8057
+ function yf(e) {
8058
+ let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => _f(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
8043
8059
  if (r && i) {
8044
- let t = gf(r.id, i.id, e);
8060
+ let t = vf(r.id, i.id, e);
8045
8061
  if (t.size > 0) {
8046
8062
  let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
8047
8063
  for (let e of t) {
8048
8064
  let t = i.get(e);
8049
8065
  if (!t) continue;
8050
- let n = t.width, r = mf(t);
8066
+ let n = t.width, r = gf(t);
8051
8067
  o = Math.min(o, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + n), l = Math.max(l, t.position.y + r);
8052
8068
  }
8053
8069
  if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
@@ -8095,10 +8111,10 @@ function _f(e) {
8095
8111
  }
8096
8112
  //#endregion
8097
8113
  //#region src/gn/ir/curvePath.ts
8098
- function vf(e, t) {
8114
+ function bf(e, t) {
8099
8115
  return Math.sqrt(e * e + t * t);
8100
8116
  }
8101
- function yf(e) {
8117
+ function xf(e) {
8102
8118
  let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
8103
8119
  let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
8104
8120
  if (i === "VECTOR") return {
@@ -8108,11 +8124,11 @@ function yf(e) {
8108
8124
  let c = 0, l = 0, u = 0, d = 0;
8109
8125
  if (o && s) {
8110
8126
  let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
8111
- if (u = vf(e, t), d = vf(i, a), u > 1e-8 && d > 1e-8) {
8112
- let n = e / u + i / d, r = t / u + a / d, o = vf(n, r);
8127
+ if (u = bf(e, t), d = bf(i, a), u > 1e-8 && d > 1e-8) {
8128
+ let n = e / u + i / d, r = t / u + a / d, o = bf(n, r);
8113
8129
  o > 1e-8 && (c = n / o, l = r / o);
8114
8130
  } else d > 1e-8 ? (c = (s[0] - n) / d, l = (s[1] - r) / d) : u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u);
8115
- } else s ? (d = vf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = vf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8131
+ } else s ? (d = bf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = bf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8116
8132
  let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
8117
8133
  if (i === "AUTO_CLAMPED") {
8118
8134
  if (o) {
@@ -8157,7 +8173,7 @@ function yf(e) {
8157
8173
  }
8158
8174
  return n;
8159
8175
  }
8160
- function bf(e, t, n, r, i, a, o) {
8176
+ function Sf(e, t, n, r, i, a, o) {
8161
8177
  let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
8162
8178
  if (e.length < 2) return {
8163
8179
  strokePath: "",
@@ -8165,7 +8181,7 @@ function bf(e, t, n, r, i, a, o) {
8165
8181
  zeroLinePath: "",
8166
8182
  dotPositions: []
8167
8183
  };
8168
- let d = yf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8184
+ let d = xf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8169
8185
  for (let t = 0; t < e.length - 1; t++) {
8170
8186
  let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
8171
8187
  m += ` C ${l(n[0]).toFixed(2)} ${u(n[1]).toFixed(2)},`, m += ` ${l(r[0]).toFixed(2)} ${u(r[1]).toFixed(2)},`, m += ` ${l(i).toFixed(2)} ${u(a).toFixed(2)}`;
@@ -8180,18 +8196,18 @@ function bf(e, t, n, r, i, a, o) {
8180
8196
  }
8181
8197
  //#endregion
8182
8198
  //#region src/gn/components/groupNavContext.ts
8183
- var xf = t(null);
8184
- function Sf() {
8185
- return o(xf);
8199
+ var Cf = t(null);
8200
+ function wf() {
8201
+ return o(Cf);
8186
8202
  }
8187
8203
  //#endregion
8188
8204
  //#region src/gn/components/GenericGNNode.tsx
8189
- var Cf = [
8205
+ var Tf = [
8190
8206
  "X",
8191
8207
  "Y",
8192
8208
  "Z",
8193
8209
  "W"
8194
- ], wf = {
8210
+ ], Ef = {
8195
8211
  FLOAT: "Float",
8196
8212
  INT: "Integer",
8197
8213
  VECTOR: "Vector",
@@ -8199,7 +8215,7 @@ var Cf = [
8199
8215
  STRING: "String",
8200
8216
  BOOLEAN: "Boolean",
8201
8217
  ROTATION: "Rotation"
8202
- }, Tf = {
8218
+ }, Df = {
8203
8219
  EQUAL: "Equal",
8204
8220
  NOT_EQUAL: "Not Equal",
8205
8221
  LESS_THAN: "Less Than",
@@ -8245,10 +8261,10 @@ var Cf = [
8245
8261
  RADIANS: "To Radians",
8246
8262
  DEGREES: "To Degrees"
8247
8263
  };
8248
- function Ef(e, t) {
8249
- return e === "data_type" ? wf[t] ?? t : e === "operation" ? Tf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8264
+ function Of(e, t) {
8265
+ return e === "data_type" ? Ef[t] ?? t : e === "operation" ? Df[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8250
8266
  }
8251
- function Df(e) {
8267
+ function kf(e) {
8252
8268
  switch (e) {
8253
8269
  case "LINE": return "gn-socket--line";
8254
8270
  case "DIAMOND": return "gn-socket--diamond";
@@ -8257,55 +8273,55 @@ function Df(e) {
8257
8273
  default: return "gn-socket--circle";
8258
8274
  }
8259
8275
  }
8260
- function Of(e) {
8276
+ function Af(e) {
8261
8277
  return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
8262
8278
  }
8263
- function kf(e) {
8279
+ function jf(e) {
8264
8280
  return parseFloat(e.toFixed(3)).toString();
8265
8281
  }
8266
- function Af(e, t) {
8267
- return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${kf(e)}${Of(t)}`;
8282
+ function Mf(e, t) {
8283
+ return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${jf(e)}${Af(t)}`;
8268
8284
  }
8269
- function jf(e) {
8285
+ function Nf(e) {
8270
8286
  return Math.round(Math.min(1, Math.max(0, e)) * 255);
8271
8287
  }
8272
- function Mf(e) {
8288
+ function Pf(e) {
8273
8289
  let [t, n, r, i = 1] = e.values;
8274
8290
  return /* @__PURE__ */ g("div", {
8275
8291
  className: "gn-node__color-swatch",
8276
- style: { background: `rgba(${jf(t)},${jf(n)},${jf(r)},${i.toFixed(2)})` }
8292
+ style: { background: `rgba(${Nf(t)},${Nf(n)},${Nf(r)},${i.toFixed(2)})` }
8277
8293
  });
8278
8294
  }
8279
- function Nf(e) {
8280
- if (e.dataType === "RGBA") return /* @__PURE__ */ g(Mf, { values: e.values });
8281
- let t = Of(e.dataType);
8295
+ function Ff(e) {
8296
+ if (e.dataType === "RGBA") return /* @__PURE__ */ g(Pf, { values: e.values });
8297
+ let t = Af(e.dataType);
8282
8298
  return /* @__PURE__ */ g("div", {
8283
8299
  className: "gn-node__vec-block",
8284
8300
  children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
8285
8301
  className: "gn-node__vec-row",
8286
8302
  children: [/* @__PURE__ */ g("span", {
8287
8303
  className: "gn-node__vec-label",
8288
- children: Cf[n]
8304
+ children: Tf[n]
8289
8305
  }), /* @__PURE__ */ _("span", {
8290
8306
  className: "gn-node__vec-value",
8291
- children: [kf(e), t]
8307
+ children: [jf(e), t]
8292
8308
  })]
8293
8309
  }, n))
8294
8310
  });
8295
8311
  }
8296
- function Pf({ properties: e }) {
8312
+ function If({ properties: e }) {
8297
8313
  let t = Object.entries(e);
8298
8314
  return t.length === 0 ? null : /* @__PURE__ */ g("div", {
8299
8315
  className: "gn-node__props",
8300
8316
  children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
8301
8317
  className: "gn-node__prop-row",
8302
- children: Ef(e, t)
8318
+ children: Of(e, t)
8303
8319
  }, e))
8304
8320
  });
8305
8321
  }
8306
- var Ff = 120, If = 6;
8307
- function Lf({ curve: e, width: t }) {
8308
- let n = Math.max(10, t - If * 2), r = Ff, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = bf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8322
+ var Lf = 120, Rf = 6;
8323
+ function zf({ curve: e, width: t }) {
8324
+ let n = Math.max(10, t - Rf * 2), r = Lf, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Sf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8309
8325
  return /* @__PURE__ */ g("div", {
8310
8326
  className: "gn-node__curve-wrap",
8311
8327
  children: /* @__PURE__ */ _("svg", {
@@ -8336,7 +8352,7 @@ function Lf({ curve: e, width: t }) {
8336
8352
  })
8337
8353
  });
8338
8354
  }
8339
- function Rf(e) {
8355
+ function Bf(e) {
8340
8356
  let { socket: t, position: n, type: r, align: i, suppressDefault: a } = e, o = t.name.trim().length === 0, s = !a && !t.hideValue && t.defaultValue?.kind === "scalar";
8341
8357
  return /* @__PURE__ */ _("div", {
8342
8358
  className: `gn-node__socket-row gn-node__socket-row--${i}`,
@@ -8345,7 +8361,7 @@ function Rf(e) {
8345
8361
  id: t.id,
8346
8362
  type: r,
8347
8363
  position: n,
8348
- className: `gn-socket ${Df(t.displayShape)}`,
8364
+ className: `gn-socket ${kf(t.displayShape)}`,
8349
8365
  style: {
8350
8366
  top: "50%",
8351
8367
  background: t.color,
@@ -8358,15 +8374,15 @@ function Rf(e) {
8358
8374
  }),
8359
8375
  s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
8360
8376
  className: "gn-node__value",
8361
- children: Af(t.defaultValue.value, t.dataType)
8377
+ children: Mf(t.defaultValue.value, t.dataType)
8362
8378
  }) : null
8363
8379
  ]
8364
8380
  });
8365
8381
  }
8366
- function zf(e, t) {
8382
+ function Vf(e, t) {
8367
8383
  return !t && !e.hideValue && e.defaultValue?.kind === "vec";
8368
8384
  }
8369
- function Bf() {
8385
+ function Hf() {
8370
8386
  return /* @__PURE__ */ _("div", {
8371
8387
  className: "gn-node__stack",
8372
8388
  "aria-hidden": "true",
@@ -8377,8 +8393,8 @@ function Bf() {
8377
8393
  ]
8378
8394
  });
8379
8395
  }
8380
- function Vf(e) {
8381
- let t = e.data, n = Sf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
8396
+ function Uf(e) {
8397
+ let t = e.data, n = wf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
8382
8398
  return /* @__PURE__ */ _("div", {
8383
8399
  className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
8384
8400
  onClick: s ? () => n.openGroup(o) : void 0,
@@ -8393,15 +8409,15 @@ function Vf(e) {
8393
8409
  children: t.label
8394
8410
  })
8395
8411
  }),
8396
- s && /* @__PURE__ */ g(Bf, {}),
8397
- t.properties && /* @__PURE__ */ g(Pf, { properties: t.properties }),
8398
- t.floatCurve && /* @__PURE__ */ g(Lf, {
8412
+ s && /* @__PURE__ */ g(Hf, {}),
8413
+ t.properties && /* @__PURE__ */ g(If, { properties: t.properties }),
8414
+ t.floatCurve && /* @__PURE__ */ g(zf, {
8399
8415
  curve: t.floatCurve,
8400
8416
  width: t.width
8401
8417
  }),
8402
8418
  /* @__PURE__ */ _("div", {
8403
8419
  className: "gn-node__body",
8404
- children: [i.map((e) => /* @__PURE__ */ g(Rf, {
8420
+ children: [i.map((e) => /* @__PURE__ */ g(Bf, {
8405
8421
  socket: e,
8406
8422
  position: Y.Right,
8407
8423
  type: "source",
@@ -8409,13 +8425,13 @@ function Vf(e) {
8409
8425
  suppressDefault: !0
8410
8426
  }, e.id)), a.map((e) => {
8411
8427
  let t = r.has(e.id);
8412
- return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Rf, {
8428
+ return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Bf, {
8413
8429
  socket: e,
8414
8430
  position: Y.Left,
8415
8431
  type: "target",
8416
8432
  align: "left",
8417
8433
  suppressDefault: t
8418
- }), zf(e, t) ? /* @__PURE__ */ g(Nf, {
8434
+ }), Vf(e, t) ? /* @__PURE__ */ g(Ff, {
8419
8435
  values: e.defaultValue.values,
8420
8436
  dataType: e.dataType
8421
8437
  }) : null] }, e.id);
@@ -8426,7 +8442,7 @@ function Vf(e) {
8426
8442
  }
8427
8443
  //#endregion
8428
8444
  //#region src/gn/components/RerouteNode.tsx
8429
- function Hf(e) {
8445
+ function Wf(e) {
8430
8446
  let t = e.data;
8431
8447
  return /* @__PURE__ */ _("div", {
8432
8448
  className: "gn-reroute",
@@ -8446,7 +8462,7 @@ function Hf(e) {
8446
8462
  }
8447
8463
  //#endregion
8448
8464
  //#region src/gn/components/SimulationZoneFrame.tsx
8449
- function Uf(e) {
8465
+ function Gf(e) {
8450
8466
  let t = e.data;
8451
8467
  return /* @__PURE__ */ g("div", {
8452
8468
  className: "gn-sim-zone",
@@ -8473,93 +8489,125 @@ function Uf(e) {
8473
8489
  }
8474
8490
  //#endregion
8475
8491
  //#region src/gn/components/GeometryNodesFlow.tsx
8476
- var Wf = {
8477
- gnNode: Vf,
8478
- rerouteNode: Hf,
8479
- simulationZone: Uf
8480
- }, Gf = { padding: .08 };
8481
- function Kf(e) {
8482
- let { nodes: t, edges: n, breadcrumbs: r, onNavigate: i } = e, { fitView: a } = ll();
8483
- return c(() => {
8484
- a(Gf);
8485
- }, [t, a]), /* @__PURE__ */ _(dd, {
8486
- nodes: t,
8487
- edges: n,
8488
- nodeTypes: Wf,
8489
- fitView: !0,
8490
- fitViewOptions: Gf,
8491
- minZoom: .2,
8492
- nodesDraggable: !1,
8493
- nodesConnectable: !1,
8494
- elementsSelectable: !1,
8495
- nodesFocusable: !1,
8496
- edgesFocusable: !1,
8497
- selectNodesOnDrag: !1,
8498
- selectionOnDrag: !1,
8499
- connectOnClick: !1,
8500
- panOnDrag: !0,
8501
- panOnScroll: !1,
8502
- zoomOnScroll: !0,
8503
- zoomOnDoubleClick: !1,
8504
- children: [
8505
- /* @__PURE__ */ g(vd, {
8506
- gap: 20,
8507
- size: 1
8508
- }),
8509
- /* @__PURE__ */ g(Dd, { showInteractive: !1 }),
8510
- r.length > 1 ? /* @__PURE__ */ g(Sc, {
8511
- position: "top-left",
8512
- children: /* @__PURE__ */ g("nav", {
8513
- className: "gn-breadcrumbs",
8514
- "aria-label": "Node group path",
8515
- children: r.map((e, t) => {
8516
- let n = t === r.length - 1;
8517
- return /* @__PURE__ */ _("span", {
8518
- className: "gn-breadcrumbs__item",
8519
- children: [t > 0 ? /* @__PURE__ */ g("span", {
8520
- className: "gn-breadcrumbs__sep",
8521
- "aria-hidden": "true",
8522
- children: "›"
8523
- }) : null, n ? /* @__PURE__ */ g("span", {
8524
- className: "gn-breadcrumbs__current",
8525
- "aria-current": "page",
8526
- children: e.label
8527
- }) : /* @__PURE__ */ g("button", {
8528
- type: "button",
8529
- className: "gn-breadcrumbs__link",
8530
- onClick: () => i(t),
8531
- children: e.label
8532
- })]
8533
- }, `${e.id}-${t}`);
8492
+ var Kf = {
8493
+ gnNode: Uf,
8494
+ rerouteNode: Wf,
8495
+ simulationZone: Gf
8496
+ }, qf = { padding: .08 };
8497
+ function Jf(e) {
8498
+ let { nodes: t, edges: n, breadcrumbs: r, onNavigate: i, onSelectionIds: o } = e, { fitView: s } = ll(), l = d(null), u = d(!1), [f, p, m] = fd(t), [h, v, y] = pd(n);
8499
+ c(() => {
8500
+ p(t), o?.([]), u.current = !1, s(qf);
8501
+ }, [
8502
+ t,
8503
+ p,
8504
+ o,
8505
+ s
8506
+ ]), c(() => {
8507
+ v(n);
8508
+ }, [n, v]), c(() => {
8509
+ let e = l.current;
8510
+ if (!e) return;
8511
+ let t = new ResizeObserver(() => {
8512
+ u.current || s(qf);
8513
+ });
8514
+ return t.observe(e), () => t.disconnect();
8515
+ }, [s]);
8516
+ let b = a((e) => {
8517
+ e && (u.current = !0);
8518
+ }, []);
8519
+ return /* @__PURE__ */ g("div", {
8520
+ ref: l,
8521
+ style: {
8522
+ width: "100%",
8523
+ height: "100%"
8524
+ },
8525
+ children: /* @__PURE__ */ _(dd, {
8526
+ nodes: f,
8527
+ edges: h,
8528
+ onNodesChange: m,
8529
+ onEdgesChange: y,
8530
+ onSelectionChange: a(({ nodes: e }) => {
8531
+ o?.(e.map((e) => e.id));
8532
+ }, [o]),
8533
+ onMoveStart: b,
8534
+ nodeTypes: Kf,
8535
+ fitView: !0,
8536
+ fitViewOptions: qf,
8537
+ minZoom: .2,
8538
+ nodesDraggable: !1,
8539
+ nodesConnectable: !1,
8540
+ elementsSelectable: !0,
8541
+ nodesFocusable: !1,
8542
+ edgesFocusable: !1,
8543
+ selectNodesOnDrag: !1,
8544
+ selectionOnDrag: !0,
8545
+ selectionMode: va.Partial,
8546
+ connectOnClick: !1,
8547
+ panOnDrag: [1, 2],
8548
+ panOnScroll: !1,
8549
+ zoomOnScroll: !0,
8550
+ zoomOnDoubleClick: !1,
8551
+ children: [
8552
+ /* @__PURE__ */ g(bd, {
8553
+ gap: 20,
8554
+ size: 1
8555
+ }),
8556
+ /* @__PURE__ */ g(kd, { showInteractive: !1 }),
8557
+ r.length > 1 ? /* @__PURE__ */ g(Sc, {
8558
+ position: "top-left",
8559
+ children: /* @__PURE__ */ g("nav", {
8560
+ className: "gn-breadcrumbs",
8561
+ "aria-label": "Node group path",
8562
+ children: r.map((e, t) => {
8563
+ let n = t === r.length - 1;
8564
+ return /* @__PURE__ */ _("span", {
8565
+ className: "gn-breadcrumbs__item",
8566
+ children: [t > 0 ? /* @__PURE__ */ g("span", {
8567
+ className: "gn-breadcrumbs__sep",
8568
+ "aria-hidden": "true",
8569
+ children: "›"
8570
+ }) : null, n ? /* @__PURE__ */ g("span", {
8571
+ className: "gn-breadcrumbs__current",
8572
+ "aria-current": "page",
8573
+ children: e.label
8574
+ }) : /* @__PURE__ */ g("button", {
8575
+ type: "button",
8576
+ className: "gn-breadcrumbs__link",
8577
+ onClick: () => i(t),
8578
+ children: e.label
8579
+ })]
8580
+ }, `${e.id}-${t}`);
8581
+ })
8582
+ })
8583
+ }) : null,
8584
+ /* @__PURE__ */ g(Sc, {
8585
+ position: "bottom-right",
8586
+ children: /* @__PURE__ */ g("a", {
8587
+ href: "https://extensions.blender.org/add-ons/tree-clipper/",
8588
+ target: "_blank",
8589
+ rel: "noopener noreferrer",
8590
+ className: "tree-clipper-badge",
8591
+ children: "Exported from Blender using Tree Clipper ↗"
8534
8592
  })
8535
8593
  })
8536
- }) : null,
8537
- /* @__PURE__ */ g(Sc, {
8538
- position: "bottom-right",
8539
- children: /* @__PURE__ */ g("a", {
8540
- href: "https://extensions.blender.org/add-ons/tree-clipper/",
8541
- target: "_blank",
8542
- rel: "noopener noreferrer",
8543
- className: "tree-clipper-badge",
8544
- children: "Exported from Blender using Tree Clipper ↗"
8545
- })
8546
- })
8547
- ]
8594
+ ]
8595
+ })
8548
8596
  });
8549
8597
  }
8550
- function qf(e) {
8551
- let { jsonText: t, showHeader: n = !0 } = e, [r, i] = f({
8598
+ function Yf(e) {
8599
+ let { jsonText: t, showHeader: n = !0, onSelectionChange: r } = e, [i, o] = f({
8552
8600
  json: t,
8553
8601
  ids: []
8554
- }), o = u(() => {
8602
+ }), s = u(() => {
8555
8603
  if (!t.trim()) return null;
8556
8604
  try {
8557
- let { rootId: e, trees: n } = uf(JSON.parse(t)), r = {};
8605
+ let { rootId: e, trees: n } = ff(JSON.parse(t)), r = {};
8558
8606
  for (let e of Object.values(n)) {
8559
- let t = pf(e);
8607
+ let t = hf(e);
8560
8608
  r[t.id] = {
8561
8609
  graph: t,
8562
- flow: _f(t)
8610
+ flow: yf(t)
8563
8611
  };
8564
8612
  }
8565
8613
  return {
@@ -8574,36 +8622,36 @@ function qf(e) {
8574
8622
  error: e instanceof Error ? e.message : String(e)
8575
8623
  };
8576
8624
  }
8577
- }, [t]), s = u(() => {
8578
- if (!o?.views) return [];
8579
- let e = r.json === t ? r.ids : [], n = [o.rootId];
8580
- for (let t of e) o.views[t] && n.push(t);
8625
+ }, [t]), l = u(() => {
8626
+ if (!s?.views) return [];
8627
+ let e = i.json === t ? i.ids : [], n = [s.rootId];
8628
+ for (let t of e) s.views[t] && n.push(t);
8581
8629
  return n;
8582
8630
  }, [
8583
- o,
8584
- r,
8631
+ s,
8632
+ i,
8585
8633
  t
8586
- ]), l = o?.views ? o.views[s[s.length - 1]] : null, d = a((e) => {
8587
- i((n) => ({
8634
+ ]), d = s?.views ? s.views[l[l.length - 1]] : null, p = a((e) => {
8635
+ o((n) => ({
8588
8636
  json: t,
8589
8637
  ids: n.json === t ? [...n.ids, e] : [e]
8590
8638
  }));
8591
- }, [t]), p = u(() => ({ openGroup: d }), [d]);
8639
+ }, [t]), m = u(() => ({ openGroup: p }), [p]);
8592
8640
  c(() => {
8593
- if (s.length <= 1) return;
8641
+ if (l.length <= 1) return;
8594
8642
  function e(e) {
8595
8643
  if (e.key !== "Tab" && e.key !== "Escape" || e.ctrlKey || e.metaKey || e.altKey) return;
8596
8644
  let n = e.target;
8597
- n && (n.isContentEditable || n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.closest(".cm-editor")) || (e.preventDefault(), i({
8645
+ n && (n.isContentEditable || n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.closest(".cm-editor")) || (e.preventDefault(), o({
8598
8646
  json: t,
8599
- ids: s.slice(1, -1)
8647
+ ids: l.slice(1, -1)
8600
8648
  }));
8601
8649
  }
8602
8650
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
8603
- }, [s, t]);
8604
- let m = o?.views ? s.map((e) => ({
8651
+ }, [l, t]);
8652
+ let h = s?.views ? l.map((e) => ({
8605
8653
  id: e,
8606
- label: o.views[e].graph.label
8654
+ label: s.views[e].graph.label
8607
8655
  })) : [];
8608
8656
  return /* @__PURE__ */ _("div", {
8609
8657
  className: "panel flow-panel",
@@ -8615,24 +8663,25 @@ function qf(e) {
8615
8663
  }), /* @__PURE__ */ g("div", {
8616
8664
  className: "panel-status",
8617
8665
  "aria-live": "polite",
8618
- children: l ? `${l.graph.nodes.length} nodes, ${l.graph.edges.length} links` : null
8666
+ children: d ? `${d.graph.nodes.length} nodes, ${d.graph.edges.length} links` : null
8619
8667
  })]
8620
8668
  }) : null, /* @__PURE__ */ g("div", {
8621
8669
  className: "panel-body flow-panel__body",
8622
- children: o?.error ? /* @__PURE__ */ _("div", {
8670
+ children: s?.error ? /* @__PURE__ */ _("div", {
8623
8671
  className: "flow-error",
8624
8672
  role: "alert",
8625
- children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: o.error })]
8626
- }) : l ? /* @__PURE__ */ g(xf.Provider, {
8627
- value: p,
8628
- children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(Kf, {
8629
- nodes: l.flow.nodes,
8630
- edges: l.flow.edges,
8631
- breadcrumbs: m,
8632
- onNavigate: (e) => i({
8673
+ children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: s.error })]
8674
+ }) : d ? /* @__PURE__ */ g(Cf.Provider, {
8675
+ value: m,
8676
+ children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(Jf, {
8677
+ nodes: d.flow.nodes,
8678
+ edges: d.flow.edges,
8679
+ breadcrumbs: h,
8680
+ onNavigate: (e) => o({
8633
8681
  json: t,
8634
- ids: s.slice(1, e + 1)
8635
- })
8682
+ ids: l.slice(1, e + 1)
8683
+ }),
8684
+ onSelectionIds: r
8636
8685
  }) })
8637
8686
  }) : /* @__PURE__ */ g("div", {
8638
8687
  className: "flow-empty",
@@ -8643,7 +8692,7 @@ function qf(e) {
8643
8692
  }
8644
8693
  //#endregion
8645
8694
  //#region src/embed.tsx
8646
- function Jf(e) {
8695
+ function Xf(e) {
8647
8696
  let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0);
8648
8697
  return c(() => {
8649
8698
  let e = !1;
@@ -8665,26 +8714,29 @@ function Jf(e) {
8665
8714
  className: "flow-error",
8666
8715
  role: "alert",
8667
8716
  children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
8668
- }) : /* @__PURE__ */ g(qf, {
8717
+ }) : /* @__PURE__ */ g(Yf, {
8669
8718
  jsonText: n,
8670
8719
  showHeader: !1
8671
8720
  })
8672
8721
  })
8673
8722
  });
8674
8723
  }
8675
- var Yf = null;
8676
- function Xf(e, t) {
8677
- Yf &&= (Yf.unmount(), null), Yf = m(e);
8678
- let r = t.onClose;
8679
- return Yf.render(n(Jf, {
8724
+ var Zf = /* @__PURE__ */ new Map(), Qf = null;
8725
+ function $f(e, t) {
8726
+ Zf.get(e)?.unmount();
8727
+ let r = m(e);
8728
+ Zf.set(e, r), Qf = e;
8729
+ let i = t.onClose;
8730
+ return r.render(n(Xf, {
8680
8731
  ...t,
8681
- onClose: r ? () => {
8682
- Zf(), r();
8732
+ onClose: i ? () => {
8733
+ ep(e), i();
8683
8734
  } : void 0
8684
- })), Zf;
8735
+ })), () => ep(e);
8685
8736
  }
8686
- function Zf() {
8687
- Yf &&= (Yf.unmount(), null);
8737
+ function ep(e) {
8738
+ let t = e ?? Qf;
8739
+ t && (Zf.get(t)?.unmount(), Zf.delete(t), t === Qf && (Qf = null));
8688
8740
  }
8689
8741
  //#endregion
8690
- export { Jf as GraphView, Xf as mountGraphView, Zf as unmountGraphView };
8742
+ export { Xf as GraphView, $f as mountGraphView, ep as unmountGraphView };