@articles-media/articles-dev-box 1.0.31 → 1.0.32

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 (51) hide show
  1. package/README.md +11 -3
  2. package/dist/Ad-BsG4C_lR.js +668 -0
  3. package/dist/Ad.js +2 -2
  4. package/dist/AdConfirmExitModal-heFPJNdX.js +55 -0
  5. package/dist/AdDetailsModal-D2-4lh9e.js +107 -0
  6. package/dist/ArticlesAd.js +15 -10
  7. package/dist/Button-DvEZjsVV.js +32 -0
  8. package/dist/CreditsModal.js +51 -35
  9. package/dist/DarkModeHandler.js +21 -13
  10. package/dist/FriendsList.js +49 -47
  11. package/dist/GameMenu-BD1HSDJ-.js +84 -0
  12. package/dist/GameMenu.js +2 -0
  13. package/dist/GameScoreboard-DVoXXDnM.js +174 -0
  14. package/dist/GameScoreboard.js +2 -2
  15. package/dist/GlobalBody.js +58 -23
  16. package/dist/GlobalHead.js +5 -5
  17. package/dist/Link-CguWJy6y.js +16 -0
  18. package/dist/ReturnToLauncherButton.js +26 -22
  19. package/dist/SessionButton.js +62 -38
  20. package/dist/SettingsModal-yU_TsVYh.js +430 -0
  21. package/dist/SettingsModal.js +2 -2
  22. package/dist/SignInButton.js +21 -17
  23. package/dist/SocketServerUrlHandler.js +14 -10
  24. package/dist/StatusModal-BXRbJQ10.js +84 -0
  25. package/dist/ToontownModeHandler.js +13 -10
  26. package/dist/ViewUserModal-Dgo1C4sR.js +1798 -0
  27. package/dist/ViewUserModal.js +2 -2
  28. package/dist/articles-dev-box.css +498 -2
  29. package/dist/classnames-No-mjhw1.js +66 -0
  30. package/dist/index.js +23 -22
  31. package/dist/numberWithCommas-B0B9bjWC.js +2198 -0
  32. package/dist/typicalZustandStoreExcludes.js +4 -3
  33. package/dist/typicalZustandStoreStateSlice.js +53 -49
  34. package/dist/useAuthSiteStatus-ZK1GbPBV.js +34 -0
  35. package/dist/useFullscreen.js +38 -18
  36. package/dist/useUserDetails.js +17 -16
  37. package/dist/useUserFriends.js +23 -21
  38. package/dist/useUserToken.js +12 -11
  39. package/package.json +2 -1
  40. package/dist/Ad-CFuDgQYL.js +0 -504
  41. package/dist/AdConfirmExitModal-skW9lp88.js +0 -55
  42. package/dist/AdDetailsModal-CdTR2Y9l.js +0 -107
  43. package/dist/Button-sSB4xpOw.js +0 -31
  44. package/dist/GameScoreboard-9GYlLx72.js +0 -165
  45. package/dist/Link-8nSDV4sI.js +0 -16
  46. package/dist/SettingsModal-CiLvMoLW.js +0 -303
  47. package/dist/StatusModal-PG3i9NKf.js +0 -75
  48. package/dist/ViewUserModal-C5gjfuJ5.js +0 -1549
  49. package/dist/classnames-DCsil9eG.js +0 -39
  50. package/dist/numberWithCommas-DSRplpBy.js +0 -1170
  51. package/dist/useAuthSiteStatus-Cj9IjMj7.js +0 -29
