@burdenoff/microfe-bigconsole 2026.615.2 → 2026.615.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/components/widgets/WidgetHeader.js +78 -59
- package/dist/bigconsole/components/widgets/WidgetHeader.js.map +1 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +243 -227
- package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +200 -0
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js.map +1 -0
- package/dist/bigconsole/hooks/index.js +1 -0
- package/dist/bigconsole/hooks/useWidgetComments.js +81 -0
- package/dist/bigconsole/hooks/useWidgetComments.js.map +1 -0
- package/dist/generated/wspace-operations.js +282 -201
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import e from "./WidgetMenu.js";
|
|
2
2
|
import { memo as t } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { MessageSquare as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
5
|
//#region src/bigconsole/components/widgets/WidgetHeader.tsx
|
|
5
|
-
var
|
|
6
|
-
return /* @__PURE__ */
|
|
6
|
+
var a = t(function({ widget: t, definition: a, isSelected: s, isEditMode: c, isLoading: l, timeUntilRefresh: u, hasDrilldown: d, onRefresh: f, onExportCSV: p, onExportPNG: m, onDrilldown: h, onToggleComments: g, commentsOpen: _, commentCount: v = 0 }) {
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
7
8
|
className: `
|
|
8
9
|
flex items-center justify-between
|
|
9
10
|
px-4 py-3
|
|
10
11
|
border-b border-border-default
|
|
11
12
|
bg-bg-muted
|
|
12
|
-
${
|
|
13
|
+
${s && c ? "bg-action-primary-bg/5" : ""}
|
|
13
14
|
`,
|
|
14
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ i("div", {
|
|
15
16
|
className: `
|
|
16
17
|
widget-drag-handle
|
|
17
18
|
flex items-center gap-2 min-w-0 flex-1
|
|
18
|
-
${
|
|
19
|
+
${c ? "cursor-move" : ""}
|
|
19
20
|
`,
|
|
20
21
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ r("div", {
|
|
22
23
|
className: `
|
|
23
24
|
flex-shrink-0 w-5 h-5
|
|
24
25
|
text-text-secondary
|
|
25
|
-
${
|
|
26
|
+
${l ? "animate-pulse" : ""}
|
|
26
27
|
`,
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ r(o, { name: a.icon })
|
|
28
29
|
}),
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ r("h3", {
|
|
30
31
|
className: "\n text-sm font-medium\n text-text-primary\n truncate\n ",
|
|
31
32
|
title: t.title,
|
|
32
33
|
children: t.title
|
|
33
34
|
}),
|
|
34
|
-
|
|
35
|
+
d && /* @__PURE__ */ i("span", {
|
|
35
36
|
className: "\n flex-shrink-0 inline-flex items-center gap-0.5\n px-1.5 py-0.5 rounded-md\n bg-action-primary-bg/10 text-action-primary-text\n text-[10px] font-medium\n ",
|
|
36
37
|
title: "Click data to drill down",
|
|
37
|
-
children: [/* @__PURE__ */
|
|
38
|
+
children: [/* @__PURE__ */ r("svg", {
|
|
38
39
|
className: "w-2.5 h-2.5",
|
|
39
40
|
fill: "none",
|
|
40
41
|
stroke: "currentColor",
|
|
41
42
|
viewBox: "0 0 24 24",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ r("path", {
|
|
43
44
|
strokeLinecap: "round",
|
|
44
45
|
strokeLinejoin: "round",
|
|
45
46
|
strokeWidth: 2.5,
|
|
@@ -47,28 +48,28 @@ var i = t(function({ widget: t, definition: i, isSelected: o, isEditMode: s, isL
|
|
|
47
48
|
})
|
|
48
49
|
}), "Drilldown"]
|
|
49
50
|
}),
|
|
50
|
-
|
|
51
|
+
u && !c && /* @__PURE__ */ r("span", {
|
|
51
52
|
className: "\n flex-shrink-0 text-xs\n text-text-secondary\n tabular-nums\n ",
|
|
52
53
|
title: "Time until next refresh",
|
|
53
|
-
children:
|
|
54
|
+
children: u
|
|
54
55
|
})
|
|
55
56
|
]
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ i("div", {
|
|
57
58
|
className: "flex items-center gap-1 ml-2",
|
|
58
59
|
children: [
|
|
59
|
-
|
|
60
|
+
h && !c && /* @__PURE__ */ r("button", {
|
|
60
61
|
type: "button",
|
|
61
62
|
onClick: (e) => {
|
|
62
|
-
e.stopPropagation(),
|
|
63
|
+
e.stopPropagation(), h();
|
|
63
64
|
},
|
|
64
65
|
className: "\n p-1.5 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-muted\n transition-colors\n ",
|
|
65
66
|
title: "Drill down to details",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ r("svg", {
|
|
67
68
|
className: "w-4 h-4",
|
|
68
69
|
fill: "none",
|
|
69
70
|
stroke: "currentColor",
|
|
70
71
|
viewBox: "0 0 24 24",
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ r("path", {
|
|
72
73
|
strokeLinecap: "round",
|
|
73
74
|
strokeLinejoin: "round",
|
|
74
75
|
strokeWidth: 2,
|
|
@@ -76,12 +77,12 @@ var i = t(function({ widget: t, definition: i, isSelected: o, isEditMode: s, isL
|
|
|
76
77
|
})
|
|
77
78
|
})
|
|
78
79
|
}),
|
|
79
|
-
|
|
80
|
+
f && /* @__PURE__ */ r("button", {
|
|
80
81
|
type: "button",
|
|
81
82
|
onClick: (e) => {
|
|
82
|
-
e.stopPropagation(),
|
|
83
|
+
e.stopPropagation(), f();
|
|
83
84
|
},
|
|
84
|
-
disabled:
|
|
85
|
+
disabled: l,
|
|
85
86
|
className: `
|
|
86
87
|
p-1.5 rounded-md
|
|
87
88
|
text-text-secondary
|
|
@@ -89,15 +90,15 @@ var i = t(function({ widget: t, definition: i, isSelected: o, isEditMode: s, isL
|
|
|
89
90
|
hover:bg-bg-muted
|
|
90
91
|
transition-colors
|
|
91
92
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
92
|
-
${
|
|
93
|
+
${l ? "animate-spin" : ""}
|
|
93
94
|
`,
|
|
94
95
|
title: "Refresh data",
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ r("svg", {
|
|
96
97
|
className: "w-4 h-4",
|
|
97
98
|
fill: "none",
|
|
98
99
|
stroke: "currentColor",
|
|
99
100
|
viewBox: "0 0 24 24",
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ r("path", {
|
|
101
102
|
strokeLinecap: "round",
|
|
102
103
|
strokeLinejoin: "round",
|
|
103
104
|
strokeWidth: 2,
|
|
@@ -105,161 +106,179 @@ var i = t(function({ widget: t, definition: i, isSelected: o, isEditMode: s, isL
|
|
|
105
106
|
})
|
|
106
107
|
})
|
|
107
108
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
+
g && /* @__PURE__ */ i("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
onClick: (e) => {
|
|
112
|
+
e.stopPropagation(), g();
|
|
113
|
+
},
|
|
114
|
+
"aria-label": "Toggle comments",
|
|
115
|
+
"aria-pressed": _,
|
|
116
|
+
className: `
|
|
117
|
+
relative p-1.5 rounded-md
|
|
118
|
+
transition-colors
|
|
119
|
+
${_ ? "text-action-primary-text bg-action-primary-bg/10" : "text-text-secondary hover:text-text-primary hover:bg-bg-muted"}
|
|
120
|
+
`,
|
|
121
|
+
title: "Comments",
|
|
122
|
+
children: [/* @__PURE__ */ r(n, { className: "w-4 h-4" }), v > 0 && /* @__PURE__ */ r("span", {
|
|
123
|
+
className: "absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] px-0.5 rounded-full bg-action-primary-bg text-action-primary-text text-[9px] font-semibold leading-[14px] text-center tabular-nums",
|
|
124
|
+
children: v > 99 ? "99+" : v
|
|
125
|
+
})]
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ r("div", {
|
|
109
128
|
className: "block",
|
|
110
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ r(e, {
|
|
111
130
|
widget: t,
|
|
112
|
-
isEditMode:
|
|
113
|
-
onRefresh:
|
|
114
|
-
onExportCSV:
|
|
115
|
-
onExportPNG:
|
|
131
|
+
isEditMode: c,
|
|
132
|
+
onRefresh: f,
|
|
133
|
+
onExportCSV: p,
|
|
134
|
+
onExportPNG: m
|
|
116
135
|
})
|
|
117
136
|
})
|
|
118
137
|
]
|
|
119
138
|
})]
|
|
120
139
|
});
|
|
121
|
-
}),
|
|
122
|
-
let
|
|
123
|
-
TrendingUp: /* @__PURE__ */
|
|
140
|
+
}), o = ({ name: e, className: t = "" }) => {
|
|
141
|
+
let n = {
|
|
142
|
+
TrendingUp: /* @__PURE__ */ r("svg", {
|
|
124
143
|
fill: "none",
|
|
125
144
|
stroke: "currentColor",
|
|
126
145
|
viewBox: "0 0 24 24",
|
|
127
146
|
className: t,
|
|
128
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ r("path", {
|
|
129
148
|
strokeLinecap: "round",
|
|
130
149
|
strokeLinejoin: "round",
|
|
131
150
|
strokeWidth: 2,
|
|
132
151
|
d: "M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"
|
|
133
152
|
})
|
|
134
153
|
}),
|
|
135
|
-
BarChart3: /* @__PURE__ */
|
|
154
|
+
BarChart3: /* @__PURE__ */ r("svg", {
|
|
136
155
|
fill: "none",
|
|
137
156
|
stroke: "currentColor",
|
|
138
157
|
viewBox: "0 0 24 24",
|
|
139
158
|
className: t,
|
|
140
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: /* @__PURE__ */ r("path", {
|
|
141
160
|
strokeLinecap: "round",
|
|
142
161
|
strokeLinejoin: "round",
|
|
143
162
|
strokeWidth: 2,
|
|
144
163
|
d: "M18 20V10M12 20V4M6 20v-6"
|
|
145
164
|
})
|
|
146
165
|
}),
|
|
147
|
-
LineChart: /* @__PURE__ */
|
|
166
|
+
LineChart: /* @__PURE__ */ r("svg", {
|
|
148
167
|
fill: "none",
|
|
149
168
|
stroke: "currentColor",
|
|
150
169
|
viewBox: "0 0 24 24",
|
|
151
170
|
className: t,
|
|
152
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ r("path", {
|
|
153
172
|
strokeLinecap: "round",
|
|
154
173
|
strokeLinejoin: "round",
|
|
155
174
|
strokeWidth: 2,
|
|
156
175
|
d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14"
|
|
157
176
|
})
|
|
158
177
|
}),
|
|
159
|
-
Table: /* @__PURE__ */
|
|
178
|
+
Table: /* @__PURE__ */ r("svg", {
|
|
160
179
|
fill: "none",
|
|
161
180
|
stroke: "currentColor",
|
|
162
181
|
viewBox: "0 0 24 24",
|
|
163
182
|
className: t,
|
|
164
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ r("path", {
|
|
165
184
|
strokeLinecap: "round",
|
|
166
185
|
strokeLinejoin: "round",
|
|
167
186
|
strokeWidth: 2,
|
|
168
187
|
d: "M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"
|
|
169
188
|
})
|
|
170
189
|
}),
|
|
171
|
-
Gauge: /* @__PURE__ */
|
|
190
|
+
Gauge: /* @__PURE__ */ r("svg", {
|
|
172
191
|
fill: "none",
|
|
173
192
|
stroke: "currentColor",
|
|
174
193
|
viewBox: "0 0 24 24",
|
|
175
194
|
className: t,
|
|
176
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ r("path", {
|
|
177
196
|
strokeLinecap: "round",
|
|
178
197
|
strokeLinejoin: "round",
|
|
179
198
|
strokeWidth: 2,
|
|
180
199
|
d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
181
200
|
})
|
|
182
201
|
}),
|
|
183
|
-
Activity: /* @__PURE__ */
|
|
202
|
+
Activity: /* @__PURE__ */ r("svg", {
|
|
184
203
|
fill: "none",
|
|
185
204
|
stroke: "currentColor",
|
|
186
205
|
viewBox: "0 0 24 24",
|
|
187
206
|
className: t,
|
|
188
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ r("path", {
|
|
189
208
|
strokeLinecap: "round",
|
|
190
209
|
strokeLinejoin: "round",
|
|
191
210
|
strokeWidth: 2,
|
|
192
211
|
d: "M22 12h-4l-3 9L9 3l-3 9H2"
|
|
193
212
|
})
|
|
194
213
|
}),
|
|
195
|
-
List: /* @__PURE__ */
|
|
214
|
+
List: /* @__PURE__ */ r("svg", {
|
|
196
215
|
fill: "none",
|
|
197
216
|
stroke: "currentColor",
|
|
198
217
|
viewBox: "0 0 24 24",
|
|
199
218
|
className: t,
|
|
200
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ r("path", {
|
|
201
220
|
strokeLinecap: "round",
|
|
202
221
|
strokeLinejoin: "round",
|
|
203
222
|
strokeWidth: 2,
|
|
204
223
|
d: "M4 6h16M4 10h16M4 14h16M4 18h16"
|
|
205
224
|
})
|
|
206
225
|
}),
|
|
207
|
-
PieChart: /* @__PURE__ */
|
|
226
|
+
PieChart: /* @__PURE__ */ i("svg", {
|
|
208
227
|
fill: "none",
|
|
209
228
|
stroke: "currentColor",
|
|
210
229
|
viewBox: "0 0 24 24",
|
|
211
230
|
className: t,
|
|
212
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ r("path", {
|
|
213
232
|
strokeLinecap: "round",
|
|
214
233
|
strokeLinejoin: "round",
|
|
215
234
|
strokeWidth: 2,
|
|
216
235
|
d: "M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z"
|
|
217
|
-
}), /* @__PURE__ */
|
|
236
|
+
}), /* @__PURE__ */ r("path", {
|
|
218
237
|
strokeLinecap: "round",
|
|
219
238
|
strokeLinejoin: "round",
|
|
220
239
|
strokeWidth: 2,
|
|
221
240
|
d: "M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z"
|
|
222
241
|
})]
|
|
223
242
|
}),
|
|
224
|
-
BarChart: /* @__PURE__ */
|
|
243
|
+
BarChart: /* @__PURE__ */ r("svg", {
|
|
225
244
|
fill: "none",
|
|
226
245
|
stroke: "currentColor",
|
|
227
246
|
viewBox: "0 0 24 24",
|
|
228
247
|
className: t,
|
|
229
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ r("path", {
|
|
230
249
|
strokeLinecap: "round",
|
|
231
250
|
strokeLinejoin: "round",
|
|
232
251
|
strokeWidth: 2,
|
|
233
252
|
d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"
|
|
234
253
|
})
|
|
235
254
|
}),
|
|
236
|
-
AreaChart: /* @__PURE__ */
|
|
255
|
+
AreaChart: /* @__PURE__ */ r("svg", {
|
|
237
256
|
fill: "none",
|
|
238
257
|
stroke: "currentColor",
|
|
239
258
|
viewBox: "0 0 24 24",
|
|
240
259
|
className: t,
|
|
241
|
-
children: /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ r("path", {
|
|
242
261
|
strokeLinecap: "round",
|
|
243
262
|
strokeLinejoin: "round",
|
|
244
263
|
strokeWidth: 2,
|
|
245
264
|
d: "M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16"
|
|
246
265
|
})
|
|
247
266
|
})
|
|
248
|
-
}, a = /* @__PURE__ */
|
|
267
|
+
}, a = /* @__PURE__ */ r("svg", {
|
|
249
268
|
fill: "none",
|
|
250
269
|
stroke: "currentColor",
|
|
251
270
|
viewBox: "0 0 24 24",
|
|
252
271
|
className: t,
|
|
253
|
-
children: /* @__PURE__ */
|
|
272
|
+
children: /* @__PURE__ */ r("path", {
|
|
254
273
|
strokeLinecap: "round",
|
|
255
274
|
strokeLinejoin: "round",
|
|
256
275
|
strokeWidth: 2,
|
|
257
276
|
d: "M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
|
|
258
277
|
})
|
|
259
278
|
});
|
|
260
|
-
return
|
|
279
|
+
return n[e] || a;
|
|
261
280
|
};
|
|
262
281
|
//#endregion
|
|
263
|
-
export {
|
|
282
|
+
export { a as default };
|
|
264
283
|
|
|
265
284
|
//# sourceMappingURL=WidgetHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetHeader.js","names":[],"sources":["../../../../src/bigconsole/components/widgets/WidgetHeader.tsx"],"sourcesContent":["/**\n * WidgetHeader Component\n *\n * Header section of a widget with title, icon, and action menu.\n */\n\nimport { type FC, type ReactElement, memo } from 'react';\nimport type { Widget } from '../../types';\nimport type { WidgetDefinition } from './WidgetRegistry';\nimport { WidgetMenu } from './WidgetMenu';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface WidgetHeaderProps {\n /** The widget data */\n widget: Widget;\n /** Widget definition from registry */\n definition: WidgetDefinition;\n /** Whether the widget is selected */\n isSelected?: boolean;\n /** Whether in edit mode */\n isEditMode?: boolean;\n /** Whether the widget is loading */\n isLoading?: boolean;\n /** Time until next refresh (formatted string) */\n timeUntilRefresh?: string;\n /** Whether drilldown is enabled on this widget */\n hasDrilldown?: boolean;\n /** Callback to refresh widget */\n onRefresh?: () => void;\n /** Callback to export as CSV */\n onExportCSV?: () => void;\n /** Callback to export as PNG */\n onExportPNG?: () => void;\n /** Callback for drilldown */\n onDrilldown?: () => void;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WidgetHeader: FC<WidgetHeaderProps> = memo(function WidgetHeader({\n widget,\n definition,\n isSelected,\n isEditMode,\n isLoading,\n timeUntilRefresh,\n hasDrilldown,\n onRefresh,\n onExportCSV,\n onExportPNG,\n onDrilldown,\n}) {\n return (\n <div\n className={`\n flex items-center justify-between\n px-4 py-3\n border-b border-border-default\n bg-bg-muted\n ${isSelected && isEditMode ? 'bg-action-primary-bg/5' : ''}\n `}\n >\n {/* Left side: Icon and Title - THIS IS THE DRAG HANDLE */}\n <div\n className={`\n widget-drag-handle\n flex items-center gap-2 min-w-0 flex-1\n ${isEditMode ? 'cursor-move' : ''}\n `}\n >\n {/* Widget type icon */}\n <div\n className={`\n flex-shrink-0 w-5 h-5\n text-text-secondary\n ${isLoading ? 'animate-pulse' : ''}\n `}\n >\n <WidgetIcon name={definition.icon} />\n </div>\n\n {/* Title */}\n <h3\n className=\"\n text-sm font-medium\n text-text-primary\n truncate\n \"\n title={widget.title}\n >\n {widget.title}\n </h3>\n\n {/* Drilldown indicator badge */}\n {hasDrilldown && (\n <span\n className=\"\n flex-shrink-0 inline-flex items-center gap-0.5\n px-1.5 py-0.5 rounded-md\n bg-action-primary-bg/10 text-action-primary-text\n text-[10px] font-medium\n \"\n title=\"Click data to drill down\"\n >\n <svg className=\"w-2.5 h-2.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\"\n />\n </svg>\n Drilldown\n </span>\n )}\n\n {/* Refresh indicator */}\n {timeUntilRefresh && !isEditMode && (\n <span\n className=\"\n flex-shrink-0 text-xs\n text-text-secondary\n tabular-nums\n \"\n title=\"Time until next refresh\"\n >\n {timeUntilRefresh}\n </span>\n )}\n </div>\n\n {/* Right side: Actions */}\n <div className=\"flex items-center gap-1 ml-2\">\n {/* Drilldown button (shown in view mode) */}\n {onDrilldown && !isEditMode && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onDrilldown();\n }}\n className=\"\n p-1.5 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-muted\n transition-colors\n \"\n title=\"Drill down to details\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\"\n />\n </svg>\n </button>\n )}\n\n {/* Refresh button */}\n {onRefresh && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onRefresh();\n }}\n disabled={isLoading}\n className={`\n p-1.5 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-muted\n transition-colors\n disabled:opacity-50 disabled:cursor-not-allowed\n ${isLoading ? 'animate-spin' : ''}\n `}\n title=\"Refresh data\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\"\n />\n </svg>\n </button>\n )}\n\n {/* Menu (always visible) */}\n <div className=\"block\">\n <WidgetMenu\n widget={widget}\n isEditMode={isEditMode}\n onRefresh={onRefresh}\n onExportCSV={onExportCSV}\n onExportPNG={onExportPNG}\n />\n </div>\n </div>\n </div>\n );\n});\n\n// ============================================================================\n// Widget Icon Component\n// ============================================================================\n\ninterface WidgetIconProps {\n name: string;\n className?: string;\n}\n\nconst WidgetIcon: FC<WidgetIconProps> = ({ name, className = '' }) => {\n // Simple icon mapping - in production, use lucide-react or similar\n const icons: Record<string, ReactElement> = {\n TrendingUp: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6\" />\n </svg>\n ),\n BarChart3: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M18 20V10M12 20V4M6 20v-6\" />\n </svg>\n ),\n LineChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\" />\n </svg>\n ),\n Table: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z\"\n />\n </svg>\n ),\n Gauge: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n ),\n Activity: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M22 12h-4l-3 9L9 3l-3 9H2\" />\n </svg>\n ),\n List: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M4 6h16M4 10h16M4 14h16M4 18h16\" />\n </svg>\n ),\n PieChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z\"\n />\n </svg>\n ),\n BarChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z\"\n />\n </svg>\n ),\n AreaChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16\"\n />\n </svg>\n ),\n };\n\n // Default icon\n const defaultIcon = (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z\"\n />\n </svg>\n );\n\n return icons[name] || defaultIcon;\n};\n\nexport default WidgetHeader;\n"],"mappings":";;;;AA4CA,IAAa,IAAsC,EAAK,SAAsB,EAC5E,WACA,eACA,eACA,eACA,cACA,qBACA,iBACA,cACA,gBACA,gBACA,kBACC;AACD,QACE,kBAAC,OAAD;EACE,WAAW;;;;;UAKP,KAAc,IAAa,2BAA2B,GAAG;;YAN/D,CAUE,kBAAC,OAAD;GACE,WAAW;;;YAGP,IAAa,gBAAgB,GAAG;;aAJtC;IAQE,kBAAC,OAAD;KACE,WAAW;;;cAGP,IAAY,kBAAkB,GAAG;;eAGrC,kBAAC,GAAD,EAAY,MAAM,EAAW,MAAQ,CAAA;KACjC,CAAA;IAGN,kBAAC,MAAD;KACE,WAAU;KAKV,OAAO,EAAO;eAEb,EAAO;KACL,CAAA;IAGJ,KACC,kBAAC,QAAD;KACE,WAAU;KAMV,OAAM;eAPR,CASE,kBAAC,OAAD;MAAK,WAAU;MAAc,MAAK;MAAO,QAAO;MAAe,SAAQ;gBACrE,kBAAC,QAAD;OACE,eAAc;OACd,gBAAe;OACf,aAAa;OACb,GAAE;OACF,CAAA;MACE,CAAA,EAAA,YAED;;IAIR,KAAoB,CAAC,KACpB,kBAAC,QAAD;KACE,WAAU;KAKV,OAAM;eAEL;KACI,CAAA;IAEL;MAGN,kBAAC,OAAD;GAAK,WAAU;aAAf;IAEG,KAAe,CAAC,KACf,kBAAC,UAAD;KACE,MAAK;KACL,UAAU,MAAM;AAEd,MADA,EAAE,iBAAiB,EACnB,GAAa;;KAEf,WAAU;KAOV,OAAM;eAEN,kBAAC,OAAD;MA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AGR,QAAO,EAAM,MAAS"}
|
|
1
|
+
{"version":3,"file":"WidgetHeader.js","names":[],"sources":["../../../../src/bigconsole/components/widgets/WidgetHeader.tsx"],"sourcesContent":["/**\n * WidgetHeader Component\n *\n * Header section of a widget with title, icon, and action menu.\n */\n\nimport { type FC, type ReactElement, memo } from 'react';\nimport { MessageSquare } from 'lucide-react';\nimport type { Widget } from '../../types';\nimport type { WidgetDefinition } from './WidgetRegistry';\nimport { WidgetMenu } from './WidgetMenu';\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface WidgetHeaderProps {\n /** The widget data */\n widget: Widget;\n /** Widget definition from registry */\n definition: WidgetDefinition;\n /** Whether the widget is selected */\n isSelected?: boolean;\n /** Whether in edit mode */\n isEditMode?: boolean;\n /** Whether the widget is loading */\n isLoading?: boolean;\n /** Time until next refresh (formatted string) */\n timeUntilRefresh?: string;\n /** Whether drilldown is enabled on this widget */\n hasDrilldown?: boolean;\n /** Callback to refresh widget */\n onRefresh?: () => void;\n /** Callback to export as CSV */\n onExportCSV?: () => void;\n /** Callback to export as PNG */\n onExportPNG?: () => void;\n /** Callback for drilldown */\n onDrilldown?: () => void;\n /** Toggle the widget comments panel */\n onToggleComments?: () => void;\n /** Whether the comments panel is currently open */\n commentsOpen?: boolean;\n /** Number of comments on this widget (badge) */\n commentCount?: number;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const WidgetHeader: FC<WidgetHeaderProps> = memo(function WidgetHeader({\n widget,\n definition,\n isSelected,\n isEditMode,\n isLoading,\n timeUntilRefresh,\n hasDrilldown,\n onRefresh,\n onExportCSV,\n onExportPNG,\n onDrilldown,\n onToggleComments,\n commentsOpen,\n commentCount = 0,\n}) {\n return (\n <div\n className={`\n flex items-center justify-between\n px-4 py-3\n border-b border-border-default\n bg-bg-muted\n ${isSelected && isEditMode ? 'bg-action-primary-bg/5' : ''}\n `}\n >\n {/* Left side: Icon and Title - THIS IS THE DRAG HANDLE */}\n <div\n className={`\n widget-drag-handle\n flex items-center gap-2 min-w-0 flex-1\n ${isEditMode ? 'cursor-move' : ''}\n `}\n >\n {/* Widget type icon */}\n <div\n className={`\n flex-shrink-0 w-5 h-5\n text-text-secondary\n ${isLoading ? 'animate-pulse' : ''}\n `}\n >\n <WidgetIcon name={definition.icon} />\n </div>\n\n {/* Title */}\n <h3\n className=\"\n text-sm font-medium\n text-text-primary\n truncate\n \"\n title={widget.title}\n >\n {widget.title}\n </h3>\n\n {/* Drilldown indicator badge */}\n {hasDrilldown && (\n <span\n className=\"\n flex-shrink-0 inline-flex items-center gap-0.5\n px-1.5 py-0.5 rounded-md\n bg-action-primary-bg/10 text-action-primary-text\n text-[10px] font-medium\n \"\n title=\"Click data to drill down\"\n >\n <svg className=\"w-2.5 h-2.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2.5}\n d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\"\n />\n </svg>\n Drilldown\n </span>\n )}\n\n {/* Refresh indicator */}\n {timeUntilRefresh && !isEditMode && (\n <span\n className=\"\n flex-shrink-0 text-xs\n text-text-secondary\n tabular-nums\n \"\n title=\"Time until next refresh\"\n >\n {timeUntilRefresh}\n </span>\n )}\n </div>\n\n {/* Right side: Actions */}\n <div className=\"flex items-center gap-1 ml-2\">\n {/* Drilldown button (shown in view mode) */}\n {onDrilldown && !isEditMode && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onDrilldown();\n }}\n className=\"\n p-1.5 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-muted\n transition-colors\n \"\n title=\"Drill down to details\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\"\n />\n </svg>\n </button>\n )}\n\n {/* Refresh button */}\n {onRefresh && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onRefresh();\n }}\n disabled={isLoading}\n className={`\n p-1.5 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-muted\n transition-colors\n disabled:opacity-50 disabled:cursor-not-allowed\n ${isLoading ? 'animate-spin' : ''}\n `}\n title=\"Refresh data\"\n >\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\"\n />\n </svg>\n </button>\n )}\n\n {/* Comments toggle */}\n {onToggleComments && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n onToggleComments();\n }}\n aria-label=\"Toggle comments\"\n aria-pressed={commentsOpen}\n className={`\n relative p-1.5 rounded-md\n transition-colors\n ${\n commentsOpen\n ? 'text-action-primary-text bg-action-primary-bg/10'\n : 'text-text-secondary hover:text-text-primary hover:bg-bg-muted'\n }\n `}\n title=\"Comments\"\n >\n <MessageSquare className=\"w-4 h-4\" />\n {commentCount > 0 && (\n <span className=\"absolute -top-0.5 -right-0.5 min-w-[14px] h-[14px] px-0.5 rounded-full bg-action-primary-bg text-action-primary-text text-[9px] font-semibold leading-[14px] text-center tabular-nums\">\n {commentCount > 99 ? '99+' : commentCount}\n </span>\n )}\n </button>\n )}\n\n {/* Menu (always visible) */}\n <div className=\"block\">\n <WidgetMenu\n widget={widget}\n isEditMode={isEditMode}\n onRefresh={onRefresh}\n onExportCSV={onExportCSV}\n onExportPNG={onExportPNG}\n />\n </div>\n </div>\n </div>\n );\n});\n\n// ============================================================================\n// Widget Icon Component\n// ============================================================================\n\ninterface WidgetIconProps {\n name: string;\n className?: string;\n}\n\nconst WidgetIcon: FC<WidgetIconProps> = ({ name, className = '' }) => {\n // Simple icon mapping - in production, use lucide-react or similar\n const icons: Record<string, ReactElement> = {\n TrendingUp: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6\" />\n </svg>\n ),\n BarChart3: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M18 20V10M12 20V4M6 20v-6\" />\n </svg>\n ),\n LineChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M7 20l4-16m2 16l4-16M6 9h14M4 15h14\" />\n </svg>\n ),\n Table: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z\"\n />\n </svg>\n ),\n Gauge: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n ),\n Activity: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M22 12h-4l-3 9L9 3l-3 9H2\" />\n </svg>\n ),\n List: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M4 6h16M4 10h16M4 14h16M4 18h16\" />\n </svg>\n ),\n PieChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z\"\n />\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z\"\n />\n </svg>\n ),\n BarChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z\"\n />\n </svg>\n ),\n AreaChart: (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16\"\n />\n </svg>\n ),\n };\n\n // Default icon\n const defaultIcon = (\n <svg fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className={className}>\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z\"\n />\n </svg>\n );\n\n return icons[name] || defaultIcon;\n};\n\nexport default WidgetHeader;\n"],"mappings":";;;;;AAmDA,IAAa,IAAsC,EAAK,SAAsB,EAC5E,WACA,eACA,eACA,eACA,cACA,qBACA,iBACA,cACA,gBACA,gBACA,gBACA,qBACA,iBACA,kBAAe,KACd;AACD,QACE,kBAAC,OAAD;EACE,WAAW;;;;;UAKP,KAAc,IAAa,2BAA2B,GAAG;;YAN/D,CAUE,kBAAC,OAAD;GACE,WAAW;;;YAGP,IAAa,gBAAgB,GAAG;;aAJtC;IAQE,kBAAC,OAAD;KACE,WAAW;;;cAGP,IAAY,kBAAkB,GAAG;;eAGrC,kBAAC,GAAD,EAAY,MAAM,EAAW,MAAQ,CAAA;KACjC,CAAA;IAGN,kBAAC,MAAD;KACE,WAAU;KAKV,OAAO,EAAO;eAEb,EAAO;KACL,CAAA;IAGJ,KACC,kBAAC,QAAD;KACE,WAAU;KAMV,OAAM;eAPR,CASE,kBAAC,OAAD;MAAK,WAAU;MAAc,MAAK;MAAO,QAAO;MAAe,SAAQ;gBACrE,kBAAC,QAAD;OACE,eAAc;OACd,gBAAe;OACf,aAAa;OACb,GAAE;OACF,CAAA;MACE,CAAA,EAAA,YAED;;IAIR,KAAoB,CAAC,KACpB,kBAAC,QAAD;KACE,WAAU;KAKV,OAAM;eAEL;KACI,CAAA;IAEL;MAGN,kBAAC,OAAD;GAAK,WAAU;aAAf;IAEG,KAAe,CAAC,KACf,kBAAC,UAAD;KACE,MAAK;KACL,UAAU,MAAM;AAEd,MADA,EAAE,iBAAiB,EACnB,GAAa;;KAEf,WAAU;KAOV,OAAM;eAEN,kBAAC,OAAD;MAAK,WAAU;MAAU,MAAK;MAAO,QAAO;MAAe,SAAQ;gBACjE,kBA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