geonodes-web-render 0.3.14 → 0.3.15

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
@@ -7824,7 +7824,29 @@ function cf(e) {
7824
7824
  points: r
7825
7825
  };
7826
7826
  }
7827
- function lf(e, t) {
7827
+ function lf(e) {
7828
+ let t = e.data.color_ramp?.data;
7829
+ if (!t) return;
7830
+ let n = (t.elements?.data?.items ?? []).map((e) => {
7831
+ let t = e.data.color;
7832
+ return {
7833
+ position: e.data.position,
7834
+ color: [
7835
+ t[0],
7836
+ t[1],
7837
+ t[2],
7838
+ e.data.alpha ?? t[3] ?? 1
7839
+ ]
7840
+ };
7841
+ });
7842
+ return {
7843
+ interpolation: t.interpolation ?? "LINEAR",
7844
+ colorMode: t.color_mode ?? "RGB",
7845
+ hueInterpolation: t.hue_interpolation ?? "NEAR",
7846
+ stops: n
7847
+ };
7848
+ }
7849
+ function uf(e, t) {
7828
7850
  let n = sf[t ?? "RGB"] ?? sf.RGB, r = sf.RGB;
7829
7851
  return e.map((e) => {
7830
7852
  let t = r.indexOf(e.name);
@@ -7834,10 +7856,10 @@ function lf(e, t) {
7834
7856
  };
7835
7857
  });
7836
7858
  }
7837
- function uf(e) {
7859
+ function df(e) {
7838
7860
  return e.replace(/\.\d{3}$/, "");
7839
7861
  }
7840
- function df(e, t) {
7862
+ function ff(e, t) {
7841
7863
  let n = of(e.data.socket_idname ?? ""), r = Zd(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7842
7864
  id: e,
7843
7865
  name: "",
@@ -7860,10 +7882,11 @@ function df(e, t) {
7860
7882
  width: 0,
7861
7883
  headerColor: "",
7862
7884
  inputs: [o(i)],
7863
- outputs: [o(a)]
7885
+ outputs: [o(a)],
7886
+ ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
7864
7887
  };
7865
7888
  }
7866
- function ff(e) {
7889
+ function pf(e) {
7867
7890
  return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
7868
7891
  kind: "vec",
7869
7892
  values: e
@@ -7872,20 +7895,20 @@ function ff(e) {
7872
7895
  value: e
7873
7896
  } : null;
7874
7897
  }
7875
- function pf(e, t) {
7898
+ function mf(e, t) {
7876
7899
  return {
7877
7900
  id: String(e.id),
7878
7901
  name: e.data.name,
7879
7902
  dataType: e.data.type,
7880
7903
  displayShape: e.data.display_shape,
7881
7904
  color: Zd(e.data.type),
7882
- defaultValue: ff(e.data.default_value),
7905
+ defaultValue: pf(e.data.default_value),
7883
7906
  hideValue: e.data.hide_value ?? !1,
7884
7907
  enabled: e.data.enabled ?? !0,
7885
7908
  index: t
7886
7909
  };
7887
7910
  }
7888
- function mf(e) {
7911
+ function hf(e) {
7889
7912
  if (e.data.bl_idname === "FunctionNodeCompare") {
7890
7913
  let t = {};
7891
7914
  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;
@@ -7895,7 +7918,7 @@ function mf(e) {
7895
7918
  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;
7896
7919
  }
7897
7920
  }
7898
- function hf(e, t) {
7921
+ function gf(e, t) {
7899
7922
  if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
7900
7923
  if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
7901
7924
  if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
@@ -7905,10 +7928,10 @@ function hf(e, t) {
7905
7928
  nodes: e.data.nodes.data.items.map((e, t) => {
7906
7929
  if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
7907
7930
  let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
7908
- if (e.data.bl_idname === "NodeReroute") return df(e, n);
7931
+ if (e.data.bl_idname === "NodeReroute") return ff(e, n);
7909
7932
  let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
7910
7933
  if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
7911
- return pf(t, n);
7934
+ return mf(t, n);
7912
7935
  });
7913
7936
  e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
7914
7937
  ...r[0],
@@ -7919,14 +7942,14 @@ function hf(e, t) {
7919
7942
  });
7920
7943
  let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
7921
7944
  if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
7922
- return pf(t, n);
7945
+ return mf(t, n);
7923
7946
  });
7924
- (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = lf(i, e.data.mode));
7925
- let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? cf(e) : void 0, o = mf(e);
7947
+ (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = uf(i, e.data.mode));
7948
+ let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? cf(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? lf(e) : void 0, s = hf(e);
7926
7949
  return {
7927
7950
  id: String(e.id),
7928
7951
  type: e.data.bl_idname,
7929
- label: e.data.label || uf(e.data.name),
7952
+ label: e.data.label || df(e.data.name),
7930
7953
  position: {
7931
7954
  x: n[0],
7932
7955
  y: -n[1]
@@ -7936,8 +7959,10 @@ function hf(e, t) {
7936
7959
  inputs: i,
7937
7960
  outputs: r,
7938
7961
  floatCurve: a,
7939
- ...o ? { properties: o } : {},
7940
- ...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) }
7962
+ colorRamp: o,
7963
+ ...s ? { properties: s } : {},
7964
+ ...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) },
7965
+ ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
7941
7966
  };
7942
7967
  }),
7943
7968
  links: e.data.links.data.items.map((e, t) => {
@@ -7950,12 +7975,12 @@ function hf(e, t) {
7950
7975
  })
7951
7976
  };
7952
7977
  }
7953
- function gf(e) {
7978
+ function _f(e) {
7954
7979
  if (!e || typeof e != "object") throw Error("JSON root must be an object.");
7955
7980
  if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
7956
7981
  let t = {};
7957
7982
  for (let n = 0; n < e.node_trees.length; n++) {
7958
- let r = hf(e.node_trees[n], n);
7983
+ let r = gf(e.node_trees[n], n);
7959
7984
  t[r.id] = r;
7960
7985
  }
7961
7986
  let n = /* @__PURE__ */ new Set();
@@ -7974,21 +7999,21 @@ function gf(e) {
7974
7999
  trees: t
7975
8000
  };
7976
8001
  }
7977
- function _f(e, t) {
8002
+ function vf(e, t) {
7978
8003
  return {
7979
8004
  ...t,
7980
8005
  nodeId: e,
7981
8006
  direction: "input"
7982
8007
  };
7983
8008
  }
7984
- function vf(e, t) {
8009
+ function yf(e, t) {
7985
8010
  return {
7986
8011
  ...t,
7987
8012
  nodeId: e,
7988
8013
  direction: "output"
7989
8014
  };
7990
8015
  }
7991
- function yf(e) {
8016
+ function bf(e) {
7992
8017
  let t = e.nodes.map((e) => ({
7993
8018
  id: e.id,
7994
8019
  type: e.type,
@@ -7996,12 +8021,14 @@ function yf(e) {
7996
8021
  position: e.position,
7997
8022
  width: e.width,
7998
8023
  headerColor: e.headerColor,
7999
- inputs: e.inputs.map((t) => _f(e.id, t)),
8000
- outputs: e.outputs.map((t) => vf(e.id, t)),
8024
+ inputs: e.inputs.map((t) => vf(e.id, t)),
8025
+ outputs: e.outputs.map((t) => yf(e.id, t)),
8001
8026
  floatCurve: e.floatCurve,
8027
+ colorRamp: e.colorRamp,
8002
8028
  properties: e.properties,
8003
8029
  groupTreeId: e.groupTreeId,
8004
- groupTreeName: e.groupTreeName
8030
+ groupTreeName: e.groupTreeName,
8031
+ parentFrameId: e.parentFrameId
8005
8032
  })), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
8006
8033
  for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
8007
8034
  let i = e.links.map((e) => ({
@@ -8021,11 +8048,58 @@ function yf(e) {
8021
8048
  }
8022
8049
  //#endregion
8023
8050
  //#region src/gn/xyflow/mapGraphIRToFlow.ts
8024
- function bf(e) {
8051
+ function xf(e) {
8025
8052
  let t = Math.max(e.inputs.length, e.outputs.length);
8026
8053
  return Math.max(60, 32 + t * 18 + 16);
8027
8054
  }
8028
- function xf(e, t) {
8055
+ function Sf(e) {
8056
+ return e.type === "NodeReroute" ? {
8057
+ w: 12,
8058
+ h: 12
8059
+ } : {
8060
+ w: e.width,
8061
+ h: xf(e)
8062
+ };
8063
+ }
8064
+ function Cf(e) {
8065
+ let t = e.nodes.filter((e) => e.type === "NodeFrame");
8066
+ if (t.length === 0) return [];
8067
+ let n = /* @__PURE__ */ new Map();
8068
+ for (let t of e.nodes) {
8069
+ if (!t.parentFrameId) continue;
8070
+ let e = n.get(t.parentFrameId) ?? [];
8071
+ e.push(t), n.set(t.parentFrameId, e);
8072
+ }
8073
+ let r = [];
8074
+ for (let e of t) {
8075
+ let t = n.get(e.id) ?? [];
8076
+ if (t.length === 0) continue;
8077
+ let i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
8078
+ for (let e of t) {
8079
+ let { w: t, h: n } = Sf(e);
8080
+ i = Math.min(i, e.position.x), a = Math.min(a, e.position.y), o = Math.max(o, e.position.x + t), s = Math.max(s, e.position.y + n);
8081
+ }
8082
+ Number.isFinite(i) && r.push({
8083
+ id: `frame:${e.id}`,
8084
+ type: "nodeFrame",
8085
+ position: {
8086
+ x: i - 28,
8087
+ y: a - 48
8088
+ },
8089
+ draggable: !1,
8090
+ selectable: !1,
8091
+ connectable: !1,
8092
+ data: { label: e.label },
8093
+ style: {
8094
+ width: o - i + 56,
8095
+ height: s - a + 48 + 28,
8096
+ zIndex: -8
8097
+ }
8098
+ });
8099
+ }
8100
+ return r;
8101
+ }
8102
+ function wf(e, t) {
8029
8103
  if (e.type === "NodeReroute") {
8030
8104
  let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
8031
8105
  return {
@@ -8059,13 +8133,14 @@ function xf(e, t) {
8059
8133
  outputs: e.outputs,
8060
8134
  connectedInputIds: e.inputs.filter((e) => t.has(e.id)).map((e) => e.id),
8061
8135
  floatCurve: e.floatCurve,
8136
+ colorRamp: e.colorRamp,
8062
8137
  properties: e.properties,
8063
8138
  groupTreeId: e.groupTreeId,
8064
8139
  groupTreeName: e.groupTreeName
8065
8140
  }
8066
8141
  };
8067
8142
  }
8068
- function Sf(e, t, n) {
8143
+ function Tf(e, t, n) {
8069
8144
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
8070
8145
  for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
8071
8146
  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);
@@ -8089,26 +8164,26 @@ function Sf(e, t, n) {
8089
8164
  for (let e of a) s.has(e) && l.add(e);
8090
8165
  return l;
8091
8166
  }
8092
- function Cf(e) {
8093
- let t = new Set(e.edges.map((e) => e.targetSocketId)), n = e.nodes.map((e) => xf(e, t)), r = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), a = n;
8094
- if (r && i) {
8095
- let t = Sf(r.id, i.id, e);
8167
+ function Ef(e) {
8168
+ let t = new Set(e.edges.map((e) => e.targetSocketId)), n = Cf(e), r = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => wf(e, t)), i = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), o = r;
8169
+ if (i && a) {
8170
+ let t = Tf(i.id, a.id, e);
8096
8171
  if (t.size > 0) {
8097
- let i = new Map(e.nodes.map((e) => [e.id, e])), o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
8172
+ let n = new Map(e.nodes.map((e) => [e.id, e])), a = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
8098
8173
  for (let e of t) {
8099
- let t = i.get(e);
8174
+ let t = n.get(e);
8100
8175
  if (!t) continue;
8101
- let n = t.width, r = bf(t);
8102
- 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);
8176
+ let r = t.width, i = xf(t);
8177
+ a = Math.min(a, t.position.x), s = Math.min(s, t.position.y), c = Math.max(c, t.position.x + r), l = Math.max(l, t.position.y + i);
8103
8178
  }
8104
- if (Number.isFinite(o) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
8105
- let e = o - 64, i = s - 64, u = c - o + 128, d = l - s + 128, f = `zone:simulation:${r.id}`;
8106
- a = [{
8179
+ if (Number.isFinite(a) && Number.isFinite(s) && Number.isFinite(c) && Number.isFinite(l)) {
8180
+ let e = a - 64, n = s - 64, u = c - a + 128, d = l - s + 128, f = `zone:simulation:${i.id}`;
8181
+ o = [{
8107
8182
  id: f,
8108
8183
  type: "simulationZone",
8109
8184
  position: {
8110
8185
  x: e,
8111
- y: i
8186
+ y: n
8112
8187
  },
8113
8188
  draggable: !1,
8114
8189
  selectable: !1,
@@ -8119,20 +8194,20 @@ function Cf(e) {
8119
8194
  height: d,
8120
8195
  zIndex: -10
8121
8196
  }
8122
- }, ...n.map((n) => t.has(n.id) ? {
8123
- ...n,
8197
+ }, ...r.map((r) => t.has(r.id) ? {
8198
+ ...r,
8124
8199
  parentId: f,
8125
8200
  extent: "parent",
8126
8201
  position: {
8127
- x: n.position.x - e,
8128
- y: n.position.y - i
8202
+ x: r.position.x - e,
8203
+ y: r.position.y - n
8129
8204
  }
8130
- } : n)];
8205
+ } : r)];
8131
8206
  }
8132
8207
  }
8133
8208
  }
8134
8209
  return {
8135
- nodes: a,
8210
+ nodes: [...n, ...o],
8136
8211
  edges: e.edges.map((e) => ({
8137
8212
  id: e.id,
8138
8213
  source: e.sourceNodeId,
@@ -8146,7 +8221,7 @@ function Cf(e) {
8146
8221
  }
8147
8222
  //#endregion
8148
8223
  //#region src/gn/exporter/nodebpyExporter.ts
8149
- function wf(e, t) {
8224
+ function Df(e, t) {
8150
8225
  let n = e.node_trees;
8151
8226
  if (!Array.isArray(n) || t.size === 0) return e;
8152
8227
  let r = new Map(n.map((e) => [e.id, e])), i = /* @__PURE__ */ new Set(), a = [];
@@ -8206,25 +8281,25 @@ function wf(e, t) {
8206
8281
  }
8207
8282
  //#endregion
8208
8283
  //#region src/utils/encodeTreeClipperPayload.ts
8209
- var Tf = "TreeClipper::";
8210
- function Ef(e) {
8284
+ var Of = "TreeClipper::";
8285
+ function kf(e) {
8211
8286
  let t = "", n = 32768;
8212
8287
  for (let r = 0; r < e.length; r += n) t += String.fromCharCode(...e.subarray(r, r + n));
8213
8288
  return btoa(t);
8214
8289
  }
8215
- async function Df(e) {
8290
+ async function Af(e) {
8216
8291
  let t = new Blob([e]).stream().pipeThrough(new CompressionStream("gzip")), n = await new Response(t).arrayBuffer();
8217
8292
  return new Uint8Array(n);
8218
8293
  }
8219
- async function Of(e) {
8220
- return Tf + Ef(await Df(new TextEncoder().encode(e)));
8294
+ async function jf(e) {
8295
+ return Of + kf(await Af(new TextEncoder().encode(e)));
8221
8296
  }
8222
8297
  //#endregion
8223
8298
  //#region src/gn/ir/curvePath.ts
8224
- function kf(e, t) {
8299
+ function Mf(e, t) {
8225
8300
  return Math.sqrt(e * e + t * t);
8226
8301
  }
8227
- function Af(e) {
8302
+ function Nf(e) {
8228
8303
  let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
8229
8304
  let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
8230
8305
  if (i === "VECTOR") return {
@@ -8234,11 +8309,11 @@ function Af(e) {
8234
8309
  let c = 0, l = 0, u = 0, d = 0;
8235
8310
  if (o && s) {
8236
8311
  let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
8237
- if (u = kf(e, t), d = kf(i, a), u > 1e-8 && d > 1e-8) {
8238
- let n = e / u + i / d, r = t / u + a / d, o = kf(n, r);
8312
+ if (u = Mf(e, t), d = Mf(i, a), u > 1e-8 && d > 1e-8) {
8313
+ let n = e / u + i / d, r = t / u + a / d, o = Mf(n, r);
8239
8314
  o > 1e-8 && (c = n / o, l = r / o);
8240
8315
  } 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);
8241
- } else s ? (d = kf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = kf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8316
+ } else s ? (d = Mf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = Mf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8242
8317
  let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
8243
8318
  if (i === "AUTO_CLAMPED") {
8244
8319
  if (o) {
@@ -8283,7 +8358,7 @@ function Af(e) {
8283
8358
  }
8284
8359
  return n;
8285
8360
  }
8286
- function jf(e, t, n, r, i, a, o) {
8361
+ function Pf(e, t, n, r, i, a, o) {
8287
8362
  let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
8288
8363
  if (e.length < 2) return {
8289
8364
  strokePath: "",
@@ -8291,7 +8366,7 @@ function jf(e, t, n, r, i, a, o) {
8291
8366
  zeroLinePath: "",
8292
8367
  dotPositions: []
8293
8368
  };
8294
- let d = Af(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8369
+ let d = Nf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8295
8370
  for (let t = 0; t < e.length - 1; t++) {
8296
8371
  let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
8297
8372
  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)}`;
@@ -8305,19 +8380,217 @@ function jf(e, t, n, r, i, a, o) {
8305
8380
  };
8306
8381
  }
8307
8382
  //#endregion
8383
+ //#region src/gn/components/ColorRampViz.tsx
8384
+ function Ff([e, t, n]) {
8385
+ let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
8386
+ i !== 0 && (a = r === e ? (t - n) / i % 6 : r === t ? (n - e) / i + 2 : (e - t) / i + 4, a /= 6, a < 0 && (a += 1));
8387
+ let o = r === 0 ? 0 : i / r;
8388
+ return [
8389
+ a,
8390
+ o,
8391
+ r
8392
+ ];
8393
+ }
8394
+ function If([e, t, n]) {
8395
+ if (t === 0) return [
8396
+ n,
8397
+ n,
8398
+ n
8399
+ ];
8400
+ let r = Math.floor(e * 6), i = e * 6 - r, a = n * (1 - t), o = n * (1 - t * i), s = n * (1 - t * (1 - i));
8401
+ switch ((r % 6 + 6) % 6) {
8402
+ case 0: return [
8403
+ n,
8404
+ s,
8405
+ a
8406
+ ];
8407
+ case 1: return [
8408
+ o,
8409
+ n,
8410
+ a
8411
+ ];
8412
+ case 2: return [
8413
+ a,
8414
+ n,
8415
+ s
8416
+ ];
8417
+ case 3: return [
8418
+ a,
8419
+ o,
8420
+ n
8421
+ ];
8422
+ case 4: return [
8423
+ s,
8424
+ a,
8425
+ n
8426
+ ];
8427
+ default: return [
8428
+ n,
8429
+ a,
8430
+ o
8431
+ ];
8432
+ }
8433
+ }
8434
+ function Lf([e, t, n]) {
8435
+ let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2, o = r - i, s = 0, c = 0;
8436
+ return o !== 0 && (c = a > .5 ? o / (2 - r - i) : o / (r + i), s = r === e ? (t - n) / o % 6 : r === t ? (n - e) / o + 2 : (e - t) / o + 4, s /= 6, s < 0 && (s += 1)), [
8437
+ s,
8438
+ c,
8439
+ a
8440
+ ];
8441
+ }
8442
+ function Rf([e, t, n]) {
8443
+ if (t === 0) return [
8444
+ n,
8445
+ n,
8446
+ n
8447
+ ];
8448
+ let r = n < .5 ? n * (1 + t) : n + t - n * t, i = 2 * n - r, a = (e) => (e < 0 && (e += 1), e > 1 && --e, e < 1 / 6 ? i + (r - i) * 6 * e : e < 1 / 2 ? r : e < 2 / 3 ? i + (r - i) * (2 / 3 - e) * 6 : i);
8449
+ return [
8450
+ a(e + 1 / 3),
8451
+ a(e),
8452
+ a(e - 1 / 3)
8453
+ ];
8454
+ }
8455
+ var zf = (e) => e < 1 ? e : e - 1;
8456
+ function Bf(e, t, n, r, i) {
8457
+ let a = zf((r % 1 + 1) % 1), o = zf((i % 1 + 1) % 1), s = 0;
8458
+ switch (e) {
8459
+ case "NEAR":
8460
+ a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
8461
+ break;
8462
+ case "FAR":
8463
+ a === o || a < o && o - a < .5 ? s = 1 : a > o && o - a > -.5 && (s = 2);
8464
+ break;
8465
+ case "CCW":
8466
+ a > o && (s = 2);
8467
+ break;
8468
+ case "CW":
8469
+ a < o && (s = 1);
8470
+ break;
8471
+ }
8472
+ let c = (e, r) => t * e + n * r;
8473
+ return s === 1 ? zf(c(a + 1, o)) : s === 2 ? zf(c(a, o + 1)) : c(a, o);
8474
+ }
8475
+ function Vf(e, t) {
8476
+ let n = [...e.stops].sort((e, t) => e.position - t.position);
8477
+ if (n.length === 0) return [
8478
+ 0,
8479
+ 0,
8480
+ 0,
8481
+ 1
8482
+ ];
8483
+ if (n.length === 1) return n[0].color;
8484
+ let r = e.colorMode === "RGB" ? e.interpolation : "LINEAR";
8485
+ if (t <= n[0].position) return n[0].color;
8486
+ if (t >= n[n.length - 1].position) return n[n.length - 1].color;
8487
+ let i = 0;
8488
+ for (; i < n.length - 1 && n[i + 1].position <= t;) i++;
8489
+ let a = n[i], o = n[i + 1];
8490
+ if (r === "CONSTANT") return a.color;
8491
+ let s = o.position - a.position, c = s === 0 ? 0 : (t - a.position) / s;
8492
+ r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
8493
+ let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
8494
+ if (e.colorMode === "HSV" || e.colorMode === "HSL") {
8495
+ let t = e.colorMode === "HSV" ? Ff : Lf, n = e.colorMode === "HSV" ? If : Rf, r = t([
8496
+ a.color[0],
8497
+ a.color[1],
8498
+ a.color[2]
8499
+ ]), i = t([
8500
+ o.color[0],
8501
+ o.color[1],
8502
+ o.color[2]
8503
+ ]), [s, c, f] = n([
8504
+ Bf(e.hueInterpolation, l, u, i[0], r[0]),
8505
+ u * r[1] + l * i[1],
8506
+ u * r[2] + l * i[2]
8507
+ ]);
8508
+ return [
8509
+ s,
8510
+ c,
8511
+ f,
8512
+ d
8513
+ ];
8514
+ }
8515
+ return [
8516
+ u * a.color[0] + l * o.color[0],
8517
+ u * a.color[1] + l * o.color[1],
8518
+ u * a.color[2] + l * o.color[2],
8519
+ d
8520
+ ];
8521
+ }
8522
+ function Hf(e) {
8523
+ let t = Math.min(1, Math.max(0, e));
8524
+ return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
8525
+ }
8526
+ function Uf([e, t, n, r]) {
8527
+ let i = (e) => Math.round(Hf(e) * 255);
8528
+ return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
8529
+ }
8530
+ var Wf = {
8531
+ NEAR: "Near",
8532
+ FAR: "Far",
8533
+ CW: "CW",
8534
+ CCW: "CCW"
8535
+ }, Gf = 64;
8536
+ function Kf({ data: e, width: t }) {
8537
+ let n = [];
8538
+ for (let t = 0; t <= Gf; t++) {
8539
+ let r = t / Gf;
8540
+ n.push(`${Uf(Vf(e, r))} ${(r * 100).toFixed(1)}%`);
8541
+ }
8542
+ let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
8543
+ return /* @__PURE__ */ _("div", {
8544
+ className: "gn-color-ramp",
8545
+ style: { width: t },
8546
+ children: [
8547
+ /* @__PURE__ */ _("div", {
8548
+ className: "gn-color-ramp__row",
8549
+ children: [/* @__PURE__ */ g("span", {
8550
+ className: "gn-color-ramp__select",
8551
+ children: e.colorMode
8552
+ }), /* @__PURE__ */ g("span", {
8553
+ className: "gn-color-ramp__select",
8554
+ children: Wf[e.hueInterpolation] ?? e.hueInterpolation
8555
+ })]
8556
+ }),
8557
+ /* @__PURE__ */ _("div", {
8558
+ className: "gn-color-ramp__bar-wrap",
8559
+ children: [/* @__PURE__ */ g("div", {
8560
+ className: "gn-color-ramp__checker",
8561
+ style: { backgroundImage: r }
8562
+ }), i.map((e, t) => /* @__PURE__ */ g("span", {
8563
+ className: `gn-color-ramp__stop${e === a ? " is-active" : ""}`,
8564
+ style: { left: `${e.position * 100}%` }
8565
+ }, t))]
8566
+ }),
8567
+ a && /* @__PURE__ */ _("div", {
8568
+ className: "gn-color-ramp__row gn-color-ramp__active",
8569
+ children: [/* @__PURE__ */ _("span", {
8570
+ className: "gn-color-ramp__pos",
8571
+ children: ["Pos ", a.position.toFixed(3)]
8572
+ }), /* @__PURE__ */ g("span", {
8573
+ className: "gn-color-ramp__swatch",
8574
+ style: { background: Uf(a.color) }
8575
+ })]
8576
+ })
8577
+ ]
8578
+ });
8579
+ }
8580
+ //#endregion
8308
8581
  //#region src/gn/components/groupNavContext.ts
8309
- var Mf = t(null);
8310
- function Nf() {
8311
- return o(Mf);
8582
+ var qf = t(null);
8583
+ function Jf() {
8584
+ return o(qf);
8312
8585
  }
8313
8586
  //#endregion
8314
8587
  //#region src/gn/components/GenericGNNode.tsx
8315
- var Pf = [
8588
+ var Yf = [
8316
8589
  "X",
8317
8590
  "Y",
8318
8591
  "Z",
8319
8592
  "W"
8320
- ], Ff = {
8593
+ ], Xf = {
8321
8594
  FLOAT: "Float",
8322
8595
  INT: "Integer",
8323
8596
  VECTOR: "Vector",
@@ -8325,7 +8598,7 @@ var Pf = [
8325
8598
  STRING: "String",
8326
8599
  BOOLEAN: "Boolean",
8327
8600
  ROTATION: "Rotation"
8328
- }, If = {
8601
+ }, Zf = {
8329
8602
  EQUAL: "Equal",
8330
8603
  NOT_EQUAL: "Not Equal",
8331
8604
  LESS_THAN: "Less Than",
@@ -8371,10 +8644,10 @@ var Pf = [
8371
8644
  RADIANS: "To Radians",
8372
8645
  DEGREES: "To Degrees"
8373
8646
  };
8374
- function Lf(e, t) {
8375
- return e === "data_type" ? Ff[t] ?? t : e === "operation" ? If[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8647
+ function Qf(e, t) {
8648
+ return e === "data_type" ? Xf[t] ?? t : e === "operation" ? Zf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8376
8649
  }
8377
- function Rf(e) {
8650
+ function $f(e) {
8378
8651
  switch (e) {
8379
8652
  case "LINE": return "gn-socket--line";
8380
8653
  case "DIAMOND": return "gn-socket--diamond";
@@ -8383,55 +8656,55 @@ function Rf(e) {
8383
8656
  default: return "gn-socket--circle";
8384
8657
  }
8385
8658
  }
8386
- function zf(e) {
8659
+ function ep(e) {
8387
8660
  return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
8388
8661
  }
8389
- function Bf(e) {
8662
+ function tp(e) {
8390
8663
  return parseFloat(e.toFixed(3)).toString();
8391
8664
  }
8392
- function Vf(e, t) {
8393
- return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${Bf(e)}${zf(t)}`;
8665
+ function np(e, t) {
8666
+ return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${tp(e)}${ep(t)}`;
8394
8667
  }
8395
- function Hf(e) {
8668
+ function rp(e) {
8396
8669
  return Math.round(Math.min(1, Math.max(0, e)) * 255);
8397
8670
  }
8398
- function Uf(e) {
8671
+ function ip(e) {
8399
8672
  let [t, n, r, i = 1] = e.values;
8400
8673
  return /* @__PURE__ */ g("div", {
8401
8674
  className: "gn-node__color-swatch",
8402
- style: { background: `rgba(${Hf(t)},${Hf(n)},${Hf(r)},${i.toFixed(2)})` }
8675
+ style: { background: `rgba(${rp(t)},${rp(n)},${rp(r)},${i.toFixed(2)})` }
8403
8676
  });
8404
8677
  }
8405
- function Wf(e) {
8406
- if (e.dataType === "RGBA") return /* @__PURE__ */ g(Uf, { values: e.values });
8407
- let t = zf(e.dataType);
8678
+ function ap(e) {
8679
+ if (e.dataType === "RGBA") return /* @__PURE__ */ g(ip, { values: e.values });
8680
+ let t = ep(e.dataType);
8408
8681
  return /* @__PURE__ */ g("div", {
8409
8682
  className: "gn-node__vec-block",
8410
8683
  children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
8411
8684
  className: "gn-node__vec-row",
8412
8685
  children: [/* @__PURE__ */ g("span", {
8413
8686
  className: "gn-node__vec-label",
8414
- children: Pf[n]
8687
+ children: Yf[n]
8415
8688
  }), /* @__PURE__ */ _("span", {
8416
8689
  className: "gn-node__vec-value",
8417
- children: [Bf(e), t]
8690
+ children: [tp(e), t]
8418
8691
  })]
8419
8692
  }, n))
8420
8693
  });
8421
8694
  }
8422
- function Gf({ properties: e }) {
8695
+ function op({ properties: e }) {
8423
8696
  let t = Object.entries(e);
8424
8697
  return t.length === 0 ? null : /* @__PURE__ */ g("div", {
8425
8698
  className: "gn-node__props",
8426
8699
  children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
8427
8700
  className: "gn-node__prop-row",
8428
- children: Lf(e, t)
8701
+ children: Qf(e, t)
8429
8702
  }, e))
8430
8703
  });
8431
8704
  }
8432
- var Kf = 120, qf = 6;
8433
- function Jf({ curve: e, width: t }) {
8434
- let n = Math.max(10, t - qf * 2), r = Kf, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = jf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8705
+ var sp = 120, cp = 6;
8706
+ function lp({ curve: e, width: t }) {
8707
+ let n = Math.max(10, t - cp * 2), r = sp, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Pf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8435
8708
  return /* @__PURE__ */ g("div", {
8436
8709
  className: "gn-node__curve-wrap",
8437
8710
  children: /* @__PURE__ */ _("svg", {
@@ -8462,7 +8735,7 @@ function Jf({ curve: e, width: t }) {
8462
8735
  })
8463
8736
  });
8464
8737
  }
8465
- function Yf(e) {
8738
+ function up(e) {
8466
8739
  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";
8467
8740
  return /* @__PURE__ */ _("div", {
8468
8741
  className: `gn-node__socket-row gn-node__socket-row--${i}`,
@@ -8471,7 +8744,7 @@ function Yf(e) {
8471
8744
  id: t.id,
8472
8745
  type: r,
8473
8746
  position: n,
8474
- className: `gn-socket ${Rf(t.displayShape)}`,
8747
+ className: `gn-socket ${$f(t.displayShape)}`,
8475
8748
  style: {
8476
8749
  top: "50%",
8477
8750
  background: t.color,
@@ -8484,15 +8757,15 @@ function Yf(e) {
8484
8757
  }),
8485
8758
  s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
8486
8759
  className: "gn-node__value",
8487
- children: Vf(t.defaultValue.value, t.dataType)
8760
+ children: np(t.defaultValue.value, t.dataType)
8488
8761
  }) : null
8489
8762
  ]
8490
8763
  });
8491
8764
  }
8492
- function Xf(e, t) {
8765
+ function dp(e, t) {
8493
8766
  return !t && !e.hideValue && e.defaultValue?.kind === "vec";
8494
8767
  }
8495
- function Zf() {
8768
+ function fp() {
8496
8769
  return /* @__PURE__ */ _("div", {
8497
8770
  className: "gn-node__stack",
8498
8771
  "aria-hidden": "true",
@@ -8503,8 +8776,8 @@ function Zf() {
8503
8776
  ]
8504
8777
  });
8505
8778
  }
8506
- function Qf(e) {
8507
- let t = e.data, n = Nf(), 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;
8779
+ function pp(e) {
8780
+ let t = e.data, n = Jf(), 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;
8508
8781
  return /* @__PURE__ */ _("div", {
8509
8782
  className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
8510
8783
  onClick: s ? () => n.openGroup(o) : void 0,
@@ -8519,40 +8792,47 @@ function Qf(e) {
8519
8792
  children: t.label
8520
8793
  })
8521
8794
  }),
8522
- s && /* @__PURE__ */ g(Zf, {}),
8523
- t.properties && /* @__PURE__ */ g(Gf, { properties: t.properties }),
8524
- t.floatCurve && /* @__PURE__ */ g(Jf, {
8795
+ s && /* @__PURE__ */ g(fp, {}),
8796
+ t.properties && /* @__PURE__ */ g(op, { properties: t.properties }),
8797
+ t.floatCurve && /* @__PURE__ */ g(lp, {
8525
8798
  curve: t.floatCurve,
8526
8799
  width: t.width
8527
8800
  }),
8528
8801
  /* @__PURE__ */ _("div", {
8529
8802
  className: "gn-node__body",
8530
- children: [i.map((e) => /* @__PURE__ */ g(Yf, {
8531
- socket: e,
8532
- position: Y.Right,
8533
- type: "source",
8534
- align: "right",
8535
- suppressDefault: !0
8536
- }, e.id)), a.map((e) => {
8537
- let t = r.has(e.id);
8538
- return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(Yf, {
8803
+ children: [
8804
+ i.map((e) => /* @__PURE__ */ g(up, {
8539
8805
  socket: e,
8540
- position: Y.Left,
8541
- type: "target",
8542
- align: "left",
8543
- suppressDefault: t
8544
- }), Xf(e, t) ? /* @__PURE__ */ g(Wf, {
8545
- values: e.defaultValue.values,
8546
- dataType: e.dataType
8547
- }) : null] }, e.id);
8548
- })]
8806
+ position: Y.Right,
8807
+ type: "source",
8808
+ align: "right",
8809
+ suppressDefault: !0
8810
+ }, e.id)),
8811
+ t.colorRamp && /* @__PURE__ */ g(Kf, {
8812
+ data: t.colorRamp,
8813
+ width: t.width
8814
+ }),
8815
+ a.map((e) => {
8816
+ let t = r.has(e.id);
8817
+ return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(up, {
8818
+ socket: e,
8819
+ position: Y.Left,
8820
+ type: "target",
8821
+ align: "left",
8822
+ suppressDefault: t
8823
+ }), dp(e, t) ? /* @__PURE__ */ g(ap, {
8824
+ values: e.defaultValue.values,
8825
+ dataType: e.dataType
8826
+ }) : null] }, e.id);
8827
+ })
8828
+ ]
8549
8829
  })
8550
8830
  ]
8551
8831
  });
8552
8832
  }
8553
8833
  //#endregion
8554
8834
  //#region src/gn/components/RerouteNode.tsx
8555
- function $f(e) {
8835
+ function mp(e) {
8556
8836
  let t = e.data;
8557
8837
  return /* @__PURE__ */ _("div", {
8558
8838
  className: "gn-reroute",
@@ -8572,7 +8852,7 @@ function $f(e) {
8572
8852
  }
8573
8853
  //#endregion
8574
8854
  //#region src/gn/components/SimulationZoneFrame.tsx
8575
- function ep(e) {
8855
+ function hp(e) {
8576
8856
  let t = e.data;
8577
8857
  return /* @__PURE__ */ g("div", {
8578
8858
  className: "gn-sim-zone",
@@ -8598,13 +8878,44 @@ function ep(e) {
8598
8878
  });
8599
8879
  }
8600
8880
  //#endregion
8881
+ //#region src/gn/components/NodeFrame.tsx
8882
+ function gp(e) {
8883
+ let t = e.data;
8884
+ return /* @__PURE__ */ g("div", {
8885
+ className: "gn-node-frame",
8886
+ style: {
8887
+ width: "100%",
8888
+ height: "100%",
8889
+ borderRadius: 10,
8890
+ border: "1px solid rgba(255, 255, 255, 0.09)",
8891
+ background: "rgba(255, 255, 255, 0.035)",
8892
+ pointerEvents: "none"
8893
+ },
8894
+ children: t?.label ? /* @__PURE__ */ g("div", {
8895
+ style: {
8896
+ textAlign: "center",
8897
+ padding: "10px 12px",
8898
+ fontSize: 15,
8899
+ fontWeight: 500,
8900
+ color: "rgba(235, 235, 235, 0.6)",
8901
+ userSelect: "none",
8902
+ whiteSpace: "nowrap",
8903
+ overflow: "hidden",
8904
+ textOverflow: "ellipsis"
8905
+ },
8906
+ children: t.label
8907
+ }) : null
8908
+ });
8909
+ }
8910
+ //#endregion
8601
8911
  //#region src/gn/components/GeometryNodesFlow.tsx
8602
- var tp = {
8603
- gnNode: Qf,
8604
- rerouteNode: $f,
8605
- simulationZone: ep
8606
- }, np = { padding: .08 };
8607
- function rp(e) {
8912
+ var _p = {
8913
+ gnNode: pp,
8914
+ rerouteNode: mp,
8915
+ simulationZone: hp,
8916
+ nodeFrame: gp
8917
+ }, vp = { padding: .08 };
8918
+ function yp(e) {
8608
8919
  let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, zoomOnScroll: u = !0 } = e, { fitView: p, getNodes: m, getNodesBounds: h } = ll(), v = hd(), y = d(null), b = d(!1), x = d([]), [S, C] = f(null), [w, T] = f(!1), [E, D] = f(!1), O = d([]), [k, A, j] = fd(t), [M, N, P] = pd(n), [F, I] = f(void 0);
8609
8920
  c(() => {
8610
8921
  if (!v) return;
@@ -8616,7 +8927,7 @@ function rp(e) {
8616
8927
  m,
8617
8928
  h
8618
8929
  ]), c(() => {
8619
- A(t), s?.([]), b.current = !1, p(np);
8930
+ A(t), s?.([]), b.current = !1, p(vp);
8620
8931
  }, [
8621
8932
  t,
8622
8933
  A,
@@ -8628,7 +8939,7 @@ function rp(e) {
8628
8939
  let e = y.current;
8629
8940
  if (!e) return;
8630
8941
  let t = new ResizeObserver(() => {
8631
- b.current || p(np);
8942
+ b.current || p(vp);
8632
8943
  });
8633
8944
  return t.observe(e), () => t.disconnect();
8634
8945
  }, [p]);
@@ -8645,7 +8956,7 @@ function rp(e) {
8645
8956
  }, []), z = a(async () => {
8646
8957
  C(null);
8647
8958
  try {
8648
- let e = JSON.parse(r), t = new Set(x.current.map(Number).filter(Number.isFinite)), n = t.size > 0 ? wf(e, t) : e, i = await Of(JSON.stringify(n));
8959
+ let e = JSON.parse(r), t = new Set(x.current.map(Number).filter(Number.isFinite)), n = t.size > 0 ? Df(e, t) : e, i = await jf(JSON.stringify(n));
8649
8960
  if (await navigator.clipboard.writeText(i), l) {
8650
8961
  l();
8651
8962
  return;
@@ -8679,9 +8990,9 @@ function rp(e) {
8679
8990
  onEdgesChange: P,
8680
8991
  onSelectionChange: R,
8681
8992
  onMoveStart: L,
8682
- nodeTypes: tp,
8993
+ nodeTypes: _p,
8683
8994
  fitView: !0,
8684
- fitViewOptions: np,
8995
+ fitViewOptions: vp,
8685
8996
  minZoom: .2,
8686
8997
  translateExtent: F,
8687
8998
  nodesDraggable: !1,
@@ -8711,7 +9022,7 @@ function rp(e) {
8711
9022
  className: "gn-top-left",
8712
9023
  children: [/* @__PURE__ */ _("span", {
8713
9024
  className: "gn-version-badge",
8714
- children: ["node-web-render v", "0.3.14"]
9025
+ children: ["node-web-render v", "0.3.15"]
8715
9026
  }), i.length > 1 ? /* @__PURE__ */ g("nav", {
8716
9027
  className: "gn-breadcrumbs",
8717
9028
  "aria-label": "Node group path",
@@ -8764,19 +9075,19 @@ function rp(e) {
8764
9075
  ]
8765
9076
  });
8766
9077
  }
8767
- function ip(e) {
9078
+ function bp(e) {
8768
9079
  let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, zoomOnScroll: o = !0 } = e, [s, l] = f({
8769
9080
  json: t,
8770
9081
  ids: []
8771
9082
  }), d = u(() => {
8772
9083
  if (!t.trim()) return null;
8773
9084
  try {
8774
- let { rootId: e, trees: n } = gf(JSON.parse(t)), r = {};
9085
+ let { rootId: e, trees: n } = _f(JSON.parse(t)), r = {};
8775
9086
  for (let e of Object.values(n)) {
8776
- let t = yf(e);
9087
+ let t = bf(e);
8777
9088
  r[t.id] = {
8778
9089
  graph: t,
8779
- flow: Cf(t)
9090
+ flow: Ef(t)
8780
9091
  };
8781
9092
  }
8782
9093
  return {
@@ -8840,9 +9151,9 @@ function ip(e) {
8840
9151
  className: "flow-error",
8841
9152
  role: "alert",
8842
9153
  children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: d.error })]
8843
- }) : m ? /* @__PURE__ */ g(Mf.Provider, {
9154
+ }) : m ? /* @__PURE__ */ g(qf.Provider, {
8844
9155
  value: v,
8845
- children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(rp, {
9156
+ children: /* @__PURE__ */ g(sd, { children: /* @__PURE__ */ g(yp, {
8846
9157
  nodes: m.flow.nodes,
8847
9158
  edges: m.flow.edges,
8848
9159
  jsonText: t,
@@ -8864,7 +9175,7 @@ function ip(e) {
8864
9175
  }
8865
9176
  //#endregion
8866
9177
  //#region src/components/TreeClipperLogo.tsx
8867
- function ap({ className: e }) {
9178
+ function xp({ className: e }) {
8868
9179
  return /* @__PURE__ */ _("svg", {
8869
9180
  viewBox: "0 0 256 256",
8870
9181
  className: e,
@@ -8925,7 +9236,7 @@ function ap({ className: e }) {
8925
9236
  }
8926
9237
  //#endregion
8927
9238
  //#region src/embed.tsx
8928
- function op(e) {
9239
+ function Sp(e) {
8929
9240
  let { payload: t } = e, [n, r] = f(""), [i, a] = f(null), [o, s] = f(!0), [l, u] = f(!1), [p, m] = f(!1), v = d(!1), y = d(!1), b = d(null), S = d(null), C = d(null), w = () => {
8930
9241
  !y.current || v.current || (m(!0), C.current && clearTimeout(C.current), C.current = setTimeout(() => {
8931
9242
  u(!1), m(!1);
@@ -8964,7 +9275,7 @@ function op(e) {
8964
9275
  className: "gnwr-loading",
8965
9276
  role: "status",
8966
9277
  "aria-live": "polite",
8967
- children: [/* @__PURE__ */ g(ap, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
9278
+ children: [/* @__PURE__ */ g(xp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
8968
9279
  className: "gnwr-loading__label",
8969
9280
  children: "Loading graph…"
8970
9281
  })]
@@ -8973,7 +9284,7 @@ function op(e) {
8973
9284
  role: "alert",
8974
9285
  children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: i })]
8975
9286
  }) : /* @__PURE__ */ _(h, { children: [
8976
- /* @__PURE__ */ g(ip, {
9287
+ /* @__PURE__ */ g(bp, {
8977
9288
  jsonText: n,
8978
9289
  showHeader: !1,
8979
9290
  zoomOnScroll: !1,
@@ -8998,7 +9309,7 @@ function op(e) {
8998
9309
  strokeLinecap: "round",
8999
9310
  strokeLinejoin: "round"
9000
9311
  })
9001
- }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ap, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: "Copy TreeClipper Magic String" })] })
9312
+ }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(xp, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: "Copy TreeClipper Magic String" })] })
9002
9313
  }),
9003
9314
  (l || p) && /* @__PURE__ */ _("div", {
9004
9315
  className: `gnwr-copy-toast${p ? " gnwr-leaving" : ""}`,
@@ -9023,22 +9334,22 @@ function op(e) {
9023
9334
  })
9024
9335
  });
9025
9336
  }
9026
- var sp = /* @__PURE__ */ new Map(), cp = null;
9027
- function lp(e, t) {
9028
- sp.get(e)?.unmount();
9337
+ var Cp = /* @__PURE__ */ new Map(), wp = null;
9338
+ function Tp(e, t) {
9339
+ Cp.get(e)?.unmount();
9029
9340
  let r = m(e);
9030
- sp.set(e, r), cp = e;
9341
+ Cp.set(e, r), wp = e;
9031
9342
  let i = t.onClose;
9032
- return r.render(n(op, {
9343
+ return r.render(n(Sp, {
9033
9344
  ...t,
9034
9345
  onClose: i ? () => {
9035
- up(e), i();
9346
+ Ep(e), i();
9036
9347
  } : void 0
9037
- })), () => up(e);
9348
+ })), () => Ep(e);
9038
9349
  }
9039
- function up(e) {
9040
- let t = e ?? cp;
9041
- t && (sp.get(t)?.unmount(), sp.delete(t), t === cp && (cp = null));
9350
+ function Ep(e) {
9351
+ let t = e ?? wp;
9352
+ t && (Cp.get(t)?.unmount(), Cp.delete(t), t === wp && (wp = null));
9042
9353
  }
9043
9354
  //#endregion
9044
- export { op as GraphView, lp as mountGraphView, up as unmountGraphView };
9355
+ export { Sp as GraphView, Tp as mountGraphView, Ep as unmountGraphView };