@@ -1,1549 +0,0 @@
1
- import { n as e, t } from "./classnames-DCsil9eG.js";
2
- import { t as n } from "./Button-sSB4xpOw.js";
3
- import { t as r } from "./Link-8nSDV4sI.js";
4
- import { a as i, i as a, n as o, o as s, r as c, t as l } from "./numberWithCommas-DSRplpBy.js";
5
- import { useEffect as u, useMemo as ee, useState as d } from "react";
6
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
7
- import h from "swr";
8
- import g from "react-bootstrap/Modal";
9
- import _ from "react-bootstrap/OverlayTrigger";
10
- import v from "react-bootstrap/Tooltip";
11
- import y from "swr/immutable";
12
- import { ProgressBar as b } from "react-bootstrap";
13
- //#region node_modules/date-fns/compareAsc.js
14
- function x(e, t) {
15
- let n = s(e) - +s(t);
16
- return n < 0 ? -1 : n > 0 ? 1 : n;
17
- }
18
- //#endregion
19
- //#region node_modules/date-fns/differenceInCalendarMonths.js
20
- function S(e, t, n) {
21
- let [r, a] = i(n?.in, e, t), o = r.getFullYear() - a.getFullYear(), s = r.getMonth() - a.getMonth();
22
- return o * 12 + s;
23
- }
24
- //#endregion
25
- //#region node_modules/date-fns/endOfDay.js
26
- function C(e, t) {
27
- let n = s(e, t?.in);
28
- return n.setHours(23, 59, 59, 999), n;
29
- }
30
- //#endregion
31
- //#region node_modules/date-fns/endOfMonth.js
32
- function w(e, t) {
33
- let n = s(e, t?.in), r = n.getMonth();
34
- return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
35
- }
36
- //#endregion
37
- //#region node_modules/date-fns/isLastDayOfMonth.js
38
- function T(e, t) {
39
- let n = s(e, t?.in);
40
- return +C(n, t) == +w(n, t);
41
- }
42
- //#endregion
43
- //#region node_modules/date-fns/differenceInMonths.js
44
- function te(e, t, n) {
45
- let [r, a, o] = i(n?.in, e, e, t), s = x(a, o), c = Math.abs(S(a, o));
46
- if (c < 1) return 0;
47
- a.getMonth() === 1 && a.getDate() > 27 && a.setDate(30), a.setMonth(a.getMonth() - s * c);
48
- let l = x(a, o) === -s;
49
- T(r) && c === 1 && x(r, o) === 1 && (l = !1);
50
- let u = s * (c - +l);
51
- return u === 0 ? 0 : u;
52
- }
53
- //#endregion
54
- //#region src/components/UI/UserProfilePhoto.jsx
55
- var E = /* @__PURE__ */ e(t(), 1);
56
- function D(e) {
57
- let { profile_photo: t, width: n, alt: r, hideDefault: i, activityStatus: a, user_id: o } = e;
58
- return t?.key ? /* @__PURE__ */ m("div", {
59
- "data-using-react-profile-photo": "true",
60
- className: `profile-photo-wrap ${n ? "" : "w-100 h-100"}`,
61
- style: { ...n && {
62
- width: n,
63
- height: n
64
- } },
65
- children: [/* @__PURE__ */ p(O, {
66
- activityStatus: a,
67
- user_id: o
68
- }), /* @__PURE__ */ p("img", {
69
- className: "w-100 h-100",
70
- src: `${process.env.NEXT_PUBLIC_CDN}${t.key}`,
71
- style: { objectFit: "contain" },
72
- alt: r || "Profile photo of a user"
73
- })]
74
- }) : /* @__PURE__ */ m("div", {
75
- "data-using-react-profile-photo": "true",
76
- className: (0, E.default)("profile-photo-wrap", {
77
- "w-100 h-100": !n,
78
- "d-none": i
79
- }),
80
- style: { ...n && {
81
- width: n,
82
- height: n
83
- } },
84
- children: [/* @__PURE__ */ p(O, {
85
- activityStatus: a,
86
- user_id: o
87
- }), /* @__PURE__ */ p("img", {
88
- className: "w-100 h-100",
89
- src: `${process.env.NEXT_PUBLIC_CDN}profile_photos/starter/articles.jpg`,
90
- style: { objectFit: "contain" },
91
- alt: r || "Profile photo of a user"
92
- })]
93
- });
94
- }
95
- function O({ activityStatus: e, user_id: t }) {
96
- if (!(!e || !t)) return /* @__PURE__ */ p("div", {
97
- "data-user_id": t,
98
- className: (0, E.default)("online-status", {
99
- "status-online": e?.status == "Online" || t == "630f0b337c52851e754b03f7",
100
- "status-offline": e?.status == "Offline",
101
- "status-away": e?.status == "Away",
102
- "activity-active": !1
103
- })
104
- });
105
- }
106
- //#endregion
107
- //#region src/hooks/User/UserPublic/usePublicUserData.js
108
- var k = (e) => {
109
- let t = new URLSearchParams({ user_id: e.user_id }).toString();
110
- return fetch(`${e.url}?${t}`).then((e) => e.json());
111
- }, A = {
112
- dedupingInterval: 1e3 * 60 * 1,
113
- focusThrottleInterval: 1e3 * 60 * 1
114
- }, j = (e) => {
115
- let { data: t, error: n, isLoading: r, isValidating: i, mutate: a } = y(e?.user_id ? {
116
- url: process.env.NODE_ENV === "development" ? "http://localhost:3001/api/user-public/getUserDetails" : "https://articles.media/api/user-public/getUserDetails",
117
- user_id: e.user_id
118
- } : null, k, A);
119
- return {
120
- data: t,
121
- error: n,
122
- isLoading: r,
123
- isValidating: i,
124
- mutate: a
125
- };
126
- };
127
- //#endregion
128
- //#region src/components/UI/IsDev.jsx
129
- function M({ className: e, noOutline: t, children: n, inline: r }) {
130
- let [i, a] = d();
131
- if (u(() => {
132
- a(!0);
133
- }, []), n && (!1)?.roles?.isDev && i) return /* @__PURE__ */ p("div", {
134
- className: `is-dev-content ${t && "no-outline"} ${e} ${r && "d-inline-block"}`,
135
- children: n
136
- });
137
- }
138
- //#endregion
139
- //#region src/constants/routes.js
140
- var N = {
141
- BASE: "https://articles.media",
142
- SIGN_IN: "/login",
143
- SIGN_UP: "/signup",
144
- HOME: "/",
145
- PROPOSALS: "/politics/proposals",
146
- PROPOSALS_SUBMISSIONS_ALL: "/politics/proposals/submissions",
147
- STORIES: "/news/stories",
148
- ISSUES: "/news/issues",
149
- MYTHS: "/news/myths"
150
- };
151
- //#endregion
152
- //#region src/components/UI/ViewUserModal/Panels/ProposalsStance.jsx
153
- function ne({ activeLayoutProposalSentiments: e, populated_user: t, usersProposalSentiments: i, setShowFullStanceDetails: a, showFullStanceDetails: o, userData: s }) {
154
- return /* @__PURE__ */ p("div", {
155
- className: "row mx-0 mb-2",
156
- children: [{
157
- name: `${t?.display_name || s.display_name}`,
158
- data: e || {}
159
- }, {
160
- name: "You",
161
- data: i || {}
162
- }].map((e) => e.name == "You" ? /* @__PURE__ */ p("div", {
163
- className: "col-lg-6 px-1",
164
- children: /* @__PURE__ */ m("div", {
165
- className: "card card-articles card-sm h-100",
166
- children: [
167
- /* @__PURE__ */ p("div", {
168
- className: "card-header",
169
- children: /* @__PURE__ */ p("b", { children: e.name })
170
- }),
171
- /* @__PURE__ */ p("div", {
172
- className: "card-body p-2",
173
- children: /* @__PURE__ */ p("small", { children: "Login or create an account to compare your political stance with this user!" })
174
- }),
175
- /* @__PURE__ */ m("div", {
176
- className: "card-footer",
177
- children: [/* @__PURE__ */ p(r, {
178
- href: N.SIGN_IN,
179
- children: /* @__PURE__ */ p(n, {
180
- small: !0,
181
- className: "",
182
- children: "Sign In"
183
- })
184
- }), /* @__PURE__ */ p(r, {
185
- href: N.SIGN_UP,
186
- children: /* @__PURE__ */ p(n, {
187
- small: !0,
188
- className: "",
189
- children: "Sign Up"
190
- })
191
- })]
192
- })
193
- ]
194
- })
195
- }, e.name) : /* @__PURE__ */ p("div", {
196
- className: "col-lg-6 px-1",
197
- children: /* @__PURE__ */ m("div", {
198
- className: "card card-articles card-sm",
199
- children: [/* @__PURE__ */ p("div", {
200
- className: "card-header",
201
- onClick: () => {
202
- console.log(e.data);
203
- },
204
- children: /* @__PURE__ */ p("b", { children: e.name })
205
- }), /* @__PURE__ */ m("div", {
206
- className: "card-body py-2 px-2 small",
207
- children: [
208
- /* @__PURE__ */ m("div", {
209
- className: "",
210
- children: [
211
- /* @__PURE__ */ m("div", {
212
- className: "small",
213
- children: [
214
- "Fundamental: ",
215
- e?.data?.fundamental?.filter((t) => e.data?.user_sentiments?.find((e) => e.proposal_id == t._id) ? t : null).length,
216
- "/",
217
- e?.data?.fundamental?.length
218
- ]
219
- }),
220
- /* @__PURE__ */ p(b, {
221
- striped: !0,
222
- variant: "dark",
223
- className: "shadow-articles mb-2",
224
- now: (e.data?.fundamental?.filter((t) => e.data?.user_sentiments?.find((e) => e.proposal_id == t._id) ? t : null).length / e.data?.fundamental?.length * 100).toFixed(2),
225
- label: `${(e.data?.fundamental?.filter((t) => e.data?.user_sentiments?.find((e) => e.proposal_id == t._id) ? t : null).length / e.data?.fundamental?.length * 100).toFixed(2)}%`
226
- }),
227
- /* @__PURE__ */ m(b, {
228
- className: "shadow-articles mb-2",
229
- style: { height: "10px" },
230
- children: [
231
- /* @__PURE__ */ p(b, {
232
- striped: !0,
233
- variant: "danger",
234
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Disagree" && e.populated_proposal.fundamental)?.length / e.data?.fundamental?.length * 100).toFixed(2)
235
- }),
236
- /* @__PURE__ */ p(b, {
237
- striped: !0,
238
- variant: "warning",
239
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Needs Work" && e.populated_proposal.fundamental)?.length / e.data?.fundamental?.length * 100).toFixed(2)
240
- }),
241
- /* @__PURE__ */ p(b, {
242
- striped: !0,
243
- variant: "success",
244
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Agree" && e.populated_proposal.fundamental)?.length / e.data?.fundamental?.length * 100).toFixed(2)
245
- })
246
- ]
247
- }),
248
- /* @__PURE__ */ m("div", {
249
- className: "",
250
- children: ["Disagree: ", e.data?.user_sentiments?.filter((t) => {
251
- let n = e.data?.fundamental.find((e) => e._id == t.proposal_id);
252
- return t.sentiment_status == "Disagree" && n;
253
- })?.length || 0]
254
- }),
255
- /* @__PURE__ */ m("div", {
256
- className: "",
257
- children: ["Needs Work: ", e.data?.user_sentiments?.filter((t) => {
258
- let n = e.data?.fundamental.find((e) => e._id == t.proposal_id);
259
- return t.sentiment_status == "Needs Work" && n;
260
- })?.length || 0]
261
- }),
262
- /* @__PURE__ */ m("div", {
263
- className: "mb-2",
264
- children: ["Agree: ", e.data?.user_sentiments?.filter((t) => {
265
- let n = e.data?.fundamental.find((e) => e._id == t.proposal_id);
266
- return t.sentiment_status == "Agree" && n;
267
- })?.length || 0]
268
- })
269
- ]
270
- }),
271
- !o && /* @__PURE__ */ p("span", {
272
- onClick: () => a(!0),
273
- className: "badge bg-articles-secondary shadow-articles badge-hover",
274
- children: "View More"
275
- }),
276
- o && /* @__PURE__ */ m(f, { children: [
277
- /* @__PURE__ */ p("hr", {}),
278
- /* @__PURE__ */ m("div", {
279
- className: "mb-2",
280
- children: [
281
- /* @__PURE__ */ m("div", {
282
- className: "small",
283
- children: [
284
- "All: ",
285
- e.data?.user_sentiments?.length,
286
- "/",
287
- e.data?.total
288
- ]
289
- }),
290
- /* @__PURE__ */ p(b, {
291
- striped: !0,
292
- animated: !0,
293
- variant: "dark",
294
- className: "shadow-articles mb-1",
295
- now: (e.data?.user_sentiments?.length / e.data?.total * 100).toFixed(2),
296
- label: `${(e.data?.user_sentiments?.length / e.data?.total * 100).toFixed(2)}%`
297
- }),
298
- /* @__PURE__ */ m(b, {
299
- className: "shadow-articles mb-2",
300
- style: { height: "10px" },
301
- children: [
302
- /* @__PURE__ */ p(b, {
303
- striped: !0,
304
- animated: !0,
305
- variant: "danger",
306
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Disagree")?.length / e.data?.total * 100).toFixed(2)
307
- }),
308
- /* @__PURE__ */ p(b, {
309
- striped: !0,
310
- animated: !0,
311
- variant: "warning",
312
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Needs Work")?.length / e.data?.total * 100).toFixed(2)
313
- }),
314
- /* @__PURE__ */ p(b, {
315
- striped: !0,
316
- animated: !0,
317
- variant: "success",
318
- now: (e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Agree")?.length / e.data?.total * 100).toFixed(2)
319
- })
320
- ]
321
- }),
322
- /* @__PURE__ */ m("div", {
323
- className: "",
324
- children: ["Disagree: ", e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Disagree")?.length || 0]
325
- }),
326
- /* @__PURE__ */ m("div", {
327
- className: "",
328
- children: ["Needs Work: ", e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Needs Work")?.length || 0]
329
- }),
330
- /* @__PURE__ */ m("div", {
331
- className: "mb-2",
332
- children: ["Agree: ", e.data?.user_sentiments?.filter((e) => e.sentiment_status == "Agree")?.length || 0]
333
- })
334
- ]
335
- }),
336
- /* @__PURE__ */ p("hr", {}),
337
- /* @__PURE__ */ p("p", {
338
- className: "mb-0",
339
- children: /* @__PURE__ */ m("div", {
340
- className: "row",
341
- children: [
342
- /* @__PURE__ */ p("div", {
343
- className: "col-9",
344
- children: "Comments"
345
- }),
346
- /* @__PURE__ */ p("div", {
347
- className: "col-3",
348
- children: /* @__PURE__ */ p("b", { children: e.data?.user_comments?.length || 0 })
349
- }),
350
- /* @__PURE__ */ p("div", {
351
- className: "col-9",
352
- children: "Submissions"
353
- }),
354
- /* @__PURE__ */ p("div", {
355
- className: "col-3",
356
- children: /* @__PURE__ */ p("b", { children: e.data?.user_submissions })
357
- })
358
- ]
359
- })
360
- })
361
- ] })
362
- ]
363
- })]
364
- })
365
- }, e.name))
366
- });
367
- }
368
- //#endregion
369
- //#region src/components/UI/ViewUserModal/Panels/ProposalComments.jsx
370
- function re({ activeLayoutProposalSentiments: e }) {
371
- return /* @__PURE__ */ p("div", { children: e.user_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ m("div", {
372
- className: "card card-articles card-sm border mb-2",
373
- children: [
374
- /* @__PURE__ */ m("div", {
375
- className: "card-header small",
376
- children: ["Commented on ", /* @__PURE__ */ p("b", { children: e.populated_proposal.title })]
377
- }),
378
- /* @__PURE__ */ p("div", {
379
- className: "card-body small p-2",
380
- children: /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
381
- className: "small",
382
- children: a(new Date(e.date), "M/dd/yy")
383
- }), /* @__PURE__ */ p("div", { children: e.comment })] })
384
- }),
385
- /* @__PURE__ */ p("div", {
386
- className: "card-footer",
387
- children: /* @__PURE__ */ p(r, {
388
- prefetch: !1,
389
- href: `${N.PROPOSALS}/${e.populated_proposal.url}?interaction_id=${e._id}`,
390
- children: /* @__PURE__ */ p(n, {
391
- small: !0,
392
- children: "View"
393
- })
394
- })
395
- })
396
- ]
397
- }, e._id)) });
398
- }
399
- //#endregion
400
- //#region src/components/UI/ViewUserModal/Panels/ProposalSentiments.jsx
401
- function ie({ activeLayoutProposalSentiments: e }) {
402
- return /* @__PURE__ */ p("div", { children: e.user_sentiments?.map((e) => /* @__PURE__ */ m("div", {
403
- className: "card card-articles card-sm border mb-2",
404
- children: [
405
- /* @__PURE__ */ m("div", {
406
- className: "card-header small",
407
- children: ["Gave their sentiment on ", /* @__PURE__ */ p("b", { children: e.populated_proposal.title })]
408
- }),
409
- /* @__PURE__ */ m("div", {
410
- className: "card-body small p-2",
411
- children: [/* @__PURE__ */ m("div", {
412
- className: "d-flex align-items-center border-bottom pb-1",
413
- children: [
414
- e.sentiment_status == "Agree" && /* @__PURE__ */ p("div", {
415
- className: "badge shadow-articles bg-success",
416
- children: "Agree"
417
- }),
418
- e.sentiment_status == "Needs Work" && /* @__PURE__ */ p("div", {
419
- className: "badge shadow-articles bg-warning text-dark",
420
- children: "Needs Work"
421
- }),
422
- e.sentiment_status == "Disagree" && /* @__PURE__ */ p("div", {
423
- className: "badge shadow-articles bg-danger",
424
- children: "Disagree"
425
- }),
426
- /* @__PURE__ */ p("span", {
427
- className: "small ms-2",
428
- children: a(new Date(e.date), "M/dd/yy")
429
- })
430
- ]
431
- }), /* @__PURE__ */ p("div", {
432
- className: "mt-1",
433
- children: e.comment
434
- })]
435
- }),
436
- /* @__PURE__ */ p("div", {
437
- className: "card-footer",
438
- children: /* @__PURE__ */ p(r, {
439
- prefetch: !1,
440
- href: `https://articles.media/politics/proposals/${e.populated_proposal.url}?interaction_id=${e._id}`,
441
- children: /* @__PURE__ */ p(n, {
442
- small: !0,
443
- children: "View"
444
- })
445
- })
446
- })
447
- ]
448
- }, e._id)) });
449
- }
450
- //#endregion
451
- //#region src/components/UI/ViewUserModal/Panels/ProposalSubmissions.jsx
452
- function ae({ activeLayoutProposalSentiments: e, userProposalsSubmitted: t }) {
453
- let [i, a] = d(!1);
454
- return /* @__PURE__ */ m("div", { children: [
455
- /* @__PURE__ */ p("div", {
456
- className: "mb-2",
457
- children: t?.slice(0, i ? 100 : 1).map((e) => /* @__PURE__ */ m("div", {
458
- className: "card card-articles card-sm shadow-articles",
459
- children: [/* @__PURE__ */ p("div", {
460
- className: "card-body p-2 lh-sm d-flex align-items-center",
461
- children: /* @__PURE__ */ m("div", {
462
- className: "ms-2",
463
- children: [/* @__PURE__ */ p("div", { children: e.title }), /* @__PURE__ */ m("div", {
464
- className: "small",
465
- children: [e.type, e.fundamental && " - Fundamental"]
466
- })]
467
- })
468
- }), /* @__PURE__ */ p("div", {
469
- className: "card-footer d-flex",
470
- children: /* @__PURE__ */ p(r, {
471
- href: `${N.PROPOSALS_SUBMISSIONS_ALL}/${e._id}`,
472
- className: "",
473
- children: /* @__PURE__ */ p(n, {
474
- small: !0,
475
- children: /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("i", { className: "fad fa-eye me-1" }), "View"] })
476
- })
477
- })
478
- })]
479
- }, e._id))
480
- }),
481
- t?.length > 1 && /* @__PURE__ */ p(n, {
482
- onClick: () => a(!i),
483
- className: "w-100",
484
- children: i ? "View Less" : "View All"
485
- }),
486
- t?.length == 0 && /* @__PURE__ */ p("span", {
487
- className: "small",
488
- children: "User has no proposal submissions"
489
- })
490
- ] });
491
- }
492
- //#endregion
493
- //#region src/components/News/NewsPreviewImage.jsx
494
- function P(e) {
495
- let { featured_image: t, thumbnail_size: n } = e;
496
- return /* @__PURE__ */ m(f, { children: [(t?.image_type == "S3 File System" || t?.thumbnails?.length > 0) && /* @__PURE__ */ p(f, { children: t?.thumbnails?.length > 0 ? /* @__PURE__ */ p(f, { children: n && t?.thumbnails?.find((e) => e.width == n) ? /* @__PURE__ */ p("img", {
497
- style: {
498
- width: "100%",
499
- height: "100%",
500
- objectFit: "cover"
501
- },
502
- src: process.env.NEXT_PUBLIC_CDN + t?.thumbnails?.find((e) => e.width == n).key,
503
- loading: "lazy",
504
- alt: "",
505
- className: "flex-shrink-0"
506
- }) : /* @__PURE__ */ p("img", {
507
- style: {
508
- width: "100%",
509
- height: "100%",
510
- objectFit: "cover"
511
- },
512
- src: process.env.NEXT_PUBLIC_CDN + [...t?.thumbnails].sort((e, t) => e.width - t.width)[0].key,
513
- loading: "lazy",
514
- alt: "",
515
- className: "flex-shrink-0"
516
- }) }) : /* @__PURE__ */ p("img", {
517
- style: {
518
- width: "100%",
519
- height: "100%",
520
- objectFit: "cover"
521
- },
522
- src: process.env.NEXT_PUBLIC_CDN + t?.key,
523
- loading: "lazy",
524
- alt: "",
525
- className: "flex-shrink-0"
526
- }) }), t?.location && !t?.image_type && (t?.thumbnails?.length || 0) < 1 && /* @__PURE__ */ p("img", {
527
- style: {
528
- objectFit: "cover",
529
- width: "100%",
530
- height: "100%"
531
- },
532
- src: `${process.env.NEXT_PUBLIC_CDN}${t?.key}`,
533
- alt: "",
534
- loading: "lazy"
535
- })] });
536
- }
537
- //#endregion
538
- //#region src/util/renderNewsRoute.js
539
- function F(e) {
540
- switch (e) {
541
- case "story": return N.STORIES;
542
- case "issue": return N.ISSUES;
543
- case "myth": return N.MYTHS;
544
- default:
545
- }
546
- }
547
- //#endregion
548
- //#region src/components/UI/ViewUserModal/Panels/NewsComments.jsx
549
- function oe({ publicUserData: e }) {
550
- return /* @__PURE__ */ p("div", { children: e?.populated_news_comments?.filter((e) => !e.parent_id).map((e) => /* @__PURE__ */ m("div", {
551
- className: "card card-articles card-sm border mb-2",
552
- children: [
553
- /* @__PURE__ */ m("div", {
554
- className: "card-header small",
555
- children: ["Commented on ", /* @__PURE__ */ p("b", { children: e.populated_news?.news_title })]
556
- }),
557
- /* @__PURE__ */ m("div", {
558
- className: "card-body small p-2 d-flex",
559
- children: [/* @__PURE__ */ p("div", {
560
- style: {
561
- width: "100px",
562
- height: "100px"
563
- },
564
- className: "me-2 flex-shrink-0",
565
- children: /* @__PURE__ */ p(P, {
566
- featured_image: e?.populated_news?.featured_image,
567
- thumbnail_size: 100
568
- })
569
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("span", {
570
- className: "small",
571
- children: a(new Date(e.date), "M/dd/yy")
572
- }), /* @__PURE__ */ p("div", { children: e.comment })] })]
573
- }),
574
- /* @__PURE__ */ p("div", {
575
- className: "card-footer",
576
- children: /* @__PURE__ */ p(r, {
577
- prefetch: !1,
578
- href: `${F(e.populated_news?.news_type)}/${e.populated_news?.url}?interaction_id=${e._id}`,
579
- children: /* @__PURE__ */ p(n, {
580
- small: !0,
581
- children: "View"
582
- })
583
- })
584
- })
585
- ]
586
- }, e._id)) });
587
- }
588
- //#endregion
589
- //#region src/components/UI/ViewUserModal/Panels/NewsSubmissions.jsx
590
- function se({ userNewsSubmitted: e }) {
591
- let [t, i] = d(!1);
592
- return /* @__PURE__ */ m("div", { children: [
593
- /* @__PURE__ */ m("div", {
594
- className: "mb-1 d-flex justify-content-between align-items-center",
595
- children: [/* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("i", { className: "fad fa-newspaper me-1" }), /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("span", { children: "News Submissions: " }), /* @__PURE__ */ p("span", {
596
- className: "badge bg-dark",
597
- children: e?.length || 0
598
- })] })] }), /* @__PURE__ */ m("span", {
599
- className: "badge bg-articles-secondary",
600
- children: [/* @__PURE__ */ p("i", { className: "fad fa-info me-1" }), /* @__PURE__ */ p("span", { children: "Info" })]
601
- })]
602
- }),
603
- /* @__PURE__ */ p("div", {
604
- className: "mb-1",
605
- children: e?.slice(0, t ? 100 : 1).map((e) => /* @__PURE__ */ m("div", {
606
- className: "card card-articles shadow-articles",
607
- children: [/* @__PURE__ */ m("div", {
608
- className: "card-body py-1 px-2 lh-sm d-flex align-items-center",
609
- children: [/* @__PURE__ */ p("img", {
610
- className: "",
611
- src: e?.featured_image?.location,
612
- width: "40px",
613
- height: "40px",
614
- style: { objectFit: "cover" },
615
- alt: ""
616
- }), /* @__PURE__ */ p("div", {
617
- className: "ms-2",
618
- children: /* @__PURE__ */ p("div", { children: e.news_title })
619
- })]
620
- }), /* @__PURE__ */ p("div", {
621
- className: "card-footer d-flex p-1",
622
- children: /* @__PURE__ */ p(r, {
623
- href: `${N.HOME}/${e.url}`,
624
- children: /* @__PURE__ */ m(n, {
625
- small: !0,
626
- className: "",
627
- children: [/* @__PURE__ */ p("i", { className: "fad fa-eye me-1" }), "View"]
628
- })
629
- })
630
- })]
631
- }, e._id))
632
- }),
633
- e?.length > 1 ? /* @__PURE__ */ p(n, {
634
- onClick: () => i(!t),
635
- small: !0,
636
- className: "",
637
- children: t ? "View Less" : "View All"
638
- }) : /* @__PURE__ */ p("span", {
639
- className: "small",
640
- children: "User has no news submissions"
641
- })
642
- ] });
643
- }
644
- //#endregion
645
- //#region src/components/UI/ViewUserModal/Panels/Donations.jsx
646
- function ce({ activeLayoutProposalSentiments: e, userDonations: t, lifetimeContribution: i }) {
647
- let [o, s] = d(!1);
648
- return /* @__PURE__ */ m("div", {
649
- className: "card card-articles ",
650
- children: [
651
- /* @__PURE__ */ m("div", {
652
- className: "card-header d-flex justify-content-between align-items-center p-1",
653
- children: [/* @__PURE__ */ p("span", { children: "Donations: " }), /* @__PURE__ */ m("span", {
654
- className: "badge bg-dark",
655
- children: [
656
- t.count,
657
- " - ",
658
- `$${l((i / 100 || 0).toFixed(2))}`
659
- ]
660
- })]
661
- }),
662
- /* @__PURE__ */ m("div", {
663
- className: "card-body p-2",
664
- children: [t?.list?.length == 0 && /* @__PURE__ */ p("span", {
665
- className: "small",
666
- children: "User has no donations"
667
- }), /* @__PURE__ */ p("div", {
668
- className: "donations-wrap",
669
- children: t?.list?.slice(0, o ? 100 : 3).map((e) => /* @__PURE__ */ m("div", {
670
- className: "border",
671
- children: [/* @__PURE__ */ m("div", {
672
- className: "card-body py-1 px-2 lh-sm d-flex align-items-center",
673
- children: [/* @__PURE__ */ p("div", {
674
- className: "small",
675
- children: "Most Recent"
676
- }), /* @__PURE__ */ m("div", {
677
- className: "ms-2 d-flex align-items-center",
678
- children: [/* @__PURE__ */ p("div", {
679
- className: "h4 mb-0 me-2",
680
- children: `$${l((e.amount / 100).toFixed(2))}`
681
- }), /* @__PURE__ */ p("div", {
682
- className: "small",
683
- children: a(new Date(e.date), "M/dd/yy")
684
- })]
685
- })]
686
- }), /* @__PURE__ */ p("div", {
687
- className: "card-footer d-flex p-1",
688
- children: /* @__PURE__ */ p(r, {
689
- href: `${N.HOME}/${e.url}`,
690
- children: /* @__PURE__ */ m(n, {
691
- className: "",
692
- small: !0,
693
- children: [/* @__PURE__ */ p("i", { className: "fad fa-eye me-1" }), "View"]
694
- })
695
- })
696
- })]
697
- }, e._id))
698
- })]
699
- }),
700
- /* @__PURE__ */ p("div", {
701
- className: "card-footer p-1 d-flex justify-content-center",
702
- children: t.count > 1 && /* @__PURE__ */ p(n, {
703
- onClick: () => {
704
- s(!o);
705
- },
706
- className: "w-100",
707
- children: o ? "View Less" : "View All"
708
- })
709
- })
710
- ]
711
- });
712
- }
713
- //#endregion
714
- //#region src/components/UI/ViewUserModal/Panels/Layouts.jsx
715
- function le({ userLayoutsData: e, handleClose: t }) {
716
- return /* @__PURE__ */ p("div", { children: e?.map((e) => /* @__PURE__ */ m("div", {
717
- className: "card card-articles shadow-articles",
718
- children: [/* @__PURE__ */ p("div", {
719
- className: "card-body py-1 px-2 lh-sm d-flex align-items-center",
720
- children: /* @__PURE__ */ m("div", {
721
- className: "ms-2",
722
- children: [/* @__PURE__ */ p("div", { children: e.name }), /* @__PURE__ */ p("div", {
723
- className: "small",
724
- children: "Last Viewed: Never"
725
- })]
726
- })
727
- }), /* @__PURE__ */ m("div", {
728
- className: "card-footer d-flex p-1",
729
- children: [(!1)._id !== e.user_id && /* @__PURE__ */ m(n, {
730
- className: "",
731
- small: !0,
732
- children: [/* @__PURE__ */ p("i", { className: "fad fa-plus me-1" }), "Follow"]
733
- }), /* @__PURE__ */ p(r, {
734
- href: `${N.HOME}/${e.url}`,
735
- children: /* @__PURE__ */ m(n, {
736
- className: "",
737
- small: !0,
738
- children: [/* @__PURE__ */ p("i", { className: "fad fa-eye me-1" }), "View"]
739
- })
740
- })]
741
- })]
742
- }, e._id)) });
743
- }
744
- //#endregion
745
- //#region src/components/UI/ViewUserModal/Panels/Verifications.jsx
746
- function ue({ activeLayoutProposalSentiments: e, userData: t }) {
747
- return /* @__PURE__ */ p("div", { children: /* @__PURE__ */ p("div", {
748
- className: "",
749
- children: t?.verified?.verified_methods?.map((e, t) => Object.keys(e)?.length > 0 ? /* @__PURE__ */ m("div", {
750
- className: "card card-articles card-sm object mb-2",
751
- children: [/* @__PURE__ */ p("div", {
752
- className: "card-header",
753
- children: e?.method_name
754
- }), /* @__PURE__ */ p("div", {
755
- className: "card-body p-2",
756
- children: /* @__PURE__ */ m("div", {
757
- className: "small",
758
- children: [/* @__PURE__ */ m("div", {
759
- className: "d-flex align-items-center",
760
- children: [/* @__PURE__ */ p("span", {
761
- className: "me-2",
762
- children: "Approved On: "
763
- }), /* @__PURE__ */ p(o, { date: e.approved_date })]
764
- }), /* @__PURE__ */ m("div", {
765
- className: "d-flex align-items-center",
766
- children: [/* @__PURE__ */ p("span", {
767
- className: "me-2",
768
- children: "Approved By: "
769
- }), /* @__PURE__ */ p(R, {
770
- user_id: e.approved_by,
771
- dangerousPopulate: !0
772
- })]
773
- })]
774
- })
775
- })]
776
- }, t) : /* @__PURE__ */ p("div", {
777
- className: "single",
778
- children: e
779
- }, t))
780
- }) });
781
- }
782
- //#endregion
783
- //#region src/components/UI/ViewUserModal/Panels/Achievements.jsx
784
- var I = [];
785
- function de({ activeLayoutProposalSentiments: e }) {
786
- return /* @__PURE__ */ p("div", { children: /* @__PURE__ */ p("div", {
787
- className: "achievements card card-articles",
788
- children: /* @__PURE__ */ p("div", {
789
- className: "card-body p-0",
790
- children: I.map((e) => /* @__PURE__ */ p("div", { children: /* @__PURE__ */ m("div", {
791
- className: "achievement w-100 d-flex align-items-center",
792
- children: [
793
- /* @__PURE__ */ p("div", {
794
- className: "icon",
795
- style: { width: "50px" },
796
- children: /* @__PURE__ */ p("i", { className: `fad ${e.icon} fa-lg` })
797
- }),
798
- /* @__PURE__ */ m("div", {
799
- className: "details small me-auto",
800
- children: [
801
- /* @__PURE__ */ p("b", {
802
- className: "name",
803
- children: e.name
804
- }),
805
- /* @__PURE__ */ p("div", {
806
- className: "description mb-1",
807
- children: e.description
808
- }),
809
- /* @__PURE__ */ p("div", {
810
- className: "small",
811
- children: e.tags?.map((e) => /* @__PURE__ */ p("span", {
812
- className: "badge bg-dark border",
813
- children: e
814
- }, e))
815
- })
816
- ]
817
- }),
818
- /* @__PURE__ */ p("div", {
819
- className: "icon border-end-0 border-start border-dark",
820
- children: /* @__PURE__ */ p("div", {
821
- className: "text-center px-3",
822
- children: /* @__PURE__ */ p("i", { className: "fad fa-square fa-lg me-0" })
823
- })
824
- })
825
- ]
826
- }) }, e.name))
827
- })
828
- }) });
829
- }
830
- //#endregion
831
- //#region src/hooks/Politics/usePoliticalParties.js
832
- var L = (e) => fetch(e).then((e) => e.json()), fe = (e) => {
833
- let { data: t, error: n, isLoading: r, mutate: i } = h(process.env.NODE_ENV === "development" ? "http://localhost:3001/api/news/resources/political-parties" : "https://articles.media/api/news/resources/political-parties", L, e?.preload ? {
834
- dedupingInterval: 1e3 * 60 * 10,
835
- focusThrottleInterval: c(60),
836
- errorRetryInterval: 1e3 * 60 * 5,
837
- fallbackData: e?.preload
838
- } : {
839
- dedupingInterval: 1e3 * 60 * 10,
840
- focusThrottleInterval: c(60),
841
- errorRetryInterval: 1e3 * 60 * 5
842
- });
843
- return {
844
- data: t,
845
- error: n,
846
- isLoading: r,
847
- mutate: i
848
- };
849
- };
850
- //#endregion
851
- //#region src/components/UI/ViewUserModal/ViewUserModal.jsx
852
- function R(e) {
853
- let { populated_user: t, hidePhoto: i, visibleItems: s, size: c, className: h, dangerousPopulate: y, user_id: b, buttonType: x, children: S, fakeMembership: C } = e, [w, T] = d(!1), [E, O] = d({}), [k, A] = d([]), [N, P] = d([]), [F, I] = d(null), [L, R] = d([]), [pe, me] = d([]), [he, ge] = d(!1), { data: z, isLoading: _e, mutate: ve } = fe(), [B, V] = d("Proposals Stance"), H = () => {
854
- T(!1);
855
- };
856
- u(() => {
857
- t && O({ ...t });
858
- }, []);
859
- let [ye, be] = d(!1), [U, xe] = d([]), [W, Se] = d([]), { data: G, isLoading: Ce, mutate: we } = j((b || t?._id) && (w || y) ? { user_id: b || t?._id } : null), { data: K, isLoading: Te, mutate: Ee } = j((!1)?._id && (w || y) ? { user_id: (!1)?._id } : null);
860
- u(() => {
861
- G && (console.log("publicUserData", G), O(G), A(G?.populated_public_layouts), P(G?.populated_public_donations), I(G?.populated_public_donations.total), me(G?.populated_public_proposals), xe(G?.populated_public_proposals_stance), R(G?.populated_public_news_submissions || []));
862
- }, [G]), u(() => {
863
- K && (console.log("personalUserData", K), Se(K?.populated_public_proposals_stance));
864
- }, [K]);
865
- let q = (t || E)?.articles_membership?.plan.replace(" ", "-").toLowerCase(), De = C?.replace(" ", "-").toLowerCase(), J = "https://articles.media/images/store/memberships/", Y = () => {
866
- let e = (t || E)?.articles_membership?.status == "Active";
867
- return /* @__PURE__ */ m("div", {
868
- style: c == "lg" ? { fontSize: "1.5rem" } : {},
869
- className: `view-user-modal-badge-wrap ${c == "lg" && "large"} ${h && h}`,
870
- children: [
871
- /* @__PURE__ */ m("span", {
872
- onClick: () => {
873
- T(!0);
874
- },
875
- className: "position-relative view-user-modal-badge d-flex justify-content-between align-items-center badge bg-articles badge-hover ",
876
- children: [
877
- (e || C) && /* @__PURE__ */ p("i", {
878
- className: `fad membership-badge ${De || q} fa-badge-check`,
879
- style: {
880
- position: "absolute",
881
- top: "-2px",
882
- left: "-2px",
883
- fontSize: "0.9rem",
884
- zIndex: 1
885
- }
886
- }),
887
- /* @__PURE__ */ m("div", {
888
- className: `d-flex align-items-center ${e && ""}`,
889
- children: [!i && /* @__PURE__ */ p("div", {
890
- className: c == "lg" ? "me-0" : "me-1",
891
- children: /* @__PURE__ */ p(D, {
892
- width: "15px",
893
- profile_photo: E.profile_photo
894
- })
895
- }), E.display_name || t?.display_name]
896
- }),
897
- /* @__PURE__ */ p("i", { className: "fad fa-plus-square me-0 ms-2" })
898
- ]
899
- }),
900
- s?.includes("Not Verified") && t?.verified?.status !== "Verified" && /* @__PURE__ */ p(_, {
901
- placement: "bottom",
902
- overlay: /* @__PURE__ */ p(v, {
903
- style: { pointerEvents: "none" },
904
- id: "button-tooltip",
905
- children: /* @__PURE__ */ p("div", {
906
- className: "",
907
- children: "User is not verified"
908
- })
909
- }),
910
- children: /* @__PURE__ */ m("span", {
911
- className: "verification-user-badge badge bg-danger d-flex align-items-center",
912
- children: [/* @__PURE__ */ p("i", {
913
- style: { paddingBottom: "2px" },
914
- className: "fas fa-robot me-1"
915
- }), /* @__PURE__ */ p("span", {
916
- className: "",
917
- children: "Unverified"
918
- })]
919
- })
920
- }),
921
- !1,
922
- s?.includes("Verification Status") && /* @__PURE__ */ p(_, {
923
- placement: "bottom",
924
- overlay: /* @__PURE__ */ p(v, {
925
- id: "button-tooltip",
926
- style: {
927
- pointerEvents: "none",
928
- transformX: "-20px"
929
- },
930
- children: t?.verified?.status == "Verified" ? "Verified" : " Not Verified"
931
- }),
932
- children: t?.verified?.status == "Verified" ? /* @__PURE__ */ p("span", {
933
- className: "verification-user-badge badge bg-success cursor-pointer",
934
- children: /* @__PURE__ */ p("i", { className: "fas fa-check me-0" })
935
- }) : /* @__PURE__ */ m("span", {
936
- className: "verification-user-badge badge bg-danger cursor-pointer",
937
- children: [/* @__PURE__ */ p("i", { className: "fas fa-robot me-1" }), /* @__PURE__ */ p("span", { children: "?" })]
938
- })
939
- }),
940
- s?.includes("Political Party") && /* @__PURE__ */ p("div", {
941
- className: "d-flex",
942
- children: (t || E)?.political?.party_id && /* @__PURE__ */ p(_, {
943
- placement: "bottom",
944
- overlay: /* @__PURE__ */ m(v, {
945
- id: "tooltip-bottom",
946
- style: { position: "fixed" },
947
- children: [/* @__PURE__ */ p("img", {
948
- width: "40px",
949
- height: "40px",
950
- style: {
951
- objectFit: "contain",
952
- padding: "0px",
953
- zIndex: "10",
954
- position: "relative"
955
- },
956
- loading: "lazy",
957
- src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == (t || E)?.political?.party_id)?.logo,
958
- alt: ""
959
- }), /* @__PURE__ */ p("span", {
960
- className: "ms-2",
961
- children: z?.find((e) => e._id == (t || E)?.political?.party_id)?.name
962
- })]
963
- }),
964
- children: /* @__PURE__ */ p("div", {
965
- className: "badge bg-light text-capitalize ms-0 h-100 d-flex justify-content-center align-items-center",
966
- style: {
967
- padding: "0 0.15rem",
968
- cursor: "pointer"
969
- },
970
- children: (t || E)?.political?.party_id && ((t || E)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ p("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ p("img", {
971
- width: "15px",
972
- height: "15px",
973
- style: {
974
- objectFit: "contain",
975
- padding: "0px"
976
- },
977
- loading: "lazy",
978
- src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == (t || E)?.political?.party_id)?.logo,
979
- alt: ""
980
- }))
981
- })
982
- })
983
- })
984
- ]
985
- });
986
- };
987
- function Oe(t) {
988
- switch (t) {
989
- case "Link": return /* @__PURE__ */ p("span", {
990
- type: "button",
991
- className: e.className,
992
- onClick: () => {
993
- T(!0);
994
- },
995
- children: S
996
- });
997
- default: return /* @__PURE__ */ p(Y, {});
998
- }
999
- }
1000
- let [X, Z] = d(!1), [Q, ke] = d({}), [Ae, je] = d({});
1001
- u(() => {
1002
- X && Object.keys(Q).length == 0 && console.log("adminUserData", K);
1003
- }, [X]);
1004
- let [Me, Ne] = d(null);
1005
- function Pe() {
1006
- alert("TODO");
1007
- }
1008
- let $ = ee(() => k?.filter((e) => e.user_layout)?.[0]?.url, [k]);
1009
- return /* @__PURE__ */ m(f, { children: [Oe(x), /* @__PURE__ */ m(g, {
1010
- show: w,
1011
- size: "lg",
1012
- id: "view-users-modal",
1013
- className: "view-users-modal articles-modal",
1014
- scrollable: !0,
1015
- onHide: H,
1016
- children: [
1017
- /* @__PURE__ */ p(g.Header, {
1018
- closeButton: !0,
1019
- children: /* @__PURE__ */ p("div", {
1020
- className: "w-100 d-flex justify-content-between align-items-center",
1021
- children: /* @__PURE__ */ p("h3", {
1022
- className: "mb-0",
1023
- children: "User Info"
1024
- })
1025
- })
1026
- }),
1027
- /* @__PURE__ */ p(g.Body, { children: /* @__PURE__ */ m("div", {
1028
- className: "main-panel",
1029
- children: [
1030
- /* @__PURE__ */ m("div", {
1031
- className: "d-flex",
1032
- children: [/* @__PURE__ */ m("div", {
1033
- className: "d-flex flex-column align-items-center",
1034
- style: { width: "100px" },
1035
- children: [
1036
- /* @__PURE__ */ p("div", {
1037
- type: "button",
1038
- onClick: () => {
1039
- Ne(`${process.env.NEXT_PUBLIC_CDN}${E?.profile_photo?.key}`);
1040
- },
1041
- children: /* @__PURE__ */ p(D, {
1042
- width: "100px",
1043
- profile_photo: E?.profile_photo
1044
- })
1045
- }),
1046
- /* @__PURE__ */ p(_, {
1047
- placement: "bottom",
1048
- overlay: /* @__PURE__ */ p(v, {
1049
- id: "tooltip-bottom",
1050
- children: "Joined Articles Media"
1051
- }),
1052
- children: /* @__PURE__ */ m("div", {
1053
- className: "badge bg-black border border-white shadow-sm rounded-0",
1054
- children: ["Joined ", E?.sign_up_date && a(new Date(E?.sign_up_date), "M/dd/yy")]
1055
- })
1056
- }),
1057
- $ && /* @__PURE__ */ p(r, {
1058
- href: `https://articles.media/layouts/${$}`,
1059
- className: "mt-2 w-100",
1060
- children: /* @__PURE__ */ m(n, {
1061
- className: "w-100",
1062
- style: {},
1063
- children: [/* @__PURE__ */ p("i", { className: "fad fa-home" }), /* @__PURE__ */ p("span", { children: "Layout" })]
1064
- })
1065
- }),
1066
- /* @__PURE__ */ p(M, {
1067
- className: "w-100",
1068
- children: /* @__PURE__ */ p(r, {
1069
- href: {
1070
- pathname: "https://articles.media/messages",
1071
- query: { startMsg: E?._id }
1072
- },
1073
- className: "mt-2 w-100",
1074
- children: /* @__PURE__ */ m(n, {
1075
- className: "w-100",
1076
- style: { fontSize: "0.88rem" },
1077
- children: [/* @__PURE__ */ p("i", { className: "fad fa-envelope" }), /* @__PURE__ */ p("span", { children: "Message" })]
1078
- })
1079
- })
1080
- }),
1081
- X && /* @__PURE__ */ m("div", {
1082
- className: "d-flex flex-column w-100 mt-2",
1083
- style: { maxWidth: "100px" },
1084
- children: [/* @__PURE__ */ p(n, {
1085
- variant: "warning",
1086
- small: !0,
1087
- className: "",
1088
- children: /* @__PURE__ */ p(Textfit, {
1089
- max: 14,
1090
- mode: "single",
1091
- children: "Remove Photo"
1092
- })
1093
- }), Q?.user?.profile_photo?.banned_uploads ? /* @__PURE__ */ p(n, {
1094
- variant: "warning",
1095
- small: !0,
1096
- className: "",
1097
- onClick: () => {
1098
- toggleBanCustomPhotoUpload();
1099
- },
1100
- children: /* @__PURE__ */ p(Textfit, {
1101
- max: 14,
1102
- mode: "single",
1103
- children: "Unban Uploads"
1104
- })
1105
- }) : /* @__PURE__ */ p(n, {
1106
- variant: "danger",
1107
- small: !0,
1108
- className: "",
1109
- onClick: () => {
1110
- toggleBanCustomPhotoUpload();
1111
- },
1112
- children: /* @__PURE__ */ p(Textfit, {
1113
- max: 14,
1114
- mode: "single",
1115
- children: "Ban Uploads"
1116
- })
1117
- })]
1118
- })
1119
- ]
1120
- }), /* @__PURE__ */ m("div", {
1121
- className: "mx-2",
1122
- children: [
1123
- /* @__PURE__ */ m("div", {
1124
- className: "d-flex align-items-center mb-1",
1125
- children: [/* @__PURE__ */ p("h5", {
1126
- className: "mb-0",
1127
- children: t?.display_name || E.display_name
1128
- }), /* @__PURE__ */ m("span", {
1129
- className: "ms-2",
1130
- children: [" @", E?.username]
1131
- })]
1132
- }),
1133
- E?.articles_membership?.status == "Active" && /* @__PURE__ */ p(_, {
1134
- placement: "bottom",
1135
- overlay: /* @__PURE__ */ p(v, {
1136
- id: "tooltip-bottom",
1137
- children: /* @__PURE__ */ m("div", {
1138
- className: "d-flex flex-column py-1",
1139
- children: [/* @__PURE__ */ m("div", {
1140
- className: "position-relative",
1141
- children: [
1142
- E?.articles_membership?.plan == "Supporter" && /* @__PURE__ */ p("img", {
1143
- src: `${J}supporter.jpg`,
1144
- width: 50,
1145
- height: 50,
1146
- alt: "Membership plan level"
1147
- }),
1148
- E?.articles_membership?.plan == "Premium Supporter" && /* @__PURE__ */ p("img", {
1149
- src: `${J}premiumSupporter.jpg`,
1150
- width: 50,
1151
- height: 50,
1152
- alt: "Membership plan level"
1153
- }),
1154
- E?.articles_membership?.plan == "Advocate" && /* @__PURE__ */ p("img", {
1155
- src: `${J}advocate.jpg`,
1156
- width: 50,
1157
- height: 50,
1158
- alt: "Membership plan level"
1159
- }),
1160
- /* @__PURE__ */ p("i", {
1161
- className: `fad membership-badge ${q} fa-badge-check me-1`,
1162
- style: {
1163
- position: "absolute",
1164
- top: "50%",
1165
- left: "50%",
1166
- transform: "translateX(-50%) translateY(-50%)",
1167
- fontSize: "1.5rem"
1168
- }
1169
- })
1170
- ]
1171
- }), /* @__PURE__ */ m("span", {
1172
- className: "lh-sm",
1173
- children: [/* @__PURE__ */ p("div", { children: E?.articles_membership?.plan }), /* @__PURE__ */ m("div", {
1174
- className: "small",
1175
- children: ["Since ", /* @__PURE__ */ p(o, {
1176
- format: "MM/dd/yy",
1177
- date: E?.articles_membership?.membership_started
1178
- })]
1179
- })]
1180
- })]
1181
- })
1182
- }),
1183
- children: /* @__PURE__ */ m("div", {
1184
- className: "badge bg-articles border me-1 mb-1",
1185
- style: { cursor: "pointer" },
1186
- children: [
1187
- /* @__PURE__ */ p("i", {
1188
- className: `fad membership-badge ${q} fa-badge-check me-1`,
1189
- style: {}
1190
- }),
1191
- /* @__PURE__ */ p("span", { children: E?.articles_membership?.plan }),
1192
- /* @__PURE__ */ p("span", {
1193
- className: "px-1",
1194
- children: "|"
1195
- }),
1196
- /* @__PURE__ */ p("span", {
1197
- className: "months fw-bold",
1198
- children: te(/* @__PURE__ */ new Date(), new Date(E?.articles_membership?.membership_started)) || 0
1199
- })
1200
- ]
1201
- })
1202
- }),
1203
- E?.address?.state && /* @__PURE__ */ p(_, {
1204
- placement: "bottom",
1205
- overlay: E.address?.state?.length == 2 ? /* @__PURE__ */ m(v, {
1206
- id: "tooltip-bottom",
1207
- children: ["From the state of ", convertRegion(E.address?.state, "name") ? convertRegion(E.address?.state, "name")[0] : ""]
1208
- }) : /* @__PURE__ */ m(v, {
1209
- id: "tooltip-bottom",
1210
- children: ["From the state of ", E.address?.state]
1211
- }),
1212
- children: /* @__PURE__ */ m("div", {
1213
- className: "badge bg-articles border me-1 mb-1",
1214
- children: [/* @__PURE__ */ p("i", { className: "fad fa-map-pin me-1" }), E.address?.state]
1215
- })
1216
- }),
1217
- E.verified?.status !== "Verified" && /* @__PURE__ */ p(_, {
1218
- placement: "bottom",
1219
- overlay: /* @__PURE__ */ p(v, {
1220
- id: "tooltip-bottom",
1221
- children: "User is not verified"
1222
- }),
1223
- children: /* @__PURE__ */ m("div", {
1224
- className: "badge bg-danger me-1 mb-1",
1225
- children: [/* @__PURE__ */ p("i", { className: "fad fa-robot me-1" }), "Unverified"]
1226
- })
1227
- }),
1228
- E.verified?.status == "Verified" && /* @__PURE__ */ p(_, {
1229
- placement: "bottom",
1230
- overlay: /* @__PURE__ */ m(v, {
1231
- id: "tooltip-bottom",
1232
- className: "",
1233
- children: [
1234
- /* @__PURE__ */ m("div", { children: [
1235
- "Verified by ",
1236
- E.verified?.verified_methods?.length,
1237
- " method",
1238
- E.verified?.verified_methods?.length > 1 && "s"
1239
- ] }),
1240
- /* @__PURE__ */ p("hr", {}),
1241
- /* @__PURE__ */ p("div", {
1242
- className: "pb-2",
1243
- children: E.verified?.verified_methods?.map((e, t) => Object.keys(e)?.length > 0 ? /* @__PURE__ */ p("div", {
1244
- className: "object",
1245
- children: e?.method_name
1246
- }, t) : /* @__PURE__ */ p("div", {
1247
- className: "single",
1248
- children: e
1249
- }, t))
1250
- })
1251
- ]
1252
- }),
1253
- children: /* @__PURE__ */ m("div", {
1254
- className: "badge bg-articles border me-1 mb-1",
1255
- children: [/* @__PURE__ */ p("i", { className: "fad fa-star me-1" }), E.verified?.status]
1256
- })
1257
- }),
1258
- E.political?.party_id && /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p(_, {
1259
- placement: "bottom",
1260
- overlay: /* @__PURE__ */ p(v, {
1261
- id: "tooltip-bottom",
1262
- children: /* @__PURE__ */ p("div", { children: "Users political party" })
1263
- }),
1264
- children: /* @__PURE__ */ p(r, {
1265
- href: `https://articles.media/politics/parties/${(t || E)?.political?.party_id}`,
1266
- children: /* @__PURE__ */ p("div", {
1267
- className: "badge bg-articles border text-capitalize me-1",
1268
- children: /* @__PURE__ */ m("div", {
1269
- className: "",
1270
- children: [(t || E)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ p("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ p("img", {
1271
- width: "14px",
1272
- height: "14px",
1273
- style: {
1274
- objectFit: "contain",
1275
- padding: "0px"
1276
- },
1277
- loading: "lazy",
1278
- src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == E?.political?.party_id)?.logo,
1279
- alt: ""
1280
- }), /* @__PURE__ */ p("span", {
1281
- className: "ms-1",
1282
- children: z?.find((e) => e._id == E.political?.party_id)?.name
1283
- })]
1284
- })
1285
- })
1286
- })
1287
- }) }),
1288
- /* @__PURE__ */ p("hr", {}),
1289
- /* @__PURE__ */ p("div", {
1290
- className: "small",
1291
- children: E?._id == "5e90cc96579a17440c5d7d52" && /* @__PURE__ */ p("span", { children: "Founder of Articles Media, thank you for using the site, feel free to message me with any questions, concerns or anything else." })
1292
- })
1293
- ]
1294
- })]
1295
- }),
1296
- /* @__PURE__ */ p("hr", {}),
1297
- X && /* @__PURE__ */ m("div", { children: [
1298
- /* @__PURE__ */ p("div", {
1299
- className: "d-flex align-items-center justify-content-between",
1300
- children: /* @__PURE__ */ p("div", {
1301
- className: "small",
1302
- children: "Admin Mode Toolbar"
1303
- })
1304
- }),
1305
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
1306
- className: "d-flex mb-2",
1307
- children: [
1308
- /* @__PURE__ */ p(n, {
1309
- small: !0,
1310
- variant: "warning",
1311
- className: "",
1312
- onClick: () => {
1313
- loadAdminUserData();
1314
- },
1315
- children: /* @__PURE__ */ p("i", { className: "fad fa-redo me-0" })
1316
- }),
1317
- /* @__PURE__ */ p(n, {
1318
- active: X?.edit,
1319
- small: !0,
1320
- className: "",
1321
- onClick: () => {
1322
- Z({
1323
- ...X,
1324
- edit: !X?.edit
1325
- });
1326
- },
1327
- children: "Edit Mode"
1328
- }),
1329
- X?.edit && /* @__PURE__ */ p(n, {
1330
- small: !0,
1331
- variant: "success",
1332
- className: "me-0",
1333
- onClick: () => {
1334
- Pe();
1335
- },
1336
- children: /* @__PURE__ */ p("i", { className: "fad fa-save me-0" })
1337
- })
1338
- ]
1339
- }), [
1340
- "User Details",
1341
- "Verification",
1342
- "Moderation",
1343
- "Bans",
1344
- "Stripe",
1345
- "Layouts",
1346
- "Reset Password",
1347
- "Sessions"
1348
- ].map((e) => /* @__PURE__ */ p(n, {
1349
- active: e == X?.tab,
1350
- small: !0,
1351
- onClick: () => {
1352
- Z({
1353
- ...X,
1354
- tab: e
1355
- });
1356
- },
1357
- children: e
1358
- }, e))] }),
1359
- /* @__PURE__ */ p("hr", {})
1360
- ] }),
1361
- /* @__PURE__ */ m("div", {
1362
- className: "pe-3 pb-3",
1363
- children: [
1364
- /* @__PURE__ */ p("div", {
1365
- className: "mb-2 me-2",
1366
- children: [
1367
- {
1368
- name: "Proposals Stance",
1369
- badge: /* @__PURE__ */ p("span", {
1370
- className: "badge bg-black ms-1",
1371
- children: /* @__PURE__ */ m("div", {
1372
- className: "small",
1373
- children: [
1374
- /* @__PURE__ */ p("span", { children: W?.fundamental?.filter((e) => W?.user_sentiments?.find((t) => t.proposal_id == e._id) ? e : null).length }),
1375
- /* @__PURE__ */ p("span", {
1376
- className: "px-1",
1377
- children: "/"
1378
- }),
1379
- /* @__PURE__ */ p("span", { children: W?.fundamental?.length })
1380
- ]
1381
- })
1382
- })
1383
- },
1384
- {
1385
- name: "Proposal Sentiments",
1386
- badge: /* @__PURE__ */ p("span", {
1387
- className: "badge bg-black ms-1",
1388
- children: E?.populated_public_proposals_stance?.user_sentiments_count || 0
1389
- })
1390
- },
1391
- {
1392
- name: "Proposal Comments",
1393
- badge: /* @__PURE__ */ p("span", {
1394
- className: "badge bg-black ms-1",
1395
- children: E?.populated_public_proposals_stance?.user_comments_count || 0
1396
- })
1397
- },
1398
- {
1399
- name: "Proposal Submissions",
1400
- badge: /* @__PURE__ */ p("span", {
1401
- className: "badge bg-black ms-1",
1402
- children: pe?.length || 0
1403
- })
1404
- },
1405
- {
1406
- name: "News Comments",
1407
- badge: /* @__PURE__ */ p("span", {
1408
- className: "badge bg-black ms-1",
1409
- children: E?.populated_news_comments_count || 0
1410
- })
1411
- },
1412
- {
1413
- name: "News Submissions",
1414
- badge: /* @__PURE__ */ p("span", {
1415
- className: "badge bg-black ms-1",
1416
- children: L?.length || 0
1417
- })
1418
- },
1419
- {
1420
- name: "Verifications",
1421
- badge: /* @__PURE__ */ p("span", {
1422
- className: "badge bg-black ms-1",
1423
- children: E.verified?.verified_methods?.length || 0
1424
- })
1425
- },
1426
- {
1427
- name: "Layouts",
1428
- badge: /* @__PURE__ */ p("span", {
1429
- className: "badge bg-black ms-1",
1430
- children: k?.length || 0
1431
- })
1432
- },
1433
- {
1434
- name: "Donations",
1435
- badge: /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("span", {
1436
- className: "badge bg-primary ms-1",
1437
- children: G?.populated_public_donations?.count || 0
1438
- }), /* @__PURE__ */ m("span", {
1439
- className: "badge bg-black",
1440
- children: ["$", l((G?.populated_public_donations.total / 100).toFixed(2))]
1441
- })] })
1442
- },
1443
- {
1444
- name: "Orders",
1445
- badge: /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("span", {
1446
- className: "badge bg-primary ms-1",
1447
- children: "0"
1448
- }), /* @__PURE__ */ p("span", {
1449
- className: "badge bg-black",
1450
- children: "0"
1451
- })] })
1452
- },
1453
- {
1454
- name: "Achievements",
1455
- dev: !0,
1456
- badge: /* @__PURE__ */ p("span", {
1457
- className: "badge bg-black ms-1",
1458
- children: "0"
1459
- })
1460
- }
1461
- ].map((e) => (e.name, e.name, e.badge, e.name, e.dev ? /* @__PURE__ */ p(M, {
1462
- inline: !0,
1463
- children: /* @__PURE__ */ m(n, {
1464
- onClick: () => V(e.name),
1465
- active: e.name == B,
1466
- small: !0,
1467
- children: [e.name, e.badge]
1468
- }, e.name)
1469
- }, e.name) : /* @__PURE__ */ m(n, {
1470
- onClick: () => V(e.name),
1471
- active: e.name == B,
1472
- small: !0,
1473
- children: [e.name, e.badge]
1474
- }, e.name)))
1475
- }),
1476
- B == "Proposals Stance" && /* @__PURE__ */ p(ne, {
1477
- activeLayoutProposalSentiments: U,
1478
- populated_user: t,
1479
- usersProposalSentiments: W,
1480
- setShowFullStanceDetails: be,
1481
- showFullStanceDetails: ye,
1482
- userData: E
1483
- }),
1484
- B == "Proposal Comments" && /* @__PURE__ */ p(re, { activeLayoutProposalSentiments: U }),
1485
- B == "Proposal Sentiments" && /* @__PURE__ */ p(ie, { activeLayoutProposalSentiments: U }),
1486
- B == "Proposal Submissions" && /* @__PURE__ */ p(ae, { userProposalsSubmitted: G?.populated_public_proposals }),
1487
- B == "News Comments" && /* @__PURE__ */ p(oe, { publicUserData: G }),
1488
- B == "News Submissions" && /* @__PURE__ */ p(se, {
1489
- publicUserData: G,
1490
- userNewsSubmitted: G?.populated_public_news_submissions
1491
- }),
1492
- B == "Donations" && /* @__PURE__ */ p(ce, {
1493
- publicUserData: G,
1494
- userDonations: G?.populated_public_donations,
1495
- lifetimeContribution: F
1496
- }),
1497
- B == "Layouts" && /* @__PURE__ */ p(le, {
1498
- publicUserData: G,
1499
- userLayoutsData: G?.populated_public_layouts
1500
- }),
1501
- B == "Verifications" && /* @__PURE__ */ p(ue, {
1502
- publicUserData: G,
1503
- userData: E
1504
- }),
1505
- B == "Achievements" && /* @__PURE__ */ p(de, { publicUserData: G })
1506
- ]
1507
- })
1508
- ]
1509
- }) }),
1510
- /* @__PURE__ */ m(g.Footer, {
1511
- className: "justify-content-between",
1512
- children: [(!1)?._id == "5e90cc96579a17440c5d7d52" ? /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ m(M, {
1513
- inline: !0,
1514
- className: "me-2",
1515
- children: [/* @__PURE__ */ m(n, {
1516
- onClick: () => {
1517
- Z(X ? !1 : { tab: "" });
1518
- },
1519
- small: !0,
1520
- active: X,
1521
- variant: "",
1522
- className: "me-1",
1523
- children: [/* @__PURE__ */ p("i", { className: "fad fa-pen" }), /* @__PURE__ */ p("span", { children: "Admin Mode" })]
1524
- }), /* @__PURE__ */ p(n, {
1525
- onClick: () => {
1526
- we(), Ee();
1527
- },
1528
- small: !0,
1529
- variant: "warning",
1530
- className: "",
1531
- children: /* @__PURE__ */ p("i", { className: "fad fa-redo me-0" })
1532
- })]
1533
- }), /* @__PURE__ */ p("span", {
1534
- style: { fontSize: "0.8rem" },
1535
- children: E?._id
1536
- })] }) : /* @__PURE__ */ p("span", {}), /* @__PURE__ */ p("div", {
1537
- className: "justify-content-",
1538
- children: /* @__PURE__ */ p(n, {
1539
- variant: "articles",
1540
- onClick: H,
1541
- children: "Close"
1542
- })
1543
- })]
1544
- })
1545
- ]
1546
- })] });
1547
- }
1548
- //#endregion
1549
- export { R as t };