@tenorlab/react-dashboard 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/DashboardGrid.d.ts +2 -0
  2. package/dist/components/DashboardWidgetBase.d.ts +4 -0
  3. package/dist/components/DynamicWidgetLoader.d.ts +23 -0
  4. package/dist/components/WidgetContainer.d.ts +4 -0
  5. package/dist/components/WidgetsCatalogFlyout.d.ts +14 -0
  6. package/dist/components/dashboard-primitives/Buttons.d.ts +2 -0
  7. package/dist/components/dashboard-primitives/DraggablePanel.d.ts +10 -0
  8. package/dist/components/dashboard-primitives/ListItem.d.ts +14 -0
  9. package/dist/components/dashboard-primitives/Stack.d.ts +9 -0
  10. package/dist/components/dashboard-primitives/TextField.d.ts +6 -0
  11. package/dist/components/dashboard-primitives/Wrappers.d.ts +6 -0
  12. package/dist/components/dashboard-primitives/color-utils.d.ts +12 -0
  13. package/dist/components/dashboard-primitives/css-vars-utils.d.ts +6 -0
  14. package/dist/components/dashboard-primitives/icons/index.d.ts +29 -0
  15. package/dist/components/dashboard-primitives/index.d.ts +13 -0
  16. package/dist/components/dashboard-primitives/interfaces.d.ts +46 -0
  17. package/dist/components/dashboard-primitives/parse-container-title.d.ts +2 -0
  18. package/dist/components/dashboard-primitives/use-distinct-css-classes.d.ts +1 -0
  19. package/dist/components/dashboard-settings/dashboard-settings-utils.d.ts +4 -0
  20. package/dist/components/dashboard-settings/dashboard-settings.d.ts +2 -0
  21. package/dist/components/dashboard-settings/index.d.ts +2 -0
  22. package/dist/components/index.d.ts +11 -0
  23. package/dist/components/interfaces/core-react.interfaces.d.ts +21 -0
  24. package/dist/components/interfaces/core.base.d.ts +80 -0
  25. package/dist/components/interfaces/core.interfaces.d.ts +39 -0
  26. package/dist/components/interfaces/core.utils.d.ts +55 -0
  27. package/dist/components/interfaces/index.d.ts +5 -0
  28. package/dist/components/interfaces/storage-service.interfaces.d.ts +8 -0
  29. package/dist/components/use-dashboard-storage-service.d.ts +2 -0
  30. package/dist/components/use-dashboard-store.d.ts +33 -0
  31. package/dist/components/use-dashboard-undo-service.d.ts +13 -0
  32. package/dist/index.d.ts +2 -0
  33. package/dist/react-dashboard.css +1 -0
  34. package/dist/react-dashboard.es.js +3256 -0
  35. package/package.json +1 -1
