@mickyballadelli/react-things 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/components/KanbanBoard.d.ts +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/react-things-ui.cjs +22 -22
- package/dist/react-things-ui.js +1587 -1174
- package/package.json +1 -1
package/dist/react-things-ui.js
CHANGED
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Box as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import { alpha as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as e, Fragment as qe } from "react/jsx-runtime";
|
|
2
|
+
import { Box as de, Typography as Re } from "@mui/material";
|
|
3
|
+
import { useRef as pe, useState as S, useLayoutEffect as Ze, useId as et, useMemo as ze, useEffect as ke, useCallback as tt } from "react";
|
|
4
|
+
import u from "@mui/material/Box";
|
|
5
|
+
import { alpha as j } from "@mui/material/styles";
|
|
6
|
+
import ce from "@mui/material/Tooltip";
|
|
7
|
+
import Y from "@mui/material/Typography";
|
|
8
|
+
import rt from "@mui/material/Collapse";
|
|
9
|
+
import nt from "@mui/material/InputBase";
|
|
10
|
+
import ot from "@mui/material/List";
|
|
11
11
|
import Le from "@mui/material/ListItemButton";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
12
|
+
import it from "@mui/material/ListItemIcon";
|
|
13
|
+
import We from "@mui/material/ListItemText";
|
|
14
|
+
import at from "@mui/icons-material/AddBox";
|
|
15
|
+
import lt from "@mui/icons-material/AddLink";
|
|
16
|
+
import st from "@mui/icons-material/Close";
|
|
17
|
+
import _e from "@mui/icons-material/Delete";
|
|
18
|
+
import ct from "@mui/icons-material/LinkOff";
|
|
19
19
|
import ue from "@mui/material/IconButton";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
20
|
+
import be from "@mui/material/MenuItem";
|
|
21
|
+
import H from "@mui/material/Stack";
|
|
22
22
|
import _ from "@mui/material/TextField";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
23
|
+
import Ke from "@mui/icons-material/DragIndicator";
|
|
24
|
+
import ie from "@mui/material/Button";
|
|
25
|
+
import dt from "@mui/material/Checkbox";
|
|
26
26
|
import we from "@mui/material/Chip";
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
27
|
+
import ut from "@mui/material/Divider";
|
|
28
|
+
import pt from "@mui/material/FormControlLabel";
|
|
29
|
+
import $e from "@mui/material/Paper";
|
|
30
|
+
import Qe from "@mui/material/Slider";
|
|
31
|
+
import ht from "@mui/material/InputAdornment";
|
|
32
|
+
import ft from "@mui/icons-material/ContentCopy";
|
|
33
|
+
import gt from "@mui/icons-material/PushPin";
|
|
34
|
+
import bt from "@mui/icons-material/PushPinOutlined";
|
|
35
|
+
import mt from "@mui/material/ClickAwayListener";
|
|
36
|
+
import xt from "@mui/material/Popper";
|
|
37
|
+
import yt from "@mui/material/LinearProgress";
|
|
38
|
+
import Be from "@mui/icons-material/Add";
|
|
39
|
+
import Ee from "@mui/icons-material/Edit";
|
|
40
|
+
import wt from "@mui/material/Dialog";
|
|
41
|
+
import vt from "@mui/material/DialogActions";
|
|
42
|
+
import Ct from "@mui/material/DialogContent";
|
|
43
|
+
import kt from "@mui/material/DialogTitle";
|
|
44
|
+
function Xr({ title: t = "React Things", children: n }) {
|
|
45
|
+
return /* @__PURE__ */ f(
|
|
46
|
+
de,
|
|
41
47
|
{
|
|
42
48
|
sx: {
|
|
43
49
|
border: 1,
|
|
@@ -47,13 +53,13 @@ function br({ title: e = "React Things", children: n }) {
|
|
|
47
53
|
bgcolor: "background.paper"
|
|
48
54
|
},
|
|
49
55
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
n ? /* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ e(Re, { variant: "subtitle1", fontWeight: 700, children: t }),
|
|
57
|
+
n ? /* @__PURE__ */ e(de, { sx: { mt: 1 }, children: n }) : null
|
|
52
58
|
]
|
|
53
59
|
}
|
|
54
60
|
);
|
|
55
61
|
}
|
|
56
|
-
const
|
|
62
|
+
const Me = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Xe = 12, $t = {
|
|
57
63
|
c: "#659ad2",
|
|
58
64
|
cpp: "#00599c",
|
|
59
65
|
cplusplus: "#00599c",
|
|
@@ -91,29 +97,29 @@ const $e = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", T
|
|
|
91
97
|
css: "#1572b6",
|
|
92
98
|
dart: "#0175c2"
|
|
93
99
|
};
|
|
94
|
-
function
|
|
95
|
-
return
|
|
100
|
+
function It(t) {
|
|
101
|
+
return t.trim().replace(/^\./, "").toLowerCase().replace(/\s+/g, "");
|
|
96
102
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
103
|
+
function Dt(t) {
|
|
104
|
+
return $t[It(t)] ?? "#93c5fd";
|
|
99
105
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
106
|
+
function zt(t) {
|
|
107
|
+
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
102
108
|
}
|
|
103
|
-
function
|
|
104
|
-
const n =
|
|
105
|
-
return /^['"`]/.test(
|
|
109
|
+
function Mt(t) {
|
|
110
|
+
const n = zt(t), a = /^(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/;
|
|
111
|
+
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>` : a.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;
|
|
106
112
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
113
|
+
function St(t) {
|
|
114
|
+
return t.split(/(\s+|<\/?[A-Z][\w.]*|['"`][^'"`]*['"`]|\d*\.?\d+|[A-Za-z_$][\w$-]*|[{}()[\].,:;=<>/]+)/g).map((n) => Mt(n)).join("");
|
|
109
115
|
}
|
|
110
|
-
function
|
|
111
|
-
const
|
|
112
|
-
`).length, 1),
|
|
113
|
-
`),
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
116
|
+
function Fr({ label: t, language: n, value: a, onChange: s, minHeight: h = 360 }) {
|
|
117
|
+
const c = a ?? "", v = Math.max(c.split(`
|
|
118
|
+
`).length, 1), m = Array.from({ length: v }, (w, $) => $ + 1).join(`
|
|
119
|
+
`), d = St(c), k = Dt(n);
|
|
120
|
+
return /* @__PURE__ */ f(de, { children: [
|
|
121
|
+
/* @__PURE__ */ f(
|
|
122
|
+
de,
|
|
117
123
|
{
|
|
118
124
|
sx: {
|
|
119
125
|
display: "flex",
|
|
@@ -127,14 +133,14 @@ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }
|
|
|
127
133
|
borderTopRightRadius: 4
|
|
128
134
|
},
|
|
129
135
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
136
|
+
/* @__PURE__ */ e(Re, { variant: "caption", fontWeight: 800, children: t }),
|
|
137
|
+
/* @__PURE__ */ e(
|
|
138
|
+
Re,
|
|
133
139
|
{
|
|
134
140
|
variant: "caption",
|
|
135
141
|
sx: {
|
|
136
142
|
fontFamily: "monospace",
|
|
137
|
-
color:
|
|
143
|
+
color: k,
|
|
138
144
|
textTransform: "lowercase"
|
|
139
145
|
},
|
|
140
146
|
children: n
|
|
@@ -143,21 +149,21 @@ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }
|
|
|
143
149
|
]
|
|
144
150
|
}
|
|
145
151
|
),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
|
|
152
|
+
/* @__PURE__ */ f(
|
|
153
|
+
de,
|
|
148
154
|
{
|
|
149
155
|
sx: {
|
|
150
156
|
display: "grid",
|
|
151
157
|
gridTemplateColumns: "48px 1fr",
|
|
152
|
-
minHeight:
|
|
158
|
+
minHeight: h,
|
|
153
159
|
bgcolor: "#0f172a",
|
|
154
160
|
borderBottomLeftRadius: 4,
|
|
155
161
|
borderBottomRightRadius: 4,
|
|
156
162
|
overflow: "hidden"
|
|
157
163
|
},
|
|
158
164
|
children: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
165
|
+
/* @__PURE__ */ e(
|
|
166
|
+
de,
|
|
161
167
|
{
|
|
162
168
|
component: "pre",
|
|
163
169
|
"aria-hidden": "true",
|
|
@@ -167,40 +173,40 @@ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }
|
|
|
167
173
|
py: 1.5,
|
|
168
174
|
color: "#64748b",
|
|
169
175
|
bgcolor: "#111827",
|
|
170
|
-
fontFamily:
|
|
176
|
+
fontFamily: Me,
|
|
171
177
|
fontSize: 14,
|
|
172
178
|
lineHeight: 1.6,
|
|
173
179
|
textAlign: "right",
|
|
174
180
|
userSelect: "none"
|
|
175
181
|
},
|
|
176
|
-
children:
|
|
182
|
+
children: m
|
|
177
183
|
}
|
|
178
184
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
185
|
+
/* @__PURE__ */ f(
|
|
186
|
+
de,
|
|
181
187
|
{
|
|
182
188
|
sx: {
|
|
183
189
|
position: "relative",
|
|
184
|
-
minHeight:
|
|
190
|
+
minHeight: h,
|
|
185
191
|
bgcolor: "#0f172a",
|
|
186
192
|
overflow: "auto"
|
|
187
193
|
},
|
|
188
194
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
|
|
195
|
+
/* @__PURE__ */ e(
|
|
196
|
+
de,
|
|
191
197
|
{
|
|
192
198
|
component: "pre",
|
|
193
199
|
"aria-hidden": "true",
|
|
194
|
-
dangerouslySetInnerHTML: { __html:
|
|
200
|
+
dangerouslySetInnerHTML: { __html: d },
|
|
195
201
|
sx: {
|
|
196
202
|
position: "absolute",
|
|
197
203
|
inset: 0,
|
|
198
204
|
m: 0,
|
|
199
|
-
p: `${
|
|
205
|
+
p: `${Xe}px`,
|
|
200
206
|
boxSizing: "border-box",
|
|
201
207
|
pointerEvents: "none",
|
|
202
208
|
color: "#e5e7eb",
|
|
203
|
-
fontFamily:
|
|
209
|
+
fontFamily: Me,
|
|
204
210
|
fontSize: 14,
|
|
205
211
|
lineHeight: 1.6,
|
|
206
212
|
tabSize: 2,
|
|
@@ -209,29 +215,29 @@ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }
|
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
217
|
),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
218
|
+
/* @__PURE__ */ e(
|
|
219
|
+
de,
|
|
214
220
|
{
|
|
215
221
|
component: "textarea",
|
|
216
|
-
"aria-label": `${
|
|
222
|
+
"aria-label": `${t} code editor`,
|
|
217
223
|
spellCheck: !1,
|
|
218
|
-
value:
|
|
219
|
-
onChange: (
|
|
224
|
+
value: c,
|
|
225
|
+
onChange: (w) => s(w.target.value),
|
|
220
226
|
sx: {
|
|
221
227
|
position: "relative",
|
|
222
228
|
width: "100%",
|
|
223
229
|
minWidth: 0,
|
|
224
|
-
minHeight:
|
|
230
|
+
minHeight: h,
|
|
225
231
|
resize: "vertical",
|
|
226
232
|
border: 0,
|
|
227
233
|
outline: 0,
|
|
228
|
-
p: `${
|
|
234
|
+
p: `${Xe}px`,
|
|
229
235
|
boxSizing: "border-box",
|
|
230
236
|
color: "transparent",
|
|
231
237
|
WebkitTextFillColor: "transparent",
|
|
232
238
|
bgcolor: "transparent",
|
|
233
239
|
caretColor: "#60a5fa",
|
|
234
|
-
fontFamily:
|
|
240
|
+
fontFamily: Me,
|
|
235
241
|
fontSize: 14,
|
|
236
242
|
lineHeight: 1.6,
|
|
237
243
|
tabSize: 2,
|
|
@@ -255,141 +261,141 @@ function mr({ label: e, language: n, value: l, onChange: s, minHeight: f = 360 }
|
|
|
255
261
|
)
|
|
256
262
|
] });
|
|
257
263
|
}
|
|
258
|
-
function
|
|
259
|
-
children:
|
|
264
|
+
function Yr({
|
|
265
|
+
children: t,
|
|
260
266
|
initialPosition: n = { x: 50, y: 50 },
|
|
261
|
-
dragSx:
|
|
267
|
+
dragSx: a,
|
|
262
268
|
onPositionChange: s,
|
|
263
|
-
onDraggingChange:
|
|
264
|
-
sx:
|
|
265
|
-
...
|
|
269
|
+
onDraggingChange: h,
|
|
270
|
+
sx: c,
|
|
271
|
+
...v
|
|
266
272
|
}) {
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
if (!
|
|
273
|
+
const m = pe(null), d = pe(null), [k, w] = S(n), [$, g] = S({ x: 0, y: 0 }), [B, z] = S(!1);
|
|
274
|
+
Ze(() => {
|
|
275
|
+
const b = m.current, A = d.current;
|
|
276
|
+
if (!b || !A)
|
|
271
277
|
return;
|
|
272
|
-
const
|
|
273
|
-
s?.(
|
|
274
|
-
containerWidth:
|
|
275
|
-
containerHeight:
|
|
276
|
-
draggableWidth:
|
|
277
|
-
draggableHeight:
|
|
278
|
-
draggableLeft:
|
|
279
|
-
draggableTop:
|
|
280
|
-
containerBackgroundImage:
|
|
281
|
-
containerBackgroundSize:
|
|
282
|
-
containerBackgroundPosition:
|
|
278
|
+
const V = b.getBoundingClientRect(), O = A.getBoundingClientRect(), M = window.getComputedStyle(b), R = k.x / 100 * V.width, I = k.y / 100 * V.height;
|
|
279
|
+
s?.(k, {
|
|
280
|
+
containerWidth: V.width,
|
|
281
|
+
containerHeight: V.height,
|
|
282
|
+
draggableWidth: O.width,
|
|
283
|
+
draggableHeight: O.height,
|
|
284
|
+
draggableLeft: R - O.width / 2,
|
|
285
|
+
draggableTop: I - O.height / 2,
|
|
286
|
+
containerBackgroundImage: M.backgroundImage,
|
|
287
|
+
containerBackgroundSize: M.backgroundSize,
|
|
288
|
+
containerBackgroundPosition: M.backgroundPosition
|
|
283
289
|
});
|
|
284
290
|
}, []);
|
|
285
|
-
function
|
|
286
|
-
|
|
291
|
+
function i(b, A) {
|
|
292
|
+
w(b), s?.(b, A);
|
|
287
293
|
}
|
|
288
|
-
function
|
|
289
|
-
const
|
|
290
|
-
if (!
|
|
294
|
+
function E(b, A, V = $) {
|
|
295
|
+
const O = m.current, M = d.current;
|
|
296
|
+
if (!O || !M)
|
|
291
297
|
return;
|
|
292
|
-
const
|
|
293
|
-
x: Math.min(Math.max(
|
|
294
|
-
y: Math.min(Math.max(
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
containerWidth:
|
|
298
|
-
containerHeight:
|
|
299
|
-
draggableWidth:
|
|
300
|
-
draggableHeight:
|
|
301
|
-
draggableLeft:
|
|
302
|
-
draggableTop:
|
|
303
|
-
containerBackgroundImage:
|
|
304
|
-
containerBackgroundSize:
|
|
305
|
-
containerBackgroundPosition:
|
|
298
|
+
const R = O.getBoundingClientRect(), I = M.getBoundingClientRect(), W = window.getComputedStyle(O), U = b - V.x + I.width / 2, G = A - V.y + I.height / 2, p = I.width / R.width * 50, L = I.height / R.height * 50, y = (U - R.left) / R.width * 100, P = (G - R.top) / R.height * 100, N = {
|
|
299
|
+
x: Math.min(Math.max(y, p), 100 - p),
|
|
300
|
+
y: Math.min(Math.max(P, L), 100 - L)
|
|
301
|
+
}, o = N.x / 100 * R.width, X = N.y / 100 * R.height;
|
|
302
|
+
i(N, {
|
|
303
|
+
containerWidth: R.width,
|
|
304
|
+
containerHeight: R.height,
|
|
305
|
+
draggableWidth: I.width,
|
|
306
|
+
draggableHeight: I.height,
|
|
307
|
+
draggableLeft: o - I.width / 2,
|
|
308
|
+
draggableTop: X - I.height / 2,
|
|
309
|
+
containerBackgroundImage: W.backgroundImage,
|
|
310
|
+
containerBackgroundSize: W.backgroundSize,
|
|
311
|
+
containerBackgroundPosition: W.backgroundPosition
|
|
306
312
|
});
|
|
307
313
|
}
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
314
|
+
return /* @__PURE__ */ e(
|
|
315
|
+
u,
|
|
310
316
|
{
|
|
311
|
-
...
|
|
312
|
-
ref:
|
|
317
|
+
...v,
|
|
318
|
+
ref: m,
|
|
313
319
|
sx: [
|
|
314
320
|
{
|
|
315
321
|
position: "relative",
|
|
316
322
|
overflow: "hidden",
|
|
317
323
|
touchAction: "none"
|
|
318
324
|
},
|
|
319
|
-
...Array.isArray(
|
|
325
|
+
...Array.isArray(c) ? c : c ? [c] : []
|
|
320
326
|
],
|
|
321
|
-
onPointerMove: (
|
|
322
|
-
|
|
327
|
+
onPointerMove: (b) => {
|
|
328
|
+
B && E(b.clientX, b.clientY);
|
|
323
329
|
},
|
|
324
|
-
onPointerUp: (
|
|
325
|
-
|
|
330
|
+
onPointerUp: (b) => {
|
|
331
|
+
z(!1), h?.(!1), b.currentTarget.releasePointerCapture(b.pointerId);
|
|
326
332
|
},
|
|
327
333
|
onPointerCancel: () => {
|
|
328
|
-
|
|
334
|
+
z(!1), h?.(!1);
|
|
329
335
|
},
|
|
330
|
-
children: /* @__PURE__ */
|
|
331
|
-
|
|
336
|
+
children: /* @__PURE__ */ e(
|
|
337
|
+
u,
|
|
332
338
|
{
|
|
333
|
-
ref:
|
|
339
|
+
ref: d,
|
|
334
340
|
sx: [
|
|
335
341
|
{
|
|
336
342
|
position: "absolute",
|
|
337
|
-
left: `${
|
|
338
|
-
top: `${
|
|
343
|
+
left: `${k.x}%`,
|
|
344
|
+
top: `${k.y}%`,
|
|
339
345
|
transform: "translate(-50%, -50%)",
|
|
340
|
-
cursor:
|
|
346
|
+
cursor: B ? "grabbing" : "grab",
|
|
341
347
|
userSelect: "none"
|
|
342
348
|
},
|
|
343
|
-
...Array.isArray(
|
|
349
|
+
...Array.isArray(a) ? a : a ? [a] : []
|
|
344
350
|
],
|
|
345
|
-
onPointerDown: (
|
|
346
|
-
const
|
|
347
|
-
x:
|
|
348
|
-
y:
|
|
351
|
+
onPointerDown: (b) => {
|
|
352
|
+
const A = b.currentTarget.getBoundingClientRect(), V = {
|
|
353
|
+
x: b.clientX - A.left,
|
|
354
|
+
y: b.clientY - A.top
|
|
349
355
|
};
|
|
350
|
-
|
|
356
|
+
z(!0), h?.(!0), g(V), b.currentTarget.setPointerCapture(b.pointerId), E(b.clientX, b.clientY, V);
|
|
351
357
|
},
|
|
352
|
-
children:
|
|
358
|
+
children: t
|
|
353
359
|
}
|
|
354
360
|
)
|
|
355
361
|
}
|
|
356
362
|
);
|
|
357
363
|
}
|
|
358
|
-
function
|
|
359
|
-
return Math.min(Math.max(
|
|
364
|
+
function Fe(t) {
|
|
365
|
+
return Math.min(Math.max(t, 0), 1);
|
|
360
366
|
}
|
|
361
|
-
function
|
|
362
|
-
transparency:
|
|
367
|
+
function Nr({
|
|
368
|
+
transparency: t = 0.36,
|
|
363
369
|
fill: n = 0.72,
|
|
364
|
-
liquidColor:
|
|
370
|
+
liquidColor: a = "#39b8ff",
|
|
365
371
|
glassColor: s = "#ffffff",
|
|
366
|
-
motion:
|
|
367
|
-
refractionActive:
|
|
368
|
-
children:
|
|
369
|
-
sx:
|
|
370
|
-
...
|
|
372
|
+
motion: h = 0,
|
|
373
|
+
refractionActive: c = !0,
|
|
374
|
+
children: v,
|
|
375
|
+
sx: m,
|
|
376
|
+
...d
|
|
371
377
|
}) {
|
|
372
|
-
const
|
|
373
|
-
return /* @__PURE__ */
|
|
374
|
-
|
|
378
|
+
const w = `glass-liquid-${et().replace(/:/g, "")}`, $ = 1 - Fe(t), g = Fe(t), z = `${(1 - Math.min(Math.max(n, 0), 1)) * 100}%`, i = Math.abs(Math.round(h * 8)) + 1, E = 0.012 + Math.abs(Math.sin(h / 17)) * 0.012, b = 18 + $ * 18, A = c;
|
|
379
|
+
return /* @__PURE__ */ f(
|
|
380
|
+
u,
|
|
375
381
|
{
|
|
376
|
-
...
|
|
382
|
+
...d,
|
|
377
383
|
sx: [
|
|
378
384
|
{
|
|
379
385
|
position: "relative",
|
|
380
386
|
overflow: "hidden",
|
|
381
387
|
border: 1,
|
|
382
|
-
borderColor:
|
|
388
|
+
borderColor: j(s, 0.48),
|
|
383
389
|
borderRadius: 2,
|
|
384
390
|
minHeight: 160,
|
|
385
391
|
p: 3,
|
|
386
392
|
color: "common.white",
|
|
387
|
-
bgcolor:
|
|
393
|
+
bgcolor: j(s, 0.08 + g * 0.18),
|
|
388
394
|
boxShadow: `
|
|
389
|
-
inset 0 1px 0 ${
|
|
390
|
-
inset 14px 0 34px ${
|
|
391
|
-
inset -18px 0 32px ${
|
|
392
|
-
0 18px 48px ${
|
|
395
|
+
inset 0 1px 0 ${j(s, 0.68)},
|
|
396
|
+
inset 14px 0 34px ${j(s, 0.12)},
|
|
397
|
+
inset -18px 0 32px ${j(a, $ * 0.2)},
|
|
398
|
+
0 18px 48px ${j("#0b2030", 0.18)}
|
|
393
399
|
`,
|
|
394
400
|
backdropFilter: "blur(12px) saturate(170%) contrast(108%)",
|
|
395
401
|
WebkitBackdropFilter: "blur(12px) saturate(170%) contrast(108%)",
|
|
@@ -398,15 +404,15 @@ function yr({
|
|
|
398
404
|
position: "absolute",
|
|
399
405
|
left: 0,
|
|
400
406
|
right: 0,
|
|
401
|
-
top:
|
|
407
|
+
top: z,
|
|
402
408
|
bottom: 0,
|
|
403
409
|
background: `
|
|
404
|
-
linear-gradient(160deg, ${
|
|
410
|
+
linear-gradient(160deg, ${j(s, $ * 0.16)} 0%, ${j(a, $ * 0.28)} 42%, ${j("#063451", $ * 0.2)} 100%)
|
|
405
411
|
`,
|
|
406
412
|
opacity: 0.95,
|
|
407
413
|
boxShadow: `
|
|
408
|
-
inset 0 18px 28px ${
|
|
409
|
-
inset 0 -34px 44px ${
|
|
414
|
+
inset 0 18px 28px ${j(s, 0.12 + $ * 0.16)},
|
|
415
|
+
inset 0 -34px 44px ${j("#032536", $ * 0.22)}
|
|
410
416
|
`
|
|
411
417
|
},
|
|
412
418
|
"&::after": {
|
|
@@ -414,8 +420,8 @@ function yr({
|
|
|
414
420
|
position: "absolute",
|
|
415
421
|
inset: 0,
|
|
416
422
|
background: `
|
|
417
|
-
linear-gradient(105deg, ${
|
|
418
|
-
radial-gradient(circle at 18% 18%, ${
|
|
423
|
+
linear-gradient(105deg, ${j(s, 0.34)} 0%, ${j(s, 0.08)} 18%, ${j(s, 0)} 34%),
|
|
424
|
+
radial-gradient(circle at 18% 18%, ${j(s, 0.38)} 0 3%, ${j(s, 0)} 18%)
|
|
419
425
|
`,
|
|
420
426
|
pointerEvents: "none"
|
|
421
427
|
},
|
|
@@ -428,65 +434,65 @@ function yr({
|
|
|
428
434
|
backgroundSize: "var(--glassbox-refraction-background-size, cover)",
|
|
429
435
|
backgroundPosition: "var(--glassbox-refraction-background-position, center)",
|
|
430
436
|
backgroundRepeat: "no-repeat",
|
|
431
|
-
filter: `url(#${
|
|
432
|
-
opacity:
|
|
437
|
+
filter: `url(#${w}) saturate(150%) contrast(112%)`,
|
|
438
|
+
opacity: A ? 0.72 : 0,
|
|
433
439
|
transition: "opacity 120ms ease-out",
|
|
434
|
-
maskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${
|
|
435
|
-
WebkitMaskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${
|
|
440
|
+
maskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${z} + 10px), black calc(${z} + 28px), black 100%)`,
|
|
441
|
+
WebkitMaskImage: `linear-gradient(to bottom, transparent 0, transparent calc(${z} + 10px), black calc(${z} + 28px), black 100%)`
|
|
436
442
|
},
|
|
437
443
|
"& .GlassBox-refractionOffset": {
|
|
438
444
|
position: "absolute",
|
|
439
445
|
inset: 0,
|
|
440
446
|
zIndex: 2,
|
|
441
447
|
pointerEvents: "none",
|
|
442
|
-
opacity:
|
|
448
|
+
opacity: A ? 0.16 + g * 0.16 : 0,
|
|
443
449
|
backdropFilter: "blur(3px) saturate(190%)",
|
|
444
450
|
WebkitBackdropFilter: "blur(3px) saturate(190%)",
|
|
445
451
|
background: `
|
|
446
|
-
linear-gradient(180deg, ${
|
|
447
|
-
linear-gradient(90deg, ${
|
|
452
|
+
linear-gradient(180deg, ${j(s, 0.2)} 0, ${j(s, 0)} 20%),
|
|
453
|
+
linear-gradient(90deg, ${j(s, 0)} 0 18%, ${j(s, 0.14)} 26%, ${j(s, 0)} 34% 58%, ${j(s, 0.1)} 68%, ${j(s, 0)} 76% 100%)
|
|
448
454
|
`,
|
|
449
455
|
transition: "opacity 120ms ease-out",
|
|
450
|
-
maskImage: `linear-gradient(to bottom, transparent 0, transparent ${
|
|
451
|
-
WebkitMaskImage: `linear-gradient(to bottom, transparent 0, transparent ${
|
|
456
|
+
maskImage: `linear-gradient(to bottom, transparent 0, transparent ${z}, black calc(${z} + 18px), black 100%)`,
|
|
457
|
+
WebkitMaskImage: `linear-gradient(to bottom, transparent 0, transparent ${z}, black calc(${z} + 18px), black 100%)`
|
|
452
458
|
},
|
|
453
459
|
"& .GlassBox-content": {
|
|
454
460
|
position: "relative",
|
|
455
461
|
zIndex: 3,
|
|
456
|
-
textShadow: `0 1px 10px ${
|
|
462
|
+
textShadow: `0 1px 10px ${j("#00121d", 0.36)}`
|
|
457
463
|
},
|
|
458
464
|
"& > *": {
|
|
459
465
|
position: "relative",
|
|
460
466
|
zIndex: 3
|
|
461
467
|
}
|
|
462
468
|
},
|
|
463
|
-
...Array.isArray(
|
|
469
|
+
...Array.isArray(m) ? m : m ? [m] : []
|
|
464
470
|
],
|
|
465
471
|
children: [
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
|
|
472
|
+
/* @__PURE__ */ e(
|
|
473
|
+
u,
|
|
468
474
|
{
|
|
469
475
|
component: "svg",
|
|
470
476
|
"aria-hidden": "true",
|
|
471
477
|
focusable: "false",
|
|
472
478
|
sx: { position: "absolute", width: 0, height: 0, overflow: "hidden" },
|
|
473
|
-
children: /* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ f("filter", { id: w, children: [
|
|
480
|
+
/* @__PURE__ */ e(
|
|
475
481
|
"feTurbulence",
|
|
476
482
|
{
|
|
477
483
|
type: "fractalNoise",
|
|
478
|
-
baseFrequency: `${
|
|
484
|
+
baseFrequency: `${E} ${E * 2.6}`,
|
|
479
485
|
numOctaves: "2",
|
|
480
|
-
seed:
|
|
486
|
+
seed: i,
|
|
481
487
|
result: "liquidNoise"
|
|
482
488
|
}
|
|
483
489
|
),
|
|
484
|
-
/* @__PURE__ */
|
|
490
|
+
/* @__PURE__ */ e(
|
|
485
491
|
"feDisplacementMap",
|
|
486
492
|
{
|
|
487
493
|
in: "SourceGraphic",
|
|
488
494
|
in2: "liquidNoise",
|
|
489
|
-
scale:
|
|
495
|
+
scale: b,
|
|
490
496
|
xChannelSelector: "R",
|
|
491
497
|
yChannelSelector: "G"
|
|
492
498
|
}
|
|
@@ -494,30 +500,30 @@ function yr({
|
|
|
494
500
|
] })
|
|
495
501
|
}
|
|
496
502
|
),
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ e(u, { className: "GlassBox-liquidLens" }),
|
|
504
|
+
/* @__PURE__ */ e(u, { className: "GlassBox-refractionOffset" }),
|
|
505
|
+
/* @__PURE__ */ e(u, { className: "GlassBox-content", children: v })
|
|
500
506
|
]
|
|
501
507
|
}
|
|
502
508
|
);
|
|
503
509
|
}
|
|
504
|
-
function
|
|
505
|
-
return Math.min(Math.max(
|
|
510
|
+
function At(t, n, a) {
|
|
511
|
+
return Math.min(Math.max(t, n), a);
|
|
506
512
|
}
|
|
507
|
-
function
|
|
508
|
-
items:
|
|
513
|
+
function Or({
|
|
514
|
+
items: t,
|
|
509
515
|
iconSize: n = 52,
|
|
510
|
-
magnification:
|
|
516
|
+
magnification: a = 1.7,
|
|
511
517
|
gap: s = 10,
|
|
512
|
-
tooltip:
|
|
513
|
-
sx:
|
|
514
|
-
...
|
|
518
|
+
tooltip: h = !0,
|
|
519
|
+
sx: c,
|
|
520
|
+
...v
|
|
515
521
|
}) {
|
|
516
|
-
const [
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
|
|
522
|
+
const [m, d] = S(null);
|
|
523
|
+
return /* @__PURE__ */ e(
|
|
524
|
+
u,
|
|
519
525
|
{
|
|
520
|
-
...
|
|
526
|
+
...v,
|
|
521
527
|
role: "toolbar",
|
|
522
528
|
sx: [
|
|
523
529
|
{
|
|
@@ -533,18 +539,18 @@ function wr({
|
|
|
533
539
|
backdropFilter: "blur(18px) saturate(150%)",
|
|
534
540
|
WebkitBackdropFilter: "blur(18px) saturate(150%)"
|
|
535
541
|
},
|
|
536
|
-
...Array.isArray(
|
|
542
|
+
...Array.isArray(c) ? c : c ? [c] : []
|
|
537
543
|
],
|
|
538
|
-
onMouseLeave: () =>
|
|
539
|
-
children:
|
|
540
|
-
const
|
|
541
|
-
|
|
544
|
+
onMouseLeave: () => d(null),
|
|
545
|
+
children: t.map((k, w) => {
|
|
546
|
+
const $ = m === null ? 4 : Math.abs(w - m), g = At(1 - $ / 3, 0, 1), B = 1 + (a - 1) * g, z = -18 * g, i = /* @__PURE__ */ e(
|
|
547
|
+
u,
|
|
542
548
|
{
|
|
543
549
|
component: "button",
|
|
544
550
|
type: "button",
|
|
545
|
-
"aria-label":
|
|
546
|
-
onClick:
|
|
547
|
-
onMouseEnter: () =>
|
|
551
|
+
"aria-label": k.label,
|
|
552
|
+
onClick: k.onClick,
|
|
553
|
+
onMouseEnter: () => d(w),
|
|
548
554
|
sx: {
|
|
549
555
|
width: n,
|
|
550
556
|
height: n,
|
|
@@ -558,7 +564,7 @@ function wr({
|
|
|
558
564
|
bgcolor: "rgba(255,255,255,0.72)",
|
|
559
565
|
boxShadow: "inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 18px rgba(15, 23, 42, 0.18)",
|
|
560
566
|
cursor: "pointer",
|
|
561
|
-
transform: `translateY(${
|
|
567
|
+
transform: `translateY(${z}px) scale(${B})`,
|
|
562
568
|
transformOrigin: "bottom center",
|
|
563
569
|
transition: "transform 130ms ease-out, background-color 130ms ease-out",
|
|
564
570
|
"&:focus-visible": {
|
|
@@ -569,8 +575,8 @@ function wr({
|
|
|
569
575
|
bgcolor: "rgba(255,255,255,0.9)"
|
|
570
576
|
}
|
|
571
577
|
},
|
|
572
|
-
children: /* @__PURE__ */
|
|
573
|
-
|
|
578
|
+
children: /* @__PURE__ */ e(
|
|
579
|
+
Y,
|
|
574
580
|
{
|
|
575
581
|
component: "span",
|
|
576
582
|
"aria-hidden": "true",
|
|
@@ -580,72 +586,72 @@ function wr({
|
|
|
580
586
|
fontSize: Math.round(n * 0.52),
|
|
581
587
|
lineHeight: 1
|
|
582
588
|
},
|
|
583
|
-
children:
|
|
589
|
+
children: k.icon
|
|
584
590
|
}
|
|
585
591
|
)
|
|
586
592
|
},
|
|
587
|
-
|
|
593
|
+
k.id
|
|
588
594
|
);
|
|
589
|
-
return
|
|
595
|
+
return h ? /* @__PURE__ */ e(ce, { title: k.label, placement: "top", arrow: !0, children: i }, k.id) : i;
|
|
590
596
|
})
|
|
591
597
|
}
|
|
592
598
|
);
|
|
593
599
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
600
|
+
function Je(t) {
|
|
601
|
+
return t.toLowerCase().trim();
|
|
596
602
|
}
|
|
597
|
-
function
|
|
598
|
-
return
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
...
|
|
603
|
+
function Rt(t) {
|
|
604
|
+
return Je([
|
|
605
|
+
t.label,
|
|
606
|
+
t.description,
|
|
607
|
+
t.group,
|
|
608
|
+
t.parentId,
|
|
609
|
+
...t.keywords ?? []
|
|
604
610
|
].filter(Boolean).join(" "));
|
|
605
611
|
}
|
|
606
|
-
function
|
|
607
|
-
return Array.from(new Set(
|
|
612
|
+
function Ye(t) {
|
|
613
|
+
return Array.from(new Set(t.map((n) => n.group).filter(Boolean)));
|
|
608
614
|
}
|
|
609
|
-
function
|
|
610
|
-
items:
|
|
615
|
+
function Hr({
|
|
616
|
+
items: t,
|
|
611
617
|
variant: n = "list",
|
|
612
|
-
selectedId:
|
|
618
|
+
selectedId: a,
|
|
613
619
|
placeholder: s = "Search",
|
|
614
|
-
emptyText:
|
|
615
|
-
maxResults:
|
|
616
|
-
showSearch:
|
|
617
|
-
dense:
|
|
618
|
-
expandedGroups:
|
|
619
|
-
defaultExpandedGroups:
|
|
620
|
-
onExpandedGroupsChange:
|
|
621
|
-
onSelect:
|
|
622
|
-
sx:
|
|
623
|
-
...
|
|
620
|
+
emptyText: h = "No items found",
|
|
621
|
+
maxResults: c,
|
|
622
|
+
showSearch: v = !0,
|
|
623
|
+
dense: m = !1,
|
|
624
|
+
expandedGroups: d,
|
|
625
|
+
defaultExpandedGroups: k,
|
|
626
|
+
onExpandedGroupsChange: w,
|
|
627
|
+
onSelect: $,
|
|
628
|
+
sx: g,
|
|
629
|
+
...B
|
|
624
630
|
}) {
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
return typeof
|
|
628
|
-
}, [
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
+
const z = k ?? Ye(t), [i, E] = S(""), [b, A] = S(0), [V, O] = S(z), M = Je(i), R = d ?? V, I = ze(() => {
|
|
632
|
+
const o = M ? t.filter((X) => Rt(X).includes(M)) : t;
|
|
633
|
+
return typeof c == "number" ? o.slice(0, c) : o;
|
|
634
|
+
}, [t, c, M]), W = Ye(I), U = I;
|
|
635
|
+
function G(o) {
|
|
636
|
+
o.onSelect?.(), $?.(o), E(""), A(0);
|
|
631
637
|
}
|
|
632
|
-
function
|
|
633
|
-
|
|
638
|
+
function p(o) {
|
|
639
|
+
d === void 0 && O(o), w?.(o);
|
|
634
640
|
}
|
|
635
|
-
function
|
|
636
|
-
|
|
641
|
+
function L(o) {
|
|
642
|
+
p(R.includes(o) ? R.filter((X) => X !== o) : [...R, o]);
|
|
637
643
|
}
|
|
638
|
-
function
|
|
639
|
-
const
|
|
640
|
-
return /* @__PURE__ */
|
|
644
|
+
function y(o, X = 0) {
|
|
645
|
+
const ee = o.id === a;
|
|
646
|
+
return /* @__PURE__ */ f(
|
|
641
647
|
Le,
|
|
642
648
|
{
|
|
643
|
-
selected:
|
|
644
|
-
dense:
|
|
645
|
-
onClick: () =>
|
|
649
|
+
selected: ee,
|
|
650
|
+
dense: m,
|
|
651
|
+
onClick: () => G(o),
|
|
646
652
|
sx: {
|
|
647
653
|
borderRadius: 1,
|
|
648
|
-
pl: 1.25 +
|
|
654
|
+
pl: 1.25 + X * 2,
|
|
649
655
|
"&.Mui-selected": {
|
|
650
656
|
bgcolor: "action.selected",
|
|
651
657
|
color: "primary.main"
|
|
@@ -655,57 +661,57 @@ function vr({
|
|
|
655
661
|
}
|
|
656
662
|
},
|
|
657
663
|
children: [
|
|
658
|
-
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
|
|
664
|
+
o.icon ? /* @__PURE__ */ e(it, { sx: { minWidth: 34, color: "inherit" }, children: o.icon }) : null,
|
|
665
|
+
/* @__PURE__ */ e(
|
|
666
|
+
We,
|
|
661
667
|
{
|
|
662
|
-
primary:
|
|
663
|
-
secondary:
|
|
664
|
-
primaryTypographyProps: { fontWeight:
|
|
668
|
+
primary: o.label,
|
|
669
|
+
secondary: o.description,
|
|
670
|
+
primaryTypographyProps: { fontWeight: ee ? 850 : 700 },
|
|
665
671
|
secondaryTypographyProps: { color: "text.secondary" }
|
|
666
672
|
}
|
|
667
673
|
)
|
|
668
674
|
]
|
|
669
675
|
},
|
|
670
|
-
|
|
676
|
+
o.id
|
|
671
677
|
);
|
|
672
678
|
}
|
|
673
|
-
function
|
|
674
|
-
return
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
|
|
677
|
-
] },
|
|
679
|
+
function P() {
|
|
680
|
+
return I.length ? W.length ? W.map((o) => /* @__PURE__ */ f(u, { children: [
|
|
681
|
+
/* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 900, color: "text.secondary", sx: { display: "block", px: 1.25, pt: 1.5, pb: 0.5 }, children: o }),
|
|
682
|
+
I.filter((X) => X.group === o).map((X) => y(X))
|
|
683
|
+
] }, o)) : I.map((o) => y(o)) : /* @__PURE__ */ e(u, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: h });
|
|
678
684
|
}
|
|
679
|
-
function
|
|
680
|
-
return
|
|
681
|
-
const
|
|
682
|
-
return /* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
685
|
+
function N() {
|
|
686
|
+
return I.length ? W.length ? W.map((o) => {
|
|
687
|
+
const X = M || R.includes(o);
|
|
688
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
689
|
+
/* @__PURE__ */ f(
|
|
684
690
|
Le,
|
|
685
691
|
{
|
|
686
|
-
dense:
|
|
687
|
-
onClick: () =>
|
|
692
|
+
dense: m,
|
|
693
|
+
onClick: () => L(o),
|
|
688
694
|
sx: { borderRadius: 1, px: 1.25 },
|
|
689
695
|
children: [
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
|
|
696
|
+
/* @__PURE__ */ e(Y, { component: "span", "aria-hidden": "true", sx: { mr: 1, width: 16, color: "text.secondary" }, children: X ? "▾" : "▸" }),
|
|
697
|
+
/* @__PURE__ */ e(
|
|
698
|
+
We,
|
|
693
699
|
{
|
|
694
|
-
primary:
|
|
700
|
+
primary: o,
|
|
695
701
|
primaryTypographyProps: { fontWeight: 900 }
|
|
696
702
|
}
|
|
697
703
|
)
|
|
698
704
|
]
|
|
699
705
|
}
|
|
700
706
|
),
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
] },
|
|
703
|
-
}) :
|
|
707
|
+
/* @__PURE__ */ e(rt, { in: !!X, timeout: "auto", unmountOnExit: !0, children: I.filter((ee) => ee.group === o).map((ee) => y(ee, 1)) })
|
|
708
|
+
] }, o);
|
|
709
|
+
}) : I.map((o) => y(o)) : /* @__PURE__ */ e(u, { sx: { px: 2, py: 4, textAlign: "center", color: "text.secondary" }, children: h });
|
|
704
710
|
}
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
|
|
711
|
+
return /* @__PURE__ */ f(
|
|
712
|
+
u,
|
|
707
713
|
{
|
|
708
|
-
...
|
|
714
|
+
...B,
|
|
709
715
|
sx: [
|
|
710
716
|
{
|
|
711
717
|
display: "flex",
|
|
@@ -713,11 +719,11 @@ function vr({
|
|
|
713
719
|
gap: 1,
|
|
714
720
|
minWidth: 0
|
|
715
721
|
},
|
|
716
|
-
...Array.isArray(
|
|
722
|
+
...Array.isArray(g) ? g : g ? [g] : []
|
|
717
723
|
],
|
|
718
724
|
children: [
|
|
719
|
-
|
|
720
|
-
|
|
725
|
+
v ? /* @__PURE__ */ e(
|
|
726
|
+
u,
|
|
721
727
|
{
|
|
722
728
|
sx: {
|
|
723
729
|
px: 1.25,
|
|
@@ -727,143 +733,143 @@ function vr({
|
|
|
727
733
|
borderRadius: 1,
|
|
728
734
|
bgcolor: "background.paper"
|
|
729
735
|
},
|
|
730
|
-
children: /* @__PURE__ */
|
|
731
|
-
|
|
736
|
+
children: /* @__PURE__ */ e(
|
|
737
|
+
nt,
|
|
732
738
|
{
|
|
733
739
|
fullWidth: !0,
|
|
734
|
-
value:
|
|
740
|
+
value: i,
|
|
735
741
|
placeholder: s,
|
|
736
|
-
onChange: (
|
|
737
|
-
|
|
742
|
+
onChange: (o) => {
|
|
743
|
+
E(o.target.value), A(0);
|
|
738
744
|
},
|
|
739
|
-
onKeyDown: (
|
|
740
|
-
|
|
745
|
+
onKeyDown: (o) => {
|
|
746
|
+
o.key === "ArrowDown" && (o.preventDefault(), A((X) => Math.min(X + 1, U.length - 1))), o.key === "ArrowUp" && (o.preventDefault(), A((X) => Math.max(X - 1, 0))), o.key === "Enter" && U[b] && (o.preventDefault(), G(U[b]));
|
|
741
747
|
},
|
|
742
748
|
sx: { fontSize: 14 }
|
|
743
749
|
}
|
|
744
750
|
)
|
|
745
751
|
}
|
|
746
752
|
) : null,
|
|
747
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ e(ot, { disablePadding: !0, dense: m, sx: { overflow: "auto" }, children: n === "tree" ? N() : P() })
|
|
748
754
|
]
|
|
749
755
|
}
|
|
750
756
|
);
|
|
751
757
|
}
|
|
752
|
-
function
|
|
753
|
-
return Math.min(Math.max(
|
|
758
|
+
function Ne(t, n, a) {
|
|
759
|
+
return Math.min(Math.max(t, n), a);
|
|
754
760
|
}
|
|
755
|
-
function
|
|
756
|
-
if (!
|
|
761
|
+
function Pt(t) {
|
|
762
|
+
if (!t || typeof window > "u")
|
|
757
763
|
return null;
|
|
758
|
-
const n = window.localStorage.getItem(
|
|
759
|
-
return Number.isFinite(
|
|
764
|
+
const n = window.localStorage.getItem(t), a = n === null ? Number.NaN : Number(n);
|
|
765
|
+
return Number.isFinite(a) ? a : null;
|
|
760
766
|
}
|
|
761
|
-
function
|
|
762
|
-
first:
|
|
767
|
+
function jr({
|
|
768
|
+
first: t,
|
|
763
769
|
second: n,
|
|
764
|
-
orientation:
|
|
770
|
+
orientation: a = "horizontal",
|
|
765
771
|
initialSize: s = 50,
|
|
766
|
-
size:
|
|
767
|
-
defaultSize:
|
|
768
|
-
minSize:
|
|
769
|
-
maxSize:
|
|
770
|
-
dividerSize:
|
|
771
|
-
snapPoints:
|
|
772
|
-
snapThreshold:
|
|
773
|
-
resetSize:
|
|
774
|
-
collapsed:
|
|
775
|
-
defaultCollapsed:
|
|
776
|
-
collapsedSize:
|
|
777
|
-
persistKey:
|
|
778
|
-
keyboardStep:
|
|
779
|
-
onSizeChange:
|
|
780
|
-
onCollapsedChange:
|
|
781
|
-
onDraggingChange:
|
|
782
|
-
dividerLabel:
|
|
783
|
-
sx:
|
|
784
|
-
...
|
|
772
|
+
size: h,
|
|
773
|
+
defaultSize: c,
|
|
774
|
+
minSize: v = 20,
|
|
775
|
+
maxSize: m = 80,
|
|
776
|
+
dividerSize: d = 8,
|
|
777
|
+
snapPoints: k = [],
|
|
778
|
+
snapThreshold: w = 4,
|
|
779
|
+
resetSize: $ = c ?? s,
|
|
780
|
+
collapsed: g,
|
|
781
|
+
defaultCollapsed: B = null,
|
|
782
|
+
collapsedSize: z = 0,
|
|
783
|
+
persistKey: i,
|
|
784
|
+
keyboardStep: E = 5,
|
|
785
|
+
onSizeChange: b,
|
|
786
|
+
onCollapsedChange: A,
|
|
787
|
+
onDraggingChange: V,
|
|
788
|
+
dividerLabel: O = "Resize panels",
|
|
789
|
+
sx: M,
|
|
790
|
+
...R
|
|
785
791
|
}) {
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}, [
|
|
790
|
-
|
|
791
|
-
}, [
|
|
792
|
-
function q(
|
|
793
|
-
const
|
|
794
|
-
const xe = Math.abs(
|
|
795
|
-
return Math.abs(me -
|
|
796
|
-
},
|
|
797
|
-
|
|
792
|
+
const I = pe(null), [W, U] = S(() => Pt(i) ?? c ?? s), [G, p] = S(B), [L, y] = S(!1), P = a === "horizontal", o = Ne(h ?? W, v, m), X = g ?? G, ee = X === "first" ? z : X === "second" ? 100 - z : o, he = X === "first" && z <= 0, te = X === "second" && z <= 0;
|
|
793
|
+
ke(() => {
|
|
794
|
+
i && window.localStorage.setItem(i, String(o));
|
|
795
|
+
}, [i, o]), ke(() => {
|
|
796
|
+
V?.(L);
|
|
797
|
+
}, [L, V]);
|
|
798
|
+
function q(T) {
|
|
799
|
+
const le = k.reduce((oe, me) => {
|
|
800
|
+
const xe = Math.abs(oe - T);
|
|
801
|
+
return Math.abs(me - T) < xe ? me : oe;
|
|
802
|
+
}, T), ne = Math.abs(le - T) <= w, Q = Ne(ne ? le : T, v, m);
|
|
803
|
+
h === void 0 && U(Q), b?.(Q), se(null);
|
|
798
804
|
}
|
|
799
|
-
function
|
|
800
|
-
const
|
|
801
|
-
if (!
|
|
805
|
+
function ae(T, le) {
|
|
806
|
+
const ne = I.current;
|
|
807
|
+
if (!ne)
|
|
802
808
|
return;
|
|
803
|
-
const
|
|
804
|
-
q(
|
|
809
|
+
const Q = ne.getBoundingClientRect(), oe = P ? (T - Q.left) / Q.width * 100 : (le - Q.top) / Q.height * 100;
|
|
810
|
+
q(oe);
|
|
805
811
|
}
|
|
806
|
-
function
|
|
807
|
-
q(
|
|
812
|
+
function K(T) {
|
|
813
|
+
q(o + T);
|
|
808
814
|
}
|
|
809
|
-
function
|
|
810
|
-
q(
|
|
815
|
+
function re() {
|
|
816
|
+
q($);
|
|
811
817
|
}
|
|
812
|
-
function
|
|
813
|
-
|
|
818
|
+
function fe(T) {
|
|
819
|
+
se(X === T ? null : T);
|
|
814
820
|
}
|
|
815
|
-
function
|
|
816
|
-
|
|
821
|
+
function se(T) {
|
|
822
|
+
g === void 0 && p(T), A?.(T);
|
|
817
823
|
}
|
|
818
|
-
return /* @__PURE__ */
|
|
819
|
-
|
|
824
|
+
return /* @__PURE__ */ f(
|
|
825
|
+
u,
|
|
820
826
|
{
|
|
821
|
-
...
|
|
822
|
-
ref:
|
|
827
|
+
...R,
|
|
828
|
+
ref: I,
|
|
823
829
|
sx: [
|
|
824
830
|
{
|
|
825
831
|
display: "grid",
|
|
826
|
-
gridTemplateColumns:
|
|
827
|
-
gridTemplateRows:
|
|
832
|
+
gridTemplateColumns: P ? `${ee}% ${d}px 1fr` : "1fr",
|
|
833
|
+
gridTemplateRows: P ? "1fr" : `${ee}% ${d}px 1fr`,
|
|
828
834
|
minHeight: 280,
|
|
829
835
|
overflow: "hidden",
|
|
830
|
-
userSelect:
|
|
836
|
+
userSelect: L ? "none" : void 0
|
|
831
837
|
},
|
|
832
|
-
...Array.isArray(
|
|
838
|
+
...Array.isArray(M) ? M : M ? [M] : []
|
|
833
839
|
],
|
|
834
|
-
onPointerMove: (
|
|
835
|
-
|
|
840
|
+
onPointerMove: (T) => {
|
|
841
|
+
L && ae(T.clientX, T.clientY);
|
|
836
842
|
},
|
|
837
843
|
onPointerUp: () => {
|
|
838
|
-
|
|
844
|
+
y(!1);
|
|
839
845
|
},
|
|
840
|
-
onPointerCancel: () =>
|
|
846
|
+
onPointerCancel: () => y(!1),
|
|
841
847
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
|
|
848
|
+
/* @__PURE__ */ e(u, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: he ? "none" : void 0 }, children: t }),
|
|
849
|
+
/* @__PURE__ */ e(
|
|
850
|
+
u,
|
|
845
851
|
{
|
|
846
852
|
role: "separator",
|
|
847
|
-
"aria-label":
|
|
848
|
-
"aria-orientation":
|
|
849
|
-
"aria-valuemin":
|
|
850
|
-
"aria-valuemax":
|
|
851
|
-
"aria-valuenow": Math.round(
|
|
853
|
+
"aria-label": O,
|
|
854
|
+
"aria-orientation": P ? "vertical" : "horizontal",
|
|
855
|
+
"aria-valuemin": v,
|
|
856
|
+
"aria-valuemax": m,
|
|
857
|
+
"aria-valuenow": Math.round(o),
|
|
852
858
|
tabIndex: 0,
|
|
853
|
-
onPointerDown: (
|
|
854
|
-
|
|
859
|
+
onPointerDown: (T) => {
|
|
860
|
+
y(!0), T.currentTarget.setPointerCapture(T.pointerId), ae(T.clientX, T.clientY);
|
|
855
861
|
},
|
|
856
|
-
onPointerUp: (
|
|
857
|
-
|
|
862
|
+
onPointerUp: (T) => {
|
|
863
|
+
y(!1), T.currentTarget.releasePointerCapture(T.pointerId);
|
|
858
864
|
},
|
|
859
|
-
onDoubleClick:
|
|
860
|
-
onKeyDown: (
|
|
861
|
-
|
|
865
|
+
onDoubleClick: re,
|
|
866
|
+
onKeyDown: (T) => {
|
|
867
|
+
T.key === "Enter" && (re(), T.preventDefault()), T.key === "Home" && (fe("first"), T.preventDefault()), T.key === "End" && (fe("second"), T.preventDefault()), (T.key === "ArrowLeft" || T.key === "ArrowUp") && (K(-E), T.preventDefault()), (T.key === "ArrowRight" || T.key === "ArrowDown") && (K(E), T.preventDefault());
|
|
862
868
|
},
|
|
863
869
|
sx: {
|
|
864
870
|
position: "relative",
|
|
865
|
-
bgcolor:
|
|
866
|
-
cursor:
|
|
871
|
+
bgcolor: L ? "primary.main" : "divider",
|
|
872
|
+
cursor: P ? "col-resize" : "row-resize",
|
|
867
873
|
touchAction: "none",
|
|
868
874
|
transition: "background-color 120ms ease",
|
|
869
875
|
"&:hover": {
|
|
@@ -877,63 +883,63 @@ function $r({
|
|
|
877
883
|
"&::after": {
|
|
878
884
|
content: '""',
|
|
879
885
|
position: "absolute",
|
|
880
|
-
inset:
|
|
886
|
+
inset: P ? "30% -4px" : "-4px 30%",
|
|
881
887
|
borderRadius: 999,
|
|
882
|
-
bgcolor:
|
|
888
|
+
bgcolor: L ? "primary.contrastText" : "text.disabled",
|
|
883
889
|
opacity: 0.55
|
|
884
890
|
}
|
|
885
891
|
}
|
|
886
892
|
}
|
|
887
893
|
),
|
|
888
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ e(u, { sx: { minWidth: 0, minHeight: 0, overflow: "auto", display: te ? "none" : void 0 }, children: n })
|
|
889
895
|
]
|
|
890
896
|
}
|
|
891
897
|
);
|
|
892
898
|
}
|
|
893
|
-
function
|
|
894
|
-
return n ??
|
|
899
|
+
function Tt(t, n) {
|
|
900
|
+
return n ?? t?.getBoundingClientRect() ?? null;
|
|
895
901
|
}
|
|
896
|
-
function
|
|
897
|
-
open:
|
|
902
|
+
function Vr({
|
|
903
|
+
open: t,
|
|
898
904
|
children: n,
|
|
899
|
-
anchorEl:
|
|
905
|
+
anchorEl: a,
|
|
900
906
|
anchorRect: s,
|
|
901
|
-
containerRef:
|
|
902
|
-
placement:
|
|
903
|
-
offset:
|
|
904
|
-
boundaryPadding:
|
|
905
|
-
autoUpdate:
|
|
906
|
-
arrow:
|
|
907
|
-
sx:
|
|
908
|
-
|
|
907
|
+
containerRef: h,
|
|
908
|
+
placement: c = "top",
|
|
909
|
+
offset: v = 8,
|
|
910
|
+
boundaryPadding: m = 8,
|
|
911
|
+
autoUpdate: d = !0,
|
|
912
|
+
arrow: k = !0,
|
|
913
|
+
sx: w,
|
|
914
|
+
...$
|
|
909
915
|
}) {
|
|
910
|
-
const
|
|
911
|
-
if (!
|
|
916
|
+
const g = pe(null), [B, z] = S({ left: -9999, top: -9999 }), i = tt(() => {
|
|
917
|
+
if (!t)
|
|
912
918
|
return;
|
|
913
|
-
const
|
|
914
|
-
if (!
|
|
919
|
+
const E = Tt(a, s), b = g.current;
|
|
920
|
+
if (!E || !b)
|
|
915
921
|
return;
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
}, [
|
|
919
|
-
return
|
|
920
|
-
|
|
921
|
-
}, [
|
|
922
|
-
if (!(!
|
|
923
|
-
return window.addEventListener("resize",
|
|
924
|
-
window.removeEventListener("resize",
|
|
922
|
+
const A = h?.current?.getBoundingClientRect(), V = A?.left ?? 0, O = A?.top ?? 0, M = A?.width ?? window.innerWidth, R = A?.height ?? window.innerHeight, I = b.offsetWidth / 2, W = b.offsetHeight, U = E.left - V + E.width / 2, G = c === "top" ? E.top - O - v : E.bottom - O + v, p = Math.min(Math.max(U, I + m), M - I - m), L = c === "top" ? Math.max(G, W + m) : Math.min(G, R - W - m);
|
|
923
|
+
z({ left: p, top: L });
|
|
924
|
+
}, [a, s, m, h, v, t, c]);
|
|
925
|
+
return Ze(() => {
|
|
926
|
+
i();
|
|
927
|
+
}, [i]), ke(() => {
|
|
928
|
+
if (!(!t || !d))
|
|
929
|
+
return window.addEventListener("resize", i), window.addEventListener("scroll", i, !0), () => {
|
|
930
|
+
window.removeEventListener("resize", i), window.removeEventListener("scroll", i, !0);
|
|
925
931
|
};
|
|
926
|
-
}, [
|
|
927
|
-
|
|
932
|
+
}, [d, t, i]), t ? /* @__PURE__ */ e(
|
|
933
|
+
u,
|
|
928
934
|
{
|
|
929
|
-
|
|
930
|
-
ref:
|
|
935
|
+
...$,
|
|
936
|
+
ref: g,
|
|
931
937
|
role: "toolbar",
|
|
932
938
|
sx: [
|
|
933
939
|
{
|
|
934
|
-
position:
|
|
935
|
-
left:
|
|
936
|
-
top:
|
|
940
|
+
position: h ? "absolute" : "fixed",
|
|
941
|
+
left: B.left,
|
|
942
|
+
top: B.top,
|
|
937
943
|
zIndex: 1300,
|
|
938
944
|
display: "inline-flex",
|
|
939
945
|
alignItems: "center",
|
|
@@ -943,9 +949,9 @@ function kr({
|
|
|
943
949
|
bgcolor: "rgba(15,23,42,0.96)",
|
|
944
950
|
color: "#e5e7eb",
|
|
945
951
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.34)",
|
|
946
|
-
transform:
|
|
952
|
+
transform: c === "top" ? "translate(-50%, -100%)" : "translate(-50%, 0)",
|
|
947
953
|
backdropFilter: "blur(12px)",
|
|
948
|
-
"&::after":
|
|
954
|
+
"&::after": k ? {
|
|
949
955
|
content: '""',
|
|
950
956
|
position: "absolute",
|
|
951
957
|
left: "50%",
|
|
@@ -953,27 +959,27 @@ function kr({
|
|
|
953
959
|
height: 10,
|
|
954
960
|
bgcolor: "rgba(15,23,42,0.96)",
|
|
955
961
|
transform: "translateX(-50%) rotate(45deg)",
|
|
956
|
-
bottom:
|
|
957
|
-
top:
|
|
962
|
+
bottom: c === "top" ? -5 : void 0,
|
|
963
|
+
top: c === "bottom" ? -5 : void 0
|
|
958
964
|
} : void 0
|
|
959
965
|
},
|
|
960
|
-
...Array.isArray(
|
|
966
|
+
...Array.isArray(w) ? w : w ? [w] : []
|
|
961
967
|
],
|
|
962
968
|
children: n
|
|
963
969
|
}
|
|
964
970
|
) : null;
|
|
965
971
|
}
|
|
966
|
-
function
|
|
967
|
-
strength:
|
|
972
|
+
function Gr({
|
|
973
|
+
strength: t = 18,
|
|
968
974
|
tilt: n = 10,
|
|
969
|
-
lift:
|
|
975
|
+
lift: a = 10,
|
|
970
976
|
glare: s = !0,
|
|
971
|
-
perspective:
|
|
972
|
-
sx:
|
|
973
|
-
children:
|
|
974
|
-
...
|
|
977
|
+
perspective: h = 900,
|
|
978
|
+
sx: c,
|
|
979
|
+
children: v,
|
|
980
|
+
...m
|
|
975
981
|
}) {
|
|
976
|
-
const [
|
|
982
|
+
const [d, k] = S({
|
|
977
983
|
x: 0,
|
|
978
984
|
y: 0,
|
|
979
985
|
rotateX: 0,
|
|
@@ -982,23 +988,23 @@ function Cr({
|
|
|
982
988
|
glareY: 50,
|
|
983
989
|
active: !1
|
|
984
990
|
});
|
|
985
|
-
return /* @__PURE__ */
|
|
986
|
-
|
|
991
|
+
return /* @__PURE__ */ e(
|
|
992
|
+
u,
|
|
987
993
|
{
|
|
988
|
-
...
|
|
989
|
-
onMouseMove: (
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
x:
|
|
993
|
-
y:
|
|
994
|
-
rotateX: (0.5 -
|
|
995
|
-
rotateY: (
|
|
996
|
-
glareX:
|
|
997
|
-
glareY:
|
|
994
|
+
...m,
|
|
995
|
+
onMouseMove: (w) => {
|
|
996
|
+
const $ = w.currentTarget.getBoundingClientRect(), g = (w.clientX - $.left) / $.width, B = (w.clientY - $.top) / $.height, z = (g - 0.5) * t, i = (B - 0.5) * t;
|
|
997
|
+
k({
|
|
998
|
+
x: z,
|
|
999
|
+
y: i,
|
|
1000
|
+
rotateX: (0.5 - B) * n,
|
|
1001
|
+
rotateY: (g - 0.5) * n,
|
|
1002
|
+
glareX: g * 100,
|
|
1003
|
+
glareY: B * 100,
|
|
998
1004
|
active: !0
|
|
999
1005
|
});
|
|
1000
1006
|
},
|
|
1001
|
-
onMouseLeave: () =>
|
|
1007
|
+
onMouseLeave: () => k({
|
|
1002
1008
|
x: 0,
|
|
1003
1009
|
y: 0,
|
|
1004
1010
|
rotateX: 0,
|
|
@@ -1012,49 +1018,49 @@ function Cr({
|
|
|
1012
1018
|
position: "relative",
|
|
1013
1019
|
overflow: "hidden",
|
|
1014
1020
|
transform: `
|
|
1015
|
-
perspective(${
|
|
1016
|
-
translate3d(${
|
|
1017
|
-
rotateX(${
|
|
1018
|
-
rotateY(${
|
|
1021
|
+
perspective(${h}px)
|
|
1022
|
+
translate3d(${d.x}px, ${d.y}px, ${d.active ? -a : 0}px)
|
|
1023
|
+
rotateX(${d.rotateX}deg)
|
|
1024
|
+
rotateY(${d.rotateY}deg)
|
|
1019
1025
|
`,
|
|
1020
1026
|
transformStyle: "preserve-3d",
|
|
1021
|
-
transition:
|
|
1027
|
+
transition: d.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",
|
|
1022
1028
|
willChange: "transform",
|
|
1023
|
-
boxShadow:
|
|
1029
|
+
boxShadow: d.active ? "0 28px 70px rgba(15, 23, 42, 0.24)" : "0 14px 34px rgba(15, 23, 42, 0.12)",
|
|
1024
1030
|
"&::before": s ? {
|
|
1025
1031
|
content: '""',
|
|
1026
1032
|
position: "absolute",
|
|
1027
1033
|
inset: 0,
|
|
1028
1034
|
pointerEvents: "none",
|
|
1029
|
-
opacity:
|
|
1035
|
+
opacity: d.active ? 0.78 : 0,
|
|
1030
1036
|
transition: "opacity 160ms ease",
|
|
1031
|
-
background: `radial-gradient(circle at ${
|
|
1037
|
+
background: `radial-gradient(circle at ${d.glareX}% ${d.glareY}%, rgba(255,255,255,0.55), rgba(255,255,255,0.16) 22%, transparent 48%)`,
|
|
1032
1038
|
mixBlendMode: "screen"
|
|
1033
1039
|
} : void 0,
|
|
1034
1040
|
"& > *": {
|
|
1035
1041
|
position: "relative",
|
|
1036
1042
|
zIndex: 1,
|
|
1037
|
-
transform:
|
|
1043
|
+
transform: d.active ? "translateZ(24px)" : "translateZ(0)",
|
|
1038
1044
|
transition: "transform 180ms ease"
|
|
1039
1045
|
}
|
|
1040
1046
|
},
|
|
1041
|
-
...Array.isArray(
|
|
1047
|
+
...Array.isArray(c) ? c : c ? [c] : []
|
|
1042
1048
|
],
|
|
1043
|
-
children:
|
|
1049
|
+
children: v
|
|
1044
1050
|
}
|
|
1045
1051
|
);
|
|
1046
1052
|
}
|
|
1047
|
-
function
|
|
1048
|
-
const [
|
|
1049
|
-
return /* @__PURE__ */
|
|
1050
|
-
|
|
1053
|
+
function Ur({ radius: t = 160, dim: n = 0.72, sx: a, children: s, ...h }) {
|
|
1054
|
+
const [c, v] = S({ x: 50, y: 50 });
|
|
1055
|
+
return /* @__PURE__ */ e(
|
|
1056
|
+
u,
|
|
1051
1057
|
{
|
|
1052
|
-
...
|
|
1053
|
-
onMouseMove: (
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
x: (
|
|
1057
|
-
y: (
|
|
1058
|
+
...h,
|
|
1059
|
+
onMouseMove: (m) => {
|
|
1060
|
+
const d = m.currentTarget.getBoundingClientRect();
|
|
1061
|
+
v({
|
|
1062
|
+
x: (m.clientX - d.left) / d.width * 100,
|
|
1063
|
+
y: (m.clientY - d.top) / d.height * 100
|
|
1058
1064
|
});
|
|
1059
1065
|
},
|
|
1060
1066
|
sx: [
|
|
@@ -1066,193 +1072,193 @@ function Ir({ radius: e = 160, dim: n = 0.72, sx: l, children: s, ...f }) {
|
|
|
1066
1072
|
position: "absolute",
|
|
1067
1073
|
inset: 0,
|
|
1068
1074
|
pointerEvents: "none",
|
|
1069
|
-
background: `radial-gradient(circle ${
|
|
1075
|
+
background: `radial-gradient(circle ${t}px at ${c.x}% ${c.y}%, transparent 0, transparent 45%, rgba(0,0,0,${n}) 100%)`
|
|
1070
1076
|
}
|
|
1071
1077
|
},
|
|
1072
|
-
...Array.isArray(
|
|
1078
|
+
...Array.isArray(a) ? a : a ? [a] : []
|
|
1073
1079
|
],
|
|
1074
1080
|
children: s
|
|
1075
1081
|
}
|
|
1076
1082
|
);
|
|
1077
1083
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return Math.round(
|
|
1084
|
+
function Oe(t, n) {
|
|
1085
|
+
return Math.round(t / n) * n;
|
|
1080
1086
|
}
|
|
1081
|
-
function
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
const
|
|
1085
|
-
return `M ${
|
|
1087
|
+
function Lt(t, n, a, s, h) {
|
|
1088
|
+
const c = t.x + a / 2, v = t.y + s / 2, m = n.x + a / 2, d = n.y + s / 2, k = (c + m) / 2;
|
|
1089
|
+
if (h === "ellipse") {
|
|
1090
|
+
const w = Math.max(Math.abs(m - c) / 2, 24), $ = Math.max(Math.abs(d - v) / 2, 24);
|
|
1091
|
+
return `M ${c} ${v} A ${w} ${$} 0 0 1 ${m} ${d}`;
|
|
1086
1092
|
}
|
|
1087
|
-
return
|
|
1093
|
+
return h === "curved" ? `M ${c} ${v} C ${k} ${v}, ${k} ${d}, ${m} ${d}` : h === "step" ? `M ${c} ${v} L ${k} ${v} L ${k} ${d} L ${m} ${d}` : `M ${c} ${v} L ${m} ${d}`;
|
|
1088
1094
|
}
|
|
1089
|
-
function
|
|
1090
|
-
nodes:
|
|
1095
|
+
function qr({
|
|
1096
|
+
nodes: t,
|
|
1091
1097
|
connections: n = [],
|
|
1092
|
-
nodeWidth:
|
|
1098
|
+
nodeWidth: a = 132,
|
|
1093
1099
|
nodeHeight: s = 52,
|
|
1094
|
-
mode:
|
|
1095
|
-
snapToGrid:
|
|
1096
|
-
gridSize:
|
|
1097
|
-
showGrid:
|
|
1098
|
-
selectedNodeId:
|
|
1099
|
-
connectionStyle:
|
|
1100
|
-
editableTools:
|
|
1101
|
-
linkTypes:
|
|
1102
|
-
renderNode:
|
|
1103
|
-
onNodesChange:
|
|
1104
|
-
onConnectionsChange:
|
|
1105
|
-
onNodeMove:
|
|
1106
|
-
onNodeSelect:
|
|
1107
|
-
sx:
|
|
1108
|
-
...
|
|
1100
|
+
mode: h = "edit",
|
|
1101
|
+
snapToGrid: c = !1,
|
|
1102
|
+
gridSize: v = 24,
|
|
1103
|
+
showGrid: m = !1,
|
|
1104
|
+
selectedNodeId: d,
|
|
1105
|
+
connectionStyle: k = "line",
|
|
1106
|
+
editableTools: w = !1,
|
|
1107
|
+
linkTypes: $ = ["line", "curved", "step", "ellipse"],
|
|
1108
|
+
renderNode: g,
|
|
1109
|
+
onNodesChange: B,
|
|
1110
|
+
onConnectionsChange: z,
|
|
1111
|
+
onNodeMove: i,
|
|
1112
|
+
onNodeSelect: E,
|
|
1113
|
+
sx: b,
|
|
1114
|
+
...A
|
|
1109
1115
|
}) {
|
|
1110
|
-
const [
|
|
1111
|
-
Object.fromEntries(
|
|
1112
|
-
), [
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
...Object.fromEntries(
|
|
1116
|
+
const [V, O] = S(t), [M, R] = S(n), I = w ? V : t, W = w ? M : n, [U, G] = S(
|
|
1117
|
+
Object.fromEntries(I.map((r) => [r.id, { x: r.x, y: r.y }]))
|
|
1118
|
+
), [p, L] = S(d ?? null), [y, P] = S(!1), [N, o] = S(""), [X, ee] = S($[0] ?? "line"), [he, te] = S(""), [q, ae] = S(null), K = d ?? p, re = I.find((r) => r.id === K) ?? null, fe = W.map((r, C) => ({ connection: r, index: C })).filter(({ connection: r }) => r.from === K || r.to === K), se = t.map((r) => `${r.id}:${r.label}:${r.x}:${r.y}:${r.color ?? ""}`).join("|"), T = n.map((r) => `${r.from}:${r.to}:${r.type ?? ""}:${r.label ?? ""}:${r.color ?? ""}`).join("|");
|
|
1119
|
+
ke(() => {
|
|
1120
|
+
w || O(t), G((r) => ({
|
|
1121
|
+
...Object.fromEntries(t.map((C) => [C.id, r[C.id] ?? { x: C.x, y: C.y }]))
|
|
1116
1122
|
}));
|
|
1117
|
-
}, [
|
|
1118
|
-
|
|
1119
|
-
}, [
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1123
|
+
}, [w, se]), ke(() => {
|
|
1124
|
+
w || R(n);
|
|
1125
|
+
}, [T, w]);
|
|
1126
|
+
function le(r) {
|
|
1127
|
+
O(r), B?.(r);
|
|
1122
1128
|
}
|
|
1123
|
-
function
|
|
1124
|
-
|
|
1129
|
+
function ne(r) {
|
|
1130
|
+
R(r), z?.(r);
|
|
1125
1131
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
...
|
|
1130
|
-
[r]:
|
|
1131
|
-
})),
|
|
1132
|
+
function Q(r, C) {
|
|
1133
|
+
const F = c ? { x: Oe(C.x, v), y: Oe(C.y, v) } : C;
|
|
1134
|
+
G((D) => ({
|
|
1135
|
+
...D,
|
|
1136
|
+
[r]: F
|
|
1137
|
+
})), w && le(I.map((D) => D.id === r ? { ...D, ...F } : D)), i?.(r, F);
|
|
1132
1138
|
}
|
|
1133
|
-
function
|
|
1134
|
-
const r =
|
|
1139
|
+
function oe() {
|
|
1140
|
+
const r = I.length + 1, C = {
|
|
1135
1141
|
id: `node-${Date.now()}`,
|
|
1136
1142
|
label: `Box ${r}`,
|
|
1137
1143
|
x: 48 + r * 18,
|
|
1138
1144
|
y: 48 + r * 18,
|
|
1139
1145
|
color: "#ffffff"
|
|
1140
1146
|
};
|
|
1141
|
-
|
|
1142
|
-
...
|
|
1143
|
-
[
|
|
1144
|
-
})),
|
|
1147
|
+
le([...I, C]), G((F) => ({
|
|
1148
|
+
...F,
|
|
1149
|
+
[C.id]: { x: C.x, y: C.y }
|
|
1150
|
+
})), L(C.id);
|
|
1145
1151
|
}
|
|
1146
1152
|
function me() {
|
|
1147
|
-
|
|
1153
|
+
K && (le(I.filter((r) => r.id !== K)), ne(W.filter((r) => r.from !== K && r.to !== K)), L(null), P(!1));
|
|
1148
1154
|
}
|
|
1149
1155
|
function xe(r) {
|
|
1150
|
-
|
|
1156
|
+
K && le(I.map((C) => C.id === K ? { ...C, ...r } : C));
|
|
1151
1157
|
}
|
|
1152
|
-
function
|
|
1153
|
-
if (!
|
|
1158
|
+
function Ie() {
|
|
1159
|
+
if (!K || !N || K === N)
|
|
1154
1160
|
return;
|
|
1155
1161
|
const r = {
|
|
1156
|
-
from:
|
|
1157
|
-
to:
|
|
1158
|
-
type:
|
|
1159
|
-
label:
|
|
1160
|
-
color:
|
|
1161
|
-
},
|
|
1162
|
-
...
|
|
1162
|
+
from: K,
|
|
1163
|
+
to: N,
|
|
1164
|
+
type: X,
|
|
1165
|
+
label: he,
|
|
1166
|
+
color: X === "ellipse" ? "#db2777" : X === "step" ? "#059669" : "#2563eb"
|
|
1167
|
+
}, C = [
|
|
1168
|
+
...W.filter((F) => !(F.from === K && F.to === N)),
|
|
1163
1169
|
r
|
|
1164
1170
|
];
|
|
1165
|
-
|
|
1171
|
+
ne(C), o(""), te(""), ae(C.indexOf(r));
|
|
1166
1172
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1169
|
-
if (!
|
|
1173
|
+
function l(r, C) {
|
|
1174
|
+
const F = W[r];
|
|
1175
|
+
if (!F)
|
|
1170
1176
|
return;
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1177
|
+
const D = { ...F, ...C }, J = W.map((Z, ge) => ge === r ? D : Z).filter((Z, ge) => ge === r || Z.from !== D.from || Z.to !== D.to);
|
|
1178
|
+
ne(J);
|
|
1173
1179
|
}
|
|
1174
|
-
function
|
|
1175
|
-
|
|
1180
|
+
function x(r) {
|
|
1181
|
+
ne(W.filter((C, F) => F !== r)), ae(null);
|
|
1176
1182
|
}
|
|
1177
|
-
return /* @__PURE__ */
|
|
1178
|
-
|
|
1183
|
+
return /* @__PURE__ */ f(
|
|
1184
|
+
u,
|
|
1179
1185
|
{
|
|
1180
|
-
...
|
|
1186
|
+
...A,
|
|
1181
1187
|
sx: [
|
|
1182
1188
|
{
|
|
1183
1189
|
position: "relative",
|
|
1184
1190
|
minHeight: 360,
|
|
1185
1191
|
overflow: "hidden",
|
|
1186
1192
|
bgcolor: "#f8fafc",
|
|
1187
|
-
backgroundImage:
|
|
1188
|
-
backgroundSize:
|
|
1193
|
+
backgroundImage: m ? "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,
|
|
1194
|
+
backgroundSize: m ? `${v}px ${v}px` : void 0
|
|
1189
1195
|
},
|
|
1190
|
-
...Array.isArray(
|
|
1196
|
+
...Array.isArray(b) ? b : b ? [b] : []
|
|
1191
1197
|
],
|
|
1192
1198
|
children: [
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
const
|
|
1195
|
-
if (!
|
|
1199
|
+
/* @__PURE__ */ e(u, { component: "svg", sx: { position: "absolute", inset: 0, width: "100%", height: "100%" }, children: W.map((r) => {
|
|
1200
|
+
const C = U[r.from], F = U[r.to];
|
|
1201
|
+
if (!C || !F)
|
|
1196
1202
|
return null;
|
|
1197
|
-
const
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
r.label ? /* @__PURE__ */
|
|
1203
|
+
const D = Lt(C, F, a, s, r.type ?? k), J = (C.x + F.x + a) / 2, Z = (C.y + F.y + s) / 2;
|
|
1204
|
+
return /* @__PURE__ */ f("g", { children: [
|
|
1205
|
+
/* @__PURE__ */ e("path", { d: D, fill: "none", stroke: r.color ?? "#94a3b8", strokeWidth: "2.5" }),
|
|
1206
|
+
r.label ? /* @__PURE__ */ e("text", { x: J, y: Z - 8, textAnchor: "middle", fill: r.color ?? "#64748b", fontSize: "11", fontWeight: "700", children: r.label }) : null
|
|
1201
1207
|
] }, `${r.from}-${r.to}-${r.type ?? r.label ?? "link"}`);
|
|
1202
1208
|
}) }),
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
return /* @__PURE__ */
|
|
1206
|
-
|
|
1209
|
+
I.map((r) => {
|
|
1210
|
+
const C = U[r.id], F = r.id === K;
|
|
1211
|
+
return /* @__PURE__ */ e(
|
|
1212
|
+
u,
|
|
1207
1213
|
{
|
|
1208
1214
|
role: "button",
|
|
1209
1215
|
tabIndex: 0,
|
|
1210
1216
|
sx: {
|
|
1211
1217
|
position: "absolute",
|
|
1212
|
-
left:
|
|
1213
|
-
top:
|
|
1214
|
-
width:
|
|
1218
|
+
left: C.x,
|
|
1219
|
+
top: C.y,
|
|
1220
|
+
width: a,
|
|
1215
1221
|
height: s,
|
|
1216
1222
|
display: "grid",
|
|
1217
1223
|
placeItems: "center",
|
|
1218
|
-
border:
|
|
1219
|
-
borderColor:
|
|
1224
|
+
border: F ? 2 : 1,
|
|
1225
|
+
borderColor: F ? "primary.main" : "divider",
|
|
1220
1226
|
borderRadius: 1,
|
|
1221
1227
|
bgcolor: r.color ?? "background.paper",
|
|
1222
|
-
cursor:
|
|
1228
|
+
cursor: h === "edit" ? "grab" : "pointer",
|
|
1223
1229
|
userSelect: "none",
|
|
1224
|
-
boxShadow:
|
|
1230
|
+
boxShadow: F ? "0 18px 34px rgba(37,99,235,0.22)" : "0 12px 28px rgba(15,23,42,0.12)",
|
|
1225
1231
|
touchAction: "none"
|
|
1226
1232
|
},
|
|
1227
|
-
onPointerDown: (
|
|
1228
|
-
if (
|
|
1233
|
+
onPointerDown: (D) => {
|
|
1234
|
+
if (L(r.id), ae(null), w && P(!0), E?.(r), h === "readonly")
|
|
1229
1235
|
return;
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
function
|
|
1233
|
-
|
|
1234
|
-
x:
|
|
1235
|
-
y:
|
|
1236
|
+
const J = D.clientX, Z = D.clientY, ge = U[r.id];
|
|
1237
|
+
D.currentTarget.setPointerCapture(D.pointerId);
|
|
1238
|
+
function ye(Te) {
|
|
1239
|
+
Q(r.id, {
|
|
1240
|
+
x: ge.x + Te.clientX - J,
|
|
1241
|
+
y: ge.y + Te.clientY - Z
|
|
1236
1242
|
});
|
|
1237
1243
|
}
|
|
1238
|
-
function
|
|
1239
|
-
window.removeEventListener("pointermove",
|
|
1244
|
+
function Pe() {
|
|
1245
|
+
window.removeEventListener("pointermove", ye), window.removeEventListener("pointerup", Pe);
|
|
1240
1246
|
}
|
|
1241
|
-
window.addEventListener("pointermove",
|
|
1247
|
+
window.addEventListener("pointermove", ye), window.addEventListener("pointerup", Pe);
|
|
1242
1248
|
},
|
|
1243
|
-
onKeyDown: (
|
|
1244
|
-
if (
|
|
1249
|
+
onKeyDown: (D) => {
|
|
1250
|
+
if (h === "readonly")
|
|
1245
1251
|
return;
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1252
|
+
const J = c ? v : 8, Z = U[r.id];
|
|
1253
|
+
D.key === "ArrowLeft" && (Q(r.id, { x: Z.x - J, y: Z.y }), D.preventDefault()), D.key === "ArrowRight" && (Q(r.id, { x: Z.x + J, y: Z.y }), D.preventDefault()), D.key === "ArrowUp" && (Q(r.id, { x: Z.x, y: Z.y - J }), D.preventDefault()), D.key === "ArrowDown" && (Q(r.id, { x: Z.x, y: Z.y + J }), D.preventDefault());
|
|
1248
1254
|
},
|
|
1249
|
-
children:
|
|
1255
|
+
children: g ? g(r, F) : /* @__PURE__ */ e(Y, { fontWeight: 800, children: r.label })
|
|
1250
1256
|
},
|
|
1251
1257
|
r.id
|
|
1252
1258
|
);
|
|
1253
1259
|
}),
|
|
1254
|
-
|
|
1255
|
-
|
|
1260
|
+
w && re && y ? /* @__PURE__ */ e(
|
|
1261
|
+
u,
|
|
1256
1262
|
{
|
|
1257
1263
|
sx: {
|
|
1258
1264
|
position: "absolute",
|
|
@@ -1269,71 +1275,71 @@ function Mr({
|
|
|
1269
1275
|
bgcolor: "background.paper",
|
|
1270
1276
|
boxShadow: "0 20px 48px rgba(15,23,42,0.22)"
|
|
1271
1277
|
},
|
|
1272
|
-
children: /* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
/* @__PURE__ */
|
|
1275
|
-
/* @__PURE__ */
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
+
children: /* @__PURE__ */ f(H, { spacing: 1.25, sx: { p: 1.5 }, children: [
|
|
1279
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 0.75, alignItems: "center", children: [
|
|
1280
|
+
/* @__PURE__ */ e(Y, { variant: "subtitle2", fontWeight: 900, sx: { flex: 1 }, children: "Box editor" }),
|
|
1281
|
+
/* @__PURE__ */ e(ce, { title: "Add box", children: /* @__PURE__ */ e(ue, { size: "small", color: "primary", onClick: oe, children: /* @__PURE__ */ e(at, { fontSize: "small" }) }) }),
|
|
1282
|
+
/* @__PURE__ */ e(ce, { title: "Remove box", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(ue, { size: "small", color: "error", onClick: me, disabled: !re, children: /* @__PURE__ */ e(_e, { fontSize: "small" }) }) }) }),
|
|
1283
|
+
/* @__PURE__ */ e(ce, { title: "Close editor", children: /* @__PURE__ */ e(ue, { size: "small", onClick: () => P(!1), children: /* @__PURE__ */ e(st, { fontSize: "small" }) }) })
|
|
1278
1284
|
] }),
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ f(u, { sx: { display: "grid", gridTemplateColumns: "1fr 96px", gap: 1 }, children: [
|
|
1286
|
+
/* @__PURE__ */ e(
|
|
1281
1287
|
_,
|
|
1282
1288
|
{
|
|
1283
1289
|
size: "small",
|
|
1284
1290
|
label: "Label",
|
|
1285
|
-
value:
|
|
1286
|
-
disabled: !
|
|
1291
|
+
value: re?.label ?? "",
|
|
1292
|
+
disabled: !re,
|
|
1287
1293
|
onChange: (r) => xe({ label: r.target.value })
|
|
1288
1294
|
}
|
|
1289
1295
|
),
|
|
1290
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ e(
|
|
1291
1297
|
_,
|
|
1292
1298
|
{
|
|
1293
1299
|
size: "small",
|
|
1294
1300
|
label: "Color",
|
|
1295
1301
|
type: "color",
|
|
1296
|
-
value:
|
|
1297
|
-
disabled: !
|
|
1302
|
+
value: re?.color ?? "#ffffff",
|
|
1303
|
+
disabled: !re,
|
|
1298
1304
|
onChange: (r) => xe({ color: r.target.value })
|
|
1299
1305
|
}
|
|
1300
1306
|
)
|
|
1301
1307
|
] }),
|
|
1302
|
-
/* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ f(u, { sx: { display: "grid", gridTemplateColumns: "1fr", gap: 1.25 }, children: [
|
|
1309
|
+
/* @__PURE__ */ f(H, { spacing: 1, children: [
|
|
1310
|
+
/* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Links" }),
|
|
1311
|
+
/* @__PURE__ */ f(u, { sx: { display: "grid", gridTemplateColumns: "1fr 32px", gap: 0.5, alignItems: "center" }, children: [
|
|
1312
|
+
/* @__PURE__ */ f(
|
|
1307
1313
|
_,
|
|
1308
1314
|
{
|
|
1309
1315
|
select: !0,
|
|
1310
1316
|
size: "small",
|
|
1311
1317
|
label: "To",
|
|
1312
|
-
value:
|
|
1313
|
-
disabled: !
|
|
1314
|
-
onChange: (r) =>
|
|
1318
|
+
value: N,
|
|
1319
|
+
disabled: !re,
|
|
1320
|
+
onChange: (r) => o(r.target.value),
|
|
1315
1321
|
children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
|
|
1322
|
+
/* @__PURE__ */ e(be, { value: "", children: "Pick target" }),
|
|
1323
|
+
I.filter((r) => r.id !== K).map((r) => /* @__PURE__ */ e(be, { value: r.id, children: r.label }, r.id))
|
|
1318
1324
|
]
|
|
1319
1325
|
}
|
|
1320
1326
|
),
|
|
1321
|
-
/* @__PURE__ */
|
|
1327
|
+
/* @__PURE__ */ e(ce, { title: `Add link from ${re?.label ?? "box"}`, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
|
|
1322
1328
|
ue,
|
|
1323
1329
|
{
|
|
1324
1330
|
size: "small",
|
|
1325
1331
|
color: "primary",
|
|
1326
|
-
disabled: !
|
|
1327
|
-
onClick:
|
|
1332
|
+
disabled: !re || !N,
|
|
1333
|
+
onClick: Ie,
|
|
1328
1334
|
sx: { width: 32, height: 32, border: 1, borderColor: "divider", borderRadius: 1 },
|
|
1329
|
-
children: /* @__PURE__ */
|
|
1335
|
+
children: /* @__PURE__ */ e(lt, { fontSize: "small" })
|
|
1330
1336
|
}
|
|
1331
1337
|
) }) })
|
|
1332
1338
|
] }),
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
return /* @__PURE__ */
|
|
1336
|
-
|
|
1339
|
+
fe.length ? fe.map(({ connection: r, index: C }) => {
|
|
1340
|
+
const F = I.find((Z) => Z.id === r.from), D = I.find((Z) => Z.id === r.to), J = q === C;
|
|
1341
|
+
return /* @__PURE__ */ f(
|
|
1342
|
+
u,
|
|
1337
1343
|
{
|
|
1338
1344
|
sx: {
|
|
1339
1345
|
width: "100%",
|
|
@@ -1343,82 +1349,82 @@ function Mr({
|
|
|
1343
1349
|
alignItems: "center"
|
|
1344
1350
|
},
|
|
1345
1351
|
children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
|
|
1352
|
+
/* @__PURE__ */ e(
|
|
1353
|
+
u,
|
|
1348
1354
|
{
|
|
1349
1355
|
component: "button",
|
|
1350
|
-
onClick: () =>
|
|
1356
|
+
onClick: () => ae(C),
|
|
1351
1357
|
sx: {
|
|
1352
1358
|
px: 1,
|
|
1353
1359
|
py: 0.75,
|
|
1354
1360
|
minWidth: 0,
|
|
1355
1361
|
border: 1,
|
|
1356
|
-
borderColor:
|
|
1362
|
+
borderColor: J ? "primary.main" : "divider",
|
|
1357
1363
|
borderRadius: 1,
|
|
1358
|
-
bgcolor:
|
|
1359
|
-
color:
|
|
1364
|
+
bgcolor: J ? "primary.main" : "background.paper",
|
|
1365
|
+
color: J ? "primary.contrastText" : "text.primary",
|
|
1360
1366
|
cursor: "pointer",
|
|
1361
1367
|
font: "inherit",
|
|
1362
1368
|
textAlign: "left"
|
|
1363
1369
|
},
|
|
1364
|
-
children: (
|
|
1370
|
+
children: (F?.label ?? r.from) + " -> " + (D?.label ?? r.to)
|
|
1365
1371
|
}
|
|
1366
1372
|
),
|
|
1367
|
-
/* @__PURE__ */
|
|
1373
|
+
/* @__PURE__ */ e(ce, { title: "Remove link", children: /* @__PURE__ */ e(ue, { size: "small", color: "error", onClick: () => x(C), sx: { width: 32, height: 32 }, children: /* @__PURE__ */ e(ct, { fontSize: "small" }) }) })
|
|
1368
1374
|
]
|
|
1369
1375
|
},
|
|
1370
|
-
`${r.from}-${r.to}-${
|
|
1376
|
+
`${r.from}-${r.to}-${C}`
|
|
1371
1377
|
);
|
|
1372
|
-
}) : /* @__PURE__ */
|
|
1378
|
+
}) : /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", children: "No linked boxes." })
|
|
1373
1379
|
] }),
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1376
|
-
q !== null &&
|
|
1377
|
-
/* @__PURE__ */
|
|
1380
|
+
/* @__PURE__ */ f(H, { spacing: 1, children: [
|
|
1381
|
+
/* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 900, color: "text.secondary", children: "Link details" }),
|
|
1382
|
+
q !== null && W[q] ? /* @__PURE__ */ f(qe, { children: [
|
|
1383
|
+
/* @__PURE__ */ e(
|
|
1378
1384
|
_,
|
|
1379
1385
|
{
|
|
1380
1386
|
select: !0,
|
|
1381
1387
|
size: "small",
|
|
1382
1388
|
label: "From",
|
|
1383
|
-
value:
|
|
1384
|
-
onChange: (r) =>
|
|
1385
|
-
children:
|
|
1389
|
+
value: W[q].from,
|
|
1390
|
+
onChange: (r) => l(q, { from: r.target.value }),
|
|
1391
|
+
children: I.filter((r) => r.id !== W[q].to).map((r) => /* @__PURE__ */ e(be, { value: r.id, children: r.label }, r.id))
|
|
1386
1392
|
}
|
|
1387
1393
|
),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ f(u, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }, children: [
|
|
1395
|
+
/* @__PURE__ */ e(
|
|
1390
1396
|
_,
|
|
1391
1397
|
{
|
|
1392
1398
|
select: !0,
|
|
1393
1399
|
size: "small",
|
|
1394
1400
|
label: "To",
|
|
1395
|
-
value:
|
|
1396
|
-
onChange: (r) =>
|
|
1397
|
-
children:
|
|
1401
|
+
value: W[q].to,
|
|
1402
|
+
onChange: (r) => l(q, { to: r.target.value }),
|
|
1403
|
+
children: I.filter((r) => r.id !== W[q].from).map((r) => /* @__PURE__ */ e(be, { value: r.id, children: r.label }, r.id))
|
|
1398
1404
|
}
|
|
1399
1405
|
),
|
|
1400
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ e(
|
|
1401
1407
|
_,
|
|
1402
1408
|
{
|
|
1403
1409
|
select: !0,
|
|
1404
1410
|
size: "small",
|
|
1405
1411
|
label: "Shape",
|
|
1406
|
-
value:
|
|
1407
|
-
onChange: (r) =>
|
|
1408
|
-
children:
|
|
1412
|
+
value: W[q].type ?? k,
|
|
1413
|
+
onChange: (r) => l(q, { type: r.target.value }),
|
|
1414
|
+
children: $.map((r) => /* @__PURE__ */ e(be, { value: r, children: r }, r))
|
|
1409
1415
|
}
|
|
1410
1416
|
)
|
|
1411
1417
|
] }),
|
|
1412
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ e(
|
|
1413
1419
|
_,
|
|
1414
1420
|
{
|
|
1415
1421
|
size: "small",
|
|
1416
1422
|
label: "Label",
|
|
1417
|
-
value:
|
|
1418
|
-
onChange: (r) =>
|
|
1423
|
+
value: W[q].label ?? "",
|
|
1424
|
+
onChange: (r) => l(q, { label: r.target.value })
|
|
1419
1425
|
}
|
|
1420
1426
|
)
|
|
1421
|
-
] }) : /* @__PURE__ */
|
|
1427
|
+
] }) : /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", children: "Pick a link." })
|
|
1422
1428
|
] })
|
|
1423
1429
|
] })
|
|
1424
1430
|
] })
|
|
@@ -1428,61 +1434,61 @@ function Mr({
|
|
|
1428
1434
|
}
|
|
1429
1435
|
);
|
|
1430
1436
|
}
|
|
1431
|
-
function
|
|
1432
|
-
const [
|
|
1433
|
-
return /* @__PURE__ */
|
|
1434
|
-
|
|
1437
|
+
function Zr({ before: t, after: n, initialPosition: a = 50, sx: s, ...h }) {
|
|
1438
|
+
const [c, v] = S(a);
|
|
1439
|
+
return /* @__PURE__ */ f(
|
|
1440
|
+
u,
|
|
1435
1441
|
{
|
|
1436
|
-
...
|
|
1442
|
+
...h,
|
|
1437
1443
|
sx: [
|
|
1438
1444
|
{ position: "relative", overflow: "hidden", minHeight: 280 },
|
|
1439
1445
|
...Array.isArray(s) ? s : s ? [s] : []
|
|
1440
1446
|
],
|
|
1441
|
-
onPointerMove: (
|
|
1442
|
-
if (
|
|
1447
|
+
onPointerMove: (m) => {
|
|
1448
|
+
if (m.buttons !== 1)
|
|
1443
1449
|
return;
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1450
|
+
const d = m.currentTarget.getBoundingClientRect();
|
|
1451
|
+
v((m.clientX - d.left) / d.width * 100);
|
|
1446
1452
|
},
|
|
1447
1453
|
children: [
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1450
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ e(u, { sx: { position: "absolute", inset: 0 }, children: n }),
|
|
1455
|
+
/* @__PURE__ */ e(u, { sx: { position: "absolute", inset: 0, width: `${c}%`, overflow: "hidden" }, children: t }),
|
|
1456
|
+
/* @__PURE__ */ e(u, { 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" } })
|
|
1451
1457
|
]
|
|
1452
1458
|
}
|
|
1453
1459
|
);
|
|
1454
1460
|
}
|
|
1455
|
-
function
|
|
1456
|
-
initialWidth:
|
|
1461
|
+
function _r({
|
|
1462
|
+
initialWidth: t = 320,
|
|
1457
1463
|
initialHeight: n = 220,
|
|
1458
|
-
minWidth:
|
|
1464
|
+
minWidth: a = 160,
|
|
1459
1465
|
minHeight: s = 120,
|
|
1460
|
-
sx:
|
|
1461
|
-
children:
|
|
1462
|
-
...
|
|
1466
|
+
sx: h,
|
|
1467
|
+
children: c,
|
|
1468
|
+
...v
|
|
1463
1469
|
}) {
|
|
1464
|
-
const [
|
|
1465
|
-
return /* @__PURE__ */
|
|
1466
|
-
|
|
1470
|
+
const [m, d] = S({ width: t, height: n });
|
|
1471
|
+
return /* @__PURE__ */ f(
|
|
1472
|
+
u,
|
|
1467
1473
|
{
|
|
1468
|
-
...
|
|
1474
|
+
...v,
|
|
1469
1475
|
sx: [
|
|
1470
1476
|
{
|
|
1471
1477
|
position: "relative",
|
|
1472
|
-
width:
|
|
1473
|
-
height:
|
|
1478
|
+
width: m.width,
|
|
1479
|
+
height: m.height,
|
|
1474
1480
|
overflow: "auto",
|
|
1475
1481
|
border: 1,
|
|
1476
1482
|
borderColor: "divider",
|
|
1477
1483
|
borderRadius: 1,
|
|
1478
1484
|
bgcolor: "background.paper"
|
|
1479
1485
|
},
|
|
1480
|
-
...Array.isArray(
|
|
1486
|
+
...Array.isArray(h) ? h : h ? [h] : []
|
|
1481
1487
|
],
|
|
1482
1488
|
children: [
|
|
1483
|
-
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
|
|
1489
|
+
c,
|
|
1490
|
+
/* @__PURE__ */ e(
|
|
1491
|
+
u,
|
|
1486
1492
|
{
|
|
1487
1493
|
sx: {
|
|
1488
1494
|
position: "absolute",
|
|
@@ -1500,155 +1506,155 @@ function Sr({
|
|
|
1500
1506
|
borderRadius: 1,
|
|
1501
1507
|
boxShadow: "0 6px 16px rgba(15,23,42,0.14)"
|
|
1502
1508
|
},
|
|
1503
|
-
onPointerDown: (
|
|
1504
|
-
const
|
|
1505
|
-
function
|
|
1506
|
-
|
|
1507
|
-
width: Math.max(
|
|
1508
|
-
height: Math.max(s,
|
|
1509
|
+
onPointerDown: (k) => {
|
|
1510
|
+
const w = k.clientX, $ = k.clientY, g = m;
|
|
1511
|
+
function B(i) {
|
|
1512
|
+
d({
|
|
1513
|
+
width: Math.max(a, g.width + i.clientX - w),
|
|
1514
|
+
height: Math.max(s, g.height + i.clientY - $)
|
|
1509
1515
|
});
|
|
1510
1516
|
}
|
|
1511
|
-
function
|
|
1512
|
-
window.removeEventListener("pointermove",
|
|
1517
|
+
function z() {
|
|
1518
|
+
window.removeEventListener("pointermove", B), window.removeEventListener("pointerup", z);
|
|
1513
1519
|
}
|
|
1514
|
-
window.addEventListener("pointermove",
|
|
1520
|
+
window.addEventListener("pointermove", B), window.addEventListener("pointerup", z);
|
|
1515
1521
|
},
|
|
1516
|
-
children: /* @__PURE__ */
|
|
1522
|
+
children: /* @__PURE__ */ e(Ke, { fontSize: "small" })
|
|
1517
1523
|
}
|
|
1518
1524
|
)
|
|
1519
1525
|
]
|
|
1520
1526
|
}
|
|
1521
1527
|
);
|
|
1522
1528
|
}
|
|
1523
|
-
function
|
|
1524
|
-
return
|
|
1529
|
+
function Wt(t) {
|
|
1530
|
+
return t.type === "boolean" ? t.value ? "On" : "Off" : `${t.value}${t.unit ? ` ${t.unit}` : ""}`;
|
|
1525
1531
|
}
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1528
|
-
const s =
|
|
1532
|
+
function Bt(t) {
|
|
1533
|
+
return t.reduce((n, a) => {
|
|
1534
|
+
const s = a.group ?? "Settings";
|
|
1529
1535
|
return {
|
|
1530
1536
|
...n,
|
|
1531
|
-
[s]: [...n[s] ?? [],
|
|
1537
|
+
[s]: [...n[s] ?? [], a]
|
|
1532
1538
|
};
|
|
1533
1539
|
}, {});
|
|
1534
1540
|
}
|
|
1535
|
-
function
|
|
1536
|
-
fields:
|
|
1541
|
+
function Kr({
|
|
1542
|
+
fields: t,
|
|
1537
1543
|
onChange: n,
|
|
1538
|
-
title:
|
|
1544
|
+
title: a = "Inspector",
|
|
1539
1545
|
description: s,
|
|
1540
|
-
density:
|
|
1541
|
-
showValueSummary:
|
|
1542
|
-
showReset:
|
|
1543
|
-
sx:
|
|
1546
|
+
density: h = "comfortable",
|
|
1547
|
+
showValueSummary: c = !0,
|
|
1548
|
+
showReset: v = !0,
|
|
1549
|
+
sx: m
|
|
1544
1550
|
}) {
|
|
1545
|
-
const
|
|
1546
|
-
function
|
|
1547
|
-
|
|
1551
|
+
const d = Bt(t), k = h === "compact" ? 1.25 : 2, w = h === "compact" ? "small" : "medium";
|
|
1552
|
+
function $(g) {
|
|
1553
|
+
g.defaultValue !== void 0 && n?.(g.id, g.defaultValue);
|
|
1548
1554
|
}
|
|
1549
|
-
return /* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
|
|
1555
|
+
return /* @__PURE__ */ e($e, { variant: "outlined", sx: [{ p: h === "compact" ? 1.5 : 2, borderRadius: 1 }, ...Array.isArray(m) ? m : [m]], children: /* @__PURE__ */ f(H, { spacing: k, children: [
|
|
1556
|
+
/* @__PURE__ */ f(u, { children: [
|
|
1557
|
+
/* @__PURE__ */ f(H, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
|
|
1558
|
+
/* @__PURE__ */ e(Y, { variant: "subtitle1", fontWeight: 850, children: a }),
|
|
1559
|
+
c ? /* @__PURE__ */ e(we, { size: "small", label: `${t.length} fields` }) : null
|
|
1554
1560
|
] }),
|
|
1555
|
-
s ? /* @__PURE__ */
|
|
1561
|
+
s ? /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: s }) : null
|
|
1556
1562
|
] }),
|
|
1557
|
-
Object.entries(
|
|
1558
|
-
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
|
|
1561
|
-
const
|
|
1562
|
-
return
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
|
|
1563
|
+
Object.entries(d).map(([g, B], z) => /* @__PURE__ */ f(H, { spacing: k, children: [
|
|
1564
|
+
z > 0 ? /* @__PURE__ */ e(ut, {}) : null,
|
|
1565
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", fontWeight: 850, sx: { textTransform: "uppercase" }, children: g }),
|
|
1566
|
+
B.map((i) => {
|
|
1567
|
+
const E = v && i.defaultValue !== void 0 && i.defaultValue !== i.value;
|
|
1568
|
+
return i.type === "boolean" ? /* @__PURE__ */ f(u, { children: [
|
|
1569
|
+
/* @__PURE__ */ f(H, { direction: "row", alignItems: "center", justifyContent: "space-between", spacing: 1, children: [
|
|
1570
|
+
/* @__PURE__ */ e(
|
|
1571
|
+
pt,
|
|
1566
1572
|
{
|
|
1567
|
-
control: /* @__PURE__ */
|
|
1568
|
-
|
|
1573
|
+
control: /* @__PURE__ */ e(
|
|
1574
|
+
dt,
|
|
1569
1575
|
{
|
|
1570
|
-
checked: !!
|
|
1571
|
-
disabled:
|
|
1572
|
-
onChange: (
|
|
1576
|
+
checked: !!i.value,
|
|
1577
|
+
disabled: i.disabled,
|
|
1578
|
+
onChange: (b) => n?.(i.id, b.target.checked)
|
|
1573
1579
|
}
|
|
1574
1580
|
),
|
|
1575
|
-
label:
|
|
1581
|
+
label: i.label
|
|
1576
1582
|
}
|
|
1577
1583
|
),
|
|
1578
|
-
|
|
1584
|
+
E ? /* @__PURE__ */ e(ie, { size: "small", onClick: () => $(i), children: "Reset" }) : null
|
|
1579
1585
|
] }),
|
|
1580
|
-
|
|
1581
|
-
] },
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1586
|
+
i.description ? /* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", children: i.description }) : null
|
|
1587
|
+
] }, i.id) : i.type === "number" ? /* @__PURE__ */ f(H, { spacing: 1, children: [
|
|
1588
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
1589
|
+
/* @__PURE__ */ e(
|
|
1584
1590
|
_,
|
|
1585
1591
|
{
|
|
1586
1592
|
fullWidth: !0,
|
|
1587
|
-
size:
|
|
1588
|
-
label:
|
|
1593
|
+
size: w,
|
|
1594
|
+
label: i.label,
|
|
1589
1595
|
type: "number",
|
|
1590
|
-
value:
|
|
1591
|
-
helperText:
|
|
1592
|
-
disabled:
|
|
1596
|
+
value: i.value,
|
|
1597
|
+
helperText: i.description,
|
|
1598
|
+
disabled: i.disabled,
|
|
1593
1599
|
inputProps: {
|
|
1594
|
-
min:
|
|
1595
|
-
max:
|
|
1596
|
-
step:
|
|
1600
|
+
min: i.min,
|
|
1601
|
+
max: i.max,
|
|
1602
|
+
step: i.step
|
|
1597
1603
|
},
|
|
1598
|
-
onChange: (
|
|
1604
|
+
onChange: (b) => n?.(i.id, Number(b.target.value))
|
|
1599
1605
|
}
|
|
1600
1606
|
),
|
|
1601
|
-
|
|
1602
|
-
|
|
1607
|
+
i.unit ? /* @__PURE__ */ e(we, { label: i.unit, size: "small", sx: { mt: 1 } }) : null,
|
|
1608
|
+
E ? /* @__PURE__ */ e(ie, { size: "small", onClick: () => $(i), sx: { mt: 0.5 }, children: "Reset" }) : null
|
|
1603
1609
|
] }),
|
|
1604
|
-
|
|
1605
|
-
|
|
1610
|
+
i.min !== void 0 || i.max !== void 0 ? /* @__PURE__ */ e(
|
|
1611
|
+
Qe,
|
|
1606
1612
|
{
|
|
1607
|
-
value: Number(
|
|
1608
|
-
min:
|
|
1609
|
-
max:
|
|
1610
|
-
step:
|
|
1611
|
-
disabled:
|
|
1613
|
+
value: Number(i.value),
|
|
1614
|
+
min: i.min ?? 0,
|
|
1615
|
+
max: i.max ?? 100,
|
|
1616
|
+
step: i.step ?? 1,
|
|
1617
|
+
disabled: i.disabled,
|
|
1612
1618
|
valueLabelDisplay: "auto",
|
|
1613
|
-
onChange: (
|
|
1619
|
+
onChange: (b, A) => n?.(i.id, Array.isArray(A) ? A[0] : A)
|
|
1614
1620
|
}
|
|
1615
1621
|
) : null
|
|
1616
|
-
] },
|
|
1617
|
-
/* @__PURE__ */
|
|
1622
|
+
] }, i.id) : i.type === "select" ? /* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
1623
|
+
/* @__PURE__ */ e(
|
|
1618
1624
|
_,
|
|
1619
1625
|
{
|
|
1620
1626
|
select: !0,
|
|
1621
1627
|
fullWidth: !0,
|
|
1622
|
-
size:
|
|
1623
|
-
label:
|
|
1624
|
-
value:
|
|
1625
|
-
helperText:
|
|
1626
|
-
disabled:
|
|
1627
|
-
onChange: (
|
|
1628
|
-
children: (
|
|
1628
|
+
size: w,
|
|
1629
|
+
label: i.label,
|
|
1630
|
+
value: i.value,
|
|
1631
|
+
helperText: i.description,
|
|
1632
|
+
disabled: i.disabled,
|
|
1633
|
+
onChange: (b) => n?.(i.id, b.target.value),
|
|
1634
|
+
children: (i.options ?? []).map((b) => /* @__PURE__ */ e(be, { value: b.value, children: b.label }, b.value))
|
|
1629
1635
|
}
|
|
1630
1636
|
),
|
|
1631
|
-
|
|
1632
|
-
] },
|
|
1633
|
-
/* @__PURE__ */
|
|
1637
|
+
E ? /* @__PURE__ */ e(ie, { size: "small", onClick: () => $(i), sx: { mt: 0.5 }, children: "Reset" }) : null
|
|
1638
|
+
] }, i.id) : i.type === "color" ? /* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
1639
|
+
/* @__PURE__ */ e(
|
|
1634
1640
|
_,
|
|
1635
1641
|
{
|
|
1636
1642
|
fullWidth: !0,
|
|
1637
|
-
size:
|
|
1638
|
-
label:
|
|
1639
|
-
value:
|
|
1640
|
-
helperText:
|
|
1641
|
-
disabled:
|
|
1642
|
-
onChange: (
|
|
1643
|
+
size: w,
|
|
1644
|
+
label: i.label,
|
|
1645
|
+
value: i.value,
|
|
1646
|
+
helperText: i.description,
|
|
1647
|
+
disabled: i.disabled,
|
|
1648
|
+
onChange: (b) => n?.(i.id, b.target.value),
|
|
1643
1649
|
InputProps: {
|
|
1644
|
-
startAdornment: /* @__PURE__ */
|
|
1645
|
-
|
|
1650
|
+
startAdornment: /* @__PURE__ */ e(
|
|
1651
|
+
u,
|
|
1646
1652
|
{
|
|
1647
1653
|
component: "input",
|
|
1648
1654
|
type: "color",
|
|
1649
|
-
value: String(
|
|
1650
|
-
disabled:
|
|
1651
|
-
onChange: (
|
|
1655
|
+
value: String(i.value),
|
|
1656
|
+
disabled: i.disabled,
|
|
1657
|
+
onChange: (b) => n?.(i.id, b.target.value),
|
|
1652
1658
|
sx: {
|
|
1653
1659
|
width: 28,
|
|
1654
1660
|
height: 28,
|
|
@@ -1656,49 +1662,49 @@ function Ar({
|
|
|
1656
1662
|
mr: 1,
|
|
1657
1663
|
border: 0,
|
|
1658
1664
|
bgcolor: "transparent",
|
|
1659
|
-
cursor:
|
|
1665
|
+
cursor: i.disabled ? "default" : "pointer"
|
|
1660
1666
|
}
|
|
1661
1667
|
}
|
|
1662
1668
|
)
|
|
1663
1669
|
}
|
|
1664
1670
|
}
|
|
1665
1671
|
),
|
|
1666
|
-
|
|
1667
|
-
] },
|
|
1668
|
-
/* @__PURE__ */
|
|
1672
|
+
E ? /* @__PURE__ */ e(ie, { size: "small", onClick: () => $(i), sx: { mt: 0.5 }, children: "Reset" }) : null
|
|
1673
|
+
] }, i.id) : /* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
1674
|
+
/* @__PURE__ */ e(
|
|
1669
1675
|
_,
|
|
1670
1676
|
{
|
|
1671
1677
|
fullWidth: !0,
|
|
1672
|
-
size:
|
|
1673
|
-
label:
|
|
1674
|
-
value:
|
|
1675
|
-
helperText:
|
|
1676
|
-
disabled:
|
|
1677
|
-
onChange: (
|
|
1678
|
+
size: w,
|
|
1679
|
+
label: i.label,
|
|
1680
|
+
value: i.value,
|
|
1681
|
+
helperText: i.description,
|
|
1682
|
+
disabled: i.disabled,
|
|
1683
|
+
onChange: (b) => n?.(i.id, b.target.value)
|
|
1678
1684
|
}
|
|
1679
1685
|
),
|
|
1680
|
-
|
|
1681
|
-
] },
|
|
1686
|
+
E ? /* @__PURE__ */ e(ie, { size: "small", onClick: () => $(i), sx: { mt: 0.5 }, children: "Reset" }) : null
|
|
1687
|
+
] }, i.id);
|
|
1682
1688
|
})
|
|
1683
|
-
] },
|
|
1684
|
-
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1689
|
+
] }, g)),
|
|
1690
|
+
c ? /* @__PURE__ */ f(u, { sx: { p: 1.25, borderRadius: 1, bgcolor: "action.hover" }, children: [
|
|
1691
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", fontWeight: 850, children: "Current values" }),
|
|
1692
|
+
/* @__PURE__ */ e(H, { direction: "row", flexWrap: "wrap", gap: 0.75, sx: { mt: 1 }, children: t.map((g) => /* @__PURE__ */ e(we, { size: "small", label: `${g.label}: ${Wt(g)}` }, g.id)) })
|
|
1687
1693
|
] }) : null
|
|
1688
1694
|
] }) });
|
|
1689
1695
|
}
|
|
1690
|
-
function
|
|
1691
|
-
value:
|
|
1696
|
+
function Qr({
|
|
1697
|
+
value: t,
|
|
1692
1698
|
alpha: n = 1,
|
|
1693
|
-
swatches:
|
|
1699
|
+
swatches: a = ["#2563eb", "#7c3aed", "#db2777", "#dc2626", "#f59e0b", "#059669"],
|
|
1694
1700
|
showValue: s = !0,
|
|
1695
|
-
onChange:
|
|
1696
|
-
onAlphaChange:
|
|
1701
|
+
onChange: h,
|
|
1702
|
+
onAlphaChange: c
|
|
1697
1703
|
}) {
|
|
1698
|
-
const
|
|
1699
|
-
return /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
|
|
1704
|
+
const v = Math.round(n * 100), m = `${t}${Math.round(n * 255).toString(16).padStart(2, "0")}`;
|
|
1705
|
+
return /* @__PURE__ */ e($e, { variant: "outlined", sx: { p: 2, borderRadius: 1 }, children: /* @__PURE__ */ f(H, { spacing: 2, children: [
|
|
1706
|
+
/* @__PURE__ */ e(
|
|
1707
|
+
u,
|
|
1702
1708
|
{
|
|
1703
1709
|
sx: {
|
|
1704
1710
|
height: 96,
|
|
@@ -1709,97 +1715,97 @@ function Rr({
|
|
|
1709
1715
|
backgroundSize: "18px 18px",
|
|
1710
1716
|
backgroundPosition: "0 0, 0 9px, 9px -9px, -9px 0"
|
|
1711
1717
|
},
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1718
|
+
children: /* @__PURE__ */ e(u, { sx: { height: "100%", borderRadius: 1, bgcolor: t, opacity: n } })
|
|
1713
1719
|
}
|
|
1714
1720
|
),
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1721
|
+
/* @__PURE__ */ f(H, { direction: { xs: "column", sm: "row" }, spacing: 1.5, children: [
|
|
1722
|
+
/* @__PURE__ */ e(
|
|
1717
1723
|
_,
|
|
1718
1724
|
{
|
|
1719
1725
|
label: "Color",
|
|
1720
1726
|
type: "color",
|
|
1721
|
-
value:
|
|
1722
|
-
onChange: (
|
|
1727
|
+
value: t,
|
|
1728
|
+
onChange: (d) => h?.(d.target.value),
|
|
1723
1729
|
sx: { width: { xs: "100%", sm: 120 } }
|
|
1724
1730
|
}
|
|
1725
1731
|
),
|
|
1726
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ e(
|
|
1727
1733
|
_,
|
|
1728
1734
|
{
|
|
1729
1735
|
label: "Hex",
|
|
1730
|
-
value:
|
|
1731
|
-
onChange: (
|
|
1736
|
+
value: t,
|
|
1737
|
+
onChange: (d) => h?.(d.target.value),
|
|
1732
1738
|
fullWidth: !0
|
|
1733
1739
|
}
|
|
1734
1740
|
)
|
|
1735
1741
|
] }),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
|
|
1742
|
+
/* @__PURE__ */ f(u, { children: [
|
|
1743
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", fontWeight: 800, children: "Alpha" }),
|
|
1744
|
+
/* @__PURE__ */ e(
|
|
1745
|
+
Qe,
|
|
1740
1746
|
{
|
|
1741
1747
|
min: 0,
|
|
1742
1748
|
max: 1,
|
|
1743
1749
|
step: 0.01,
|
|
1744
1750
|
value: n,
|
|
1745
|
-
onChange: (
|
|
1751
|
+
onChange: (d, k) => c?.(Array.isArray(k) ? k[0] : k),
|
|
1746
1752
|
valueLabelDisplay: "auto",
|
|
1747
|
-
valueLabelFormat: (
|
|
1753
|
+
valueLabelFormat: (d) => `${Math.round(d * 100)}%`
|
|
1748
1754
|
}
|
|
1749
1755
|
),
|
|
1750
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ e(
|
|
1751
1757
|
_,
|
|
1752
1758
|
{
|
|
1753
1759
|
label: "Alpha",
|
|
1754
1760
|
type: "number",
|
|
1755
|
-
value:
|
|
1756
|
-
onChange: (
|
|
1761
|
+
value: v,
|
|
1762
|
+
onChange: (d) => c?.(Math.min(Math.max(Number(d.target.value), 0), 100) / 100),
|
|
1757
1763
|
InputProps: {
|
|
1758
|
-
endAdornment: /* @__PURE__ */
|
|
1764
|
+
endAdornment: /* @__PURE__ */ e(ht, { position: "end", children: "%" })
|
|
1759
1765
|
},
|
|
1760
1766
|
fullWidth: !0
|
|
1761
1767
|
}
|
|
1762
1768
|
)
|
|
1763
1769
|
] }),
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
|
|
1770
|
+
/* @__PURE__ */ e(u, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: a.map((d) => /* @__PURE__ */ e(
|
|
1771
|
+
u,
|
|
1766
1772
|
{
|
|
1767
1773
|
component: "button",
|
|
1768
|
-
"aria-label":
|
|
1769
|
-
onClick: () =>
|
|
1774
|
+
"aria-label": d,
|
|
1775
|
+
onClick: () => h?.(d),
|
|
1770
1776
|
sx: {
|
|
1771
1777
|
width: 32,
|
|
1772
1778
|
height: 32,
|
|
1773
1779
|
borderRadius: "50%",
|
|
1774
1780
|
border: 2,
|
|
1775
|
-
borderColor:
|
|
1776
|
-
bgcolor:
|
|
1781
|
+
borderColor: d.toLowerCase() === t.toLowerCase() ? "text.primary" : "divider",
|
|
1782
|
+
bgcolor: d,
|
|
1777
1783
|
cursor: "pointer"
|
|
1778
1784
|
}
|
|
1779
1785
|
},
|
|
1780
|
-
|
|
1786
|
+
d
|
|
1781
1787
|
)) }),
|
|
1782
|
-
s ? /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1788
|
+
s ? /* @__PURE__ */ f(u, { sx: { p: 1.5, borderRadius: 1, bgcolor: "#0f172a", color: "#e5e7eb" }, children: [
|
|
1789
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "#94a3b8", children: "selected color" }),
|
|
1790
|
+
/* @__PURE__ */ e(Y, { fontFamily: "monospace", children: m })
|
|
1785
1791
|
] }) : null
|
|
1786
1792
|
] }) });
|
|
1787
1793
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const [s,
|
|
1790
|
-
function
|
|
1791
|
-
|
|
1794
|
+
function Jr({ onFiles: t, sx: n, ...a }) {
|
|
1795
|
+
const [s, h] = S(!1);
|
|
1796
|
+
function c(v) {
|
|
1797
|
+
v && t?.(Array.from(v));
|
|
1792
1798
|
}
|
|
1793
|
-
return /* @__PURE__ */
|
|
1794
|
-
|
|
1799
|
+
return /* @__PURE__ */ f(
|
|
1800
|
+
u,
|
|
1795
1801
|
{
|
|
1796
|
-
...
|
|
1797
|
-
onDragOver: (
|
|
1798
|
-
|
|
1802
|
+
...a,
|
|
1803
|
+
onDragOver: (v) => {
|
|
1804
|
+
v.preventDefault(), h(!0);
|
|
1799
1805
|
},
|
|
1800
|
-
onDragLeave: () =>
|
|
1801
|
-
onDrop: (
|
|
1802
|
-
|
|
1806
|
+
onDragLeave: () => h(!1),
|
|
1807
|
+
onDrop: (v) => {
|
|
1808
|
+
v.preventDefault(), h(!1), c(v.dataTransfer.files);
|
|
1803
1809
|
},
|
|
1804
1810
|
sx: [
|
|
1805
1811
|
{
|
|
@@ -1814,113 +1820,113 @@ function Lr({ onFiles: e, sx: n, ...l }) {
|
|
|
1814
1820
|
...Array.isArray(n) ? n : n ? [n] : []
|
|
1815
1821
|
],
|
|
1816
1822
|
children: [
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
1823
|
+
/* @__PURE__ */ e(Y, { fontWeight: 800, children: "Drop files here" }),
|
|
1824
|
+
/* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", children: "Drag files into this zone" })
|
|
1819
1825
|
]
|
|
1820
1826
|
}
|
|
1821
1827
|
);
|
|
1822
1828
|
}
|
|
1823
|
-
function
|
|
1824
|
-
return Math.min(Math.max(
|
|
1829
|
+
function De(t, n, a) {
|
|
1830
|
+
return Math.min(Math.max(t, n), a);
|
|
1825
1831
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const n = Math.floor(
|
|
1828
|
-
return `${n}:${String(
|
|
1832
|
+
function Et(t) {
|
|
1833
|
+
const n = Math.floor(t / 60), a = Math.floor(t % 60);
|
|
1834
|
+
return `${n}:${String(a).padStart(2, "0")}`;
|
|
1829
1835
|
}
|
|
1830
|
-
function
|
|
1831
|
-
return n > 0 ?
|
|
1836
|
+
function Se(t, n) {
|
|
1837
|
+
return n > 0 ? De(t / n * 100, 0, 100) : 0;
|
|
1832
1838
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return n.reduce((
|
|
1839
|
+
function Xt(t, n) {
|
|
1840
|
+
return n.reduce((a, s) => a ? Math.abs(s.time - t) < Math.abs(a.time - t) ? s : a : s, null);
|
|
1835
1841
|
}
|
|
1836
|
-
function
|
|
1837
|
-
duration:
|
|
1842
|
+
function en({
|
|
1843
|
+
duration: t,
|
|
1838
1844
|
value: n,
|
|
1839
|
-
defaultValue:
|
|
1845
|
+
defaultValue: a = 0,
|
|
1840
1846
|
markers: s = [],
|
|
1841
|
-
thumbnails:
|
|
1842
|
-
disabled:
|
|
1843
|
-
showTime:
|
|
1844
|
-
preview:
|
|
1845
|
-
step:
|
|
1846
|
-
formatTime:
|
|
1847
|
-
onChange:
|
|
1848
|
-
sx:
|
|
1849
|
-
...
|
|
1847
|
+
thumbnails: h = [],
|
|
1848
|
+
disabled: c = !1,
|
|
1849
|
+
showTime: v = !0,
|
|
1850
|
+
preview: m = !0,
|
|
1851
|
+
step: d = 1,
|
|
1852
|
+
formatTime: k = Et,
|
|
1853
|
+
onChange: w,
|
|
1854
|
+
sx: $,
|
|
1855
|
+
...g
|
|
1850
1856
|
}) {
|
|
1851
|
-
const
|
|
1852
|
-
function
|
|
1853
|
-
const
|
|
1854
|
-
n === void 0 && o
|
|
1857
|
+
const B = pe(null), [z, i] = S(a), [E, b] = S(!1), [A, V] = S(null), O = De(n ?? z, 0, t), M = A === null ? O : A, R = Se(O, t), I = Se(M, t), W = ze(() => [...s].sort((y, P) => y.time - P.time), [s]), U = Xt(M, h);
|
|
1858
|
+
function G(y, P) {
|
|
1859
|
+
const N = d > 0 ? Math.round(y / d) * d : y, o = De(N, 0, t);
|
|
1860
|
+
n === void 0 && i(o), w?.(o, P);
|
|
1855
1861
|
}
|
|
1856
|
-
function
|
|
1857
|
-
const
|
|
1858
|
-
if (!
|
|
1859
|
-
return
|
|
1860
|
-
const
|
|
1861
|
-
return
|
|
1862
|
+
function p(y) {
|
|
1863
|
+
const P = B.current;
|
|
1864
|
+
if (!P)
|
|
1865
|
+
return O;
|
|
1866
|
+
const N = P.getBoundingClientRect();
|
|
1867
|
+
return De((y - N.left) / N.width, 0, 1) * t;
|
|
1862
1868
|
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1869
|
+
function L(y) {
|
|
1870
|
+
V(p(y));
|
|
1865
1871
|
}
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
-
|
|
1872
|
+
return /* @__PURE__ */ f(
|
|
1873
|
+
u,
|
|
1868
1874
|
{
|
|
1869
|
-
...
|
|
1875
|
+
...g,
|
|
1870
1876
|
sx: [
|
|
1871
1877
|
{
|
|
1872
1878
|
width: "100%",
|
|
1873
|
-
color:
|
|
1879
|
+
color: c ? "text.disabled" : "text.primary",
|
|
1874
1880
|
userSelect: "none"
|
|
1875
1881
|
},
|
|
1876
|
-
...Array.isArray(
|
|
1882
|
+
...Array.isArray($) ? $ : $ ? [$] : []
|
|
1877
1883
|
],
|
|
1878
1884
|
children: [
|
|
1879
|
-
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
1885
|
+
v ? /* @__PURE__ */ f(u, { sx: { display: "flex", justifyContent: "space-between", mb: 1 }, children: [
|
|
1886
|
+
/* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 800, children: k(O) }),
|
|
1887
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", children: k(t) })
|
|
1882
1888
|
] }) : null,
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
|
|
1889
|
+
/* @__PURE__ */ f(
|
|
1890
|
+
u,
|
|
1885
1891
|
{
|
|
1886
|
-
ref:
|
|
1892
|
+
ref: B,
|
|
1887
1893
|
role: "slider",
|
|
1888
|
-
tabIndex:
|
|
1894
|
+
tabIndex: c ? -1 : 0,
|
|
1889
1895
|
"aria-valuemin": 0,
|
|
1890
|
-
"aria-valuemax":
|
|
1891
|
-
"aria-valuenow": Math.round(
|
|
1892
|
-
onPointerMove: (
|
|
1893
|
-
|
|
1896
|
+
"aria-valuemax": t,
|
|
1897
|
+
"aria-valuenow": Math.round(O),
|
|
1898
|
+
onPointerMove: (y) => {
|
|
1899
|
+
c || (L(y.clientX), E && G(p(y.clientX), "drag"));
|
|
1894
1900
|
},
|
|
1895
1901
|
onPointerLeave: () => {
|
|
1896
|
-
|
|
1902
|
+
E || V(null);
|
|
1897
1903
|
},
|
|
1898
|
-
onPointerDown: (
|
|
1899
|
-
|
|
1904
|
+
onPointerDown: (y) => {
|
|
1905
|
+
c || (b(!0), y.currentTarget.setPointerCapture(y.pointerId), G(p(y.clientX), "click"));
|
|
1900
1906
|
},
|
|
1901
|
-
onPointerUp: (
|
|
1902
|
-
|
|
1907
|
+
onPointerUp: (y) => {
|
|
1908
|
+
b(!1), y.currentTarget.releasePointerCapture(y.pointerId);
|
|
1903
1909
|
},
|
|
1904
|
-
onPointerCancel: () =>
|
|
1905
|
-
onKeyDown: (
|
|
1906
|
-
|
|
1910
|
+
onPointerCancel: () => b(!1),
|
|
1911
|
+
onKeyDown: (y) => {
|
|
1912
|
+
c || (y.key === "ArrowLeft" && (G(O - d, "keyboard"), y.preventDefault()), y.key === "ArrowRight" && (G(O + d, "keyboard"), y.preventDefault()), y.key === "Home" && (G(0, "keyboard"), y.preventDefault()), y.key === "End" && (G(t, "keyboard"), y.preventDefault()));
|
|
1907
1913
|
},
|
|
1908
1914
|
sx: {
|
|
1909
1915
|
position: "relative",
|
|
1910
1916
|
height: 86,
|
|
1911
|
-
cursor:
|
|
1917
|
+
cursor: c ? "default" : "pointer",
|
|
1912
1918
|
outline: "none",
|
|
1913
1919
|
"&:focus-visible .TimelineScrubber-track": {
|
|
1914
1920
|
boxShadow: "0 0 0 3px rgba(37,99,235,0.28)"
|
|
1915
1921
|
}
|
|
1916
1922
|
},
|
|
1917
1923
|
children: [
|
|
1918
|
-
|
|
1919
|
-
|
|
1924
|
+
m && A !== null ? /* @__PURE__ */ f(
|
|
1925
|
+
u,
|
|
1920
1926
|
{
|
|
1921
1927
|
sx: {
|
|
1922
1928
|
position: "absolute",
|
|
1923
|
-
left: `${
|
|
1929
|
+
left: `${I}%`,
|
|
1924
1930
|
top: 0,
|
|
1925
1931
|
transform: "translateX(-50%)",
|
|
1926
1932
|
width: 116,
|
|
@@ -1934,13 +1940,13 @@ function Pr({
|
|
|
1934
1940
|
zIndex: 2
|
|
1935
1941
|
},
|
|
1936
1942
|
children: [
|
|
1937
|
-
/* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ e(u, { sx: { height: 56, borderRadius: 0.75, overflow: "hidden", bgcolor: "#e5e7eb" }, children: U?.thumbnail ?? /* @__PURE__ */ e(u, { sx: { height: "100%", display: "grid", placeItems: "center", bgcolor: "#0f172a", color: "#fff" }, children: /* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 900, children: k(M) }) }) }),
|
|
1944
|
+
/* @__PURE__ */ e(Y, { variant: "caption", fontWeight: 800, sx: { display: "block", mt: 0.5, textAlign: "center" }, children: k(M) })
|
|
1939
1945
|
]
|
|
1940
1946
|
}
|
|
1941
1947
|
) : null,
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
|
|
1948
|
+
/* @__PURE__ */ e(
|
|
1949
|
+
u,
|
|
1944
1950
|
{
|
|
1945
1951
|
className: "TimelineScrubber-track",
|
|
1946
1952
|
sx: {
|
|
@@ -1954,11 +1960,11 @@ function Pr({
|
|
|
1954
1960
|
overflow: "hidden",
|
|
1955
1961
|
transition: "box-shadow 120ms ease"
|
|
1956
1962
|
},
|
|
1957
|
-
children: /* @__PURE__ */
|
|
1958
|
-
|
|
1963
|
+
children: /* @__PURE__ */ e(
|
|
1964
|
+
u,
|
|
1959
1965
|
{
|
|
1960
1966
|
sx: {
|
|
1961
|
-
width: `${
|
|
1967
|
+
width: `${R}%`,
|
|
1962
1968
|
height: "100%",
|
|
1963
1969
|
borderRadius: 999,
|
|
1964
1970
|
background: "linear-gradient(90deg, #2563eb, #06b6d4)"
|
|
@@ -1967,37 +1973,37 @@ function Pr({
|
|
|
1967
1973
|
)
|
|
1968
1974
|
}
|
|
1969
1975
|
),
|
|
1970
|
-
|
|
1971
|
-
const
|
|
1972
|
-
return /* @__PURE__ */
|
|
1973
|
-
|
|
1976
|
+
W.map((y) => {
|
|
1977
|
+
const P = Se(y.time, t);
|
|
1978
|
+
return /* @__PURE__ */ e(ce, { title: y.label ?? k(y.time), arrow: !0, children: /* @__PURE__ */ e(
|
|
1979
|
+
u,
|
|
1974
1980
|
{
|
|
1975
|
-
onPointerDown: (
|
|
1976
|
-
|
|
1981
|
+
onPointerDown: (N) => {
|
|
1982
|
+
N.stopPropagation(), G(y.time, "marker");
|
|
1977
1983
|
},
|
|
1978
1984
|
sx: {
|
|
1979
1985
|
position: "absolute",
|
|
1980
|
-
left: `${
|
|
1986
|
+
left: `${P}%`,
|
|
1981
1987
|
bottom: 11,
|
|
1982
1988
|
width: 12,
|
|
1983
1989
|
height: 26,
|
|
1984
1990
|
borderRadius: 999,
|
|
1985
1991
|
transform: "translateX(-50%)",
|
|
1986
|
-
bgcolor:
|
|
1992
|
+
bgcolor: y.color ?? "#f59e0b",
|
|
1987
1993
|
border: "2px solid",
|
|
1988
1994
|
borderColor: "background.paper",
|
|
1989
1995
|
boxShadow: "0 8px 18px rgba(15,23,42,0.2)",
|
|
1990
1996
|
zIndex: 1
|
|
1991
1997
|
}
|
|
1992
1998
|
}
|
|
1993
|
-
) },
|
|
1999
|
+
) }, y.id);
|
|
1994
2000
|
}),
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
|
|
2001
|
+
/* @__PURE__ */ e(
|
|
2002
|
+
u,
|
|
1997
2003
|
{
|
|
1998
2004
|
sx: {
|
|
1999
2005
|
position: "absolute",
|
|
2000
|
-
left: `${
|
|
2006
|
+
left: `${R}%`,
|
|
2001
2007
|
bottom: 5,
|
|
2002
2008
|
width: 28,
|
|
2003
2009
|
height: 28,
|
|
@@ -2006,7 +2012,7 @@ function Pr({
|
|
|
2006
2012
|
bgcolor: "background.paper",
|
|
2007
2013
|
border: 3,
|
|
2008
2014
|
borderColor: "#2563eb",
|
|
2009
|
-
boxShadow:
|
|
2015
|
+
boxShadow: E ? "0 12px 30px rgba(37,99,235,0.36)" : "0 8px 20px rgba(15,23,42,0.2)"
|
|
2010
2016
|
}
|
|
2011
2017
|
}
|
|
2012
2018
|
)
|
|
@@ -2017,83 +2023,83 @@ function Pr({
|
|
|
2017
2023
|
}
|
|
2018
2024
|
);
|
|
2019
2025
|
}
|
|
2020
|
-
function
|
|
2021
|
-
return Math.min(Math.max(
|
|
2026
|
+
function He(t, n, a) {
|
|
2027
|
+
return Math.min(Math.max(t, n), a);
|
|
2022
2028
|
}
|
|
2023
|
-
function
|
|
2024
|
-
items:
|
|
2029
|
+
function tn({
|
|
2030
|
+
items: t = [],
|
|
2025
2031
|
defaultViewport: n = { x: 0, y: 0, zoom: 1 },
|
|
2026
|
-
viewport:
|
|
2032
|
+
viewport: a,
|
|
2027
2033
|
minZoom: s = 0.3,
|
|
2028
|
-
maxZoom:
|
|
2029
|
-
showGrid:
|
|
2030
|
-
showMinimap:
|
|
2031
|
-
selectedItemId:
|
|
2032
|
-
renderItem:
|
|
2033
|
-
onViewportChange:
|
|
2034
|
-
onItemMove:
|
|
2035
|
-
onItemSelect:
|
|
2036
|
-
sx:
|
|
2037
|
-
...
|
|
2034
|
+
maxZoom: h = 2.5,
|
|
2035
|
+
showGrid: c = !0,
|
|
2036
|
+
showMinimap: v = !0,
|
|
2037
|
+
selectedItemId: m,
|
|
2038
|
+
renderItem: d,
|
|
2039
|
+
onViewportChange: k,
|
|
2040
|
+
onItemMove: w,
|
|
2041
|
+
onItemSelect: $,
|
|
2042
|
+
sx: g,
|
|
2043
|
+
...B
|
|
2038
2044
|
}) {
|
|
2039
|
-
const
|
|
2040
|
-
Object.fromEntries(
|
|
2041
|
-
), [
|
|
2042
|
-
const
|
|
2043
|
-
x:
|
|
2044
|
-
y:
|
|
2045
|
-
width:
|
|
2046
|
-
height:
|
|
2045
|
+
const z = pe(null), [i, E] = S(n), [b, A] = S(
|
|
2046
|
+
Object.fromEntries(t.map((p) => [p.id, { x: p.x, y: p.y }]))
|
|
2047
|
+
), [V, O] = S(m ?? null), M = a ?? i, R = m ?? V, I = ze(() => {
|
|
2048
|
+
const p = t.map((o) => ({
|
|
2049
|
+
x: b[o.id]?.x ?? o.x,
|
|
2050
|
+
y: b[o.id]?.y ?? o.y,
|
|
2051
|
+
width: o.width ?? 140,
|
|
2052
|
+
height: o.height ?? 80
|
|
2047
2053
|
}));
|
|
2048
|
-
if (!
|
|
2054
|
+
if (!p.length)
|
|
2049
2055
|
return { minX: -200, minY: -120, width: 400, height: 240 };
|
|
2050
|
-
const
|
|
2051
|
-
return { minX:
|
|
2052
|
-
}, [
|
|
2053
|
-
function
|
|
2054
|
-
const
|
|
2055
|
-
...
|
|
2056
|
-
zoom:
|
|
2056
|
+
const L = Math.min(...p.map((o) => o.x)) - 80, y = Math.min(...p.map((o) => o.y)) - 80, P = Math.max(...p.map((o) => o.x + o.width)) + 80, N = Math.max(...p.map((o) => o.y + o.height)) + 80;
|
|
2057
|
+
return { minX: L, minY: y, width: P - L, height: N - y };
|
|
2058
|
+
}, [b, t]);
|
|
2059
|
+
function W(p) {
|
|
2060
|
+
const L = {
|
|
2061
|
+
...p,
|
|
2062
|
+
zoom: He(p.zoom, s, h)
|
|
2057
2063
|
};
|
|
2058
|
-
|
|
2064
|
+
a === void 0 && E(L), k?.(L);
|
|
2059
2065
|
}
|
|
2060
|
-
function
|
|
2061
|
-
const
|
|
2066
|
+
function U(p, L) {
|
|
2067
|
+
const y = z.current?.getBoundingClientRect();
|
|
2062
2068
|
return {
|
|
2063
|
-
x: (
|
|
2064
|
-
y: (
|
|
2069
|
+
x: (p - (y?.left ?? 0) - M.x) / M.zoom,
|
|
2070
|
+
y: (L - (y?.top ?? 0) - M.y) / M.zoom
|
|
2065
2071
|
};
|
|
2066
2072
|
}
|
|
2067
|
-
function
|
|
2068
|
-
|
|
2073
|
+
function G(p) {
|
|
2074
|
+
O(p?.id ?? null), $?.(p);
|
|
2069
2075
|
}
|
|
2070
|
-
return /* @__PURE__ */
|
|
2071
|
-
|
|
2076
|
+
return /* @__PURE__ */ f(
|
|
2077
|
+
u,
|
|
2072
2078
|
{
|
|
2073
|
-
...
|
|
2074
|
-
ref:
|
|
2075
|
-
onWheel: (
|
|
2076
|
-
|
|
2077
|
-
const
|
|
2078
|
-
|
|
2079
|
+
...B,
|
|
2080
|
+
ref: z,
|
|
2081
|
+
onWheel: (p) => {
|
|
2082
|
+
p.preventDefault();
|
|
2083
|
+
const L = He(M.zoom * (p.deltaY > 0 ? 0.92 : 1.08), s, h), y = U(p.clientX, p.clientY), P = z.current?.getBoundingClientRect(), N = p.clientX - (P?.left ?? 0) - y.x * L, o = p.clientY - (P?.top ?? 0) - y.y * L;
|
|
2084
|
+
W({ x: N, y: o, zoom: L });
|
|
2079
2085
|
},
|
|
2080
|
-
onPointerDown: (
|
|
2081
|
-
if (
|
|
2086
|
+
onPointerDown: (p) => {
|
|
2087
|
+
if (p.target !== p.currentTarget)
|
|
2082
2088
|
return;
|
|
2083
|
-
|
|
2084
|
-
const
|
|
2085
|
-
|
|
2086
|
-
function
|
|
2087
|
-
|
|
2088
|
-
...
|
|
2089
|
-
x:
|
|
2090
|
-
y:
|
|
2089
|
+
G(null);
|
|
2090
|
+
const L = p.clientX, y = p.clientY, P = M;
|
|
2091
|
+
p.currentTarget.setPointerCapture(p.pointerId);
|
|
2092
|
+
function N(X) {
|
|
2093
|
+
W({
|
|
2094
|
+
...P,
|
|
2095
|
+
x: P.x + X.clientX - L,
|
|
2096
|
+
y: P.y + X.clientY - y
|
|
2091
2097
|
});
|
|
2092
2098
|
}
|
|
2093
|
-
function
|
|
2094
|
-
window.removeEventListener("pointermove",
|
|
2099
|
+
function o() {
|
|
2100
|
+
window.removeEventListener("pointermove", N), window.removeEventListener("pointerup", o);
|
|
2095
2101
|
}
|
|
2096
|
-
window.addEventListener("pointermove",
|
|
2102
|
+
window.addEventListener("pointermove", N), window.addEventListener("pointerup", o);
|
|
2097
2103
|
},
|
|
2098
2104
|
sx: [
|
|
2099
2105
|
{
|
|
@@ -2104,81 +2110,81 @@ function Tr({
|
|
|
2104
2110
|
cursor: "grab",
|
|
2105
2111
|
touchAction: "none"
|
|
2106
2112
|
},
|
|
2107
|
-
...Array.isArray(
|
|
2113
|
+
...Array.isArray(g) ? g : g ? [g] : []
|
|
2108
2114
|
],
|
|
2109
2115
|
children: [
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
|
|
2116
|
+
/* @__PURE__ */ e(
|
|
2117
|
+
u,
|
|
2112
2118
|
{
|
|
2113
2119
|
sx: {
|
|
2114
2120
|
position: "absolute",
|
|
2115
2121
|
inset: 0,
|
|
2116
2122
|
pointerEvents: "none",
|
|
2117
|
-
backgroundImage:
|
|
2118
|
-
backgroundSize: `${32 *
|
|
2119
|
-
backgroundPosition: `${
|
|
2123
|
+
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,
|
|
2124
|
+
backgroundSize: `${32 * M.zoom}px ${32 * M.zoom}px`,
|
|
2125
|
+
backgroundPosition: `${M.x}px ${M.y}px`
|
|
2120
2126
|
}
|
|
2121
2127
|
}
|
|
2122
2128
|
),
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
|
|
2129
|
+
/* @__PURE__ */ e(
|
|
2130
|
+
u,
|
|
2125
2131
|
{
|
|
2126
2132
|
sx: {
|
|
2127
2133
|
position: "absolute",
|
|
2128
|
-
left:
|
|
2129
|
-
top:
|
|
2130
|
-
transform: `scale(${
|
|
2134
|
+
left: M.x,
|
|
2135
|
+
top: M.y,
|
|
2136
|
+
transform: `scale(${M.zoom})`,
|
|
2131
2137
|
transformOrigin: "0 0"
|
|
2132
2138
|
},
|
|
2133
|
-
children:
|
|
2134
|
-
const
|
|
2135
|
-
return /* @__PURE__ */
|
|
2136
|
-
|
|
2139
|
+
children: t.map((p) => {
|
|
2140
|
+
const L = b[p.id] ?? { x: p.x, y: p.y }, y = p.id === R;
|
|
2141
|
+
return /* @__PURE__ */ e(
|
|
2142
|
+
u,
|
|
2137
2143
|
{
|
|
2138
|
-
onPointerDown: (
|
|
2139
|
-
|
|
2140
|
-
const
|
|
2141
|
-
|
|
2142
|
-
function
|
|
2143
|
-
const
|
|
2144
|
-
x:
|
|
2145
|
-
y:
|
|
2144
|
+
onPointerDown: (P) => {
|
|
2145
|
+
P.stopPropagation(), G(p);
|
|
2146
|
+
const N = b[p.id] ?? { x: p.x, y: p.y }, o = U(P.clientX, P.clientY);
|
|
2147
|
+
P.currentTarget.setPointerCapture(P.pointerId);
|
|
2148
|
+
function X(he) {
|
|
2149
|
+
const te = U(he.clientX, he.clientY), q = {
|
|
2150
|
+
x: N.x + te.x - o.x,
|
|
2151
|
+
y: N.y + te.y - o.y
|
|
2146
2152
|
};
|
|
2147
|
-
|
|
2148
|
-
...
|
|
2149
|
-
[
|
|
2150
|
-
})),
|
|
2153
|
+
A((ae) => ({
|
|
2154
|
+
...ae,
|
|
2155
|
+
[p.id]: q
|
|
2156
|
+
})), w?.(p.id, q);
|
|
2151
2157
|
}
|
|
2152
|
-
function
|
|
2153
|
-
window.removeEventListener("pointermove",
|
|
2158
|
+
function ee() {
|
|
2159
|
+
window.removeEventListener("pointermove", X), window.removeEventListener("pointerup", ee);
|
|
2154
2160
|
}
|
|
2155
|
-
window.addEventListener("pointermove",
|
|
2161
|
+
window.addEventListener("pointermove", X), window.addEventListener("pointerup", ee);
|
|
2156
2162
|
},
|
|
2157
2163
|
sx: {
|
|
2158
2164
|
position: "absolute",
|
|
2159
|
-
left:
|
|
2160
|
-
top:
|
|
2161
|
-
width:
|
|
2162
|
-
height:
|
|
2165
|
+
left: L.x,
|
|
2166
|
+
top: L.y,
|
|
2167
|
+
width: p.width ?? 140,
|
|
2168
|
+
height: p.height ?? 80,
|
|
2163
2169
|
display: "grid",
|
|
2164
2170
|
placeItems: "center",
|
|
2165
|
-
border:
|
|
2166
|
-
borderColor:
|
|
2171
|
+
border: y ? 2 : 1,
|
|
2172
|
+
borderColor: y ? "primary.main" : "divider",
|
|
2167
2173
|
borderRadius: 1,
|
|
2168
|
-
bgcolor:
|
|
2169
|
-
boxShadow:
|
|
2174
|
+
bgcolor: p.color ?? "background.paper",
|
|
2175
|
+
boxShadow: y ? "0 18px 40px rgba(37,99,235,0.24)" : "0 12px 28px rgba(15,23,42,0.13)",
|
|
2170
2176
|
cursor: "grab",
|
|
2171
2177
|
userSelect: "none"
|
|
2172
2178
|
},
|
|
2173
|
-
children:
|
|
2179
|
+
children: d ? d(p, y) : /* @__PURE__ */ e(Y, { fontWeight: 900, children: p.label ?? p.id })
|
|
2174
2180
|
},
|
|
2175
|
-
|
|
2181
|
+
p.id
|
|
2176
2182
|
);
|
|
2177
2183
|
})
|
|
2178
2184
|
}
|
|
2179
2185
|
),
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
|
|
2186
|
+
/* @__PURE__ */ f(
|
|
2187
|
+
u,
|
|
2182
2188
|
{
|
|
2183
2189
|
sx: {
|
|
2184
2190
|
position: "absolute",
|
|
@@ -2197,13 +2203,13 @@ function Tr({
|
|
|
2197
2203
|
fontWeight: 800
|
|
2198
2204
|
},
|
|
2199
2205
|
children: [
|
|
2200
|
-
Math.round(
|
|
2206
|
+
Math.round(M.zoom * 100),
|
|
2201
2207
|
"%"
|
|
2202
2208
|
]
|
|
2203
2209
|
}
|
|
2204
2210
|
),
|
|
2205
|
-
|
|
2206
|
-
|
|
2211
|
+
v ? /* @__PURE__ */ e(
|
|
2212
|
+
u,
|
|
2207
2213
|
{
|
|
2208
2214
|
sx: {
|
|
2209
2215
|
position: "absolute",
|
|
@@ -2217,24 +2223,24 @@ function Tr({
|
|
|
2217
2223
|
bgcolor: "rgba(255,255,255,0.9)",
|
|
2218
2224
|
overflow: "hidden"
|
|
2219
2225
|
},
|
|
2220
|
-
children:
|
|
2221
|
-
const
|
|
2222
|
-
return /* @__PURE__ */
|
|
2223
|
-
|
|
2226
|
+
children: t.map((p) => {
|
|
2227
|
+
const L = b[p.id] ?? { x: p.x, y: p.y }, y = (L.x - I.minX) / I.width * 100, P = (L.y - I.minY) / I.height * 100, N = (p.width ?? 140) / I.width * 100, o = (p.height ?? 80) / I.height * 100;
|
|
2228
|
+
return /* @__PURE__ */ e(
|
|
2229
|
+
u,
|
|
2224
2230
|
{
|
|
2225
2231
|
sx: {
|
|
2226
2232
|
position: "absolute",
|
|
2227
|
-
left: `${
|
|
2228
|
-
top: `${
|
|
2229
|
-
width: `${
|
|
2230
|
-
height: `${
|
|
2233
|
+
left: `${y}%`,
|
|
2234
|
+
top: `${P}%`,
|
|
2235
|
+
width: `${N}%`,
|
|
2236
|
+
height: `${o}%`,
|
|
2231
2237
|
minWidth: 6,
|
|
2232
2238
|
minHeight: 4,
|
|
2233
2239
|
borderRadius: 0.5,
|
|
2234
|
-
bgcolor:
|
|
2240
|
+
bgcolor: p.id === R ? "primary.main" : p.color ?? "#94a3b8"
|
|
2235
2241
|
}
|
|
2236
2242
|
},
|
|
2237
|
-
|
|
2243
|
+
p.id
|
|
2238
2244
|
);
|
|
2239
2245
|
})
|
|
2240
2246
|
}
|
|
@@ -2243,79 +2249,79 @@ function Tr({
|
|
|
2243
2249
|
}
|
|
2244
2250
|
);
|
|
2245
2251
|
}
|
|
2246
|
-
function
|
|
2247
|
-
children:
|
|
2252
|
+
function rn({
|
|
2253
|
+
children: t,
|
|
2248
2254
|
title: n,
|
|
2249
|
-
content:
|
|
2255
|
+
content: a,
|
|
2250
2256
|
media: s,
|
|
2251
|
-
actions:
|
|
2252
|
-
copyText:
|
|
2253
|
-
placement:
|
|
2254
|
-
pinMode:
|
|
2255
|
-
defaultPinned:
|
|
2256
|
-
openDelay:
|
|
2257
|
-
sx:
|
|
2258
|
-
|
|
2257
|
+
actions: h = [],
|
|
2258
|
+
copyText: c,
|
|
2259
|
+
placement: v = "top",
|
|
2260
|
+
pinMode: m = !0,
|
|
2261
|
+
defaultPinned: d = !1,
|
|
2262
|
+
openDelay: k = 120,
|
|
2263
|
+
sx: w,
|
|
2264
|
+
...$
|
|
2259
2265
|
}) {
|
|
2260
|
-
const
|
|
2261
|
-
function
|
|
2262
|
-
|
|
2266
|
+
const g = pe(null), B = pe(null), z = pe(null), [i, E] = S(d), [b, A] = S(d), [V, O] = S(!1);
|
|
2267
|
+
function M() {
|
|
2268
|
+
z.current && window.clearTimeout(z.current), B.current && window.clearTimeout(B.current);
|
|
2263
2269
|
}
|
|
2264
|
-
function
|
|
2265
|
-
|
|
2270
|
+
function R() {
|
|
2271
|
+
M(), !i && (z.current = window.setTimeout(() => E(!0), k));
|
|
2266
2272
|
}
|
|
2267
|
-
function
|
|
2268
|
-
|
|
2273
|
+
function I() {
|
|
2274
|
+
M(), E(!0);
|
|
2269
2275
|
}
|
|
2270
|
-
function
|
|
2271
|
-
|
|
2276
|
+
function W() {
|
|
2277
|
+
M(), b || (B.current = window.setTimeout(() => E(!1), 100));
|
|
2272
2278
|
}
|
|
2273
|
-
function
|
|
2274
|
-
const
|
|
2275
|
-
|
|
2279
|
+
function U() {
|
|
2280
|
+
const p = !b;
|
|
2281
|
+
A(p), E(p || i);
|
|
2276
2282
|
}
|
|
2277
|
-
async function
|
|
2278
|
-
|
|
2283
|
+
async function G() {
|
|
2284
|
+
c && (await navigator.clipboard?.writeText(c), O(!0), window.setTimeout(() => O(!1), 1100));
|
|
2279
2285
|
}
|
|
2280
|
-
return /* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
|
|
2286
|
+
return /* @__PURE__ */ f(qe, { children: [
|
|
2287
|
+
/* @__PURE__ */ e(
|
|
2288
|
+
u,
|
|
2283
2289
|
{
|
|
2284
2290
|
component: "span",
|
|
2285
|
-
ref:
|
|
2286
|
-
onMouseEnter:
|
|
2287
|
-
onMouseLeave:
|
|
2288
|
-
onFocus:
|
|
2289
|
-
onBlur:
|
|
2291
|
+
ref: g,
|
|
2292
|
+
onMouseEnter: R,
|
|
2293
|
+
onMouseLeave: W,
|
|
2294
|
+
onFocus: R,
|
|
2295
|
+
onBlur: W,
|
|
2290
2296
|
onClick: () => {
|
|
2291
|
-
|
|
2297
|
+
m && (E(!0), A(!0));
|
|
2292
2298
|
},
|
|
2293
2299
|
sx: { display: "inline-flex" },
|
|
2294
|
-
children:
|
|
2300
|
+
children: t
|
|
2295
2301
|
}
|
|
2296
2302
|
),
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
|
|
2303
|
+
/* @__PURE__ */ e(
|
|
2304
|
+
xt,
|
|
2299
2305
|
{
|
|
2300
|
-
open:
|
|
2301
|
-
anchorEl:
|
|
2302
|
-
placement:
|
|
2306
|
+
open: i,
|
|
2307
|
+
anchorEl: g.current,
|
|
2308
|
+
placement: v,
|
|
2303
2309
|
modifiers: [
|
|
2304
2310
|
{ name: "offset", options: { offset: [0, 10] } },
|
|
2305
2311
|
{ name: "preventOverflow", options: { padding: 12 } }
|
|
2306
2312
|
],
|
|
2307
2313
|
sx: { zIndex: 1500 },
|
|
2308
|
-
children: /* @__PURE__ */
|
|
2309
|
-
|
|
2314
|
+
children: /* @__PURE__ */ e(
|
|
2315
|
+
mt,
|
|
2310
2316
|
{
|
|
2311
2317
|
onClickAway: () => {
|
|
2312
|
-
|
|
2318
|
+
b && (E(!1), A(!1));
|
|
2313
2319
|
},
|
|
2314
|
-
children: /* @__PURE__ */
|
|
2315
|
-
|
|
2320
|
+
children: /* @__PURE__ */ e(
|
|
2321
|
+
u,
|
|
2316
2322
|
{
|
|
2317
|
-
onMouseEnter:
|
|
2318
|
-
onMouseLeave:
|
|
2323
|
+
onMouseEnter: I,
|
|
2324
|
+
onMouseLeave: W,
|
|
2319
2325
|
sx: {
|
|
2320
2326
|
width: 320,
|
|
2321
2327
|
maxWidth: "calc(100vw - 24px)",
|
|
@@ -2324,18 +2330,18 @@ function Wr({
|
|
|
2324
2330
|
boxShadow: "0 24px 64px rgba(15,23,42,0.28)",
|
|
2325
2331
|
bgcolor: "background.paper"
|
|
2326
2332
|
},
|
|
2327
|
-
children: /* @__PURE__ */
|
|
2328
|
-
s ? /* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
n ? /* @__PURE__ */
|
|
2332
|
-
|
|
2333
|
+
children: /* @__PURE__ */ e(u, { ...$, sx: [{ p: 1.25 }, ...Array.isArray(w) ? w : w ? [w] : []], children: /* @__PURE__ */ f(H, { spacing: 1.25, children: [
|
|
2334
|
+
s ? /* @__PURE__ */ e(u, { sx: { borderRadius: 1, overflow: "hidden", bgcolor: "#e5e7eb" }, children: s }) : null,
|
|
2335
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
2336
|
+
/* @__PURE__ */ f(u, { sx: { minWidth: 0, flex: 1 }, children: [
|
|
2337
|
+
n ? /* @__PURE__ */ e(Y, { fontWeight: 900, children: n }) : null,
|
|
2338
|
+
a ? /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", sx: { mt: n ? 0.25 : 0 }, children: a }) : null
|
|
2333
2339
|
] }),
|
|
2334
|
-
|
|
2340
|
+
m ? /* @__PURE__ */ e(ce, { title: b ? "Unpin" : "Pin", children: /* @__PURE__ */ e(ue, { size: "small", onClick: U, children: b ? /* @__PURE__ */ e(gt, { fontSize: "small" }) : /* @__PURE__ */ e(bt, { fontSize: "small" }) }) }) : null
|
|
2335
2341
|
] }),
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2342
|
+
c || h.length ? /* @__PURE__ */ f(H, { direction: "row", spacing: 1, flexWrap: "wrap", children: [
|
|
2343
|
+
c ? /* @__PURE__ */ e(ie, { size: "small", variant: "outlined", startIcon: /* @__PURE__ */ e(ft, {}), onClick: G, children: V ? "Copied" : "Copy" }) : null,
|
|
2344
|
+
h.map((p) => /* @__PURE__ */ e(ie, { size: "small", variant: "contained", startIcon: p.icon, onClick: p.onClick, children: p.label }, p.id))
|
|
2339
2345
|
] }) : null
|
|
2340
2346
|
] }) })
|
|
2341
2347
|
}
|
|
@@ -2346,79 +2352,79 @@ function Wr({
|
|
|
2346
2352
|
)
|
|
2347
2353
|
] });
|
|
2348
2354
|
}
|
|
2349
|
-
const
|
|
2355
|
+
const Ce = {
|
|
2350
2356
|
neutral: "#64748b",
|
|
2351
2357
|
good: "#059669",
|
|
2352
2358
|
warning: "#d97706",
|
|
2353
2359
|
danger: "#dc2626"
|
|
2354
2360
|
};
|
|
2355
|
-
function
|
|
2356
|
-
return Math.min(Math.max(
|
|
2361
|
+
function Ft(t, n, a) {
|
|
2362
|
+
return Math.min(Math.max(t, n), a);
|
|
2357
2363
|
}
|
|
2358
|
-
function
|
|
2359
|
-
return
|
|
2364
|
+
function Yt(t) {
|
|
2365
|
+
return t.color ?? Ce[t.status ?? "neutral"];
|
|
2360
2366
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return typeof
|
|
2367
|
+
function Nt(t) {
|
|
2368
|
+
return typeof t.delta == "number" ? t.delta : typeof t.value == "number" && typeof t.previousValue == "number" && t.previousValue !== 0 ? (t.value - t.previousValue) / Math.abs(t.previousValue) * 100 : null;
|
|
2363
2369
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return
|
|
2370
|
+
function Ot(t) {
|
|
2371
|
+
return t.formatter ? t.formatter(t.value) : typeof t.value == "number" ? new Intl.NumberFormat("en", { maximumFractionDigits: 1 }).format(t.value) : t.value;
|
|
2366
2372
|
}
|
|
2367
|
-
function
|
|
2368
|
-
if (
|
|
2373
|
+
function Ht(t, n, a) {
|
|
2374
|
+
if (t.length < 2)
|
|
2369
2375
|
return "";
|
|
2370
|
-
const s = Math.min(...
|
|
2371
|
-
return
|
|
2372
|
-
const
|
|
2373
|
-
return `${
|
|
2376
|
+
const s = Math.min(...t), c = Math.max(...t) - s || 1;
|
|
2377
|
+
return t.map((v, m) => {
|
|
2378
|
+
const d = m / (t.length - 1) * n, k = a - (v - s) / c * a;
|
|
2379
|
+
return `${m === 0 ? "M" : "L"} ${d.toFixed(2)} ${k.toFixed(2)}`;
|
|
2374
2380
|
}).join(" ");
|
|
2375
2381
|
}
|
|
2376
|
-
function
|
|
2377
|
-
const
|
|
2378
|
-
return /* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2380
|
-
/* @__PURE__ */
|
|
2381
|
-
|
|
2382
|
-
|
|
2382
|
+
function jt({ values: t, color: n }) {
|
|
2383
|
+
const h = Ht(t, 180, 54), c = h ? `${h} L 180 54 L 0 54 Z` : "";
|
|
2384
|
+
return /* @__PURE__ */ f(u, { component: "svg", viewBox: "0 0 180 54", sx: { display: "block", width: "100%", height: 54 }, children: [
|
|
2385
|
+
/* @__PURE__ */ e(u, { component: "path", d: c, sx: { fill: j(n, 0.14) } }),
|
|
2386
|
+
/* @__PURE__ */ e(u, { component: "path", d: h, sx: { fill: "none", stroke: n, strokeWidth: 4, strokeLinecap: "round", strokeLinejoin: "round" } }),
|
|
2387
|
+
t.length ? /* @__PURE__ */ e(
|
|
2388
|
+
u,
|
|
2383
2389
|
{
|
|
2384
2390
|
component: "circle",
|
|
2385
2391
|
cx: 180,
|
|
2386
|
-
cy: 54 - (
|
|
2392
|
+
cy: 54 - (t[t.length - 1] - Math.min(...t)) / (Math.max(...t) - Math.min(...t) || 1) * 54,
|
|
2387
2393
|
r: 4,
|
|
2388
2394
|
sx: { fill: n }
|
|
2389
2395
|
}
|
|
2390
2396
|
) : null
|
|
2391
2397
|
] });
|
|
2392
2398
|
}
|
|
2393
|
-
function
|
|
2394
|
-
metrics:
|
|
2399
|
+
function nn({
|
|
2400
|
+
metrics: t,
|
|
2395
2401
|
title: n,
|
|
2396
|
-
subtitle:
|
|
2402
|
+
subtitle: a,
|
|
2397
2403
|
columns: s = 3,
|
|
2398
|
-
density:
|
|
2399
|
-
showSparklines:
|
|
2400
|
-
showProgress:
|
|
2401
|
-
sx:
|
|
2402
|
-
...
|
|
2404
|
+
density: h = "comfortable",
|
|
2405
|
+
showSparklines: c = !0,
|
|
2406
|
+
showProgress: v = !0,
|
|
2407
|
+
sx: m,
|
|
2408
|
+
...d
|
|
2403
2409
|
}) {
|
|
2404
|
-
const
|
|
2405
|
-
return /* @__PURE__ */
|
|
2406
|
-
|
|
2410
|
+
const k = h === "compact";
|
|
2411
|
+
return /* @__PURE__ */ f(
|
|
2412
|
+
u,
|
|
2407
2413
|
{
|
|
2408
|
-
...
|
|
2414
|
+
...d,
|
|
2409
2415
|
sx: [
|
|
2410
2416
|
{
|
|
2411
2417
|
width: "100%"
|
|
2412
2418
|
},
|
|
2413
|
-
...Array.isArray(
|
|
2419
|
+
...Array.isArray(m) ? m : m ? [m] : []
|
|
2414
2420
|
],
|
|
2415
2421
|
children: [
|
|
2416
|
-
n ||
|
|
2417
|
-
n ? /* @__PURE__ */
|
|
2418
|
-
|
|
2422
|
+
n || a ? /* @__PURE__ */ f(u, { sx: { mb: 2 }, children: [
|
|
2423
|
+
n ? /* @__PURE__ */ e(Y, { variant: "h6", fontWeight: 900, children: n }) : null,
|
|
2424
|
+
a ? /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", children: a }) : null
|
|
2419
2425
|
] }) : null,
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
|
|
2426
|
+
/* @__PURE__ */ e(
|
|
2427
|
+
u,
|
|
2422
2428
|
{
|
|
2423
2429
|
sx: {
|
|
2424
2430
|
display: "grid",
|
|
@@ -2427,60 +2433,60 @@ function Dr({
|
|
|
2427
2433
|
sm: "repeat(2, minmax(0, 1fr))",
|
|
2428
2434
|
lg: `repeat(${s}, minmax(0, 1fr))`
|
|
2429
2435
|
},
|
|
2430
|
-
gap:
|
|
2436
|
+
gap: k ? 1.25 : 2
|
|
2431
2437
|
},
|
|
2432
|
-
children:
|
|
2433
|
-
const
|
|
2434
|
-
return /* @__PURE__ */
|
|
2435
|
-
|
|
2438
|
+
children: t.map((w) => {
|
|
2439
|
+
const $ = Yt(w), g = Nt(w), B = (g ?? 0) >= 0;
|
|
2440
|
+
return /* @__PURE__ */ e(
|
|
2441
|
+
$e,
|
|
2436
2442
|
{
|
|
2437
2443
|
variant: "outlined",
|
|
2438
2444
|
sx: {
|
|
2439
|
-
p:
|
|
2445
|
+
p: k ? 1.5 : 2,
|
|
2440
2446
|
borderRadius: 1,
|
|
2441
2447
|
overflow: "hidden",
|
|
2442
2448
|
position: "relative",
|
|
2443
|
-
borderColor:
|
|
2444
|
-
background: `linear-gradient(180deg, ${
|
|
2449
|
+
borderColor: j($, 0.32),
|
|
2450
|
+
background: `linear-gradient(180deg, ${j($, 0.08)}, rgba(255,255,255,0) 42%)`
|
|
2445
2451
|
},
|
|
2446
|
-
children: /* @__PURE__ */
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2450
|
-
/* @__PURE__ */
|
|
2451
|
-
/* @__PURE__ */
|
|
2452
|
-
|
|
2452
|
+
children: /* @__PURE__ */ f(H, { spacing: k ? 1 : 1.5, children: [
|
|
2453
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", justifyContent: "space-between", children: [
|
|
2454
|
+
/* @__PURE__ */ f(u, { sx: { minWidth: 0 }, children: [
|
|
2455
|
+
/* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", fontWeight: 850, sx: { textTransform: "uppercase" }, children: w.label }),
|
|
2456
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 0.75, alignItems: "baseline", sx: { mt: 0.5 }, children: [
|
|
2457
|
+
/* @__PURE__ */ e(Y, { variant: k ? "h5" : "h4", fontWeight: 950, sx: { lineHeight: 1 }, children: Ot(w) }),
|
|
2458
|
+
w.unit ? /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", fontWeight: 800, children: w.unit }) : null
|
|
2453
2459
|
] })
|
|
2454
2460
|
] }),
|
|
2455
|
-
|
|
2461
|
+
w.icon ? /* @__PURE__ */ e(u, { sx: { color: $, display: "grid", placeItems: "center", mt: 0.25 }, children: w.icon }) : null
|
|
2456
2462
|
] }),
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
|
|
2463
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between", children: [
|
|
2464
|
+
g !== null ? /* @__PURE__ */ e(
|
|
2459
2465
|
we,
|
|
2460
2466
|
{
|
|
2461
2467
|
size: "small",
|
|
2462
|
-
label: `${
|
|
2468
|
+
label: `${B ? "+" : ""}${g.toFixed(1)}%`,
|
|
2463
2469
|
sx: {
|
|
2464
|
-
color:
|
|
2465
|
-
bgcolor:
|
|
2470
|
+
color: B ? Ce.good : Ce.danger,
|
|
2471
|
+
bgcolor: j(B ? Ce.good : Ce.danger, 0.12),
|
|
2466
2472
|
fontWeight: 850
|
|
2467
2473
|
}
|
|
2468
2474
|
}
|
|
2469
|
-
) : /* @__PURE__ */
|
|
2470
|
-
|
|
2475
|
+
) : /* @__PURE__ */ e(u, {}),
|
|
2476
|
+
w.helper ? /* @__PURE__ */ e(Y, { variant: "caption", color: "text.secondary", textAlign: "right", children: w.helper }) : null
|
|
2471
2477
|
] }),
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2478
|
+
c && w.trend?.length ? /* @__PURE__ */ e(jt, { values: w.trend, color: $ }) : null,
|
|
2479
|
+
v && typeof w.progress == "number" ? /* @__PURE__ */ e(
|
|
2480
|
+
yt,
|
|
2475
2481
|
{
|
|
2476
2482
|
variant: "determinate",
|
|
2477
|
-
value:
|
|
2483
|
+
value: Ft(w.progress, 0, 100),
|
|
2478
2484
|
sx: {
|
|
2479
2485
|
height: 8,
|
|
2480
2486
|
borderRadius: 999,
|
|
2481
|
-
bgcolor:
|
|
2487
|
+
bgcolor: j($, 0.14),
|
|
2482
2488
|
"& .MuiLinearProgress-bar": {
|
|
2483
|
-
bgcolor:
|
|
2489
|
+
bgcolor: $,
|
|
2484
2490
|
borderRadius: 999
|
|
2485
2491
|
}
|
|
2486
2492
|
}
|
|
@@ -2488,7 +2494,7 @@ function Dr({
|
|
|
2488
2494
|
) : null
|
|
2489
2495
|
] })
|
|
2490
2496
|
},
|
|
2491
|
-
|
|
2497
|
+
w.id
|
|
2492
2498
|
);
|
|
2493
2499
|
})
|
|
2494
2500
|
}
|
|
@@ -2497,25 +2503,432 @@ function Dr({
|
|
|
2497
2503
|
}
|
|
2498
2504
|
);
|
|
2499
2505
|
}
|
|
2506
|
+
const Vt = [
|
|
2507
|
+
{
|
|
2508
|
+
id: "todo",
|
|
2509
|
+
title: "To do",
|
|
2510
|
+
color: "#2563eb",
|
|
2511
|
+
cards: [
|
|
2512
|
+
{ id: "card-1", title: "Map user journey", description: "Find the rough edges before building.", tags: ["Research"] },
|
|
2513
|
+
{ id: "card-2", title: "Write API contract", description: "Lock the shape of the data.", tags: ["Backend"] }
|
|
2514
|
+
]
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
id: "doing",
|
|
2518
|
+
title: "Doing",
|
|
2519
|
+
color: "#d97706",
|
|
2520
|
+
cards: [
|
|
2521
|
+
{ id: "card-3", title: "Build board interactions", description: "Drag between columns and reorder cards.", tags: ["UI"], color: "#fef3c7" }
|
|
2522
|
+
]
|
|
2523
|
+
},
|
|
2524
|
+
{
|
|
2525
|
+
id: "done",
|
|
2526
|
+
title: "Done",
|
|
2527
|
+
color: "#059669",
|
|
2528
|
+
cards: [
|
|
2529
|
+
{ id: "card-4", title: "Choose visual system", description: "Dense, clean, and readable.", tags: ["Design"], color: "#dcfce7" }
|
|
2530
|
+
]
|
|
2531
|
+
}
|
|
2532
|
+
];
|
|
2533
|
+
function Ae(t) {
|
|
2534
|
+
return typeof crypto < "u" && "randomUUID" in crypto ? `${t}-${crypto.randomUUID()}` : `${t}-${Date.now()}-${Math.round(Math.random() * 1e3)}`;
|
|
2535
|
+
}
|
|
2536
|
+
function Gt(t, n, a) {
|
|
2537
|
+
const s = [...t], [h] = s.splice(n, 1);
|
|
2538
|
+
return s.splice(a, 0, h), s;
|
|
2539
|
+
}
|
|
2540
|
+
function je(t, n) {
|
|
2541
|
+
for (const a of t) {
|
|
2542
|
+
const s = a.cards.find((h) => h.id === n);
|
|
2543
|
+
if (s)
|
|
2544
|
+
return { card: s, column: a };
|
|
2545
|
+
}
|
|
2546
|
+
return null;
|
|
2547
|
+
}
|
|
2548
|
+
function Ve(t, n) {
|
|
2549
|
+
return t.map((a) => ({
|
|
2550
|
+
...a,
|
|
2551
|
+
cards: a.cards.filter((s) => s.id !== n)
|
|
2552
|
+
}));
|
|
2553
|
+
}
|
|
2554
|
+
function Ut(t, n, a, s) {
|
|
2555
|
+
return t.map((h) => {
|
|
2556
|
+
if (h.id !== n)
|
|
2557
|
+
return h;
|
|
2558
|
+
const c = [...h.cards];
|
|
2559
|
+
return c.splice(s, 0, a), {
|
|
2560
|
+
...h,
|
|
2561
|
+
cards: c
|
|
2562
|
+
};
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
function Ge(t, n) {
|
|
2566
|
+
const a = t.currentTarget.getBoundingClientRect();
|
|
2567
|
+
return t.clientY > a.top + a.height / 2 ? n + 1 : n;
|
|
2568
|
+
}
|
|
2569
|
+
function qt(t) {
|
|
2570
|
+
return t.split(",").map((n) => n.trim()).filter(Boolean);
|
|
2571
|
+
}
|
|
2572
|
+
function ve(t, n, a, s) {
|
|
2573
|
+
if (!n || n.type !== "card" || n.fromColumnId !== a)
|
|
2574
|
+
return !1;
|
|
2575
|
+
const c = t.find((v) => v.id === a)?.cards.findIndex((v) => v.id === n.cardId) ?? -1;
|
|
2576
|
+
return s === c || s === c + 1;
|
|
2577
|
+
}
|
|
2578
|
+
function Ue({
|
|
2579
|
+
compact: t,
|
|
2580
|
+
onDragOver: n,
|
|
2581
|
+
onDrop: a
|
|
2582
|
+
}) {
|
|
2583
|
+
return /* @__PURE__ */ e(
|
|
2584
|
+
u,
|
|
2585
|
+
{
|
|
2586
|
+
onDragOver: n,
|
|
2587
|
+
onDrop: a,
|
|
2588
|
+
sx: {
|
|
2589
|
+
height: t ? 44 : 56,
|
|
2590
|
+
border: 1,
|
|
2591
|
+
borderStyle: "dashed",
|
|
2592
|
+
borderColor: "primary.main",
|
|
2593
|
+
borderRadius: 1,
|
|
2594
|
+
bgcolor: j("#2563eb", 0.08),
|
|
2595
|
+
transition: "height 120ms ease, background-color 120ms ease"
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
);
|
|
2599
|
+
}
|
|
2600
|
+
function on({
|
|
2601
|
+
columns: t,
|
|
2602
|
+
defaultColumns: n = Vt,
|
|
2603
|
+
title: a = "Kanban",
|
|
2604
|
+
subtitle: s,
|
|
2605
|
+
density: h = "comfortable",
|
|
2606
|
+
allowColumnDrag: c = !0,
|
|
2607
|
+
onChange: v,
|
|
2608
|
+
onCardSelect: m,
|
|
2609
|
+
sx: d,
|
|
2610
|
+
...k
|
|
2611
|
+
}) {
|
|
2612
|
+
const [w, $] = S(n), [g, B] = S(null), [z, i] = S(null), [E, b] = S(null), [A, V] = S(""), [O, M] = S({}), [R, I] = S(null), [W, U] = S(""), [G, p] = S(""), [L, y] = S(""), [P, N] = S("#ffffff"), o = t ?? w, X = h === "compact", ee = R?.card ? je(o, R.card.id) : null, he = ze(() => o.reduce((l, x) => l + x.cards.length, 0), [o]);
|
|
2613
|
+
function te(l) {
|
|
2614
|
+
t || $(l), v?.(l);
|
|
2615
|
+
}
|
|
2616
|
+
function q() {
|
|
2617
|
+
const l = A.trim();
|
|
2618
|
+
l && (te([
|
|
2619
|
+
...o,
|
|
2620
|
+
{
|
|
2621
|
+
id: Ae("column"),
|
|
2622
|
+
title: l,
|
|
2623
|
+
cards: [],
|
|
2624
|
+
color: "#64748b"
|
|
2625
|
+
}
|
|
2626
|
+
]), V(""));
|
|
2627
|
+
}
|
|
2628
|
+
function ae(l, x) {
|
|
2629
|
+
te(o.map((r) => r.id === l ? { ...r, title: x } : r));
|
|
2630
|
+
}
|
|
2631
|
+
function K(l) {
|
|
2632
|
+
te(o.filter((x) => x.id !== l));
|
|
2633
|
+
}
|
|
2634
|
+
function re(l) {
|
|
2635
|
+
const x = O[l]?.trim();
|
|
2636
|
+
if (!x)
|
|
2637
|
+
return;
|
|
2638
|
+
const r = {
|
|
2639
|
+
id: Ae("card"),
|
|
2640
|
+
title: x
|
|
2641
|
+
};
|
|
2642
|
+
te(o.map((C) => C.id === l ? { ...C, cards: [...C.cards, r] } : C)), M((C) => ({ ...C, [l]: "" }));
|
|
2643
|
+
}
|
|
2644
|
+
function fe(l, x, r) {
|
|
2645
|
+
I({ columnId: l, mode: x, card: r }), U(r?.title ?? ""), p(r?.description ?? ""), y((r?.tags ?? []).join(", ")), N(r?.color ?? "#ffffff");
|
|
2646
|
+
}
|
|
2647
|
+
function se() {
|
|
2648
|
+
I(null), U(""), p(""), y(""), N("#ffffff");
|
|
2649
|
+
}
|
|
2650
|
+
function T() {
|
|
2651
|
+
if (!R || !W.trim())
|
|
2652
|
+
return;
|
|
2653
|
+
const l = {
|
|
2654
|
+
id: R.card?.id ?? Ae("card"),
|
|
2655
|
+
title: W.trim(),
|
|
2656
|
+
description: G.trim() || void 0,
|
|
2657
|
+
tags: qt(L),
|
|
2658
|
+
color: P
|
|
2659
|
+
};
|
|
2660
|
+
if (R.mode === "add") {
|
|
2661
|
+
te(o.map((x) => x.id === R.columnId ? { ...x, cards: [...x.cards, l] } : x)), se();
|
|
2662
|
+
return;
|
|
2663
|
+
}
|
|
2664
|
+
te(o.map((x) => ({
|
|
2665
|
+
...x,
|
|
2666
|
+
cards: x.cards.map((r) => r.id === l.id ? l : r)
|
|
2667
|
+
}))), se();
|
|
2668
|
+
}
|
|
2669
|
+
function le(l) {
|
|
2670
|
+
te(Ve(o, l)), se();
|
|
2671
|
+
}
|
|
2672
|
+
function ne(l, x, r) {
|
|
2673
|
+
const C = je(o, l);
|
|
2674
|
+
if (!C)
|
|
2675
|
+
return;
|
|
2676
|
+
const F = C.column.cards.findIndex((ye) => ye.id === l), D = C.column.id === x && F < r ? r - 1 : r, J = Ve(o, l), Z = J.find((ye) => ye.id === x), ge = Math.min(Math.max(D, 0), Z?.cards.length ?? 0);
|
|
2677
|
+
te(Ut(J, x, C.card, ge));
|
|
2678
|
+
}
|
|
2679
|
+
function Q(l, x) {
|
|
2680
|
+
if (ve(o, g, l, x)) {
|
|
2681
|
+
i(null);
|
|
2682
|
+
return;
|
|
2683
|
+
}
|
|
2684
|
+
i((r) => r?.columnId === l && r.index === x ? r : { columnId: l, index: x });
|
|
2685
|
+
}
|
|
2686
|
+
function oe() {
|
|
2687
|
+
B(null), i(null);
|
|
2688
|
+
}
|
|
2689
|
+
function me(l, x) {
|
|
2690
|
+
const r = o.findIndex((F) => F.id === l), C = o.findIndex((F) => F.id === x);
|
|
2691
|
+
r < 0 || C < 0 || r === C || te(Gt(o, r, C));
|
|
2692
|
+
}
|
|
2693
|
+
function xe(l, x) {
|
|
2694
|
+
if (l.preventDefault(), !g)
|
|
2695
|
+
return;
|
|
2696
|
+
if (g.type === "column") {
|
|
2697
|
+
me(g.columnId, x), oe();
|
|
2698
|
+
return;
|
|
2699
|
+
}
|
|
2700
|
+
const C = o.find((F) => F.id === x)?.cards.length ?? 0;
|
|
2701
|
+
ve(o, g, x, C) || ne(g.cardId, x, C), oe();
|
|
2702
|
+
}
|
|
2703
|
+
function Ie(l, x, r) {
|
|
2704
|
+
if (l.preventDefault(), l.stopPropagation(), !g || g.type !== "card")
|
|
2705
|
+
return;
|
|
2706
|
+
const C = Ge(l, r);
|
|
2707
|
+
ve(o, g, x, C) || ne(g.cardId, x, C), oe();
|
|
2708
|
+
}
|
|
2709
|
+
return /* @__PURE__ */ f(
|
|
2710
|
+
u,
|
|
2711
|
+
{
|
|
2712
|
+
...k,
|
|
2713
|
+
sx: [
|
|
2714
|
+
{
|
|
2715
|
+
width: "100%",
|
|
2716
|
+
color: "text.primary"
|
|
2717
|
+
},
|
|
2718
|
+
...Array.isArray(d) ? d : d ? [d] : []
|
|
2719
|
+
],
|
|
2720
|
+
children: [
|
|
2721
|
+
/* @__PURE__ */ f(H, { direction: { xs: "column", sm: "row" }, spacing: 2, alignItems: { xs: "stretch", sm: "center" }, justifyContent: "space-between", sx: { mb: 2 }, children: [
|
|
2722
|
+
/* @__PURE__ */ f(u, { children: [
|
|
2723
|
+
/* @__PURE__ */ e(Y, { variant: "h6", fontWeight: 900, children: a }),
|
|
2724
|
+
/* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", children: s ?? `${o.length} columns, ${he} cards` })
|
|
2725
|
+
] }),
|
|
2726
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, children: [
|
|
2727
|
+
/* @__PURE__ */ e(
|
|
2728
|
+
_,
|
|
2729
|
+
{
|
|
2730
|
+
size: "small",
|
|
2731
|
+
label: "New column",
|
|
2732
|
+
value: A,
|
|
2733
|
+
onChange: (l) => V(l.target.value),
|
|
2734
|
+
onKeyDown: (l) => {
|
|
2735
|
+
l.key === "Enter" && q();
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
),
|
|
2739
|
+
/* @__PURE__ */ e(ie, { variant: "contained", startIcon: /* @__PURE__ */ e(Be, {}), onClick: q, children: "Column" })
|
|
2740
|
+
] })
|
|
2741
|
+
] }),
|
|
2742
|
+
/* @__PURE__ */ e(
|
|
2743
|
+
u,
|
|
2744
|
+
{
|
|
2745
|
+
sx: {
|
|
2746
|
+
display: "grid",
|
|
2747
|
+
gridAutoFlow: { xs: "row", md: "column" },
|
|
2748
|
+
gridAutoColumns: { md: "minmax(280px, 1fr)" },
|
|
2749
|
+
gridTemplateColumns: { xs: "1fr", md: "none" },
|
|
2750
|
+
gap: 2,
|
|
2751
|
+
overflowX: { xs: "visible", md: "auto" },
|
|
2752
|
+
pb: 1
|
|
2753
|
+
},
|
|
2754
|
+
children: o.map((l) => /* @__PURE__ */ e(
|
|
2755
|
+
$e,
|
|
2756
|
+
{
|
|
2757
|
+
variant: "outlined",
|
|
2758
|
+
draggable: c && g?.type !== "card",
|
|
2759
|
+
onDragStart: () => {
|
|
2760
|
+
c && B({ type: "column", columnId: l.id });
|
|
2761
|
+
},
|
|
2762
|
+
onDragOver: (x) => {
|
|
2763
|
+
x.preventDefault(), g?.type === "card" && x.target === x.currentTarget && Q(l.id, l.cards.length);
|
|
2764
|
+
},
|
|
2765
|
+
onDrop: (x) => xe(x, l.id),
|
|
2766
|
+
onDragEnd: oe,
|
|
2767
|
+
sx: {
|
|
2768
|
+
p: X ? 1.25 : 1.5,
|
|
2769
|
+
borderRadius: 1,
|
|
2770
|
+
minHeight: 260,
|
|
2771
|
+
bgcolor: j(l.color ?? "#64748b", 0.06),
|
|
2772
|
+
borderColor: j(l.color ?? "#64748b", 0.28)
|
|
2773
|
+
},
|
|
2774
|
+
children: /* @__PURE__ */ f(H, { spacing: X ? 1 : 1.25, children: [
|
|
2775
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
2776
|
+
c ? /* @__PURE__ */ e(Ke, { fontSize: "small", color: "disabled" }) : null,
|
|
2777
|
+
E === l.id ? /* @__PURE__ */ e(
|
|
2778
|
+
_,
|
|
2779
|
+
{
|
|
2780
|
+
autoFocus: !0,
|
|
2781
|
+
fullWidth: !0,
|
|
2782
|
+
size: "small",
|
|
2783
|
+
value: l.title,
|
|
2784
|
+
onChange: (x) => ae(l.id, x.target.value),
|
|
2785
|
+
onBlur: () => b(null),
|
|
2786
|
+
onKeyDown: (x) => {
|
|
2787
|
+
x.key === "Enter" && b(null);
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
) : /* @__PURE__ */ e(Y, { fontWeight: 900, sx: { flex: 1, minWidth: 0 }, children: l.title }),
|
|
2791
|
+
/* @__PURE__ */ e(we, { size: "small", label: l.cards.length }),
|
|
2792
|
+
/* @__PURE__ */ e(ce, { title: "Rename column", children: /* @__PURE__ */ e(ue, { size: "small", onClick: () => b(l.id), children: /* @__PURE__ */ e(Ee, { fontSize: "small" }) }) }),
|
|
2793
|
+
/* @__PURE__ */ e(ce, { title: "Delete column", children: /* @__PURE__ */ e(ue, { size: "small", onClick: () => K(l.id), children: /* @__PURE__ */ e(_e, { fontSize: "small" }) }) })
|
|
2794
|
+
] }),
|
|
2795
|
+
/* @__PURE__ */ f(H, { spacing: 1, children: [
|
|
2796
|
+
l.cards.map((x, r) => {
|
|
2797
|
+
const C = g?.type === "card" && g.cardId !== x.id && z?.columnId === l.id && z.index === r, F = g?.type === "card" && g.cardId === x.id;
|
|
2798
|
+
return /* @__PURE__ */ f(u, { children: [
|
|
2799
|
+
C ? /* @__PURE__ */ e(u, { sx: { mb: 1 }, children: /* @__PURE__ */ e(
|
|
2800
|
+
Ue,
|
|
2801
|
+
{
|
|
2802
|
+
compact: X,
|
|
2803
|
+
onDragOver: (D) => {
|
|
2804
|
+
D.preventDefault(), D.stopPropagation(), Q(l.id, r);
|
|
2805
|
+
},
|
|
2806
|
+
onDrop: (D) => {
|
|
2807
|
+
D.preventDefault(), D.stopPropagation(), g?.type === "card" && (ve(o, g, l.id, r) || ne(g.cardId, l.id, r), oe());
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
) }) : null,
|
|
2811
|
+
/* @__PURE__ */ e(
|
|
2812
|
+
$e,
|
|
2813
|
+
{
|
|
2814
|
+
variant: "outlined",
|
|
2815
|
+
draggable: !0,
|
|
2816
|
+
onDragStart: (D) => {
|
|
2817
|
+
D.stopPropagation(), D.dataTransfer.effectAllowed = "move", B({ type: "card", cardId: x.id, fromColumnId: l.id }), Q(l.id, r);
|
|
2818
|
+
},
|
|
2819
|
+
onDragOver: (D) => {
|
|
2820
|
+
D.preventDefault(), D.stopPropagation(), Q(l.id, Ge(D, r));
|
|
2821
|
+
},
|
|
2822
|
+
onDrop: (D) => Ie(D, l.id, r),
|
|
2823
|
+
onDragEnd: oe,
|
|
2824
|
+
onClick: () => m?.(x, l),
|
|
2825
|
+
sx: {
|
|
2826
|
+
p: X ? 1.25 : 1.5,
|
|
2827
|
+
borderRadius: 1,
|
|
2828
|
+
cursor: F ? "grabbing" : "grab",
|
|
2829
|
+
bgcolor: x.color ?? "background.paper",
|
|
2830
|
+
borderColor: F ? "primary.main" : "divider",
|
|
2831
|
+
opacity: F ? 0.42 : 1,
|
|
2832
|
+
transform: F ? "scale(0.98)" : "scale(1)",
|
|
2833
|
+
transition: "transform 120ms ease, opacity 120ms ease, border-color 120ms ease",
|
|
2834
|
+
boxShadow: F ? "0 18px 40px rgba(37,99,235,0.22)" : void 0
|
|
2835
|
+
},
|
|
2836
|
+
children: /* @__PURE__ */ f(H, { spacing: 1, children: [
|
|
2837
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, alignItems: "flex-start", children: [
|
|
2838
|
+
/* @__PURE__ */ f(u, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
2839
|
+
/* @__PURE__ */ e(Y, { fontWeight: 850, children: x.title }),
|
|
2840
|
+
x.description ? /* @__PURE__ */ e(Y, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: x.description }) : null
|
|
2841
|
+
] }),
|
|
2842
|
+
/* @__PURE__ */ e(ue, { size: "small", onClick: (D) => {
|
|
2843
|
+
D.stopPropagation(), fe(l.id, "edit", x);
|
|
2844
|
+
}, children: /* @__PURE__ */ e(Ee, { fontSize: "small" }) })
|
|
2845
|
+
] }),
|
|
2846
|
+
x.tags?.length ? /* @__PURE__ */ e(H, { direction: "row", flexWrap: "wrap", gap: 0.75, children: x.tags.map((D) => /* @__PURE__ */ e(we, { size: "small", label: D }, D)) }) : null
|
|
2847
|
+
] })
|
|
2848
|
+
}
|
|
2849
|
+
)
|
|
2850
|
+
] }, x.id);
|
|
2851
|
+
}),
|
|
2852
|
+
g?.type === "card" && z?.columnId === l.id && z.index === l.cards.length ? /* @__PURE__ */ e(
|
|
2853
|
+
Ue,
|
|
2854
|
+
{
|
|
2855
|
+
compact: X,
|
|
2856
|
+
onDragOver: (x) => {
|
|
2857
|
+
x.preventDefault(), x.stopPropagation(), Q(l.id, l.cards.length);
|
|
2858
|
+
},
|
|
2859
|
+
onDrop: (x) => {
|
|
2860
|
+
x.preventDefault(), x.stopPropagation(), g?.type === "card" && (ve(o, g, l.id, l.cards.length) || ne(g.cardId, l.id, l.cards.length), oe());
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
) : null
|
|
2864
|
+
] }),
|
|
2865
|
+
/* @__PURE__ */ f(H, { direction: "row", spacing: 1, children: [
|
|
2866
|
+
/* @__PURE__ */ e(
|
|
2867
|
+
_,
|
|
2868
|
+
{
|
|
2869
|
+
fullWidth: !0,
|
|
2870
|
+
size: "small",
|
|
2871
|
+
label: "Quick card",
|
|
2872
|
+
value: O[l.id] ?? "",
|
|
2873
|
+
onChange: (x) => M((r) => ({ ...r, [l.id]: x.target.value })),
|
|
2874
|
+
onKeyDown: (x) => {
|
|
2875
|
+
x.key === "Enter" && re(l.id);
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
),
|
|
2879
|
+
/* @__PURE__ */ e(ie, { variant: "outlined", onClick: () => re(l.id), children: "Add" })
|
|
2880
|
+
] }),
|
|
2881
|
+
/* @__PURE__ */ e(ie, { startIcon: /* @__PURE__ */ e(Be, {}), onClick: () => fe(l.id, "add"), children: "Detailed card" })
|
|
2882
|
+
] })
|
|
2883
|
+
},
|
|
2884
|
+
l.id
|
|
2885
|
+
))
|
|
2886
|
+
}
|
|
2887
|
+
),
|
|
2888
|
+
/* @__PURE__ */ f(wt, { open: !!R, onClose: se, fullWidth: !0, maxWidth: "sm", children: [
|
|
2889
|
+
/* @__PURE__ */ e(kt, { children: R?.mode === "add" ? "Add card" : "Edit card" }),
|
|
2890
|
+
/* @__PURE__ */ e(Ct, { children: /* @__PURE__ */ f(H, { spacing: 2, sx: { pt: 1 }, children: [
|
|
2891
|
+
/* @__PURE__ */ e(_, { label: "Title", value: W, onChange: (l) => U(l.target.value), autoFocus: !0 }),
|
|
2892
|
+
/* @__PURE__ */ e(_, { label: "Description", value: G, onChange: (l) => p(l.target.value), multiline: !0, minRows: 3 }),
|
|
2893
|
+
/* @__PURE__ */ e(_, { label: "Tags", helperText: "Comma separated", value: L, onChange: (l) => y(l.target.value) }),
|
|
2894
|
+
/* @__PURE__ */ e(_, { label: "Color", value: P, onChange: (l) => N(l.target.value), select: !0, children: [
|
|
2895
|
+
{ label: "White", value: "#ffffff" },
|
|
2896
|
+
{ label: "Blue", value: "#dbeafe" },
|
|
2897
|
+
{ label: "Green", value: "#dcfce7" },
|
|
2898
|
+
{ label: "Yellow", value: "#fef3c7" },
|
|
2899
|
+
{ label: "Red", value: "#fee2e2" }
|
|
2900
|
+
].map((l) => /* @__PURE__ */ e(be, { value: l.value, children: l.label }, l.value)) })
|
|
2901
|
+
] }) }),
|
|
2902
|
+
/* @__PURE__ */ f(vt, { children: [
|
|
2903
|
+
ee ? /* @__PURE__ */ e(ie, { color: "error", onClick: () => le(ee.card.id), children: "Delete" }) : null,
|
|
2904
|
+
/* @__PURE__ */ e(ie, { onClick: se, children: "Cancel" }),
|
|
2905
|
+
/* @__PURE__ */ e(ie, { variant: "contained", onClick: T, children: R?.mode === "add" ? "Add" : "Save" })
|
|
2906
|
+
] })
|
|
2907
|
+
] })
|
|
2908
|
+
]
|
|
2909
|
+
}
|
|
2910
|
+
);
|
|
2911
|
+
}
|
|
2500
2912
|
export {
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2913
|
+
Zr as BeforeAfterSlider,
|
|
2914
|
+
Fr as CodeViewer,
|
|
2915
|
+
Qr as ColorPicker,
|
|
2916
|
+
Hr as CommandPalette,
|
|
2917
|
+
Xr as ComponentExample,
|
|
2918
|
+
nn as DataCardGrid,
|
|
2919
|
+
Or as DockBar,
|
|
2920
|
+
Yr as DraggableBox,
|
|
2921
|
+
Jr as FileDropZone,
|
|
2922
|
+
Vr as FloatingToolbar,
|
|
2923
|
+
Nr as GlassBox,
|
|
2924
|
+
tn as InfiniteCanvas,
|
|
2925
|
+
Kr as InspectorPanel,
|
|
2926
|
+
on as KanbanBoard,
|
|
2927
|
+
Gr as MagneticCard,
|
|
2928
|
+
qr as NodeCanvas,
|
|
2929
|
+
_r as ResizableFrame,
|
|
2930
|
+
rn as SmartTooltip,
|
|
2931
|
+
jr as SplitPane,
|
|
2932
|
+
Ur as SpotlightPanel,
|
|
2933
|
+
en as TimelineScrubber
|
|
2521
2934
|
};
|