@empoweredvote/ev-ui 0.5.0 → 0.6.0
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/index.js +909 -229
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +903 -226
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,8 +35,10 @@ __export(index_exports, {
|
|
|
35
35
|
CategorySection: () => CategorySection,
|
|
36
36
|
CommitteeTable: () => CommitteeTable,
|
|
37
37
|
CompassCardHorizontal: () => CompassCardHorizontal,
|
|
38
|
+
CompassCardVertical: () => CompassCardVertical,
|
|
38
39
|
CompassCoverageCallout: () => CompassCoverageCallout,
|
|
39
40
|
CompassIcon: () => CompassIcon,
|
|
41
|
+
CompassKey: () => CompassKey,
|
|
40
42
|
ExpandCompassNudge: () => ExpandCompassNudge,
|
|
41
43
|
FilterSidebar: () => FilterSidebar,
|
|
42
44
|
GovernmentBodySection: () => GovernmentBodySection,
|
|
@@ -66,6 +68,7 @@ __export(index_exports, {
|
|
|
66
68
|
defaultNavItems: () => defaultNavItems,
|
|
67
69
|
duration: () => duration,
|
|
68
70
|
easing: () => easing,
|
|
71
|
+
evContext: () => evContext,
|
|
69
72
|
focus: () => focus,
|
|
70
73
|
fontSizes: () => fontSizes,
|
|
71
74
|
fontWeights: () => fontWeights,
|
|
@@ -101,7 +104,8 @@ function RadarChartCore({
|
|
|
101
104
|
size = 400,
|
|
102
105
|
labelFontSize = 18,
|
|
103
106
|
padding = 80,
|
|
104
|
-
labelOffset = 20
|
|
107
|
+
labelOffset = 20,
|
|
108
|
+
tightFit = false
|
|
105
109
|
}) {
|
|
106
110
|
const radius = size / 2 - 40;
|
|
107
111
|
const centerX = size / 2;
|
|
@@ -200,6 +204,20 @@ function RadarChartCore({
|
|
|
200
204
|
const leftPadding = symmetricPadding;
|
|
201
205
|
const rightPadding = symmetricPadding;
|
|
202
206
|
const verticalPadding = padding;
|
|
207
|
+
let tightTop = -verticalPadding;
|
|
208
|
+
let tightHeight = size + verticalPadding * 2;
|
|
209
|
+
if (tightFit && numSpokes > 0) {
|
|
210
|
+
let yMin = Infinity, yMax = -Infinity;
|
|
211
|
+
for (let i = 0; i < numSpokes; i++) {
|
|
212
|
+
const angle = 2 * Math.PI * i / numSpokes;
|
|
213
|
+
const y = centerY - radius * Math.cos(angle);
|
|
214
|
+
if (y < yMin) yMin = y;
|
|
215
|
+
if (y > yMax) yMax = y;
|
|
216
|
+
}
|
|
217
|
+
const labelMargin = labelOffset + labelFontSize * 1.4 + labelFontSize * 1.1;
|
|
218
|
+
tightTop = yMin - labelMargin;
|
|
219
|
+
tightHeight = yMax + labelMargin - tightTop;
|
|
220
|
+
}
|
|
203
221
|
const guidePolygons = [];
|
|
204
222
|
for (let level = 1; level <= 5; level++) {
|
|
205
223
|
const scale = level / 5;
|
|
@@ -218,7 +236,7 @@ function RadarChartCore({
|
|
|
218
236
|
"svg",
|
|
219
237
|
{
|
|
220
238
|
className: "w-full h-auto max-h-full",
|
|
221
|
-
viewBox: `-${leftPadding}
|
|
239
|
+
viewBox: `-${leftPadding} ${tightTop} ${size + leftPadding + rightPadding} ${tightHeight}`,
|
|
222
240
|
preserveAspectRatio: "xMidYMid meet"
|
|
223
241
|
},
|
|
224
242
|
guidePolygons,
|
|
@@ -276,6 +294,7 @@ function RadarChartCore({
|
|
|
276
294
|
fill: isUnansweredLabel ? "#9ca3af" : void 0,
|
|
277
295
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize }
|
|
278
296
|
},
|
|
297
|
+
isUnansweredLabel && /* @__PURE__ */ import_react.default.createElement("title", null, "No stance on file for this topic."),
|
|
279
298
|
lines.map((ln, idx) => /* @__PURE__ */ import_react.default.createElement("tspan", { key: idx, x: labelX, dy: idx === 0 ? "0" : `${lineHeight}` }, ln))
|
|
280
299
|
);
|
|
281
300
|
}),
|
|
@@ -302,18 +321,25 @@ function RadarChartCore({
|
|
|
302
321
|
}
|
|
303
322
|
}
|
|
304
323
|
),
|
|
305
|
-
pointsArr.map(([cx, cy], i) =>
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
324
|
+
pointsArr.map(([cx, cy], i) => {
|
|
325
|
+
const shortTitle = spokes[i][0];
|
|
326
|
+
const userVal = spokes[i][1];
|
|
327
|
+
if (!userVal || Number(userVal) === 0) return null;
|
|
328
|
+
const compareVal = compareData[shortTitle];
|
|
329
|
+
const matches = hasCompareData && userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
330
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
331
|
+
"circle",
|
|
332
|
+
{
|
|
333
|
+
key: `user-dot-${i}`,
|
|
334
|
+
cx,
|
|
335
|
+
cy,
|
|
336
|
+
r: matches ? 8 : 7,
|
|
337
|
+
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
338
|
+
stroke: "#FFFFFF",
|
|
339
|
+
strokeWidth: 3
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}),
|
|
317
343
|
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react.default.createElement(
|
|
318
344
|
"polygon",
|
|
319
345
|
{
|
|
@@ -337,18 +363,25 @@ function RadarChartCore({
|
|
|
337
363
|
}
|
|
338
364
|
}
|
|
339
365
|
) : null,
|
|
340
|
-
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) =>
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
366
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
367
|
+
const shortTitle = spokes[i][0];
|
|
368
|
+
const userVal = spokes[i][1];
|
|
369
|
+
const compareVal = compareData[shortTitle];
|
|
370
|
+
if (!compareVal || Number(compareVal) === 0) return null;
|
|
371
|
+
const matches = userVal !== 0 && compareVal !== 0 && compareVal != null && Number(userVal) === Number(compareVal);
|
|
372
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
373
|
+
"circle",
|
|
374
|
+
{
|
|
375
|
+
key: `compare-dot-${i}`,
|
|
376
|
+
cx,
|
|
377
|
+
cy,
|
|
378
|
+
r: matches ? 8 : 7,
|
|
379
|
+
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
380
|
+
stroke: "#FFFFFF",
|
|
381
|
+
strokeWidth: 3
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}),
|
|
352
385
|
spokes.map(([shortTitle], i) => {
|
|
353
386
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
354
387
|
const x = centerX + radius * Math.sin(angle);
|
|
@@ -1624,7 +1657,8 @@ function PoliticianCard({
|
|
|
1624
1657
|
},
|
|
1625
1658
|
imageWrapper: {
|
|
1626
1659
|
width: isHorizontal ? "90px" : "100%",
|
|
1627
|
-
height: isHorizontal ?
|
|
1660
|
+
height: isHorizontal ? "100%" : "auto",
|
|
1661
|
+
maxHeight: isHorizontal ? "200px" : void 0,
|
|
1628
1662
|
aspectRatio: isHorizontal ? void 0 : "4/5",
|
|
1629
1663
|
flexShrink: 0,
|
|
1630
1664
|
overflow: "hidden"
|
|
@@ -2148,7 +2182,7 @@ function CompassCardHorizontalMeta({
|
|
|
2148
2182
|
IconOverlay,
|
|
2149
2183
|
{
|
|
2150
2184
|
ballot: politician.ballot || null,
|
|
2151
|
-
hasStances:
|
|
2185
|
+
hasStances: false,
|
|
2152
2186
|
branch: politician.branch || null
|
|
2153
2187
|
}
|
|
2154
2188
|
));
|
|
@@ -2179,11 +2213,12 @@ function buildAnswerMapByShortTitle(allTopics, allAnswers, allowedShorts) {
|
|
|
2179
2213
|
}
|
|
2180
2214
|
|
|
2181
2215
|
// src/CompassCardHorizontal.jsx
|
|
2182
|
-
var RADAR_SIZE =
|
|
2183
|
-
var SLOT_WIDTH =
|
|
2216
|
+
var RADAR_SIZE = 400;
|
|
2217
|
+
var SLOT_WIDTH = 420;
|
|
2184
2218
|
function CompassCardHorizontal({
|
|
2185
2219
|
politician,
|
|
2186
2220
|
userAnswers = null,
|
|
2221
|
+
invertedSpokes = {},
|
|
2187
2222
|
tierVisuals = null,
|
|
2188
2223
|
view = "compass",
|
|
2189
2224
|
surface = "representatives",
|
|
@@ -2267,7 +2302,7 @@ function CompassCardHorizontal({
|
|
|
2267
2302
|
topics,
|
|
2268
2303
|
data,
|
|
2269
2304
|
compareData,
|
|
2270
|
-
invertedSpokes: {},
|
|
2305
|
+
invertedSpokes: invertedSpokes || {},
|
|
2271
2306
|
onToggleInversion: () => {
|
|
2272
2307
|
},
|
|
2273
2308
|
onReplaceTopic: () => {
|
|
@@ -2360,7 +2395,7 @@ function CompassCardHorizontal({
|
|
|
2360
2395
|
"Calibrate your compass"
|
|
2361
2396
|
));
|
|
2362
2397
|
}
|
|
2363
|
-
function renderUnavailablePlate() {
|
|
2398
|
+
function renderUnavailablePlate(message = "Compass currently unavailable for this role.") {
|
|
2364
2399
|
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2365
2400
|
width: "100%",
|
|
2366
2401
|
height: "100%",
|
|
@@ -2379,12 +2414,16 @@ function CompassCardHorizontal({
|
|
|
2379
2414
|
maxWidth: "180px",
|
|
2380
2415
|
margin: 0,
|
|
2381
2416
|
fontFamily: fonts.primary
|
|
2382
|
-
} },
|
|
2417
|
+
} }, message));
|
|
2383
2418
|
}
|
|
2384
2419
|
function renderSlotContent() {
|
|
2385
2420
|
if (view === "portrait") return renderPortrait();
|
|
2386
2421
|
if (variant === "empty") return renderEmptyVariant();
|
|
2387
2422
|
if (variant === "administrative" || variant === "judicial") return renderUnavailablePlate();
|
|
2423
|
+
if (variant === "no-stances") {
|
|
2424
|
+
const name = (politician == null ? void 0 : politician.full_name) || "this official";
|
|
2425
|
+
return renderUnavailablePlate(`No compass stances on file for ${name} yet.`);
|
|
2426
|
+
}
|
|
2388
2427
|
return /* @__PURE__ */ import_react13.default.createElement("div", { style: {
|
|
2389
2428
|
width: "100%",
|
|
2390
2429
|
height: "100%",
|
|
@@ -2440,8 +2479,644 @@ function CompassCardHorizontal({
|
|
|
2440
2479
|
);
|
|
2441
2480
|
}
|
|
2442
2481
|
|
|
2443
|
-
// src/
|
|
2482
|
+
// src/CompassCardVertical.jsx
|
|
2444
2483
|
var import_react14 = __toESM(require("react"));
|
|
2484
|
+
var RADAR_SIZE2 = 400;
|
|
2485
|
+
function CompassCardVertical({
|
|
2486
|
+
politician,
|
|
2487
|
+
userAnswers = null,
|
|
2488
|
+
invertedSpokes = {},
|
|
2489
|
+
tierVisuals = null,
|
|
2490
|
+
view = "compass",
|
|
2491
|
+
surface = "representatives",
|
|
2492
|
+
variant = "compass",
|
|
2493
|
+
onBuildCompass = null,
|
|
2494
|
+
onClick
|
|
2495
|
+
}) {
|
|
2496
|
+
var _a;
|
|
2497
|
+
const [hovered, setHovered] = (0, import_react14.useState)(false);
|
|
2498
|
+
const [focused, setFocused] = (0, import_react14.useState)(false);
|
|
2499
|
+
const [imgError, setImgError] = (0, import_react14.useState)(false);
|
|
2500
|
+
const [emptyCtaHovered, setEmptyCtaHovered] = (0, import_react14.useState)(false);
|
|
2501
|
+
(0, import_react14.useEffect)(() => {
|
|
2502
|
+
setImgError(false);
|
|
2503
|
+
}, [politician == null ? void 0 : politician.photo_origin_url]);
|
|
2504
|
+
const cardStyle = {
|
|
2505
|
+
position: "relative",
|
|
2506
|
+
display: "flex",
|
|
2507
|
+
flexDirection: "column",
|
|
2508
|
+
height: "100%",
|
|
2509
|
+
backgroundColor: (_a = tierVisuals == null ? void 0 : tierVisuals.bg) != null ? _a : colors.bgWhite,
|
|
2510
|
+
border: `1px solid ${colors.borderLight}`,
|
|
2511
|
+
borderRadius: borderRadius.xl,
|
|
2512
|
+
overflow: "hidden",
|
|
2513
|
+
boxShadow: focused ? focus.ring : hovered ? shadows.cardHover : shadows.md,
|
|
2514
|
+
transform: hovered ? "translateY(-2px)" : "none",
|
|
2515
|
+
transition: `box-shadow ${duration.normal} ease, transform ${duration.normal} ease`,
|
|
2516
|
+
cursor: onClick ? "pointer" : "default",
|
|
2517
|
+
fontFamily: fonts.primary,
|
|
2518
|
+
outline: "none"
|
|
2519
|
+
};
|
|
2520
|
+
const titleText = surface === "elections" ? politician.office_running_for : politician.office_title;
|
|
2521
|
+
function renderCompass() {
|
|
2522
|
+
var _a2, _b, _c;
|
|
2523
|
+
if (!userAnswers || userAnswers.length === 0) {
|
|
2524
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2525
|
+
}
|
|
2526
|
+
let topics = [];
|
|
2527
|
+
let data = {};
|
|
2528
|
+
let compareData = {};
|
|
2529
|
+
try {
|
|
2530
|
+
if (Array.isArray(userAnswers) && userAnswers.length > 0) {
|
|
2531
|
+
const hasEmbeddedTopics = (_b = (_a2 = userAnswers[0]) == null ? void 0 : _a2.topic) == null ? void 0 : _b.short_title;
|
|
2532
|
+
if (hasEmbeddedTopics) {
|
|
2533
|
+
const allowedShorts = userAnswers.map((a) => a.topic.short_title);
|
|
2534
|
+
const allTopics = userAnswers.map((a) => a.topic);
|
|
2535
|
+
const { topicsFiltered, answersByShort } = buildAnswerMapByShortTitle(
|
|
2536
|
+
allTopics,
|
|
2537
|
+
userAnswers,
|
|
2538
|
+
allowedShorts
|
|
2539
|
+
);
|
|
2540
|
+
topics = topicsFiltered;
|
|
2541
|
+
data = answersByShort;
|
|
2542
|
+
} else {
|
|
2543
|
+
if (!Array.isArray(userAnswers[0])) {
|
|
2544
|
+
topics = userAnswers.filter((a) => a.short_title).map((a) => ({ id: a.topic_id || a.short_title, short_title: a.short_title, title: a.short_title }));
|
|
2545
|
+
data = {};
|
|
2546
|
+
for (const a of userAnswers) {
|
|
2547
|
+
if (a.short_title) data[a.short_title] = (_c = a.value) != null ? _c : 0;
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
if ((politician == null ? void 0 : politician.stances) && typeof politician.stances === "object") {
|
|
2553
|
+
compareData = Array.isArray(politician.stances) ? politician.stances.reduce((acc, s) => {
|
|
2554
|
+
var _a3;
|
|
2555
|
+
if (s.short_title) acc[s.short_title] = (_a3 = s.value) != null ? _a3 : 0;
|
|
2556
|
+
return acc;
|
|
2557
|
+
}, {}) : politician.stances;
|
|
2558
|
+
}
|
|
2559
|
+
if (topics.length === 0) {
|
|
2560
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2561
|
+
}
|
|
2562
|
+
} catch {
|
|
2563
|
+
return /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: RADAR_SIZE2, name: (politician == null ? void 0 : politician.full_name) || "" });
|
|
2564
|
+
}
|
|
2565
|
+
const unansweredSpokes = {};
|
|
2566
|
+
for (const t of topics) {
|
|
2567
|
+
const v = compareData[t.short_title];
|
|
2568
|
+
if (!v || Number(v) === 0) unansweredSpokes[t.short_title] = true;
|
|
2569
|
+
}
|
|
2570
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: { width: RADAR_SIZE2 + 240, maxWidth: "100%", flexShrink: 0 } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2571
|
+
RadarChartCore,
|
|
2572
|
+
{
|
|
2573
|
+
topics,
|
|
2574
|
+
data,
|
|
2575
|
+
compareData,
|
|
2576
|
+
invertedSpokes: invertedSpokes || {},
|
|
2577
|
+
unansweredSpokes,
|
|
2578
|
+
onToggleInversion: () => {
|
|
2579
|
+
},
|
|
2580
|
+
onReplaceTopic: () => {
|
|
2581
|
+
},
|
|
2582
|
+
size: RADAR_SIZE2,
|
|
2583
|
+
padding: 40,
|
|
2584
|
+
labelOffset: 5,
|
|
2585
|
+
labelFontSize: 18,
|
|
2586
|
+
tightFit: true
|
|
2587
|
+
}
|
|
2588
|
+
));
|
|
2589
|
+
}
|
|
2590
|
+
function renderAvatar() {
|
|
2591
|
+
var _a2, _b, _c;
|
|
2592
|
+
const imageSrc = (politician == null ? void 0 : politician.photo_origin_url) || (politician == null ? void 0 : politician.images) && ((_a2 = politician.images[0]) == null ? void 0 : _a2.url) || null;
|
|
2593
|
+
const baseStyle = {
|
|
2594
|
+
width: 88,
|
|
2595
|
+
height: 110,
|
|
2596
|
+
flexShrink: 0,
|
|
2597
|
+
overflow: "hidden",
|
|
2598
|
+
borderRadius: borderRadius.md,
|
|
2599
|
+
backgroundColor: colors.evMutedBlue,
|
|
2600
|
+
display: "flex",
|
|
2601
|
+
alignItems: "center",
|
|
2602
|
+
justifyContent: "center"
|
|
2603
|
+
};
|
|
2604
|
+
if (imageSrc && !imgError) {
|
|
2605
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2606
|
+
"img",
|
|
2607
|
+
{
|
|
2608
|
+
src: imageSrc,
|
|
2609
|
+
alt: `${politician.full_name} portrait`,
|
|
2610
|
+
onError: () => setImgError(true),
|
|
2611
|
+
style: {
|
|
2612
|
+
width: "100%",
|
|
2613
|
+
height: "100%",
|
|
2614
|
+
objectFit: "cover",
|
|
2615
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2616
|
+
display: "block"
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
));
|
|
2620
|
+
}
|
|
2621
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2622
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2623
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: baseStyle }, /* @__PURE__ */ import_react14.default.createElement("span", { style: {
|
|
2624
|
+
color: colors.textWhite,
|
|
2625
|
+
fontFamily: fonts.primary,
|
|
2626
|
+
fontWeight: fontWeights.bold,
|
|
2627
|
+
fontSize: fontSizes["2xl"]
|
|
2628
|
+
} }, initials));
|
|
2629
|
+
}
|
|
2630
|
+
function renderPortrait() {
|
|
2631
|
+
var _a2, _b, _c;
|
|
2632
|
+
const imageSrc = (politician == null ? void 0 : politician.photo_origin_url) || (politician == null ? void 0 : politician.images) && ((_a2 = politician.images[0]) == null ? void 0 : _a2.url) || null;
|
|
2633
|
+
if (imageSrc && !imgError) {
|
|
2634
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2635
|
+
"img",
|
|
2636
|
+
{
|
|
2637
|
+
src: imageSrc,
|
|
2638
|
+
alt: `${politician.full_name} portrait`,
|
|
2639
|
+
style: {
|
|
2640
|
+
width: RADAR_SIZE2,
|
|
2641
|
+
height: RADAR_SIZE2,
|
|
2642
|
+
objectFit: "cover",
|
|
2643
|
+
objectPosition: (_b = politician.imageFocalPoint) != null ? _b : "center 20%",
|
|
2644
|
+
display: "block",
|
|
2645
|
+
borderRadius: borderRadius.md
|
|
2646
|
+
},
|
|
2647
|
+
onError: () => setImgError(true)
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
const parts = ((politician == null ? void 0 : politician.full_name) || "").split(" ").filter(Boolean);
|
|
2652
|
+
const initials = (parts.length >= 2 ? parts[0][0] + parts[parts.length - 1][0] : ((_c = parts[0]) == null ? void 0 : _c[0]) || "?").toUpperCase();
|
|
2653
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2654
|
+
width: RADAR_SIZE2,
|
|
2655
|
+
height: RADAR_SIZE2,
|
|
2656
|
+
backgroundColor: colors.evMutedBlue,
|
|
2657
|
+
color: colors.textWhite,
|
|
2658
|
+
display: "flex",
|
|
2659
|
+
alignItems: "center",
|
|
2660
|
+
justifyContent: "center",
|
|
2661
|
+
fontFamily: fonts.primary,
|
|
2662
|
+
fontWeight: fontWeights.bold,
|
|
2663
|
+
fontSize: fontSizes["5xl"],
|
|
2664
|
+
borderRadius: borderRadius.md
|
|
2665
|
+
} }, initials);
|
|
2666
|
+
}
|
|
2667
|
+
function renderEmptyVariant() {
|
|
2668
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2669
|
+
width: "100%",
|
|
2670
|
+
height: "100%",
|
|
2671
|
+
flex: 1,
|
|
2672
|
+
display: "flex",
|
|
2673
|
+
flexDirection: "column",
|
|
2674
|
+
alignItems: "center",
|
|
2675
|
+
justifyContent: "center",
|
|
2676
|
+
gap: "12px",
|
|
2677
|
+
padding: "20px",
|
|
2678
|
+
boxSizing: "border-box",
|
|
2679
|
+
backgroundColor: colorScales.teal["050"],
|
|
2680
|
+
borderRadius: borderRadius.md
|
|
2681
|
+
} }, /* @__PURE__ */ import_react14.default.createElement(PlaceholderRadar, { size: 220, name: (politician == null ? void 0 : politician.full_name) || "" }), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2682
|
+
margin: 0,
|
|
2683
|
+
fontSize: fontSizes.sm,
|
|
2684
|
+
color: colors.textMuted,
|
|
2685
|
+
textAlign: "center",
|
|
2686
|
+
lineHeight: 1.4,
|
|
2687
|
+
fontFamily: fonts.primary
|
|
2688
|
+
} }, "Calibrate your compass to see how you align with ", (politician == null ? void 0 : politician.full_name) || "this official"), /* @__PURE__ */ import_react14.default.createElement(
|
|
2689
|
+
"button",
|
|
2690
|
+
{
|
|
2691
|
+
type: "button",
|
|
2692
|
+
onClick: onBuildCompass || void 0,
|
|
2693
|
+
onMouseEnter: () => setEmptyCtaHovered(true),
|
|
2694
|
+
onMouseLeave: () => setEmptyCtaHovered(false),
|
|
2695
|
+
style: {
|
|
2696
|
+
minWidth: "180px",
|
|
2697
|
+
height: "44px",
|
|
2698
|
+
padding: "0 20px",
|
|
2699
|
+
backgroundColor: emptyCtaHovered ? semanticTokens.light.buttonPrimary.background.hovered : semanticTokens.light.buttonPrimary.background.default,
|
|
2700
|
+
color: colors.textWhite,
|
|
2701
|
+
fontSize: fontSizes.sm,
|
|
2702
|
+
fontWeight: fontWeights.semibold,
|
|
2703
|
+
fontFamily: fonts.primary,
|
|
2704
|
+
borderRadius: borderRadius.full,
|
|
2705
|
+
border: "none",
|
|
2706
|
+
cursor: onBuildCompass ? "pointer" : "default",
|
|
2707
|
+
transition: `background ${duration.normal} ease`
|
|
2708
|
+
}
|
|
2709
|
+
},
|
|
2710
|
+
"Calibrate your compass"
|
|
2711
|
+
));
|
|
2712
|
+
}
|
|
2713
|
+
function renderUnavailablePlate(message) {
|
|
2714
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2715
|
+
width: "100%",
|
|
2716
|
+
height: "100%",
|
|
2717
|
+
flex: 1,
|
|
2718
|
+
backgroundColor: colorScales.teal["050"],
|
|
2719
|
+
borderRadius: borderRadius.md,
|
|
2720
|
+
display: "flex",
|
|
2721
|
+
alignItems: "center",
|
|
2722
|
+
justifyContent: "center",
|
|
2723
|
+
padding: spacing[6],
|
|
2724
|
+
boxSizing: "border-box"
|
|
2725
|
+
} }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2726
|
+
fontSize: fontSizes.base,
|
|
2727
|
+
fontWeight: fontWeights.semibold,
|
|
2728
|
+
lineHeight: 1.4,
|
|
2729
|
+
color: colors.textMuted,
|
|
2730
|
+
textAlign: "center",
|
|
2731
|
+
margin: 0,
|
|
2732
|
+
fontFamily: fonts.primary
|
|
2733
|
+
} }, message));
|
|
2734
|
+
}
|
|
2735
|
+
function renderSlotContent() {
|
|
2736
|
+
if (view === "portrait") return renderPortrait();
|
|
2737
|
+
if (variant === "empty") return renderEmptyVariant();
|
|
2738
|
+
if (variant === "administrative" || variant === "judicial") {
|
|
2739
|
+
return renderUnavailablePlate("Compass currently unavailable for this role.");
|
|
2740
|
+
}
|
|
2741
|
+
if (variant === "no-stances") {
|
|
2742
|
+
return renderUnavailablePlate(`No compass stances on file for ${(politician == null ? void 0 : politician.full_name) || "this official"} yet.`);
|
|
2743
|
+
}
|
|
2744
|
+
return renderCompass();
|
|
2745
|
+
}
|
|
2746
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
2747
|
+
"div",
|
|
2748
|
+
{
|
|
2749
|
+
role: "article",
|
|
2750
|
+
"aria-label": `${politician.full_name}, ${politician.office_title || ""}`,
|
|
2751
|
+
tabIndex: 0,
|
|
2752
|
+
style: cardStyle,
|
|
2753
|
+
onClick,
|
|
2754
|
+
onKeyDown: (e) => {
|
|
2755
|
+
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
2756
|
+
e.preventDefault();
|
|
2757
|
+
onClick();
|
|
2758
|
+
}
|
|
2759
|
+
},
|
|
2760
|
+
onMouseEnter: () => setHovered(true),
|
|
2761
|
+
onMouseLeave: () => setHovered(false),
|
|
2762
|
+
onFocus: () => setFocused(true),
|
|
2763
|
+
onBlur: () => setFocused(false)
|
|
2764
|
+
},
|
|
2765
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: { padding: spacing[4], paddingBottom: spacing[3], display: "flex", alignItems: "stretch", gap: spacing[3], flexShrink: 0 } }, renderAvatar(), /* @__PURE__ */ import_react14.default.createElement("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1], minWidth: 0, flex: 1 } }, /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2766
|
+
fontFamily: fonts.primary,
|
|
2767
|
+
fontSize: fontSizes.xl,
|
|
2768
|
+
fontWeight: fontWeights.semibold,
|
|
2769
|
+
lineHeight: 1.3,
|
|
2770
|
+
color: colors.evMutedBlue,
|
|
2771
|
+
margin: 0
|
|
2772
|
+
} }, politician.full_name), /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2773
|
+
fontFamily: fonts.primary,
|
|
2774
|
+
fontSize: fontSizes.sm,
|
|
2775
|
+
fontWeight: fontWeights.semibold,
|
|
2776
|
+
lineHeight: 1.4,
|
|
2777
|
+
color: colors.textSecondary,
|
|
2778
|
+
margin: 0
|
|
2779
|
+
} }, titleText || ""), politician.district_label && /* @__PURE__ */ import_react14.default.createElement("p", { style: {
|
|
2780
|
+
fontFamily: fonts.primary,
|
|
2781
|
+
fontSize: fontSizes.sm,
|
|
2782
|
+
fontWeight: fontWeights.regular,
|
|
2783
|
+
lineHeight: 1.5,
|
|
2784
|
+
color: colors.textMuted,
|
|
2785
|
+
margin: 0,
|
|
2786
|
+
overflow: "hidden",
|
|
2787
|
+
textOverflow: "ellipsis",
|
|
2788
|
+
whiteSpace: "nowrap"
|
|
2789
|
+
} }, politician.district_label), /* @__PURE__ */ import_react14.default.createElement("div", { style: { marginTop: "auto" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
2790
|
+
IconOverlay,
|
|
2791
|
+
{
|
|
2792
|
+
ballot: politician.ballot || null,
|
|
2793
|
+
hasStances: false,
|
|
2794
|
+
branch: politician.branch || null
|
|
2795
|
+
}
|
|
2796
|
+
)))),
|
|
2797
|
+
surface === "elections" && politician.withdrawn && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2798
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2799
|
+
backgroundColor: "rgba(120,0,0,0.85)",
|
|
2800
|
+
color: "#fff",
|
|
2801
|
+
fontSize: "12px",
|
|
2802
|
+
fontWeight: 700,
|
|
2803
|
+
letterSpacing: "0.4px",
|
|
2804
|
+
textAlign: "center",
|
|
2805
|
+
textTransform: "uppercase",
|
|
2806
|
+
padding: "6px 0",
|
|
2807
|
+
borderRadius: borderRadius.sm
|
|
2808
|
+
} }, "Withdrawn"),
|
|
2809
|
+
surface === "elections" && !politician.withdrawn && politician.running_unopposed && /* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2810
|
+
margin: `0 ${spacing[4]} ${spacing[3]}`,
|
|
2811
|
+
backgroundColor: "rgba(0,0,0,0.75)",
|
|
2812
|
+
color: "#fff",
|
|
2813
|
+
fontSize: "12px",
|
|
2814
|
+
fontWeight: 700,
|
|
2815
|
+
letterSpacing: "0.4px",
|
|
2816
|
+
textAlign: "center",
|
|
2817
|
+
textTransform: "uppercase",
|
|
2818
|
+
padding: "6px 0",
|
|
2819
|
+
borderRadius: borderRadius.sm
|
|
2820
|
+
} }, "Running Unopposed"),
|
|
2821
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { style: {
|
|
2822
|
+
flex: 1,
|
|
2823
|
+
padding: spacing[4],
|
|
2824
|
+
paddingTop: 0,
|
|
2825
|
+
display: "flex",
|
|
2826
|
+
alignItems: "center",
|
|
2827
|
+
justifyContent: "center",
|
|
2828
|
+
position: "relative",
|
|
2829
|
+
minHeight: 0
|
|
2830
|
+
} }, renderSlotContent())
|
|
2831
|
+
);
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// src/CompassKey.jsx
|
|
2835
|
+
var import_react15 = __toESM(require("react"));
|
|
2836
|
+
|
|
2837
|
+
// src/evContext.js
|
|
2838
|
+
var DEFAULT_BROKER_URL = "https://ev-context.empowered.vote/";
|
|
2839
|
+
var brokerUrl = DEFAULT_BROKER_URL;
|
|
2840
|
+
var iframe = null;
|
|
2841
|
+
var readyPromise = null;
|
|
2842
|
+
var pendingRequests = /* @__PURE__ */ new Map();
|
|
2843
|
+
var subscribers = /* @__PURE__ */ new Set();
|
|
2844
|
+
var lastValue = null;
|
|
2845
|
+
var nextRequestId = 1;
|
|
2846
|
+
function brokerOrigin() {
|
|
2847
|
+
try {
|
|
2848
|
+
return new URL(brokerUrl).origin;
|
|
2849
|
+
} catch {
|
|
2850
|
+
return "";
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
function ensureMounted() {
|
|
2854
|
+
if (typeof window === "undefined" || typeof document === "undefined") return null;
|
|
2855
|
+
if (iframe) return iframe;
|
|
2856
|
+
iframe = document.createElement("iframe");
|
|
2857
|
+
iframe.src = brokerUrl;
|
|
2858
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
2859
|
+
iframe.setAttribute("tabindex", "-1");
|
|
2860
|
+
iframe.style.position = "absolute";
|
|
2861
|
+
iframe.style.width = "1px";
|
|
2862
|
+
iframe.style.height = "1px";
|
|
2863
|
+
iframe.style.border = "0";
|
|
2864
|
+
iframe.style.opacity = "0";
|
|
2865
|
+
iframe.style.pointerEvents = "none";
|
|
2866
|
+
iframe.style.top = "-9999px";
|
|
2867
|
+
iframe.style.left = "-9999px";
|
|
2868
|
+
window.addEventListener("message", onMessage);
|
|
2869
|
+
(document.body || document.documentElement).appendChild(iframe);
|
|
2870
|
+
readyPromise = new Promise((resolve) => {
|
|
2871
|
+
const onReady = (e) => {
|
|
2872
|
+
if (e.origin !== brokerOrigin()) return;
|
|
2873
|
+
if (!e.data || e.data.type !== "ev-context:ready") return;
|
|
2874
|
+
window.removeEventListener("message", onReady);
|
|
2875
|
+
resolve();
|
|
2876
|
+
};
|
|
2877
|
+
window.addEventListener("message", onReady);
|
|
2878
|
+
iframe.addEventListener("load", () => {
|
|
2879
|
+
setTimeout(() => resolve(), 50);
|
|
2880
|
+
});
|
|
2881
|
+
});
|
|
2882
|
+
return iframe;
|
|
2883
|
+
}
|
|
2884
|
+
function onMessage(event) {
|
|
2885
|
+
var _a, _b, _c;
|
|
2886
|
+
if (event.origin !== brokerOrigin()) return;
|
|
2887
|
+
const data = event.data;
|
|
2888
|
+
if (!data || typeof data !== "object") return;
|
|
2889
|
+
if (data.type === "ev-context:value" || data.type === "ev-context:ack") {
|
|
2890
|
+
const id = data.requestId;
|
|
2891
|
+
if (id && pendingRequests.has(id)) {
|
|
2892
|
+
const { resolve, timeout } = pendingRequests.get(id);
|
|
2893
|
+
clearTimeout(timeout);
|
|
2894
|
+
pendingRequests.delete(id);
|
|
2895
|
+
resolve(data.type === "ev-context:value" ? (_a = data.value) != null ? _a : null : data.ok);
|
|
2896
|
+
}
|
|
2897
|
+
if (data.type === "ev-context:value") {
|
|
2898
|
+
lastValue = (_b = data.value) != null ? _b : null;
|
|
2899
|
+
notifySubscribers();
|
|
2900
|
+
}
|
|
2901
|
+
} else if (data.type === "ev-context:update") {
|
|
2902
|
+
lastValue = (_c = data.value) != null ? _c : null;
|
|
2903
|
+
notifySubscribers();
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
function notifySubscribers() {
|
|
2907
|
+
for (const fn of subscribers) {
|
|
2908
|
+
try {
|
|
2909
|
+
fn(lastValue);
|
|
2910
|
+
} catch {
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
function send(message, { expectReply = true, timeoutMs = 4e3 } = {}) {
|
|
2915
|
+
ensureMounted();
|
|
2916
|
+
return readyPromise.then(() => new Promise((resolve, reject) => {
|
|
2917
|
+
if (!iframe || !iframe.contentWindow) {
|
|
2918
|
+
reject(new Error("evContext broker iframe not ready"));
|
|
2919
|
+
return;
|
|
2920
|
+
}
|
|
2921
|
+
const requestId = expectReply ? `req-${nextRequestId++}` : void 0;
|
|
2922
|
+
if (expectReply) {
|
|
2923
|
+
const timeout = setTimeout(() => {
|
|
2924
|
+
pendingRequests.delete(requestId);
|
|
2925
|
+
reject(new Error("evContext request timed out"));
|
|
2926
|
+
}, timeoutMs);
|
|
2927
|
+
pendingRequests.set(requestId, { resolve, reject, timeout });
|
|
2928
|
+
}
|
|
2929
|
+
try {
|
|
2930
|
+
iframe.contentWindow.postMessage({ ...message, requestId }, brokerOrigin());
|
|
2931
|
+
if (!expectReply) resolve(true);
|
|
2932
|
+
} catch (err) {
|
|
2933
|
+
if (expectReply) {
|
|
2934
|
+
const entry = pendingRequests.get(requestId);
|
|
2935
|
+
if (entry) {
|
|
2936
|
+
clearTimeout(entry.timeout);
|
|
2937
|
+
pendingRequests.delete(requestId);
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
reject(err);
|
|
2941
|
+
}
|
|
2942
|
+
}));
|
|
2943
|
+
}
|
|
2944
|
+
var evContext = {
|
|
2945
|
+
/**
|
|
2946
|
+
* Override the broker URL. Call once at app startup before any get/set.
|
|
2947
|
+
* Defaults to https://ev-context.empowered.vote/ for prod.
|
|
2948
|
+
*/
|
|
2949
|
+
configure({ brokerUrl: url } = {}) {
|
|
2950
|
+
if (url) brokerUrl = url;
|
|
2951
|
+
},
|
|
2952
|
+
/** Mount the iframe immediately (optional — get/set will mount lazily). */
|
|
2953
|
+
preload() {
|
|
2954
|
+
ensureMounted();
|
|
2955
|
+
return readyPromise;
|
|
2956
|
+
},
|
|
2957
|
+
/** Read the current shared context. Resolves to the stored value or null. */
|
|
2958
|
+
async get() {
|
|
2959
|
+
return send({ type: "ev-context:get" });
|
|
2960
|
+
},
|
|
2961
|
+
/** Overwrite the shared context. */
|
|
2962
|
+
async set(value) {
|
|
2963
|
+
return send({ type: "ev-context:set", value });
|
|
2964
|
+
},
|
|
2965
|
+
/** Clear the shared context. */
|
|
2966
|
+
async clear() {
|
|
2967
|
+
return send({ type: "ev-context:clear" });
|
|
2968
|
+
},
|
|
2969
|
+
/**
|
|
2970
|
+
* Subscribe to live updates. Fires when this tab or any other tab
|
|
2971
|
+
* (any subdomain) writes to the store. Returns an unsubscribe function.
|
|
2972
|
+
*/
|
|
2973
|
+
subscribe(fn) {
|
|
2974
|
+
subscribers.add(fn);
|
|
2975
|
+
send({ type: "ev-context:subscribe" }).then((value) => {
|
|
2976
|
+
lastValue = value != null ? value : lastValue;
|
|
2977
|
+
try {
|
|
2978
|
+
fn(lastValue);
|
|
2979
|
+
} catch {
|
|
2980
|
+
}
|
|
2981
|
+
}).catch(() => {
|
|
2982
|
+
});
|
|
2983
|
+
return () => {
|
|
2984
|
+
subscribers.delete(fn);
|
|
2985
|
+
};
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
|
|
2989
|
+
// src/CompassKey.jsx
|
|
2990
|
+
function CompassKey({ compact = false } = {}) {
|
|
2991
|
+
const [dismissed, setDismissed] = (0, import_react15.useState)(false);
|
|
2992
|
+
const [loaded, setLoaded] = (0, import_react15.useState)(false);
|
|
2993
|
+
(0, import_react15.useEffect)(() => {
|
|
2994
|
+
let cancelled = false;
|
|
2995
|
+
evContext.get().then((shared) => {
|
|
2996
|
+
if (cancelled) return;
|
|
2997
|
+
setDismissed(Boolean(shared == null ? void 0 : shared.compassKeyDismissed));
|
|
2998
|
+
setLoaded(true);
|
|
2999
|
+
}).catch(() => {
|
|
3000
|
+
if (!cancelled) setLoaded(true);
|
|
3001
|
+
});
|
|
3002
|
+
return () => {
|
|
3003
|
+
cancelled = true;
|
|
3004
|
+
};
|
|
3005
|
+
}, []);
|
|
3006
|
+
function persistDismissed(value) {
|
|
3007
|
+
evContext.get().then((current) => {
|
|
3008
|
+
const next = { ...current || {}, compassKeyDismissed: value };
|
|
3009
|
+
evContext.set(next).catch(() => {
|
|
3010
|
+
});
|
|
3011
|
+
}).catch(() => {
|
|
3012
|
+
});
|
|
3013
|
+
}
|
|
3014
|
+
function handleDismiss() {
|
|
3015
|
+
setDismissed(true);
|
|
3016
|
+
persistDismissed(true);
|
|
3017
|
+
}
|
|
3018
|
+
function handleReopen() {
|
|
3019
|
+
setDismissed(false);
|
|
3020
|
+
persistDismissed(false);
|
|
3021
|
+
}
|
|
3022
|
+
if (!loaded) return null;
|
|
3023
|
+
const Swatch = ({ color, label, ring }) => /* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3024
|
+
display: "inline-block",
|
|
3025
|
+
width: 12,
|
|
3026
|
+
height: 12,
|
|
3027
|
+
borderRadius: "50%",
|
|
3028
|
+
background: color,
|
|
3029
|
+
border: `2px solid ${ring || "#fff"}`,
|
|
3030
|
+
boxShadow: "0 0 0 1px rgba(0,0,0,0.08)"
|
|
3031
|
+
} }), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, label));
|
|
3032
|
+
if (dismissed) {
|
|
3033
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3034
|
+
"button",
|
|
3035
|
+
{
|
|
3036
|
+
type: "button",
|
|
3037
|
+
onClick: handleReopen,
|
|
3038
|
+
"aria-label": "Show compass legend",
|
|
3039
|
+
style: {
|
|
3040
|
+
display: "inline-flex",
|
|
3041
|
+
alignItems: "center",
|
|
3042
|
+
gap: spacing[1],
|
|
3043
|
+
padding: "4px 10px",
|
|
3044
|
+
borderRadius: borderRadius.full,
|
|
3045
|
+
background: "transparent",
|
|
3046
|
+
border: `1px solid ${colors.borderLight}`,
|
|
3047
|
+
color: colors.textMuted,
|
|
3048
|
+
fontFamily: fonts.primary,
|
|
3049
|
+
fontSize: fontSizes.xs,
|
|
3050
|
+
fontWeight: fontWeights.semibold,
|
|
3051
|
+
cursor: "pointer"
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { "aria-hidden": "true" }, "?"),
|
|
3055
|
+
" Compass key"
|
|
3056
|
+
);
|
|
3057
|
+
}
|
|
3058
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
3059
|
+
"div",
|
|
3060
|
+
{
|
|
3061
|
+
role: "region",
|
|
3062
|
+
"aria-label": "Compass legend",
|
|
3063
|
+
style: {
|
|
3064
|
+
display: "inline-flex",
|
|
3065
|
+
alignItems: "center",
|
|
3066
|
+
flexWrap: "wrap",
|
|
3067
|
+
gap: compact ? spacing[2] : spacing[3],
|
|
3068
|
+
padding: compact ? `${spacing[1]} ${spacing[2]}` : `${spacing[2]} ${spacing[3]}`,
|
|
3069
|
+
background: "#fff",
|
|
3070
|
+
border: `1px solid ${colors.borderLight}`,
|
|
3071
|
+
borderRadius: borderRadius.md,
|
|
3072
|
+
fontFamily: fonts.primary,
|
|
3073
|
+
maxWidth: "100%",
|
|
3074
|
+
boxSizing: "border-box"
|
|
3075
|
+
}
|
|
3076
|
+
},
|
|
3077
|
+
!compact && /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3078
|
+
fontSize: fontSizes.xs,
|
|
3079
|
+
fontWeight: fontWeights.semibold,
|
|
3080
|
+
color: colors.textMuted,
|
|
3081
|
+
textTransform: "uppercase",
|
|
3082
|
+
letterSpacing: "0.5px"
|
|
3083
|
+
} }, "Compass key"),
|
|
3084
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#7C6B9E", label: "You" }),
|
|
3085
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#5A9A6E", label: "Politician" }),
|
|
3086
|
+
/* @__PURE__ */ import_react15.default.createElement(Swatch, { color: "#fed12e", label: "Match" }),
|
|
3087
|
+
/* @__PURE__ */ import_react15.default.createElement("span", { style: { display: "inline-flex", alignItems: "center", gap: spacing[1] } }, /* @__PURE__ */ import_react15.default.createElement("span", { style: {
|
|
3088
|
+
fontSize: fontSizes.xs,
|
|
3089
|
+
fontWeight: fontWeights.semibold,
|
|
3090
|
+
color: "#9ca3af",
|
|
3091
|
+
fontFamily: fonts.primary,
|
|
3092
|
+
textDecoration: "underline",
|
|
3093
|
+
textDecorationStyle: "dashed",
|
|
3094
|
+
textUnderlineOffset: "3px"
|
|
3095
|
+
} }, "Topic"), /* @__PURE__ */ import_react15.default.createElement("span", { style: { fontSize: fontSizes.xs, color: colors.textSecondary, fontFamily: fonts.primary } }, "= no stance")),
|
|
3096
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
3097
|
+
"button",
|
|
3098
|
+
{
|
|
3099
|
+
type: "button",
|
|
3100
|
+
onClick: handleDismiss,
|
|
3101
|
+
"aria-label": "Hide compass legend",
|
|
3102
|
+
style: {
|
|
3103
|
+
marginLeft: spacing[2],
|
|
3104
|
+
padding: "2px 6px",
|
|
3105
|
+
border: "none",
|
|
3106
|
+
background: "transparent",
|
|
3107
|
+
color: colors.textMuted,
|
|
3108
|
+
fontSize: "16px",
|
|
3109
|
+
lineHeight: 1,
|
|
3110
|
+
cursor: "pointer"
|
|
3111
|
+
}
|
|
3112
|
+
},
|
|
3113
|
+
"\xD7"
|
|
3114
|
+
)
|
|
3115
|
+
);
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
// src/CategorySection.jsx
|
|
3119
|
+
var import_react16 = __toESM(require("react"));
|
|
2445
3120
|
function CategorySection({
|
|
2446
3121
|
title,
|
|
2447
3122
|
infoTooltip,
|
|
@@ -2451,7 +3126,7 @@ function CategorySection({
|
|
|
2451
3126
|
tier
|
|
2452
3127
|
}) {
|
|
2453
3128
|
var _a, _b;
|
|
2454
|
-
const [showTooltip, setShowTooltip] = (0,
|
|
3129
|
+
const [showTooltip, setShowTooltip] = (0, import_react16.useState)(false);
|
|
2455
3130
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2456
3131
|
const styles2 = {
|
|
2457
3132
|
section: {
|
|
@@ -2519,7 +3194,7 @@ function CategorySection({
|
|
|
2519
3194
|
gap: spacing[4]
|
|
2520
3195
|
}
|
|
2521
3196
|
};
|
|
2522
|
-
return /* @__PURE__ */
|
|
3197
|
+
return /* @__PURE__ */ import_react16.default.createElement("section", { style: styles2.section, className: "ev-category-section" }, /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react16.default.createElement("span", { style: styles2.titlePill }, title), infoTooltip && /* @__PURE__ */ import_react16.default.createElement(
|
|
2523
3198
|
"button",
|
|
2524
3199
|
{
|
|
2525
3200
|
type: "button",
|
|
@@ -2531,8 +3206,8 @@ function CategorySection({
|
|
|
2531
3206
|
"aria-label": `Info about ${title}`
|
|
2532
3207
|
},
|
|
2533
3208
|
"i",
|
|
2534
|
-
showTooltip && /* @__PURE__ */
|
|
2535
|
-
), websiteUrl && /* @__PURE__ */
|
|
3209
|
+
showTooltip && /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.tooltip, role: "tooltip" }, infoTooltip)
|
|
3210
|
+
), websiteUrl && /* @__PURE__ */ import_react16.default.createElement(
|
|
2536
3211
|
"a",
|
|
2537
3212
|
{
|
|
2538
3213
|
href: websiteUrl,
|
|
@@ -2541,7 +3216,7 @@ function CategorySection({
|
|
|
2541
3216
|
style: styles2.externalLink,
|
|
2542
3217
|
"aria-label": `Visit official website for ${title}`
|
|
2543
3218
|
},
|
|
2544
|
-
/* @__PURE__ */
|
|
3219
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
2545
3220
|
"svg",
|
|
2546
3221
|
{
|
|
2547
3222
|
viewBox: "0 0 24 24",
|
|
@@ -2549,7 +3224,7 @@ function CategorySection({
|
|
|
2549
3224
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2550
3225
|
style: { width: "14px", height: "14px" }
|
|
2551
3226
|
},
|
|
2552
|
-
/* @__PURE__ */
|
|
3227
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
2553
3228
|
"path",
|
|
2554
3229
|
{
|
|
2555
3230
|
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
|
|
@@ -2560,12 +3235,12 @@ function CategorySection({
|
|
|
2560
3235
|
}
|
|
2561
3236
|
)
|
|
2562
3237
|
)
|
|
2563
|
-
)), /* @__PURE__ */
|
|
3238
|
+
)), /* @__PURE__ */ import_react16.default.createElement("div", { style: styles2.grid, className: "ev-category-grid" }, children));
|
|
2564
3239
|
}
|
|
2565
3240
|
|
|
2566
3241
|
// src/SubGroupSection.jsx
|
|
2567
|
-
var
|
|
2568
|
-
function SubGroupSection({ title, websiteUrl, children }) {
|
|
3242
|
+
var import_react17 = __toESM(require("react"));
|
|
3243
|
+
function SubGroupSection({ title, websiteUrl, children, gridTemplateColumns, gap, justifyContent }) {
|
|
2569
3244
|
const styles2 = {
|
|
2570
3245
|
section: {
|
|
2571
3246
|
marginBottom: spacing[4]
|
|
@@ -2593,11 +3268,13 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2593
3268
|
},
|
|
2594
3269
|
grid: {
|
|
2595
3270
|
display: "grid",
|
|
2596
|
-
gridTemplateColumns: "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
2597
|
-
gap: spacing[2]
|
|
3271
|
+
gridTemplateColumns: gridTemplateColumns || "repeat(auto-fill, minmax(min(250px, 100%), 1fr))",
|
|
3272
|
+
gap: gap || spacing[2],
|
|
3273
|
+
justifyContent: justifyContent || void 0,
|
|
3274
|
+
width: "100%"
|
|
2598
3275
|
}
|
|
2599
3276
|
};
|
|
2600
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.section }, title && /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.header }, /* @__PURE__ */ import_react17.default.createElement("span", { style: styles2.label }, title), websiteUrl && /* @__PURE__ */ import_react17.default.createElement(
|
|
2601
3278
|
"a",
|
|
2602
3279
|
{
|
|
2603
3280
|
href: websiteUrl,
|
|
@@ -2605,12 +3282,12 @@ function SubGroupSection({ title, websiteUrl, children }) {
|
|
|
2605
3282
|
rel: "noopener noreferrer",
|
|
2606
3283
|
style: styles2.link
|
|
2607
3284
|
},
|
|
2608
|
-
/* @__PURE__ */
|
|
2609
|
-
)), /* @__PURE__ */
|
|
3285
|
+
/* @__PURE__ */ import_react17.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "12px", height: "12px" } }, /* @__PURE__ */ import_react17.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react17.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
3286
|
+
)), /* @__PURE__ */ import_react17.default.createElement("div", { style: styles2.grid, className: "ev-subgroup-grid" }, children));
|
|
2610
3287
|
}
|
|
2611
3288
|
|
|
2612
3289
|
// src/GovernmentBodySection.jsx
|
|
2613
|
-
var
|
|
3290
|
+
var import_react18 = __toESM(require("react"));
|
|
2614
3291
|
function GovernmentBodySection({
|
|
2615
3292
|
title,
|
|
2616
3293
|
websiteUrl,
|
|
@@ -2619,7 +3296,7 @@ function GovernmentBodySection({
|
|
|
2619
3296
|
children
|
|
2620
3297
|
}) {
|
|
2621
3298
|
var _a;
|
|
2622
|
-
const [expanded, setExpanded] = (0,
|
|
3299
|
+
const [expanded, setExpanded] = (0, import_react18.useState)(defaultExpanded);
|
|
2623
3300
|
const tierStyle = tier ? tierColors[tier] : null;
|
|
2624
3301
|
const accentColor = (_a = tierStyle == null ? void 0 : tierStyle.accent) != null ? _a : colors.borderMedium;
|
|
2625
3302
|
const styles2 = {
|
|
@@ -2659,7 +3336,7 @@ function GovernmentBodySection({
|
|
|
2659
3336
|
display: expanded ? "block" : "none"
|
|
2660
3337
|
}
|
|
2661
3338
|
};
|
|
2662
|
-
return /* @__PURE__ */
|
|
3339
|
+
return /* @__PURE__ */ import_react18.default.createElement("section", { style: styles2.section, className: "ev-gov-body-section" }, /* @__PURE__ */ import_react18.default.createElement(
|
|
2663
3340
|
"div",
|
|
2664
3341
|
{
|
|
2665
3342
|
style: styles2.header,
|
|
@@ -2675,8 +3352,8 @@ function GovernmentBodySection({
|
|
|
2675
3352
|
"aria-expanded": expanded,
|
|
2676
3353
|
"aria-label": `${expanded ? "Collapse" : "Expand"} ${title}`
|
|
2677
3354
|
},
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
websiteUrl && /* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.title }, title),
|
|
3356
|
+
websiteUrl && /* @__PURE__ */ import_react18.default.createElement(
|
|
2680
3357
|
"a",
|
|
2681
3358
|
{
|
|
2682
3359
|
href: websiteUrl,
|
|
@@ -2686,14 +3363,14 @@ function GovernmentBodySection({
|
|
|
2686
3363
|
onClick: (e) => e.stopPropagation(),
|
|
2687
3364
|
"aria-label": `Visit ${title} website`
|
|
2688
3365
|
},
|
|
2689
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ import_react18.default.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { width: "14px", height: "14px" } }, /* @__PURE__ */ import_react18.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react18.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z", stroke: "currentColor", strokeWidth: "2" }))
|
|
2690
3367
|
),
|
|
2691
|
-
/* @__PURE__ */
|
|
2692
|
-
), /* @__PURE__ */
|
|
3368
|
+
/* @__PURE__ */ import_react18.default.createElement("span", { style: styles2.toggle, "aria-hidden": "true" }, "\u25BC")
|
|
3369
|
+
), /* @__PURE__ */ import_react18.default.createElement("div", { style: styles2.content }, children));
|
|
2693
3370
|
}
|
|
2694
3371
|
|
|
2695
3372
|
// src/SocialLinks.jsx
|
|
2696
|
-
var
|
|
3373
|
+
var import_react19 = __toESM(require("react"));
|
|
2697
3374
|
var SOCIAL_PLATFORMS = [
|
|
2698
3375
|
{ test: /facebook\.com/i, platform: "facebook" },
|
|
2699
3376
|
{ test: /twitter\.com|x\.com/i, platform: "twitter" },
|
|
@@ -2764,7 +3441,7 @@ function SocialLinks({
|
|
|
2764
3441
|
}
|
|
2765
3442
|
};
|
|
2766
3443
|
const platformIconMap = {
|
|
2767
|
-
twitter: /* @__PURE__ */
|
|
3444
|
+
twitter: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2768
3445
|
"path",
|
|
2769
3446
|
{
|
|
2770
3447
|
d: "M4 4L10.5 12.5M20 20L13.5 11.5M10.5 12.5L4 20H8L13.5 11.5M10.5 12.5L16 4H20L13.5 11.5",
|
|
@@ -2774,7 +3451,7 @@ function SocialLinks({
|
|
|
2774
3451
|
strokeLinejoin: "round"
|
|
2775
3452
|
}
|
|
2776
3453
|
)),
|
|
2777
|
-
facebook: /* @__PURE__ */
|
|
3454
|
+
facebook: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2778
3455
|
"path",
|
|
2779
3456
|
{
|
|
2780
3457
|
d: "M18 2H15C13.6739 2 12.4021 2.52678 11.4645 3.46447C10.5268 4.40215 10 5.67392 10 7V10H7V14H10V22H14V14H17L18 10H14V7C14 6.73478 14.1054 6.48043 14.2929 6.29289C14.4804 6.10536 14.7348 6 15 6H18V2Z",
|
|
@@ -2784,8 +3461,8 @@ function SocialLinks({
|
|
|
2784
3461
|
strokeLinejoin: "round"
|
|
2785
3462
|
}
|
|
2786
3463
|
)),
|
|
2787
|
-
instagram: /* @__PURE__ */
|
|
2788
|
-
linkedin: /* @__PURE__ */
|
|
3464
|
+
instagram: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "18", cy: "6", r: "1", fill: "currentColor" })),
|
|
3465
|
+
linkedin: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement(
|
|
2789
3466
|
"path",
|
|
2790
3467
|
{
|
|
2791
3468
|
d: "M16 8C17.5913 8 19.1174 8.63214 20.2426 9.75736C21.3679 10.8826 22 12.4087 22 14V21H18V14C18 13.4696 17.7893 12.9609 17.4142 12.5858C17.0391 12.2107 16.5304 12 16 12C15.4696 12 14.9609 12.2107 14.5858 12.5858C14.2107 12.9609 14 13.4696 14 14V21H10V14C10 12.4087 10.6321 10.8826 11.7574 9.75736C12.8826 8.63214 14.4087 8 16 8Z",
|
|
@@ -2794,8 +3471,8 @@ function SocialLinks({
|
|
|
2794
3471
|
strokeLinecap: "round",
|
|
2795
3472
|
strokeLinejoin: "round"
|
|
2796
3473
|
}
|
|
2797
|
-
), /* @__PURE__ */
|
|
2798
|
-
youtube: /* @__PURE__ */
|
|
3474
|
+
), /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "9", width: "4", height: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "4", cy: "4", r: "2", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })),
|
|
3475
|
+
youtube: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("rect", { x: "2", y: "5", width: "20", height: "14", rx: "3", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement("polygon", { points: "10,9 16,12 10,15", fill: "currentColor" }))
|
|
2799
3476
|
};
|
|
2800
3477
|
const links = [
|
|
2801
3478
|
{
|
|
@@ -2821,7 +3498,7 @@ function SocialLinks({
|
|
|
2821
3498
|
{
|
|
2822
3499
|
href: website,
|
|
2823
3500
|
label: "Website",
|
|
2824
|
-
icon: /* @__PURE__ */
|
|
3501
|
+
icon: /* @__PURE__ */ import_react19.default.createElement("svg", { style: styles2.icon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ import_react19.default.createElement("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2" }), /* @__PURE__ */ import_react19.default.createElement(
|
|
2825
3502
|
"path",
|
|
2826
3503
|
{
|
|
2827
3504
|
d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z",
|
|
@@ -2851,7 +3528,7 @@ function SocialLinks({
|
|
|
2851
3528
|
if (links.length === 0) {
|
|
2852
3529
|
return null;
|
|
2853
3530
|
}
|
|
2854
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ import_react19.default.createElement("div", { style: styles2.container, className: "ev-social-links" }, links.map((link) => /* @__PURE__ */ import_react19.default.createElement(
|
|
2855
3532
|
"a",
|
|
2856
3533
|
{
|
|
2857
3534
|
key: link.label,
|
|
@@ -2874,7 +3551,7 @@ function SocialLinks({
|
|
|
2874
3551
|
}
|
|
2875
3552
|
|
|
2876
3553
|
// src/IssueTags.jsx
|
|
2877
|
-
var
|
|
3554
|
+
var import_react20 = __toESM(require("react"));
|
|
2878
3555
|
function IssueTags({
|
|
2879
3556
|
tags = [],
|
|
2880
3557
|
selectedTags = [],
|
|
@@ -2917,9 +3594,9 @@ function IssueTags({
|
|
|
2917
3594
|
onTagClick(tag.value);
|
|
2918
3595
|
}
|
|
2919
3596
|
};
|
|
2920
|
-
return /* @__PURE__ */
|
|
3597
|
+
return /* @__PURE__ */ import_react20.default.createElement("div", { style: styles2.container, className: "ev-issue-tags", role: "list" }, tags.map((tag) => {
|
|
2921
3598
|
const isSelected = selectedTags.includes(tag.value);
|
|
2922
|
-
return /* @__PURE__ */
|
|
3599
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
2923
3600
|
"span",
|
|
2924
3601
|
{
|
|
2925
3602
|
key: tag.value,
|
|
@@ -2948,7 +3625,7 @@ function IssueTags({
|
|
|
2948
3625
|
}
|
|
2949
3626
|
|
|
2950
3627
|
// src/CommitteeTable.jsx
|
|
2951
|
-
var
|
|
3628
|
+
var import_react21 = __toESM(require("react"));
|
|
2952
3629
|
var ROLE_ORDER = {
|
|
2953
3630
|
"chair": 0,
|
|
2954
3631
|
"co-chair": 1,
|
|
@@ -2975,7 +3652,7 @@ function CommitteeTable({
|
|
|
2975
3652
|
maxVisible = 6,
|
|
2976
3653
|
style = {}
|
|
2977
3654
|
}) {
|
|
2978
|
-
const [showAll, setShowAll] = (0,
|
|
3655
|
+
const [showAll, setShowAll] = (0, import_react21.useState)(false);
|
|
2979
3656
|
if (committees.length === 0) {
|
|
2980
3657
|
return null;
|
|
2981
3658
|
}
|
|
@@ -3037,7 +3714,7 @@ function CommitteeTable({
|
|
|
3037
3714
|
cursor: "pointer"
|
|
3038
3715
|
}
|
|
3039
3716
|
};
|
|
3040
|
-
return /* @__PURE__ */
|
|
3717
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { style: styles2.container, className: "ev-committee-table" }, /* @__PURE__ */ import_react21.default.createElement("h4", { style: styles2.heading }, /* @__PURE__ */ import_react21.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react21.default.createElement("path", { d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /* @__PURE__ */ import_react21.default.createElement("circle", { cx: "9", cy: "7", r: "4" }), /* @__PURE__ */ import_react21.default.createElement("path", { d: "M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" })), title), /* @__PURE__ */ import_react21.default.createElement("table", { style: styles2.table }, /* @__PURE__ */ import_react21.default.createElement("tbody", null, visible.map((committee, index) => /* @__PURE__ */ import_react21.default.createElement("tr", { key: index, style: styles2.row }, /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.nameCell } }, committee.url ? /* @__PURE__ */ import_react21.default.createElement(
|
|
3041
3718
|
"a",
|
|
3042
3719
|
{
|
|
3043
3720
|
href: committee.url,
|
|
@@ -3052,7 +3729,7 @@ function CommitteeTable({
|
|
|
3052
3729
|
}
|
|
3053
3730
|
},
|
|
3054
3731
|
committee.name
|
|
3055
|
-
) : committee.name), /* @__PURE__ */
|
|
3732
|
+
) : committee.name), /* @__PURE__ */ import_react21.default.createElement("td", { style: { ...styles2.cell, ...styles2.positionCell } }, formatPosition(committee.position)))))), hasMore && /* @__PURE__ */ import_react21.default.createElement(
|
|
3056
3733
|
"button",
|
|
3057
3734
|
{
|
|
3058
3735
|
type: "button",
|
|
@@ -3060,7 +3737,7 @@ function CommitteeTable({
|
|
|
3060
3737
|
onClick: () => setShowAll(!showAll)
|
|
3061
3738
|
},
|
|
3062
3739
|
showAll ? "Show less" : `Show all ${sorted.length} committees`,
|
|
3063
|
-
/* @__PURE__ */
|
|
3740
|
+
/* @__PURE__ */ import_react21.default.createElement(
|
|
3064
3741
|
"svg",
|
|
3065
3742
|
{
|
|
3066
3743
|
width: "14",
|
|
@@ -3073,16 +3750,16 @@ function CommitteeTable({
|
|
|
3073
3750
|
strokeLinejoin: "round",
|
|
3074
3751
|
style: { transform: showAll ? "rotate(180deg)" : "none", transition: "transform 0.2s" }
|
|
3075
3752
|
},
|
|
3076
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ import_react21.default.createElement("polyline", { points: "6 9 12 15 18 9" })
|
|
3077
3754
|
)
|
|
3078
3755
|
));
|
|
3079
3756
|
}
|
|
3080
3757
|
|
|
3081
3758
|
// src/PoliticianProfile.jsx
|
|
3082
|
-
var
|
|
3759
|
+
var import_react24 = __toESM(require("react"));
|
|
3083
3760
|
|
|
3084
3761
|
// src/LegislativeInlineSummary.jsx
|
|
3085
|
-
var
|
|
3762
|
+
var import_react22 = __toESM(require("react"));
|
|
3086
3763
|
function normalizePosition(pos) {
|
|
3087
3764
|
if (!pos) return "";
|
|
3088
3765
|
return pos.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
@@ -3190,7 +3867,7 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3190
3867
|
fontSize: fontSizes.sm,
|
|
3191
3868
|
fontWeight: fontWeights.medium
|
|
3192
3869
|
};
|
|
3193
|
-
return /* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { style: card }, stats.length > 0 && /* @__PURE__ */ import_react22.default.createElement("div", { style: statsRow }, stats.map((s, i) => /* @__PURE__ */ import_react22.default.createElement("div", { key: i, style: statItem }, /* @__PURE__ */ import_react22.default.createElement("span", { style: statValue }, s.value), s.label && /* @__PURE__ */ import_react22.default.createElement("span", { style: statLabel }, s.label)))), mostRecentAction && /* @__PURE__ */ import_react22.default.createElement("div", { style: actionLine, title: mostRecentAction }, mostRecentAction), /* @__PURE__ */ import_react22.default.createElement("div", null), /* @__PURE__ */ import_react22.default.createElement("div", { style: footerRow }, /* @__PURE__ */ import_react22.default.createElement(
|
|
3194
3871
|
"button",
|
|
3195
3872
|
{
|
|
3196
3873
|
onClick: () => {
|
|
@@ -3215,12 +3892,12 @@ function LegislativeInlineSummary({ summary, politicianId, onNavigateToRecord })
|
|
|
3215
3892
|
}
|
|
3216
3893
|
},
|
|
3217
3894
|
"View Full Legislative Record",
|
|
3218
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ import_react22.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react22.default.createElement("path", { d: "M9 18l6-6-6-6" }))
|
|
3219
3896
|
)));
|
|
3220
3897
|
}
|
|
3221
3898
|
|
|
3222
3899
|
// src/JudicialScorecard.jsx
|
|
3223
|
-
var
|
|
3900
|
+
var import_react23 = __toESM(require("react"));
|
|
3224
3901
|
|
|
3225
3902
|
// src/judicialUtils.js
|
|
3226
3903
|
function formatDate(dateStr) {
|
|
@@ -3338,7 +4015,7 @@ function JudicialScorecard({ judicialRecord, politicianId, onNavigateToRecord })
|
|
|
3338
4015
|
onNavigateToRecord(`/politician/${politicianId}/judicial-record`);
|
|
3339
4016
|
}
|
|
3340
4017
|
};
|
|
3341
|
-
return /* @__PURE__ */
|
|
4018
|
+
return /* @__PURE__ */ import_react23.default.createElement("section", { style: sectionStyle }, /* @__PURE__ */ import_react23.default.createElement("h3", { style: headingStyle }, "Judicial Record"), evaluations.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "16px" } }, evaluations.slice(0, 3).map((ev, i) => /* @__PURE__ */ import_react23.default.createElement("span", { key: i, style: evalChipStyle }, ev.rating, /* @__PURE__ */ import_react23.default.createElement("span", { style: { fontWeight: 400, color: "#4a90a4", fontSize: "11px" } }, "\u2014 ", ev.source)))), metrics.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: cardGridStyle }, metrics.slice(0, 4).map((m, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: metricCardStyle }, /* @__PURE__ */ import_react23.default.createElement("div", { style: metricLabelStyle }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react23.default.createElement("div", { style: metricValueStyle }, formatMetricValue(m.metric_type, m.value)), m.context_label && /* @__PURE__ */ import_react23.default.createElement("div", { style: metricContextStyle }, m.context_label)))), disciplinary.length > 0 && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginBottom: "12px" } }, disciplinary.slice(0, 2).map((d, i) => /* @__PURE__ */ import_react23.default.createElement("div", { key: i, style: disciplinaryStyle }, /* @__PURE__ */ import_react23.default.createElement("strong", null, d.record_type), " \u2014 ", formatDate(d.record_date), d.description && /* @__PURE__ */ import_react23.default.createElement("div", { style: { marginTop: "4px" } }, d.description)))), /* @__PURE__ */ import_react23.default.createElement("a", { href: `/politician/${politicianId}/judicial-record`, onClick: handleNavigate, style: linkStyle }, "View Full Judicial Record \u2192"));
|
|
3342
4019
|
}
|
|
3343
4020
|
|
|
3344
4021
|
// src/PoliticianProfile.jsx
|
|
@@ -3489,13 +4166,13 @@ function formatAddress(addr) {
|
|
|
3489
4166
|
if (cityStateZip) lines.push(cityStateZip);
|
|
3490
4167
|
return lines;
|
|
3491
4168
|
}
|
|
3492
|
-
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3493
|
-
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3494
|
-
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3495
|
-
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3496
|
-
var MailIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3497
|
-
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
3498
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */
|
|
4169
|
+
var CalendarIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" }));
|
|
4170
|
+
var ClockIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "12 6 12 12 16 14" }));
|
|
4171
|
+
var MapPinIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" }), /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "10", r: "3" }));
|
|
4172
|
+
var PhoneIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 10.8 19.79 19.79 0 01.07 2.18 2 2 0 012.02 0h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" }));
|
|
4173
|
+
var MailIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M4 4H20C21.1 4 22 4.9 22 6V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18V6C2 4.9 2.9 4 4 4Z" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M22 6L12 13L2 6" }));
|
|
4174
|
+
var GlobeIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ import_react24.default.createElement("path", { d: "M2 12H22M12 2C14.5 4.5 16 8 16 12C16 16 14.5 19.5 12 22C9.5 19.5 8 16 8 12C8 8 9.5 4.5 12 2Z" }));
|
|
4175
|
+
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ import_react24.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6" }), /* @__PURE__ */ import_react24.default.createElement("polyline", { points: "15 3 21 3 21 9" }), /* @__PURE__ */ import_react24.default.createElement("line", { x1: "10", y1: "14", x2: "21", y2: "3" }));
|
|
3499
4176
|
function PoliticianProfile({
|
|
3500
4177
|
politician = {},
|
|
3501
4178
|
onBack,
|
|
@@ -3522,8 +4199,8 @@ function PoliticianProfile({
|
|
|
3522
4199
|
return pol.photo_origin_url;
|
|
3523
4200
|
})();
|
|
3524
4201
|
const initials = [pol.first_name, pol.last_name].filter(Boolean).map((n) => n[0]).join("");
|
|
3525
|
-
const [imgError, setImgError] = (0,
|
|
3526
|
-
(0,
|
|
4202
|
+
const [imgError, setImgError] = (0, import_react24.useState)(false);
|
|
4203
|
+
(0, import_react24.useEffect)(() => {
|
|
3527
4204
|
setImgError(false);
|
|
3528
4205
|
}, [profileImageUrl]);
|
|
3529
4206
|
const getSocialHandle = (type) => {
|
|
@@ -3823,7 +4500,7 @@ function PoliticianProfile({
|
|
|
3823
4500
|
borderRadius: borderRadius.full
|
|
3824
4501
|
}
|
|
3825
4502
|
};
|
|
3826
|
-
return /* @__PURE__ */
|
|
4503
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.container, className: "ev-politician-profile" }, onBack && /* @__PURE__ */ import_react24.default.createElement(
|
|
3827
4504
|
"button",
|
|
3828
4505
|
{
|
|
3829
4506
|
type: "button",
|
|
@@ -3836,9 +4513,9 @@ function PoliticianProfile({
|
|
|
3836
4513
|
e.currentTarget.style.textDecoration = "none";
|
|
3837
4514
|
}
|
|
3838
4515
|
},
|
|
3839
|
-
/* @__PURE__ */
|
|
4516
|
+
/* @__PURE__ */ import_react24.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react24.default.createElement("path", { d: "M15 19l-7-7 7-7" })),
|
|
3840
4517
|
label
|
|
3841
|
-
), /* @__PURE__ */
|
|
4518
|
+
), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.card }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.heroRow }, /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.photoWrap }, profileImageUrl && !imgError ? /* @__PURE__ */ import_react24.default.createElement(
|
|
3842
4519
|
"img",
|
|
3843
4520
|
{
|
|
3844
4521
|
src: profileImageUrl,
|
|
@@ -3846,7 +4523,7 @@ function PoliticianProfile({
|
|
|
3846
4523
|
style: styles2.photo,
|
|
3847
4524
|
onError: () => setImgError(true)
|
|
3848
4525
|
}
|
|
3849
|
-
) : /* @__PURE__ */
|
|
4526
|
+
) : /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.placeholder }, initials || "?")), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.infoCol }, styles2.tierBadge && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.tierBadge }, tier), /* @__PURE__ */ import_react24.default.createElement("h1", { style: styles2.name }, displayName), banner, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.roleLine }, roleLine), pol.office_description && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.officeDesc }, pol.office_description), pol.bio_text && /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.bioText }, pol.bio_text), (termLine || pol.total_years_in_office > 0) && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.metaRow }, termLine && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(CalendarIcon, { size: 14 }), termLine), pol.total_years_in_office > 0 && /* @__PURE__ */ import_react24.default.createElement("span", { style: styles2.metaItem }, /* @__PURE__ */ import_react24.default.createElement(ClockIcon, { size: 14 }), pol.total_years_in_office, " ", pol.total_years_in_office === 1 ? "year" : "years", " in office")), pol.web_form_url && /* @__PURE__ */ import_react24.default.createElement(
|
|
3850
4527
|
"a",
|
|
3851
4528
|
{
|
|
3852
4529
|
href: pol.web_form_url,
|
|
@@ -3860,9 +4537,9 @@ function PoliticianProfile({
|
|
|
3860
4537
|
e.currentTarget.style.background = colors.evTeal;
|
|
3861
4538
|
}
|
|
3862
4539
|
},
|
|
3863
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ import_react24.default.createElement(ExternalLinkIcon, { size: 14 }),
|
|
3864
4541
|
"Submit a Message"
|
|
3865
|
-
))), hasContactInfo && /* @__PURE__ */
|
|
4542
|
+
))), hasContactInfo && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement("div", { style: sectionHeading }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 20 }), "Contact Information"), /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGrid }, hasAddresses && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MapPinIcon, { size: 12 }), "Addresses"), addresses.map((addr, i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `addr-${i}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, addr.type), /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactValue }, addr.lines.map((line, j) => /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, { key: j }, line, j < addr.lines.length - 1 && /* @__PURE__ */ import_react24.default.createElement("br", null))))))), hasPhones && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(PhoneIcon, { size: 12 }), "Phone"), Object.entries(phonesByType).map(([type, phones], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `phone-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), phones.map((phone, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3866
4543
|
"a",
|
|
3867
4544
|
{
|
|
3868
4545
|
href: `tel:${phone}`,
|
|
@@ -3875,7 +4552,7 @@ function PoliticianProfile({
|
|
|
3875
4552
|
}
|
|
3876
4553
|
},
|
|
3877
4554
|
phone
|
|
3878
|
-
)))))), hasEmails && /* @__PURE__ */
|
|
4555
|
+
)))))), hasEmails && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(MailIcon, { size: 12 }), "Email"), Object.entries(emailsByType).filter(([, emails]) => emails.some((e) => e && e.trim())).map(([type, emails], i) => /* @__PURE__ */ import_react24.default.createElement("div", { key: `email-${type}` }, /* @__PURE__ */ import_react24.default.createElement("p", { style: { ...styles2.contactSubLabel, ...i === 0 ? { marginTop: 0 } : { marginTop: spacing[2] } } }, type), emails.filter((e) => e && e.trim()).map((email, j) => /* @__PURE__ */ import_react24.default.createElement("p", { key: j, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3879
4556
|
"a",
|
|
3880
4557
|
{
|
|
3881
4558
|
href: `mailto:${email}`,
|
|
@@ -3888,7 +4565,7 @@ function PoliticianProfile({
|
|
|
3888
4565
|
}
|
|
3889
4566
|
},
|
|
3890
4567
|
email
|
|
3891
|
-
)))))), hasWebsitesCol && /* @__PURE__ */
|
|
4568
|
+
)))))), hasWebsitesCol && /* @__PURE__ */ import_react24.default.createElement("div", { style: styles2.contactGroup }, /* @__PURE__ */ import_react24.default.createElement("p", { style: styles2.contactLabel }, /* @__PURE__ */ import_react24.default.createElement(GlobeIcon, { size: 12 }), "Websites"), allWebsites.map((url, i) => /* @__PURE__ */ import_react24.default.createElement("p", { key: i, style: styles2.contactValue }, /* @__PURE__ */ import_react24.default.createElement(
|
|
3892
4569
|
"a",
|
|
3893
4570
|
{
|
|
3894
4571
|
href: url,
|
|
@@ -3903,7 +4580,7 @@ function PoliticianProfile({
|
|
|
3903
4580
|
}
|
|
3904
4581
|
},
|
|
3905
4582
|
extractDomain(url)
|
|
3906
|
-
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */
|
|
4583
|
+
))), (hasSocial || socialWebsiteUrls.length > 0) && /* @__PURE__ */ import_react24.default.createElement(
|
|
3907
4584
|
SocialLinks,
|
|
3908
4585
|
{
|
|
3909
4586
|
twitter,
|
|
@@ -3914,14 +4591,14 @@ function PoliticianProfile({
|
|
|
3914
4591
|
size: "sm",
|
|
3915
4592
|
style: { marginTop: allWebsites.length > 0 ? "8px" : 0 }
|
|
3916
4593
|
}
|
|
3917
|
-
)))), committees.length > 0 && /* @__PURE__ */
|
|
4594
|
+
)))), committees.length > 0 && /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement("div", { style: divider }), /* @__PURE__ */ import_react24.default.createElement(CommitteeTable, { committees })), pol.is_judicial ? /* @__PURE__ */ import_react24.default.createElement(
|
|
3918
4595
|
JudicialScorecard,
|
|
3919
4596
|
{
|
|
3920
4597
|
judicialRecord,
|
|
3921
4598
|
politicianId,
|
|
3922
4599
|
onNavigateToRecord
|
|
3923
4600
|
}
|
|
3924
|
-
) : /* @__PURE__ */
|
|
4601
|
+
) : /* @__PURE__ */ import_react24.default.createElement(
|
|
3925
4602
|
LegislativeInlineSummary,
|
|
3926
4603
|
{
|
|
3927
4604
|
summary: legislativeSummary,
|
|
@@ -3932,7 +4609,7 @@ function PoliticianProfile({
|
|
|
3932
4609
|
}
|
|
3933
4610
|
|
|
3934
4611
|
// src/LegislativeRecord.jsx
|
|
3935
|
-
var
|
|
4612
|
+
var import_react25 = __toESM(require("react"));
|
|
3936
4613
|
var DEFAULT_LIMIT = 25;
|
|
3937
4614
|
function normalizeText(str) {
|
|
3938
4615
|
if (!str) return "";
|
|
@@ -4012,7 +4689,7 @@ function getPositionBadge(position) {
|
|
|
4012
4689
|
return { bg: colors.borderLight, text: colors.textSecondary };
|
|
4013
4690
|
}
|
|
4014
4691
|
function Badge({ label, bg, text }) {
|
|
4015
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4016
4693
|
display: "inline-block",
|
|
4017
4694
|
background: bg,
|
|
4018
4695
|
color: text,
|
|
@@ -4025,18 +4702,18 @@ function Badge({ label, bg, text }) {
|
|
|
4025
4702
|
} }, label);
|
|
4026
4703
|
}
|
|
4027
4704
|
function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
4028
|
-
return /* @__PURE__ */
|
|
4705
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4029
4706
|
display: "flex",
|
|
4030
4707
|
alignItems: "center",
|
|
4031
4708
|
justifyContent: "space-between",
|
|
4032
4709
|
marginBottom: spacing[4]
|
|
4033
|
-
} }, /* @__PURE__ */
|
|
4710
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("h2", { style: {
|
|
4034
4711
|
fontFamily: fonts.primary,
|
|
4035
4712
|
fontSize: fontSizes.xl,
|
|
4036
4713
|
fontWeight: fontWeights.bold,
|
|
4037
4714
|
color: colors.evTeal,
|
|
4038
4715
|
margin: 0
|
|
4039
|
-
} }, title), years && years.length > 0 && /* @__PURE__ */
|
|
4716
|
+
} }, title), years && years.length > 0 && /* @__PURE__ */ import_react25.default.createElement(
|
|
4040
4717
|
"select",
|
|
4041
4718
|
{
|
|
4042
4719
|
value: yearFilter,
|
|
@@ -4052,13 +4729,13 @@ function SectionHeader({ title, yearFilter, years, onYearChange }) {
|
|
|
4052
4729
|
cursor: "pointer"
|
|
4053
4730
|
}
|
|
4054
4731
|
},
|
|
4055
|
-
/* @__PURE__ */
|
|
4056
|
-
years.map((y) => /* @__PURE__ */
|
|
4732
|
+
/* @__PURE__ */ import_react25.default.createElement("option", { value: "All" }, "All years"),
|
|
4733
|
+
years.map((y) => /* @__PURE__ */ import_react25.default.createElement("option", { key: y, value: y }, y))
|
|
4057
4734
|
));
|
|
4058
4735
|
}
|
|
4059
4736
|
function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
4060
4737
|
if (totalCount <= visibleCount) return null;
|
|
4061
|
-
return /* @__PURE__ */
|
|
4738
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { textAlign: "center", marginTop: spacing[3] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4062
4739
|
"button",
|
|
4063
4740
|
{
|
|
4064
4741
|
type: "button",
|
|
@@ -4086,7 +4763,7 @@ function ShowAllLink({ totalCount, visibleCount, onClick }) {
|
|
|
4086
4763
|
));
|
|
4087
4764
|
}
|
|
4088
4765
|
function EmptyState({ message }) {
|
|
4089
|
-
return /* @__PURE__ */
|
|
4766
|
+
return /* @__PURE__ */ import_react25.default.createElement("p", { style: {
|
|
4090
4767
|
fontFamily: fonts.primary,
|
|
4091
4768
|
fontSize: fontSizes.sm,
|
|
4092
4769
|
color: colors.textMuted,
|
|
@@ -4096,24 +4773,24 @@ function EmptyState({ message }) {
|
|
|
4096
4773
|
} }, message);
|
|
4097
4774
|
}
|
|
4098
4775
|
function Spinner() {
|
|
4099
|
-
return /* @__PURE__ */
|
|
4776
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4100
4777
|
display: "flex",
|
|
4101
4778
|
justifyContent: "center",
|
|
4102
4779
|
alignItems: "center",
|
|
4103
4780
|
padding: spacing[10]
|
|
4104
|
-
} }, /* @__PURE__ */
|
|
4781
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4105
4782
|
width: "40px",
|
|
4106
4783
|
height: "40px",
|
|
4107
4784
|
borderRadius: borderRadius.full,
|
|
4108
4785
|
border: `3px solid ${colors.borderLight}`,
|
|
4109
4786
|
borderTopColor: colors.evTeal,
|
|
4110
4787
|
animation: "ev-spin 0.8s linear infinite"
|
|
4111
|
-
} }), /* @__PURE__ */
|
|
4788
|
+
} }), /* @__PURE__ */ import_react25.default.createElement("style", null, `@keyframes ev-spin { to { transform: rotate(360deg); } }`));
|
|
4112
4789
|
}
|
|
4113
4790
|
function CommitteesSection({ committees, leadership }) {
|
|
4114
|
-
const [showAll, setShowAll] = (0,
|
|
4791
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4115
4792
|
const visible = showAll ? committees : committees.slice(0, DEFAULT_LIMIT);
|
|
4116
|
-
return /* @__PURE__ */
|
|
4793
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(SectionHeader, { title: "Committees & Leadership" }), leadership && leadership.length > 0 && /* @__PURE__ */ import_react25.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: spacing[2], marginBottom: spacing[4] } }, leadership.map((role, i) => /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4117
4794
|
display: "inline-flex",
|
|
4118
4795
|
alignItems: "center",
|
|
4119
4796
|
gap: spacing[1],
|
|
@@ -4124,23 +4801,23 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4124
4801
|
fontFamily: fonts.primary,
|
|
4125
4802
|
fontSize: fontSizes.sm,
|
|
4126
4803
|
fontWeight: fontWeights.semibold
|
|
4127
|
-
} }, role.title, role.chamber && /* @__PURE__ */
|
|
4804
|
+
} }, role.title, role.chamber && /* @__PURE__ */ import_react25.default.createElement("span", { style: { fontWeight: fontWeights.regular, opacity: 0.85 } }, "(", role.chamber, ")")))), committees.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Committee information is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((c, i) => {
|
|
4128
4805
|
const badge = getRoleBadge(c.role);
|
|
4129
|
-
return /* @__PURE__ */
|
|
4806
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4130
4807
|
display: "flex",
|
|
4131
4808
|
alignItems: "center",
|
|
4132
4809
|
justifyContent: "space-between",
|
|
4133
4810
|
padding: `${spacing[3]} 0`,
|
|
4134
4811
|
borderBottom: `1px solid ${colors.borderLight}`,
|
|
4135
4812
|
gap: spacing[3]
|
|
4136
|
-
} }, /* @__PURE__ */
|
|
4813
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4137
4814
|
fontFamily: fonts.primary,
|
|
4138
4815
|
fontSize: fontSizes.sm,
|
|
4139
4816
|
color: colors.textSecondary,
|
|
4140
4817
|
flex: 1,
|
|
4141
4818
|
minWidth: 0
|
|
4142
|
-
} }, c.committee_name, c.parent_name && /* @__PURE__ */
|
|
4143
|
-
})), !showAll && /* @__PURE__ */
|
|
4819
|
+
} }, c.committee_name, c.parent_name && /* @__PURE__ */ import_react25.default.createElement("span", { style: { color: colors.textMuted, marginLeft: spacing[1] } }, "(", c.parent_name, ")")), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: badge.label, bg: badge.bg, text: badge.text }));
|
|
4820
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4144
4821
|
ShowAllLink,
|
|
4145
4822
|
{
|
|
4146
4823
|
totalCount: committees.length,
|
|
@@ -4151,15 +4828,15 @@ function CommitteesSection({ committees, leadership }) {
|
|
|
4151
4828
|
}
|
|
4152
4829
|
function LegislationSection({ bills, isMobile }) {
|
|
4153
4830
|
const years = getYears(bills, "introduced_at");
|
|
4154
|
-
const [yearFilter, setYearFilter] = (0,
|
|
4155
|
-
const [showAll, setShowAll] = (0,
|
|
4831
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
4832
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4156
4833
|
const handleYearChange = (y) => {
|
|
4157
4834
|
setYearFilter(y);
|
|
4158
4835
|
setShowAll(false);
|
|
4159
4836
|
};
|
|
4160
4837
|
const filtered = yearFilter === "All" ? bills : bills.filter((b) => extractYear(b.introduced_at) === yearFilter);
|
|
4161
4838
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4162
|
-
return /* @__PURE__ */
|
|
4839
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4163
4840
|
SectionHeader,
|
|
4164
4841
|
{
|
|
4165
4842
|
title: "Sponsored Legislation",
|
|
@@ -4167,42 +4844,42 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4167
4844
|
years,
|
|
4168
4845
|
onYearChange: handleYearChange
|
|
4169
4846
|
}
|
|
4170
|
-
), bills.length === 0 ? /* @__PURE__ */
|
|
4847
|
+
), bills.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Sponsored legislation data is not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((bill, i) => {
|
|
4171
4848
|
const statusBadge = getStatusBadge(bill.status_label);
|
|
4172
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4173
4850
|
display: "flex",
|
|
4174
4851
|
flexDirection: isMobile ? "column" : "row",
|
|
4175
4852
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4176
4853
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4177
4854
|
padding: `${spacing[3]} 0`,
|
|
4178
4855
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4179
|
-
} }, /* @__PURE__ */
|
|
4856
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4180
4857
|
fontFamily: fonts.primary,
|
|
4181
4858
|
fontSize: fontSizes.xs,
|
|
4182
4859
|
fontWeight: fontWeights.bold,
|
|
4183
4860
|
color: colors.textSecondary,
|
|
4184
4861
|
marginRight: spacing[2]
|
|
4185
|
-
} }, bill.number), /* @__PURE__ */
|
|
4862
|
+
} }, bill.number), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4186
4863
|
fontFamily: fonts.primary,
|
|
4187
4864
|
fontSize: fontSizes.sm,
|
|
4188
4865
|
color: colors.textSecondary
|
|
4189
|
-
} }, bill.title)), /* @__PURE__ */
|
|
4866
|
+
} }, bill.title)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4190
4867
|
display: "flex",
|
|
4191
4868
|
alignItems: "center",
|
|
4192
4869
|
gap: spacing[2],
|
|
4193
4870
|
flexShrink: 0,
|
|
4194
4871
|
flexWrap: "wrap"
|
|
4195
|
-
} }, /* @__PURE__ */
|
|
4872
|
+
} }, /* @__PURE__ */ import_react25.default.createElement(Badge, { label: bill.status_label || "Unknown", bg: statusBadge.bg, text: statusBadge.text }), bill.introduced_at && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4196
4873
|
fontFamily: fonts.primary,
|
|
4197
4874
|
fontSize: fontSizes.xs,
|
|
4198
4875
|
color: colors.textMuted
|
|
4199
|
-
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */
|
|
4876
|
+
} }, formatDate2(bill.introduced_at)), /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4200
4877
|
fontFamily: fonts.primary,
|
|
4201
4878
|
fontSize: fontSizes.xs,
|
|
4202
4879
|
color: colors.textMuted,
|
|
4203
4880
|
fontStyle: "italic"
|
|
4204
4881
|
} }, bill.is_sponsor ? "Sponsored" : "Cosponsored")));
|
|
4205
|
-
})), !showAll && /* @__PURE__ */
|
|
4882
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4206
4883
|
ShowAllLink,
|
|
4207
4884
|
{
|
|
4208
4885
|
totalCount: filtered.length,
|
|
@@ -4213,15 +4890,15 @@ function LegislationSection({ bills, isMobile }) {
|
|
|
4213
4890
|
}
|
|
4214
4891
|
function VotingSection({ votes, isMobile }) {
|
|
4215
4892
|
const years = getYears(votes, "vote_date");
|
|
4216
|
-
const [yearFilter, setYearFilter] = (0,
|
|
4217
|
-
const [showAll, setShowAll] = (0,
|
|
4893
|
+
const [yearFilter, setYearFilter] = (0, import_react25.useState)("All");
|
|
4894
|
+
const [showAll, setShowAll] = (0, import_react25.useState)(false);
|
|
4218
4895
|
const handleYearChange = (y) => {
|
|
4219
4896
|
setYearFilter(y);
|
|
4220
4897
|
setShowAll(false);
|
|
4221
4898
|
};
|
|
4222
4899
|
const filtered = yearFilter === "All" ? votes : votes.filter((v) => extractYear(v.vote_date) === yearFilter);
|
|
4223
4900
|
const visible = showAll ? filtered : filtered.slice(0, DEFAULT_LIMIT);
|
|
4224
|
-
return /* @__PURE__ */
|
|
4901
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { marginBottom: spacing[8] } }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4225
4902
|
SectionHeader,
|
|
4226
4903
|
{
|
|
4227
4904
|
title: "Voting Record",
|
|
@@ -4229,38 +4906,38 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4229
4906
|
years,
|
|
4230
4907
|
onYearChange: handleYearChange
|
|
4231
4908
|
}
|
|
4232
|
-
), votes.length === 0 ? /* @__PURE__ */
|
|
4909
|
+
), votes.length === 0 ? /* @__PURE__ */ import_react25.default.createElement(EmptyState, { message: "Voting records are not available for this office." }) : /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement("div", null, visible.map((vote, i) => {
|
|
4233
4910
|
const positionBadge = getPositionBadge(vote.position);
|
|
4234
4911
|
const normPosition = normalizeText(vote.position);
|
|
4235
4912
|
const topic = vote.bill_title || vote.vote_question;
|
|
4236
4913
|
const sourceUrl = vote.bill_url;
|
|
4237
|
-
return /* @__PURE__ */
|
|
4914
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { key: i, style: {
|
|
4238
4915
|
display: "flex",
|
|
4239
4916
|
flexDirection: isMobile ? "column" : "row",
|
|
4240
4917
|
alignItems: isMobile ? "flex-start" : "center",
|
|
4241
4918
|
gap: isMobile ? spacing[1] : spacing[3],
|
|
4242
4919
|
padding: `${spacing[3]} 0`,
|
|
4243
4920
|
borderBottom: `1px solid ${colors.borderLight}`
|
|
4244
|
-
} }, /* @__PURE__ */
|
|
4921
|
+
} }, /* @__PURE__ */ import_react25.default.createElement("div", { style: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4245
4922
|
fontFamily: fonts.primary,
|
|
4246
4923
|
fontSize: fontSizes.sm,
|
|
4247
4924
|
color: colors.textSecondary
|
|
4248
|
-
} }, topic)), /* @__PURE__ */
|
|
4925
|
+
} }, topic)), /* @__PURE__ */ import_react25.default.createElement("div", { style: {
|
|
4249
4926
|
display: "flex",
|
|
4250
4927
|
alignItems: "center",
|
|
4251
4928
|
gap: spacing[2],
|
|
4252
4929
|
flexShrink: 0,
|
|
4253
4930
|
flexWrap: "wrap"
|
|
4254
|
-
} }, vote.vote_date && /* @__PURE__ */
|
|
4931
|
+
} }, vote.vote_date && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4255
4932
|
fontFamily: fonts.primary,
|
|
4256
4933
|
fontSize: fontSizes.xs,
|
|
4257
4934
|
color: colors.textMuted
|
|
4258
|
-
} }, formatDate2(vote.vote_date)), /* @__PURE__ */
|
|
4935
|
+
} }, formatDate2(vote.vote_date)), /* @__PURE__ */ import_react25.default.createElement(Badge, { label: normPosition || "Unknown", bg: positionBadge.bg, text: positionBadge.text }), vote.result && /* @__PURE__ */ import_react25.default.createElement("span", { style: {
|
|
4259
4936
|
fontFamily: fonts.primary,
|
|
4260
4937
|
fontSize: fontSizes.xs,
|
|
4261
4938
|
color: vote.result === "Passed" ? colors.success : colors.textMuted,
|
|
4262
4939
|
fontWeight: fontWeights.medium
|
|
4263
|
-
} }, vote.result), sourceUrl && /* @__PURE__ */
|
|
4940
|
+
} }, vote.result), sourceUrl && /* @__PURE__ */ import_react25.default.createElement(
|
|
4264
4941
|
"a",
|
|
4265
4942
|
{
|
|
4266
4943
|
href: sourceUrl,
|
|
@@ -4281,7 +4958,7 @@ function VotingSection({ votes, isMobile }) {
|
|
|
4281
4958
|
},
|
|
4282
4959
|
"Source"
|
|
4283
4960
|
)));
|
|
4284
|
-
})), !showAll && /* @__PURE__ */
|
|
4961
|
+
})), !showAll && /* @__PURE__ */ import_react25.default.createElement(
|
|
4285
4962
|
ShowAllLink,
|
|
4286
4963
|
{
|
|
4287
4964
|
totalCount: filtered.length,
|
|
@@ -4300,20 +4977,20 @@ function LegislativeRecord({
|
|
|
4300
4977
|
}) {
|
|
4301
4978
|
const isMobile = useMediaQuery("(max-width: 768px)");
|
|
4302
4979
|
if (loading) {
|
|
4303
|
-
return /* @__PURE__ */
|
|
4980
|
+
return /* @__PURE__ */ import_react25.default.createElement(Spinner, null);
|
|
4304
4981
|
}
|
|
4305
|
-
return /* @__PURE__ */
|
|
4982
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", { style: { fontFamily: fonts.primary } }, politicianName && /* @__PURE__ */ import_react25.default.createElement("h1", { style: {
|
|
4306
4983
|
fontFamily: fonts.primary,
|
|
4307
4984
|
fontSize: isMobile ? fontSizes["2xl"] : fontSizes["4xl"],
|
|
4308
4985
|
fontWeight: fontWeights.bold,
|
|
4309
4986
|
color: colors.evTeal,
|
|
4310
4987
|
marginBottom: spacing[8],
|
|
4311
4988
|
marginTop: 0
|
|
4312
|
-
} }, "Legislative Record: ", politicianName), /* @__PURE__ */
|
|
4989
|
+
} }, "Legislative Record: ", politicianName), /* @__PURE__ */ import_react25.default.createElement(CommitteesSection, { committees, leadership }), /* @__PURE__ */ import_react25.default.createElement(LegislationSection, { bills, isMobile }), /* @__PURE__ */ import_react25.default.createElement(VotingSection, { votes, isMobile }));
|
|
4313
4990
|
}
|
|
4314
4991
|
|
|
4315
4992
|
// src/JudicialRecordDetail.jsx
|
|
4316
|
-
var
|
|
4993
|
+
var import_react26 = __toESM(require("react"));
|
|
4317
4994
|
var containerStyle = {
|
|
4318
4995
|
fontFamily: "'Manrope', sans-serif",
|
|
4319
4996
|
maxWidth: "800px"
|
|
@@ -4398,7 +5075,7 @@ var emptyStateStyle = {
|
|
|
4398
5075
|
function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
4399
5076
|
var _a;
|
|
4400
5077
|
if (!judicialRecord) {
|
|
4401
|
-
return /* @__PURE__ */
|
|
5078
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No judicial record data available."));
|
|
4402
5079
|
}
|
|
4403
5080
|
const {
|
|
4404
5081
|
judge_detail: detail,
|
|
@@ -4407,13 +5084,13 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4407
5084
|
disciplinary_records: disciplinary = []
|
|
4408
5085
|
} = judicialRecord;
|
|
4409
5086
|
const displayName = politician.full_name || `${politician.first_name || ""} ${politician.last_name || ""}`.trim();
|
|
4410
|
-
return /* @__PURE__ */
|
|
5087
|
+
return /* @__PURE__ */ import_react26.default.createElement("div", { style: containerStyle }, /* @__PURE__ */ import_react26.default.createElement("button", { style: backBtnStyle, onClick: onBack }, "\u2190 Back to Profile"), /* @__PURE__ */ import_react26.default.createElement("h1", { style: nameStyle }, displayName), /* @__PURE__ */ import_react26.default.createElement("p", { style: roleStyle }, (detail == null ? void 0 : detail.court_role) || politician.office_title, (detail == null ? void 0 : detail.date_seated) && ` \xB7 Seated ${formatDate(detail.date_seated)}`), detail && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Background"), detail.appointed_by && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Appointed by"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.appointed_by, " (", detail.appointing_president_party, ")")), detail.confirmation_vote && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Confirmation Vote"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.confirmation_vote)), detail.election_type && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Election Type"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.election_type === "retention" ? "Retention (Yes/No)" : "Contested Election")), ((_a = detail.areas_of_focus) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ import_react26.default.createElement("div", { style: detailRowStyle }, /* @__PURE__ */ import_react26.default.createElement("span", { style: detailLabelStyle }, "Areas of Focus"), /* @__PURE__ */ import_react26.default.createElement("span", { style: detailValueStyle }, detail.areas_of_focus.join(", ")))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Evaluations"), evaluations.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No evaluation data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Source"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Rating"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Date"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, evaluations.map((ev, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, ev.source_url ? /* @__PURE__ */ import_react26.default.createElement("a", { href: ev.source_url, target: "_blank", rel: "noopener noreferrer", style: { color: "#319795" } }, ev.source) : ev.source), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, ev.rating), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatDate(ev.rating_date)))))), /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Performance Metrics"), metrics.length === 0 ? /* @__PURE__ */ import_react26.default.createElement("div", { style: emptyStateStyle }, "No performance metric data available yet.") : /* @__PURE__ */ import_react26.default.createElement("table", { style: tableStyle }, /* @__PURE__ */ import_react26.default.createElement("thead", null, /* @__PURE__ */ import_react26.default.createElement("tr", null, /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Metric"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Value"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Context"), /* @__PURE__ */ import_react26.default.createElement("th", { style: thStyle }, "Period"))), /* @__PURE__ */ import_react26.default.createElement("tbody", null, metrics.map((m, i) => /* @__PURE__ */ import_react26.default.createElement("tr", { key: i }, /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, fontWeight: 600 } }, METRIC_LABELS[m.metric_type] || m.metric_type.replace(/_/g, " ")), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, formatMetricValue(m.metric_type, m.value)), /* @__PURE__ */ import_react26.default.createElement("td", { style: { ...tdStyle, color: "#718096", fontSize: "13px" } }, m.context_label), /* @__PURE__ */ import_react26.default.createElement("td", { style: tdStyle }, m.time_period))))), disciplinary.length > 0 && /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement("h2", { style: sectionHeadingStyle }, "Disciplinary History"), disciplinary.map((d, i) => /* @__PURE__ */ import_react26.default.createElement("div", { key: i, style: {
|
|
4411
5088
|
borderLeft: "3px solid #fc8181",
|
|
4412
5089
|
backgroundColor: "#fff5f5",
|
|
4413
5090
|
borderRadius: "0 6px 6px 0",
|
|
4414
5091
|
padding: "12px 16px",
|
|
4415
5092
|
marginBottom: "10px"
|
|
4416
|
-
} }, /* @__PURE__ */
|
|
5093
|
+
} }, /* @__PURE__ */ import_react26.default.createElement("div", { style: { fontWeight: 700, color: "#742a2a", fontSize: "14px" } }, d.record_type, " \u2014 ", formatDate(d.record_date)), d.description && /* @__PURE__ */ import_react26.default.createElement("div", { style: { color: "#9b2c2c", fontSize: "13px", marginTop: "4px" } }, d.description), d.source_url && /* @__PURE__ */ import_react26.default.createElement(
|
|
4417
5094
|
"a",
|
|
4418
5095
|
{
|
|
4419
5096
|
href: d.source_url,
|
|
@@ -4426,7 +5103,7 @@ function JudicialRecordDetail({ politician = {}, judicialRecord, onBack }) {
|
|
|
4426
5103
|
}
|
|
4427
5104
|
|
|
4428
5105
|
// src/AuthForm.jsx
|
|
4429
|
-
var
|
|
5106
|
+
var import_react27 = __toESM(require("react"));
|
|
4430
5107
|
function AuthForm({
|
|
4431
5108
|
logoSrc = "/EVLogo.svg",
|
|
4432
5109
|
appName = "Empowered Vote",
|
|
@@ -4437,11 +5114,11 @@ function AuthForm({
|
|
|
4437
5114
|
error = null,
|
|
4438
5115
|
submitting = false
|
|
4439
5116
|
}) {
|
|
4440
|
-
const [username, setUsername] = (0,
|
|
4441
|
-
const [password, setPassword] = (0,
|
|
4442
|
-
const [confirmPassword, setConfirmPassword] = (0,
|
|
4443
|
-
const [showPasswords, setShowPasswords] = (0,
|
|
4444
|
-
const [passwordMismatch, setPasswordMismatch] = (0,
|
|
5117
|
+
const [username, setUsername] = (0, import_react27.useState)("");
|
|
5118
|
+
const [password, setPassword] = (0, import_react27.useState)("");
|
|
5119
|
+
const [confirmPassword, setConfirmPassword] = (0, import_react27.useState)("");
|
|
5120
|
+
const [showPasswords, setShowPasswords] = (0, import_react27.useState)(false);
|
|
5121
|
+
const [passwordMismatch, setPasswordMismatch] = (0, import_react27.useState)(false);
|
|
4445
5122
|
const isLogin = mode === "login";
|
|
4446
5123
|
const handleSubmit = (e) => {
|
|
4447
5124
|
e.preventDefault();
|
|
@@ -4453,7 +5130,7 @@ function AuthForm({
|
|
|
4453
5130
|
setPasswordMismatch(false);
|
|
4454
5131
|
onSubmit == null ? void 0 : onSubmit(username.trim(), password);
|
|
4455
5132
|
};
|
|
4456
|
-
const EyeOpen = () => /* @__PURE__ */
|
|
5133
|
+
const EyeOpen = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4457
5134
|
"svg",
|
|
4458
5135
|
{
|
|
4459
5136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4463,7 +5140,7 @@ function AuthForm({
|
|
|
4463
5140
|
stroke: "currentColor",
|
|
4464
5141
|
style: { width: "20px", height: "20px" }
|
|
4465
5142
|
},
|
|
4466
|
-
/* @__PURE__ */
|
|
5143
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4467
5144
|
"path",
|
|
4468
5145
|
{
|
|
4469
5146
|
strokeLinecap: "round",
|
|
@@ -4471,7 +5148,7 @@ function AuthForm({
|
|
|
4471
5148
|
d: "M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"
|
|
4472
5149
|
}
|
|
4473
5150
|
),
|
|
4474
|
-
/* @__PURE__ */
|
|
5151
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4475
5152
|
"path",
|
|
4476
5153
|
{
|
|
4477
5154
|
strokeLinecap: "round",
|
|
@@ -4480,7 +5157,7 @@ function AuthForm({
|
|
|
4480
5157
|
}
|
|
4481
5158
|
)
|
|
4482
5159
|
);
|
|
4483
|
-
const EyeClosed = () => /* @__PURE__ */
|
|
5160
|
+
const EyeClosed = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4484
5161
|
"svg",
|
|
4485
5162
|
{
|
|
4486
5163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4490,7 +5167,7 @@ function AuthForm({
|
|
|
4490
5167
|
stroke: "currentColor",
|
|
4491
5168
|
style: { width: "20px", height: "20px" }
|
|
4492
5169
|
},
|
|
4493
|
-
/* @__PURE__ */
|
|
5170
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4494
5171
|
"path",
|
|
4495
5172
|
{
|
|
4496
5173
|
strokeLinecap: "round",
|
|
@@ -4499,17 +5176,17 @@ function AuthForm({
|
|
|
4499
5176
|
}
|
|
4500
5177
|
)
|
|
4501
5178
|
);
|
|
4502
|
-
const PasswordToggle = () => /* @__PURE__ */
|
|
5179
|
+
const PasswordToggle = () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4503
5180
|
"button",
|
|
4504
5181
|
{
|
|
4505
5182
|
type: "button",
|
|
4506
5183
|
onClick: () => setShowPasswords((prev) => !prev),
|
|
4507
5184
|
style: styles.passwordToggle
|
|
4508
5185
|
},
|
|
4509
|
-
showPasswords ? /* @__PURE__ */
|
|
5186
|
+
showPasswords ? /* @__PURE__ */ import_react27.default.createElement(EyeOpen, null) : /* @__PURE__ */ import_react27.default.createElement(EyeClosed, null)
|
|
4510
5187
|
);
|
|
4511
5188
|
const displayError = passwordMismatch ? "Passwords do not match." : error;
|
|
4512
|
-
return /* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.wrapper }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.container }, /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.header }, logoSrc && /* @__PURE__ */ import_react27.default.createElement("img", { src: logoSrc, alt: appName, style: styles.logo }), appName && /* @__PURE__ */ import_react27.default.createElement("h1", { style: styles.appName }, appName), appSubtitle && /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.appSubtitle }, appSubtitle)), /* @__PURE__ */ import_react27.default.createElement("form", { onSubmit: handleSubmit, style: styles.card }, /* @__PURE__ */ import_react27.default.createElement("h2", { style: styles.cardTitle }, isLogin ? "Welcome Back" : "Create Account"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Username"), /* @__PURE__ */ import_react27.default.createElement(
|
|
4513
5190
|
"input",
|
|
4514
5191
|
{
|
|
4515
5192
|
type: "text",
|
|
@@ -4526,7 +5203,7 @@ function AuthForm({
|
|
|
4526
5203
|
},
|
|
4527
5204
|
required: true
|
|
4528
5205
|
}
|
|
4529
|
-
)), /* @__PURE__ */
|
|
5206
|
+
)), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4530
5207
|
"input",
|
|
4531
5208
|
{
|
|
4532
5209
|
type: showPasswords ? "text" : "password",
|
|
@@ -4542,7 +5219,7 @@ function AuthForm({
|
|
|
4542
5219
|
},
|
|
4543
5220
|
required: true
|
|
4544
5221
|
}
|
|
4545
|
-
), /* @__PURE__ */
|
|
5222
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), !isLogin && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.fieldGroup }, /* @__PURE__ */ import_react27.default.createElement("label", { style: styles.label }, "Confirm Password"), /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.passwordWrapper }, /* @__PURE__ */ import_react27.default.createElement(
|
|
4546
5223
|
"input",
|
|
4547
5224
|
{
|
|
4548
5225
|
type: showPasswords ? "text" : "password",
|
|
@@ -4558,7 +5235,7 @@ function AuthForm({
|
|
|
4558
5235
|
},
|
|
4559
5236
|
required: true
|
|
4560
5237
|
}
|
|
4561
|
-
), /* @__PURE__ */
|
|
5238
|
+
), /* @__PURE__ */ import_react27.default.createElement(PasswordToggle, null))), displayError && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.errorBox }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.errorText }, displayError)), /* @__PURE__ */ import_react27.default.createElement(
|
|
4562
5239
|
"button",
|
|
4563
5240
|
{
|
|
4564
5241
|
type: "submit",
|
|
@@ -4576,7 +5253,7 @@ function AuthForm({
|
|
|
4576
5253
|
}
|
|
4577
5254
|
},
|
|
4578
5255
|
submitting ? isLogin ? "Signing In..." : "Creating Account..." : isLogin ? "Sign In" : "Create Account"
|
|
4579
|
-
), onModeSwitch && /* @__PURE__ */
|
|
5256
|
+
), onModeSwitch && /* @__PURE__ */ import_react27.default.createElement("div", { style: styles.modeSwitch }, /* @__PURE__ */ import_react27.default.createElement("p", { style: styles.modeSwitchText }, isLogin ? "Don't have an account?" : "Already have an account?"), /* @__PURE__ */ import_react27.default.createElement(
|
|
4580
5257
|
"button",
|
|
4581
5258
|
{
|
|
4582
5259
|
type: "button",
|
|
@@ -4749,9 +5426,9 @@ var styles = {
|
|
|
4749
5426
|
};
|
|
4750
5427
|
|
|
4751
5428
|
// src/TopicTierBadge.jsx
|
|
4752
|
-
var
|
|
5429
|
+
var import_react28 = __toESM(require("react"));
|
|
4753
5430
|
function LandmarkIcon({ size = 14 }) {
|
|
4754
|
-
return /* @__PURE__ */
|
|
5431
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4755
5432
|
"svg",
|
|
4756
5433
|
{
|
|
4757
5434
|
width: size,
|
|
@@ -4765,16 +5442,16 @@ function LandmarkIcon({ size = 14 }) {
|
|
|
4765
5442
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4766
5443
|
"aria-hidden": "true"
|
|
4767
5444
|
},
|
|
4768
|
-
/* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4773
|
-
/* @__PURE__ */
|
|
5445
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18v-7" }),
|
|
5446
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z" }),
|
|
5447
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M14 18v-7" }),
|
|
5448
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 18v-7" }),
|
|
5449
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M3 22h18" }),
|
|
5450
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 18v-7" })
|
|
4774
5451
|
);
|
|
4775
5452
|
}
|
|
4776
5453
|
function Building2Icon({ size = 14 }) {
|
|
4777
|
-
return /* @__PURE__ */
|
|
5454
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4778
5455
|
"svg",
|
|
4779
5456
|
{
|
|
4780
5457
|
width: size,
|
|
@@ -4788,17 +5465,17 @@ function Building2Icon({ size = 14 }) {
|
|
|
4788
5465
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4789
5466
|
"aria-hidden": "true"
|
|
4790
5467
|
},
|
|
4791
|
-
/* @__PURE__ */
|
|
4792
|
-
/* @__PURE__ */
|
|
4793
|
-
/* @__PURE__ */
|
|
4794
|
-
/* @__PURE__ */
|
|
4795
|
-
/* @__PURE__ */
|
|
4796
|
-
/* @__PURE__ */
|
|
4797
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
|
|
5469
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M6 12H4a2 2 0 0 0-2 2v8h4" }),
|
|
5470
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M18 9h2a2 2 0 0 1 2 2v11h-4" }),
|
|
5471
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 6h4" }),
|
|
5472
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 10h4" }),
|
|
5473
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 14h4" }),
|
|
5474
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "M10 18h4" })
|
|
4798
5475
|
);
|
|
4799
5476
|
}
|
|
4800
5477
|
function HomeIcon({ size = 14 }) {
|
|
4801
|
-
return /* @__PURE__ */
|
|
5478
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4802
5479
|
"svg",
|
|
4803
5480
|
{
|
|
4804
5481
|
width: size,
|
|
@@ -4812,8 +5489,8 @@ function HomeIcon({ size = 14 }) {
|
|
|
4812
5489
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4813
5490
|
"aria-hidden": "true"
|
|
4814
5491
|
},
|
|
4815
|
-
/* @__PURE__ */
|
|
4816
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ import_react28.default.createElement("path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }),
|
|
5493
|
+
/* @__PURE__ */ import_react28.default.createElement("polyline", { points: "9 22 9 12 15 12 15 22" })
|
|
4817
5494
|
);
|
|
4818
5495
|
}
|
|
4819
5496
|
var TIER_INFO = {
|
|
@@ -4873,7 +5550,7 @@ function TopicTierBadge({
|
|
|
4873
5550
|
userSelect: "none"
|
|
4874
5551
|
};
|
|
4875
5552
|
};
|
|
4876
|
-
return /* @__PURE__ */
|
|
5553
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4877
5554
|
"span",
|
|
4878
5555
|
{
|
|
4879
5556
|
className: "ev-topic-tier-badge",
|
|
@@ -4883,13 +5560,13 @@ function TopicTierBadge({
|
|
|
4883
5560
|
},
|
|
4884
5561
|
effectiveTiers.map((tier) => {
|
|
4885
5562
|
const { label, Icon } = TIER_INFO[tier];
|
|
4886
|
-
return /* @__PURE__ */
|
|
5563
|
+
return /* @__PURE__ */ import_react28.default.createElement("span", { key: tier, style: itemStyle(tier) }, /* @__PURE__ */ import_react28.default.createElement(Icon, { size: sizeStyle.iconSize }), !iconOnly && /* @__PURE__ */ import_react28.default.createElement("span", null, label));
|
|
4887
5564
|
})
|
|
4888
5565
|
);
|
|
4889
5566
|
}
|
|
4890
5567
|
|
|
4891
5568
|
// src/CompassCoverageCallout.jsx
|
|
4892
|
-
var
|
|
5569
|
+
var import_react29 = __toESM(require("react"));
|
|
4893
5570
|
var TIER_LABELS = {
|
|
4894
5571
|
federal: "federal",
|
|
4895
5572
|
state: "state",
|
|
@@ -4902,7 +5579,7 @@ function CompassCoverageCallout({
|
|
|
4902
5579
|
compassUrl,
|
|
4903
5580
|
onDismiss
|
|
4904
5581
|
}) {
|
|
4905
|
-
const [dismissed, setDismissed] = (0,
|
|
5582
|
+
const [dismissed, setDismissed] = (0, import_react29.useState)(false);
|
|
4906
5583
|
if (dismissed) return null;
|
|
4907
5584
|
const tierLabel = TIER_LABELS[tier] || tier;
|
|
4908
5585
|
const tierStyle = tierColors[tier] || tierColors.federal;
|
|
@@ -4953,15 +5630,15 @@ function CompassCoverageCallout({
|
|
|
4953
5630
|
setDismissed(true);
|
|
4954
5631
|
if (onDismiss) onDismiss();
|
|
4955
5632
|
};
|
|
4956
|
-
return /* @__PURE__ */
|
|
5633
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
4957
5634
|
"div",
|
|
4958
5635
|
{
|
|
4959
5636
|
className: "ev-compass-coverage-callout",
|
|
4960
5637
|
role: "status",
|
|
4961
5638
|
style: containerStyle2
|
|
4962
5639
|
},
|
|
4963
|
-
/* @__PURE__ */
|
|
4964
|
-
onDismiss !== void 0 && /* @__PURE__ */
|
|
5640
|
+
/* @__PURE__ */ import_react29.default.createElement("div", { style: textStyle }, /* @__PURE__ */ import_react29.default.createElement("div", { style: headlineStyle }, "Your compass covers ", tierLabel, " issues lightly"), /* @__PURE__ */ import_react29.default.createElement("div", null, count === 0 ? `None of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. ` : `Only ${count} of your ${totalSelected != null ? totalSelected : "selected"} compass topics apply at the ${tierLabel} level. `, "Add more ", tierLabel, "-applicable topics to get better comparisons with ", tierLabel, " officials."), /* @__PURE__ */ import_react29.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Add ", tierLabel, " topics \u2192")),
|
|
5641
|
+
onDismiss !== void 0 && /* @__PURE__ */ import_react29.default.createElement(
|
|
4965
5642
|
"button",
|
|
4966
5643
|
{
|
|
4967
5644
|
onClick: handleDismiss,
|
|
@@ -4974,7 +5651,7 @@ function CompassCoverageCallout({
|
|
|
4974
5651
|
}
|
|
4975
5652
|
|
|
4976
5653
|
// src/ExpandCompassNudge.jsx
|
|
4977
|
-
var
|
|
5654
|
+
var import_react30 = __toESM(require("react"));
|
|
4978
5655
|
function ExpandCompassNudge({
|
|
4979
5656
|
politicianName,
|
|
4980
5657
|
missingCount,
|
|
@@ -5021,7 +5698,7 @@ function ExpandCompassNudge({
|
|
|
5021
5698
|
};
|
|
5022
5699
|
const topicsLabel = missingCount === 1 ? "topic" : "topics";
|
|
5023
5700
|
const speakerName = politicianName || "This politician";
|
|
5024
|
-
return /* @__PURE__ */
|
|
5701
|
+
return /* @__PURE__ */ import_react30.default.createElement("div", { className: "ev-expand-compass-nudge", style: containerStyle2, role: "region" }, /* @__PURE__ */ import_react30.default.createElement("p", { style: headlineStyle }, "Want a richer comparison?"), /* @__PURE__ */ import_react30.default.createElement("p", { style: bodyStyle }, speakerName, " has stances on ", missingCount, " more ", topicsLabel, " you haven't answered yet. Expand your compass to see where you stand on all of them."), /* @__PURE__ */ import_react30.default.createElement("a", { href: compassUrl, style: ctaStyle }, "Expand my compass \u2192"));
|
|
5025
5702
|
}
|
|
5026
5703
|
|
|
5027
5704
|
// src/computeTierCoverage.js
|
|
@@ -5042,14 +5719,14 @@ function computeTierCoverage(topics) {
|
|
|
5042
5719
|
}
|
|
5043
5720
|
|
|
5044
5721
|
// src/StanceAccordion.jsx
|
|
5045
|
-
var
|
|
5722
|
+
var import_react32 = __toESM(require("react"));
|
|
5046
5723
|
|
|
5047
5724
|
// src/Favicon.jsx
|
|
5048
|
-
var
|
|
5725
|
+
var import_react31 = __toESM(require("react"));
|
|
5049
5726
|
function Favicon({ url, size = 16 }) {
|
|
5050
5727
|
try {
|
|
5051
5728
|
const domain = new URL(url).hostname;
|
|
5052
|
-
return /* @__PURE__ */
|
|
5729
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5053
5730
|
"img",
|
|
5054
5731
|
{
|
|
5055
5732
|
src: `https://www.google.com/s2/favicons?sz=${size}&domain=${domain}`,
|
|
@@ -5060,7 +5737,7 @@ function Favicon({ url, size = 16 }) {
|
|
|
5060
5737
|
}
|
|
5061
5738
|
);
|
|
5062
5739
|
} catch {
|
|
5063
|
-
return /* @__PURE__ */
|
|
5740
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5064
5741
|
"svg",
|
|
5065
5742
|
{
|
|
5066
5743
|
width: size,
|
|
@@ -5071,8 +5748,8 @@ function Favicon({ url, size = 16 }) {
|
|
|
5071
5748
|
strokeWidth: "1.5",
|
|
5072
5749
|
style: { verticalAlign: "middle", flexShrink: 0 }
|
|
5073
5750
|
},
|
|
5074
|
-
/* @__PURE__ */
|
|
5075
|
-
/* @__PURE__ */
|
|
5751
|
+
/* @__PURE__ */ import_react31.default.createElement("circle", { cx: "12", cy: "12", r: "10" }),
|
|
5752
|
+
/* @__PURE__ */ import_react31.default.createElement("path", { d: "M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
|
|
5076
5753
|
);
|
|
5077
5754
|
}
|
|
5078
5755
|
}
|
|
@@ -5103,11 +5780,11 @@ function StanceAccordion({
|
|
|
5103
5780
|
apiUrl = "https://api.empowered.vote"
|
|
5104
5781
|
}) {
|
|
5105
5782
|
var _a;
|
|
5106
|
-
const [expandedTopicId, setExpandedTopicId] = (0,
|
|
5107
|
-
const [loadingId, setLoadingId] = (0,
|
|
5108
|
-
const [showAll, setShowAll] = (0,
|
|
5109
|
-
const contextCache = (0,
|
|
5110
|
-
const quotesCache = (0,
|
|
5783
|
+
const [expandedTopicId, setExpandedTopicId] = (0, import_react32.useState)(null);
|
|
5784
|
+
const [loadingId, setLoadingId] = (0, import_react32.useState)(null);
|
|
5785
|
+
const [showAll, setShowAll] = (0, import_react32.useState)(false);
|
|
5786
|
+
const contextCache = (0, import_react32.useRef)(/* @__PURE__ */ new Map());
|
|
5787
|
+
const quotesCache = (0, import_react32.useRef)(null);
|
|
5111
5788
|
const polAnswerMap = {};
|
|
5112
5789
|
if (polAnswers) {
|
|
5113
5790
|
polAnswers.forEach((a) => {
|
|
@@ -5166,7 +5843,7 @@ function StanceAccordion({
|
|
|
5166
5843
|
quotesCache.current = [];
|
|
5167
5844
|
}
|
|
5168
5845
|
}
|
|
5169
|
-
const handleToggle = (0,
|
|
5846
|
+
const handleToggle = (0, import_react32.useCallback)(
|
|
5170
5847
|
async (topicId) => {
|
|
5171
5848
|
if (expandedTopicId === topicId) {
|
|
5172
5849
|
setExpandedTopicId(null);
|
|
@@ -5183,7 +5860,7 @@ function StanceAccordion({
|
|
|
5183
5860
|
},
|
|
5184
5861
|
[expandedTopicId, politicianId, apiUrl]
|
|
5185
5862
|
);
|
|
5186
|
-
(0,
|
|
5863
|
+
(0, import_react32.useEffect)(() => {
|
|
5187
5864
|
if (initialExpandedTopicId && topics && topics.length > 0) {
|
|
5188
5865
|
handleToggle(String(initialExpandedTopicId));
|
|
5189
5866
|
}
|
|
@@ -5199,13 +5876,13 @@ function StanceAccordion({
|
|
|
5199
5876
|
visibleTopics = [pinned, ...baseTopics.filter((t) => String(t.id) !== String(initialExpandedTopicId))];
|
|
5200
5877
|
}
|
|
5201
5878
|
}
|
|
5202
|
-
return /* @__PURE__ */
|
|
5879
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
5203
5880
|
"div",
|
|
5204
5881
|
{
|
|
5205
5882
|
className: "flex flex-col",
|
|
5206
5883
|
style: { fontFamily: "'Manrope', sans-serif" }
|
|
5207
5884
|
},
|
|
5208
|
-
/* @__PURE__ */
|
|
5885
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5209
5886
|
"h3",
|
|
5210
5887
|
{
|
|
5211
5888
|
className: "text-sm font-semibold text-neutral-400 uppercase tracking-wider mb-2",
|
|
@@ -5227,15 +5904,15 @@ function StanceAccordion({
|
|
|
5227
5904
|
if (topic.topic_key) return q.issue === topic.topic_key;
|
|
5228
5905
|
return topic.short_title && q.issue.toLowerCase() === topic.short_title.toLowerCase();
|
|
5229
5906
|
}) : [];
|
|
5230
|
-
return /* @__PURE__ */
|
|
5907
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", { key: topicId, className: "border-b border-neutral-100" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5231
5908
|
"button",
|
|
5232
5909
|
{
|
|
5233
5910
|
type: "button",
|
|
5234
5911
|
onClick: () => handleToggle(topicId),
|
|
5235
5912
|
className: "w-full flex items-center justify-between py-3 px-2 text-left cursor-pointer hover:bg-neutral-50 transition-colors"
|
|
5236
5913
|
},
|
|
5237
|
-
/* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5914
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { className: "flex flex-col min-w-0" }, /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-sm font-medium text-neutral-800 truncate" }, topic.short_title), questionText && /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-400 mt-0.5" }, questionText), /* @__PURE__ */ import_react32.default.createElement("span", { className: "text-xs text-neutral-500 mt-0.5" }, label)),
|
|
5915
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5239
5916
|
"svg",
|
|
5240
5917
|
{
|
|
5241
5918
|
width: "16",
|
|
@@ -5252,9 +5929,9 @@ function StanceAccordion({
|
|
|
5252
5929
|
transition: "transform 0.2s ease"
|
|
5253
5930
|
}
|
|
5254
5931
|
},
|
|
5255
|
-
/* @__PURE__ */
|
|
5932
|
+
/* @__PURE__ */ import_react32.default.createElement("polyline", { points: "9 18 15 12 9 6" })
|
|
5256
5933
|
)
|
|
5257
|
-
), /* @__PURE__ */
|
|
5934
|
+
), /* @__PURE__ */ import_react32.default.createElement(
|
|
5258
5935
|
"div",
|
|
5259
5936
|
{
|
|
5260
5937
|
style: {
|
|
@@ -5263,7 +5940,7 @@ function StanceAccordion({
|
|
|
5263
5940
|
transition: "grid-template-rows 0.25s ease"
|
|
5264
5941
|
}
|
|
5265
5942
|
},
|
|
5266
|
-
/* @__PURE__ */
|
|
5943
|
+
/* @__PURE__ */ import_react32.default.createElement("div", { style: { overflow: "hidden" } }, /* @__PURE__ */ import_react32.default.createElement("div", { className: "px-2 pb-4" }, isLoading && /* @__PURE__ */ import_react32.default.createElement("div", { className: "flex items-center py-3" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5267
5944
|
"div",
|
|
5268
5945
|
{
|
|
5269
5946
|
style: {
|
|
@@ -5275,14 +5952,14 @@ function StanceAccordion({
|
|
|
5275
5952
|
animation: "ev-spin 0.8s linear infinite"
|
|
5276
5953
|
}
|
|
5277
5954
|
}
|
|
5278
|
-
)), !isLoading && cached && /* @__PURE__ */
|
|
5955
|
+
)), !isLoading && cached && /* @__PURE__ */ import_react32.default.createElement(import_react32.default.Fragment, null, cached.reasoning ? /* @__PURE__ */ import_react32.default.createElement(
|
|
5279
5956
|
"p",
|
|
5280
5957
|
{
|
|
5281
5958
|
className: "text-sm text-neutral-700 mb-3",
|
|
5282
5959
|
style: { whiteSpace: "pre-wrap", lineHeight: 1.6 }
|
|
5283
5960
|
},
|
|
5284
5961
|
cached.reasoning
|
|
5285
|
-
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */
|
|
5962
|
+
) : null, cached.sources && cached.sources.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { className: "mt-2" }, /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-xs font-semibold text-neutral-500 uppercase tracking-wider mb-1.5" }, "References"), /* @__PURE__ */ import_react32.default.createElement("ol", { className: "list-decimal list-inside space-y-1" }, cached.sources.map((src, i) => /* @__PURE__ */ import_react32.default.createElement("li", { key: i, className: "text-xs text-neutral-600" }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5286
5963
|
"a",
|
|
5287
5964
|
{
|
|
5288
5965
|
href: src,
|
|
@@ -5290,9 +5967,9 @@ function StanceAccordion({
|
|
|
5290
5967
|
rel: "noreferrer",
|
|
5291
5968
|
className: "inline-flex items-center gap-1.5 hover:text-[#00657c] transition-colors"
|
|
5292
5969
|
},
|
|
5293
|
-
/* @__PURE__ */
|
|
5294
|
-
/* @__PURE__ */
|
|
5295
|
-
))))), topicQuotes.length > 0 && /* @__PURE__ */
|
|
5970
|
+
/* @__PURE__ */ import_react32.default.createElement(Favicon, { url: src }),
|
|
5971
|
+
/* @__PURE__ */ import_react32.default.createElement("span", { className: "underline underline-offset-2" }, getDisplayUrl(src))
|
|
5972
|
+
))))), topicQuotes.length > 0 && /* @__PURE__ */ import_react32.default.createElement("div", { style: { marginTop: "12px" } }, /* @__PURE__ */ import_react32.default.createElement(
|
|
5296
5973
|
"p",
|
|
5297
5974
|
{
|
|
5298
5975
|
style: {
|
|
@@ -5309,7 +5986,7 @@ function StanceAccordion({
|
|
|
5309
5986
|
const verdict = verdictsByQuote ? verdictsByQuote[quote.id] : void 0;
|
|
5310
5987
|
const borderColor = verdict === "agreed" ? "#0e7490" : verdict === "disagreed" ? "#b45309" : "#e2e8f0";
|
|
5311
5988
|
const sourceName = quote.source_name || quote.sourceName;
|
|
5312
|
-
return /* @__PURE__ */
|
|
5989
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
5313
5990
|
"div",
|
|
5314
5991
|
{
|
|
5315
5992
|
key: quote.id,
|
|
@@ -5321,7 +5998,7 @@ function StanceAccordion({
|
|
|
5321
5998
|
marginBottom: "8px"
|
|
5322
5999
|
}
|
|
5323
6000
|
},
|
|
5324
|
-
/* @__PURE__ */
|
|
6001
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
5325
6002
|
"p",
|
|
5326
6003
|
{
|
|
5327
6004
|
style: {
|
|
@@ -5334,7 +6011,7 @@ function StanceAccordion({
|
|
|
5334
6011
|
},
|
|
5335
6012
|
quote.text
|
|
5336
6013
|
),
|
|
5337
|
-
verdict === "agreed" && /* @__PURE__ */
|
|
6014
|
+
verdict === "agreed" && /* @__PURE__ */ import_react32.default.createElement(
|
|
5338
6015
|
"span",
|
|
5339
6016
|
{
|
|
5340
6017
|
style: {
|
|
@@ -5351,10 +6028,10 @@ function StanceAccordion({
|
|
|
5351
6028
|
flexShrink: 0
|
|
5352
6029
|
}
|
|
5353
6030
|
},
|
|
5354
|
-
/* @__PURE__ */
|
|
6031
|
+
/* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M5 13l4 4L19 7" })),
|
|
5355
6032
|
"Agreed"
|
|
5356
6033
|
),
|
|
5357
|
-
verdict === "disagreed" && /* @__PURE__ */
|
|
6034
|
+
verdict === "disagreed" && /* @__PURE__ */ import_react32.default.createElement(
|
|
5358
6035
|
"span",
|
|
5359
6036
|
{
|
|
5360
6037
|
style: {
|
|
@@ -5371,10 +6048,10 @@ function StanceAccordion({
|
|
|
5371
6048
|
flexShrink: 0
|
|
5372
6049
|
}
|
|
5373
6050
|
},
|
|
5374
|
-
/* @__PURE__ */
|
|
6051
|
+
/* @__PURE__ */ import_react32.default.createElement("svg", { width: "11", height: "11", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ import_react32.default.createElement("path", { d: "M6 18L18 6M6 6l12 12" })),
|
|
5375
6052
|
"Disagreed"
|
|
5376
6053
|
),
|
|
5377
|
-
sourceName && /* @__PURE__ */
|
|
6054
|
+
sourceName && /* @__PURE__ */ import_react32.default.createElement(
|
|
5378
6055
|
"a",
|
|
5379
6056
|
{
|
|
5380
6057
|
href: quote.source_url || quote.sourceUrl,
|
|
@@ -5391,10 +6068,10 @@ function StanceAccordion({
|
|
|
5391
6068
|
sourceName
|
|
5392
6069
|
)
|
|
5393
6070
|
);
|
|
5394
|
-
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */
|
|
6071
|
+
})), !cached.reasoning && (!cached.sources || cached.sources.length === 0) && topicQuotes.length === 0 && /* @__PURE__ */ import_react32.default.createElement("p", { className: "text-sm text-neutral-400 italic py-2" }, "No detailed reasoning available for this topic."))))
|
|
5395
6072
|
));
|
|
5396
6073
|
}),
|
|
5397
|
-
hasToggle && /* @__PURE__ */
|
|
6074
|
+
hasToggle && /* @__PURE__ */ import_react32.default.createElement(
|
|
5398
6075
|
"button",
|
|
5399
6076
|
{
|
|
5400
6077
|
type: "button",
|
|
@@ -5414,8 +6091,10 @@ function StanceAccordion({
|
|
|
5414
6091
|
CategorySection,
|
|
5415
6092
|
CommitteeTable,
|
|
5416
6093
|
CompassCardHorizontal,
|
|
6094
|
+
CompassCardVertical,
|
|
5417
6095
|
CompassCoverageCallout,
|
|
5418
6096
|
CompassIcon,
|
|
6097
|
+
CompassKey,
|
|
5419
6098
|
ExpandCompassNudge,
|
|
5420
6099
|
FilterSidebar,
|
|
5421
6100
|
GovernmentBodySection,
|
|
@@ -5445,6 +6124,7 @@ function StanceAccordion({
|
|
|
5445
6124
|
defaultNavItems,
|
|
5446
6125
|
duration,
|
|
5447
6126
|
easing,
|
|
6127
|
+
evContext,
|
|
5448
6128
|
focus,
|
|
5449
6129
|
fontSizes,
|
|
5450
6130
|
fontWeights,
|