@articles-media/articles-dev-box 1.0.17 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +6 -5
  2. package/dist/Ad-Ck5UdTq3.js +387 -0
  3. package/dist/Ad-DYtftKNV.cjs +1 -0
  4. package/dist/Ad.cjs +1 -1
  5. package/dist/Ad.js +2 -604
  6. package/dist/AdConfirmExitModal-CJ-HtcVC.js +56 -0
  7. package/dist/AdConfirmExitModal-CRCnzYQM.cjs +1 -0
  8. package/dist/AdDetailsModal-DRNRTL2W.js +108 -0
  9. package/dist/AdDetailsModal-g0n7LiV6.cjs +1 -0
  10. package/dist/ArticlesAd.cjs +1 -1
  11. package/dist/ArticlesAd.js +16 -15
  12. package/dist/Button-BlAdEbSd.js +30 -0
  13. package/dist/Button-CbpRj01E.cjs +1 -0
  14. package/dist/CreditsModal.cjs +1 -0
  15. package/dist/CreditsModal.js +56 -0
  16. package/dist/DarkModeHandler.cjs +1 -1
  17. package/dist/DarkModeHandler.js +17 -16
  18. package/dist/FriendsList.cjs +1 -1
  19. package/dist/FriendsList.js +77 -121
  20. package/dist/GameScoreboard-CBY3JsFa.js +165 -0
  21. package/dist/GameScoreboard-DdOCRxON.cjs +1 -0
  22. package/dist/GameScoreboard.cjs +1 -1
  23. package/dist/GameScoreboard.js +2 -190
  24. package/dist/GlobalBody.cjs +33 -1
  25. package/dist/GlobalBody.js +36 -7
  26. package/dist/GlobalHead.cjs +1 -1
  27. package/dist/GlobalHead.js +10 -12
  28. package/dist/Link-MFZblBb4.js +17 -0
  29. package/dist/Link-c7exNCJ3.cjs +1 -0
  30. package/dist/Modal-BX1s6CCU.js +1631 -0
  31. package/dist/Modal-DP9CeAVD.cjs +3 -0
  32. package/dist/ReturnToLauncherButton.cjs +1 -1
  33. package/dist/ReturnToLauncherButton.js +39 -54
  34. package/dist/SettingsModal--sWLmLGp.cjs +1 -0
  35. package/dist/SettingsModal-XI2dMI09.js +247 -0
  36. package/dist/SettingsModal.cjs +1 -1
  37. package/dist/SettingsModal.js +2 -658
  38. package/dist/StatusModal-D7WDDR9P.cjs +1 -0
  39. package/dist/StatusModal-elrPJvX1.js +70 -0
  40. package/dist/ViewUserModal-DDjWLpyM.js +3094 -0
  41. package/dist/ViewUserModal-DPVcjXNU.cjs +1 -0
  42. package/dist/ViewUserModal.cjs +1 -1
  43. package/dist/ViewUserModal.js +3 -3149
  44. package/dist/articles-dev-box.css +2 -1
  45. package/dist/chunk-350yNsax.cjs +1 -0
  46. package/dist/classnames-DP6dWde5.js +31 -0
  47. package/dist/classnames-pS64X3rL.cjs +1 -0
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.js +16 -28
  50. package/dist/jsx-runtime-VZk6y-ec.js +191 -0
  51. package/dist/jsx-runtime-hCcDh67y.cjs +6 -0
  52. package/dist/numberWithCommas-BSKBdR-e.js +18 -0
  53. package/dist/numberWithCommas-D9tgiUnq.cjs +1 -0
  54. package/dist/useAuthSiteStatus-1rHjYC4N.js +29 -0
  55. package/dist/useAuthSiteStatus-P5kHc_Bz.cjs +1 -0
  56. package/dist/useFullscreen.cjs +1 -0
  57. package/dist/useFullscreen.js +24 -0
  58. package/dist/useUserDetails.cjs +1 -1
  59. package/dist/useUserDetails.js +22 -32
  60. package/dist/useUserFriends.cjs +1 -1
  61. package/dist/useUserFriends.js +29 -51
  62. package/dist/useUserToken.cjs +1 -1
  63. package/dist/useUserToken.js +16 -21
  64. package/package.json +17 -10
  65. package/dist/AdConfirmExitModal-Bhz-lt9w.js +0 -72
  66. package/dist/AdConfirmExitModal-N3Lvhb4y.cjs +0 -1
  67. package/dist/AdDetailsModal-BMj8DjV0.cjs +0 -1
  68. package/dist/AdDetailsModal-DXvfmyKK.js +0 -83
  69. package/dist/Button-0ZK0NKiK.cjs +0 -1
  70. package/dist/Button-_Quon8UV.js +0 -54
  71. package/dist/ElementChildren-DN3RWY2E.js +0 -51
  72. package/dist/ElementChildren-eAwIENLl.cjs +0 -1
  73. package/dist/GlobalBody-BrrtfBBs.js +0 -123
  74. package/dist/GlobalBody-weON_TbJ.cjs +0 -33
  75. package/dist/Modal-Bdhkgkwr.cjs +0 -2
  76. package/dist/Modal-nux8R77F.js +0 -2087
  77. package/dist/StatusModal-B086BgSW.js +0 -71
  78. package/dist/StatusModal-CzPyqQQA.cjs +0 -1
  79. package/dist/index-BlP2-uOi.cjs +0 -1
  80. package/dist/index-C8MeSLnR.js +0 -2504
  81. package/dist/index-DWV8myok.cjs +0 -6
  82. package/dist/index-YnD2EP-S.js +0 -43
  83. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  84. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  85. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  86. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
