@nivaro/react 0.3.47 → 0.3.49
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/CellCopyLayer.js +81 -44
- package/dist/shared/components/CollectionBrowserView.js +306 -297
- package/dist/shared/components/DataTable.js +3 -3
- package/dist/shared/components/FulfilmentPill.js +98 -78
- package/dist/shared/components/ItemEditForm.js +2830 -2815
- package/dist/shared/components/NotificationSourcesCard.js +151 -147
- package/dist/shared/components/ProfileView.js +72 -70
- package/dist/shared/components/QueryTable.js +3 -3
- package/dist/shared/components/imports/ImportConsole.js +4 -4
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
- package/dist/shared/components/item-edit/HeaderTools.js +118 -113
- package/dist/shared/components/item-edit/InlineTableField.js +874 -868
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
- package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
- package/dist/shared/components/notifications/DeliveryChips.js +9 -9
- package/dist/shared/components/panels/PipelinePanel.js +73 -71
- package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
- package/dist/shared/components/profile/PersonProfile.js +23 -21
- package/dist/shared/components/profile/SignedInDevices.js +126 -0
- package/dist/shared/components/queue/QueueItemSheet.js +38 -37
- package/dist/shared/components/support/SupportView.js +1 -1
- package/dist/shared/lib/edit-lock-fields.js +7 -0
- package/dist/shared/lib/reimport-visibility.js +10 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as ye, useQuery as W, useMutation as H } from "@tanstack/react-query";
|
|
3
|
-
import { BellRing as z, History as fe, Inbox as
|
|
3
|
+
import { BellRing as z, History as fe, Inbox as le, FileBarChart as ve, Gauge as ke, Activity as _e, CalendarClock as pe, Pencil as Ne, ExternalLink as we, Plus as $e, Zap as Se, X as Ce } from "lucide-react";
|
|
4
4
|
import { useState as f } from "react";
|
|
5
5
|
import { useNivaroClient as qe, useNavigation as Re, useItemNavigation as Be } from "../context.js";
|
|
6
6
|
import { get as Q, del as Fe, patch as De, put as Me } from "../lib/commands.js";
|
|
@@ -10,21 +10,21 @@ import { SimpleSelectXs as ue } from "./ui/SimpleSelect.js";
|
|
|
10
10
|
import { Switch as Le } from "./ui/switch.js";
|
|
11
11
|
function Ee({
|
|
12
12
|
sub: n,
|
|
13
|
-
onPatch:
|
|
13
|
+
onPatch: s
|
|
14
14
|
}) {
|
|
15
|
-
const i = n.notify_inapp !== !1,
|
|
15
|
+
const i = n.notify_inapp !== !1, l = n.notify_email !== !1, c = (d, m, b) => /* @__PURE__ */ t(
|
|
16
16
|
"button",
|
|
17
17
|
{
|
|
18
18
|
type: "button",
|
|
19
19
|
"data-tip": d ? `${m} on — click to turn off` : `${m} off — click to turn on`,
|
|
20
|
-
onClick: () =>
|
|
20
|
+
onClick: () => s(b),
|
|
21
21
|
className: `rounded-full border px-1.5 py-0.5 text-[10px] leading-none transition-colors ${d ? "border-nvr-cyan/40 bg-nvr-cyan/10 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 line-through dark:border-border"}`,
|
|
22
22
|
children: m
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
return /* @__PURE__ */ a("span", { className: "flex items-center gap-1", children: [
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
c(i, "In-app", { notify_inapp: !i }),
|
|
27
|
+
c(l, "Email", { notify_email: !l })
|
|
28
28
|
] });
|
|
29
29
|
}
|
|
30
30
|
const oe = [
|
|
@@ -33,27 +33,27 @@ const oe = [
|
|
|
33
33
|
], je = (n) => n === "weekly" ? [...oe, { value: "weekly", label: "Weekly summary" }] : oe;
|
|
34
34
|
function ce({
|
|
35
35
|
sub: n,
|
|
36
|
-
onPatch:
|
|
36
|
+
onPatch: s,
|
|
37
37
|
onEdit: i
|
|
38
38
|
}) {
|
|
39
|
-
const
|
|
39
|
+
const l = n.is_active !== !1 && n.is_active !== 0;
|
|
40
40
|
return /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
41
|
-
/* @__PURE__ */ t(Ee, { sub: n, onPatch:
|
|
41
|
+
/* @__PURE__ */ t(Ee, { sub: n, onPatch: s }),
|
|
42
42
|
/* @__PURE__ */ t(
|
|
43
43
|
ue,
|
|
44
44
|
{
|
|
45
45
|
value: n.digest_frequency ?? "instant",
|
|
46
46
|
options: je(n.digest_frequency),
|
|
47
|
-
onChange: (
|
|
47
|
+
onChange: (c) => s({ digest_frequency: c })
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
/* @__PURE__ */ t(
|
|
51
51
|
Le,
|
|
52
52
|
{
|
|
53
|
-
checked:
|
|
54
|
-
onCheckedChange: (
|
|
55
|
-
"aria-label":
|
|
56
|
-
"data-tip":
|
|
53
|
+
checked: l,
|
|
54
|
+
onCheckedChange: (c) => s({ is_active: c }),
|
|
55
|
+
"aria-label": l ? "Pause this subscription" : "Resume this subscription",
|
|
56
|
+
"data-tip": l ? "Active — click to pause" : "Paused — click to resume",
|
|
57
57
|
className: "scale-[0.8]"
|
|
58
58
|
}
|
|
59
59
|
),
|
|
@@ -80,28 +80,28 @@ const Ae = {
|
|
|
80
80
|
};
|
|
81
81
|
function Oe(n) {
|
|
82
82
|
if (!n) return "Metric";
|
|
83
|
-
const [
|
|
84
|
-
return
|
|
83
|
+
const [s, ...i] = n.split("."), l = i.join(" ").replace(/_/g, " ");
|
|
84
|
+
return l ? `${v(s)} · ${l}` : v(s.replace(/_/g, " "));
|
|
85
85
|
}
|
|
86
|
-
function k(n,
|
|
87
|
-
return `${n &&
|
|
86
|
+
function k(n, s, i) {
|
|
87
|
+
return `${n && s ? "Email + in-app" : n ? "Email" : s ? "In-app" : "No channels"}, ${!i || i === "instant" || i === "immediate" ? "instantly" : i === "daily" ? "in your daily summary" : i === "weekly" ? "in Monday's summary" : i}`;
|
|
88
88
|
}
|
|
89
89
|
function de(n) {
|
|
90
90
|
return n ? `last fired ${X(n)}` : null;
|
|
91
91
|
}
|
|
92
92
|
function Ie({
|
|
93
93
|
label: n,
|
|
94
|
-
onRemove:
|
|
94
|
+
onRemove: s,
|
|
95
95
|
busy: i
|
|
96
96
|
}) {
|
|
97
|
-
const [
|
|
98
|
-
return
|
|
97
|
+
const [l, c] = f(!1);
|
|
98
|
+
return l ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1 text-[11px]", children: [
|
|
99
99
|
/* @__PURE__ */ t(
|
|
100
100
|
"button",
|
|
101
101
|
{
|
|
102
102
|
type: "button",
|
|
103
103
|
disabled: i,
|
|
104
|
-
onClick:
|
|
104
|
+
onClick: s,
|
|
105
105
|
className: "rounded bg-red-500/10 px-1.5 py-0.5 font-medium text-red-600 hover:bg-red-500/20 disabled:opacity-50 dark:text-red-400",
|
|
106
106
|
children: "Remove"
|
|
107
107
|
}
|
|
@@ -110,7 +110,7 @@ function Ie({
|
|
|
110
110
|
"button",
|
|
111
111
|
{
|
|
112
112
|
type: "button",
|
|
113
|
-
onClick: () =>
|
|
113
|
+
onClick: () => c(!1),
|
|
114
114
|
className: "rounded px-1 py-0.5 text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-muted",
|
|
115
115
|
children: "Keep"
|
|
116
116
|
}
|
|
@@ -119,7 +119,7 @@ function Ie({
|
|
|
119
119
|
"button",
|
|
120
120
|
{
|
|
121
121
|
type: "button",
|
|
122
|
-
onClick: () =>
|
|
122
|
+
onClick: () => c(!0),
|
|
123
123
|
"aria-label": `Remove ${n}`,
|
|
124
124
|
title: "Remove",
|
|
125
125
|
className: "shrink-0 rounded p-1 text-slate-500 opacity-0 transition-opacity duration-150 hover:bg-red-500/10 hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100 dark:text-slate-400",
|
|
@@ -129,18 +129,18 @@ function Ie({
|
|
|
129
129
|
}
|
|
130
130
|
function L({
|
|
131
131
|
label: n,
|
|
132
|
-
on:
|
|
132
|
+
on: s,
|
|
133
133
|
onToggle: i,
|
|
134
|
-
disabled:
|
|
134
|
+
disabled: l
|
|
135
135
|
}) {
|
|
136
136
|
return /* @__PURE__ */ t(
|
|
137
137
|
i ? "button" : "span",
|
|
138
138
|
{
|
|
139
|
-
...i ? { type: "button", onClick: i, disabled:
|
|
140
|
-
title: i ? `Turn ${n} ${
|
|
139
|
+
...i ? { type: "button", onClick: i, disabled: l } : {},
|
|
140
|
+
title: i ? `Turn ${n} ${s ? "off" : "on"}` : void 0,
|
|
141
141
|
className: [
|
|
142
142
|
"rounded px-1.5 py-0.5 text-[10px] font-medium transition-colors duration-150",
|
|
143
|
-
|
|
143
|
+
s ? "bg-nvr-cyan/10 text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan" : "bg-slate-100 text-slate-500 line-through dark:bg-muted dark:text-slate-400",
|
|
144
144
|
i ? "cursor-pointer hover:ring-1 hover:ring-nvr-cyan/40" : ""
|
|
145
145
|
].join(" "),
|
|
146
146
|
children: n
|
|
@@ -149,10 +149,10 @@ function L({
|
|
|
149
149
|
}
|
|
150
150
|
function h({
|
|
151
151
|
title: n,
|
|
152
|
-
description:
|
|
152
|
+
description: s,
|
|
153
153
|
meta: i,
|
|
154
|
-
trigger:
|
|
155
|
-
paused:
|
|
154
|
+
trigger: l,
|
|
155
|
+
paused: c,
|
|
156
156
|
controls: d,
|
|
157
157
|
onRemove: m,
|
|
158
158
|
removing: b
|
|
@@ -160,36 +160,36 @@ function h({
|
|
|
160
160
|
return /* @__PURE__ */ a(
|
|
161
161
|
"div",
|
|
162
162
|
{
|
|
163
|
-
className: `group flex items-center gap-3 rounded-md px-2 py-1.5 transition-colors duration-150 ${
|
|
164
|
-
"data-paused":
|
|
163
|
+
className: `group flex items-center gap-3 rounded-md px-2 py-1.5 transition-colors duration-150 ${c ? "bg-amber-500/[0.07] hover:bg-amber-500/10 dark:bg-amber-400/10 dark:hover:bg-amber-400/15" : "hover:bg-slate-50 dark:hover:bg-muted/40"}`,
|
|
164
|
+
"data-paused": c ? "true" : void 0,
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
167
167
|
/* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 truncate text-[12.5px] text-slate-800 dark:text-slate-100", children: [
|
|
168
|
-
/* @__PURE__ */ t("span", { className: `truncate ${
|
|
169
|
-
|
|
168
|
+
/* @__PURE__ */ t("span", { className: `truncate ${c ? "text-slate-500 dark:text-slate-400" : ""}`, children: n }),
|
|
169
|
+
c && /* @__PURE__ */ t(
|
|
170
170
|
"span",
|
|
171
171
|
{
|
|
172
172
|
className: "shrink-0 rounded bg-amber-500/15 px-1.5 py-px text-[9.5px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-400/20 dark:text-amber-300",
|
|
173
173
|
"data-tip": "Not firing — nothing is sent while this source is paused",
|
|
174
|
-
children:
|
|
174
|
+
children: c
|
|
175
175
|
}
|
|
176
176
|
)
|
|
177
177
|
] }),
|
|
178
178
|
/* @__PURE__ */ a("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
179
|
-
|
|
179
|
+
s,
|
|
180
180
|
i && /* @__PURE__ */ a("span", { className: "text-slate-400 dark:text-slate-500", children: [
|
|
181
181
|
" · ",
|
|
182
182
|
i
|
|
183
183
|
] })
|
|
184
184
|
] }),
|
|
185
|
-
|
|
185
|
+
l && (c ? /* @__PURE__ */ a("p", { className: "mt-0.5 flex items-center gap-1 truncate text-[10.5px] text-amber-700/80 dark:text-amber-300/80", children: [
|
|
186
186
|
/* @__PURE__ */ t(pe, { className: "h-3 w-3 shrink-0" }),
|
|
187
187
|
/* @__PURE__ */ t("span", { className: "font-medium", children: "Not running" }),
|
|
188
188
|
/* @__PURE__ */ a("span", { className: "truncate", children: [
|
|
189
189
|
"· would be ",
|
|
190
|
-
|
|
190
|
+
l.text.charAt(0).toLowerCase() + l.text.slice(1)
|
|
191
191
|
] })
|
|
192
|
-
] }) : /* @__PURE__ */ t(Ke, { trigger:
|
|
192
|
+
] }) : /* @__PURE__ */ t(Ke, { trigger: l }))
|
|
193
193
|
] }),
|
|
194
194
|
d,
|
|
195
195
|
m && /* @__PURE__ */ t(
|
|
@@ -205,14 +205,14 @@ function h({
|
|
|
205
205
|
);
|
|
206
206
|
}
|
|
207
207
|
function Ke({ trigger: n }) {
|
|
208
|
-
const
|
|
208
|
+
const s = n.kind !== "event";
|
|
209
209
|
return /* @__PURE__ */ a(
|
|
210
210
|
"p",
|
|
211
211
|
{
|
|
212
212
|
className: "mt-0.5 flex items-center gap-1 truncate text-[10.5px] text-slate-400 dark:text-slate-500",
|
|
213
|
-
"data-tip":
|
|
213
|
+
"data-tip": s ? "Runs on the server schedule shown" : "Fires the moment it happens",
|
|
214
214
|
children: [
|
|
215
|
-
|
|
215
|
+
s ? /* @__PURE__ */ t(pe, { className: "h-3 w-3 shrink-0 text-nvr-cyan" }) : /* @__PURE__ */ t(Se, { className: "h-3 w-3 shrink-0 text-amber-500" }),
|
|
216
216
|
/* @__PURE__ */ t("span", { className: "font-medium text-slate-500 dark:text-slate-400", children: n.kind === "event" ? "On event" : n.kind === "both" ? "Event + schedule" : "Scheduled" }),
|
|
217
217
|
/* @__PURE__ */ a("span", { className: "truncate", children: [
|
|
218
218
|
"· ",
|
|
@@ -224,16 +224,16 @@ function Ke({ trigger: n }) {
|
|
|
224
224
|
}
|
|
225
225
|
function Ue({
|
|
226
226
|
collection: n,
|
|
227
|
-
itemId:
|
|
227
|
+
itemId: s,
|
|
228
228
|
label: i
|
|
229
229
|
}) {
|
|
230
|
-
const
|
|
230
|
+
const l = Be(), c = { collection: n, itemId: s };
|
|
231
231
|
return /* @__PURE__ */ t(
|
|
232
232
|
"a",
|
|
233
233
|
{
|
|
234
|
-
href:
|
|
234
|
+
href: l.urlFor(c),
|
|
235
235
|
onClick: (d) => {
|
|
236
|
-
d.metaKey || d.ctrlKey || (d.preventDefault(),
|
|
236
|
+
d.metaKey || d.ctrlKey || (d.preventDefault(), l.open(c));
|
|
237
237
|
},
|
|
238
238
|
className: "font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
239
239
|
"data-record-link": !0,
|
|
@@ -241,22 +241,22 @@ function Ue({
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
function y({ path: n, label:
|
|
245
|
-
const i = Re(),
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
244
|
+
function y({ path: n, label: s }) {
|
|
245
|
+
const i = Re(), l = i.consoleUrl ? i.consoleUrl(n) : n;
|
|
246
|
+
if (!l) return null;
|
|
247
|
+
const c = /^https?:\/\//.test(l);
|
|
248
248
|
return /* @__PURE__ */ a(
|
|
249
249
|
"a",
|
|
250
250
|
{
|
|
251
|
-
href:
|
|
252
|
-
...
|
|
251
|
+
href: l,
|
|
252
|
+
...c ? { target: "_blank", rel: "noreferrer" } : {},
|
|
253
253
|
onClick: (d) => {
|
|
254
|
-
|
|
254
|
+
c || d.metaKey || d.ctrlKey || (d.preventDefault(), i.navigate(l));
|
|
255
255
|
},
|
|
256
256
|
className: "inline-flex items-center gap-1 text-[10.5px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
257
257
|
"data-manage-link": !0,
|
|
258
258
|
children: [
|
|
259
|
-
|
|
259
|
+
s,
|
|
260
260
|
/* @__PURE__ */ t(we, { className: "h-2.5 w-2.5" })
|
|
261
261
|
]
|
|
262
262
|
}
|
|
@@ -264,32 +264,32 @@ function y({ path: n, label: l }) {
|
|
|
264
264
|
}
|
|
265
265
|
function x({
|
|
266
266
|
title: n,
|
|
267
|
-
hint:
|
|
267
|
+
hint: s,
|
|
268
268
|
action: i,
|
|
269
|
-
children:
|
|
269
|
+
children: l
|
|
270
270
|
}) {
|
|
271
271
|
return /* @__PURE__ */ a("section", { children: [
|
|
272
272
|
/* @__PURE__ */ a("div", { className: "mb-1.5 flex items-baseline gap-2 border-b border-slate-100 pb-1 dark:border-border/60", children: [
|
|
273
273
|
/* @__PURE__ */ t("h3", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: n }),
|
|
274
|
-
|
|
274
|
+
s && /* @__PURE__ */ t("span", { className: "min-w-0 truncate text-[10.5px] text-slate-400", children: s }),
|
|
275
275
|
i && /* @__PURE__ */ t("span", { className: "ml-auto flex shrink-0 items-center gap-3", children: i })
|
|
276
276
|
] }),
|
|
277
|
-
/* @__PURE__ */ t("div", { className: "space-y-0.5", children:
|
|
277
|
+
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: l })
|
|
278
278
|
] });
|
|
279
279
|
}
|
|
280
280
|
const We = {
|
|
281
|
-
notification: { icon:
|
|
281
|
+
notification: { icon: le, tint: "text-nvr-cyan bg-nvr-cyan/10" },
|
|
282
282
|
metric_alert: { icon: ke, tint: "text-amber-600 bg-amber-500/10 dark:text-amber-400" },
|
|
283
283
|
record_alert: { icon: z, tint: "text-red-600 bg-red-500/10 dark:text-red-400" },
|
|
284
284
|
report_alert: {
|
|
285
285
|
icon: ve,
|
|
286
286
|
tint: "text-purple-600 bg-purple-500/10 dark:text-purple-400"
|
|
287
287
|
},
|
|
288
|
-
digest_email: { icon:
|
|
288
|
+
digest_email: { icon: le, tint: "text-emerald-600 bg-emerald-500/10 dark:text-emerald-400" }
|
|
289
289
|
};
|
|
290
|
-
function tt({ only: n, bare:
|
|
290
|
+
function tt({ only: n, bare: s } = {}) {
|
|
291
291
|
var ie;
|
|
292
|
-
const i = qe(),
|
|
292
|
+
const i = qe(), l = ye(), [c, d] = f("sources"), m = Pe(), [b, E] = f(null), [S, Y] = f(null), u = n === "subscriptions", [R, G] = f(/* @__PURE__ */ new Set()), [B, V] = f(/* @__PURE__ */ new Set()), [F, Z] = f(""), [D, J] = f(""), [j, N] = f(25), { data: ee, isLoading: he } = W({
|
|
293
293
|
queryKey: ["me-notification-sources"],
|
|
294
294
|
queryFn: () => i.request(Q("/users/me/notification-sources")).then((e) => e.data),
|
|
295
295
|
staleTime: 3e4
|
|
@@ -300,39 +300,39 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
300
300
|
}), ae = W({
|
|
301
301
|
queryKey: ["me-notification-history"],
|
|
302
302
|
queryFn: () => i.request(Q("/users/me/notification-history", { limit: 200 })).then((e) => e.data),
|
|
303
|
-
enabled:
|
|
303
|
+
enabled: c === "history",
|
|
304
304
|
staleTime: 6e4
|
|
305
|
-
}), A = () => void
|
|
305
|
+
}), A = () => void l.invalidateQueries({ queryKey: ["me-notification-sources"] }), w = H({
|
|
306
306
|
mutationFn: (e) => i.request(Fe(e)),
|
|
307
307
|
onSuccess: A
|
|
308
308
|
}), C = H({
|
|
309
|
-
mutationFn: ({ path: e, body:
|
|
309
|
+
mutationFn: ({ path: e, body: r }) => i.request(De(e, r)),
|
|
310
310
|
onSuccess: A
|
|
311
311
|
}), O = H({
|
|
312
|
-
mutationFn: ({ reportId: e, body:
|
|
312
|
+
mutationFn: ({ reportId: e, body: r }) => i.request(Me(`/report-studio/${e}/subscription`, r)),
|
|
313
313
|
onSuccess: A
|
|
314
314
|
});
|
|
315
315
|
if (he || !ee) return null;
|
|
316
|
-
const
|
|
316
|
+
const o = ee, g = w.isPending || C.isPending || O.isPending, _ = o.subscriptions.filter(
|
|
317
317
|
(e) => e.event_type === "workflow_transition" && e.filter_field === "to_state"
|
|
318
|
-
), I =
|
|
318
|
+
), I = o.subscriptions.filter((e) => !_.includes(e)), ne = o.subscriptions.length + o.field_watches.length + o.record_alerts.length + o.metric_alerts.length + o.anomaly_rules.length + o.report_subscriptions.length + o.report_alerts.length + o.view_subscriptions.length, $ = ae.data ?? [], M = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
|
|
319
319
|
for (const e of $) {
|
|
320
320
|
M.set(e.kind, (M.get(e.kind) ?? 0) + 1);
|
|
321
|
-
for (const
|
|
321
|
+
for (const r of e.channels ?? []) P.set(r, (P.get(r) ?? 0) + 1);
|
|
322
322
|
}
|
|
323
323
|
const q = $.filter((e) => {
|
|
324
|
-
if (R.size > 0 && !R.has(e.kind) || B.size > 0 && !(e.channels ?? []).some((
|
|
324
|
+
if (R.size > 0 && !R.has(e.kind) || B.size > 0 && !(e.channels ?? []).some((p) => B.has(p)))
|
|
325
325
|
return !1;
|
|
326
|
-
const
|
|
327
|
-
return !(F &&
|
|
326
|
+
const r = new Date(e.at).toLocaleDateString("sv-SE");
|
|
327
|
+
return !(F && r < F || D && r > D);
|
|
328
328
|
}), ge = q.slice(0, j), K = /* @__PURE__ */ new Map();
|
|
329
329
|
for (const e of ge) {
|
|
330
|
-
const
|
|
330
|
+
const r = new Date(e.at).toLocaleDateString("en-US", {
|
|
331
331
|
month: "short",
|
|
332
332
|
day: "numeric",
|
|
333
333
|
year: "numeric"
|
|
334
|
-
}),
|
|
335
|
-
|
|
334
|
+
}), p = K.get(r);
|
|
335
|
+
p ? p.push(e) : K.set(r, [e]);
|
|
336
336
|
}
|
|
337
337
|
const U = (e) => /* @__PURE__ */ a(
|
|
338
338
|
"button",
|
|
@@ -350,7 +350,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
350
350
|
return /* @__PURE__ */ a(
|
|
351
351
|
"div",
|
|
352
352
|
{
|
|
353
|
-
className:
|
|
353
|
+
className: s ? "" : "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
354
354
|
"data-notification-sources": !0,
|
|
355
355
|
children: [
|
|
356
356
|
/* @__PURE__ */ t(
|
|
@@ -367,7 +367,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
367
367
|
} : void 0
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
!
|
|
370
|
+
!s && /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-slate-100 px-5 py-3.5 dark:border-border/60", children: [
|
|
371
371
|
/* @__PURE__ */ t(z, { className: "h-4 w-4 shrink-0 text-nvr-cyan" }),
|
|
372
372
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
373
373
|
/* @__PURE__ */ t("h2", { className: "text-[14px] font-semibold text-slate-900 dark:text-foreground", children: "Notifications & alerts" }),
|
|
@@ -375,7 +375,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
375
375
|
ne,
|
|
376
376
|
" sources · email delivered",
|
|
377
377
|
" ",
|
|
378
|
-
|
|
378
|
+
o.preferences.email_digest === "daily" ? "in your daily summary" : "instantly"
|
|
379
379
|
] })
|
|
380
380
|
] }),
|
|
381
381
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: [
|
|
@@ -386,18 +386,18 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
386
386
|
{
|
|
387
387
|
type: "button",
|
|
388
388
|
onClick: () => d(e.key),
|
|
389
|
-
"aria-pressed":
|
|
389
|
+
"aria-pressed": c === e.key,
|
|
390
390
|
className: [
|
|
391
391
|
"rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors duration-150",
|
|
392
|
-
|
|
392
|
+
c === e.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
393
393
|
].join(" "),
|
|
394
394
|
children: e.label
|
|
395
395
|
},
|
|
396
396
|
e.key
|
|
397
397
|
)) })
|
|
398
398
|
] }),
|
|
399
|
-
|
|
400
|
-
!
|
|
399
|
+
c === "sources" && /* @__PURE__ */ a(T, { children: [
|
|
400
|
+
!u && te.some((e) => e.unread >= 25) && /* @__PURE__ */ a("div", { className: "mb-3 space-y-1.5 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 dark:border-amber-500/30 dark:bg-amber-400/10", children: [
|
|
401
401
|
/* @__PURE__ */ t("p", { className: "text-[11.5px] font-medium text-amber-800 dark:text-amber-300", children: "Unread piles — the important ones drown under these:" }),
|
|
402
402
|
te.filter((e) => e.unread >= 25).slice(0, 4).map((e) => /* @__PURE__ */ a(
|
|
403
403
|
"p",
|
|
@@ -426,15 +426,15 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
426
426
|
...new Map(
|
|
427
427
|
_.filter((e) => e.template_id).map((e) => [e.template_id, e.template_name])
|
|
428
428
|
).entries()
|
|
429
|
-
].map(([e,
|
|
429
|
+
].map(([e, r]) => /* @__PURE__ */ t(
|
|
430
430
|
y,
|
|
431
431
|
{
|
|
432
432
|
path: `/pipelines/${e}`,
|
|
433
|
-
label: `${
|
|
433
|
+
label: `${r ?? "Pipeline"} states`
|
|
434
434
|
},
|
|
435
435
|
String(e)
|
|
436
436
|
)),
|
|
437
|
-
!
|
|
437
|
+
!u && /* @__PURE__ */ t(y, { path: "/notification-subscriptions", label: "All subscriptions" }),
|
|
438
438
|
U({
|
|
439
439
|
collection: ((ie = _[0]) == null ? void 0 : ie.collection) ?? void 0,
|
|
440
440
|
event_type: "workflow_transition"
|
|
@@ -451,7 +451,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
451
451
|
ce,
|
|
452
452
|
{
|
|
453
453
|
sub: e,
|
|
454
|
-
onPatch: (
|
|
454
|
+
onPatch: (r) => m.patchFields.mutate({ id: e.id, body: r }),
|
|
455
455
|
onEdit: () => E(e)
|
|
456
456
|
}
|
|
457
457
|
),
|
|
@@ -467,7 +467,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
467
467
|
{
|
|
468
468
|
title: "Record & collection subscriptions",
|
|
469
469
|
action: /* @__PURE__ */ a(T, { children: [
|
|
470
|
-
!
|
|
470
|
+
!u && /* @__PURE__ */ t(y, { path: "/notification-subscriptions", label: "All subscriptions" }),
|
|
471
471
|
U()
|
|
472
472
|
] }),
|
|
473
473
|
children: I.map((e) => /* @__PURE__ */ t(
|
|
@@ -501,7 +501,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
501
501
|
ce,
|
|
502
502
|
{
|
|
503
503
|
sub: e,
|
|
504
|
-
onPatch: (
|
|
504
|
+
onPatch: (r) => m.patchFields.mutate({ id: e.id, body: r }),
|
|
505
505
|
onEdit: () => E(e)
|
|
506
506
|
}
|
|
507
507
|
),
|
|
@@ -512,18 +512,18 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
512
512
|
))
|
|
513
513
|
}
|
|
514
514
|
),
|
|
515
|
-
|
|
515
|
+
u && _.length === 0 && I.length === 0 && /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2 py-12 text-center", children: [
|
|
516
516
|
/* @__PURE__ */ t(z, { className: "h-7 w-7 text-slate-300 dark:text-slate-600" }),
|
|
517
517
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: "No subscriptions yet" }),
|
|
518
518
|
/* @__PURE__ */ t("p", { className: "max-w-[38ch] text-[12px] text-slate-500 dark:text-slate-400", children: "Subscribe to a collection or a workflow state to get told when it changes — instantly, or folded into your daily summary." }),
|
|
519
519
|
/* @__PURE__ */ t("div", { className: "mt-1", children: U() })
|
|
520
520
|
] }),
|
|
521
|
-
!
|
|
521
|
+
!u && o.field_watches.length > 0 && /* @__PURE__ */ t(
|
|
522
522
|
x,
|
|
523
523
|
{
|
|
524
524
|
title: "Field watches",
|
|
525
525
|
action: /* @__PURE__ */ t(y, { path: "/field-watches", label: "Manage watches" }),
|
|
526
|
-
children:
|
|
526
|
+
children: o.field_watches.map((e) => /* @__PURE__ */ t(
|
|
527
527
|
h,
|
|
528
528
|
{
|
|
529
529
|
trigger: e.trigger,
|
|
@@ -536,12 +536,12 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
536
536
|
))
|
|
537
537
|
}
|
|
538
538
|
),
|
|
539
|
-
!
|
|
539
|
+
!u && o.record_alerts.length > 0 && /* @__PURE__ */ t(
|
|
540
540
|
x,
|
|
541
541
|
{
|
|
542
542
|
title: "Record alerts",
|
|
543
543
|
action: /* @__PURE__ */ t(y, { path: "/alerts", label: "Manage alert definitions" }),
|
|
544
|
-
children:
|
|
544
|
+
children: o.record_alerts.map((e) => /* @__PURE__ */ t(
|
|
545
545
|
h,
|
|
546
546
|
{
|
|
547
547
|
trigger: e.trigger,
|
|
@@ -556,12 +556,12 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
556
556
|
))
|
|
557
557
|
}
|
|
558
558
|
),
|
|
559
|
-
!
|
|
559
|
+
!u && o.metric_alerts.length > 0 && /* @__PURE__ */ t(
|
|
560
560
|
x,
|
|
561
561
|
{
|
|
562
562
|
title: "Metric alerts",
|
|
563
563
|
action: /* @__PURE__ */ t(y, { path: "/alert-manager", label: "Alert Manager" }),
|
|
564
|
-
children:
|
|
564
|
+
children: o.metric_alerts.map((e) => /* @__PURE__ */ t(
|
|
565
565
|
h,
|
|
566
566
|
{
|
|
567
567
|
trigger: e.trigger,
|
|
@@ -606,13 +606,13 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
606
606
|
))
|
|
607
607
|
}
|
|
608
608
|
),
|
|
609
|
-
!
|
|
609
|
+
!u && o.anomaly_rules.length > 0 && /* @__PURE__ */ t(
|
|
610
610
|
x,
|
|
611
611
|
{
|
|
612
612
|
title: "Anomaly detection",
|
|
613
613
|
hint: "rules you created — detections come to you",
|
|
614
614
|
action: /* @__PURE__ */ t(y, { path: "/alert-manager", label: "Alert Manager" }),
|
|
615
|
-
children:
|
|
615
|
+
children: o.anomaly_rules.map((e) => /* @__PURE__ */ t(
|
|
616
616
|
h,
|
|
617
617
|
{
|
|
618
618
|
trigger: e.trigger,
|
|
@@ -650,12 +650,12 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
650
650
|
))
|
|
651
651
|
}
|
|
652
652
|
),
|
|
653
|
-
!
|
|
653
|
+
!u && o.report_subscriptions.length > 0 && /* @__PURE__ */ t(
|
|
654
654
|
x,
|
|
655
655
|
{
|
|
656
656
|
title: "Report digests",
|
|
657
657
|
action: /* @__PURE__ */ t(y, { path: "/reports", label: "Reports" }),
|
|
658
|
-
children:
|
|
658
|
+
children: o.report_subscriptions.map((e) => /* @__PURE__ */ t(
|
|
659
659
|
h,
|
|
660
660
|
{
|
|
661
661
|
trigger: e.trigger,
|
|
@@ -678,7 +678,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
678
678
|
{ value: "daily", label: "Daily" },
|
|
679
679
|
{ value: "weekly", label: "Weekly" }
|
|
680
680
|
],
|
|
681
|
-
onChange: (
|
|
681
|
+
onChange: (r) => O.mutate({ reportId: e.report_id, body: { cadence: r } })
|
|
682
682
|
}
|
|
683
683
|
),
|
|
684
684
|
onRemove: () => O.mutate({ reportId: e.report_id, body: null }),
|
|
@@ -688,13 +688,13 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
688
688
|
))
|
|
689
689
|
}
|
|
690
690
|
),
|
|
691
|
-
!
|
|
691
|
+
!u && o.report_alerts.length > 0 && /* @__PURE__ */ t(
|
|
692
692
|
x,
|
|
693
693
|
{
|
|
694
694
|
title: "Report alerts",
|
|
695
695
|
hint: "you created these",
|
|
696
696
|
action: /* @__PURE__ */ t(y, { path: "/reports", label: "Reports" }),
|
|
697
|
-
children:
|
|
697
|
+
children: o.report_alerts.map((e) => /* @__PURE__ */ t(
|
|
698
698
|
h,
|
|
699
699
|
{
|
|
700
700
|
trigger: e.trigger,
|
|
@@ -707,12 +707,12 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
707
707
|
))
|
|
708
708
|
}
|
|
709
709
|
),
|
|
710
|
-
!
|
|
710
|
+
!u && o.view_subscriptions.length > 0 && /* @__PURE__ */ t(
|
|
711
711
|
x,
|
|
712
712
|
{
|
|
713
713
|
title: "Saved-view digests",
|
|
714
714
|
hint: "which records entered the view since last time",
|
|
715
|
-
children:
|
|
715
|
+
children: o.view_subscriptions.map((e) => /* @__PURE__ */ t(
|
|
716
716
|
h,
|
|
717
717
|
{
|
|
718
718
|
trigger: e.trigger,
|
|
@@ -727,8 +727,8 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
727
727
|
))
|
|
728
728
|
}
|
|
729
729
|
),
|
|
730
|
-
!
|
|
731
|
-
|
|
730
|
+
!u && (o.chat_rooms.length > 0 || o.push_devices.length > 0) && /* @__PURE__ */ a(x, { title: "Chat & devices", children: [
|
|
731
|
+
o.chat_rooms.map((e) => /* @__PURE__ */ t(
|
|
732
732
|
h,
|
|
733
733
|
{
|
|
734
734
|
title: e.room.replace(/^ch:/, "#"),
|
|
@@ -736,23 +736,27 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
736
736
|
},
|
|
737
737
|
e.room
|
|
738
738
|
)),
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
739
|
+
["browser", "phone"].map((e) => {
|
|
740
|
+
const r = o.push_devices.filter((p) => (p.kind ?? "browser") === e).length;
|
|
741
|
+
return r === 0 ? null : /* @__PURE__ */ t(
|
|
742
|
+
h,
|
|
743
|
+
{
|
|
744
|
+
title: e === "phone" ? `Phone alerts — ${r} phone${r === 1 ? "" : "s"}` : `Browser push — ${r} device${r === 1 ? "" : "s"}`,
|
|
745
|
+
description: "Push notifications mirror your in-app notifications"
|
|
746
|
+
},
|
|
747
|
+
e
|
|
748
|
+
);
|
|
749
|
+
})
|
|
746
750
|
] }),
|
|
747
|
-
!
|
|
748
|
-
e.items.map((
|
|
751
|
+
!u && (o.external ?? []).map((e) => /* @__PURE__ */ a(x, { title: e.title, hint: e.description, children: [
|
|
752
|
+
e.items.map((r) => /* @__PURE__ */ t(
|
|
749
753
|
h,
|
|
750
754
|
{
|
|
751
|
-
title:
|
|
752
|
-
description:
|
|
753
|
-
paused:
|
|
755
|
+
title: r.label,
|
|
756
|
+
description: r.detail ?? void 0,
|
|
757
|
+
paused: r.is_active === !1 ? "inactive" : null
|
|
754
758
|
},
|
|
755
|
-
String(
|
|
759
|
+
String(r.id)
|
|
756
760
|
)),
|
|
757
761
|
e.items.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-1.5 text-[11.5px] text-slate-400", children: "Nothing watched yet." }),
|
|
758
762
|
e.manage_url && /* @__PURE__ */ t(
|
|
@@ -764,13 +768,13 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
764
768
|
}
|
|
765
769
|
)
|
|
766
770
|
] }, e.key)),
|
|
767
|
-
!
|
|
771
|
+
!u && (o.implicit.owner_group_memberships.length > 0 || o.implicit.sla_escalations.length > 0) && /* @__PURE__ */ a(
|
|
768
772
|
x,
|
|
769
773
|
{
|
|
770
774
|
title: "Because of your role",
|
|
771
775
|
hint: "these follow from assignments, not subscriptions — an admin manages them",
|
|
772
776
|
children: [
|
|
773
|
-
|
|
777
|
+
o.implicit.owner_group_memberships.map((e) => /* @__PURE__ */ t(
|
|
774
778
|
h,
|
|
775
779
|
{
|
|
776
780
|
trigger: e.trigger,
|
|
@@ -779,7 +783,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
779
783
|
},
|
|
780
784
|
e.template
|
|
781
785
|
)),
|
|
782
|
-
|
|
786
|
+
o.implicit.sla_escalations.map((e) => /* @__PURE__ */ t(
|
|
783
787
|
h,
|
|
784
788
|
{
|
|
785
789
|
trigger: e.trigger,
|
|
@@ -797,7 +801,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
797
801
|
] })
|
|
798
802
|
] })
|
|
799
803
|
] }),
|
|
800
|
-
|
|
804
|
+
c === "history" && /* @__PURE__ */ a("div", { className: "px-5 py-4", children: [
|
|
801
805
|
$.length > 0 && /* @__PURE__ */ a("div", { className: "mb-3 flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
802
806
|
/* @__PURE__ */ t(
|
|
803
807
|
me,
|
|
@@ -875,7 +879,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
875
879
|
}
|
|
876
880
|
)
|
|
877
881
|
] }),
|
|
878
|
-
ae.isLoading ? /* @__PURE__ */ t("div", { className: "space-y-2 py-2", children: Array.from({ length: 6 }, (e,
|
|
882
|
+
ae.isLoading ? /* @__PURE__ */ t("div", { className: "space-y-2 py-2", children: Array.from({ length: 6 }, (e, r) => /* @__PURE__ */ t("div", { className: "h-9 animate-pulse rounded-md bg-slate-100 dark:bg-muted" }, r)) }) : $.length === 0 ? /* @__PURE__ */ a("div", { className: "px-2 py-6 text-center", children: [
|
|
879
883
|
/* @__PURE__ */ t(fe, { className: "mx-auto mb-2 h-5 w-5 text-slate-300 dark:text-slate-600" }),
|
|
880
884
|
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: "Nothing delivered yet" }),
|
|
881
885
|
/* @__PURE__ */ t("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "When a subscription or alert fires, it shows up here with the time it was sent." })
|
|
@@ -884,13 +888,13 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
884
888
|
$.length,
|
|
885
889
|
" entries."
|
|
886
890
|
] }) : /* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
887
|
-
[...K.entries()].map(([e,
|
|
891
|
+
[...K.entries()].map(([e, r]) => /* @__PURE__ */ a("div", { children: [
|
|
888
892
|
/* @__PURE__ */ t("p", { className: "mb-1 text-[10.5px] font-semibold text-slate-400", children: e }),
|
|
889
|
-
/* @__PURE__ */ t("div", { className: "space-y-0.5", children:
|
|
890
|
-
const
|
|
893
|
+
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: r.map((p, xe) => {
|
|
894
|
+
const re = We[p.kind] ?? {
|
|
891
895
|
icon: _e,
|
|
892
896
|
tint: "text-slate-500 bg-slate-100 dark:bg-muted"
|
|
893
|
-
}, be =
|
|
897
|
+
}, be = re.icon;
|
|
894
898
|
return /* @__PURE__ */ a(
|
|
895
899
|
"div",
|
|
896
900
|
{
|
|
@@ -899,29 +903,29 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
899
903
|
/* @__PURE__ */ t(
|
|
900
904
|
"span",
|
|
901
905
|
{
|
|
902
|
-
className: `mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ${
|
|
906
|
+
className: `mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ${re.tint}`,
|
|
903
907
|
children: /* @__PURE__ */ t(be, { className: "h-3 w-3" })
|
|
904
908
|
}
|
|
905
909
|
),
|
|
906
910
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
907
|
-
/* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-800 dark:text-slate-100", children:
|
|
908
|
-
|
|
911
|
+
/* @__PURE__ */ t("p", { className: "text-[12.5px] text-slate-800 dark:text-slate-100", children: p.title }),
|
|
912
|
+
p.detail && /* @__PURE__ */ t("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: p.detail })
|
|
909
913
|
] }),
|
|
910
914
|
/* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
911
|
-
(
|
|
915
|
+
(p.channels ?? []).map((se) => /* @__PURE__ */ t(
|
|
912
916
|
"span",
|
|
913
917
|
{
|
|
914
918
|
className: "rounded bg-slate-100 px-1 py-0.5 text-[9.5px] font-medium uppercase tracking-wide text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
915
|
-
children:
|
|
919
|
+
children: se
|
|
916
920
|
},
|
|
917
|
-
|
|
921
|
+
se
|
|
918
922
|
)),
|
|
919
923
|
/* @__PURE__ */ t(
|
|
920
924
|
"span",
|
|
921
925
|
{
|
|
922
926
|
className: "text-[10.5px] tabular-nums text-slate-400",
|
|
923
|
-
title: new Date(
|
|
924
|
-
children: new Date(
|
|
927
|
+
title: new Date(p.at).toLocaleString(),
|
|
928
|
+
children: new Date(p.at).toLocaleTimeString("en-US", {
|
|
925
929
|
hour: "numeric",
|
|
926
930
|
minute: "2-digit"
|
|
927
931
|
})
|
|
@@ -930,7 +934,7 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
930
934
|
] })
|
|
931
935
|
]
|
|
932
936
|
},
|
|
933
|
-
`${
|
|
937
|
+
`${p.kind}-${p.at}-${xe}`
|
|
934
938
|
);
|
|
935
939
|
}) })
|
|
936
940
|
] }, e)),
|
|
@@ -955,23 +959,23 @@ function tt({ only: n, bare: l } = {}) {
|
|
|
955
959
|
}
|
|
956
960
|
function me({
|
|
957
961
|
label: n,
|
|
958
|
-
options:
|
|
962
|
+
options: s,
|
|
959
963
|
counts: i,
|
|
960
|
-
selected:
|
|
961
|
-
onChange:
|
|
964
|
+
selected: l,
|
|
965
|
+
onChange: c
|
|
962
966
|
}) {
|
|
963
|
-
return
|
|
967
|
+
return s.length === 0 ? null : /* @__PURE__ */ a("span", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
964
968
|
/* @__PURE__ */ t("span", { className: "text-[10.5px] font-semibold text-slate-500 dark:text-slate-400", children: n }),
|
|
965
|
-
|
|
966
|
-
const m =
|
|
969
|
+
s.map((d) => {
|
|
970
|
+
const m = l.has(d.key);
|
|
967
971
|
return /* @__PURE__ */ a(
|
|
968
972
|
"button",
|
|
969
973
|
{
|
|
970
974
|
type: "button",
|
|
971
975
|
"aria-pressed": m,
|
|
972
976
|
onClick: () => {
|
|
973
|
-
const b = new Set(
|
|
974
|
-
m ? b.delete(d.key) : b.add(d.key),
|
|
977
|
+
const b = new Set(l);
|
|
978
|
+
m ? b.delete(d.key) : b.add(d.key), c(b);
|
|
975
979
|
},
|
|
976
980
|
className: [
|
|
977
981
|
"rounded-full border px-2 py-0.5 text-[11px] transition-colors duration-150",
|