@nice2dev/events 1.0.27 → 1.0.29
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/CHANGELOG.md +15 -0
- package/README.md +11 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +39 -64
- package/dist/index.mjs +1065 -1102
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -1,786 +1,685 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
+
import { NtdHeart as en, NtdTrash as nn, NtdPlay as tn, NtdImage as an, NtdSparkle as ye, NtdCamera as fe, NtdMicrophone as Ne, NtdHelp as _e, NtdMusic as W, NtdGamepad as be, NtdThumbsUp as ln, NtdClipboardCheck as rn, NtdMedal as pe, NtdTrophy as cn } from "@nice2dev/icons";
|
|
3
|
+
import { NiceUpload as sn, NiceTextInput as T, NiceCardGroup as on, NiceAvatarGroup as ue, NiceAvatar as X, NiceBadge as U, NiceButton as B, NiceSelect as he, NiceAmountBreakdown as dn, NiceToggle as ve, NiceTabs as mn, NiceTextArea as pn } from "@nice2dev/ui";
|
|
4
|
+
import ee, { forwardRef as E, useState as _, useMemo as I, useCallback as $ } from "react";
|
|
5
|
+
import { NiceIcon as L } from "@nice2dev/ui-core";
|
|
6
|
+
const un = ({ item: w }) => {
|
|
7
|
+
const [b, x] = _(!1), t = w.thumbnailUrl ?? w.url;
|
|
8
|
+
return w.type === "video" ? /* @__PURE__ */ e("div", { className: "nice-event-media__video-thumb", children: /* @__PURE__ */ e(tn, { size: 26 }) }) : b || !t ? /* @__PURE__ */ e("div", { className: "nice-event-media__broken", title: "Image unavailable", children: /* @__PURE__ */ e(an, { size: 24 }) }) : /* @__PURE__ */ e(
|
|
9
|
+
"img",
|
|
10
|
+
{
|
|
11
|
+
src: t,
|
|
12
|
+
alt: w.caption ?? "",
|
|
13
|
+
className: "nice-event-media__thumb",
|
|
14
|
+
loading: "lazy",
|
|
15
|
+
onError: () => x(!0)
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}, Sn = E(
|
|
19
|
+
function(b, x) {
|
|
5
20
|
const {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
className:
|
|
15
|
-
style:
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
!s.trim() || !m || (m(s.trim(), "text"), u(""));
|
|
22
|
-
}, [s, m]), p = (c) => {
|
|
23
|
-
c.key === "Enter" && !c.shiftKey && (c.preventDefault(), b());
|
|
24
|
-
};
|
|
25
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-chat ${f ?? ""}`, style: C, children: [
|
|
26
|
-
/* @__PURE__ */ t("div", { className: "nice-event-chat__messages", children: [
|
|
27
|
-
a.length === 0 && /* @__PURE__ */ e("p", { className: "nice-event-chat__empty", children: "No messages yet. Start the conversation!" }),
|
|
28
|
-
a.map((c) => {
|
|
29
|
-
const n = c.senderId === y;
|
|
30
|
-
return c.type === "system" || c.type === "announcement" ? /* @__PURE__ */ t(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: `nice-event-chat__system nice-event-chat__${c.type}`,
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ e("span", { children: c.content }),
|
|
36
|
-
/* @__PURE__ */ e("time", { children: c.timestamp })
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
c.id
|
|
40
|
-
) : /* @__PURE__ */ t(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
className: `nice-event-chat__bubble ${n ? "nice-event-chat__bubble--own" : ""}`,
|
|
44
|
-
children: [
|
|
45
|
-
!n && /* @__PURE__ */ t("div", { className: "nice-event-chat__sender", children: [
|
|
46
|
-
c.senderAvatarUrl && /* @__PURE__ */ e("img", { src: c.senderAvatarUrl, alt: "", className: "nice-event-chat__avatar" }),
|
|
47
|
-
/* @__PURE__ */ e("strong", { children: c.senderName })
|
|
48
|
-
] }),
|
|
49
|
-
c.type === "image" ? /* @__PURE__ */ e("img", { src: c.content, alt: "Shared image", className: "nice-event-chat__image" }) : /* @__PURE__ */ e("p", { className: "nice-event-chat__text", children: c.content }),
|
|
50
|
-
/* @__PURE__ */ t("div", { className: "nice-event-chat__meta", children: [
|
|
51
|
-
/* @__PURE__ */ e("time", { children: c.timestamp }),
|
|
52
|
-
c.reactions && Object.keys(c.reactions).length > 0 && /* @__PURE__ */ e("span", { className: "nice-event-chat__reactions", children: Object.entries(c.reactions).map(([i, h]) => /* @__PURE__ */ t(
|
|
53
|
-
"button",
|
|
54
|
-
{
|
|
55
|
-
className: "nice-event-chat__reaction",
|
|
56
|
-
onClick: () => v == null ? void 0 : v(c.id, i),
|
|
57
|
-
children: [
|
|
58
|
-
i,
|
|
59
|
-
" ",
|
|
60
|
-
h
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
i
|
|
64
|
-
)) })
|
|
65
|
-
] }),
|
|
66
|
-
v && !g && /* @__PURE__ */ e("div", { className: "nice-event-chat__react-bar", children: _.map((i) => /* @__PURE__ */ e("button", { onClick: () => v(c.id, i), title: i, children: i }, i)) })
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
c.id
|
|
70
|
-
);
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ e("div", { ref: k })
|
|
73
|
-
] }),
|
|
74
|
-
!g && /* @__PURE__ */ t("div", { className: "nice-event-chat__input-bar", children: [
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
-
"textarea",
|
|
77
|
-
{
|
|
78
|
-
value: s,
|
|
79
|
-
onChange: (c) => u(c.target.value),
|
|
80
|
-
onKeyDown: p,
|
|
81
|
-
placeholder: S,
|
|
82
|
-
rows: 1
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
/* @__PURE__ */ e("button", { onClick: b, disabled: !s.trim(), children: "Send" })
|
|
86
|
-
] })
|
|
87
|
-
] });
|
|
88
|
-
}
|
|
89
|
-
), X = {
|
|
90
|
-
invited: "#3b82f6",
|
|
91
|
-
confirmed: "#22c55e",
|
|
92
|
-
declined: "#ef4444",
|
|
93
|
-
"checked-in": "#8b5cf6",
|
|
94
|
-
"no-show": "#9ca3af"
|
|
95
|
-
}, Z = {
|
|
96
|
-
host: "👑 Host",
|
|
97
|
-
"co-host": "🎯 Co-Host",
|
|
98
|
-
moderator: "🛡️ Moderator",
|
|
99
|
-
participant: "👤 Participant",
|
|
100
|
-
spectator: "👁️ Spectator",
|
|
101
|
-
vip: "⭐ VIP"
|
|
102
|
-
}, ke = P(
|
|
103
|
-
function(x, A) {
|
|
104
|
-
const {
|
|
105
|
-
participants: a,
|
|
106
|
-
currentParticipantId: y,
|
|
107
|
-
onInvite: m,
|
|
108
|
-
onRemove: v,
|
|
109
|
-
onRoleChange: _,
|
|
110
|
-
onCheckIn: g,
|
|
111
|
-
onParticipantClick: S,
|
|
112
|
-
showQR: N = !1,
|
|
113
|
-
editable: f = !1,
|
|
114
|
-
maxParticipants: C,
|
|
115
|
-
className: s,
|
|
116
|
-
style: u
|
|
117
|
-
} = x, [k, b] = w(""), [p, c] = w(""), n = R(() => {
|
|
118
|
-
let h = a;
|
|
119
|
-
if (p && (h = h.filter((l) => l.status === p)), k.trim()) {
|
|
120
|
-
const l = k.toLowerCase();
|
|
121
|
-
h = h.filter((o) => o.name.toLowerCase().includes(l));
|
|
122
|
-
}
|
|
123
|
-
return h;
|
|
124
|
-
}, [a, p, k]), d = R(() => {
|
|
125
|
-
const h = /* @__PURE__ */ new Map(), l = [
|
|
126
|
-
"host",
|
|
127
|
-
"co-host",
|
|
128
|
-
"moderator",
|
|
129
|
-
"vip",
|
|
130
|
-
"participant",
|
|
131
|
-
"spectator"
|
|
132
|
-
];
|
|
133
|
-
for (const o of l)
|
|
134
|
-
h.set(o, []);
|
|
135
|
-
for (const o of n)
|
|
136
|
-
h.has(o.role) || h.set(o.role, []), h.get(o.role).push(o);
|
|
137
|
-
return Array.from(h.entries()).filter(([, o]) => o.length > 0);
|
|
138
|
-
}, [n]), i = R(() => {
|
|
139
|
-
const h = {};
|
|
140
|
-
for (const l of a)
|
|
141
|
-
h[l.status] = (h[l.status] ?? 0) + 1;
|
|
142
|
-
return h;
|
|
143
|
-
}, [a]);
|
|
144
|
-
return /* @__PURE__ */ t("div", { ref: A, className: `nice-event-participants ${s ?? ""}`, style: u, children: [
|
|
145
|
-
/* @__PURE__ */ t("div", { className: "nice-event-participants__header", children: [
|
|
146
|
-
/* @__PURE__ */ t("h3", { children: [
|
|
147
|
-
"Participants (",
|
|
148
|
-
a.length,
|
|
149
|
-
C ? ` / ${C}` : "",
|
|
150
|
-
")"
|
|
151
|
-
] }),
|
|
152
|
-
f && m && /* @__PURE__ */ e(
|
|
153
|
-
"button",
|
|
154
|
-
{
|
|
155
|
-
onClick: m,
|
|
156
|
-
disabled: C ? a.length >= C : !1,
|
|
157
|
-
children: "+ Invite"
|
|
158
|
-
}
|
|
159
|
-
)
|
|
160
|
-
] }),
|
|
161
|
-
/* @__PURE__ */ e("div", { className: "nice-event-participants__summary", children: Object.entries(i).map(([h, l]) => /* @__PURE__ */ t("span", { className: "nice-event-participants__stat", children: [
|
|
162
|
-
/* @__PURE__ */ e(
|
|
163
|
-
"span",
|
|
164
|
-
{
|
|
165
|
-
className: "nice-event-participants__dot",
|
|
166
|
-
style: { backgroundColor: X[h] }
|
|
167
|
-
}
|
|
168
|
-
),
|
|
169
|
-
h,
|
|
170
|
-
": ",
|
|
171
|
-
l
|
|
172
|
-
] }, h)) }),
|
|
173
|
-
/* @__PURE__ */ t("div", { className: "nice-event-participants__toolbar", children: [
|
|
174
|
-
/* @__PURE__ */ e(
|
|
175
|
-
"input",
|
|
176
|
-
{
|
|
177
|
-
type: "text",
|
|
178
|
-
value: k,
|
|
179
|
-
onChange: (h) => b(h.target.value),
|
|
180
|
-
placeholder: "Search…"
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ t(
|
|
184
|
-
"select",
|
|
185
|
-
{
|
|
186
|
-
value: p,
|
|
187
|
-
onChange: (h) => c(h.target.value),
|
|
188
|
-
children: [
|
|
189
|
-
/* @__PURE__ */ e("option", { value: "", children: "All" }),
|
|
190
|
-
/* @__PURE__ */ e("option", { value: "invited", children: "Invited" }),
|
|
191
|
-
/* @__PURE__ */ e("option", { value: "confirmed", children: "Confirmed" }),
|
|
192
|
-
/* @__PURE__ */ e("option", { value: "declined", children: "Declined" }),
|
|
193
|
-
/* @__PURE__ */ e("option", { value: "checked-in", children: "Checked In" }),
|
|
194
|
-
/* @__PURE__ */ e("option", { value: "no-show", children: "No Show" })
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
)
|
|
198
|
-
] }),
|
|
199
|
-
d.map(([h, l]) => /* @__PURE__ */ t("div", { className: "nice-event-participants__group", children: [
|
|
200
|
-
/* @__PURE__ */ t("h4", { className: "nice-event-participants__role-label", children: [
|
|
201
|
-
Z[h],
|
|
202
|
-
" (",
|
|
203
|
-
l.length,
|
|
204
|
-
")"
|
|
205
|
-
] }),
|
|
206
|
-
l.map((o) => /* @__PURE__ */ t(
|
|
207
|
-
"div",
|
|
208
|
-
{
|
|
209
|
-
className: `nice-event-participants__item ${o.id === y ? "nice-event-participants__item--self" : ""}`,
|
|
210
|
-
onClick: () => S == null ? void 0 : S(o),
|
|
211
|
-
children: [
|
|
212
|
-
o.avatarUrl ? /* @__PURE__ */ e("img", { src: o.avatarUrl, alt: "", className: "nice-event-participants__avatar" }) : /* @__PURE__ */ e("span", { className: "nice-event-participants__avatar-placeholder", children: o.name.charAt(0) }),
|
|
213
|
-
/* @__PURE__ */ t("div", { className: "nice-event-participants__info", children: [
|
|
214
|
-
/* @__PURE__ */ e("span", { className: "nice-event-participants__name", children: o.name }),
|
|
215
|
-
/* @__PURE__ */ e(
|
|
216
|
-
"span",
|
|
217
|
-
{
|
|
218
|
-
className: "nice-event-participants__status",
|
|
219
|
-
style: { color: X[o.status] },
|
|
220
|
-
children: o.status
|
|
221
|
-
}
|
|
222
|
-
),
|
|
223
|
-
o.score != null && /* @__PURE__ */ t("span", { className: "nice-event-participants__score", children: [
|
|
224
|
-
"Score: ",
|
|
225
|
-
o.score
|
|
226
|
-
] })
|
|
227
|
-
] }),
|
|
228
|
-
N && o.qrCode && /* @__PURE__ */ e("span", { className: "nice-event-participants__qr", title: "QR Code", children: "📱" }),
|
|
229
|
-
f && /* @__PURE__ */ t("div", { className: "nice-event-participants__actions", children: [
|
|
230
|
-
_ && /* @__PURE__ */ e(
|
|
231
|
-
"select",
|
|
232
|
-
{
|
|
233
|
-
value: o.role,
|
|
234
|
-
onChange: (I) => _(o.id, I.target.value),
|
|
235
|
-
onClick: (I) => I.stopPropagation(),
|
|
236
|
-
children: Object.entries(Z).map(([I, O]) => /* @__PURE__ */ e("option", { value: I, children: O }, I))
|
|
237
|
-
}
|
|
238
|
-
),
|
|
239
|
-
g && o.status === "confirmed" && /* @__PURE__ */ e(
|
|
240
|
-
"button",
|
|
241
|
-
{
|
|
242
|
-
onClick: (I) => {
|
|
243
|
-
I.stopPropagation(), g(o.id);
|
|
244
|
-
},
|
|
245
|
-
children: "Check In"
|
|
246
|
-
}
|
|
247
|
-
),
|
|
248
|
-
v && o.role !== "host" && /* @__PURE__ */ e(
|
|
249
|
-
"button",
|
|
250
|
-
{
|
|
251
|
-
onClick: (I) => {
|
|
252
|
-
I.stopPropagation(), v(o.id);
|
|
253
|
-
},
|
|
254
|
-
children: "Remove"
|
|
255
|
-
}
|
|
256
|
-
)
|
|
257
|
-
] })
|
|
258
|
-
]
|
|
259
|
-
},
|
|
260
|
-
o.id
|
|
261
|
-
))
|
|
262
|
-
] }, h))
|
|
263
|
-
] });
|
|
264
|
-
}
|
|
265
|
-
), Ce = P(
|
|
266
|
-
function(x, A) {
|
|
267
|
-
const {
|
|
268
|
-
items: a,
|
|
269
|
-
onUpload: y,
|
|
270
|
-
onDelete: m,
|
|
271
|
-
onLike: v,
|
|
272
|
-
onItemClick: _,
|
|
273
|
-
layout: g = "grid",
|
|
274
|
-
uploadEnabled: S = !0,
|
|
275
|
-
typeFilter: N = "all",
|
|
276
|
-
className: f,
|
|
277
|
-
style: C
|
|
278
|
-
} = x, [s, u] = w(""), k = R(() => N === "all" ? a : a.filter((p) => p.type === N), [a, N]), b = (p) => {
|
|
279
|
-
var n;
|
|
280
|
-
const c = (n = p.target.files) == null ? void 0 : n[0];
|
|
281
|
-
!c || !y || (y(c, s.trim() || void 0), u(""), p.target.value = "");
|
|
282
|
-
};
|
|
283
|
-
return /* @__PURE__ */ t(
|
|
21
|
+
items: t,
|
|
22
|
+
onUpload: p,
|
|
23
|
+
onDelete: u,
|
|
24
|
+
onLike: m,
|
|
25
|
+
onItemClick: v,
|
|
26
|
+
layout: y = "grid",
|
|
27
|
+
uploadEnabled: k = !0,
|
|
28
|
+
typeFilter: f = "all",
|
|
29
|
+
className: h,
|
|
30
|
+
style: N
|
|
31
|
+
} = b, [c, o] = _(""), C = I(() => f === "all" ? t : t.filter((d) => d.type === f), [t, f]), g = (d) => {
|
|
32
|
+
const n = d[0];
|
|
33
|
+
!n || !p || (p(n, c.trim() || void 0), o(""));
|
|
34
|
+
}, S = y === "list";
|
|
35
|
+
return /* @__PURE__ */ i(
|
|
284
36
|
"div",
|
|
285
37
|
{
|
|
286
|
-
ref:
|
|
287
|
-
className: `nice-event-media nice-event-media--${
|
|
288
|
-
style:
|
|
38
|
+
ref: x,
|
|
39
|
+
className: `nice-event-media nice-event-media--${y} ${h ?? ""}`,
|
|
40
|
+
style: N,
|
|
289
41
|
children: [
|
|
290
|
-
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ e("div", { className: "nice-event-media__header", children: /* @__PURE__ */ i("h3", { children: [
|
|
291
43
|
"Media (",
|
|
292
|
-
|
|
44
|
+
C.length,
|
|
293
45
|
")"
|
|
294
46
|
] }) }),
|
|
295
|
-
|
|
296
|
-
/* @__PURE__ */ e("input", { type: "file", accept: "image/*,video/*", onChange: b }),
|
|
47
|
+
k && p && /* @__PURE__ */ i("div", { className: "nice-event-media__upload", children: [
|
|
297
48
|
/* @__PURE__ */ e(
|
|
298
|
-
|
|
49
|
+
sn,
|
|
299
50
|
{
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
className: "nice-event-media__caption-input"
|
|
51
|
+
accept: "image/*,video/*",
|
|
52
|
+
multiple: !1,
|
|
53
|
+
imagePreview: !1,
|
|
54
|
+
onFilesSelected: g
|
|
305
55
|
}
|
|
306
|
-
)
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ e(T, { value: c, onChange: o, placeholder: "Add a caption…" })
|
|
307
58
|
] }),
|
|
308
|
-
|
|
309
|
-
|
|
59
|
+
C.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-media__empty", children: "No media yet." }) : /* @__PURE__ */ e(
|
|
60
|
+
on,
|
|
310
61
|
{
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
62
|
+
columns: S ? 1 : void 0,
|
|
63
|
+
minColumnWidth: 200,
|
|
64
|
+
gap: 12,
|
|
65
|
+
align: "stretch",
|
|
66
|
+
children: C.map((d) => /* @__PURE__ */ i(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: `nice-event-media__card${S ? " nice-event-media__card--row" : ""}`,
|
|
70
|
+
onClick: () => v == null ? void 0 : v(d),
|
|
71
|
+
role: v ? "button" : void 0,
|
|
72
|
+
tabIndex: v ? 0 : void 0,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ e(un, { item: d }),
|
|
75
|
+
/* @__PURE__ */ i("div", { className: "nice-event-media__body", children: [
|
|
76
|
+
d.caption && /* @__PURE__ */ e("span", { className: "nice-event-media__caption", children: d.caption }),
|
|
77
|
+
d.uploadedByName && /* @__PURE__ */ e("span", { className: "nice-event-media__uploader", children: d.uploadedByName }),
|
|
78
|
+
/* @__PURE__ */ i("div", { className: "nice-event-media__actions", children: [
|
|
79
|
+
m && /* @__PURE__ */ i(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
className: "nice-event-media__action",
|
|
84
|
+
onClick: (n) => {
|
|
85
|
+
n.stopPropagation(), m(d.id);
|
|
86
|
+
},
|
|
87
|
+
"aria-label": "Like",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ e(en, { size: 15 }),
|
|
90
|
+
" ",
|
|
91
|
+
d.likes ?? 0
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
u && /* @__PURE__ */ e(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
className: "nice-event-media__action nice-event-media__action--danger",
|
|
100
|
+
onClick: (n) => {
|
|
101
|
+
n.stopPropagation(), u(d.id);
|
|
102
|
+
},
|
|
103
|
+
"aria-label": "Delete",
|
|
104
|
+
children: /* @__PURE__ */ e(nn, { size: 15 })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
d.id
|
|
112
|
+
))
|
|
113
|
+
}
|
|
114
|
+
)
|
|
354
115
|
]
|
|
355
116
|
}
|
|
356
117
|
);
|
|
357
118
|
}
|
|
358
|
-
)
|
|
359
|
-
|
|
360
|
-
|
|
119
|
+
);
|
|
120
|
+
function Z(w) {
|
|
121
|
+
const b = w.toLowerCase();
|
|
122
|
+
return ["active", "live", "published", "completed", "confirmed"].includes(b) ? "success" : ["cancelled", "canceled", "rejected", "failed"].includes(b) ? "error" : ["scheduled", "pending", "planning"].includes(b) ? "info" : ["draft", "archived"].includes(b) ? "secondary" : "warning";
|
|
123
|
+
}
|
|
124
|
+
const hn = {
|
|
125
|
+
micro: [],
|
|
126
|
+
compact: ["details", "location", "budget"],
|
|
127
|
+
normal: ["details", "location", "participants", "surveys", "budget"],
|
|
128
|
+
full: ["details", "location", "participants", "surveys", "budget", "settings"]
|
|
129
|
+
}, xn = E(
|
|
130
|
+
function(b, x) {
|
|
131
|
+
var re, ce, se, oe, de, me;
|
|
361
132
|
const {
|
|
362
|
-
event:
|
|
363
|
-
|
|
133
|
+
event: t,
|
|
134
|
+
participants: p = [],
|
|
135
|
+
surveys: u = [],
|
|
364
136
|
billing: m = [],
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
137
|
+
displayMode: v = "normal",
|
|
138
|
+
tabs: y,
|
|
139
|
+
activeTab: k,
|
|
140
|
+
onTabChange: f,
|
|
141
|
+
editable: h = !1,
|
|
142
|
+
onSave: N,
|
|
143
|
+
onPublish: c,
|
|
144
|
+
onShare: o,
|
|
145
|
+
onExport: C,
|
|
146
|
+
onUpdateEvent: g,
|
|
147
|
+
onUpdateLocation: S,
|
|
148
|
+
onAddSurvey: d,
|
|
149
|
+
onSurveyRespond: n,
|
|
150
|
+
onAddBilling: s,
|
|
151
|
+
className: a,
|
|
152
|
+
style: z
|
|
153
|
+
} = b, [r, A] = _(t.title), [P, V] = _(t.description ?? ""), [q, ke] = _(t.startDate ?? ""), [F, Ce] = _(t.endDate ?? ""), [Q, Se] = _(((re = t.location) == null ? void 0 : re.name) ?? ""), [j, xe] = _(((ce = t.location) == null ? void 0 : ce.address) ?? ""), [G, we] = _(((se = t.location) == null ? void 0 : se.virtualUrl) ?? ""), [M, ze] = _(((oe = t.location) == null ? void 0 : oe.isVirtual) ?? !1), [O, ne] = _(""), [H, Ae] = _("single"), [Y, ie] = _(""), [D, te] = _(""), [K, ae] = _(""), [J, Ie] = _("PLN"), le = y ?? hn[v], [Le, Te] = _(le[0] ?? "details"), Pe = k ?? Le, Re = $(
|
|
154
|
+
(l) => {
|
|
155
|
+
const R = l;
|
|
156
|
+
k === void 0 && Te(R), f == null || f(R);
|
|
157
|
+
},
|
|
158
|
+
[k, f]
|
|
159
|
+
), Be = $(() => {
|
|
160
|
+
g == null || g({
|
|
161
|
+
title: r,
|
|
162
|
+
description: P || void 0,
|
|
163
|
+
startDate: q || void 0,
|
|
164
|
+
endDate: F || void 0
|
|
379
165
|
});
|
|
380
|
-
}, [
|
|
381
|
-
|
|
382
|
-
name:
|
|
383
|
-
address:
|
|
384
|
-
virtualUrl:
|
|
385
|
-
isVirtual:
|
|
166
|
+
}, [r, P, q, F, g]), Ee = $(() => {
|
|
167
|
+
S == null || S({
|
|
168
|
+
name: Q,
|
|
169
|
+
address: j || void 0,
|
|
170
|
+
virtualUrl: G || void 0,
|
|
171
|
+
isVirtual: M
|
|
386
172
|
});
|
|
387
|
-
}, [
|
|
388
|
-
if (!
|
|
173
|
+
}, [Q, j, G, M, S]), $e = $(() => {
|
|
174
|
+
if (!O.trim() || !d)
|
|
389
175
|
return;
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
}, [
|
|
393
|
-
!
|
|
394
|
-
label:
|
|
395
|
-
amount: parseFloat(
|
|
396
|
-
currency:
|
|
397
|
-
}),
|
|
398
|
-
}, [
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
176
|
+
const l = Y.split(",").map((R) => R.trim()).filter(Boolean);
|
|
177
|
+
d(O.trim(), H, l.length > 0 ? l : void 0), ne(""), ie("");
|
|
178
|
+
}, [O, H, Y, d]), Oe = $(() => {
|
|
179
|
+
!D.trim() || !s || (s({
|
|
180
|
+
label: D.trim(),
|
|
181
|
+
amount: parseFloat(K) || 0,
|
|
182
|
+
currency: J
|
|
183
|
+
}), te(""), ae(""));
|
|
184
|
+
}, [D, K, J, s]), De = I(
|
|
185
|
+
() => m.map((l) => ({
|
|
186
|
+
label: l.label,
|
|
187
|
+
amount: l.amount
|
|
188
|
+
})),
|
|
189
|
+
[m]
|
|
190
|
+
), Ve = I(() => m.reduce((l, R) => l + R.amount, 0), [m]), Me = ((de = m[0]) == null ? void 0 : de.currency) ?? "PLN", Ue = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
191
|
+
/* @__PURE__ */ e(
|
|
192
|
+
T,
|
|
402
193
|
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
)
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
/* @__PURE__ */ t("label", { children: [
|
|
423
|
-
"Description",
|
|
424
|
-
/* @__PURE__ */ e(
|
|
425
|
-
"textarea",
|
|
426
|
-
{
|
|
427
|
-
value: c,
|
|
428
|
-
onChange: (r) => n(r.target.value),
|
|
429
|
-
readOnly: !f,
|
|
430
|
-
rows: 3
|
|
431
|
-
}
|
|
432
|
-
)
|
|
433
|
-
] }),
|
|
434
|
-
/* @__PURE__ */ t("label", { children: [
|
|
435
|
-
"Start",
|
|
194
|
+
label: "Title",
|
|
195
|
+
value: r,
|
|
196
|
+
onChange: A,
|
|
197
|
+
readOnly: !h
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ e(
|
|
201
|
+
pn,
|
|
202
|
+
{
|
|
203
|
+
label: "Description",
|
|
204
|
+
value: P,
|
|
205
|
+
onChange: V,
|
|
206
|
+
readOnly: !h,
|
|
207
|
+
rows: 3
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ i("div", { className: "nice-event-planning__row", children: [
|
|
211
|
+
/* @__PURE__ */ i("label", { className: "nice-field", children: [
|
|
212
|
+
/* @__PURE__ */ e("span", { className: "nice-field__label", children: "Start" }),
|
|
436
213
|
/* @__PURE__ */ e(
|
|
437
214
|
"input",
|
|
438
215
|
{
|
|
216
|
+
className: "nice-input",
|
|
439
217
|
type: "datetime-local",
|
|
440
|
-
value:
|
|
441
|
-
onChange: (
|
|
442
|
-
readOnly: !
|
|
218
|
+
value: q,
|
|
219
|
+
onChange: (l) => ke(l.target.value),
|
|
220
|
+
readOnly: !h
|
|
443
221
|
}
|
|
444
222
|
)
|
|
445
223
|
] }),
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
"End",
|
|
224
|
+
/* @__PURE__ */ i("label", { className: "nice-field", children: [
|
|
225
|
+
/* @__PURE__ */ e("span", { className: "nice-field__label", children: "End" }),
|
|
448
226
|
/* @__PURE__ */ e(
|
|
449
227
|
"input",
|
|
450
228
|
{
|
|
229
|
+
className: "nice-input",
|
|
451
230
|
type: "datetime-local",
|
|
452
|
-
value:
|
|
453
|
-
onChange: (
|
|
454
|
-
readOnly: !
|
|
455
|
-
}
|
|
456
|
-
)
|
|
457
|
-
] }),
|
|
458
|
-
/* @__PURE__ */ t("div", { className: "nice-event-planning__status", children: [
|
|
459
|
-
"Status: ",
|
|
460
|
-
/* @__PURE__ */ e("strong", { children: a.status })
|
|
461
|
-
] }),
|
|
462
|
-
f && /* @__PURE__ */ e("button", { onClick: le, children: "Save Details" })
|
|
463
|
-
] }),
|
|
464
|
-
u === "location" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
465
|
-
/* @__PURE__ */ t("label", { children: [
|
|
466
|
-
/* @__PURE__ */ e(
|
|
467
|
-
"input",
|
|
468
|
-
{
|
|
469
|
-
type: "checkbox",
|
|
470
|
-
checked: B,
|
|
471
|
-
onChange: (r) => ie(r.target.checked),
|
|
472
|
-
disabled: !f
|
|
473
|
-
}
|
|
474
|
-
),
|
|
475
|
-
" ",
|
|
476
|
-
"Virtual event"
|
|
477
|
-
] }),
|
|
478
|
-
/* @__PURE__ */ t("label", { children: [
|
|
479
|
-
"Venue Name",
|
|
480
|
-
/* @__PURE__ */ e(
|
|
481
|
-
"input",
|
|
482
|
-
{
|
|
483
|
-
type: "text",
|
|
484
|
-
value: o,
|
|
485
|
-
onChange: (r) => I(r.target.value),
|
|
486
|
-
readOnly: !f
|
|
487
|
-
}
|
|
488
|
-
)
|
|
489
|
-
] }),
|
|
490
|
-
!B && /* @__PURE__ */ t("label", { children: [
|
|
491
|
-
"Address",
|
|
492
|
-
/* @__PURE__ */ e(
|
|
493
|
-
"input",
|
|
494
|
-
{
|
|
495
|
-
type: "text",
|
|
496
|
-
value: O,
|
|
497
|
-
onChange: (r) => te(r.target.value),
|
|
498
|
-
readOnly: !f
|
|
499
|
-
}
|
|
500
|
-
)
|
|
501
|
-
] }),
|
|
502
|
-
B && /* @__PURE__ */ t("label", { children: [
|
|
503
|
-
"Virtual URL",
|
|
504
|
-
/* @__PURE__ */ e(
|
|
505
|
-
"input",
|
|
506
|
-
{
|
|
507
|
-
type: "url",
|
|
508
|
-
value: z,
|
|
509
|
-
onChange: (r) => ne(r.target.value),
|
|
510
|
-
readOnly: !f
|
|
231
|
+
value: F,
|
|
232
|
+
onChange: (l) => Ce(l.target.value),
|
|
233
|
+
readOnly: !h
|
|
511
234
|
}
|
|
512
235
|
)
|
|
513
|
-
] }),
|
|
514
|
-
f && /* @__PURE__ */ e("button", { onClick: re, children: "Save Location" })
|
|
515
|
-
] }),
|
|
516
|
-
u === "surveys" && /* @__PURE__ */ t("div", { className: "nice-event-planning__section", children: [
|
|
517
|
-
y.length === 0 ? /* @__PURE__ */ e("p", { children: "No surveys yet." }) : y.map((r) => /* @__PURE__ */ t("div", { className: "nice-event-planning__survey", children: [
|
|
518
|
-
/* @__PURE__ */ e("strong", { children: r.question }),
|
|
519
|
-
/* @__PURE__ */ t("span", { className: "nice-event-planning__survey-type", children: [
|
|
520
|
-
"(",
|
|
521
|
-
r.type,
|
|
522
|
-
")"
|
|
523
|
-
] }),
|
|
524
|
-
r.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: r.options.map(($, he) => /* @__PURE__ */ e("button", { onClick: () => S == null ? void 0 : S(r.id, $), children: $ }, he)) }),
|
|
525
|
-
r.responses && /* @__PURE__ */ t("span", { children: [
|
|
526
|
-
r.responses.length,
|
|
527
|
-
" responses"
|
|
528
|
-
] })
|
|
529
|
-
] }, r.id)),
|
|
530
|
-
f && g && /* @__PURE__ */ t("div", { className: "nice-event-planning__add-survey", children: [
|
|
531
|
-
/* @__PURE__ */ e("h4", { children: "Add Survey" }),
|
|
532
|
-
/* @__PURE__ */ e(
|
|
533
|
-
"input",
|
|
534
|
-
{
|
|
535
|
-
type: "text",
|
|
536
|
-
value: T,
|
|
537
|
-
onChange: (r) => F(r.target.value),
|
|
538
|
-
placeholder: "Question"
|
|
539
|
-
}
|
|
540
|
-
),
|
|
541
|
-
/* @__PURE__ */ t(
|
|
542
|
-
"select",
|
|
543
|
-
{
|
|
544
|
-
value: D,
|
|
545
|
-
onChange: (r) => ae(r.target.value),
|
|
546
|
-
children: [
|
|
547
|
-
/* @__PURE__ */ e("option", { value: "single", children: "Single choice" }),
|
|
548
|
-
/* @__PURE__ */ e("option", { value: "multiple", children: "Multiple choice" }),
|
|
549
|
-
/* @__PURE__ */ e("option", { value: "text", children: "Free text" }),
|
|
550
|
-
/* @__PURE__ */ e("option", { value: "rating", children: "Rating" })
|
|
551
|
-
]
|
|
552
|
-
}
|
|
553
|
-
),
|
|
554
|
-
/* @__PURE__ */ e(
|
|
555
|
-
"input",
|
|
556
|
-
{
|
|
557
|
-
type: "text",
|
|
558
|
-
value: U,
|
|
559
|
-
onChange: (r) => Q(r.target.value),
|
|
560
|
-
placeholder: "Options (comma-separated)"
|
|
561
|
-
}
|
|
562
|
-
),
|
|
563
|
-
/* @__PURE__ */ e("button", { onClick: se, disabled: !T.trim(), children: "Add" })
|
|
564
236
|
] })
|
|
565
237
|
] }),
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
238
|
+
h && /* @__PURE__ */ e(
|
|
239
|
+
B,
|
|
240
|
+
{
|
|
241
|
+
variant: "primary",
|
|
242
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
243
|
+
onClick: Be,
|
|
244
|
+
children: "Save details"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] }), We = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
248
|
+
/* @__PURE__ */ e(
|
|
249
|
+
ve,
|
|
250
|
+
{
|
|
251
|
+
label: "Virtual event",
|
|
252
|
+
checked: M,
|
|
253
|
+
onChange: ze,
|
|
254
|
+
disabled: !h
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
/* @__PURE__ */ e(
|
|
258
|
+
T,
|
|
259
|
+
{
|
|
260
|
+
label: "Venue name",
|
|
261
|
+
value: Q,
|
|
262
|
+
onChange: Se,
|
|
263
|
+
readOnly: !h
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
M ? /* @__PURE__ */ e(
|
|
267
|
+
T,
|
|
268
|
+
{
|
|
269
|
+
label: "Virtual URL",
|
|
270
|
+
value: G,
|
|
271
|
+
onChange: we,
|
|
272
|
+
readOnly: !h
|
|
273
|
+
}
|
|
274
|
+
) : /* @__PURE__ */ e(
|
|
275
|
+
T,
|
|
276
|
+
{
|
|
277
|
+
label: "Address",
|
|
278
|
+
value: j,
|
|
279
|
+
onChange: xe,
|
|
280
|
+
readOnly: !h
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
h && /* @__PURE__ */ e(
|
|
284
|
+
B,
|
|
285
|
+
{
|
|
286
|
+
variant: "primary",
|
|
287
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
288
|
+
onClick: Ee,
|
|
289
|
+
children: "Save location"
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] }), qe = /* @__PURE__ */ e("div", { className: "nice-event-planning__participants", children: p.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No participants yet." }) : /* @__PURE__ */ i(Ze, { children: [
|
|
293
|
+
/* @__PURE__ */ e(ue, { max: 8, children: p.map((l) => /* @__PURE__ */ e(X, { name: l.name, src: l.avatarUrl }, l.id)) }),
|
|
294
|
+
/* @__PURE__ */ e("ul", { className: "nice-event-planning__participant-list", children: p.map((l) => /* @__PURE__ */ i("li", { className: "nice-event-planning__participant", children: [
|
|
295
|
+
/* @__PURE__ */ e(X, { name: l.name, src: l.avatarUrl, size: "sm" }),
|
|
296
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__participant-name", children: l.name }),
|
|
297
|
+
/* @__PURE__ */ e(U, { size: "xs", subtle: !0, variant: Z(l.status), children: l.status })
|
|
298
|
+
] }, l.id)) })
|
|
299
|
+
] }) }), Fe = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
300
|
+
u.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No surveys yet." }) : u.map((l) => /* @__PURE__ */ i("div", { className: "nice-event-planning__survey", children: [
|
|
301
|
+
/* @__PURE__ */ e("strong", { children: l.question }),
|
|
302
|
+
" ",
|
|
303
|
+
/* @__PURE__ */ e(U, { size: "xs", outline: !0, variant: "info", children: l.type }),
|
|
304
|
+
l.options && /* @__PURE__ */ e("div", { className: "nice-event-planning__survey-options", children: l.options.map((R, Xe) => /* @__PURE__ */ e(
|
|
305
|
+
B,
|
|
306
|
+
{
|
|
307
|
+
size: "sm",
|
|
308
|
+
variant: "outline",
|
|
309
|
+
onClick: () => n == null ? void 0 : n(l.id, R),
|
|
310
|
+
children: R
|
|
311
|
+
},
|
|
312
|
+
Xe
|
|
313
|
+
)) }),
|
|
314
|
+
l.responses && /* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
315
|
+
l.responses.length,
|
|
316
|
+
" responses"
|
|
631
317
|
] })
|
|
318
|
+
] }, l.id)),
|
|
319
|
+
h && d && /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
320
|
+
/* @__PURE__ */ e(
|
|
321
|
+
T,
|
|
322
|
+
{
|
|
323
|
+
label: "New survey question",
|
|
324
|
+
value: O,
|
|
325
|
+
onChange: ne,
|
|
326
|
+
placeholder: "Question"
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
/* @__PURE__ */ e(
|
|
330
|
+
he,
|
|
331
|
+
{
|
|
332
|
+
label: "Type",
|
|
333
|
+
value: H,
|
|
334
|
+
onChange: (l) => Ae(l),
|
|
335
|
+
options: [
|
|
336
|
+
{ value: "single", label: "Single choice" },
|
|
337
|
+
{ value: "multiple", label: "Multiple choice" },
|
|
338
|
+
{ value: "text", label: "Free text" },
|
|
339
|
+
{ value: "rating", label: "Rating" }
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
),
|
|
343
|
+
/* @__PURE__ */ e(
|
|
344
|
+
T,
|
|
345
|
+
{
|
|
346
|
+
label: "Options (comma-separated)",
|
|
347
|
+
value: Y,
|
|
348
|
+
onChange: ie,
|
|
349
|
+
placeholder: "Yes, No, Maybe"
|
|
350
|
+
}
|
|
351
|
+
),
|
|
352
|
+
/* @__PURE__ */ e(
|
|
353
|
+
B,
|
|
354
|
+
{
|
|
355
|
+
variant: "primary",
|
|
356
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "plus", size: "sm" }),
|
|
357
|
+
onClick: $e,
|
|
358
|
+
disabled: !O.trim(),
|
|
359
|
+
children: "Add survey"
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
] })
|
|
363
|
+
] }), Qe = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
364
|
+
m.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-event-planning__empty", children: "No billing items yet." }) : /* @__PURE__ */ e(
|
|
365
|
+
dn,
|
|
366
|
+
{
|
|
367
|
+
lines: [...De, { label: "Total", amount: Ve, isSummary: !0 }],
|
|
368
|
+
currency: Me
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
h && s && /* @__PURE__ */ i("div", { className: "nice-event-planning__row", children: [
|
|
372
|
+
/* @__PURE__ */ e(
|
|
373
|
+
T,
|
|
374
|
+
{
|
|
375
|
+
label: "Item",
|
|
376
|
+
value: D,
|
|
377
|
+
onChange: te,
|
|
378
|
+
placeholder: "Catering"
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
/* @__PURE__ */ e(
|
|
382
|
+
T,
|
|
383
|
+
{
|
|
384
|
+
label: "Amount",
|
|
385
|
+
value: K,
|
|
386
|
+
onChange: ae,
|
|
387
|
+
placeholder: "0.00"
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ e(
|
|
391
|
+
he,
|
|
392
|
+
{
|
|
393
|
+
label: "Currency",
|
|
394
|
+
value: J,
|
|
395
|
+
onChange: (l) => Ie(l),
|
|
396
|
+
options: ["PLN", "EUR", "USD", "GBP"]
|
|
397
|
+
}
|
|
398
|
+
),
|
|
399
|
+
/* @__PURE__ */ e(
|
|
400
|
+
B,
|
|
401
|
+
{
|
|
402
|
+
variant: "primary",
|
|
403
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "plus", size: "sm" }),
|
|
404
|
+
onClick: Oe,
|
|
405
|
+
disabled: !D.trim(),
|
|
406
|
+
children: "Add"
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] })
|
|
410
|
+
] }), je = /* @__PURE__ */ i("div", { className: "nice-event-planning__form", children: [
|
|
411
|
+
/* @__PURE__ */ e(ve, { label: "Public event", checked: t.isPublic ?? !1, disabled: !h }),
|
|
412
|
+
/* @__PURE__ */ e(
|
|
413
|
+
T,
|
|
414
|
+
{
|
|
415
|
+
label: "Max participants",
|
|
416
|
+
value: t.maxParticipants != null ? String(t.maxParticipants) : "",
|
|
417
|
+
onChange: () => {
|
|
418
|
+
},
|
|
419
|
+
readOnly: !h
|
|
420
|
+
}
|
|
421
|
+
),
|
|
422
|
+
/* @__PURE__ */ i("div", { className: "nice-event-planning__muted", children: [
|
|
423
|
+
"Host: ",
|
|
424
|
+
t.hostName,
|
|
425
|
+
" · Created ",
|
|
426
|
+
new Date(t.createdAt).toLocaleDateString()
|
|
427
|
+
] })
|
|
428
|
+
] }), Ge = {
|
|
429
|
+
details: Ue,
|
|
430
|
+
location: We,
|
|
431
|
+
participants: qe,
|
|
432
|
+
surveys: Fe,
|
|
433
|
+
budget: Qe,
|
|
434
|
+
settings: je
|
|
435
|
+
}, He = {
|
|
436
|
+
details: "file",
|
|
437
|
+
location: "home",
|
|
438
|
+
participants: "users",
|
|
439
|
+
surveys: "clipboard",
|
|
440
|
+
budget: "file",
|
|
441
|
+
settings: "settings"
|
|
442
|
+
}, Ye = {
|
|
443
|
+
participants: p.length || void 0,
|
|
444
|
+
surveys: u.length || void 0,
|
|
445
|
+
budget: m.length || void 0
|
|
446
|
+
}, Ke = le.map((l) => ({
|
|
447
|
+
id: l,
|
|
448
|
+
label: l.charAt(0).toUpperCase() + l.slice(1),
|
|
449
|
+
icon: /* @__PURE__ */ e(L, { name: He[l], size: "sm" }),
|
|
450
|
+
badge: Ye[l],
|
|
451
|
+
content: Ge[l]
|
|
452
|
+
})), Je = /* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar", children: [
|
|
453
|
+
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-title", children: [
|
|
454
|
+
/* @__PURE__ */ e(L, { name: "calendar", size: "md" }),
|
|
455
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
456
|
+
/* @__PURE__ */ e(U, { size: "sm", variant: Z(t.status), children: t.status })
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__toolbar-spacer" }),
|
|
459
|
+
/* @__PURE__ */ i("div", { className: "nice-event-planning__toolbar-actions", children: [
|
|
460
|
+
N && /* @__PURE__ */ e(
|
|
461
|
+
B,
|
|
462
|
+
{
|
|
463
|
+
size: "sm",
|
|
464
|
+
variant: "primary",
|
|
465
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "check", size: "sm" }),
|
|
466
|
+
onClick: () => N({ title: r, description: P }),
|
|
467
|
+
children: "Save"
|
|
468
|
+
}
|
|
469
|
+
),
|
|
470
|
+
c && /* @__PURE__ */ e(
|
|
471
|
+
B,
|
|
472
|
+
{
|
|
473
|
+
size: "sm",
|
|
474
|
+
variant: "success",
|
|
475
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "upload", size: "sm" }),
|
|
476
|
+
onClick: c,
|
|
477
|
+
children: "Publish"
|
|
478
|
+
}
|
|
479
|
+
),
|
|
480
|
+
o && /* @__PURE__ */ e(
|
|
481
|
+
B,
|
|
482
|
+
{
|
|
483
|
+
size: "sm",
|
|
484
|
+
variant: "ghost",
|
|
485
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "link", size: "sm" }),
|
|
486
|
+
onClick: o,
|
|
487
|
+
children: "Share"
|
|
488
|
+
}
|
|
489
|
+
),
|
|
490
|
+
C && /* @__PURE__ */ e(
|
|
491
|
+
B,
|
|
492
|
+
{
|
|
493
|
+
size: "sm",
|
|
494
|
+
variant: "ghost",
|
|
495
|
+
leftIcon: /* @__PURE__ */ e(L, { name: "download", size: "sm" }),
|
|
496
|
+
onClick: C,
|
|
497
|
+
children: "Export"
|
|
498
|
+
}
|
|
499
|
+
)
|
|
632
500
|
] })
|
|
633
501
|
] });
|
|
502
|
+
return v === "micro" ? /* @__PURE__ */ e(
|
|
503
|
+
"div",
|
|
504
|
+
{
|
|
505
|
+
ref: x,
|
|
506
|
+
className: `nice-event-planning nice-event-planning--micro ${a ?? ""}`,
|
|
507
|
+
style: z,
|
|
508
|
+
children: /* @__PURE__ */ i("div", { className: "nice-event-planning__micro", children: [
|
|
509
|
+
/* @__PURE__ */ e(L, { name: "calendar", size: "md" }),
|
|
510
|
+
/* @__PURE__ */ i("div", { className: "nice-event-planning__micro-body", children: [
|
|
511
|
+
/* @__PURE__ */ e("span", { className: "nice-event-planning__title", children: t.title }),
|
|
512
|
+
/* @__PURE__ */ i("span", { className: "nice-event-planning__muted", children: [
|
|
513
|
+
t.startDate ? new Date(t.startDate).toLocaleString() : "No date",
|
|
514
|
+
(me = t.location) != null && me.name ? ` · ${t.location.name}` : ""
|
|
515
|
+
] })
|
|
516
|
+
] }),
|
|
517
|
+
/* @__PURE__ */ e(U, { size: "sm", variant: Z(t.status), children: t.status }),
|
|
518
|
+
p.length > 0 && /* @__PURE__ */ e(ue, { max: 4, size: "sm", children: p.map((l) => /* @__PURE__ */ e(X, { name: l.name, src: l.avatarUrl, size: "sm" }, l.id)) })
|
|
519
|
+
] })
|
|
520
|
+
}
|
|
521
|
+
) : /* @__PURE__ */ i(
|
|
522
|
+
"div",
|
|
523
|
+
{
|
|
524
|
+
ref: x,
|
|
525
|
+
className: `nice-event-planning nice-event-planning--${v} ${a ?? ""}`,
|
|
526
|
+
style: z,
|
|
527
|
+
children: [
|
|
528
|
+
Je,
|
|
529
|
+
/* @__PURE__ */ e(mn, { tabs: Ke, activeTab: Pe, onChange: Re })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
);
|
|
634
533
|
}
|
|
635
|
-
),
|
|
534
|
+
), vn = {
|
|
636
535
|
upcoming: "⏳",
|
|
637
536
|
active: "▶️",
|
|
638
537
|
voting: "🗳️",
|
|
639
538
|
scored: "📊",
|
|
640
539
|
completed: "✅",
|
|
641
540
|
skipped: "⏭️"
|
|
642
|
-
},
|
|
541
|
+
}, gn = {
|
|
643
542
|
upcoming: "#9ca3af",
|
|
644
543
|
active: "#22c55e",
|
|
645
544
|
voting: "#eab308",
|
|
646
545
|
scored: "#3b82f6",
|
|
647
546
|
completed: "#6b7280",
|
|
648
547
|
skipped: "#d1d5db"
|
|
649
|
-
},
|
|
650
|
-
function(
|
|
548
|
+
}, wn = E(
|
|
549
|
+
function(b, x) {
|
|
651
550
|
const {
|
|
652
|
-
rounds:
|
|
653
|
-
activeRoundId:
|
|
654
|
-
onSelect:
|
|
655
|
-
onStart:
|
|
656
|
-
onEnd:
|
|
657
|
-
onCreate:
|
|
658
|
-
editable:
|
|
659
|
-
className:
|
|
660
|
-
style:
|
|
661
|
-
} =
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
551
|
+
rounds: t,
|
|
552
|
+
activeRoundId: p,
|
|
553
|
+
onSelect: u,
|
|
554
|
+
onStart: m,
|
|
555
|
+
onEnd: v,
|
|
556
|
+
onCreate: y,
|
|
557
|
+
editable: k = !1,
|
|
558
|
+
className: f,
|
|
559
|
+
style: h
|
|
560
|
+
} = b, N = [...t].sort((c, o) => c.order - o.order);
|
|
561
|
+
return /* @__PURE__ */ i("div", { ref: x, className: `nice-round-list ${f ?? ""}`, style: h, children: [
|
|
562
|
+
/* @__PURE__ */ i("div", { className: "nice-round-list__header", children: [
|
|
563
|
+
/* @__PURE__ */ i("h3", { children: [
|
|
665
564
|
"Rounds (",
|
|
666
|
-
|
|
565
|
+
t.length,
|
|
667
566
|
")"
|
|
668
567
|
] }),
|
|
669
|
-
|
|
568
|
+
k && y && /* @__PURE__ */ e("button", { onClick: y, children: "+ Add Round" })
|
|
670
569
|
] }),
|
|
671
|
-
|
|
672
|
-
const
|
|
673
|
-
return /* @__PURE__ */
|
|
570
|
+
N.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-round-list__empty", children: "No rounds yet." }) : /* @__PURE__ */ e("div", { className: "nice-round-list__items", children: N.map((c) => {
|
|
571
|
+
const o = c.id === p;
|
|
572
|
+
return /* @__PURE__ */ i(
|
|
674
573
|
"div",
|
|
675
574
|
{
|
|
676
|
-
className: `nice-round-list__item ${
|
|
677
|
-
onClick: () =>
|
|
678
|
-
role:
|
|
679
|
-
tabIndex:
|
|
575
|
+
className: `nice-round-list__item ${o ? "nice-round-list__item--active" : ""}`,
|
|
576
|
+
onClick: () => u == null ? void 0 : u(c),
|
|
577
|
+
role: u ? "button" : void 0,
|
|
578
|
+
tabIndex: u ? 0 : void 0,
|
|
680
579
|
children: [
|
|
681
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ i("span", { className: "nice-round-list__order", children: [
|
|
682
581
|
"#",
|
|
683
|
-
|
|
582
|
+
c.order
|
|
684
583
|
] }),
|
|
685
|
-
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children:
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children:
|
|
688
|
-
|
|
689
|
-
|
|
584
|
+
/* @__PURE__ */ e("span", { className: "nice-round-list__icon", children: vn[c.status] }),
|
|
585
|
+
/* @__PURE__ */ i("div", { className: "nice-round-list__info", children: [
|
|
586
|
+
/* @__PURE__ */ e("strong", { className: "nice-round-list__name", children: c.name }),
|
|
587
|
+
c.description && /* @__PURE__ */ e("small", { children: c.description }),
|
|
588
|
+
c.type && /* @__PURE__ */ e("span", { className: "nice-round-list__type", children: c.type })
|
|
690
589
|
] }),
|
|
691
590
|
/* @__PURE__ */ e(
|
|
692
591
|
"span",
|
|
693
592
|
{
|
|
694
593
|
className: "nice-round-list__status",
|
|
695
|
-
style: { color:
|
|
696
|
-
children:
|
|
594
|
+
style: { color: gn[c.status] },
|
|
595
|
+
children: c.status
|
|
697
596
|
}
|
|
698
597
|
),
|
|
699
|
-
|
|
700
|
-
|
|
598
|
+
c.durationMinutes && /* @__PURE__ */ i("span", { className: "nice-round-list__duration", children: [
|
|
599
|
+
c.durationMinutes,
|
|
701
600
|
"m"
|
|
702
601
|
] }),
|
|
703
|
-
|
|
602
|
+
c.winnerIds && c.winnerIds.length > 0 && /* @__PURE__ */ i("span", { className: "nice-round-list__winners", children: [
|
|
704
603
|
"🏆 ",
|
|
705
|
-
|
|
604
|
+
c.winnerIds.length
|
|
706
605
|
] }),
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
(
|
|
606
|
+
k && /* @__PURE__ */ i("div", { className: "nice-round-list__actions", onClick: (C) => C.stopPropagation(), children: [
|
|
607
|
+
c.status === "upcoming" && m && /* @__PURE__ */ e("button", { onClick: () => m(c.id), children: "Start" }),
|
|
608
|
+
(c.status === "active" || c.status === "voting") && v && /* @__PURE__ */ e("button", { onClick: () => v(c.id), children: "End" })
|
|
710
609
|
] })
|
|
711
610
|
]
|
|
712
611
|
},
|
|
713
|
-
|
|
612
|
+
c.id
|
|
714
613
|
);
|
|
715
614
|
}) })
|
|
716
615
|
] });
|
|
717
616
|
}
|
|
718
|
-
),
|
|
719
|
-
function(
|
|
617
|
+
), zn = E(
|
|
618
|
+
function(b, x) {
|
|
720
619
|
const {
|
|
721
|
-
round:
|
|
722
|
-
timerRunning:
|
|
723
|
-
remainingSeconds:
|
|
724
|
-
onSubmitScore:
|
|
725
|
-
onStart:
|
|
726
|
-
onEnd:
|
|
727
|
-
onSkip:
|
|
728
|
-
editable:
|
|
729
|
-
footerActions:
|
|
730
|
-
className:
|
|
731
|
-
style:
|
|
732
|
-
} =
|
|
620
|
+
round: t,
|
|
621
|
+
timerRunning: p = !1,
|
|
622
|
+
remainingSeconds: u,
|
|
623
|
+
onSubmitScore: m,
|
|
624
|
+
onStart: v,
|
|
625
|
+
onEnd: y,
|
|
626
|
+
onSkip: k,
|
|
627
|
+
editable: f = !1,
|
|
628
|
+
footerActions: h,
|
|
629
|
+
className: N,
|
|
630
|
+
style: c
|
|
631
|
+
} = b, [o, C] = _({}), g = $(
|
|
733
632
|
(n) => {
|
|
734
|
-
const
|
|
735
|
-
isNaN(
|
|
633
|
+
const s = parseFloat(o[n] ?? "");
|
|
634
|
+
isNaN(s) || !m || (m(n, s), C((a) => ({ ...a, [n]: "" })));
|
|
736
635
|
},
|
|
737
|
-
[
|
|
738
|
-
),
|
|
739
|
-
const
|
|
740
|
-
return `${
|
|
741
|
-
},
|
|
742
|
-
return /* @__PURE__ */
|
|
636
|
+
[o, m]
|
|
637
|
+
), S = (n) => {
|
|
638
|
+
const s = Math.floor(n / 60), a = n % 60;
|
|
639
|
+
return `${s}:${a.toString().padStart(2, "0")}`;
|
|
640
|
+
}, d = t.scores ? [...t.scores].sort((n, s) => s.score - n.score) : [];
|
|
641
|
+
return /* @__PURE__ */ i(
|
|
743
642
|
"div",
|
|
744
643
|
{
|
|
745
|
-
ref:
|
|
746
|
-
className: `nice-round-card nice-round-card--${
|
|
747
|
-
style:
|
|
644
|
+
ref: x,
|
|
645
|
+
className: `nice-round-card nice-round-card--${t.status} ${N ?? ""}`,
|
|
646
|
+
style: c,
|
|
748
647
|
children: [
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ i("div", { className: "nice-round-card__header", children: [
|
|
649
|
+
/* @__PURE__ */ i("span", { className: "nice-round-card__order", children: [
|
|
751
650
|
"Round #",
|
|
752
|
-
|
|
651
|
+
t.order
|
|
753
652
|
] }),
|
|
754
|
-
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children:
|
|
755
|
-
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children:
|
|
653
|
+
/* @__PURE__ */ e("h3", { className: "nice-round-card__name", children: t.name }),
|
|
654
|
+
/* @__PURE__ */ e("span", { className: "nice-round-card__status", children: t.status })
|
|
756
655
|
] }),
|
|
757
|
-
|
|
758
|
-
(
|
|
656
|
+
t.description && /* @__PURE__ */ e("p", { className: "nice-round-card__description", children: t.description }),
|
|
657
|
+
(p || u != null) && /* @__PURE__ */ i(
|
|
759
658
|
"div",
|
|
760
659
|
{
|
|
761
|
-
className: `nice-round-card__timer ${
|
|
660
|
+
className: `nice-round-card__timer ${p ? "nice-round-card__timer--running" : ""}`,
|
|
762
661
|
children: [
|
|
763
662
|
"⏱️ ",
|
|
764
|
-
|
|
663
|
+
u != null ? S(u) : "—"
|
|
765
664
|
]
|
|
766
665
|
}
|
|
767
666
|
),
|
|
768
|
-
|
|
667
|
+
d.length > 0 && /* @__PURE__ */ i("div", { className: "nice-round-card__scoreboard", children: [
|
|
769
668
|
/* @__PURE__ */ e("h4", { children: "Scoreboard" }),
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ i("table", { className: "nice-round-card__scores-table", children: [
|
|
670
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ i("tr", { children: [
|
|
772
671
|
/* @__PURE__ */ e("th", { children: "Rank" }),
|
|
773
672
|
/* @__PURE__ */ e("th", { children: "Participant" }),
|
|
774
673
|
/* @__PURE__ */ e("th", { children: "Score" })
|
|
775
674
|
] }) }),
|
|
776
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
675
|
+
/* @__PURE__ */ e("tbody", { children: d.map((n, s) => /* @__PURE__ */ i(
|
|
777
676
|
"tr",
|
|
778
677
|
{
|
|
779
|
-
className:
|
|
678
|
+
className: s < 3 ? `nice-round-card__top-${s + 1}` : "",
|
|
780
679
|
children: [
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
n.rank ??
|
|
783
|
-
|
|
680
|
+
/* @__PURE__ */ i("td", { children: [
|
|
681
|
+
n.rank ?? s + 1,
|
|
682
|
+
s === 0 ? " 🥇" : s === 1 ? " 🥈" : s === 2 ? " 🥉" : ""
|
|
784
683
|
] }),
|
|
785
684
|
/* @__PURE__ */ e("td", { children: n.participantName }),
|
|
786
685
|
/* @__PURE__ */ e("td", { children: n.score })
|
|
@@ -790,123 +689,123 @@ const be = P(
|
|
|
790
689
|
)) })
|
|
791
690
|
] })
|
|
792
691
|
] }),
|
|
793
|
-
|
|
692
|
+
m && (t.status === "active" || t.status === "voting") && d.length > 0 && /* @__PURE__ */ i("div", { className: "nice-round-card__score-input", children: [
|
|
794
693
|
/* @__PURE__ */ e("h4", { children: "Submit Scores" }),
|
|
795
|
-
|
|
694
|
+
d.map((n) => /* @__PURE__ */ i("div", { className: "nice-round-card__score-row", children: [
|
|
796
695
|
/* @__PURE__ */ e("span", { children: n.participantName }),
|
|
797
696
|
/* @__PURE__ */ e(
|
|
798
697
|
"input",
|
|
799
698
|
{
|
|
800
699
|
type: "number",
|
|
801
|
-
value:
|
|
802
|
-
onChange: (
|
|
700
|
+
value: o[n.participantId] ?? "",
|
|
701
|
+
onChange: (s) => C((a) => ({ ...a, [n.participantId]: s.target.value })),
|
|
803
702
|
min: 0,
|
|
804
703
|
step: 1,
|
|
805
704
|
placeholder: "Score"
|
|
806
705
|
}
|
|
807
706
|
),
|
|
808
|
-
/* @__PURE__ */ e("button", { onClick: () =>
|
|
707
|
+
/* @__PURE__ */ e("button", { onClick: () => g(n.participantId), children: "Submit" })
|
|
809
708
|
] }, n.participantId))
|
|
810
709
|
] }),
|
|
811
|
-
/* @__PURE__ */
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
(
|
|
815
|
-
|
|
710
|
+
/* @__PURE__ */ i("div", { className: "nice-round-card__footer", children: [
|
|
711
|
+
f && /* @__PURE__ */ i("div", { className: "nice-round-card__actions", children: [
|
|
712
|
+
t.status === "upcoming" && v && /* @__PURE__ */ e("button", { onClick: v, children: "▶ Start Round" }),
|
|
713
|
+
(t.status === "active" || t.status === "voting") && y && /* @__PURE__ */ e("button", { onClick: y, children: "⏹ End Round" }),
|
|
714
|
+
t.status === "upcoming" && k && /* @__PURE__ */ e("button", { onClick: k, children: "⏭ Skip" })
|
|
816
715
|
] }),
|
|
817
|
-
|
|
716
|
+
h
|
|
818
717
|
] }),
|
|
819
|
-
|
|
718
|
+
t.winnerIds && t.winnerIds.length > 0 && /* @__PURE__ */ i("div", { className: "nice-round-card__winners", children: [
|
|
820
719
|
"🏆 Winners: ",
|
|
821
|
-
|
|
720
|
+
t.winnerIds.length
|
|
822
721
|
] })
|
|
823
722
|
]
|
|
824
723
|
}
|
|
825
724
|
);
|
|
826
725
|
}
|
|
827
|
-
),
|
|
828
|
-
function(
|
|
726
|
+
), An = E(
|
|
727
|
+
function(b, x) {
|
|
829
728
|
const {
|
|
830
|
-
songs:
|
|
831
|
-
onAdd:
|
|
832
|
-
onRemove:
|
|
833
|
-
onVote:
|
|
834
|
-
onSearch:
|
|
835
|
-
showQueue:
|
|
836
|
-
readOnly:
|
|
837
|
-
className:
|
|
838
|
-
style:
|
|
839
|
-
} =
|
|
840
|
-
if (!
|
|
841
|
-
return
|
|
842
|
-
const n =
|
|
843
|
-
return
|
|
844
|
-
(
|
|
729
|
+
songs: t,
|
|
730
|
+
onAdd: p,
|
|
731
|
+
onRemove: u,
|
|
732
|
+
onVote: m,
|
|
733
|
+
onSearch: v,
|
|
734
|
+
showQueue: y = !0,
|
|
735
|
+
readOnly: k = !1,
|
|
736
|
+
className: f,
|
|
737
|
+
style: h
|
|
738
|
+
} = b, [N, c] = _(""), o = I(() => {
|
|
739
|
+
if (!N.trim())
|
|
740
|
+
return t;
|
|
741
|
+
const n = N.toLowerCase();
|
|
742
|
+
return t.filter(
|
|
743
|
+
(s) => s.title.toLowerCase().includes(n) || s.artist.toLowerCase().includes(n)
|
|
845
744
|
);
|
|
846
|
-
}, [
|
|
847
|
-
|
|
848
|
-
},
|
|
745
|
+
}, [t, N]), C = I(() => t.filter((n) => n.isQueued), [t]), g = t.find((n) => n.isPlaying), S = (n) => {
|
|
746
|
+
c(n), v == null || v(n);
|
|
747
|
+
}, d = (n) => {
|
|
849
748
|
if (!n)
|
|
850
749
|
return "";
|
|
851
|
-
const
|
|
852
|
-
return `${
|
|
750
|
+
const s = Math.floor(n / 60), a = n % 60;
|
|
751
|
+
return `${s}:${a.toString().padStart(2, "0")}`;
|
|
853
752
|
};
|
|
854
|
-
return /* @__PURE__ */
|
|
855
|
-
|
|
753
|
+
return /* @__PURE__ */ i("div", { ref: x, className: `nice-song-picker ${f ?? ""}`, style: h, children: [
|
|
754
|
+
g && /* @__PURE__ */ i("div", { className: "nice-song-picker__now-playing", children: [
|
|
856
755
|
/* @__PURE__ */ e("span", { className: "nice-song-picker__np-label", children: "🎵 Now Playing" }),
|
|
857
|
-
|
|
858
|
-
/* @__PURE__ */ e("strong", { children:
|
|
859
|
-
/* @__PURE__ */ e("span", { children:
|
|
756
|
+
g.albumArt && /* @__PURE__ */ e("img", { src: g.albumArt, alt: "", className: "nice-song-picker__album-art" }),
|
|
757
|
+
/* @__PURE__ */ e("strong", { children: g.title }),
|
|
758
|
+
/* @__PURE__ */ e("span", { children: g.artist })
|
|
860
759
|
] }),
|
|
861
760
|
/* @__PURE__ */ e(
|
|
862
761
|
"input",
|
|
863
762
|
{
|
|
864
763
|
type: "text",
|
|
865
|
-
value:
|
|
866
|
-
onChange: (n) =>
|
|
764
|
+
value: N,
|
|
765
|
+
onChange: (n) => S(n.target.value),
|
|
867
766
|
placeholder: "Search songs…",
|
|
868
767
|
className: "nice-song-picker__search"
|
|
869
768
|
}
|
|
870
769
|
),
|
|
871
|
-
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children:
|
|
770
|
+
/* @__PURE__ */ e("div", { className: "nice-song-picker__list", children: o.length === 0 ? /* @__PURE__ */ e("p", { className: "nice-song-picker__empty", children: "No songs found." }) : o.map((n) => /* @__PURE__ */ i(
|
|
872
771
|
"div",
|
|
873
772
|
{
|
|
874
773
|
className: `nice-song-picker__item ${n.isPlaying ? "nice-song-picker__item--playing" : ""}`,
|
|
875
774
|
children: [
|
|
876
775
|
n.albumArt && /* @__PURE__ */ e("img", { src: n.albumArt, alt: "", className: "nice-song-picker__thumb" }),
|
|
877
|
-
/* @__PURE__ */
|
|
776
|
+
/* @__PURE__ */ i("div", { className: "nice-song-picker__info", children: [
|
|
878
777
|
/* @__PURE__ */ e("strong", { children: n.title }),
|
|
879
778
|
/* @__PURE__ */ e("span", { children: n.artist }),
|
|
880
|
-
n.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children:
|
|
881
|
-
n.addedByName && /* @__PURE__ */
|
|
779
|
+
n.duration && /* @__PURE__ */ e("span", { className: "nice-song-picker__duration", children: d(n.duration) }),
|
|
780
|
+
n.addedByName && /* @__PURE__ */ i("small", { children: [
|
|
882
781
|
"Added by ",
|
|
883
782
|
n.addedByName
|
|
884
783
|
] })
|
|
885
784
|
] }),
|
|
886
|
-
!
|
|
887
|
-
|
|
785
|
+
!k && /* @__PURE__ */ i("div", { className: "nice-song-picker__actions", children: [
|
|
786
|
+
m && /* @__PURE__ */ i("button", { onClick: () => m(n.id), children: [
|
|
888
787
|
"👍 ",
|
|
889
788
|
n.votes ?? 0
|
|
890
789
|
] }),
|
|
891
|
-
|
|
892
|
-
|
|
790
|
+
p && !n.isQueued && /* @__PURE__ */ e("button", { onClick: () => p(n.id), children: "+ Queue" }),
|
|
791
|
+
u && n.isQueued && /* @__PURE__ */ e("button", { onClick: () => u(n.id), children: "Remove" })
|
|
893
792
|
] })
|
|
894
793
|
]
|
|
895
794
|
},
|
|
896
795
|
n.id
|
|
897
796
|
)) }),
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */
|
|
797
|
+
y && C.length > 0 && /* @__PURE__ */ i("div", { className: "nice-song-picker__queue", children: [
|
|
798
|
+
/* @__PURE__ */ i("h4", { children: [
|
|
900
799
|
"Queue (",
|
|
901
|
-
|
|
800
|
+
C.length,
|
|
902
801
|
")"
|
|
903
802
|
] }),
|
|
904
|
-
|
|
905
|
-
/* @__PURE__ */
|
|
906
|
-
|
|
803
|
+
C.map((n, s) => /* @__PURE__ */ i("div", { className: "nice-song-picker__queue-item", children: [
|
|
804
|
+
/* @__PURE__ */ i("span", { className: "nice-song-picker__queue-pos", children: [
|
|
805
|
+
s + 1,
|
|
907
806
|
"."
|
|
908
807
|
] }),
|
|
909
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ i("span", { children: [
|
|
910
809
|
n.title,
|
|
911
810
|
" — ",
|
|
912
811
|
n.artist
|
|
@@ -915,29 +814,29 @@ const be = P(
|
|
|
915
814
|
] })
|
|
916
815
|
] });
|
|
917
816
|
}
|
|
918
|
-
),
|
|
919
|
-
function(
|
|
817
|
+
), In = E(
|
|
818
|
+
function(b, x) {
|
|
920
819
|
const {
|
|
921
|
-
songs:
|
|
922
|
-
queue:
|
|
923
|
-
onEnqueue:
|
|
924
|
-
onDequeue:
|
|
925
|
-
onNext:
|
|
926
|
-
nowPlayingId:
|
|
927
|
-
readOnly:
|
|
928
|
-
className:
|
|
929
|
-
style:
|
|
930
|
-
} =
|
|
931
|
-
let
|
|
932
|
-
if (
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
(
|
|
820
|
+
songs: t,
|
|
821
|
+
queue: p = [],
|
|
822
|
+
onEnqueue: u,
|
|
823
|
+
onDequeue: m,
|
|
824
|
+
onNext: v,
|
|
825
|
+
nowPlayingId: y,
|
|
826
|
+
readOnly: k = !1,
|
|
827
|
+
className: f,
|
|
828
|
+
style: h
|
|
829
|
+
} = b, [N, c] = _(""), [o, C] = _(""), g = t.find((a) => a.id === y), S = I(() => {
|
|
830
|
+
let a = t;
|
|
831
|
+
if (N.trim()) {
|
|
832
|
+
const z = N.toLowerCase();
|
|
833
|
+
a = a.filter(
|
|
834
|
+
(r) => r.title.toLowerCase().includes(z) || r.artist.toLowerCase().includes(z)
|
|
936
835
|
);
|
|
937
836
|
}
|
|
938
|
-
return
|
|
939
|
-
}, [
|
|
940
|
-
switch (
|
|
837
|
+
return o && (a = a.filter((z) => z.difficulty === o)), a;
|
|
838
|
+
}, [t, N, o]), d = I(() => new Set(p.map((a) => a.id)), [p]), n = ["easy", "medium", "hard", "expert"], s = (a) => {
|
|
839
|
+
switch (a) {
|
|
941
840
|
case "easy":
|
|
942
841
|
return "#4caf50";
|
|
943
842
|
case "medium":
|
|
@@ -950,8 +849,8 @@ const be = P(
|
|
|
950
849
|
return "#999";
|
|
951
850
|
}
|
|
952
851
|
};
|
|
953
|
-
return /* @__PURE__ */
|
|
954
|
-
|
|
852
|
+
return /* @__PURE__ */ i("div", { ref: x, className: `nice-karaoke-picker ${f ?? ""}`, style: h, children: [
|
|
853
|
+
g && /* @__PURE__ */ i(
|
|
955
854
|
"div",
|
|
956
855
|
{
|
|
957
856
|
className: "nice-karaoke-picker__now-singing",
|
|
@@ -963,21 +862,21 @@ const be = P(
|
|
|
963
862
|
},
|
|
964
863
|
children: [
|
|
965
864
|
/* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: "🎤 Now Singing" }),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */ e("strong", { children:
|
|
865
|
+
/* @__PURE__ */ i("div", { children: [
|
|
866
|
+
/* @__PURE__ */ e("strong", { children: g.title }),
|
|
968
867
|
" — ",
|
|
969
|
-
|
|
970
|
-
|
|
868
|
+
g.artist,
|
|
869
|
+
g.performerName && /* @__PURE__ */ i("span", { children: [
|
|
971
870
|
" (by ",
|
|
972
|
-
|
|
871
|
+
g.performerName,
|
|
973
872
|
")"
|
|
974
873
|
] })
|
|
975
874
|
] }),
|
|
976
|
-
!
|
|
875
|
+
!k && v && /* @__PURE__ */ e("button", { onClick: v, style: { marginTop: 8 }, children: "Skip / Next ⏭" })
|
|
977
876
|
]
|
|
978
877
|
}
|
|
979
878
|
),
|
|
980
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ i(
|
|
981
880
|
"div",
|
|
982
881
|
{
|
|
983
882
|
className: "nice-karaoke-picker__filters",
|
|
@@ -987,20 +886,20 @@ const be = P(
|
|
|
987
886
|
"input",
|
|
988
887
|
{
|
|
989
888
|
type: "text",
|
|
990
|
-
value:
|
|
991
|
-
onChange: (
|
|
889
|
+
value: N,
|
|
890
|
+
onChange: (a) => c(a.target.value),
|
|
992
891
|
placeholder: "Search songs or artists…",
|
|
993
892
|
style: { flex: 1 }
|
|
994
893
|
}
|
|
995
894
|
),
|
|
996
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ i("select", { value: o, onChange: (a) => C(a.target.value), children: [
|
|
997
896
|
/* @__PURE__ */ e("option", { value: "", children: "All Difficulties" }),
|
|
998
|
-
n.map((
|
|
897
|
+
n.map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
|
|
999
898
|
] })
|
|
1000
899
|
]
|
|
1001
900
|
}
|
|
1002
901
|
),
|
|
1003
|
-
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children:
|
|
902
|
+
/* @__PURE__ */ e("div", { className: "nice-karaoke-picker__catalog", children: S.length === 0 ? /* @__PURE__ */ e("p", { children: "No songs match your search." }) : S.map((a) => /* @__PURE__ */ i(
|
|
1004
903
|
"div",
|
|
1005
904
|
{
|
|
1006
905
|
className: "nice-karaoke-picker__song",
|
|
@@ -1012,81 +911,81 @@ const be = P(
|
|
|
1012
911
|
borderBottom: "1px solid #eee"
|
|
1013
912
|
},
|
|
1014
913
|
children: [
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */ e("strong", { children:
|
|
914
|
+
/* @__PURE__ */ i("div", { children: [
|
|
915
|
+
/* @__PURE__ */ e("strong", { children: a.title }),
|
|
1017
916
|
" — ",
|
|
1018
|
-
|
|
1019
|
-
|
|
917
|
+
a.artist,
|
|
918
|
+
a.difficulty && /* @__PURE__ */ i(
|
|
1020
919
|
"span",
|
|
1021
920
|
{
|
|
1022
921
|
style: {
|
|
1023
922
|
marginLeft: 8,
|
|
1024
923
|
fontSize: 12,
|
|
1025
|
-
color:
|
|
924
|
+
color: s(a.difficulty),
|
|
1026
925
|
fontWeight: 600
|
|
1027
926
|
},
|
|
1028
927
|
children: [
|
|
1029
928
|
"[",
|
|
1030
|
-
|
|
929
|
+
a.difficulty,
|
|
1031
930
|
"]"
|
|
1032
931
|
]
|
|
1033
932
|
}
|
|
1034
933
|
),
|
|
1035
|
-
|
|
1036
|
-
|
|
934
|
+
a.hasLyrics && /* @__PURE__ */ e("span", { style: { marginLeft: 6, fontSize: 12 }, title: "Lyrics available", children: "📝" }),
|
|
935
|
+
a.language && /* @__PURE__ */ i("span", { style: { marginLeft: 6, fontSize: 12, color: "#666" }, children: [
|
|
1037
936
|
"(",
|
|
1038
|
-
|
|
937
|
+
a.language,
|
|
1039
938
|
")"
|
|
1040
939
|
] })
|
|
1041
940
|
] }),
|
|
1042
|
-
!
|
|
941
|
+
!k && /* @__PURE__ */ e("div", { children: d.has(a.id) ? /* @__PURE__ */ e("button", { onClick: () => m == null ? void 0 : m(a.id), style: { color: "#f44336" }, children: "Remove" }) : /* @__PURE__ */ e("button", { onClick: () => u == null ? void 0 : u(a.id), children: "🎤 Sing" }) })
|
|
1043
942
|
]
|
|
1044
943
|
},
|
|
1045
|
-
|
|
944
|
+
a.id
|
|
1046
945
|
)) }),
|
|
1047
|
-
|
|
1048
|
-
/* @__PURE__ */
|
|
946
|
+
p.length > 0 && /* @__PURE__ */ i("div", { className: "nice-karaoke-picker__queue", style: { marginTop: 16 }, children: [
|
|
947
|
+
/* @__PURE__ */ i("h4", { children: [
|
|
1049
948
|
"🎶 Queue (",
|
|
1050
|
-
|
|
949
|
+
p.length,
|
|
1051
950
|
")"
|
|
1052
951
|
] }),
|
|
1053
|
-
|
|
952
|
+
p.map((a, z) => /* @__PURE__ */ i(
|
|
1054
953
|
"div",
|
|
1055
954
|
{
|
|
1056
955
|
style: { display: "flex", justifyContent: "space-between", padding: "4px 0" },
|
|
1057
956
|
children: [
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
957
|
+
/* @__PURE__ */ i("span", { children: [
|
|
958
|
+
/* @__PURE__ */ i("strong", { children: [
|
|
959
|
+
z + 1,
|
|
1061
960
|
"."
|
|
1062
961
|
] }),
|
|
1063
962
|
" ",
|
|
1064
|
-
|
|
963
|
+
a.title,
|
|
1065
964
|
" — ",
|
|
1066
|
-
|
|
1067
|
-
|
|
965
|
+
a.artist,
|
|
966
|
+
a.performerName && /* @__PURE__ */ i("em", { children: [
|
|
1068
967
|
" (",
|
|
1069
|
-
|
|
968
|
+
a.performerName,
|
|
1070
969
|
")"
|
|
1071
970
|
] })
|
|
1072
971
|
] }),
|
|
1073
|
-
!
|
|
972
|
+
!k && m && /* @__PURE__ */ e("button", { onClick: () => m(a.id), style: { fontSize: 12 }, children: "✕" })
|
|
1074
973
|
]
|
|
1075
974
|
},
|
|
1076
|
-
|
|
975
|
+
a.id
|
|
1077
976
|
))
|
|
1078
977
|
] })
|
|
1079
978
|
] });
|
|
1080
979
|
}
|
|
1081
|
-
),
|
|
1082
|
-
game:
|
|
1083
|
-
music:
|
|
1084
|
-
dance:
|
|
1085
|
-
quiz:
|
|
1086
|
-
karaoke:
|
|
1087
|
-
photo:
|
|
1088
|
-
custom:
|
|
1089
|
-
},
|
|
980
|
+
), ge = {
|
|
981
|
+
game: be,
|
|
982
|
+
music: W,
|
|
983
|
+
dance: W,
|
|
984
|
+
quiz: _e,
|
|
985
|
+
karaoke: Ne,
|
|
986
|
+
photo: fe,
|
|
987
|
+
custom: ye
|
|
988
|
+
}, yn = {
|
|
1090
989
|
game: "Games",
|
|
1091
990
|
music: "Music",
|
|
1092
991
|
dance: "Dance",
|
|
@@ -1094,346 +993,410 @@ const be = P(
|
|
|
1094
993
|
karaoke: "Karaoke",
|
|
1095
994
|
photo: "Photo",
|
|
1096
995
|
custom: "Custom"
|
|
1097
|
-
},
|
|
1098
|
-
function(
|
|
996
|
+
}, Ln = E(
|
|
997
|
+
function(b, x) {
|
|
1099
998
|
const {
|
|
1100
|
-
attractions:
|
|
1101
|
-
onSelect:
|
|
1102
|
-
onDeselect:
|
|
1103
|
-
onVote:
|
|
1104
|
-
selectedIds:
|
|
1105
|
-
maxSelections:
|
|
1106
|
-
showVotes:
|
|
1107
|
-
readOnly:
|
|
1108
|
-
layout:
|
|
1109
|
-
className:
|
|
1110
|
-
style:
|
|
1111
|
-
} =
|
|
1112
|
-
const
|
|
1113
|
-
return Array.from(
|
|
1114
|
-
}, [
|
|
1115
|
-
let
|
|
1116
|
-
if (
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
(
|
|
1120
|
-
var
|
|
1121
|
-
return
|
|
999
|
+
attractions: t,
|
|
1000
|
+
onSelect: p,
|
|
1001
|
+
onDeselect: u,
|
|
1002
|
+
onVote: m,
|
|
1003
|
+
selectedIds: v = [],
|
|
1004
|
+
maxSelections: y,
|
|
1005
|
+
showVotes: k = !0,
|
|
1006
|
+
readOnly: f = !1,
|
|
1007
|
+
layout: h = "grid",
|
|
1008
|
+
className: N,
|
|
1009
|
+
style: c
|
|
1010
|
+
} = b, [o, C] = _(""), [g, S] = _(""), d = I(() => new Set(v), [v]), n = I(() => {
|
|
1011
|
+
const r = new Set(t.map((A) => A.category));
|
|
1012
|
+
return Array.from(r);
|
|
1013
|
+
}, [t]), s = I(() => {
|
|
1014
|
+
let r = t;
|
|
1015
|
+
if (o && (r = r.filter((A) => A.category === o)), g.trim()) {
|
|
1016
|
+
const A = g.toLowerCase();
|
|
1017
|
+
r = r.filter(
|
|
1018
|
+
(P) => {
|
|
1019
|
+
var V;
|
|
1020
|
+
return P.name.toLowerCase().includes(A) || ((V = P.description) == null ? void 0 : V.toLowerCase().includes(A));
|
|
1122
1021
|
}
|
|
1123
1022
|
);
|
|
1124
1023
|
}
|
|
1125
|
-
return
|
|
1126
|
-
}, [
|
|
1127
|
-
|
|
1024
|
+
return r;
|
|
1025
|
+
}, [t, o, g]), a = !y || d.size < y, z = (r) => {
|
|
1026
|
+
f || (d.has(r) ? u == null || u(r) : a && (p == null || p(r)));
|
|
1128
1027
|
};
|
|
1129
|
-
return /* @__PURE__ */
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
}
|
|
1160
|
-
),
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1162
|
-
"button",
|
|
1163
|
-
{
|
|
1164
|
-
onClick: () => k(""),
|
|
1165
|
-
style: { fontWeight: u ? 400 : 700 },
|
|
1166
|
-
children: "All"
|
|
1167
|
-
}
|
|
1168
|
-
),
|
|
1169
|
-
n.map((l) => /* @__PURE__ */ t(
|
|
1170
|
-
"button",
|
|
1171
|
-
{
|
|
1172
|
-
onClick: () => k(l === u ? "" : l),
|
|
1173
|
-
style: { fontWeight: l === u ? 700 : 400 },
|
|
1174
|
-
children: [
|
|
1175
|
-
ee[l],
|
|
1176
|
-
" ",
|
|
1177
|
-
_e[l]
|
|
1178
|
-
]
|
|
1179
|
-
},
|
|
1180
|
-
l
|
|
1181
|
-
))
|
|
1182
|
-
] }),
|
|
1183
|
-
/* @__PURE__ */ e(
|
|
1184
|
-
"div",
|
|
1185
|
-
{
|
|
1186
|
-
style: {
|
|
1187
|
-
display: f === "grid" ? "grid" : "flex",
|
|
1188
|
-
gridTemplateColumns: f === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
1189
|
-
gap: 12,
|
|
1190
|
-
flexDirection: f === "list" ? "column" : void 0
|
|
1191
|
-
},
|
|
1192
|
-
children: d.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : d.map((l) => {
|
|
1193
|
-
const o = c.has(l.id);
|
|
1194
|
-
return /* @__PURE__ */ t(
|
|
1195
|
-
"div",
|
|
1028
|
+
return /* @__PURE__ */ i(
|
|
1029
|
+
"div",
|
|
1030
|
+
{
|
|
1031
|
+
ref: x,
|
|
1032
|
+
className: `nice-attraction-picker ${N ?? ""}`,
|
|
1033
|
+
style: { color: "var(--text-primary)", ...c },
|
|
1034
|
+
children: [
|
|
1035
|
+
/* @__PURE__ */ i(
|
|
1036
|
+
"div",
|
|
1037
|
+
{
|
|
1038
|
+
style: {
|
|
1039
|
+
display: "flex",
|
|
1040
|
+
justifyContent: "space-between",
|
|
1041
|
+
alignItems: "center",
|
|
1042
|
+
marginBottom: 12
|
|
1043
|
+
},
|
|
1044
|
+
children: [
|
|
1045
|
+
/* @__PURE__ */ e("h3", { style: { margin: 0 }, children: "Attractions" }),
|
|
1046
|
+
y && /* @__PURE__ */ i("span", { style: { color: "var(--text-secondary, #64748b)", fontSize: 14 }, children: [
|
|
1047
|
+
d.size,
|
|
1048
|
+
"/",
|
|
1049
|
+
y,
|
|
1050
|
+
" selected"
|
|
1051
|
+
] })
|
|
1052
|
+
]
|
|
1053
|
+
}
|
|
1054
|
+
),
|
|
1055
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", gap: 8, marginBottom: 12, flexWrap: "wrap" }, children: [
|
|
1056
|
+
/* @__PURE__ */ e(
|
|
1057
|
+
"input",
|
|
1196
1058
|
{
|
|
1197
|
-
|
|
1059
|
+
type: "text",
|
|
1060
|
+
value: g,
|
|
1061
|
+
onChange: (r) => S(r.target.value),
|
|
1062
|
+
placeholder: "Search attractions…",
|
|
1063
|
+
style: { flex: 1, minWidth: 150 }
|
|
1064
|
+
}
|
|
1065
|
+
),
|
|
1066
|
+
/* @__PURE__ */ e(
|
|
1067
|
+
"button",
|
|
1068
|
+
{
|
|
1069
|
+
onClick: () => C(""),
|
|
1070
|
+
style: { fontWeight: o ? 400 : 700 },
|
|
1071
|
+
children: "All"
|
|
1072
|
+
}
|
|
1073
|
+
),
|
|
1074
|
+
n.map((r) => /* @__PURE__ */ i(
|
|
1075
|
+
"button",
|
|
1076
|
+
{
|
|
1077
|
+
onClick: () => C(r === o ? "" : r),
|
|
1198
1078
|
style: {
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
background: o ? "#e3f2fd" : "#fff",
|
|
1204
|
-
transition: "all 0.2s"
|
|
1079
|
+
fontWeight: r === o ? 700 : 400,
|
|
1080
|
+
display: "inline-flex",
|
|
1081
|
+
alignItems: "center",
|
|
1082
|
+
gap: 4
|
|
1205
1083
|
},
|
|
1206
|
-
onClick: () => h(l.id),
|
|
1207
1084
|
children: [
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
src: l.imageUrl,
|
|
1212
|
-
alt: l.name,
|
|
1213
|
-
style: {
|
|
1214
|
-
width: "100%",
|
|
1215
|
-
borderRadius: 6,
|
|
1216
|
-
marginBottom: 8,
|
|
1217
|
-
objectFit: "cover",
|
|
1218
|
-
maxHeight: 120
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
),
|
|
1222
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1223
|
-
/* @__PURE__ */ e("span", { children: ee[l.category] }),
|
|
1224
|
-
/* @__PURE__ */ e("strong", { children: l.name })
|
|
1225
|
-
] }),
|
|
1226
|
-
l.description && /* @__PURE__ */ e("p", { style: { fontSize: 13, color: "#666", margin: "6px 0" }, children: l.description }),
|
|
1227
|
-
/* @__PURE__ */ t(
|
|
1228
|
-
"div",
|
|
1229
|
-
{
|
|
1230
|
-
style: {
|
|
1231
|
-
display: "flex",
|
|
1232
|
-
justifyContent: "space-between",
|
|
1233
|
-
alignItems: "center",
|
|
1234
|
-
marginTop: 8
|
|
1235
|
-
},
|
|
1236
|
-
children: [
|
|
1237
|
-
S && /* @__PURE__ */ t("span", { style: { fontSize: 13 }, children: [
|
|
1238
|
-
"👍 ",
|
|
1239
|
-
l.votes ?? 0
|
|
1240
|
-
] }),
|
|
1241
|
-
!N && v && /* @__PURE__ */ e(
|
|
1242
|
-
"button",
|
|
1243
|
-
{
|
|
1244
|
-
onClick: (I) => {
|
|
1245
|
-
I.stopPropagation(), v(l.id);
|
|
1246
|
-
},
|
|
1247
|
-
style: { fontSize: 12 },
|
|
1248
|
-
children: "Vote"
|
|
1249
|
-
}
|
|
1250
|
-
)
|
|
1251
|
-
]
|
|
1252
|
-
}
|
|
1253
|
-
)
|
|
1085
|
+
ee.createElement(ge[r], { size: 14 }),
|
|
1086
|
+
" ",
|
|
1087
|
+
yn[r]
|
|
1254
1088
|
]
|
|
1255
1089
|
},
|
|
1256
|
-
|
|
1257
|
-
)
|
|
1258
|
-
})
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1090
|
+
r
|
|
1091
|
+
))
|
|
1092
|
+
] }),
|
|
1093
|
+
/* @__PURE__ */ e(
|
|
1094
|
+
"div",
|
|
1095
|
+
{
|
|
1096
|
+
style: {
|
|
1097
|
+
display: h === "grid" ? "grid" : "flex",
|
|
1098
|
+
gridTemplateColumns: h === "grid" ? "repeat(auto-fill, minmax(200px, 1fr))" : void 0,
|
|
1099
|
+
gap: 12,
|
|
1100
|
+
flexDirection: h === "list" ? "column" : void 0
|
|
1101
|
+
},
|
|
1102
|
+
children: s.length === 0 ? /* @__PURE__ */ e("p", { children: "No attractions found." }) : s.map((r) => {
|
|
1103
|
+
const A = d.has(r.id);
|
|
1104
|
+
return /* @__PURE__ */ i(
|
|
1105
|
+
"div",
|
|
1106
|
+
{
|
|
1107
|
+
className: "nice-attraction-picker__card",
|
|
1108
|
+
style: {
|
|
1109
|
+
border: A ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
1110
|
+
borderRadius: 8,
|
|
1111
|
+
padding: 12,
|
|
1112
|
+
cursor: f ? "default" : "pointer",
|
|
1113
|
+
background: A ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
1114
|
+
transition: "all 0.2s"
|
|
1115
|
+
},
|
|
1116
|
+
onClick: () => z(r.id),
|
|
1117
|
+
children: [
|
|
1118
|
+
r.imageUrl && /* @__PURE__ */ e(
|
|
1119
|
+
"img",
|
|
1120
|
+
{
|
|
1121
|
+
src: r.imageUrl,
|
|
1122
|
+
alt: r.name,
|
|
1123
|
+
style: {
|
|
1124
|
+
width: "100%",
|
|
1125
|
+
borderRadius: 6,
|
|
1126
|
+
marginBottom: 8,
|
|
1127
|
+
objectFit: "cover",
|
|
1128
|
+
maxHeight: 120
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
),
|
|
1132
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
1133
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex" }, children: ee.createElement(ge[r.category], { size: 16 }) }),
|
|
1134
|
+
/* @__PURE__ */ e("strong", { children: r.name })
|
|
1135
|
+
] }),
|
|
1136
|
+
r.description && /* @__PURE__ */ e(
|
|
1137
|
+
"p",
|
|
1138
|
+
{
|
|
1139
|
+
style: {
|
|
1140
|
+
fontSize: 13,
|
|
1141
|
+
color: "var(--text-secondary, #64748b)",
|
|
1142
|
+
margin: "6px 0"
|
|
1143
|
+
},
|
|
1144
|
+
children: r.description
|
|
1145
|
+
}
|
|
1146
|
+
),
|
|
1147
|
+
/* @__PURE__ */ i(
|
|
1148
|
+
"div",
|
|
1149
|
+
{
|
|
1150
|
+
style: {
|
|
1151
|
+
display: "flex",
|
|
1152
|
+
justifyContent: "space-between",
|
|
1153
|
+
alignItems: "center",
|
|
1154
|
+
marginTop: 8
|
|
1155
|
+
},
|
|
1156
|
+
children: [
|
|
1157
|
+
k && /* @__PURE__ */ i(
|
|
1158
|
+
"span",
|
|
1159
|
+
{
|
|
1160
|
+
style: {
|
|
1161
|
+
fontSize: 13,
|
|
1162
|
+
display: "inline-flex",
|
|
1163
|
+
alignItems: "center",
|
|
1164
|
+
gap: 4
|
|
1165
|
+
},
|
|
1166
|
+
children: [
|
|
1167
|
+
/* @__PURE__ */ e(ln, { size: 14 }),
|
|
1168
|
+
" ",
|
|
1169
|
+
r.votes ?? 0
|
|
1170
|
+
]
|
|
1171
|
+
}
|
|
1172
|
+
),
|
|
1173
|
+
!f && m && /* @__PURE__ */ e(
|
|
1174
|
+
"button",
|
|
1175
|
+
{
|
|
1176
|
+
onClick: (P) => {
|
|
1177
|
+
P.stopPropagation(), m(r.id);
|
|
1178
|
+
},
|
|
1179
|
+
style: { fontSize: 12 },
|
|
1180
|
+
children: "Vote"
|
|
1181
|
+
}
|
|
1182
|
+
)
|
|
1183
|
+
]
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1186
|
+
]
|
|
1187
|
+
},
|
|
1188
|
+
r.id
|
|
1189
|
+
);
|
|
1190
|
+
})
|
|
1191
|
+
}
|
|
1192
|
+
)
|
|
1193
|
+
]
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
1262
1196
|
}
|
|
1263
|
-
),
|
|
1264
|
-
game:
|
|
1265
|
-
music:
|
|
1266
|
-
dance:
|
|
1267
|
-
quiz:
|
|
1268
|
-
karaoke:
|
|
1269
|
-
photo:
|
|
1270
|
-
custom:
|
|
1271
|
-
},
|
|
1272
|
-
function(
|
|
1197
|
+
), fn = {
|
|
1198
|
+
game: be,
|
|
1199
|
+
music: W,
|
|
1200
|
+
dance: W,
|
|
1201
|
+
quiz: _e,
|
|
1202
|
+
karaoke: Ne,
|
|
1203
|
+
photo: fe,
|
|
1204
|
+
custom: ye
|
|
1205
|
+
}, Tn = E(
|
|
1206
|
+
function(b, x) {
|
|
1273
1207
|
const {
|
|
1274
|
-
attractions:
|
|
1275
|
-
onVote:
|
|
1276
|
-
onUnvote:
|
|
1277
|
-
votedIds:
|
|
1278
|
-
maxVotes:
|
|
1279
|
-
closed:
|
|
1280
|
-
sortBy:
|
|
1281
|
-
showResults:
|
|
1282
|
-
className:
|
|
1283
|
-
style:
|
|
1284
|
-
} =
|
|
1285
|
-
const n = [...
|
|
1286
|
-
switch (
|
|
1208
|
+
attractions: t,
|
|
1209
|
+
onVote: p,
|
|
1210
|
+
onUnvote: u,
|
|
1211
|
+
votedIds: m = [],
|
|
1212
|
+
maxVotes: v,
|
|
1213
|
+
closed: y = !1,
|
|
1214
|
+
sortBy: k = "votes",
|
|
1215
|
+
showResults: f = !0,
|
|
1216
|
+
className: h,
|
|
1217
|
+
style: N
|
|
1218
|
+
} = b, c = I(() => new Set(m), [m]), o = v ? v - c.size : void 0, C = I(() => {
|
|
1219
|
+
const n = [...t];
|
|
1220
|
+
switch (k) {
|
|
1287
1221
|
case "votes":
|
|
1288
|
-
n.sort((
|
|
1222
|
+
n.sort((s, a) => (a.votes ?? 0) - (s.votes ?? 0));
|
|
1289
1223
|
break;
|
|
1290
1224
|
case "name":
|
|
1291
|
-
n.sort((
|
|
1225
|
+
n.sort((s, a) => s.name.localeCompare(a.name));
|
|
1292
1226
|
break;
|
|
1293
1227
|
case "category":
|
|
1294
|
-
n.sort((
|
|
1228
|
+
n.sort((s, a) => s.category.localeCompare(a.category));
|
|
1295
1229
|
break;
|
|
1296
1230
|
}
|
|
1297
1231
|
return n;
|
|
1298
|
-
}, [
|
|
1299
|
-
() => Math.max(...
|
|
1300
|
-
[
|
|
1301
|
-
),
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1232
|
+
}, [t, k]), g = I(
|
|
1233
|
+
() => Math.max(...t.map((n) => n.votes ?? 0), 1),
|
|
1234
|
+
[t]
|
|
1235
|
+
), S = (n) => {
|
|
1236
|
+
y || (c.has(n) ? u == null || u(n) : (!o || o > 0) && (p == null || p(n)));
|
|
1237
|
+
}, d = (n) => {
|
|
1304
1238
|
switch (n) {
|
|
1305
1239
|
case 0:
|
|
1306
|
-
return "
|
|
1240
|
+
return /* @__PURE__ */ e(cn, { size: 18, primaryColor: "#f59e0b", title: "1st place" });
|
|
1307
1241
|
case 1:
|
|
1308
|
-
return "
|
|
1242
|
+
return /* @__PURE__ */ e(pe, { size: 18, primaryColor: "#94a3b8", title: "2nd place" });
|
|
1309
1243
|
case 2:
|
|
1310
|
-
return "
|
|
1244
|
+
return /* @__PURE__ */ e(pe, { size: 18, primaryColor: "#b45309", title: "3rd place" });
|
|
1311
1245
|
default:
|
|
1312
1246
|
return `${n + 1}.`;
|
|
1313
1247
|
}
|
|
1314
1248
|
};
|
|
1315
|
-
return /* @__PURE__ */
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
const i = s.has(n.id), h = n.votes ?? 0, l = N ? `${Math.round(h / b * 100)}%` : "0%";
|
|
1339
|
-
return /* @__PURE__ */ t(
|
|
1340
|
-
"div",
|
|
1341
|
-
{
|
|
1342
|
-
style: {
|
|
1343
|
-
display: "flex",
|
|
1344
|
-
alignItems: "center",
|
|
1345
|
-
gap: 12,
|
|
1346
|
-
padding: "10px 14px",
|
|
1347
|
-
borderRadius: 8,
|
|
1348
|
-
border: i ? "2px solid #1976d2" : "1px solid #e0e0e0",
|
|
1349
|
-
background: i ? "#e3f2fd" : "#fff",
|
|
1350
|
-
cursor: g ? "default" : "pointer",
|
|
1351
|
-
transition: "all 0.2s"
|
|
1352
|
-
},
|
|
1353
|
-
onClick: () => p(n.id),
|
|
1354
|
-
children: [
|
|
1355
|
-
N && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: c(d) }),
|
|
1356
|
-
/* @__PURE__ */ e("span", { style: { fontSize: 20 }, children: fe[n.category] }),
|
|
1357
|
-
/* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1358
|
-
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: n.name }),
|
|
1359
|
-
n.description && /* @__PURE__ */ e(
|
|
1360
|
-
"div",
|
|
1249
|
+
return /* @__PURE__ */ i(
|
|
1250
|
+
"div",
|
|
1251
|
+
{
|
|
1252
|
+
ref: x,
|
|
1253
|
+
className: `nice-attraction-voting ${h ?? ""}`,
|
|
1254
|
+
style: { color: "var(--text-primary)", ...N },
|
|
1255
|
+
children: [
|
|
1256
|
+
/* @__PURE__ */ i(
|
|
1257
|
+
"div",
|
|
1258
|
+
{
|
|
1259
|
+
style: {
|
|
1260
|
+
display: "flex",
|
|
1261
|
+
justifyContent: "space-between",
|
|
1262
|
+
alignItems: "center",
|
|
1263
|
+
marginBottom: 16
|
|
1264
|
+
},
|
|
1265
|
+
children: [
|
|
1266
|
+
/* @__PURE__ */ i("h3", { style: { margin: 0, display: "inline-flex", alignItems: "center", gap: 8 }, children: [
|
|
1267
|
+
/* @__PURE__ */ e(rn, { size: 20 }),
|
|
1268
|
+
y ? "Voting Results" : "Vote for Attractions"
|
|
1269
|
+
] }),
|
|
1270
|
+
!y && o !== void 0 && /* @__PURE__ */ i(
|
|
1271
|
+
"span",
|
|
1361
1272
|
{
|
|
1362
1273
|
style: {
|
|
1363
|
-
fontSize:
|
|
1364
|
-
color: "#
|
|
1365
|
-
overflow: "hidden",
|
|
1366
|
-
textOverflow: "ellipsis",
|
|
1367
|
-
whiteSpace: "nowrap"
|
|
1274
|
+
fontSize: 14,
|
|
1275
|
+
color: o > 0 ? "var(--color-primary, #6366f1)" : "var(--color-error, #ef4444)"
|
|
1368
1276
|
},
|
|
1369
|
-
children:
|
|
1277
|
+
children: [
|
|
1278
|
+
o,
|
|
1279
|
+
" vote",
|
|
1280
|
+
o !== 1 ? "s" : "",
|
|
1281
|
+
" remaining"
|
|
1282
|
+
]
|
|
1370
1283
|
}
|
|
1371
|
-
)
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1284
|
+
)
|
|
1285
|
+
]
|
|
1286
|
+
}
|
|
1287
|
+
),
|
|
1288
|
+
y && /* @__PURE__ */ e("p", { style: { color: "var(--text-secondary, #64748b)", marginBottom: 12 }, children: "Voting is closed. Final results:" }),
|
|
1289
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: C.map((n, s) => {
|
|
1290
|
+
const a = c.has(n.id), z = n.votes ?? 0, r = f ? `${Math.round(z / g * 100)}%` : "0%";
|
|
1291
|
+
return /* @__PURE__ */ i(
|
|
1292
|
+
"div",
|
|
1293
|
+
{
|
|
1294
|
+
style: {
|
|
1295
|
+
display: "flex",
|
|
1296
|
+
alignItems: "center",
|
|
1297
|
+
gap: 12,
|
|
1298
|
+
padding: "10px 14px",
|
|
1299
|
+
borderRadius: 8,
|
|
1300
|
+
border: a ? "2px solid var(--color-primary, #6366f1)" : "1px solid var(--border-color, #cbd5e1)",
|
|
1301
|
+
background: a ? "color-mix(in srgb, var(--color-primary) 12%, transparent)" : "var(--bg-elevated, var(--bg-primary))",
|
|
1302
|
+
cursor: y ? "default" : "pointer",
|
|
1303
|
+
transition: "all 0.2s"
|
|
1304
|
+
},
|
|
1305
|
+
onClick: () => S(n.id),
|
|
1306
|
+
children: [
|
|
1307
|
+
f && /* @__PURE__ */ e("span", { style: { fontSize: 18, minWidth: 32, textAlign: "center" }, children: d(s) }),
|
|
1308
|
+
/* @__PURE__ */ e("span", { style: { display: "inline-flex", fontSize: 20 }, children: ee.createElement(fn[n.category], { size: 20 }) }),
|
|
1309
|
+
/* @__PURE__ */ i("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1310
|
+
/* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: n.name }),
|
|
1311
|
+
n.description && /* @__PURE__ */ e(
|
|
1383
1312
|
"div",
|
|
1384
1313
|
{
|
|
1385
1314
|
style: {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1315
|
+
fontSize: 13,
|
|
1316
|
+
color: "var(--text-secondary, #64748b)",
|
|
1317
|
+
overflow: "hidden",
|
|
1318
|
+
textOverflow: "ellipsis",
|
|
1319
|
+
whiteSpace: "nowrap"
|
|
1320
|
+
},
|
|
1321
|
+
children: n.description
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
f && /* @__PURE__ */ e(
|
|
1325
|
+
"div",
|
|
1326
|
+
{
|
|
1327
|
+
style: {
|
|
1328
|
+
marginTop: 4,
|
|
1329
|
+
height: 6,
|
|
1389
1330
|
borderRadius: 3,
|
|
1390
|
-
|
|
1391
|
-
|
|
1331
|
+
background: "var(--bg-tertiary, #e2e8f0)",
|
|
1332
|
+
overflow: "hidden"
|
|
1333
|
+
},
|
|
1334
|
+
children: /* @__PURE__ */ e(
|
|
1335
|
+
"div",
|
|
1336
|
+
{
|
|
1337
|
+
style: {
|
|
1338
|
+
height: "100%",
|
|
1339
|
+
width: r,
|
|
1340
|
+
background: "var(--color-primary, #6366f1)",
|
|
1341
|
+
borderRadius: 3,
|
|
1342
|
+
transition: "width 0.3s"
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
)
|
|
1392
1346
|
}
|
|
1393
1347
|
)
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1348
|
+
] }),
|
|
1349
|
+
f && /* @__PURE__ */ e("span", { style: { fontWeight: 600, fontSize: 16, minWidth: 40, textAlign: "right" }, children: z }),
|
|
1350
|
+
!y && /* @__PURE__ */ e(
|
|
1351
|
+
"button",
|
|
1352
|
+
{
|
|
1353
|
+
onClick: (A) => {
|
|
1354
|
+
A.stopPropagation(), S(n.id);
|
|
1355
|
+
},
|
|
1356
|
+
style: {
|
|
1357
|
+
padding: "4px 12px",
|
|
1358
|
+
borderRadius: 4,
|
|
1359
|
+
border: "none",
|
|
1360
|
+
background: a ? "var(--color-error, #ef4444)" : "var(--color-primary, #6366f1)",
|
|
1361
|
+
color: "#fff",
|
|
1362
|
+
cursor: "pointer",
|
|
1363
|
+
fontSize: 13
|
|
1364
|
+
},
|
|
1365
|
+
children: a ? "Unvote" : "Vote"
|
|
1366
|
+
}
|
|
1367
|
+
)
|
|
1368
|
+
]
|
|
1369
|
+
},
|
|
1370
|
+
n.id
|
|
1371
|
+
);
|
|
1372
|
+
}) }),
|
|
1373
|
+
f && /* @__PURE__ */ i(
|
|
1374
|
+
"div",
|
|
1375
|
+
{
|
|
1376
|
+
style: {
|
|
1377
|
+
marginTop: 12,
|
|
1378
|
+
textAlign: "right",
|
|
1379
|
+
fontSize: 13,
|
|
1380
|
+
color: "var(--text-secondary, #64748b)"
|
|
1381
|
+
},
|
|
1382
|
+
children: [
|
|
1383
|
+
"Total votes: ",
|
|
1384
|
+
t.reduce((n, s) => n + (s.votes ?? 0), 0)
|
|
1385
|
+
]
|
|
1386
|
+
}
|
|
1387
|
+
)
|
|
1388
|
+
]
|
|
1389
|
+
}
|
|
1390
|
+
);
|
|
1426
1391
|
}
|
|
1427
1392
|
);
|
|
1428
1393
|
export {
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
we as NiceRoundList,
|
|
1438
|
-
Ae as NiceSongPicker
|
|
1394
|
+
Ln as NiceAttractionPicker,
|
|
1395
|
+
Tn as NiceAttractionVoting,
|
|
1396
|
+
Sn as NiceEventMedia,
|
|
1397
|
+
xn as NiceEventPlanning,
|
|
1398
|
+
In as NiceKaraokePicker,
|
|
1399
|
+
zn as NiceRoundCard,
|
|
1400
|
+
wn as NiceRoundList,
|
|
1401
|
+
An as NiceSongPicker
|
|
1439
1402
|
};
|