@mickyballadelli/react-things 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,41 @@
1
- import { jsxs as m, jsx as e, Fragment as Ee } from "react/jsx-runtime";
2
- import { Box as ne, Typography as $e } from "@mui/material";
3
- import { useRef as oe, useState as T, useLayoutEffect as Xe, useId as He, useMemo as Ce, useEffect as fe, useCallback as je } from "react";
4
- import p from "@mui/material/Box";
5
- import { alpha as H } from "@mui/material/styles";
1
+ import { jsxs as m, jsx as t, Fragment as Ye } from "react/jsx-runtime";
2
+ import { Box as ne, Typography as Ce } from "@mui/material";
3
+ import { useRef as oe, useState as W, useLayoutEffect as Fe, useId as je, useMemo as Ie, useEffect as ge, useCallback as Ve } from "react";
4
+ import d from "@mui/material/Box";
5
+ import { alpha as Y } from "@mui/material/styles";
6
6
  import ie from "@mui/material/Tooltip";
7
- import N from "@mui/material/Typography";
7
+ import E from "@mui/material/Typography";
8
8
  import Ge from "@mui/material/Collapse";
9
- import Ve from "@mui/material/InputBase";
10
- import qe from "@mui/material/List";
11
- import Ae from "@mui/material/ListItemButton";
12
- import Ue from "@mui/material/ListItemIcon";
13
- import Re from "@mui/material/ListItemText";
9
+ import qe from "@mui/material/InputBase";
10
+ import Ue from "@mui/material/List";
11
+ import Le from "@mui/material/ListItemButton";
12
+ import Ze from "@mui/material/ListItemIcon";
13
+ import Pe from "@mui/material/ListItemText";
14
14
  import _e from "@mui/icons-material/AddBox";
15
- import Ze from "@mui/icons-material/AddLink";
16
- import Qe from "@mui/icons-material/Close";
17
- import Je from "@mui/icons-material/Delete";
18
- import Ke from "@mui/icons-material/LinkOff";
15
+ import Qe from "@mui/icons-material/AddLink";
16
+ import Je from "@mui/icons-material/Close";
17
+ import Ke from "@mui/icons-material/Delete";
18
+ import et from "@mui/icons-material/LinkOff";
19
19
  import ue from "@mui/material/IconButton";
20
20
  import pe from "@mui/material/MenuItem";
21
- import q from "@mui/material/Stack";
22
- import Z from "@mui/material/TextField";
23
- import et from "@mui/icons-material/DragIndicator";
21
+ import V from "@mui/material/Stack";
22
+ import _ from "@mui/material/TextField";
23
+ import tt from "@mui/icons-material/DragIndicator";
24
24
  import ae from "@mui/material/Button";
25
- import tt from "@mui/material/Checkbox";
25
+ import rt from "@mui/material/Checkbox";
26
26
  import we from "@mui/material/Chip";