@@ -1,3149 +1,3 @@
1
- import { j as s } from "./jsx-runtime-tc70JA_2.js";
2
- import * as ce from "react";
3
- import { useRef as q, useEffect as X, useMemo as Me, useState as C, useCallback as z, useLayoutEffect as xs, cloneElement as zt } from "react";
4
- import { t as ke, a as Xt, L as Y, f as Te, n as et, A as Yt } from "./numberWithCommas-DnAkiOFL.js";
5
- import { c as gs, d as bs, e as tt, f as st, o as qt, l as Ae, i as js, g as ys, h as wt, r as ws, u as ve, j as Kt, k as Nt, m as Gt, n as Ns, F as _t, s as at, p as _s, P as Os, M as Be } from "./Modal-nux8R77F.js";
6
- import { w as Jt, m as Ss } from "./ElementChildren-DN3RWY2E.js";
7
- import { c as ue } from "./index-YnD2EP-S.js";
8
- import Ds from "react-dom";
9
- import { w as Ps, u as Qt, a as Zt } from "./index-C8MeSLnR.js";
10
- import { A as P } from "./Button-_Quon8UV.js";
11
- function Qe(t, e) {
12
- const a = +ke(t) - +ke(e);
13
- return a < 0 ? -1 : a > 0 ? 1 : a;
14
- }
15
- function As(t, e, a) {
16
- const [r, n] = Xt(
17
- a?.in,
18
- t,
19
- e
20
- ), l = r.getFullYear() - n.getFullYear(), i = r.getMonth() - n.getMonth();
21
- return l * 12 + i;
22
- }
23
- function Cs(t, e) {
24
- const a = ke(t, e?.in);
25
- return a.setHours(23, 59, 59, 999), a;
26
- }
27
- function $s(t, e) {
28
- const a = ke(t, e?.in), r = a.getMonth();
29
- return a.setFullYear(a.getFullYear(), r + 1, 0), a.setHours(23, 59, 59, 999), a;
30
- }
31
- function Es(t, e) {
32
- const a = ke(t, e?.in);
33
- return +Cs(a, e) == +$s(a, e);
34
- }
35
- function Ms(t, e, a) {
36
- const [r, n, l] = Xt(
37
- a?.in,
38
- t,
39
- t,
40
- e
41
- ), i = Qe(n, l), o = Math.abs(
42
- As(n, l)
43
- );
44
- if (o < 1) return 0;
45
- n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - i * o);
46
- let c = Qe(n, l) === -i;
47
- Es(r) && o === 1 && Qe(r, l) === 1 && (c = !1);
48
- const f = i * (o - +c);
49
- return f === 0 ? 0 : f;
50
- }
51
- function ks() {
52
- const t = q(!0), e = q(() => t.current);
53
- return X(() => (t.current = !0, () => {
54
- t.current = !1;
55
- }), []), e.current;
56
- }
57
- const rt = 2 ** 31 - 1;
58
- function es(t, e, a) {
59
- const r = a - Date.now();
60
- t.current = r <= rt ? setTimeout(e, r) : setTimeout(() => es(t, e, a), rt);
61
- }
62
- function Rs() {
63
- const t = ks(), e = q();
64
- return gs(() => clearTimeout(e.current)), Me(() => {
65
- const a = () => clearTimeout(e.current);
66
- function r(n, l = 0) {
67
- t() && (a(), l <= rt ? e.current = setTimeout(n, l) : es(e, n, Date.now() + l));
68
- }
69
- return {
70
- set: r,
71
- clear: a,
72
- handleRef: e
73
- };
74
- }, []);
75
- }
76
- function Ls(t, e, a) {
77
- var r = q(t !== void 0), n = C(e), l = n[0], i = n[1], o = t !== void 0, c = r.current;
78
- return r.current = o, !o && c && l !== e && i(e), [o ? t : l, z(function(f) {
79
- for (var u = arguments.length, m = new Array(u > 1 ? u - 1 : 0), h = 1; h < u; h++)
80
- m[h - 1] = arguments[h];
81
- a && a.apply(void 0, [f].concat(m)), i(f);
82
- }, [a])];
83
- }
84
- function Ot() {
85
- return C(null);
86
- }
87
- var St = Object.prototype.hasOwnProperty;
88
- function Dt(t, e, a) {
89
- for (a of t.keys())
90
- if (Ce(a, e)) return a;
91
- }
92
- function Ce(t, e) {
93
- var a, r, n;
94
- if (t === e) return !0;
95
- if (t && e && (a = t.constructor) === e.constructor) {
96
- if (a === Date) return t.getTime() === e.getTime();
97
- if (a === RegExp) return t.toString() === e.toString();
98
- if (a === Array) {
99
- if ((r = t.length) === e.length)
100
- for (; r-- && Ce(t[r], e[r]); ) ;
101
- return r === -1;
102
- }
103
- if (a === Set) {
104
- if (t.size !== e.size)
105
- return !1;
106
- for (r of t)
107
- if (n = r, n && typeof n == "object" && (n = Dt(e, n), !n) || !e.has(n)) return !1;
108
- return !0;
109
- }
110
- if (a === Map) {
111
- if (t.size !== e.size)
112
- return !1;
113
- for (r of t)
114
- if (n = r[0], n && typeof n == "object" && (n = Dt(e, n), !n) || !Ce(r[1], e.get(n)))
115
- return !1;
116
- return !0;
117
- }
118
- if (a === ArrayBuffer)
119
- t = new Uint8Array(t), e = new Uint8Array(e);
120
- else if (a === DataView) {
121
- if ((r = t.byteLength) === e.byteLength)
122
- for (; r-- && t.getInt8(r) === e.getInt8(r); ) ;
123
- return r === -1;
124
- }
125
- if (ArrayBuffer.isView(t)) {
126
- if ((r = t.byteLength) === e.byteLength)
127
- for (; r-- && t[r] === e[r]; ) ;
128
- return r === -1;
129
- }
130
- if (!a || typeof t == "object") {
131
- r = 0;
132
- for (a in t)
133
- if (St.call(t, a) && ++r && !St.call(e, a) || !(a in e) || !Ce(t[a], e[a])) return !1;
134
- return Object.keys(e).length === r;
135
- }
136
- }
137
- return t !== t && e !== e;
138
- }
139
- function Ts(t) {
140
- const e = bs();
141
- return [t[0], z((a) => {
142
- if (e())
143
- return t[1](a);
144
- }, [e, t[1]])];
145
- }
146
- var U = "top", K = "bottom", G = "right", B = "left", ot = "auto", Fe = [U, K, G, B], ye = "start", Re = "end", Fs = "clippingParents", ts = "viewport", Pe = "popper", Us = "reference", Pt = /* @__PURE__ */ Fe.reduce(function(t, e) {
147
- return t.concat([e + "-" + ye, e + "-" + Re]);
148
- }, []), ss = /* @__PURE__ */ [].concat(Fe, [ot]).reduce(function(t, e) {
149
- return t.concat([e, e + "-" + ye, e + "-" + Re]);
150
- }, []), Bs = "beforeRead", Is = "read", Vs = "afterRead", Ws = "beforeMain", Hs = "main", zs = "afterMain", Xs = "beforeWrite", Ys = "write", qs = "afterWrite", Ks = [Bs, Is, Vs, Ws, Hs, zs, Xs, Ys, qs];
151
- function se(t) {
152
- return t.split("-")[0];
153
- }
154
- function W(t) {
155
- if (t == null)
156
- return window;
157
- if (t.toString() !== "[object Window]") {
158
- var e = t.ownerDocument;
159
- return e && e.defaultView || window;
160
- }
161
- return t;
162
- }
163
- function xe(t) {
164
- var e = W(t).Element;
165
- return t instanceof e || t instanceof Element;
166
- }
167
- function ae(t) {
168
- var e = W(t).HTMLElement;
169
- return t instanceof e || t instanceof HTMLElement;
170
- }
171
- function lt(t) {
172
- if (typeof ShadowRoot > "u")
173
- return !1;
174
- var e = W(t).ShadowRoot;
175
- return t instanceof e || t instanceof ShadowRoot;
176
- }
177
- var he = Math.max, He = Math.min, we = Math.round;
178
- function nt() {
179
- var t = navigator.userAgentData;
180
- return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
181
- return e.brand + "/" + e.version;
182
- }).join(" ") : navigator.userAgent;
183
- }
184
- function as() {
185
- return !/^((?!chrome|android).)*safari/i.test(nt());
186
- }
187
- function Ne(t, e, a) {
188
- e === void 0 && (e = !1), a === void 0 && (a = !1);
189
- var r = t.getBoundingClientRect(), n = 1, l = 1;
190
- e && ae(t) && (n = t.offsetWidth > 0 && we(r.width) / t.offsetWidth || 1, l = t.offsetHeight > 0 && we(r.height) / t.offsetHeight || 1);
191
- var i = xe(t) ? W(t) : window, o = i.visualViewport, c = !as() && a, f = (r.left + (c && o ? o.offsetLeft : 0)) / n, u = (r.top + (c && o ? o.offsetTop : 0)) / l, m = r.width / n, h = r.height / l;
192
- return {
193
- width: m,
194
- height: h,
195
- top: u,
196
- right: f + m,
197
- bottom: u + h,
198
- left: f,
199
- x: f,
200
- y: u
201
- };
202
- }
203
- function ct(t) {
204
- var e = Ne(t), a = t.offsetWidth, r = t.offsetHeight;
205
- return Math.abs(e.width - a) <= 1 && (a = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
206
- x: t.offsetLeft,
207
- y: t.offsetTop,
208
- width: a,
209
- height: r
210
- };
211
- }
212
- function rs(t, e) {
213
- var a = e.getRootNode && e.getRootNode();
214
- if (t.contains(e))
215
- return !0;
216
- if (a && lt(a)) {
217
- var r = e;
218
- do {
219
- if (r && t.isSameNode(r))
220
- return !0;
221
- r = r.parentNode || r.host;
222
- } while (r);
223
- }
224
- return !1;
225
- }
226
- function pe(t) {
227
- return t ? (t.nodeName || "").toLowerCase() : null;
228
- }
229
- function de(t) {
230
- return W(t).getComputedStyle(t);
231
- }
232
- function Gs(t) {
233
- return ["table", "td", "th"].indexOf(pe(t)) >= 0;
234
- }
235
- function me(t) {
236
- return ((xe(t) ? t.ownerDocument : (
237
- // $FlowFixMe[prop-missing]
238
- t.document
239
- )) || window.document).documentElement;
240
- }
241
- function ze(t) {
242
- return pe(t) === "html" ? t : (
243
- // this is a quicker (but less type safe) way to save quite some bytes from the bundle
244
- // $FlowFixMe[incompatible-return]
245
- // $FlowFixMe[prop-missing]
246
- t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
247
- t.parentNode || // DOM Element detected
248
- (lt(t) ? t.host : null) || // ShadowRoot detected
249
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
250
- me(t)
251
- );
252
- }
253
- function At(t) {
254
- return !ae(t) || // https://github.com/popperjs/popper-core/issues/837
255
- de(t).position === "fixed" ? null : t.offsetParent;
256
- }
257
- function Js(t) {
258
- var e = /firefox/i.test(nt()), a = /Trident/i.test(nt());
259
- if (a && ae(t)) {
260
- var r = de(t);
261
- if (r.position === "fixed")
262
- return null;
263
- }
264
- var n = ze(t);
265
- for (lt(n) && (n = n.host); ae(n) && ["html", "body"].indexOf(pe(n)) < 0; ) {
266
- var l = de(n);
267
- if (l.transform !== "none" || l.perspective !== "none" || l.contain === "paint" || ["transform", "perspective"].indexOf(l.willChange) !== -1 || e && l.willChange === "filter" || e && l.filter && l.filter !== "none")
268
- return n;
269
- n = n.parentNode;
270
- }
271
- return null;
272
- }
273
- function Ue(t) {
274
- for (var e = W(t), a = At(t); a && Gs(a) && de(a).position === "static"; )
275
- a = At(a);
276
- return a && (pe(a) === "html" || pe(a) === "body" && de(a).position === "static") ? e : a || Js(t) || e;
277
- }
278
- function dt(t) {
279
- return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
280
- }
281
- function $e(t, e, a) {
282
- return he(t, He(e, a));
283
- }
284
- function Qs(t, e, a) {
285
- var r = $e(t, e, a);
286
- return r > a ? a : r;
287
- }
288
- function ns() {
289
- return {
290
- top: 0,
291
- right: 0,
292
- bottom: 0,
293
- left: 0
294
- };
295
- }
296
- function is(t) {
297
- return Object.assign({}, ns(), t);
298
- }
299
- function os(t, e) {
300
- return e.reduce(function(a, r) {
301
- return a[r] = t, a;
302
- }, {});
303
- }
304
- var Zs = function(e, a) {
305
- return e = typeof e == "function" ? e(Object.assign({}, a.rects, {
306
- placement: a.placement
307
- })) : e, is(typeof e != "number" ? e : os(e, Fe));
308
- };
309
- function ea(t) {
310
- var e, a = t.state, r = t.name, n = t.options, l = a.elements.arrow, i = a.modifiersData.popperOffsets, o = se(a.placement), c = dt(o), f = [B, G].indexOf(o) >= 0, u = f ? "height" : "width";
311
- if (!(!l || !i)) {
312
- var m = Zs(n.padding, a), h = ct(l), d = c === "y" ? U : B, v = c === "y" ? K : G, x = a.rects.reference[u] + a.rects.reference[c] - i[c] - a.rects.popper[u], p = i[c] - a.rects.reference[c], j = Ue(l), g = j ? c === "y" ? j.clientHeight || 0 : j.clientWidth || 0 : 0, N = x / 2 - p / 2, b = m[d], _ = g - h[u] - m[v], w = g / 2 - h[u] / 2 + N, O = $e(b, w, _), E = c;
313
- a.modifiersData[r] = (e = {}, e[E] = O, e.centerOffset = O - w, e);
314
- }
315
- }
316
- function ta(t) {
317
- var e = t.state, a = t.options, r = a.element, n = r === void 0 ? "[data-popper-arrow]" : r;
318
- n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || rs(e.elements.popper, n) && (e.elements.arrow = n));
319
- }
320
- const sa = {
321
- name: "arrow",
322
- enabled: !0,
323
- phase: "main",
324
- fn: ea,
325
- effect: ta,
326
- requires: ["popperOffsets"],
327
- requiresIfExists: ["preventOverflow"]
328
- };
329
- function _e(t) {
330
- return t.split("-")[1];
331
- }
332
- var aa = {
333
- top: "auto",
334
- right: "auto",
335
- bottom: "auto",
336
- left: "auto"
337
- };
338
- function ra(t, e) {
339
- var a = t.x, r = t.y, n = e.devicePixelRatio || 1;
340
- return {
341
- x: we(a * n) / n || 0,
342
- y: we(r * n) / n || 0
343
- };
344
- }
345
- function Ct(t) {
346
- var e, a = t.popper, r = t.popperRect, n = t.placement, l = t.variation, i = t.offsets, o = t.position, c = t.gpuAcceleration, f = t.adaptive, u = t.roundOffsets, m = t.isFixed, h = i.x, d = h === void 0 ? 0 : h, v = i.y, x = v === void 0 ? 0 : v, p = typeof u == "function" ? u({
347
- x: d,
348
- y: x
349
- }) : {
350
- x: d,
351
- y: x
352
- };
353
- d = p.x, x = p.y;
354
- var j = i.hasOwnProperty("x"), g = i.hasOwnProperty("y"), N = B, b = U, _ = window;
355
- if (f) {
356
- var w = Ue(a), O = "clientHeight", E = "clientWidth";
357
- if (w === W(a) && (w = me(a), de(w).position !== "static" && o === "absolute" && (O = "scrollHeight", E = "scrollWidth")), w = w, n === U || (n === B || n === G) && l === Re) {
358
- b = K;
359
- var M = m && w === _ && _.visualViewport ? _.visualViewport.height : (
360
- // $FlowFixMe[prop-missing]
361
- w[O]
362
- );
363
- x -= M - r.height, x *= c ? 1 : -1;
364
- }
365
- if (n === B || (n === U || n === K) && l === Re) {
366
- N = G;
367
- var A = m && w === _ && _.visualViewport ? _.visualViewport.width : (
368
- // $FlowFixMe[prop-missing]
369
- w[E]
370
- );
371
- d -= A - r.width, d *= c ? 1 : -1;
372
- }
373
- }
374
- var $ = Object.assign({
375
- position: o
376
- }, f && aa), R = u === !0 ? ra({
377
- x: d,
378
- y: x
379
- }, W(a)) : {
380
- x: d,
381
- y: x
382
- };
383
- if (d = R.x, x = R.y, c) {
384
- var S;
385
- return Object.assign({}, $, (S = {}, S[b] = g ? "0" : "", S[N] = j ? "0" : "", S.transform = (_.devicePixelRatio || 1) <= 1 ? "translate(" + d + "px, " + x + "px)" : "translate3d(" + d + "px, " + x + "px, 0)", S));
386
- }
387
- return Object.assign({}, $, (e = {}, e[b] = g ? x + "px" : "", e[N] = j ? d + "px" : "", e.transform = "", e));
388
- }
389
- function na(t) {
390
- var e = t.state, a = t.options, r = a.gpuAcceleration, n = r === void 0 ? !0 : r, l = a.adaptive, i = l === void 0 ? !0 : l, o = a.roundOffsets, c = o === void 0 ? !0 : o, f = {
391
- placement: se(e.placement),
392
- variation: _e(e.placement),
393
- popper: e.elements.popper,
394
- popperRect: e.rects.popper,
395
- gpuAcceleration: n,
396
- isFixed: e.options.strategy === "fixed"
397
- };
398
- e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Ct(Object.assign({}, f, {
399
- offsets: e.modifiersData.popperOffsets,
400
- position: e.options.strategy,
401
- adaptive: i,
402
- roundOffsets: c
403
- })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Ct(Object.assign({}, f, {
404
- offsets: e.modifiersData.arrow,
405
- position: "absolute",
406
- adaptive: !1,
407
- roundOffsets: c
408
- })))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
409
- "data-popper-placement": e.placement
410
- });
411
- }
412
- const ia = {
413
- name: "computeStyles",
414
- enabled: !0,
415
- phase: "beforeWrite",
416
- fn: na,
417
- data: {}
418
- };
419
- var Ie = {
420
- passive: !0
421
- };
422
- function oa(t) {
423
- var e = t.state, a = t.instance, r = t.options, n = r.scroll, l = n === void 0 ? !0 : n, i = r.resize, o = i === void 0 ? !0 : i, c = W(e.elements.popper), f = [].concat(e.scrollParents.reference, e.scrollParents.popper);
424
- return l && f.forEach(function(u) {
425
- u.addEventListener("scroll", a.update, Ie);
426
- }), o && c.addEventListener("resize", a.update, Ie), function() {
427
- l && f.forEach(function(u) {
428
- u.removeEventListener("scroll", a.update, Ie);
429
- }), o && c.removeEventListener("resize", a.update, Ie);
430
- };
431
- }
432
- const la = {
433
- name: "eventListeners",
434
- enabled: !0,
435
- phase: "write",
436
- fn: function() {
437
- },
438
- effect: oa,
439
- data: {}
440
- };
441
- var ca = {
442
- left: "right",
443
- right: "left",
444
- bottom: "top",
445
- top: "bottom"
446
- };
447
- function Ve(t) {
448
- return t.replace(/left|right|bottom|top/g, function(e) {
449
- return ca[e];
450
- });
451
- }
452
- var da = {
453
- start: "end",
454
- end: "start"
455
- };
456
- function $t(t) {
457
- return t.replace(/start|end/g, function(e) {
458
- return da[e];
459
- });
460
- }
461
- function ut(t) {
462
- var e = W(t), a = e.pageXOffset, r = e.pageYOffset;
463
- return {
464
- scrollLeft: a,
465
- scrollTop: r
466
- };
467
- }
468
- function ft(t) {
469
- return Ne(me(t)).left + ut(t).scrollLeft;
470
- }
471
- function ua(t, e) {
472
- var a = W(t), r = me(t), n = a.visualViewport, l = r.clientWidth, i = r.clientHeight, o = 0, c = 0;
473
- if (n) {
474
- l = n.width, i = n.height;
475
- var f = as();
476
- (f || !f && e === "fixed") && (o = n.offsetLeft, c = n.offsetTop);
477
- }
478
- return {
479
- width: l,
480
- height: i,
481
- x: o + ft(t),
482
- y: c
483
- };
484
- }
485
- function fa(t) {
486
- var e, a = me(t), r = ut(t), n = (e = t.ownerDocument) == null ? void 0 : e.body, l = he(a.scrollWidth, a.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), i = he(a.scrollHeight, a.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), o = -r.scrollLeft + ft(t), c = -r.scrollTop;
487
- return de(n || a).direction === "rtl" && (o += he(a.clientWidth, n ? n.clientWidth : 0) - l), {
488
- width: l,
489
- height: i,
490
- x: o,
491
- y: c
492
- };
493
- }
494
- function pt(t) {
495
- var e = de(t), a = e.overflow, r = e.overflowX, n = e.overflowY;
496
- return /auto|scroll|overlay|hidden/.test(a + n + r);
497
- }
498
- function ls(t) {
499
- return ["html", "body", "#document"].indexOf(pe(t)) >= 0 ? t.ownerDocument.body : ae(t) && pt(t) ? t : ls(ze(t));
500
- }
501
- function Ee(t, e) {
502
- var a;
503
- e === void 0 && (e = []);
504
- var r = ls(t), n = r === ((a = t.ownerDocument) == null ? void 0 : a.body), l = W(r), i = n ? [l].concat(l.visualViewport || [], pt(r) ? r : []) : r, o = e.concat(i);
505
- return n ? o : (
506
- // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
507
- o.concat(Ee(ze(i)))
508
- );
509
- }
510
- function it(t) {
511
- return Object.assign({}, t, {
512
- left: t.x,
513
- top: t.y,
514
- right: t.x + t.width,
515
- bottom: t.y + t.height
516
- });
517
- }
518
- function pa(t, e) {
519
- var a = Ne(t, !1, e === "fixed");
520
- return a.top = a.top + t.clientTop, a.left = a.left + t.clientLeft, a.bottom = a.top + t.clientHeight, a.right = a.left + t.clientWidth, a.width = t.clientWidth, a.height = t.clientHeight, a.x = a.left, a.y = a.top, a;
521
- }
522
- function Et(t, e, a) {
523
- return e === ts ? it(ua(t, a)) : xe(e) ? pa(e, a) : it(fa(me(t)));
524
- }
525
- function ma(t) {
526
- var e = Ee(ze(t)), a = ["absolute", "fixed"].indexOf(de(t).position) >= 0, r = a && ae(t) ? Ue(t) : t;
527
- return xe(r) ? e.filter(function(n) {
528
- return xe(n) && rs(n, r) && pe(n) !== "body";
529
- }) : [];
530
- }
531
- function ha(t, e, a, r) {
532
- var n = e === "clippingParents" ? ma(t) : [].concat(e), l = [].concat(n, [a]), i = l[0], o = l.reduce(function(c, f) {
533
- var u = Et(t, f, r);
534
- return c.top = he(u.top, c.top), c.right = He(u.right, c.right), c.bottom = He(u.bottom, c.bottom), c.left = he(u.left, c.left), c;
535
- }, Et(t, i, r));
536
- return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
537
- }
538
- function cs(t) {
539
- var e = t.reference, a = t.element, r = t.placement, n = r ? se(r) : null, l = r ? _e(r) : null, i = e.x + e.width / 2 - a.width / 2, o = e.y + e.height / 2 - a.height / 2, c;
540
- switch (n) {
541
- case U:
542
- c = {
543
- x: i,
544
- y: e.y - a.height
545
- };
546
- break;
547
- case K:
548
- c = {
549
- x: i,
550
- y: e.y + e.height
551
- };
552
- break;
553
- case G:
554
- c = {
555
- x: e.x + e.width,
556
- y: o
557
- };
558
- break;
559
- case B:
560
- c = {
561
- x: e.x - a.width,
562
- y: o
563
- };
564
- break;
565
- default:
566
- c = {
567
- x: e.x,
568
- y: e.y
569
- };
570
- }
571
- var f = n ? dt(n) : null;
572
- if (f != null) {
573
- var u = f === "y" ? "height" : "width";
574
- switch (l) {
575
- case ye:
576
- c[f] = c[f] - (e[u] / 2 - a[u] / 2);
577
- break;
578
- case Re:
579
- c[f] = c[f] + (e[u] / 2 - a[u] / 2);
580
- break;
581
- }
582
- }
583
- return c;
584
- }
585
- function Le(t, e) {
586
- e === void 0 && (e = {});
587
- var a = e, r = a.placement, n = r === void 0 ? t.placement : r, l = a.strategy, i = l === void 0 ? t.strategy : l, o = a.boundary, c = o === void 0 ? Fs : o, f = a.rootBoundary, u = f === void 0 ? ts : f, m = a.elementContext, h = m === void 0 ? Pe : m, d = a.altBoundary, v = d === void 0 ? !1 : d, x = a.padding, p = x === void 0 ? 0 : x, j = is(typeof p != "number" ? p : os(p, Fe)), g = h === Pe ? Us : Pe, N = t.rects.popper, b = t.elements[v ? g : h], _ = ha(xe(b) ? b : b.contextElement || me(t.elements.popper), c, u, i), w = Ne(t.elements.reference), O = cs({
588
- reference: w,
589
- element: N,
590
- placement: n
591
- }), E = it(Object.assign({}, N, O)), M = h === Pe ? E : w, A = {
592
- top: _.top - M.top + j.top,
593
- bottom: M.bottom - _.bottom + j.bottom,
594
- left: _.left - M.left + j.left,
595
- right: M.right - _.right + j.right
596
- }, $ = t.modifiersData.offset;
597
- if (h === Pe && $) {
598
- var R = $[n];
599
- Object.keys(A).forEach(function(S) {
600
- var L = [G, K].indexOf(S) >= 0 ? 1 : -1, k = [U, K].indexOf(S) >= 0 ? "y" : "x";
601
- A[S] += R[k] * L;
602
- });
603
- }
604
- return A;
605
- }
606
- function va(t, e) {
607
- e === void 0 && (e = {});
608
- var a = e, r = a.placement, n = a.boundary, l = a.rootBoundary, i = a.padding, o = a.flipVariations, c = a.allowedAutoPlacements, f = c === void 0 ? ss : c, u = _e(r), m = u ? o ? Pt : Pt.filter(function(v) {
609
- return _e(v) === u;
610
- }) : Fe, h = m.filter(function(v) {
611
- return f.indexOf(v) >= 0;
612
- });
613
- h.length === 0 && (h = m);
614
- var d = h.reduce(function(v, x) {
615
- return v[x] = Le(t, {
616
- placement: x,
617
- boundary: n,
618
- rootBoundary: l,
619
- padding: i
620
- })[se(x)], v;
621
- }, {});
622
- return Object.keys(d).sort(function(v, x) {
623
- return d[v] - d[x];
624
- });
625
- }
626
- function xa(t) {
627
- if (se(t) === ot)
628
- return [];
629
- var e = Ve(t);
630
- return [$t(t), e, $t(e)];
631
- }
632
- function ga(t) {
633
- var e = t.state, a = t.options, r = t.name;
634
- if (!e.modifiersData[r]._skip) {
635
- for (var n = a.mainAxis, l = n === void 0 ? !0 : n, i = a.altAxis, o = i === void 0 ? !0 : i, c = a.fallbackPlacements, f = a.padding, u = a.boundary, m = a.rootBoundary, h = a.altBoundary, d = a.flipVariations, v = d === void 0 ? !0 : d, x = a.allowedAutoPlacements, p = e.options.placement, j = se(p), g = j === p, N = c || (g || !v ? [Ve(p)] : xa(p)), b = [p].concat(N).reduce(function(H, ee) {
636
- return H.concat(se(ee) === ot ? va(e, {
637
- placement: ee,
638
- boundary: u,
639
- rootBoundary: m,
640
- padding: f,
641
- flipVariations: v,
642
- allowedAutoPlacements: x
643
- }) : ee);
644
- }, []), _ = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), E = !0, M = b[0], A = 0; A < b.length; A++) {
645
- var $ = b[A], R = se($), S = _e($) === ye, L = [U, K].indexOf(R) >= 0, k = L ? "width" : "height", F = Le(e, {
646
- placement: $,
647
- boundary: u,
648
- rootBoundary: m,
649
- altBoundary: h,
650
- padding: f
651
- }), I = L ? S ? G : B : S ? K : U;
652
- _[k] > w[k] && (I = Ve(I));
653
- var fe = Ve(I), ne = [];
654
- if (l && ne.push(F[R] <= 0), o && ne.push(F[I] <= 0, F[fe] <= 0), ne.every(function(H) {
655
- return H;
656
- })) {
657
- M = $, E = !1;
658
- break;
659
- }
660
- O.set($, ne);
661
- }
662
- if (E)
663
- for (var ie = v ? 3 : 1, Oe = function(ee) {
664
- var oe = b.find(function(be) {
665
- var J = O.get(be);
666
- if (J)
667
- return J.slice(0, ee).every(function(Se) {
668
- return Se;
669
- });
670
- });
671
- if (oe)
672
- return M = oe, "break";
673
- }, D = ie; D > 0; D--) {
674
- var ge = Oe(D);
675
- if (ge === "break") break;
676
- }
677
- e.placement !== M && (e.modifiersData[r]._skip = !0, e.placement = M, e.reset = !0);
678
- }
679
- }
680
- const ba = {
681
- name: "flip",
682
- enabled: !0,
683
- phase: "main",
684
- fn: ga,
685
- requiresIfExists: ["offset"],
686
- data: {
687
- _skip: !1
688
- }
689
- };
690
- function Mt(t, e, a) {
691
- return a === void 0 && (a = {
692
- x: 0,
693
- y: 0
694
- }), {
695
- top: t.top - e.height - a.y,
696
- right: t.right - e.width + a.x,
697
- bottom: t.bottom - e.height + a.y,
698
- left: t.left - e.width - a.x
699
- };
700
- }
701
- function kt(t) {
702
- return [U, G, K, B].some(function(e) {
703
- return t[e] >= 0;
704
- });
705
- }
706
- function ja(t) {
707
- var e = t.state, a = t.name, r = e.rects.reference, n = e.rects.popper, l = e.modifiersData.preventOverflow, i = Le(e, {
708
- elementContext: "reference"
709
- }), o = Le(e, {
710
- altBoundary: !0
711
- }), c = Mt(i, r), f = Mt(o, n, l), u = kt(c), m = kt(f);
712
- e.modifiersData[a] = {
713
- referenceClippingOffsets: c,
714
- popperEscapeOffsets: f,
715
- isReferenceHidden: u,
716
- hasPopperEscaped: m
717
- }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
718
- "data-popper-reference-hidden": u,
719
- "data-popper-escaped": m
720
- });
721
- }
722
- const ya = {
723
- name: "hide",
724
- enabled: !0,
725
- phase: "main",
726
- requiresIfExists: ["preventOverflow"],
727
- fn: ja
728
- };
729
- function wa(t, e, a) {
730
- var r = se(t), n = [B, U].indexOf(r) >= 0 ? -1 : 1, l = typeof a == "function" ? a(Object.assign({}, e, {
731
- placement: t
732
- })) : a, i = l[0], o = l[1];
733
- return i = i || 0, o = (o || 0) * n, [B, G].indexOf(r) >= 0 ? {
734
- x: o,
735
- y: i
736
- } : {
737
- x: i,
738
- y: o
739
- };
740
- }
741
- function Na(t) {
742
- var e = t.state, a = t.options, r = t.name, n = a.offset, l = n === void 0 ? [0, 0] : n, i = ss.reduce(function(u, m) {
743
- return u[m] = wa(m, e.rects, l), u;
744
- }, {}), o = i[e.placement], c = o.x, f = o.y;
745
- e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += f), e.modifiersData[r] = i;
746
- }
747
- const _a = {
748
- name: "offset",
749
- enabled: !0,
750
- phase: "main",
751
- requires: ["popperOffsets"],
752
- fn: Na
753
- };
754
- function Oa(t) {
755
- var e = t.state, a = t.name;
756
- e.modifiersData[a] = cs({
757
- reference: e.rects.reference,
758
- element: e.rects.popper,
759
- placement: e.placement
760
- });
761
- }
762
- const Sa = {
763
- name: "popperOffsets",
764
- enabled: !0,
765
- phase: "read",
766
- fn: Oa,
767
- data: {}
768
- };
769
- function Da(t) {
770
- return t === "x" ? "y" : "x";
771
- }
772
- function Pa(t) {
773
- var e = t.state, a = t.options, r = t.name, n = a.mainAxis, l = n === void 0 ? !0 : n, i = a.altAxis, o = i === void 0 ? !1 : i, c = a.boundary, f = a.rootBoundary, u = a.altBoundary, m = a.padding, h = a.tether, d = h === void 0 ? !0 : h, v = a.tetherOffset, x = v === void 0 ? 0 : v, p = Le(e, {
774
- boundary: c,
775
- rootBoundary: f,
776
- padding: m,
777
- altBoundary: u
778
- }), j = se(e.placement), g = _e(e.placement), N = !g, b = dt(j), _ = Da(b), w = e.modifiersData.popperOffsets, O = e.rects.reference, E = e.rects.popper, M = typeof x == "function" ? x(Object.assign({}, e.rects, {
779
- placement: e.placement
780
- })) : x, A = typeof M == "number" ? {
781
- mainAxis: M,
782
- altAxis: M
783
- } : Object.assign({
784
- mainAxis: 0,
785
- altAxis: 0
786
- }, M), $ = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, R = {
787
- x: 0,
788
- y: 0
789
- };
790
- if (w) {
791
- if (l) {
792
- var S, L = b === "y" ? U : B, k = b === "y" ? K : G, F = b === "y" ? "height" : "width", I = w[b], fe = I + p[L], ne = I - p[k], ie = d ? -E[F] / 2 : 0, Oe = g === ye ? O[F] : E[F], D = g === ye ? -E[F] : -O[F], ge = e.elements.arrow, H = d && ge ? ct(ge) : {
793
- width: 0,
794
- height: 0
795
- }, ee = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : ns(), oe = ee[L], be = ee[k], J = $e(0, O[F], H[F]), Se = N ? O[F] / 2 - ie - J - oe - A.mainAxis : Oe - J - oe - A.mainAxis, Xe = N ? -O[F] / 2 + ie + J + be + A.mainAxis : D + J + be + A.mainAxis, T = e.elements.arrow && Ue(e.elements.arrow), je = T ? b === "y" ? T.clientTop || 0 : T.clientLeft || 0 : 0, De = (S = $?.[b]) != null ? S : 0, ht = I + Se - De - je, vt = I + Xe - De, Ye = $e(d ? He(fe, ht) : fe, I, d ? he(ne, vt) : ne);
796
- w[b] = Ye, R[b] = Ye - I;
797
- }
798
- if (o) {
799
- var qe, Ke = b === "x" ? U : B, Ge = b === "x" ? K : G, te = w[_], y = _ === "y" ? "height" : "width", V = te + p[Ke], xt = te - p[Ge], Je = [U, B].indexOf(j) !== -1, gt = (qe = $?.[_]) != null ? qe : 0, bt = Je ? V : te - O[y] - E[y] - gt + A.altAxis, jt = Je ? te + O[y] + E[y] - gt - A.altAxis : xt, yt = d && Je ? Qs(bt, te, jt) : $e(d ? bt : V, te, d ? jt : xt);
800
- w[_] = yt, R[_] = yt - te;
801
- }
802
- e.modifiersData[r] = R;
803
- }
804
- }
805
- const Aa = {
806
- name: "preventOverflow",
807
- enabled: !0,
808
- phase: "main",
809
- fn: Pa,
810
- requiresIfExists: ["offset"]
811
- };
812
- function Ca(t) {
813
- return {
814
- scrollLeft: t.scrollLeft,
815
- scrollTop: t.scrollTop
816
- };
817
- }
818
- function $a(t) {
819
- return t === W(t) || !ae(t) ? ut(t) : Ca(t);
820
- }
821
- function Ea(t) {
822
- var e = t.getBoundingClientRect(), a = we(e.width) / t.offsetWidth || 1, r = we(e.height) / t.offsetHeight || 1;
823
- return a !== 1 || r !== 1;
824
- }
825
- function Ma(t, e, a) {
826
- a === void 0 && (a = !1);
827
- var r = ae(e), n = ae(e) && Ea(e), l = me(e), i = Ne(t, n, a), o = {
828
- scrollLeft: 0,
829
- scrollTop: 0
830
- }, c = {
831
- x: 0,
832
- y: 0
833
- };
834
- return (r || !r && !a) && ((pe(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
835
- pt(l)) && (o = $a(e)), ae(e) ? (c = Ne(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : l && (c.x = ft(l))), {
836
- x: i.left + o.scrollLeft - c.x,
837
- y: i.top + o.scrollTop - c.y,
838
- width: i.width,
839
- height: i.height
840
- };
841
- }
842
- function ka(t) {
843
- var e = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), r = [];
844
- t.forEach(function(l) {
845
- e.set(l.name, l);
846
- });
847
- function n(l) {
848
- a.add(l.name);
849
- var i = [].concat(l.requires || [], l.requiresIfExists || []);
850
- i.forEach(function(o) {
851
- if (!a.has(o)) {
852
- var c = e.get(o);
853
- c && n(c);
854
- }
855
- }), r.push(l);
856
- }
857
- return t.forEach(function(l) {
858
- a.has(l.name) || n(l);
859
- }), r;
860
- }
861
- function Ra(t) {
862
- var e = ka(t);
863
- return Ks.reduce(function(a, r) {
864
- return a.concat(e.filter(function(n) {
865
- return n.phase === r;
866
- }));
867
- }, []);
868
- }
869
- function La(t) {
870
- var e;
871
- return function() {
872
- return e || (e = new Promise(function(a) {
873
- Promise.resolve().then(function() {
874
- e = void 0, a(t());
875
- });
876
- })), e;
877
- };
878
- }
879
- function Ta(t) {
880
- var e = t.reduce(function(a, r) {
881
- var n = a[r.name];
882
- return a[r.name] = n ? Object.assign({}, n, r, {
883
- options: Object.assign({}, n.options, r.options),
884
- data: Object.assign({}, n.data, r.data)
885
- }) : r, a;
886
- }, {});
887
- return Object.keys(e).map(function(a) {
888
- return e[a];
889
- });
890
- }
891
- var Rt = {
892
- placement: "bottom",
893
- modifiers: [],
894
- strategy: "absolute"
895
- };
896
- function Lt() {
897
- for (var t = arguments.length, e = new Array(t), a = 0; a < t; a++)
898
- e[a] = arguments[a];
899
- return !e.some(function(r) {
900
- return !(r && typeof r.getBoundingClientRect == "function");
901
- });
902
- }
903
- function Fa(t) {
904
- t === void 0 && (t = {});
905
- var e = t, a = e.defaultModifiers, r = a === void 0 ? [] : a, n = e.defaultOptions, l = n === void 0 ? Rt : n;
906
- return function(o, c, f) {
907
- f === void 0 && (f = l);
908
- var u = {
909
- placement: "bottom",
910
- orderedModifiers: [],
911
- options: Object.assign({}, Rt, l),
912
- modifiersData: {},
913
- elements: {
914
- reference: o,
915
- popper: c
916
- },
917
- attributes: {},
918
- styles: {}
919
- }, m = [], h = !1, d = {
920
- state: u,
921
- setOptions: function(j) {
922
- var g = typeof j == "function" ? j(u.options) : j;
923
- x(), u.options = Object.assign({}, l, u.options, g), u.scrollParents = {
924
- reference: xe(o) ? Ee(o) : o.contextElement ? Ee(o.contextElement) : [],
925
- popper: Ee(c)
926
- };
927
- var N = Ra(Ta([].concat(r, u.options.modifiers)));
928
- return u.orderedModifiers = N.filter(function(b) {
929
- return b.enabled;
930
- }), v(), d.update();
931
- },
932
- // Sync update – it will always be executed, even if not necessary. This
933
- // is useful for low frequency updates where sync behavior simplifies the
934
- // logic.
935
- // For high frequency updates (e.g. `resize` and `scroll` events), always
936
- // prefer the async Popper#update method
937
- forceUpdate: function() {
938
- if (!h) {
939
- var j = u.elements, g = j.reference, N = j.popper;
940
- if (Lt(g, N)) {
941
- u.rects = {
942
- reference: Ma(g, Ue(N), u.options.strategy === "fixed"),
943
- popper: ct(N)
944
- }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(A) {
945
- return u.modifiersData[A.name] = Object.assign({}, A.data);
946
- });
947
- for (var b = 0; b < u.orderedModifiers.length; b++) {
948
- if (u.reset === !0) {
949
- u.reset = !1, b = -1;
950
- continue;
951
- }
952
- var _ = u.orderedModifiers[b], w = _.fn, O = _.options, E = O === void 0 ? {} : O, M = _.name;
953
- typeof w == "function" && (u = w({
954
- state: u,
955
- options: E,
956
- name: M,
957
- instance: d
958
- }) || u);
959
- }
960
- }
961
- }
962
- },
963
- // Async and optimistically optimized update – it will not be executed if
964
- // not necessary (debounced to run at most once-per-tick)
965
- update: La(function() {
966
- return new Promise(function(p) {
967
- d.forceUpdate(), p(u);
968
- });
969
- }),
970
- destroy: function() {
971
- x(), h = !0;
972
- }
973
- };
974
- if (!Lt(o, c))
975
- return d;
976
- d.setOptions(f).then(function(p) {
977
- !h && f.onFirstUpdate && f.onFirstUpdate(p);
978
- });
979
- function v() {
980
- u.orderedModifiers.forEach(function(p) {
981
- var j = p.name, g = p.options, N = g === void 0 ? {} : g, b = p.effect;
982
- if (typeof b == "function") {
983
- var _ = b({
984
- state: u,
985
- name: j,
986
- instance: d,
987
- options: N
988
- }), w = function() {
989
- };
990
- m.push(_ || w);
991
- }
992
- });
993
- }
994
- function x() {
995
- m.forEach(function(p) {
996
- return p();
997
- }), m = [];
998
- }
999
- return d;
1000
- };
1001
- }
1002
- const Ua = Fa({
1003
- defaultModifiers: [ya, Sa, ia, la, _a, ba, Aa, sa]
1004
- }), Ba = ["enabled", "placement", "strategy", "modifiers"];
1005
- function Ia(t, e) {
1006
- if (t == null) return {};
1007
- var a = {};
1008
- for (var r in t) if ({}.hasOwnProperty.call(t, r)) {
1009
- if (e.indexOf(r) >= 0) continue;
1010
- a[r] = t[r];
1011
- }
1012
- return a;
1013
- }
1014
- const Va = {
1015
- name: "applyStyles",
1016
- enabled: !1,
1017
- phase: "afterWrite",
1018
- fn: () => {
1019
- }
1020
- }, Wa = {
1021
- name: "ariaDescribedBy",
1022
- enabled: !0,
1023
- phase: "afterWrite",
1024
- effect: ({
1025
- state: t
1026
- }) => () => {
1027
- const {
1028
- reference: e,
1029
- popper: a
1030
- } = t.elements;
1031
- if ("removeAttribute" in e) {
1032
- const r = (e.getAttribute("aria-describedby") || "").split(",").filter((n) => n.trim() !== a.id);
1033
- r.length ? e.setAttribute("aria-describedby", r.join(",")) : e.removeAttribute("aria-describedby");
1034
- }
1035
- },
1036
- fn: ({
1037
- state: t
1038
- }) => {
1039
- var e;
1040
- const {
1041
- popper: a,
1042
- reference: r
1043
- } = t.elements, n = (e = a.getAttribute("role")) == null ? void 0 : e.toLowerCase();
1044
- if (a.id && n === "tooltip" && "setAttribute" in r) {
1045
- const l = r.getAttribute("aria-describedby");
1046
- if (l && l.split(",").indexOf(a.id) !== -1)
1047
- return;
1048
- r.setAttribute("aria-describedby", l ? `${l},${a.id}` : a.id);
1049
- }
1050
- }
1051
- }, Ha = [];
1052
- function za(t, e, a = {}) {
1053
- let {
1054
- enabled: r = !0,
1055
- placement: n = "bottom",
1056
- strategy: l = "absolute",
1057
- modifiers: i = Ha
1058
- } = a, o = Ia(a, Ba);
1059
- const c = q(i), f = q(), u = z(() => {
1060
- var p;
1061
- (p = f.current) == null || p.update();
1062
- }, []), m = z(() => {
1063
- var p;
1064
- (p = f.current) == null || p.forceUpdate();
1065
- }, []), [h, d] = Ts(C({
1066
- placement: n,
1067
- update: u,
1068
- forceUpdate: m,
1069
- attributes: {},
1070
- styles: {
1071
- popper: {},
1072
- arrow: {}
1073
- }
1074
- })), v = Me(() => ({
1075
- name: "updateStateModifier",
1076
- enabled: !0,
1077
- phase: "write",
1078
- requires: ["computeStyles"],
1079
- fn: ({
1080
- state: p
1081
- }) => {
1082
- const j = {}, g = {};
1083
- Object.keys(p.elements).forEach((N) => {
1084
- j[N] = p.styles[N], g[N] = p.attributes[N];
1085
- }), d({
1086
- state: p,
1087
- styles: j,
1088
- attributes: g,
1089
- update: u,
1090
- forceUpdate: m,
1091
- placement: p.placement
1092
- });
1093
- }
1094
- }), [u, m, d]), x = Me(() => (Ce(c.current, i) || (c.current = i), c.current), [i]);
1095
- return X(() => {
1096
- !f.current || !r || f.current.setOptions({
1097
- placement: n,
1098
- strategy: l,
1099
- modifiers: [...x, v, Va]
1100
- });
1101
- }, [l, n, v, r, x]), X(() => {
1102
- if (!(!r || t == null || e == null))
1103
- return f.current = Ua(t, e, Object.assign({}, o, {
1104
- placement: n,
1105
- strategy: l,
1106
- modifiers: [...x, Wa, v]
1107
- })), () => {
1108
- f.current != null && (f.current.destroy(), f.current = void 0, d((p) => Object.assign({}, p, {
1109
- attributes: {},
1110
- styles: {
1111
- popper: {}
1112
- }
1113
- })));
1114
- };
1115
- }, [r, t, e]), h;
1116
- }
1117
- const Tt = () => {
1118
- };
1119
- function Xa(t) {
1120
- return t.button === 0;
1121
- }
1122
- function Ya(t) {
1123
- return !!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey);
1124
- }
1125
- const We = (t) => t && ("current" in t ? t.current : t), Ft = {
1126
- click: "mousedown",
1127
- mouseup: "mousedown",
1128
- pointerup: "pointerdown"
1129
- };
1130
- function qa(t, e = Tt, {
1131
- disabled: a,
1132
- clickTrigger: r = "click"
1133
- } = {}) {
1134
- const n = q(!1), l = q(!1), i = z((f) => {
1135
- const u = We(t);
1136
- Jt(!!u, "ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"), n.current = !u || Ya(f) || !Xa(f) || !!tt(u, f.target) || l.current, l.current = !1;
1137
- }, [t]), o = st((f) => {
1138
- const u = We(t);
1139
- u && tt(u, f.target) ? l.current = !0 : l.current = !1;
1140
- }), c = st((f) => {
1141
- n.current || e(f);
1142
- });
1143
- X(() => {
1144
- var f, u;
1145
- if (a || t == null) return;
1146
- const m = qt(We(t)), h = m.defaultView || window;
1147
- let d = (f = h.event) != null ? f : (u = h.parent) == null ? void 0 : u.event, v = null;
1148
- Ft[r] && (v = Ae(m, Ft[r], o, !0));
1149
- const x = Ae(m, r, i, !0), p = Ae(m, r, (g) => {
1150
- if (g === d) {
1151
- d = void 0;
1152
- return;
1153
- }
1154
- c(g);
1155
- });
1156
- let j = [];
1157
- return "ontouchstart" in m.documentElement && (j = [].slice.call(m.body.children).map((g) => Ae(g, "mousemove", Tt))), () => {
1158
- v?.(), x(), p(), j.forEach((g) => g());
1159
- };
1160
- }, [t, a, r, i, o, c]);
1161
- }
1162
- const Ka = () => {
1163
- };
1164
- function Ga(t, e, {
1165
- disabled: a,
1166
- clickTrigger: r
1167
- } = {}) {
1168
- const n = e || Ka;
1169
- qa(t, n, {
1170
- disabled: a,
1171
- clickTrigger: r
1172
- });
1173
- const l = st((i) => {
1174
- js(i) && n(i);
1175
- });
1176
- X(() => {
1177
- if (a || t == null) return;
1178
- const i = qt(We(t));
1179
- let o = (i.defaultView || window).event;
1180
- const c = Ae(i, "keyup", (f) => {
1181
- if (f === o) {
1182
- o = void 0;
1183
- return;
1184
- }
1185
- l(f);
1186
- });
1187
- return () => {
1188
- c();
1189
- };
1190
- }, [t, a, l]);
1191
- }
1192
- function Ja(t) {
1193
- const e = {};
1194
- return Array.isArray(t) ? (t?.forEach((a) => {
1195
- e[a.name] = a;
1196
- }), e) : t || e;
1197
- }
1198
- function Qa(t = {}) {
1199
- return Array.isArray(t) ? t : Object.keys(t).map((e) => (t[e].name = e, t[e]));
1200
- }
1201
- function Za({
1202
- enabled: t,
1203
- enableEvents: e,
1204
- placement: a,
1205
- flip: r,
1206
- offset: n,
1207
- fixed: l,
1208
- containerPadding: i,
1209
- arrowElement: o,
1210
- popperConfig: c = {}
1211
- }) {
1212
- var f, u, m, h;
1213
- const d = Ja(c.modifiers);
1214
- return Object.assign({}, c, {
1215
- placement: a,
1216
- enabled: t,
1217
- strategy: l ? "fixed" : c.strategy,
1218
- modifiers: Qa(Object.assign({}, d, {
1219
- eventListeners: {
1220
- enabled: e,
1221
- options: (f = d.eventListeners) == null ? void 0 : f.options
1222
- },
1223
- preventOverflow: Object.assign({}, d.preventOverflow, {
1224
- options: Object.assign({
1225
- padding: i
1226
- }, (u = d.preventOverflow) == null ? void 0 : u.options)
1227
- }),
1228
- offset: {
1229
- options: Object.assign({
1230
- offset: n
1231
- }, (m = d.offset) == null ? void 0 : m.options)
1232
- },
1233
- arrow: Object.assign({}, d.arrow, {
1234
- enabled: !!o,
1235
- options: Object.assign({}, (h = d.arrow) == null ? void 0 : h.options, {
1236
- element: o
1237
- })
1238
- }),
1239
- flip: Object.assign({
1240
- enabled: !!r
1241
- }, d.flip)
1242
- }))
1243
- });
1244
- }
1245
- const ds = /* @__PURE__ */ ce.forwardRef((t, e) => {
1246
- const {
1247
- flip: a,
1248
- offset: r,
1249
- placement: n,
1250
- containerPadding: l,
1251
- popperConfig: i = {},
1252
- transition: o,
1253
- runTransition: c
1254
- } = t, [f, u] = Ot(), [m, h] = Ot(), d = ys(u, e), v = wt(t.container), x = wt(t.target), [p, j] = C(!t.show), g = za(x, f, Za({
1255
- placement: n,
1256
- enableEvents: !!t.show,
1257
- containerPadding: l || 5,
1258
- flip: a,
1259
- offset: r,
1260
- arrowElement: m,
1261
- popperConfig: i
1262
- }));
1263
- t.show && p && j(!1);
1264
- const N = (...$) => {
1265
- j(!0), t.onExited && t.onExited(...$);
1266
- }, b = t.show || !p;
1267
- if (Ga(f, t.onHide, {
1268
- disabled: !t.rootClose || t.rootCloseDisabled,
1269
- clickTrigger: t.rootCloseEvent
1270
- }), !b)
1271
- return null;
1272
- const {
1273
- onExit: _,
1274
- onExiting: w,
1275
- onEnter: O,
1276
- onEntering: E,
1277
- onEntered: M
1278
- } = t;
1279
- let A = t.children(Object.assign({}, g.attributes.popper, {
1280
- style: g.styles.popper,
1281
- ref: d
1282
- }), {
1283
- popper: g,
1284
- placement: n,
1285
- show: !!t.show,
1286
- arrowProps: Object.assign({}, g.attributes.arrow, {
1287
- style: g.styles.arrow,
1288
- ref: h
1289
- })
1290
- });
1291
- return A = ws(o, c, {
1292
- in: !!t.show,
1293
- appear: !0,
1294
- mountOnEnter: !0,
1295
- unmountOnExit: !0,
1296
- children: A,
1297
- onExit: _,
1298
- onExiting: w,
1299
- onExited: N,
1300
- onEnter: O,
1301
- onEntering: E,
1302
- onEntered: M
1303
- }), v ? /* @__PURE__ */ Ds.createPortal(A, v) : null;
1304
- });
1305
- ds.displayName = "Overlay";
1306
- const er = typeof global < "u" && // @ts-ignore
1307
- global.navigator && // @ts-ignore
1308
- global.navigator.product === "ReactNative", tr = typeof document < "u", sr = tr || er ? xs : X, us = /* @__PURE__ */ ce.forwardRef(({
1309
- className: t,
1310
- bsPrefix: e,
1311
- as: a = "div",
1312
- ...r
1313
- }, n) => (e = ve(e, "popover-header"), /* @__PURE__ */ s.jsx(a, {
1314
- ref: n,
1315
- className: ue(t, e),
1316
- ...r
1317
- })));
1318
- us.displayName = "PopoverHeader";
1319
- const mt = /* @__PURE__ */ ce.forwardRef(({
1320
- className: t,
1321
- bsPrefix: e,
1322
- as: a = "div",
1323
- ...r
1324
- }, n) => (e = ve(e, "popover-body"), /* @__PURE__ */ s.jsx(a, {
1325
- ref: n,
1326
- className: ue(t, e),
1327
- ...r
1328
- })));
1329
- mt.displayName = "PopoverBody";
1330
- function fs(t, e) {
1331
- let a = t;
1332
- return t === "left" ? a = e ? "end" : "start" : t === "right" && (a = e ? "start" : "end"), a;
1333
- }
1334
- function ps(t = "absolute") {
1335
- return {
1336
- position: t,
1337
- top: "0",
1338
- left: "0",
1339
- opacity: "0",
1340
- pointerEvents: "none"
1341
- };
1342
- }
1343
- const ms = /* @__PURE__ */ ce.forwardRef(({
1344
- bsPrefix: t,
1345
- placement: e = "right",
1346
- className: a,
1347
- style: r,
1348
- children: n,
1349
- body: l,
1350
- arrowProps: i,
1351
- hasDoneInitialMeasure: o,
1352
- popper: c,
1353
- show: f,
1354
- ...u
1355
- }, m) => {
1356
- const h = ve(t, "popover"), d = Kt(), [v] = e?.split("-") || [], x = fs(v, d);
1357
- let p = r;
1358
- return f && !o && (p = {
1359
- ...r,
1360
- ...ps(c?.strategy)
1361
- }), /* @__PURE__ */ s.jsxs("div", {
1362
- ref: m,
1363
- role: "tooltip",
1364
- style: p,
1365
- "x-placement": v,
1366
- className: ue(a, h, v && `bs-popover-${x}`),
1367
- ...u,
1368
- children: [/* @__PURE__ */ s.jsx("div", {
1369
- className: "popover-arrow",
1370
- ...i
1371
- }), l ? /* @__PURE__ */ s.jsx(mt, {
1372
- children: n
1373
- }) : n]
1374
- });
1375
- });
1376
- ms.displayName = "Popover";
1377
- const ar = Object.assign(ms, {
1378
- Header: us,
1379
- Body: mt,
1380
- // Default popover offset.
1381
- // https://github.com/twbs/bootstrap/blob/5c32767e0e0dbac2d934bcdee03719a65d3f1187/js/src/popover.js#L28
1382
- POPPER_OFFSET: [0, 8]
1383
- }), hs = /* @__PURE__ */ ce.forwardRef(({
1384
- bsPrefix: t,
1385
- placement: e = "right",
1386
- className: a,
1387
- style: r,
1388
- children: n,
1389
- arrowProps: l,
1390
- hasDoneInitialMeasure: i,
1391
- popper: o,
1392
- show: c,
1393
- ...f
1394
- }, u) => {
1395
- t = ve(t, "tooltip");
1396
- const m = Kt(), [h] = e?.split("-") || [], d = fs(h, m);
1397
- let v = r;
1398
- return c && !i && (v = {
1399
- ...r,
1400
- ...ps(o?.strategy)
1401
- }), /* @__PURE__ */ s.jsxs("div", {
1402
- ref: u,
1403
- style: v,
1404
- role: "tooltip",
1405
- "x-placement": h,
1406
- className: ue(a, t, `bs-tooltip-${d}`),
1407
- ...f,
1408
- children: [/* @__PURE__ */ s.jsx("div", {
1409
- className: "tooltip-arrow",
1410
- ...l
1411
- }), /* @__PURE__ */ s.jsx("div", {
1412
- className: `${t}-inner`,
1413
- children: n
1414
- })]
1415
- });
1416
- });
1417
- hs.displayName = "Tooltip";
1418
- const Q = Object.assign(hs, {
1419
- // Default tooltip offset.
1420
- // https://github.com/twbs/bootstrap/blob/beca2a6c7f6bc88b6449339fc76edcda832c59e5/js/src/tooltip.js#L65
1421
- TOOLTIP_OFFSET: [0, 6]
1422
- });
1423
- function rr(t) {
1424
- const e = q(null), a = ve(void 0, "popover"), r = ve(void 0, "tooltip"), n = Me(() => ({
1425
- name: "offset",
1426
- options: {
1427
- offset: () => {
1428
- if (t)
1429
- return t;
1430
- if (e.current) {
1431
- if (Nt(e.current, a))
1432
- return ar.POPPER_OFFSET;
1433
- if (Nt(e.current, r))
1434
- return Q.TOOLTIP_OFFSET;
1435
- }
1436
- return [0, 0];
1437
- }
1438
- }
1439
- }), [t, a, r]);
1440
- return [e, [n]];
1441
- }
1442
- function nr(t, e) {
1443
- const {
1444
- ref: a
1445
- } = t, {
1446
- ref: r
1447
- } = e;
1448
- t.ref = a.__wrapped || (a.__wrapped = (n) => a(at(n))), e.ref = r.__wrapped || (r.__wrapped = (n) => r(at(n)));
1449
- }
1450
- const vs = /* @__PURE__ */ ce.forwardRef(({
1451
- children: t,
1452
- transition: e = _t,
1453
- popperConfig: a = {},
1454
- rootClose: r = !1,
1455
- placement: n = "top",
1456
- show: l = !1,
1457
- ...i
1458
- }, o) => {
1459
- const c = q({}), [f, u] = C(null), [m, h] = rr(i.offset), d = Gt(o, m), v = e === !0 ? _t : e || void 0, x = Ns((p) => {
1460
- u(p), a == null || a.onFirstUpdate == null || a.onFirstUpdate(p);
1461
- });
1462
- return sr(() => {
1463
- f && i.target && (c.current.scheduleUpdate == null || c.current.scheduleUpdate());
1464
- }, [f, i.target]), X(() => {
1465
- l || u(null);
1466
- }, [l]), /* @__PURE__ */ s.jsx(ds, {
1467
- ...i,
1468
- ref: d,
1469
- popperConfig: {
1470
- ...a,
1471
- modifiers: h.concat(a.modifiers || []),
1472
- onFirstUpdate: x
1473
- },
1474
- transition: v,
1475
- rootClose: r,
1476
- placement: n,
1477
- show: l,
1478
- children: (p, {
1479
- arrowProps: j,
1480
- popper: g,
1481
- show: N
1482
- }) => {
1483
- var b;
1484
- nr(p, j);
1485
- const _ = g?.placement, w = Object.assign(c.current, {
1486
- state: g?.state,
1487
- scheduleUpdate: g?.update,
1488
- placement: _,
1489
- outOfBoundaries: (g == null || (b = g.state) == null || (b = b.modifiersData.hide) == null ? void 0 : b.isReferenceHidden) || !1,
1490
- strategy: a.strategy
1491
- }), O = !!f;
1492
- return typeof t == "function" ? t({
1493
- ...p,
1494
- placement: _,
1495
- show: N,
1496
- ...!e && N && {
1497
- className: "show"
1498
- },
1499
- popper: w,
1500
- arrowProps: j,
1501
- hasDoneInitialMeasure: O
1502
- }) : /* @__PURE__ */ ce.cloneElement(t, {
1503
- ...p,
1504
- placement: _,
1505
- arrowProps: j,
1506
- popper: w,
1507
- hasDoneInitialMeasure: O,
1508
- className: ue(t.props.className, !e && N && "show"),
1509
- style: {
1510
- ...t.props.style,
1511
- ...p.style
1512
- }
1513
- });
1514
- }
1515
- });
1516
- });
1517
- vs.displayName = "Overlay";
1518
- function ir(t) {
1519
- return t && typeof t == "object" ? t : {
1520
- show: t,
1521
- hide: t
1522
- };
1523
- }
1524
- function Ut(t, e, a) {
1525
- const [r] = e, n = r.currentTarget, l = r.relatedTarget || r.nativeEvent[a];
1526
- (!l || l !== n) && !tt(n, l) && t(...e);
1527
- }
1528
- Os.oneOf(["click", "hover", "focus"]);
1529
- const le = ({
1530
- trigger: t = ["hover", "focus"],
1531
- overlay: e,
1532
- children: a,
1533
- popperConfig: r = {},
1534
- show: n,
1535
- defaultShow: l = !1,
1536
- onToggle: i,
1537
- delay: o,
1538
- placement: c,
1539
- flip: f = c && c.indexOf("auto") !== -1,
1540
- ...u
1541
- }) => {
1542
- const m = q(null), h = Gt(m, _s(a)), d = Rs(), v = q(""), [x, p] = Ls(n, l, i), j = ir(o), {
1543
- onFocus: g,
1544
- onBlur: N,
1545
- onClick: b
1546
- } = typeof a != "function" ? ce.Children.only(a).props : {}, _ = (k) => {
1547
- h(at(k));
1548
- }, w = z(() => {
1549
- if (d.clear(), v.current = "show", !j.show) {
1550
- p(!0);
1551
- return;
1552
- }
1553
- d.set(() => {
1554
- v.current === "show" && p(!0);
1555
- }, j.show);
1556
- }, [j.show, p, d]), O = z(() => {
1557
- if (d.clear(), v.current = "hide", !j.hide) {
1558
- p(!1);
1559
- return;
1560
- }
1561
- d.set(() => {
1562
- v.current === "hide" && p(!1);
1563
- }, j.hide);
1564
- }, [j.hide, p, d]), E = z((...k) => {
1565
- w(), g?.(...k);
1566
- }, [w, g]), M = z((...k) => {
1567
- O(), N?.(...k);
1568
- }, [O, N]), A = z((...k) => {
1569
- p(!x), b?.(...k);
1570
- }, [b, p, x]), $ = z((...k) => {
1571
- Ut(w, k, "fromElement");
1572
- }, [w]), R = z((...k) => {
1573
- Ut(O, k, "toElement");
1574
- }, [O]), S = t == null ? [] : [].concat(t), L = {
1575
- ref: _
1576
- };
1577
- return S.indexOf("click") !== -1 && (L.onClick = A), S.indexOf("focus") !== -1 && (L.onFocus = E, L.onBlur = M), S.indexOf("hover") !== -1 && (process.env.NODE_ENV !== "production" && Jt(S.length > 1, '[react-bootstrap] Specifying only the `"hover"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `"focus"` trigger so that touch and keyboard only users can see the overlay as well.'), L.onMouseOver = $, L.onMouseOut = R), /* @__PURE__ */ s.jsxs(s.Fragment, {
1578
- children: [typeof a == "function" ? a(L) : /* @__PURE__ */ zt(a, L), /* @__PURE__ */ s.jsx(vs, {
1579
- ...u,
1580
- show: x,
1581
- onHide: O,
1582
- flip: f,
1583
- placement: c,
1584
- popperConfig: r,
1585
- target: m.current,
1586
- children: e
1587
- })]
1588
- });
1589
- };
1590
- function Bt(t) {
1591
- const { profile_photo: e, width: a, alt: r, hideDefault: n, activityStatus: l, user_id: i } = t;
1592
- return e?.key ? /* @__PURE__ */ s.jsxs(
1593
- "div",
1594
- {
1595
- "data-using-react-profile-photo": "true",
1596
- className: `profile-photo-wrap ${a ? "" : "w-100 h-100"}`,
1597
- style: {
1598
- ...a && {
1599
- width: a,
1600
- height: a
1601
- }
1602
- },
1603
- children: [
1604
- /* @__PURE__ */ s.jsx(
1605
- It,
1606
- {
1607
- activityStatus: l,
1608
- user_id: i
1609
- }
1610
- ),
1611
- /* @__PURE__ */ s.jsx(
1612
- "img",
1613
- {
1614
- className: "w-100 h-100",
1615
- src: `${process.env.NEXT_PUBLIC_CDN}${e.key}`,
1616
- style: { objectFit: "contain" },
1617
- alt: r || "Profile photo of a user"
1618
- }
1619
- )
1620
- ]
1621
- }
1622
- ) : /* @__PURE__ */ s.jsxs(
1623
- "div",
1624
- {
1625
- "data-using-react-profile-photo": "true",
1626
- className: ue(
1627
- "profile-photo-wrap",
1628
- {
1629
- "w-100 h-100": !a,
1630
- "d-none": n
1631
- }
1632
- ),
1633
- style: {
1634
- ...a && {
1635
- width: a,
1636
- height: a
1637
- }
1638
- },
1639
- children: [
1640
- /* @__PURE__ */ s.jsx(
1641
- It,
1642
- {
1643
- activityStatus: l,
1644
- user_id: i
1645
- }
1646
- ),
1647
- /* @__PURE__ */ s.jsx(
1648
- "img",
1649
- {
1650
- className: "w-100 h-100",
1651
- src: `${process.env.NEXT_PUBLIC_CDN}profile_photos/starter/articles.jpg`,
1652
- style: { objectFit: "contain" },
1653
- alt: r || "Profile photo of a user"
1654
- }
1655
- )
1656
- ]
1657
- }
1658
- );
1659
- }
1660
- function It({
1661
- activityStatus: t,
1662
- user_id: e
1663
- }) {
1664
- if (!(!t || !e))
1665
- return /* @__PURE__ */ s.jsx(
1666
- "div",
1667
- {
1668
- "data-user_id": e,
1669
- className: ue(
1670
- "online-status",
1671
- {
1672
- "status-online": t?.status == "Online" || e == "630f0b337c52851e754b03f7",
1673
- "status-offline": t?.status == "Offline",
1674
- "status-away": t?.status == "Away",
1675
- // Maybe one day show that friends are in a game or on a page if they want to share, we already collect this data anyway!
1676
- "activity-active": !1
1677
- }
1678
- )
1679
- }
1680
- );
1681
- }
1682
- const or = (t) => (e, a, r) => (r.revalidateOnFocus = !1, r.revalidateIfStale = !1, r.revalidateOnReconnect = !1, t(e, a, r)), lr = Ps(Qt, or), cr = (t) => Zt.get(t.url, {
1683
- params: {
1684
- user_id: t.user_id
1685
- }
1686
- }).then((e) => e.data), dr = {
1687
- dedupingInterval: 1e3 * 60 * 1,
1688
- focusThrottleInterval: 1e3 * 60 * 1
1689
- // fallbackData: []
1690
- }, Vt = (t) => {
1691
- const { data: e, error: a, isLoading: r, isValidating: n, mutate: l } = lr(
1692
- t?.user_id ? {
1693
- url: process.env.NODE_ENV === "development" ? "http://localhost:3001/api/user-public/getUserDetails" : "https://articles.media/api/user-public/getUserDetails",
1694
- // "/api/user-public/getUserDetails",
1695
- user_id: t.user_id
1696
- } : null,
1697
- cr,
1698
- dr
1699
- );
1700
- return {
1701
- data: e,
1702
- error: a,
1703
- isLoading: r,
1704
- isValidating: n,
1705
- mutate: l
1706
- };
1707
- };
1708
- function Ze({ className: t, noOutline: e, children: a, inline: r }) {
1709
- const [l, i] = C();
1710
- if (X(() => {
1711
- i(!0);
1712
- }, []), a && (!1)?.roles?.isDev && l)
1713
- return /* @__PURE__ */ s.jsx("div", { className: `is-dev-content ${e && "no-outline"} ${t} ${r && "d-inline-block"}`, children: a });
1714
- }
1715
- const Wt = 1e3;
1716
- function ur(t, e, a) {
1717
- const r = (t - e) / (a - e) * 100;
1718
- return Math.round(r * Wt) / Wt;
1719
- }
1720
- function Ht({
1721
- min: t,
1722
- now: e,
1723
- max: a,
1724
- label: r,
1725
- visuallyHidden: n,
1726
- striped: l,
1727
- animated: i,
1728
- className: o,
1729
- style: c,
1730
- variant: f,
1731
- bsPrefix: u,
1732
- ...m
1733
- }, h) {
1734
- return /* @__PURE__ */ s.jsx("div", {
1735
- ref: h,
1736
- ...m,
1737
- role: "progressbar",
1738
- className: ue(o, `${u}-bar`, {
1739
- [`bg-${f}`]: f,
1740
- [`${u}-bar-animated`]: i,
1741
- [`${u}-bar-striped`]: i || l
1742
- }),
1743
- style: {
1744
- width: `${ur(e, t, a)}%`,
1745
- ...c
1746
- },
1747
- "aria-valuenow": e,
1748
- "aria-valuemin": t,
1749
- "aria-valuemax": a,
1750
- children: n ? /* @__PURE__ */ s.jsx("span", {
1751
- className: "visually-hidden",
1752
- children: r
1753
- }) : r
1754
- });
1755
- }
1756
- const Z = /* @__PURE__ */ ce.forwardRef(({
1757
- isChild: t = !1,
1758
- ...e
1759
- }, a) => {
1760
- const r = {
1761
- min: 0,
1762
- max: 100,
1763
- animated: !1,
1764
- visuallyHidden: !1,
1765
- striped: !1,
1766
- ...e
1767
- };
1768
- if (r.bsPrefix = ve(r.bsPrefix, "progress"), t)
1769
- return Ht(r, a);
1770
- const {
1771
- min: n,
1772
- now: l,
1773
- max: i,
1774
- label: o,
1775
- visuallyHidden: c,
1776
- striped: f,
1777
- animated: u,
1778
- bsPrefix: m,
1779
- variant: h,
1780
- className: d,
1781
- children: v,
1782
- ...x
1783
- } = r;
1784
- return /* @__PURE__ */ s.jsx("div", {
1785
- ref: a,
1786
- ...x,
1787
- className: ue(d, m),
1788
- children: v ? Ss(v, (p) => /* @__PURE__ */ zt(p, {
1789
- isChild: !0
1790
- })) : Ht({
1791
- min: n,
1792
- now: l,
1793
- max: i,
1794
- label: o,
1795
- visuallyHidden: c,
1796
- striped: f,
1797
- animated: u,
1798
- bsPrefix: m,
1799
- variant: h
1800
- }, a)
1801
- });
1802
- });
1803
- Z.displayName = "ProgressBar";
1804
- const re = {
1805
- SIGN_IN: "/login",
1806
- SIGN_UP: "/signup",
1807
- HOME: "/",
1808
- PROPOSALS: "/politics/proposals",
1809
- PROPOSALS_SUBMISSIONS_ALL: "/politics/proposals/submissions",
1810
- STORIES: "/news/stories",
1811
- ISSUES: "/news/issues",
1812
- MYTHS: "/news/myths"
1813
- // ... other routes
1814
- };
1815
- function fr({
1816
- activeLayoutProposalSentiments: t,
1817
- populated_user: e,
1818
- usersProposalSentiments: a,
1819
- setShowFullStanceDetails: r,
1820
- showFullStanceDetails: n,
1821
- userData: l
1822
- }) {
1823
- return /* @__PURE__ */ s.jsx("div", { className: "row mx-0 mb-2", children: [
1824
- {
1825
- name: `${e?.display_name || l.display_name}`,
1826
- data: t || {}
1827
- },
1828
- {
1829
- name: "You",
1830
- data: a || {}
1831
- }
1832
- ].map((i) => i.name == "You" ? /* @__PURE__ */ s.jsx("div", { className: "col-lg-6 px-1", children: /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm h-100", children: [
1833
- /* @__PURE__ */ s.jsx("div", { className: "card-header", children: /* @__PURE__ */ s.jsx("b", { children: i.name }) }),
1834
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2", children: /* @__PURE__ */ s.jsx("small", { children: "Login or create an account to compare your political stance with this user!" }) }),
1835
- /* @__PURE__ */ s.jsxs("div", { className: "card-footer", children: [
1836
- /* @__PURE__ */ s.jsx(Y, { href: re.SIGN_IN, children: /* @__PURE__ */ s.jsx(P, { small: !0, className: "", children: "Sign In" }) }),
1837
- /* @__PURE__ */ s.jsx(Y, { href: re.SIGN_UP, children: /* @__PURE__ */ s.jsx(P, { small: !0, className: "", children: "Sign Up" }) })
1838
- ] })
1839
- ] }) }, i.name) : /* @__PURE__ */ s.jsx("div", { className: "col-lg-6 px-1", children: /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm", children: [
1840
- /* @__PURE__ */ s.jsx(
1841
- "div",
1842
- {
1843
- className: "card-header",
1844
- onClick: () => {
1845
- console.log(i.data);
1846
- },
1847
- children: /* @__PURE__ */ s.jsx("b", { children: i.name })
1848
- }
1849
- ),
1850
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-2 px-2 small", children: [
1851
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1852
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
1853
- "Fundamental: ",
1854
- i?.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length,
1855
- "/",
1856
- i?.data?.fundamental?.length
1857
- ] }),
1858
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "dark", className: "shadow-articles mb-2", now: (i.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length / i.data?.fundamental?.length * 100).toFixed(2), label: `${(i.data?.fundamental?.filter((o) => i.data?.user_sentiments?.find((c) => c.proposal_id == o._id) ? o : null).length / i.data?.fundamental?.length * 100).toFixed(2)}%` }),
1859
- /* @__PURE__ */ s.jsxs(Z, { className: "shadow-articles mb-2", style: { height: "10px" }, children: [
1860
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "danger", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) }),
1861
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "warning", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) }),
1862
- /* @__PURE__ */ s.jsx(Z, { striped: !0, variant: "success", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree" && o.populated_proposal.fundamental)?.length / i.data?.fundamental?.length * 100).toFixed(2) })
1863
- ] }),
1864
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1865
- "Disagree: ",
1866
- i.data?.user_sentiments?.filter((o) => {
1867
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1868
- return o.sentiment_status == "Disagree" && c;
1869
- })?.length || 0
1870
- ] }),
1871
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1872
- "Needs Work: ",
1873
- i.data?.user_sentiments?.filter((o) => {
1874
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1875
- return o.sentiment_status == "Needs Work" && c;
1876
- })?.length || 0
1877
- ] }),
1878
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1879
- "Agree: ",
1880
- i.data?.user_sentiments?.filter((o) => {
1881
- let c = i.data?.fundamental.find((f) => f._id == o.proposal_id);
1882
- return o.sentiment_status == "Agree" && c;
1883
- })?.length || 0
1884
- ] })
1885
- ] }),
1886
- !n && /* @__PURE__ */ s.jsx("span", { onClick: () => r(!0), className: "badge bg-articles-secondary shadow-articles badge-hover", children: "View More" }),
1887
- n && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
1888
- /* @__PURE__ */ s.jsx("hr", {}),
1889
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1890
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
1891
- "All: ",
1892
- i.data?.user_sentiments?.length,
1893
- "/",
1894
- i.data?.total
1895
- ] }),
1896
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "dark", className: "shadow-articles mb-1", now: (i.data?.user_sentiments?.length / i.data?.total * 100).toFixed(2), label: `${(i.data?.user_sentiments?.length / i.data?.total * 100).toFixed(2)}%` }),
1897
- /* @__PURE__ */ s.jsxs(Z, { className: "shadow-articles mb-2", style: { height: "10px" }, children: [
1898
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "danger", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree")?.length / i.data?.total * 100).toFixed(2) }),
1899
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "warning", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work")?.length / i.data?.total * 100).toFixed(2) }),
1900
- /* @__PURE__ */ s.jsx(Z, { striped: !0, animated: !0, variant: "success", now: (i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree")?.length / i.data?.total * 100).toFixed(2) })
1901
- ] }),
1902
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1903
- "Disagree: ",
1904
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Disagree")?.length || 0
1905
- ] }),
1906
- /* @__PURE__ */ s.jsxs("div", { className: "", children: [
1907
- "Needs Work: ",
1908
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Needs Work")?.length || 0
1909
- ] }),
1910
- /* @__PURE__ */ s.jsxs("div", { className: "mb-2", children: [
1911
- "Agree: ",
1912
- i.data?.user_sentiments?.filter((o) => o.sentiment_status == "Agree")?.length || 0
1913
- ] })
1914
- ] }),
1915
- /* @__PURE__ */ s.jsx("hr", {}),
1916
- /* @__PURE__ */ s.jsx("p", { className: "mb-0", children: /* @__PURE__ */ s.jsxs("div", { className: "row", children: [
1917
- /* @__PURE__ */ s.jsx("div", { className: "col-9", children: "Comments" }),
1918
- /* @__PURE__ */ s.jsx("div", { className: "col-3", children: /* @__PURE__ */ s.jsx("b", { children: i.data?.user_comments?.length || 0 }) }),
1919
- /* @__PURE__ */ s.jsx("div", { className: "col-9", children: "Submissions" }),
1920
- /* @__PURE__ */ s.jsx("div", { className: "col-3", children: /* @__PURE__ */ s.jsx("b", { children: i.data?.user_submissions }) })
1921
- ] }) })
1922
- ] })
1923
- ] })
1924
- ] }) }, i.name)) });
1925
- }
1926
- function pr({
1927
- activeLayoutProposalSentiments: t
1928
- }) {
1929
- return /* @__PURE__ */ s.jsx("div", { children: t.user_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
1930
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
1931
- "Commented on ",
1932
- /* @__PURE__ */ s.jsx("b", { children: e.populated_proposal.title })
1933
- ] }),
1934
- /* @__PURE__ */ s.jsx("div", { className: "card-body small p-2", children: /* @__PURE__ */ s.jsxs("div", { children: [
1935
- /* @__PURE__ */ s.jsx("span", { className: "small", children: Te(new Date(e.date), "M/dd/yy") }),
1936
- /* @__PURE__ */ s.jsx("div", { children: e.comment })
1937
- ] }) }),
1938
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(Y, { prefetch: !1, href: `${re.PROPOSALS}/${e.populated_proposal.url}?interaction_id=${e._id}`, children: /* @__PURE__ */ s.jsx(
1939
- P,
1940
- {
1941
- small: !0,
1942
- children: "View"
1943
- }
1944
- ) }) })
1945
- ] }, e._id)) });
1946
- }
1947
- function mr({
1948
- activeLayoutProposalSentiments: t
1949
- }) {
1950
- return /* @__PURE__ */ s.jsx("div", { children: t.user_sentiments?.map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
1951
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
1952
- "Gave their sentiment on ",
1953
- /* @__PURE__ */ s.jsx("b", { children: e.populated_proposal.title })
1954
- ] }),
1955
- /* @__PURE__ */ s.jsxs("div", { className: "card-body small p-2", children: [
1956
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center border-bottom pb-1", children: [
1957
- e.sentiment_status == "Agree" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-success", children: "Agree" }),
1958
- e.sentiment_status == "Needs Work" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-warning text-dark", children: "Needs Work" }),
1959
- e.sentiment_status == "Disagree" && /* @__PURE__ */ s.jsx("div", { className: "badge shadow-articles bg-danger", children: "Disagree" }),
1960
- /* @__PURE__ */ s.jsx("span", { className: "small ms-2", children: Te(new Date(e.date), "M/dd/yy") })
1961
- ] }),
1962
- /* @__PURE__ */ s.jsx("div", { className: "mt-1", children: e.comment })
1963
- ] }),
1964
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(
1965
- Y,
1966
- {
1967
- prefetch: !1,
1968
- href: `https://articles.media/politics/proposals/${e.populated_proposal.url}?interaction_id=${e._id}`,
1969
- children: /* @__PURE__ */ s.jsx(
1970
- P,
1971
- {
1972
- small: !0,
1973
- children: "View"
1974
- }
1975
- )
1976
- }
1977
- ) })
1978
- ] }, e._id)) });
1979
- }
1980
- function hr({
1981
- activeLayoutProposalSentiments: t,
1982
- userProposalsSubmitted: e
1983
- }) {
1984
- const [a, r] = C(!1);
1985
- return /* @__PURE__ */ s.jsxs("div", { children: [
1986
- /* @__PURE__ */ s.jsx("div", { className: "mb-2", children: e?.slice(0, a ? 100 : 1).map((n) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm shadow-articles", children: [
1987
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2 lh-sm d-flex align-items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "ms-2", children: [
1988
- /* @__PURE__ */ s.jsx("div", { children: n.title }),
1989
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
1990
- n.type,
1991
- n.fundamental && " - Fundamental"
1992
- ] })
1993
- ] }) }),
1994
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex", children: /* @__PURE__ */ s.jsx(
1995
- Y,
1996
- {
1997
- href: `${re.PROPOSALS_SUBMISSIONS_ALL}/${n._id}`,
1998
- className: "",
1999
- children: /* @__PURE__ */ s.jsx(P, { small: !0, children: /* @__PURE__ */ s.jsxs("span", { children: [
2000
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2001
- "View"
2002
- ] }) })
2003
- }
2004
- ) })
2005
- ] }, n._id)) }),
2006
- e?.length > 1 && /* @__PURE__ */ s.jsx(
2007
- P,
2008
- {
2009
- onClick: () => r(!a),
2010
- className: "w-100",
2011
- children: a ? "View Less" : "View All"
2012
- }
2013
- ),
2014
- e?.length == 0 && /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no proposal submissions" })
2015
- ] });
2016
- }
2017
- function vr(t) {
2018
- const { featured_image: e, thumbnail_size: a } = t;
2019
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2020
- (e?.image_type == "S3 File System" || e?.thumbnails?.length > 0) && /* @__PURE__ */ s.jsx(s.Fragment, { children: e?.thumbnails?.length > 0 ? /* @__PURE__ */ s.jsx(s.Fragment, { children: a && e?.thumbnails?.find((r) => r.width == a) ? /* @__PURE__ */ s.jsx(
2021
- "img",
2022
- {
2023
- style: {
2024
- width: "100%",
2025
- height: "100%",
2026
- objectFit: "cover"
2027
- },
2028
- src: process.env.NEXT_PUBLIC_CDN + e?.thumbnails?.find((r) => r.width == a).key,
2029
- loading: "lazy",
2030
- alt: "",
2031
- className: "flex-shrink-0"
2032
- }
2033
- ) : /* @__PURE__ */ s.jsx(
2034
- "img",
2035
- {
2036
- style: {
2037
- width: "100%",
2038
- height: "100%",
2039
- objectFit: "cover"
2040
- },
2041
- src: process.env.NEXT_PUBLIC_CDN + [...e?.thumbnails].sort((r, n) => r.width - n.width)[0].key,
2042
- loading: "lazy",
2043
- alt: "",
2044
- className: "flex-shrink-0"
2045
- }
2046
- ) }) : /* @__PURE__ */ s.jsx(
2047
- "img",
2048
- {
2049
- style: {
2050
- width: "100%",
2051
- height: "100%",
2052
- objectFit: "cover"
2053
- },
2054
- src: process.env.NEXT_PUBLIC_CDN + e?.key,
2055
- loading: "lazy",
2056
- alt: "",
2057
- className: "flex-shrink-0"
2058
- }
2059
- ) }),
2060
- e?.location && !e?.image_type && (e?.thumbnails?.length || 0) < 1 && /* @__PURE__ */ s.jsx(
2061
- "img",
2062
- {
2063
- style: { objectFit: "cover", width: "100%", height: "100%" },
2064
- src: `${process.env.NEXT_PUBLIC_CDN}${e?.key}`,
2065
- alt: "",
2066
- loading: "lazy"
2067
- }
2068
- )
2069
- ] });
2070
- }
2071
- function xr(t) {
2072
- switch (t) {
2073
- case "story":
2074
- return re.STORIES;
2075
- // break;
2076
- case "issue":
2077
- return re.ISSUES;
2078
- // break;
2079
- case "myth":
2080
- return re.MYTHS;
2081
- }
2082
- }
2083
- function gr({
2084
- publicUserData: t
2085
- }) {
2086
- return /* @__PURE__ */ s.jsx("div", { children: t?.populated_news_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles card-sm border mb-2", children: [
2087
- /* @__PURE__ */ s.jsxs("div", { className: "card-header small", children: [
2088
- "Commented on ",
2089
- /* @__PURE__ */ s.jsx("b", { children: e.populated_news?.news_title })
2090
- ] }),
2091
- /* @__PURE__ */ s.jsxs("div", { className: "card-body small p-2 d-flex", children: [
2092
- /* @__PURE__ */ s.jsx(
2093
- "div",
2094
- {
2095
- style: {
2096
- width: "100px",
2097
- height: "100px"
2098
- },
2099
- className: "me-2 flex-shrink-0",
2100
- children: /* @__PURE__ */ s.jsx(
2101
- vr,
2102
- {
2103
- featured_image: e?.populated_news?.featured_image,
2104
- thumbnail_size: 100
2105
- }
2106
- )
2107
- }
2108
- ),
2109
- /* @__PURE__ */ s.jsxs("div", { children: [
2110
- /* @__PURE__ */ s.jsx("span", { className: "small", children: Te(new Date(e.date), "M/dd/yy") }),
2111
- /* @__PURE__ */ s.jsx("div", { children: e.comment })
2112
- ] })
2113
- ] }),
2114
- /* @__PURE__ */ s.jsx("div", { className: "card-footer", children: /* @__PURE__ */ s.jsx(Y, { prefetch: !1, href: `${xr(e.populated_news?.news_type)}/${e.populated_news?.url}?interaction_id=${e._id}`, children: /* @__PURE__ */ s.jsx(
2115
- P,
2116
- {
2117
- small: !0,
2118
- children: "View"
2119
- }
2120
- ) }) })
2121
- ] }, e._id)) });
2122
- }
2123
- function br({
2124
- userNewsSubmitted: t
2125
- }) {
2126
- const [e, a] = C(!1);
2127
- return /* @__PURE__ */ s.jsxs("div", { children: [
2128
- /* @__PURE__ */ s.jsxs("div", { className: "mb-1 d-flex justify-content-between align-items-center", children: [
2129
- /* @__PURE__ */ s.jsxs("span", { children: [
2130
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-newspaper me-1" }),
2131
- /* @__PURE__ */ s.jsxs("span", { children: [
2132
- /* @__PURE__ */ s.jsx("span", { children: "News Submissions: " }),
2133
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-dark", children: t?.length || 0 })
2134
- ] })
2135
- ] }),
2136
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-articles-secondary", children: [
2137
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-info me-1" }),
2138
- /* @__PURE__ */ s.jsx("span", { children: "Info" })
2139
- ] })
2140
- ] }),
2141
- /* @__PURE__ */ s.jsx("div", { className: "mb-1", children: t?.slice(0, e ? 100 : 1).map((r) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles shadow-articles", children: [
2142
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: [
2143
- /* @__PURE__ */ s.jsx("img", { className: "", src: r?.featured_image?.location, width: "40px", height: "40px", style: { objectFit: "cover" }, alt: "" }),
2144
- /* @__PURE__ */ s.jsx("div", { className: "ms-2", children: /* @__PURE__ */ s.jsx("div", { children: r.news_title }) })
2145
- ] }),
2146
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex p-1", children: /* @__PURE__ */ s.jsx(Y, { href: `${re.HOME}/${r.url}`, children: /* @__PURE__ */ s.jsxs(P, { small: !0, className: "", children: [
2147
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2148
- "View"
2149
- ] }) }) })
2150
- ] }, r._id)) }),
2151
- t?.length > 1 ? /* @__PURE__ */ s.jsx(P, { onClick: () => a(!e), small: !0, className: "", children: e ? "View Less" : "View All" }) : /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no news submissions" })
2152
- ] });
2153
- }
2154
- function jr({
2155
- activeLayoutProposalSentiments: t,
2156
- userDonations: e,
2157
- lifetimeContribution: a
2158
- }) {
2159
- const [r, n] = C(!1);
2160
- return /* @__PURE__ */ s.jsxs("div", { className: "card card-articles ", children: [
2161
- /* @__PURE__ */ s.jsxs("div", { className: "card-header d-flex justify-content-between align-items-center p-1", children: [
2162
- /* @__PURE__ */ s.jsx("span", { children: "Donations: " }),
2163
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-dark", children: [
2164
- e.count,
2165
- " - ",
2166
- `$${et((a / 100 || 0).toFixed(2))}`
2167
- ] })
2168
- ] }),
2169
- /* @__PURE__ */ s.jsxs("div", { className: "card-body p-2", children: [
2170
- e?.list?.length == 0 && /* @__PURE__ */ s.jsx("span", { className: "small", children: "User has no donations" }),
2171
- /* @__PURE__ */ s.jsx("div", { className: "donations-wrap", children: e?.list?.slice(0, r ? 100 : 3).map((l) => /* @__PURE__ */ s.jsxs("div", { className: "border", children: [
2172
- /* @__PURE__ */ s.jsxs("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: [
2173
- /* @__PURE__ */ s.jsx("div", { className: "small", children: "Most Recent" }),
2174
- /* @__PURE__ */ s.jsxs("div", { className: "ms-2 d-flex align-items-center", children: [
2175
- /* @__PURE__ */ s.jsx("div", { className: "h4 mb-0 me-2", children: `$${et((l.amount / 100).toFixed(2))}` }),
2176
- /* @__PURE__ */ s.jsx("div", { className: "small", children: Te(new Date(l.date), "M/dd/yy") })
2177
- ] })
2178
- ] }),
2179
- /* @__PURE__ */ s.jsx("div", { className: "card-footer d-flex p-1", children: /* @__PURE__ */ s.jsx(Y, { href: `${re.HOME}/${l.url}`, children: /* @__PURE__ */ s.jsxs(
2180
- P,
2181
- {
2182
- className: "",
2183
- small: !0,
2184
- children: [
2185
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2186
- "View"
2187
- ]
2188
- }
2189
- ) }) })
2190
- ] }, l._id)) })
2191
- ] }),
2192
- /* @__PURE__ */ s.jsx("div", { className: "card-footer p-1 d-flex justify-content-center", children: e.count > 1 && /* @__PURE__ */ s.jsx(
2193
- P,
2194
- {
2195
- onClick: () => {
2196
- n(!r);
2197
- },
2198
- className: "w-100",
2199
- children: r ? "View Less" : "View All"
2200
- }
2201
- ) })
2202
- ] });
2203
- }
2204
- function yr({
2205
- userLayoutsData: t,
2206
- handleClose: e
2207
- }) {
2208
- return /* @__PURE__ */ s.jsx("div", { children: t?.map((r) => /* @__PURE__ */ s.jsxs("div", { className: "card card-articles shadow-articles", children: [
2209
- /* @__PURE__ */ s.jsx("div", { className: "card-body py-1 px-2 lh-sm d-flex align-items-center", children: /* @__PURE__ */ s.jsxs("div", { className: "ms-2", children: [
2210
- /* @__PURE__ */ s.jsx("div", { children: r.name }),
2211
- /* @__PURE__ */ s.jsx("div", { className: "small", children: "Last Viewed: Never" })
2212
- ] }) }),
2213
- /* @__PURE__ */ s.jsxs("div", { className: "card-footer d-flex p-1", children: [
2214
- (!1)._id !== r.user_id && /* @__PURE__ */ s.jsxs(
2215
- P,
2216
- {
2217
- className: "",
2218
- small: !0,
2219
- children: [
2220
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-plus me-1" }),
2221
- "Follow"
2222
- ]
2223
- }
2224
- ),
2225
- /* @__PURE__ */ s.jsx(
2226
- Y,
2227
- {
2228
- href: `${re.HOME}/${r.url}`,
2229
- children: /* @__PURE__ */ s.jsxs(
2230
- P,
2231
- {
2232
- className: "",
2233
- small: !0,
2234
- children: [
2235
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-eye me-1" }),
2236
- "View"
2237
- ]
2238
- }
2239
- )
2240
- }
2241
- )
2242
- ] })
2243
- ] }, r._id)) });
2244
- }
2245
- function wr({
2246
- activeLayoutProposalSentiments: t,
2247
- userData: e
2248
- }) {
2249
- return /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx("div", { className: "", children: e?.verified?.verified_methods?.map((a, r) => Object.keys(a)?.length > 0 ? /* @__PURE__ */ s.jsxs(
2250
- "div",
2251
- {
2252
- className: "card card-articles card-sm object mb-2",
2253
- children: [
2254
- /* @__PURE__ */ s.jsx("div", { className: "card-header", children: a?.method_name }),
2255
- /* @__PURE__ */ s.jsx("div", { className: "card-body p-2", children: /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2256
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center", children: [
2257
- /* @__PURE__ */ s.jsx("span", { className: "me-2", children: "Approved On: " }),
2258
- /* @__PURE__ */ s.jsx(Yt, { date: a.approved_date })
2259
- ] }),
2260
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center", children: [
2261
- /* @__PURE__ */ s.jsx("span", { className: "me-2", children: "Approved By: " }),
2262
- /* @__PURE__ */ s.jsx(Dr, { user_id: a.approved_by, dangerousPopulate: !0 })
2263
- ] })
2264
- ] }) })
2265
- ]
2266
- },
2267
- r
2268
- ) : /* @__PURE__ */ s.jsx(
2269
- "div",
2270
- {
2271
- className: "single",
2272
- children: a
2273
- },
2274
- r
2275
- )) }) });
2276
- }
2277
- const Nr = [];
2278
- function _r({
2279
- activeLayoutProposalSentiments: t
2280
- }) {
2281
- return /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx("div", { className: "achievements card card-articles", children: /* @__PURE__ */ s.jsx("div", { className: "card-body p-0", children: Nr.map(
2282
- (e) => /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsxs("div", { className: "achievement w-100 d-flex align-items-center", children: [
2283
- /* @__PURE__ */ s.jsx("div", { className: "icon", style: { width: "50px" }, children: /* @__PURE__ */ s.jsx("i", { className: `fad ${e.icon} fa-lg` }) }),
2284
- /* @__PURE__ */ s.jsxs("div", { className: "details small me-auto", children: [
2285
- /* @__PURE__ */ s.jsx("b", { className: "name", children: e.name }),
2286
- /* @__PURE__ */ s.jsx("div", { className: "description mb-1", children: e.description }),
2287
- /* @__PURE__ */ s.jsx("div", { className: "small", children: e.tags?.map((a) => /* @__PURE__ */ s.jsx("span", { className: "badge bg-dark border", children: a }, a)) })
2288
- ] }),
2289
- /* @__PURE__ */ s.jsx("div", { className: "icon border-end-0 border-start border-dark", children: /* @__PURE__ */ s.jsx("div", { className: "text-center px-3", children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-square fa-lg me-0" }) }) })
2290
- ] }) }, e.name)
2291
- ) }) }) });
2292
- }
2293
- const Or = (t) => Zt.get(t).then((e) => e.data), Sr = (t) => {
2294
- const { data: e, error: a, isLoading: r, mutate: n } = Qt(
2295
- process.env.NODE_ENV === "development" ? "http://localhost:3001/api/news/resources/political-parties" : "https://articles.media/api/news/resources/political-parties",
2296
- Or,
2297
- {
2298
- dedupingInterval: 6e5
2299
- // fallbackData: []
2300
- }
2301
- );
2302
- return {
2303
- data: e,
2304
- error: a,
2305
- isLoading: r,
2306
- mutate: n
2307
- };
2308
- };
2309
- function Dr(t) {
2310
- const {
2311
- populated_user: e,
2312
- hidePhoto: a,
2313
- visibleItems: r,
2314
- size: n,
2315
- className: l,
2316
- dangerousPopulate: i,
2317
- user_id: o,
2318
- buttonType: c,
2319
- children: f,
2320
- fakeMembership: u
2321
- // name
2322
- } = t, [m, h] = C(!1), [d, v] = C({}), [x, p] = C([]), [j, g] = C([]), [N, b] = C(null), [_, w] = C([]), [O, E] = C([]), [M, A] = C(!1), $ = !1, { data: R } = Sr(), [S, L] = C("Proposals Stance"), k = () => {
2323
- h(!1);
2324
- };
2325
- X(() => {
2326
- e && v({
2327
- ...e
2328
- });
2329
- }, []);
2330
- const [F, I] = C(!1), [fe, ne] = C([]), [ie, Oe] = C([]), { data: D, mutate: ge } = Vt(
2331
- (o || e?._id) && (m || i) ? {
2332
- user_id: o || e?._id
2333
- } : null
2334
- ), { data: H, mutate: ee } = Vt(
2335
- $?._id && (m || i) ? {
2336
- user_id: $?._id
2337
- } : null
2338
- );
2339
- X(() => {
2340
- D && (console.log("publicUserData", D), v(D), p(D?.populated_public_layouts), g(D?.populated_public_donations), b(D?.populated_public_donations.total), E(D?.populated_public_proposals), ne(D?.populated_public_proposals_stance), w(D?.populated_public_news_submissions || []));
2341
- }, [D]), X(() => {
2342
- H && (console.log("personalUserData", H), Oe(H?.populated_public_proposals_stance));
2343
- }, [H]);
2344
- let oe = (e || d)?.articles_membership?.plan.replace(" ", "-").toLowerCase(), be = u?.replace(" ", "-").toLowerCase();
2345
- const J = "https://articles.media/images/store/memberships/", Se = () => {
2346
- let y = (e || d)?.articles_membership?.status == "Active";
2347
- return /* @__PURE__ */ s.jsxs(
2348
- "div",
2349
- {
2350
- style: {
2351
- position: "relative",
2352
- cursor: "pointer"
2353
- } && (n == "lg" ? { fontSize: "1.5rem" } : {}),
2354
- className: `view-user-modal-badge-wrap ${n == "lg" && "large"} ${l && l}`,
2355
- children: [
2356
- /* @__PURE__ */ s.jsxs(
2357
- "span",
2358
- {
2359
- onClick: () => {
2360
- h(!0);
2361
- },
2362
- className: "position-relative view-user-modal-badge d-flex justify-content-between align-items-center badge bg-articles badge-hover ",
2363
- children: [
2364
- (y || u) && /* @__PURE__ */ s.jsx(
2365
- "i",
2366
- {
2367
- className: `fad membership-badge ${be || oe} fa-badge-check`,
2368
- style: {
2369
- position: "absolute",
2370
- // top: '50%',
2371
- top: "-2px",
2372
- left: "-2px",
2373
- // transform: 'translateY(-50%)',
2374
- fontSize: "0.9rem",
2375
- zIndex: 1
2376
- // marginRight: '-0.5rem'
2377
- // color: `${obj.badge_color}!important`
2378
- }
2379
- }
2380
- ),
2381
- /* @__PURE__ */ s.jsxs("div", { className: `d-flex align-items-center ${y && ""}`, children: [
2382
- !a && /* @__PURE__ */ s.jsx("div", { className: n == "lg" ? "me-0" : "me-1", children: /* @__PURE__ */ s.jsx(
2383
- Bt,
2384
- {
2385
- width: "15px",
2386
- profile_photo: d.profile_photo
2387
- }
2388
- ) }),
2389
- d.display_name || e?.display_name
2390
- ] }),
2391
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-plus-square me-0 ms-2" })
2392
- ]
2393
- }
2394
- ),
2395
- r?.includes("Not Verified") && e?.verified?.status !== "Verified" && /* @__PURE__ */ s.jsx(
2396
- le,
2397
- {
2398
- placement: "bottom",
2399
- overlay: /* @__PURE__ */ s.jsx(Q, { style: { pointerEvents: "none" }, id: "button-tooltip", children: /* @__PURE__ */ s.jsx("div", { className: "", children: "User is not verified" }) }),
2400
- children: /* @__PURE__ */ s.jsxs(
2401
- "span",
2402
- {
2403
- className: "verification-user-badge badge bg-danger d-flex align-items-center",
2404
- children: [
2405
- /* @__PURE__ */ s.jsx("i", { style: { paddingBottom: "2px" }, className: "fas fa-robot me-1" }),
2406
- /* @__PURE__ */ s.jsx("span", { className: "", children: "Unverified" })
2407
- ]
2408
- }
2409
- )
2410
- }
2411
- ),
2412
- // true
2413
- // ||
2414
- // visibleItems?.includes("Membership")
2415
- !1,
2416
- r?.includes("Verification Status") && /* @__PURE__ */ s.jsx(
2417
- le,
2418
- {
2419
- placement: "bottom",
2420
- overlay: /* @__PURE__ */ s.jsx(
2421
- Q,
2422
- {
2423
- id: "button-tooltip",
2424
- style: { pointerEvents: "none", transformX: "-20px" },
2425
- children: e?.verified?.status == "Verified" ? "Verified" : " Not Verified"
2426
- }
2427
- ),
2428
- children: e?.verified?.status == "Verified" ? /* @__PURE__ */ s.jsx("span", { className: "verification-user-badge badge bg-success cursor-pointer", children: /* @__PURE__ */ s.jsx("i", { className: "fas fa-check me-0" }) }) : /* @__PURE__ */ s.jsxs("span", { className: "verification-user-badge badge bg-danger cursor-pointer", children: [
2429
- /* @__PURE__ */ s.jsx("i", { className: "fas fa-robot me-1" }),
2430
- /* @__PURE__ */ s.jsx("span", { children: "?" })
2431
- ] })
2432
- }
2433
- ),
2434
- r?.includes("Political Party") && /* @__PURE__ */ s.jsx("div", { className: "d-flex", children: (e || d)?.political?.party_id && /* @__PURE__ */ s.jsx(
2435
- le,
2436
- {
2437
- placement: "bottom",
2438
- overlay: /* @__PURE__ */ s.jsxs(
2439
- Q,
2440
- {
2441
- id: "tooltip-bottom",
2442
- style: { position: "fixed" },
2443
- children: [
2444
- /* @__PURE__ */ s.jsx(
2445
- "img",
2446
- {
2447
- width: "40px",
2448
- height: "40px",
2449
- style: {
2450
- objectFit: "contain",
2451
- padding: "0px",
2452
- zIndex: "10",
2453
- position: "relative"
2454
- },
2455
- loading: "lazy",
2456
- src: `${process.env.NEXT_PUBLIC_CDN}` + R?.find((V) => V._id == (e || d)?.political?.party_id)?.logo,
2457
- alt: ""
2458
- }
2459
- ),
2460
- /* @__PURE__ */ s.jsx(
2461
- "span",
2462
- {
2463
- className: "ms-2",
2464
- children: R?.find((V) => V._id == (e || d)?.political?.party_id)?.name
2465
- }
2466
- )
2467
- ]
2468
- }
2469
- ),
2470
- children: /* @__PURE__ */ s.jsx(
2471
- "div",
2472
- {
2473
- className: "badge bg-light text-capitalize ms-0 h-100 d-flex justify-content-center align-items-center",
2474
- style: {
2475
- padding: "0 0.15rem",
2476
- cursor: "pointer"
2477
- },
2478
- children: (e || d)?.political?.party_id && ((e || d)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ s.jsx("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ s.jsx(
2479
- "img",
2480
- {
2481
- width: "15px",
2482
- height: "15px",
2483
- style: {
2484
- objectFit: "contain",
2485
- padding: "0px"
2486
- },
2487
- loading: "lazy",
2488
- src: `${process.env.NEXT_PUBLIC_CDN}` + R?.find((V) => V._id == (e || d)?.political?.party_id)?.logo,
2489
- alt: ""
2490
- }
2491
- ))
2492
- }
2493
- )
2494
- }
2495
- ) })
2496
- ]
2497
- }
2498
- );
2499
- };
2500
- function Xe(y) {
2501
- return y === "Link" ? /* @__PURE__ */ s.jsx(
2502
- "span",
2503
- {
2504
- type: "button",
2505
- onClick: () => {
2506
- h(!0);
2507
- },
2508
- children: f
2509
- }
2510
- ) : /* @__PURE__ */ s.jsx(Se, {});
2511
- }
2512
- const [T, je] = C(!1), [De, ht] = C({}), [vt, Ye] = C({});
2513
- X(() => {
2514
- T && Object.keys(De).length == 0 && console.log("adminUserData", H);
2515
- }, [T]);
2516
- const [qe, Ke] = C(null);
2517
- function Ge() {
2518
- alert("TODO");
2519
- }
2520
- const te = Me(() => x?.filter((y) => y.user_layout)?.[0]?.url, [x]);
2521
- return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2522
- Xe(c),
2523
- /* @__PURE__ */ s.jsxs(
2524
- Be,
2525
- {
2526
- show: m,
2527
- size: "lg",
2528
- id: "view-users-modal",
2529
- className: "view-users-modal articles-modal",
2530
- scrollable: !0,
2531
- onHide: k,
2532
- children: [
2533
- /* @__PURE__ */ s.jsx(Be.Header, { closeButton: !0, children: /* @__PURE__ */ s.jsx("div", { className: "w-100 d-flex justify-content-between align-items-center", children: /* @__PURE__ */ s.jsx("h3", { className: "mb-0", children: "User Info" }) }) }),
2534
- /* @__PURE__ */ s.jsx(Be.Body, { children: /* @__PURE__ */ s.jsxs("div", { className: "main-panel", children: [
2535
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex", children: [
2536
- /* @__PURE__ */ s.jsxs(
2537
- "div",
2538
- {
2539
- className: "d-flex flex-column align-items-center",
2540
- style: {
2541
- width: "100px"
2542
- },
2543
- children: [
2544
- /* @__PURE__ */ s.jsx(
2545
- "div",
2546
- {
2547
- type: "button",
2548
- onClick: () => {
2549
- Ke(`${process.env.NEXT_PUBLIC_CDN}${d?.profile_photo?.key}`);
2550
- },
2551
- children: /* @__PURE__ */ s.jsx(
2552
- Bt,
2553
- {
2554
- width: "100px",
2555
- profile_photo: d?.profile_photo
2556
- }
2557
- )
2558
- }
2559
- ),
2560
- /* @__PURE__ */ s.jsx(
2561
- le,
2562
- {
2563
- placement: "bottom",
2564
- overlay: /* @__PURE__ */ s.jsx(
2565
- Q,
2566
- {
2567
- id: "tooltip-bottom",
2568
- children: "Joined Articles Media"
2569
- }
2570
- ),
2571
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-black border border-white shadow-sm rounded-0", children: [
2572
- "Joined ",
2573
- d?.sign_up_date && Te(new Date(d?.sign_up_date), "M/dd/yy")
2574
- ] })
2575
- }
2576
- ),
2577
- te && /* @__PURE__ */ s.jsx(
2578
- Y,
2579
- {
2580
- href: (
2581
- // `${ROUTES.LAYOUTS}/${userLayoutLink}`
2582
- `https://articles.media/layouts/${te}`
2583
- ),
2584
- className: "mt-2 w-100",
2585
- children: /* @__PURE__ */ s.jsxs(
2586
- P,
2587
- {
2588
- className: "w-100",
2589
- style: {
2590
- // fontSize: '0.75rem'
2591
- },
2592
- children: [
2593
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-home" }),
2594
- /* @__PURE__ */ s.jsx("span", { children: "Layout" })
2595
- ]
2596
- }
2597
- )
2598
- }
2599
- ),
2600
- /* @__PURE__ */ s.jsx(Ze, { className: "w-100", children: /* @__PURE__ */ s.jsx(
2601
- Y,
2602
- {
2603
- href: {
2604
- // pathname: ROUTES.MESSAGES,
2605
- pathname: "https://articles.media/messages",
2606
- query: {
2607
- startMsg: d?._id
2608
- }
2609
- },
2610
- className: "mt-2 w-100",
2611
- children: /* @__PURE__ */ s.jsxs(
2612
- P,
2613
- {
2614
- className: "w-100",
2615
- style: {
2616
- fontSize: "0.88rem"
2617
- },
2618
- children: [
2619
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-envelope" }),
2620
- /* @__PURE__ */ s.jsx("span", { children: "Message" })
2621
- ]
2622
- }
2623
- )
2624
- }
2625
- ) }),
2626
- T && /* @__PURE__ */ s.jsxs(
2627
- "div",
2628
- {
2629
- className: "d-flex flex-column w-100 mt-2",
2630
- style: {
2631
- maxWidth: "100px"
2632
- },
2633
- children: [
2634
- /* @__PURE__ */ s.jsx(P, { variant: "warning", small: !0, className: "", children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Remove Photo" }) }),
2635
- De?.user?.profile_photo?.banned_uploads ? /* @__PURE__ */ s.jsx(
2636
- P,
2637
- {
2638
- variant: "warning",
2639
- small: !0,
2640
- className: "",
2641
- onClick: () => {
2642
- toggleBanCustomPhotoUpload();
2643
- },
2644
- children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Unban Uploads" })
2645
- }
2646
- ) : /* @__PURE__ */ s.jsx(
2647
- P,
2648
- {
2649
- variant: "danger",
2650
- small: !0,
2651
- className: "",
2652
- onClick: () => {
2653
- toggleBanCustomPhotoUpload();
2654
- },
2655
- children: /* @__PURE__ */ s.jsx(Textfit, { max: 14, mode: "single", children: "Ban Uploads" })
2656
- }
2657
- )
2658
- ]
2659
- }
2660
- )
2661
- ]
2662
- }
2663
- ),
2664
- /* @__PURE__ */ s.jsxs("div", { className: "mx-2", children: [
2665
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex align-items-center mb-1", children: [
2666
- /* @__PURE__ */ s.jsx("h5", { className: "mb-0", children: e?.display_name || d.display_name }),
2667
- /* @__PURE__ */ s.jsxs("span", { className: "ms-2", children: [
2668
- " @",
2669
- d?.username
2670
- ] })
2671
- ] }),
2672
- d?.articles_membership?.status == "Active" && /* @__PURE__ */ s.jsx(
2673
- le,
2674
- {
2675
- placement: "bottom",
2676
- overlay: /* @__PURE__ */ s.jsx(
2677
- Q,
2678
- {
2679
- id: "tooltip-bottom",
2680
- children: /* @__PURE__ */ s.jsxs("div", { className: "d-flex flex-column py-1", children: [
2681
- /* @__PURE__ */ s.jsxs("div", { className: "position-relative", children: [
2682
- d?.articles_membership?.plan == "Supporter" && /* @__PURE__ */ s.jsx("img", { src: `${J}supporter.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2683
- d?.articles_membership?.plan == "Premium Supporter" && /* @__PURE__ */ s.jsx("img", { src: `${J}premiumSupporter.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2684
- d?.articles_membership?.plan == "Advocate" && /* @__PURE__ */ s.jsx("img", { src: `${J}advocate.jpg`, width: 50, height: 50, alt: "Membership plan level" }),
2685
- /* @__PURE__ */ s.jsx(
2686
- "i",
2687
- {
2688
- className: `fad membership-badge ${oe} fa-badge-check me-1`,
2689
- style: {
2690
- position: "absolute",
2691
- top: "50%",
2692
- // top: '-2px',
2693
- left: "50%",
2694
- transform: "translateX(-50%) translateY(-50%)",
2695
- fontSize: "1.5rem"
2696
- // marginRight: '-0.5rem'
2697
- // color: `${obj.badge_color}!important`
2698
- }
2699
- }
2700
- )
2701
- ] }),
2702
- /* @__PURE__ */ s.jsxs("span", { className: "lh-sm", children: [
2703
- /* @__PURE__ */ s.jsx("div", { children: d?.articles_membership?.plan }),
2704
- /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2705
- "Since ",
2706
- /* @__PURE__ */ s.jsx(Yt, { format: "MM/dd/yy", date: d?.articles_membership?.membership_started })
2707
- ] })
2708
- ] })
2709
- ] })
2710
- }
2711
- ),
2712
- children: /* @__PURE__ */ s.jsxs(
2713
- "div",
2714
- {
2715
- className: "badge bg-articles border me-1 mb-1",
2716
- style: {
2717
- // padding: '0 0.25rem',
2718
- cursor: "pointer"
2719
- },
2720
- children: [
2721
- /* @__PURE__ */ s.jsx(
2722
- "i",
2723
- {
2724
- className: `fad membership-badge ${oe} fa-badge-check me-1`,
2725
- style: {
2726
- // position: 'absolute',
2727
- // top: '50%',
2728
- // top: '-2px',
2729
- // left: '-2px',
2730
- // transform: 'translateY(-50%)',
2731
- // fontSize: '0.9rem'
2732
- // marginRight: '-0.5rem'
2733
- // color: `${obj.badge_color}!important`
2734
- }
2735
- }
2736
- ),
2737
- /* @__PURE__ */ s.jsx("span", { children: d?.articles_membership?.plan }),
2738
- /* @__PURE__ */ s.jsx("span", { className: "px-1", children: "|" }),
2739
- /* @__PURE__ */ s.jsx("span", { className: "months fw-bold", children: Ms(
2740
- /* @__PURE__ */ new Date(),
2741
- new Date(d?.articles_membership?.membership_started)
2742
- ) || 0 })
2743
- ]
2744
- }
2745
- )
2746
- }
2747
- ),
2748
- d?.address?.state && /* @__PURE__ */ s.jsx(
2749
- le,
2750
- {
2751
- placement: "bottom",
2752
- overlay: d.address?.state?.length == 2 ? /* @__PURE__ */ s.jsxs(Q, { id: "tooltip-bottom", children: [
2753
- "From the state of ",
2754
- convertRegion(d.address?.state, "name") ? convertRegion(d.address?.state, "name")[0] : ""
2755
- ] }) : /* @__PURE__ */ s.jsxs(Q, { id: "tooltip-bottom", children: [
2756
- "From the state of ",
2757
- d.address?.state
2758
- ] }),
2759
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-articles border me-1 mb-1", children: [
2760
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-map-pin me-1" }),
2761
- d.address?.state
2762
- ] })
2763
- }
2764
- ),
2765
- d.verified?.status !== "Verified" && /* @__PURE__ */ s.jsx(
2766
- le,
2767
- {
2768
- placement: "bottom",
2769
- overlay: /* @__PURE__ */ s.jsx(Q, { id: "tooltip-bottom", children: "User is not verified" }),
2770
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-danger me-1 mb-1", children: [
2771
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-robot me-1" }),
2772
- "Unverified"
2773
- ] })
2774
- }
2775
- ),
2776
- d.verified?.status == "Verified" && /* @__PURE__ */ s.jsx(
2777
- le,
2778
- {
2779
- placement: "bottom",
2780
- overlay: /* @__PURE__ */ s.jsxs(
2781
- Q,
2782
- {
2783
- id: "tooltip-bottom",
2784
- className: "",
2785
- children: [
2786
- /* @__PURE__ */ s.jsxs("div", { children: [
2787
- "Verified by ",
2788
- d.verified?.verified_methods?.length,
2789
- " method",
2790
- d.verified?.verified_methods?.length > 1 && "s"
2791
- ] }),
2792
- /* @__PURE__ */ s.jsx("hr", {}),
2793
- /* @__PURE__ */ s.jsx("div", { className: "pb-2", children: d.verified?.verified_methods?.map((y, V) => Object.keys(y)?.length > 0 ? /* @__PURE__ */ s.jsx(
2794
- "div",
2795
- {
2796
- className: "object",
2797
- children: y?.method_name
2798
- },
2799
- V
2800
- ) : /* @__PURE__ */ s.jsx(
2801
- "div",
2802
- {
2803
- className: "single",
2804
- children: y
2805
- },
2806
- V
2807
- )) })
2808
- ]
2809
- }
2810
- ),
2811
- children: /* @__PURE__ */ s.jsxs("div", { className: "badge bg-articles border me-1 mb-1", children: [
2812
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-star me-1" }),
2813
- d.verified?.status
2814
- ] })
2815
- }
2816
- ),
2817
- d.political?.party_id && /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsx(
2818
- le,
2819
- {
2820
- placement: "bottom",
2821
- overlay: /* @__PURE__ */ s.jsx(Q, { id: "tooltip-bottom", children: /* @__PURE__ */ s.jsx("div", { children: "Users political party" }) }),
2822
- children: /* @__PURE__ */ s.jsx(
2823
- Y,
2824
- {
2825
- href: (
2826
- // `${ROUTES.RESOURCES_POLITICAL_PARTIES}/${(populated_user || userData)?.political?.party_id}`
2827
- `https://articles.media/politics/parties/${(e || d)?.political?.party_id}`
2828
- ),
2829
- children: /* @__PURE__ */ s.jsx("div", { className: "badge bg-articles border text-capitalize me-1", children: /* @__PURE__ */ s.jsxs("div", { className: "", children: [
2830
- (e || d)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ s.jsx("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ s.jsx(
2831
- "img",
2832
- {
2833
- width: "14px",
2834
- height: "14px",
2835
- style: {
2836
- objectFit: "contain",
2837
- padding: "0px"
2838
- },
2839
- loading: "lazy",
2840
- src: `${process.env.NEXT_PUBLIC_CDN}` + R?.find((y) => y._id == d?.political?.party_id)?.logo,
2841
- alt: ""
2842
- }
2843
- ),
2844
- /* @__PURE__ */ s.jsx("span", { className: "ms-1", children: R?.find((y) => y._id == d.political?.party_id)?.name })
2845
- ] }) })
2846
- }
2847
- )
2848
- }
2849
- ) }),
2850
- /* @__PURE__ */ s.jsx("hr", {}),
2851
- /* @__PURE__ */ s.jsx("div", { className: "small", children: d?._id == "5e90cc96579a17440c5d7d52" && /* @__PURE__ */ s.jsx("span", { children: "Founder of Articles Media, thank you for using the site, feel free to message me with any questions, concerns or anything else." }) })
2852
- ] })
2853
- ] }),
2854
- /* @__PURE__ */ s.jsx("hr", {}),
2855
- T && /* @__PURE__ */ s.jsxs("div", { children: [
2856
- /* @__PURE__ */ s.jsx("div", { className: "d-flex align-items-center justify-content-between", children: /* @__PURE__ */ s.jsx("div", { className: "small", children: "Admin Mode Toolbar" }) }),
2857
- /* @__PURE__ */ s.jsxs("div", { children: [
2858
- /* @__PURE__ */ s.jsxs("div", { className: "d-flex mb-2", children: [
2859
- /* @__PURE__ */ s.jsx(
2860
- P,
2861
- {
2862
- small: !0,
2863
- variant: "warning",
2864
- className: "",
2865
- onClick: () => {
2866
- loadAdminUserData();
2867
- },
2868
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-redo me-0" })
2869
- }
2870
- ),
2871
- /* @__PURE__ */ s.jsx(
2872
- P,
2873
- {
2874
- active: T?.edit,
2875
- small: !0,
2876
- className: "",
2877
- onClick: () => {
2878
- je({
2879
- ...T,
2880
- edit: !T?.edit
2881
- });
2882
- },
2883
- children: "Edit Mode"
2884
- }
2885
- ),
2886
- T?.edit && /* @__PURE__ */ s.jsx(
2887
- P,
2888
- {
2889
- small: !0,
2890
- variant: "success",
2891
- className: "me-0",
2892
- onClick: () => {
2893
- Ge();
2894
- },
2895
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-save me-0" })
2896
- }
2897
- )
2898
- ] }),
2899
- [
2900
- "User Details",
2901
- "Verification",
2902
- "Moderation",
2903
- "Bans",
2904
- "Stripe",
2905
- "Layouts",
2906
- "Reset Password",
2907
- "Sessions"
2908
- ].map(
2909
- (y) => /* @__PURE__ */ s.jsx(
2910
- P,
2911
- {
2912
- active: y == T?.tab,
2913
- small: !0,
2914
- onClick: () => {
2915
- je({
2916
- ...T,
2917
- tab: y
2918
- });
2919
- },
2920
- children: y
2921
- },
2922
- y
2923
- )
2924
- )
2925
- ] }),
2926
- /* @__PURE__ */ s.jsx("hr", {})
2927
- ] }),
2928
- /* @__PURE__ */ s.jsxs("div", { className: "pe-3 pb-3", children: [
2929
- /* @__PURE__ */ s.jsx("div", { className: "mb-2 me-2", children: [
2930
- {
2931
- name: "Proposals Stance",
2932
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: /* @__PURE__ */ s.jsxs("div", { className: "small", children: [
2933
- /* @__PURE__ */ s.jsx("span", { children: ie?.fundamental?.filter((y) => ie?.user_sentiments?.find((V) => V.proposal_id == y._id) ? y : null).length }),
2934
- /* @__PURE__ */ s.jsx("span", { className: "px-1", children: "/" }),
2935
- /* @__PURE__ */ s.jsx("span", { children: ie?.fundamental?.length })
2936
- ] }) })
2937
- },
2938
- {
2939
- name: "Proposal Sentiments",
2940
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_public_proposals_stance?.user_sentiments_count || 0 })
2941
- },
2942
- {
2943
- name: "Proposal Comments",
2944
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_public_proposals_stance?.user_comments_count || 0 })
2945
- },
2946
- {
2947
- name: "Proposal Submissions",
2948
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: O?.length || 0 })
2949
- // TODO - Make conditional
2950
- },
2951
- {
2952
- name: "News Comments",
2953
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d?.populated_news_comments_count || 0 })
2954
- },
2955
- {
2956
- name: "News Submissions",
2957
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: _?.length || 0 })
2958
- // TODO - Make conditional
2959
- },
2960
- {
2961
- name: "Verifications",
2962
- // dev: true,
2963
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: d.verified?.verified_methods?.length || 0 })
2964
- // TODO - Make conditional
2965
- },
2966
- {
2967
- name: "Layouts",
2968
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: x?.length || 0 })
2969
- },
2970
- {
2971
- name: "Donations",
2972
- badge: /* @__PURE__ */ s.jsxs("span", { children: [
2973
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-primary ms-1", children: D?.populated_public_donations?.count || 0 }),
2974
- /* @__PURE__ */ s.jsxs("span", { className: "badge bg-black", children: [
2975
- "$",
2976
- et((D?.populated_public_donations.total / 100).toFixed(2))
2977
- ] })
2978
- ] })
2979
- },
2980
- {
2981
- name: "Orders",
2982
- badge: /* @__PURE__ */ s.jsxs("span", { children: [
2983
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-primary ms-1", children: "0" }),
2984
- /* @__PURE__ */ s.jsx("span", { className: "badge bg-black", children: "0" })
2985
- ] })
2986
- },
2987
- {
2988
- name: "Achievements",
2989
- dev: !0,
2990
- badge: /* @__PURE__ */ s.jsx("span", { className: "badge bg-black ms-1", children: "0" })
2991
- // TODO - Make conditional
2992
- }
2993
- ].map((y) => (P, y.name == S, y.name, y.badge, y.name, y.dev ? /* @__PURE__ */ s.jsx(
2994
- Ze,
2995
- {
2996
- inline: !0,
2997
- children: /* @__PURE__ */ s.jsxs(
2998
- P,
2999
- {
3000
- onClick: () => L(y.name),
3001
- active: y.name == S,
3002
- small: !0,
3003
- children: [
3004
- y.name,
3005
- y.badge
3006
- ]
3007
- },
3008
- y.name
3009
- )
3010
- },
3011
- y.name
3012
- ) : /* @__PURE__ */ s.jsxs(
3013
- P,
3014
- {
3015
- onClick: () => L(y.name),
3016
- active: y.name == S,
3017
- small: !0,
3018
- children: [
3019
- y.name,
3020
- y.badge
3021
- ]
3022
- },
3023
- y.name
3024
- ))) }),
3025
- S == "Proposals Stance" && /* @__PURE__ */ s.jsx(
3026
- fr,
3027
- {
3028
- activeLayoutProposalSentiments: fe,
3029
- populated_user: e,
3030
- usersProposalSentiments: ie,
3031
- setShowFullStanceDetails: I,
3032
- showFullStanceDetails: F,
3033
- userData: d
3034
- }
3035
- ),
3036
- S == "Proposal Comments" && /* @__PURE__ */ s.jsx(
3037
- pr,
3038
- {
3039
- activeLayoutProposalSentiments: fe
3040
- }
3041
- ),
3042
- S == "Proposal Sentiments" && /* @__PURE__ */ s.jsx(
3043
- mr,
3044
- {
3045
- activeLayoutProposalSentiments: fe
3046
- }
3047
- ),
3048
- S == "Proposal Submissions" && /* @__PURE__ */ s.jsx(
3049
- hr,
3050
- {
3051
- userProposalsSubmitted: D?.populated_public_proposals
3052
- }
3053
- ),
3054
- S == "News Comments" && /* @__PURE__ */ s.jsx(
3055
- gr,
3056
- {
3057
- publicUserData: D
3058
- }
3059
- ),
3060
- S == "News Submissions" && /* @__PURE__ */ s.jsx(
3061
- br,
3062
- {
3063
- publicUserData: D,
3064
- userNewsSubmitted: D?.populated_public_news_submissions
3065
- }
3066
- ),
3067
- S == "Donations" && /* @__PURE__ */ s.jsx(
3068
- jr,
3069
- {
3070
- publicUserData: D,
3071
- userDonations: D?.populated_public_donations,
3072
- lifetimeContribution: N
3073
- }
3074
- ),
3075
- S == "Layouts" && /* @__PURE__ */ s.jsx(
3076
- yr,
3077
- {
3078
- publicUserData: D,
3079
- userLayoutsData: D?.populated_public_layouts
3080
- }
3081
- ),
3082
- S == "Verifications" && /* @__PURE__ */ s.jsx(
3083
- wr,
3084
- {
3085
- publicUserData: D,
3086
- userData: d
3087
- }
3088
- ),
3089
- S == "Achievements" && /* @__PURE__ */ s.jsx(
3090
- _r,
3091
- {
3092
- publicUserData: D
3093
- }
3094
- )
3095
- ] })
3096
- ] }) }),
3097
- /* @__PURE__ */ s.jsxs(Be.Footer, { className: "justify-content-between", children: [
3098
- $?._id == "5e90cc96579a17440c5d7d52" ? /* @__PURE__ */ s.jsxs("span", { children: [
3099
- /* @__PURE__ */ s.jsxs(
3100
- Ze,
3101
- {
3102
- inline: !0,
3103
- className: "me-2",
3104
- children: [
3105
- /* @__PURE__ */ s.jsxs(
3106
- P,
3107
- {
3108
- onClick: () => {
3109
- je(T ? !1 : {
3110
- tab: ""
3111
- });
3112
- },
3113
- small: !0,
3114
- active: T,
3115
- variant: "",
3116
- className: "me-1",
3117
- children: [
3118
- /* @__PURE__ */ s.jsx("i", { className: "fad fa-pen" }),
3119
- /* @__PURE__ */ s.jsx("span", { children: "Admin Mode" })
3120
- ]
3121
- }
3122
- ),
3123
- /* @__PURE__ */ s.jsx(
3124
- P,
3125
- {
3126
- onClick: () => {
3127
- ge(), ee();
3128
- },
3129
- small: !0,
3130
- variant: "warning",
3131
- className: "",
3132
- children: /* @__PURE__ */ s.jsx("i", { className: "fad fa-redo me-0" })
3133
- }
3134
- )
3135
- ]
3136
- }
3137
- ),
3138
- /* @__PURE__ */ s.jsx("span", { style: { fontSize: "0.8rem" }, children: d?._id })
3139
- ] }) : /* @__PURE__ */ s.jsx("span", {}),
3140
- /* @__PURE__ */ s.jsx("div", { className: "justify-content-", children: /* @__PURE__ */ s.jsx(P, { variant: "articles", onClick: k, children: "Close" }) })
3141
- ] })
3142
- ]
3143
- }
3144
- )
3145
- ] });
3146
- }
3147
- export {
3148
- Dr as default
3149
- };
1
+ "use client";
2
+ import { t as e } from "./ViewUserModal-DDjWLpyM.js";
3
+ export { e as default };