@@ -0,0 +1,3256 @@
1
+ import se, { useState as ce, useCallback as ue, useMemo as at, forwardRef as le, useRef as xt, Suspense as Ct, useEffect as St } from "react";
2
+ import { jsxs as W, jsx as a } from "react/jsx-runtime";
3
+ import st from "react-dom";
4
+ const Dt = [
5
+ {
6
+ key: "grid-gap",
7
+ displayName: "Gap",
8
+ description: "Set the gap between widgets in the dashboard grid",
9
+ cssProperty: "--bwj-dashboard-gap",
10
+ step: 0.1,
11
+ defaultUnit: "rem",
12
+ minValue: 0,
13
+ defaultValue: "1.25rem",
14
+ value: "1.25rem"
15
+ },
16
+ {
17
+ key: "widget-width",
18
+ displayName: "Widget Width",
19
+ description: "Set the min width for the widgets",
20
+ cssProperty: "--bwj-widget-width",
21
+ step: 0.1,
22
+ defaultUnit: "rem",
23
+ minValue: 6,
24
+ defaultValue: "21rem",
25
+ value: "21rem"
26
+ },
27
+ {
28
+ key: "widget-border-radius",
29
+ displayName: "Widget Border Radius",
30
+ description: "Set the border radius for the widgets",
31
+ cssProperty: "--bwj-widget-border-radius",
32
+ step: 0.1,
33
+ defaultUnit: "rem",
34
+ minValue: 0,
35
+ defaultValue: "0.33rem",
36
+ value: "0.33rem"
37
+ },
38
+ {
39
+ key: "widget-inner-padding-x",
40
+ displayName: "Widget Horiz Padding",
41
+ description: "Set the horizontal padding for the widgets",
42
+ cssProperty: "--bwj-widget-inner-px",
43
+ step: 0.1,
44
+ defaultUnit: "rem",
45
+ minValue: 0,
46
+ defaultValue: "1.0rem",
47
+ value: "1.0rem"
48
+ },
49
+ {
50
+ key: "widget-inner-padding-y",
51
+ displayName: "Widget Vertical Padding",
52
+ description: "Set the vertical padding for the widgets",
53
+ cssProperty: "--bwj-widget-inner-py",
54
+ step: 0.1,
55
+ defaultUnit: "rem",
56
+ minValue: 0,
57
+ defaultValue: "0.75rem",
58
+ value: "0.75rem"
59
+ },
60
+ {
61
+ key: "widget-header-padding-y",
62
+ displayName: "Widget Header Vertical Padding",
63
+ description: "Set the vertical padding for the widget headers",
64
+ cssProperty: "--bwj-widget-header-py",
65
+ step: 0.1,
66
+ defaultUnit: "rem",
67
+ minValue: 0,
68
+ defaultValue: "1.0rem",
69
+ value: "1.0rem"
70
+ },
71
+ {
72
+ key: "widget-title-font-size",
73
+ displayName: "Widget Title Font Size",
74
+ description: "Set the font size for the widget titles",
75
+ cssProperty: "--bwj-widget-title-size",
76
+ step: 0.1,
77
+ defaultUnit: "rem",
78
+ minValue: 0,
79
+ defaultValue: "1.0rem",
80
+ value: "1.0rem"
81
+ }
82
+ ], Tt = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], Nt = (e, n) => Tt.includes(e) ? n : 1, Et = {
83
+ incrementOrDecrementValue: (e, n) => {
84
+ const t = e.value.match(/([\d.]+)/), r = t ? parseFloat(t[1]) : 0, i = e.value.match(/([^\d.]+)/), o = i ? i[1] : e.defaultUnit, s = Nt(o, e.step) * n, p = `${Math.max(r + s, e.minValue).toFixed(1)}${o}`;
85
+ return {
86
+ ...e,
87
+ value: p
88
+ };
89
+ }
90
+ }, Ce = {
91
+ userID: 0,
92
+ clientAppKey: "",
93
+ dashboardId: "default",
94
+ dashboardName: "Default",
95
+ zoomScale: 1,
96
+ responsiveGrid: !1,
97
+ widgets: [],
98
+ childWidgetsConfig: [],
99
+ cssSettings: [...Dt]
100
+ }, Ae = 0.7, Fe = 1, _t = 0.05, lt = (e) => {
101
+ let n = Number(e || 0);
102
+ return n < Ae && (n = Ae), n > Fe && (n = Fe), n;
103
+ }, _n = (e, n) => {
104
+ let t = Number(Number((_t * n).toFixed(2)).toFixed(2)), r = Number((Number(e) + t).toFixed(2));
105
+ return lt(r);
106
+ }, Mn = (e) => {
107
+ let n = {
108
+ ...e
109
+ };
110
+ return n.widgets = n.widgets.filter((t) => {
111
+ if (`${t}`.includes("WidgetContainer")) {
112
+ const r = n.childWidgetsConfig.filter(
113
+ (i) => i.parentWidgetKey === t
114
+ );
115
+ if (!r || r.length === 0)
116
+ return n.widgets = n.widgets.filter(
117
+ (i) => i !== t
118
+ ), !1;
119
+ }
120
+ return !0;
121
+ }), n;
122
+ }, Mt = (e) => {
123
+ const n = e.widgets.filter(
124
+ (r) => r.includes("WidgetContainer")
125
+ ), t = {};
126
+ return n.forEach((r, i) => {
127
+ const d = `${r.split("_container")[0]}_container${i + 1}`;
128
+ t[r] = d;
129
+ }), e.widgets = e.widgets.map((r) => t[r] || r), e.childWidgetsConfig = e.childWidgetsConfig.map((r) => {
130
+ const i = r.parentWidgetKey, o = t[i];
131
+ return {
132
+ ...r,
133
+ // If a new key exists, use it. If not, keep the original key.
134
+ parentWidgetKey: o || i
135
+ };
136
+ }), e;
137
+ }, ge = (e, n) => {
138
+ const t = `${e}`.includes("Container"), r = t ? ["Container"] : ["Widget"], i = n?.title || e, o = n?.description || (t ? "Container" : "Unknown");
139
+ return {
140
+ title: i,
141
+ displayName: e,
142
+ description: o,
143
+ categories: r,
144
+ noDuplicatedWidgets: !0,
145
+ icon: void 0
146
+ };
147
+ }, Pn = (e, n, t) => {
148
+ const r = n[e];
149
+ return r || ge(e, t);
150
+ }, Pt = (e, n) => {
151
+ const r = n.get(e)?.meta;
152
+ return r || ge(e);
153
+ }, $n = (e, n, t) => {
154
+ const r = t || ge(e);
155
+ return [
156
+ e,
157
+ {
158
+ key: e,
159
+ title: r.displayName,
160
+ isContainer: `${e}`.includes("Container"),
161
+ meta: r,
162
+ component: n
163
+ }
164
+ ];
165
+ }, ct = (e, n, t) => {
166
+ const r = t || ge(e);
167
+ return [
168
+ e,
169
+ {
170
+ key: e,
171
+ title: r.displayName,
172
+ isContainer: !1,
173
+ meta: r,
174
+ loader: n
175
+ }
176
+ ];
177
+ }, $t = (e) => {
178
+ const n = e.match(/\/widget-([a-zA-Z0-9-]+)\/index\.ts$/);
179
+ if (n && n[1]) {
180
+ const t = n[1], r = `Widget${t.split("-").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join("")}`, i = t.split("-").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
181
+ return { key: r, title: i, folder: t };
182
+ }
183
+ return null;
184
+ }, Wt = (e, n, t) => {
185
+ const r = `${n}/${t}/${t}.meta.ts`, i = e[r];
186
+ if (i && i[`${key}Meta`])
187
+ return i[`${key}Meta`];
188
+ }, Wn = async (e, n, t) => {
189
+ const r = [];
190
+ for (const i in n) {
191
+ const o = n[i], s = $t(i);
192
+ if (s && o) {
193
+ const { key: d, title: p, folder: g } = s;
194
+ console.log("widgets-catalog: registering dynamic plugins", d, p, g);
195
+ let h = Wt(
196
+ //key,
197
+ t,
198
+ e,
199
+ g
200
+ );
201
+ h || (h = ge(d, {
202
+ title: p,
203
+ description: "Dynamic plugin widget"
204
+ })), r.push(ct(d, o, h));
205
+ }
206
+ }
207
+ return r;
208
+ }, In = async (e) => new Promise(async (n, t) => {
209
+ const r = [];
210
+ try {
211
+ const o = await (await fetch(`${e}?${Math.random()}`)).json();
212
+ for (const s in o) {
213
+ const d = o[s], p = () => import(
214
+ /* @vite-ignore */
215
+ d.url
216
+ ), g = {
217
+ displayName: d.meta.displayName,
218
+ description: d.meta.description || "Remote Plugin",
219
+ categories: d.meta.categories || ["Widget"],
220
+ noDuplicatedWidgets: d.meta.noDuplicatedWidgets ?? !0,
221
+ icon: void 0
222
+ // Or a logic to map a string name to a Lucide component
223
+ };
224
+ r.push(ct(s, p, g));
225
+ }
226
+ n({
227
+ entries: r,
228
+ message: "",
229
+ details: ""
230
+ });
231
+ } catch (i) {
232
+ console.error("Remote plugin discovery failed:", i), t({
233
+ entries: [],
234
+ message: "Remote plugin discovery failed:",
235
+ details: typeof i == "object" ? JSON.stringify(i) : i
236
+ });
237
+ }
238
+ }), Le = (e) => {
239
+ let n;
240
+ const t = /* @__PURE__ */ new Set(), r = (g, h) => {
241
+ const u = typeof g == "function" ? g(n) : g;
242
+ if (!Object.is(u, n)) {
243
+ const m = n;
244
+ n = h ?? (typeof u != "object" || u === null) ? u : Object.assign({}, n, u), t.forEach((y) => y(n, m));
245
+ }
246
+ }, i = () => n, d = { setState: r, getState: i, getInitialState: () => p, subscribe: (g) => (t.add(g), () => t.delete(g)) }, p = n = e(r, i, d);
247
+ return d;
248
+ }, It = ((e) => e ? Le(e) : Le), Ot = (e) => e;
249
+ function Rt(e, n = Ot) {
250
+ const t = se.useSyncExternalStore(
251
+ e.subscribe,
252
+ se.useCallback(() => n(e.getState()), [e, n]),
253
+ se.useCallback(() => n(e.getInitialState()), [e, n])
254
+ );
255
+ return se.useDebugValue(t), t;
256
+ }
257
+ const kt = (e) => {
258
+ const n = It(e), t = (r) => Rt(n, r);
259
+ return Object.assign(t, n), t;
260
+ }, jt = ((e) => kt), At = (e) => {
261
+ const n = e.widgets.filter((r) => r.includes("WidgetContainer")).map((r) => Number(r.split("_")[1].replace("container", "")));
262
+ return `container${n.length > 0 ? Math.max(...n) + 1 : 1}`;
263
+ }, Ft = (e, n) => {
264
+ const t = At(e);
265
+ return `${n}_${t}`;
266
+ }, Lt = (e) => {
267
+ const { dashboardConfig: n, widgetKey: t, parentWidgetKey: r, noDuplicatedWidgets: i } = e;
268
+ if (r) {
269
+ if (i && n.childWidgetsConfig.find(
270
+ (s) => s.parentWidgetKey === r && s.widgetKey === t
271
+ ))
272
+ return {
273
+ success: !1,
274
+ message: `DashboardStore: addWidget: Widget already added (${t})`,
275
+ updatedDashboardConfig: n
276
+ };
277
+ const o = [
278
+ ...n.childWidgetsConfig,
279
+ { parentWidgetKey: r, widgetKey: t }
280
+ // new entry
281
+ ];
282
+ return {
283
+ success: !0,
284
+ updatedDashboardConfig: {
285
+ ...n,
286
+ childWidgetsConfig: o
287
+ }
288
+ };
289
+ } else {
290
+ if (i && n.widgets.includes(t))
291
+ return {
292
+ success: !1,
293
+ message: `DashboardStore: addWidget: Widget already added (${t})`,
294
+ updatedDashboardConfig: n
295
+ };
296
+ const o = [...n.widgets, t];
297
+ return {
298
+ success: !0,
299
+ updatedDashboardConfig: {
300
+ ...n,
301
+ widgets: o
302
+ }
303
+ };
304
+ }
305
+ }, Ut = (e, n, t) => {
306
+ if ((t || "").trim().length > 0) {
307
+ const r = e.childWidgetsConfig.filter(
308
+ (p) => p.parentWidgetKey !== t
309
+ ), i = e.childWidgetsConfig.filter(
310
+ (p) => p.parentWidgetKey === t && p.widgetKey !== n
311
+ ), o = [...r, ...i];
312
+ let s = {
313
+ ...e,
314
+ childWidgetsConfig: o
315
+ };
316
+ return `${n}`.includes("Container") && (s = Mt(s)), {
317
+ success: !0,
318
+ updatedDashboardConfig: s
319
+ };
320
+ } else {
321
+ const r = e.widgets.filter((o) => o !== n), i = e.childWidgetsConfig.filter(
322
+ (o) => o.parentWidgetKey !== n
323
+ );
324
+ return {
325
+ success: !0,
326
+ updatedDashboardConfig: {
327
+ ...e,
328
+ widgets: r,
329
+ childWidgetsConfig: i
330
+ }
331
+ };
332
+ }
333
+ }, Vt = (e, n, t, r) => {
334
+ if ((r || "").trim().length > 0) {
335
+ const i = e.childWidgetsConfig.filter(
336
+ (h) => h.parentWidgetKey !== r
337
+ );
338
+ let o = e.childWidgetsConfig.filter(
339
+ (h) => h.parentWidgetKey === r
340
+ );
341
+ const s = o.indexOf(t);
342
+ let d = s + n;
343
+ if (d = Math.max(0, d), d = Math.min(o.length - 1, d), d === s)
344
+ return {
345
+ success: !1,
346
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
347
+ updatedDashboardConfig: e
348
+ };
349
+ const p = [...o], [g] = p.splice(s, 1);
350
+ return p.splice(d, 0, g), {
351
+ success: !0,
352
+ updatedDashboardConfig: {
353
+ ...e,
354
+ childWidgetsConfig: [...i, ...p]
355
+ }
356
+ };
357
+ } else {
358
+ const i = e.widgets || [], o = i.indexOf(t);
359
+ let s = o + n;
360
+ if (s = Math.max(0, s), s = Math.min(i.length - 1, s), s === o)
361
+ return {
362
+ success: !1,
363
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${t})`,
364
+ updatedDashboardConfig: e
365
+ };
366
+ const d = [...i], [p] = d.splice(o, 1);
367
+ return d.splice(s, 0, p), {
368
+ success: !0,
369
+ updatedDashboardConfig: {
370
+ ...e,
371
+ widgets: d
372
+ }
373
+ };
374
+ }
375
+ }, Yt = (e, n) => ({
376
+ isLoading: !1,
377
+ isEditing: !1,
378
+ allDashboardConfigs: [Ce],
379
+ currentDashboardConfig: Ce,
380
+ targetContainerKey: void 0,
381
+ getNextContainerKey: (t) => Ft(n().currentDashboardConfig, t),
382
+ setIsLoading: (t) => (e(() => ({ isLoading: t })), t),
383
+ setIsEditing: (t) => {
384
+ let r = n().targetContainerKey;
385
+ return t || (r = void 0), e(() => ({ isEditing: t, targetContainerKey: r })), t;
386
+ },
387
+ setTargetContainerKey: (t) => (e(() => ({ targetContainerKey: t })), t),
388
+ setAllDashboardConfigs: (t) => (e(() => ({ allDashboardConfigs: t })), n().allDashboardConfigs),
389
+ setCurrentDashboardConfig: (t) => {
390
+ const r = n(), i = [
391
+ ...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
392
+ t
393
+ ];
394
+ return e(() => ({
395
+ ...r,
396
+ allDashboardConfigs: i,
397
+ currentDashboardConfig: t
398
+ })), i;
399
+ },
400
+ addDashboardConfig: (t) => {
401
+ const r = n(), i = [
402
+ ...r.allDashboardConfigs.filter((o) => o.dashboardId !== t.dashboardId),
403
+ t
404
+ ];
405
+ return e(() => ({
406
+ ...r,
407
+ allDashboardConfigs: i,
408
+ currentDashboardConfig: t
409
+ })), i;
410
+ },
411
+ deleteDashboardConfigById: (t) => {
412
+ const r = n(), i = [...r.allDashboardConfigs.filter((o) => o.dashboardId !== t)];
413
+ return e(() => ({
414
+ ...r,
415
+ allDashboardConfigs: i,
416
+ currentDashboardConfig: i[0] || Ce
417
+ })), i;
418
+ },
419
+ selectDashboardById: (t) => (e(() => {
420
+ const r = n(), i = r.allDashboardConfigs.find((o) => o.dashboardId === t);
421
+ return i ? {
422
+ currentDashboardConfig: i
423
+ } : {
424
+ ...r
425
+ };
426
+ }), n().currentDashboardConfig),
427
+ addWidget: (t) => {
428
+ const r = n(), i = Lt({
429
+ dashboardConfig: r.currentDashboardConfig,
430
+ ...t
431
+ }), o = [
432
+ ...r.allDashboardConfigs.filter(
433
+ (s) => s.dashboardId !== i.updatedDashboardConfig.dashboardId
434
+ ),
435
+ i.updatedDashboardConfig
436
+ ];
437
+ return i.success && e(() => ({
438
+ allDashboardConfigs: o,
439
+ currentDashboardConfig: i.updatedDashboardConfig
440
+ })), {
441
+ ...i,
442
+ allUpdatedDashboardConfigs: o
443
+ };
444
+ },
445
+ removeWidget: (t, r) => {
446
+ const i = n(), o = Ut(i.currentDashboardConfig, t, r), s = [
447
+ ...i.allDashboardConfigs.filter(
448
+ (d) => d.dashboardId !== o.updatedDashboardConfig.dashboardId
449
+ ),
450
+ o.updatedDashboardConfig
451
+ ];
452
+ return o.success && e(() => ({
453
+ allDashboardConfigs: s,
454
+ currentDashboardConfig: o.updatedDashboardConfig
455
+ })), {
456
+ ...o,
457
+ allUpdatedDashboardConfigs: s
458
+ };
459
+ },
460
+ moveWidget: (t, r, i) => {
461
+ const o = n(), s = Vt(o.currentDashboardConfig, t, r, i), d = [
462
+ ...o.allDashboardConfigs.filter(
463
+ (p) => p.dashboardId !== s.updatedDashboardConfig.dashboardId
464
+ ),
465
+ s.updatedDashboardConfig
466
+ ];
467
+ return s.success && e(() => ({
468
+ allDashboardConfigs: d,
469
+ currentDashboardConfig: s.updatedDashboardConfig
470
+ })), {
471
+ ...s,
472
+ allUpdatedDashboardConfigs: d
473
+ };
474
+ }
475
+ }), On = jt()((...e) => ({
476
+ ...Yt(...e)
477
+ })), dt = (e, n) => `dashboards_${n}_${e}`, qt = async (e, n, t, r) => {
478
+ const i = localStorage.getItem(dt(e, n));
479
+ if (i)
480
+ try {
481
+ const o = JSON.parse(i);
482
+ return o.length < 1 ? [r] : (o.forEach((s) => {
483
+ s.dashboardId || (s.dashboardId = "default"), s.dashboardName || (s.dashboardName = `Dashboard ${s.dashboardId}`), s.responsiveGrid = s.responsiveGrid ?? !1, (s.widgets || []).length < 1 && (s.widgets = r.widgets);
484
+ const d = (s.cssSettings || []).filter(
485
+ (p) => r.cssSettings.some((g) => g.key === p.key)
486
+ );
487
+ if (d.length < 1)
488
+ s.cssSettings = [...r.cssSettings];
489
+ else {
490
+ d.forEach((g) => {
491
+ g.value = (g.value || "").replace(/NaN/g, "");
492
+ const h = r.cssSettings.find(
493
+ (u) => u.key === g.key
494
+ );
495
+ h && (Object.keys(h).forEach((u) => {
496
+ u in g || (g[u] = h[u]);
497
+ }), g.step = h.step, g.minValue = h.minValue, g.defaultValue = h.defaultValue, g.defaultUnit = h.defaultUnit, /\d+/g.test(g.value) === !1 && (g.value = h ? h.value : "1.0rem"));
498
+ });
499
+ const p = r.cssSettings.filter((g) => !d.some(
500
+ (h) => h.key === g.key
501
+ ));
502
+ s.cssSettings = [...d, ...p];
503
+ }
504
+ s.widgets = s.widgets.filter(
505
+ (p) => p.includes("WidgetContainer") || t.has(p)
506
+ ), s.childWidgetsConfig = s.childWidgetsConfig.filter(
507
+ (p) => t.has(p.widgetKey)
508
+ ), s.zoomScale ? s.zoomScale < 0.7 && (s.zoomScale = 0.7) : s.zoomScale = 1;
509
+ }), o);
510
+ } catch (o) {
511
+ console.warn("Error parsing saved dashboard config:", o);
512
+ }
513
+ return [r];
514
+ }, zt = async (e, n, t, r) => {
515
+ t.forEach((o) => {
516
+ if (o.userID = e, o.clientAppKey = n, o.responsiveGrid = o.responsiveGrid ?? !1, typeof o != "object")
517
+ throw new Error("Invalid dashboard configuration");
518
+ o.widgets = o.widgets.filter(
519
+ (s) => s.includes("WidgetContainer") || r.has(s)
520
+ ), o.childWidgetsConfig = o.childWidgetsConfig.filter(
521
+ (s) => r.has(s.widgetKey)
522
+ ), o.zoomScale ? o.zoomScale < 0.7 && (o.zoomScale = 0.7) : o.zoomScale = 1;
523
+ });
524
+ const i = JSON.stringify(t);
525
+ return localStorage.setItem(dt(e, n), i), !0;
526
+ }, Bt = {
527
+ getSavedDashboards: qt,
528
+ saveDashboards: zt
529
+ }, Rn = () => Bt, kn = () => {
530
+ const [e, n] = ce({}), [t, r] = ce({}), i = ue((h) => {
531
+ const u = h.dashboardId;
532
+ n((m) => {
533
+ const y = {
534
+ undoIndex: 0,
535
+ config: h
536
+ };
537
+ return r((x) => ({
538
+ ...x,
539
+ [u]: 0
540
+ })), {
541
+ ...m,
542
+ [u]: [y]
543
+ // Forces a reset to just this one entry
544
+ };
545
+ });
546
+ }, []), o = ue(
547
+ (h) => {
548
+ n((u) => {
549
+ const m = h.dashboardId, y = u[m] || [], x = t[m] ?? -1, v = y.slice(0, x + 1), b = {
550
+ undoIndex: v.length,
551
+ // New index based on trimmed length
552
+ config: h
553
+ }, C = [...v, b];
554
+ return r((T) => ({
555
+ ...T,
556
+ [m]: C.length - 1
557
+ // Index is now the last element's index
558
+ })), {
559
+ ...u,
560
+ [m]: C
561
+ };
562
+ });
563
+ },
564
+ [t]
565
+ ), s = ue((h) => {
566
+ n((u) => {
567
+ if (!u[h])
568
+ return u;
569
+ const { [h]: m, ...y } = u;
570
+ return y;
571
+ }), r((u) => {
572
+ const { [h]: m, ...y } = u;
573
+ return y;
574
+ });
575
+ }, []), d = ue(
576
+ (h) => {
577
+ r((u) => {
578
+ const m = u[h] ?? -1, y = Math.max(0, m - 1);
579
+ return y !== m ? { ...u, [h]: y } : u;
580
+ });
581
+ },
582
+ [
583
+ //loadConfigFromHistory
584
+ ]
585
+ ), p = ue(
586
+ (h) => {
587
+ r((u) => {
588
+ const m = e[h]?.length || 0, y = u[h] ?? -1, x = Math.min(m - 1, y + 1);
589
+ return x !== y ? { ...u, [h]: x } : u;
590
+ });
591
+ },
592
+ [
593
+ e
594
+ //loadConfigFromHistory,
595
+ ]
596
+ );
597
+ return {
598
+ initializeHistoryForDashboard: i,
599
+ resetAllHistory: () => n({}),
600
+ addUndoEntry: o,
601
+ removeUndoHistoryForDashboard: s,
602
+ undo: d,
603
+ redo: p,
604
+ getUndoStatus: (h) => {
605
+ const u = t[h] ?? -1, m = e[h]?.length || 0, y = u <= 0, x = u >= m - 1;
606
+ return { isUndoDisabled: y, isRedoDisabled: x };
607
+ },
608
+ undoHistory: e,
609
+ historyIndex: t
610
+ // (Optional: You might expose undoHistory and historyIndex if needed for debugging)
611
+ };
612
+ };
613
+ function K({
614
+ children: e,
615
+ className: n
616
+ }) {
617
+ return /* @__PURE__ */ a(
618
+ "svg",
619
+ {
620
+ xmlns: "http://www.w3.org/2000/svg",
621
+ width: "24",
622
+ height: "24",
623
+ viewBox: "0 0 24 24",
624
+ fill: "none",
625
+ stroke: "currentColor",
626
+ strokeWidth: "2",
627
+ strokeLinecap: "round",
628
+ strokeLinejoin: "round",
629
+ className: n,
630
+ children: e
631
+ }
632
+ );
633
+ }
634
+ function jn({ className: e }) {
635
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-circle-plus-icon lucide-circle-plus ${e}`, children: [
636
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
637
+ /* @__PURE__ */ a("path", { d: "M8 12h8" }),
638
+ /* @__PURE__ */ a("path", { d: "M12 8v8" })
639
+ ] });
640
+ }
641
+ function An({ className: e }) {
642
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-trash2-icon lucide-trash-2 ${e}`, children: [
643
+ /* @__PURE__ */ a("path", { d: "M10 11v6" }),
644
+ /* @__PURE__ */ a("path", { d: "M14 11v6" }),
645
+ /* @__PURE__ */ a("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
646
+ /* @__PURE__ */ a("path", { d: "M3 6h18" }),
647
+ /* @__PURE__ */ a("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
648
+ ] });
649
+ }
650
+ function Fn({ className: e }) {
651
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-square-pen-icon lucide-square-pen ${e}`, children: [
652
+ /* @__PURE__ */ a("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
653
+ /* @__PURE__ */ a("path", { d: "M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z" })
654
+ ] });
655
+ }
656
+ function Ln({ className: e }) {
657
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-grid3x3-icon lucide-grid-3x3 ${e}`, children: [
658
+ /* @__PURE__ */ a("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
659
+ /* @__PURE__ */ a("path", { d: "M3 9h18" }),
660
+ /* @__PURE__ */ a("path", { d: "M3 15h18" }),
661
+ /* @__PURE__ */ a("path", { d: "M9 3v18" }),
662
+ /* @__PURE__ */ a("path", { d: "M15 3v18" })
663
+ ] });
664
+ }
665
+ function Un({ className: e }) {
666
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-monitor-icon lucide-monitor ${e}`, children: [
667
+ /* @__PURE__ */ a("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
668
+ /* @__PURE__ */ a("line", { x1: "8", x2: "16", y1: "21", y2: "21" }),
669
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "17", y2: "21" })
670
+ ] });
671
+ }
672
+ function Vn({ className: e }) {
673
+ return /* @__PURE__ */ W(
674
+ K,
675
+ {
676
+ className: `lucide lucide-monitor-smartphone-icon lucide-monitor-smartphone ${e}`,
677
+ children: [
678
+ /* @__PURE__ */ a("path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8" }),
679
+ /* @__PURE__ */ a("path", { d: "M10 19v-3.96 3.15" }),
680
+ /* @__PURE__ */ a("path", { d: "M7 19h5" }),
681
+ /* @__PURE__ */ a("rect", { width: "6", height: "10", x: "16", y: "12", rx: "2" })
682
+ ]
683
+ }
684
+ );
685
+ }
686
+ function ut({ className: e }) {
687
+ return /* @__PURE__ */ W(
688
+ K,
689
+ {
690
+ className: `lucide lucide-circle-arrow-left-icon lucide-circle-arrow-left ${e}`,
691
+ children: [
692
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
693
+ /* @__PURE__ */ a("path", { d: "m12 8-4 4 4 4" }),
694
+ /* @__PURE__ */ a("path", { d: "M16 12H8" })
695
+ ]
696
+ }
697
+ );
698
+ }
699
+ function ft({ className: e }) {
700
+ return /* @__PURE__ */ W(
701
+ K,
702
+ {
703
+ className: `lucide lucide-circle-arrow-right-icon lucide-circle-arrow-right ${e}`,
704
+ children: [
705
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
706
+ /* @__PURE__ */ a("path", { d: "m12 16 4-4-4-4" }),
707
+ /* @__PURE__ */ a("path", { d: "M8 12h8" })
708
+ ]
709
+ }
710
+ );
711
+ }
712
+ function Kt({ className: e }) {
713
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-settings-icon lucide-settings ${e}`, children: [
714
+ /* @__PURE__ */ a("path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }),
715
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "3" })
716
+ ] });
717
+ }
718
+ function Yn({ className: e }) {
719
+ return /* @__PURE__ */ W(
720
+ K,
721
+ {
722
+ className: `lucide lucide-tablet-smartphone-icon lucide-tablet-smartphone ${e}`,
723
+ children: [
724
+ /* @__PURE__ */ a("rect", { width: "10", height: "14", x: "3", y: "8", rx: "2" }),
725
+ /* @__PURE__ */ a("path", { d: "M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4" }),
726
+ /* @__PURE__ */ a("path", { d: "M8 18h.01" })
727
+ ]
728
+ }
729
+ );
730
+ }
731
+ function ht({ className: e }) {
732
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-circle-x-icon lucide-circle-x ${e}`, children: [
733
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
734
+ /* @__PURE__ */ a("path", { d: "m15 9-6 6" }),
735
+ /* @__PURE__ */ a("path", { d: "m9 9 6 6" })
736
+ ] });
737
+ }
738
+ function qn({ className: e }) {
739
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-zoom-in-icon lucide-zoom-in ${e}`, children: [
740
+ /* @__PURE__ */ a("circle", { cx: "11", cy: "11", r: "8" }),
741
+ /* @__PURE__ */ a("line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }),
742
+ /* @__PURE__ */ a("line", { x1: "11", x2: "11", y1: "8", y2: "14" }),
743
+ /* @__PURE__ */ a("line", { x1: "8", x2: "14", y1: "11", y2: "11" })
744
+ ] });
745
+ }
746
+ function zn({ className: e }) {
747
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-zoom-out-icon lucide-zoom-out ${e}`, children: [
748
+ /* @__PURE__ */ a("circle", { cx: "11", cy: "11", r: "8" }),
749
+ /* @__PURE__ */ a("line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }),
750
+ /* @__PURE__ */ a("line", { x1: "8", x2: "14", y1: "11", y2: "11" })
751
+ ] });
752
+ }
753
+ function Ht({ className: e }) {
754
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-timer-reset-icon lucide-timer-reset ${e}`, children: [
755
+ /* @__PURE__ */ a("path", { d: "M10 2h4" }),
756
+ /* @__PURE__ */ a("path", { d: "M12 14v-4" }),
757
+ /* @__PURE__ */ a("path", { d: "M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6" }),
758
+ /* @__PURE__ */ a("path", { d: "M9 17H4v5" })
759
+ ] });
760
+ }
761
+ function Xt({ className: e }) {
762
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-undo-icon lucide-undo ${e}`, children: [
763
+ /* @__PURE__ */ a("path", { d: "M3 7v6h6" }),
764
+ /* @__PURE__ */ a("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" })
765
+ ] });
766
+ }
767
+ function Gt({ className: e }) {
768
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-redo-icon lucide-redo ${e}`, children: [
769
+ /* @__PURE__ */ a("path", { d: "M21 7v6h-6" }),
770
+ /* @__PURE__ */ a("path", { d: "M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" })
771
+ ] });
772
+ }
773
+ function Zt({ className: e }) {
774
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-hand-icon lucide-hand ${e}`, children: [
775
+ /* @__PURE__ */ a("path", { d: "M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2" }),
776
+ /* @__PURE__ */ a("path", { d: "M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" }),
777
+ /* @__PURE__ */ a("path", { d: "M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8" }),
778
+ /* @__PURE__ */ a("path", { d: "M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" })
779
+ ] });
780
+ }
781
+ function Jt({ className: e }) {
782
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-hand-grab-icon lucide-hand-grab ${e}`, children: [
783
+ /* @__PURE__ */ a("path", { d: "M18 11.5V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1.4" }),
784
+ /* @__PURE__ */ a("path", { d: "M14 10V8a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" }),
785
+ /* @__PURE__ */ a("path", { d: "M10 9.9V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v5" }),
786
+ /* @__PURE__ */ a("path", { d: "M6 14a2 2 0 0 0-2-2a2 2 0 0 0-2 2" }),
787
+ /* @__PURE__ */ a("path", { d: "M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-4a8 8 0 0 1-8-8 2 2 0 1 1 4 0" })
788
+ ] });
789
+ }
790
+ function Qt({ className: e }) {
791
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-crosshair-icon lucide-crosshair ${e}`, children: [
792
+ /* @__PURE__ */ a("line", { x1: "22", x2: "18", y1: "12", y2: "12" }),
793
+ /* @__PURE__ */ a("line", { x1: "6", x2: "2", y1: "12", y2: "12" }),
794
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "6", y2: "2" }),
795
+ /* @__PURE__ */ a("line", { x1: "12", x2: "12", y1: "22", y2: "18" })
796
+ ] });
797
+ }
798
+ function Bn({ className: e }) {
799
+ return /* @__PURE__ */ W(K, { className: `lucide lucide-target-icon lucide-target ${e}`, children: [
800
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
801
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "6" }),
802
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "2" })
803
+ ] });
804
+ }
805
+ function en({ className: e }) {
806
+ return /* @__PURE__ */ W(
807
+ K,
808
+ {
809
+ className: `lucide lucide-file-question-mark-icon lucide-file-question-mark ${e}`,
810
+ children: [
811
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "10" }),
812
+ /* @__PURE__ */ a("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
813
+ /* @__PURE__ */ a("path", { d: "M12 17h.01" })
814
+ ]
815
+ }
816
+ );
817
+ }
818
+ const Z = (e, ...n) => [
819
+ ...new Set(
820
+ [e || "", ...n].join(" ").trim().replace(/\n+/gi, " ").replace(/\s+/gi, " ").split(" ")
821
+ )
822
+ ].join(" ").trim(), re = (e, n = "color") => {
823
+ if (typeof window > "u") return "#FFFFFF";
824
+ const t = document.createElement("div");
825
+ Array.isArray(e) ? e.forEach((i) => t.classList.add(i)) : e.split(" ").forEach((i) => t.classList.add(i)), t.style.display = "none", document.body.appendChild(t);
826
+ const r = window.getComputedStyle(t)[n];
827
+ return document.body.removeChild(t), r;
828
+ }, Kn = {
829
+ primary: re("text-primary", "color"),
830
+ secondary: re("text-secondary", "color"),
831
+ success: re("text-success", "color"),
832
+ danger: re("text-danger", "color"),
833
+ warning: re("text-warning", "color"),
834
+ info: re("text-info", "color"),
835
+ disabled: re("text-disabled", "color"),
836
+ neutral: re("text-neutral", "color"),
837
+ body: re("text-body", "color")
838
+ }, Hn = {
839
+ getCssVariableValue: (e) => {
840
+ const n = document.documentElement;
841
+ return getComputedStyle(n).getPropertyValue(e).trim() || null;
842
+ },
843
+ setCssVariableValue: (e, n) => {
844
+ document.documentElement.style.setProperty(e, n);
845
+ },
846
+ restoreCssVarsFromSettings: (e) => {
847
+ const n = document.documentElement;
848
+ e.forEach((t) => {
849
+ n.style.setProperty(t.cssProperty, t.value);
850
+ });
851
+ }
852
+ }, gt = (e) => {
853
+ const n = `${e}`.split("_");
854
+ return n.length > 1 ? n[1].replace(/(\D)(\d+)/, "$1 $2") : "Container";
855
+ }, mt = ({
856
+ label: e,
857
+ className: n,
858
+ size: t = "medium",
859
+ value: r,
860
+ onChange: i,
861
+ onKeyDown: o,
862
+ placeholder: s = ""
863
+ }) => {
864
+ const d = at(() => t === "small" ? "py-1.5 px-3 text-sm" : "py-2.5 px-4 text-base", [t]), p = Z("flex flex-col mb-4", n || ""), h = `${Z(`
865
+ block w-full rounded-md px-3 py-1.5 text-base
866
+ bg-formfield content-formfield
867
+ outline-1 -outline-offset-1 outline-primary
868
+ placeholder:text-disabled
869
+ focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-200 sm:text-sm/6
870
+ `)} ${d}`;
871
+ return /* @__PURE__ */ W("div", { className: p, children: [
872
+ /* @__PURE__ */ a("label", { htmlFor: e, className: "block text-sm/6 font-medium mb-1.5", children: e }),
873
+ /* @__PURE__ */ a(
874
+ "input",
875
+ {
876
+ id: e,
877
+ type: "text",
878
+ value: r,
879
+ onChange: i,
880
+ onKeyDown: (u) => o && o(u),
881
+ placeholder: s,
882
+ className: h,
883
+ "aria-label": e
884
+ }
885
+ )
886
+ ] });
887
+ }, Se = /* @__PURE__ */ new Map([
888
+ [
889
+ "normal",
890
+ "group bg-[category] content-[category] hover:bg-[category] group-hover:bg-[category] focus:outline-[category] focus:outline-offset-[category]"
891
+ ],
892
+ [
893
+ "ghost",
894
+ "group bg-transparent border-[category] text-[category] hover:text-[category] group-hover:text-[category] focus:outline-[category] focus:outline-offset-[category]"
895
+ ]
896
+ ]);
897
+ function J(e) {
898
+ const {
899
+ tooltip: n,
900
+ disabled: t,
901
+ isIconButton: r,
902
+ className: i,
903
+ buttonType: o,
904
+ category: s,
905
+ px: d,
906
+ py: p,
907
+ children: g,
908
+ ...h
909
+ } = e, u = () => {
910
+ const y = e.isIconButton || !1, x = e.category || "primary", v = e.buttonType || "normal", b = e.disabled || !1, C = e.className || "", T = e.font || "semibold", S = Number((e.border || 0) > 0 ? e.border : 0);
911
+ let D = (e.borderColor || "").trim();
912
+ D = D.length > 0 ? D : "";
913
+ const c = Number((e.borderHover || 0) > 0 ? e.borderHover : 0), N = e.shadow || "sm", l = e.shadowHover || "md", f = (e.addCss || "").trim(), P = e.justifyCss || "justify-center";
914
+ if (y)
915
+ return Z(
916
+ "flex flex-row items-center",
917
+ b ? "text-disabled" : `text-${x} hover:brightness-110 cursor-pointer`,
918
+ C || ""
919
+ );
920
+ const $ = [
921
+ "relative cursor-pointer",
922
+ "rounded-sm focus:outline-none focus:ring focus:ring-offset",
923
+ "transition-all duration-150",
924
+ "text-sm",
925
+ `font-${T}`
926
+ ];
927
+ if (b)
928
+ v === "ghost" ? $.push("text-disabled border-disabled cursor-not-allowed") : $.push("bg-disabled content-disabled border-disabled cursor-not-allowed");
929
+ else {
930
+ $.push("cursor-pointer");
931
+ let O = "";
932
+ Se.has(v) ? O = `${Se.get(v)}` : O = `${Se.get("normal")}`, S < 1 && (O = O.replace("border-[category]", ""));
933
+ const E = O.replace(/\[category\]/g, x).trim();
934
+ $.push(E);
935
+ }
936
+ return S > 0 ? ($.push(`border-[${S}px]`), $.push(`border-${D}`)) : ($.push("border-[1px]"), $.push("border-transparent")), c > 0 ? ($.push(`hover:border-[${c}px] group-hover:border-[${c}px]`), $.push(`hover:border-${D} group-hover:border-${D}`)) : $.push("hover:border-[1px] group-hover:border-[1px]"), $.push(`shadow-${N}`), $.push(`hover:shadow-${l} group-hover:shadow-${l}`), f.length > 0 && $.push(f), f.indexOf("hidden") === -1 && $.push("inline-flex"), $.push(P), $.join(" ").trim();
937
+ }, m = () => {
938
+ const y = e.px || 0.7, x = e.py || 0.25;
939
+ return {
940
+ padding: r ? 0 : `${x}rem ${y}rem `
941
+ };
942
+ };
943
+ return /* @__PURE__ */ a("button", { type: "button", disabled: t, className: u(), style: m(), ...h, children: g });
944
+ }
945
+ const tn = (e) => e.direction === "row" ? Z("flex flex-row items-center gap-2", e.classNames || "") : Z("flex flex-col gap-2 w-full", e.classNames || "");
946
+ function nn(e) {
947
+ const { children: n, testId: t, classNames: r, direction: i, ...o } = e, s = tn(e);
948
+ return /* @__PURE__ */ a("div", { "data-testid": t || "not-set", className: s, ...o, children: n });
949
+ }
950
+ const Xn = le(
951
+ (e, n) => {
952
+ const { classNames: t, innerClass: r, ...i } = e, o = Z(t || "", "w-full"), s = Z(
953
+ `w-full flex overflow-hidden justify-between items-center gap-0
954
+ rounded-md border`,
955
+ r || ""
956
+ );
957
+ return /* @__PURE__ */ a(nn, { direction: "row", classNames: o, ...i, children: /* @__PURE__ */ a("div", { className: s, children: e.children }) });
958
+ }
959
+ ), Gn = le((e, n) => /* @__PURE__ */ a(
960
+ "div",
961
+ {
962
+ "data-testid": e.testId || "not-set",
963
+ className: "flex items-center justify-center",
964
+ style: {
965
+ flexShrink: 0,
966
+ padding: "0.75rem 0 0.75rem 0.75rem"
967
+ },
968
+ children: e.children
969
+ }
970
+ )), Zn = le(
971
+ (e, n) => /* @__PURE__ */ a(
972
+ "div",
973
+ {
974
+ "data-testid": e.testId || "not-set",
975
+ className: "flex-1 flex flex-col gap-0 truncate p-2",
976
+ children: e.children
977
+ }
978
+ )
979
+ ), Jn = le((e, n) => /* @__PURE__ */ a(
980
+ "div",
981
+ {
982
+ "data-testid": e.testId || "not-set",
983
+ className: "flex flex-row items-center justify-between gap-1 h-full",
984
+ style: {
985
+ flexShrink: 0,
986
+ paddingRight: "0.65rem"
987
+ },
988
+ children: e.children
989
+ }
990
+ ));
991
+ function rn(e) {
992
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
993
+ }
994
+ var fe = { exports: {} }, De = {}, pe = { exports: {} }, ye = { exports: {} }, V = {};
995
+ var Ue;
996
+ function on() {
997
+ if (Ue) return V;
998
+ Ue = 1;
999
+ var e = typeof Symbol == "function" && Symbol.for, n = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, t = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, o = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, p = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, g = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, h = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, u = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, m = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, x = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, b = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
1000
+ function S(c) {
1001
+ if (typeof c == "object" && c !== null) {
1002
+ var N = c.$$typeof;
1003
+ switch (N) {
1004
+ case n:
1005
+ switch (c = c.type, c) {
1006
+ case p:
1007
+ case g:
1008
+ case r:
1009
+ case o:
1010
+ case i:
1011
+ case u:
1012
+ return c;
1013
+ default:
1014
+ switch (c = c && c.$$typeof, c) {
1015
+ case d:
1016
+ case h:
1017
+ case x:
1018
+ case y:
1019
+ case s:
1020
+ return c;
1021
+ default:
1022
+ return N;
1023
+ }
1024
+ }
1025
+ case t:
1026
+ return N;
1027
+ }
1028
+ }
1029
+ }
1030
+ function D(c) {
1031
+ return S(c) === g;
1032
+ }
1033
+ return V.AsyncMode = p, V.ConcurrentMode = g, V.ContextConsumer = d, V.ContextProvider = s, V.Element = n, V.ForwardRef = h, V.Fragment = r, V.Lazy = x, V.Memo = y, V.Portal = t, V.Profiler = o, V.StrictMode = i, V.Suspense = u, V.isAsyncMode = function(c) {
1034
+ return D(c) || S(c) === p;
1035
+ }, V.isConcurrentMode = D, V.isContextConsumer = function(c) {
1036
+ return S(c) === d;
1037
+ }, V.isContextProvider = function(c) {
1038
+ return S(c) === s;
1039
+ }, V.isElement = function(c) {
1040
+ return typeof c == "object" && c !== null && c.$$typeof === n;
1041
+ }, V.isForwardRef = function(c) {
1042
+ return S(c) === h;
1043
+ }, V.isFragment = function(c) {
1044
+ return S(c) === r;
1045
+ }, V.isLazy = function(c) {
1046
+ return S(c) === x;
1047
+ }, V.isMemo = function(c) {
1048
+ return S(c) === y;
1049
+ }, V.isPortal = function(c) {
1050
+ return S(c) === t;
1051
+ }, V.isProfiler = function(c) {
1052
+ return S(c) === o;
1053
+ }, V.isStrictMode = function(c) {
1054
+ return S(c) === i;
1055
+ }, V.isSuspense = function(c) {
1056
+ return S(c) === u;
1057
+ }, V.isValidElementType = function(c) {
1058
+ return typeof c == "string" || typeof c == "function" || c === r || c === g || c === o || c === i || c === u || c === m || typeof c == "object" && c !== null && (c.$$typeof === x || c.$$typeof === y || c.$$typeof === s || c.$$typeof === d || c.$$typeof === h || c.$$typeof === b || c.$$typeof === C || c.$$typeof === T || c.$$typeof === v);
1059
+ }, V.typeOf = S, V;
1060
+ }
1061
+ var Y = {};
1062
+ var Ve;
1063
+ function an() {
1064
+ return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && (function() {
1065
+ var e = typeof Symbol == "function" && Symbol.for, n = e ? /* @__PURE__ */ Symbol.for("react.element") : 60103, t = e ? /* @__PURE__ */ Symbol.for("react.portal") : 60106, r = e ? /* @__PURE__ */ Symbol.for("react.fragment") : 60107, i = e ? /* @__PURE__ */ Symbol.for("react.strict_mode") : 60108, o = e ? /* @__PURE__ */ Symbol.for("react.profiler") : 60114, s = e ? /* @__PURE__ */ Symbol.for("react.provider") : 60109, d = e ? /* @__PURE__ */ Symbol.for("react.context") : 60110, p = e ? /* @__PURE__ */ Symbol.for("react.async_mode") : 60111, g = e ? /* @__PURE__ */ Symbol.for("react.concurrent_mode") : 60111, h = e ? /* @__PURE__ */ Symbol.for("react.forward_ref") : 60112, u = e ? /* @__PURE__ */ Symbol.for("react.suspense") : 60113, m = e ? /* @__PURE__ */ Symbol.for("react.suspense_list") : 60120, y = e ? /* @__PURE__ */ Symbol.for("react.memo") : 60115, x = e ? /* @__PURE__ */ Symbol.for("react.lazy") : 60116, v = e ? /* @__PURE__ */ Symbol.for("react.block") : 60121, b = e ? /* @__PURE__ */ Symbol.for("react.fundamental") : 60117, C = e ? /* @__PURE__ */ Symbol.for("react.responder") : 60118, T = e ? /* @__PURE__ */ Symbol.for("react.scope") : 60119;
1066
+ function S(_) {
1067
+ return typeof _ == "string" || typeof _ == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1068
+ _ === r || _ === g || _ === o || _ === i || _ === u || _ === m || typeof _ == "object" && _ !== null && (_.$$typeof === x || _.$$typeof === y || _.$$typeof === s || _.$$typeof === d || _.$$typeof === h || _.$$typeof === b || _.$$typeof === C || _.$$typeof === T || _.$$typeof === v);
1069
+ }
1070
+ function D(_) {
1071
+ if (typeof _ == "object" && _ !== null) {
1072
+ var te = _.$$typeof;
1073
+ switch (te) {
1074
+ case n:
1075
+ var me = _.type;
1076
+ switch (me) {
1077
+ case p:
1078
+ case g:
1079
+ case r:
1080
+ case o:
1081
+ case i:
1082
+ case u:
1083
+ return me;
1084
+ default:
1085
+ var je = me && me.$$typeof;
1086
+ switch (je) {
1087
+ case d:
1088
+ case h:
1089
+ case x:
1090
+ case y:
1091
+ case s:
1092
+ return je;
1093
+ default:
1094
+ return te;
1095
+ }
1096
+ }
1097
+ case t:
1098
+ return te;
1099
+ }
1100
+ }
1101
+ }
1102
+ var c = p, N = g, l = d, f = s, P = n, $ = h, O = r, E = x, z = y, X = t, Q = o, H = i, ee = u, ae = !1;
1103
+ function de(_) {
1104
+ return ae || (ae = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), w(_) || D(_) === p;
1105
+ }
1106
+ function w(_) {
1107
+ return D(_) === g;
1108
+ }
1109
+ function M(_) {
1110
+ return D(_) === d;
1111
+ }
1112
+ function A(_) {
1113
+ return D(_) === s;
1114
+ }
1115
+ function k(_) {
1116
+ return typeof _ == "object" && _ !== null && _.$$typeof === n;
1117
+ }
1118
+ function I(_) {
1119
+ return D(_) === h;
1120
+ }
1121
+ function F(_) {
1122
+ return D(_) === r;
1123
+ }
1124
+ function R(_) {
1125
+ return D(_) === x;
1126
+ }
1127
+ function j(_) {
1128
+ return D(_) === y;
1129
+ }
1130
+ function L(_) {
1131
+ return D(_) === t;
1132
+ }
1133
+ function q(_) {
1134
+ return D(_) === o;
1135
+ }
1136
+ function U(_) {
1137
+ return D(_) === i;
1138
+ }
1139
+ function G(_) {
1140
+ return D(_) === u;
1141
+ }
1142
+ Y.AsyncMode = c, Y.ConcurrentMode = N, Y.ContextConsumer = l, Y.ContextProvider = f, Y.Element = P, Y.ForwardRef = $, Y.Fragment = O, Y.Lazy = E, Y.Memo = z, Y.Portal = X, Y.Profiler = Q, Y.StrictMode = H, Y.Suspense = ee, Y.isAsyncMode = de, Y.isConcurrentMode = w, Y.isContextConsumer = M, Y.isContextProvider = A, Y.isElement = k, Y.isForwardRef = I, Y.isFragment = F, Y.isLazy = R, Y.isMemo = j, Y.isPortal = L, Y.isProfiler = q, Y.isStrictMode = U, Y.isSuspense = G, Y.isValidElementType = S, Y.typeOf = D;
1143
+ })()), Y;
1144
+ }
1145
+ var Ye;
1146
+ function pt() {
1147
+ return Ye || (Ye = 1, process.env.NODE_ENV === "production" ? ye.exports = on() : ye.exports = an()), ye.exports;
1148
+ }
1149
+ var Te, qe;
1150
+ function sn() {
1151
+ if (qe) return Te;
1152
+ qe = 1;
1153
+ var e = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
1154
+ function r(o) {
1155
+ if (o == null)
1156
+ throw new TypeError("Object.assign cannot be called with null or undefined");
1157
+ return Object(o);
1158
+ }
1159
+ function i() {
1160
+ try {
1161
+ if (!Object.assign)
1162
+ return !1;
1163
+ var o = new String("abc");
1164
+ if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
1165
+ return !1;
1166
+ for (var s = {}, d = 0; d < 10; d++)
1167
+ s["_" + String.fromCharCode(d)] = d;
1168
+ var p = Object.getOwnPropertyNames(s).map(function(h) {
1169
+ return s[h];
1170
+ });
1171
+ if (p.join("") !== "0123456789")
1172
+ return !1;
1173
+ var g = {};
1174
+ return "abcdefghijklmnopqrst".split("").forEach(function(h) {
1175
+ g[h] = h;
1176
+ }), Object.keys(Object.assign({}, g)).join("") === "abcdefghijklmnopqrst";
1177
+ } catch {
1178
+ return !1;
1179
+ }
1180
+ }
1181
+ return Te = i() ? Object.assign : function(o, s) {
1182
+ for (var d, p = r(o), g, h = 1; h < arguments.length; h++) {
1183
+ d = Object(arguments[h]);
1184
+ for (var u in d)
1185
+ n.call(d, u) && (p[u] = d[u]);
1186
+ if (e) {
1187
+ g = e(d);
1188
+ for (var m = 0; m < g.length; m++)
1189
+ t.call(d, g[m]) && (p[g[m]] = d[g[m]]);
1190
+ }
1191
+ }
1192
+ return p;
1193
+ }, Te;
1194
+ }
1195
+ var Ne, ze;
1196
+ function Oe() {
1197
+ if (ze) return Ne;
1198
+ ze = 1;
1199
+ var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
1200
+ return Ne = e, Ne;
1201
+ }
1202
+ var Ee, Be;
1203
+ function yt() {
1204
+ return Be || (Be = 1, Ee = Function.call.bind(Object.prototype.hasOwnProperty)), Ee;
1205
+ }
1206
+ var _e, Ke;
1207
+ function ln() {
1208
+ if (Ke) return _e;
1209
+ Ke = 1;
1210
+ var e = function() {
1211
+ };
1212
+ if (process.env.NODE_ENV !== "production") {
1213
+ var n = /* @__PURE__ */ Oe(), t = {}, r = /* @__PURE__ */ yt();
1214
+ e = function(o) {
1215
+ var s = "Warning: " + o;
1216
+ typeof console < "u" && console.error(s);
1217
+ try {
1218
+ throw new Error(s);
1219
+ } catch {
1220
+ }
1221
+ };
1222
+ }
1223
+ function i(o, s, d, p, g) {
1224
+ if (process.env.NODE_ENV !== "production") {
1225
+ for (var h in o)
1226
+ if (r(o, h)) {
1227
+ var u;
1228
+ try {
1229
+ if (typeof o[h] != "function") {
1230
+ var m = Error(
1231
+ (p || "React class") + ": " + d + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
1232
+ );
1233
+ throw m.name = "Invariant Violation", m;
1234
+ }
1235
+ u = o[h](s, h, p, d, null, n);
1236
+ } catch (x) {
1237
+ u = x;
1238
+ }
1239
+ if (u && !(u instanceof Error) && e(
1240
+ (p || "React class") + ": type specification of " + d + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
1241
+ ), u instanceof Error && !(u.message in t)) {
1242
+ t[u.message] = !0;
1243
+ var y = g ? g() : "";
1244
+ e(
1245
+ "Failed " + d + " type: " + u.message + (y ?? "")
1246
+ );
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+ return i.resetWarningCache = function() {
1252
+ process.env.NODE_ENV !== "production" && (t = {});
1253
+ }, _e = i, _e;
1254
+ }
1255
+ var Me, He;
1256
+ function cn() {
1257
+ if (He) return Me;
1258
+ He = 1;
1259
+ var e = pt(), n = sn(), t = /* @__PURE__ */ Oe(), r = /* @__PURE__ */ yt(), i = /* @__PURE__ */ ln(), o = function() {
1260
+ };
1261
+ process.env.NODE_ENV !== "production" && (o = function(d) {
1262
+ var p = "Warning: " + d;
1263
+ typeof console < "u" && console.error(p);
1264
+ try {
1265
+ throw new Error(p);
1266
+ } catch {
1267
+ }
1268
+ });
1269
+ function s() {
1270
+ return null;
1271
+ }
1272
+ return Me = function(d, p) {
1273
+ var g = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
1274
+ function u(w) {
1275
+ var M = w && (g && w[g] || w[h]);
1276
+ if (typeof M == "function")
1277
+ return M;
1278
+ }
1279
+ var m = "<<anonymous>>", y = {
1280
+ array: C("array"),
1281
+ bigint: C("bigint"),
1282
+ bool: C("boolean"),
1283
+ func: C("function"),
1284
+ number: C("number"),
1285
+ object: C("object"),
1286
+ string: C("string"),
1287
+ symbol: C("symbol"),
1288
+ any: T(),
1289
+ arrayOf: S,
1290
+ element: D(),
1291
+ elementType: c(),
1292
+ instanceOf: N,
1293
+ node: $(),
1294
+ objectOf: f,
1295
+ oneOf: l,
1296
+ oneOfType: P,
1297
+ shape: E,
1298
+ exact: z
1299
+ };
1300
+ function x(w, M) {
1301
+ return w === M ? w !== 0 || 1 / w === 1 / M : w !== w && M !== M;
1302
+ }
1303
+ function v(w, M) {
1304
+ this.message = w, this.data = M && typeof M == "object" ? M : {}, this.stack = "";
1305
+ }
1306
+ v.prototype = Error.prototype;
1307
+ function b(w) {
1308
+ if (process.env.NODE_ENV !== "production")
1309
+ var M = {}, A = 0;
1310
+ function k(F, R, j, L, q, U, G) {
1311
+ if (L = L || m, U = U || j, G !== t) {
1312
+ if (p) {
1313
+ var _ = new Error(
1314
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
1315
+ );
1316
+ throw _.name = "Invariant Violation", _;
1317
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1318
+ var te = L + ":" + j;
1319
+ !M[te] && // Avoid spamming the console because they are often not actionable except for lib authors
1320
+ A < 3 && (o(
1321
+ "You are manually calling a React.PropTypes validation function for the `" + U + "` prop on `" + L + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1322
+ ), M[te] = !0, A++);
1323
+ }
1324
+ }
1325
+ return R[j] == null ? F ? R[j] === null ? new v("The " + q + " `" + U + "` is marked as required " + ("in `" + L + "`, but its value is `null`.")) : new v("The " + q + " `" + U + "` is marked as required in " + ("`" + L + "`, but its value is `undefined`.")) : null : w(R, j, L, q, U);
1326
+ }
1327
+ var I = k.bind(null, !1);
1328
+ return I.isRequired = k.bind(null, !0), I;
1329
+ }
1330
+ function C(w) {
1331
+ function M(A, k, I, F, R, j) {
1332
+ var L = A[k], q = H(L);
1333
+ if (q !== w) {
1334
+ var U = ee(L);
1335
+ return new v(
1336
+ "Invalid " + F + " `" + R + "` of type " + ("`" + U + "` supplied to `" + I + "`, expected ") + ("`" + w + "`."),
1337
+ { expectedType: w }
1338
+ );
1339
+ }
1340
+ return null;
1341
+ }
1342
+ return b(M);
1343
+ }
1344
+ function T() {
1345
+ return b(s);
1346
+ }
1347
+ function S(w) {
1348
+ function M(A, k, I, F, R) {
1349
+ if (typeof w != "function")
1350
+ return new v("Property `" + R + "` of component `" + I + "` has invalid PropType notation inside arrayOf.");
1351
+ var j = A[k];
1352
+ if (!Array.isArray(j)) {
1353
+ var L = H(j);
1354
+ return new v("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected an array."));
1355
+ }
1356
+ for (var q = 0; q < j.length; q++) {
1357
+ var U = w(j, q, I, F, R + "[" + q + "]", t);
1358
+ if (U instanceof Error)
1359
+ return U;
1360
+ }
1361
+ return null;
1362
+ }
1363
+ return b(M);
1364
+ }
1365
+ function D() {
1366
+ function w(M, A, k, I, F) {
1367
+ var R = M[A];
1368
+ if (!d(R)) {
1369
+ var j = H(R);
1370
+ return new v("Invalid " + I + " `" + F + "` of type " + ("`" + j + "` supplied to `" + k + "`, expected a single ReactElement."));
1371
+ }
1372
+ return null;
1373
+ }
1374
+ return b(w);
1375
+ }
1376
+ function c() {
1377
+ function w(M, A, k, I, F) {
1378
+ var R = M[A];
1379
+ if (!e.isValidElementType(R)) {
1380
+ var j = H(R);
1381
+ return new v("Invalid " + I + " `" + F + "` of type " + ("`" + j + "` supplied to `" + k + "`, expected a single ReactElement type."));
1382
+ }
1383
+ return null;
1384
+ }
1385
+ return b(w);
1386
+ }
1387
+ function N(w) {
1388
+ function M(A, k, I, F, R) {
1389
+ if (!(A[k] instanceof w)) {
1390
+ var j = w.name || m, L = de(A[k]);
1391
+ return new v("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected ") + ("instance of `" + j + "`."));
1392
+ }
1393
+ return null;
1394
+ }
1395
+ return b(M);
1396
+ }
1397
+ function l(w) {
1398
+ if (!Array.isArray(w))
1399
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? o(
1400
+ "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
1401
+ ) : o("Invalid argument supplied to oneOf, expected an array.")), s;
1402
+ function M(A, k, I, F, R) {
1403
+ for (var j = A[k], L = 0; L < w.length; L++)
1404
+ if (x(j, w[L]))
1405
+ return null;
1406
+ var q = JSON.stringify(w, function(G, _) {
1407
+ var te = ee(_);
1408
+ return te === "symbol" ? String(_) : _;
1409
+ });
1410
+ return new v("Invalid " + F + " `" + R + "` of value `" + String(j) + "` " + ("supplied to `" + I + "`, expected one of " + q + "."));
1411
+ }
1412
+ return b(M);
1413
+ }
1414
+ function f(w) {
1415
+ function M(A, k, I, F, R) {
1416
+ if (typeof w != "function")
1417
+ return new v("Property `" + R + "` of component `" + I + "` has invalid PropType notation inside objectOf.");
1418
+ var j = A[k], L = H(j);
1419
+ if (L !== "object")
1420
+ return new v("Invalid " + F + " `" + R + "` of type " + ("`" + L + "` supplied to `" + I + "`, expected an object."));
1421
+ for (var q in j)
1422
+ if (r(j, q)) {
1423
+ var U = w(j, q, I, F, R + "." + q, t);
1424
+ if (U instanceof Error)
1425
+ return U;
1426
+ }
1427
+ return null;
1428
+ }
1429
+ return b(M);
1430
+ }
1431
+ function P(w) {
1432
+ if (!Array.isArray(w))
1433
+ return process.env.NODE_ENV !== "production" && o("Invalid argument supplied to oneOfType, expected an instance of array."), s;
1434
+ for (var M = 0; M < w.length; M++) {
1435
+ var A = w[M];
1436
+ if (typeof A != "function")
1437
+ return o(
1438
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ae(A) + " at index " + M + "."
1439
+ ), s;
1440
+ }
1441
+ function k(I, F, R, j, L) {
1442
+ for (var q = [], U = 0; U < w.length; U++) {
1443
+ var G = w[U], _ = G(I, F, R, j, L, t);
1444
+ if (_ == null)
1445
+ return null;
1446
+ _.data && r(_.data, "expectedType") && q.push(_.data.expectedType);
1447
+ }
1448
+ var te = q.length > 0 ? ", expected one of type [" + q.join(", ") + "]" : "";
1449
+ return new v("Invalid " + j + " `" + L + "` supplied to " + ("`" + R + "`" + te + "."));
1450
+ }
1451
+ return b(k);
1452
+ }
1453
+ function $() {
1454
+ function w(M, A, k, I, F) {
1455
+ return X(M[A]) ? null : new v("Invalid " + I + " `" + F + "` supplied to " + ("`" + k + "`, expected a ReactNode."));
1456
+ }
1457
+ return b(w);
1458
+ }
1459
+ function O(w, M, A, k, I) {
1460
+ return new v(
1461
+ (w || "React class") + ": " + M + " type `" + A + "." + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + I + "`."
1462
+ );
1463
+ }
1464
+ function E(w) {
1465
+ function M(A, k, I, F, R) {
1466
+ var j = A[k], L = H(j);
1467
+ if (L !== "object")
1468
+ return new v("Invalid " + F + " `" + R + "` of type `" + L + "` " + ("supplied to `" + I + "`, expected `object`."));
1469
+ for (var q in w) {
1470
+ var U = w[q];
1471
+ if (typeof U != "function")
1472
+ return O(I, F, R, q, ee(U));
1473
+ var G = U(j, q, I, F, R + "." + q, t);
1474
+ if (G)
1475
+ return G;
1476
+ }
1477
+ return null;
1478
+ }
1479
+ return b(M);
1480
+ }
1481
+ function z(w) {
1482
+ function M(A, k, I, F, R) {
1483
+ var j = A[k], L = H(j);
1484
+ if (L !== "object")
1485
+ return new v("Invalid " + F + " `" + R + "` of type `" + L + "` " + ("supplied to `" + I + "`, expected `object`."));
1486
+ var q = n({}, A[k], w);
1487
+ for (var U in q) {
1488
+ var G = w[U];
1489
+ if (r(w, U) && typeof G != "function")
1490
+ return O(I, F, R, U, ee(G));
1491
+ if (!G)
1492
+ return new v(
1493
+ "Invalid " + F + " `" + R + "` key `" + U + "` supplied to `" + I + "`.\nBad object: " + JSON.stringify(A[k], null, " ") + `
1494
+ Valid keys: ` + JSON.stringify(Object.keys(w), null, " ")
1495
+ );
1496
+ var _ = G(j, U, I, F, R + "." + U, t);
1497
+ if (_)
1498
+ return _;
1499
+ }
1500
+ return null;
1501
+ }
1502
+ return b(M);
1503
+ }
1504
+ function X(w) {
1505
+ switch (typeof w) {
1506
+ case "number":
1507
+ case "string":
1508
+ case "undefined":
1509
+ return !0;
1510
+ case "boolean":
1511
+ return !w;
1512
+ case "object":
1513
+ if (Array.isArray(w))
1514
+ return w.every(X);
1515
+ if (w === null || d(w))
1516
+ return !0;
1517
+ var M = u(w);
1518
+ if (M) {
1519
+ var A = M.call(w), k;
1520
+ if (M !== w.entries) {
1521
+ for (; !(k = A.next()).done; )
1522
+ if (!X(k.value))
1523
+ return !1;
1524
+ } else
1525
+ for (; !(k = A.next()).done; ) {
1526
+ var I = k.value;
1527
+ if (I && !X(I[1]))
1528
+ return !1;
1529
+ }
1530
+ } else
1531
+ return !1;
1532
+ return !0;
1533
+ default:
1534
+ return !1;
1535
+ }
1536
+ }
1537
+ function Q(w, M) {
1538
+ return w === "symbol" ? !0 : M ? M["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && M instanceof Symbol : !1;
1539
+ }
1540
+ function H(w) {
1541
+ var M = typeof w;
1542
+ return Array.isArray(w) ? "array" : w instanceof RegExp ? "object" : Q(M, w) ? "symbol" : M;
1543
+ }
1544
+ function ee(w) {
1545
+ if (typeof w > "u" || w === null)
1546
+ return "" + w;
1547
+ var M = H(w);
1548
+ if (M === "object") {
1549
+ if (w instanceof Date)
1550
+ return "date";
1551
+ if (w instanceof RegExp)
1552
+ return "regexp";
1553
+ }
1554
+ return M;
1555
+ }
1556
+ function ae(w) {
1557
+ var M = ee(w);
1558
+ switch (M) {
1559
+ case "array":
1560
+ case "object":
1561
+ return "an " + M;
1562
+ case "boolean":
1563
+ case "date":
1564
+ case "regexp":
1565
+ return "a " + M;
1566
+ default:
1567
+ return M;
1568
+ }
1569
+ }
1570
+ function de(w) {
1571
+ return !w.constructor || !w.constructor.name ? m : w.constructor.name;
1572
+ }
1573
+ return y.checkPropTypes = i, y.resetWarningCache = i.resetWarningCache, y.PropTypes = y, y;
1574
+ }, Me;
1575
+ }
1576
+ var Pe, Xe;
1577
+ function dn() {
1578
+ if (Xe) return Pe;
1579
+ Xe = 1;
1580
+ var e = /* @__PURE__ */ Oe();
1581
+ function n() {
1582
+ }
1583
+ function t() {
1584
+ }
1585
+ return t.resetWarningCache = n, Pe = function() {
1586
+ function r(s, d, p, g, h, u) {
1587
+ if (u !== e) {
1588
+ var m = new Error(
1589
+ "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
1590
+ );
1591
+ throw m.name = "Invariant Violation", m;
1592
+ }
1593
+ }
1594
+ r.isRequired = r;
1595
+ function i() {
1596
+ return r;
1597
+ }
1598
+ var o = {
1599
+ array: r,
1600
+ bigint: r,
1601
+ bool: r,
1602
+ func: r,
1603
+ number: r,
1604
+ object: r,
1605
+ string: r,
1606
+ symbol: r,
1607
+ any: r,
1608
+ arrayOf: i,
1609
+ element: r,
1610
+ elementType: r,
1611
+ instanceOf: i,
1612
+ node: r,
1613
+ objectOf: i,
1614
+ oneOf: i,
1615
+ oneOfType: i,
1616
+ shape: i,
1617
+ exact: i,
1618
+ checkPropTypes: t,
1619
+ resetWarningCache: n
1620
+ };
1621
+ return o.PropTypes = o, o;
1622
+ }, Pe;
1623
+ }
1624
+ var Ge;
1625
+ function vt() {
1626
+ if (Ge) return pe.exports;
1627
+ if (Ge = 1, process.env.NODE_ENV !== "production") {
1628
+ var e = pt(), n = !0;
1629
+ pe.exports = /* @__PURE__ */ cn()(e.isElement, n);
1630
+ } else
1631
+ pe.exports = /* @__PURE__ */ dn()();
1632
+ return pe.exports;
1633
+ }
1634
+ var ve = { exports: {} }, Ze;
1635
+ function un() {
1636
+ if (Ze) return ve.exports;
1637
+ Ze = 1;
1638
+ function e(t) {
1639
+ var r, i, o = "";
1640
+ if (typeof t == "string" || typeof t == "number") o += t;
1641
+ else if (typeof t == "object") if (Array.isArray(t)) {
1642
+ var s = t.length;
1643
+ for (r = 0; r < s; r++) t[r] && (i = e(t[r])) && (o && (o += " "), o += i);
1644
+ } else for (i in t) t[i] && (o && (o += " "), o += i);
1645
+ return o;
1646
+ }
1647
+ function n() {
1648
+ for (var t, r, i = 0, o = "", s = arguments.length; i < s; i++) (t = arguments[i]) && (r = e(t)) && (o && (o += " "), o += r);
1649
+ return o;
1650
+ }
1651
+ return ve.exports = n, ve.exports.clsx = n, ve.exports;
1652
+ }
1653
+ var B = {}, oe = {}, Je;
1654
+ function xe() {
1655
+ if (Je) return oe;
1656
+ Je = 1, Object.defineProperty(oe, "__esModule", {
1657
+ value: !0
1658
+ }), oe.dontSetMe = i, oe.findInArray = e, oe.int = r, oe.isFunction = n, oe.isNum = t;
1659
+ function e(o, s) {
1660
+ for (let d = 0, p = o.length; d < p; d++)
1661
+ if (s.apply(s, [o[d], d, o])) return o[d];
1662
+ }
1663
+ function n(o) {
1664
+ return typeof o == "function" || Object.prototype.toString.call(o) === "[object Function]";
1665
+ }
1666
+ function t(o) {
1667
+ return typeof o == "number" && !isNaN(o);
1668
+ }
1669
+ function r(o) {
1670
+ return parseInt(o, 10);
1671
+ }
1672
+ function i(o, s, d) {
1673
+ if (o[s])
1674
+ return new Error(`Invalid prop ${s} passed to ${d} - do not set this, set it on the child.`);
1675
+ }
1676
+ return oe;
1677
+ }
1678
+ var ie = {}, Qe;
1679
+ function fn() {
1680
+ if (Qe) return ie;
1681
+ Qe = 1, Object.defineProperty(ie, "__esModule", {
1682
+ value: !0
1683
+ }), ie.browserPrefixToKey = t, ie.browserPrefixToStyle = r, ie.default = void 0, ie.getPrefix = n;
1684
+ const e = ["Moz", "Webkit", "O", "ms"];
1685
+ function n() {
1686
+ let o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
1687
+ if (typeof window > "u") return "";
1688
+ const s = window.document?.documentElement?.style;
1689
+ if (!s || o in s) return "";
1690
+ for (let d = 0; d < e.length; d++)
1691
+ if (t(o, e[d]) in s) return e[d];
1692
+ return "";
1693
+ }
1694
+ function t(o, s) {
1695
+ return s ? `${s}${i(o)}` : o;
1696
+ }
1697
+ function r(o, s) {
1698
+ return s ? `-${s.toLowerCase()}-${o}` : o;
1699
+ }
1700
+ function i(o) {
1701
+ let s = "", d = !0;
1702
+ for (let p = 0; p < o.length; p++)
1703
+ d ? (s += o[p].toUpperCase(), d = !1) : o[p] === "-" ? d = !0 : s += o[p];
1704
+ return s;
1705
+ }
1706
+ return ie.default = n(), ie;
1707
+ }
1708
+ var et;
1709
+ function Re() {
1710
+ if (et) return B;
1711
+ et = 1, Object.defineProperty(B, "__esModule", {
1712
+ value: !0
1713
+ }), B.addClassName = c, B.addEvent = s, B.addUserSelectStyles = T, B.createCSSTransform = y, B.createSVGTransform = x, B.getTouch = b, B.getTouchIdentifier = C, B.getTranslation = v, B.innerHeight = h, B.innerWidth = u, B.matchesSelector = i, B.matchesSelectorAndParentsTo = o, B.offsetXYFromParent = m, B.outerHeight = p, B.outerWidth = g, B.removeClassName = N, B.removeEvent = d, B.scheduleRemoveUserSelectStyles = S;
1714
+ var e = xe(), n = t(fn());
1715
+ function t(l, f) {
1716
+ if (typeof WeakMap == "function") var P = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap();
1717
+ return (t = function(O, E) {
1718
+ if (!E && O && O.__esModule) return O;
1719
+ var z, X, Q = { __proto__: null, default: O };
1720
+ if (O === null || typeof O != "object" && typeof O != "function") return Q;
1721
+ if (z = E ? $ : P) {
1722
+ if (z.has(O)) return z.get(O);
1723
+ z.set(O, Q);
1724
+ }
1725
+ for (const H in O) H !== "default" && {}.hasOwnProperty.call(O, H) && ((X = (z = Object.defineProperty) && Object.getOwnPropertyDescriptor(O, H)) && (X.get || X.set) ? z(Q, H, X) : Q[H] = O[H]);
1726
+ return Q;
1727
+ })(l, f);
1728
+ }
1729
+ let r = "";
1730
+ function i(l, f) {
1731
+ return r || (r = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(P) {
1732
+ return (0, e.isFunction)(l[P]);
1733
+ })), (0, e.isFunction)(l[r]) ? l[r](f) : !1;
1734
+ }
1735
+ function o(l, f, P) {
1736
+ let $ = l;
1737
+ do {
1738
+ if (i($, f)) return !0;
1739
+ if ($ === P) return !1;
1740
+ $ = $.parentNode;
1741
+ } while ($);
1742
+ return !1;
1743
+ }
1744
+ function s(l, f, P, $) {
1745
+ if (!l) return;
1746
+ const O = {
1747
+ capture: !0,
1748
+ ...$
1749
+ };
1750
+ l.addEventListener ? l.addEventListener(f, P, O) : l.attachEvent ? l.attachEvent("on" + f, P) : l["on" + f] = P;
1751
+ }
1752
+ function d(l, f, P, $) {
1753
+ if (!l) return;
1754
+ const O = {
1755
+ capture: !0,
1756
+ ...$
1757
+ };
1758
+ l.removeEventListener ? l.removeEventListener(f, P, O) : l.detachEvent ? l.detachEvent("on" + f, P) : l["on" + f] = null;
1759
+ }
1760
+ function p(l) {
1761
+ let f = l.clientHeight;
1762
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1763
+ return f += (0, e.int)(P.borderTopWidth), f += (0, e.int)(P.borderBottomWidth), f;
1764
+ }
1765
+ function g(l) {
1766
+ let f = l.clientWidth;
1767
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1768
+ return f += (0, e.int)(P.borderLeftWidth), f += (0, e.int)(P.borderRightWidth), f;
1769
+ }
1770
+ function h(l) {
1771
+ let f = l.clientHeight;
1772
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1773
+ return f -= (0, e.int)(P.paddingTop), f -= (0, e.int)(P.paddingBottom), f;
1774
+ }
1775
+ function u(l) {
1776
+ let f = l.clientWidth;
1777
+ const P = l.ownerDocument.defaultView.getComputedStyle(l);
1778
+ return f -= (0, e.int)(P.paddingLeft), f -= (0, e.int)(P.paddingRight), f;
1779
+ }
1780
+ function m(l, f, P) {
1781
+ const O = f === f.ownerDocument.body ? {
1782
+ left: 0,
1783
+ top: 0
1784
+ } : f.getBoundingClientRect(), E = (l.clientX + f.scrollLeft - O.left) / P, z = (l.clientY + f.scrollTop - O.top) / P;
1785
+ return {
1786
+ x: E,
1787
+ y: z
1788
+ };
1789
+ }
1790
+ function y(l, f) {
1791
+ const P = v(l, f, "px");
1792
+ return {
1793
+ [(0, n.browserPrefixToKey)("transform", n.default)]: P
1794
+ };
1795
+ }
1796
+ function x(l, f) {
1797
+ return v(l, f, "");
1798
+ }
1799
+ function v(l, f, P) {
1800
+ let {
1801
+ x: $,
1802
+ y: O
1803
+ } = l, E = `translate(${$}${P},${O}${P})`;
1804
+ if (f) {
1805
+ const z = `${typeof f.x == "string" ? f.x : f.x + P}`, X = `${typeof f.y == "string" ? f.y : f.y + P}`;
1806
+ E = `translate(${z}, ${X})` + E;
1807
+ }
1808
+ return E;
1809
+ }
1810
+ function b(l, f) {
1811
+ return l.targetTouches && (0, e.findInArray)(l.targetTouches, (P) => f === P.identifier) || l.changedTouches && (0, e.findInArray)(l.changedTouches, (P) => f === P.identifier);
1812
+ }
1813
+ function C(l) {
1814
+ if (l.targetTouches && l.targetTouches[0]) return l.targetTouches[0].identifier;
1815
+ if (l.changedTouches && l.changedTouches[0]) return l.changedTouches[0].identifier;
1816
+ }
1817
+ function T(l) {
1818
+ if (!l) return;
1819
+ let f = l.getElementById("react-draggable-style-el");
1820
+ f || (f = l.createElement("style"), f.type = "text/css", f.id = "react-draggable-style-el", f.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
1821
+ `, f.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
1822
+ `, l.getElementsByTagName("head")[0].appendChild(f)), l.body && c(l.body, "react-draggable-transparent-selection");
1823
+ }
1824
+ function S(l) {
1825
+ window.requestAnimationFrame ? window.requestAnimationFrame(() => {
1826
+ D(l);
1827
+ }) : D(l);
1828
+ }
1829
+ function D(l) {
1830
+ if (l)
1831
+ try {
1832
+ if (l.body && N(l.body, "react-draggable-transparent-selection"), l.selection)
1833
+ l.selection.empty();
1834
+ else {
1835
+ const f = (l.defaultView || window).getSelection();
1836
+ f && f.type !== "Caret" && f.removeAllRanges();
1837
+ }
1838
+ } catch {
1839
+ }
1840
+ }
1841
+ function c(l, f) {
1842
+ l.classList ? l.classList.add(f) : l.className.match(new RegExp(`(?:^|\\s)${f}(?!\\S)`)) || (l.className += ` ${f}`);
1843
+ }
1844
+ function N(l, f) {
1845
+ l.classList ? l.classList.remove(f) : l.className = l.className.replace(new RegExp(`(?:^|\\s)${f}(?!\\S)`, "g"), "");
1846
+ }
1847
+ return B;
1848
+ }
1849
+ var ne = {}, tt;
1850
+ function bt() {
1851
+ if (tt) return ne;
1852
+ tt = 1, Object.defineProperty(ne, "__esModule", {
1853
+ value: !0
1854
+ }), ne.canDragX = i, ne.canDragY = o, ne.createCoreData = d, ne.createDraggableData = p, ne.getBoundPosition = t, ne.getControlPosition = s, ne.snapToGrid = r;
1855
+ var e = xe(), n = Re();
1856
+ function t(u, m, y) {
1857
+ if (!u.props.bounds) return [m, y];
1858
+ let {
1859
+ bounds: x
1860
+ } = u.props;
1861
+ x = typeof x == "string" ? x : g(x);
1862
+ const v = h(u);
1863
+ if (typeof x == "string") {
1864
+ const {
1865
+ ownerDocument: b
1866
+ } = v, C = b.defaultView;
1867
+ let T;
1868
+ if (x === "parent" ? T = v.parentNode : T = v.getRootNode().querySelector(x), !(T instanceof C.HTMLElement))
1869
+ throw new Error('Bounds selector "' + x + '" could not find an element.');
1870
+ const S = T, D = C.getComputedStyle(v), c = C.getComputedStyle(S);
1871
+ x = {
1872
+ left: -v.offsetLeft + (0, e.int)(c.paddingLeft) + (0, e.int)(D.marginLeft),
1873
+ top: -v.offsetTop + (0, e.int)(c.paddingTop) + (0, e.int)(D.marginTop),
1874
+ right: (0, n.innerWidth)(S) - (0, n.outerWidth)(v) - v.offsetLeft + (0, e.int)(c.paddingRight) - (0, e.int)(D.marginRight),
1875
+ bottom: (0, n.innerHeight)(S) - (0, n.outerHeight)(v) - v.offsetTop + (0, e.int)(c.paddingBottom) - (0, e.int)(D.marginBottom)
1876
+ };
1877
+ }
1878
+ return (0, e.isNum)(x.right) && (m = Math.min(m, x.right)), (0, e.isNum)(x.bottom) && (y = Math.min(y, x.bottom)), (0, e.isNum)(x.left) && (m = Math.max(m, x.left)), (0, e.isNum)(x.top) && (y = Math.max(y, x.top)), [m, y];
1879
+ }
1880
+ function r(u, m, y) {
1881
+ const x = Math.round(m / u[0]) * u[0], v = Math.round(y / u[1]) * u[1];
1882
+ return [x, v];
1883
+ }
1884
+ function i(u) {
1885
+ return u.props.axis === "both" || u.props.axis === "x";
1886
+ }
1887
+ function o(u) {
1888
+ return u.props.axis === "both" || u.props.axis === "y";
1889
+ }
1890
+ function s(u, m, y) {
1891
+ const x = typeof m == "number" ? (0, n.getTouch)(u, m) : null;
1892
+ if (typeof m == "number" && !x) return null;
1893
+ const v = h(y), b = y.props.offsetParent || v.offsetParent || v.ownerDocument.body;
1894
+ return (0, n.offsetXYFromParent)(x || u, b, y.props.scale);
1895
+ }
1896
+ function d(u, m, y) {
1897
+ const x = !(0, e.isNum)(u.lastX), v = h(u);
1898
+ return x ? {
1899
+ node: v,
1900
+ deltaX: 0,
1901
+ deltaY: 0,
1902
+ lastX: m,
1903
+ lastY: y,
1904
+ x: m,
1905
+ y
1906
+ } : {
1907
+ node: v,
1908
+ deltaX: m - u.lastX,
1909
+ deltaY: y - u.lastY,
1910
+ lastX: u.lastX,
1911
+ lastY: u.lastY,
1912
+ x: m,
1913
+ y
1914
+ };
1915
+ }
1916
+ function p(u, m) {
1917
+ const y = u.props.scale;
1918
+ return {
1919
+ node: m.node,
1920
+ x: u.state.x + m.deltaX / y,
1921
+ y: u.state.y + m.deltaY / y,
1922
+ deltaX: m.deltaX / y,
1923
+ deltaY: m.deltaY / y,
1924
+ lastX: u.state.x,
1925
+ lastY: u.state.y
1926
+ };
1927
+ }
1928
+ function g(u) {
1929
+ return {
1930
+ left: u.left,
1931
+ top: u.top,
1932
+ right: u.right,
1933
+ bottom: u.bottom
1934
+ };
1935
+ }
1936
+ function h(u) {
1937
+ const m = u.findDOMNode();
1938
+ if (!m)
1939
+ throw new Error("<DraggableCore>: Unmounted during event!");
1940
+ return m;
1941
+ }
1942
+ return ne;
1943
+ }
1944
+ var he = {}, be = {}, nt;
1945
+ function wt() {
1946
+ if (nt) return be;
1947
+ nt = 1, Object.defineProperty(be, "__esModule", {
1948
+ value: !0
1949
+ }), be.default = e;
1950
+ function e() {
1951
+ }
1952
+ return be;
1953
+ }
1954
+ var rt;
1955
+ function hn() {
1956
+ if (rt) return he;
1957
+ rt = 1, Object.defineProperty(he, "__esModule", {
1958
+ value: !0
1959
+ }), he.default = void 0;
1960
+ var e = p(se), n = d(/* @__PURE__ */ vt()), t = d(st), r = Re(), i = bt(), o = xe(), s = d(wt());
1961
+ function d(v) {
1962
+ return v && v.__esModule ? v : { default: v };
1963
+ }
1964
+ function p(v, b) {
1965
+ if (typeof WeakMap == "function") var C = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap();
1966
+ return (p = function(S, D) {
1967
+ if (!D && S && S.__esModule) return S;
1968
+ var c, N, l = { __proto__: null, default: S };
1969
+ if (S === null || typeof S != "object" && typeof S != "function") return l;
1970
+ if (c = D ? T : C) {
1971
+ if (c.has(S)) return c.get(S);
1972
+ c.set(S, l);
1973
+ }
1974
+ for (const f in S) f !== "default" && {}.hasOwnProperty.call(S, f) && ((N = (c = Object.defineProperty) && Object.getOwnPropertyDescriptor(S, f)) && (N.get || N.set) ? c(l, f, N) : l[f] = S[f]);
1975
+ return l;
1976
+ })(v, b);
1977
+ }
1978
+ function g(v, b, C) {
1979
+ return (b = h(b)) in v ? Object.defineProperty(v, b, { value: C, enumerable: !0, configurable: !0, writable: !0 }) : v[b] = C, v;
1980
+ }
1981
+ function h(v) {
1982
+ var b = u(v, "string");
1983
+ return typeof b == "symbol" ? b : b + "";
1984
+ }
1985
+ function u(v, b) {
1986
+ if (typeof v != "object" || !v) return v;
1987
+ var C = v[Symbol.toPrimitive];
1988
+ if (C !== void 0) {
1989
+ var T = C.call(v, b);
1990
+ if (typeof T != "object") return T;
1991
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1992
+ }
1993
+ return (b === "string" ? String : Number)(v);
1994
+ }
1995
+ const m = {
1996
+ touch: {
1997
+ start: "touchstart",
1998
+ move: "touchmove",
1999
+ stop: "touchend"
2000
+ },
2001
+ mouse: {
2002
+ start: "mousedown",
2003
+ move: "mousemove",
2004
+ stop: "mouseup"
2005
+ }
2006
+ };
2007
+ let y = m.mouse, x = class extends e.Component {
2008
+ constructor() {
2009
+ super(...arguments), g(this, "dragging", !1), g(this, "lastX", NaN), g(this, "lastY", NaN), g(this, "touchIdentifier", null), g(this, "mounted", !1), g(this, "handleDragStart", (b) => {
2010
+ if (this.props.onMouseDown(b), !this.props.allowAnyClick && typeof b.button == "number" && b.button !== 0) return !1;
2011
+ const C = this.findDOMNode();
2012
+ if (!C || !C.ownerDocument || !C.ownerDocument.body)
2013
+ throw new Error("<DraggableCore> not mounted on DragStart!");
2014
+ const {
2015
+ ownerDocument: T
2016
+ } = C;
2017
+ if (this.props.disabled || !(b.target instanceof T.defaultView.Node) || this.props.handle && !(0, r.matchesSelectorAndParentsTo)(b.target, this.props.handle, C) || this.props.cancel && (0, r.matchesSelectorAndParentsTo)(b.target, this.props.cancel, C))
2018
+ return;
2019
+ b.type === "touchstart" && !this.props.allowMobileScroll && b.preventDefault();
2020
+ const S = (0, r.getTouchIdentifier)(b);
2021
+ this.touchIdentifier = S;
2022
+ const D = (0, i.getControlPosition)(b, S, this);
2023
+ if (D == null) return;
2024
+ const {
2025
+ x: c,
2026
+ y: N
2027
+ } = D, l = (0, i.createCoreData)(this, c, N);
2028
+ (0, s.default)("DraggableCore: handleDragStart: %j", l), (0, s.default)("calling", this.props.onStart), !(this.props.onStart(b, l) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, r.addUserSelectStyles)(T), this.dragging = !0, this.lastX = c, this.lastY = N, (0, r.addEvent)(T, y.move, this.handleDrag), (0, r.addEvent)(T, y.stop, this.handleDragStop));
2029
+ }), g(this, "handleDrag", (b) => {
2030
+ const C = (0, i.getControlPosition)(b, this.touchIdentifier, this);
2031
+ if (C == null) return;
2032
+ let {
2033
+ x: T,
2034
+ y: S
2035
+ } = C;
2036
+ if (Array.isArray(this.props.grid)) {
2037
+ let N = T - this.lastX, l = S - this.lastY;
2038
+ if ([N, l] = (0, i.snapToGrid)(this.props.grid, N, l), !N && !l) return;
2039
+ T = this.lastX + N, S = this.lastY + l;
2040
+ }
2041
+ const D = (0, i.createCoreData)(this, T, S);
2042
+ if ((0, s.default)("DraggableCore: handleDrag: %j", D), this.props.onDrag(b, D) === !1 || this.mounted === !1) {
2043
+ try {
2044
+ this.handleDragStop(new MouseEvent("mouseup"));
2045
+ } catch {
2046
+ const l = document.createEvent("MouseEvents");
2047
+ l.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(l);
2048
+ }
2049
+ return;
2050
+ }
2051
+ this.lastX = T, this.lastY = S;
2052
+ }), g(this, "handleDragStop", (b) => {
2053
+ if (!this.dragging) return;
2054
+ const C = (0, i.getControlPosition)(b, this.touchIdentifier, this);
2055
+ if (C == null) return;
2056
+ let {
2057
+ x: T,
2058
+ y: S
2059
+ } = C;
2060
+ if (Array.isArray(this.props.grid)) {
2061
+ let l = T - this.lastX || 0, f = S - this.lastY || 0;
2062
+ [l, f] = (0, i.snapToGrid)(this.props.grid, l, f), T = this.lastX + l, S = this.lastY + f;
2063
+ }
2064
+ const D = (0, i.createCoreData)(this, T, S);
2065
+ if (this.props.onStop(b, D) === !1 || this.mounted === !1) return !1;
2066
+ const N = this.findDOMNode();
2067
+ N && this.props.enableUserSelectHack && (0, r.scheduleRemoveUserSelectStyles)(N.ownerDocument), (0, s.default)("DraggableCore: handleDragStop: %j", D), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, N && ((0, s.default)("DraggableCore: Removing handlers"), (0, r.removeEvent)(N.ownerDocument, y.move, this.handleDrag), (0, r.removeEvent)(N.ownerDocument, y.stop, this.handleDragStop));
2068
+ }), g(this, "onMouseDown", (b) => (y = m.mouse, this.handleDragStart(b))), g(this, "onMouseUp", (b) => (y = m.mouse, this.handleDragStop(b))), g(this, "onTouchStart", (b) => (y = m.touch, this.handleDragStart(b))), g(this, "onTouchEnd", (b) => (y = m.touch, this.handleDragStop(b)));
2069
+ }
2070
+ componentDidMount() {
2071
+ this.mounted = !0;
2072
+ const b = this.findDOMNode();
2073
+ b && (0, r.addEvent)(b, m.touch.start, this.onTouchStart, {
2074
+ passive: !1
2075
+ });
2076
+ }
2077
+ componentWillUnmount() {
2078
+ this.mounted = !1;
2079
+ const b = this.findDOMNode();
2080
+ if (b) {
2081
+ const {
2082
+ ownerDocument: C
2083
+ } = b;
2084
+ (0, r.removeEvent)(C, m.mouse.move, this.handleDrag), (0, r.removeEvent)(C, m.touch.move, this.handleDrag), (0, r.removeEvent)(C, m.mouse.stop, this.handleDragStop), (0, r.removeEvent)(C, m.touch.stop, this.handleDragStop), (0, r.removeEvent)(b, m.touch.start, this.onTouchStart, {
2085
+ passive: !1
2086
+ }), this.props.enableUserSelectHack && (0, r.scheduleRemoveUserSelectStyles)(C);
2087
+ }
2088
+ }
2089
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
2090
+ // the underlying DOM node ourselves. See the README for more information.
2091
+ findDOMNode() {
2092
+ return this.props?.nodeRef ? this.props?.nodeRef?.current : t.default.findDOMNode(this);
2093
+ }
2094
+ render() {
2095
+ return /* @__PURE__ */ e.cloneElement(e.Children.only(this.props.children), {
2096
+ // Note: mouseMove handler is attached to document so it will still function
2097
+ // when the user drags quickly and leaves the bounds of the element.
2098
+ onMouseDown: this.onMouseDown,
2099
+ onMouseUp: this.onMouseUp,
2100
+ // onTouchStart is added on `componentDidMount` so they can be added with
2101
+ // {passive: false}, which allows it to cancel. See
2102
+ // https://developers.google.com/web/updates/2017/01/scrolling-intervention
2103
+ onTouchEnd: this.onTouchEnd
2104
+ });
2105
+ }
2106
+ };
2107
+ return he.default = x, g(x, "displayName", "DraggableCore"), g(x, "propTypes", {
2108
+ /**
2109
+ * `allowAnyClick` allows dragging using any mouse button.
2110
+ * By default, we only accept the left button.
2111
+ *
2112
+ * Defaults to `false`.
2113
+ */
2114
+ allowAnyClick: n.default.bool,
2115
+ /**
2116
+ * `allowMobileScroll` turns off cancellation of the 'touchstart' event
2117
+ * on mobile devices. Only enable this if you are having trouble with click
2118
+ * events. Prefer using 'handle' / 'cancel' instead.
2119
+ *
2120
+ * Defaults to `false`.
2121
+ */
2122
+ allowMobileScroll: n.default.bool,
2123
+ children: n.default.node.isRequired,
2124
+ /**
2125
+ * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
2126
+ * with the exception of `onMouseDown`, will not fire.
2127
+ */
2128
+ disabled: n.default.bool,
2129
+ /**
2130
+ * By default, we add 'user-select:none' attributes to the document body
2131
+ * to prevent ugly text selection during drag. If this is causing problems
2132
+ * for your app, set this to `false`.
2133
+ */
2134
+ enableUserSelectHack: n.default.bool,
2135
+ /**
2136
+ * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
2137
+ * instead of using the parent node.
2138
+ */
2139
+ offsetParent: function(v, b) {
2140
+ if (v[b] && v[b].nodeType !== 1)
2141
+ throw new Error("Draggable's offsetParent must be a DOM Node.");
2142
+ },
2143
+ /**
2144
+ * `grid` specifies the x and y that dragging should snap to.
2145
+ */
2146
+ grid: n.default.arrayOf(n.default.number),
2147
+ /**
2148
+ * `handle` specifies a selector to be used as the handle that initiates drag.
2149
+ *
2150
+ * Example:
2151
+ *
2152
+ * ```jsx
2153
+ * let App = React.createClass({
2154
+ * render: function () {
2155
+ * return (
2156
+ * <Draggable handle=".handle">
2157
+ * <div>
2158
+ * <div className="handle">Click me to drag</div>
2159
+ * <div>This is some other content</div>
2160
+ * </div>
2161
+ * </Draggable>
2162
+ * );
2163
+ * }
2164
+ * });
2165
+ * ```
2166
+ */
2167
+ handle: n.default.string,
2168
+ /**
2169
+ * `cancel` specifies a selector to be used to prevent drag initialization.
2170
+ *
2171
+ * Example:
2172
+ *
2173
+ * ```jsx
2174
+ * let App = React.createClass({
2175
+ * render: function () {
2176
+ * return(
2177
+ * <Draggable cancel=".cancel">
2178
+ * <div>
2179
+ * <div className="cancel">You can't drag from here</div>
2180
+ * <div>Dragging here works fine</div>
2181
+ * </div>
2182
+ * </Draggable>
2183
+ * );
2184
+ * }
2185
+ * });
2186
+ * ```
2187
+ */
2188
+ cancel: n.default.string,
2189
+ /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
2190
+ * Unfortunately, in order for <Draggable> to work properly, we need raw access
2191
+ * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
2192
+ * as in this example:
2193
+ *
2194
+ * function MyComponent() {
2195
+ * const nodeRef = React.useRef(null);
2196
+ * return (
2197
+ * <Draggable nodeRef={nodeRef}>
2198
+ * <div ref={nodeRef}>Example Target</div>
2199
+ * </Draggable>
2200
+ * );
2201
+ * }
2202
+ *
2203
+ * This can be used for arbitrarily nested components, so long as the ref ends up
2204
+ * pointing to the actual child DOM node and not a custom component.
2205
+ */
2206
+ nodeRef: n.default.object,
2207
+ /**
2208
+ * Called when dragging starts.
2209
+ * If this function returns the boolean false, dragging will be canceled.
2210
+ */
2211
+ onStart: n.default.func,
2212
+ /**
2213
+ * Called while dragging.
2214
+ * If this function returns the boolean false, dragging will be canceled.
2215
+ */
2216
+ onDrag: n.default.func,
2217
+ /**
2218
+ * Called when dragging stops.
2219
+ * If this function returns the boolean false, the drag will remain active.
2220
+ */
2221
+ onStop: n.default.func,
2222
+ /**
2223
+ * A workaround option which can be passed if onMouseDown needs to be accessed,
2224
+ * since it'll always be blocked (as there is internal use of onMouseDown)
2225
+ */
2226
+ onMouseDown: n.default.func,
2227
+ /**
2228
+ * `scale`, if set, applies scaling while dragging an element
2229
+ */
2230
+ scale: n.default.number,
2231
+ /**
2232
+ * These properties should be defined on the child, not here.
2233
+ */
2234
+ className: o.dontSetMe,
2235
+ style: o.dontSetMe,
2236
+ transform: o.dontSetMe
2237
+ }), g(x, "defaultProps", {
2238
+ allowAnyClick: !1,
2239
+ // by default only accept left click
2240
+ allowMobileScroll: !1,
2241
+ disabled: !1,
2242
+ enableUserSelectHack: !0,
2243
+ onStart: function() {
2244
+ },
2245
+ onDrag: function() {
2246
+ },
2247
+ onStop: function() {
2248
+ },
2249
+ onMouseDown: function() {
2250
+ },
2251
+ scale: 1
2252
+ }), he;
2253
+ }
2254
+ var ot;
2255
+ function gn() {
2256
+ return ot || (ot = 1, (function(e) {
2257
+ Object.defineProperty(e, "__esModule", {
2258
+ value: !0
2259
+ }), Object.defineProperty(e, "DraggableCore", {
2260
+ enumerable: !0,
2261
+ get: function() {
2262
+ return p.default;
2263
+ }
2264
+ }), e.default = void 0;
2265
+ var n = u(se), t = h(/* @__PURE__ */ vt()), r = h(st), i = un(), o = Re(), s = bt(), d = xe(), p = h(hn()), g = h(wt());
2266
+ function h(C) {
2267
+ return C && C.__esModule ? C : { default: C };
2268
+ }
2269
+ function u(C, T) {
2270
+ if (typeof WeakMap == "function") var S = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap();
2271
+ return (u = function(c, N) {
2272
+ if (!N && c && c.__esModule) return c;
2273
+ var l, f, P = { __proto__: null, default: c };
2274
+ if (c === null || typeof c != "object" && typeof c != "function") return P;
2275
+ if (l = N ? D : S) {
2276
+ if (l.has(c)) return l.get(c);
2277
+ l.set(c, P);
2278
+ }
2279
+ for (const $ in c) $ !== "default" && {}.hasOwnProperty.call(c, $) && ((f = (l = Object.defineProperty) && Object.getOwnPropertyDescriptor(c, $)) && (f.get || f.set) ? l(P, $, f) : P[$] = c[$]);
2280
+ return P;
2281
+ })(C, T);
2282
+ }
2283
+ function m() {
2284
+ return m = Object.assign ? Object.assign.bind() : function(C) {
2285
+ for (var T = 1; T < arguments.length; T++) {
2286
+ var S = arguments[T];
2287
+ for (var D in S) ({}).hasOwnProperty.call(S, D) && (C[D] = S[D]);
2288
+ }
2289
+ return C;
2290
+ }, m.apply(null, arguments);
2291
+ }
2292
+ function y(C, T, S) {
2293
+ return (T = x(T)) in C ? Object.defineProperty(C, T, { value: S, enumerable: !0, configurable: !0, writable: !0 }) : C[T] = S, C;
2294
+ }
2295
+ function x(C) {
2296
+ var T = v(C, "string");
2297
+ return typeof T == "symbol" ? T : T + "";
2298
+ }
2299
+ function v(C, T) {
2300
+ if (typeof C != "object" || !C) return C;
2301
+ var S = C[Symbol.toPrimitive];
2302
+ if (S !== void 0) {
2303
+ var D = S.call(C, T);
2304
+ if (typeof D != "object") return D;
2305
+ throw new TypeError("@@toPrimitive must return a primitive value.");
2306
+ }
2307
+ return (T === "string" ? String : Number)(C);
2308
+ }
2309
+ class b extends n.Component {
2310
+ // React 16.3+
2311
+ // Arity (props, state)
2312
+ static getDerivedStateFromProps(T, S) {
2313
+ let {
2314
+ position: D
2315
+ } = T, {
2316
+ prevPropsPosition: c
2317
+ } = S;
2318
+ return D && (!c || D.x !== c.x || D.y !== c.y) ? ((0, g.default)("Draggable: getDerivedStateFromProps %j", {
2319
+ position: D,
2320
+ prevPropsPosition: c
2321
+ }), {
2322
+ x: D.x,
2323
+ y: D.y,
2324
+ prevPropsPosition: {
2325
+ ...D
2326
+ }
2327
+ }) : null;
2328
+ }
2329
+ constructor(T) {
2330
+ super(T), y(this, "onDragStart", (S, D) => {
2331
+ if ((0, g.default)("Draggable: onDragStart: %j", D), this.props.onStart(S, (0, s.createDraggableData)(this, D)) === !1) return !1;
2332
+ this.setState({
2333
+ dragging: !0,
2334
+ dragged: !0
2335
+ });
2336
+ }), y(this, "onDrag", (S, D) => {
2337
+ if (!this.state.dragging) return !1;
2338
+ (0, g.default)("Draggable: onDrag: %j", D);
2339
+ const c = (0, s.createDraggableData)(this, D), N = {
2340
+ x: c.x,
2341
+ y: c.y,
2342
+ slackX: 0,
2343
+ slackY: 0
2344
+ };
2345
+ if (this.props.bounds) {
2346
+ const {
2347
+ x: f,
2348
+ y: P
2349
+ } = N;
2350
+ N.x += this.state.slackX, N.y += this.state.slackY;
2351
+ const [$, O] = (0, s.getBoundPosition)(this, N.x, N.y);
2352
+ N.x = $, N.y = O, N.slackX = this.state.slackX + (f - N.x), N.slackY = this.state.slackY + (P - N.y), c.x = N.x, c.y = N.y, c.deltaX = N.x - this.state.x, c.deltaY = N.y - this.state.y;
2353
+ }
2354
+ if (this.props.onDrag(S, c) === !1) return !1;
2355
+ this.setState(N);
2356
+ }), y(this, "onDragStop", (S, D) => {
2357
+ if (!this.state.dragging || this.props.onStop(S, (0, s.createDraggableData)(this, D)) === !1) return !1;
2358
+ (0, g.default)("Draggable: onDragStop: %j", D);
2359
+ const N = {
2360
+ dragging: !1,
2361
+ slackX: 0,
2362
+ slackY: 0
2363
+ };
2364
+ if (!!this.props.position) {
2365
+ const {
2366
+ x: f,
2367
+ y: P
2368
+ } = this.props.position;
2369
+ N.x = f, N.y = P;
2370
+ }
2371
+ this.setState(N);
2372
+ }), this.state = {
2373
+ // Whether or not we are currently dragging.
2374
+ dragging: !1,
2375
+ // Whether or not we have been dragged before.
2376
+ dragged: !1,
2377
+ // Current transform x and y.
2378
+ x: T.position ? T.position.x : T.defaultPosition.x,
2379
+ y: T.position ? T.position.y : T.defaultPosition.y,
2380
+ prevPropsPosition: {
2381
+ ...T.position
2382
+ },
2383
+ // Used for compensating for out-of-bounds drags
2384
+ slackX: 0,
2385
+ slackY: 0,
2386
+ // Can only determine if SVG after mounting
2387
+ isElementSVG: !1
2388
+ }, T.position && !(T.onDrag || T.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
2389
+ }
2390
+ componentDidMount() {
2391
+ typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
2392
+ isElementSVG: !0
2393
+ });
2394
+ }
2395
+ componentWillUnmount() {
2396
+ this.state.dragging && this.setState({
2397
+ dragging: !1
2398
+ });
2399
+ }
2400
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
2401
+ // the underlying DOM node ourselves. See the README for more information.
2402
+ findDOMNode() {
2403
+ return this.props?.nodeRef?.current ?? r.default.findDOMNode(this);
2404
+ }
2405
+ render() {
2406
+ const {
2407
+ axis: T,
2408
+ bounds: S,
2409
+ children: D,
2410
+ defaultPosition: c,
2411
+ defaultClassName: N,
2412
+ defaultClassNameDragging: l,
2413
+ defaultClassNameDragged: f,
2414
+ position: P,
2415
+ positionOffset: $,
2416
+ scale: O,
2417
+ ...E
2418
+ } = this.props;
2419
+ let z = {}, X = null;
2420
+ const H = !!!P || this.state.dragging, ee = P || c, ae = {
2421
+ // Set left if horizontal drag is enabled
2422
+ x: (0, s.canDragX)(this) && H ? this.state.x : ee.x,
2423
+ // Set top if vertical drag is enabled
2424
+ y: (0, s.canDragY)(this) && H ? this.state.y : ee.y
2425
+ };
2426
+ this.state.isElementSVG ? X = (0, o.createSVGTransform)(ae, $) : z = (0, o.createCSSTransform)(ae, $);
2427
+ const de = (0, i.clsx)(D.props.className || "", N, {
2428
+ [l]: this.state.dragging,
2429
+ [f]: this.state.dragged
2430
+ });
2431
+ return /* @__PURE__ */ n.createElement(p.default, m({}, E, {
2432
+ onStart: this.onDragStart,
2433
+ onDrag: this.onDrag,
2434
+ onStop: this.onDragStop
2435
+ }), /* @__PURE__ */ n.cloneElement(n.Children.only(D), {
2436
+ className: de,
2437
+ style: {
2438
+ ...D.props.style,
2439
+ ...z
2440
+ },
2441
+ transform: X
2442
+ }));
2443
+ }
2444
+ }
2445
+ e.default = b, y(b, "displayName", "Draggable"), y(b, "propTypes", {
2446
+ // Accepts all props <DraggableCore> accepts.
2447
+ ...p.default.propTypes,
2448
+ /**
2449
+ * `axis` determines which axis the draggable can move.
2450
+ *
2451
+ * Note that all callbacks will still return data as normal. This only
2452
+ * controls flushing to the DOM.
2453
+ *
2454
+ * 'both' allows movement horizontally and vertically.
2455
+ * 'x' limits movement to horizontal axis.
2456
+ * 'y' limits movement to vertical axis.
2457
+ * 'none' limits all movement.
2458
+ *
2459
+ * Defaults to 'both'.
2460
+ */
2461
+ axis: t.default.oneOf(["both", "x", "y", "none"]),
2462
+ /**
2463
+ * `bounds` determines the range of movement available to the element.
2464
+ * Available values are:
2465
+ *
2466
+ * 'parent' restricts movement within the Draggable's parent node.
2467
+ *
2468
+ * Alternatively, pass an object with the following properties, all of which are optional:
2469
+ *
2470
+ * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
2471
+ *
2472
+ * All values are in px.
2473
+ *
2474
+ * Example:
2475
+ *
2476
+ * ```jsx
2477
+ * let App = React.createClass({
2478
+ * render: function () {
2479
+ * return (
2480
+ * <Draggable bounds={{right: 300, bottom: 300}}>
2481
+ * <div>Content</div>
2482
+ * </Draggable>
2483
+ * );
2484
+ * }
2485
+ * });
2486
+ * ```
2487
+ */
2488
+ bounds: t.default.oneOfType([t.default.shape({
2489
+ left: t.default.number,
2490
+ right: t.default.number,
2491
+ top: t.default.number,
2492
+ bottom: t.default.number
2493
+ }), t.default.string, t.default.oneOf([!1])]),
2494
+ defaultClassName: t.default.string,
2495
+ defaultClassNameDragging: t.default.string,
2496
+ defaultClassNameDragged: t.default.string,
2497
+ /**
2498
+ * `defaultPosition` specifies the x and y that the dragged item should start at
2499
+ *
2500
+ * Example:
2501
+ *
2502
+ * ```jsx
2503
+ * let App = React.createClass({
2504
+ * render: function () {
2505
+ * return (
2506
+ * <Draggable defaultPosition={{x: 25, y: 25}}>
2507
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
2508
+ * </Draggable>
2509
+ * );
2510
+ * }
2511
+ * });
2512
+ * ```
2513
+ */
2514
+ defaultPosition: t.default.shape({
2515
+ x: t.default.number,
2516
+ y: t.default.number
2517
+ }),
2518
+ positionOffset: t.default.shape({
2519
+ x: t.default.oneOfType([t.default.number, t.default.string]),
2520
+ y: t.default.oneOfType([t.default.number, t.default.string])
2521
+ }),
2522
+ /**
2523
+ * `position`, if present, defines the current position of the element.
2524
+ *
2525
+ * This is similar to how form elements in React work - if no `position` is supplied, the component
2526
+ * is uncontrolled.
2527
+ *
2528
+ * Example:
2529
+ *
2530
+ * ```jsx
2531
+ * let App = React.createClass({
2532
+ * render: function () {
2533
+ * return (
2534
+ * <Draggable position={{x: 25, y: 25}}>
2535
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
2536
+ * </Draggable>
2537
+ * );
2538
+ * }
2539
+ * });
2540
+ * ```
2541
+ */
2542
+ position: t.default.shape({
2543
+ x: t.default.number,
2544
+ y: t.default.number
2545
+ }),
2546
+ /**
2547
+ * These properties should be defined on the child, not here.
2548
+ */
2549
+ className: d.dontSetMe,
2550
+ style: d.dontSetMe,
2551
+ transform: d.dontSetMe
2552
+ }), y(b, "defaultProps", {
2553
+ ...p.default.defaultProps,
2554
+ axis: "both",
2555
+ bounds: !1,
2556
+ defaultClassName: "react-draggable",
2557
+ defaultClassNameDragging: "react-draggable-dragging",
2558
+ defaultClassNameDragged: "react-draggable-dragged",
2559
+ defaultPosition: {
2560
+ x: 0,
2561
+ y: 0
2562
+ },
2563
+ scale: 1
2564
+ });
2565
+ })(De)), De;
2566
+ }
2567
+ var it;
2568
+ function mn() {
2569
+ if (it) return fe.exports;
2570
+ it = 1;
2571
+ const {
2572
+ default: e,
2573
+ DraggableCore: n
2574
+ } = gn();
2575
+ return fe.exports = e, fe.exports.default = e, fe.exports.DraggableCore = n, fe.exports;
2576
+ }
2577
+ var pn = mn();
2578
+ const yn = /* @__PURE__ */ rn(pn), vn = le((e, n) => {
2579
+ const r = {
2580
+ ...{
2581
+ // 1. Take it out of the document flow
2582
+ position: "fixed",
2583
+ // 2. Set initial viewport position (e.g., top right)
2584
+ top: "6rem",
2585
+ right: "1rem",
2586
+ // 3. Ensure it stacks above other content
2587
+ zIndex: 1,
2588
+ // Add your layout/appearance styles
2589
+ width: "360px",
2590
+ minHeight: "360px",
2591
+ borderStyle: "solid",
2592
+ borderWidth: "3px",
2593
+ boxShadow: "rgba(0, 0, 0, 0.5) 7px 7px 10px 0px"
2594
+ },
2595
+ ...e.style || {}
2596
+ }, i = e.testId || "not-set", o = e.className || "panel", s = xt(null);
2597
+ return (
2598
+ // 3. Pass the internal ref to the Draggable component via 'nodeRef'
2599
+ /* @__PURE__ */ a(
2600
+ yn,
2601
+ {
2602
+ nodeRef: s,
2603
+ "data-testid": i,
2604
+ axis: "both",
2605
+ handle: ".handle",
2606
+ onStart: (g, h) => {
2607
+ e.onDraggingChange?.(!0);
2608
+ },
2609
+ onStop: (g, h) => {
2610
+ setTimeout(() => {
2611
+ e.onDraggingChange?.(!1);
2612
+ }, 100);
2613
+ },
2614
+ children: /* @__PURE__ */ a("div", { ref: s, className: o, style: r, children: e.children })
2615
+ }
2616
+ )
2617
+ );
2618
+ });
2619
+ function er({ children: e }) {
2620
+ return /* @__PURE__ */ a(
2621
+ "div",
2622
+ {
2623
+ className: "w-full h-full flex-1 flex flex-col gap-2 items-end justify-end content-end",
2624
+ style: {
2625
+ minHeight: "140px"
2626
+ },
2627
+ children: e
2628
+ }
2629
+ );
2630
+ }
2631
+ function tr({ children: e }) {
2632
+ return /* @__PURE__ */ a("div", { className: "w-full flex flex-col items-end", children: e });
2633
+ }
2634
+ const nr = (e) => {
2635
+ console.warn("showToast TODO", e);
2636
+ }, bn = (e) => e < 0.8 ? 1 : e <= 1 ? 0 : e > 1 ? -1 : 0, rr = le((e, n) => {
2637
+ let t = lt(Number(e.zoomScale || 0));
2638
+ const r = e.responsiveGrid || !1, i = e.isEditing || !1, o = {
2639
+ "--bwj-dashboard-transform-scale": t,
2640
+ "--bwj-dashboard-add-cols": bn(t)
2641
+ }, s = Z(
2642
+ "dashboard-main-grid w-full",
2643
+ i ? "editing" : "",
2644
+ r ? "responsive-grid" : "",
2645
+ //`border border-dashed ${isEditing ? 'border-primary border-opacity-50' : 'border-transparent'}`,
2646
+ "border border-solid border-primary"
2647
+ );
2648
+ return /* @__PURE__ */ a("div", { className: s, style: o, children: e.children });
2649
+ }), $e = "size-5", wn = (e, n) => {
2650
+ const t = e.hideTitle && !e.isEditing, r = e.noBorder;
2651
+ let i = `dashboard-widget ${e.isEditing ? "editing" : ""} border border-solid`;
2652
+ r ? i = `${i} border-transparent border-opacity-0` : (e.borderCssClasses || "").trim().length > 0 ? i = `${i} ${e.borderCssClasses}` : i = `${i} border-card-invert border-opacity-20`, e.noShadow && (i = `${i} no-shadow`), e.noPadding && (i = `${i} no-padding p-0`), (e.backgroundCssClasses || "").trim().length > 0 ? i = `${i} ${e.backgroundCssClasses}` : i = `${i} bg-card content-card`, ["large", "xlarge"].indexOf(e.size || "") > -1 && (i = `${i} ${e.size}-widget`);
2653
+ const o = () => {
2654
+ e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey, e.parentWidgetKey);
2655
+ }, s = (p) => {
2656
+ e.onMoveClick && e.widgetKey && e.onMoveClick(p, e.widgetKey, e.parentWidgetKey);
2657
+ }, d = Z(
2658
+ "widget-header",
2659
+ t ? "hidden" : "flex items-center justify-between border-b border-solid border-card-invert",
2660
+ t ? "border-opacity-0" : "border-opacity-20"
2661
+ );
2662
+ return /* @__PURE__ */ W("div", { className: i, children: [
2663
+ /* @__PURE__ */ W("div", { className: d, children: [
2664
+ /* @__PURE__ */ W("div", { className: "widget-title-wrapper w-full flex flex-row gap-2 items-center justify-between", children: [
2665
+ /* @__PURE__ */ W("h2", { className: "widget-title", children: [
2666
+ e.title,
2667
+ " "
2668
+ ] }),
2669
+ /* @__PURE__ */ a("div", {})
2670
+ ] }),
2671
+ /* @__PURE__ */ a("div", { "data-testid": "collapse-and-other-actions", children: /* @__PURE__ */ W("div", { className: "actions-inner", children: [
2672
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("span", { className: "hidden", children: "Widget" }) }),
2673
+ /* @__PURE__ */ W("div", { className: "actions-buttons-container", children: [
2674
+ /* @__PURE__ */ a(
2675
+ J,
2676
+ {
2677
+ "data-testid": `move-widget-left_${e.title}`,
2678
+ isIconButton: !0,
2679
+ disabled: e.index < 1,
2680
+ tooltip: {
2681
+ placement: "top",
2682
+ title: `${e.index < 1 ? "Already at min position" : "Move Widget to the left/up"}`
2683
+ },
2684
+ onClick: () => s(-1),
2685
+ children: /* @__PURE__ */ a(ut, { className: $e })
2686
+ }
2687
+ ),
2688
+ /* @__PURE__ */ a(
2689
+ J,
2690
+ {
2691
+ "data-testid": `move-widget-right_${e.title}`,
2692
+ isIconButton: !0,
2693
+ disabled: e.index >= e.maxIndex,
2694
+ tooltip: {
2695
+ placement: "top",
2696
+ title: `${e.index >= e.maxIndex ? "Already at max position" : "Move Widget to the right/down"}`
2697
+ },
2698
+ onClick: () => s(1),
2699
+ children: /* @__PURE__ */ a(ft, { className: $e })
2700
+ }
2701
+ ),
2702
+ /* @__PURE__ */ a(
2703
+ J,
2704
+ {
2705
+ "data-testid": `remove-container_${e.title}`,
2706
+ isIconButton: !0,
2707
+ tooltip: {
2708
+ placement: "top",
2709
+ title: "Remove Widget"
2710
+ },
2711
+ onClick: () => o(),
2712
+ children: /* @__PURE__ */ a(ht, { className: $e })
2713
+ }
2714
+ )
2715
+ ] })
2716
+ ] }) })
2717
+ ] }),
2718
+ /* @__PURE__ */ a("div", { className: "widget-inner", children: e.children })
2719
+ ] });
2720
+ }, xn = le(wn);
2721
+ function Cn(e) {
2722
+ return /* @__PURE__ */ a("div", { className: "dashboard-widget", children: /* @__PURE__ */ W("div", { className: "absolute inset-0 bg-black flex flex-col items-center justify-center text-center", children: [
2723
+ /* @__PURE__ */ a("div", { className: "w-full absolute opacity-100 text-primary", children: e.title }),
2724
+ /* @__PURE__ */ a("div", { className: "animate-ping rounded-full h-32 w-32 border-8 border-white" })
2725
+ ] }) });
2726
+ }
2727
+ function Sn({
2728
+ index: e,
2729
+ maxIndex: n,
2730
+ widgetKey: t,
2731
+ parentWidgetKey: r,
2732
+ targetContainerKey: i,
2733
+ childWidgetsConfig: o,
2734
+ widgetCatalog: s,
2735
+ isEditing: d,
2736
+ onRemoveClick: p,
2737
+ onMoveClick: g,
2738
+ selectContainer: h
2739
+ }) {
2740
+ const u = `${t}`.split("_"), m = u.length > 1, y = m ? u[0] : t, x = s.get(y);
2741
+ if (!x)
2742
+ return /* @__PURE__ */ a("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
2743
+ "Widget not found in catalog: ",
2744
+ y
2745
+ ] }) });
2746
+ let v = null, b = !1;
2747
+ if (x.component ? (v = x.component, b = !1) : x.loader && (b = !0, v = at(() => {
2748
+ if (!x) return null;
2749
+ if (x.component)
2750
+ return x.component;
2751
+ if (x.loader) {
2752
+ const l = async () => {
2753
+ try {
2754
+ return await x.loader();
2755
+ } catch (f) {
2756
+ return console.error(`CDN Load Failure for ${t}:`, f), {
2757
+ default: () => /* @__PURE__ */ a(xn, { ...D, children: /* @__PURE__ */ W("div", { className: "p-4 border border-dashed border-danger", children: [
2758
+ /* @__PURE__ */ W("p", { className: "font-bold", children: [
2759
+ 'Failed to load "',
2760
+ t,
2761
+ '"'
2762
+ ] }),
2763
+ /* @__PURE__ */ a("p", { className: "text-xs italic", children: "The remote plugin is unavailable or incompatible." }),
2764
+ /* @__PURE__ */ a("pre", { className: "text-xs overflow-hidden", children: JSON.stringify(x.meta || {}, null, 2) })
2765
+ ] }) })
2766
+ };
2767
+ }
2768
+ };
2769
+ return se.lazy(l);
2770
+ }
2771
+ return null;
2772
+ }, [x, t])), !v)
2773
+ return /* @__PURE__ */ a("div", { className: "flex", children: /* @__PURE__ */ W("p", { children: [
2774
+ "Widget definition incomplete: ",
2775
+ y
2776
+ ] }) });
2777
+ const C = !!x.isContainer, T = m ? gt(t) : "", S = C ? (o || []).filter((l) => l.parentWidgetKey === t) : [], D = {
2778
+ index: e,
2779
+ maxIndex: n,
2780
+ widgetKey: t,
2781
+ parentWidgetKey: r,
2782
+ isEditing: d,
2783
+ title: m ? T : x.title,
2784
+ onRemoveClick: p,
2785
+ onMoveClick: g
2786
+ }, c = C ? {
2787
+ highlight: i === t,
2788
+ selectContainer: h,
2789
+ // The children prop is the recursive call back to DynamicWidgetLoader
2790
+ children: S.map((l, f) => /* @__PURE__ */ a(
2791
+ Sn,
2792
+ {
2793
+ index: f,
2794
+ maxIndex: S.length - 1,
2795
+ widgetKey: l.widgetKey,
2796
+ parentWidgetKey: l.parentWidgetKey,
2797
+ widgetCatalog: s,
2798
+ isEditing: d,
2799
+ onRemoveClick: p,
2800
+ onMoveClick: g
2801
+ },
2802
+ `${l.widgetKey}_${f}`
2803
+ ))
2804
+ } : {}, N = () => /* @__PURE__ */ a(v, { ...D, ...c });
2805
+ return b ? /* @__PURE__ */ a(Ct, { fallback: /* @__PURE__ */ a(Cn, { title: `Loading ${x.title}` }), children: /* @__PURE__ */ a(N, {}) }) : /* @__PURE__ */ a(N, {});
2806
+ }
2807
+ const we = "size-5";
2808
+ function ke(e) {
2809
+ const n = e.highlight || !1, t = e.direction || "column", r = e.children.length > 0, i = e.isEditing || !1;
2810
+ let d = n ? "border-transparent" : i && !r ? "border-card-invert" : "border-transparent";
2811
+ const p = ["large", "xlarge"].includes(e.size || "");
2812
+ let g = "";
2813
+ ["large", "xlarge"].indexOf(e.size || "") > -1 && (g = `${e.size}-widget`);
2814
+ let h = "";
2815
+ t === "row" && !r ? h = "min-h-48" : t === "column" && !r && (h = "min-h-96");
2816
+ let u = Z(
2817
+ "dashboard-widget-container relative ",
2818
+ r ? "" : "has-no-children",
2819
+ i ? "editing" : "",
2820
+ h,
2821
+ g,
2822
+ p ? "widget-container-grid" : "widget-container-flex",
2823
+ `direction-${t}`,
2824
+ `border ${d}`,
2825
+ `${n ? "highlight-container" : ""} ${d}`
2826
+ ), m = `widget-container-header direction-${t} flex items-center border-1 ${d}`;
2827
+ const y = () => {
2828
+ e.onRemoveClick && e.widgetKey && e.onRemoveClick(e.widgetKey);
2829
+ }, x = (b) => {
2830
+ e.onMoveClick && e.widgetKey && e.onMoveClick(b, e.widgetKey, e.parentWidgetKey);
2831
+ }, v = () => {
2832
+ e.selectContainer && e.widgetKey && e.selectContainer(e.widgetKey);
2833
+ };
2834
+ return /* @__PURE__ */ W("div", { "data-testid": `container_${e.widgetKey}`, className: u, children: [
2835
+ /* @__PURE__ */ W("div", { className: m, children: [
2836
+ /* @__PURE__ */ a(
2837
+ "div",
2838
+ {
2839
+ className: "widget-title-wrapper w-full flex whitespace-nowrap",
2840
+ onClick: v,
2841
+ children: /* @__PURE__ */ a("span", { className: "text-sm font-semibold capitalize", children: e.title })
2842
+ }
2843
+ ),
2844
+ /* @__PURE__ */ a("div", { "data-testid": "collapse-and-other-actions", children: /* @__PURE__ */ a("div", { className: "actions-inner", children: /* @__PURE__ */ W("div", { className: "actions-buttons-container", children: [
2845
+ /* @__PURE__ */ a(
2846
+ J,
2847
+ {
2848
+ "data-testid": `open-widgets-catalog-from-container_${e.title}`,
2849
+ isIconButton: !0,
2850
+ className: "whitespace-nowrap",
2851
+ tooltip: {
2852
+ placement: "top",
2853
+ title: "Target this Container"
2854
+ },
2855
+ onClick: v,
2856
+ children: /* @__PURE__ */ a(
2857
+ Qt,
2858
+ {
2859
+ className: `${we} ${n ? "text-success" : "text-disabled"}`
2860
+ }
2861
+ )
2862
+ }
2863
+ ),
2864
+ /* @__PURE__ */ a(
2865
+ J,
2866
+ {
2867
+ "data-testid": `move-container-left_${e.title}`,
2868
+ isIconButton: !0,
2869
+ disabled: e.index < 1,
2870
+ tooltip: {
2871
+ placement: "top",
2872
+ title: `${e.index < 1 ? "Already at min position" : "Move Container to the left/up"}`
2873
+ },
2874
+ onClick: () => x(-1),
2875
+ children: /* @__PURE__ */ a(ut, { className: we })
2876
+ }
2877
+ ),
2878
+ /* @__PURE__ */ a(
2879
+ J,
2880
+ {
2881
+ "data-testid": `move-container-right_${e.title}`,
2882
+ isIconButton: !0,
2883
+ disabled: e.index >= e.maxIndex,
2884
+ tooltip: {
2885
+ placement: "top",
2886
+ title: `${e.index >= e.maxIndex ? "Already at max position" : "Move Container to the right/down"}`
2887
+ },
2888
+ onClick: () => x(1),
2889
+ children: /* @__PURE__ */ a(ft, { className: we })
2890
+ }
2891
+ ),
2892
+ /* @__PURE__ */ a(
2893
+ J,
2894
+ {
2895
+ "data-testid": `remove-container_${e.title}`,
2896
+ isIconButton: !0,
2897
+ tooltip: {
2898
+ placement: "top",
2899
+ title: "Remove Container"
2900
+ },
2901
+ onClick: () => y(),
2902
+ children: /* @__PURE__ */ a(ht, { className: we })
2903
+ }
2904
+ )
2905
+ ] }) }) })
2906
+ ] }),
2907
+ /* @__PURE__ */ a("div", { "data-testid": `childrenwrapper_${e.widgetKey}`, className: "widget-container-inner", children: e.children })
2908
+ ] });
2909
+ }
2910
+ function or(e) {
2911
+ const { direction: n, ...t } = e;
2912
+ return /* @__PURE__ */ a(ke, { direction: "column", ...t });
2913
+ }
2914
+ function ir(e) {
2915
+ const { size: n, ...t } = e;
2916
+ return /* @__PURE__ */ a(ke, { size: "large", ...t });
2917
+ }
2918
+ function ar(e) {
2919
+ const { direction: n, ...t } = e;
2920
+ return /* @__PURE__ */ a(ke, { direction: "row", ...t });
2921
+ }
2922
+ function We({
2923
+ // widgetKey,
2924
+ metaData: e,
2925
+ alreadyAdded: n,
2926
+ addWidget: t
2927
+ }) {
2928
+ const r = e.icon || en, i = e.displayName || "Unknown", o = e.description || "---", d = (e.noDuplicatedWidgets || !1) && n, p = Z(`
2929
+ flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
2930
+ ${d ? "border-disabled fill-disabled text-disabled" : "cursor-pointer border-primary fill-danger hover:fill-primary content-primary hover:brightness-110"}
2931
+ `);
2932
+ return /* @__PURE__ */ W("div", { className: p, style: { width: "calc(100% - 1rem)" }, onClick: () => {
2933
+ d || t();
2934
+ }, children: [
2935
+ /* @__PURE__ */ a(r, { className: "" }),
2936
+ /* @__PURE__ */ W("div", { className: "w-full", children: [
2937
+ /* @__PURE__ */ W("div", { className: "flex flex-row items-center gap-2 justify-between", children: [
2938
+ /* @__PURE__ */ a("span", { className: "font-bold", children: i }),
2939
+ /* @__PURE__ */ a("div", { className: "text-xs", children: d ? "(Added)" : "" })
2940
+ ] }),
2941
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 text-xs", children: /* @__PURE__ */ a("div", { children: o }) })
2942
+ ] })
2943
+ ] });
2944
+ }
2945
+ function Dn({
2946
+ item: e,
2947
+ onSettingItemChanged: n
2948
+ }) {
2949
+ const t = e.displayName || "Unknown", r = e.description || "---", i = Z(`
2950
+ flex flex-row gap-2 p-2 rounded-md border text-sm bg-card content-card backdrop-opacity-100
2951
+ `), o = (d) => {
2952
+ const p = d.key;
2953
+ if (["ArrowUp", "ArrowDown"].includes(p)) {
2954
+ d.preventDefault();
2955
+ const g = Et.incrementOrDecrementValue(
2956
+ e,
2957
+ p === "ArrowUp" ? 1 : -1
2958
+ );
2959
+ n(g);
2960
+ }
2961
+ }, s = (d) => {
2962
+ n({
2963
+ ...e,
2964
+ value: d.target.value || ""
2965
+ });
2966
+ };
2967
+ return /* @__PURE__ */ a("div", { className: i, style: { width: "calc(100% - 1rem)" }, children: /* @__PURE__ */ W("div", { className: "w-full", children: [
2968
+ /* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2 justify-between", children: /* @__PURE__ */ a("span", { className: "font-bold", children: t }) }),
2969
+ /* @__PURE__ */ a("div", { className: "flex flex-col gap-2 text-xs", children: /* @__PURE__ */ a("div", { children: r }) }),
2970
+ /* @__PURE__ */ W("div", { children: [
2971
+ "Value:",
2972
+ /* @__PURE__ */ a(
2973
+ mt,
2974
+ {
2975
+ label: "Filter...",
2976
+ size: "small",
2977
+ className: "w-full",
2978
+ value: e.value,
2979
+ onChange: s,
2980
+ onKeyDown: o
2981
+ }
2982
+ )
2983
+ ] })
2984
+ ] }) });
2985
+ }
2986
+ const Ie = (e, n) => [
2987
+ ...n.widgets.filter((r) => r.indexOf("Container") === -1),
2988
+ ...n.childWidgetsConfig.map((r) => r.widgetKey)
2989
+ ].includes(e);
2990
+ function sr({
2991
+ targetContainerKey: e,
2992
+ widgetsCatalog: n,
2993
+ currentDashboardConfig: t,
2994
+ undoStatus: r,
2995
+ addWidget: i,
2996
+ addContainer: o,
2997
+ onSettingItemsUpdated: s,
2998
+ onResetToDefaultDashboardClick: d,
2999
+ onUndoOrRedo: p,
3000
+ onDoneClick: g
3001
+ }) {
3002
+ const [h, u] = ce("Editing"), [m, y] = ce(0), [x, v] = ce(""), C = Array.from(n.keys()).map((E) => ({
3003
+ widgetKey: E,
3004
+ metaData: Pt(E, n)
3005
+ })), T = (E) => {
3006
+ v(E.target.value);
3007
+ }, S = (E) => {
3008
+ const z = x.trim().toLowerCase();
3009
+ return z.length < 1 ? !0 : E.displayName.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
3010
+ }, D = (E) => {
3011
+ const z = x.trim().toLowerCase();
3012
+ return z.length < 1 ? !0 : E.displayName.trim().toLowerCase().includes(z) || E.description.toLowerCase().includes(z);
3013
+ }, c = (E) => Z(
3014
+ "px-4 py-2 font-medium cursor-pointer border-b-2 border-transparent hover:border-primary focus:outline-none",
3015
+ E === m ? "text-primary border-primary" : ""
3016
+ ), N = !!e;
3017
+ St(() => {
3018
+ if (e) {
3019
+ y(0);
3020
+ const E = gt(e);
3021
+ u(`Editing ${E}`);
3022
+ } else
3023
+ u("Editing Dashboard");
3024
+ }, [e]);
3025
+ const l = (E) => {
3026
+ N ? i(E, e) : i(E);
3027
+ }, f = (E) => {
3028
+ const z = (t.cssSettings || []).map((X) => X.key === E.key ? E : X);
3029
+ s(z);
3030
+ }, [P, $] = ce(!1);
3031
+ return /* @__PURE__ */ a(
3032
+ vn,
3033
+ {
3034
+ testId: "dashboard-catalog-flyout",
3035
+ className: "bg-body content-body bg-opacity-70 border-2 border-primary",
3036
+ style: {
3037
+ width: "360px",
3038
+ minWidth: "360px",
3039
+ maxWidth: "360px",
3040
+ minHeight: "360px",
3041
+ backdropFilter: "blur(8px)"
3042
+ },
3043
+ onDraggingChange: (E) => {
3044
+ $(E);
3045
+ },
3046
+ children: /* @__PURE__ */ W("div", { className: "flex flex-col gap-2 p-2", children: [
3047
+ /* @__PURE__ */ W("div", { className: "flex flex-row gap-2 justify-between", children: [
3048
+ /* @__PURE__ */ W("div", { className: "handle flex-1 flex gap-2 w-full hover:text-primary cursor-grab", children: [
3049
+ P ? /* @__PURE__ */ a(Jt, { className: "size-5" }) : /* @__PURE__ */ a(Zt, { className: "size-5" }),
3050
+ /* @__PURE__ */ a(
3051
+ "h2",
3052
+ {
3053
+ className: "flex-1 text-base margin-0 capitalize",
3054
+ title: N ? h : `Editing dashboard: ${t.dashboardName}`,
3055
+ children: h
3056
+ }
3057
+ )
3058
+ ] }),
3059
+ /* @__PURE__ */ W("div", { className: "flex flex-row gap-2 items-center", children: [
3060
+ /* @__PURE__ */ a(
3061
+ J,
3062
+ {
3063
+ "data-testid": "undo-dashboard-config-change",
3064
+ isIconButton: !0,
3065
+ tooltip: {
3066
+ placement: "bottom",
3067
+ title: "Undo"
3068
+ },
3069
+ disabled: r.isUndoDisabled,
3070
+ onClick: () => p("Undo"),
3071
+ children: /* @__PURE__ */ a(Xt, { className: "size-5" })
3072
+ }
3073
+ ),
3074
+ /* @__PURE__ */ a(
3075
+ J,
3076
+ {
3077
+ "data-testid": "redo-dashboard-config-change",
3078
+ isIconButton: !0,
3079
+ tooltip: {
3080
+ placement: "bottom",
3081
+ title: "Redo"
3082
+ },
3083
+ disabled: r.isRedoDisabled,
3084
+ onClick: () => p("Redo"),
3085
+ children: /* @__PURE__ */ a(Gt, { className: "size-5" })
3086
+ }
3087
+ ),
3088
+ /* @__PURE__ */ a(
3089
+ J,
3090
+ {
3091
+ "data-testid": "reset-dashboard-to-default",
3092
+ isIconButton: !0,
3093
+ tooltip: {
3094
+ placement: "bottom",
3095
+ title: "Reset this dashboard to the default configuration"
3096
+ },
3097
+ onClick: d,
3098
+ children: /* @__PURE__ */ a(Ht, { className: "size-5" })
3099
+ }
3100
+ )
3101
+ ] })
3102
+ ] }),
3103
+ /* @__PURE__ */ W("div", { className: "flex border-b border-gray-200", children: [
3104
+ /* @__PURE__ */ a("button", { onClick: () => y(0), className: c(0), children: "Widgets" }),
3105
+ /* @__PURE__ */ a("button", { onClick: () => y(1), className: c(1), children: "Charts" }),
3106
+ !N && /* @__PURE__ */ a("button", { onClick: () => y(2), className: c(2), children: "Containers" }),
3107
+ !N && /* @__PURE__ */ a("button", { onClick: () => y(3), className: c(3), children: /* @__PURE__ */ a(Kt, {}) })
3108
+ ] }),
3109
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-1 w-full", children: /* @__PURE__ */ a(
3110
+ mt,
3111
+ {
3112
+ label: "Filter...",
3113
+ size: "small",
3114
+ className: "w-full",
3115
+ value: x,
3116
+ onChange: T
3117
+ }
3118
+ ) }),
3119
+ /* @__PURE__ */ W(
3120
+ "div",
3121
+ {
3122
+ className: "flex flex-col gap-2 overflow-x-hidden overflow-y-auto",
3123
+ style: {
3124
+ maxHeight: "360px"
3125
+ },
3126
+ children: [
3127
+ m === 0 && C.filter(
3128
+ (E) => E.metaData.categories.includes("Widget") && S(E.metaData)
3129
+ ).map((E) => /* @__PURE__ */ a(
3130
+ We,
3131
+ {
3132
+ widgetKey: E.widgetKey,
3133
+ metaData: E.metaData,
3134
+ alreadyAdded: Ie(E.widgetKey, t),
3135
+ addWidget: () => l(E.widgetKey)
3136
+ },
3137
+ E.widgetKey
3138
+ )),
3139
+ m === 1 && C.filter(
3140
+ (E) => E.metaData.categories.includes("Chart") && S(E.metaData)
3141
+ ).map((E) => /* @__PURE__ */ a(
3142
+ We,
3143
+ {
3144
+ widgetKey: E.widgetKey,
3145
+ metaData: E.metaData,
3146
+ alreadyAdded: Ie(E.widgetKey, t),
3147
+ addWidget: () => l(E.widgetKey)
3148
+ },
3149
+ E.widgetKey
3150
+ )),
3151
+ !N && m === 2 && C.filter((E) => E.metaData.categories.includes("Container")).map((E) => /* @__PURE__ */ a(
3152
+ We,
3153
+ {
3154
+ widgetKey: E.widgetKey,
3155
+ metaData: E.metaData,
3156
+ alreadyAdded: Ie(E.widgetKey, t),
3157
+ addWidget: () => o(E.widgetKey)
3158
+ },
3159
+ E.widgetKey
3160
+ )),
3161
+ !N && m === 3 && (t.cssSettings || []).filter(D).map((E) => /* @__PURE__ */ a(
3162
+ Dn,
3163
+ {
3164
+ item: E,
3165
+ onSettingItemChanged: f
3166
+ },
3167
+ E.key
3168
+ ))
3169
+ ]
3170
+ }
3171
+ ),
3172
+ /* @__PURE__ */ a("div", { className: "mt-4 w-full flex flex-row justify-end pt-1", children: /* @__PURE__ */ a(
3173
+ J,
3174
+ {
3175
+ className: "bg-opacity-100",
3176
+ tooltip: {
3177
+ placement: "bottom",
3178
+ title: "Click to exit edit mode"
3179
+ },
3180
+ onClick: g,
3181
+ children: "Done"
3182
+ }
3183
+ ) })
3184
+ ] })
3185
+ }
3186
+ );
3187
+ }
3188
+ export {
3189
+ jn as AddIcon,
3190
+ J as Button,
3191
+ en as CircleQuestionMark,
3192
+ Qt as CrosshairIcon,
3193
+ rr as DashboardGrid,
3194
+ Fe as DashboardMaxZoomScale,
3195
+ Ae as DashboardMinZoomScale,
3196
+ xn as DashboardWidgetBase,
3197
+ _t as DashboardZoomStep,
3198
+ An as DeleteIcon,
3199
+ vn as DraggablePanel,
3200
+ Sn as DynamicWidgetLoader,
3201
+ Fn as EditIcon,
3202
+ Ln as GridIcon,
3203
+ Jt as HandGrabIcon,
3204
+ Zt as HandIcon,
3205
+ Xn as ListItem,
3206
+ Gn as ListItemLeftChild,
3207
+ Zn as ListItemMiddleChild,
3208
+ Jn as ListItemRightChild,
3209
+ Un as MonitorIcon,
3210
+ Vn as MonitorSmartphoneIcon,
3211
+ ut as MoveLeftIcon,
3212
+ ft as MoveRightIcon,
3213
+ Gt as RedoIcon,
3214
+ Kt as SettingsIcon,
3215
+ nn as Stack,
3216
+ K as SvgBaseWrapper,
3217
+ Yn as TabletSmartphoneIcon,
3218
+ Bn as TargetIcon,
3219
+ mt as TextField,
3220
+ Ht as TimerResetIcon,
3221
+ Xt as UndoIcon,
3222
+ or as WidgetContainerColumn,
3223
+ ir as WidgetContainerLarge,
3224
+ ar as WidgetContainerRow,
3225
+ sr as WidgetsCatalogFlyout,
3226
+ er as WrapperColumnContent,
3227
+ tr as WrapperColumnContentListItem,
3228
+ ht as XCircleIcon,
3229
+ qn as ZoomInIcon,
3230
+ zn as ZoomOutIcon,
3231
+ Ce as blankDashboardConfig,
3232
+ ct as createDynamicEntry,
3233
+ $n as createStaticEntry,
3234
+ Dt as cssSettingsCatalog,
3235
+ Hn as cssVarsUtils,
3236
+ Et as dashboardSettingsUtils,
3237
+ Mt as ensureContainersSequence,
3238
+ lt as ensureZoomScaleIsWithinRange,
3239
+ ge as getDefaultWidgetMetaFromKey,
3240
+ Pn as getDefaultWidgetMetaFromMap,
3241
+ Z as getDistinctCssClasses,
3242
+ Wt as getMetaInfoFromFile,
3243
+ _n as getNewZoomScaleWithinRange,
3244
+ Pt as getWidgetMetaFromCatalog,
3245
+ Wn as localWidgetDiscovery,
3246
+ gt as parseContainerTitle,
3247
+ $t as parseKeyAndTitleFromFilePath,
3248
+ In as remoteWidgetDiscovery,
3249
+ Mn as removeEmptyContainers,
3250
+ re as resolveColorFromClass,
3251
+ Kn as resolvedColors,
3252
+ nr as showToast,
3253
+ Rn as useDashboardStorageService,
3254
+ On as useDashboardStore,
3255
+ kn as useDashboardUndoService
3256
+ };