27
- import rt from "@mui/material/Divider";
28
- import nt from "@mui/material/FormControlLabel";
29
- import Ye from "@mui/material/Paper";
30
- import Fe from "@mui/material/Slider";
31
- import ot from "@mui/material/InputAdornment";
32
- import it from "@mui/icons-material/ContentCopy";
33
- import at from "@mui/icons-material/PushPin";
34
- import lt from "@mui/icons-material/PushPinOutlined";
35
- import st from "@mui/material/ClickAwayListener";
36
- import ct from "@mui/material/Popper";
37
- function lr({ title: t = "React Things", children: n }) {
27
+ import nt from "@mui/material/Divider";
28
+ import ot from "@mui/material/FormControlLabel";
29
+ import Me from "@mui/material/Paper";
30
+ import Ne from "@mui/material/Slider";
31
+ import it from "@mui/material/InputAdornment";
32
+ import at from "@mui/icons-material/ContentCopy";
33
+ import lt from "@mui/icons-material/PushPin";
34
+ import st from "@mui/icons-material/PushPinOutlined";
35
+ import ct from "@mui/material/ClickAwayListener";
36
+ import dt from "@mui/material/Popper";
37
+ import ut from "@mui/material/LinearProgress";
38
+ function br({ title: e = "React Things", children: n }) {
38
39
  return /* @__PURE__ */ m(
39
40
  ne,
40
41
  {
@@ -46,13 +47,13 @@ function lr({ title: t = "React Things", children: n }) {
46
47
  bgcolor: "background.paper"
47
48
  },
48
49
  children: [
49
- /* @__PURE__ */ e($e, { variant: "subtitle1", fontWeight: 700, children: t }),
50
- n ? /* @__PURE__ */ e(ne, { sx: { mt: 1 }, children: n }) : null
50
+ /* @__PURE__ */ t(Ce, { variant: "subtitle1", fontWeight: 700, children: e }),
51
+ n ? /* @__PURE__ */ t(ne, { sx: { mt: 1 }, children: n }) : null
51
52
  ]
52
53
  }
53
54
  );
54
55
  }
55
- const ve = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Le = 12, dt = {
56
+ const $e = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Te = 12, pt = {
56
57
  c: "#659ad2",
57
58
  cpp: "#00599c",
58
59
  cplusplus: "#00599c",
@@ -90,26 +91,26 @@ const ve = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", L
90
91
  css: "#1572b6",
91
92
  dart: "#0175c2"
92
93
  };
93
- function ut(t) {
94
- return t.trim().replace(/^\./, "").toLowerCase().replace(/\s+/g, "");
94
+ function ht(e) {
95
+ return e.trim().replace(/^\./, "").toLowerCase().replace(/\s+/g, "");
95
96
  }
96
- function pt(t) {
97
- return dt[ut(t)] ?? "#93c5fd";
97
+ function ft(e) {
98
+ return pt[ht(e)] ?? "#93c5fd";
98
99
  }
99
- function ht(t) {
100
- return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
100
+ function gt(e) {
101
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
101
102
  }
102
- function ft(t) {
103
- const n = ht(t), d = /^(import|from|export|function|return|const|let|var|type|interface|class|extends|new|if|else|for|while|switch|case|break|continue|async|await|try|catch|finally|throw|fn|pub|use|mod|impl|trait|struct|enum|match|mut|let|where|package|func|defer|go|select|range|map|chan|SELECT|FROM|WHERE|AS|AND|OR|INSERT|UPDATE|DELETE|CREATE|TABLE|ORDER|BY|GROUP|LIMIT|select|from|where|as|and|or|insert|update|delete|create|table|order|by|group|limit)\b/;
104
- return /^['"`]/.test(t) ? `<span style="color:#86efac">${n}</span>` : /^\d/.test(t) ? `<span style="color:#fbbf24">${n}</span>` : /^<\/?[A-Z][\w.]*/.test(t) ? `<span style="color:#67e8f9">${n}</span>` : d.test(t) ? `<span style="color:#c084fc">${n}</span>` : /^[$#][\w-]+$|^\.[\w-]+$/.test(t) ? `<span style="color:#f9a8d4">${n}</span>` : /^[A-Z][\w.]*$/.test(t) ? `<span style="color:#93c5fd">${n}</span>` : /^[a-z][\w-]*(?==|:)/.test(t) ? `<span style="color:#f9a8d4">${n}</span>` : /^[{}()[\].,:;=<>/]+$/.test(t) ? `<span style="color:#94a3b8">${n}</span>` : n;
103
+ function bt(e) {
104
+ const n = gt(e), l = /^(import|from|export|function|return|const|let|var|type|interface|class|extends|new|if|else|for|while|switch|case|break|continue|async|await|try|catch|finally|throw|fn|pub|use|mod|impl|trait|struct|enum|match|mut|let|where|package|func|defer|go|select|range|map|chan|SELECT|FROM|WHERE|AS|AND|OR|INSERT|UPDATE|DELETE|CREATE|TABLE|ORDER|BY|GROUP|LIMIT|select|from|where|as|and|or|insert|update|delete|create|table|order|by|group|limit)\b/;
105
+ return /^['"`]/.test(e) ? `<span style="color:#86efac">${n}</span>` : /^\d/.test(e) ? `<span style="color:#fbbf24">${n}</span>` : /^<\/?[A-Z][\w.]*/.test(e) ? `<span style="color:#67e8f9">${n}</span>` : l.test(e) ? `<span style="color:#c084fc">${n}</span>` : /^[$#][\w-]+$|^\.[\w-]+$/.test(e) ? `<span style="color:#f9a8d4">${n}</span>` : /^[A-Z][\w.]*$/.test(e) ? `<span style="color:#93c5fd">${n}</span>` : /^[a-z][\w-]*(?==|:)/.test(e) ? `<span style="color:#f9a8d4">${n}</span>` : /^[{}()[\].,:;=<>/]+$/.test(e) ? `<span style="color:#94a3b8">${n}</span>` : n;
105
106
  }
106
- function bt(t) {
107
- return t.split(/(\s+|<\/?[A-Z][\w.]*|['"`][^'"`]*['"`]|\d*\.?\d+|[A-Za-z_$][\w$-]*|[{}()[\].,:;=<>/]+)/g).map((n) => ft(n)).join("");
107
+ function mt(e) {
108
+ return e.split(/(\s+|<\/?[A-Z][\w.]*|['"`][^'"`]*['"`]|\d*\.?\d+|[A-Za-z_$][\w$-]*|[{}()[\].,:;=<>/]+)/g).map((n) => bt(n)).join("");
108
109
  }
109
- function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }) {
110
- const c = d ?? "", g = Math.max(c.split(`
111
- `).length, 1), f = Array.from({ length: g }, (y, k) => k + 1).join(`
112
- `), a = bt(c), x = pt(n);
110
+ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }) {
111
+ const u = l ?? "", x = Math.max(u.split(`
112
+ `).length, 1), p = Array.from({ length: x }, (g, w) => w + 1).join(`
113
+ `), i = mt(u), y = ft(n);
113
114
  return /* @__PURE__ */ m(ne, { children: [
114
115
  /* @__PURE__ */ m(
115
116
  ne,
@@ -126,14 +127,14 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
126
127
  borderTopRightRadius: 4
127
128
  },
128
129
  children: [
129
- /* @__PURE__ */ e($e, { variant: "caption", fontWeight: 800, children: t }),
130
- /* @__PURE__ */ e(
131
- $e,
130
+ /* @__PURE__ */ t(Ce, { variant: "caption", fontWeight: 800, children: e }),
131
+ /* @__PURE__ */ t(
132
+ Ce,
132
133
  {
133
134
  variant: "caption",
134
135
  sx: {
135
136
  fontFamily: "monospace",
136
- color: x,
137
+ color: y,
137
138
  textTransform: "lowercase"
138
139
  },
139
140
  children: n
@@ -148,14 +149,14 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
148
149
  sx: {
149
150
  display: "grid",
150
151
  gridTemplateColumns: "48px 1fr",
151
- minHeight: b,
152
+ minHeight: f,
152
153
  bgcolor: "#0f172a",
153
154
  borderBottomLeftRadius: 4,
154
155
  borderBottomRightRadius: 4,
155
156
  overflow: "hidden"
156
157
  },
157
158
  children: [
158
- /* @__PURE__ */ e(
159
+ /* @__PURE__ */ t(
159
160
  ne,
160
161
  {
161
162
  component: "pre",
@@ -166,13 +167,13 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
166
167
  py: 1.5,
167
168
  color: "#64748b",
168
169
  bgcolor: "#111827",
169
- fontFamily: ve,
170
+ fontFamily: $e,
170
171
  fontSize: 14,
171
172
  lineHeight: 1.6,
172
173
  textAlign: "right",
173
174
  userSelect: "none"
174
175
  },
175
- children: f
176
+ children: p
176
177
  }
177
178
  ),
178
179
  /* @__PURE__ */ m(
@@ -180,26 +181,26 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
180
181
  {
181
182
  sx: {
182
183
  position: "relative",
183
- minHeight: b,
184
+ minHeight: f,
184
185
  bgcolor: "#0f172a",
185
186
  overflow: "auto"
186
187
  },
187
188
  children: [
188
- /* @__PURE__ */ e(
189
+ /* @__PURE__ */ t(
189
190
  ne,
190
191
  {
191
192
  component: "pre",
192
193
  "aria-hidden": "true",
193
- dangerouslySetInnerHTML: { __html: a },
194
+ dangerouslySetInnerHTML: { __html: i },
194
195
  sx: {
195
196
  position: "absolute",
196
197
  inset: 0,
197
198
  m: 0,
198
- p: `${Le}px`,
199
+ p: `${Te}px`,
199
200
  boxSizing: "border-box",
200
201
  pointerEvents: "none",
201
202
  color: "#e5e7eb",
202
- fontFamily: ve,
203
+ fontFamily: $e,
203
204
  fontSize: 14,
204
205
  lineHeight: 1.6,
205
206
  tabSize: 2,
@@ -208,29 +209,29 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
208
209
  }
209
210
  }
210
211
  ),
211
- /* @__PURE__ */ e(
212
+ /* @__PURE__ */ t(
212
213
  ne,
213
214
  {
214
215
  component: "textarea",
215
- "aria-label": `${t} code editor`,
216
+ "aria-label": `${e} code editor`,
216
217
  spellCheck: !1,
217
- value: c,
218
- onChange: (y) => s(y.target.value),
218
+ value: u,
219
+ onChange: (g) => s(g.target.value),
219
220
  sx: {
220
221
  position: "relative",
221
222
  width: "100%",
222
223
  minWidth: 0,
223
- minHeight: b,
224
+ minHeight: f,
224
225
  resize: "vertical",
225
226
  border: 0,
226
227
  outline: 0,
227
- p: `${Le}px`,
228
+ p: `${Te}px`,
228
229
  boxSizing: "border-box",
229
230
  color: "transparent",
230
231
  WebkitTextFillColor: "transparent",
231
232
  bgcolor: "transparent",
232
233
  caretColor: "#60a5fa",
233
- fontFamily: ve,
234
+ fontFamily: $e,
234
235
  fontSize: 14,
235
236
  lineHeight: 1.6,
236
237
  tabSize: 2,
@@ -254,141 +255,141 @@ function sr({ label: t, language: n, value: d, onChange: s, minHeight: b = 360 }
254
255
  )
255
256
  ] });
256
257
  }
257
- function cr({
258
- children: t,
258
+ function xr({
259
+ children: e,
259
260
  initialPosition: n = { x: 50, y: 50 },
260
- dragSx: d,
261
+ dragSx: l,
261
262
  onPositionChange: s,
262
- onDraggingChange: b,
263
- sx: c,
264
- ...g
263
+ onDraggingChange: f,
264
+ sx: u,
265
+ ...x
265
266
  }) {
266
- const f = oe(null), a = oe(null), [x, y] = T(n), [k, v] = T({ x: 0, y: 0 }), [B, C] = T(!1);
267
- Xe(() => {
268
- const u = f.current, z = a.current;
269
- if (!u || !z)
267
+ const p = oe(null), i = oe(null), [y, g] = W(n), [w, v] = W({ x: 0, y: 0 }), [P, C] = W(!1);
268
+ Fe(() => {
269
+ const h = p.current, M = i.current;
270
+ if (!h || !M)
270
271
  return;
271
- const Y = u.getBoundingClientRect(), E = z.getBoundingClientRect(), $ = window.getComputedStyle(u), W = x.x / 100 * Y.width, w = x.y / 100 * Y.height;
272
- s?.(x, {
273
- containerWidth: Y.width,
274
- containerHeight: Y.height,
275
- draggableWidth: E.width,
276
- draggableHeight: E.height,
277
- draggableLeft: W - E.width / 2,
278
- draggableTop: w - E.height / 2,
279
- containerBackgroundImage: $.backgroundImage,
280
- containerBackgroundSize: $.backgroundSize,
281
- containerBackgroundPosition: $.backgroundPosition
272
+ const N = h.getBoundingClientRect(), X = M.getBoundingClientRect(), k = window.getComputedStyle(h), D = y.x / 100 * N.width, $ = y.y / 100 * N.height;
273
+ s?.(y, {
274
+ containerWidth: N.width,
275
+ containerHeight: N.height,
276
+ draggableWidth: X.width,
277
+ draggableHeight: X.height,
278
+ draggableLeft: D - X.width / 2,
279
+ draggableTop: $ - X.height / 2,
280
+ containerBackgroundImage: k.backgroundImage,
281
+ containerBackgroundSize: k.backgroundSize,
282
+ containerBackgroundPosition: k.backgroundPosition
282
283
  });
283
284
  }, []);
284
- function o(u, z) {
285
- y(u), s?.(u, z);
285
+ function o(h, M) {
286
+ g(h), s?.(h, M);
286
287
  }
287
- function R(u, z, Y = k) {
288
- const E = f.current, $ = a.current;
289
- if (!E || !$)
288
+ function R(h, M, N = w) {
289
+ const X = p.current, k = i.current;
290
+ if (!X || !k)
290
291
  return;
291
- const W = E.getBoundingClientRect(), w = $.getBoundingClientRect(), L = window.getComputedStyle(E), j = u - Y.x + w.width / 2, F = z - Y.y + w.height / 2, l = w.width / W.width * 50, M = w.height / W.height * 50, h = (j - W.left) / W.width * 100, S = (F - W.top) / W.height * 100, D = {
292
- x: Math.min(Math.max(h, l), 100 - l),
293
- y: Math.min(Math.max(S, M), 100 - M)
294
- }, i = D.x / 100 * W.width, P = D.y / 100 * W.height;
295
- o(D, {
296
- containerWidth: W.width,
297
- containerHeight: W.height,
298
- draggableWidth: w.width,
299
- draggableHeight: w.height,
300
- draggableLeft: i - w.width / 2,
301
- draggableTop: P - w.height / 2,
292
+ const D = X.getBoundingClientRect(), $ = k.getBoundingClientRect(), L = window.getComputedStyle(X), j = h - N.x + $.width / 2, O = M - N.y + $.height / 2, c = $.width / D.width * 50, S = $.height / D.height * 50, b = (j - D.left) / D.width * 100, z = (O - D.top) / D.height * 100, B = {
293
+ x: Math.min(Math.max(b, c), 100 - c),
294
+ y: Math.min(Math.max(z, S), 100 - S)
295
+ }, a = B.x / 100 * D.width, T = B.y / 100 * D.height;
296
+ o(B, {
297
+ containerWidth: D.width,
298
+ containerHeight: D.height,
299
+ draggableWidth: $.width,
300
+ draggableHeight: $.height,
301
+ draggableLeft: a - $.width / 2,
302
+ draggableTop: T - $.height / 2,
302
303
  containerBackgroundImage: L.backgroundImage,
303
304
  containerBackgroundSize: L.backgroundSize,
304
305
  containerBackgroundPosition: L.backgroundPosition
305
306
  });
306
307
  }
307
- return /* @__PURE__ */ e(
308
- p,
308
+ return /* @__PURE__ */ t(
309
+ d,
309
310
  {
310
- ...g,
311
- ref: f,
311
+ ...x,
312
+ ref: p,
312
313
  sx: [
313
314
  {
314
315
  position: "relative",
315
316
  overflow: "hidden",
316
317
  touchAction: "none"
317
318
  },
318
- ...Array.isArray(c) ? c : c ? [c] : []
319
+ ...Array.isArray(u) ? u : u ? [u] : []
319
320
  ],
320
- onPointerMove: (u) => {
321
- B && R(u.clientX, u.clientY);
321
+ onPointerMove: (h) => {
322
+ P && R(h.clientX, h.clientY);
322
323
  },
323
- onPointerUp: (u) => {
324
- C(!1), b?.(!1), u.currentTarget.releasePointerCapture(u.pointerId);
324
+ onPointerUp: (h) => {
325
+ C(!1), f?.(!1), h.currentTarget.releasePointerCapture(h.pointerId);
325
326
  },
326
327
  onPointerCancel: () => {
327
- C(!1), b?.(!1);
328
+ C(!1), f?.(!1);
328
329
  },
329
- children: /* @__PURE__ */ e(
330
- p,
330
+ children: /* @__PURE__ */ t(
331
+ d,
331
332
  {
332
- ref: a,
333
+ ref: i,
333
334
  sx: [
334
335
  {
335
336
  position: "absolute",
336
- left: `${x.x}%`,
337
- top: `${x.y}%`,
337
+ left: `${y.x}%`,
338
+ top: `${y.y}%`,
338
339
  transform: "translate(-50%, -50%)",
339
- cursor: B ? "grabbing" : "grab",
340
+ cursor: P ? "grabbing" : "grab",
340
341
  userSelect: "none"
341
342
  },
342
- ...Array.isArray(d) ? d : d ? [d] : []
343
+ ...Array.isArray(l) ? l : l ? [l] : []
343
344
  ],
344
- onPointerDown: (u) => {
345
- const z = u.currentTarget.getBoundingClientRect(), Y = {
346
- x: u.clientX - z.left,
347
- y: u.clientY - z.top
345
+ onPointerDown: (h) => {
346
+ const M = h.currentTarget.getBoundingClientRect(), N = {
347
+ x: h.clientX - M.left,
348
+ y: h.clientY - M.top
348
349
  };
349
- C(!0), b?.(!0), v(Y), u.currentTarget.setPointerCapture(u.pointerId), R(u.clientX, u.clientY, Y);
350
+ C(!0), f?.(!0), v(N), h.currentTarget.setPointerCapture(h.pointerId), R(h.clientX, h.clientY, N);
350
351
  },
351
- children: t
352
+ children: e
352
353
  }
353
354
  )
354
355
  }
355
356
  );
356
357
  }
357
- function Pe(t) {
358
- return Math.min(Math.max(t, 0), 1);
358
+ function We(e) {
359
+ return Math.min(Math.max(e, 0), 1);
359
360
  }
360
- function dr({
361
- transparency: t = 0.36,
361
+ function yr({
362
+ transparency: e = 0.36,
362
363
  fill: n = 0.72,
363
- liquidColor: d = "#39b8ff",
364
+ liquidColor: l = "#39b8ff",
364
365
  glassColor: s = "#ffffff",
365
- motion: b = 0,
366
- refractionActive: c = !0,
367
- children: g,
368
- sx: f,
369
- ...a
366
+ motion: f = 0,
367
+ refractionActive: u = !0,
368
+ children: x,
369
+ sx: p,
370
+ ...i
370
371
  }) {
371
- const y = `glass-liquid-${He().replace(/:/g, "")}`, k = 1 - Pe(t), v = Pe(t), C = `${(1 - Math.min(Math.max(n, 0), 1)) * 100}%`, o = Math.abs(Math.round(b * 8)) + 1, R = 0.012 + Math.abs(Math.sin(b / 17)) * 0.012, u = 18 + k * 18, z = c;
372
+ const g = `glass-liquid-${je().replace(/:/g, "")}`, w = 1 - We(e), v = We(e), C = `${(1 - Math.min(Math.max(n, 0), 1)) * 100}%`, o = Math.abs(Math.round(f * 8)) + 1, R = 0.012 + Math.abs(Math.sin(f / 17)) * 0.012, h = 18 + w * 18, M = u;
372
373
  return /* @__PURE__ */ m(
373
- p,
374
+ d,
374
375
  {
375
- ...a,
376
+ ...i,
376
377
  sx: [
377
378
  {
378
379
  position: "relative",
379
380
  overflow: "hidden",
380
381
  border: 1,
381
- borderColor: H(s, 0.48),
382
+ borderColor: Y(s, 0.48),
382
383
  borderRadius: 2,
383
384
  minHeight: 160,
384
385
  p: 3,
385
386
  color: "common.white",
386
- bgcolor: H(s, 0.08 + v * 0.18),
387
+ bgcolor: Y(s, 0.08 + v * 0.18),
387
388
  boxShadow: `
388
- inset 0 1px 0 ${H(s, 0.68)},
389
- inset 14px 0 34px ${H(s, 0.12)},
390
- inset -18px 0 32px ${H(d, k * 0.2)},
391
- 0 18px 48px ${H("#0b2030", 0.18)}
389
+ inset 0 1px 0 ${Y(s, 0.68)},
390
+ inset 14px 0 34px ${Y(s, 0.12)},
391
+ inset -18px 0 32px ${Y(l, w * 0.2)},
392
+ 0 18px 48px ${Y("#0b2030", 0.18)}
392
393
  `,
393
394
  backdropFilter: "blur(12px) saturate(170%) contrast(108%)",
394
395
  WebkitBackdropFilter: "blur(12px) saturate(170%) contrast(108%)",
@@ -400,12 +401,12 @@ function dr({
400
401
  top: C,
401
402
  bottom: 0,
402
403
  background: `
403
- linear-gradient(160deg, ${H(s, k * 0.16)} 0%, ${H(d, k * 0.28)} 42%, ${H("#063451", k * 0.2)} 100%)
404
+ linear-gradient(160deg, ${Y(s, w * 0.16)} 0%, ${Y(l, w * 0.28)} 42%, ${Y("#063451", w * 0.2)} 100%)
404
405
  `,
405
406
  opacity: 0.95,
406
407
  boxShadow: `
407
- inset 0 18px 28px ${H(s, 0.12 + k * 0.16)},
408
- inset 0 -34px 44px ${H("#032536", k * 0.22)}
408
+ inset 0 18px 28px ${Y(s, 0.12 + w * 0.16)},
409
+ inset 0 -34px 44px ${Y("#032536", w * 0.22)}
409
410
  `
410
411
  },
411
412
  "&::after": {
@@ -413,8 +414,8 @@ function dr({
413
414
  position: "absolute",
414
415
  inset: 0,
415
416
  background: `
416
- linear-gradient(105deg, ${H(s, 0.34)} 0%, ${H(s, 0.08)} 18%, ${H(s, 0)} 34%),
417
- radial-gradient(circle at 18% 18%, ${H(s, 0.38)} 0 3%, ${H(s, 0)} 18%)
417
+ linear-gradient(105deg, ${Y(s, 0.34)} 0%, ${Y(s, 0.08)} 18%, ${Y(s, 0)} 34%),
418
+ radial-gradient(circle at 18% 18%, ${Y(s, 0.38)} 0 3%, ${Y(s, 0)} 18%)
418
419
  `,
419
420
  pointerEvents: "none"
420
421
  },
@@ -427,8 +428,8 @@ function dr({
427
428
  backgroundSize: "var(--glassbox-refraction-background-size, cover)",
428
429
  backgroundPosition: "var(--glassbox-refraction-background-position, center)",
429
430
  backgroundRepeat: "no-repeat",
430
- filter: `url(#${y}) saturate(150%) contrast(112%)`,
431
- opacity: z ? 0.72 : 0,
431
+ filter: `url(#${g}) saturate(150%) contrast(112%)`,
432
+ opacity: M ? 0.72 : 0,
432
433
  transition: "opacity 120ms ease-out",
433
434
  maskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${C} + 10px), black calc(${C} + 28px), black 100%)`,
434
435
  WebkitMaskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${C} + 10px), black calc(${C} + 28px), black 100%)`
@@ -438,12 +439,12 @@ function dr({
438
439
  inset: 0,
439
440
  zIndex: 2,
440
441
  pointerEvents: "none",
441
- opacity: z ? 0.16 + v * 0.16 : 0,
442
+ opacity: M ? 0.16 + v * 0.16 : 0,
442
443
  backdropFilter: "blur(3px) saturate(190%)",
443
444
  WebkitBackdropFilter: "blur(3px) saturate(190%)",
444
445
  background: `
445
- linear-gradient(180deg, ${H(s, 0.2)} 0, ${H(s, 0)} 20%),
446
- linear-gradient(90deg, ${H(s, 0)} 0 18%, ${H(s, 0.14)} 26%, ${H(s, 0)} 34% 58%, ${H(s, 0.1)} 68%, ${H(s, 0)} 76% 100%)
446
+ linear-gradient(180deg, ${Y(s, 0.2)} 0, ${Y(s, 0)} 20%),
447
+ linear-gradient(90deg, ${Y(s, 0)} 0 18%, ${Y(s, 0.14)} 26%, ${Y(s, 0)} 34% 58%, ${Y(s, 0.1)} 68%, ${Y(s, 0)} 76% 100%)
447
448
  `,
448
449
  transition: "opacity 120ms ease-out",
449
450
  maskImage: `linear-gradient(to bottom, transparent 0, transparent ${C}, black calc(${C} + 18px), black 100%)`,
@@ -452,25 +453,25 @@ function dr({
452
453
  "& .GlassBox-content": {
453
454
  position: "relative",
454
455
  zIndex: 3,
455
- textShadow: `0 1px 10px ${H("#00121d", 0.36)}`
456
+ textShadow: `0 1px 10px ${Y("#00121d", 0.36)}`
456
457
  },
457
458
  "& > *": {
458
459
  position: "relative",
459
460
  zIndex: 3
460
461
  }
461
462
  },
462
- ...Array.isArray(f) ? f : f ? [f] : []
463
+ ...Array.isArray(p) ? p : p ? [p] : []
463
464
  ],
464
465
  children: [
465
- /* @__PURE__ */ e(
466
- p,
466
+ /* @__PURE__ */ t(
467
+ d,
467
468
  {
468
469
  component: "svg",
469
470
  "aria-hidden": "true",
470
471
  focusable: "false",
471
472
  sx: { position: "absolute", width: 0, height: 0, overflow: "hidden" },
472
- children: /* @__PURE__ */ m("filter", { id: y, children: [
473
- /* @__PURE__ */ e(
473
+ children: /* @__PURE__ */ m("filter", { id: g, children: [
474
+ /* @__PURE__ */ t(
474
475
  "feTurbulence",
475
476
  {
476
477
  type: "fractalNoise",
@@ -480,12 +481,12 @@ function dr({
480
481
  result: "liquidNoise"
481
482
  }
482
483
  ),
483
- /* @__PURE__ */ e(
484
+ /* @__PURE__ */ t(
484
485
  "feDisplacementMap",
485
486
  {
486
487
  in: "SourceGraphic",
487
488
  in2: "liquidNoise",
488
- scale: u,
489
+ scale: h,
489
490
  xChannelSelector: "R",
490
491
  yChannelSelector: "G"
491
492
  }
@@ -493,30 +494,30 @@ function dr({
493
494
  ] })
494
495
  }
495
496
  ),
496
- /* @__PURE__ */ e(p, { className: "GlassBox-liquidLens" }),
497
- /* @__PURE__ */ e(p, { className: "GlassBox-refractionOffset" }),
498
- /* @__PURE__ */ e(p, { className: "GlassBox-content", children: g })
497
+ /* @__PURE__ */ t(d, { className: "GlassBox-liquidLens" }),
498
+ /* @__PURE__ */ t(d, { className: "GlassBox-refractionOffset" }),
499
+ /* @__PURE__ */ t(d, { className: "GlassBox-content", children: x })
499
500
  ]
500
501
  }
501
502
  );
502
503
  }
503
- function gt(t, n, d) {
504
- return Math.min(Math.max(t, n), d);
504
+ function xt(e, n, l) {
505
+ return Math.min(Math.max(e, n), l);
505
506
  }
506
- function ur({
507
- items: t,
507
+ function wr({
508
+ items: e,
508
509
  iconSize: n = 52,
509
- magnification: d = 1.7,
510
+ magnification: l = 1.7,
510
511
  gap: s = 10,
511
- tooltip: b = !0,
512
- sx: c,
513
- ...g
512
+ tooltip: f = !0,
513
+ sx: u,
514
+ ...x
514
515
  }) {
515
- const [f, a] = T(null);
516
- return /* @__PURE__ */ e(
517
- p,
516
+ const [p, i] = W(null);
517
+ return /* @__PURE__ */ t(
518
+ d,
518
519
  {
519
- ...g,
520
+ ...x,
520
521
  role: "toolbar",
521
522
  sx: [
522
523
  {
@@ -532,18 +533,18 @@ function ur({
532
533
  backdropFilter: "blur(18px) saturate(150%)",
533
534
  WebkitBackdropFilter: "blur(18px) saturate(150%)"
534
535
  },
535
- ...Array.isArray(c) ? c : c ? [c] : []
536
+ ...Array.isArray(u) ? u : u ? [u] : []
536
537
  ],
537
- onMouseLeave: () => a(null),
538
- children: t.map((x, y) => {
539
- const k = f === null ? 4 : Math.abs(y - f), v = gt(1 - k / 3, 0, 1), B = 1 + (d - 1) * v, C = -18 * v, o = /* @__PURE__ */ e(
540
- p,
538
+ onMouseLeave: () => i(null),
539
+ children: e.map((y, g) => {
540
+ const w = p === null ? 4 : Math.abs(g - p), v = xt(1 - w / 3, 0, 1), P = 1 + (l - 1) * v, C = -18 * v, o = /* @__PURE__ */ t(
541
+ d,
541
542
  {
542
543
  component: "button",
543
544
  type: "button",
544
- "aria-label": x.label,
545
- onClick: x.onClick,
546
- onMouseEnter: () => a(y),
545
+ "aria-label": y.label,
546
+ onClick: y.onClick,
547
+ onMouseEnter: () => i(g),
547
548
  sx: {
548
549
  width: n,
549
550
  height: n,
@@ -557,7 +558,7 @@ function ur({
557
558
  bgcolor: "rgba(255,255,255,0.72)",
558
559
  boxShadow: "inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 18px rgba(15, 23, 42, 0.18)",
559
560
  cursor: "pointer",
560
- transform: `translateY(${C}px) scale(${B})`,
561
+ transform: `translateY(${C}px) scale(${P})`,
561
562
  transformOrigin: "bottom center",
562
563
  transition: "transform 130ms ease-out, background-color 130ms ease-out",
563
564
  "&:focus-visible": {
@@ -568,8 +569,8 @@ function ur({
568
569
  bgcolor: "rgba(255,255,255,0.9)"
569
570
  }
570
571
  },
571
- children: /* @__PURE__ */ e(
572
- N,
572
+ children: /* @__PURE__ */ t(
573
+ E,
573
574
  {
574
575
  component: "span",
575
576
  "aria-hidden": "true",
@@ -579,72 +580,72 @@ function ur({
579
580
  fontSize: Math.round(n * 0.52),
580
581
  lineHeight: 1
581
582
  },
582
- children: x.icon
583
+ children: y.icon
583
584
  }
584
585
  )
585
586
  },
586
- x.id
587
+ y.id
587
588
  );
588
- return b ? /* @__PURE__ */ e(ie, { title: x.label, placement: "top", arrow: !0, children: o }, x.id) : o;
589
+ return f ? /* @__PURE__ */ t(ie, { title: y.label, placement: "top", arrow: !0, children: o }, y.id) : o;
589
590
  })
590
591
  }
591
592
  );
592
593
  }
593
- function Ne(t) {
594
- return t.toLowerCase().trim();
594
+ function Oe(e) {
595
+ return e.toLowerCase().trim();
595
596
  }
596
- function mt(t) {
597
- return Ne([
598
- t.label,
599
- t.description,
600
- t.group,
601
- t.parentId,
602
- ...t.keywords ?? []
597
+ function yt(e) {
598
+ return Oe([
599
+ e.label,
600
+ e.description,
601
+ e.group,
602
+ e.parentId,
603
+ ...e.keywords ?? []
603
604
  ].filter(Boolean).join(" "));
604
605
  }
605
- function Te(t) {
606
- return Array.from(new Set(t.map((n) => n.group).filter(Boolean)));
606
+ function De(e) {
607
+ return Array.from(new Set(e.map((n) => n.group).filter(Boolean)));
607
608
  }
608
- function pr({
609
- items: t,
609
+ function vr({
610
+ items: e,
610
611
  variant: n = "list",
611
- selectedId: d,
612
+ selectedId: l,
612
613
  placeholder: s = "Search",
613
- emptyText: b = "No items found",
614
- maxResults: c,
615
- showSearch: g = !0,
616
- dense: f = !1,
617
- expandedGroups: a,
618
- defaultExpandedGroups: x,
619
- onExpandedGroupsChange: y,
620
- onSelect: k,
614
+ emptyText: f = "No items found",
615
+ maxResults: u,
616
+ showSearch: x = !0,
617
+ dense: p = !1,
618
+ expandedGroups: i,
619
+ defaultExpandedGroups: y,
620
+ onExpandedGroupsChange: g,
621
+ onSelect: w,
621
622
  sx: v,
622
- ...B
623
+ ...P
623
624
  }) {
624
- const C = x ?? Te(t), [o, R] = T(""), [u, z] = T(0), [Y, E] = T(C), $ = Ne(o), W = a ?? Y, w = Ce(() => {
625
- const i = $ ? t.filter((P) => mt(P).includes($)) : t;
626
- return typeof c == "number" ? i.slice(0, c) : i;
627
- }, [t, c, $]), L = Te(w), j = w;
628
- function F(i) {
629
- i.onSelect?.(), k?.(i), R(""), z(0);
625
+ const C = y ?? De(e), [o, R] = W(""), [h, M] = W(0), [N, X] = W(C), k = Oe(o), D = i ?? N, $ = Ie(() => {
626
+ const a = k ? e.filter((T) => yt(T).includes(k)) : e;
627
+ return typeof u == "number" ? a.slice(0, u) : a;
628
+ }, [e, u, k]), L = De($), j = $;
629
+ function O(a) {
630
+ a.onSelect?.(), w?.(a), R(""), M(0);
630
631
  }
631
- function l(i) {
632
- a === void 0 && E(i), y?.(i);
632
+ function c(a) {
633
+ i === void 0 && X(a), g?.(a);
633
634
  }
634
- function M(i) {
635
- l(W.includes(i) ? W.filter((P) => P !== i) : [...W, i]);
635
+ function S(a) {
636
+ c(D.includes(a) ? D.filter((T) => T !== a) : [...D, a]);
636
637
  }
637
- function h(i, P = 0) {
638
- const Q = i.id === d;
638
+ function b(a, T = 0) {
639
+ const Q = a.id === l;
639
640
  return /* @__PURE__ */ m(
640
- Ae,
641
+ Le,
641
642
  {
642
643
  selected: Q,
643
- dense: f,
644
- onClick: () => F(i),
644
+ dense: p,
645
+ onClick: () => O(a),
645
646
  sx: {
646
647
  borderRadius: 1,
647
- pl: 1.25 + P * 2,
648
+ pl: 1.25 + T * 2,
648
649
  "&.Mui-selected": {
649
650
  bgcolor: "action.selected",
650
651
  color: "primary.main"
@@ -654,57 +655,57 @@ function pr({
654
655
  }
655
656
  },
656
657
  children: [
657
- i.icon ? /* @__PURE__ */ e(Ue, { sx: { minWidth: 34, color: "inherit" }, children: i.icon }) : null,
658
- /* @__PURE__ */ e(
659
- Re,
658
+ a.icon ? /* @__PURE__ */ t(Ze, { sx: { minWidth: 34, color: "inherit" }, children: a.icon }) : null,
659
+ /* @__PURE__ */ t(
660
+ Pe,
660
661
  {
661
- primary: i.label,
662
- secondary: i.description,
662
+ primary: a.label,
663
+ secondary: a.description,
663
664
  primaryTypographyProps: { fontWeight: Q ? 850 : 700 },
664
665
  secondaryTypographyProps: { color: "text.secondary" }
665
666
  }
666
667
  )
667
668
  ]
668
669
  },
669
- i.id
670
+ a.id
670
671
  );
671
672
  }
672
- function S() {
673
- return w.length ? L.length ? L.map((i) => /* @__PURE__ */ m(p, { children: [
674
- /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 900, color: "text.secondary", sx: { display: "block", px: 1.25, pt: 1.5, pb: 0.5 }, children: i }),
675
- w.filter((P) => P.group === i).map((P) => h(P))
676
- ] }, i)) : w.map((i) => h(i)) : /* @__PURE__ */ e(p, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: b });
673
+ function z() {
674
+ return $.length ? L.length ? L.map((a) => /* @__PURE__ */ m(d, { children: [
675
+ /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 900, color: "text.secondary", sx: { display: "block", px: 1.25, pt: 1.5, pb: 0.5 }, children: a }),
676
+ $.filter((T) => T.group === a).map((T) => b(T))
677
+ ] }, a)) : $.map((a) => b(a)) : /* @__PURE__ */ t(d, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: f });
677
678
  }
678
- function D() {
679
- return w.length ? L.length ? L.map((i) => {
680
- const P = $ || W.includes(i);
681
- return /* @__PURE__ */ m(p, { children: [
679
+ function B() {
680
+ return $.length ? L.length ? L.map((a) => {
681
+ const T = k || D.includes(a);
682
+ return /* @__PURE__ */ m(d, { children: [
682
683
  /* @__PURE__ */ m(
683
- Ae,
684
+ Le,
684
685
  {
685
- dense: f,
686
- onClick: () => M(i),
686
+ dense: p,
687
+ onClick: () => S(a),
687
688
  sx: { borderRadius: 1, px: 1.25 },
688
689
  children: [
689
- /* @__PURE__ */ e(N, { component: "span", "aria-hidden": "true", sx: { mr: 1, width: 16, color: "text.secondary" }, children: P ? "▾" : "▸" }),
690
- /* @__PURE__ */ e(
691
- Re,
690
+ /* @__PURE__ */ t(E, { component: "span", "aria-hidden": "true", sx: { mr: 1, width: 16, color: "text.secondary" }, children: T ? "▾" : "▸" }),
691
+ /* @__PURE__ */ t(
692
+ Pe,
692
693
  {
693
- primary: i,
694
+ primary: a,
694
695
  primaryTypographyProps: { fontWeight: 900 }
695
696
  }
696
697
  )
697
698
  ]
698
699
  }
699
700
  ),
700
- /* @__PURE__ */ e(Ge, { in: !!P, timeout: "auto", unmountOnExit: !0, children: w.filter((Q) => Q.group === i).map((Q) => h(Q, 1)) })
701
- ] }, i);
702
- }) : w.map((i) => h(i)) : /* @__PURE__ */ e(p, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: b });
701
+ /* @__PURE__ */ t(Ge, { in: !!T, timeout: "auto", unmountOnExit: !0, children: $.filter((Q) => Q.group === a).map((Q) => b(Q, 1)) })
702
+ ] }, a);
703
+ }) : $.map((a) => b(a)) : /* @__PURE__ */ t(d, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: f });
703
704
  }
704
705
  return /* @__PURE__ */ m(
705
- p,
706
+ d,
706
707
  {
707
- ...B,
708
+ ...P,
708
709
  sx: [
709
710
  {
710
711
  display: "flex",
@@ -715,8 +716,8 @@ function pr({
715
716
  ...Array.isArray(v) ? v : v ? [v] : []
716
717
  ],
717
718
  children: [
718
- g ? /* @__PURE__ */ e(
719
- p,
719
+ x ? /* @__PURE__ */ t(
720
+ d,
720
721
  {
721
722
  sx: {
722
723
  px: 1.25,
@@ -726,134 +727,134 @@ function pr({
726
727
  borderRadius: 1,
727
728
  bgcolor: "background.paper"
728
729
  },
729
- children: /* @__PURE__ */ e(
730
- Ve,
730
+ children: /* @__PURE__ */ t(
731
+ qe,
731
732
  {
732
733
  fullWidth: !0,
733
734
  value: o,
734
735
  placeholder: s,
735
- onChange: (i) => {
736
- R(i.target.value), z(0);
736
+ onChange: (a) => {
737
+ R(a.target.value), M(0);
737
738
  },
738
- onKeyDown: (i) => {
739
- i.key === "ArrowDown" && (i.preventDefault(), z((P) => Math.min(P + 1, j.length - 1))), i.key === "ArrowUp" && (i.preventDefault(), z((P) => Math.max(P - 1, 0))), i.key === "Enter" && j[u] && (i.preventDefault(), F(j[u]));
739
+ onKeyDown: (a) => {
740
+ a.key === "ArrowDown" && (a.preventDefault(), M((T) => Math.min(T + 1, j.length - 1))), a.key === "ArrowUp" && (a.preventDefault(), M((T) => Math.max(T - 1, 0))), a.key === "Enter" && j[h] && (a.preventDefault(), O(j[h]));
740
741
  },
741
742
  sx: { fontSize: 14 }
742
743
  }
743
744
  )
744
745
  }
745
746
  ) : null,
746
- /* @__PURE__ */ e(qe, { disablePadding: !0, dense: f, sx: { overflow: "auto" }, children: n === "tree" ? D() : S() })
747
+ /* @__PURE__ */ t(Ue, { disablePadding: !0, dense: p, sx: { overflow: "auto" }, children: n === "tree" ? B() : z() })
747
748
  ]
748
749
  }
749
750
  );
750
751
  }
751
- function We(t, n, d) {
752
- return Math.min(Math.max(t, n), d);
752
+ function Be(e, n, l) {
753
+ return Math.min(Math.max(e, n), l);
753
754
  }
754
- function xt(t) {
755
- if (!t || typeof window > "u")
755
+ function wt(e) {
756
+ if (!e || typeof window > "u")
756
757
  return null;
757
- const n = window.localStorage.getItem(t), d = n === null ? Number.NaN : Number(n);
758
- return Number.isFinite(d) ? d : null;
758
+ const n = window.localStorage.getItem(e), l = n === null ? Number.NaN : Number(n);
759
+ return Number.isFinite(l) ? l : null;
759
760
  }
760
- function hr({
761
- first: t,
761
+ function $r({
762
+ first: e,
762
763
  second: n,
763
- orientation: d = "horizontal",
764
+ orientation: l = "horizontal",
764
765
  initialSize: s = 50,
765
- size: b,
766
- defaultSize: c,
767
- minSize: g = 20,
768
- maxSize: f = 80,
769
- dividerSize: a = 8,
770
- snapPoints: x = [],
771
- snapThreshold: y = 4,
772
- resetSize: k = c ?? s,
766
+ size: f,
767
+ defaultSize: u,
768
+ minSize: x = 20,
769
+ maxSize: p = 80,
770
+ dividerSize: i = 8,
771
+ snapPoints: y = [],
772
+ snapThreshold: g = 4,
773
+ resetSize: w = u ?? s,
773
774
  collapsed: v,
774
- defaultCollapsed: B = null,
775
+ defaultCollapsed: P = null,
775
776
  collapsedSize: C = 0,
776
777
  persistKey: o,
777
778
  keyboardStep: R = 5,
778
- onSizeChange: u,
779
- onCollapsedChange: z,
780
- onDraggingChange: Y,
781
- dividerLabel: E = "Resize panels",
782
- sx: $,
783
- ...W
779
+ onSizeChange: h,
780
+ onCollapsedChange: M,
781
+ onDraggingChange: N,
782
+ dividerLabel: X = "Resize panels",
783
+ sx: k,
784
+ ...D
784
785
  }) {
785
- const w = oe(null), [L, j] = T(() => xt(o) ?? c ?? s), [F, l] = T(B), [M, h] = T(!1), S = d === "horizontal", i = We(b ?? L, g, f), P = v ?? F, Q = P === "first" ? C : P === "second" ? 100 - C : i, le = P === "first" && C <= 0, se = P === "second" && C <= 0;
786
- fe(() => {
787
- o && window.localStorage.setItem(o, String(i));
788
- }, [o, i]), fe(() => {
789
- Y?.(M);
790
- }, [M, Y]);
791
- function V(I) {
792
- const te = x.reduce((ce, ge) => {
793
- const me = Math.abs(ce - I);
794
- return Math.abs(ge - I) < me ? ge : ce;
795
- }, I), re = Math.abs(te - I) <= y, J = We(re ? te : I, g, f);
796
- b === void 0 && j(J), u?.(J), be(null);
786
+ const $ = oe(null), [L, j] = W(() => wt(o) ?? u ?? s), [O, c] = W(P), [S, b] = W(!1), z = l === "horizontal", a = Be(f ?? L, x, p), T = v ?? O, Q = T === "first" ? C : T === "second" ? 100 - C : a, le = T === "first" && C <= 0, se = T === "second" && C <= 0;
787
+ ge(() => {
788
+ o && window.localStorage.setItem(o, String(a));
789
+ }, [o, a]), ge(() => {
790
+ N?.(S);
791
+ }, [S, N]);
792
+ function q(I) {
793
+ const te = y.reduce((ce, me) => {
794
+ const xe = Math.abs(ce - I);
795
+ return Math.abs(me - I) < xe ? me : ce;
796
+ }, I), re = Math.abs(te - I) <= g, J = Be(re ? te : I, x, p);
797
+ f === void 0 && j(J), h?.(J), be(null);
797
798
  }
798
799
  function ee(I, te) {
799
- const re = w.current;
800
+ const re = $.current;
800
801
  if (!re)
801
802
  return;
802
- const J = re.getBoundingClientRect(), ce = S ? (I - J.left) / J.width * 100 : (te - J.top) / J.height * 100;
803
- V(ce);
803
+ const J = re.getBoundingClientRect(), ce = z ? (I - J.left) / J.width * 100 : (te - J.top) / J.height * 100;
804
+ q(ce);
804
805
  }
805
806
  function U(I) {
806
- V(i + I);
807
+ q(a + I);
807
808
  }
808
809
  function K() {
809
- V(k);
810
+ q(w);
810
811
  }
811
812
  function he(I) {
812
- be(P === I ? null : I);
813
+ be(T === I ? null : I);
813
814
  }
814
815
  function be(I) {
815
- v === void 0 && l(I), z?.(I);
816
+ v === void 0 && c(I), M?.(I);
816
817
  }
817
818
  return /* @__PURE__ */ m(
818
- p,
819
+ d,
819
820
  {
820
- ...W,
821
- ref: w,
821
+ ...D,
822
+ ref: $,
822
823
  sx: [
823
824
  {
824
825
  display: "grid",
825
- gridTemplateColumns: S ? `${Q}% ${a}px 1fr` : "1fr",
826
- gridTemplateRows: S ? "1fr" : `${Q}% ${a}px 1fr`,
826
+ gridTemplateColumns: z ? `${Q}% ${i}px 1fr` : "1fr",
827
+ gridTemplateRows: z ? "1fr" : `${Q}% ${i}px 1fr`,
827
828
  minHeight: 280,
828
829
  overflow: "hidden",
829
- userSelect: M ? "none" : void 0
830
+ userSelect: S ? "none" : void 0
830
831
  },
831
- ...Array.isArray($) ? $ : $ ? [$] : []
832
+ ...Array.isArray(k) ? k : k ? [k] : []
832
833
  ],
833
834
  onPointerMove: (I) => {
834
- M && ee(I.clientX, I.clientY);
835
+ S && ee(I.clientX, I.clientY);
835
836
  },
836
837
  onPointerUp: () => {
837
- h(!1);
838
+ b(!1);
838
839
  },
839
- onPointerCancel: () => h(!1),
840
+ onPointerCancel: () => b(!1),
840
841
  children: [
841
- /* @__PURE__ */ e(p, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: le ? "none" : void 0 }, children: t }),
842
- /* @__PURE__ */ e(
843
- p,
842
+ /* @__PURE__ */ t(d, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: le ? "none" : void 0 }, children: e }),
843
+ /* @__PURE__ */ t(
844
+ d,
844
845
  {
845
846
  role: "separator",
846
- "aria-label": E,
847
- "aria-orientation": S ? "vertical" : "horizontal",
848
- "aria-valuemin": g,
849
- "aria-valuemax": f,
850
- "aria-valuenow": Math.round(i),
847
+ "aria-label": X,
848
+ "aria-orientation": z ? "vertical" : "horizontal",
849
+ "aria-valuemin": x,
850
+ "aria-valuemax": p,
851
+ "aria-valuenow": Math.round(a),
851
852
  tabIndex: 0,
852
853
  onPointerDown: (I) => {
853
- h(!0), I.currentTarget.setPointerCapture(I.pointerId), ee(I.clientX, I.clientY);
854
+ b(!0), I.currentTarget.setPointerCapture(I.pointerId), ee(I.clientX, I.clientY);
854
855
  },
855
856
  onPointerUp: (I) => {
856
- h(!1), I.currentTarget.releasePointerCapture(I.pointerId);
857
+ b(!1), I.currentTarget.releasePointerCapture(I.pointerId);
857
858
  },
858
859
  onDoubleClick: K,
859
860
  onKeyDown: (I) => {
@@ -861,8 +862,8 @@ function hr({
861
862
  },
862
863
  sx: {
863
864
  position: "relative",
864
- bgcolor: M ? "primary.main" : "divider",
865
- cursor: S ? "col-resize" : "row-resize",
865
+ bgcolor: S ? "primary.main" : "divider",
866
+ cursor: z ? "col-resize" : "row-resize",
866
867
  touchAction: "none",
867
868
  transition: "background-color 120ms ease",
868
869
  "&:hover": {
@@ -876,63 +877,63 @@ function hr({
876
877
  "&::after": {
877
878
  content: '""',
878
879
  position: "absolute",
879
- inset: S ? "30% -4px" : "-4px 30%",
880
+ inset: z ? "30% -4px" : "-4px 30%",
880
881
  borderRadius: 999,
881
- bgcolor: M ? "primary.contrastText" : "text.disabled",
882
+ bgcolor: S ? "primary.contrastText" : "text.disabled",
882
883
  opacity: 0.55
883
884
  }
884
885
  }
885
886
  }
886
887
  ),
887
- /* @__PURE__ */ e(p, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: se ? "none" : void 0 }, children: n })
888
+ /* @__PURE__ */ t(d, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: se ? "none" : void 0 }, children: n })
888
889
  ]
889
890
  }
890
891
  );
891
892
  }
892
- function yt(t, n) {
893
- return n ?? t?.getBoundingClientRect() ?? null;
893
+ function vt(e, n) {
894
+ return n ?? e?.getBoundingClientRect() ?? null;
894
895
  }
895
- function fr({
896
- open: t,
896
+ function kr({
897
+ open: e,
897
898
  children: n,
898
- anchorEl: d,
899
+ anchorEl: l,
899
900
  anchorRect: s,
900
- containerRef: b,
901
- placement: c = "top",
902
- offset: g = 8,
903
- boundaryPadding: f = 8,
904
- autoUpdate: a = !0,
905
- arrow: x = !0,
906
- sx: y,
907
- ...k
901
+ containerRef: f,
902
+ placement: u = "top",
903
+ offset: x = 8,
904
+ boundaryPadding: p = 8,
905
+ autoUpdate: i = !0,
906
+ arrow: y = !0,
907
+ sx: g,
908
+ ...w
908
909
  }) {
909
- const v = oe(null), [B, C] = T({ left: -9999, top: -9999 }), o = je(() => {
910
- if (!t)
910
+ const v = oe(null), [P, C] = W({ left: -9999, top: -9999 }), o = Ve(() => {
911
+ if (!e)
911
912
  return;
912
- const R = yt(d, s), u = v.current;
913
- if (!R || !u)
913
+ const R = vt(l, s), h = v.current;
914
+ if (!R || !h)
914
915
  return;
915
- const z = b?.current?.getBoundingClientRect(), Y = z?.left ?? 0, E = z?.top ?? 0, $ = z?.width ?? window.innerWidth, W = z?.height ?? window.innerHeight, w = u.offsetWidth / 2, L = u.offsetHeight, j = R.left - Y + R.width / 2, F = c === "top" ? R.top - E - g : R.bottom - E + g, l = Math.min(Math.max(j, w + f), $ - w - f), M = c === "top" ? Math.max(F, L + f) : Math.min(F, W - L - f);
916
- C({ left: l, top: M });
917
- }, [d, s, f, b, g, t, c]);
918
- return Xe(() => {
916
+ const M = f?.current?.getBoundingClientRect(), N = M?.left ?? 0, X = M?.top ?? 0, k = M?.width ?? window.innerWidth, D = M?.height ?? window.innerHeight, $ = h.offsetWidth / 2, L = h.offsetHeight, j = R.left - N + R.width / 2, O = u === "top" ? R.top - X - x : R.bottom - X + x, c = Math.min(Math.max(j, $ + p), k - $ - p), S = u === "top" ? Math.max(O, L + p) : Math.min(O, D - L - p);
917
+ C({ left: c, top: S });
918
+ }, [l, s, p, f, x, e, u]);
919
+ return Fe(() => {
919
920
  o();
920
- }, [o]), fe(() => {
921
- if (!(!t || !a))
921
+ }, [o]), ge(() => {
922
+ if (!(!e || !i))
922
923
  return window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
923
924
  window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
924
925
  };
925
- }, [a, t, o]), t ? /* @__PURE__ */ e(
926
- p,
926
+ }, [i, e, o]), e ? /* @__PURE__ */ t(
927
+ d,
927
928
  {
928
- ...k,
929
+ ...w,
929
930
  ref: v,
930
931
  role: "toolbar",
931
932
  sx: [
932
933
  {
933
- position: b ? "absolute" : "fixed",
934
- left: B.left,
935
- top: B.top,
934
+ position: f ? "absolute" : "fixed",
935
+ left: P.left,
936
+ top: P.top,
936
937
  zIndex: 1300,
937
938
  display: "inline-flex",
938
939
  alignItems: "center",
@@ -942,9 +943,9 @@ function fr({
942
943
  bgcolor: "rgba(15,23,42,0.96)",
943
944
  color: "#e5e7eb",
944
945
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.34)",
945
- transform: c === "top" ? "translate(-50%, -100%)" : "translate(-50%, 0)",
946
+ transform: u === "top" ? "translate(-50%, -100%)" : "translate(-50%, 0)",
946
947
  backdropFilter: "blur(12px)",
947
- "&::after": x ? {
948
+ "&::after": y ? {
948
949
  content: '""',
949
950
  position: "absolute",
950
951
  left: "50%",
@@ -952,27 +953,27 @@ function fr({
952
953
  height: 10,
953
954
  bgcolor: "rgba(15,23,42,0.96)",
954
955
  transform: "translateX(-50%) rotate(45deg)",
955
- bottom: c === "top" ? -5 : void 0,
956
- top: c === "bottom" ? -5 : void 0
956
+ bottom: u === "top" ? -5 : void 0,
957
+ top: u === "bottom" ? -5 : void 0
957
958
  } : void 0
958
959
  },
959
- ...Array.isArray(y) ? y : y ? [y] : []
960
+ ...Array.isArray(g) ? g : g ? [g] : []
960
961
  ],
961
962
  children: n
962
963
  }
963
964
  ) : null;
964
965
  }
965
- function br({
966
- strength: t = 18,
966
+ function Cr({
967
+ strength: e = 18,
967
968
  tilt: n = 10,
968
- lift: d = 10,
969
+ lift: l = 10,
969
970
  glare: s = !0,
970
- perspective: b = 900,
971
- sx: c,
972
- children: g,
973
- ...f
971
+ perspective: f = 900,
972
+ sx: u,
973
+ children: x,
974
+ ...p
974
975
  }) {
975
- const [a, x] = T({
976
+ const [i, y] = W({
976
977
  x: 0,
977
978
  y: 0,
978
979
  rotateX: 0,
@@ -981,23 +982,23 @@ function br({
981
982
  glareY: 50,
982
983
  active: !1
983
984
  });
984
- return /* @__PURE__ */ e(
985
- p,
985
+ return /* @__PURE__ */ t(
986
+ d,
986
987
  {
987
- ...f,
988
- onMouseMove: (y) => {
989
- const k = y.currentTarget.getBoundingClientRect(), v = (y.clientX - k.left) / k.width, B = (y.clientY - k.top) / k.height, C = (v - 0.5) * t, o = (B - 0.5) * t;
990
- x({
988
+ ...p,
989
+ onMouseMove: (g) => {
990
+ const w = g.currentTarget.getBoundingClientRect(), v = (g.clientX - w.left) / w.width, P = (g.clientY - w.top) / w.height, C = (v - 0.5) * e, o = (P - 0.5) * e;
991
+ y({
991
992
  x: C,
992
993
  y: o,
993
- rotateX: (0.5 - B) * n,
994
+ rotateX: (0.5 - P) * n,
994
995
  rotateY: (v - 0.5) * n,
995
996
  glareX: v * 100,
996
- glareY: B * 100,
997
+ glareY: P * 100,
997
998
  active: !0
998
999
  });
999
1000
  },
1000
- onMouseLeave: () => x({
1001
+ onMouseLeave: () => y({
1001
1002
  x: 0,
1002
1003
  y: 0,
1003
1004
  rotateX: 0,
@@ -1011,49 +1012,49 @@ function br({
1011
1012
  position: "relative",
1012
1013
  overflow: "hidden",
1013
1014
  transform: `
1014
- perspective(${b}px)
1015
- translate3d(${a.x}px, ${a.y}px, ${a.active ? -d : 0}px)
1016
- rotateX(${a.rotateX}deg)
1017
- rotateY(${a.rotateY}deg)
1015
+ perspective(${f}px)
1016
+ translate3d(${i.x}px, ${i.y}px, ${i.active ? -l : 0}px)
1017
+ rotateX(${i.rotateX}deg)
1018
+ rotateY(${i.rotateY}deg)
1018
1019
  `,
1019
1020
  transformStyle: "preserve-3d",
1020
- transition: a.active ? "transform 80ms ease-out, box-shadow 120ms ease-out" : "transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease",
1021
+ transition: i.active ? "transform 80ms ease-out, box-shadow 120ms ease-out" : "transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease",
1021
1022
  willChange: "transform",
1022
- boxShadow: a.active ? "0 28px 70px rgba(15, 23, 42, 0.24)" : "0 14px 34px rgba(15, 23, 42, 0.12)",
1023
+ boxShadow: i.active ? "0 28px 70px rgba(15, 23, 42, 0.24)" : "0 14px 34px rgba(15, 23, 42, 0.12)",
1023
1024
  "&::before": s ? {
1024
1025
  content: '""',
1025
1026
  position: "absolute",
1026
1027
  inset: 0,
1027
1028
  pointerEvents: "none",
1028
- opacity: a.active ? 0.78 : 0,
1029
+ opacity: i.active ? 0.78 : 0,
1029
1030
  transition: "opacity 160ms ease",
1030
- background: `radial-gradient(circle at ${a.glareX}% ${a.glareY}%, rgba(255,255,255,0.55), rgba(255,255,255,0.16) 22%, transparent 48%)`,
1031
+ background: `radial-gradient(circle at ${i.glareX}% ${i.glareY}%, rgba(255,255,255,0.55), rgba(255,255,255,0.16) 22%, transparent 48%)`,
1031
1032
  mixBlendMode: "screen"
1032
1033
  } : void 0,
1033
1034
  "& > *": {
1034
1035
  position: "relative",
1035
1036
  zIndex: 1,
1036
- transform: a.active ? "translateZ(24px)" : "translateZ(0)",
1037
+ transform: i.active ? "translateZ(24px)" : "translateZ(0)",
1037
1038
  transition: "transform 180ms ease"
1038
1039
  }
1039
1040
  },
1040
- ...Array.isArray(c) ? c : c ? [c] : []
1041
+ ...Array.isArray(u) ? u : u ? [u] : []
1041
1042
  ],
1042
- children: g
1043
+ children: x
1043
1044
  }
1044
1045
  );
1045
1046
  }
1046
- function gr({ radius: t = 160, dim: n = 0.72, sx: d, children: s, ...b }) {
1047
- const [c, g] = T({ x: 50, y: 50 });
1048
- return /* @__PURE__ */ e(
1049
- p,
1047
+ function Ir({ radius: e = 160, dim: n = 0.72, sx: l, children: s, ...f }) {
1048
+ const [u, x] = W({ x: 50, y: 50 });
1049
+ return /* @__PURE__ */ t(
1050
+ d,
1050
1051
  {
1051
- ...b,
1052
- onMouseMove: (f) => {
1053
- const a = f.currentTarget.getBoundingClientRect();
1054
- g({
1055
- x: (f.clientX - a.left) / a.width * 100,
1056
- y: (f.clientY - a.top) / a.height * 100
1052
+ ...f,
1053
+ onMouseMove: (p) => {
1054
+ const i = p.currentTarget.getBoundingClientRect();
1055
+ x({
1056
+ x: (p.clientX - i.left) / i.width * 100,
1057
+ y: (p.clientY - i.top) / i.height * 100
1057
1058
  });
1058
1059
  },
1059
1060
  sx: [
@@ -1065,144 +1066,144 @@ function gr({ radius: t = 160, dim: n = 0.72, sx: d, children: s, ...b }) {
1065
1066
  position: "absolute",
1066
1067
  inset: 0,
1067
1068
  pointerEvents: "none",
1068
- background: `radial-gradient(circle ${t}px at ${c.x}% ${c.y}%, transparent 0, transparent 45%, rgba(0,0,0,${n}) 100%)`
1069
+ background: `radial-gradient(circle ${e}px at ${u.x}% ${u.y}%, transparent 0, transparent 45%, rgba(0,0,0,${n}) 100%)`
1069
1070
  }
1070
1071
  },
1071
- ...Array.isArray(d) ? d : d ? [d] : []
1072
+ ...Array.isArray(l) ? l : l ? [l] : []
1072
1073
  ],
1073
1074
  children: s
1074
1075
  }
1075
1076
  );
1076
1077
  }
1077
- function Be(t, n) {
1078
- return Math.round(t / n) * n;
1078
+ function Ee(e, n) {
1079
+ return Math.round(e / n) * n;
1079
1080
  }
1080
- function wt(t, n, d, s, b) {
1081
- const c = t.x + d / 2, g = t.y + s / 2, f = n.x + d / 2, a = n.y + s / 2, x = (c + f) / 2;
1082
- if (b === "ellipse") {
1083
- const y = Math.max(Math.abs(f - c) / 2, 24), k = Math.max(Math.abs(a - g) / 2, 24);
1084
- return `M ${c} ${g} A ${y} ${k} 0 0 1 ${f} ${a}`;
1081
+ function $t(e, n, l, s, f) {
1082
+ const u = e.x + l / 2, x = e.y + s / 2, p = n.x + l / 2, i = n.y + s / 2, y = (u + p) / 2;
1083
+ if (f === "ellipse") {
1084
+ const g = Math.max(Math.abs(p - u) / 2, 24), w = Math.max(Math.abs(i - x) / 2, 24);
1085
+ return `M ${u} ${x} A ${g} ${w} 0 0 1 ${p} ${i}`;
1085
1086
  }
1086
- return b === "curved" ? `M ${c} ${g} C ${x} ${g}, ${x} ${a}, ${f} ${a}` : b === "step" ? `M ${c} ${g} L ${x} ${g} L ${x} ${a} L ${f} ${a}` : `M ${c} ${g} L ${f} ${a}`;
1087
+ return f === "curved" ? `M ${u} ${x} C ${y} ${x}, ${y} ${i}, ${p} ${i}` : f === "step" ? `M ${u} ${x} L ${y} ${x} L ${y} ${i} L ${p} ${i}` : `M ${u} ${x} L ${p} ${i}`;
1087
1088
  }
1088
- function mr({
1089
- nodes: t,
1089
+ function Mr({
1090
+ nodes: e,
1090
1091
  connections: n = [],
1091
- nodeWidth: d = 132,
1092
+ nodeWidth: l = 132,
1092
1093
  nodeHeight: s = 52,
1093
- mode: b = "edit",
1094
- snapToGrid: c = !1,
1095
- gridSize: g = 24,
1096
- showGrid: f = !1,
1097
- selectedNodeId: a,
1098
- connectionStyle: x = "line",
1099
- editableTools: y = !1,
1100
- linkTypes: k = ["line", "curved", "step", "ellipse"],
1094
+ mode: f = "edit",
1095
+ snapToGrid: u = !1,
1096
+ gridSize: x = 24,
1097
+ showGrid: p = !1,
1098
+ selectedNodeId: i,
1099
+ connectionStyle: y = "line",
1100
+ editableTools: g = !1,
1101
+ linkTypes: w = ["line", "curved", "step", "ellipse"],
1101
1102
  renderNode: v,
1102
- onNodesChange: B,
1103
+ onNodesChange: P,
1103
1104
  onConnectionsChange: C,
1104
1105
  onNodeMove: o,
1105
1106
  onNodeSelect: R,
1106
- sx: u,
1107
- ...z
1107
+ sx: h,
1108
+ ...M
1108
1109
  }) {
1109
- const [Y, E] = T(t), [$, W] = T(n), w = y ? Y : t, L = y ? $ : n, [j, F] = T(
1110
- Object.fromEntries(w.map((r) => [r.id, { x: r.x, y: r.y }]))
1111
- ), [l, M] = T(a ?? null), [h, S] = T(!1), [D, i] = T(""), [P, Q] = T(k[0] ?? "line"), [le, se] = T(""), [V, ee] = T(null), U = a ?? l, K = w.find((r) => r.id === U) ?? null, he = L.map((r, A) => ({ connection: r, index: A })).filter(({ connection: r }) => r.from === U || r.to === U), be = t.map((r) => `${r.id}:${r.label}:${r.x}:${r.y}:${r.color ?? ""}`).join("|"), I = n.map((r) => `${r.from}:${r.to}:${r.type ?? ""}:${r.label ?? ""}:${r.color ?? ""}`).join("|");
1112
- fe(() => {
1113
- y || E(t), F((r) => ({
1114
- ...Object.fromEntries(t.map((A) => [A.id, r[A.id] ?? { x: A.x, y: A.y }]))
1110
+ const [N, X] = W(e), [k, D] = W(n), $ = g ? N : e, L = g ? k : n, [j, O] = W(
1111
+ Object.fromEntries($.map((r) => [r.id, { x: r.x, y: r.y }]))
1112
+ ), [c, S] = W(i ?? null), [b, z] = W(!1), [B, a] = W(""), [T, Q] = W(w[0] ?? "line"), [le, se] = W(""), [q, ee] = W(null), U = i ?? c, K = $.find((r) => r.id === U) ?? null, he = L.map((r, A) => ({ connection: r, index: A })).filter(({ connection: r }) => r.from === U || r.to === U), be = e.map((r) => `${r.id}:${r.label}:${r.x}:${r.y}:${r.color ?? ""}`).join("|"), I = n.map((r) => `${r.from}:${r.to}:${r.type ?? ""}:${r.label ?? ""}:${r.color ?? ""}`).join("|");
1113
+ ge(() => {
1114
+ g || X(e), O((r) => ({
1115
+ ...Object.fromEntries(e.map((A) => [A.id, r[A.id] ?? { x: A.x, y: A.y }]))
1115
1116
  }));
1116
- }, [y, be]), fe(() => {
1117
- y || W(n);
1118
- }, [I, y]);
1117
+ }, [g, be]), ge(() => {
1118
+ g || D(n);
1119
+ }, [I, g]);
1119
1120
  function te(r) {
1120
- E(r), B?.(r);
1121
+ X(r), P?.(r);
1121
1122
  }
1122
1123
  function re(r) {
1123
- W(r), C?.(r);
1124
+ D(r), C?.(r);
1124
1125
  }
1125
1126
  function J(r, A) {
1126
- const O = c ? { x: Be(A.x, g), y: Be(A.y, g) } : A;
1127
- F((X) => ({
1128
- ...X,
1129
- [r]: O
1130
- })), y && te(w.map((X) => X.id === r ? { ...X, ...O } : X)), o?.(r, O);
1127
+ const H = u ? { x: Ee(A.x, x), y: Ee(A.y, x) } : A;
1128
+ O((F) => ({
1129
+ ...F,
1130
+ [r]: H
1131
+ })), g && te($.map((F) => F.id === r ? { ...F, ...H } : F)), o?.(r, H);
1131
1132
  }
1132
1133
  function ce() {
1133
- const r = w.length + 1, A = {
1134
+ const r = $.length + 1, A = {
1134
1135
  id: `node-${Date.now()}`,
1135
1136
  label: `Box ${r}`,
1136
1137
  x: 48 + r * 18,
1137
1138
  y: 48 + r * 18,
1138
1139
  color: "#ffffff"
1139
1140
  };
1140
- te([...w, A]), F((O) => ({
1141
- ...O,
1141
+ te([...$, A]), O((H) => ({
1142
+ ...H,
1142
1143
  [A.id]: { x: A.x, y: A.y }
1143
- })), M(A.id);
1144
+ })), S(A.id);
1144
1145
  }
1145
- function ge() {
1146
- U && (te(w.filter((r) => r.id !== U)), re(L.filter((r) => r.from !== U && r.to !== U)), M(null), S(!1));
1146
+ function me() {
1147
+ U && (te($.filter((r) => r.id !== U)), re(L.filter((r) => r.from !== U && r.to !== U)), S(null), z(!1));
1147
1148
  }
1148
- function me(r) {
1149
- U && te(w.map((A) => A.id === U ? { ...A, ...r } : A));
1149
+ function xe(r) {
1150
+ U && te($.map((A) => A.id === U ? { ...A, ...r } : A));
1150
1151
  }
1151
- function Ie() {
1152
- if (!U || !D || U === D)
1152
+ function ze() {
1153
+ if (!U || !B || U === B)
1153
1154
  return;
1154
1155
  const r = {
1155
1156
  from: U,
1156
- to: D,
1157
- type: P,
1157
+ to: B,
1158
+ type: T,
1158
1159
  label: le,
1159
- color: P === "ellipse" ? "#db2777" : P === "step" ? "#059669" : "#2563eb"
1160
+ color: T === "ellipse" ? "#db2777" : T === "step" ? "#059669" : "#2563eb"
1160
1161
  }, A = [
1161
- ...L.filter((O) => !(O.from === U && O.to === D)),
1162
+ ...L.filter((H) => !(H.from === U && H.to === B)),
1162
1163
  r
1163
1164
  ];
1164
- re(A), i(""), se(""), ee(A.indexOf(r));
1165
+ re(A), a(""), se(""), ee(A.indexOf(r));
1165
1166
  }
1166
- function xe(r, A) {
1167
- const O = L[r];
1168
- if (!O)
1167
+ function ye(r, A) {
1168
+ const H = L[r];
1169
+ if (!H)
1169
1170
  return;
1170
- const X = { ...O, ...A }, _ = L.map((G, de) => de === r ? X : G).filter((G, de) => de === r || G.from !== X.from || G.to !== X.to);
1171
- re(_);
1171
+ const F = { ...H, ...A }, Z = L.map((G, de) => de === r ? F : G).filter((G, de) => de === r || G.from !== F.from || G.to !== F.to);
1172
+ re(Z);
1172
1173
  }
1173
- function Oe(r) {
1174
- re(L.filter((A, O) => O !== r)), ee(null);
1174
+ function He(r) {
1175
+ re(L.filter((A, H) => H !== r)), ee(null);
1175
1176
  }
1176
1177
  return /* @__PURE__ */ m(
1177
- p,
1178
+ d,
1178
1179
  {
1179
- ...z,
1180
+ ...M,
1180
1181
  sx: [
1181
1182
  {
1182
1183
  position: "relative",
1183
1184
  minHeight: 360,
1184
1185
  overflow: "hidden",
1185
1186
  bgcolor: "#f8fafc",
1186
- backgroundImage: f ? "linear-gradient(rgba(148,163,184,0.24) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,0.24) 1px, transparent 1px)" : void 0,
1187
- backgroundSize: f ? `${g}px ${g}px` : void 0
1187
+ backgroundImage: p ? "linear-gradient(rgba(148,163,184,0.24) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,0.24) 1px, transparent 1px)" : void 0,
1188
+ backgroundSize: p ? `${x}px ${x}px` : void 0
1188
1189
  },
1189
- ...Array.isArray(u) ? u : u ? [u] : []
1190
+ ...Array.isArray(h) ? h : h ? [h] : []
1190
1191
  ],
1191
1192
  children: [
1192
- /* @__PURE__ */ e(p, { component: "svg", sx: { position: "absolute", inset: 0, width: "100%", height: "100%" }, children: L.map((r) => {
1193
- const A = j[r.from], O = j[r.to];
1194
- if (!A || !O)
1193
+ /* @__PURE__ */ t(d, { component: "svg", sx: { position: "absolute", inset: 0, width: "100%", height: "100%" }, children: L.map((r) => {
1194
+ const A = j[r.from], H = j[r.to];
1195
+ if (!A || !H)
1195
1196
  return null;
1196
- const X = wt(A, O, d, s, r.type ?? x), _ = (A.x + O.x + d) / 2, G = (A.y + O.y + s) / 2;
1197
+ const F = $t(A, H, l, s, r.type ?? y), Z = (A.x + H.x + l) / 2, G = (A.y + H.y + s) / 2;
1197
1198
  return /* @__PURE__ */ m("g", { children: [
1198
- /* @__PURE__ */ e("path", { d: X, fill: "none", stroke: r.color ?? "#94a3b8", strokeWidth: "2.5" }),
1199
- r.label ? /* @__PURE__ */ e("text", { x: _, y: G - 8, textAnchor: "middle", fill: r.color ?? "#64748b", fontSize: "11", fontWeight: "700", children: r.label }) : null
1199
+ /* @__PURE__ */ t("path", { d: F, fill: "none", stroke: r.color ?? "#94a3b8", strokeWidth: "2.5" }),
1200
+ r.label ? /* @__PURE__ */ t("text", { x: Z, y: G - 8, textAnchor: "middle", fill: r.color ?? "#64748b", fontSize: "11", fontWeight: "700", children: r.label }) : null
1200
1201
  ] }, `${r.from}-${r.to}-${r.type ?? r.label ?? "link"}`);
1201
1202
  }) }),
1202
- w.map((r) => {
1203
- const A = j[r.id], O = r.id === U;
1204
- return /* @__PURE__ */ e(
1205
- p,
1203
+ $.map((r) => {
1204
+ const A = j[r.id], H = r.id === U;
1205
+ return /* @__PURE__ */ t(
1206
+ d,
1206
1207
  {
1207
1208
  role: "button",
1208
1209
  tabIndex: 0,
@@ -1210,48 +1211,48 @@ function mr({
1210
1211
  position: "absolute",
1211
1212
  left: A.x,
1212
1213
  top: A.y,
1213
- width: d,
1214
+ width: l,
1214
1215
  height: s,
1215
1216
  display: "grid",
1216
1217
  placeItems: "center",
1217
- border: O ? 2 : 1,
1218
- borderColor: O ? "primary.main" : "divider",
1218
+ border: H ? 2 : 1,
1219
+ borderColor: H ? "primary.main" : "divider",
1219
1220
  borderRadius: 1,
1220
1221
  bgcolor: r.color ?? "background.paper",
1221
- cursor: b === "edit" ? "grab" : "pointer",
1222
+ cursor: f === "edit" ? "grab" : "pointer",
1222
1223
  userSelect: "none",
1223
- boxShadow: O ? "0 18px 34px rgba(37,99,235,0.22)" : "0 12px 28px rgba(15,23,42,0.12)",
1224
+ boxShadow: H ? "0 18px 34px rgba(37,99,235,0.22)" : "0 12px 28px rgba(15,23,42,0.12)",
1224
1225
  touchAction: "none"
1225
1226
  },
1226
- onPointerDown: (X) => {
1227
- if (M(r.id), ee(null), y && S(!0), R?.(r), b === "readonly")
1227
+ onPointerDown: (F) => {
1228
+ if (S(r.id), ee(null), g && z(!0), R?.(r), f === "readonly")
1228
1229
  return;
1229
- const _ = X.clientX, G = X.clientY, de = j[r.id];
1230
- X.currentTarget.setPointerCapture(X.pointerId);
1231
- function ze(Me) {
1230
+ const Z = F.clientX, G = F.clientY, de = j[r.id];
1231
+ F.currentTarget.setPointerCapture(F.pointerId);
1232
+ function Se(Re) {
1232
1233
  J(r.id, {
1233
- x: de.x + Me.clientX - _,
1234
- y: de.y + Me.clientY - G
1234
+ x: de.x + Re.clientX - Z,
1235
+ y: de.y + Re.clientY - G
1235
1236
  });
1236
1237
  }
1237
- function Se() {
1238
- window.removeEventListener("pointermove", ze), window.removeEventListener("pointerup", Se);
1238
+ function Ae() {
1239
+ window.removeEventListener("pointermove", Se), window.removeEventListener("pointerup", Ae);
1239
1240
  }
1240
- window.addEventListener("pointermove", ze), window.addEventListener("pointerup", Se);
1241
+ window.addEventListener("pointermove", Se), window.addEventListener("pointerup", Ae);
1241
1242
  },
1242
- onKeyDown: (X) => {
1243
- if (b === "readonly")
1243
+ onKeyDown: (F) => {
1244
+ if (f === "readonly")
1244
1245
  return;
1245
- const _ = c ? g : 8, G = j[r.id];
1246
- X.key === "ArrowLeft" && (J(r.id, { x: G.x - _, y: G.y }), X.preventDefault()), X.key === "ArrowRight" && (J(r.id, { x: G.x + _, y: G.y }), X.preventDefault()), X.key === "ArrowUp" && (J(r.id, { x: G.x, y: G.y - _ }), X.preventDefault()), X.key === "ArrowDown" && (J(r.id, { x: G.x, y: G.y + _ }), X.preventDefault());
1246
+ const Z = u ? x : 8, G = j[r.id];
1247
+ F.key === "ArrowLeft" && (J(r.id, { x: G.x - Z, y: G.y }), F.preventDefault()), F.key === "ArrowRight" && (J(r.id, { x: G.x + Z, y: G.y }), F.preventDefault()), F.key === "ArrowUp" && (J(r.id, { x: G.x, y: G.y - Z }), F.preventDefault()), F.key === "ArrowDown" && (J(r.id, { x: G.x, y: G.y + Z }), F.preventDefault());
1247
1248
  },
1248
- children: v ? v(r, O) : /* @__PURE__ */ e(N, { fontWeight: 800, children: r.label })
1249
+ children: v ? v(r, H) : /* @__PURE__ */ t(E, { fontWeight: 800, children: r.label })
1249
1250
  },
1250
1251
  r.id
1251
1252
  );
1252
1253
  }),
1253
- y && K && h ? /* @__PURE__ */ e(
1254
- p,
1254
+ g && K && b ? /* @__PURE__ */ t(
1255
+ d,
1255
1256
  {
1256
1257
  sx: {
1257
1258
  position: "absolute",
@@ -1268,71 +1269,71 @@ function mr({
1268
1269
  bgcolor: "background.paper",
1269
1270
  boxShadow: "0 20px 48px rgba(15,23,42,0.22)"
1270
1271
  },
1271
- children: /* @__PURE__ */ m(q, { spacing: 1.25, sx: { p: 1.5 }, children: [
1272
- /* @__PURE__ */ m(q, { direction: "row", spacing: 0.75, alignItems: "center", children: [
1273
- /* @__PURE__ */ e(N, { variant: "subtitle2", fontWeight: 900, sx: { flex: 1 }, children: "Box editor" }),
1274
- /* @__PURE__ */ e(ie, { title: "Add box", children: /* @__PURE__ */ e(ue, { size: "small", color: "primary", onClick: ce, children: /* @__PURE__ */ e(_e, { fontSize: "small" }) }) }),
1275
- /* @__PURE__ */ e(ie, { title: "Remove box", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(ue, { size: "small", color: "error", onClick: ge, disabled: !K, children: /* @__PURE__ */ e(Je, { fontSize: "small" }) }) }) }),
1276
- /* @__PURE__ */ e(ie, { title: "Close editor", children: /* @__PURE__ */ e(ue, { size: "small", onClick: () => S(!1), children: /* @__PURE__ */ e(Qe, { fontSize: "small" }) }) })
1272
+ children: /* @__PURE__ */ m(V, { spacing: 1.25, sx: { p: 1.5 }, children: [
1273
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 0.75, alignItems: "center", children: [
1274
+ /* @__PURE__ */ t(E, { variant: "subtitle2", fontWeight: 900, sx: { flex: 1 }, children: "Box editor" }),
1275
+ /* @__PURE__ */ t(ie, { title: "Add box", children: /* @__PURE__ */ t(ue, { size: "small", color: "primary", onClick: ce, children: /* @__PURE__ */ t(_e, { fontSize: "small" }) }) }),
1276
+ /* @__PURE__ */ t(ie, { title: "Remove box", children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(ue, { size: "small", color: "error", onClick: me, disabled: !K, children: /* @__PURE__ */ t(Ke, { fontSize: "small" }) }) }) }),
1277
+ /* @__PURE__ */ t(ie, { title: "Close editor", children: /* @__PURE__ */ t(ue, { size: "small", onClick: () => z(!1), children: /* @__PURE__ */ t(Je, { fontSize: "small" }) }) })
1277
1278
  ] }),
1278
- /* @__PURE__ */ m(p, { sx: { display: "grid", gridTemplateColumns: "1fr 96px", gap: 1 }, children: [
1279
- /* @__PURE__ */ e(
1280
- Z,
1279
+ /* @__PURE__ */ m(d, { sx: { display: "grid", gridTemplateColumns: "1fr 96px", gap: 1 }, children: [
1280
+ /* @__PURE__ */ t(
1281
+ _,
1281
1282
  {
1282
1283
  size: "small",
1283
1284
  label: "Label",
1284
1285
  value: K?.label ?? "",
1285
1286
  disabled: !K,
1286
- onChange: (r) => me({ label: r.target.value })
1287
+ onChange: (r) => xe({ label: r.target.value })
1287
1288
  }
1288
1289
  ),
1289
- /* @__PURE__ */ e(
1290
- Z,
1290
+ /* @__PURE__ */ t(
1291
+ _,
1291
1292
  {
1292
1293
  size: "small",
1293
1294
  label: "Color",
1294
1295
  type: "color",
1295
1296
  value: K?.color ?? "#ffffff",
1296
1297
  disabled: !K,
1297
- onChange: (r) => me({ color: r.target.value })
1298
+ onChange: (r) => xe({ color: r.target.value })
1298
1299
  }
1299
1300
  )
1300
1301
  ] }),
1301
- /* @__PURE__ */ m(p, { sx: { display: "grid", gridTemplateColumns: "1fr", gap: 1.25 }, children: [
1302
- /* @__PURE__ */ m(q, { spacing: 1, children: [
1303
- /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Links" }),
1304
- /* @__PURE__ */ m(p, { sx: { display: "grid", gridTemplateColumns: "1fr 32px", gap: 0.5, alignItems: "center" }, children: [
1302
+ /* @__PURE__ */ m(d, { sx: { display: "grid", gridTemplateColumns: "1fr", gap: 1.25 }, children: [
1303
+ /* @__PURE__ */ m(V, { spacing: 1, children: [
1304
+ /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Links" }),
1305
+ /* @__PURE__ */ m(d, { sx: { display: "grid", gridTemplateColumns: "1fr 32px", gap: 0.5, alignItems: "center" }, children: [
1305
1306
  /* @__PURE__ */ m(
1306
- Z,
1307
+ _,
1307
1308
  {
1308
1309
  select: !0,
1309
1310
  size: "small",
1310
1311
  label: "To",
1311
- value: D,
1312
+ value: B,
1312
1313
  disabled: !K,
1313
- onChange: (r) => i(r.target.value),
1314
+ onChange: (r) => a(r.target.value),
1314
1315
  children: [
1315
- /* @__PURE__ */ e(pe, { value: "", children: "Pick target" }),
1316
- w.filter((r) => r.id !== U).map((r) => /* @__PURE__ */ e(pe, { value: r.id, children: r.label }, r.id))
1316
+ /* @__PURE__ */ t(pe, { value: "", children: "Pick target" }),
1317
+ $.filter((r) => r.id !== U).map((r) => /* @__PURE__ */ t(pe, { value: r.id, children: r.label }, r.id))
1317
1318
  ]
1318
1319
  }
1319
1320
  ),
1320
- /* @__PURE__ */ e(ie, { title: `Add link from ${K?.label ?? "box"}`, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
1321
+ /* @__PURE__ */ t(ie, { title: `Add link from ${K?.label ?? "box"}`, children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
1321
1322
  ue,
1322
1323
  {
1323
1324
  size: "small",
1324
1325
  color: "primary",
1325
- disabled: !K || !D,
1326
- onClick: Ie,
1326
+ disabled: !K || !B,
1327
+ onClick: ze,
1327
1328
  sx: { width: 32, height: 32, border: 1, borderColor: "divider", borderRadius: 1 },
1328
- children: /* @__PURE__ */ e(Ze, { fontSize: "small" })
1329
+ children: /* @__PURE__ */ t(Qe, { fontSize: "small" })
1329
1330
  }
1330
1331
  ) }) })
1331
1332
  ] }),
1332
1333
  he.length ? he.map(({ connection: r, index: A }) => {
1333
- const O = w.find((G) => G.id === r.from), X = w.find((G) => G.id === r.to), _ = V === A;
1334
+ const H = $.find((G) => G.id === r.from), F = $.find((G) => G.id === r.to), Z = q === A;
1334
1335
  return /* @__PURE__ */ m(
1335
- p,
1336
+ d,
1336
1337
  {
1337
1338
  sx: {
1338
1339
  width: "100%",
@@ -1342,8 +1343,8 @@ function mr({
1342
1343
  alignItems: "center"
1343
1344
  },
1344
1345
  children: [
1345
- /* @__PURE__ */ e(
1346
- p,
1346
+ /* @__PURE__ */ t(
1347
+ d,
1347
1348
  {
1348
1349
  component: "button",
1349
1350
  onClick: () => ee(A),
@@ -1352,72 +1353,72 @@ function mr({
1352
1353
  py: 0.75,
1353
1354
  minWidth: 0,
1354
1355
  border: 1,
1355
- borderColor: _ ? "primary.main" : "divider",
1356
+ borderColor: Z ? "primary.main" : "divider",
1356
1357
  borderRadius: 1,
1357
- bgcolor: _ ? "primary.main" : "background.paper",
1358
- color: _ ? "primary.contrastText" : "text.primary",
1358
+ bgcolor: Z ? "primary.main" : "background.paper",
1359
+ color: Z ? "primary.contrastText" : "text.primary",
1359
1360
  cursor: "pointer",
1360
1361
  font: "inherit",
1361
1362
  textAlign: "left"
1362
1363
  },
1363
- children: (O?.label ?? r.from) + " -> " + (X?.label ?? r.to)
1364
+ children: (H?.label ?? r.from) + " -> " + (F?.label ?? r.to)
1364
1365
  }
1365
1366
  ),
1366
- /* @__PURE__ */ e(ie, { title: "Remove link", children: /* @__PURE__ */ e(ue, { size: "small", color: "error", onClick: () => Oe(A), sx: { width: 32, height: 32 }, children: /* @__PURE__ */ e(Ke, { fontSize: "small" }) }) })
1367
+ /* @__PURE__ */ t(ie, { title: "Remove link", children: /* @__PURE__ */ t(ue, { size: "small", color: "error", onClick: () => He(A), sx: { width: 32, height: 32 }, children: /* @__PURE__ */ t(et, { fontSize: "small" }) }) })
1367
1368
  ]
1368
1369
  },
1369
1370
  `${r.from}-${r.to}-${A}`
1370
1371
  );
1371
- }) : /* @__PURE__ */ e(N, { variant: "body2", color: "text.secondary", children: "No linked boxes." })
1372
+ }) : /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", children: "No linked boxes." })
1372
1373
  ] }),
1373
- /* @__PURE__ */ m(q, { spacing: 1, children: [
1374
- /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Link details" }),
1375
- V !== null && L[V] ? /* @__PURE__ */ m(Ee, { children: [
1376
- /* @__PURE__ */ e(
1377
- Z,
1374
+ /* @__PURE__ */ m(V, { spacing: 1, children: [
1375
+ /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Link details" }),
1376
+ q !== null && L[q] ? /* @__PURE__ */ m(Ye, { children: [
1377
+ /* @__PURE__ */ t(
1378
+ _,
1378
1379
  {
1379
1380
  select: !0,
1380
1381
  size: "small",
1381
1382
  label: "From",
1382
- value: L[V].from,
1383
- onChange: (r) => xe(V, { from: r.target.value }),
1384
- children: w.filter((r) => r.id !== L[V].to).map((r) => /* @__PURE__ */ e(pe, { value: r.id, children: r.label }, r.id))
1383
+ value: L[q].from,
1384
+ onChange: (r) => ye(q, { from: r.target.value }),
1385
+ children: $.filter((r) => r.id !== L[q].to).map((r) => /* @__PURE__ */ t(pe, { value: r.id, children: r.label }, r.id))
1385
1386
  }
1386
1387
  ),
1387
- /* @__PURE__ */ m(p, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }, children: [
1388
- /* @__PURE__ */ e(
1389
- Z,
1388
+ /* @__PURE__ */ m(d, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }, children: [
1389
+ /* @__PURE__ */ t(
1390
+ _,
1390
1391
  {
1391
1392
  select: !0,
1392
1393
  size: "small",
1393
1394
  label: "To",
1394
- value: L[V].to,
1395
- onChange: (r) => xe(V, { to: r.target.value }),
1396
- children: w.filter((r) => r.id !== L[V].from).map((r) => /* @__PURE__ */ e(pe, { value: r.id, children: r.label }, r.id))
1395
+ value: L[q].to,
1396
+ onChange: (r) => ye(q, { to: r.target.value }),
1397
+ children: $.filter((r) => r.id !== L[q].from).map((r) => /* @__PURE__ */ t(pe, { value: r.id, children: r.label }, r.id))
1397
1398
  }
1398
1399
  ),
1399
- /* @__PURE__ */ e(
1400
- Z,
1400
+ /* @__PURE__ */ t(
1401
+ _,
1401
1402
  {
1402
1403
  select: !0,
1403
1404
  size: "small",
1404
1405
  label: "Shape",
1405
- value: L[V].type ?? x,
1406
- onChange: (r) => xe(V, { type: r.target.value }),
1407
- children: k.map((r) => /* @__PURE__ */ e(pe, { value: r, children: r }, r))
1406
+ value: L[q].type ?? y,
1407
+ onChange: (r) => ye(q, { type: r.target.value }),
1408
+ children: w.map((r) => /* @__PURE__ */ t(pe, { value: r, children: r }, r))
1408
1409
  }
1409
1410
  )
1410
1411
  ] }),
1411
- /* @__PURE__ */ e(
1412
- Z,
1412
+ /* @__PURE__ */ t(
1413
+ _,
1413
1414
  {
1414
1415
  size: "small",
1415
1416
  label: "Label",
1416
- value: L[V].label ?? "",
1417
- onChange: (r) => xe(V, { label: r.target.value })
1417
+ value: L[q].label ?? "",
1418
+ onChange: (r) => ye(q, { label: r.target.value })
1418
1419
  }
1419
1420
  )
1420
- ] }) : /* @__PURE__ */ e(N, { variant: "body2", color: "text.secondary", children: "Pick a link." })
1421
+ ] }) : /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", children: "Pick a link." })
1421
1422
  ] })
1422
1423
  ] })
1423
1424
  ] })
@@ -1427,61 +1428,61 @@ function mr({
1427
1428
  }
1428
1429
  );
1429
1430
  }
1430
- function xr({ before: t, after: n, initialPosition: d = 50, sx: s, ...b }) {
1431
- const [c, g] = T(d);
1431
+ function zr({ before: e, after: n, initialPosition: l = 50, sx: s, ...f }) {
1432
+ const [u, x] = W(l);
1432
1433
  return /* @__PURE__ */ m(
1433
- p,
1434
+ d,
1434
1435
  {
1435
- ...b,
1436
+ ...f,
1436
1437
  sx: [
1437
1438
  { position: "relative", overflow: "hidden", minHeight: 280 },
1438
1439
  ...Array.isArray(s) ? s : s ? [s] : []
1439
1440
  ],
1440
- onPointerMove: (f) => {
1441
- if (f.buttons !== 1)
1441
+ onPointerMove: (p) => {
1442
+ if (p.buttons !== 1)
1442
1443
  return;
1443
- const a = f.currentTarget.getBoundingClientRect();
1444
- g((f.clientX - a.left) / a.width * 100);
1444
+ const i = p.currentTarget.getBoundingClientRect();
1445
+ x((p.clientX - i.left) / i.width * 100);
1445
1446
  },
1446
1447
  children: [
1447
- /* @__PURE__ */ e(p, { sx: { position: "absolute", inset: 0 }, children: n }),
1448
- /* @__PURE__ */ e(p, { sx: { position: "absolute", inset: 0, width: `${c}%`, overflow: "hidden" }, children: t }),
1449
- /* @__PURE__ */ e(p, { sx: { position: "absolute", top: 0, bottom: 0, left: `${c}%`, width: 3, bgcolor: "#ffffff", boxShadow: "0 0 0 1px rgba(0,0,0,0.2)", cursor: "ew-resize" } })
1448
+ /* @__PURE__ */ t(d, { sx: { position: "absolute", inset: 0 }, children: n }),
1449
+ /* @__PURE__ */ t(d, { sx: { position: "absolute", inset: 0, width: `${u}%`, overflow: "hidden" }, children: e }),
1450
+ /* @__PURE__ */ t(d, { sx: { position: "absolute", top: 0, bottom: 0, left: `${u}%`, width: 3, bgcolor: "#ffffff", boxShadow: "0 0 0 1px rgba(0,0,0,0.2)", cursor: "ew-resize" } })
1450
1451
  ]
1451
1452
  }
1452
1453
  );
1453
1454
  }
1454
- function yr({
1455
- initialWidth: t = 320,
1455
+ function Sr({
1456
+ initialWidth: e = 320,
1456
1457
  initialHeight: n = 220,
1457
- minWidth: d = 160,
1458
+ minWidth: l = 160,
1458
1459
  minHeight: s = 120,
1459
- sx: b,
1460
- children: c,
1461
- ...g
1460
+ sx: f,
1461
+ children: u,
1462
+ ...x
1462
1463
  }) {
1463
- const [f, a] = T({ width: t, height: n });
1464
+ const [p, i] = W({ width: e, height: n });
1464
1465
  return /* @__PURE__ */ m(
1465
- p,
1466
+ d,
1466
1467
  {
1467
- ...g,
1468
+ ...x,
1468
1469
  sx: [
1469
1470
  {
1470
1471
  position: "relative",
1471
- width: f.width,
1472
- height: f.height,
1472
+ width: p.width,
1473
+ height: p.height,
1473
1474
  overflow: "auto",
1474
1475
  border: 1,
1475
1476
  borderColor: "divider",
1476
1477
  borderRadius: 1,
1477
1478
  bgcolor: "background.paper"
1478
1479
  },
1479
- ...Array.isArray(b) ? b : b ? [b] : []
1480
+ ...Array.isArray(f) ? f : f ? [f] : []
1480
1481
  ],
1481
1482
  children: [
1482
- c,
1483
- /* @__PURE__ */ e(
1484
- p,
1483
+ u,
1484
+ /* @__PURE__ */ t(
1485
+ d,
1485
1486
  {
1486
1487
  sx: {
1487
1488
  position: "absolute",
@@ -1499,91 +1500,91 @@ function yr({
1499
1500
  borderRadius: 1,
1500
1501
  boxShadow: "0 6px 16px rgba(15,23,42,0.14)"
1501
1502
  },
1502
- onPointerDown: (x) => {
1503
- const y = x.clientX, k = x.clientY, v = f;
1504
- function B(o) {
1505
- a({
1506
- width: Math.max(d, v.width + o.clientX - y),
1507
- height: Math.max(s, v.height + o.clientY - k)
1503
+ onPointerDown: (y) => {
1504
+ const g = y.clientX, w = y.clientY, v = p;
1505
+ function P(o) {
1506
+ i({
1507
+ width: Math.max(l, v.width + o.clientX - g),
1508
+ height: Math.max(s, v.height + o.clientY - w)
1508
1509
  });
1509
1510
  }
1510
1511
  function C() {
1511
- window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", C);
1512
+ window.removeEventListener("pointermove", P), window.removeEventListener("pointerup", C);
1512
1513
  }
1513
- window.addEventListener("pointermove", B), window.addEventListener("pointerup", C);
1514
+ window.addEventListener("pointermove", P), window.addEventListener("pointerup", C);
1514
1515
  },
1515
- children: /* @__PURE__ */ e(et, { fontSize: "small" })
1516
+ children: /* @__PURE__ */ t(tt, { fontSize: "small" })
1516
1517
  }
1517
1518
  )
1518
1519
  ]
1519
1520
  }
1520
1521
  );
1521
1522
  }
1522
- function vt(t) {
1523
- return t.type === "boolean" ? t.value ? "On" : "Off" : `${t.value}${t.unit ? ` ${t.unit}` : ""}`;
1523
+ function kt(e) {
1524
+ return e.type === "boolean" ? e.value ? "On" : "Off" : `${e.value}${e.unit ? ` ${e.unit}` : ""}`;
1524
1525
  }
1525
- function kt(t) {
1526
- return t.reduce((n, d) => {
1527
- const s = d.group ?? "Settings";
1526
+ function Ct(e) {
1527
+ return e.reduce((n, l) => {
1528
+ const s = l.group ?? "Settings";
1528
1529
  return {
1529
1530
  ...n,
1530
- [s]: [...n[s] ?? [], d]
1531
+ [s]: [...n[s] ?? [], l]
1531
1532
  };
1532
1533
  }, {});
1533
1534
  }
1534
- function wr({
1535
- fields: t,
1535
+ function Ar({
1536
+ fields: e,
1536
1537
  onChange: n,
1537
- title: d = "Inspector",
1538
+ title: l = "Inspector",
1538
1539
  description: s,
1539
- density: b = "comfortable",
1540
- showValueSummary: c = !0,
1541
- showReset: g = !0,
1542
- sx: f
1540
+ density: f = "comfortable",
1541
+ showValueSummary: u = !0,
1542
+ showReset: x = !0,
1543
+ sx: p
1543
1544
  }) {
1544
- const a = kt(t), x = b === "compact" ? 1.25 : 2, y = b === "compact" ? "small" : "medium";
1545
- function k(v) {
1545
+ const i = Ct(e), y = f === "compact" ? 1.25 : 2, g = f === "compact" ? "small" : "medium";
1546
+ function w(v) {
1546
1547
  v.defaultValue !== void 0 && n?.(v.id, v.defaultValue);
1547
1548
  }
1548
- return /* @__PURE__ */ e(Ye, { variant: "outlined", sx: [{ p: b === "compact" ? 1.5 : 2, borderRadius: 1 }, ...Array.isArray(f) ? f : [f]], children: /* @__PURE__ */ m(q, { spacing: x, children: [
1549
- /* @__PURE__ */ m(p, { children: [
1550
- /* @__PURE__ */ m(q, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
1551
- /* @__PURE__ */ e(N, { variant: "subtitle1", fontWeight: 850, children: d }),
1552
- c ? /* @__PURE__ */ e(we, { size: "small", label: `${t.length} fields` }) : null
1549
+ return /* @__PURE__ */ t(Me, { variant: "outlined", sx: [{ p: f === "compact" ? 1.5 : 2, borderRadius: 1 }, ...Array.isArray(p) ? p : [p]], children: /* @__PURE__ */ m(V, { spacing: y, children: [
1550
+ /* @__PURE__ */ m(d, { children: [
1551
+ /* @__PURE__ */ m(V, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
1552
+ /* @__PURE__ */ t(E, { variant: "subtitle1", fontWeight: 850, children: l }),
1553
+ u ? /* @__PURE__ */ t(we, { size: "small", label: `${e.length} fields` }) : null
1553
1554
  ] }),
1554
- s ? /* @__PURE__ */ e(N, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: s }) : null
1555
+ s ? /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: s }) : null
1555
1556
  ] }),
1556
- Object.entries(a).map(([v, B], C) => /* @__PURE__ */ m(q, { spacing: x, children: [
1557
- C > 0 ? /* @__PURE__ */ e(rt, {}) : null,
1558
- /* @__PURE__ */ e(N, { variant: "caption", color: "text.secondary", fontWeight: 850, sx: { textTransform: "uppercase" }, children: v }),
1559
- B.map((o) => {
1560
- const R = g && o.defaultValue !== void 0 && o.defaultValue !== o.value;
1561
- return o.type === "boolean" ? /* @__PURE__ */ m(p, { children: [
1562
- /* @__PURE__ */ m(q, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
1563
- /* @__PURE__ */ e(
1564
- nt,
1557
+ Object.entries(i).map(([v, P], C) => /* @__PURE__ */ m(V, { spacing: y, children: [
1558
+ C > 0 ? /* @__PURE__ */ t(nt, {}) : null,
1559
+ /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", fontWeight: 850, sx: { textTransform: "uppercase" }, children: v }),
1560
+ P.map((o) => {
1561
+ const R = x && o.defaultValue !== void 0 && o.defaultValue !== o.value;
1562
+ return o.type === "boolean" ? /* @__PURE__ */ m(d, { children: [
1563
+ /* @__PURE__ */ m(V, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
1564
+ /* @__PURE__ */ t(
1565
+ ot,
1565
1566
  {
1566
- control: /* @__PURE__ */ e(
1567
- tt,
1567
+ control: /* @__PURE__ */ t(
1568
+ rt,
1568
1569
  {
1569
1570
  checked: !!o.value,
1570
1571
  disabled: o.disabled,
1571
- onChange: (u) => n?.(o.id, u.target.checked)
1572
+ onChange: (h) => n?.(o.id, h.target.checked)
1572
1573
  }
1573
1574
  ),
1574
1575
  label: o.label
1575
1576
  }
1576
1577
  ),
1577
- R ? /* @__PURE__ */ e(ae, { size: "small", onClick: () => k(o), children: "Reset" }) : null
1578
+ R ? /* @__PURE__ */ t(ae, { size: "small", onClick: () => w(o), children: "Reset" }) : null
1578
1579
  ] }),
1579
- o.description ? /* @__PURE__ */ e(N, { variant: "caption", color: "text.secondary", children: o.description }) : null
1580
- ] }, o.id) : o.type === "number" ? /* @__PURE__ */ m(q, { spacing: 1, children: [
1581
- /* @__PURE__ */ m(q, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1582
- /* @__PURE__ */ e(
1583
- Z,
1580
+ o.description ? /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", children: o.description }) : null
1581
+ ] }, o.id) : o.type === "number" ? /* @__PURE__ */ m(V, { spacing: 1, children: [
1582
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1583
+ /* @__PURE__ */ t(
1584
+ _,
1584
1585
  {
1585
1586
  fullWidth: !0,
1586
- size: y,
1587
+ size: g,
1587
1588
  label: o.label,
1588
1589
  type: "number",
1589
1590
  value: o.value,
@@ -1594,14 +1595,14 @@ function wr({
1594
1595
  max: o.max,
1595
1596
  step: o.step
1596
1597
  },
1597
- onChange: (u) => n?.(o.id, Number(u.target.value))
1598
+ onChange: (h) => n?.(o.id, Number(h.target.value))
1598
1599
  }
1599
1600
  ),
1600
- o.unit ? /* @__PURE__ */ e(we, { label: o.unit, size: "small", sx: { mt: 1 } }) : null,
1601
- R ? /* @__PURE__ */ e(ae, { size: "small", onClick: () => k(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1601
+ o.unit ? /* @__PURE__ */ t(we, { label: o.unit, size: "small", sx: { mt: 1 } }) : null,
1602
+ R ? /* @__PURE__ */ t(ae, { size: "small", onClick: () => w(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1602
1603
  ] }),
1603
- o.min !== void 0 || o.max !== void 0 ? /* @__PURE__ */ e(
1604
- Fe,
1604
+ o.min !== void 0 || o.max !== void 0 ? /* @__PURE__ */ t(
1605
+ Ne,
1605
1606
  {
1606
1607
  value: Number(o.value),
1607
1608
  min: o.min ?? 0,
@@ -1609,45 +1610,45 @@ function wr({
1609
1610
  step: o.step ?? 1,
1610
1611
  disabled: o.disabled,
1611
1612
  valueLabelDisplay: "auto",
1612
- onChange: (u, z) => n?.(o.id, Array.isArray(z) ? z[0] : z)
1613
+ onChange: (h, M) => n?.(o.id, Array.isArray(M) ? M[0] : M)
1613
1614
  }
1614
1615
  ) : null
1615
- ] }, o.id) : o.type === "select" ? /* @__PURE__ */ m(q, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1616
- /* @__PURE__ */ e(
1617
- Z,
1616
+ ] }, o.id) : o.type === "select" ? /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1617
+ /* @__PURE__ */ t(
1618
+ _,
1618
1619
  {
1619
1620
  select: !0,
1620
1621
  fullWidth: !0,
1621
- size: y,
1622
+ size: g,
1622
1623
  label: o.label,
1623
1624
  value: o.value,
1624
1625
  helperText: o.description,
1625
1626
  disabled: o.disabled,
1626
- onChange: (u) => n?.(o.id, u.target.value),
1627
- children: (o.options ?? []).map((u) => /* @__PURE__ */ e(pe, { value: u.value, children: u.label }, u.value))
1627
+ onChange: (h) => n?.(o.id, h.target.value),
1628
+ children: (o.options ?? []).map((h) => /* @__PURE__ */ t(pe, { value: h.value, children: h.label }, h.value))
1628
1629
  }
1629
1630
  ),
1630
- R ? /* @__PURE__ */ e(ae, { size: "small", onClick: () => k(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1631
- ] }, o.id) : o.type === "color" ? /* @__PURE__ */ m(q, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1632
- /* @__PURE__ */ e(
1633
- Z,
1631
+ R ? /* @__PURE__ */ t(ae, { size: "small", onClick: () => w(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1632
+ ] }, o.id) : o.type === "color" ? /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1633
+ /* @__PURE__ */ t(
1634
+ _,
1634
1635
  {
1635
1636
  fullWidth: !0,
1636
- size: y,
1637
+ size: g,
1637
1638
  label: o.label,
1638
1639
  value: o.value,
1639
1640
  helperText: o.description,
1640
1641
  disabled: o.disabled,
1641
- onChange: (u) => n?.(o.id, u.target.value),
1642
+ onChange: (h) => n?.(o.id, h.target.value),
1642
1643
  InputProps: {
1643
- startAdornment: /* @__PURE__ */ e(
1644
- p,
1644
+ startAdornment: /* @__PURE__ */ t(
1645
+ d,
1645
1646
  {
1646
1647
  component: "input",
1647
1648
  type: "color",
1648
1649
  value: String(o.value),
1649
1650
  disabled: o.disabled,
1650
- onChange: (u) => n?.(o.id, u.target.value),
1651
+ onChange: (h) => n?.(o.id, h.target.value),
1651
1652
  sx: {
1652
1653
  width: 28,
1653
1654
  height: 28,
@@ -1662,42 +1663,42 @@ function wr({
1662
1663
  }
1663
1664
  }
1664
1665
  ),
1665
- R ? /* @__PURE__ */ e(ae, { size: "small", onClick: () => k(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1666
- ] }, o.id) : /* @__PURE__ */ m(q, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1667
- /* @__PURE__ */ e(
1668
- Z,
1666
+ R ? /* @__PURE__ */ t(ae, { size: "small", onClick: () => w(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1667
+ ] }, o.id) : /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
1668
+ /* @__PURE__ */ t(
1669
+ _,
1669
1670
  {
1670
1671
  fullWidth: !0,
1671
- size: y,
1672
+ size: g,
1672
1673
  label: o.label,
1673
1674
  value: o.value,
1674
1675
  helperText: o.description,
1675
1676
  disabled: o.disabled,
1676
- onChange: (u) => n?.(o.id, u.target.value)
1677
+ onChange: (h) => n?.(o.id, h.target.value)
1677
1678
  }
1678
1679
  ),
1679
- R ? /* @__PURE__ */ e(ae, { size: "small", onClick: () => k(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1680
+ R ? /* @__PURE__ */ t(ae, { size: "small", onClick: () => w(o), sx: { mt: 0.5 }, children: "Reset" }) : null
1680
1681
  ] }, o.id);
1681
1682
  })
1682
1683
  ] }, v)),
1683
- c ? /* @__PURE__ */ m(p, { sx: { p: 1.25, borderRadius: 1, bgcolor: "action.hover" }, children: [
1684
- /* @__PURE__ */ e(N, { variant: "caption", color: "text.secondary", fontWeight: 850, children: "Current values" }),
1685
- /* @__PURE__ */ e(q, { direction: "row", flexWrap: "wrap", gap: 0.75, sx: { mt: 1 }, children: t.map((v) => /* @__PURE__ */ e(we, { size: "small", label: `${v.label}: ${vt(v)}` }, v.id)) })
1684
+ u ? /* @__PURE__ */ m(d, { sx: { p: 1.25, borderRadius: 1, bgcolor: "action.hover" }, children: [
1685
+ /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", fontWeight: 850, children: "Current values" }),
1686
+ /* @__PURE__ */ t(V, { direction: "row", flexWrap: "wrap", gap: 0.75, sx: { mt: 1 }, children: e.map((v) => /* @__PURE__ */ t(we, { size: "small", label: `${v.label}: ${kt(v)}` }, v.id)) })
1686
1687
  ] }) : null
1687
1688
  ] }) });
1688
1689
  }
1689
- function vr({
1690
- value: t,
1690
+ function Rr({
1691
+ value: e,
1691
1692
  alpha: n = 1,
1692
- swatches: d = ["#2563eb", "#7c3aed", "#db2777", "#dc2626", "#f59e0b", "#059669"],
1693
+ swatches: l = ["#2563eb", "#7c3aed", "#db2777", "#dc2626", "#f59e0b", "#059669"],
1693
1694
  showValue: s = !0,
1694
- onChange: b,
1695
- onAlphaChange: c
1695
+ onChange: f,
1696
+ onAlphaChange: u
1696
1697
  }) {
1697
- const g = Math.round(n * 100), f = `${t}${Math.round(n * 255).toString(16).padStart(2, "0")}`;
1698
- return /* @__PURE__ */ e(Ye, { variant: "outlined", sx: { p: 2, borderRadius: 1 }, children: /* @__PURE__ */ m(q, { spacing: 2, children: [
1699
- /* @__PURE__ */ e(
1700
- p,
1698
+ const x = Math.round(n * 100), p = `${e}${Math.round(n * 255).toString(16).padStart(2, "0")}`;
1699
+ return /* @__PURE__ */ t(Me, { variant: "outlined", sx: { p: 2, borderRadius: 1 }, children: /* @__PURE__ */ m(V, { spacing: 2, children: [
1700
+ /* @__PURE__ */ t(
1701
+ d,
1701
1702
  {
1702
1703
  sx: {
1703
1704
  height: 96,
@@ -1708,97 +1709,97 @@ function vr({
1708
1709
  backgroundSize: "18px 18px",
1709
1710
  backgroundPosition: "0 0, 0 9px, 9px -9px, -9px 0"
1710
1711
  },
1711
- children: /* @__PURE__ */ e(p, { sx: { height: "100%", borderRadius: 1, bgcolor: t, opacity: n } })
1712
+ children: /* @__PURE__ */ t(d, { sx: { height: "100%", borderRadius: 1, bgcolor: e, opacity: n } })
1712
1713
  }
1713
1714
  ),
1714
- /* @__PURE__ */ m(q, { direction: { xs: "column", sm: "row" }, spacing: 1.5, children: [
1715
- /* @__PURE__ */ e(
1716
- Z,
1715
+ /* @__PURE__ */ m(V, { direction: { xs: "column", sm: "row" }, spacing: 1.5, children: [
1716
+ /* @__PURE__ */ t(
1717
+ _,
1717
1718
  {
1718
1719
  label: "Color",
1719
1720
  type: "color",
1720
- value: t,
1721
- onChange: (a) => b?.(a.target.value),
1721
+ value: e,
1722
+ onChange: (i) => f?.(i.target.value),
1722
1723
  sx: { width: { xs: "100%", sm: 120 } }
1723
1724
  }
1724
1725
  ),
1725
- /* @__PURE__ */ e(
1726
- Z,
1726
+ /* @__PURE__ */ t(
1727
+ _,
1727
1728
  {
1728
1729
  label: "Hex",
1729
- value: t,
1730
- onChange: (a) => b?.(a.target.value),
1730
+ value: e,
1731
+ onChange: (i) => f?.(i.target.value),
1731
1732
  fullWidth: !0
1732
1733
  }
1733
1734
  )
1734
1735
  ] }),
1735
- /* @__PURE__ */ m(p, { children: [
1736
- /* @__PURE__ */ e(N, { variant: "caption", color: "text.secondary", fontWeight: 800, children: "Alpha" }),
1737
- /* @__PURE__ */ e(
1738
- Fe,
1736
+ /* @__PURE__ */ m(d, { children: [
1737
+ /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", fontWeight: 800, children: "Alpha" }),
1738
+ /* @__PURE__ */ t(
1739
+ Ne,
1739
1740
  {
1740
1741
  min: 0,
1741
1742
  max: 1,
1742
1743
  step: 0.01,
1743
1744
  value: n,
1744
- onChange: (a, x) => c?.(Array.isArray(x) ? x[0] : x),
1745
+ onChange: (i, y) => u?.(Array.isArray(y) ? y[0] : y),
1745
1746
  valueLabelDisplay: "auto",
1746
- valueLabelFormat: (a) => `${Math.round(a * 100)}%`
1747
+ valueLabelFormat: (i) => `${Math.round(i * 100)}%`
1747
1748
  }
1748
1749
  ),
1749
- /* @__PURE__ */ e(
1750
- Z,
1750
+ /* @__PURE__ */ t(
1751
+ _,
1751
1752
  {
1752
1753
  label: "Alpha",
1753
1754
  type: "number",
1754
- value: g,
1755
- onChange: (a) => c?.(Math.min(Math.max(Number(a.target.value), 0), 100) / 100),
1755
+ value: x,
1756
+ onChange: (i) => u?.(Math.min(Math.max(Number(i.target.value), 0), 100) / 100),
1756
1757
  InputProps: {
1757
- endAdornment: /* @__PURE__ */ e(ot, { position: "end", children: "%" })
1758
+ endAdornment: /* @__PURE__ */ t(it, { position: "end", children: "%" })
1758
1759
  },
1759
1760
  fullWidth: !0
1760
1761
  }
1761
1762
  )
1762
1763
  ] }),
1763
- /* @__PURE__ */ e(p, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: d.map((a) => /* @__PURE__ */ e(
1764
- p,
1764
+ /* @__PURE__ */ t(d, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: l.map((i) => /* @__PURE__ */ t(
1765
+ d,
1765
1766
  {
1766
1767
  component: "button",
1767
- "aria-label": a,
1768
- onClick: () => b?.(a),
1768
+ "aria-label": i,
1769
+ onClick: () => f?.(i),
1769
1770
  sx: {
1770
1771
  width: 32,
1771
1772
  height: 32,
1772
1773
  borderRadius: "50%",
1773
1774
  border: 2,
1774
- borderColor: a.toLowerCase() === t.toLowerCase() ? "text.primary" : "divider",
1775
- bgcolor: a,
1775
+ borderColor: i.toLowerCase() === e.toLowerCase() ? "text.primary" : "divider",
1776
+ bgcolor: i,
1776
1777
  cursor: "pointer"
1777
1778
  }
1778
1779
  },
1779
- a
1780
+ i
1780
1781
  )) }),
1781
- s ? /* @__PURE__ */ m(p, { sx: { p: 1.5, borderRadius: 1, bgcolor: "#0f172a", color: "#e5e7eb" }, children: [
1782
- /* @__PURE__ */ e(N, { variant: "caption", color: "#94a3b8", children: "selected color" }),
1783
- /* @__PURE__ */ e(N, { fontFamily: "monospace", children: f })
1782
+ s ? /* @__PURE__ */ m(d, { sx: { p: 1.5, borderRadius: 1, bgcolor: "#0f172a", color: "#e5e7eb" }, children: [
1783
+ /* @__PURE__ */ t(E, { variant: "caption", color: "#94a3b8", children: "selected color" }),
1784
+ /* @__PURE__ */ t(E, { fontFamily: "monospace", children: p })
1784
1785
  ] }) : null
1785
1786
  ] }) });
1786
1787
  }
1787
- function kr({ onFiles: t, sx: n, ...d }) {
1788
- const [s, b] = T(!1);
1789
- function c(g) {
1790
- g && t?.(Array.from(g));
1788
+ function Lr({ onFiles: e, sx: n, ...l }) {
1789
+ const [s, f] = W(!1);
1790
+ function u(x) {
1791
+ x && e?.(Array.from(x));
1791
1792
  }
1792
1793
  return /* @__PURE__ */ m(
1793
- p,
1794
+ d,
1794
1795
  {
1795
- ...d,
1796
- onDragOver: (g) => {
1797
- g.preventDefault(), b(!0);
1796
+ ...l,
1797
+ onDragOver: (x) => {
1798
+ x.preventDefault(), f(!0);
1798
1799
  },
1799
- onDragLeave: () => b(!1),
1800
- onDrop: (g) => {
1801
- g.preventDefault(), b(!1), c(g.dataTransfer.files);
1800
+ onDragLeave: () => f(!1),
1801
+ onDrop: (x) => {
1802
+ x.preventDefault(), f(!1), u(x.dataTransfer.files);
1802
1803
  },
1803
1804
  sx: [
1804
1805
  {
@@ -1813,113 +1814,113 @@ function kr({ onFiles: t, sx: n, ...d }) {
1813
1814
  ...Array.isArray(n) ? n : n ? [n] : []
1814
1815
  ],
1815
1816
  children: [
1816
- /* @__PURE__ */ e(N, { fontWeight: 800, children: "Drop files here" }),
1817
- /* @__PURE__ */ e(N, { variant: "body2", color: "text.secondary", children: "Drag files into this zone" })
1817
+ /* @__PURE__ */ t(E, { fontWeight: 800, children: "Drop files here" }),
1818
+ /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", children: "Drag files into this zone" })
1818
1819
  ]
1819
1820
  }
1820
1821
  );
1821
1822
  }
1822
- function ye(t, n, d) {
1823
- return Math.min(Math.max(t, n), d);
1823
+ function ve(e, n, l) {
1824
+ return Math.min(Math.max(e, n), l);
1824
1825
  }
1825
- function $t(t) {
1826
- const n = Math.floor(t / 60), d = Math.floor(t % 60);
1827
- return `${n}:${String(d).padStart(2, "0")}`;
1826
+ function It(e) {
1827
+ const n = Math.floor(e / 60), l = Math.floor(e % 60);
1828
+ return `${n}:${String(l).padStart(2, "0")}`;
1828
1829
  }
1829
- function ke(t, n) {
1830
- return n > 0 ? ye(t / n * 100, 0, 100) : 0;
1830
+ function ke(e, n) {
1831
+ return n > 0 ? ve(e / n * 100, 0, 100) : 0;
1831
1832
  }
1832
- function Ct(t, n) {
1833
- return n.reduce((d, s) => d ? Math.abs(s.time - t) < Math.abs(d.time - t) ? s : d : s, null);
1833
+ function Mt(e, n) {
1834
+ return n.reduce((l, s) => l ? Math.abs(s.time - e) < Math.abs(l.time - e) ? s : l : s, null);
1834
1835
  }
1835
- function $r({
1836
- duration: t,
1836
+ function Pr({
1837
+ duration: e,
1837
1838
  value: n,
1838
- defaultValue: d = 0,
1839
+ defaultValue: l = 0,
1839
1840
  markers: s = [],
1840
- thumbnails: b = [],
1841
- disabled: c = !1,
1842
- showTime: g = !0,
1843
- preview: f = !0,
1844
- step: a = 1,
1845
- formatTime: x = $t,
1846
- onChange: y,
1847
- sx: k,
1841
+ thumbnails: f = [],
1842
+ disabled: u = !1,
1843
+ showTime: x = !0,
1844
+ preview: p = !0,
1845
+ step: i = 1,
1846
+ formatTime: y = It,
1847
+ onChange: g,
1848
+ sx: w,
1848
1849
  ...v
1849
1850
  }) {
1850
- const B = oe(null), [C, o] = T(d), [R, u] = T(!1), [z, Y] = T(null), E = ye(n ?? C, 0, t), $ = z === null ? E : z, W = ke(E, t), w = ke($, t), L = Ce(() => [...s].sort((h, S) => h.time - S.time), [s]), j = Ct($, b);
1851
- function F(h, S) {
1852
- const D = a > 0 ? Math.round(h / a) * a : h, i = ye(D, 0, t);
1853
- n === void 0 && o(i), y?.(i, S);
1851
+ const P = oe(null), [C, o] = W(l), [R, h] = W(!1), [M, N] = W(null), X = ve(n ?? C, 0, e), k = M === null ? X : M, D = ke(X, e), $ = ke(k, e), L = Ie(() => [...s].sort((b, z) => b.time - z.time), [s]), j = Mt(k, f);
1852
+ function O(b, z) {
1853
+ const B = i > 0 ? Math.round(b / i) * i : b, a = ve(B, 0, e);
1854
+ n === void 0 && o(a), g?.(a, z);
1854
1855
  }
1855
- function l(h) {
1856
- const S = B.current;
1857
- if (!S)
1858
- return E;
1859
- const D = S.getBoundingClientRect();
1860
- return ye((h - D.left) / D.width, 0, 1) * t;
1856
+ function c(b) {
1857
+ const z = P.current;
1858
+ if (!z)
1859
+ return X;
1860
+ const B = z.getBoundingClientRect();
1861
+ return ve((b - B.left) / B.width, 0, 1) * e;
1861
1862
  }
1862
- function M(h) {
1863
- Y(l(h));
1863
+ function S(b) {
1864
+ N(c(b));
1864
1865
  }
1865
1866
  return /* @__PURE__ */ m(
1866
- p,
1867
+ d,
1867
1868
  {
1868
1869
  ...v,
1869
1870
  sx: [
1870
1871
  {
1871
1872
  width: "100%",
1872
- color: c ? "text.disabled" : "text.primary",
1873
+ color: u ? "text.disabled" : "text.primary",
1873
1874
  userSelect: "none"
1874
1875
  },
1875
- ...Array.isArray(k) ? k : k ? [k] : []
1876
+ ...Array.isArray(w) ? w : w ? [w] : []
1876
1877
  ],
1877
1878
  children: [
1878
- g ? /* @__PURE__ */ m(p, { sx: { display: "flex", justifyContent: "space-between", mb: 1 }, children: [
1879
- /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 800, children: x(E) }),
1880
- /* @__PURE__ */ e(N, { variant: "caption", color: "text.secondary", children: x(t) })
1879
+ x ? /* @__PURE__ */ m(d, { sx: { display: "flex", justifyContent: "space-between", mb: 1 }, children: [
1880
+ /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 800, children: y(X) }),
1881
+ /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", children: y(e) })
1881
1882
  ] }) : null,
1882
1883
  /* @__PURE__ */ m(
1883
- p,
1884
+ d,
1884
1885
  {
1885
- ref: B,
1886
+ ref: P,
1886
1887
  role: "slider",
1887
- tabIndex: c ? -1 : 0,
1888
+ tabIndex: u ? -1 : 0,
1888
1889
  "aria-valuemin": 0,
1889
- "aria-valuemax": t,
1890
- "aria-valuenow": Math.round(E),
1891
- onPointerMove: (h) => {
1892
- c || (M(h.clientX), R && F(l(h.clientX), "drag"));
1890
+ "aria-valuemax": e,
1891
+ "aria-valuenow": Math.round(X),
1892
+ onPointerMove: (b) => {
1893
+ u || (S(b.clientX), R && O(c(b.clientX), "drag"));
1893
1894
  },
1894
1895
  onPointerLeave: () => {
1895
- R || Y(null);
1896
+ R || N(null);
1896
1897
  },
1897
- onPointerDown: (h) => {
1898
- c || (u(!0), h.currentTarget.setPointerCapture(h.pointerId), F(l(h.clientX), "click"));
1898
+ onPointerDown: (b) => {
1899
+ u || (h(!0), b.currentTarget.setPointerCapture(b.pointerId), O(c(b.clientX), "click"));
1899
1900
  },
1900
- onPointerUp: (h) => {
1901
- u(!1), h.currentTarget.releasePointerCapture(h.pointerId);
1901
+ onPointerUp: (b) => {
1902
+ h(!1), b.currentTarget.releasePointerCapture(b.pointerId);
1902
1903
  },
1903
- onPointerCancel: () => u(!1),
1904
- onKeyDown: (h) => {
1905
- c || (h.key === "ArrowLeft" && (F(E - a, "keyboard"), h.preventDefault()), h.key === "ArrowRight" && (F(E + a, "keyboard"), h.preventDefault()), h.key === "Home" && (F(0, "keyboard"), h.preventDefault()), h.key === "End" && (F(t, "keyboard"), h.preventDefault()));
1904
+ onPointerCancel: () => h(!1),
1905
+ onKeyDown: (b) => {
1906
+ u || (b.key === "ArrowLeft" && (O(X - i, "keyboard"), b.preventDefault()), b.key === "ArrowRight" && (O(X + i, "keyboard"), b.preventDefault()), b.key === "Home" && (O(0, "keyboard"), b.preventDefault()), b.key === "End" && (O(e, "keyboard"), b.preventDefault()));
1906
1907
  },
1907
1908
  sx: {
1908
1909
  position: "relative",
1909
1910
  height: 86,
1910
- cursor: c ? "default" : "pointer",
1911
+ cursor: u ? "default" : "pointer",
1911
1912
  outline: "none",
1912
1913
  "&:focus-visible .TimelineScrubber-track": {
1913
1914
  boxShadow: "0 0 0 3px rgba(37,99,235,0.28)"
1914
1915
  }
1915
1916
  },
1916
1917
  children: [
1917
- f && z !== null ? /* @__PURE__ */ m(
1918
- p,
1918
+ p && M !== null ? /* @__PURE__ */ m(
1919
+ d,
1919
1920
  {
1920
1921
  sx: {
1921
1922
  position: "absolute",
1922
- left: `${w}%`,
1923
+ left: `${$}%`,
1923
1924
  top: 0,
1924
1925
  transform: "translateX(-50%)",
1925
1926
  width: 116,
@@ -1933,13 +1934,13 @@ function $r({
1933
1934
  zIndex: 2
1934
1935
  },
1935
1936
  children: [
1936
- /* @__PURE__ */ e(p, { sx: { height: 56, borderRadius: 0.75, overflow: "hidden", bgcolor: "#e5e7eb" }, children: j?.thumbnail ?? /* @__PURE__ */ e(p, { sx: { height: "100%", display: "grid", placeItems: "center", bgcolor: "#0f172a", color: "#fff" }, children: /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 900, children: x($) }) }) }),
1937
- /* @__PURE__ */ e(N, { variant: "caption", fontWeight: 800, sx: { display: "block", mt: 0.5, textAlign: "center" }, children: x($) })
1937
+ /* @__PURE__ */ t(d, { sx: { height: 56, borderRadius: 0.75, overflow: "hidden", bgcolor: "#e5e7eb" }, children: j?.thumbnail ?? /* @__PURE__ */ t(d, { sx: { height: "100%", display: "grid", placeItems: "center", bgcolor: "#0f172a", color: "#fff" }, children: /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 900, children: y(k) }) }) }),
1938
+ /* @__PURE__ */ t(E, { variant: "caption", fontWeight: 800, sx: { display: "block", mt: 0.5, textAlign: "center" }, children: y(k) })
1938
1939
  ]
1939
1940
  }
1940
1941
  ) : null,
1941
- /* @__PURE__ */ e(
1942
- p,
1942
+ /* @__PURE__ */ t(
1943
+ d,
1943
1944
  {
1944
1945
  className: "TimelineScrubber-track",
1945
1946
  sx: {
@@ -1953,11 +1954,11 @@ function $r({
1953
1954
  overflow: "hidden",
1954
1955
  transition: "box-shadow 120ms ease"
1955
1956
  },
1956
- children: /* @__PURE__ */ e(
1957
- p,
1957
+ children: /* @__PURE__ */ t(
1958
+ d,
1958
1959
  {
1959
1960
  sx: {
1960
- width: `${W}%`,
1961
+ width: `${D}%`,
1961
1962
  height: "100%",
1962
1963
  borderRadius: 999,
1963
1964
  background: "linear-gradient(90deg, #2563eb, #06b6d4)"
@@ -1966,37 +1967,37 @@ function $r({
1966
1967
  )
1967
1968
  }
1968
1969
  ),
1969
- L.map((h) => {
1970
- const S = ke(h.time, t);
1971
- return /* @__PURE__ */ e(ie, { title: h.label ?? x(h.time), arrow: !0, children: /* @__PURE__ */ e(
1972
- p,
1970
+ L.map((b) => {
1971
+ const z = ke(b.time, e);
1972
+ return /* @__PURE__ */ t(ie, { title: b.label ?? y(b.time), arrow: !0, children: /* @__PURE__ */ t(
1973
+ d,
1973
1974
  {
1974
- onPointerDown: (D) => {
1975
- D.stopPropagation(), F(h.time, "marker");
1975
+ onPointerDown: (B) => {
1976
+ B.stopPropagation(), O(b.time, "marker");
1976
1977
  },
1977
1978
  sx: {
1978
1979
  position: "absolute",
1979
- left: `${S}%`,
1980
+ left: `${z}%`,
1980
1981
  bottom: 11,
1981
1982
  width: 12,
1982
1983
  height: 26,
1983
1984
  borderRadius: 999,
1984
1985
  transform: "translateX(-50%)",
1985
- bgcolor: h.color ?? "#f59e0b",
1986
+ bgcolor: b.color ?? "#f59e0b",
1986
1987
  border: "2px solid",
1987
1988
  borderColor: "background.paper",
1988
1989
  boxShadow: "0 8px 18px rgba(15,23,42,0.2)",
1989
1990
  zIndex: 1
1990
1991
  }
1991
1992
  }
1992
- ) }, h.id);
1993
+ ) }, b.id);
1993
1994
  }),
1994
- /* @__PURE__ */ e(
1995
- p,
1995
+ /* @__PURE__ */ t(
1996
+ d,
1996
1997
  {
1997
1998
  sx: {
1998
1999
  position: "absolute",
1999
- left: `${W}%`,
2000
+ left: `${D}%`,
2000
2001
  bottom: 5,
2001
2002
  width: 28,
2002
2003
  height: 28,
@@ -2016,83 +2017,83 @@ function $r({
2016
2017
  }
2017
2018
  );
2018
2019
  }
2019
- function De(t, n, d) {
2020
- return Math.min(Math.max(t, n), d);
2020
+ function Xe(e, n, l) {
2021
+ return Math.min(Math.max(e, n), l);
2021
2022
  }
2022
- function Cr({
2023
- items: t = [],
2023
+ function Tr({
2024
+ items: e = [],
2024
2025
  defaultViewport: n = { x: 0, y: 0, zoom: 1 },
2025
- viewport: d,
2026
+ viewport: l,
2026
2027
  minZoom: s = 0.3,
2027
- maxZoom: b = 2.5,
2028
- showGrid: c = !0,
2029
- showMinimap: g = !0,
2030
- selectedItemId: f,
2031
- renderItem: a,
2032
- onViewportChange: x,
2033
- onItemMove: y,
2034
- onItemSelect: k,
2028
+ maxZoom: f = 2.5,
2029
+ showGrid: u = !0,
2030
+ showMinimap: x = !0,
2031
+ selectedItemId: p,
2032
+ renderItem: i,
2033
+ onViewportChange: y,
2034
+ onItemMove: g,
2035
+ onItemSelect: w,
2035
2036
  sx: v,
2036
- ...B
2037
+ ...P
2037
2038
  }) {
2038
- const C = oe(null), [o, R] = T(n), [u, z] = T(
2039
- Object.fromEntries(t.map((l) => [l.id, { x: l.x, y: l.y }]))
2040
- ), [Y, E] = T(f ?? null), $ = d ?? o, W = f ?? Y, w = Ce(() => {
2041
- const l = t.map((i) => ({
2042
- x: u[i.id]?.x ?? i.x,
2043
- y: u[i.id]?.y ?? i.y,
2044
- width: i.width ?? 140,
2045
- height: i.height ?? 80
2039
+ const C = oe(null), [o, R] = W(n), [h, M] = W(
2040
+ Object.fromEntries(e.map((c) => [c.id, { x: c.x, y: c.y }]))
2041
+ ), [N, X] = W(p ?? null), k = l ?? o, D = p ?? N, $ = Ie(() => {
2042
+ const c = e.map((a) => ({
2043
+ x: h[a.id]?.x ?? a.x,
2044
+ y: h[a.id]?.y ?? a.y,
2045
+ width: a.width ?? 140,
2046
+ height: a.height ?? 80
2046
2047
  }));
2047
- if (!l.length)
2048
+ if (!c.length)
2048
2049
  return { minX: -200, minY: -120, width: 400, height: 240 };
2049
- const M = Math.min(...l.map((i) => i.x)) - 80, h = Math.min(...l.map((i) => i.y)) - 80, S = Math.max(...l.map((i) => i.x + i.width)) + 80, D = Math.max(...l.map((i) => i.y + i.height)) + 80;
2050
- return { minX: M, minY: h, width: S - M, height: D - h };
2051
- }, [u, t]);
2052
- function L(l) {
2053
- const M = {
2054
- ...l,
2055
- zoom: De(l.zoom, s, b)
2050
+ const S = Math.min(...c.map((a) => a.x)) - 80, b = Math.min(...c.map((a) => a.y)) - 80, z = Math.max(...c.map((a) => a.x + a.width)) + 80, B = Math.max(...c.map((a) => a.y + a.height)) + 80;
2051
+ return { minX: S, minY: b, width: z - S, height: B - b };
2052
+ }, [h, e]);
2053
+ function L(c) {
2054
+ const S = {
2055
+ ...c,
2056
+ zoom: Xe(c.zoom, s, f)
2056
2057
  };
2057
- d === void 0 && R(M), x?.(M);
2058
+ l === void 0 && R(S), y?.(S);
2058
2059
  }
2059
- function j(l, M) {
2060
- const h = C.current?.getBoundingClientRect();
2060
+ function j(c, S) {
2061
+ const b = C.current?.getBoundingClientRect();
2061
2062
  return {
2062
- x: (l - (h?.left ?? 0) - $.x) / $.zoom,
2063
- y: (M - (h?.top ?? 0) - $.y) / $.zoom
2063
+ x: (c - (b?.left ?? 0) - k.x) / k.zoom,
2064
+ y: (S - (b?.top ?? 0) - k.y) / k.zoom
2064
2065
  };
2065
2066
  }
2066
- function F(l) {
2067
- E(l?.id ?? null), k?.(l);
2067
+ function O(c) {
2068
+ X(c?.id ?? null), w?.(c);
2068
2069
  }
2069
2070
  return /* @__PURE__ */ m(
2070
- p,
2071
+ d,
2071
2072
  {
2072
- ...B,
2073
+ ...P,
2073
2074
  ref: C,
2074
- onWheel: (l) => {
2075
- l.preventDefault();
2076
- const M = De($.zoom * (l.deltaY > 0 ? 0.92 : 1.08), s, b), h = j(l.clientX, l.clientY), S = C.current?.getBoundingClientRect(), D = l.clientX - (S?.left ?? 0) - h.x * M, i = l.clientY - (S?.top ?? 0) - h.y * M;
2077
- L({ x: D, y: i, zoom: M });
2075
+ onWheel: (c) => {
2076
+ c.preventDefault();
2077
+ const S = Xe(k.zoom * (c.deltaY > 0 ? 0.92 : 1.08), s, f), b = j(c.clientX, c.clientY), z = C.current?.getBoundingClientRect(), B = c.clientX - (z?.left ?? 0) - b.x * S, a = c.clientY - (z?.top ?? 0) - b.y * S;
2078
+ L({ x: B, y: a, zoom: S });
2078
2079
  },
2079
- onPointerDown: (l) => {
2080
- if (l.target !== l.currentTarget)
2080
+ onPointerDown: (c) => {
2081
+ if (c.target !== c.currentTarget)
2081
2082
  return;
2082
- F(null);
2083
- const M = l.clientX, h = l.clientY, S = $;
2084
- l.currentTarget.setPointerCapture(l.pointerId);
2085
- function D(P) {
2083
+ O(null);
2084
+ const S = c.clientX, b = c.clientY, z = k;
2085
+ c.currentTarget.setPointerCapture(c.pointerId);
2086
+ function B(T) {
2086
2087
  L({
2087
- ...S,
2088
- x: S.x + P.clientX - M,
2089
- y: S.y + P.clientY - h
2088
+ ...z,
2089
+ x: z.x + T.clientX - S,
2090
+ y: z.y + T.clientY - b
2090
2091
  });
2091
2092
  }
2092
- function i() {
2093
- window.removeEventListener("pointermove", D), window.removeEventListener("pointerup", i);
2093
+ function a() {
2094
+ window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", a);
2094
2095
  }
2095
- window.addEventListener("pointermove", D), window.addEventListener("pointerup", i);
2096
+ window.addEventListener("pointermove", B), window.addEventListener("pointerup", a);
2096
2097
  },
2097
2098
  sx: [
2098
2099
  {
@@ -2106,78 +2107,78 @@ function Cr({
2106
2107
  ...Array.isArray(v) ? v : v ? [v] : []
2107
2108
  ],
2108
2109
  children: [
2109
- /* @__PURE__ */ e(
2110
- p,
2110
+ /* @__PURE__ */ t(
2111
+ d,
2111
2112
  {
2112
2113
  sx: {
2113
2114
  position: "absolute",
2114
2115
  inset: 0,
2115
2116
  pointerEvents: "none",
2116
- backgroundImage: c ? "linear-gradient(rgba(148,163,184,0.25) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,0.25) 1px, transparent 1px)" : void 0,
2117
- backgroundSize: `${32 * $.zoom}px ${32 * $.zoom}px`,
2118
- backgroundPosition: `${$.x}px ${$.y}px`
2117
+ backgroundImage: u ? "linear-gradient(rgba(148,163,184,0.25) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,0.25) 1px, transparent 1px)" : void 0,
2118
+ backgroundSize: `${32 * k.zoom}px ${32 * k.zoom}px`,
2119
+ backgroundPosition: `${k.x}px ${k.y}px`
2119
2120
  }
2120
2121
  }
2121
2122
  ),
2122
- /* @__PURE__ */ e(
2123
- p,
2123
+ /* @__PURE__ */ t(
2124
+ d,
2124
2125
  {
2125
2126
  sx: {
2126
2127
  position: "absolute",
2127
- left: $.x,
2128
- top: $.y,
2129
- transform: `scale(${$.zoom})`,
2128
+ left: k.x,
2129
+ top: k.y,
2130
+ transform: `scale(${k.zoom})`,
2130
2131
  transformOrigin: "0 0"
2131
2132
  },
2132
- children: t.map((l) => {
2133
- const M = u[l.id] ?? { x: l.x, y: l.y }, h = l.id === W;
2134
- return /* @__PURE__ */ e(
2135
- p,
2133
+ children: e.map((c) => {
2134
+ const S = h[c.id] ?? { x: c.x, y: c.y }, b = c.id === D;
2135
+ return /* @__PURE__ */ t(
2136
+ d,
2136
2137
  {
2137
- onPointerDown: (S) => {
2138
- S.stopPropagation(), F(l);
2139
- const D = u[l.id] ?? { x: l.x, y: l.y }, i = j(S.clientX, S.clientY);
2140
- S.currentTarget.setPointerCapture(S.pointerId);
2141
- function P(le) {
2142
- const se = j(le.clientX, le.clientY), V = {
2143
- x: D.x + se.x - i.x,
2144
- y: D.y + se.y - i.y
2138
+ onPointerDown: (z) => {
2139
+ z.stopPropagation(), O(c);
2140
+ const B = h[c.id] ?? { x: c.x, y: c.y }, a = j(z.clientX, z.clientY);
2141
+ z.currentTarget.setPointerCapture(z.pointerId);
2142
+ function T(le) {
2143
+ const se = j(le.clientX, le.clientY), q = {
2144
+ x: B.x + se.x - a.x,
2145
+ y: B.y + se.y - a.y
2145
2146
  };
2146
- z((ee) => ({
2147
+ M((ee) => ({
2147
2148
  ...ee,
2148
- [l.id]: V
2149
- })), y?.(l.id, V);
2149
+ [c.id]: q
2150
+ })), g?.(c.id, q);
2150
2151
  }
2151
2152
  function Q() {
2152
- window.removeEventListener("pointermove", P), window.removeEventListener("pointerup", Q);
2153
+ window.removeEventListener("pointermove", T), window.removeEventListener("pointerup", Q);
2153
2154
  }
2154
- window.addEventListener("pointermove", P), window.addEventListener("pointerup", Q);
2155
+ window.addEventListener("pointermove", T), window.addEventListener("pointerup", Q);
2155
2156
  },
2156
2157
  sx: {
2157
2158
  position: "absolute",
2158
- left: M.x,
2159
- top: M.y,
2160
- width: l.width ?? 140,
2161
- height: l.height ?? 80,
2159
+ left: S.x,
2160
+ top: S.y,
2161
+ width: c.width ?? 140,
2162
+ height: c.height ?? 80,
2162
2163
  display: "grid",
2163
2164
  placeItems: "center",
2164
- border: h ? 2 : 1,
2165
- borderColor: h ? "primary.main" : "divider",
2165
+ border: b ? 2 : 1,
2166
+ borderColor: b ? "primary.main" : "divider",
2166
2167
  borderRadius: 1,
2167
- bgcolor: l.color ?? "background.paper",
2168
- boxShadow: h ? "0 18px 40px rgba(37,99,235,0.24)" : "0 12px 28px rgba(15,23,42,0.13)",
2168
+ bgcolor: c.color ?? "background.paper",
2169
+ boxShadow: b ? "0 18px 40px rgba(37,99,235,0.24)" : "0 12px 28px rgba(15,23,42,0.13)",
2169
2170
  cursor: "grab",
2170
2171
  userSelect: "none"
2171
2172
  },
2172
- children: a ? a(l, h) : /* @__PURE__ */ e(N, { fontWeight: 900, children: l.label ?? l.id })
2173
+ children: i ? i(c, b) : /* @__PURE__ */ t(E, { fontWeight: 900, children: c.label ?? c.id })
2173
2174
  },
2174
- l.id
2175
+ c.id
2175
2176
  );
2176
2177
  })
2177
2178
  }
2178
2179
  ),
2179
2180
  /* @__PURE__ */ m(
2180
- p,
2181
+ d,
2181
2182
  {
2182
2183
  sx: {
2183
2184
  position: "absolute",
@@ -2196,13 +2197,13 @@ function Cr({
2196
2197
  fontWeight: 800
2197
2198
  },
2198
2199
  children: [
2199
- Math.round($.zoom * 100),
2200
+ Math.round(k.zoom * 100),
2200
2201
  "%"
2201
2202
  ]
2202
2203
  }
2203
2204
  ),
2204
- g ? /* @__PURE__ */ e(
2205
- p,
2205
+ x ? /* @__PURE__ */ t(
2206
+ d,
2206
2207
  {
2207
2208
  sx: {
2208
2209
  position: "absolute",
@@ -2216,24 +2217,24 @@ function Cr({
2216
2217
  bgcolor: "rgba(255,255,255,0.9)",
2217
2218
  overflow: "hidden"
2218
2219
  },
2219
- children: t.map((l) => {
2220
- const M = u[l.id] ?? { x: l.x, y: l.y }, h = (M.x - w.minX) / w.width * 100, S = (M.y - w.minY) / w.height * 100, D = (l.width ?? 140) / w.width * 100, i = (l.height ?? 80) / w.height * 100;
2221
- return /* @__PURE__ */ e(
2222
- p,
2220
+ children: e.map((c) => {
2221
+ const S = h[c.id] ?? { x: c.x, y: c.y }, b = (S.x - $.minX) / $.width * 100, z = (S.y - $.minY) / $.height * 100, B = (c.width ?? 140) / $.width * 100, a = (c.height ?? 80) / $.height * 100;
2222
+ return /* @__PURE__ */ t(
2223
+ d,
2223
2224
  {
2224
2225
  sx: {
2225
2226
  position: "absolute",
2226
- left: `${h}%`,
2227
- top: `${S}%`,
2228
- width: `${D}%`,
2229
- height: `${i}%`,
2227
+ left: `${b}%`,
2228
+ top: `${z}%`,
2229
+ width: `${B}%`,
2230
+ height: `${a}%`,
2230
2231
  minWidth: 6,
2231
2232
  minHeight: 4,
2232
2233
  borderRadius: 0.5,
2233
- bgcolor: l.id === W ? "primary.main" : l.color ?? "#94a3b8"
2234
+ bgcolor: c.id === D ? "primary.main" : c.color ?? "#94a3b8"
2234
2235
  }
2235
2236
  },
2236
- l.id
2237
+ c.id
2237
2238
  );
2238
2239
  })
2239
2240
  }
@@ -2242,78 +2243,78 @@ function Cr({
2242
2243
  }
2243
2244
  );
2244
2245
  }
2245
- function Ir({
2246
- children: t,
2246
+ function Wr({
2247
+ children: e,
2247
2248
  title: n,
2248
- content: d,
2249
+ content: l,
2249
2250
  media: s,
2250
- actions: b = [],
2251
- copyText: c,
2252
- placement: g = "top",
2253
- pinMode: f = !0,
2254
- defaultPinned: a = !1,
2255
- openDelay: x = 120,
2256
- sx: y,
2257
- ...k
2251
+ actions: f = [],
2252
+ copyText: u,
2253
+ placement: x = "top",
2254
+ pinMode: p = !0,
2255
+ defaultPinned: i = !1,
2256
+ openDelay: y = 120,
2257
+ sx: g,
2258
+ ...w
2258
2259
  }) {
2259
- const v = oe(null), B = oe(null), C = oe(null), [o, R] = T(a), [u, z] = T(a), [Y, E] = T(!1);
2260
- function $() {
2261
- C.current && window.clearTimeout(C.current), B.current && window.clearTimeout(B.current);
2260
+ const v = oe(null), P = oe(null), C = oe(null), [o, R] = W(i), [h, M] = W(i), [N, X] = W(!1);
2261
+ function k() {
2262
+ C.current && window.clearTimeout(C.current), P.current && window.clearTimeout(P.current);
2262
2263
  }
2263
- function W() {
2264
- $(), !o && (C.current = window.setTimeout(() => R(!0), x));
2264
+ function D() {
2265
+ k(), !o && (C.current = window.setTimeout(() => R(!0), y));
2265
2266
  }
2266
- function w() {
2267
- $(), R(!0);
2267
+ function $() {
2268
+ k(), R(!0);
2268
2269
  }
2269
2270
  function L() {
2270
- $(), u || (B.current = window.setTimeout(() => R(!1), 100));
2271
+ k(), h || (P.current = window.setTimeout(() => R(!1), 100));
2271
2272
  }
2272
2273
  function j() {
2273
- const l = !u;
2274
- z(l), R(l || o);
2274
+ const c = !h;
2275
+ M(c), R(c || o);
2275
2276
  }
2276
- async function F() {
2277
- c && (await navigator.clipboard?.writeText(c), E(!0), window.setTimeout(() => E(!1), 1100));
2277
+ async function O() {
2278
+ u && (await navigator.clipboard?.writeText(u), X(!0), window.setTimeout(() => X(!1), 1100));
2278
2279
  }
2279
- return /* @__PURE__ */ m(Ee, { children: [
2280
- /* @__PURE__ */ e(
2281
- p,
2280
+ return /* @__PURE__ */ m(Ye, { children: [
2281
+ /* @__PURE__ */ t(
2282
+ d,
2282
2283
  {
2283
2284
  component: "span",
2284
2285
  ref: v,
2285
- onMouseEnter: W,
2286
+ onMouseEnter: D,
2286
2287
  onMouseLeave: L,
2287
- onFocus: W,
2288
+ onFocus: D,
2288
2289
  onBlur: L,
2289
2290
  onClick: () => {
2290
- f && (R(!0), z(!0));
2291
+ p && (R(!0), M(!0));
2291
2292
  },
2292
2293
  sx: { display: "inline-flex" },
2293
- children: t
2294
+ children: e
2294
2295
  }
2295
2296
  ),
2296
- /* @__PURE__ */ e(
2297
- ct,
2297
+ /* @__PURE__ */ t(
2298
+ dt,
2298
2299
  {
2299
2300
  open: o,
2300
2301
  anchorEl: v.current,
2301
- placement: g,
2302
+ placement: x,
2302
2303
  modifiers: [
2303
2304
  { name: "offset", options: { offset: [0, 10] } },
2304
2305
  { name: "preventOverflow", options: { padding: 12 } }
2305
2306
  ],
2306
2307
  sx: { zIndex: 1500 },
2307
- children: /* @__PURE__ */ e(
2308
- st,
2308
+ children: /* @__PURE__ */ t(
2309
+ ct,
2309
2310
  {
2310
2311
  onClickAway: () => {
2311
- u && (R(!1), z(!1));
2312
+ h && (R(!1), M(!1));
2312
2313
  },
2313
- children: /* @__PURE__ */ e(
2314
- p,
2314
+ children: /* @__PURE__ */ t(
2315
+ d,
2315
2316
  {
2316
- onMouseEnter: w,
2317
+ onMouseEnter: $,
2317
2318
  onMouseLeave: L,
2318
2319
  sx: {
2319
2320
  width: 320,
@@ -2323,18 +2324,18 @@ function Ir({
2323
2324
  boxShadow: "0 24px 64px rgba(15,23,42,0.28)",
2324
2325
  bgcolor: "background.paper"
2325
2326
  },
2326
- children: /* @__PURE__ */ e(p, { ...k, sx: [{ p: 1.25 }, ...Array.isArray(y) ? y : y ? [y] : []], children: /* @__PURE__ */ m(q, { spacing: 1.25, children: [
2327
- s ? /* @__PURE__ */ e(p, { sx: { borderRadius: 1, overflow: "hidden", bgcolor: "#e5e7eb" }, children: s }) : null,
2328
- /* @__PURE__ */ m(q, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
2329
- /* @__PURE__ */ m(p, { sx: { minWidth: 0, flex: 1 }, children: [
2330
- n ? /* @__PURE__ */ e(N, { fontWeight: 900, children: n }) : null,
2331
- d ? /* @__PURE__ */ e(N, { variant: "body2", color: "text.secondary", sx: { mt: n ? 0.25 : 0 }, children: d }) : null
2327
+ children: /* @__PURE__ */ t(d, { ...w, sx: [{ p: 1.25 }, ...Array.isArray(g) ? g : g ? [g] : []], children: /* @__PURE__ */ m(V, { spacing: 1.25, children: [
2328
+ s ? /* @__PURE__ */ t(d, { sx: { borderRadius: 1, overflow: "hidden", bgcolor: "#e5e7eb" }, children: s }) : null,
2329
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
2330
+ /* @__PURE__ */ m(d, { sx: { minWidth: 0, flex: 1 }, children: [
2331
+ n ? /* @__PURE__ */ t(E, { fontWeight: 900, children: n }) : null,
2332
+ l ? /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", sx: { mt: n ? 0.25 : 0 }, children: l }) : null
2332
2333
  ] }),
2333
- f ? /* @__PURE__ */ e(ie, { title: u ? "Unpin" : "Pin", children: /* @__PURE__ */ e(ue, { size: "small", onClick: j, children: u ? /* @__PURE__ */ e(at, { fontSize: "small" }) : /* @__PURE__ */ e(lt, { fontSize: "small" }) }) }) : null
2334
+ p ? /* @__PURE__ */ t(ie, { title: h ? "Unpin" : "Pin", children: /* @__PURE__ */ t(ue, { size: "small", onClick: j, children: h ? /* @__PURE__ */ t(lt, { fontSize: "small" }) : /* @__PURE__ */ t(st, { fontSize: "small" }) }) }) : null
2334
2335
  ] }),
2335
- c || b.length ? /* @__PURE__ */ m(q, { direction: "row", spacing: 1, flexWrap: "wrap", children: [
2336
- c ? /* @__PURE__ */ e(ae, { size: "small", variant: "outlined", startIcon: /* @__PURE__ */ e(it, {}), onClick: F, children: Y ? "Copied" : "Copy" }) : null,
2337
- b.map((l) => /* @__PURE__ */ e(ae, { size: "small", variant: "contained", startIcon: l.icon, onClick: l.onClick, children: l.label }, l.id))
2336
+ u || f.length ? /* @__PURE__ */ m(V, { direction: "row", spacing: 1, flexWrap: "wrap", children: [
2337
+ u ? /* @__PURE__ */ t(ae, { size: "small", variant: "outlined", startIcon: /* @__PURE__ */ t(at, {}), onClick: O, children: N ? "Copied" : "Copy" }) : null,
2338
+ f.map((c) => /* @__PURE__ */ t(ae, { size: "small", variant: "contained", startIcon: c.icon, onClick: c.onClick, children: c.label }, c.id))
2338
2339
  ] }) : null
2339
2340
  ] }) })
2340
2341
  }
@@ -2345,24 +2346,176 @@ function Ir({
2345
2346
  )
2346
2347
  ] });
2347
2348
  }
2349
+ const fe = {
2350
+ neutral: "#64748b",
2351
+ good: "#059669",
2352
+ warning: "#d97706",
2353
+ danger: "#dc2626"
2354
+ };
2355
+ function zt(e, n, l) {
2356
+ return Math.min(Math.max(e, n), l);
2357
+ }
2358
+ function St(e) {
2359
+ return e.color ?? fe[e.status ?? "neutral"];
2360
+ }
2361
+ function At(e) {
2362
+ return typeof e.delta == "number" ? e.delta : typeof e.value == "number" && typeof e.previousValue == "number" && e.previousValue !== 0 ? (e.value - e.previousValue) / Math.abs(e.previousValue) * 100 : null;
2363
+ }
2364
+ function Rt(e) {
2365
+ return e.formatter ? e.formatter(e.value) : typeof e.value == "number" ? new Intl.NumberFormat("en", { maximumFractionDigits: 1 }).format(e.value) : e.value;
2366
+ }
2367
+ function Lt(e, n, l) {
2368
+ if (e.length < 2)
2369
+ return "";
2370
+ const s = Math.min(...e), u = Math.max(...e) - s || 1;
2371
+ return e.map((x, p) => {
2372
+ const i = p / (e.length - 1) * n, y = l - (x - s) / u * l;
2373
+ return `${p === 0 ? "M" : "L"} ${i.toFixed(2)} ${y.toFixed(2)}`;
2374
+ }).join(" ");
2375
+ }
2376
+ function Pt({ values: e, color: n }) {
2377
+ const f = Lt(e, 180, 54), u = f ? `${f} L 180 54 L 0 54 Z` : "";
2378
+ return /* @__PURE__ */ m(d, { component: "svg", viewBox: "0 0 180 54", sx: { display: "block", width: "100%", height: 54 }, children: [
2379
+ /* @__PURE__ */ t(d, { component: "path", d: u, sx: { fill: Y(n, 0.14) } }),
2380
+ /* @__PURE__ */ t(d, { component: "path", d: f, sx: { fill: "none", stroke: n, strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" } }),
2381
+ e.length ? /* @__PURE__ */ t(
2382
+ d,
2383
+ {
2384
+ component: "circle",
2385
+ cx: 180,
2386
+ cy: 54 - (e[e.length - 1] - Math.min(...e)) / (Math.max(...e) - Math.min(...e) || 1) * 54,
2387
+ r: 4,
2388
+ sx: { fill: n }
2389
+ }
2390
+ ) : null
2391
+ ] });
2392
+ }
2393
+ function Dr({
2394
+ metrics: e,
2395
+ title: n,
2396
+ subtitle: l,
2397
+ columns: s = 3,
2398
+ density: f = "comfortable",
2399
+ showSparklines: u = !0,
2400
+ showProgress: x = !0,
2401
+ sx: p,
2402
+ ...i
2403
+ }) {
2404
+ const y = f === "compact";
2405
+ return /* @__PURE__ */ m(
2406
+ d,
2407
+ {
2408
+ ...i,
2409
+ sx: [
2410
+ {
2411
+ width: "100%"
2412
+ },
2413
+ ...Array.isArray(p) ? p : p ? [p] : []
2414
+ ],
2415
+ children: [
2416
+ n || l ? /* @__PURE__ */ m(d, { sx: { mb: 2 }, children: [
2417
+ n ? /* @__PURE__ */ t(E, { variant: "h6", fontWeight: 900, children: n }) : null,
2418
+ l ? /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", children: l }) : null
2419
+ ] }) : null,
2420
+ /* @__PURE__ */ t(
2421
+ d,
2422
+ {
2423
+ sx: {
2424
+ display: "grid",
2425
+ gridTemplateColumns: {
2426
+ xs: "1fr",
2427
+ sm: "repeat(2, minmax(0, 1fr))",
2428
+ lg: `repeat(${s}, minmax(0, 1fr))`
2429
+ },
2430
+ gap: y ? 1.25 : 2
2431
+ },
2432
+ children: e.map((g) => {
2433
+ const w = St(g), v = At(g), P = (v ?? 0) >= 0;
2434
+ return /* @__PURE__ */ t(
2435
+ Me,
2436
+ {
2437
+ variant: "outlined",
2438
+ sx: {
2439
+ p: y ? 1.5 : 2,
2440
+ borderRadius: 1,
2441
+ overflow: "hidden",
2442
+ position: "relative",
2443
+ borderColor: Y(w, 0.32),
2444
+ background: `linear-gradient(180deg, ${Y(w, 0.08)}, rgba(255,255,255,0) 42%)`
2445
+ },
2446
+ children: /* @__PURE__ */ m(V, { spacing: y ? 1 : 1.5, children: [
2447
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "flex-start", justifyContent: "space-between", children: [
2448
+ /* @__PURE__ */ m(d, { sx: { minWidth: 0 }, children: [
2449
+ /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", fontWeight: 850, sx: { textTransform: "uppercase" }, children: g.label }),
2450
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 0.75, alignItems: "baseline", sx: { mt: 0.5 }, children: [
2451
+ /* @__PURE__ */ t(E, { variant: y ? "h5" : "h4", fontWeight: 950, sx: { lineHeight: 1 }, children: Rt(g) }),
2452
+ g.unit ? /* @__PURE__ */ t(E, { variant: "body2", color: "text.secondary", fontWeight: 800, children: g.unit }) : null
2453
+ ] })
2454
+ ] }),
2455
+ g.icon ? /* @__PURE__ */ t(d, { sx: { color: w, display: "grid", placeItems: "center", mt: 0.25 }, children: g.icon }) : null
2456
+ ] }),
2457
+ /* @__PURE__ */ m(V, { direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between", children: [
2458
+ v !== null ? /* @__PURE__ */ t(
2459
+ we,
2460
+ {
2461
+ size: "small",
2462
+ label: `${P ? "+" : ""}${v.toFixed(1)}%`,
2463
+ sx: {
2464
+ color: P ? fe.good : fe.danger,
2465
+ bgcolor: Y(P ? fe.good : fe.danger, 0.12),
2466
+ fontWeight: 850
2467
+ }
2468
+ }
2469
+ ) : /* @__PURE__ */ t(d, {}),
2470
+ g.helper ? /* @__PURE__ */ t(E, { variant: "caption", color: "text.secondary", textAlign: "right", children: g.helper }) : null
2471
+ ] }),
2472
+ u && g.trend?.length ? /* @__PURE__ */ t(Pt, { values: g.trend, color: w }) : null,
2473
+ x && typeof g.progress == "number" ? /* @__PURE__ */ t(
2474
+ ut,
2475
+ {
2476
+ variant: "determinate",
2477
+ value: zt(g.progress, 0, 100),
2478
+ sx: {
2479
+ height: 8,
2480
+ borderRadius: 999,
2481
+ bgcolor: Y(w, 0.14),
2482
+ "& .MuiLinearProgress-bar": {
2483
+ bgcolor: w,
2484
+ borderRadius: 999
2485
+ }
2486
+ }
2487
+ }
2488
+ ) : null
2489
+ ] })
2490
+ },
2491
+ g.id
2492
+ );
2493
+ })
2494
+ }
2495
+ )
2496
+ ]
2497
+ }
2498
+ );
2499
+ }
2348
2500
  export {
2349
- xr as BeforeAfterSlider,
2350
- sr as CodeViewer,
2351
- vr as ColorPicker,
2352
- pr as CommandPalette,
2353
- lr as ComponentExample,
2354
- ur as DockBar,
2355
- cr as DraggableBox,
2356
- kr as FileDropZone,
2357
- fr as FloatingToolbar,
2358
- dr as GlassBox,
2359
- Cr as InfiniteCanvas,
2360
- wr as InspectorPanel,
2361
- br as MagneticCard,
2362
- mr as NodeCanvas,
2363
- yr as ResizableFrame,
2364
- Ir as SmartTooltip,
2365
- hr as SplitPane,
2366
- gr as SpotlightPanel,
2367
- $r as TimelineScrubber
2501
+ zr as BeforeAfterSlider,
2502
+ mr as CodeViewer,
2503
+ Rr as ColorPicker,
2504
+ vr as CommandPalette,
2505
+ br as ComponentExample,
2506
+ Dr as DataCardGrid,
2507
+ wr as DockBar,
2508
+ xr as DraggableBox,
2509
+ Lr as FileDropZone,
2510
+ kr as FloatingToolbar,
2511
+ yr as GlassBox,
2512
+ Tr as InfiniteCanvas,
2513
+ Ar as InspectorPanel,
2514
+ Cr as MagneticCard,
2515
+ Mr as NodeCanvas,
2516
+ Sr as ResizableFrame,
2517
+ Wr as SmartTooltip,
2518
+ $r as SplitPane,
2519
+ Ir as SpotlightPanel,
2520
+ Pr as TimelineScrubber
2368
2521
  };