@articles-media/articles-dev-box 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Ad-BAvmOFcq.js +503 -0
- package/dist/Ad.js +1 -1
- package/dist/AdConfirmExitModal-BNFKKayL.js +55 -0
- package/dist/AdDetailsModal-Cv1ll9G-.js +107 -0
- package/dist/ArticlesAd.js +7 -8
- package/dist/{Button-BlAdEbSd.js → Button-CU11ETla.js} +9 -9
- package/dist/CreditsModal.js +23 -24
- package/dist/DarkModeHandler.js +11 -12
- package/dist/FriendsList.js +40 -41
- package/dist/{GameScoreboard-CBY3JsFa.js → GameScoreboard-Dj5mTFTn.js} +48 -49
- package/dist/GameScoreboard.js +1 -1
- package/dist/GlobalBody.js +20 -20
- package/dist/GlobalHead.js +2 -3
- package/dist/Link-8nSDV4sI.js +16 -0
- package/dist/ReturnToLauncherButton.js +17 -18
- package/dist/SettingsModal-tXcbd23J.js +246 -0
- package/dist/SettingsModal.js +1 -1
- package/dist/StatusModal-CBzdZdAm.js +69 -0
- package/dist/ViewUserModal-C_gWUvXi.js +1544 -0
- package/dist/ViewUserModal.js +1 -1
- package/dist/{classnames-DP6dWde5.js → classnames-CpG5mzJ5.js} +12 -4
- package/dist/index.js +4 -4
- package/dist/numberWithCommas-rN3cZDJL.js +1170 -0
- package/package.json +18 -66
- package/dist/Ad-Ck5UdTq3.js +0 -387
- package/dist/Ad-DYtftKNV.cjs +0 -1
- package/dist/Ad.cjs +0 -1
- package/dist/AdConfirmExitModal-CJ-HtcVC.js +0 -56
- package/dist/AdConfirmExitModal-CRCnzYQM.cjs +0 -1
- package/dist/AdDetailsModal-DRNRTL2W.js +0 -108
- package/dist/AdDetailsModal-g0n7LiV6.cjs +0 -1
- package/dist/ArticlesAd.cjs +0 -1
- package/dist/Button-CbpRj01E.cjs +0 -1
- package/dist/CreditsModal.cjs +0 -1
- package/dist/DarkModeHandler.cjs +0 -1
- package/dist/FriendsList.cjs +0 -1
- package/dist/GameScoreboard-DdOCRxON.cjs +0 -1
- package/dist/GameScoreboard.cjs +0 -1
- package/dist/GlobalBody.cjs +0 -33
- package/dist/GlobalHead.cjs +0 -1
- package/dist/Link-MFZblBb4.js +0 -17
- package/dist/Link-c7exNCJ3.cjs +0 -1
- package/dist/Modal-BX1s6CCU.js +0 -1631
- package/dist/Modal-DP9CeAVD.cjs +0 -3
- package/dist/ReturnToLauncherButton.cjs +0 -1
- package/dist/SettingsModal--sWLmLGp.cjs +0 -1
- package/dist/SettingsModal-XI2dMI09.js +0 -247
- package/dist/SettingsModal.cjs +0 -1
- package/dist/StatusModal-D7WDDR9P.cjs +0 -1
- package/dist/StatusModal-elrPJvX1.js +0 -70
- package/dist/ViewUserModal-DDjWLpyM.js +0 -3094
- package/dist/ViewUserModal-DPVcjXNU.cjs +0 -1
- package/dist/ViewUserModal.cjs +0 -1
- package/dist/chunk-350yNsax.cjs +0 -1
- package/dist/classnames-pS64X3rL.cjs +0 -1
- package/dist/index.cjs +0 -1
- package/dist/jsx-runtime-VZk6y-ec.js +0 -191
- package/dist/jsx-runtime-hCcDh67y.cjs +0 -6
- package/dist/numberWithCommas-BSKBdR-e.js +0 -18
- package/dist/numberWithCommas-D9tgiUnq.cjs +0 -1
- package/dist/useAuthSiteStatus-P5kHc_Bz.cjs +0 -1
- package/dist/useFullscreen.cjs +0 -1
- package/dist/useUserDetails.cjs +0 -1
- package/dist/useUserFriends.cjs +0 -1
- package/dist/useUserToken.cjs +0 -1
- /package/dist/{useAuthSiteStatus-1rHjYC4N.js → useAuthSiteStatus-Cj9IjMj7.js} +0 -0
|
@@ -0,0 +1,1544 @@
|
|
|
1
|
+
import { n as e, t } from "./classnames-CpG5mzJ5.js";
|
|
2
|
+
import { t as n } from "./Button-CU11ETla.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-rN3cZDJL.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());
|
|
833
|
+
c(60), c(60);
|
|
834
|
+
var fe = (e) => {
|
|
835
|
+
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 ? {
|
|
836
|
+
dedupingInterval: 1e3 * 60 * 10,
|
|
837
|
+
fallbackData: e?.preload
|
|
838
|
+
} : { dedupingInterval: 1e3 * 60 * 10 });
|
|
839
|
+
return {
|
|
840
|
+
data: t,
|
|
841
|
+
error: n,
|
|
842
|
+
isLoading: r,
|
|
843
|
+
mutate: i
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region src/components/UI/ViewUserModal/ViewUserModal.jsx
|
|
848
|
+
function R(e) {
|
|
849
|
+
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 = () => {
|
|
850
|
+
T(!1);
|
|
851
|
+
};
|
|
852
|
+
u(() => {
|
|
853
|
+
t && O({ ...t });
|
|
854
|
+
}, []);
|
|
855
|
+
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);
|
|
856
|
+
u(() => {
|
|
857
|
+
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 || []));
|
|
858
|
+
}, [G]), u(() => {
|
|
859
|
+
K && (console.log("personalUserData", K), Se(K?.populated_public_proposals_stance));
|
|
860
|
+
}, [K]);
|
|
861
|
+
let q = (t || E)?.articles_membership?.plan.replace(" ", "-").toLowerCase(), De = C?.replace(" ", "-").toLowerCase(), J = "https://articles.media/images/store/memberships/", Y = () => {
|
|
862
|
+
let e = (t || E)?.articles_membership?.status == "Active";
|
|
863
|
+
return /* @__PURE__ */ m("div", {
|
|
864
|
+
style: c == "lg" ? { fontSize: "1.5rem" } : {},
|
|
865
|
+
className: `view-user-modal-badge-wrap ${c == "lg" && "large"} ${h && h}`,
|
|
866
|
+
children: [
|
|
867
|
+
/* @__PURE__ */ m("span", {
|
|
868
|
+
onClick: () => {
|
|
869
|
+
T(!0);
|
|
870
|
+
},
|
|
871
|
+
className: "position-relative view-user-modal-badge d-flex justify-content-between align-items-center badge bg-articles badge-hover ",
|
|
872
|
+
children: [
|
|
873
|
+
(e || C) && /* @__PURE__ */ p("i", {
|
|
874
|
+
className: `fad membership-badge ${De || q} fa-badge-check`,
|
|
875
|
+
style: {
|
|
876
|
+
position: "absolute",
|
|
877
|
+
top: "-2px",
|
|
878
|
+
left: "-2px",
|
|
879
|
+
fontSize: "0.9rem",
|
|
880
|
+
zIndex: 1
|
|
881
|
+
}
|
|
882
|
+
}),
|
|
883
|
+
/* @__PURE__ */ m("div", {
|
|
884
|
+
className: `d-flex align-items-center ${e && ""}`,
|
|
885
|
+
children: [!i && /* @__PURE__ */ p("div", {
|
|
886
|
+
className: c == "lg" ? "me-0" : "me-1",
|
|
887
|
+
children: /* @__PURE__ */ p(D, {
|
|
888
|
+
width: "15px",
|
|
889
|
+
profile_photo: E.profile_photo
|
|
890
|
+
})
|
|
891
|
+
}), E.display_name || t?.display_name]
|
|
892
|
+
}),
|
|
893
|
+
/* @__PURE__ */ p("i", { className: "fad fa-plus-square me-0 ms-2" })
|
|
894
|
+
]
|
|
895
|
+
}),
|
|
896
|
+
s?.includes("Not Verified") && t?.verified?.status !== "Verified" && /* @__PURE__ */ p(_, {
|
|
897
|
+
placement: "bottom",
|
|
898
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
899
|
+
style: { pointerEvents: "none" },
|
|
900
|
+
id: "button-tooltip",
|
|
901
|
+
children: /* @__PURE__ */ p("div", {
|
|
902
|
+
className: "",
|
|
903
|
+
children: "User is not verified"
|
|
904
|
+
})
|
|
905
|
+
}),
|
|
906
|
+
children: /* @__PURE__ */ m("span", {
|
|
907
|
+
className: "verification-user-badge badge bg-danger d-flex align-items-center",
|
|
908
|
+
children: [/* @__PURE__ */ p("i", {
|
|
909
|
+
style: { paddingBottom: "2px" },
|
|
910
|
+
className: "fas fa-robot me-1"
|
|
911
|
+
}), /* @__PURE__ */ p("span", {
|
|
912
|
+
className: "",
|
|
913
|
+
children: "Unverified"
|
|
914
|
+
})]
|
|
915
|
+
})
|
|
916
|
+
}),
|
|
917
|
+
!1,
|
|
918
|
+
s?.includes("Verification Status") && /* @__PURE__ */ p(_, {
|
|
919
|
+
placement: "bottom",
|
|
920
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
921
|
+
id: "button-tooltip",
|
|
922
|
+
style: {
|
|
923
|
+
pointerEvents: "none",
|
|
924
|
+
transformX: "-20px"
|
|
925
|
+
},
|
|
926
|
+
children: t?.verified?.status == "Verified" ? "Verified" : " Not Verified"
|
|
927
|
+
}),
|
|
928
|
+
children: t?.verified?.status == "Verified" ? /* @__PURE__ */ p("span", {
|
|
929
|
+
className: "verification-user-badge badge bg-success cursor-pointer",
|
|
930
|
+
children: /* @__PURE__ */ p("i", { className: "fas fa-check me-0" })
|
|
931
|
+
}) : /* @__PURE__ */ m("span", {
|
|
932
|
+
className: "verification-user-badge badge bg-danger cursor-pointer",
|
|
933
|
+
children: [/* @__PURE__ */ p("i", { className: "fas fa-robot me-1" }), /* @__PURE__ */ p("span", { children: "?" })]
|
|
934
|
+
})
|
|
935
|
+
}),
|
|
936
|
+
s?.includes("Political Party") && /* @__PURE__ */ p("div", {
|
|
937
|
+
className: "d-flex",
|
|
938
|
+
children: (t || E)?.political?.party_id && /* @__PURE__ */ p(_, {
|
|
939
|
+
placement: "bottom",
|
|
940
|
+
overlay: /* @__PURE__ */ m(v, {
|
|
941
|
+
id: "tooltip-bottom",
|
|
942
|
+
style: { position: "fixed" },
|
|
943
|
+
children: [/* @__PURE__ */ p("img", {
|
|
944
|
+
width: "40px",
|
|
945
|
+
height: "40px",
|
|
946
|
+
style: {
|
|
947
|
+
objectFit: "contain",
|
|
948
|
+
padding: "0px",
|
|
949
|
+
zIndex: "10",
|
|
950
|
+
position: "relative"
|
|
951
|
+
},
|
|
952
|
+
loading: "lazy",
|
|
953
|
+
src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == (t || E)?.political?.party_id)?.logo,
|
|
954
|
+
alt: ""
|
|
955
|
+
}), /* @__PURE__ */ p("span", {
|
|
956
|
+
className: "ms-2",
|
|
957
|
+
children: z?.find((e) => e._id == (t || E)?.political?.party_id)?.name
|
|
958
|
+
})]
|
|
959
|
+
}),
|
|
960
|
+
children: /* @__PURE__ */ p("div", {
|
|
961
|
+
className: "badge bg-light text-capitalize ms-0 h-100 d-flex justify-content-center align-items-center",
|
|
962
|
+
style: {
|
|
963
|
+
padding: "0 0.15rem",
|
|
964
|
+
cursor: "pointer"
|
|
965
|
+
},
|
|
966
|
+
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", {
|
|
967
|
+
width: "15px",
|
|
968
|
+
height: "15px",
|
|
969
|
+
style: {
|
|
970
|
+
objectFit: "contain",
|
|
971
|
+
padding: "0px"
|
|
972
|
+
},
|
|
973
|
+
loading: "lazy",
|
|
974
|
+
src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == (t || E)?.political?.party_id)?.logo,
|
|
975
|
+
alt: ""
|
|
976
|
+
}))
|
|
977
|
+
})
|
|
978
|
+
})
|
|
979
|
+
})
|
|
980
|
+
]
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
function Oe(e) {
|
|
984
|
+
switch (e) {
|
|
985
|
+
case "Link": return /* @__PURE__ */ p("span", {
|
|
986
|
+
type: "button",
|
|
987
|
+
onClick: () => {
|
|
988
|
+
T(!0);
|
|
989
|
+
},
|
|
990
|
+
children: S
|
|
991
|
+
});
|
|
992
|
+
default: return /* @__PURE__ */ p(Y, {});
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
let [X, Z] = d(!1), [Q, ke] = d({}), [Ae, je] = d({});
|
|
996
|
+
u(() => {
|
|
997
|
+
X && Object.keys(Q).length == 0 && console.log("adminUserData", K);
|
|
998
|
+
}, [X]);
|
|
999
|
+
let [Me, Ne] = d(null);
|
|
1000
|
+
function Pe() {
|
|
1001
|
+
alert("TODO");
|
|
1002
|
+
}
|
|
1003
|
+
let $ = ee(() => k?.filter((e) => e.user_layout)?.[0]?.url, [k]);
|
|
1004
|
+
return /* @__PURE__ */ m(f, { children: [Oe(x), /* @__PURE__ */ m(g, {
|
|
1005
|
+
show: w,
|
|
1006
|
+
size: "lg",
|
|
1007
|
+
id: "view-users-modal",
|
|
1008
|
+
className: "view-users-modal articles-modal",
|
|
1009
|
+
scrollable: !0,
|
|
1010
|
+
onHide: H,
|
|
1011
|
+
children: [
|
|
1012
|
+
/* @__PURE__ */ p(g.Header, {
|
|
1013
|
+
closeButton: !0,
|
|
1014
|
+
children: /* @__PURE__ */ p("div", {
|
|
1015
|
+
className: "w-100 d-flex justify-content-between align-items-center",
|
|
1016
|
+
children: /* @__PURE__ */ p("h3", {
|
|
1017
|
+
className: "mb-0",
|
|
1018
|
+
children: "User Info"
|
|
1019
|
+
})
|
|
1020
|
+
})
|
|
1021
|
+
}),
|
|
1022
|
+
/* @__PURE__ */ p(g.Body, { children: /* @__PURE__ */ m("div", {
|
|
1023
|
+
className: "main-panel",
|
|
1024
|
+
children: [
|
|
1025
|
+
/* @__PURE__ */ m("div", {
|
|
1026
|
+
className: "d-flex",
|
|
1027
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1028
|
+
className: "d-flex flex-column align-items-center",
|
|
1029
|
+
style: { width: "100px" },
|
|
1030
|
+
children: [
|
|
1031
|
+
/* @__PURE__ */ p("div", {
|
|
1032
|
+
type: "button",
|
|
1033
|
+
onClick: () => {
|
|
1034
|
+
Ne(`${process.env.NEXT_PUBLIC_CDN}${E?.profile_photo?.key}`);
|
|
1035
|
+
},
|
|
1036
|
+
children: /* @__PURE__ */ p(D, {
|
|
1037
|
+
width: "100px",
|
|
1038
|
+
profile_photo: E?.profile_photo
|
|
1039
|
+
})
|
|
1040
|
+
}),
|
|
1041
|
+
/* @__PURE__ */ p(_, {
|
|
1042
|
+
placement: "bottom",
|
|
1043
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
1044
|
+
id: "tooltip-bottom",
|
|
1045
|
+
children: "Joined Articles Media"
|
|
1046
|
+
}),
|
|
1047
|
+
children: /* @__PURE__ */ m("div", {
|
|
1048
|
+
className: "badge bg-black border border-white shadow-sm rounded-0",
|
|
1049
|
+
children: ["Joined ", E?.sign_up_date && a(new Date(E?.sign_up_date), "M/dd/yy")]
|
|
1050
|
+
})
|
|
1051
|
+
}),
|
|
1052
|
+
$ && /* @__PURE__ */ p(r, {
|
|
1053
|
+
href: `https://articles.media/layouts/${$}`,
|
|
1054
|
+
className: "mt-2 w-100",
|
|
1055
|
+
children: /* @__PURE__ */ m(n, {
|
|
1056
|
+
className: "w-100",
|
|
1057
|
+
style: {},
|
|
1058
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-home" }), /* @__PURE__ */ p("span", { children: "Layout" })]
|
|
1059
|
+
})
|
|
1060
|
+
}),
|
|
1061
|
+
/* @__PURE__ */ p(M, {
|
|
1062
|
+
className: "w-100",
|
|
1063
|
+
children: /* @__PURE__ */ p(r, {
|
|
1064
|
+
href: {
|
|
1065
|
+
pathname: "https://articles.media/messages",
|
|
1066
|
+
query: { startMsg: E?._id }
|
|
1067
|
+
},
|
|
1068
|
+
className: "mt-2 w-100",
|
|
1069
|
+
children: /* @__PURE__ */ m(n, {
|
|
1070
|
+
className: "w-100",
|
|
1071
|
+
style: { fontSize: "0.88rem" },
|
|
1072
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-envelope" }), /* @__PURE__ */ p("span", { children: "Message" })]
|
|
1073
|
+
})
|
|
1074
|
+
})
|
|
1075
|
+
}),
|
|
1076
|
+
X && /* @__PURE__ */ m("div", {
|
|
1077
|
+
className: "d-flex flex-column w-100 mt-2",
|
|
1078
|
+
style: { maxWidth: "100px" },
|
|
1079
|
+
children: [/* @__PURE__ */ p(n, {
|
|
1080
|
+
variant: "warning",
|
|
1081
|
+
small: !0,
|
|
1082
|
+
className: "",
|
|
1083
|
+
children: /* @__PURE__ */ p(Textfit, {
|
|
1084
|
+
max: 14,
|
|
1085
|
+
mode: "single",
|
|
1086
|
+
children: "Remove Photo"
|
|
1087
|
+
})
|
|
1088
|
+
}), Q?.user?.profile_photo?.banned_uploads ? /* @__PURE__ */ p(n, {
|
|
1089
|
+
variant: "warning",
|
|
1090
|
+
small: !0,
|
|
1091
|
+
className: "",
|
|
1092
|
+
onClick: () => {
|
|
1093
|
+
toggleBanCustomPhotoUpload();
|
|
1094
|
+
},
|
|
1095
|
+
children: /* @__PURE__ */ p(Textfit, {
|
|
1096
|
+
max: 14,
|
|
1097
|
+
mode: "single",
|
|
1098
|
+
children: "Unban Uploads"
|
|
1099
|
+
})
|
|
1100
|
+
}) : /* @__PURE__ */ p(n, {
|
|
1101
|
+
variant: "danger",
|
|
1102
|
+
small: !0,
|
|
1103
|
+
className: "",
|
|
1104
|
+
onClick: () => {
|
|
1105
|
+
toggleBanCustomPhotoUpload();
|
|
1106
|
+
},
|
|
1107
|
+
children: /* @__PURE__ */ p(Textfit, {
|
|
1108
|
+
max: 14,
|
|
1109
|
+
mode: "single",
|
|
1110
|
+
children: "Ban Uploads"
|
|
1111
|
+
})
|
|
1112
|
+
})]
|
|
1113
|
+
})
|
|
1114
|
+
]
|
|
1115
|
+
}), /* @__PURE__ */ m("div", {
|
|
1116
|
+
className: "mx-2",
|
|
1117
|
+
children: [
|
|
1118
|
+
/* @__PURE__ */ m("div", {
|
|
1119
|
+
className: "d-flex align-items-center mb-1",
|
|
1120
|
+
children: [/* @__PURE__ */ p("h5", {
|
|
1121
|
+
className: "mb-0",
|
|
1122
|
+
children: t?.display_name || E.display_name
|
|
1123
|
+
}), /* @__PURE__ */ m("span", {
|
|
1124
|
+
className: "ms-2",
|
|
1125
|
+
children: [" @", E?.username]
|
|
1126
|
+
})]
|
|
1127
|
+
}),
|
|
1128
|
+
E?.articles_membership?.status == "Active" && /* @__PURE__ */ p(_, {
|
|
1129
|
+
placement: "bottom",
|
|
1130
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
1131
|
+
id: "tooltip-bottom",
|
|
1132
|
+
children: /* @__PURE__ */ m("div", {
|
|
1133
|
+
className: "d-flex flex-column py-1",
|
|
1134
|
+
children: [/* @__PURE__ */ m("div", {
|
|
1135
|
+
className: "position-relative",
|
|
1136
|
+
children: [
|
|
1137
|
+
E?.articles_membership?.plan == "Supporter" && /* @__PURE__ */ p("img", {
|
|
1138
|
+
src: `${J}supporter.jpg`,
|
|
1139
|
+
width: 50,
|
|
1140
|
+
height: 50,
|
|
1141
|
+
alt: "Membership plan level"
|
|
1142
|
+
}),
|
|
1143
|
+
E?.articles_membership?.plan == "Premium Supporter" && /* @__PURE__ */ p("img", {
|
|
1144
|
+
src: `${J}premiumSupporter.jpg`,
|
|
1145
|
+
width: 50,
|
|
1146
|
+
height: 50,
|
|
1147
|
+
alt: "Membership plan level"
|
|
1148
|
+
}),
|
|
1149
|
+
E?.articles_membership?.plan == "Advocate" && /* @__PURE__ */ p("img", {
|
|
1150
|
+
src: `${J}advocate.jpg`,
|
|
1151
|
+
width: 50,
|
|
1152
|
+
height: 50,
|
|
1153
|
+
alt: "Membership plan level"
|
|
1154
|
+
}),
|
|
1155
|
+
/* @__PURE__ */ p("i", {
|
|
1156
|
+
className: `fad membership-badge ${q} fa-badge-check me-1`,
|
|
1157
|
+
style: {
|
|
1158
|
+
position: "absolute",
|
|
1159
|
+
top: "50%",
|
|
1160
|
+
left: "50%",
|
|
1161
|
+
transform: "translateX(-50%) translateY(-50%)",
|
|
1162
|
+
fontSize: "1.5rem"
|
|
1163
|
+
}
|
|
1164
|
+
})
|
|
1165
|
+
]
|
|
1166
|
+
}), /* @__PURE__ */ m("span", {
|
|
1167
|
+
className: "lh-sm",
|
|
1168
|
+
children: [/* @__PURE__ */ p("div", { children: E?.articles_membership?.plan }), /* @__PURE__ */ m("div", {
|
|
1169
|
+
className: "small",
|
|
1170
|
+
children: ["Since ", /* @__PURE__ */ p(o, {
|
|
1171
|
+
format: "MM/dd/yy",
|
|
1172
|
+
date: E?.articles_membership?.membership_started
|
|
1173
|
+
})]
|
|
1174
|
+
})]
|
|
1175
|
+
})]
|
|
1176
|
+
})
|
|
1177
|
+
}),
|
|
1178
|
+
children: /* @__PURE__ */ m("div", {
|
|
1179
|
+
className: "badge bg-articles border me-1 mb-1",
|
|
1180
|
+
style: { cursor: "pointer" },
|
|
1181
|
+
children: [
|
|
1182
|
+
/* @__PURE__ */ p("i", {
|
|
1183
|
+
className: `fad membership-badge ${q} fa-badge-check me-1`,
|
|
1184
|
+
style: {}
|
|
1185
|
+
}),
|
|
1186
|
+
/* @__PURE__ */ p("span", { children: E?.articles_membership?.plan }),
|
|
1187
|
+
/* @__PURE__ */ p("span", {
|
|
1188
|
+
className: "px-1",
|
|
1189
|
+
children: "|"
|
|
1190
|
+
}),
|
|
1191
|
+
/* @__PURE__ */ p("span", {
|
|
1192
|
+
className: "months fw-bold",
|
|
1193
|
+
children: te(/* @__PURE__ */ new Date(), new Date(E?.articles_membership?.membership_started)) || 0
|
|
1194
|
+
})
|
|
1195
|
+
]
|
|
1196
|
+
})
|
|
1197
|
+
}),
|
|
1198
|
+
E?.address?.state && /* @__PURE__ */ p(_, {
|
|
1199
|
+
placement: "bottom",
|
|
1200
|
+
overlay: E.address?.state?.length == 2 ? /* @__PURE__ */ m(v, {
|
|
1201
|
+
id: "tooltip-bottom",
|
|
1202
|
+
children: ["From the state of ", convertRegion(E.address?.state, "name") ? convertRegion(E.address?.state, "name")[0] : ""]
|
|
1203
|
+
}) : /* @__PURE__ */ m(v, {
|
|
1204
|
+
id: "tooltip-bottom",
|
|
1205
|
+
children: ["From the state of ", E.address?.state]
|
|
1206
|
+
}),
|
|
1207
|
+
children: /* @__PURE__ */ m("div", {
|
|
1208
|
+
className: "badge bg-articles border me-1 mb-1",
|
|
1209
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-map-pin me-1" }), E.address?.state]
|
|
1210
|
+
})
|
|
1211
|
+
}),
|
|
1212
|
+
E.verified?.status !== "Verified" && /* @__PURE__ */ p(_, {
|
|
1213
|
+
placement: "bottom",
|
|
1214
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
1215
|
+
id: "tooltip-bottom",
|
|
1216
|
+
children: "User is not verified"
|
|
1217
|
+
}),
|
|
1218
|
+
children: /* @__PURE__ */ m("div", {
|
|
1219
|
+
className: "badge bg-danger me-1 mb-1",
|
|
1220
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-robot me-1" }), "Unverified"]
|
|
1221
|
+
})
|
|
1222
|
+
}),
|
|
1223
|
+
E.verified?.status == "Verified" && /* @__PURE__ */ p(_, {
|
|
1224
|
+
placement: "bottom",
|
|
1225
|
+
overlay: /* @__PURE__ */ m(v, {
|
|
1226
|
+
id: "tooltip-bottom",
|
|
1227
|
+
className: "",
|
|
1228
|
+
children: [
|
|
1229
|
+
/* @__PURE__ */ m("div", { children: [
|
|
1230
|
+
"Verified by ",
|
|
1231
|
+
E.verified?.verified_methods?.length,
|
|
1232
|
+
" method",
|
|
1233
|
+
E.verified?.verified_methods?.length > 1 && "s"
|
|
1234
|
+
] }),
|
|
1235
|
+
/* @__PURE__ */ p("hr", {}),
|
|
1236
|
+
/* @__PURE__ */ p("div", {
|
|
1237
|
+
className: "pb-2",
|
|
1238
|
+
children: E.verified?.verified_methods?.map((e, t) => Object.keys(e)?.length > 0 ? /* @__PURE__ */ p("div", {
|
|
1239
|
+
className: "object",
|
|
1240
|
+
children: e?.method_name
|
|
1241
|
+
}, t) : /* @__PURE__ */ p("div", {
|
|
1242
|
+
className: "single",
|
|
1243
|
+
children: e
|
|
1244
|
+
}, t))
|
|
1245
|
+
})
|
|
1246
|
+
]
|
|
1247
|
+
}),
|
|
1248
|
+
children: /* @__PURE__ */ m("div", {
|
|
1249
|
+
className: "badge bg-articles border me-1 mb-1",
|
|
1250
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-star me-1" }), E.verified?.status]
|
|
1251
|
+
})
|
|
1252
|
+
}),
|
|
1253
|
+
E.political?.party_id && /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p(_, {
|
|
1254
|
+
placement: "bottom",
|
|
1255
|
+
overlay: /* @__PURE__ */ p(v, {
|
|
1256
|
+
id: "tooltip-bottom",
|
|
1257
|
+
children: /* @__PURE__ */ p("div", { children: "Users political party" })
|
|
1258
|
+
}),
|
|
1259
|
+
children: /* @__PURE__ */ p(r, {
|
|
1260
|
+
href: `https://articles.media/politics/parties/${(t || E)?.political?.party_id}`,
|
|
1261
|
+
children: /* @__PURE__ */ p("div", {
|
|
1262
|
+
className: "badge bg-articles border text-capitalize me-1",
|
|
1263
|
+
children: /* @__PURE__ */ m("div", {
|
|
1264
|
+
className: "",
|
|
1265
|
+
children: [(t || E)?.political?.party_id == "62a830440593acbd4061c48c" ? /* @__PURE__ */ p("i", { className: "fad fa-unlink unaffiliated-icon fa-lg me-0" }) : /* @__PURE__ */ p("img", {
|
|
1266
|
+
width: "14px",
|
|
1267
|
+
height: "14px",
|
|
1268
|
+
style: {
|
|
1269
|
+
objectFit: "contain",
|
|
1270
|
+
padding: "0px"
|
|
1271
|
+
},
|
|
1272
|
+
loading: "lazy",
|
|
1273
|
+
src: `${process.env.NEXT_PUBLIC_CDN}` + z?.find((e) => e._id == E?.political?.party_id)?.logo,
|
|
1274
|
+
alt: ""
|
|
1275
|
+
}), /* @__PURE__ */ p("span", {
|
|
1276
|
+
className: "ms-1",
|
|
1277
|
+
children: z?.find((e) => e._id == E.political?.party_id)?.name
|
|
1278
|
+
})]
|
|
1279
|
+
})
|
|
1280
|
+
})
|
|
1281
|
+
})
|
|
1282
|
+
}) }),
|
|
1283
|
+
/* @__PURE__ */ p("hr", {}),
|
|
1284
|
+
/* @__PURE__ */ p("div", {
|
|
1285
|
+
className: "small",
|
|
1286
|
+
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." })
|
|
1287
|
+
})
|
|
1288
|
+
]
|
|
1289
|
+
})]
|
|
1290
|
+
}),
|
|
1291
|
+
/* @__PURE__ */ p("hr", {}),
|
|
1292
|
+
X && /* @__PURE__ */ m("div", { children: [
|
|
1293
|
+
/* @__PURE__ */ p("div", {
|
|
1294
|
+
className: "d-flex align-items-center justify-content-between",
|
|
1295
|
+
children: /* @__PURE__ */ p("div", {
|
|
1296
|
+
className: "small",
|
|
1297
|
+
children: "Admin Mode Toolbar"
|
|
1298
|
+
})
|
|
1299
|
+
}),
|
|
1300
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("div", {
|
|
1301
|
+
className: "d-flex mb-2",
|
|
1302
|
+
children: [
|
|
1303
|
+
/* @__PURE__ */ p(n, {
|
|
1304
|
+
small: !0,
|
|
1305
|
+
variant: "warning",
|
|
1306
|
+
className: "",
|
|
1307
|
+
onClick: () => {
|
|
1308
|
+
loadAdminUserData();
|
|
1309
|
+
},
|
|
1310
|
+
children: /* @__PURE__ */ p("i", { className: "fad fa-redo me-0" })
|
|
1311
|
+
}),
|
|
1312
|
+
/* @__PURE__ */ p(n, {
|
|
1313
|
+
active: X?.edit,
|
|
1314
|
+
small: !0,
|
|
1315
|
+
className: "",
|
|
1316
|
+
onClick: () => {
|
|
1317
|
+
Z({
|
|
1318
|
+
...X,
|
|
1319
|
+
edit: !X?.edit
|
|
1320
|
+
});
|
|
1321
|
+
},
|
|
1322
|
+
children: "Edit Mode"
|
|
1323
|
+
}),
|
|
1324
|
+
X?.edit && /* @__PURE__ */ p(n, {
|
|
1325
|
+
small: !0,
|
|
1326
|
+
variant: "success",
|
|
1327
|
+
className: "me-0",
|
|
1328
|
+
onClick: () => {
|
|
1329
|
+
Pe();
|
|
1330
|
+
},
|
|
1331
|
+
children: /* @__PURE__ */ p("i", { className: "fad fa-save me-0" })
|
|
1332
|
+
})
|
|
1333
|
+
]
|
|
1334
|
+
}), [
|
|
1335
|
+
"User Details",
|
|
1336
|
+
"Verification",
|
|
1337
|
+
"Moderation",
|
|
1338
|
+
"Bans",
|
|
1339
|
+
"Stripe",
|
|
1340
|
+
"Layouts",
|
|
1341
|
+
"Reset Password",
|
|
1342
|
+
"Sessions"
|
|
1343
|
+
].map((e) => /* @__PURE__ */ p(n, {
|
|
1344
|
+
active: e == X?.tab,
|
|
1345
|
+
small: !0,
|
|
1346
|
+
onClick: () => {
|
|
1347
|
+
Z({
|
|
1348
|
+
...X,
|
|
1349
|
+
tab: e
|
|
1350
|
+
});
|
|
1351
|
+
},
|
|
1352
|
+
children: e
|
|
1353
|
+
}, e))] }),
|
|
1354
|
+
/* @__PURE__ */ p("hr", {})
|
|
1355
|
+
] }),
|
|
1356
|
+
/* @__PURE__ */ m("div", {
|
|
1357
|
+
className: "pe-3 pb-3",
|
|
1358
|
+
children: [
|
|
1359
|
+
/* @__PURE__ */ p("div", {
|
|
1360
|
+
className: "mb-2 me-2",
|
|
1361
|
+
children: [
|
|
1362
|
+
{
|
|
1363
|
+
name: "Proposals Stance",
|
|
1364
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1365
|
+
className: "badge bg-black ms-1",
|
|
1366
|
+
children: /* @__PURE__ */ m("div", {
|
|
1367
|
+
className: "small",
|
|
1368
|
+
children: [
|
|
1369
|
+
/* @__PURE__ */ p("span", { children: W?.fundamental?.filter((e) => W?.user_sentiments?.find((t) => t.proposal_id == e._id) ? e : null).length }),
|
|
1370
|
+
/* @__PURE__ */ p("span", {
|
|
1371
|
+
className: "px-1",
|
|
1372
|
+
children: "/"
|
|
1373
|
+
}),
|
|
1374
|
+
/* @__PURE__ */ p("span", { children: W?.fundamental?.length })
|
|
1375
|
+
]
|
|
1376
|
+
})
|
|
1377
|
+
})
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
name: "Proposal Sentiments",
|
|
1381
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1382
|
+
className: "badge bg-black ms-1",
|
|
1383
|
+
children: E?.populated_public_proposals_stance?.user_sentiments_count || 0
|
|
1384
|
+
})
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
name: "Proposal Comments",
|
|
1388
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1389
|
+
className: "badge bg-black ms-1",
|
|
1390
|
+
children: E?.populated_public_proposals_stance?.user_comments_count || 0
|
|
1391
|
+
})
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
name: "Proposal Submissions",
|
|
1395
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1396
|
+
className: "badge bg-black ms-1",
|
|
1397
|
+
children: pe?.length || 0
|
|
1398
|
+
})
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: "News Comments",
|
|
1402
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1403
|
+
className: "badge bg-black ms-1",
|
|
1404
|
+
children: E?.populated_news_comments_count || 0
|
|
1405
|
+
})
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
name: "News Submissions",
|
|
1409
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1410
|
+
className: "badge bg-black ms-1",
|
|
1411
|
+
children: L?.length || 0
|
|
1412
|
+
})
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
name: "Verifications",
|
|
1416
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1417
|
+
className: "badge bg-black ms-1",
|
|
1418
|
+
children: E.verified?.verified_methods?.length || 0
|
|
1419
|
+
})
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
name: "Layouts",
|
|
1423
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1424
|
+
className: "badge bg-black ms-1",
|
|
1425
|
+
children: k?.length || 0
|
|
1426
|
+
})
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: "Donations",
|
|
1430
|
+
badge: /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("span", {
|
|
1431
|
+
className: "badge bg-primary ms-1",
|
|
1432
|
+
children: G?.populated_public_donations?.count || 0
|
|
1433
|
+
}), /* @__PURE__ */ m("span", {
|
|
1434
|
+
className: "badge bg-black",
|
|
1435
|
+
children: ["$", l((G?.populated_public_donations.total / 100).toFixed(2))]
|
|
1436
|
+
})] })
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
name: "Orders",
|
|
1440
|
+
badge: /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ p("span", {
|
|
1441
|
+
className: "badge bg-primary ms-1",
|
|
1442
|
+
children: "0"
|
|
1443
|
+
}), /* @__PURE__ */ p("span", {
|
|
1444
|
+
className: "badge bg-black",
|
|
1445
|
+
children: "0"
|
|
1446
|
+
})] })
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
name: "Achievements",
|
|
1450
|
+
dev: !0,
|
|
1451
|
+
badge: /* @__PURE__ */ p("span", {
|
|
1452
|
+
className: "badge bg-black ms-1",
|
|
1453
|
+
children: "0"
|
|
1454
|
+
})
|
|
1455
|
+
}
|
|
1456
|
+
].map((e) => (e.name, e.name, e.badge, e.name, e.dev ? /* @__PURE__ */ p(M, {
|
|
1457
|
+
inline: !0,
|
|
1458
|
+
children: /* @__PURE__ */ m(n, {
|
|
1459
|
+
onClick: () => V(e.name),
|
|
1460
|
+
active: e.name == B,
|
|
1461
|
+
small: !0,
|
|
1462
|
+
children: [e.name, e.badge]
|
|
1463
|
+
}, e.name)
|
|
1464
|
+
}, e.name) : /* @__PURE__ */ m(n, {
|
|
1465
|
+
onClick: () => V(e.name),
|
|
1466
|
+
active: e.name == B,
|
|
1467
|
+
small: !0,
|
|
1468
|
+
children: [e.name, e.badge]
|
|
1469
|
+
}, e.name)))
|
|
1470
|
+
}),
|
|
1471
|
+
B == "Proposals Stance" && /* @__PURE__ */ p(ne, {
|
|
1472
|
+
activeLayoutProposalSentiments: U,
|
|
1473
|
+
populated_user: t,
|
|
1474
|
+
usersProposalSentiments: W,
|
|
1475
|
+
setShowFullStanceDetails: be,
|
|
1476
|
+
showFullStanceDetails: ye,
|
|
1477
|
+
userData: E
|
|
1478
|
+
}),
|
|
1479
|
+
B == "Proposal Comments" && /* @__PURE__ */ p(re, { activeLayoutProposalSentiments: U }),
|
|
1480
|
+
B == "Proposal Sentiments" && /* @__PURE__ */ p(ie, { activeLayoutProposalSentiments: U }),
|
|
1481
|
+
B == "Proposal Submissions" && /* @__PURE__ */ p(ae, { userProposalsSubmitted: G?.populated_public_proposals }),
|
|
1482
|
+
B == "News Comments" && /* @__PURE__ */ p(oe, { publicUserData: G }),
|
|
1483
|
+
B == "News Submissions" && /* @__PURE__ */ p(se, {
|
|
1484
|
+
publicUserData: G,
|
|
1485
|
+
userNewsSubmitted: G?.populated_public_news_submissions
|
|
1486
|
+
}),
|
|
1487
|
+
B == "Donations" && /* @__PURE__ */ p(ce, {
|
|
1488
|
+
publicUserData: G,
|
|
1489
|
+
userDonations: G?.populated_public_donations,
|
|
1490
|
+
lifetimeContribution: F
|
|
1491
|
+
}),
|
|
1492
|
+
B == "Layouts" && /* @__PURE__ */ p(le, {
|
|
1493
|
+
publicUserData: G,
|
|
1494
|
+
userLayoutsData: G?.populated_public_layouts
|
|
1495
|
+
}),
|
|
1496
|
+
B == "Verifications" && /* @__PURE__ */ p(ue, {
|
|
1497
|
+
publicUserData: G,
|
|
1498
|
+
userData: E
|
|
1499
|
+
}),
|
|
1500
|
+
B == "Achievements" && /* @__PURE__ */ p(de, { publicUserData: G })
|
|
1501
|
+
]
|
|
1502
|
+
})
|
|
1503
|
+
]
|
|
1504
|
+
}) }),
|
|
1505
|
+
/* @__PURE__ */ m(g.Footer, {
|
|
1506
|
+
className: "justify-content-between",
|
|
1507
|
+
children: [(!1)?._id == "5e90cc96579a17440c5d7d52" ? /* @__PURE__ */ m("span", { children: [/* @__PURE__ */ m(M, {
|
|
1508
|
+
inline: !0,
|
|
1509
|
+
className: "me-2",
|
|
1510
|
+
children: [/* @__PURE__ */ m(n, {
|
|
1511
|
+
onClick: () => {
|
|
1512
|
+
Z(X ? !1 : { tab: "" });
|
|
1513
|
+
},
|
|
1514
|
+
small: !0,
|
|
1515
|
+
active: X,
|
|
1516
|
+
variant: "",
|
|
1517
|
+
className: "me-1",
|
|
1518
|
+
children: [/* @__PURE__ */ p("i", { className: "fad fa-pen" }), /* @__PURE__ */ p("span", { children: "Admin Mode" })]
|
|
1519
|
+
}), /* @__PURE__ */ p(n, {
|
|
1520
|
+
onClick: () => {
|
|
1521
|
+
we(), Ee();
|
|
1522
|
+
},
|
|
1523
|
+
small: !0,
|
|
1524
|
+
variant: "warning",
|
|
1525
|
+
className: "",
|
|
1526
|
+
children: /* @__PURE__ */ p("i", { className: "fad fa-redo me-0" })
|
|
1527
|
+
})]
|
|
1528
|
+
}), /* @__PURE__ */ p("span", {
|
|
1529
|
+
style: { fontSize: "0.8rem" },
|
|
1530
|
+
children: E?._id
|
|
1531
|
+
})] }) : /* @__PURE__ */ p("span", {}), /* @__PURE__ */ p("div", {
|
|
1532
|
+
className: "justify-content-",
|
|
1533
|
+
children: /* @__PURE__ */ p(n, {
|
|
1534
|
+
variant: "articles",
|
|
1535
|
+
onClick: H,
|
|
1536
|
+
children: "Close"
|
|
1537
|
+
})
|
|
1538
|
+
})]
|
|
1539
|
+
})
|
|
1540
|
+
]
|
|
1541
|
+
})] });
|
|
1542
|
+
}
|
|
1543
|
+
//#endregion
|
|
1544
|
+
export { R as t };
|