fansunited-frontend-components 0.0.39 → 0.0.40
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/ChanceGame.js +104 -102
- package/ClassicQuizPlay.js +45 -42
- package/CollectLead.js +25 -24
- package/Discussion.js +376 -378
- package/EitherOrPlay.d.ts +4 -0
- package/EitherOrPlay.d.ts.map +1 -0
- package/EitherOrPlay.js +2533 -0
- package/EventGamePlay.js +59 -54
- package/MatchQuizPlay.js +63 -57
- package/PersonalityQuizPlay.js +7935 -7201
- package/PickThePair.js +153 -151
- package/PollVote.js +108 -104
- package/chunks/{AlertMessage-C2aBXCrl.js → AlertMessage-cjTHrMUK.js} +51 -51
- package/chunks/ArrowRightAlt-88jKjh6A.js +8 -0
- package/chunks/Avatar-CQCrd1m-.js +352 -0
- package/chunks/ChanceGameEmbedVariant-DWqOTf4o.js +1051 -0
- package/chunks/{CheckCircle-D-GH16Lb.js → CheckCircle-ClY-iOQ5.js} +105 -105
- package/chunks/{CollectLeadForm-o9NdYQgu.js → CollectLeadForm-0vVnu4DL.js} +5 -5
- package/chunks/FavoriteBorder-BHnvGBrn.js +11 -0
- package/chunks/{useInfoPage-v91yL5SS.js → NotFoundSkeleton-B3RNa8KJ.js} +451 -646
- package/chunks/Notification-BTtUhfZQ.js +615 -0
- package/chunks/OverlayLeadAfterCollection-CaBbwZVo.js +480 -0
- package/chunks/{OverlayScoreStateSkeleton-xvq9lQEi.js → OverlayScoreStateSkeleton-DJn0Rim3.js} +3 -3
- package/chunks/Person-D0Im9_zE.js +522 -0
- package/chunks/{PickOneOfX-C2YpLk40.js → PickOneOfX-DYQ4c1o2.js} +7 -7
- package/chunks/{Portal-DWAr8MhA.js → Portal-B9wkUnY2.js} +7 -7
- package/chunks/{ConstantsProvider-BPJJz9fq.js → PrizeCard-gMp7I66d.js} +3593 -2860
- package/chunks/{Spinner-m59ZJZ35.js → Spinner-BBA89t5s.js} +50 -50
- package/chunks/StandardLeadAfterCollection-L1cOGfS6.js +432 -0
- package/chunks/{Tabs-BGihvj9C.js → Tabs-D_n8rNw3.js} +28 -28
- package/chunks/{Textarea-Bzlb89Zp.js → Textarea-BdN2xj4j.js} +44 -44
- package/chunks/{TimerOutlined-DiX8hCoC.js → TimerOutlined-DmKZDDI-.js} +1 -1
- package/chunks/chevron-right-DGEksBI7.js +330 -0
- package/chunks/default-quiz-bg-vertical-CT7rrg9o.js +5 -0
- package/chunks/index-2s5UkG1y.js +1607 -0
- package/chunks/useImageVariant-pnFelF9A.js +535 -0
- package/chunks/useInfoPage-DPkzE5Gn.js +204 -0
- package/components.d.ts +2 -1
- package/components.d.ts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -2
- package/package.json +1 -1
- package/chunks/ChanceGameEmbedVariant-BvIKBhq_.js +0 -2609
- package/chunks/Notification-Bwcoljir.js +0 -961
- package/chunks/OverlayLeadAfterCollection-B3D5ct0J.js +0 -901
- package/chunks/chevron-right-Dlc9ZKhv.js +0 -846
- package/chunks/useImageVariant-Do8kOVs2.js +0 -537
package/Discussion.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as F, Fragment as De } from "react/jsx-runtime";
|
|
2
2
|
import * as I from "react";
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
import { C as No, M as _o, d as Lo, a as qe, b as Xe, S as Ee } from "./chunks/Spinner-
|
|
3
|
+
import J, { useState as H, useEffect as be, useCallback as Ae, useRef as Ie } from "react";
|
|
4
|
+
import { _ as D, I as Ke, ad as xe, K as Be, Q as We, an as Ge, s as Y, q as ue, t as pe, v as Z, w as Je, P as t, x as G, y as me, l as Ce, m as Re, o as Co, p as Ro, av as Po, ae as So, aw as Io, as as Do, at as Mo, G as zo, A as le, k as te, j as ae, h as Me, f as re, B as L, D as oe, T as W, c as Q, a7 as we, ag as Ne, ah as To, i as Eo, a as Oo, C as $o, b as ko, E as Vo, d as wo } from "./chunks/PrizeCard-gMp7I66d.js";
|
|
5
|
+
import { C as No, M as _o, d as Lo, a as qe, b as Xe, S as Ee } from "./chunks/Spinner-BBA89t5s.js";
|
|
6
6
|
import { createPortal as Fo } from "react-dom";
|
|
7
|
-
import { C as Ao, u as Bo, T as Ye } from "./chunks/Textarea-
|
|
8
|
-
import {
|
|
9
|
-
import { g as
|
|
7
|
+
import { C as Ao, u as Bo, T as Ye } from "./chunks/Textarea-BdN2xj4j.js";
|
|
8
|
+
import { F as Ho, a as jo } from "./chunks/FavoriteBorder-BHnvGBrn.js";
|
|
9
|
+
import { L as ye, l as Uo, a as Ko, e as Wo, h as Oe, b as Go, f as _e, g as Jo, d as qo, j as Xo, s as Yo, V as Qo, G as Zo, k as et, S as ot, R as tt, q as rt, i as nt, F as $e, y as Qe, w as st, x as it } from "./chunks/CheckCircle-ClY-iOQ5.js";
|
|
10
|
+
import { g as lt, N as Ze } from "./chunks/Notification-BTtUhfZQ.js";
|
|
11
|
+
import { A as at } from "./chunks/Avatar-CQCrd1m-.js";
|
|
10
12
|
const Le = /* @__PURE__ */ I.createContext(null);
|
|
11
13
|
process.env.NODE_ENV !== "production" && (Le.displayName = "DropdownContext");
|
|
12
14
|
const ke = {
|
|
@@ -16,18 +18,18 @@ const ke = {
|
|
|
16
18
|
open: "dropdown:open",
|
|
17
19
|
close: "dropdown:close"
|
|
18
20
|
};
|
|
19
|
-
function
|
|
21
|
+
function ct(o, e) {
|
|
20
22
|
if (e.type === ye.itemHover)
|
|
21
|
-
return
|
|
23
|
+
return D({}, o, {
|
|
22
24
|
highlightedValue: e.item
|
|
23
25
|
});
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
26
|
+
const r = Uo(o, e);
|
|
27
|
+
if (r.highlightedValue === null && e.context.items.length > 0)
|
|
28
|
+
return D({}, r, {
|
|
27
29
|
highlightedValue: e.context.items[0]
|
|
28
30
|
});
|
|
29
31
|
if (e.type === ye.keyDown && e.event.key === "Escape")
|
|
30
|
-
return
|
|
32
|
+
return D({}, r, {
|
|
31
33
|
open: !1
|
|
32
34
|
});
|
|
33
35
|
if (e.type === ye.blur) {
|
|
@@ -35,15 +37,15 @@ function lt(o, e) {
|
|
|
35
37
|
if (!((a = e.context.listboxRef.current) != null && a.contains(e.event.relatedTarget))) {
|
|
36
38
|
var l, i;
|
|
37
39
|
const c = (l = e.context.listboxRef.current) == null ? void 0 : l.getAttribute("id"), s = (i = e.event.relatedTarget) == null ? void 0 : i.getAttribute("aria-controls");
|
|
38
|
-
return c && s && c === s ?
|
|
40
|
+
return c && s && c === s ? r : D({}, r, {
|
|
39
41
|
open: !1,
|
|
40
42
|
highlightedValue: e.context.items[0]
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
return
|
|
46
|
+
return r;
|
|
45
47
|
}
|
|
46
|
-
const
|
|
48
|
+
const dt = {
|
|
47
49
|
dispatch: () => {
|
|
48
50
|
},
|
|
49
51
|
popupId: "",
|
|
@@ -57,8 +59,8 @@ const at = {
|
|
|
57
59
|
},
|
|
58
60
|
triggerElement: null
|
|
59
61
|
};
|
|
60
|
-
function
|
|
61
|
-
var e,
|
|
62
|
+
function ut(o = {}) {
|
|
63
|
+
var e, r;
|
|
62
64
|
const {
|
|
63
65
|
listboxRef: a,
|
|
64
66
|
onItemsChange: l,
|
|
@@ -75,18 +77,18 @@ function ct(o = {}) {
|
|
|
75
77
|
dispatch: C,
|
|
76
78
|
triggerElement: R,
|
|
77
79
|
registerPopup: S
|
|
78
|
-
} = (
|
|
80
|
+
} = (r = I.useContext(Le)) != null ? r : dt, T = I.useRef(f), {
|
|
79
81
|
subitems: y,
|
|
80
82
|
contextValue: $
|
|
81
|
-
} =
|
|
82
|
-
var
|
|
83
|
-
return m == null ? null : (
|
|
83
|
+
} = Ko(), v = I.useMemo(() => Array.from(y.keys()), [y]), E = I.useCallback((m) => {
|
|
84
|
+
var M, z;
|
|
85
|
+
return m == null ? null : (M = (z = y.get(m)) == null ? void 0 : z.ref.current) != null ? M : null;
|
|
84
86
|
}, [y]), h = I.useCallback((m) => {
|
|
85
|
-
var
|
|
86
|
-
return (y == null || (
|
|
87
|
+
var M;
|
|
88
|
+
return (y == null || (M = y.get(m)) == null ? void 0 : M.disabled) || !1;
|
|
87
89
|
}, [y]), O = I.useCallback((m) => {
|
|
88
|
-
var
|
|
89
|
-
return ((
|
|
90
|
+
var M, z;
|
|
91
|
+
return ((M = y.get(m)) == null ? void 0 : M.label) || ((z = y.get(m)) == null || (z = z.ref.current) == null ? void 0 : z.innerText);
|
|
90
92
|
}, [y]), N = I.useMemo(() => ({
|
|
91
93
|
listboxRef: p
|
|
92
94
|
}), [p]), {
|
|
@@ -97,7 +99,7 @@ function ct(o = {}) {
|
|
|
97
99
|
highlightedValue: B
|
|
98
100
|
},
|
|
99
101
|
rootRef: K
|
|
100
|
-
} =
|
|
102
|
+
} = Wo({
|
|
101
103
|
disabledItemsFocusable: c,
|
|
102
104
|
disableListWrap: s,
|
|
103
105
|
focusManagement: "DOM",
|
|
@@ -113,7 +115,7 @@ function ct(o = {}) {
|
|
|
113
115
|
onItemsChange: l,
|
|
114
116
|
reducerActionContext: N,
|
|
115
117
|
selectionMode: "none",
|
|
116
|
-
stateReducer:
|
|
118
|
+
stateReducer: ct,
|
|
117
119
|
componentName: d
|
|
118
120
|
});
|
|
119
121
|
Be(() => {
|
|
@@ -131,28 +133,28 @@ function ct(o = {}) {
|
|
|
131
133
|
}, [f, u, B, y, v]), I.useEffect(() => {
|
|
132
134
|
var m;
|
|
133
135
|
if ((m = p.current) != null && m.contains(document.activeElement) && B !== null) {
|
|
134
|
-
var
|
|
135
|
-
y == null || (
|
|
136
|
+
var M;
|
|
137
|
+
y == null || (M = y.get(B)) == null || (M = M.ref.current) == null || M.focus();
|
|
136
138
|
}
|
|
137
139
|
}, [B, y]);
|
|
138
|
-
const k = (m) => (
|
|
140
|
+
const k = (m) => (M) => {
|
|
139
141
|
var z, ee;
|
|
140
|
-
(z = m.onBlur) == null || z.call(m,
|
|
142
|
+
(z = m.onBlur) == null || z.call(m, M), !M.defaultMuiPrevented && ((ee = p.current) != null && ee.contains(M.relatedTarget) || M.relatedTarget === R || C({
|
|
141
143
|
type: ke.blur,
|
|
142
|
-
event:
|
|
144
|
+
event: M
|
|
143
145
|
}));
|
|
144
|
-
}, _ = (m) => (
|
|
146
|
+
}, _ = (m) => (M) => {
|
|
145
147
|
var z;
|
|
146
|
-
(z = m.onKeyDown) == null || z.call(m,
|
|
148
|
+
(z = m.onKeyDown) == null || z.call(m, M), !M.defaultMuiPrevented && M.key === "Escape" && C({
|
|
147
149
|
type: ke.escapeKeyDown,
|
|
148
|
-
event:
|
|
150
|
+
event: M
|
|
149
151
|
});
|
|
150
152
|
}, P = (m = {}) => ({
|
|
151
153
|
onBlur: k(m),
|
|
152
154
|
onKeyDown: _(m)
|
|
153
155
|
}), V = (m = {}) => {
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
+
const M = Oe(P, j), z = We(m);
|
|
157
|
+
return D({}, m, z, M(z), {
|
|
156
158
|
id: x,
|
|
157
159
|
role: "menu"
|
|
158
160
|
});
|
|
@@ -161,7 +163,7 @@ function ct(o = {}) {
|
|
|
161
163
|
subitems: y,
|
|
162
164
|
highlightedValue: B
|
|
163
165
|
}), {
|
|
164
|
-
contextValue:
|
|
166
|
+
contextValue: D({}, $, U),
|
|
165
167
|
dispatch: A,
|
|
166
168
|
getListboxProps: V,
|
|
167
169
|
highlightedValue: B,
|
|
@@ -171,10 +173,10 @@ function ct(o = {}) {
|
|
|
171
173
|
triggerElement: R
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
|
-
function
|
|
176
|
+
function pt(o) {
|
|
175
177
|
const {
|
|
176
178
|
value: e,
|
|
177
|
-
children:
|
|
179
|
+
children: r
|
|
178
180
|
} = o, {
|
|
179
181
|
dispatch: a,
|
|
180
182
|
getItemIndex: l,
|
|
@@ -190,18 +192,18 @@ function dt(o) {
|
|
|
190
192
|
registerItem: c,
|
|
191
193
|
totalSubitemCount: s
|
|
192
194
|
}), [c, l, s]);
|
|
193
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ n(Go.Provider, {
|
|
194
196
|
value: d,
|
|
195
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ n(_e.Provider, {
|
|
196
198
|
value: u,
|
|
197
|
-
children:
|
|
199
|
+
children: r
|
|
198
200
|
})
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
|
-
function
|
|
203
|
+
function mt(o) {
|
|
202
204
|
return `menu-item-${o.size}`;
|
|
203
205
|
}
|
|
204
|
-
const
|
|
206
|
+
const ft = {
|
|
205
207
|
dispatch: () => {
|
|
206
208
|
},
|
|
207
209
|
popupId: "",
|
|
@@ -215,42 +217,42 @@ const pt = {
|
|
|
215
217
|
},
|
|
216
218
|
triggerElement: null
|
|
217
219
|
};
|
|
218
|
-
function
|
|
220
|
+
function vt(o) {
|
|
219
221
|
var e;
|
|
220
222
|
const {
|
|
221
|
-
disabled:
|
|
223
|
+
disabled: r = !1,
|
|
222
224
|
id: a,
|
|
223
225
|
rootRef: l,
|
|
224
226
|
label: i,
|
|
225
227
|
disableFocusOnHover: c = !1
|
|
226
228
|
} = o, s = xe(a), u = I.useRef(null), d = I.useMemo(() => ({
|
|
227
|
-
disabled:
|
|
229
|
+
disabled: r,
|
|
228
230
|
id: s ?? "",
|
|
229
231
|
label: i,
|
|
230
232
|
ref: u
|
|
231
|
-
}), [
|
|
233
|
+
}), [r, s, i]), {
|
|
232
234
|
dispatch: p
|
|
233
|
-
} = (e = I.useContext(Le)) != null ? e :
|
|
235
|
+
} = (e = I.useContext(Le)) != null ? e : ft, {
|
|
234
236
|
getRootProps: g,
|
|
235
237
|
highlighted: x
|
|
236
|
-
} =
|
|
238
|
+
} = Jo({
|
|
237
239
|
item: s,
|
|
238
240
|
handlePointerOverEvents: !c
|
|
239
241
|
}), {
|
|
240
242
|
index: f,
|
|
241
243
|
totalItemCount: b
|
|
242
|
-
} =
|
|
244
|
+
} = qo(s ?? mt, d), {
|
|
243
245
|
getRootProps: C,
|
|
244
246
|
focusVisible: R,
|
|
245
247
|
rootRef: S
|
|
246
248
|
} = Ge({
|
|
247
|
-
disabled:
|
|
249
|
+
disabled: r,
|
|
248
250
|
focusableWhenDisabled: !0
|
|
249
251
|
}), T = Ke(S, l, u);
|
|
250
252
|
I.useDebugValue({
|
|
251
253
|
id: s,
|
|
252
254
|
highlighted: x,
|
|
253
|
-
disabled:
|
|
255
|
+
disabled: r,
|
|
254
256
|
label: i
|
|
255
257
|
});
|
|
256
258
|
const y = (E) => (h) => {
|
|
@@ -259,12 +261,12 @@ function mt(o) {
|
|
|
259
261
|
type: ke.close,
|
|
260
262
|
event: h
|
|
261
263
|
});
|
|
262
|
-
}, $ = (E = {}) =>
|
|
264
|
+
}, $ = (E = {}) => D({}, E, {
|
|
263
265
|
onClick: y(E)
|
|
264
266
|
});
|
|
265
267
|
function v(E = {}) {
|
|
266
268
|
const h = We(E), O = Oe($, Oe(C, g));
|
|
267
|
-
return
|
|
269
|
+
return D({}, E, h, O(h), {
|
|
268
270
|
id: s,
|
|
269
271
|
ref: T,
|
|
270
272
|
role: "menuitem"
|
|
@@ -280,7 +282,7 @@ function mt(o) {
|
|
|
280
282
|
rootRef: T
|
|
281
283
|
} : {
|
|
282
284
|
getRootProps: v,
|
|
283
|
-
disabled:
|
|
285
|
+
disabled: r,
|
|
284
286
|
focusVisible: R,
|
|
285
287
|
highlighted: x,
|
|
286
288
|
index: f,
|
|
@@ -288,16 +290,16 @@ function mt(o) {
|
|
|
288
290
|
rootRef: T
|
|
289
291
|
};
|
|
290
292
|
}
|
|
291
|
-
function
|
|
293
|
+
function ht(o) {
|
|
292
294
|
const e = I.useContext(_e);
|
|
293
295
|
if (!e)
|
|
294
296
|
throw new Error("MenuItem: ListContext was not found.");
|
|
295
|
-
const
|
|
297
|
+
const r = xe(o), {
|
|
296
298
|
getItemState: a,
|
|
297
299
|
dispatch: l
|
|
298
300
|
} = e;
|
|
299
301
|
let i;
|
|
300
|
-
|
|
302
|
+
r != null ? i = a(r) : i = {
|
|
301
303
|
focusable: !0,
|
|
302
304
|
highlighted: !1,
|
|
303
305
|
selected: !1
|
|
@@ -307,38 +309,38 @@ function ft(o) {
|
|
|
307
309
|
selected: s,
|
|
308
310
|
focusable: u
|
|
309
311
|
} = i, d = I.useCallback((g) => {
|
|
310
|
-
if (g !==
|
|
311
|
-
throw new Error(["Base UI MenuItem: Tried to access the state of another MenuItem.", `itemValue: ${g} | id: ${
|
|
312
|
+
if (g !== r)
|
|
313
|
+
throw new Error(["Base UI MenuItem: Tried to access the state of another MenuItem.", `itemValue: ${g} | id: ${r}`, "This is unsupported when the MenuItem uses the MenuItemContextStabilizer as a performance optimization."].join("/n"));
|
|
312
314
|
return {
|
|
313
315
|
highlighted: c,
|
|
314
316
|
selected: s,
|
|
315
317
|
focusable: u
|
|
316
318
|
};
|
|
317
|
-
}, [c, s, u,
|
|
319
|
+
}, [c, s, u, r]);
|
|
318
320
|
return {
|
|
319
321
|
contextValue: I.useMemo(() => ({
|
|
320
322
|
dispatch: l,
|
|
321
323
|
getItemState: d
|
|
322
324
|
}), [l, d]),
|
|
323
|
-
id:
|
|
325
|
+
id: r
|
|
324
326
|
};
|
|
325
327
|
}
|
|
326
|
-
const
|
|
328
|
+
const yt = ["className", "children", "component", "inset", "orientation", "role", "slots", "slotProps"], gt = (o) => {
|
|
327
329
|
const {
|
|
328
330
|
orientation: e,
|
|
329
|
-
inset:
|
|
331
|
+
inset: r
|
|
330
332
|
} = o, a = {
|
|
331
|
-
root: ["root", e,
|
|
333
|
+
root: ["root", e, r && `inset${G(r)}`]
|
|
332
334
|
};
|
|
333
|
-
return me(a,
|
|
334
|
-
},
|
|
335
|
+
return me(a, lt, {});
|
|
336
|
+
}, bt = Y("hr", {
|
|
335
337
|
name: "JoyDivider",
|
|
336
338
|
slot: "Root",
|
|
337
339
|
overridesResolver: (o, e) => e.root
|
|
338
340
|
})(({
|
|
339
341
|
theme: o,
|
|
340
342
|
ownerState: e
|
|
341
|
-
}) =>
|
|
343
|
+
}) => D({
|
|
342
344
|
"--Divider-thickness": "1px",
|
|
343
345
|
"--Divider-lineColor": o.vars.palette.divider
|
|
344
346
|
}, e.inset === "none" && {
|
|
@@ -353,7 +355,7 @@ const vt = ["className", "children", "component", "inset", "orientation", "role"
|
|
|
353
355
|
position: "relative",
|
|
354
356
|
alignSelf: "stretch",
|
|
355
357
|
flexShrink: 0
|
|
356
|
-
}, e.children ?
|
|
358
|
+
}, e.children ? D({
|
|
357
359
|
"--Divider-gap": o.spacing(1),
|
|
358
360
|
"--Divider-childPosition": "50%",
|
|
359
361
|
display: "flex",
|
|
@@ -389,7 +391,7 @@ const vt = ["className", "children", "component", "inset", "orientation", "role"
|
|
|
389
391
|
// use logical size + background is better than border because they work with gradient.
|
|
390
392
|
inlineSize: e.orientation === "vertical" ? "var(--Divider-thickness)" : "initial",
|
|
391
393
|
blockSize: e.orientation === "vertical" ? "initial" : "var(--Divider-thickness)"
|
|
392
|
-
})), Fe = /* @__PURE__ */ I.forwardRef(function(e,
|
|
394
|
+
})), Fe = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
393
395
|
const a = ue({
|
|
394
396
|
props: e,
|
|
395
397
|
name: "JoyDivider"
|
|
@@ -402,22 +404,22 @@ const vt = ["className", "children", "component", "inset", "orientation", "role"
|
|
|
402
404
|
role: d = c !== "hr" ? "separator" : void 0,
|
|
403
405
|
slots: p = {},
|
|
404
406
|
slotProps: g = {}
|
|
405
|
-
} = a, x = pe(a,
|
|
407
|
+
} = a, x = pe(a, yt), f = D({}, a, {
|
|
406
408
|
inset: s,
|
|
407
409
|
role: d,
|
|
408
410
|
orientation: u,
|
|
409
411
|
component: c
|
|
410
|
-
}), b =
|
|
412
|
+
}), b = gt(f), C = D({}, x, {
|
|
411
413
|
component: c,
|
|
412
414
|
slots: p,
|
|
413
415
|
slotProps: g
|
|
414
416
|
}), [R, S] = Z("root", {
|
|
415
|
-
ref:
|
|
417
|
+
ref: r,
|
|
416
418
|
className: Je(b.root, l),
|
|
417
|
-
elementType:
|
|
419
|
+
elementType: bt,
|
|
418
420
|
externalForwardedProps: C,
|
|
419
421
|
ownerState: f,
|
|
420
|
-
additionalProps:
|
|
422
|
+
additionalProps: D({
|
|
421
423
|
as: c,
|
|
422
424
|
role: d
|
|
423
425
|
}, d === "separator" && u === "vertical" && {
|
|
@@ -426,7 +428,7 @@ const vt = ["className", "children", "component", "inset", "orientation", "role"
|
|
|
426
428
|
"aria-orientation": "vertical"
|
|
427
429
|
})
|
|
428
430
|
});
|
|
429
|
-
return /* @__PURE__ */
|
|
431
|
+
return /* @__PURE__ */ n(R, D({}, S, {
|
|
430
432
|
children: i
|
|
431
433
|
}));
|
|
432
434
|
});
|
|
@@ -481,22 +483,22 @@ process.env.NODE_ENV !== "production" && (Fe.propTypes = {
|
|
|
481
483
|
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
482
484
|
});
|
|
483
485
|
Fe.muiName = "Divider";
|
|
484
|
-
function
|
|
486
|
+
function xt(o) {
|
|
485
487
|
return Ce("MuiMenu", o);
|
|
486
488
|
}
|
|
487
489
|
Re("MuiMenu", ["root", "listbox", "expanded", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
|
|
488
|
-
const
|
|
490
|
+
const Ct = ["actions", "children", "color", "component", "disablePortal", "keepMounted", "id", "invertedColors", "onItemsChange", "modifiers", "variant", "size", "slots", "slotProps"], Rt = (o) => {
|
|
489
491
|
const {
|
|
490
492
|
open: e,
|
|
491
|
-
variant:
|
|
493
|
+
variant: r,
|
|
492
494
|
color: a,
|
|
493
495
|
size: l
|
|
494
496
|
} = o, i = {
|
|
495
|
-
root: ["root", e && "expanded",
|
|
497
|
+
root: ["root", e && "expanded", r && `variant${G(r)}`, a && `color${G(a)}`, l && `size${G(l)}`],
|
|
496
498
|
listbox: ["listbox"]
|
|
497
499
|
};
|
|
498
|
-
return me(i,
|
|
499
|
-
}, He =
|
|
500
|
+
return me(i, xt, {});
|
|
501
|
+
}, He = Y(Xo, {
|
|
500
502
|
name: "JoyMenu",
|
|
501
503
|
slot: "Root",
|
|
502
504
|
overridesResolver: (o, e) => e.root
|
|
@@ -504,14 +506,14 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
504
506
|
theme: o,
|
|
505
507
|
ownerState: e
|
|
506
508
|
}) => {
|
|
507
|
-
var
|
|
508
|
-
const l = (
|
|
509
|
-
return [
|
|
509
|
+
var r, a;
|
|
510
|
+
const l = (r = o.variants[e.variant]) == null ? void 0 : r[e.color];
|
|
511
|
+
return [D({
|
|
510
512
|
"--focus-outline-offset": `calc(${o.vars.focus.thickness} * -1)`,
|
|
511
513
|
// to prevent the focus outline from being cut by overflow
|
|
512
514
|
"--ListItem-stickyBackground": (l == null ? void 0 : l.backgroundColor) || (l == null ? void 0 : l.background) || o.vars.palette.background.popup,
|
|
513
515
|
"--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
|
|
514
|
-
},
|
|
516
|
+
}, Yo, {
|
|
515
517
|
borderRadius: `var(--List-radius, ${o.vars.radius.sm})`,
|
|
516
518
|
boxShadow: o.shadow.md,
|
|
517
519
|
overflow: "auto",
|
|
@@ -520,7 +522,7 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
520
522
|
}, !(l != null && l.backgroundColor) && {
|
|
521
523
|
backgroundColor: o.vars.palette.background.popup
|
|
522
524
|
}, e.variant === "solid" && e.color && e.invertedColors && Co(e.color)(o), e.variant === "soft" && e.color && e.invertedColors && Ro(e.color)(o), (a = o.variants[e.variant]) == null ? void 0 : a[e.color])];
|
|
523
|
-
}), eo = /* @__PURE__ */ I.forwardRef(function(e,
|
|
525
|
+
}), eo = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
524
526
|
var a;
|
|
525
527
|
const l = ue({
|
|
526
528
|
props: e,
|
|
@@ -540,16 +542,16 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
540
542
|
size: R = "md",
|
|
541
543
|
slots: S = {},
|
|
542
544
|
slotProps: T = {}
|
|
543
|
-
} = l, y = pe(l,
|
|
545
|
+
} = l, y = pe(l, Ct), {
|
|
544
546
|
contextValue: $,
|
|
545
547
|
getListboxProps: v,
|
|
546
548
|
dispatch: E,
|
|
547
549
|
open: h,
|
|
548
550
|
triggerElement: O
|
|
549
|
-
} =
|
|
551
|
+
} = ut({
|
|
550
552
|
onItemsChange: f,
|
|
551
553
|
id: g,
|
|
552
|
-
listboxRef:
|
|
554
|
+
listboxRef: r
|
|
553
555
|
});
|
|
554
556
|
I.useImperativeHandle(i, () => ({
|
|
555
557
|
dispatch: E,
|
|
@@ -558,7 +560,7 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
558
560
|
event: null
|
|
559
561
|
})
|
|
560
562
|
}), [E]);
|
|
561
|
-
const N =
|
|
563
|
+
const N = D({}, l, {
|
|
562
564
|
disablePortal: d,
|
|
563
565
|
invertedColors: x,
|
|
564
566
|
color: s,
|
|
@@ -567,7 +569,7 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
567
569
|
open: h,
|
|
568
570
|
nesting: !1,
|
|
569
571
|
row: !1
|
|
570
|
-
}), A =
|
|
572
|
+
}), A = Rt(N), j = D({}, y, {
|
|
571
573
|
component: u,
|
|
572
574
|
slots: S,
|
|
573
575
|
slotProps: T
|
|
@@ -591,20 +593,20 @@ const bt = ["actions", "children", "color", "component", "disablePortal", "keepM
|
|
|
591
593
|
},
|
|
592
594
|
className: A.root
|
|
593
595
|
});
|
|
594
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ n(He, D({}, B, !((a = l.slots) != null && a.root) && {
|
|
595
597
|
as: So,
|
|
596
598
|
slots: {
|
|
597
599
|
root: u || "ul"
|
|
598
600
|
}
|
|
599
601
|
}, {
|
|
600
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ n(pt, {
|
|
601
603
|
value: $,
|
|
602
|
-
children: /* @__PURE__ */
|
|
604
|
+
children: /* @__PURE__ */ n(Qo, {
|
|
603
605
|
variant: x ? void 0 : C,
|
|
604
606
|
color: s,
|
|
605
|
-
children: /* @__PURE__ */
|
|
607
|
+
children: /* @__PURE__ */ n(Zo.Provider, {
|
|
606
608
|
value: "menu",
|
|
607
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ n(et, {
|
|
608
610
|
nested: !0,
|
|
609
611
|
children: c
|
|
610
612
|
})
|
|
@@ -720,30 +722,30 @@ process.env.NODE_ENV !== "production" && (eo.propTypes = {
|
|
|
720
722
|
*/
|
|
721
723
|
variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
|
|
722
724
|
});
|
|
723
|
-
function
|
|
725
|
+
function Pt(o) {
|
|
724
726
|
return Ce("MuiMenuItem", o);
|
|
725
727
|
}
|
|
726
728
|
Re("MuiMenuItem", ["root", "focusVisible", "disabled", "selected", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
|
|
727
|
-
const
|
|
729
|
+
const St = ["children", "disabled", "component", "selected", "color", "orientation", "variant", "slots", "slotProps", "id"], It = (o) => {
|
|
728
730
|
const {
|
|
729
731
|
focusVisible: e,
|
|
730
|
-
disabled:
|
|
732
|
+
disabled: r,
|
|
731
733
|
selected: a,
|
|
732
734
|
color: l,
|
|
733
735
|
variant: i
|
|
734
736
|
} = o, c = {
|
|
735
|
-
root: ["root", e && "focusVisible",
|
|
737
|
+
root: ["root", e && "focusVisible", r && "disabled", a && "selected", l && `color${G(l)}`, i && `variant${G(i)}`]
|
|
736
738
|
};
|
|
737
|
-
return me(c,
|
|
738
|
-
},
|
|
739
|
+
return me(c, Pt, {});
|
|
740
|
+
}, Dt = Y(ot, {
|
|
739
741
|
name: "JoyMenuItem",
|
|
740
742
|
slot: "Root",
|
|
741
743
|
overridesResolver: (o, e) => e.root
|
|
742
|
-
})({}),
|
|
744
|
+
})({}), Mt = /* @__PURE__ */ I.memo(/* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
743
745
|
const a = ue({
|
|
744
746
|
props: e,
|
|
745
747
|
name: "JoyMenuItem"
|
|
746
|
-
}), l = I.useContext(
|
|
748
|
+
}), l = I.useContext(tt), {
|
|
747
749
|
children: i,
|
|
748
750
|
disabled: c = !1,
|
|
749
751
|
component: s = "li",
|
|
@@ -754,18 +756,18 @@ const Rt = ["children", "disabled", "component", "selected", "color", "orientati
|
|
|
754
756
|
slots: x = {},
|
|
755
757
|
slotProps: f = {},
|
|
756
758
|
id: b
|
|
757
|
-
} = a, C = pe(a,
|
|
759
|
+
} = a, C = pe(a, St), {
|
|
758
760
|
variant: R = g,
|
|
759
761
|
color: S = d
|
|
760
|
-
} =
|
|
762
|
+
} = rt(e.variant, e.color), {
|
|
761
763
|
getRootProps: T,
|
|
762
764
|
disabled: y,
|
|
763
765
|
focusVisible: $
|
|
764
|
-
} =
|
|
766
|
+
} = vt({
|
|
765
767
|
id: b,
|
|
766
768
|
disabled: c,
|
|
767
|
-
rootRef:
|
|
768
|
-
}), v =
|
|
769
|
+
rootRef: r
|
|
770
|
+
}), v = D({}, a, {
|
|
769
771
|
component: s,
|
|
770
772
|
color: S,
|
|
771
773
|
disabled: y,
|
|
@@ -774,34 +776,34 @@ const Rt = ["children", "disabled", "component", "selected", "color", "orientati
|
|
|
774
776
|
selected: u,
|
|
775
777
|
row: l,
|
|
776
778
|
variant: R
|
|
777
|
-
}), E =
|
|
779
|
+
}), E = It(v), h = D({}, C, {
|
|
778
780
|
component: s,
|
|
779
781
|
slots: x,
|
|
780
782
|
slotProps: f
|
|
781
783
|
}), [O, N] = Z("root", {
|
|
782
|
-
ref:
|
|
783
|
-
elementType:
|
|
784
|
+
ref: r,
|
|
785
|
+
elementType: Dt,
|
|
784
786
|
getSlotProps: T,
|
|
785
787
|
externalForwardedProps: h,
|
|
786
788
|
className: E.root,
|
|
787
789
|
ownerState: v
|
|
788
790
|
});
|
|
789
|
-
return /* @__PURE__ */
|
|
791
|
+
return /* @__PURE__ */ n(nt.Provider, {
|
|
790
792
|
value: p,
|
|
791
|
-
children: /* @__PURE__ */
|
|
793
|
+
children: /* @__PURE__ */ n(O, D({}, N, {
|
|
792
794
|
children: i
|
|
793
795
|
}))
|
|
794
796
|
});
|
|
795
|
-
})), Ve = /* @__PURE__ */ I.forwardRef(function(e,
|
|
797
|
+
})), Ve = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
796
798
|
const {
|
|
797
799
|
contextValue: a,
|
|
798
800
|
id: l
|
|
799
|
-
} =
|
|
800
|
-
return /* @__PURE__ */
|
|
801
|
+
} = ht(e.id);
|
|
802
|
+
return /* @__PURE__ */ n(_e.Provider, {
|
|
801
803
|
value: a,
|
|
802
|
-
children: /* @__PURE__ */
|
|
804
|
+
children: /* @__PURE__ */ n(Mt, D({}, e, {
|
|
803
805
|
id: l,
|
|
804
|
-
ref:
|
|
806
|
+
ref: r
|
|
805
807
|
}))
|
|
806
808
|
});
|
|
807
809
|
});
|
|
@@ -816,23 +818,23 @@ process.env.NODE_ENV !== "production" && (Ve.propTypes = {
|
|
|
816
818
|
children: t.node,
|
|
817
819
|
id: t.string
|
|
818
820
|
});
|
|
819
|
-
function
|
|
821
|
+
function zt(o) {
|
|
820
822
|
return Ce("MuiModalClose", o);
|
|
821
823
|
}
|
|
822
824
|
Re("MuiModalClose", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg"]);
|
|
823
825
|
var je;
|
|
824
|
-
const
|
|
826
|
+
const Tt = ["component", "color", "variant", "size", "onClick", "slots", "slotProps"], Et = (o) => {
|
|
825
827
|
const {
|
|
826
828
|
variant: e,
|
|
827
|
-
color:
|
|
829
|
+
color: r,
|
|
828
830
|
disabled: a,
|
|
829
831
|
focusVisible: l,
|
|
830
832
|
size: i
|
|
831
833
|
} = o, c = {
|
|
832
|
-
root: ["root", a && "disabled", l && "focusVisible", e && `variant${G(e)}`,
|
|
834
|
+
root: ["root", a && "disabled", l && "focusVisible", e && `variant${G(e)}`, r && `color${G(r)}`, i && `size${G(i)}`]
|
|
833
835
|
};
|
|
834
|
-
return me(c,
|
|
835
|
-
},
|
|
836
|
+
return me(c, zt, {});
|
|
837
|
+
}, Ot = Y(Do, {
|
|
836
838
|
name: "JoyModalClose",
|
|
837
839
|
slot: "Root",
|
|
838
840
|
overridesResolver: (o, e) => e.root
|
|
@@ -840,8 +842,8 @@ const Dt = ["component", "color", "variant", "size", "onClick", "slots", "slotPr
|
|
|
840
842
|
ownerState: o,
|
|
841
843
|
theme: e
|
|
842
844
|
}) => {
|
|
843
|
-
var
|
|
844
|
-
return
|
|
845
|
+
var r;
|
|
846
|
+
return D({}, o.size === "sm" && {
|
|
845
847
|
"--IconButton-size": "1.75rem"
|
|
846
848
|
}, o.size === "md" && {
|
|
847
849
|
"--IconButton-size": "2rem"
|
|
@@ -854,15 +856,15 @@ const Dt = ["component", "color", "variant", "size", "onClick", "slots", "slotPr
|
|
|
854
856
|
top: "var(--ModalClose-inset, 0.625rem)",
|
|
855
857
|
right: "var(--ModalClose-inset, 0.625rem)",
|
|
856
858
|
borderRadius: `var(--ModalClose-radius, ${e.vars.radius.sm})`
|
|
857
|
-
}, !((
|
|
859
|
+
}, !((r = e.variants[o.variant]) != null && (r = r[o.color]) != null && r.backgroundColor) && {
|
|
858
860
|
color: e.vars.palette.text.secondary
|
|
859
861
|
});
|
|
860
|
-
}),
|
|
862
|
+
}), $t = {
|
|
861
863
|
plain: "plain",
|
|
862
864
|
outlined: "plain",
|
|
863
865
|
soft: "soft",
|
|
864
866
|
solid: "solid"
|
|
865
|
-
}, oo = /* @__PURE__ */ I.forwardRef(function(e,
|
|
867
|
+
}, oo = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
866
868
|
var a, l, i, c, s, u;
|
|
867
869
|
const d = ue({
|
|
868
870
|
props: e,
|
|
@@ -875,22 +877,22 @@ const Dt = ["component", "color", "variant", "size", "onClick", "slots", "slotPr
|
|
|
875
877
|
onClick: b,
|
|
876
878
|
slots: C = {},
|
|
877
879
|
slotProps: R = {}
|
|
878
|
-
} = d, S = pe(d,
|
|
880
|
+
} = d, S = pe(d, Tt), T = I.useContext(No), y = I.useContext(_o), $ = (a = (l = e.variant) != null ? l : $t[y == null ? void 0 : y.variant]) != null ? a : x, v = (i = (c = e.color) != null ? c : y == null ? void 0 : y.color) != null ? i : g, E = I.useContext(Lo), h = (s = (u = e.size) != null ? u : E) != null ? s : f, {
|
|
879
881
|
focusVisible: O,
|
|
880
882
|
getRootProps: N
|
|
881
|
-
} = Ge(
|
|
882
|
-
rootRef:
|
|
883
|
-
})), A =
|
|
883
|
+
} = Ge(D({}, d, {
|
|
884
|
+
rootRef: r
|
|
885
|
+
})), A = D({}, d, {
|
|
884
886
|
color: v,
|
|
885
887
|
component: p,
|
|
886
888
|
variant: $,
|
|
887
889
|
size: h,
|
|
888
890
|
focusVisible: O
|
|
889
|
-
}), j =
|
|
890
|
-
ref:
|
|
891
|
-
elementType:
|
|
891
|
+
}), j = Et(A), [U, B] = Z("root", {
|
|
892
|
+
ref: r,
|
|
893
|
+
elementType: Ot,
|
|
892
894
|
getSlotProps: N,
|
|
893
|
-
externalForwardedProps:
|
|
895
|
+
externalForwardedProps: D({
|
|
894
896
|
onClick: (K) => {
|
|
895
897
|
T == null || T(K, "closeClick"), b == null || b(K);
|
|
896
898
|
}
|
|
@@ -902,8 +904,8 @@ const Dt = ["component", "color", "variant", "size", "onClick", "slots", "slotPr
|
|
|
902
904
|
className: j.root,
|
|
903
905
|
ownerState: A
|
|
904
906
|
});
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
children: je || (je = /* @__PURE__ */
|
|
907
|
+
return /* @__PURE__ */ n(U, D({}, B, {
|
|
908
|
+
children: je || (je = /* @__PURE__ */ n(Ao, {}))
|
|
907
909
|
}));
|
|
908
910
|
});
|
|
909
911
|
process.env.NODE_ENV !== "production" && (oo.propTypes = {
|
|
@@ -958,39 +960,39 @@ process.env.NODE_ENV !== "production" && (oo.propTypes = {
|
|
|
958
960
|
*/
|
|
959
961
|
variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
|
|
960
962
|
});
|
|
961
|
-
function
|
|
963
|
+
function kt(o) {
|
|
962
964
|
return Ce("MuiRadio", o);
|
|
963
965
|
}
|
|
964
|
-
const ge = Re("MuiRadio", ["root", "radio", "icon", "action", "input", "label", "checked", "disabled", "focusVisible", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid"]),
|
|
966
|
+
const ge = Re("MuiRadio", ["root", "radio", "icon", "action", "input", "label", "checked", "disabled", "focusVisible", "colorPrimary", "colorDanger", "colorNeutral", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantOutlined", "variantSoft", "variantSolid"]), Vt = ["checked", "checkedIcon", "defaultChecked", "disabled", "disableIcon", "overlay", "label", "id", "name", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "color", "variant", "size", "uncheckedIcon", "value", "component", "slots", "slotProps"], wt = (o) => {
|
|
965
967
|
const {
|
|
966
968
|
checked: e,
|
|
967
|
-
disabled:
|
|
969
|
+
disabled: r,
|
|
968
970
|
disableIcon: a,
|
|
969
971
|
focusVisible: l,
|
|
970
972
|
color: i,
|
|
971
973
|
variant: c,
|
|
972
974
|
size: s
|
|
973
975
|
} = o, u = {
|
|
974
|
-
root: ["root", e && "checked",
|
|
975
|
-
radio: ["radio", e && "checked",
|
|
976
|
+
root: ["root", e && "checked", r && "disabled", l && "focusVisible", c && `variant${G(c)}`, i && `color${G(i)}`, s && `size${G(s)}`],
|
|
977
|
+
radio: ["radio", e && "checked", r && "disabled"],
|
|
976
978
|
// disabled class is necessary for displaying global variant
|
|
977
979
|
icon: ["icon"],
|
|
978
980
|
action: [
|
|
979
981
|
"action",
|
|
980
982
|
e && "checked",
|
|
981
|
-
a &&
|
|
983
|
+
a && r && "disabled",
|
|
982
984
|
// add disabled class to action element for displaying global variant
|
|
983
985
|
l && "focusVisible"
|
|
984
986
|
],
|
|
985
987
|
input: ["input"],
|
|
986
988
|
label: ["label"]
|
|
987
989
|
};
|
|
988
|
-
return me(u,
|
|
990
|
+
return me(u, kt, {});
|
|
989
991
|
};
|
|
990
|
-
function
|
|
992
|
+
function Nt(o, e) {
|
|
991
993
|
return typeof e == "object" && e !== null ? o === e : String(o) === String(e);
|
|
992
994
|
}
|
|
993
|
-
const
|
|
995
|
+
const _t = Y("span", {
|
|
994
996
|
name: "JoyRadio",
|
|
995
997
|
slot: "Root",
|
|
996
998
|
overridesResolver: (o, e) => e.root
|
|
@@ -998,8 +1000,8 @@ const wt = Q("span", {
|
|
|
998
1000
|
ownerState: o,
|
|
999
1001
|
theme: e
|
|
1000
1002
|
}) => {
|
|
1001
|
-
var
|
|
1002
|
-
return [
|
|
1003
|
+
var r, a, l;
|
|
1004
|
+
return [D({
|
|
1003
1005
|
"--Icon-fontSize": "var(--Radio-size)",
|
|
1004
1006
|
"--Icon-color": "currentColor"
|
|
1005
1007
|
}, o.size === "sm" && {
|
|
@@ -1034,7 +1036,7 @@ const wt = Q("span", {
|
|
|
1034
1036
|
// prevent label from having larger height than the checkbox
|
|
1035
1037
|
color: e.vars.palette.text.primary,
|
|
1036
1038
|
[`&.${ge.disabled}`]: {
|
|
1037
|
-
color: (
|
|
1039
|
+
color: (r = e.variants.plainDisabled) == null || (r = r[o.color]) == null ? void 0 : r.color
|
|
1038
1040
|
}
|
|
1039
1041
|
}, o.disableIcon && {
|
|
1040
1042
|
color: (a = e.variants[o.variant]) == null || (a = a[o.color]) == null ? void 0 : a.color,
|
|
@@ -1045,7 +1047,7 @@ const wt = Q("span", {
|
|
|
1045
1047
|
marginInlineStart: o.orientation === "horizontal" ? "var(--RadioGroup-gap)" : void 0,
|
|
1046
1048
|
marginBlockStart: o.orientation === "horizontal" ? void 0 : "var(--RadioGroup-gap)"
|
|
1047
1049
|
})];
|
|
1048
|
-
}),
|
|
1050
|
+
}), Lt = Y("span", {
|
|
1049
1051
|
name: "JoyRadio",
|
|
1050
1052
|
slot: "Radio",
|
|
1051
1053
|
overridesResolver: (o, e) => e.radio
|
|
@@ -1053,9 +1055,9 @@ const wt = Q("span", {
|
|
|
1053
1055
|
ownerState: o,
|
|
1054
1056
|
theme: e
|
|
1055
1057
|
}) => {
|
|
1056
|
-
var
|
|
1057
|
-
const s = (
|
|
1058
|
-
return [
|
|
1058
|
+
var r, a, l, i, c;
|
|
1059
|
+
const s = (r = e.variants[`${o.variant}`]) == null ? void 0 : r[o.color];
|
|
1060
|
+
return [D({
|
|
1059
1061
|
"--Icon-color": o.color !== "neutral" || o.variant === "solid" ? "currentColor" : e.vars.palette.text.icon,
|
|
1060
1062
|
margin: 0,
|
|
1061
1063
|
boxSizing: "border-box",
|
|
@@ -1072,7 +1074,7 @@ const wt = Q("span", {
|
|
|
1072
1074
|
[`&.${ge.checked}`]: {
|
|
1073
1075
|
"--Icon-color": "currentColor"
|
|
1074
1076
|
}
|
|
1075
|
-
}), ...o.disableIcon ? [] : [
|
|
1077
|
+
}), ...o.disableIcon ? [] : [D({}, s, {
|
|
1076
1078
|
backgroundColor: (a = s == null ? void 0 : s.backgroundColor) != null ? a : e.vars.palette.background.surface
|
|
1077
1079
|
}), {
|
|
1078
1080
|
"&:hover": {
|
|
@@ -1083,7 +1085,7 @@ const wt = Q("span", {
|
|
|
1083
1085
|
}, {
|
|
1084
1086
|
[`&.${ge.disabled}`]: (c = e.variants[`${o.variant}Disabled`]) == null ? void 0 : c[o.color]
|
|
1085
1087
|
}]];
|
|
1086
|
-
}),
|
|
1088
|
+
}), Ft = Y("span", {
|
|
1087
1089
|
name: "JoyRadio",
|
|
1088
1090
|
slot: "Action",
|
|
1089
1091
|
overridesResolver: (o, e) => e.action
|
|
@@ -1091,7 +1093,7 @@ const wt = Q("span", {
|
|
|
1091
1093
|
theme: o,
|
|
1092
1094
|
ownerState: e
|
|
1093
1095
|
}) => {
|
|
1094
|
-
var
|
|
1096
|
+
var r, a, l, i;
|
|
1095
1097
|
return [{
|
|
1096
1098
|
position: "absolute",
|
|
1097
1099
|
textAlign: "left",
|
|
@@ -1106,7 +1108,7 @@ const wt = Q("span", {
|
|
|
1106
1108
|
zIndex: 1,
|
|
1107
1109
|
// The action element usually cover the area of nearest positioned parent
|
|
1108
1110
|
[o.focus.selector]: o.focus.default
|
|
1109
|
-
}, ...e.disableIcon ? [(
|
|
1111
|
+
}, ...e.disableIcon ? [(r = o.variants[e.variant]) == null ? void 0 : r[e.color], {
|
|
1110
1112
|
"&:hover": {
|
|
1111
1113
|
"@media (hover: hover)": (a = o.variants[`${e.variant}Hover`]) == null ? void 0 : a[e.color]
|
|
1112
1114
|
}
|
|
@@ -1115,7 +1117,7 @@ const wt = Q("span", {
|
|
|
1115
1117
|
}, {
|
|
1116
1118
|
[`&.${ge.disabled}`]: (i = o.variants[`${e.variant}Disabled`]) == null ? void 0 : i[e.color]
|
|
1117
1119
|
}] : []];
|
|
1118
|
-
}),
|
|
1120
|
+
}), At = Y("input", {
|
|
1119
1121
|
name: "JoyRadio",
|
|
1120
1122
|
slot: "Input",
|
|
1121
1123
|
overridesResolver: (o, e) => e.input
|
|
@@ -1126,13 +1128,13 @@ const wt = Q("span", {
|
|
|
1126
1128
|
height: "100%",
|
|
1127
1129
|
width: "100%",
|
|
1128
1130
|
cursor: "pointer"
|
|
1129
|
-
})),
|
|
1131
|
+
})), Bt = Y("label", {
|
|
1130
1132
|
name: "JoyRadio",
|
|
1131
1133
|
slot: "Label",
|
|
1132
1134
|
overridesResolver: (o, e) => e.label
|
|
1133
1135
|
})(({
|
|
1134
1136
|
ownerState: o
|
|
1135
|
-
}) =>
|
|
1137
|
+
}) => D({
|
|
1136
1138
|
flex: 1,
|
|
1137
1139
|
minWidth: 0
|
|
1138
1140
|
}, o.disableIcon && {
|
|
@@ -1140,7 +1142,7 @@ const wt = Q("span", {
|
|
|
1140
1142
|
// label should stay on top of the action.
|
|
1141
1143
|
pointerEvents: "none"
|
|
1142
1144
|
// makes hover ineffect.
|
|
1143
|
-
})),
|
|
1145
|
+
})), Ht = Y("span", {
|
|
1144
1146
|
name: "JoyRadio",
|
|
1145
1147
|
slot: "Icon",
|
|
1146
1148
|
overridesResolver: (o, e) => e.icon
|
|
@@ -1153,7 +1155,7 @@ const wt = Q("span", {
|
|
|
1153
1155
|
color: "inherit",
|
|
1154
1156
|
backgroundColor: "currentColor",
|
|
1155
1157
|
transform: o.checked ? "scale(1)" : "scale(0)"
|
|
1156
|
-
})), to = /* @__PURE__ */ I.forwardRef(function(e,
|
|
1158
|
+
})), to = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
1157
1159
|
var a, l, i, c, s, u, d;
|
|
1158
1160
|
const p = ue({
|
|
1159
1161
|
props: e,
|
|
@@ -1182,7 +1184,7 @@ const wt = Q("span", {
|
|
|
1182
1184
|
component: k,
|
|
1183
1185
|
slots: _ = {},
|
|
1184
1186
|
slotProps: P = {}
|
|
1185
|
-
} = p, V = pe(p,
|
|
1187
|
+
} = p, V = pe(p, Vt), m = I.useContext($e);
|
|
1186
1188
|
if (process.env.NODE_ENV !== "production") {
|
|
1187
1189
|
const Te = m == null ? void 0 : m.registerEffect;
|
|
1188
1190
|
I.useEffect(() => {
|
|
@@ -1190,8 +1192,8 @@ const wt = Q("span", {
|
|
|
1190
1192
|
return Te();
|
|
1191
1193
|
}, [Te]);
|
|
1192
1194
|
}
|
|
1193
|
-
const
|
|
1194
|
-
checked: typeof g > "u" && K != null ?
|
|
1195
|
+
const M = xe(T ?? (m == null ? void 0 : m.htmlFor)), z = I.useContext(Qe), ee = m != null && m.error ? "danger" : (a = (l = (i = e.color) != null ? i : m == null ? void 0 : m.color) != null ? l : A) != null ? a : "primary", fe = m != null && m.error ? "danger" : (c = (s = (u = e.color) != null ? u : m == null ? void 0 : m.color) != null ? s : A) != null ? c : "neutral", ve = e.size || (m == null ? void 0 : m.size) || (z == null ? void 0 : z.size) || U, Pe = e.name || (z == null ? void 0 : z.name) || y, ne = e.disableIcon || (z == null ? void 0 : z.disableIcon) || C, Se = e.overlay || (z == null ? void 0 : z.overlay) || R, w = {
|
|
1196
|
+
checked: typeof g > "u" && K != null ? Nt(z == null ? void 0 : z.value, K) : g,
|
|
1195
1197
|
defaultChecked: f,
|
|
1196
1198
|
disabled: e.disabled || (m == null ? void 0 : m.disabled) || b,
|
|
1197
1199
|
onBlur: $,
|
|
@@ -1199,12 +1201,12 @@ const wt = Q("span", {
|
|
|
1199
1201
|
onFocus: E,
|
|
1200
1202
|
onFocusVisible: h
|
|
1201
1203
|
}, {
|
|
1202
|
-
getInputProps:
|
|
1203
|
-
checked:
|
|
1204
|
+
getInputProps: q,
|
|
1205
|
+
checked: X,
|
|
1204
1206
|
disabled: he,
|
|
1205
1207
|
focusVisible: se
|
|
1206
|
-
} = Bo(w), lo = (d = e.color) != null ? d :
|
|
1207
|
-
checked:
|
|
1208
|
+
} = Bo(w), lo = (d = e.color) != null ? d : X ? ee : fe, ie = D({}, p, {
|
|
1209
|
+
checked: X,
|
|
1208
1210
|
disabled: he,
|
|
1209
1211
|
focusVisible: se,
|
|
1210
1212
|
color: lo,
|
|
@@ -1213,36 +1215,36 @@ const wt = Q("span", {
|
|
|
1213
1215
|
disableIcon: ne,
|
|
1214
1216
|
overlay: Se,
|
|
1215
1217
|
orientation: z == null ? void 0 : z.orientation
|
|
1216
|
-
}), ce =
|
|
1218
|
+
}), ce = wt(ie), de = D({}, V, {
|
|
1217
1219
|
component: k,
|
|
1218
1220
|
slots: _,
|
|
1219
1221
|
slotProps: P
|
|
1220
1222
|
}), [ao, co] = Z("root", {
|
|
1221
|
-
ref:
|
|
1223
|
+
ref: r,
|
|
1222
1224
|
className: ce.root,
|
|
1223
|
-
elementType:
|
|
1225
|
+
elementType: _t,
|
|
1224
1226
|
externalForwardedProps: de,
|
|
1225
1227
|
ownerState: ie
|
|
1226
1228
|
}), [uo, po] = Z("radio", {
|
|
1227
1229
|
className: ce.radio,
|
|
1228
|
-
elementType:
|
|
1230
|
+
elementType: Lt,
|
|
1229
1231
|
externalForwardedProps: de,
|
|
1230
1232
|
ownerState: ie
|
|
1231
1233
|
}), [mo, fo] = Z("icon", {
|
|
1232
1234
|
className: ce.icon,
|
|
1233
|
-
elementType:
|
|
1235
|
+
elementType: Ht,
|
|
1234
1236
|
externalForwardedProps: de,
|
|
1235
1237
|
ownerState: ie
|
|
1236
1238
|
}), [vo, ho] = Z("action", {
|
|
1237
1239
|
className: ce.action,
|
|
1238
|
-
elementType:
|
|
1240
|
+
elementType: Ft,
|
|
1239
1241
|
externalForwardedProps: de,
|
|
1240
1242
|
ownerState: ie
|
|
1241
1243
|
}), [yo, go] = Z("input", {
|
|
1242
1244
|
additionalProps: {
|
|
1243
1245
|
type: "radio",
|
|
1244
1246
|
role: void 0,
|
|
1245
|
-
id:
|
|
1247
|
+
id: M,
|
|
1246
1248
|
name: Pe,
|
|
1247
1249
|
readOnly: O,
|
|
1248
1250
|
required: N ?? (m == null ? void 0 : m.required),
|
|
@@ -1250,28 +1252,28 @@ const wt = Q("span", {
|
|
|
1250
1252
|
"aria-describedby": m == null ? void 0 : m["aria-describedby"]
|
|
1251
1253
|
},
|
|
1252
1254
|
className: ce.input,
|
|
1253
|
-
elementType:
|
|
1255
|
+
elementType: At,
|
|
1254
1256
|
externalForwardedProps: de,
|
|
1255
|
-
getSlotProps: () =>
|
|
1257
|
+
getSlotProps: () => q({
|
|
1256
1258
|
onChange: z == null ? void 0 : z.onChange
|
|
1257
1259
|
}),
|
|
1258
1260
|
ownerState: ie
|
|
1259
1261
|
}), [bo, xo] = Z("label", {
|
|
1260
1262
|
additionalProps: {
|
|
1261
|
-
htmlFor:
|
|
1263
|
+
htmlFor: M
|
|
1262
1264
|
},
|
|
1263
1265
|
className: ce.label,
|
|
1264
|
-
elementType:
|
|
1266
|
+
elementType: Bt,
|
|
1265
1267
|
externalForwardedProps: de,
|
|
1266
1268
|
ownerState: ie
|
|
1267
1269
|
});
|
|
1268
|
-
return /* @__PURE__ */ F(ao,
|
|
1269
|
-
children: [/* @__PURE__ */ F(uo,
|
|
1270
|
-
children: [
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1270
|
+
return /* @__PURE__ */ F(ao, D({}, co, {
|
|
1271
|
+
children: [/* @__PURE__ */ F(uo, D({}, po, {
|
|
1272
|
+
children: [X && !ne && x, !X && !ne && B, !x && !B && !ne && /* @__PURE__ */ n(mo, D({}, fo)), /* @__PURE__ */ n(vo, D({}, ho, {
|
|
1273
|
+
children: /* @__PURE__ */ n(yo, D({}, go))
|
|
1272
1274
|
}))]
|
|
1273
|
-
})), S && /* @__PURE__ */
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1275
|
+
})), S && /* @__PURE__ */ n(bo, D({}, xo, {
|
|
1276
|
+
children: /* @__PURE__ */ n(Mo.Provider, {
|
|
1275
1277
|
value: !0,
|
|
1276
1278
|
children: S
|
|
1277
1279
|
})
|
|
@@ -1415,21 +1417,21 @@ process.env.NODE_ENV !== "production" && (to.propTypes = {
|
|
|
1415
1417
|
*/
|
|
1416
1418
|
variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
|
|
1417
1419
|
});
|
|
1418
|
-
function
|
|
1420
|
+
function jt(o) {
|
|
1419
1421
|
return Ce("MuiRadioGroup", o);
|
|
1420
1422
|
}
|
|
1421
1423
|
Re("MuiRadioGroup", ["root", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "variantPlain", "variantOutlined", "variantSoft", "variantSolid", "sizeSm", "sizeMd", "sizeLg", "horizontal", "vertical"]);
|
|
1422
|
-
const
|
|
1424
|
+
const Ut = ["className", "component", "children", "name", "defaultValue", "disableIcon", "overlay", "value", "onChange", "color", "variant", "size", "orientation", "role", "slots", "slotProps"], Kt = (o) => {
|
|
1423
1425
|
const {
|
|
1424
1426
|
orientation: e,
|
|
1425
|
-
size:
|
|
1427
|
+
size: r,
|
|
1426
1428
|
variant: a,
|
|
1427
1429
|
color: l
|
|
1428
1430
|
} = o, i = {
|
|
1429
|
-
root: ["root", e, a && `variant${G(a)}`, l && `color${G(l)}`,
|
|
1431
|
+
root: ["root", e, a && `variant${G(a)}`, l && `color${G(l)}`, r && `size${G(r)}`]
|
|
1430
1432
|
};
|
|
1431
|
-
return me(i,
|
|
1432
|
-
},
|
|
1433
|
+
return me(i, jt, {});
|
|
1434
|
+
}, Wt = Y("div", {
|
|
1433
1435
|
name: "JoyRadioGroup",
|
|
1434
1436
|
slot: "Root",
|
|
1435
1437
|
overridesResolver: (o, e) => e.root
|
|
@@ -1437,8 +1439,8 @@ const Ht = ["className", "component", "children", "name", "defaultValue", "disab
|
|
|
1437
1439
|
ownerState: o,
|
|
1438
1440
|
theme: e
|
|
1439
1441
|
}) => {
|
|
1440
|
-
var
|
|
1441
|
-
return
|
|
1442
|
+
var r;
|
|
1443
|
+
return D({}, o.size === "sm" && {
|
|
1442
1444
|
"--RadioGroup-gap": "0.625rem"
|
|
1443
1445
|
}, o.size === "md" && {
|
|
1444
1446
|
"--RadioGroup-gap": "0.875rem"
|
|
@@ -1449,8 +1451,8 @@ const Ht = ["className", "component", "children", "name", "defaultValue", "disab
|
|
|
1449
1451
|
margin: "var(--unstable_RadioGroup-margin)",
|
|
1450
1452
|
flexDirection: o.orientation === "horizontal" ? "row" : "column",
|
|
1451
1453
|
borderRadius: e.vars.radius.sm
|
|
1452
|
-
}, (
|
|
1453
|
-
}), ro = /* @__PURE__ */ I.forwardRef(function(e,
|
|
1454
|
+
}, (r = e.variants[o.variant]) == null ? void 0 : r[o.color]);
|
|
1455
|
+
}), ro = /* @__PURE__ */ I.forwardRef(function(e, r) {
|
|
1454
1456
|
const a = ue({
|
|
1455
1457
|
props: e,
|
|
1456
1458
|
name: "JoyRadioGroup"
|
|
@@ -1471,17 +1473,17 @@ const Ht = ["className", "component", "children", "name", "defaultValue", "disab
|
|
|
1471
1473
|
role: S = "radiogroup",
|
|
1472
1474
|
slots: T = {},
|
|
1473
1475
|
slotProps: y = {}
|
|
1474
|
-
} = a, $ = pe(a,
|
|
1476
|
+
} = a, $ = pe(a, Ut), [v, E] = zo({
|
|
1475
1477
|
controlled: g,
|
|
1476
1478
|
default: u,
|
|
1477
1479
|
name: "RadioGroup"
|
|
1478
|
-
}), h = I.useContext($e), O = e.size || (h == null ? void 0 : h.size) || C, N =
|
|
1480
|
+
}), h = I.useContext($e), O = e.size || (h == null ? void 0 : h.size) || C, N = D({
|
|
1479
1481
|
orientation: R,
|
|
1480
1482
|
size: O,
|
|
1481
1483
|
variant: b,
|
|
1482
1484
|
color: f,
|
|
1483
1485
|
role: S
|
|
1484
|
-
}, a), A =
|
|
1486
|
+
}, a), A = Kt(N), j = xe(s);
|
|
1485
1487
|
if (process.env.NODE_ENV !== "production") {
|
|
1486
1488
|
const k = h == null ? void 0 : h.registerEffect;
|
|
1487
1489
|
I.useEffect(() => {
|
|
@@ -1500,10 +1502,10 @@ const Ht = ["className", "component", "children", "name", "defaultValue", "disab
|
|
|
1500
1502
|
E(k.target.value), x && x(k);
|
|
1501
1503
|
}
|
|
1502
1504
|
}), [d, j, x, p, R, E, O, v]), [B, K] = Z("root", {
|
|
1503
|
-
ref:
|
|
1505
|
+
ref: r,
|
|
1504
1506
|
className: Je(A.root, l),
|
|
1505
|
-
elementType:
|
|
1506
|
-
externalForwardedProps:
|
|
1507
|
+
elementType: Wt,
|
|
1508
|
+
externalForwardedProps: D({}, $, {
|
|
1507
1509
|
component: i,
|
|
1508
1510
|
slots: T,
|
|
1509
1511
|
slotProps: y
|
|
@@ -1520,12 +1522,12 @@ const Ht = ["className", "component", "children", "name", "defaultValue", "disab
|
|
|
1520
1522
|
"aria-describedby": h == null ? void 0 : h["aria-describedby"]
|
|
1521
1523
|
}
|
|
1522
1524
|
});
|
|
1523
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ n(Qe.Provider, {
|
|
1524
1526
|
value: U,
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1526
|
-
children: /* @__PURE__ */
|
|
1527
|
+
children: /* @__PURE__ */ n(B, D({}, K, {
|
|
1528
|
+
children: /* @__PURE__ */ n($e.Provider, {
|
|
1527
1529
|
value: void 0,
|
|
1528
|
-
children: I.Children.map(c, (k, _) => /* @__PURE__ */ I.isValidElement(k) ? /* @__PURE__ */ I.cloneElement(k,
|
|
1530
|
+
children: I.Children.map(c, (k, _) => /* @__PURE__ */ I.isValidElement(k) ? /* @__PURE__ */ I.cloneElement(k, D({}, _ === 0 && {
|
|
1529
1531
|
"data-first-child": ""
|
|
1530
1532
|
}, _ === I.Children.count(c) - 1 && {
|
|
1531
1533
|
"data-last-child": ""
|
|
@@ -1627,8 +1629,8 @@ process.env.NODE_ENV !== "production" && (ro.propTypes = {
|
|
|
1627
1629
|
*/
|
|
1628
1630
|
variant: t.oneOfType([t.oneOf(["outlined", "plain", "soft", "solid"]), t.string])
|
|
1629
1631
|
});
|
|
1630
|
-
const
|
|
1631
|
-
const [
|
|
1632
|
+
const Gt = (o, e) => {
|
|
1633
|
+
const [r, a] = H(null), [l, i] = H(!0), [c, s] = H(null), [u, d] = H(!1);
|
|
1632
1634
|
return be(() => {
|
|
1633
1635
|
e && (async () => {
|
|
1634
1636
|
try {
|
|
@@ -1641,8 +1643,8 @@ const Kt = (o, e) => {
|
|
|
1641
1643
|
i(!1);
|
|
1642
1644
|
}
|
|
1643
1645
|
})();
|
|
1644
|
-
}, [o, e]), { discussion:
|
|
1645
|
-
},
|
|
1646
|
+
}, [o, e]), { discussion: r, setDiscussion: a, isLoading: l, error: c, isNotFound: u };
|
|
1647
|
+
}, Jt = (o, e, r = null, a = "", l = "LATEST", i = 20, c, s = !1) => {
|
|
1646
1648
|
const [u, d] = H([]), [p, g] = H(!0), [x, f] = H(!1), [b, C] = H(null), [R, S] = H(l), [T, y] = H(
|
|
1647
1649
|
null
|
|
1648
1650
|
), [$, v] = H(!1), E = Ae(
|
|
@@ -1650,20 +1652,20 @@ const Kt = (o, e) => {
|
|
|
1650
1652
|
var V, m;
|
|
1651
1653
|
try {
|
|
1652
1654
|
g(!0);
|
|
1653
|
-
const
|
|
1655
|
+
const M = await o.discussions.getPosts(e, {
|
|
1654
1656
|
sort: k,
|
|
1655
1657
|
limit: i,
|
|
1656
1658
|
startAfter: _,
|
|
1657
1659
|
skipDeleted: !0,
|
|
1658
1660
|
skipModerated: !s
|
|
1659
|
-
}), z =
|
|
1661
|
+
}), z = M.data;
|
|
1660
1662
|
d(P ? (fe) => [...fe, ...z] : z);
|
|
1661
|
-
const ee = !!((V =
|
|
1663
|
+
const ee = !!((V = M.meta.pagination) != null && V.nextPageStartsAfter) && z.length === i;
|
|
1662
1664
|
y(
|
|
1663
|
-
((m =
|
|
1665
|
+
((m = M.meta.pagination) == null ? void 0 : m.nextPageStartsAfter) || null
|
|
1664
1666
|
), v(ee), C(null);
|
|
1665
|
-
} catch (
|
|
1666
|
-
(o.helpers.getSDKConfiguration().errorHandlingMode === "standard" ?
|
|
1667
|
+
} catch (M) {
|
|
1668
|
+
(o.helpers.getSDKConfiguration().errorHandlingMode === "standard" ? M.error.code === 404 : M.data.error.code === 404) ? (d([]), v(!1), y(null), C(null)) : C(b);
|
|
1667
1669
|
} finally {
|
|
1668
1670
|
g(!1);
|
|
1669
1671
|
}
|
|
@@ -1698,7 +1700,7 @@ const Kt = (o, e) => {
|
|
|
1698
1700
|
content: k,
|
|
1699
1701
|
replyId: _ || null,
|
|
1700
1702
|
userNickname: null,
|
|
1701
|
-
discussionLabel:
|
|
1703
|
+
discussionLabel: r,
|
|
1702
1704
|
discussionUrl: a,
|
|
1703
1705
|
context: {
|
|
1704
1706
|
content: null,
|
|
@@ -1713,7 +1715,7 @@ const Kt = (o, e) => {
|
|
|
1713
1715
|
}
|
|
1714
1716
|
d(
|
|
1715
1717
|
_ ? (m) => m.map(
|
|
1716
|
-
(
|
|
1718
|
+
(M) => M.id === _ ? { ...M, repliesCount: (M.repliesCount || 0) + 1 } : M
|
|
1717
1719
|
) : (m) => [V, ...m]
|
|
1718
1720
|
), c == null || c(1), C(null);
|
|
1719
1721
|
} catch (P) {
|
|
@@ -1762,13 +1764,13 @@ const Kt = (o, e) => {
|
|
|
1762
1764
|
}, no = ({
|
|
1763
1765
|
onSubmit: o,
|
|
1764
1766
|
userIsLoggedIn: e,
|
|
1765
|
-
onSignInClick:
|
|
1767
|
+
onSignInClick: r,
|
|
1766
1768
|
placeholder: a,
|
|
1767
1769
|
isSubmitting: l,
|
|
1768
1770
|
replyTo: i,
|
|
1769
1771
|
onCancel: c
|
|
1770
1772
|
}) => {
|
|
1771
|
-
const { t: s } = le(), [u, d] = H(""), p = te(), g = ae(), x =
|
|
1773
|
+
const { t: s } = le(), [u, d] = H(""), p = te(), g = ae(), x = Me(), f = re(), b = p.palette.primary.plainColor, C = p.palette.primary.onPrimary, R = async (S) => {
|
|
1772
1774
|
if (S.preventDefault(), !!u.trim())
|
|
1773
1775
|
try {
|
|
1774
1776
|
await o(u), d("");
|
|
@@ -1777,10 +1779,10 @@ const Kt = (o, e) => {
|
|
|
1777
1779
|
}
|
|
1778
1780
|
};
|
|
1779
1781
|
return e ? /* @__PURE__ */ F(L, { component: "form", onSubmit: R, sx: { mb: f.lg }, children: [
|
|
1780
|
-
i && /* @__PURE__ */
|
|
1782
|
+
i && /* @__PURE__ */ n(W, { level: "body-sm", sx: { mb: f.xs, color: p.textSecondary }, children: s("discussion.replyingTo", "Replying to {{name}}", {
|
|
1781
1783
|
name: i
|
|
1782
1784
|
}) }),
|
|
1783
|
-
/* @__PURE__ */
|
|
1785
|
+
/* @__PURE__ */ n(
|
|
1784
1786
|
Ye,
|
|
1785
1787
|
{
|
|
1786
1788
|
placeholder: a || s("discussion.writeComment", "Write a comment..."),
|
|
@@ -1807,7 +1809,7 @@ const Kt = (o, e) => {
|
|
|
1807
1809
|
}
|
|
1808
1810
|
),
|
|
1809
1811
|
/* @__PURE__ */ F(L, { sx: { display: "flex", gap: f.xs, justifyContent: "flex-end" }, children: [
|
|
1810
|
-
c && /* @__PURE__ */
|
|
1812
|
+
c && /* @__PURE__ */ n(
|
|
1811
1813
|
oe,
|
|
1812
1814
|
{
|
|
1813
1815
|
variant: "plain",
|
|
@@ -1824,7 +1826,7 @@ const Kt = (o, e) => {
|
|
|
1824
1826
|
children: s("common.cancel", "Cancel")
|
|
1825
1827
|
}
|
|
1826
1828
|
),
|
|
1827
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ n(
|
|
1828
1830
|
oe,
|
|
1829
1831
|
{
|
|
1830
1832
|
type: "submit",
|
|
@@ -1850,12 +1852,12 @@ const Kt = (o, e) => {
|
|
|
1850
1852
|
}
|
|
1851
1853
|
)
|
|
1852
1854
|
] })
|
|
1853
|
-
] }) : /* @__PURE__ */
|
|
1855
|
+
] }) : /* @__PURE__ */ n(L, { sx: { mb: f.lg }, children: /* @__PURE__ */ n(
|
|
1854
1856
|
oe,
|
|
1855
1857
|
{
|
|
1856
1858
|
fullWidth: !0,
|
|
1857
1859
|
variant: "outlined",
|
|
1858
|
-
onClick:
|
|
1860
|
+
onClick: r,
|
|
1859
1861
|
sx: {
|
|
1860
1862
|
py: f.sm,
|
|
1861
1863
|
fontFamily: x.primary,
|
|
@@ -1870,66 +1872,62 @@ const Kt = (o, e) => {
|
|
|
1870
1872
|
children: s("discussion.signInToPost", "Sign in to post")
|
|
1871
1873
|
}
|
|
1872
1874
|
) });
|
|
1873
|
-
},
|
|
1875
|
+
}, qt = Q(/* @__PURE__ */ n("path", {
|
|
1874
1876
|
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"
|
|
1875
|
-
}), "Delete"),
|
|
1877
|
+
}), "Delete"), Xt = Q(/* @__PURE__ */ n("path", {
|
|
1876
1878
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
|
|
1877
|
-
}), "EmojiEmotions"),
|
|
1878
|
-
d: "m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"
|
|
1879
|
-
}), "Favorite"), Xt = J(/* @__PURE__ */ r("path", {
|
|
1880
|
-
d: "M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"
|
|
1881
|
-
}), "FavoriteBorder"), Yt = J(/* @__PURE__ */ r("path", {
|
|
1879
|
+
}), "EmojiEmotions"), Yt = Q(/* @__PURE__ */ n("path", {
|
|
1882
1880
|
d: "M14.4 6 14 4H5v17h2v-7h5.6l.4 2h7V6z"
|
|
1883
|
-
}), "Flag"), Qt =
|
|
1881
|
+
}), "Flag"), Qt = Q(/* @__PURE__ */ n("path", {
|
|
1884
1882
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11m3.5 3c-2.33 0-4.31 1.46-5.11 3.5h10.22c-.8-2.04-2.78-3.5-5.11-3.5"
|
|
1885
|
-
}), "MoodBad"), Zt =
|
|
1883
|
+
}), "MoodBad"), Zt = Q(/* @__PURE__ */ n("path", {
|
|
1886
1884
|
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
|
|
1887
|
-
}), "MoreVert"), er =
|
|
1885
|
+
}), "MoreVert"), er = Q(/* @__PURE__ */ n("path", {
|
|
1888
1886
|
d: "M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"
|
|
1889
|
-
}), "RemoveCircleOutline"), or =
|
|
1887
|
+
}), "RemoveCircleOutline"), or = Q(/* @__PURE__ */ n("path", {
|
|
1890
1888
|
d: "M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11"
|
|
1891
|
-
}), "Reply"), tr =
|
|
1889
|
+
}), "Reply"), tr = Q([/* @__PURE__ */ n("circle", {
|
|
1892
1890
|
cx: "15.5",
|
|
1893
1891
|
cy: "9.5",
|
|
1894
1892
|
r: "1.5"
|
|
1895
|
-
}, "0"), /* @__PURE__ */
|
|
1893
|
+
}, "0"), /* @__PURE__ */ n("circle", {
|
|
1896
1894
|
cx: "8.5",
|
|
1897
1895
|
cy: "9.5",
|
|
1898
1896
|
r: "1.5"
|
|
1899
|
-
}, "1"), /* @__PURE__ */
|
|
1897
|
+
}, "1"), /* @__PURE__ */ n("path", {
|
|
1900
1898
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-4c-.73 0-1.38-.18-1.96-.52-.12.14-.86.98-1.01 1.15.86.55 1.87.87 2.97.87 1.11 0 2.12-.33 2.98-.88-.97-1.09-.01-.02-1.01-1.15-.59.35-1.24.53-1.97.53"
|
|
1901
|
-
}, "2")], "SentimentSatisfied"), rr =
|
|
1899
|
+
}, "2")], "SentimentSatisfied"), rr = Q([/* @__PURE__ */ n("circle", {
|
|
1902
1900
|
cx: "15.5",
|
|
1903
1901
|
cy: "9.5",
|
|
1904
1902
|
r: "1.5"
|
|
1905
|
-
}, "0"), /* @__PURE__ */
|
|
1903
|
+
}, "0"), /* @__PURE__ */ n("circle", {
|
|
1906
1904
|
cx: "8.5",
|
|
1907
1905
|
cy: "9.5",
|
|
1908
1906
|
r: "1.5"
|
|
1909
|
-
}, "1"), /* @__PURE__ */
|
|
1907
|
+
}, "1"), /* @__PURE__ */ n("path", {
|
|
1910
1908
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5"
|
|
1911
|
-
}, "2")], "SentimentVeryDissatisfied"), nr =
|
|
1909
|
+
}, "2")], "SentimentVeryDissatisfied"), nr = Q(/* @__PURE__ */ n("path", {
|
|
1912
1910
|
d: "M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2m4 0v12h4V3z"
|
|
1913
|
-
}), "ThumbDown"), sr =
|
|
1911
|
+
}), "ThumbDown"), sr = Q(/* @__PURE__ */ n("path", {
|
|
1914
1912
|
d: "M1 21h4V9H1zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73z"
|
|
1915
1913
|
}), "ThumbUp"), ir = {
|
|
1916
|
-
LIKE: /* @__PURE__ */
|
|
1917
|
-
DISLIKE: /* @__PURE__ */
|
|
1918
|
-
LOVE: /* @__PURE__ */
|
|
1919
|
-
LAUGH: /* @__PURE__ */
|
|
1920
|
-
CARE: /* @__PURE__ */
|
|
1921
|
-
WOW: /* @__PURE__ */
|
|
1922
|
-
SAD: /* @__PURE__ */
|
|
1923
|
-
ANGRY: /* @__PURE__ */
|
|
1914
|
+
LIKE: /* @__PURE__ */ n(sr, { fontSize: "small" }),
|
|
1915
|
+
DISLIKE: /* @__PURE__ */ n(nr, { fontSize: "small" }),
|
|
1916
|
+
LOVE: /* @__PURE__ */ n(Ho, { fontSize: "small" }),
|
|
1917
|
+
LAUGH: /* @__PURE__ */ n(tr, { fontSize: "small" }),
|
|
1918
|
+
CARE: /* @__PURE__ */ n(jo, { fontSize: "small" }),
|
|
1919
|
+
WOW: /* @__PURE__ */ n(Xt, { fontSize: "small" }),
|
|
1920
|
+
SAD: /* @__PURE__ */ n(rr, { fontSize: "small" }),
|
|
1921
|
+
ANGRY: /* @__PURE__ */ n(Qt, { fontSize: "small" })
|
|
1924
1922
|
}, Ue = ({
|
|
1925
1923
|
reaction: o,
|
|
1926
1924
|
count: e,
|
|
1927
|
-
isActive:
|
|
1925
|
+
isActive: r,
|
|
1928
1926
|
onClick: a,
|
|
1929
1927
|
disabled: l
|
|
1930
1928
|
}) => {
|
|
1931
1929
|
const i = te(), c = re(), s = (d) => d >= 1e6 ? (d / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : d >= 1e3 ? (d / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : d.toString(), u = () => {
|
|
1932
|
-
if (!
|
|
1930
|
+
if (!r) return i.textSecondary;
|
|
1933
1931
|
switch (o) {
|
|
1934
1932
|
case "LIKE":
|
|
1935
1933
|
return i.palette.primary.plainColor;
|
|
@@ -1953,7 +1951,7 @@ const Kt = (o, e) => {
|
|
|
1953
1951
|
px: c.sm,
|
|
1954
1952
|
py: c["2xs"],
|
|
1955
1953
|
borderRadius: "18px",
|
|
1956
|
-
backgroundColor:
|
|
1954
|
+
backgroundColor: r ? `${i.palette.neutral.softBg}` : "transparent",
|
|
1957
1955
|
color: u(),
|
|
1958
1956
|
"&:hover": {
|
|
1959
1957
|
backgroundColor: `${i.palette.neutral.softHoverBg}`
|
|
@@ -1963,7 +1961,7 @@ const Kt = (o, e) => {
|
|
|
1963
1961
|
},
|
|
1964
1962
|
onClick: l ? void 0 : a,
|
|
1965
1963
|
children: [
|
|
1966
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ n(
|
|
1967
1965
|
L,
|
|
1968
1966
|
{
|
|
1969
1967
|
sx: {
|
|
@@ -1975,12 +1973,12 @@ const Kt = (o, e) => {
|
|
|
1975
1973
|
children: ir[o]
|
|
1976
1974
|
}
|
|
1977
1975
|
),
|
|
1978
|
-
e > 0 && /* @__PURE__ */
|
|
1976
|
+
e > 0 && /* @__PURE__ */ n(
|
|
1979
1977
|
W,
|
|
1980
1978
|
{
|
|
1981
1979
|
level: "body-sm",
|
|
1982
1980
|
sx: {
|
|
1983
|
-
color:
|
|
1981
|
+
color: r ? u() : i.textPrimary,
|
|
1984
1982
|
fontWeight: 500
|
|
1985
1983
|
},
|
|
1986
1984
|
children: s(e)
|
|
@@ -1990,7 +1988,7 @@ const Kt = (o, e) => {
|
|
|
1990
1988
|
}
|
|
1991
1989
|
);
|
|
1992
1990
|
}, so = (o, e) => {
|
|
1993
|
-
const [
|
|
1991
|
+
const [r, a] = H(null);
|
|
1994
1992
|
return be(() => {
|
|
1995
1993
|
(async () => {
|
|
1996
1994
|
if (e)
|
|
@@ -2001,11 +1999,11 @@ const Kt = (o, e) => {
|
|
|
2001
1999
|
console.error("Failed to get current user ID:", i);
|
|
2002
2000
|
}
|
|
2003
2001
|
})();
|
|
2004
|
-
}, [e, o]),
|
|
2002
|
+
}, [e, o]), r;
|
|
2005
2003
|
}, lr = ({
|
|
2006
2004
|
post: o,
|
|
2007
2005
|
sdk: e,
|
|
2008
|
-
userIsLoggedIn:
|
|
2006
|
+
userIsLoggedIn: r,
|
|
2009
2007
|
onSignInClick: a,
|
|
2010
2008
|
onReact: l,
|
|
2011
2009
|
showReactions: i = !0,
|
|
@@ -2013,7 +2011,7 @@ const Kt = (o, e) => {
|
|
|
2013
2011
|
onReplyClick: s
|
|
2014
2012
|
}) => {
|
|
2015
2013
|
var S, T, y, $;
|
|
2016
|
-
const { t: u } = le(), d = te(), p = ae(), g =
|
|
2014
|
+
const { t: u } = le(), d = te(), p = ae(), g = Me(), x = re(), f = so(e, r), C = (() => {
|
|
2017
2015
|
if (!f || !o.reactions)
|
|
2018
2016
|
return null;
|
|
2019
2017
|
for (const v of o.reactions)
|
|
@@ -2021,7 +2019,7 @@ const Kt = (o, e) => {
|
|
|
2021
2019
|
return v.type;
|
|
2022
2020
|
return null;
|
|
2023
2021
|
})(), R = (v) => {
|
|
2024
|
-
if (!
|
|
2022
|
+
if (!r) {
|
|
2025
2023
|
a == null || a();
|
|
2026
2024
|
return;
|
|
2027
2025
|
}
|
|
@@ -2038,35 +2036,35 @@ const Kt = (o, e) => {
|
|
|
2038
2036
|
mb: x.xs
|
|
2039
2037
|
},
|
|
2040
2038
|
children: [
|
|
2041
|
-
i && /* @__PURE__ */ F(
|
|
2042
|
-
/* @__PURE__ */
|
|
2039
|
+
i && /* @__PURE__ */ F(De, { children: [
|
|
2040
|
+
/* @__PURE__ */ n(
|
|
2043
2041
|
Ue,
|
|
2044
2042
|
{
|
|
2045
2043
|
reaction: "LIKE",
|
|
2046
2044
|
count: ((T = (S = o.reactions) == null ? void 0 : S.find((v) => v.type === "LIKE")) == null ? void 0 : T.reactionCount) || 0,
|
|
2047
2045
|
isActive: C === "LIKE",
|
|
2048
2046
|
onClick: () => R("LIKE"),
|
|
2049
|
-
disabled: !
|
|
2047
|
+
disabled: !r
|
|
2050
2048
|
}
|
|
2051
2049
|
),
|
|
2052
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ n(
|
|
2053
2051
|
Ue,
|
|
2054
2052
|
{
|
|
2055
2053
|
reaction: "DISLIKE",
|
|
2056
2054
|
count: (($ = (y = o.reactions) == null ? void 0 : y.find((v) => v.type === "DISLIKE")) == null ? void 0 : $.reactionCount) || 0,
|
|
2057
2055
|
isActive: C === "DISLIKE",
|
|
2058
2056
|
onClick: () => R("DISLIKE"),
|
|
2059
|
-
disabled: !
|
|
2057
|
+
disabled: !r
|
|
2060
2058
|
}
|
|
2061
2059
|
)
|
|
2062
2060
|
] }),
|
|
2063
|
-
c && /* @__PURE__ */
|
|
2061
|
+
c && /* @__PURE__ */ n(
|
|
2064
2062
|
oe,
|
|
2065
2063
|
{
|
|
2066
2064
|
size: "sm",
|
|
2067
2065
|
variant: "plain",
|
|
2068
2066
|
onClick: s,
|
|
2069
|
-
startDecorator: /* @__PURE__ */
|
|
2067
|
+
startDecorator: /* @__PURE__ */ n(or, { fontSize: "small" }),
|
|
2070
2068
|
sx: {
|
|
2071
2069
|
ml: x.xs,
|
|
2072
2070
|
fontFamily: g.primary,
|
|
@@ -2091,11 +2089,11 @@ const Kt = (o, e) => {
|
|
|
2091
2089
|
}, ar = ({
|
|
2092
2090
|
isOwnPost: o,
|
|
2093
2091
|
canReport: e,
|
|
2094
|
-
onDelete:
|
|
2092
|
+
onDelete: r,
|
|
2095
2093
|
onReport: a
|
|
2096
2094
|
}) => {
|
|
2097
|
-
const { t: l } = le(), { shadowRootElement: i } = we(Ne), c = ae(), s = te(), u = re(), [d, p] =
|
|
2098
|
-
if (
|
|
2095
|
+
const { t: l } = le(), { shadowRootElement: i } = we(Ne), c = ae(), s = te(), u = re(), [d, p] = J.useState(null), g = J.useRef(null);
|
|
2096
|
+
if (J.useEffect(() => {
|
|
2099
2097
|
if (!d) return;
|
|
2100
2098
|
const b = (R) => {
|
|
2101
2099
|
const S = R.composedPath();
|
|
@@ -2121,8 +2119,8 @@ const Kt = (o, e) => {
|
|
|
2121
2119
|
color: `${s.textPrimary} !important`
|
|
2122
2120
|
}
|
|
2123
2121
|
};
|
|
2124
|
-
return /* @__PURE__ */ F(
|
|
2125
|
-
/* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ F(De, { children: [
|
|
2123
|
+
/* @__PURE__ */ n(
|
|
2126
2124
|
To,
|
|
2127
2125
|
{
|
|
2128
2126
|
size: "sm",
|
|
@@ -2135,7 +2133,7 @@ const Kt = (o, e) => {
|
|
|
2135
2133
|
bgcolor: `${s.textPrimary}14`
|
|
2136
2134
|
}
|
|
2137
2135
|
},
|
|
2138
|
-
children: /* @__PURE__ */
|
|
2136
|
+
children: /* @__PURE__ */ n(Zt, { fontSize: "small" })
|
|
2139
2137
|
}
|
|
2140
2138
|
),
|
|
2141
2139
|
/* @__PURE__ */ F(
|
|
@@ -2152,11 +2150,11 @@ const Kt = (o, e) => {
|
|
|
2152
2150
|
Ve,
|
|
2153
2151
|
{
|
|
2154
2152
|
onClick: () => {
|
|
2155
|
-
p(null),
|
|
2153
|
+
p(null), r();
|
|
2156
2154
|
},
|
|
2157
2155
|
sx: f,
|
|
2158
2156
|
children: [
|
|
2159
|
-
/* @__PURE__ */
|
|
2157
|
+
/* @__PURE__ */ n(qt, { fontSize: "small", sx: { mr: u.xs } }),
|
|
2160
2158
|
l("discussion.delete.action", "Delete")
|
|
2161
2159
|
]
|
|
2162
2160
|
}
|
|
@@ -2169,7 +2167,7 @@ const Kt = (o, e) => {
|
|
|
2169
2167
|
},
|
|
2170
2168
|
sx: f,
|
|
2171
2169
|
children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ n(Yt, { fontSize: "small", sx: { mr: u.xs } }),
|
|
2173
2171
|
l("discussion.report.action", "Report")
|
|
2174
2172
|
]
|
|
2175
2173
|
}
|
|
@@ -2181,14 +2179,14 @@ const Kt = (o, e) => {
|
|
|
2181
2179
|
}, cr = ({
|
|
2182
2180
|
open: o,
|
|
2183
2181
|
onClose: e,
|
|
2184
|
-
onConfirm:
|
|
2182
|
+
onConfirm: r,
|
|
2185
2183
|
onError: a,
|
|
2186
2184
|
container: l
|
|
2187
2185
|
}) => {
|
|
2188
|
-
const { t: i } = le(), c = te(), s = ae(), u =
|
|
2186
|
+
const { t: i } = le(), c = te(), s = ae(), u = Me(), d = re(), p = c.palette.primary.plainColor, g = c.palette.primary.onPrimary, [x, f] = H(!1), b = async () => {
|
|
2189
2187
|
f(!0);
|
|
2190
2188
|
try {
|
|
2191
|
-
await
|
|
2189
|
+
await r(), e();
|
|
2192
2190
|
} catch {
|
|
2193
2191
|
a(
|
|
2194
2192
|
i(
|
|
@@ -2200,7 +2198,7 @@ const Kt = (o, e) => {
|
|
|
2200
2198
|
f(!1);
|
|
2201
2199
|
}
|
|
2202
2200
|
};
|
|
2203
|
-
return /* @__PURE__ */
|
|
2201
|
+
return /* @__PURE__ */ n(qe, { open: o, onClose: e, container: l, children: /* @__PURE__ */ F(
|
|
2204
2202
|
Xe,
|
|
2205
2203
|
{
|
|
2206
2204
|
sx: {
|
|
@@ -2212,7 +2210,7 @@ const Kt = (o, e) => {
|
|
|
2212
2210
|
maxWidth: 400
|
|
2213
2211
|
},
|
|
2214
2212
|
children: [
|
|
2215
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ n(
|
|
2216
2214
|
W,
|
|
2217
2215
|
{
|
|
2218
2216
|
level: "title-lg",
|
|
@@ -2220,12 +2218,12 @@ const Kt = (o, e) => {
|
|
|
2220
2218
|
children: i("discussion.delete.title", "Delete comment")
|
|
2221
2219
|
}
|
|
2222
2220
|
),
|
|
2223
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ n(W, { level: "body-sm", sx: { mb: d.lg, color: c.textSecondary }, children: i(
|
|
2224
2222
|
"discussion.delete.description",
|
|
2225
2223
|
"Are you sure you want to delete this comment? This action cannot be undone."
|
|
2226
2224
|
) }),
|
|
2227
2225
|
/* @__PURE__ */ F(L, { sx: { display: "flex", gap: d.xs, justifyContent: "flex-end" }, children: [
|
|
2228
|
-
/* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ n(
|
|
2229
2227
|
oe,
|
|
2230
2228
|
{
|
|
2231
2229
|
variant: "plain",
|
|
@@ -2239,7 +2237,7 @@ const Kt = (o, e) => {
|
|
|
2239
2237
|
children: i("common.cancel", "Cancel")
|
|
2240
2238
|
}
|
|
2241
2239
|
),
|
|
2242
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ n(
|
|
2243
2241
|
oe,
|
|
2244
2242
|
{
|
|
2245
2243
|
variant: "solid",
|
|
@@ -2296,17 +2294,17 @@ const Kt = (o, e) => {
|
|
|
2296
2294
|
], ur = ({
|
|
2297
2295
|
open: o,
|
|
2298
2296
|
onClose: e,
|
|
2299
|
-
onSubmit:
|
|
2297
|
+
onSubmit: r,
|
|
2300
2298
|
onSuccess: a,
|
|
2301
2299
|
onError: l,
|
|
2302
2300
|
container: i
|
|
2303
2301
|
}) => {
|
|
2304
|
-
const { t: c } = le(), s = te(), u = ae(), d =
|
|
2302
|
+
const { t: c } = le(), s = te(), u = ae(), d = Me(), p = re(), g = s.palette.primary.plainColor, x = s.palette.primary.onPrimary, [f, b] = H(""), [C, R] = H(""), [S, T] = H(!1), y = () => {
|
|
2305
2303
|
e(), b(""), R("");
|
|
2306
2304
|
}, $ = async () => {
|
|
2307
2305
|
T(!0);
|
|
2308
2306
|
try {
|
|
2309
|
-
await
|
|
2307
|
+
await r(
|
|
2310
2308
|
f,
|
|
2311
2309
|
f === "OTHER" ? C : void 0
|
|
2312
2310
|
), a(
|
|
@@ -2326,7 +2324,7 @@ const Kt = (o, e) => {
|
|
|
2326
2324
|
T(!1);
|
|
2327
2325
|
}
|
|
2328
2326
|
};
|
|
2329
|
-
return /* @__PURE__ */
|
|
2327
|
+
return /* @__PURE__ */ n(qe, { open: o, onClose: y, container: i, children: /* @__PURE__ */ F(
|
|
2330
2328
|
Xe,
|
|
2331
2329
|
{
|
|
2332
2330
|
sx: {
|
|
@@ -2338,7 +2336,7 @@ const Kt = (o, e) => {
|
|
|
2338
2336
|
maxWidth: 440
|
|
2339
2337
|
},
|
|
2340
2338
|
children: [
|
|
2341
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ n(
|
|
2342
2340
|
oo,
|
|
2343
2341
|
{
|
|
2344
2342
|
sx: {
|
|
@@ -2347,7 +2345,7 @@ const Kt = (o, e) => {
|
|
|
2347
2345
|
}
|
|
2348
2346
|
}
|
|
2349
2347
|
),
|
|
2350
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ n(
|
|
2351
2349
|
W,
|
|
2352
2350
|
{
|
|
2353
2351
|
level: "title-lg",
|
|
@@ -2355,17 +2353,17 @@ const Kt = (o, e) => {
|
|
|
2355
2353
|
children: c("discussion.report.title", "Report post")
|
|
2356
2354
|
}
|
|
2357
2355
|
),
|
|
2358
|
-
/* @__PURE__ */
|
|
2356
|
+
/* @__PURE__ */ n(W, { level: "body-sm", sx: { mb: p.md, color: s.textSecondary }, children: c(
|
|
2359
2357
|
"discussion.report.description",
|
|
2360
2358
|
"Why are you reporting this post?"
|
|
2361
2359
|
) }),
|
|
2362
|
-
/* @__PURE__ */
|
|
2360
|
+
/* @__PURE__ */ n(
|
|
2363
2361
|
ro,
|
|
2364
2362
|
{
|
|
2365
2363
|
value: f,
|
|
2366
2364
|
onChange: (v) => b(v.target.value),
|
|
2367
2365
|
sx: { gap: p.xs, mb: p.md },
|
|
2368
|
-
children: dr.map((v) => /* @__PURE__ */
|
|
2366
|
+
children: dr.map((v) => /* @__PURE__ */ n(
|
|
2369
2367
|
to,
|
|
2370
2368
|
{
|
|
2371
2369
|
value: v.value,
|
|
@@ -2391,7 +2389,7 @@ const Kt = (o, e) => {
|
|
|
2391
2389
|
))
|
|
2392
2390
|
}
|
|
2393
2391
|
),
|
|
2394
|
-
f === "OTHER" && /* @__PURE__ */
|
|
2392
|
+
f === "OTHER" && /* @__PURE__ */ n(
|
|
2395
2393
|
Ye,
|
|
2396
2394
|
{
|
|
2397
2395
|
placeholder: c(
|
|
@@ -2418,7 +2416,7 @@ const Kt = (o, e) => {
|
|
|
2418
2416
|
}
|
|
2419
2417
|
),
|
|
2420
2418
|
/* @__PURE__ */ F(L, { sx: { display: "flex", gap: p.xs, justifyContent: "flex-end" }, children: [
|
|
2421
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ n(
|
|
2422
2420
|
oe,
|
|
2423
2421
|
{
|
|
2424
2422
|
variant: "plain",
|
|
@@ -2432,7 +2430,7 @@ const Kt = (o, e) => {
|
|
|
2432
2430
|
children: c("common.cancel", "Cancel")
|
|
2433
2431
|
}
|
|
2434
2432
|
),
|
|
2435
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ n(
|
|
2436
2434
|
oe,
|
|
2437
2435
|
{
|
|
2438
2436
|
variant: "solid",
|
|
@@ -2462,12 +2460,12 @@ const Kt = (o, e) => {
|
|
|
2462
2460
|
}
|
|
2463
2461
|
) });
|
|
2464
2462
|
}, pr = (o, e) => {
|
|
2465
|
-
const
|
|
2466
|
-
return i < 1 ? e("discussion.justNow", "Just now") : i < 60 ? e("discussion.minutesAgo", "{{count}}m ago", { count: i }) : c < 24 ? e("discussion.hoursAgo", "{{count}}h ago", { count: c }) : s < 7 ? e("discussion.daysAgo", "{{count}}d ago", { count: s }) :
|
|
2463
|
+
const r = new Date(o), l = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), i = Math.floor(l / 6e4), c = Math.floor(l / 36e5), s = Math.floor(l / 864e5);
|
|
2464
|
+
return i < 1 ? e("discussion.justNow", "Just now") : i < 60 ? e("discussion.minutesAgo", "{{count}}m ago", { count: i }) : c < 24 ? e("discussion.hoursAgo", "{{count}}h ago", { count: c }) : s < 7 ? e("discussion.daysAgo", "{{count}}d ago", { count: s }) : r.toLocaleDateString();
|
|
2467
2465
|
}, io = ({
|
|
2468
2466
|
post: o,
|
|
2469
2467
|
sdk: e,
|
|
2470
|
-
userIsLoggedIn:
|
|
2468
|
+
userIsLoggedIn: r,
|
|
2471
2469
|
onSignInClick: a,
|
|
2472
2470
|
showReactions: l = !0,
|
|
2473
2471
|
showReplies: i = !0,
|
|
@@ -2484,10 +2482,10 @@ const Kt = (o, e) => {
|
|
|
2484
2482
|
onDeleteSuccess: R
|
|
2485
2483
|
}) => {
|
|
2486
2484
|
var Pe, ne, Se, ze;
|
|
2487
|
-
const { t: S } = le(), { shadowRootElement: T } = we(Ne), y = te(), $ = ae(), v = re(), E = so(e,
|
|
2485
|
+
const { t: S } = le(), { shadowRootElement: T } = we(Ne), y = te(), $ = ae(), v = re(), E = so(e, r), [h, O] = H(!1), [N, A] = H([]), [j, U] = H(!1), [B, K] = H(!1), [k, _] = H(!1), [P, V] = H({ open: !1, variant: "success", title: "", message: "" }), m = !!(r && E && o.userId === E), M = async (w) => {
|
|
2488
2486
|
var se;
|
|
2489
|
-
const
|
|
2490
|
-
await s(
|
|
2487
|
+
const q = f === 1 && b || o.id, X = ((se = o.userModel) == null ? void 0 : se.name) || o.anonymousNickname || S("discussion.anonymous", "Anonymous"), he = f === 1 ? `@${X} ${w}` : w;
|
|
2488
|
+
await s(q, he), O(!1), f === 1 && C ? C() : f === 0 && (U(!0), z());
|
|
2491
2489
|
}, z = async () => {
|
|
2492
2490
|
if (!(!i || f >= 2))
|
|
2493
2491
|
try {
|
|
@@ -2505,19 +2503,19 @@ const Kt = (o, e) => {
|
|
|
2505
2503
|
j && N.length === 0 && z();
|
|
2506
2504
|
}, [j]);
|
|
2507
2505
|
const ee = async (w) => {
|
|
2508
|
-
await d(w, o.id), A((
|
|
2509
|
-
}, fe = async (w,
|
|
2510
|
-
const
|
|
2511
|
-
|
|
2512
|
-
(he) => he.map((se) => se.id === w ?
|
|
2506
|
+
await d(w, o.id), A((q) => q.filter((X) => X.id !== w));
|
|
2507
|
+
}, fe = async (w, q) => {
|
|
2508
|
+
const X = await u(w, q);
|
|
2509
|
+
X && N.length > 0 && A(
|
|
2510
|
+
(he) => he.map((se) => se.id === w ? X : se)
|
|
2513
2511
|
);
|
|
2514
|
-
}, ve = (w,
|
|
2515
|
-
V({ open: !0, variant:
|
|
2512
|
+
}, ve = (w, q) => {
|
|
2513
|
+
V({ open: !0, variant: q, title: "", message: w });
|
|
2516
2514
|
};
|
|
2517
2515
|
return /* @__PURE__ */ F(L, { sx: { mb: v.md, ml: f > 0 ? v.xl : 0 }, children: [
|
|
2518
2516
|
/* @__PURE__ */ F(L, { sx: { display: "flex", gap: v.sm }, children: [
|
|
2519
|
-
/* @__PURE__ */
|
|
2520
|
-
|
|
2517
|
+
/* @__PURE__ */ n(
|
|
2518
|
+
at,
|
|
2521
2519
|
{
|
|
2522
2520
|
src: (Pe = o.userModel) == null ? void 0 : Pe.avatar,
|
|
2523
2521
|
alt: ((ne = o.userModel) == null ? void 0 : ne.name) || o.anonymousNickname || "User",
|
|
@@ -2527,13 +2525,13 @@ const Kt = (o, e) => {
|
|
|
2527
2525
|
),
|
|
2528
2526
|
/* @__PURE__ */ F(L, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
2529
2527
|
/* @__PURE__ */ F(L, { sx: { display: "flex", alignItems: "center", gap: v.xs, mb: v["2xs"] }, children: [
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ n(W, { level: "title-sm", sx: { color: y.textPrimary }, children: ((Se = o.userModel) == null ? void 0 : Se.name) || o.anonymousNickname || S("discussion.anonymous", "Anonymous") }),
|
|
2529
|
+
/* @__PURE__ */ n(W, { level: "body-xs", sx: { color: y.textSecondary }, children: pr(o.createdAt, S) }),
|
|
2530
|
+
/* @__PURE__ */ n(
|
|
2533
2531
|
ar,
|
|
2534
2532
|
{
|
|
2535
2533
|
isOwnPost: m,
|
|
2536
|
-
canReport: !!(c &&
|
|
2534
|
+
canReport: !!(c && r && !m),
|
|
2537
2535
|
onDelete: () => K(!0),
|
|
2538
2536
|
onReport: () => _(!0)
|
|
2539
2537
|
}
|
|
@@ -2555,7 +2553,7 @@ const Kt = (o, e) => {
|
|
|
2555
2553
|
gap: v.xs
|
|
2556
2554
|
},
|
|
2557
2555
|
children: [
|
|
2558
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ n(
|
|
2559
2557
|
er,
|
|
2560
2558
|
{
|
|
2561
2559
|
sx: {
|
|
@@ -2566,7 +2564,7 @@ const Kt = (o, e) => {
|
|
|
2566
2564
|
}
|
|
2567
2565
|
}
|
|
2568
2566
|
),
|
|
2569
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ n(
|
|
2570
2568
|
W,
|
|
2571
2569
|
{
|
|
2572
2570
|
level: "body-sm",
|
|
@@ -2579,7 +2577,7 @@ const Kt = (o, e) => {
|
|
|
2579
2577
|
)
|
|
2580
2578
|
]
|
|
2581
2579
|
}
|
|
2582
|
-
) : /* @__PURE__ */
|
|
2580
|
+
) : /* @__PURE__ */ n(
|
|
2583
2581
|
W,
|
|
2584
2582
|
{
|
|
2585
2583
|
level: "body-sm",
|
|
@@ -2587,12 +2585,12 @@ const Kt = (o, e) => {
|
|
|
2587
2585
|
children: o.content
|
|
2588
2586
|
}
|
|
2589
2587
|
),
|
|
2590
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ n(
|
|
2591
2589
|
lr,
|
|
2592
2590
|
{
|
|
2593
2591
|
post: o,
|
|
2594
2592
|
sdk: e,
|
|
2595
|
-
userIsLoggedIn:
|
|
2593
|
+
userIsLoggedIn: r,
|
|
2596
2594
|
onSignInClick: a,
|
|
2597
2595
|
onReact: u,
|
|
2598
2596
|
showReactions: l,
|
|
@@ -2600,7 +2598,7 @@ const Kt = (o, e) => {
|
|
|
2600
2598
|
onReplyClick: () => O(!h)
|
|
2601
2599
|
}
|
|
2602
2600
|
),
|
|
2603
|
-
i && o.repliesCount > 0 && /* @__PURE__ */
|
|
2601
|
+
i && o.repliesCount > 0 && /* @__PURE__ */ n(L, { sx: { mb: v.xs }, children: /* @__PURE__ */ F(
|
|
2604
2602
|
W,
|
|
2605
2603
|
{
|
|
2606
2604
|
level: "body-sm",
|
|
@@ -2621,11 +2619,11 @@ const Kt = (o, e) => {
|
|
|
2621
2619
|
]
|
|
2622
2620
|
}
|
|
2623
2621
|
) }),
|
|
2624
|
-
h && /* @__PURE__ */
|
|
2622
|
+
h && /* @__PURE__ */ n(L, { sx: { mt: v.md }, children: /* @__PURE__ */ n(
|
|
2625
2623
|
no,
|
|
2626
2624
|
{
|
|
2627
|
-
onSubmit:
|
|
2628
|
-
userIsLoggedIn:
|
|
2625
|
+
onSubmit: M,
|
|
2626
|
+
userIsLoggedIn: r,
|
|
2629
2627
|
onSignInClick: a,
|
|
2630
2628
|
placeholder: S("discussion.writeReply", "Write a reply..."),
|
|
2631
2629
|
isSubmitting: g,
|
|
@@ -2633,12 +2631,12 @@ const Kt = (o, e) => {
|
|
|
2633
2631
|
onCancel: () => O(!1)
|
|
2634
2632
|
}
|
|
2635
2633
|
) }),
|
|
2636
|
-
j && N.length > 0 && /* @__PURE__ */
|
|
2634
|
+
j && N.length > 0 && /* @__PURE__ */ n(L, { sx: { mt: v.md }, children: N.map((w) => /* @__PURE__ */ n(
|
|
2637
2635
|
io,
|
|
2638
2636
|
{
|
|
2639
2637
|
post: w,
|
|
2640
2638
|
sdk: e,
|
|
2641
|
-
userIsLoggedIn:
|
|
2639
|
+
userIsLoggedIn: r,
|
|
2642
2640
|
onSignInClick: a,
|
|
2643
2641
|
showReactions: l,
|
|
2644
2642
|
showReplies: i,
|
|
@@ -2658,7 +2656,7 @@ const Kt = (o, e) => {
|
|
|
2658
2656
|
)) })
|
|
2659
2657
|
] })
|
|
2660
2658
|
] }),
|
|
2661
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ n(
|
|
2662
2660
|
cr,
|
|
2663
2661
|
{
|
|
2664
2662
|
open: B,
|
|
@@ -2670,18 +2668,18 @@ const Kt = (o, e) => {
|
|
|
2670
2668
|
container: T
|
|
2671
2669
|
}
|
|
2672
2670
|
),
|
|
2673
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ n(
|
|
2674
2672
|
ur,
|
|
2675
2673
|
{
|
|
2676
2674
|
open: k,
|
|
2677
2675
|
onClose: () => _(!1),
|
|
2678
|
-
onSubmit: (w,
|
|
2676
|
+
onSubmit: (w, q) => p(o.id, w, q),
|
|
2679
2677
|
onSuccess: (w) => ve(w, "success"),
|
|
2680
2678
|
onError: (w) => ve(w, "error"),
|
|
2681
2679
|
container: T
|
|
2682
2680
|
}
|
|
2683
2681
|
),
|
|
2684
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ n(
|
|
2685
2683
|
Ze,
|
|
2686
2684
|
{
|
|
2687
2685
|
notification: P,
|
|
@@ -2692,7 +2690,7 @@ const Kt = (o, e) => {
|
|
|
2692
2690
|
}, mr = ({
|
|
2693
2691
|
discussion: o,
|
|
2694
2692
|
posts: e,
|
|
2695
|
-
sdk:
|
|
2693
|
+
sdk: r,
|
|
2696
2694
|
userIsLoggedIn: a,
|
|
2697
2695
|
onSignInClick: l,
|
|
2698
2696
|
showReactions: i,
|
|
@@ -2778,12 +2776,12 @@ const Kt = (o, e) => {
|
|
|
2778
2776
|
},
|
|
2779
2777
|
children: [
|
|
2780
2778
|
/* @__PURE__ */ F(L, { sx: { mb: O.lg }, children: [
|
|
2781
|
-
/* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ n(W, { level: "h3", sx: { mb: O.xs }, children: o.label || $("discussion.title", "Discussion") }),
|
|
2780
|
+
/* @__PURE__ */ n(W, { level: "body-sm", sx: { color: h.textSecondary }, children: $("discussion.postsCount", "{{count}} posts", {
|
|
2783
2781
|
count: o.postsCount || 0
|
|
2784
2782
|
}) })
|
|
2785
2783
|
] }),
|
|
2786
|
-
/* @__PURE__ */
|
|
2784
|
+
/* @__PURE__ */ n(
|
|
2787
2785
|
no,
|
|
2788
2786
|
{
|
|
2789
2787
|
onSubmit: (P) => p(P),
|
|
@@ -2792,7 +2790,7 @@ const Kt = (o, e) => {
|
|
|
2792
2790
|
isSubmitting: S
|
|
2793
2791
|
}
|
|
2794
2792
|
),
|
|
2795
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ n(Fe, { sx: { my: O.lg } }),
|
|
2796
2794
|
/* @__PURE__ */ F(
|
|
2797
2795
|
L,
|
|
2798
2796
|
{
|
|
@@ -2803,9 +2801,9 @@ const Kt = (o, e) => {
|
|
|
2803
2801
|
alignItems: "center"
|
|
2804
2802
|
},
|
|
2805
2803
|
children: [
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
|
|
2804
|
+
/* @__PURE__ */ n(W, { level: "title-md", children: $("discussion.comments", "Comments") }),
|
|
2805
|
+
/* @__PURE__ */ n(
|
|
2806
|
+
st,
|
|
2809
2807
|
{
|
|
2810
2808
|
value: u,
|
|
2811
2809
|
onChange: (P, V) => V && d(V),
|
|
@@ -2823,21 +2821,21 @@ const Kt = (o, e) => {
|
|
|
2823
2821
|
}
|
|
2824
2822
|
},
|
|
2825
2823
|
slotProps: k,
|
|
2826
|
-
children: K.map((P) => /* @__PURE__ */
|
|
2824
|
+
children: K.map((P) => /* @__PURE__ */ n(it, { value: P.value, sx: _, children: P.label }, P.value))
|
|
2827
2825
|
}
|
|
2828
2826
|
)
|
|
2829
2827
|
]
|
|
2830
2828
|
}
|
|
2831
2829
|
),
|
|
2832
|
-
R && e.length === 0 ? /* @__PURE__ */
|
|
2830
|
+
R && e.length === 0 ? /* @__PURE__ */ n(L, { sx: { py: O.xl }, children: /* @__PURE__ */ n(Ee, { my: 4 }) }) : e.length === 0 ? /* @__PURE__ */ n(L, { sx: { textAlign: "center", py: O.xl }, children: /* @__PURE__ */ n(W, { level: "body-md", sx: { color: h.textSecondary }, children: $(
|
|
2833
2831
|
"discussion.noPosts",
|
|
2834
2832
|
"No comments yet. Be the first to comment!"
|
|
2835
|
-
) }) }) : /* @__PURE__ */ F(
|
|
2836
|
-
/* @__PURE__ */
|
|
2833
|
+
) }) }) : /* @__PURE__ */ F(De, { children: [
|
|
2834
|
+
/* @__PURE__ */ n(L, { children: e.map((P) => /* @__PURE__ */ n(
|
|
2837
2835
|
io,
|
|
2838
2836
|
{
|
|
2839
2837
|
post: P,
|
|
2840
|
-
sdk:
|
|
2838
|
+
sdk: r,
|
|
2841
2839
|
userIsLoggedIn: a,
|
|
2842
2840
|
onSignInClick: l,
|
|
2843
2841
|
showReactions: i,
|
|
@@ -2853,10 +2851,10 @@ const Kt = (o, e) => {
|
|
|
2853
2851
|
},
|
|
2854
2852
|
P.id
|
|
2855
2853
|
)) }),
|
|
2856
|
-
T && /* @__PURE__ */
|
|
2854
|
+
T && /* @__PURE__ */ n(L, { ref: A, sx: { height: 1 } })
|
|
2857
2855
|
] }),
|
|
2858
|
-
T && R && e.length > 0 && /* @__PURE__ */
|
|
2859
|
-
!T && C && /* @__PURE__ */
|
|
2856
|
+
T && R && e.length > 0 && /* @__PURE__ */ n(L, { sx: { py: O.md }, children: /* @__PURE__ */ n(Ee, { my: 2 }) }),
|
|
2857
|
+
!T && C && /* @__PURE__ */ n(L, { sx: { display: "flex", justifyContent: "center", mt: O.lg }, children: /* @__PURE__ */ n(
|
|
2860
2858
|
oe,
|
|
2861
2859
|
{
|
|
2862
2860
|
variant: "outlined",
|
|
@@ -2880,7 +2878,7 @@ const Kt = (o, e) => {
|
|
|
2880
2878
|
children: $("discussion.loadMore", "Load More")
|
|
2881
2879
|
}
|
|
2882
2880
|
) }),
|
|
2883
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ n(
|
|
2884
2882
|
Ze,
|
|
2885
2883
|
{
|
|
2886
2884
|
notification: j,
|
|
@@ -2893,7 +2891,7 @@ const Kt = (o, e) => {
|
|
|
2893
2891
|
}, fr = (o) => {
|
|
2894
2892
|
const {
|
|
2895
2893
|
entityId: e,
|
|
2896
|
-
sdk:
|
|
2894
|
+
sdk: r,
|
|
2897
2895
|
discussionLabel: a,
|
|
2898
2896
|
discussionUrl: l = "",
|
|
2899
2897
|
defaultSort: i = "LATEST",
|
|
@@ -2911,7 +2909,7 @@ const Kt = (o, e) => {
|
|
|
2911
2909
|
isLoading: R,
|
|
2912
2910
|
error: S,
|
|
2913
2911
|
isNotFound: T
|
|
2914
|
-
} =
|
|
2912
|
+
} = Gt(r, e), y = (_) => {
|
|
2915
2913
|
C(
|
|
2916
2914
|
(P) => P && { ...P, postsCount: Math.max(0, P.postsCount + _) }
|
|
2917
2915
|
);
|
|
@@ -2927,8 +2925,8 @@ const Kt = (o, e) => {
|
|
|
2927
2925
|
handleReact: U,
|
|
2928
2926
|
handleDeletePost: B,
|
|
2929
2927
|
handleReportPost: K
|
|
2930
|
-
} =
|
|
2931
|
-
|
|
2928
|
+
} = Jt(
|
|
2929
|
+
r,
|
|
2932
2930
|
e,
|
|
2933
2931
|
a ?? null,
|
|
2934
2932
|
l,
|
|
@@ -2938,9 +2936,9 @@ const Kt = (o, e) => {
|
|
|
2938
2936
|
g
|
|
2939
2937
|
);
|
|
2940
2938
|
if (R || !b && !T && v)
|
|
2941
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ n(Ee, { my: 20 });
|
|
2942
2940
|
if (S)
|
|
2943
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ n("div", { style: { padding: "20px", textAlign: "center" }, children: /* @__PURE__ */ n("p", { children: "Failed to load discussion. Please try again later." }) });
|
|
2944
2942
|
const k = b || {
|
|
2945
2943
|
id: e,
|
|
2946
2944
|
title: "",
|
|
@@ -2949,12 +2947,12 @@ const Kt = (o, e) => {
|
|
|
2949
2947
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2950
2948
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2951
2949
|
};
|
|
2952
|
-
return /* @__PURE__ */
|
|
2950
|
+
return /* @__PURE__ */ n(
|
|
2953
2951
|
mr,
|
|
2954
2952
|
{
|
|
2955
2953
|
discussion: k,
|
|
2956
2954
|
posts: $,
|
|
2957
|
-
sdk:
|
|
2955
|
+
sdk: r,
|
|
2958
2956
|
userIsLoggedIn: x,
|
|
2959
2957
|
onSignInClick: f,
|
|
2960
2958
|
showReactions: s,
|
|
@@ -2975,12 +2973,12 @@ const Kt = (o, e) => {
|
|
|
2975
2973
|
}
|
|
2976
2974
|
);
|
|
2977
2975
|
}, vr = (o) => {
|
|
2978
|
-
const [e,
|
|
2976
|
+
const [e, r] = J.useState(!1), [a, l] = J.useState(!1), i = J.useRef(
|
|
2979
2977
|
`$discussion-shadow-root-${Math.random().toString(36).substring(2, 11)}`
|
|
2980
|
-
), c =
|
|
2981
|
-
|
|
2978
|
+
), c = J.useRef(null), s = J.useRef(null), u = J.useRef(null), d = J.useRef(null);
|
|
2979
|
+
J.useEffect(() => {
|
|
2982
2980
|
Eo(o.language || "en").finally(() => l(!0));
|
|
2983
|
-
}, [o.language]),
|
|
2981
|
+
}, [o.language]), J.useEffect(() => {
|
|
2984
2982
|
if (c.current)
|
|
2985
2983
|
return c.current.shadowRoot ? (s.current = c.current.shadowRoot, u.current = s.current.getElementById(
|
|
2986
2984
|
i.current
|
|
@@ -2988,18 +2986,18 @@ const Kt = (o, e) => {
|
|
|
2988
2986
|
key: "discussion-css",
|
|
2989
2987
|
prepend: !0,
|
|
2990
2988
|
container: s.current
|
|
2991
|
-
})),
|
|
2992
|
-
|
|
2989
|
+
})), r(!0), () => {
|
|
2990
|
+
r(!1);
|
|
2993
2991
|
};
|
|
2994
2992
|
}, []);
|
|
2995
|
-
const p = o.themeOptions, g = /* @__PURE__ */
|
|
2996
|
-
/* @__PURE__ */
|
|
2993
|
+
const p = o.themeOptions, g = /* @__PURE__ */ n(L, { ref: c, sx: { height: "100%", display: "block" } }), x = e && a && u.current && d.current ? Fo(
|
|
2994
|
+
/* @__PURE__ */ n($o, { value: d.current, children: /* @__PURE__ */ n(ko, { containerRef: c, children: /* @__PURE__ */ n(
|
|
2997
2995
|
Vo,
|
|
2998
2996
|
{
|
|
2999
2997
|
customTheme: p,
|
|
3000
2998
|
mode: p == null ? void 0 : p.mode,
|
|
3001
2999
|
shadowRootElement: u.current,
|
|
3002
|
-
children: /* @__PURE__ */
|
|
3000
|
+
children: /* @__PURE__ */ n(
|
|
3003
3001
|
wo,
|
|
3004
3002
|
{
|
|
3005
3003
|
shadowRootElement: u.current,
|
|
@@ -3013,11 +3011,11 @@ const Kt = (o, e) => {
|
|
|
3013
3011
|
) }) }),
|
|
3014
3012
|
u.current
|
|
3015
3013
|
) : null;
|
|
3016
|
-
return /* @__PURE__ */ F(
|
|
3014
|
+
return /* @__PURE__ */ F(De, { children: [
|
|
3017
3015
|
g,
|
|
3018
3016
|
x
|
|
3019
3017
|
] });
|
|
3020
|
-
}, hr = (o) => /* @__PURE__ */
|
|
3018
|
+
}, hr = (o) => /* @__PURE__ */ n(vr, { ...o, children: /* @__PURE__ */ n(fr, { ...o }) }), Mr = hr;
|
|
3021
3019
|
export {
|
|
3022
|
-
|
|
3020
|
+
Mr as Discussion
|
|
3023
3021
|
};
|